mirror of
https://git.launchpad.net/livecd-rootfs
synced 2025-03-31 04:41:18 +00:00
Merge make-rprivate-before-umount
This commit is contained in:
commit
8a78ab4021
@ -91,7 +91,7 @@ mount_image() {
|
|||||||
setup_mountpoint() {
|
setup_mountpoint() {
|
||||||
local mountpoint="$1"
|
local mountpoint="$1"
|
||||||
|
|
||||||
mount --rbind --make-rslave /dev "$mountpoint/dev"
|
mount --rbind /dev "$mountpoint/dev"
|
||||||
mount proc-live -t proc "$mountpoint/proc"
|
mount proc-live -t proc "$mountpoint/proc"
|
||||||
mount sysfs-live -t sysfs "$mountpoint/sys"
|
mount sysfs-live -t sysfs "$mountpoint/sys"
|
||||||
mount -t tmpfs none "$mountpoint/tmp"
|
mount -t tmpfs none "$mountpoint/tmp"
|
||||||
@ -112,6 +112,7 @@ teardown_mountpoint() {
|
|||||||
# sort -r ensures that deeper mountpoints are unmounted first
|
# sort -r ensures that deeper mountpoints are unmounted first
|
||||||
for submount in $(awk </proc/self/mounts "\$2 ~ /$mountpoint_match/ \
|
for submount in $(awk </proc/self/mounts "\$2 ~ /$mountpoint_match/ \
|
||||||
{ print \$2 }" | LC_ALL=C sort -r); do
|
{ print \$2 }" | LC_ALL=C sort -r); do
|
||||||
|
mount --make-private $submount
|
||||||
umount $submount
|
umount $submount
|
||||||
done
|
done
|
||||||
mv resolv.conf.tmp "$mountpoint/etc/resolv.conf"
|
mv resolv.conf.tmp "$mountpoint/etc/resolv.conf"
|
||||||
@ -179,7 +180,8 @@ EOF
|
|||||||
umount_partition() {
|
umount_partition() {
|
||||||
local mountpoint=${1}
|
local mountpoint=${1}
|
||||||
teardown_mountpoint $mountpoint
|
teardown_mountpoint $mountpoint
|
||||||
umount -R $mountpoint
|
mount --make-private $mountpoint
|
||||||
|
umount $mountpoint
|
||||||
udevadm settle
|
udevadm settle
|
||||||
|
|
||||||
if [ -n "${rootfs_dev_mapper}" -a -b "${rootfs_dev_mapper}" ]; then
|
if [ -n "${rootfs_dev_mapper}" -a -b "${rootfs_dev_mapper}" ]; then
|
||||||
@ -202,6 +204,7 @@ umount_disk_image() {
|
|||||||
# zero fill free space in UEFI partition
|
# zero fill free space in UEFI partition
|
||||||
cat < /dev/zero > "$mountpoint/boot/efi/bloat_file" 2> /dev/null || true
|
cat < /dev/zero > "$mountpoint/boot/efi/bloat_file" 2> /dev/null || true
|
||||||
rm "$mountpoint/boot/efi/bloat_file"
|
rm "$mountpoint/boot/efi/bloat_file"
|
||||||
|
mount --make-private "$mountpoint/boot/efi"
|
||||||
umount --detach-loop "$mountpoint/boot/efi"
|
umount --detach-loop "$mountpoint/boot/efi"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user