]> git.ipfire.org Git - thirdparty/systemd.git/commitdiff
Define 'microcode' type of initrd for the kernel-install staging area.
authorcvlc12 <cvlc12@outlook.fr>
Tue, 6 Jun 2023 15:14:57 +0000 (17:14 +0200)
committercvlc12 <cvlc12@outlook.fr>
Sun, 18 Jun 2023 18:38:20 +0000 (20:38 +0200)
This allows microcode to be referenced first for UKIs and loader entries.

src/kernel-install/90-loaderentry.install.in

index f4ba4708baccf7e14c27f1cd5b68a3b3211e8972..e1cab0dc23b16c8e8ba799dc6b73f086368dd82e 100755 (executable)
@@ -117,9 +117,12 @@ chown root:root "$KERNEL_DEST" || :
 
 shift "$INITRD_OPTIONS_SHIFT"
 # All files listed as arguments, and staged files starting with "initrd" are installed as initrds.
-for initrd in "$@" "${KERNEL_INSTALL_STAGING_AREA}"/initrd*; do
+for initrd in "${KERNEL_INSTALL_STAGING_AREA}/microcode*" "${@}" "${KERNEL_INSTALL_STAGING_AREA}/initrd*"; do
     [ -f "$initrd" ] || {
-        [ "$initrd" = "${KERNEL_INSTALL_STAGING_AREA}/initrd*" ] && continue
+        case "$initrd" in
+            "${KERNEL_INSTALL_STAGING_AREA}/initrd*" | "${KERNEL_INSTALL_STAGING_AREA}/microcode*")
+            continue ;;
+        esac
         echo "Error: initrd '$initrd' not a file." >&2
         exit 1
     }
@@ -153,7 +156,7 @@ mkdir -p "${LOADER_ENTRY%/*}" || {
     echo "linux      $KERNEL_ENTRY"
 
     have_initrd=
-    for initrd in "${@}" "${KERNEL_INSTALL_STAGING_AREA}"/initrd*; do
+    for initrd in "${KERNEL_INSTALL_STAGING_AREA}/microcode*" "${@}" "${KERNEL_INSTALL_STAGING_AREA}/initrd*"; do
         [ -f "$initrd" ] || continue
         echo "initrd     $ENTRY_DIR/${initrd##*/}"
         have_initrd=yes