From: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>
To: The development of GNU GRUB <grub-devel@gnu.org>
Cc: Matthew Garrett <mjg59@coreos.com>
Subject: Re: [PATCH] Add fwconfig command
Date: Tue, 24 Jan 2017 09:52:35 -0500 [thread overview]
Message-ID: <20170124145235.GE17957@char.us.oracle.com> (raw)
In-Reply-To: <20170123234332.22379-1-mjg59@coreos.com>
On Mon, Jan 23, 2017 at 03:43:32PM -0800, Matthew Garrett wrote:
> Add a command to read values from the qemu fwcfg store. This allows data
> to be passed from the qemu command line to grub.
>
> Example use:
>
> echo '(hd0,1)' >rootdev
> qemu -fw_cfg opt/rootdev,file=rootdev
>
> fwconfig opt/rootdev root
> ---
> docs/grub.texi | 6 +++
> grub-core/Makefile.core.def | 6 +++
> grub-core/commands/fwconfig.c | 121 ++++++++++++++++++++++++++++++++++++++++++
> 3 files changed, 133 insertions(+)
> create mode 100644 grub-core/commands/fwconfig.c
>
> diff --git a/docs/grub.texi b/docs/grub.texi
> index 4469638..4f8a378 100644
> --- a/docs/grub.texi
> +++ b/docs/grub.texi
> @@ -3818,6 +3818,7 @@ you forget a command, you can run the command @command{help}
> * eval:: Evaluate agruments as GRUB commands
> * export:: Export an environment variable
> * false:: Do nothing, unsuccessfully
> +* fwconfig:: Retrieves a value from the qemu fwcfg store
> * getenv:: Retrieve an EFI firmware variable
> * gettext:: Translate a string
> * gptsync:: Fill an MBR based on GPT entries
> @@ -4259,6 +4260,11 @@ Do nothing, unsuccessfully. This is mainly useful in control constructs
> such as @code{if} and @code{while} (@pxref{Shell-like scripting}).
> @end deffn
>
> +@node fwconfig
> +@subsection fwconig
> +@deffn Command fwconfig fwpath envvar
> +Retrieves @var{fwpath} from the qemu fwcfg store and stores it in @var{envvar}
> +
> @node getenv
> @subsection getenv
>
> diff --git a/grub-core/Makefile.core.def b/grub-core/Makefile.core.def
> index db77a7f..f6b6f38 100644
> --- a/grub-core/Makefile.core.def
> +++ b/grub-core/Makefile.core.def
> @@ -2362,3 +2362,9 @@ module = {
> common = loader/i386/xen_file64.c;
> extra_dist = loader/i386/xen_fileXX.c;
> };
> +
> +module = {
> + name = fwconfig;
> + common = commands/fwconfig.c;
> + enable = x86;
> +};
> diff --git a/grub-core/commands/fwconfig.c b/grub-core/commands/fwconfig.c
> new file mode 100644
> index 0000000..289d167
> --- /dev/null
> +++ b/grub-core/commands/fwconfig.c
> @@ -0,0 +1,121 @@
> +/* fwconfig.c - command to read config from qemu fwconfig */
> +/*
> + * GRUB -- GRand Unified Bootloader
> + * Copyright (C) 2015 CoreOS, Inc.
Hmm,
See https://www.gnu.org/licenses/why-assign.html
> + *
> + * GRUB is free software: you can redistribute it and/or modify
> + * it under the terms of the GNU General Public License as published by
> + * the Free Software Foundation, either version 3 of the License, or
> + * (at your option) any later version.
So what is your option here (see the 'at your option').
> + *
> + * GRUB is distributed in the hope that it will be useful,
> + * but WITHOUT ANY WARRANTY; without even the implied warranty of
> + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
> + * GNU General Public License for more details.
> + *
> + * You should have received a copy of the GNU General Public License
> + * along with GRUB. If not, see <http://www.gnu.org/licenses/>.
> + */
next prev parent reply other threads:[~2017-01-24 14:52 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-01-23 23:43 [PATCH] Add fwconfig command Matthew Garrett
2017-01-24 14:52 ` Konrad Rzeszutek Wilk [this message]
2017-01-24 16:36 ` Colin Watson
2017-01-24 16:40 ` Konrad Rzeszutek Wilk
2017-01-24 17:36 ` Colin Watson
2017-01-24 18:18 ` Thomas Schmitt
2017-01-24 18:48 ` Lennart Sorensen
2017-01-25 18:05 ` Andrei Borzenkov
-- strict thread matches above, loose matches on Subject: below --
2017-01-24 0:32 Matthew Garrett
2017-01-24 19:49 ` Daniel Kiper
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=20170124145235.GE17957@char.us.oracle.com \
--to=konrad.wilk@oracle.com \
--cc=grub-devel@gnu.org \
--cc=mjg59@coreos.com \
/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.