mirror of
https://git.launchpad.net/livecd-rootfs
synced 2025-02-22 02:41:12 +00:00
live-build/ubuntu-cpc/functions: Add teardown_mountpoint to reverse setup_mountpoint
* live-build/ubuntu-cpc/functions: Add a function, teardown_mountpoint, to reverse the work done in setup_mountpoint. Lack of this function has forced users of setup_mountpoint to implement this separately and the implementations have diverged. (LP: #1716992) * live-build/ubuntu-cpc/functions: Remove umount_settle function. The was only used where teardown_mountpoint was lacking.
This commit is contained in:
parent
8589d3548f
commit
83b4f5338c
9
debian/changelog
vendored
9
debian/changelog
vendored
@ -1,5 +1,14 @@
|
||||
livecd-rootfs (2.454) UNRELEASED; urgency=medium
|
||||
|
||||
[ Robert C Jennings ]
|
||||
* live-build/ubuntu-cpc/functions: Add a function, teardown_mountpoint,
|
||||
to reverse the work done in setup_mountpoint. Lack of this function
|
||||
has forced users of setup_mountpoint to implement this separately
|
||||
and the implementations have diverged. (LP: #1716992)
|
||||
* live-build/ubuntu-cpc/functions: Remove umount_settle function.
|
||||
The was only used where teardown_mountpoint was lacking.
|
||||
|
||||
[ Steve Langasek ]
|
||||
* live-build/functions: mount tmpfs on /var/cache/apt and var/lib/apt, so
|
||||
we don't have to leave empty space in our derivative images for packages
|
||||
that have been downloaded/installed/removed. This normally isn't
|
||||
|
@ -91,6 +91,21 @@ setup_mountpoint() {
|
||||
|
||||
}
|
||||
|
||||
teardown_mountpoint() {
|
||||
# Reverse the operations from setup_mountpoint
|
||||
local mountpoint="$1"
|
||||
|
||||
umount "$mountpoint/var/cache/apt"
|
||||
umount "$mountpoint/var/lib/apt"
|
||||
umount "$mountpoint/tmp"
|
||||
umount "$mountpoint/sys"
|
||||
umount "$mountpoint/proc"
|
||||
umount -R "$mountpoint/dev"
|
||||
udevadm settle
|
||||
sleep 3
|
||||
mv resolv.conf.tmp "$mountpoint/etc/resolv.conf"
|
||||
}
|
||||
|
||||
mount_partition() {
|
||||
partition="$1"
|
||||
mountpoint="$2"
|
||||
@ -134,16 +149,9 @@ EOF
|
||||
|
||||
}
|
||||
|
||||
umount_settle() {
|
||||
# Unmount device, and let it settle
|
||||
umount $1
|
||||
udevadm settle
|
||||
}
|
||||
|
||||
umount_partition() {
|
||||
local mountpoint=${1}
|
||||
mv resolv.conf.tmp "$mountpoint/etc/resolv.conf"
|
||||
umount -R $mountpoint
|
||||
teardown_mountpoint $mountpoint
|
||||
udevadm settle
|
||||
|
||||
if [ -n "${rootfs_dev_mapper}" -a -b "${rootfs_dev_mapper}" ]; then
|
||||
|
@ -36,13 +36,7 @@ chroot binary/boot/squashfs.dir mkdir /lib/modules
|
||||
chroot binary/boot/squashfs.dir rm /usr/sbin/grub-probe
|
||||
chroot binary/boot/squashfs.dir dpkg-divert --remove --local --rename /usr/sbin/grub-probe
|
||||
|
||||
mv resolv.conf.tmp "binary/boot/squashfs.dir/etc/resolv.conf"
|
||||
umount "binary/boot/squashfs.dir/proc"
|
||||
umount "binary/boot/squashfs.dir/sys"
|
||||
umount -R "binary/boot/squashfs.dir/dev"
|
||||
umount "binary/boot/squashfs.dir/tmp"
|
||||
umount "binary/boot/squashfs.dir/var/lib/apt"
|
||||
umount "binary/boot/squashfs.dir/var/cache/apt"
|
||||
teardown_mountpoint binary/boot/squashfs.dir
|
||||
|
||||
squashfs_f="${PWD}/livecd.ubuntu-cpc.squashfs"
|
||||
squashfs_f_manifest="${squashfs_f}.manifest"
|
||||
|
Loading…
x
Reference in New Issue
Block a user