From 3c39128f163cd4522b8fb74f78470d100f8ac828 Mon Sep 17 00:00:00 2001 From: Simon Quigley Date: Sat, 23 Nov 2024 13:49:04 -0600 Subject: [PATCH] Add optional Dracut support for installed images, enable it for Lubuntu. --- debian/changelog | 1 + live-build/auto/config | 12 ++++++++++++ live-build/functions | 9 +++++++-- 3 files changed, 20 insertions(+), 2 deletions(-) diff --git a/debian/changelog b/debian/changelog index c2e7f70e..19185f8d 100644 --- a/debian/changelog +++ b/debian/changelog @@ -2,6 +2,7 @@ livecd-rootfs (25.04.3) UNRELEASED; urgency=medium * Switch Lubuntu to stacked squashfses, and split apart the common functionality to avoid Subiquity-specific commands. + * Add optional Dracut support for installed images, enable it for Lubuntu. -- Simon Quigley Sat, 23 Nov 2024 13:44:46 -0600 diff --git a/live-build/auto/config b/live-build/auto/config index a85c8577..75ee3b92 100755 --- a/live-build/auto/config +++ b/live-build/auto/config @@ -695,6 +695,10 @@ common_layered_desktop_image() { fi # the minimal layer, for minimal installs add_task minimal minimal standard $MINIMAL_TASKS + # If Dracut is enabled, include it early + if [ -n "$NEEDS_DRACUT" ]; then + add_package minimal dracut + fi # fixme: this should go in seeds, not be in code here add_package minimal cloud-init add_package minimal linux-$KERNEL_FLAVOURS @@ -724,6 +728,13 @@ common_layered_desktop_image() { add_task ${LIVE_PREFIX}live "$LIVE_TASK" add_package ${LIVE_PREFIX}live casper + # If Dracut is enabled, ensure it is removed in the live layer + # casper still depends on initramfs-tools + if [ -n "$NEEDS_DRACUT" ]; then + remove_package ${LIVE_PREFIX}live dracut + add_package ${LIVE_PREFIX}live initramfs-tools + fi + if [ -n "$LANGUAGE_BASE" ]; then # language support seeded_langs="$(get_seeded_languages $LANGUAGE_BASE)" @@ -927,6 +938,7 @@ case $PROJECT in MINIMAL_TASKS=lubuntu-desktop-minimal MINIMAL_DESC="A minimal installation of the $UCFLAVOUR Desktop." KERNEL_FLAVOURS=generic + NEEDS_DRACUT=yes common_layered_desktop_image ;; diff --git a/live-build/functions b/live-build/functions index 9ec51967..8148185e 100644 --- a/live-build/functions +++ b/live-build/functions @@ -1154,9 +1154,14 @@ divert_update_initramfs () { --divert /usr/sbin/update-initramfs.REAL --rename \ /usr/sbin/update-initramfs" cat > chroot/usr/sbin/update-initramfs <<'EOF' -#! /bin/sh +#!/bin/sh if [ $# != 1 ] || [ "$1" != -u ]; then - exec update-initramfs.REAL "$@" + if [ -x /usr/sbin/update-initramfs.REAL ]; then + exec /usr/sbin/update-initramfs.REAL "$@" + else + echo "update-initramfs.REAL not found. Skipping execution." >&2 + exit 0 + fi fi echo "update-initramfs: diverted by livecd-rootfs (will be called later)" >&2