[syslinux] Append boot device to /proc/cmdline

H. Peter Anvin hpa at zytor.com
Fri Nov 27 21:57:44 PST 2009


On 11/26/2009 09:55 AM, Patrick Verner wrote:
> Would it be possible to append the device syslinux booted from to /proc/cmdline? It would be nice to have a method of grepping /proc and /sys to locate the correct boot device for a LiveCD/USB instead of looking for it or manually appending it to the cfg file.
> 
> I'm the creator of Parted Magic and people are starting to do odd things with it. They will boot the CD and have Parted Magic on a USB drive or HDD too. The initramfs init script has noway of knowing what device the boot loader originated from, so it's almost impossible to determine what device or squashfs the user intended to use.
> 
> I would think syslinux is aware of what device it originated from and that value could be written to /proc/cdmline like the rest of the APPEND line is. The distribution creators could simply grep /proc/cmdline and find a way to match the bios named device to the name linux (udev) gives it.
> 

Hmmm... Syslinux already provides the filesystem type it is booted from
via the bootloader ID; there is some additional information that it can
provide, e.g. device type (fd,hd,cdrom,pxe), bios number, and partition
offset (if applicable for the device type.)  This doesn't automatically
map 1:1 onto the Linux device mappings, but it's probably the best that
one can do.

	-hpa

-- 
H. Peter Anvin, Intel Open Source Technology Center
I work for Intel.  I don't speak on their behalf.




More information about the Syslinux mailing list