From d11c71a6869a65036d3cefb5a67e33500073c62a Mon Sep 17 00:00:00 2001 From: Michael Hudson-Doyle Date: Mon, 19 Jul 2021 16:24:07 +1200 Subject: [PATCH 1/5] add a minimal server layer under the full server layer --- debian/changelog | 8 ++++++++ live-build/auto/config | 18 ++++++++++-------- .../hooks/02-installer-bits.chroot | 2 +- .../hooks/03-kernel-metapkg.chroot_early | 2 +- .../ubuntu-server/hooks/04-kernel-bits.binary | 2 +- .../etc/cloud/cloud.cfg | 0 .../etc/cloud/cloud.cfg.d/06_quiet.cfg | 0 .../systemd/journald.conf.d/no-rate-limit.conf | 0 .../override.conf" | 0 .../usr/bin/subiquity-shell | 0 .../system/getty@.service.d/autologin.conf | 0 .../usr/lib/systemd/system/getty@tty1.service | 0 .../media-filesystem.mount | 0 .../lib/systemd/system/media-filesystem.mount | 5 +++++ .../subiquity-serial.conf | 0 .../subiquity-serial.conf | 0 .../subiquity.conf | 0 .../system/snapd.service.d/no-reexec.conf | 0 .../lib/systemd/system/subiquity_config.mount | 0 .../lib/systemd/systemd-networkd-wait-online | 0 .../var/lib/cloud/seed/nocloud/meta-data | 0 .../var/lib/cloud/seed/nocloud/user-data | 0 .../etc/hosts | 0 .../systemd-networkd.service | 0 .../systemd-networkd-wait-online.service | 0 .../systemd-networkd.socket | 0 .../lib/systemd/system/media-filesystem.mount | 5 ----- 27 files changed, 26 insertions(+), 16 deletions(-) rename live-build/ubuntu-server/{includes.chroot.ubuntu-server.installer => includes.chroot.ubuntu-server-minimal.ubuntu-server.installer}/etc/cloud/cloud.cfg (100%) rename live-build/ubuntu-server/{includes.chroot.ubuntu-server.installer => includes.chroot.ubuntu-server-minimal.ubuntu-server.installer}/etc/cloud/cloud.cfg.d/06_quiet.cfg (100%) rename live-build/ubuntu-server/{includes.chroot.ubuntu-server.installer => includes.chroot.ubuntu-server-minimal.ubuntu-server.installer}/etc/systemd/journald.conf.d/no-rate-limit.conf (100%) rename "live-build/ubuntu-server/includes.chroot.ubuntu-server.installer/etc/systemd/system/dev-disk-by\\x2duuid-00c629d6\\x2d06ab\\x2d4dfd\\x2db21e\\x2dc3186f34105d.device.d/override.conf" => "live-build/ubuntu-server/includes.chroot.ubuntu-server-minimal.ubuntu-server.installer/etc/systemd/system/dev-disk-by\\x2duuid-00c629d6\\x2d06ab\\x2d4dfd\\x2db21e\\x2dc3186f34105d.device.d/override.conf" (100%) rename live-build/ubuntu-server/{includes.chroot.ubuntu-server.installer => includes.chroot.ubuntu-server-minimal.ubuntu-server.installer}/usr/bin/subiquity-shell (100%) rename live-build/ubuntu-server/{includes.chroot.ubuntu-server.installer => includes.chroot.ubuntu-server-minimal.ubuntu-server.installer}/usr/lib/systemd/system/getty@.service.d/autologin.conf (100%) rename live-build/ubuntu-server/{includes.chroot.ubuntu-server.installer => includes.chroot.ubuntu-server-minimal.ubuntu-server.installer}/usr/lib/systemd/system/getty@tty1.service (100%) rename live-build/ubuntu-server/{includes.chroot.ubuntu-server.installer => includes.chroot.ubuntu-server-minimal.ubuntu-server.installer}/usr/lib/systemd/system/local-fs.target.wants/media-filesystem.mount (100%) create mode 100644 live-build/ubuntu-server/includes.chroot.ubuntu-server-minimal.ubuntu-server.installer/usr/lib/systemd/system/media-filesystem.mount rename live-build/ubuntu-server/{includes.chroot.ubuntu-server.installer => includes.chroot.ubuntu-server-minimal.ubuntu-server.installer}/usr/lib/systemd/system/serial-getty@.service.d/subiquity-serial.conf (100%) rename live-build/ubuntu-server/{includes.chroot.ubuntu-server.installer => includes.chroot.ubuntu-server-minimal.ubuntu-server.installer}/usr/lib/systemd/system/serial-getty@sclp_line0.service.d/subiquity-serial.conf (100%) rename live-build/ubuntu-server/{includes.chroot.ubuntu-server.installer => includes.chroot.ubuntu-server-minimal.ubuntu-server.installer}/usr/lib/systemd/system/snap.subiquity.subiquity-service.service.d/subiquity.conf (100%) rename live-build/ubuntu-server/{includes.chroot.ubuntu-server.installer => includes.chroot.ubuntu-server-minimal.ubuntu-server.installer}/usr/lib/systemd/system/snapd.service.d/no-reexec.conf (100%) rename live-build/ubuntu-server/{includes.chroot.ubuntu-server.installer => includes.chroot.ubuntu-server-minimal.ubuntu-server.installer}/usr/lib/systemd/system/subiquity_config.mount (100%) rename live-build/ubuntu-server/{includes.chroot.ubuntu-server.installer => includes.chroot.ubuntu-server-minimal.ubuntu-server.installer}/usr/lib/systemd/systemd-networkd-wait-online (100%) rename live-build/ubuntu-server/{includes.chroot.ubuntu-server.installer => includes.chroot.ubuntu-server-minimal.ubuntu-server.installer}/var/lib/cloud/seed/nocloud/meta-data (100%) rename live-build/ubuntu-server/{includes.chroot.ubuntu-server.installer => includes.chroot.ubuntu-server-minimal.ubuntu-server.installer}/var/lib/cloud/seed/nocloud/user-data (100%) rename live-build/ubuntu-server/{includes.chroot.ubuntu-server => includes.chroot.ubuntu-server-minimal}/etc/hosts (100%) rename live-build/ubuntu-server/{includes.chroot.ubuntu-server => includes.chroot.ubuntu-server-minimal}/etc/systemd/system/multi-user.target.wants/systemd-networkd.service (100%) rename live-build/ubuntu-server/{includes.chroot.ubuntu-server => includes.chroot.ubuntu-server-minimal}/etc/systemd/system/network-online.target.wants/systemd-networkd-wait-online.service (100%) rename live-build/ubuntu-server/{includes.chroot.ubuntu-server => includes.chroot.ubuntu-server-minimal}/etc/systemd/system/sockets.target.wants/systemd-networkd.socket (100%) delete mode 100644 live-build/ubuntu-server/includes.chroot.ubuntu-server.installer/usr/lib/systemd/system/media-filesystem.mount diff --git a/debian/changelog b/debian/changelog index ad3ca301..a3a2b625 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,3 +1,11 @@ +livecd-rootfs (2.733) UNRELEASED; urgency=medium + + * Add a minimal server layer underneath the full server layer. Continue to + mount the full server layer at /media/filesystem for now to keep + compatibility with current subiquity. + + -- Michael Hudson-Doyle Tue, 03 Aug 2021 16:34:57 +1200 + livecd-rootfs (2.732) impish; urgency=medium [ Michael Hudson-Doyle ] diff --git a/live-build/auto/config b/live-build/auto/config index 6d5fce11..d6d9d40a 100755 --- a/live-build/auto/config +++ b/live-build/auto/config @@ -773,15 +773,17 @@ case $PROJECT in case ${SUBPROJECT:-} in live) PASSES_TO_LAYERS=true - add_task ubuntu-server minimal standard server + add_task ubuntu-server-minimal server-minimal + add_package ubuntu-server-minimal lxd-installer + add_task ubuntu-server-minimal.ubuntu-server minimal standard server # add_task really should do this itself but for now... - snap_from_seed server config/package-lists/livecd-rootfs.snaplist.chroot_ubuntu-server.full - add_package ubuntu-server cloud-init + snap_from_seed server config/package-lists/livecd-rootfs.snaplist.chroot_ubuntu-server-minimal.ubuntu-server.full + add_package ubuntu-server-minimal.ubuntu-server cloud-init - add_package ubuntu-server.installer linux-firmware lupin-casper openssh-server - add_snap ubuntu-server.installer subiquity/classic + add_package ubuntu-server-minimal.ubuntu-server.installer linux-firmware lupin-casper openssh-server + add_snap ubuntu-server-minimal.ubuntu-server.installer subiquity/classic if [ $ARCH = s390x ]; then - add_package ubuntu-server.installer s390-tools-zkey + add_package ubuntu-server-minimal.ubuntu-server.installer s390-tools-zkey fi # Live server ISOs for LTS point releases past .2 offer both @@ -804,8 +806,8 @@ case $PROJECT in exit 1 fi - add_package ubuntu-server.installer.$flavor $kernel_metapkg - LIVE_PASSES="${LIVE_PASSES:+$LIVE_PASSES }ubuntu-server.installer.$flavor" + add_package ubuntu-server-minimal.ubuntu-server.installer.$flavor $kernel_metapkg + LIVE_PASSES="${LIVE_PASSES:+$LIVE_PASSES }ubuntu-server-minimal.ubuntu-server.installer.$flavor" done ;; *) diff --git a/live-build/ubuntu-server/hooks/02-installer-bits.chroot b/live-build/ubuntu-server/hooks/02-installer-bits.chroot index d71157cc..49a6c271 100755 --- a/live-build/ubuntu-server/hooks/02-installer-bits.chroot +++ b/live-build/ubuntu-server/hooks/02-installer-bits.chroot @@ -1,7 +1,7 @@ #!/bin/bash -ex # vi: ts=4 noexpandtab -if [ "${PASS}" != "ubuntu-server.installer" ]; then +if [ "${PASS}" != "ubuntu-server-minimal.ubuntu-server.installer" ]; then exit 0 fi diff --git a/live-build/ubuntu-server/hooks/03-kernel-metapkg.chroot_early b/live-build/ubuntu-server/hooks/03-kernel-metapkg.chroot_early index 7e99c6bf..dda5a149 100755 --- a/live-build/ubuntu-server/hooks/03-kernel-metapkg.chroot_early +++ b/live-build/ubuntu-server/hooks/03-kernel-metapkg.chroot_early @@ -2,7 +2,7 @@ # vi: ts=4 noexpandtab case $PASS in - ubuntu-server.installer.*) + ubuntu-server-minimal.ubuntu-server.installer.*) flavor=${PASS##*.} if [ "$flavor" = "generic" ]; then kernel_metapkg=linux-generic diff --git a/live-build/ubuntu-server/hooks/04-kernel-bits.binary b/live-build/ubuntu-server/hooks/04-kernel-bits.binary index 3b5f0862..c0b2e3d7 100755 --- a/live-build/ubuntu-server/hooks/04-kernel-bits.binary +++ b/live-build/ubuntu-server/hooks/04-kernel-bits.binary @@ -2,7 +2,7 @@ # vi: ts=4 noexpandtab case $PASS in - ubuntu-server.installer.*) + ubuntu-server-minimal.ubuntu-server.installer.*) flavor=${PASS##*.} ;; *) diff --git a/live-build/ubuntu-server/includes.chroot.ubuntu-server.installer/etc/cloud/cloud.cfg b/live-build/ubuntu-server/includes.chroot.ubuntu-server-minimal.ubuntu-server.installer/etc/cloud/cloud.cfg similarity index 100% rename from live-build/ubuntu-server/includes.chroot.ubuntu-server.installer/etc/cloud/cloud.cfg rename to live-build/ubuntu-server/includes.chroot.ubuntu-server-minimal.ubuntu-server.installer/etc/cloud/cloud.cfg diff --git a/live-build/ubuntu-server/includes.chroot.ubuntu-server.installer/etc/cloud/cloud.cfg.d/06_quiet.cfg b/live-build/ubuntu-server/includes.chroot.ubuntu-server-minimal.ubuntu-server.installer/etc/cloud/cloud.cfg.d/06_quiet.cfg similarity index 100% rename from live-build/ubuntu-server/includes.chroot.ubuntu-server.installer/etc/cloud/cloud.cfg.d/06_quiet.cfg rename to live-build/ubuntu-server/includes.chroot.ubuntu-server-minimal.ubuntu-server.installer/etc/cloud/cloud.cfg.d/06_quiet.cfg diff --git a/live-build/ubuntu-server/includes.chroot.ubuntu-server.installer/etc/systemd/journald.conf.d/no-rate-limit.conf b/live-build/ubuntu-server/includes.chroot.ubuntu-server-minimal.ubuntu-server.installer/etc/systemd/journald.conf.d/no-rate-limit.conf similarity index 100% rename from live-build/ubuntu-server/includes.chroot.ubuntu-server.installer/etc/systemd/journald.conf.d/no-rate-limit.conf rename to live-build/ubuntu-server/includes.chroot.ubuntu-server-minimal.ubuntu-server.installer/etc/systemd/journald.conf.d/no-rate-limit.conf diff --git "a/live-build/ubuntu-server/includes.chroot.ubuntu-server.installer/etc/systemd/system/dev-disk-by\\x2duuid-00c629d6\\x2d06ab\\x2d4dfd\\x2db21e\\x2dc3186f34105d.device.d/override.conf" "b/live-build/ubuntu-server/includes.chroot.ubuntu-server-minimal.ubuntu-server.installer/etc/systemd/system/dev-disk-by\\x2duuid-00c629d6\\x2d06ab\\x2d4dfd\\x2db21e\\x2dc3186f34105d.device.d/override.conf" similarity index 100% rename from "live-build/ubuntu-server/includes.chroot.ubuntu-server.installer/etc/systemd/system/dev-disk-by\\x2duuid-00c629d6\\x2d06ab\\x2d4dfd\\x2db21e\\x2dc3186f34105d.device.d/override.conf" rename to "live-build/ubuntu-server/includes.chroot.ubuntu-server-minimal.ubuntu-server.installer/etc/systemd/system/dev-disk-by\\x2duuid-00c629d6\\x2d06ab\\x2d4dfd\\x2db21e\\x2dc3186f34105d.device.d/override.conf" diff --git a/live-build/ubuntu-server/includes.chroot.ubuntu-server.installer/usr/bin/subiquity-shell b/live-build/ubuntu-server/includes.chroot.ubuntu-server-minimal.ubuntu-server.installer/usr/bin/subiquity-shell similarity index 100% rename from live-build/ubuntu-server/includes.chroot.ubuntu-server.installer/usr/bin/subiquity-shell rename to live-build/ubuntu-server/includes.chroot.ubuntu-server-minimal.ubuntu-server.installer/usr/bin/subiquity-shell diff --git a/live-build/ubuntu-server/includes.chroot.ubuntu-server.installer/usr/lib/systemd/system/getty@.service.d/autologin.conf b/live-build/ubuntu-server/includes.chroot.ubuntu-server-minimal.ubuntu-server.installer/usr/lib/systemd/system/getty@.service.d/autologin.conf similarity index 100% rename from live-build/ubuntu-server/includes.chroot.ubuntu-server.installer/usr/lib/systemd/system/getty@.service.d/autologin.conf rename to live-build/ubuntu-server/includes.chroot.ubuntu-server-minimal.ubuntu-server.installer/usr/lib/systemd/system/getty@.service.d/autologin.conf diff --git a/live-build/ubuntu-server/includes.chroot.ubuntu-server.installer/usr/lib/systemd/system/getty@tty1.service b/live-build/ubuntu-server/includes.chroot.ubuntu-server-minimal.ubuntu-server.installer/usr/lib/systemd/system/getty@tty1.service similarity index 100% rename from live-build/ubuntu-server/includes.chroot.ubuntu-server.installer/usr/lib/systemd/system/getty@tty1.service rename to live-build/ubuntu-server/includes.chroot.ubuntu-server-minimal.ubuntu-server.installer/usr/lib/systemd/system/getty@tty1.service diff --git a/live-build/ubuntu-server/includes.chroot.ubuntu-server.installer/usr/lib/systemd/system/local-fs.target.wants/media-filesystem.mount b/live-build/ubuntu-server/includes.chroot.ubuntu-server-minimal.ubuntu-server.installer/usr/lib/systemd/system/local-fs.target.wants/media-filesystem.mount similarity index 100% rename from live-build/ubuntu-server/includes.chroot.ubuntu-server.installer/usr/lib/systemd/system/local-fs.target.wants/media-filesystem.mount rename to live-build/ubuntu-server/includes.chroot.ubuntu-server-minimal.ubuntu-server.installer/usr/lib/systemd/system/local-fs.target.wants/media-filesystem.mount diff --git a/live-build/ubuntu-server/includes.chroot.ubuntu-server-minimal.ubuntu-server.installer/usr/lib/systemd/system/media-filesystem.mount b/live-build/ubuntu-server/includes.chroot.ubuntu-server-minimal.ubuntu-server.installer/usr/lib/systemd/system/media-filesystem.mount new file mode 100644 index 00000000..82af906e --- /dev/null +++ b/live-build/ubuntu-server/includes.chroot.ubuntu-server-minimal.ubuntu-server.installer/usr/lib/systemd/system/media-filesystem.mount @@ -0,0 +1,5 @@ +[Mount] +What=/cdrom/casper/ubuntu-server-minimal.ubuntu-server.squashfs +Where=/media/filesystem +Type=squashfs +Options=ro diff --git a/live-build/ubuntu-server/includes.chroot.ubuntu-server.installer/usr/lib/systemd/system/serial-getty@.service.d/subiquity-serial.conf b/live-build/ubuntu-server/includes.chroot.ubuntu-server-minimal.ubuntu-server.installer/usr/lib/systemd/system/serial-getty@.service.d/subiquity-serial.conf similarity index 100% rename from live-build/ubuntu-server/includes.chroot.ubuntu-server.installer/usr/lib/systemd/system/serial-getty@.service.d/subiquity-serial.conf rename to live-build/ubuntu-server/includes.chroot.ubuntu-server-minimal.ubuntu-server.installer/usr/lib/systemd/system/serial-getty@.service.d/subiquity-serial.conf diff --git a/live-build/ubuntu-server/includes.chroot.ubuntu-server.installer/usr/lib/systemd/system/serial-getty@sclp_line0.service.d/subiquity-serial.conf b/live-build/ubuntu-server/includes.chroot.ubuntu-server-minimal.ubuntu-server.installer/usr/lib/systemd/system/serial-getty@sclp_line0.service.d/subiquity-serial.conf similarity index 100% rename from live-build/ubuntu-server/includes.chroot.ubuntu-server.installer/usr/lib/systemd/system/serial-getty@sclp_line0.service.d/subiquity-serial.conf rename to live-build/ubuntu-server/includes.chroot.ubuntu-server-minimal.ubuntu-server.installer/usr/lib/systemd/system/serial-getty@sclp_line0.service.d/subiquity-serial.conf diff --git a/live-build/ubuntu-server/includes.chroot.ubuntu-server.installer/usr/lib/systemd/system/snap.subiquity.subiquity-service.service.d/subiquity.conf b/live-build/ubuntu-server/includes.chroot.ubuntu-server-minimal.ubuntu-server.installer/usr/lib/systemd/system/snap.subiquity.subiquity-service.service.d/subiquity.conf similarity index 100% rename from live-build/ubuntu-server/includes.chroot.ubuntu-server.installer/usr/lib/systemd/system/snap.subiquity.subiquity-service.service.d/subiquity.conf rename to live-build/ubuntu-server/includes.chroot.ubuntu-server-minimal.ubuntu-server.installer/usr/lib/systemd/system/snap.subiquity.subiquity-service.service.d/subiquity.conf diff --git a/live-build/ubuntu-server/includes.chroot.ubuntu-server.installer/usr/lib/systemd/system/snapd.service.d/no-reexec.conf b/live-build/ubuntu-server/includes.chroot.ubuntu-server-minimal.ubuntu-server.installer/usr/lib/systemd/system/snapd.service.d/no-reexec.conf similarity index 100% rename from live-build/ubuntu-server/includes.chroot.ubuntu-server.installer/usr/lib/systemd/system/snapd.service.d/no-reexec.conf rename to live-build/ubuntu-server/includes.chroot.ubuntu-server-minimal.ubuntu-server.installer/usr/lib/systemd/system/snapd.service.d/no-reexec.conf diff --git a/live-build/ubuntu-server/includes.chroot.ubuntu-server.installer/usr/lib/systemd/system/subiquity_config.mount b/live-build/ubuntu-server/includes.chroot.ubuntu-server-minimal.ubuntu-server.installer/usr/lib/systemd/system/subiquity_config.mount similarity index 100% rename from live-build/ubuntu-server/includes.chroot.ubuntu-server.installer/usr/lib/systemd/system/subiquity_config.mount rename to live-build/ubuntu-server/includes.chroot.ubuntu-server-minimal.ubuntu-server.installer/usr/lib/systemd/system/subiquity_config.mount diff --git a/live-build/ubuntu-server/includes.chroot.ubuntu-server.installer/usr/lib/systemd/systemd-networkd-wait-online b/live-build/ubuntu-server/includes.chroot.ubuntu-server-minimal.ubuntu-server.installer/usr/lib/systemd/systemd-networkd-wait-online similarity index 100% rename from live-build/ubuntu-server/includes.chroot.ubuntu-server.installer/usr/lib/systemd/systemd-networkd-wait-online rename to live-build/ubuntu-server/includes.chroot.ubuntu-server-minimal.ubuntu-server.installer/usr/lib/systemd/systemd-networkd-wait-online diff --git a/live-build/ubuntu-server/includes.chroot.ubuntu-server.installer/var/lib/cloud/seed/nocloud/meta-data b/live-build/ubuntu-server/includes.chroot.ubuntu-server-minimal.ubuntu-server.installer/var/lib/cloud/seed/nocloud/meta-data similarity index 100% rename from live-build/ubuntu-server/includes.chroot.ubuntu-server.installer/var/lib/cloud/seed/nocloud/meta-data rename to live-build/ubuntu-server/includes.chroot.ubuntu-server-minimal.ubuntu-server.installer/var/lib/cloud/seed/nocloud/meta-data diff --git a/live-build/ubuntu-server/includes.chroot.ubuntu-server.installer/var/lib/cloud/seed/nocloud/user-data b/live-build/ubuntu-server/includes.chroot.ubuntu-server-minimal.ubuntu-server.installer/var/lib/cloud/seed/nocloud/user-data similarity index 100% rename from live-build/ubuntu-server/includes.chroot.ubuntu-server.installer/var/lib/cloud/seed/nocloud/user-data rename to live-build/ubuntu-server/includes.chroot.ubuntu-server-minimal.ubuntu-server.installer/var/lib/cloud/seed/nocloud/user-data diff --git a/live-build/ubuntu-server/includes.chroot.ubuntu-server/etc/hosts b/live-build/ubuntu-server/includes.chroot.ubuntu-server-minimal/etc/hosts similarity index 100% rename from live-build/ubuntu-server/includes.chroot.ubuntu-server/etc/hosts rename to live-build/ubuntu-server/includes.chroot.ubuntu-server-minimal/etc/hosts diff --git a/live-build/ubuntu-server/includes.chroot.ubuntu-server/etc/systemd/system/multi-user.target.wants/systemd-networkd.service b/live-build/ubuntu-server/includes.chroot.ubuntu-server-minimal/etc/systemd/system/multi-user.target.wants/systemd-networkd.service similarity index 100% rename from live-build/ubuntu-server/includes.chroot.ubuntu-server/etc/systemd/system/multi-user.target.wants/systemd-networkd.service rename to live-build/ubuntu-server/includes.chroot.ubuntu-server-minimal/etc/systemd/system/multi-user.target.wants/systemd-networkd.service diff --git a/live-build/ubuntu-server/includes.chroot.ubuntu-server/etc/systemd/system/network-online.target.wants/systemd-networkd-wait-online.service b/live-build/ubuntu-server/includes.chroot.ubuntu-server-minimal/etc/systemd/system/network-online.target.wants/systemd-networkd-wait-online.service similarity index 100% rename from live-build/ubuntu-server/includes.chroot.ubuntu-server/etc/systemd/system/network-online.target.wants/systemd-networkd-wait-online.service rename to live-build/ubuntu-server/includes.chroot.ubuntu-server-minimal/etc/systemd/system/network-online.target.wants/systemd-networkd-wait-online.service diff --git a/live-build/ubuntu-server/includes.chroot.ubuntu-server/etc/systemd/system/sockets.target.wants/systemd-networkd.socket b/live-build/ubuntu-server/includes.chroot.ubuntu-server-minimal/etc/systemd/system/sockets.target.wants/systemd-networkd.socket similarity index 100% rename from live-build/ubuntu-server/includes.chroot.ubuntu-server/etc/systemd/system/sockets.target.wants/systemd-networkd.socket rename to live-build/ubuntu-server/includes.chroot.ubuntu-server-minimal/etc/systemd/system/sockets.target.wants/systemd-networkd.socket diff --git a/live-build/ubuntu-server/includes.chroot.ubuntu-server.installer/usr/lib/systemd/system/media-filesystem.mount b/live-build/ubuntu-server/includes.chroot.ubuntu-server.installer/usr/lib/systemd/system/media-filesystem.mount deleted file mode 100644 index 60a07210..00000000 --- a/live-build/ubuntu-server/includes.chroot.ubuntu-server.installer/usr/lib/systemd/system/media-filesystem.mount +++ /dev/null @@ -1,5 +0,0 @@ -[Mount] -What=/cdrom/casper/ubuntu-server.squashfs -Where=/media/filesystem -Type=squashfs -Options=ro From 5232f2f8ccbcfb3489086dfb0ddc583c998955ed Mon Sep 17 00:00:00 2001 From: Michael Hudson-Doyle Date: Thu, 22 Jul 2021 23:09:34 +1200 Subject: [PATCH 2/5] fix /media/filesystem mount --- .../usr/lib/systemd/system/media-filesystem.mount | 8 ++++++-- .../usr/lib/systemd/system/media-full.mount | 5 +++++ .../usr/lib/systemd/system/media-minimal.mount | 5 +++++ 3 files changed, 16 insertions(+), 2 deletions(-) create mode 100644 live-build/ubuntu-server/includes.chroot.ubuntu-server-minimal.ubuntu-server.installer/usr/lib/systemd/system/media-full.mount create mode 100644 live-build/ubuntu-server/includes.chroot.ubuntu-server-minimal.ubuntu-server.installer/usr/lib/systemd/system/media-minimal.mount diff --git a/live-build/ubuntu-server/includes.chroot.ubuntu-server-minimal.ubuntu-server.installer/usr/lib/systemd/system/media-filesystem.mount b/live-build/ubuntu-server/includes.chroot.ubuntu-server-minimal.ubuntu-server.installer/usr/lib/systemd/system/media-filesystem.mount index 82af906e..2570aaf2 100644 --- a/live-build/ubuntu-server/includes.chroot.ubuntu-server-minimal.ubuntu-server.installer/usr/lib/systemd/system/media-filesystem.mount +++ b/live-build/ubuntu-server/includes.chroot.ubuntu-server-minimal.ubuntu-server.installer/usr/lib/systemd/system/media-filesystem.mount @@ -1,5 +1,9 @@ +[Unit] +Requires=media-full.mount media-minimal.mount +After=media-full.mount media-minimal.mount + [Mount] What=/cdrom/casper/ubuntu-server-minimal.ubuntu-server.squashfs Where=/media/filesystem -Type=squashfs -Options=ro +Type=overlay +Options=ro,lowerdir=/media/full:/media/minimal diff --git a/live-build/ubuntu-server/includes.chroot.ubuntu-server-minimal.ubuntu-server.installer/usr/lib/systemd/system/media-full.mount b/live-build/ubuntu-server/includes.chroot.ubuntu-server-minimal.ubuntu-server.installer/usr/lib/systemd/system/media-full.mount new file mode 100644 index 00000000..7c96a46e --- /dev/null +++ b/live-build/ubuntu-server/includes.chroot.ubuntu-server-minimal.ubuntu-server.installer/usr/lib/systemd/system/media-full.mount @@ -0,0 +1,5 @@ +[Mount] +What=/cdrom/casper/ubuntu-server-minimal.ubuntu-server.squashfs +Where=/media/full +Type=squashfs +Options=ro diff --git a/live-build/ubuntu-server/includes.chroot.ubuntu-server-minimal.ubuntu-server.installer/usr/lib/systemd/system/media-minimal.mount b/live-build/ubuntu-server/includes.chroot.ubuntu-server-minimal.ubuntu-server.installer/usr/lib/systemd/system/media-minimal.mount new file mode 100644 index 00000000..0d606898 --- /dev/null +++ b/live-build/ubuntu-server/includes.chroot.ubuntu-server-minimal.ubuntu-server.installer/usr/lib/systemd/system/media-minimal.mount @@ -0,0 +1,5 @@ +[Mount] +What=/cdrom/casper/ubuntu-server-minimal.squashfs +Where=/media/minimal +Type=squashfs +Options=ro From 5fda0bb2aa07b4c7bf3cd0537654a1304235c0b0 Mon Sep 17 00:00:00 2001 From: Michael Hudson-Doyle Date: Wed, 21 Jul 2021 14:54:30 +1200 Subject: [PATCH 3/5] apply dpkg minimizations to minimal layer, and undo them for full layer --- live-build/auto/build | 7 +++++-- .../hooks/01-unminimize.chroot_early | 20 +++++++++++++++++++ 2 files changed, 25 insertions(+), 2 deletions(-) create mode 100755 live-build/ubuntu-server/hooks/01-unminimize.chroot_early diff --git a/live-build/auto/build b/live-build/auto/build index e1a00f88..3133972b 100755 --- a/live-build/auto/build +++ b/live-build/auto/build @@ -169,7 +169,10 @@ Expire-Date: 0 rm -f chroot/etc/localtime chroot/etc/timezone fi - if [ "${SUBPROJECT:-}" = minimized ]; then + if [ "${SUBPROJECT:-}" = minimized ] || [ "${PROJECT}" = "ubuntu-server" ]; then + # ubuntu-server has a minimized base layer so needs + # minimizations applied to the chroot + # set up dpkg filters to skip installing docs on minimized system mkdir -p chroot/etc/dpkg/dpkg.cfg.d cat > chroot/etc/dpkg/dpkg.cfg.d/excludes < /dev/ fi EOF fi - if [ "$PROJECT" = "ubuntu-cpc" ]; then + if [ "$PROJECT" = "ubuntu-cpc" ] || [ "$PROJECT" = "ubuntu-server" ]; then cat >> chroot/usr/local/sbin/unminimize <<'EOF' echo "Removing lxd installer package..." diff --git a/live-build/ubuntu-server/hooks/01-unminimize.chroot_early b/live-build/ubuntu-server/hooks/01-unminimize.chroot_early new file mode 100755 index 00000000..f70b59b4 --- /dev/null +++ b/live-build/ubuntu-server/hooks/01-unminimize.chroot_early @@ -0,0 +1,20 @@ +#!/bin/bash + +set -ex + +case ${PASS} in + ubuntu-server-minimal.ubuntu-server) + ;; + *) + exit 0 + ;; +esac + +# The unminimize script will try to install the lxd snap. We can't +# do that at this stage so just neuter the snap command (the snap +# will get properly seeded by generic machinery). +dpkg-divert --add --divert /usr/bin/snap.REAL --rename /usr/bin/snap +ln -s /bin/true /usr/bin/snap +yes | /usr/local/sbin/unminimize +rm /usr/bin/snap +dpkg-divert --remove --rename /usr/bin/snap From b341c81ff3f3f800a2638a669eae9d4711f8d249 Mon Sep 17 00:00:00 2001 From: Michael Hudson-Doyle Date: Thu, 29 Jul 2021 11:57:04 +1200 Subject: [PATCH 4/5] do the mounting in an initrd script rather than systemd units --- .../hooks/03-kernel-metapkg.chroot_early | 13 +++++++++++++ .../usr/lib/systemd/system/media-filesystem.mount | 9 --------- .../usr/lib/systemd/system/media-full.mount | 5 ----- .../usr/lib/systemd/system/media-minimal.mount | 5 ----- 4 files changed, 13 insertions(+), 19 deletions(-) delete mode 100644 live-build/ubuntu-server/includes.chroot.ubuntu-server-minimal.ubuntu-server.installer/usr/lib/systemd/system/media-filesystem.mount delete mode 100644 live-build/ubuntu-server/includes.chroot.ubuntu-server-minimal.ubuntu-server.installer/usr/lib/systemd/system/media-full.mount delete mode 100644 live-build/ubuntu-server/includes.chroot.ubuntu-server-minimal.ubuntu-server.installer/usr/lib/systemd/system/media-minimal.mount diff --git a/live-build/ubuntu-server/hooks/03-kernel-metapkg.chroot_early b/live-build/ubuntu-server/hooks/03-kernel-metapkg.chroot_early index dda5a149..864d4c4c 100755 --- a/live-build/ubuntu-server/hooks/03-kernel-metapkg.chroot_early +++ b/live-build/ubuntu-server/hooks/03-kernel-metapkg.chroot_early @@ -18,6 +18,14 @@ case $PASS in ;; esac +# Add a script to record which kernel meta-package to use and to set +# up the /media/filesystem mount that subiquity currently depends +# on. It would be cleaner to do this mount in a systemd mount unit but +# that doesn't work because we mask the cdrom mount to avoid strange +# issues with the handover from the initrd to systemd in the live +# session. In any case, subiquity will sooner or later not require +# this mount to be here at all and then we can delete these mount commands. + cat < /etc/initramfs-tools/scripts/init-bottom/live-server #!/bin/sh case \$1 in @@ -25,6 +33,11 @@ prereqs) exit 0;; esac echo ${kernel_metapkg} > /run/kernel-meta-package + +mkdir -p \${rootmnt}/media/filesystem \${rootmnt}/media/full \${rootmnt}/media/minimal +mount -o ro -t squashfs \${rootmnt}/cdrom/casper/ubuntu-server-minimal.squashfs \${rootmnt}/media/minimal +mount -o ro -t squashfs \${rootmnt}/cdrom/casper/ubuntu-server-minimal.ubuntu-server.squashfs \${rootmnt}/media/full +mount -o ro,lowerdir=\${rootmnt}/media/full:\${rootmnt}/media/minimal -t overlay overlay \${rootmnt}/media/filesystem EOF chmod +x /etc/initramfs-tools/scripts/init-bottom/live-server diff --git a/live-build/ubuntu-server/includes.chroot.ubuntu-server-minimal.ubuntu-server.installer/usr/lib/systemd/system/media-filesystem.mount b/live-build/ubuntu-server/includes.chroot.ubuntu-server-minimal.ubuntu-server.installer/usr/lib/systemd/system/media-filesystem.mount deleted file mode 100644 index 2570aaf2..00000000 --- a/live-build/ubuntu-server/includes.chroot.ubuntu-server-minimal.ubuntu-server.installer/usr/lib/systemd/system/media-filesystem.mount +++ /dev/null @@ -1,9 +0,0 @@ -[Unit] -Requires=media-full.mount media-minimal.mount -After=media-full.mount media-minimal.mount - -[Mount] -What=/cdrom/casper/ubuntu-server-minimal.ubuntu-server.squashfs -Where=/media/filesystem -Type=overlay -Options=ro,lowerdir=/media/full:/media/minimal diff --git a/live-build/ubuntu-server/includes.chroot.ubuntu-server-minimal.ubuntu-server.installer/usr/lib/systemd/system/media-full.mount b/live-build/ubuntu-server/includes.chroot.ubuntu-server-minimal.ubuntu-server.installer/usr/lib/systemd/system/media-full.mount deleted file mode 100644 index 7c96a46e..00000000 --- a/live-build/ubuntu-server/includes.chroot.ubuntu-server-minimal.ubuntu-server.installer/usr/lib/systemd/system/media-full.mount +++ /dev/null @@ -1,5 +0,0 @@ -[Mount] -What=/cdrom/casper/ubuntu-server-minimal.ubuntu-server.squashfs -Where=/media/full -Type=squashfs -Options=ro diff --git a/live-build/ubuntu-server/includes.chroot.ubuntu-server-minimal.ubuntu-server.installer/usr/lib/systemd/system/media-minimal.mount b/live-build/ubuntu-server/includes.chroot.ubuntu-server-minimal.ubuntu-server.installer/usr/lib/systemd/system/media-minimal.mount deleted file mode 100644 index 0d606898..00000000 --- a/live-build/ubuntu-server/includes.chroot.ubuntu-server-minimal.ubuntu-server.installer/usr/lib/systemd/system/media-minimal.mount +++ /dev/null @@ -1,5 +0,0 @@ -[Mount] -What=/cdrom/casper/ubuntu-server-minimal.squashfs -Where=/media/minimal -Type=squashfs -Options=ro From 116a51a0802a56dc64c9740e8c91557adb233432 Mon Sep 17 00:00:00 2001 From: Michael Hudson-Doyle Date: Tue, 3 Aug 2021 16:31:23 +1200 Subject: [PATCH 5/5] bootstrap the minimal variant for the minimal server layer --- live-build/auto/config | 1 + 1 file changed, 1 insertion(+) diff --git a/live-build/auto/config b/live-build/auto/config index d6d9d40a..3d012cc0 100755 --- a/live-build/auto/config +++ b/live-build/auto/config @@ -772,6 +772,7 @@ case $PROJECT in ubuntu-server) case ${SUBPROJECT:-} in live) + OPTS="${OPTS:+$OPTS }--bootstrap-flavour=minimal" PASSES_TO_LAYERS=true add_task ubuntu-server-minimal server-minimal add_package ubuntu-server-minimal lxd-installer