From: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>
To: The development of GNU GRUB <grub-devel@gnu.org>
Cc: ian.campbell@citrix.com
Subject: Re: [PATCH grub-core/kern/xen/init.c] pvgrub2 xen cmdline xenstore var to grubenv
Date: Sat, 24 Oct 2015 20:46:44 -0400 [thread overview]
Message-ID: <20151025004644.GD16672@konrad-lan.dumpdata.com> (raw)
In-Reply-To: <1445645493-24798-1-git-send-email-pryorm09@gmail.com>
On Fri, Oct 23, 2015 at 05:11:33PM -0700, Mark Pryor wrote:
> When entering the grub2 shell during a pvgrub2 boot, there is no info about the current
> domU in the grubenv (set). Starting with a patch submitted by Olaf Herring I exported
Which patch? Is there a name for it so it can be part of the
git commit history?
Thanks.
> the xenstore cmdline only.
>
> The env var, xen_cmdline, can then be used in the top level script used to make
> the pvgrub2 kernel blob.
>
> Signed-off-by: Mark Pryor <pryorm09@gmail.com>
> ---
> grub-core/kern/xen/init.c | 25 +++++++++++++++++++++++++
> 1 file changed, 25 insertions(+)
>
> diff --git a/grub-core/kern/xen/init.c b/grub-core/kern/xen/init.c
> index 0559c03..2a3112d 100644
> --- a/grub-core/kern/xen/init.c
> +++ b/grub-core/kern/xen/init.c
> @@ -524,6 +524,29 @@ map_all_pages (void)
> grub_mm_init_region ((void *) heap_start, heap_end - heap_start);
> }
>
> +/*
> + * Find all name=val pairs in the provided cmd_line and export them
> + * so that scripts can evaluate the variables for their own purpose.
> + */
> +static void
> +export_cmdline (void)
> +{
> + char *p;
> + const char *name="xen_cmdline";
> +
> + p = grub_malloc (MAX_GUEST_CMDLINE + 1);
> + if (!p)
> + return;
> +
> + grub_memcpy (p, grub_xen_start_page_addr->cmd_line, MAX_GUEST_CMDLINE);
> + p[MAX_GUEST_CMDLINE] = '\0';
> +
> + grub_env_set (name, p);
> + grub_env_export (name);
> +
> + grub_free (p);
> +}
> +
> extern char _end[];
>
> void
> @@ -539,6 +562,8 @@ grub_machine_init (void)
>
> map_all_pages ();
>
> + export_cmdline ();
> +
> grub_console_init ();
>
> grub_tsc_init ();
> --
> 2.1.4
>
>
> _______________________________________________
> Grub-devel mailing list
> Grub-devel@gnu.org
> https://lists.gnu.org/mailman/listinfo/grub-devel
next prev parent reply other threads:[~2015-10-25 0:47 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-10-24 0:11 [PATCH grub-core/kern/xen/init.c] pvgrub2 xen cmdline xenstore var to grubenv Mark Pryor
2015-10-25 0:46 ` Konrad Rzeszutek Wilk [this message]
2015-11-02 12:12 ` Ian Campbell
2015-11-04 11:20 ` Vladimir 'phcoder' Serbinenko
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=20151025004644.GD16672@konrad-lan.dumpdata.com \
--to=konrad.wilk@oracle.com \
--cc=grub-devel@gnu.org \
--cc=ian.campbell@citrix.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.