From mboxrd@z Thu Jan 1 00:00:00 1970 From: Andrew Patterson Date: Thu, 07 Oct 2004 00:23:05 +0000 Subject: Re: Problem parsing %s in udev rules Message-Id: <1097108585.9268.15.camel@bluto.andrew> MIME-Version: 1 Content-Type: multipart/mixed; boundary="=-9ZEfGB0yoYPC8k2sg/ml" List-Id: References: <1097105584.9273.9.camel@bluto.andrew> In-Reply-To: <1097105584.9273.9.camel@bluto.andrew> To: linux-hotplug@vger.kernel.org --=-9ZEfGB0yoYPC8k2sg/ml Content-Type: text/plain Content-Transfer-Encoding: quoted-printable On Thu, 2004-10-07 at 01:50 +0200, Kay Sievers wrote: > On Wed, Oct 06, 2004 at 05:33:04PM -0600, Andrew Patterson wrote: > > Udev seems to be chopping off anything seen in a rule after a %s. For > > example, if I have the following rule: > >=20 > > BUS=3D"scsi", KERNEL=3D"sd*", PROGRAM=3D"/sbin/scsi_id", NAME=3D"%k", > > SYMLINK=3D"scsi_disks/some-proceeding-stuff-%s{model}-some-following- > > stuff" > >=20 > > Everything after the %s{model} is ignored. > >=20 > > Furthermore, everything in model following whitespace is ignored as > > well. I.e, if model contains "HP 34.7G", the resulting device file > > created is /dev/scsi_disks/some-proceeding-stuff-HP. > >=20 > > I used the following command to run this test: > >=20 > > # DEVPATH=3D/block/sda ACTION=3Dadd ./udev block > >=20 > > I also get the same behavior when using udevstart (patched to fix > > parameter passing problems). >=20 > If your sysfs value contains spaces, which is the delimiter for multiple > symlinks, it will not work. >=20 > udev can't do this now, you need to wrap the call with an external script= , > which ensures sane values. >=20 That explains the spaces. What about stuff trailing %s, if %s does not contain spaces. I.e, in the above example, model is ST336753LC and the resulting device file is /dev/scsi_disks/some-proceding-stuff- ST336753LC. Andrew > Kay >=20 --=20 Andrew Patterson =20 Hewlett-Packard --=-9ZEfGB0yoYPC8k2sg/ml Content-Type: application/pgp-signature; name=signature.asc Content-Description: This is a digitally signed message part -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.2.5 (GNU/Linux) iD8DBQBBZIxpoKXgdXvblSgRAuKtAKDqqVLqdWNdEz06sNHTGEQfav3ilQCg21PK CZzeo4ZooC9qcjhAghyiKQc= =t612 -----END PGP SIGNATURE----- --=-9ZEfGB0yoYPC8k2sg/ml-- ------------------------------------------------------- This SF.net email is sponsored by: IT Product Guide on ITManagersJournal Use IT products in your business? Tell us what you think of them. Give us Your Opinions, Get Free ThinkGeek Gift Certificates! Click to find out more http://productguide.itmanagersjournal.com/guidepromo.tmpl _______________________________________________ Linux-hotplug-devel mailing list http://linux-hotplug.sourceforge.net Linux-hotplug-devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/linux-hotplug-devel