[syslinux] Append boot device to /proc/cmdline

Sven-Hendrik Haase sh at lutzhaase.com
Sat Nov 28 13:14:40 PST 2009


Keep in mind though that the FS might as well be UDF or VFAT.

On 28.11.2009 19:28, Patrick Verner wrote:
> I got some ideas. When isolinux is the boot loader APPEND the file system type to /proc/cmdline. This will be ISO9660 almost 100% of the time for Linux LiveCDs. Why would somebody have the exact LiveCD in two CDROM drives in the same computer?
>
> If syslinux is used, simply apply the size of the device to /proc/cmdline. This should narrow it down enough to minimize misfired boots.
>
> examples:
> ISOLINUX_FS=ISO9660
> SYSLINUX_BOOT_DEV_SIZE=256MB
>
> If this method fails to find the device somebody might be running an iso image through memdisk and a fall back routine could be put in place to properly deal with iso image booting. I can see where Bernd Blaauw is coming from.
>
> If we had even vague information about the boot device in the initramfs, it would be a huge step away from "try mounting" every device and flat out using the wrong one.
>
> If ISOLINUX_FS=ISO9660 is found, don't even bother mounting sd devices. If it's a sr device it can be added to the try mount list first. If a hd device is found we can use blkid to see if it's a cdrom drive and not a hard disk. Then the hd device can be added to the try mount list.
>
> If SYSLINUX_BOOT_DEV_SIZE=256MB is found we simply use a hd or sd device of the same size.
>
> In rare cases more than one device might need to be checked for the physical squashfs because there is more than one CDROM drive containing a CD or there are two disk partitions exactly the same size with the boot flag enabled. In most cases the try mount list should only contain one device to physically mount and then access the squashfs image.
>
> Just tossing some ideas out there...
>
> Patrick
>
> --- On Sat, 11/28/09, H. Peter Anvin <hpa at zytor.com> wrote:
>
>   
>> From: H. Peter Anvin <hpa at zytor.com>
>> Subject: Re: [syslinux] Append boot device to /proc/cmdline
>> To: syslinux at zytor.com
>> Date: Saturday, November 28, 2009, 12:57 AM
>> 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