Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix unmount devices when scrpit chroot #2

Closed
wants to merge 1 commit into from

Conversation

luxifer
Copy link

@luxifer luxifer commented Dec 21, 2018

When the chroot destination is a folder and this folder is already a
mounted partition (ie: a loop mount of an fs file to create a rootfs),
if the install script is run chrooted (--script-chroot), than at the end
of the execution of the install script we try to unmount recursively
everything that is mounted in the destination folder AND the
destination, which will cause the end of this script to fail.

The solution I am proposing is to create another bash function to
unmount only required devices for the chroot (/proc, /dev and /sys).

When the chroot destination is a folder and this folder is already a
mounted partition (ie: a loop mount of an fs file to create a rootfs),
if the install script is run chrooted (--script-chroot), than at the end
of the execution of the install script we try to unmount recursively
everything that is mounted in the destination folder AND the
destination, which will cause the end of this script to fail.

The solution I am proposing is to create another bash function to
unmount only required devices for the chroot (/proc, /dev and /sys).
@jirutka
Copy link
Member

jirutka commented Jan 11, 2019

The function umount_recursively is here for a purpose. I used to use the way you propose and it doesn’t work with nested mounts that are usually present in /proc.

Please open an issue and describe precisely your setup and what doesn’t work.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants