--- a/docs/grub.texi +++ a/docs/grub.texi @@ -1398,6 +1398,12 @@ for all respectively normal entries. The values of these options replace the values of @samp{GRUB_CMDLINE_LINUX} and @samp{GRUB_CMDLINE_LINUX_DEFAULT} for Linux and Xen menu entries. +@item GRUB_CUSTOM_INITRD_EARLY_INCLUDES +List of space-separated early initrd images to be loaded from @samp{/boot}. +This is for loading things like microcode, firmware, ACPI tables, and so on. +They will be loaded after standard processor microcode images but before an +actual kernel initrd image. + @item GRUB_DISABLE_LINUX_UUID Normally, @command{grub-mkconfig} will generate menu entries that use universally-unique identifiers (UUIDs) to identify the root filesystem to --- a/util/grub-mkconfig.in +++ a/util/grub-mkconfig.in @@ -211,6 +211,7 @@ export GRUB_DEFAULT \ GRUB_CMDLINE_NETBSD \ GRUB_CMDLINE_NETBSD_DEFAULT \ GRUB_CMDLINE_GNUMACH \ + GRUB_CUSTOM_INITRD_EARLY_INCLUDES \ GRUB_TERMINAL_INPUT \ GRUB_TERMINAL_OUTPUT \ GRUB_SERIAL_COMMAND \ --- a/util/grub.d/10_linux.in +++ a/util/grub.d/10_linux.in @@ -136,9 +136,13 @@ EOF if test -n "${initrd}" ; then # TRANSLATORS: ramdisk isn't identifier. Should be translated. message="$(gettext_printf "Loading initial ramdisk ...")" + initrd_path= + for i in ${initrd}; do + initrd_path="${initrd_path} ${rel_dirname}/${i}" + done sed "s/^/$submenu_indentation/" << EOF echo '$(echo "$message" | grub_quote)' - initrd ${rel_dirname}/${initrd} + initrd $(echo $initrd_path) EOF fi sed "s/^/$submenu_indentation/" << EOF @@ -189,6 +193,17 @@ while [ "x$list" != "x" ] ; do linux_root_device_thisversion="${LINUX_ROOT_DEVICE}" initrd= + # Search for early initrd images applicable to all kernels. + for i in intel-uc.img intel-ucode.img amd-uc.img amd-ucode.img \ + early_ucode.cpio microcode.cpio \ + ${GRUB_CUSTOM_INITRD_EARLY_INCLUDES}; do + if test -e "${dirname}/${i}" ; then + initrd="${initrd} ${i}" + fi + done + + initrd_kernel= + # Search for a kernel initrd image. for i in "initrd.img-${version}" "initrd-${version}.img" "initrd-${version}.gz" \ "initrd-${version}" "initramfs-${version}.img" \ "initrd.img-${alt_version}" "initrd-${alt_version}.img" \ @@ -198,7 +213,8 @@ while [ "x$list" != "x" ] ; do "initramfs-genkernel-${GENKERNEL_ARCH}-${version}" \ "initramfs-genkernel-${GENKERNEL_ARCH}-${alt_version}"; do if test -e "${dirname}/${i}" ; then - initrd="$i" + initrd="${initrd} ${i}" + initrd_kernel="${i}" break fi done @@ -217,8 +233,14 @@ while [ "x$list" != "x" ] ; do fi if test -n "${initrd}" ; then - gettext_printf "Found initrd image: %s\n" "${dirname}/${initrd}" >&2 - elif test -z "${initramfs}" ; then + initrd_display= + for i in ${initrd}; do + initrd_display="${initrd_display} ${dirname}/${i}" + done + gettext_printf "Found initrd image: %s\n" "$(echo $initrd_display)" >&2 + fi + + if test -z "${initramfs}" && test -z "${initrd_kernel}" ; then # "UUID=" and "ZFS=" magic is parsed by initrd or initramfs. Since there's # no initrd or builtin initramfs, it can't work here. linux_root_device_thisversion=${GRUB_DEVICE}