[syslinux] [Fwd: Re: extlinux reports "./extlinux: path /media/disk doesn't match device /dev/sda4"]

Casual Programmer casualprogrammer at yahoo.com
Sat Jan 26 18:10:02 PST 2008


The problem as I view it, lies in specifying a
directory rather than a drive ( /mnt/.. or /media..
instead of /dev/sdb.. or /dev/sdc.. ). 

If, for instance, /dev/sdb1 is in fact mounted to
/media/disk all is fine. If the path exists and is not
a mountpoint ( /dev/sd... not 
mounted to it ), then extlinux will set the system
disk as base for the directory. ( i.e. /media/disk =
/dev/sda4 in my setup ), at this 
point no user acknowledgment is required, but BR
modified and extlinux.sys written to /media/disk.

TODO: run a few tests with hpa's extlinux to verify.

DONE: ./extlinux -i /media will in fact write to
/dev/sda4 if /dev/sdb1 is not mounted here.

Attached find a patch to /extlinux/extlinux.c which
gets along without expecting a special directory for
mounting the device to be made bootable.

The idea is, that the root directory "/" will always
be on the system disk, so I just added a pass to find
the "devname" belonging to "/" then 
proceeding as normal. If the devnames for "/" and the
target directory match, extlinux aborts indicating
this fact.

The programming isn't very beautiful and might need
some honing, but basically it works. So if, for what
reason ever, a device is not mounted at 
the path given extlinux will now exit rather than
writing over the system disks boot sector.

Casual







      ____________________________________________________________________________________
Be a better friend, newshound, and 
know-it-all with Yahoo! Mobile.  Try it now.  http://mobile.yahoo.com/;_ylt=Ahu06i62sR8HDtDypao8Wcj9tAcJ 
-------------- next part --------------
A non-text attachment was scrubbed...
Name: extlinux.c.diff
Type: text/x-patch
Size: 1544 bytes
Desc: 4253174477-extlinux.c.diff
URL: <http://www.zytor.com/pipermail/syslinux/attachments/20080126/1145db1d/attachment.bin>


More information about the Syslinux mailing list