diff --git a/live-build/lb_binary_layered b/live-build/lb_binary_layered index 60b5dd05..869b12f3 100755 --- a/live-build/lb_binary_layered +++ b/live-build/lb_binary_layered @@ -91,6 +91,20 @@ build_layered_squashfs () { # Copy initrd and vmlinuz outside of chroot and remove them from the layer squashfs if $(is_live_layer "$pass"); then + # For *.live passes (desktop builds), the kernel flavor comes from + # LB_LINUX_FLAVOURS. For other live passes (server installer passes + # like "...installer.generic-hwe"), the flavor is encoded as the + # final dot-separated component of the pass name. + case "$pass" in + *.live) + for flavor in $LB_LINUX_FLAVOURS; do + iso_install_kernel "$flavor" chroot/boot/vmlinu?-* chroot/boot/initrd.img-* + done + ;; + *) + iso_install_kernel "${pass##*.}" chroot/boot/vmlinu?-* chroot/boot/initrd.img-* + ;; + esac lb binary_linux-image ${*} rm -f chroot/boot/initrd.img-* chroot/boot/vmlinu{x,z}-* fi diff --git a/live-build/ubuntu-server/hooks/04-kernel-bits.binary b/live-build/ubuntu-server/hooks/04-kernel-bits.binary deleted file mode 100755 index cf38b36b..00000000 --- a/live-build/ubuntu-server/hooks/04-kernel-bits.binary +++ /dev/null @@ -1,19 +0,0 @@ -#!/bin/bash -eux -# vi: ts=4 noexpandtab - -. config/functions - -case $PASS in - ubuntu-server-minimal.ubuntu-server.installer.*.*) - exit 0 - ;; - ubuntu-server-minimal.ubuntu-server.installer.*) - flavor=${PASS##*.} - ;; - *) - exit 0 - ;; -esac - -# Install kernel and initrd directly into the ISO casper directory -iso_install_kernel "$flavor" chroot/boot/vmlinu?-* chroot/boot/initrd.img-*