From 81ea1e273f182313bc0310cad2b435ba65d2aa41 Mon Sep 17 00:00:00 2001 From: CloudBuilder Date: Thu, 3 Dec 2020 13:44:06 +0000 Subject: [PATCH] Imported 2.664.8 No reason for CPC update specified. --- debian/changelog | 24 ++++++ live-build/apparmor/generic.features | 78 +++++++++++++++++++ live-build/apparmor/generic/capability | 1 + live-build/apparmor/generic/caps/mask | 1 + live-build/apparmor/generic/dbus/mask | 1 + .../generic/domain/attach_conditions/xattr | 1 + live-build/apparmor/generic/domain/change_hat | 1 + .../apparmor/generic/domain/change_hatv | 1 + .../apparmor/generic/domain/change_onexec | 1 + .../apparmor/generic/domain/change_profile | 1 + .../generic/domain/computed_longest_left | 1 + .../generic/domain/fix_binfmt_elf_mmap | 1 + .../apparmor/generic/domain/post_nnp_subset | 1 + live-build/apparmor/generic/domain/stack | 1 + live-build/apparmor/generic/domain/version | 1 + live-build/apparmor/generic/file/mask | 1 + live-build/apparmor/generic/mount/mask | 1 + .../apparmor/generic/namespaces/pivot_root | 1 + .../apparmor/generic/namespaces/profile | 1 + live-build/apparmor/generic/network/af_mask | 1 + live-build/apparmor/generic/network/af_unix | 1 + .../apparmor/generic/network_v8/af_mask | 1 + live-build/apparmor/generic/policy/set_load | 1 + .../apparmor/generic/policy/versions/v5 | 1 + .../apparmor/generic/policy/versions/v6 | 1 + .../apparmor/generic/policy/versions/v7 | 1 + .../apparmor/generic/policy/versions/v8 | 1 + live-build/apparmor/generic/ptrace/mask | 1 + live-build/apparmor/generic/query/label/data | 1 + .../generic/query/label/multi_transaction | 1 + live-build/apparmor/generic/query/label/perms | 1 + live-build/apparmor/generic/rlimit/mask | 1 + live-build/apparmor/generic/signal/mask | 1 + live-build/auto/build | 7 +- live-build/auto/config | 3 +- live-build/functions | 15 ++++ live-build/seccomp/generic.actions_avail | 1 + .../hooks.d/base/disk-image-ppc64el.binary | 1 - .../hooks.d/base/disk-image-uefi.binary | 4 +- .../ubuntu-cpc/hooks.d/base/disk-image.binary | 1 - live-build/ubuntu-cpc/hooks.d/base/wsl.binary | 1 - .../hooks/032-installer-squashfs.binary | 9 ++- 42 files changed, 164 insertions(+), 11 deletions(-) create mode 100644 live-build/apparmor/generic.features create mode 100644 live-build/apparmor/generic/capability create mode 100644 live-build/apparmor/generic/caps/mask create mode 100644 live-build/apparmor/generic/dbus/mask create mode 100644 live-build/apparmor/generic/domain/attach_conditions/xattr create mode 100644 live-build/apparmor/generic/domain/change_hat create mode 100644 live-build/apparmor/generic/domain/change_hatv create mode 100644 live-build/apparmor/generic/domain/change_onexec create mode 100644 live-build/apparmor/generic/domain/change_profile create mode 100644 live-build/apparmor/generic/domain/computed_longest_left create mode 100644 live-build/apparmor/generic/domain/fix_binfmt_elf_mmap create mode 100644 live-build/apparmor/generic/domain/post_nnp_subset create mode 100644 live-build/apparmor/generic/domain/stack create mode 100644 live-build/apparmor/generic/domain/version create mode 100644 live-build/apparmor/generic/file/mask create mode 100644 live-build/apparmor/generic/mount/mask create mode 100644 live-build/apparmor/generic/namespaces/pivot_root create mode 100644 live-build/apparmor/generic/namespaces/profile create mode 100644 live-build/apparmor/generic/network/af_mask create mode 100644 live-build/apparmor/generic/network/af_unix create mode 100644 live-build/apparmor/generic/network_v8/af_mask create mode 100644 live-build/apparmor/generic/policy/set_load create mode 100644 live-build/apparmor/generic/policy/versions/v5 create mode 100644 live-build/apparmor/generic/policy/versions/v6 create mode 100644 live-build/apparmor/generic/policy/versions/v7 create mode 100644 live-build/apparmor/generic/policy/versions/v8 create mode 100644 live-build/apparmor/generic/ptrace/mask create mode 100644 live-build/apparmor/generic/query/label/data create mode 100644 live-build/apparmor/generic/query/label/multi_transaction create mode 100644 live-build/apparmor/generic/query/label/perms create mode 100644 live-build/apparmor/generic/rlimit/mask create mode 100644 live-build/apparmor/generic/signal/mask create mode 100644 live-build/seccomp/generic.actions_avail diff --git a/debian/changelog b/debian/changelog index c8f9ba23..4d1865fd 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,3 +1,27 @@ +livecd-rootfs (2.664.8) focal; urgency=medium + + Backport snap-preseed work from groovy to focal LP: #1896755 + + [ Robert C Jennings ] + * Apply snap-preseed optimizations after seeding snaps + + [ Dimitri John Ledkov ] + * live-server: remove duplicate snaps, due to overlayfs vs snap-preseed. + * apparmor: Add generic v5.4 kernel apparmor features + * apparmor: mount more up-to-date apparmor features in the chroot. + * seccomp: add more up-to-date seccomp actions + * seccomp: mount more up-to-date seccomp features + * apparmor: compile all profiles + + [ Robert C Jennings ] + * Avoid rbind /sys for chroot snap pre-seeding (cgroups fail to unmount) + + [ Dimitri John Ledkov ] + * auto/build: use setup|teardown_mountpoint to reduce duplication + * functions: provide nss_systemd-less nsswitch.conf in chroots. + + -- Dimitri John Ledkov Mon, 05 Oct 2020 10:33:02 +0100 + livecd-rootfs (2.664.7) focal; urgency=medium [ Stanislav German-Evtushenko / John Chittum ] diff --git a/live-build/apparmor/generic.features b/live-build/apparmor/generic.features new file mode 100644 index 00000000..9f272e6a --- /dev/null +++ b/live-build/apparmor/generic.features @@ -0,0 +1,78 @@ +query {label {multi_transaction {yes +} +data {yes +} +perms {allow deny audit quiet +} +} +} +dbus {mask {acquire send receive +} +} +signal {mask {hup int quit ill trap abrt bus fpe kill usr1 segv usr2 pipe alrm term stkflt chld cont stop stp ttin ttou urg xcpu xfsz vtalrm prof winch io pwr sys emt lost +} +} +ptrace {mask {read trace +} +} +caps {mask {chown dac_override dac_read_search fowner fsetid kill setgid setuid setpcap linux_immutable net_bind_service net_broadcast net_admin net_raw ipc_lock ipc_owner sys_module sys_rawio sys_chroot sys_ptrace sys_pacct sys_admin sys_boot sys_nice sys_resource sys_time sys_tty_config mknod lease audit_write audit_control setfcap mac_override mac_admin syslog wake_alarm block_suspend audit_read +} +} +rlimit {mask {cpu fsize data stack core rss nproc nofile memlock as locks sigpending msgqueue nice rtprio rttime +} +} +capability {0xffffff +} +namespaces {pivot_root {no +} +profile {yes +} +} +mount {mask {mount umount pivot_root +} +} +network {af_unix {yes +} +af_mask {unspec unix inet ax25 ipx appletalk netrom bridge atmpvc x25 inet6 rose netbeui security key netlink packet ash econet atmsvc rds sna irda pppox wanpipe llc ib mpls can tipc bluetooth iucv rxrpc isdn phonet ieee802154 caif alg nfc vsock kcm qipcrtr smc xdp +} +} +network_v8 {af_mask {unspec unix inet ax25 ipx appletalk netrom bridge atmpvc x25 inet6 rose netbeui security key netlink packet ash econet atmsvc rds sna irda pppox wanpipe llc ib mpls can tipc bluetooth iucv rxrpc isdn phonet ieee802154 caif alg nfc vsock kcm qipcrtr smc xdp +} +} +file {mask {create read write exec append mmap_exec link lock +} +} +domain {version {1.2 +} +attach_conditions {xattr {yes +} +} +computed_longest_left {yes +} +post_nnp_subset {yes +} +fix_binfmt_elf_mmap {yes +} +stack {yes +} +change_profile {yes +} +change_onexec {yes +} +change_hatv {yes +} +change_hat {yes +} +} +policy {set_load {yes +} +versions {v8 {yes +} +v7 {yes +} +v6 {yes +} +v5 {yes +} +} +} diff --git a/live-build/apparmor/generic/capability b/live-build/apparmor/generic/capability new file mode 100644 index 00000000..96a10b97 --- /dev/null +++ b/live-build/apparmor/generic/capability @@ -0,0 +1 @@ +0xffffff diff --git a/live-build/apparmor/generic/caps/mask b/live-build/apparmor/generic/caps/mask new file mode 100644 index 00000000..1a8d13ec --- /dev/null +++ b/live-build/apparmor/generic/caps/mask @@ -0,0 +1 @@ +chown dac_override dac_read_search fowner fsetid kill setgid setuid setpcap linux_immutable net_bind_service net_broadcast net_admin net_raw ipc_lock ipc_owner sys_module sys_rawio sys_chroot sys_ptrace sys_pacct sys_admin sys_boot sys_nice sys_resource sys_time sys_tty_config mknod lease audit_write audit_control setfcap mac_override mac_admin syslog wake_alarm block_suspend audit_read diff --git a/live-build/apparmor/generic/dbus/mask b/live-build/apparmor/generic/dbus/mask new file mode 100644 index 00000000..1248078e --- /dev/null +++ b/live-build/apparmor/generic/dbus/mask @@ -0,0 +1 @@ +acquire send receive diff --git a/live-build/apparmor/generic/domain/attach_conditions/xattr b/live-build/apparmor/generic/domain/attach_conditions/xattr new file mode 100644 index 00000000..7cfab5b0 --- /dev/null +++ b/live-build/apparmor/generic/domain/attach_conditions/xattr @@ -0,0 +1 @@ +yes diff --git a/live-build/apparmor/generic/domain/change_hat b/live-build/apparmor/generic/domain/change_hat new file mode 100644 index 00000000..7cfab5b0 --- /dev/null +++ b/live-build/apparmor/generic/domain/change_hat @@ -0,0 +1 @@ +yes diff --git a/live-build/apparmor/generic/domain/change_hatv b/live-build/apparmor/generic/domain/change_hatv new file mode 100644 index 00000000..7cfab5b0 --- /dev/null +++ b/live-build/apparmor/generic/domain/change_hatv @@ -0,0 +1 @@ +yes diff --git a/live-build/apparmor/generic/domain/change_onexec b/live-build/apparmor/generic/domain/change_onexec new file mode 100644 index 00000000..7cfab5b0 --- /dev/null +++ b/live-build/apparmor/generic/domain/change_onexec @@ -0,0 +1 @@ +yes diff --git a/live-build/apparmor/generic/domain/change_profile b/live-build/apparmor/generic/domain/change_profile new file mode 100644 index 00000000..7cfab5b0 --- /dev/null +++ b/live-build/apparmor/generic/domain/change_profile @@ -0,0 +1 @@ +yes diff --git a/live-build/apparmor/generic/domain/computed_longest_left b/live-build/apparmor/generic/domain/computed_longest_left new file mode 100644 index 00000000..7cfab5b0 --- /dev/null +++ b/live-build/apparmor/generic/domain/computed_longest_left @@ -0,0 +1 @@ +yes diff --git a/live-build/apparmor/generic/domain/fix_binfmt_elf_mmap b/live-build/apparmor/generic/domain/fix_binfmt_elf_mmap new file mode 100644 index 00000000..7cfab5b0 --- /dev/null +++ b/live-build/apparmor/generic/domain/fix_binfmt_elf_mmap @@ -0,0 +1 @@ +yes diff --git a/live-build/apparmor/generic/domain/post_nnp_subset b/live-build/apparmor/generic/domain/post_nnp_subset new file mode 100644 index 00000000..7cfab5b0 --- /dev/null +++ b/live-build/apparmor/generic/domain/post_nnp_subset @@ -0,0 +1 @@ +yes diff --git a/live-build/apparmor/generic/domain/stack b/live-build/apparmor/generic/domain/stack new file mode 100644 index 00000000..7cfab5b0 --- /dev/null +++ b/live-build/apparmor/generic/domain/stack @@ -0,0 +1 @@ +yes diff --git a/live-build/apparmor/generic/domain/version b/live-build/apparmor/generic/domain/version new file mode 100644 index 00000000..5625e59d --- /dev/null +++ b/live-build/apparmor/generic/domain/version @@ -0,0 +1 @@ +1.2 diff --git a/live-build/apparmor/generic/file/mask b/live-build/apparmor/generic/file/mask new file mode 100644 index 00000000..087b6771 --- /dev/null +++ b/live-build/apparmor/generic/file/mask @@ -0,0 +1 @@ +create read write exec append mmap_exec link lock diff --git a/live-build/apparmor/generic/mount/mask b/live-build/apparmor/generic/mount/mask new file mode 100644 index 00000000..652c8796 --- /dev/null +++ b/live-build/apparmor/generic/mount/mask @@ -0,0 +1 @@ +mount umount pivot_root diff --git a/live-build/apparmor/generic/namespaces/pivot_root b/live-build/apparmor/generic/namespaces/pivot_root new file mode 100644 index 00000000..7ecb56eb --- /dev/null +++ b/live-build/apparmor/generic/namespaces/pivot_root @@ -0,0 +1 @@ +no diff --git a/live-build/apparmor/generic/namespaces/profile b/live-build/apparmor/generic/namespaces/profile new file mode 100644 index 00000000..7cfab5b0 --- /dev/null +++ b/live-build/apparmor/generic/namespaces/profile @@ -0,0 +1 @@ +yes diff --git a/live-build/apparmor/generic/network/af_mask b/live-build/apparmor/generic/network/af_mask new file mode 100644 index 00000000..503289e7 --- /dev/null +++ b/live-build/apparmor/generic/network/af_mask @@ -0,0 +1 @@ +unspec unix inet ax25 ipx appletalk netrom bridge atmpvc x25 inet6 rose netbeui security key netlink packet ash econet atmsvc rds sna irda pppox wanpipe llc ib mpls can tipc bluetooth iucv rxrpc isdn phonet ieee802154 caif alg nfc vsock kcm qipcrtr smc xdp diff --git a/live-build/apparmor/generic/network/af_unix b/live-build/apparmor/generic/network/af_unix new file mode 100644 index 00000000..7cfab5b0 --- /dev/null +++ b/live-build/apparmor/generic/network/af_unix @@ -0,0 +1 @@ +yes diff --git a/live-build/apparmor/generic/network_v8/af_mask b/live-build/apparmor/generic/network_v8/af_mask new file mode 100644 index 00000000..503289e7 --- /dev/null +++ b/live-build/apparmor/generic/network_v8/af_mask @@ -0,0 +1 @@ +unspec unix inet ax25 ipx appletalk netrom bridge atmpvc x25 inet6 rose netbeui security key netlink packet ash econet atmsvc rds sna irda pppox wanpipe llc ib mpls can tipc bluetooth iucv rxrpc isdn phonet ieee802154 caif alg nfc vsock kcm qipcrtr smc xdp diff --git a/live-build/apparmor/generic/policy/set_load b/live-build/apparmor/generic/policy/set_load new file mode 100644 index 00000000..7cfab5b0 --- /dev/null +++ b/live-build/apparmor/generic/policy/set_load @@ -0,0 +1 @@ +yes diff --git a/live-build/apparmor/generic/policy/versions/v5 b/live-build/apparmor/generic/policy/versions/v5 new file mode 100644 index 00000000..7cfab5b0 --- /dev/null +++ b/live-build/apparmor/generic/policy/versions/v5 @@ -0,0 +1 @@ +yes diff --git a/live-build/apparmor/generic/policy/versions/v6 b/live-build/apparmor/generic/policy/versions/v6 new file mode 100644 index 00000000..7cfab5b0 --- /dev/null +++ b/live-build/apparmor/generic/policy/versions/v6 @@ -0,0 +1 @@ +yes diff --git a/live-build/apparmor/generic/policy/versions/v7 b/live-build/apparmor/generic/policy/versions/v7 new file mode 100644 index 00000000..7cfab5b0 --- /dev/null +++ b/live-build/apparmor/generic/policy/versions/v7 @@ -0,0 +1 @@ +yes diff --git a/live-build/apparmor/generic/policy/versions/v8 b/live-build/apparmor/generic/policy/versions/v8 new file mode 100644 index 00000000..7cfab5b0 --- /dev/null +++ b/live-build/apparmor/generic/policy/versions/v8 @@ -0,0 +1 @@ +yes diff --git a/live-build/apparmor/generic/ptrace/mask b/live-build/apparmor/generic/ptrace/mask new file mode 100644 index 00000000..10fc201a --- /dev/null +++ b/live-build/apparmor/generic/ptrace/mask @@ -0,0 +1 @@ +read trace diff --git a/live-build/apparmor/generic/query/label/data b/live-build/apparmor/generic/query/label/data new file mode 100644 index 00000000..7cfab5b0 --- /dev/null +++ b/live-build/apparmor/generic/query/label/data @@ -0,0 +1 @@ +yes diff --git a/live-build/apparmor/generic/query/label/multi_transaction b/live-build/apparmor/generic/query/label/multi_transaction new file mode 100644 index 00000000..7cfab5b0 --- /dev/null +++ b/live-build/apparmor/generic/query/label/multi_transaction @@ -0,0 +1 @@ +yes diff --git a/live-build/apparmor/generic/query/label/perms b/live-build/apparmor/generic/query/label/perms new file mode 100644 index 00000000..71685cbf --- /dev/null +++ b/live-build/apparmor/generic/query/label/perms @@ -0,0 +1 @@ +allow deny audit quiet diff --git a/live-build/apparmor/generic/rlimit/mask b/live-build/apparmor/generic/rlimit/mask new file mode 100644 index 00000000..c305a7d2 --- /dev/null +++ b/live-build/apparmor/generic/rlimit/mask @@ -0,0 +1 @@ +cpu fsize data stack core rss nproc nofile memlock as locks sigpending msgqueue nice rtprio rttime diff --git a/live-build/apparmor/generic/signal/mask b/live-build/apparmor/generic/signal/mask new file mode 100644 index 00000000..9eb55a04 --- /dev/null +++ b/live-build/apparmor/generic/signal/mask @@ -0,0 +1 @@ +hup int quit ill trap abrt bus fpe kill usr1 segv usr2 pipe alrm term stkflt chld cont stop stp ttin ttou urg xcpu xfsz vtalrm prof winch io pwr sys emt lost diff --git a/live-build/auto/build b/live-build/auto/build index 3c8f76fe..12b96a5b 100755 --- a/live-build/auto/build +++ b/live-build/auto/build @@ -106,14 +106,17 @@ fi Setup_cleanup preinstall_snaps() { - lb chroot_resolv install + setup_mountpoint chroot + snap_prepare chroot for snap in "$@"; do SNAP_NO_VALIDATE_SEED=1 snap_preseed chroot "${snap}" done + snap_validate_seed chroot - lb chroot_resolv remove + + teardown_mountpoint chroot } rm -f binary.success diff --git a/live-build/auto/config b/live-build/auto/config index a3f1e2c0..761dd429 100755 --- a/live-build/auto/config +++ b/live-build/auto/config @@ -775,7 +775,8 @@ case $PROJECT in add_package install grub-pc ;; amd64) - add_package install grub-pc + add_package install grub-pc-bin + add_package install grub-efi-amd64-signed add_package install shim-signed ;; esac diff --git a/live-build/functions b/live-build/functions index 2e505949..17e42cd7 100644 --- a/live-build/functions +++ b/live-build/functions @@ -96,14 +96,25 @@ mount_image() { setup_mountpoint() { local mountpoint="$1" + if [ ! -c /dev/mem ]; then + mknod -m 660 /dev/mem c 1 1 + chown root:kmem /dev/mem + fi + mount --rbind /dev "$mountpoint/dev" mount proc-live -t proc "$mountpoint/proc" mount sysfs-live -t sysfs "$mountpoint/sys" + mount securityfs -t securityfs "$mountpoint/sys/kernel/security" + # Provide more up to date apparmor features, matching target kernel + mount -o bind /usr/share/livecd-rootfs/live-build/apparmor/generic "$mountpoint/sys/kernel/security/apparmor/features/" + mount -o bind /usr/share/livecd-rootfs/live-build/seccomp/generic.actions_avail "$mountpoint/proc/sys/kernel/seccomp/actions_avail" mount -t tmpfs none "$mountpoint/tmp" mount -t tmpfs none "$mountpoint/var/lib/apt" mount -t tmpfs none "$mountpoint/var/cache/apt" mv "$mountpoint/etc/resolv.conf" resolv.conf.tmp cp /etc/resolv.conf "$mountpoint/etc/resolv.conf" + mv "$mountpoint/etc/nsswitch.conf" nsswitch.conf.tmp + sed 's/systemd//g' nsswitch.conf.tmp > "$mountpoint/etc/nsswitch.conf" chroot "$mountpoint" apt-get update } @@ -121,6 +132,7 @@ teardown_mountpoint() { umount $submount done mv resolv.conf.tmp "$mountpoint/etc/resolv.conf" + mv nsswitch.conf.tmp "$mountpoint/etc/nsswitch.conf" } mount_partition() { @@ -682,6 +694,9 @@ snap_validate_seed() { if [ -e "${CHROOT_ROOT}/var/lib/snapd/seed/seed.yaml" ]; then snap debug validate-seed "${CHROOT_ROOT}/var/lib/snapd/seed/seed.yaml" + /usr/lib/snapd/snap-preseed --reset $(realpath "${CHROOT_ROOT}") + /usr/lib/snapd/snap-preseed $(realpath "${CHROOT_ROOT}") + chroot "${CHROOT_ROOT}" apparmor_parser --skip-read-cache --write-cache --skip-kernel-load --verbose -j `nproc` /etc/apparmor.d fi } diff --git a/live-build/seccomp/generic.actions_avail b/live-build/seccomp/generic.actions_avail new file mode 100644 index 00000000..a608f9fd --- /dev/null +++ b/live-build/seccomp/generic.actions_avail @@ -0,0 +1 @@ +kill_process kill_thread trap errno user_notif trace log allow diff --git a/live-build/ubuntu-cpc/hooks.d/base/disk-image-ppc64el.binary b/live-build/ubuntu-cpc/hooks.d/base/disk-image-ppc64el.binary index dc87a361..77f24e7e 100755 --- a/live-build/ubuntu-cpc/hooks.d/base/disk-image-ppc64el.binary +++ b/live-build/ubuntu-cpc/hooks.d/base/disk-image-ppc64el.binary @@ -33,7 +33,6 @@ install_grub() { chroot mountpoint apt-get -qqy update chroot mountpoint apt-get -qqy install grub-ieee1275 chroot mountpoint apt-get -qqy remove --purge grub-legacy-ec2 - chroot mountpoint apt-get autoremove --purge --assume-yes # set the kernel commandline to use hvc0 mkdir -p mountpoint/etc/default/grub.d diff --git a/live-build/ubuntu-cpc/hooks.d/base/disk-image-uefi.binary b/live-build/ubuntu-cpc/hooks.d/base/disk-image-uefi.binary index 4bb4ba13..98c08f81 100755 --- a/live-build/ubuntu-cpc/hooks.d/base/disk-image-uefi.binary +++ b/live-build/ubuntu-cpc/hooks.d/base/disk-image-uefi.binary @@ -97,13 +97,11 @@ install_grub() { efi_target=arm-efi ;; amd64) - chroot mountpoint apt-get install -qqy grub-pc shim-signed + chroot mountpoint apt-get install -qqy grub-efi-amd64-signed shim-signed efi_target=x86_64-efi ;; esac - chroot mountpoint apt-get autoremove --purge --assume-yes - # This call to rewrite the debian package manifest is added here to capture # grub-efi packages that otherwise would not make it into the base # manifest. filesystem.packages is moved into place via symlinking to diff --git a/live-build/ubuntu-cpc/hooks.d/base/disk-image.binary b/live-build/ubuntu-cpc/hooks.d/base/disk-image.binary index 74d30aaa..5884fe61 100755 --- a/live-build/ubuntu-cpc/hooks.d/base/disk-image.binary +++ b/live-build/ubuntu-cpc/hooks.d/base/disk-image.binary @@ -136,7 +136,6 @@ fi if [ "$ARCH" = "s390x" ]; then # Do ZIPL install bits chroot mountpoint apt-get -qqy install s390-tools sysconfig-hardware - chroot mountpoint apt-get autoremove --purge --assume-yes # Write out cloudy zipl.conf for future kernel updates cat << EOF > mountpoint/etc/zipl.conf diff --git a/live-build/ubuntu-cpc/hooks.d/base/wsl.binary b/live-build/ubuntu-cpc/hooks.d/base/wsl.binary index 8ce28140..05f51e30 100755 --- a/live-build/ubuntu-cpc/hooks.d/base/wsl.binary +++ b/live-build/ubuntu-cpc/hooks.d/base/wsl.binary @@ -35,7 +35,6 @@ cp -a rootfs.dir $rootfs_dir setup_mountpoint $rootfs_dir env DEBIAN_FRONTEND=noninteractive chroot $rootfs_dir apt-get -y -qq install ubuntu-wsl -env DEBIAN_FRONTEND=noninteractive chroot $rootfs_dir apt-get autoremove --purge --assume-yes create_manifest $rootfs_dir livecd.ubuntu-cpc.wsl.rootfs.manifest teardown_mountpoint $rootfs_dir diff --git a/live-build/ubuntu-server/hooks/032-installer-squashfs.binary b/live-build/ubuntu-server/hooks/032-installer-squashfs.binary index b48149b1..c12c8bf1 100755 --- a/live-build/ubuntu-server/hooks/032-installer-squashfs.binary +++ b/live-build/ubuntu-server/hooks/032-installer-squashfs.binary @@ -21,10 +21,9 @@ if [ -n "$SUBARCH" ]; then exit 0 fi +. config/binary . config/functions . config/common -# somehow i don't have LB_DISTRIBUTION set ?! -. config/bootstrap FILESYSTEM_ROOT=binary/boot/squashfs.dir INSTALLER_ROOT=binary/boot/installer.squashfs.dir @@ -84,6 +83,12 @@ sed -i -e'N;/name: lxd/,+2d' $INSTALLER_ROOT/var/lib/snapd/seed/seed.yaml teardown_mountpoint "$INSTALLER_ROOT" +# Drop core/lxd/snapd that got copied up from base layer, due to +# snap-preseed tool doing --reset & speedup +find $OVERLAY_ROOT/var/lib/snapd/ -name 'core*.snap' -delete +find $OVERLAY_ROOT/var/lib/snapd/ -name 'snapd_*.snap' -delete +find $OVERLAY_ROOT/var/lib/snapd/ -name 'lxd_*.snap' -delete + squashfs_f="${PWD}/livecd.${PROJECT}.installer.squashfs" (cd "$OVERLAY_ROOT/" &&