linux-hotplug.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: md@Linux.IT (Marco d'Itri)
To: linux-hotplug@vger.kernel.org
Subject: Re: new release of udev?
Date: Sun, 22 May 2005 00:59:28 +0000	[thread overview]
Message-ID: <20050522005928.GA16995@wonderland.linux.it> (raw)
In-Reply-To: <20050519065848.GA25640@kroah.com>


[-- Attachment #1.1: Type: text/plain, Size: 882 bytes --]

On May 20, Kay Sievers <kay.sievers@vrfy.org> wrote:

> > Why not? I think it's a very reasonable request. Different people have
> > different ideas about /dev.
> 
> Well I still don't see a real need for this. Anyway, what about some
> "final assignments" instead:
>   GROUP:="mygroup" or
>   SYMLINK:="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="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.

-- 
ciao,
Marco

[-- Attachment #1.2: last_run_rule.diff --]
[-- Type: text/plain, Size: 2522 bytes --]

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);
 
-		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"
 
 #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];
 
 	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]='%s', sysfs_value[0]='%s', "
 	    "kernel='%s', program='%s', result='%s', "
 	    "owner='%s', group='%s', mode=%#o, "
-	    "all_partions=%u, ignore_remove=%u, ignore_device=%u, last_rule=%u",
+	    "all_partions=%u, ignore_remove=%u, ignore_device=%u, "
+	    "last_rule=%u, last_run_rule=%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->last_rule);
+	    rule->partitions, rule->ignore_remove, rule->ignore_device,
+	    rule->last_rule, rule->last_run_rule);
 
 	return 0;
 }
@@ -397,6 +399,10 @@ static int rules_parse(const char *filen
 					dbg("last rule to be applied");
 					rule.last_rule = 1;
 				}
+				if (strstr(value, OPTION_LAST_RUN RULE) != NULL) {
+					dbg("last run rule to be applied");
+					rule.last_run_rule = 1;
+				}
 				if (strstr(value, OPTION_IGNORE_DEVICE) != NULL) {
 					dbg("device should be ignored");
 					rule.ignore_device = 1;

[-- Attachment #2: Digital signature --]
[-- Type: application/pgp-signature, Size: 189 bytes --]

  parent reply	other threads:[~2005-05-22  0:59 UTC|newest]

Thread overview: 23+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2005-05-19  6:58 new release of udev? Greg KH
2005-05-19  7:30 ` Kay Sievers
2005-05-19  7:55 ` Greg KH
2005-05-19 10:32 ` Marco d'Itri
2005-05-19 14:12 ` Kay Sievers
2005-05-19 16:09 ` Marco d'Itri
2005-05-19 17:49 ` Darren Salt
2005-05-19 21:02 ` Greg KH
2005-05-19 21:24 ` Darren Salt
2005-05-19 22:31 ` Kay Sievers
2005-05-22  0:59 ` Marco d'Itri [this message]
2005-05-22  1:09 ` Kay Sievers
2005-05-22 12:01 ` Marco d'Itri
2005-05-22 12:42 ` Kay Sievers
2005-05-22 12:55 ` Marco d'Itri
2005-05-22 13:00 ` Kay Sievers
2005-05-22 13:07 ` Marco d'Itri
2005-05-22 17:38 ` Kay Sievers
2005-05-23  6:52 ` Hannes Reinecke
2005-05-23  7:34 ` Marco d'Itri
2005-05-23  9:43 ` Marco d'Itri
2005-06-20 18:10 ` Marco d'Itri
2005-06-20 20:40 ` Kay Sievers

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20050522005928.GA16995@wonderland.linux.it \
    --to=md@linux.it \
    --cc=linux-hotplug@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).