From mboxrd@z Thu Jan 1 00:00:00 1970 From: Bryan Kadzban Date: Sat, 08 Aug 2009 03:12:39 +0000 Subject: Re: Can udev match on metadata from the partition table map itself? Message-Id: <4A7CED27.1000304@kadzban.is-a-geek.net> MIME-Version: 1 Content-Type: multipart/mixed; boundary="------------enig97876A92D963A1013315529A" List-Id: References: In-Reply-To: To: linux-hotplug@vger.kernel.org This is an OpenPGP/MIME signed message (RFC 2440 and 3156) --------------enig97876A92D963A1013315529A Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable James Cheng wrote: > I want to have a rule that matches against the name in the Apple=20 > Partition Map, rather than one that matches against the ext2=20 > filesystem name. >=20 > Is there any easy way to do this? I can think of some ugly hack, by=20 > running a PROGRAM to set some variables with the name from the=20 > partition map, and then matching against those. Any ideas for=20 > 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 >=3D 2.15) in udev >=3D 142 or 143 or som= e 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... --------------enig97876A92D963A1013315529A Content-Type: application/pgp-signature; name="signature.asc" Content-Description: OpenPGP digital signature Content-Disposition: attachment; filename="signature.asc" -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.9 (GNU/Linux) Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org iEYEAREDAAYFAkp87S0ACgkQYasYN+YI5W6IeACeOYrCCXKKrIENx/5Ubcls5GtL 3wkAn1tYVAxs1FG6/sTDoncXlPNnPvm8 =V1Bm -----END PGP SIGNATURE----- --------------enig97876A92D963A1013315529A--