From: Jo Zzsi Date: Mon, 21 Oct 2024 11:55:40 +0000 (-0400) Subject: fix: set initrd-release in the base module X-Git-Tag: 106~369 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=41f9e8f;p=thirdparty%2Fdracut-ng.git fix: set initrd-release in the base module This resolves a regression introduced by 5bf724fa217ccd6011be4341d30eca05427b3415. --- diff --git a/modules.d/98dracut-systemd/module-setup.sh b/modules.d/98dracut-systemd/module-setup.sh index 93c0bfa73..0438e40f0 100755 --- a/modules.d/98dracut-systemd/module-setup.sh +++ b/modules.d/98dracut-systemd/module-setup.sh @@ -76,15 +76,6 @@ install() { grep -hE -ve '^VERSION=' -ve '^PRETTY_NAME' "$dracutsysrootdir"/etc/os-release > "${initdir}"/usr/lib/initrd-release [[ -n ${VERSION} ]] && VERSION+=" " [[ -n ${PRETTY_NAME} ]] && PRETTY_NAME+=" " - else - # Fall back to synthesizing one, since dracut is presently used - # on non-systemd systems as well. - { - echo "NAME=dracut" - echo "ID=dracut" - echo "VERSION_ID=\"$DRACUT_VERSION\"" - echo 'ANSI_COLOR="0;34"' - } > "${initdir}"/usr/lib/initrd-release fi VERSION+="dracut-$DRACUT_VERSION" PRETTY_NAME+="dracut-$DRACUT_VERSION (Initramfs)" @@ -96,7 +87,6 @@ install() { # having it mixed in with the real underlying OS version. echo "DRACUT_VERSION=\"${DRACUT_VERSION}\"" } >> "$initdir"/usr/lib/initrd-release - echo "dracut-$DRACUT_VERSION" > "$initdir/lib/dracut/dracut-$DRACUT_VERSION" ln -sf ../usr/lib/initrd-release "$initdir"/etc/initrd-release ln -sf initrd-release "$initdir"/usr/lib/os-release ln -sf initrd-release "$initdir"/etc/os-release diff --git a/modules.d/99base/module-setup.sh b/modules.d/99base/module-setup.sh index 723cb9f24..13639bd45 100755 --- a/modules.d/99base/module-setup.sh +++ b/modules.d/99base/module-setup.sh @@ -61,6 +61,15 @@ install() { echo ro >> "${initdir}/etc/cmdline.d/base.conf" fi + { + echo "NAME=dracut" + echo "ID=dracut" + echo "VERSION_ID=\"$DRACUT_VERSION\"" + echo 'ANSI_COLOR="0;34"' + } > "${initdir}"/usr/lib/initrd-release + + echo "dracut-$DRACUT_VERSION" > "$initdir/lib/dracut/dracut-$DRACUT_VERSION" + ## save host_devs which we need bring up if [[ $hostonly_cmdline == "yes" ]]; then if [[ -n ${host_devs[*]} ]]; then