Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions debian/control
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@ Depends:
rsync,
socat,
squashfs-tools,
util-linux (>= 2.39~),
xorriso,
${misc:Depends},
Recommends:
Expand Down
15 changes: 12 additions & 3 deletions grml-live
Original file line number Diff line number Diff line change
Expand Up @@ -150,9 +150,17 @@ else
fi
# }}}

# umount all directories {{{
# umount all directories beneath CHROOT_OUTPUT {{{
_UMOUNT_ALL_ATTEMPTED=""
umount_all() {
[ -n "$MIRROR_DIRECTORY" ] && umount "${CHROOT_OUTPUT}/${MIRROR_DIRECTORY}"
[ -n "${CHROOT_OUTPUT}" ] && [ -d "${CHROOT_OUTPUT}" ] || return 0
[ -z "${_UMOUNT_ALL_ATTEMPTED}" ] || return 0
_UMOUNT_ALL_ATTEMPTED=1
local mountpoint
while IFS= read -r mountpoint; do
einfo "Unmounting ${mountpoint} ..."
umount -R "${mountpoint}" ; eend $?

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

AFAICS we're now trying to unmount all mount points without taking care of any preference/ordering in mind, no matter whether it's a parent (/chroot/) or children (/chroot/proc/ + /chroot/sys/) directory, but we don't care?

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

i've reworked this to ignore the parent and umount all mountpoints inside CHROOT_DIRECTORY in reverse order. this might not always work, but it shouldn't be worse than before

done < <(findmnt -k -l -n -o TARGET | awk -v path="${CHROOT_OUTPUT%/}/" 'index($0, path) == 1' | sort -r)
}
# }}}

Expand Down Expand Up @@ -744,7 +752,8 @@ mkdir -p "$CHROOT_OUTPUT" || bailout 5 "Problem with creating $CHROOT_OUTPUT"

if [ -n "${MIRROR_DIRECTORY}" ] ; then
mkdir -p "${CHROOT_OUTPUT}/${MIRROR_DIRECTORY}"
mount --bind "${MIRROR_DIRECTORY}" "${CHROOT_OUTPUT}/${MIRROR_DIRECTORY}"
# -o rbind needs util-linux >= 2.39
mount -o rbind,ro=recursive "${MIRROR_DIRECTORY}" "${CHROOT_OUTPUT}/${MIRROR_DIRECTORY}" || bailout 5 "Failed to bind-mount ${MIRROR_DIRECTORY}"
Comment thread
zeha marked this conversation as resolved.
fi

log "Executed FAI command line:"
Expand Down