From 30430fc7d8cb0ebc2c987b2b3d022cc282bbfced Mon Sep 17 00:00:00 2001 From: Dimitri John Ledkov Date: Wed, 1 Apr 2020 11:14:19 +0100 Subject: [PATCH] Determine kernel image/initrd version exactly, using apt data. --- debian/changelog | 6 ++++++ live-build/auto/build | 27 +-------------------------- 2 files changed, 7 insertions(+), 26 deletions(-) diff --git a/debian/changelog b/debian/changelog index 74fc91e6..4226188d 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,3 +1,9 @@ +livecd-rootfs (2.657) UNRELEASED; urgency=medium + + * Determine kernel image/initrd version exactly, using apt data. + + -- Dimitri John Ledkov Wed, 01 Apr 2020 11:13:42 +0100 + livecd-rootfs (2.656) focal; urgency=medium [ David Krauser ] diff --git a/live-build/auto/build b/live-build/auto/build index 2ec77b86..ed6c79f8 100755 --- a/live-build/auto/build +++ b/live-build/auto/build @@ -819,33 +819,8 @@ for FLAVOUR in $LB_LINUX_FLAVOURS; do if [ -z "$LB_LINUX_FLAVOURS" ] || [ "$LB_LINUX_FLAVOURS" = "none" ]; then continue fi - case $FLAVOUR in - virtual) - FLAVOUR="generic" - ;; - oem-*) - FLAVOUR="oem" - ;; - esac - KVERS="$( (cd "binary/$INITFS"; ls vmlinu?-* 2>/dev/null || true) | (fgrep -v .efi || true) | sed -n "s/^vmlinu.-\\([^-]*-[^-]*-$FLAVOUR\\)$/\\1/p" )" - if [ -z "$KVERS" ]; then - if [ -e "binary/$INITFS/vmlinuz" ]; then - # already renamed by ubuntu-defaults-image - break - fi - echo "No kernel output for $FLAVOUR!" >&2 - exit 1 - fi - NUMKVERS="$(set -- $KVERS; echo $#)" - if [ "$NUMKVERS" -gt 1 ]; then - echo "Cannot handle more than one kernel for $FLAVOUR ($KVERS)!" >&2 - exit 1 - fi + KVERS=$(Chroot chroot apt show linux-image-$FLAVOUR 2>/dev/null | sed -n 's/^Depends:.* linux-image-\([a-z0-9.-]*\).*/\1/p') ln "binary/$INITFS/"vmlinu?-"$KVERS" "$PREFIX.kernel-$FLAVOUR" - if [ -e "binary/$INITFS/"vmlinu?-"$KVERS.efi.signed" ]; then - ln "binary/$INITFS/"vmlinu?-"$KVERS.efi.signed" "$PREFIX.kernel-$FLAVOUR.efi.signed" - chmod 644 "$PREFIX.kernel-$FLAVOUR.efi.signed" - fi chmod 644 "$PREFIX.kernel-$FLAVOUR" if [ -e "binary/$INITFS/initrd.img-$KVERS" ]; then ln "binary/$INITFS/initrd.img-$KVERS" "$PREFIX.initrd-$FLAVOUR"