Received: from list by lists.gnu.org with archive (Exim 4.71) id 1aReQZ-0002q9-Fm for mharc-grub-devel@gnu.org; Fri, 05 Feb 2016 06:19:51 -0500 Received: from eggs.gnu.org ([2001:4830:134:3::10]:49169) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1aReQX-0002n5-7m for grub-devel@gnu.org; Fri, 05 Feb 2016 06:19:50 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1aReQV-0008Or-KJ for grub-devel@gnu.org; Fri, 05 Feb 2016 06:19:49 -0500 Received: from mx.mylinuxtime.de ([2a01:4f8:202:62a9:5054:ff:fe05:a137]:54160) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1aReQV-0008ON-9M for grub-devel@gnu.org; Fri, 05 Feb 2016 06:19:47 -0500 Received: from leda.eworm.de (unknown [10.10.1.2]) (using TLSv1.2 with cipher DHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx.mylinuxtime.de (Postfix) with ESMTPSA id 4D5A8259C4; Fri, 5 Feb 2016 11:43:21 +0100 (CET) DKIM-Filter: OpenDKIM Filter v2.9.2 mx.mylinuxtime.de 4D5A8259C4 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=eworm.de; s=mail; t=1454669001; bh=n4jm5WwJ1xUl/vG2JigDAujHZuJizT5ydBjFuP5L1H4=; h=From:To:Cc:Subject:Date; b=issjZepu1c6VSNY0i0xgJUZELDduD9/nUSo1boLZzo74eW7djrRsxHdEkcUFOgaQz 5calIZlAulCCimaPCKSmqIG9uixhtJrVIYf9VnzmPh8k/27HG7bR83U5ZLRPfISG50 ntx1Yq7cIsuyvG3Uq8iW+97uvaVKHxhAYHd+AOTU= Received: by leda.eworm.de (Postfix, from userid 1000) id 1BFE71013C3; Fri, 5 Feb 2016 11:43:16 +0100 (CET) From: Christian Hesse To: grub-devel Subject: [PATCH 1/1] support loading of custom initrd images Date: Fri, 5 Feb 2016 11:43:00 +0100 Message-Id: <1454668980-25352-1-git-send-email-list@eworm.de> X-Mailer: git-send-email 2.7.0 X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 2a01:4f8:202:62a9:5054:ff:fe05:a137 Cc: Christian Hesse X-BeenThere: grub-devel@gnu.org X-Mailman-Version: 2.1.14 Precedence: list Reply-To: The development of GNU GRUB List-Id: The development of GNU GRUB List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 05 Feb 2016 11:19:50 -0000 From: Christian Hesse Signed-off-by: Christian Hesse --- docs/grub.texi | 6 ++++++ util/grub-mkconfig.in | 1 + util/grub.d/10_linux.in | 16 +++++++++------- 3 files changed, 16 insertions(+), 7 deletions(-) diff --git a/docs/grub.texi b/docs/grub.texi index 0afdd8c..f65647c 100644 --- a/docs/grub.texi +++ b/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 +Give custom initrd images to be loaded in addition to the initrd image +found for the kernel. One use case is to load Intel ucode image. + +This expects a space separated list of initrd images in @samp{/boot}. + @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 diff --git a/util/grub-mkconfig.in b/util/grub-mkconfig.in index 3183744..bbe9e62 100644 --- a/util/grub-mkconfig.in +++ b/util/grub-mkconfig.in @@ -211,6 +211,7 @@ export GRUB_DEFAULT \ GRUB_CMDLINE_NETBSD \ GRUB_CMDLINE_NETBSD_DEFAULT \ GRUB_CMDLINE_GNUMACH \ + GRUB_CUSTOM_INITRD \ GRUB_TERMINAL_INPUT \ GRUB_TERMINAL_OUTPUT \ GRUB_SERIAL_COMMAND \ diff --git a/util/grub.d/10_linux.in b/util/grub.d/10_linux.in index 5a78513..8e060c5 100644 --- a/util/grub.d/10_linux.in +++ b/util/grub.d/10_linux.in @@ -136,10 +136,12 @@ EOF if test -n "${initrd}" ; then # TRANSLATORS: ramdisk isn't identifier. Should be translated. message="$(gettext_printf "Loading initial ramdisk ...")" - sed "s/^/$submenu_indentation/" << EOF - echo '$(echo "$message" | grub_quote)' - initrd ${rel_dirname}/${initrd} -EOF + printf ' %s\n' "echo '$(echo "$message" | grub_quote)'" | sed "s/^/$submenu_indentation/" + printf ' %s ' 'initrd' | sed "s/^/$submenu_indentation/" + for I in "${initrd[@]}"; do + printf ' %s/%s' "${rel_dirname}" "${I}" + done + printf '\n' fi sed "s/^/$submenu_indentation/" << EOF } @@ -188,7 +190,7 @@ while [ "x$list" != "x" ] ; do alt_version=`echo $version | sed -e "s,\.old$,,g"` linux_root_device_thisversion="${LINUX_ROOT_DEVICE}" - initrd= + initrd=(${GRUB_CUSTOM_INITRD}) 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 +200,7 @@ 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+=("$i") break fi done @@ -217,7 +219,7 @@ while [ "x$list" != "x" ] ; do fi if test -n "${initrd}" ; then - gettext_printf "Found initrd image: %s\n" "${dirname}/${initrd}" >&2 + gettext_printf "Found initrd image(s) in %s: %s\n" "${dirname}" "${initrd[*]}" >&2 elif test -z "${initramfs}" ; then # "UUID=" and "ZFS=" magic is parsed by initrd or initramfs. Since there's # no initrd or builtin initramfs, it can't work here. -- 2.7.0