diff --git a/live-build/auto/config b/live-build/auto/config index ef279cb5..38013537 100755 --- a/live-build/auto/config +++ b/live-build/auto/config @@ -1065,16 +1065,12 @@ case $PROJECT in exit 1 fi - add_pass ubuntu-server-minimal.ubuntu-server.installer.$flavor if [ "$first_kernel" = "y" ]; then # Put the first kernel offered into the base layer - kernel_layer=ubuntu-server-minimal first_kernel=n - else - # and subsequent ones into their own layer - kernel_layer=ubuntu-server-minimal.ubuntu-server.installer.$flavor + add_package ubuntu-server-minimal $kernel_metapkg fi - add_package $kernel_layer $kernel_metapkg + 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-hwe-kernel.chroot_early b/live-build/ubuntu-server/hooks/02-hwe-kernel.chroot_early new file mode 100755 index 00000000..69394637 --- /dev/null +++ b/live-build/ubuntu-server/hooks/02-hwe-kernel.chroot_early @@ -0,0 +1,18 @@ +#!/bin/bash -eux +# vi: ts=4 noexpandtab + +case $PASS in + ubuntu-server-minimal.ubuntu-server.installer.*.*) + exit 0 + ;; + ubuntu-server-minimal.ubuntu-server.installer.*) + ;; + *) + exit 0 + ;; +esac + +# remove excess kernels. auto/config arranges for the correct one to be +# installed. + +apt-get --yes remove --purge 'linux-image*'