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

Bug#697017: root=compute fails at parse_numeric() for lilo compatibility



On Sun, 30 Dec 2012 15:58:14 -0500 (EST), Gabriel Klawitter wrote:
> 
> Package: initramfs-tools
> Version: 0.109
> 
> Dear Maintainer,
> 
> I'm using your package to set up a netboot environment where I use a
> script at local-bottom to retrieve a image to extract it into a tmpfs.
> The kernel command line looks as follows:
> 
> rw rootfstype=tmpfs root=compute
> imgurl=http://10.0.0.254/profiles/compute.xz ip=eth0 ipv6.disable=1
> 
> This is working in any case when the root= option doesn't start with an
> hex digit, else parse_numeric tries to parse it as hex value in complete.
> 
> I don't know why this [A-Fa-f0-9]*) case switch is necessary, but maybe
> it could be made a little more precise.
> 
> Unfortunately I don't have a clue how.
> 
> I'm using Debian GNU/Linux wheezy up to date.

Gabriel,

I am not one of the Debian package maintainers for the initramfs-tools
package, but I am familiar with the LILO boot loader and why that logic
is there.  I just happened to see this bug report and thought I might
attempt an explanation.

When the lilo command sees the root file system specified by means of a
block special file name, such as

   root=/dev/sda2

or by means of a symbolic link to a block special file name, such as

   root=/dev/disk/by-id/...

it translates this specification into the kernel major and minor device
numbers associated with the device at the time the lilo command is issued.
In the above case, this would be major device number 0x08 (used by the SCSI
driver) and minor device number 0x02.  At boot time, LILO will use this
as a specification for the root file system as the concatenation of these
two numbers, major number first, with leading zeros suppressed.
For example,

   root=802

This historic behavior of lilo/LILO dates back to the days before udev
(and its predecessor, devfs).  The idea was that maybe the mknod command
for the root file system might be missing from /dev; so using the kernel
major and minor device numbers was a way around this.  Today, with udev,
and especially since the assignment of kernel device numbers and user space
device names is no longer predictable, as it once was, the use of a
traditional block special file name, or a symbolic link to a block special
file name, is no longer recommended.  The LILO developers recommend the use
of the form

   root="UUID=xxx"

or

   root="LABEL=xxx"

However, initramfs-tools still has to have logic in it to interpret a
string of hexadecimal characters as a major/minor device number specification
to accomodate the historic behavior of LILO that will occur if the user
specifies a block special file name or a symbolic link to a block special
file name.

For more information, see my LILO web page:

   http://users.wowway.com/~zlinuxman/lilo.htm

I hope this helps.

-- 
  .''`.     Stephen Powell    
 : :'  :
 `. `'`
   `-


Reply to: