The Ubuntu Collection
PATCH 1/1 The Ubuntu Collection
Attached are the current set of Ubuntu patches to udev, as of 077. The rest of this e-mail is a brief description of each one, and why we have it.
01-lib-udev.patch
This arranges for the various extras programs to be installed directly into /lib/udev/ rather than into /sbin/. Pretty sweet and obvious.
02-no-sepol.patch
The libsepol dependency seems to only exist on RedHat, with the versions of the SELinux libraries we have in Ubuntu, there wasn't any need for it. Removing it saved us from having to security audit libsepol as part of our main promotion procedure.
10-udev-conf.patch
We've given up trying to support people who want their udev_root and udev_rules to be in different places; with initramfs, changing this would mean regenerating the initramfs as well. We decided to just drop mention of the two options as a safety catch against pedocide.
40-udevplug.patch
This adds an extra tool to udev called "udevplug", it's basically a binary that handles tickling uevents and waiting for udevd to finish processing them. The command-line options let you choose exactly what to tickle (or just everything), and do things like filter by sysfs attributes. (manpage included)
50-result-whitespace.patch
In a few places udev calls the replace_untrusted_chars() function on things like program output; it treats \t, \r, \n, and other whitespace characters (other than space itself) as illegal and replaces them with an underscore. This patch slightly alters that behaviour, it leaves them as untrusted, but instead replaces those of whitespace-ilk with an ordinary space, instead of an underscore. We use this because various helpers output a newline-separated list of modules, and we wanted to pass that $result straight to modprobe.
55-run-program.patch
This reduces the severity of the "exec of program failed" error IF the reason the program couldn't be run was because it didn't exist yet. With /dev/.udev/failed, helpers not existing yet isn't serious, it just means they need to be retried later and there's no point screaming too loudly about it.
60-firmware-hunt.patch
This modifies the firmware_helper extra to also look in /lib/firmware/$KERNEL_VERSION which is where we put firmware that comes with our kernel images.
80-extras-dvb_device_name.patch
This adds a dvb_device_name helper that's pretty much equivalent to the shell code passed around between the distros, just rather faster and usable in busybox environments. As with all our extras, includes a manpage.
80-extras-ide_media.patch
Adds an ide_media helper that looks up the media type under /proc, again somewhat similar to the shell code but this also will wait for the node to appear under /proc, avoiding a race condition.
80-extras-pnp_modules.patch
Another binary helper replacing shell code, outputs a list of module aliases for a pnp device.
80-extras-storage_enum.patch
An odd one, we use this in the installer to make the devfs-like /dev/discs, /dev/cdroms and /dev/floppy directories which the debian-installer we use still requires. We didn't use the existing devfs scripts because they don't cope well with everything getting plugged at once, this is reasonably safe against that and ensures that each gets a unique number.
80-extras-usb_device_name.patch
Back to the binary helpers again, this one is for the usb_device subsystem and again just replaces equivalent shell code other distros use.
80-extras-vio_type.patch
Binary helper to look up the type of a vio device under /proc, and like ide_media wait for the node to appear to avoid races.
Scott
Signature · 2 lines
Scott James Remnant [email protected]
extras/ata_id/Makefile +2 -2
@@ -48,11 +48,11 @@ clean: .PHONY: clean install-bin: all - $(INSTALL_PROGRAM) $(PROG) $(DESTDIR)$(sbindir)/$(PROG) + $(INSTALL_PROGRAM) -D $(PROG) $(DESTDIR)$(libudevdir)/$(PROG) .PHONY: install-bin uninstall-bin: - - rm $(DESTDIR)$(sbindir)/$(PROG) + - rm $(DESTDIR)$(libudevdir)/$(PROG) .PHONY: uninstall-bin install-man:
extras/cdrom_id/Makefile +2 -2
@@ -48,11 +48,11 @@ clean: .PHONY: clean install-bin: all - $(INSTALL_PROGRAM) $(PROG) $(DESTDIR)$(sbindir)/$(PROG) + $(INSTALL_PROGRAM) -D $(PROG) $(DESTDIR)$(libudevdir)/$(PROG) .PHONY: install-bin uninstall-bin: - - rm $(DESTDIR)$(sbindir)/$(PROG) + - rm $(DESTDIR)$(libudevdir)/$(PROG) .PHONY: uninstall-bin install-man:
extras/dasd_id/Makefile +2 -2
@@ -48,11 +48,11 @@ clean: .PHONY: clean install-bin: all - $(INSTALL_PROGRAM) $(PROG) $(DESTDIR)$(sbindir)/$(PROG) + $(INSTALL_PROGRAM) -D $(PROG) $(DESTDIR)$(libudevdir)/$(PROG) .PHONY: install-bin uninstall-bin: - - rm $(DESTDIR)$(sbindir)/$(PROG) + - rm $(DESTDIR)$(libudevdir)/$(PROG) .PHONY: uninstall-bin install-man:
extras/edd_id/Makefile +2 -2
@@ -48,11 +48,11 @@ clean: .PHONY: clean install-bin: all - $(INSTALL_PROGRAM) $(PROG) $(DESTDIR)$(sbindir)/$(PROG) + $(INSTALL_PROGRAM) -D $(PROG) $(DESTDIR)$(libudevdir)/$(PROG) .PHONY: install-bin uninstall-bin: - - rm $(DESTDIR)$(sbindir)/$(PROG) + - rm $(DESTDIR)$(libudevdir)/$(PROG) .PHONY: uninstall-bin install-man:
extras/scsi_id/Makefile +2 -2
@@ -67,11 +67,11 @@ clean: .PHONY: clean install-bin: all - $(INSTALL_PROGRAM) $(PROG) $(DESTDIR)$(sbindir)/$(PROG) + $(INSTALL_PROGRAM) -D $(PROG) $(DESTDIR)$(libudevdir)/$(PROG) .PHONY: install-bin uninstall-bin: - - rm $(DESTDIR)$(sbindir)/$(PROG) + - rm $(DESTDIR)$(libudevdir)/$(PROG) .PHONY: uninstall-bin install-man:
extras/usb_id/Makefile +2 -2
@@ -48,11 +48,11 @@ clean: .PHONY: clean install-bin: all - $(INSTALL_PROGRAM) $(PROG) $(DESTDIR)$(sbindir)/$(PROG) + $(INSTALL_PROGRAM) -D $(PROG) $(DESTDIR)$(libudevdir)/$(PROG) .PHONY: install-bin uninstall-bin: - - rm $(DESTDIR)$(sbindir)/$(PROG) + - rm $(DESTDIR)$(libudevdir)/$(PROG) .PHONY: uninstall-bin install-man:
extras/volume_id/Makefile +2 -2
@@ -51,11 +51,11 @@ clean: .PHONY: clean install-bin: all - $(INSTALL_PROGRAM) $(PROG) $(DESTDIR)$(sbindir)/$(PROG) + $(INSTALL_PROGRAM) -D $(PROG) $(DESTDIR)$(libudevdir)/$(PROG) .PHONY: install-bin uninstall-bin: - - rm $(DESTDIR)$(sbindir)/$(PROG) + - rm $(DESTDIR)$(libudevdir)/$(PROG) .PHONY: uninstall-bin install-man:
Makefile +1 -1
@@ -178,7 +178,7 @@ endif ifeq ($(strip $(USE_SELINUX)),true) UDEV_OBJS += udev_selinux.o - LIB_OBJS += -lselinux -lsepol + LIB_OBJS += -lselinux CFLAGS += -DUSE_SELINUX endif
etc/udev/udev.conf.in +0 -6
@@ -1,11 +1,5 @@ # udev.conf -# Where in the filesystem to place the device nodes. -udev_root="@udevdir@" - -# The name and location of the udev rules file(s). -udev_rules="@configdir@/rules.d" - # The initial syslog(3) priority: "err", "info", "debug" or its # numerical equivalent. For runtime debugging, the daemons internal # state can be changed with: "udevcontrol log_priority=<value>".
Makefile +9 -2
@@ -54,7 +54,8 @@ PROGRAMS = \ udevmonitor \ udevinfo \ udevtest \ - udevstart + udevstart \ + udevplug HEADERS = \ udev.h \
@@ -88,9 +89,11 @@ MAN_PAGES = \ udevsend.8 \ udevtest.8 \ udevinfo.8 \ - udevstart.8 + udevstart.8 \ + udevplug.8 SYSFS_OBJS = \ + libsysfs/sysfs_bus.o \ libsysfs/sysfs_class.o \ libsysfs/sysfs_device.o \ libsysfs/sysfs_dir.o \
@@ -303,6 +306,7 @@ install-man: $(INSTALL_DATA) -D udevd.8 $(DESTDIR)$(mandir)/man8/udevd.8 $(INSTALL_DATA) -D udevsend.8 $(DESTDIR)$(mandir)/man8/udevsend.8 $(INSTALL_DATA) -D udevmonitor.8 $(DESTDIR)$(mandir)/man8/udevmonitor.8 + $(INSTALL_DATA) -D udevplug.8 $(DESTDIR)$(mandir)/man8/udevplug.8 - ln -f -s udevd.8 $(DESTDIR)$(mandir)/man8/udevcontrol.8 @extras="$(EXTRAS)"; for target in $$extras; do \ echo $$target; \
@@ -319,6 +323,7 @@ uninstall-man: - rm -f $(DESTDIR)$(mandir)/man8/udevmonitor.8 - rm -f $(DESTDIR)$(mandir)/man8/udevsend.8 - rm -f $(DESTDIR)$(mandir)/man8/udevcontrol.8 + - rm -f $(DESTDIR)$(mandir)/man8/udevplug.8 @extras="$(EXTRAS)"; for target in $$extras; do \ echo $$target; \ $(MAKE) -C $$target $@ || exit 1; \
@@ -335,6 +340,7 @@ install-bin: $(INSTALL_PROGRAM) -D udevinfo $(DESTDIR)$(usrbindir)/udevinfo $(INSTALL_PROGRAM) -D udevtest $(DESTDIR)$(usrbindir)/udevtest $(INSTALL_PROGRAM) -D udevstart $(DESTDIR)$(sbindir)/udevstart + $(INSTALL_PROGRAM) -D udevplug $(DESTDIR)$(sbindir)/udevplug @extras="$(EXTRAS)"; for target in $$extras; do \ echo $$target; \ $(MAKE) -C $$target $@ || exit 1; \
@@ -355,6 +361,7 @@ uninstall-bin: - rm -f $(DESTDIR)$(usrsbindir)/udevmonitor - rm -f $(usrbindir)/udevinfo - rm -f $(DESTDIR)$(DESTDIR)$(usrbindir)/udevtest + - rm -f $(DESTDIR)$(sbindir)/udevplug ifndef DESTDIR - killall udevd - rm -rf /dev/.udev
udevplug.8 +83 -0
83 lines not on this page · raw message
udevplug.c +600 -0
600 lines not on this page · raw message
udev_utils_string.c +8 -1
@@ -245,10 +245,17 @@ int replace_untrusted_chars(char *str)if ((str[i] >='0' && str[i] <='9' ) || (str[i] >='A' && str[i] <='Z' ) || (str[i] >='a' && str[i] <='z' ) || -strchr (" #$%+-./:=?@_" , str[i])) { +strchr ("#$%+-./:=?@_" , str[i])) { i++;continue ; } +/* whitespace replaced with ordinary space */ +if (isspace (str[i])) { + str[i] =' ' ; + i++; + replaced++; +continue ; + }/* valid utf8 is accepted */ len =utf8_encoded_valid_unichar (&str[i]);if (len >1 ) {
udev_utils_run.c +7 -2
@@ -160,8 +160,13 @@ int run_program(const char *command, condup2 (errpipe[WRITE_END ],STDERR_FILENO );execv (argv[0 ], argv); -/* we should never reach this */ -err ("exec of program '%s' failed" , argv[0 ]); +if ((errno ==ENOENT ) || (errno =ENOTDIR )) { +/* will probably turn up later */ +info ("program '%s' not found" , argv[0 ]); + }else { +/* bigger problems */ +err ("exec of program '%s' failed" , argv[0 ]); + }_exit (1 );case -1 :err ("fork of '%s' failed: %s" , argv[0 ],strerror (errno));
extras/firmware/firmware_helper.c +52 -25
115 lines not on this page · raw message
extras/dvb_device_name/Makefile +66 -0
66 lines not on this page · raw message
extras/dvb_device_name/dvb_device_name.8 +28 -0
@@ -0,0 +1,28 @@ +.TH DVB_DEVICE_NAME 8 "November 2005" "" "Linux Administrator's Manual" +.SH NAME +dvb_device_name \- udev callout to split kernel name for dvb devices +.SH SYNOPSIS +.BI dvb_device_name +[\fI--export\fP] \fIdevicename\fP +.SH DESCRIPTION +.B dvb_device_name +is normally called from a udev rule to split the kernel-assigned name for a +device in the dvb_device subsystem into bus and device numbers. Udev can use +this information to construct a name under /dev/dvb for the real device +node. +.SH USAGE +.B dvb_device_name +splits the kernel-assigned name specified on the command-line and prints the +information chosen by the options. +.SH OPTIONS +The following command-line switches are supported to specify what +dvb_device_name should print: +.TP +.BI --export +print bus and device numbers as DVB_ADAPTER and DVB_DEV environment variables, +for use with an IMPORT{program} rule. +.RE +.SH SEE ALSO +.BR udev (8) +.SH AUTHORS +Scott James Remnant <[email protected]>
extras/dvb_device_name/dvb_device_name.c +103 -0
103 lines not on this page · raw message
extras/ide_media/Makefile +66 -0
66 lines not on this page · raw message
extras/ide_media/ide_media.8 +29 -0
@@ -0,0 +1,29 @@ +.TH IDE_MEDIA 8 "November 2005" "" "Linux Administrator's Manual" +.SH NAME +ide_media \- udev callout to identify media of IDE device +.SH SYNOPSIS +.BI ide_media +[\fI--export\fP] \fIdevpath\fP +.SH DESCRIPTION +.B ide_media +is normally called from a udev rule to identify the media type of an IDE +device. Udev can use this information to assign appropriate permissions to +the device or load an appropriate module. +.SH USAGE +.B ide_media +takes a path under /sys, if not given it uses the value of the +.I DEVPATH +environment variable instead. It then prints the information chosen by the +options. +.SH OPTIONS +The following command-line switches are supported to specify what +ide_media should print: +.TP +.BI --export +print media type as IDE_MEDIA environment variable for use with an +IMPORT{program} rule. +.RE +.SH SEE ALSO +.BR udev (8) +.SH AUTHORS +Scott James Remnant <[email protected]>
extras/ide_media/ide_media.c +155 -0
155 lines not on this page · raw message
extras/pnp_modules/Makefile +66 -0
66 lines not on this page · raw message
extras/pnp_modules/pnp_modules.8 +22 -0
@@ -0,0 +1,22 @@ +.TH PNP_MODULES 8 "November 2005" "" "Linux Administrator's Manual" +.SH NAME +pnp_modules \- udev callout to list modules for PNP devices +.SH SYNOPSIS +.BI pnp_modules +\fIdevpath\fP +.SH DESCRIPTION +.B ide_media +is normally called from a udev PROGRAM rule to list aliases that can be +used to load modules for PNP devices. +.SH USAGE +.B pnp_modules +takes a single argument which should be a path under /sys, if not given +it uses the value of the +.I DEVPATH +environment variable instead. Outputs a list of modprobe aliases that +can be used to load modules, e.g. with a RUN rule. +.RE +.SH SEE ALSO +.BR udev (8) +.SH AUTHORS +Scott James Remnant <[email protected]>
extras/pnp_modules/pnp_modules.c +111 -0
111 lines not on this page · raw message
extras/storage_enum.sh +93 -0
93 lines not on this page · raw message
extras/usb_device_name/Makefile +66 -0
66 lines not on this page · raw message
extras/usb_device_name/usb_device_name.8 +28 -0
@@ -0,0 +1,28 @@ +.TH USB_DEVICE_NAME 8 "November 2005" "" "Linux Administrator's Manual" +.SH NAME +usb_device_name \- udev callout to split kernel name for usb devices +.SH SYNOPSIS +.BI usb_device_name +[\fI--export\fP] \fIdevicename\fP +.SH DESCRIPTION +.B usb_device_name +is normally called from a udev rule to split the kernel-assigned name for a +device in the usb_device subsystem into bus and device numbers. Udev can use +this information to construct a name under /dev/bus/usb for the real device +node. +.SH USAGE +.B usb_device_name +splits the kernel-assigned name specified on the command-line and prints the +information chosen by the options. +.SH OPTIONS +The following command-line switches are supported to specify what +usb_device_name should print: +.TP +.BI --export +print bus and device numbers as USB_BUS and USB_DEV environment variables, +for use with an IMPORT{program} rule. +.RE +.SH SEE ALSO +.BR udev (8) +.SH AUTHORS +Scott James Remnant <[email protected]>
extras/usb_device_name/usb_device_name.c +103 -0
103 lines not on this page · raw message
extras/vio_type/Makefile +66 -0
66 lines not on this page · raw message
extras/vio_type/vio_type.8 +29 -0
@@ -0,0 +1,29 @@ +.TH VIO_TYPE 8 "November 2005" "" "Linux Administrator's Manual" +.SH NAME +vio_type \- udev callout to identify type of VIO device +.SH SYNOPSIS +.BI vio_type +[\fI--export\fP] \fIdevpath\fP +.SH DESCRIPTION +.B vio_type +is normally called from a udev rule to identify the type of a VIO +device. Udev can use this information to assign appropriate permissions to +the device or load an appropriate module. +.SH USAGE +.B vio_type +takes a path under /sys, if not given it uses the value of the +.I DEVPATH +environment variable instead. It then prints the information chosen by the +options. +.SH OPTIONS +The following command-line switches are supported to specify what +vio_type should print: +.TP +.BI --export +print device type as VIO_TYPE environment variable for use with an +IMPORT{program} rule. +.RE +.SH SEE ALSO +.BR udev (8) +.SH AUTHORS +Scott James Remnant <[email protected]>
extras/vio_type/vio_type.c +165 -0
165 lines not on this page · raw message
Quoted 3 lines · Scott James Remnant
Attached are the current set of Ubuntu patches to udev, as of 077. The rest of this e-mail is a brief description of each one, and why we have it.
Thanks for sending this. We made pretty good progress the last weeks and seems the way udev is integrated in the systems is getting more similar across distros. The goal is to make it as similar as possible, so we may be able to share most of the stuff.
Quoted 4 lines
01-lib-udev.patch
This arranges for the various extras programs to be installed directly into/lib/udev/rather than into/sbin/. Pretty sweet and obvious.
That's nice. I wanted to do this too, but I need to make sure, not to break existing users of the tools, cause they have been installed in sbin for a long time. But in general I agree, that we should move all the udev tools to /lib/udev. Btw: Marco had a nice idea and udev 077 automatically picks up the tools there, if RUN="firmware.sh" is given.
Quoted 5 lines
02-no-sepol.patch
The libsepol dependency seems to only exist on RedHat, with the versions of the SELinux libraries we have in Ubuntu, there wasn't any need for it. Removing it saved us from having to security audit libsepol as part of our main promotion procedure.
I'm waiting for an answer from Harald, Red Hat added this recently and it may be needed with a newer version of selinux, don't know.
Quoted 5 lines
10-udev-conf.patch
We've given up trying to support people who want theirudev_rootandudev_rulesto be in different places; with initramfs, changing this would mean regenerating the initramfs as well. We decided to just drop mention of the two options as a safety catch against pedocide.
Funny patch. :)
Quoted 6 lines
40-udevplug.patch
This adds an extra tool to udev called "udevplug", it's basically a binary that handles tickling uevents and waiting for udevd to finish processing them. The command-line options let you choose exactly what to tickle (or just everything), and do things like filter by sysfs attributes. (manpage included)
That's a nice tool. We will probably want such a thing in the tree, but I want to wait until early next year, when we passed a lot of testing with the current udev and really know what we need. Changing stuff in the tree that is bootup relevant is not too funny for the guys who are already have enough trouble catching up all the time. :)
I expect we want a way to specify for what kind of events or what device nodes we want to wait to appear. Think of a SCSI controller that scans a lot of buses during bootup needs a lot of time to do this but there is not a single disk connected. Udevplug (like the simple initscripts others use too) will delay the bootup process, even when all requirements of the fstab are already fulfilled. We will see, what we really need here. I'll stick with the shell scripts for now and we can come up with something next year to put in the tree.
Quoted 9 lines
50-result-whitespace.patch
In a few places udev calls thereplace_untrusted_chars()function on things like program output; it treats \t, \r, \n, and other whitespace characters (other than space itself) as illegal and replaces them with an underscore. This patch slightly alters that behaviour, it leaves them as untrusted, but instead replaces those of whitespace-ilk with an ordinary space, instead of an underscore. We use this because various helpers output a newline-separated list of modules, and we wanted to pass that $result straight to modprobe.
Yes, I see, may make sense at some places as a separate function. What are the tools you call and this is useful?
Quoted 6 lines
55-run-program.patch
This reduces the severity of the "exec of program failed" error IF the reason the program couldn't be run was because it didn't exist yet. With/dev/.udev/failed, helpers not existing yet isn't serious, it just means they need to be retried later and there's no point screaming too loudly about it.
Yeah, I'm still unsure if the used tool should be required to be in the rootfs or not. But it sounds like a sane default, if we don't require this.
For the higher level things HAL is the approproate place to do device setup anyway. That's the reason I ignored all the map conversion things, cause digital cameras, scanners and such things belong to HAL these days and not in udev rules.
Quoted 4 lines
60-firmware-hunt.patch
This modifies thefirmware_helperextra to also look in/lib/firmware/$KERNEL_VERSIONwhich is where we put firmware that comes with our kernel images.
Hmm, I'm no longer sure that the C programs for something that is usually 20 lines of shell long and called 3 times at bootup make sense. For the firmware case I always wanted to add some handling for missing firmware, but even for this we would not need a C program. Hmm...
Quoted 5 lines
80-extras-dvb_device_name.patch
This adds advb_device_namehelper that's pretty much equivalent to the shell code passed around between the distros, just rather faster and usable in busybox environments. As with all our extras, includes a manpage.
Hmm, why isn't the simple shell command in the RUN key not working in busybox?
Quoted 4 lines
80-extras-ide_media.patch
Adds anide_mediahelper that looks up the media type under /proc, again somewhat similar to the shell code but this also will wait for the node to appear under /proc, avoiding a race condition.
I've submitted a patch that adds MODALIAS for autoloading of IDE modules.
Quoted 3 lines
80-extras-pnp_modules.patch
Another binary helper replacing shell code, outputs a list of module aliases for a pnp device.
Hmm, again, do we want this as a C program?
Quoted 7 lines
80-extras-storage_enum.patch
An odd one, we use this in the installer to make the devfs-like/dev/discs,/dev/cdromsand/dev/floppydirectories which the debian-installer we use still requires. We didn't use the existing devfs scripts because they don't cope well with everything getting plugged at once, this is reasonably safe against that and ensures that each gets a unique number.
Yeah, you should better get rid of _any_ simple enumeration now on a system where devices can come and go any time and no order is guaranteed. Such an approach will cause much more trouble than it solves. :)
Quoted 4 lines
80-extras-usb_device_name.patch
Back to the binary helpers again, this one is for theusb_devicesubsystem and again just replaces equivalent shell code other distros use.
Oh, seems you don't like the weird RUN rules that call a shell one liner. :)
Quoted 3 lines
80-extras-vio_type.patch
Binary helper to look up the type of a vio device under /proc, and likeide_mediawait for the node to appear to avoid races.
Is this needed, even as we have MODALIAS for vio now?
Btw: I use udevd in initramfs now too and udev and udevstart are no longer needed at all. You know, I didn't like to start the daemon there in the first place, but killing udevd before leaving initramfs, after the rootfs is mounted, works nice and seems like a nice way to do it.
Thanks,
Kay
-------------------------------------------------------
This SF.net email is sponsored by: Splunk Inc. Do you grep through log files for problems? Stop! Download the new AJAX search engine that makes searching your log files as easy as surfing the web. DOWNLOAD SPLUNK!
http://ads.osdn.com/?ad_idv37&alloc_id865&op=click
_______________________________________________
Linux-hotplug-devel mailing list http://linux-hotplug.sourceforge.net
[email protected]
https://lists.sourceforge.net/lists/listinfo/linux-hotplug-devel
Quoted 6 lines · Kay Sievers
Quoted 3 lines
55-run-program.patch
This reduces the severity of the "exec of program failed" error IF the reason the program couldn't be run was because it didn't existYeah, I'm still unsure if the used tool should be required to be in the rootfs or not. But it sounds like a sane default, if we don't require this.
I'd rather not use such a patch, because in the end it will hide real problems.
Quoted 4 lines
For the higher level things HAL is the approproate place to do device setup anyway. That's the reason I ignored all the map conversion things, cause digital cameras, scanners and such things belong to HAL these days and not in udev rules.
Tell this to the libsane/libgphoto maintainers... :-)
Quoted 4 lines
Hmm, I'm no longer sure that the C programs for something that is usually 20 lines of shell long and called 3 times at bootup make sense. For the firmware case I always wanted to add some handling for missing firmware, but even for this we would not need a C program. Hmm...
Indeed. All these programs are much larger than a small shell, and I just do not believe that shell script would not be efficient enough.
Signature · 2 lines
ciao, Marco
Quoted 6 lines · Kay Sievers
Quoted 4 lines · Scott James Remnant
01-lib-udev.patch
This arranges for the various extras programs to be installed directly into/lib/udev/rather than into/sbin/. Pretty sweet and obvious.
Quoted 6 lines
That's nice. I wanted to do this too, but I need to make sure, not to break existing users of the tools, cause they have been installed in sbin for a long time. But in general I agree, that we should move all the udev tools to
/lib/udev. Btw: Marco had a nice idea and udev 077 automatically picks up the tools there, if RUN="firmware.sh" is given.
Yup, I've already picked that up and run with it.
Quoted 10 lines
Quoted 9 lines
50-result-whitespace.patch
In a few places udev calls thereplace_untrusted_chars()function on things like program output; it treats \t, \r, \n, and other whitespace characters (other than space itself) as illegal and replaces them with an underscore. This patch slightly alters that behaviour, it leaves them as untrusted, but instead replaces those of whitespace-ilk with an ordinary space, instead of an underscore. We use this because various helpers output a newline-separated list of modules, and we wanted to pass that $result straight to modprobe.
Quoted 3 lines
Yes, I see, may make sense at some places as a separate function. What are the tools you call and this is useful?
Mostly it's just our pnp_modules helper, and grepmap -- we could modify those to output space-separated modules, but then it prevents other people from doing the same. This seemed neater, somehow.
Quoted 11 lines
Quoted 6 lines
55-run-program.patch
This reduces the severity of the "exec of program failed" error IF the reason the program couldn't be run was because it didn't exist yet. With/dev/.udev/failed, helpers not existing yet isn't serious, it just means they need to be retried later and there's no point screaming too loudly about it.Yeah, I'm still unsure if the used tool should be required to be in the rootfs or not. But it sounds like a sane default, if we don't require this.
Right, this was actually because we don't include some of the helpers in the initramfs; we've established a "no helpers under /usr" policy for the rest.
Quoted 5 lines
For the higher level things HAL is the approproate place to do device setup anyway. That's the reason I ignored all the map conversion things, cause digital cameras, scanners and such things belong to HAL these days and not in udev rules.
Right, actually the digital camera ones are just GROUP= rules now for the usb_device subsystem -- those were easy.
Quoted 10 lines
Quoted 4 lines
60-firmware-hunt.patch
This modifies thefirmware_helperextra to also look in/lib/firmware/$KERNEL_VERSIONwhich is where we put firmware that comes with our kernel images.Hmm, I'm no longer sure that the C programs for something that is usually 20 lines of shell long and called 3 times at bootup make sense. For the firmware case I always wanted to add some handling for missing firmware, but even for this we would not need a C program. Hmm...
I like C, and they run about a zillion times faster than the busybox shell; probably why I'm hitting so many new race conditions, but in general I tend to prefer little binary helpers as they're less susceptible to the various silly shell quirks.
I won't be upset if you don't accept a single one ;) they're pretty specific to our needs.
Quoted 8 lines
Quoted 7 lines
80-extras-storage_enum.patch
An odd one, we use this in the installer to make the devfs-like/dev/discs,/dev/cdromsand/dev/floppydirectories which the debian-installer we use still requires. We didn't use the existing devfs scripts because they don't cope well with everything getting plugged at once, this is reasonably safe against that and ensures that each gets a unique number.
Quoted 4 lines
Yeah, you should better get rid of _any_ simple enumeration now on a system where devices can come and go any time and no order is guaranteed. Such an approach will cause much more trouble than it solves. :)
Right, this is just used in installer-world; not in the real system. I'm begging Colin to use /sys to detect cd-roms etc. but he currently has more pressing assignments.
Quoted 6 lines
Quoted 3 lines
80-extras-vio_type.patch
Binary helper to look up the type of a vio device under /proc, and likeide_mediawait for the node to appear to avoid races.Is this needed, even as we have MODALIAS for vio now?
Yeah, the devices this deals with actually don't have MODALIAS yet.
Scott
Signature · 2 lines
Scott James Remnant [email protected]