Received: from mailman by lists.gnu.org with archive (Exim 4.43) id 1JCDJl-0003ar-BK for mharc-grub-devel@gnu.org; Tue, 08 Jan 2008 07:12:29 -0500 Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1JCDJi-0003aV-Lz for grub-devel@gnu.org; Tue, 08 Jan 2008 07:12:26 -0500 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1JCDJh-0003a9-GJ for grub-devel@gnu.org; Tue, 08 Jan 2008 07:12:25 -0500 Received: from [199.232.76.173] (helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1JCDJh-0003a6-BJ for grub-devel@gnu.org; Tue, 08 Jan 2008 07:12:25 -0500 Received: from aybabtu.com ([69.60.117.155]) by monty-python.gnu.org with esmtps (TLS-1.0:RSA_AES_256_CBC_SHA1:32) (Exim 4.60) (envelope-from ) id 1JCDJh-0005zL-EN for grub-devel@gnu.org; Tue, 08 Jan 2008 07:12:25 -0500 Received: from [192.168.10.6] (helo=thorin) by aybabtu.com with esmtps (TLS-1.0:RSA_AES_256_CBC_SHA1:32) (Exim 4.63) (envelope-from ) id 1JCDJV-0001mf-6C for grub-devel@gnu.org; Tue, 08 Jan 2008 13:12:18 +0100 Received: from rmh by thorin with local (Exim 4.63) (envelope-from ) id 1JCDHp-0001Fu-4T for grub-devel@gnu.org; Tue, 08 Jan 2008 13:10:29 +0100 Date: Tue, 8 Jan 2008 13:10:29 +0100 From: Robert Millan To: The development of GRUB 2 Message-ID: <20080108121029.GB4270@thorin> References: <1199736618.7025.9.camel@localhost.localdomain> <20080107220751.GB23660@thorin> <1199745077.7025.38.camel@localhost.localdomain> <20080108092431.GB4044@thorin> <1199787703.7671.18.camel@localhost.localdomain> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1199787703.7671.18.camel@localhost.localdomain> Organization: free as in freedom X-Message-Flag: Worried about Outlook viruses? Switch to Thunderbird! www.mozilla.com/thunderbird X-Debbugs-No-Ack: true User-Agent: Mutt/1.5.13 (2006-08-11) X-detected-kernel: by monty-python.gnu.org: Genre and OS details not recognized. Subject: debian upgrades and extracting kopt from menu.lst (Re: LVM on debian) X-BeenThere: grub-devel@gnu.org X-Mailman-Version: 2.1.5 Precedence: list Reply-To: The development of GRUB 2 List-Id: The development of GRUB 2 List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 08 Jan 2008 12:12:26 -0000 On Tue, Jan 08, 2008 at 11:21:43AM +0100, Martin Braure de Calignon wrote: > > Ok it makes sense to not include all the variables in /etc/default/grub > because of course, /etc/default/grub should only contains variable that > do not really depends on script. But a kernel command line > personalization should be in there. If there's no default in there with > non-valued variables, it should be documented. Ah, right. I didn't understand you. You mean we should add a commented GRUB_CMDLINE_LINUX in that file? > Well, I think it can be important when you want grub2 to replace grub > because people don't want their computer do not boot any longer (some > options (noapictimer) missing can make my system unbootable). For now, > it's probably not urgent. > A simple > sed '/^# kopt=/!d;s/^# kopt=//g' /boot/grub/menu.lst > gives the kernel command line > Then one could use a "echo GRUB_CMD_LINE_LINUX=$(sed '/^# kopt=/!d;s/^# > kopt=//g' /boot/grub/menu.lst) >> /etc/default/grub > > It's probably not very robust, That's incomplete. First, kopt includes a "root=" parameter which update-grub2 generates automaticaly; that should be skipped. You need to consider what happens if you run this code multiple times, or if GRUB_CMD_LINE_LINUX was already in /etc/default/grub, etc... The hard part about this is not extracting the data, but handling all the corner cases and making sure nothing breaks. > so a better transitional solution could > be to ask in debconf for experimental importing of grub1 configuration. > If not, one could also add these informations to README.Debian In general, I really dislike documenting bugs or limitations. If the code is not robust, I think it's better to spend time in improving its robustness than documenting that it isn't robust. > I can try to do a patch for this, but I need some advices do not make > common and obvious mistakes on how manage this conversion. You need to make sure GRUB_CMD_LINE_LINUX is only added once, and only when it contains relevant info (for "ro" I don't know what it helps with, but I'd just skip it unless we see some indication that it serves a purpose). And you can't assume menu.lst exists. -- Robert Millan I know my rights; I want my phone call! What use is a phone call, if you are unable to speak? (as seen on /.)