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. Patrick
On 26.11.2009 18:55, 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. > > Patrick > > > > > _______________________________________________ > Syslinux mailing list > Submissions to Syslinux at zytor.com > Unsubscribe or set options at: > http://www.zytor.com/mailman/listinfo/syslinux > Please do not send private replies to mailing list traffic. > > >I'd like to reinforce this request (for what it's worth). Guessing the boot device usually works out on clean configurations but sometimes it does not and when it does not it is indeed rather frustrating and hard to debug. Partrick's suggested way would work great for me. -- Sven-Hendrik
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.