Skip to content

Commit 2e21974

Browse files
committed
[fix] : Use saver unmounting in clean.sh
1 parent 1d650fc commit 2e21974

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

tools/clean.sh

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -97,7 +97,8 @@ umount_chroot () {
9797
if [[ ! -d "${work_dir}" ]]; then
9898
return 0
9999
fi
100-
for _mount in $(cat "/proc/mounts" | getclm 2 | grep "$(realpath -s ${work_dir})" | tac | grep -xv "$(realpath -s "${work_dir}")"); do
100+
#for _mount in $(cat "/proc/mounts" | getclm 2 | grep "$(realpath -s ${build_dir})" | tac | grep -xv "$(realpath -s ${airootfs_dir})"); do
101+
for _mount in $(find "${build_dir}" -mindepth 1 -type d -printf "%p\0" | xargs -0 -I{} bash -c "mountpoint -q {} && echo {}" | tac | grep -xv "$(realpath -s ${airootfs_dir})"); do
101102
if echo "${_mount}" | grep "${work_dir}" > /dev/null 2>&1 || echo "${_mount}" | grep "${script_path}" > /dev/null 2>&1 || echo "${_mount}" | grep "${out_dir}" > /dev/null 2>&1; then
102103
msg_info "Unmounting ${_mount}"
103104
_umount "${_mount}" 2> /dev/null

0 commit comments

Comments
 (0)