* 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
* Re: udev-039-6 on Fedora Core 3
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
1 sibling, 0 replies; 3+ messages in thread
From: Kay Sievers @ 2004-10-25 15:30 UTC (permalink / raw)
To: linux-hotplug
On Mon, Oct 25, 2004 at 02:09:36PM +0200, Harald Hoyer wrote:
> 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.
Cool, somebody sharing...
I've looked at all patches in the SRPM. Some comments on it:
> 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
Why don't you compile it with klibc? Everything should work. The
klibc-version is also be able to parse /etc/passwd to keep the same
permissions file in initrd.
> 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
Right, should go in our tree.
> Patch3: udev-039-wait-error-log.patch
> wait_for_sysfs patch
Already in current version!
> Patch4: udev-039-logging.patch
> logging patch
Already in current version!
> Patch5: udev-039-wait-ppp-class.patch
> wait_for_sysfs patch
Already in current version!
> Patch6: udev-039-wait-dm-block.patch
> wait_for_sysfs patch
Already in current version!
> Patch7: udev-039-static2.patch
> include wait_for_sysfs in udev for the static udev version used in initramfs
Huh, #include of an .c file :)
The current version has a udev_sysfs.c file for that. I'm on converting
everything to a be more like a toolbox. Something like this should only
need a few lines of code now and you only need to open the device once.
> Patch8: udev-039-netif.patch
> only call dev_d_send for network interfaces, if the name was changed
Already in current version!
> Patch9: udev-039-dummy.patch
> wait_for_sysfs patch
Already in current version!
> Patch10: udev-039-volume_id-nonblock.patch
> do not open(2) with O_NONBLOCK
Already in current version!
> 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..
I see the need for that, yes. But I would like to have a match of the
ACTION string instead. This would make it more flexible. Something like:
KERNEL="abc", ACTION="add", NAME="xyz"
> Patch22: udev-032-symlink.patch
> replace format directives in every symlink part
Not needed, I think. Should work out of the box as the format replacement
will not stop at the spaces in the symlink string. If you have problems
with that, then we have a bug and please tell us.
> Patch24: udev-038-volmak.patch
> Makefile patch for volume_id
Should go in our tree. What was the problem here, On my box, this is working.
Harald,
I will take care, that:
udev-038-volmak.patch,
udev-025-volsbin.patch
are getting upstream.
Please give me some feedback on:
udev-039-norm.patch,
udev-032-symlink.patch,
udev-039-static.patch
Thanks,
Kay
-------------------------------------------------------
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
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: udev-039-6 on Fedora Core 3
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
1 sibling, 0 replies; 3+ messages in thread
From: Harald Hoyer @ 2004-10-25 15:36 UTC (permalink / raw)
To: linux-hotplug
Kay Sievers wrote:
> On Mon, Oct 25, 2004 at 02:09:36PM +0200, Harald Hoyer wrote:
>
>>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
>
>
> Why don't you compile it with klibc? Everything should work. The
> klibc-version is also be able to parse /etc/passwd to keep the same
> permissions file in initrd.
Because maintaining another libc for all our architecures is a PITA...
>>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..
>
>
> I see the need for that, yes. But I would like to have a match of the
> ACTION string instead. This would make it more flexible. Something like:
>
> KERNEL="abc", ACTION="add", NAME="xyz"
what do you mean?
>
>
>>Patch22: udev-032-symlink.patch
>>replace format directives in every symlink part
>
>
> Not needed, I think. Should work out of the box as the format replacement
> will not stop at the spaces in the symlink string. If you have problems
> with that, then we have a bug and please tell us.
ok, I will remove that one...
-------------------------------------------------------
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
^ 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).