From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from list by lists.gnu.org with archive (Exim 4.71) id 1aRjoK-0005nR-J2 for mharc-grub-devel@gnu.org; Fri, 05 Feb 2016 12:04:44 -0500 Received: from eggs.gnu.org ([2001:4830:134:3::10]:50914) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1aRjoD-0005m7-Ie for grub-devel@gnu.org; Fri, 05 Feb 2016 12:04:43 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1aRjo8-0001l5-Lk for grub-devel@gnu.org; Fri, 05 Feb 2016 12:04:37 -0500 Received: from mail-lb0-x233.google.com ([2a00:1450:4010:c04::233]:35475) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1aRjo8-0001kn-9C for grub-devel@gnu.org; Fri, 05 Feb 2016 12:04:32 -0500 Received: by mail-lb0-x233.google.com with SMTP id bc4so53092554lbc.2 for ; Fri, 05 Feb 2016 09:04:32 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=subject:to:references:cc:from:message-id:date:user-agent :mime-version:in-reply-to:content-type:content-transfer-encoding; bh=wWmruVv4K0cXKEasbzwivMeEAyAeSgDyMfjzCKgSQcE=; b=vnRdPtbCviBSFnuP4GJsmDH56JAFYEKvbzaRMGdsjV6NLWdA7QpY1oxeM0QiipWaHx EAVa4bAeeJon8vjdxYKuzmKo7i7XjhAwMaC7aeL+KaUZshMj4XBLml84lBfj0bw1IQdz dV8pXbm/y+OdeesJb60qZr/1OyzcC8NTS502TJjHvUqY6fMDVVMRLMpRaUlTtaGR0WQa 6eMwoZyWDcrg+DXOGv9D94MiyVjKUFIcghsqrBCeV0saZ1geJdghFWmG/vlJF9S8Bl37 bv/Fc2+THGjVtuH2SBtJgFm3/S4nqYVZEQjpz097unuNLKTVWSamFWIgOaoQeEKsRvjK Rtxw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:subject:to:references:cc:from:message-id:date :user-agent:mime-version:in-reply-to:content-type :content-transfer-encoding; bh=wWmruVv4K0cXKEasbzwivMeEAyAeSgDyMfjzCKgSQcE=; b=XjM6PZAuNhJTYoA79DH6wXm/fgsqgf/YQLKz9jNkvuPWKsDKCYETH4Q/4XaPUmGvmw rbxyDwM+sRkqPFcDbqbMVBwVS8Wkl6V83rurbdD13I9XZp/4T4BagLre/aTcu9HG0lY8 FQlomL0SkTGOjAuIby3YS6Mp8BCey+pbvJAtMzk529NdaosZvfBuFSR39ZIkzz4sxZbs FCgMgeiK+0r/e5WWQdTKTMIvMrJ1sepg+7nqH8yHs7nNVA6174Qzhbv92avcdrHRdes6 kzpv7RyuRSRnC1z23MjllAE82/Fl3dPxHVwwa/+YUiPG1zfxd/0N/XdsiIfW8fHHSA02 wqaQ== X-Gm-Message-State: AG10YOTnbPT1ofnie3pBaPuxJKnYMTDD8jNNTmsNdRT3BNJWtmBHkkFeQWM8Z0y29afVZQ== X-Received: by 10.112.137.41 with SMTP id qf9mr6496299lbb.140.1454691871359; Fri, 05 Feb 2016 09:04:31 -0800 (PST) Received: from [192.168.1.41] (ppp109-252-76-159.pppoe.spdop.ru. [109.252.76.159]) by smtp.gmail.com with ESMTPSA id d131sm1030067lfg.27.2016.02.05.09.04.30 (version=TLSv1/SSLv3 cipher=OTHER); Fri, 05 Feb 2016 09:04:30 -0800 (PST) Subject: Re: [PATCH 1/1] support loading of custom initrd images To: The development of GNU GRUB References: <1454668980-25352-1-git-send-email-list@eworm.de> From: Andrei Borzenkov Message-ID: <56B4D61D.5010205@gmail.com> Date: Fri, 5 Feb 2016 20:04:29 +0300 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:38.0) Gecko/20100101 Thunderbird/38.5.1 MIME-Version: 1.0 In-Reply-To: <1454668980-25352-1-git-send-email-list@eworm.de> Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 2a00:1450:4010:c04::233 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 17:04:43 -0000 05.02.2016 13:43, Christian Hesse пишет: > 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. > + Is there any other use case? Both dracut and initramfs-tools already add early cpio with microcode to generated initrd. This is bootloader agnostic and better solution. > +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}) We explicitly avoid bashisms in all scripts. > 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. >