linux-hotplug.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* udev-039-6 on Fedora Core 3
@ 2004-10-25 12:09 Harald Hoyer
  2004-10-25 15:30 ` Kay Sievers
  2004-10-25 15:36 ` Harald Hoyer
  0 siblings, 2 replies; 3+ messages in thread
From: Harald Hoyer @ 2004-10-25 12:09 UTC (permalink / raw)
  To: linux-hotplug

[-- Attachment #1: Type: text/plain, Size: 1566 bytes --]

FYI,

I added several patches to udev-039 which will be on FC3.
I only describe the most patches here. The patches itsself are in the src.rpm and can be posted on request.
The two relevant and important patches against 039 are attached.

ru
Harald

****

Patch1: udev-039-static.patch
makes inline getpwnam and getgrnam functions, which are used for the static version of udev, which is used in initramfs

Patch2: udev-025-volsbin.patch
moves volume_id from /usr/sbin to /sbin (such tools should not live in /usr, because /usr could be nfs-mounted

Patch3: udev-039-wait-error-log.patch
wait_for_sysfs patch

Patch4: udev-039-logging.patch
logging patch

Patch5: udev-039-wait-ppp-class.patch
wait_for_sysfs patch

Patch6: udev-039-wait-dm-block.patch
wait_for_sysfs patch

Patch7: udev-039-static2.patch
include wait_for_sysfs in udev for the static udev version used in initramfs

Patch8: udev-039-netif.patch
only call dev_d_send for network interfaces, if the name was changed

Patch9: udev-039-dummy.patch
wait_for_sysfs patch

Patch10: udev-039-volume_id-nonblock.patch
do not open(2) with O_NONBLOCK

Patch11: udev-039-norm.patch
add NOREMOVE keyword to the rules. this was necessary because removable ide devices were added/removed for every open(2)/close(2)
added to the rules:
KERNEL="hd[a-z]*", NOREMOVE="1"

this could eventually be refined by checking the "removable" sysfs-attribute, but not for partitions..

Patch22: udev-032-symlink.patch
replace format directives in every symlink part

Patch24: udev-038-volmak.patch
Makefile patch for volume_id


[-- Attachment #2: udev-032-symlink.patch --]
[-- Type: text/x-patch, Size: 937 bytes --]

--- udev-032/namedev.c.symlink	2004-10-06 10:38:58.760423024 +0200
+++ udev-032/namedev.c	2004-10-06 10:38:58.767421960 +0200
@@ -898,14 +898,18 @@
 
 			if (dev->symlink[0] != '\0') {
 				char temp[NAME_SIZE];
-
+				char *p;
+				int len;
 				info("configured rule in '%s' at line %i applied, added symlink '%s'",
 				     dev->config_file, dev->config_line, dev->symlink);
-				strfieldcpy(temp, dev->symlink);
-				apply_format(udev, temp, sizeof(temp), class_dev, sysfs_device);
-				if (udev->symlink[0] != '\0')
-					strfieldcat(udev->symlink, " ");
-				strfieldcat(udev->symlink, temp);
+				foreach_strpart(dev->symlink, " ", p, len) {
+					strncpy(temp, p, len);
+					temp[len] = '\0';
+					apply_format(udev, temp, sizeof(temp), class_dev, sysfs_device);
+					if (udev->symlink[0] != '\0')
+						strfieldcat(udev->symlink, " ");
+					strfieldcat(udev->symlink, temp);
+				}
 			}
 
 			if (dev->name[0] != '\0') {

[-- Attachment #3: udev-039-norm.patch --]
[-- Type: text/x-patch, Size: 3373 bytes --]

--- udev-039/namedev.h.norm	2004-10-16 00:08:29.000000000 +0200
+++ udev-039/namedev.h	2004-10-21 16:31:46.436124429 +0200
@@ -44,6 +44,7 @@
 #define FIELD_KERNEL		"KERNEL"
 #define FIELD_NAME		"NAME"
 #define FIELD_SYMLINK		"SYMLINK"
+#define FIELD_NOREMOVE		"NOREMOVE"
 #define FIELD_OWNER		"OWNER"
 #define FIELD_GROUP		"GROUP"
 #define FIELD_MODE		"MODE"
@@ -83,6 +84,7 @@
 	struct sysfs_pair sysfs_pair[MAX_SYSFS_PAIRS];
 	char owner[OWNER_SIZE];
 	char group[GROUP_SIZE];
+	char noremove;
 	unsigned int mode;
 	int partitions;
 	char config_file[NAME_SIZE];
--- udev-039/udev_remove.c.norm	2004-10-16 00:08:29.000000000 +0200
+++ udev-039/udev_remove.c	2004-10-21 16:31:46.438124139 +0200
@@ -113,6 +113,11 @@
 
 	strfieldcpy(filename, udev_root);
 	strfieldcat(filename, dev->name);
+	
+	if ( dev->noremove != 0) {
+		info("not removing device node '%s', because of rule", filename);
+		return 0;
+	}
 
 	info("removing device node '%s'", filename);
 	retval = secure_unlink(filename);
--- udev-039/namedev_parse.c.norm	2004-10-16 00:08:29.000000000 +0200
+++ udev-039/namedev_parse.c	2004-10-21 16:37:01.640537113 +0200
@@ -59,11 +59,11 @@
 	dbg_parse("name='%s', symlink='%s', bus='%s', place='%s', id='%s', "
 		  "sysfs_file[0]='%s', sysfs_value[0]='%s', "
 		  "kernel='%s', program='%s', result='%s'"
-		  "owner='%s', group='%s', mode=%#o",
+		  "owner='%s', group='%s', mode=%#o remove=%d",
 		  dev->name, dev->symlink, dev->bus, dev->place, dev->id,
 		  dev->sysfs_pair[0].file, dev->sysfs_pair[0].value,
 		  dev->kernel, dev->program, dev->result,
-		  dev->owner, dev->group, dev->mode);
+		  dev->owner, dev->group, dev->mode, dev->noremove);
 }
 
 void dump_config_dev_list(void)
@@ -265,6 +265,12 @@
 				continue;
 			}
 
+			if (strcasecmp(temp2, FIELD_NOREMOVE) == 0) {
+				dev.noremove = strtol(temp3, NULL, 10);
+				valid = 1;
+				continue;
+			}
+
 			if (strcasecmp(temp2, FIELD_RESULT) == 0) {
 				strfieldcpy(dev.result, temp3);
 				valid = 1;
--- udev-039/namedev.c.norm	2004-10-16 00:08:30.000000000 +0200
+++ udev-039/namedev.c	2004-10-21 16:31:46.448122693 +0200
@@ -738,12 +738,15 @@
 	list_for_each_entry(dev, &config_device_list, node) {
 		dbg("process rule");
 		if (match_rule(dev, class_dev, udev, sysfs_device) == 0) {
-			if (dev->name[0] == '\0' && dev->symlink[0] == '\0') {
+			if (dev->name[0] == '\0' && dev->symlink[0] == '\0' && dev->noremove == 0) {
 				info("configured rule in '%s' at line %i applied, '%s' is ignored",
 				     dev->config_file, dev->config_line, udev->kernel_name);
 				return -1;
 			}
+			if (dev->noremove != 0) {
+				udev->noremove = dev->noremove;
+			}
 
 			if (dev->symlink[0] != '\0') {
 				char temp[NAME_SIZE];
 
--- udev-039/udev.h.norm	2004-10-21 16:31:46.393130647 +0200
+++ udev-039/udev.h	2004-10-21 16:31:46.442123561 +0200
@@ -52,6 +52,7 @@
 	char owner[OWNER_SIZE];
 	char group[GROUP_SIZE];
 	char type;
+	char noremove;
 	int major;
 	int minor;
 	unsigned int mode;	/* not mode_t due to conflicting definitions in different libcs */
--- udev-039/udevinfo.c.norm	2004-10-21 16:31:46.408128478 +0200
+++ udev-039/udevinfo.c	2004-10-21 16:31:46.443123416 +0200
@@ -116,6 +116,7 @@
 	printf("F: %s\n", dev->config_file);
 	printf("L: %i\n", dev->config_line);
 	printf("U: %li\n", dev->config_uptime);
+	printf("R: %d\n", dev->noremove);
 	printf("\n");
 	return 0;
 }

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2004-10-25 15:36 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2004-10-25 12:09 udev-039-6 on Fedora Core 3 Harald Hoyer
2004-10-25 15:30 ` Kay Sievers
2004-10-25 15:36 ` Harald Hoyer

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).