bootutils
bootutils copied to clipboard
remaster_iso_functions: add trap to umount chroot bind mounts
When running for chroot target, a number of dirs are mounted (with --bind option). If the user presses CTRL-C or the program abends for any reason during this phase,:
- Those directories remain mounted
- The extract dir cannot be removed because of those mounts
Solution:
- Setup a TRAP before entering the chroot
- Do a umount -f in the trap