From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from list by lists.gnu.org with archive (Exim 4.71) id 1Zq9Sj-0007fZ-KR for mharc-grub-devel@gnu.org; Sat, 24 Oct 2015 20:47:05 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:51023) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Zq9Sg-0007fQ-VQ for grub-devel@gnu.org; Sat, 24 Oct 2015 20:47:03 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Zq9Sc-0006H8-UJ for grub-devel@gnu.org; Sat, 24 Oct 2015 20:47:02 -0400 Received: from userp1040.oracle.com ([156.151.31.81]:36319) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Zq9Sc-0006GY-Ne for grub-devel@gnu.org; Sat, 24 Oct 2015 20:46:58 -0400 Received: from aserv0021.oracle.com (aserv0021.oracle.com [141.146.126.233]) by userp1040.oracle.com (Sentrion-MTA-4.3.2/Sentrion-MTA-4.3.2) with ESMTP id t9P0koEc029097 (version=TLSv1 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK); Sun, 25 Oct 2015 00:46:52 GMT Received: from userv0122.oracle.com (userv0122.oracle.com [156.151.31.75]) by aserv0021.oracle.com (8.13.8/8.13.8) with ESMTP id t9P0klDt031443 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=FAIL); Sun, 25 Oct 2015 00:46:47 GMT Received: from abhmp0015.oracle.com (abhmp0015.oracle.com [141.146.116.21]) by userv0122.oracle.com (8.13.8/8.13.8) with ESMTP id t9P0kkC1029545; Sun, 25 Oct 2015 00:46:46 GMT Received: from konrad-lan.dumpdata.com (/209.6.196.81) by default (Oracle Beehive Gateway v4.0) with ESMTP ; Sat, 24 Oct 2015 17:46:46 -0700 Date: Sat, 24 Oct 2015 20:46:44 -0400 From: Konrad Rzeszutek Wilk To: The development of GNU GRUB Subject: Re: [PATCH grub-core/kern/xen/init.c] pvgrub2 xen cmdline xenstore var to grubenv Message-ID: <20151025004644.GD16672@konrad-lan.dumpdata.com> References: <1445645493-24798-1-git-send-email-pryorm09@gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1445645493-24798-1-git-send-email-pryorm09@gmail.com> User-Agent: Mutt/1.5.23 (2014-03-12) X-Source-IP: aserv0021.oracle.com [141.146.126.233] X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.4.x-2.6.x [generic] X-Received-From: 156.151.31.81 Cc: ian.campbell@citrix.com 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: Sun, 25 Oct 2015 00:47:04 -0000 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 > --- > 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