James Cheng wrote: > I want to have a rule that matches against the name in the Apple > Partition Map, rather than one that matches against the ext2 > filesystem name. > > Is there any easy way to do this? I can think of some ugly hack, by > running a PROGRAM to set some variables with the name from the > partition map, and then matching against those. Any ideas for > alternatives? That "ugly hack" is actually exactly what udev does to find the ext2 filesystem label. (Though it doesn't use PROGRAM, it uses IMPORT. But either way.) It runs /lib/udev/vol_id in older versions of udev, and /sbin/blkid (from util-linux-ng >= 2.15) in udev >= 142 or 143 or some version around there. This program reads the ext2 label from the FS metadata, and prints it out (along with lots of other values, like the filesystem's UUID). See /lib/udev/rules.d/60-persistent-storage.rules for the rule used to call the program in question. If the kernel driver for the partition map exposes this name in sysfs somewhere, then you can probably use that value instead -- but I think that's unlikely...
Attachment:
signature.asc
Description: OpenPGP digital signature