John_Hull | 2 Sep 2005 17:13
Picon
Favicon

RE: Udev support for EDD


>How about "by-firmware-id" to match the kernel sysfs name?
>Or putting the links just in /dev/disk/by-id/* with an edd- prefix?

I don't have any particular preference on what to name the directory;
"by-bios-id", "by-firmware-id", or "by-edd-id" are all fine by me. Ild
rather do that, though, than put the links in /dev/disk/by-id.

> To match the int13_dev8* device to the kernel block device, the 
> "mbr_signature" for the device exposed by EDD must be matched to the 
> disk signature read directly from the device by a user-space program 
> (signature is 4-bytes long starting at offset 0x1B8 on the disk). To 
> ensure that each disk can be matched to the corresponding BIOS disk, 
> each disk should have a unique disk signature. In my current 
> implementation with udev, I pass the kernel device (hd* or sd*) to a 
> bash script which reads its signature and then tries to match it to a 
> corresponding mbr_signature in the int13_dev* directories. If there is

> a unique match, it returns this directory to udev, and returns nothing

> otherwise.
> 
> I have placed a rules file and the script that it calls here:
> http://linux.dell.com/files/edd/udev/, as well as a Python module that

> can be used to read and write the signatures. Please review my 
> approach and let me know how I can improve this for eventual inclusion
with udev.

>The edd_id.sh should not check for a loaded module, otherwise it will
not work with compiled in EDD, right?

Agreed...I hadn't thought of that. The solution of just checking that
/sys/firmware/edd exists is definitely the better solution

>What is this -t option for? You need to pass an option to the program
and it just checks if the option equals "disk"?

That was my hack to make sure it only does the check for disk devices,
and not things like CD-ROMs. I'm sure there is a better way.

> I did a quick conversion to C. :) So we can use in in initramfs
without all the tools needed by the shell script. Please have a look at
it...

I did it in bash just to get do a proof-of-concept for review (plus my C
is rusty). C certainly makes more sense, so I'm glad tyou wrote that Kay
:-). The code looks good to me, so start testing with it. 

     John

-------------------------------------------------------
SF.Net email is Sponsored by the Better Software Conference & EXPO
September 19-22, 2005 * San Francisco, CA * Development Lifecycle Practices
Agile & Plan-Driven Development * Managing Projects & Teams * Testing & QA
Security * Process Improvement & Measurement * http://www.sqe.com/bsce5sf

Gmane