From: Andrei Borzenkov <arvidjaar@gmail.com>
To: The development of GNU GRUB <grub-devel@gnu.org>
Cc: Christian Hesse <mail@eworm.de>
Subject: Re: [PATCH 1/1] support loading of custom initrd images
Date: Fri, 5 Feb 2016 20:04:29 +0300 [thread overview]
Message-ID: <56B4D61D.5010205@gmail.com> (raw)
In-Reply-To: <1454668980-25352-1-git-send-email-list@eworm.de>
05.02.2016 13:43, Christian Hesse пишет:
> From: Christian Hesse <mail@eworm.de>
>
> Signed-off-by: Christian Hesse <mail@eworm.de>
> ---
> 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.
>
next prev parent reply other threads:[~2016-02-05 17:04 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-02-05 10:43 [PATCH 1/1] support loading of custom initrd images Christian Hesse
2016-02-05 17:04 ` Andrei Borzenkov [this message]
2016-02-05 17:44 ` Christian Hesse
2016-02-06 6:51 ` Andrei Borzenkov
2016-02-08 8:22 ` Christian Hesse
2016-02-08 8:30 ` [PATCH v2 " Christian Hesse
2016-02-08 16:10 ` Christian Hesse
2016-02-05 18:23 ` [PATCH " Vladimir 'phcoder' Serbinenko
2016-02-08 8:27 ` Christian Hesse
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=56B4D61D.5010205@gmail.com \
--to=arvidjaar@gmail.com \
--cc=grub-devel@gnu.org \
--cc=mail@eworm.de \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.