From mboxrd@z Thu Jan 1 00:00:00 1970 From: md@Linux.IT (Marco d'Itri) Date: Sun, 22 May 2005 00:59:28 +0000 Subject: Re: new release of udev? Message-Id: <20050522005928.GA16995@wonderland.linux.it> MIME-Version: 1 Content-Type: multipart/mixed; boundary="rJwd6BRFiFCcLxzm" List-Id: References: <20050519065848.GA25640@kroah.com> In-Reply-To: <20050519065848.GA25640@kroah.com> To: linux-hotplug@vger.kernel.org --rJwd6BRFiFCcLxzm Content-Type: multipart/mixed; boundary="WIyZ46R2i8wDzkSu" Content-Disposition: inline --WIyZ46R2i8wDzkSu Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On May 20, Kay Sievers wrote: > > Why not? I think it's a very reasonable request. Different people have > > different ideas about /dev. >=20 > Well I still don't see a real need for this. Anyway, what about some > "final assignments" instead: > GROUP:=3D"mygroup" or > SYMLINK:=3D"mylink" > would set the value unchangeable for later rules. That may give us finer > grained control and if you leave the permissions alone with your > user-rule you still get the systems default. I don't get it... Now you invented a third kind of assignment, and you say that all this is simpler to use and to understand than just supporting OPTIONS=3D"last_run_rule" (which would also allow overriding the RUN rules and simplify the rules for the console devices). I'm attaching a patch which shows how simple supporting this would be. --=20 ciao, Marco --WIyZ46R2i8wDzkSu Content-Type: text/plain; charset=us-ascii Content-Disposition: attachment; filename="last_run_rule.diff" Content-Transfer-Encoding: quoted-printable diff -ruNp udev-058.orig/udev_rules.c udev-058/udev_rules.c --- udev-058.orig/udev_rules.c 2005-05-20 22:18:28.000000000 +0200 +++ udev-058/udev_rules.c 2005-05-22 02:48:33.000000000 +0200 @@ -942,7 +942,7 @@ int udev_rules_get_run(struct udevice *u dbg("add run '%s'", program); name_list_add(&udev->run_list, program, 0); =20 - if (rule->last_rule) { + if (rule->last_run_rule) { dbg("last rule to be applied"); break; } diff -ruNp udev-058.orig/udev_rules.h udev-058/udev_rules.h --- udev-058.orig/udev_rules.h 2005-05-20 22:18:28.000000000 +0200 +++ udev-058/udev_rules.h 2005-05-22 02:49:10.000000000 +0200 @@ -47,6 +47,7 @@ #define KEY_OPTIONS "OPTIONS" =20 #define OPTION_LAST_RULE "last_rule" +#define OPTION_LAST_RUN_RULE "last_run_rule" #define OPTION_IGNORE_DEVICE "ignore_device" #define OPTION_IGNORE_REMOVE "ignore_remove" #define OPTION_PARTITIONS "all_partitions" @@ -102,6 +103,7 @@ struct udev_rule { char run[PATH_SIZE]; =20 int last_rule; + int last_run_rule; int ignore_device; int ignore_remove; int partitions; diff -ruNp udev-058.orig/udev_rules_parse.c udev-058/udev_rules_parse.c --- udev-058.orig/udev_rules_parse.c 2005-05-20 22:18:28.000000000 +0200 +++ udev-058/udev_rules_parse.c 2005-05-22 02:52:05.000000000 +0200 @@ -53,11 +53,13 @@ static int add_config_dev(struct udev_ru "sysfs_file[0]=3D'%s', sysfs_value[0]=3D'%s', " "kernel=3D'%s', program=3D'%s', result=3D'%s', " "owner=3D'%s', group=3D'%s', mode=3D%#o, " - "all_partions=3D%u, ignore_remove=3D%u, ignore_device=3D%u, last_rule= =3D%u", + "all_partions=3D%u, ignore_remove=3D%u, ignore_device=3D%u, " + "last_rule=3D%u, last_run_rule=3D%u", rule->name, rule->symlink, rule->bus, rule->id, rule->sysfs_pair[0].name, rule->sysfs_pair[0].value, rule->kernel, rule->program, rule->result, rule->owner, rule->group, = rule->mode, - rule->partitions, rule->ignore_remove, rule->ignore_device, rule->las= t_rule); + rule->partitions, rule->ignore_remove, rule->ignore_device, + rule->last_rule, rule->last_run_rule); =20 return 0; } @@ -397,6 +399,10 @@ static int rules_parse(const char *filen dbg("last rule to be applied"); rule.last_rule =3D 1; } + if (strstr(value, OPTION_LAST_RUN RULE) !=3D NULL) { + dbg("last run rule to be applied"); + rule.last_run_rule =3D 1; + } if (strstr(value, OPTION_IGNORE_DEVICE) !=3D NULL) { dbg("device should be ignored"); rule.ignore_device =3D 1; --WIyZ46R2i8wDzkSu-- --rJwd6BRFiFCcLxzm Content-Type: application/pgp-signature; name="signature.asc" Content-Description: Digital signature Content-Disposition: inline -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.1 (GNU/Linux) iD8DBQFCj9lwFGfw2OHuP7ERAkj5AJ45Xm6DRb42zpk8gmENKuclUUU7rgCffukA +nnTgTOxDFGvVVaGlpzYsmI= =v/PE -----END PGP SIGNATURE----- --rJwd6BRFiFCcLxzm-- ------------------------------------------------------- This SF.Net email is sponsored by Oracle Space Sweepstakes Want to be the first software developer in space? Enter now for the Oracle Space Sweepstakes! http://ads.osdn.com/?ad_id=7412&alloc_id=16344&op=click _______________________________________________ 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