Merge branch 'minimal-server-layer-3' into ubuntu/master

impish-sru-lp-1946520
Michael Hudson-Doyle 3 years ago
commit 8fcaf94c3b

8
debian/changelog vendored

@ -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 <michael.hudson@ubuntu.com> Tue, 03 Aug 2021 16:34:57 +1200
livecd-rootfs (2.732) impish; urgency=medium
[ Michael Hudson-Doyle ]

@ -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 <<EOF
@ -278,7 +281,7 @@ if dpkg-query --show --showformat='${db:Status-Status}\n' ubuntu-server 2> /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..."

@ -772,16 +772,19 @@ case $PROJECT in
ubuntu-server)
case ${SUBPROJECT:-} in
live)
OPTS="${OPTS:+$OPTS }--bootstrap-flavour=minimal"
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 +807,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
;;
*)

@ -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

@ -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

@ -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
@ -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 <<EOF > /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

@ -2,7 +2,7 @@
# vi: ts=4 noexpandtab
case $PASS in
ubuntu-server.installer.*)
ubuntu-server-minimal.ubuntu-server.installer.*)
flavor=${PASS##*.}
;;
*)

@ -1,5 +0,0 @@
[Mount]
What=/cdrom/casper/ubuntu-server.squashfs
Where=/media/filesystem
Type=squashfs
Options=ro
Loading…
Cancel
Save