Skip to content

Commit 1ae715d

Browse files
committed
[update] : Use umount.sh
1 parent 8636fe7 commit 1ae715d

File tree

1 file changed

+3
-13
lines changed

1 file changed

+3
-13
lines changed

build.sh

Lines changed: 3 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -173,19 +173,9 @@ _mount() { ! mountpoint -q "${2}" && [[ -f "${1}" ]] && [[ -d "${2}" ]] && mount
173173

174174
# Unmount work dir
175175
umount_work () {
176-
local _mount
177-
if [[ ! -v "build_dir" ]] || [[ "${build_dir}" = "" ]]; then
178-
msg_error "Exception error about working directory" 1
179-
fi
180-
[[ ! -d "${build_dir}" ]] && return 0
181-
for _mount in $(find "${build_dir}" -mindepth 1 -type d -printf "%p\0" | xargs -0 -I{} bash -c "mountpoint -q {} && echo {}" | tac); do
182-
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
183-
msg_info "Unmounting ${_mount}"
184-
_umount "${_mount}" 2> /dev/null
185-
else
186-
msg_error "It is dangerous to unmount a directory that is not managed by the script."
187-
fi
188-
done
176+
local _args=("${build_dir}")
177+
[[ "${debug}" = true ]] && _args=("-d" "${_args[@]}")
178+
"${tools_dir}/umount.sh" "${_args[@]}"
189179
}
190180

191181
# Mount airootfs on "${airootfs_dir}"

0 commit comments

Comments
 (0)