Received: from mailman by lists.gnu.org with archive (Exim 4.43) id 1PxNVL-0004dW-7a for mharc-grub-devel@gnu.org; Wed, 09 Mar 2011 12:48:59 -0500 Received: from [140.186.70.92] (port=55282 helo=eggs.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1PxNVE-0004Z6-Eu for grub-devel@gnu.org; Wed, 09 Mar 2011 12:48:57 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1PxNVA-00069f-Jp for grub-devel@gnu.org; Wed, 09 Mar 2011 12:48:49 -0500 Received: from smarthost01.mail.zen.net.uk ([212.23.3.140]:37798) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1PxNVA-00068j-C7 for grub-devel@gnu.org; Wed, 09 Mar 2011 12:48:48 -0500 Received: from [82.69.40.219] (helo=riva.pelham.vpn.ucam.org) by smarthost01.mail.zen.net.uk with esmtps (TLS-1.0:RSA_AES_256_CBC_SHA1:32) (Exim 4.63) (envelope-from ) id 1PxNV6-0001ki-6y; Wed, 09 Mar 2011 17:48:44 +0000 Received: from cjwatson by riva.pelham.vpn.ucam.org with local (Exim 4.72) (envelope-from ) id 1PxNV3-0002Ku-0M; Wed, 09 Mar 2011 17:48:41 +0000 Date: Wed, 9 Mar 2011 17:48:40 +0000 From: Colin Watson To: Ian Jackson , 617538@bugs.debian.org Message-ID: <20110309174840.GN31494@riva.ucam.org> References: <19831.45049.172606.321868@mariner.uk.xensource.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <19831.45049.172606.321868@mariner.uk.xensource.com> User-Agent: Mutt/1.5.20 (2009-06-14) X-Originating-Smarthost01-IP: [82.69.40.219] X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6 (newer, 3) X-Received-From: 212.23.3.140 Cc: grub-devel@gnu.org Subject: Re: Bug#617538: update-grub (mk-grubconfig) does not support old "xenkopt" X-BeenThere: grub-devel@gnu.org X-Mailman-Version: 2.1.5 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: Wed, 09 Mar 2011 17:48:57 -0000 On Wed, Mar 09, 2011 at 04:51:05PM +0000, Ian Jackson wrote: > The grub 2 config generator does not appear to support an equivalent > to the "xenkopt" option from old (grub 1) update-grub. > > This is used to provide kernel command line arguments that apply only > when booting the kernel under Xen. For example, a pvops kernel which > can boot dom0 vs. baremetal, and where a serial console is in use, > would normally want > kopt="console=ttyS0,115200,8n1" > xenkopt="console=hvc0" > since when booting under Xen the kernel needs to use the Xen console > rather than direct access to the serial port. > > I suggest adding two variables > GRUB_CMDLINE_LINUX_XEN > GRUB_CMDLINE_LINUX_XEN_DEFAULT > which when specified /override/ the values of > GRUB_CMDLINE_LINUX > GRUB_CMDLINE_LINUX_DEFAULT Seems reasonable, although I think the naming is confusing; it's not necessarily obvious that GRUB_CMDLINE_LINUX_XEN overrides GRUB_CMDLINE_LINUX while GRUB_CMDLINE_XEN appends to it. How about GRUB_CMDLINE_LINUX_XEN_REPLACE and GRUB_CMDLINE_LINUX_XEN_REPLACE_DEFAULT? They're a bit long, but ... (CCing patch to grub-devel.) 2011-03-09 Colin Watson * util/grub.d/20_linux_xen.in: Honour GRUB_CMDLINE_LINUX_XEN_REPLACE and GRUB_CMDLINE_LINUX_XEN_REPLACE_DEFAULT, which replace GRUB_CMDLINE_LINUX and GRUB_CMDLINE_LINUX_DEFAULT (complementing the existing options which append). * docs/grub.texi (Simple configuration): Document new options. === modified file 'docs/grub.texi' --- docs/grub.texi 2011-03-09 17:35:16 +0000 +++ docs/grub.texi 2011-03-09 17:46:20 +0000 @@ -1114,8 +1114,14 @@ NetBSD. @item GRUB_CMDLINE_XEN @itemx GRUB_CMDLINE_XEN_DEFAULT -As @samp{GRUB_CMDLINE_LINUX} and @samp{GRUB_CMDLINE_LINUX_DEFAULT}, but for -Linux and Xen. +The values of these options are appended to the values of +@samp{GRUB_CMDLINE_LINUX} and @samp{GRUB_CMDLINE_LINUX_DEFAULT} for Linux +and Xen menu entries. + +@item GRUB_CMDLINE_LINUX_XEN_REPLACE +@item GRUB_CMDLINE_LINUX_XEN_REPLACE_DEFAULT +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_DISABLE_LINUX_UUID Normally, @command{grub-mkconfig} will generate menu entries that use === modified file 'util/grub.d/20_linux_xen.in' --- util/grub.d/20_linux_xen.in 2011-02-11 13:00:54 +0000 +++ util/grub.d/20_linux_xen.in 2011-03-09 17:44:27 +0000 @@ -51,6 +51,14 @@ else LINUX_ROOT_DEVICE=UUID=${GRUB_DEVICE_UUID} fi +# Allow overriding GRUB_CMDLINE_LINUX and GRUB_CMDLINE_LINUX_DEFAULT. +if [ "${GRUB_CMDLINE_LINUX_XEN_REPLACE}" ]; then + GRUB_CMDLINE_LINUX="${GRUB_CMDLINE_LINUX_XEN_REPLACE}" +fi +if [ "${GRUB_CMDLINE_LINUX_XEN_REPLACE_DEFAULT}" ]; then + GRUB_CMDLINE_LINUX_DEFAULT="${GRUB_CMDLINE_LINUX_XEN_REPLACE_DEFAULT}" +fi + linux_entry () { os="$1" -- Colin Watson [cjwatson@ubuntu.com]