auto/build: use setup|teardown_mountpoint to reduce duplication

(cherry picked from commit 109e6c6613)
uc20-no-fixed-size
Dimitri John Ledkov 4 years ago
parent e2ae9c245d
commit 2be2852ee0
No known key found for this signature in database
GPG Key ID: 9B8EC849D5EF70ED

@ -106,33 +106,17 @@ fi
Setup_cleanup Setup_cleanup
preinstall_snaps() { preinstall_snaps() {
lb chroot_resolv install setup_mountpoint chroot
snap_prepare chroot snap_prepare chroot
for snap in "$@"; do for snap in "$@"; do
SNAP_NO_VALIDATE_SEED=1 snap_preseed chroot "${snap}" SNAP_NO_VALIDATE_SEED=1 snap_preseed chroot "${snap}"
done done
if [ ! -c /dev/mem ]; then
mknod -m 660 /dev/mem c 1 1
chown root:kmem /dev/mem
fi
mount --rbind /dev chroot/dev
mount --bind /sys chroot/sys
mount --bind /sys/kernel/security chroot/sys/kernel/security
mount --bind /proc chroot/proc
# Provide more up to date apparmor features, matching target kernel
mount -o bind /usr/share/livecd-rootfs/live-build/apparmor/generic chroot/sys/kernel/security/apparmor/features
mount -o bind /usr/share/livecd-rootfs/live-build/seccomp/generic.actions_avail chroot/proc/sys/kernel/seccomp/actions_avail
snap_validate_seed chroot snap_validate_seed chroot
umount --recursive chroot/proc teardown_mountpoint chroot
umount --recursive chroot/sys
umount --recursive chroot/dev
lb chroot_resolv remove
} }
rm -f binary.success rm -f binary.success

Loading…
Cancel
Save