[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

debian upgrades and extracting kopt from menu.lst (Re: LVM on debian)

From: Robert Millan
Subject: debian upgrades and extracting kopt from menu.lst (Re: LVM on debian)
Date: Tue, 8 Jan 2008 13:10:29 +0100
User-agent: Mutt/1.5.13 (2006-08-11)

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

<GPLv2> I know my rights; I want my phone call!
<DRM> What use is a phone call, if you are unable to speak?
(as seen on /.)

reply via email to

[Prev in Thread] Current Thread [Next in Thread]