From 6bccb7062a3a4ec83e84519a34adf898bcc8158c Mon Sep 17 00:00:00 2001 From: Harald Hoyer Date: Mon, 10 Nov 2008 10:45:26 +0000 Subject: [PATCH 001/142] - version 132 - added memory stick rules (bug #470096) --- .cvsignore | 2 +- sources | 2 +- start_udev | 33 +++++++++++++++++++++++++++++++-- udev-132-memstickrules.patch | 11 +++++++++++ udev.spec | 23 +++++++++++------------ 5 files changed, 55 insertions(+), 16 deletions(-) create mode 100644 udev-132-memstickrules.patch diff --git a/.cvsignore b/.cvsignore index 10a06ff..c3bc10a 100644 --- a/.cvsignore +++ b/.cvsignore @@ -1 +1 @@ -udev-127.tar.bz2 +udev-132.tar.bz2 diff --git a/sources b/sources index 94e634e..6e55d3c 100644 --- a/sources +++ b/sources @@ -1 +1 @@ -59ebde702f1ab557be15ae76d645665b udev-127.tar.bz2 +0f51bffb4f5b86cb726b24a16c60a0aa udev-132.tar.bz2 diff --git a/start_udev b/start_udev index ef72536..5af4599 100755 --- a/start_udev +++ b/start_udev @@ -96,10 +96,39 @@ make_extra_nodes () { [ -d $udev_root/shm ] || mkdir -m 0755 $udev_root/shm [ -a /dev/MAKEDEV ] || ln -s $MAKEDEV /dev/MAKEDEV; - [ -d /dev/.udev/makedev.d ] || mkdir -p /dev/.udev/makedev.d USE_MD5="false" [ -x /usr/bin/md5sum -a "$UDEV_USE_MAKEDEV_CACHE" == "yes" ] && USE_MD5="true" + [ -d /dev/net ] || mkdir -p /dev/net + /bin/mknod -m 0640 /dev/loop0 b 7 0 + /bin/chown root:disk /dev/loop0 + /bin/mknod -m 0640 /dev/loop1 b 7 1 + /bin/chown root:disk /dev/loop1 + /bin/mknod -m 0640 /dev/loop2 b 7 2 + /bin/chown root:disk /dev/loop2 + /bin/mknod -m 0640 /dev/loop3 b 7 3 + /bin/chown root:disk /dev/loop3 + /bin/mknod -m 0640 /dev/loop4 b 7 4 + /bin/chown root:disk /dev/loop4 + /bin/mknod -m 0640 /dev/loop5 b 7 5 + /bin/chown root:disk /dev/loop5 + /bin/mknod -m 0640 /dev/loop6 b 7 6 + /bin/chown root:disk /dev/loop6 + /bin/mknod -m 0640 /dev/loop7 b 7 7 + /bin/chown root:disk /dev/loop7 + /bin/mknod -m 0600 /dev/net/tun c 10 200 + /bin/chown root:root /dev/net/tun + /bin/mknod -m 0600 /dev/ppp c 108 0 + /bin/chown root:root /dev/ppp + /bin/mknod -m 0660 /dev/lp0 c 6 0 + /bin/chown root:lp /dev/lp0 + /bin/mknod -m 0660 /dev/lp1 c 6 1 + /bin/chown root:lp /dev/lp1 + /bin/mknod -m 0660 /dev/lp2 c 6 2 + /bin/chown root:lp /dev/lp2 + /bin/mknod -m 0660 /dev/lp3 c 6 3 + /bin/chown root:lp /dev/lp3 + /sbin/restorecon /dev/loop0 /dev/loop1 /dev/loop2 /dev/loop3 /dev/loop4 /dev/loop5 /dev/loop6 /dev/loop7 /dev/net/tun /dev/ppp /dev/lp0 /dev/lp1 /dev/lp2 /dev/lp3 if [ -x "$MAKEDEV" ]; then for i in /etc/udev/makedev.d/*.nodes; do @@ -107,7 +136,7 @@ make_extra_nodes () { # use a little caching to speedup things if [ "$USE_MD5" == "true" ]; then # fix for MAKEDEV shell scripts - [ -d /dev/net ] || mkdir -p /dev/net + [ -d /dev/.udev/makedev.d ] || mkdir -p /dev/.udev/makedev.d md5=$(/usr/bin/md5sum "$i"|(read a b; echo $a))-se$SELINUX_STATE if [ -f "/var/lib/udev/makedev.d/${md5}.sh" ];then md5file="/var/lib/udev/makedev.d/${md5}.sh" diff --git a/udev-132-memstickrules.patch b/udev-132-memstickrules.patch new file mode 100644 index 0000000..8c618b5 --- /dev/null +++ b/udev-132-memstickrules.patch @@ -0,0 +1,11 @@ +diff -up udev-132/rules/redhat/40-redhat.rules.memstickrules udev-132/rules/redhat/40-redhat.rules +--- udev-132/rules/redhat/40-redhat.rules.memstickrules 2008-10-16 18:03:43.000000000 +0200 ++++ udev-132/rules/redhat/40-redhat.rules 2008-11-10 11:42:31.000000000 +0100 +@@ -25,3 +25,7 @@ KERNEL=="vcsa[0-9]*", OWNER="vc + KERNEL=="vcc/*", OWNER="vcsa", GROUP="tty" + + KERNEL=="event*", ATTRS{idVendor}=="03f0", ATTRS{interface}=="Virtual Mouse", ATTRS{bInterfaceProtocol}=="02", SYMLINK+="input/hp_ilo_mouse" ++ ++KERNEL=="mspblk[0-9]", SUBSYSTEMS=="memstick", ATTRS{name}=="?*", ATTRS{serial}=="?*", ENV{ID_NAME}="$attr{name}", ENV{ID_SERIAL}="$attr{serial}", SYMLINK+="disk/by-id/memstick-$env{ID_NAME}_$env{ID_SERIAL}" ++KERNEL=="mspblk[0-9]p[0-9]", ENV{ID_NAME}=="?*", ENV{ID_SERIAL}=="?*", SYMLINK+="disk/by-id/memstick-$env{ID_NAME}_$env{ID_SERIAL}-part%n" ++ diff --git a/udev.spec b/udev.spec index 432b37d..7784480 100644 --- a/udev.spec +++ b/udev.spec @@ -5,8 +5,8 @@ Summary: A userspace implementation of devfs Name: udev -Version: 127 -Release: 2%{?dist} +Version: 132 +Release: 1%{?dist} License: GPLv2 Group: System Environment/Base Provides: udev-persistent = %{version}-%{release} @@ -14,14 +14,11 @@ Obsoletes: udev-persistent < 0:030-5 Source: ftp://ftp.kernel.org/pub/linux/utils/kernel/hotplug/%{name}-%{version}.tar.bz2 Source1: start_udev -Source2: udev.nodes Source3: udev-post.init Source4: fw_unit_symlinks.sh Source5: udev.sysconfig -Patch1: udev-127-volid-raid.patch -Patch2: udev-127-volume_id-include-config.h.patch - +Patch1: udev-132-memstickrules.patch Patch102: udev-118-sysconf.patch ExclusiveOS: Linux @@ -30,11 +27,11 @@ BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n) Requires(pre): /bin/sh fileutils /sbin/chkconfig /sbin/service Requires(pre): MAKEDEV >= 0:3.11 BuildRequires: sed libselinux-devel >= 0:1.17.9-2 flex libsepol-devel -BuildRequires: pam-devel glib2-devel bison +BuildRequires: glib2-devel bison findutils MAKEDEV %if %{with_static} BuildRequires: libselinux-static libsepol-static %endif -Requires: libselinux >= 0:1.17.9-2 MAKEDEV sed pam +Requires: libselinux >= 0:1.17.9-2 sed Conflicts: kernel < 0:2.6 mkinitrd <= 0:4.1.11-1 initscripts < 7.84 Obsoletes: dev <= 0:3.12-1 Provides: dev = 0:3.12-1 @@ -94,9 +91,9 @@ dynamic library, which provides access to udev device information. %prep %setup -q -%patch1 -p1 -b .p1 -%patch2 -p1 -b .p2 +%patch1 -p1 -b .memstickrules %patch102 -p1 -b .sysconf +rm rules/redhat/95-pam-console.rules %build %configure --with-selinux --prefix=%{_prefix} --exec-prefix="" --sysconfdir=%{_sysconfdir} --with-libdir-name=%{_lib} --sbindir="/sbin" --enable-static @@ -184,7 +181,6 @@ done mkdir -p $RPM_BUILD_ROOT%{udev_scriptdir}/{,devices} -install -m 0644 %{SOURCE2} $RPM_BUILD_ROOT%{_sysconfdir}/udev/makedev.d/50-udev.nodes install -m 0755 %{SOURCE4} $RPM_BUILD_ROOT%{udev_scriptdir}/fw_unit_symlinks.sh mkdir -p $RPM_BUILD_ROOT%{_datadir}/udev @@ -302,7 +298,6 @@ rm -rf $RPM_BUILD_ROOT %config(noreplace) %attr(0644,root,root) %{_sysconfdir}/udev/udev.conf %config %attr(0644,root,root) %{udev_scriptdir}/rules.d/*.rules -%config %attr(0644,root,root) %dir %{_sysconfdir}/udev/makedev.d/50-udev.nodes #%config(missingok) %{_sysconfdir}/hotplug.d/default/10-udev.hotplug %config(noreplace) %attr(0644,root,root) %{_sysconfdir}/scsi_id.config @@ -368,6 +363,10 @@ rm -rf $RPM_BUILD_ROOT %changelog +* Mon Nov 10 2008 Harald Hoyer 132-1 +- version 132 +- added memory stick rules (bug #470096) + * Thu Oct 16 2008 Harald Hoyer 127-2 - added 2 patches for md raid vol_id From 5a26722c4c197923df47cfaf8d305280bec7fc3b Mon Sep 17 00:00:00 2001 From: Harald Hoyer Date: Wed, 19 Nov 2008 10:35:08 +0000 Subject: [PATCH 002/142] - version 133 --- .cvsignore | 2 +- sources | 2 +- udev.nodes | 15 --------------- udev.spec | 8 ++++++-- 4 files changed, 8 insertions(+), 19 deletions(-) delete mode 100644 udev.nodes diff --git a/.cvsignore b/.cvsignore index c3bc10a..66dcd7e 100644 --- a/.cvsignore +++ b/.cvsignore @@ -1 +1 @@ -udev-132.tar.bz2 +udev-133.tar.bz2 diff --git a/sources b/sources index 6e55d3c..52a0bda 100644 --- a/sources +++ b/sources @@ -1 +1 @@ -0f51bffb4f5b86cb726b24a16c60a0aa udev-132.tar.bz2 +1fe77c4d76162f4b09bdc01becbc4295 udev-133.tar.bz2 diff --git a/udev.nodes b/udev.nodes deleted file mode 100644 index ec38d8b..0000000 --- a/udev.nodes +++ /dev/null @@ -1,15 +0,0 @@ -# These device have to be created manually -loop0 -loop1 -loop2 -loop3 -loop4 -loop5 -loop6 -loop7 -net/tun -ppp -lp0 -lp1 -lp2 -lp3 diff --git a/udev.spec b/udev.spec index 7784480..20aa86d 100644 --- a/udev.spec +++ b/udev.spec @@ -5,7 +5,7 @@ Summary: A userspace implementation of devfs Name: udev -Version: 132 +Version: 133 Release: 1%{?dist} License: GPLv2 Group: System Environment/Base @@ -162,7 +162,8 @@ done %endif for i in \ - rules/redhat/*.rules \ + rules/redhat/40-redhat.rules \ + rules/suse/40-suse.rules \ %ifarch ia64 rules/packages/40-ia64.rules \ %endif @@ -363,6 +364,9 @@ rm -rf $RPM_BUILD_ROOT %changelog +* Wed Nov 19 2008 Harald Hoyer 133-1 +- version 133 + * Mon Nov 10 2008 Harald Hoyer 132-1 - version 132 - added memory stick rules (bug #470096) From 5b6b2232ee9cb766021fd1e078283537dd94b83f Mon Sep 17 00:00:00 2001 From: Harald Hoyer Date: Tue, 2 Dec 2008 10:22:49 +0000 Subject: [PATCH 003/142] - version 135 --- udev-118-sysconf.patch | 24 ------------------------ 1 file changed, 24 deletions(-) delete mode 100644 udev-118-sysconf.patch diff --git a/udev-118-sysconf.patch b/udev-118-sysconf.patch deleted file mode 100644 index 30de6ab..0000000 --- a/udev-118-sysconf.patch +++ /dev/null @@ -1,24 +0,0 @@ -diff -up udev-126/rules/rules.d/60-persistent-storage.rules.sysconf udev-126/rules/rules.d/60-persistent-storage.rules ---- udev-126/rules/rules.d/60-persistent-storage.rules.sysconf 2008-07-31 09:40:37.000000000 +0200 -+++ udev-126/rules/rules.d/60-persistent-storage.rules 2008-08-08 15:35:57.000000000 +0200 -@@ -6,6 +6,8 @@ - # forward scsi device event to corresponding block device - ACTION=="change", SUBSYSTEM=="scsi", ENV{DEVTYPE}=="scsi_device", TEST=="block", ATTR{block/*/uevent}="change" - -+ENV{UDEV_NO_PERSISTENT_STORAGE}=="1", GOTO="persistent_storage_end" -+ - ACTION!="add|change", GOTO="persistent_storage_end" - SUBSYSTEM!="block", GOTO="persistent_storage_end" - -diff -up udev-126/rules/rules.d/60-persistent-storage-tape.rules.sysconf udev-126/rules/rules.d/60-persistent-storage-tape.rules ---- udev-126/rules/rules.d/60-persistent-storage-tape.rules.sysconf 2008-07-24 16:55:12.000000000 +0200 -+++ udev-126/rules/rules.d/60-persistent-storage-tape.rules 2008-08-08 15:35:57.000000000 +0200 -@@ -2,6 +2,8 @@ - - # persistent storage links: /dev/tape/{by-id,by-path} - -+ENV{UDEV_NO_PERSISTENT_STORAGE}=="1", GOTO="persistent_storage_tape_end" -+ - ACTION!="add|change", GOTO="persistent_storage_tape_end" - - # type 8 devices are "Medium Changers" From 05f658140848cc2697ebe0b444ab60f6481844b6 Mon Sep 17 00:00:00 2001 From: Harald Hoyer Date: Tue, 2 Dec 2008 10:23:48 +0000 Subject: [PATCH 004/142] - version 135 --- .cvsignore | 2 +- sources | 2 +- udev-118-sysconf.patch | 24 +++++++++ udev-127-volid-raid.patch | 50 ------------------- udev-127-volume_id-include-config.h.patch | 12 ----- udev-132-memstickrules.patch | 11 ---- ...-127.tar.bz2.sign => udev-135.tar.bz2.sign | 6 +-- udev.spec | 8 +-- upstream | 2 +- 9 files changed, 34 insertions(+), 83 deletions(-) create mode 100644 udev-118-sysconf.patch delete mode 100644 udev-127-volid-raid.patch delete mode 100644 udev-127-volume_id-include-config.h.patch delete mode 100644 udev-132-memstickrules.patch rename udev-127.tar.bz2.sign => udev-135.tar.bz2.sign (61%) diff --git a/.cvsignore b/.cvsignore index 66dcd7e..565f528 100644 --- a/.cvsignore +++ b/.cvsignore @@ -1 +1 @@ -udev-133.tar.bz2 +udev-135.tar.bz2 diff --git a/sources b/sources index 52a0bda..b3ce601 100644 --- a/sources +++ b/sources @@ -1 +1 @@ -1fe77c4d76162f4b09bdc01becbc4295 udev-133.tar.bz2 +661b9df34e1304dad10f595d95b472bb udev-135.tar.bz2 diff --git a/udev-118-sysconf.patch b/udev-118-sysconf.patch new file mode 100644 index 0000000..30de6ab --- /dev/null +++ b/udev-118-sysconf.patch @@ -0,0 +1,24 @@ +diff -up udev-126/rules/rules.d/60-persistent-storage.rules.sysconf udev-126/rules/rules.d/60-persistent-storage.rules +--- udev-126/rules/rules.d/60-persistent-storage.rules.sysconf 2008-07-31 09:40:37.000000000 +0200 ++++ udev-126/rules/rules.d/60-persistent-storage.rules 2008-08-08 15:35:57.000000000 +0200 +@@ -6,6 +6,8 @@ + # forward scsi device event to corresponding block device + ACTION=="change", SUBSYSTEM=="scsi", ENV{DEVTYPE}=="scsi_device", TEST=="block", ATTR{block/*/uevent}="change" + ++ENV{UDEV_NO_PERSISTENT_STORAGE}=="1", GOTO="persistent_storage_end" ++ + ACTION!="add|change", GOTO="persistent_storage_end" + SUBSYSTEM!="block", GOTO="persistent_storage_end" + +diff -up udev-126/rules/rules.d/60-persistent-storage-tape.rules.sysconf udev-126/rules/rules.d/60-persistent-storage-tape.rules +--- udev-126/rules/rules.d/60-persistent-storage-tape.rules.sysconf 2008-07-24 16:55:12.000000000 +0200 ++++ udev-126/rules/rules.d/60-persistent-storage-tape.rules 2008-08-08 15:35:57.000000000 +0200 +@@ -2,6 +2,8 @@ + + # persistent storage links: /dev/tape/{by-id,by-path} + ++ENV{UDEV_NO_PERSISTENT_STORAGE}=="1", GOTO="persistent_storage_tape_end" ++ + ACTION!="add|change", GOTO="persistent_storage_tape_end" + + # type 8 devices are "Medium Changers" diff --git a/udev-127-volid-raid.patch b/udev-127-volid-raid.patch deleted file mode 100644 index e63e667..0000000 --- a/udev-127-volid-raid.patch +++ /dev/null @@ -1,50 +0,0 @@ -diff -up udev-127/extras/volume_id/lib/linux_raid.c.p1 udev-127/extras/volume_id/lib/linux_raid.c ---- udev-127/extras/volume_id/lib/linux_raid.c.p1 2008-08-28 23:20:07.000000000 +0200 -+++ udev-127/extras/volume_id/lib/linux_raid.c 2008-10-16 14:23:54.000000000 +0200 -@@ -149,26 +149,31 @@ int volume_id_probe_linux_raid(struct vo - { - uint64_t sboff; - -- /* version 0 at the end of the device */ -- sboff = (size & ~(MD_RESERVED_BYTES - 1)) - MD_RESERVED_BYTES; -- if (volume_id_probe_linux_raid0(id, off + sboff, size) == 0) -- return 0; -- -- /* version 1.0 at the end of the device */ -- sboff = (size & ~(0x1000 - 1)) - 0x2000; -- if (volume_id_probe_linux_raid1(id, off + sboff, size) == 0) -- strcpy(id->type_version, "1.0"); -+ if (size > MD_RESERVED_BYTES) { -+ /* version 0 at the end of the device */ -+ sboff = (size & ~(MD_RESERVED_BYTES - 1)) - MD_RESERVED_BYTES; -+ if (volume_id_probe_linux_raid0(id, off + sboff, size) == 0) -+ return 0; -+ -+ /* version 1.0 at the end of the device */ -+ sboff = (size & ~(0x1000 - 1)) - 0x2000; -+ if (volume_id_probe_linux_raid1(id, off + sboff, size) == 0) { -+ strcpy(id->type_version, "1.0"); -+ return 0; -+ } -+ } - - /* version 1.1 at the start of the device */ -- else if (volume_id_probe_linux_raid1(id, off, size) == 0) -+ if (volume_id_probe_linux_raid1(id, off, size) == 0) { - strcpy(id->type_version, "1.1"); -+ return 0; -+ } - - /* version 1.2 at 4k offset from the start */ -- else if (volume_id_probe_linux_raid1(id, off + 0x1000, size) == 0) -+ if (volume_id_probe_linux_raid1(id, off + 0x1000, size) == 0) { - strcpy(id->type_version, "1.2"); -+ return 0; -+ } - -- else -- return -1; -- -- return 0; -+ return -1; - } diff --git a/udev-127-volume_id-include-config.h.patch b/udev-127-volume_id-include-config.h.patch deleted file mode 100644 index 405b446..0000000 --- a/udev-127-volume_id-include-config.h.patch +++ /dev/null @@ -1,12 +0,0 @@ -diff -up udev-127/extras/volume_id/lib/util.c.p2 udev-127/extras/volume_id/lib/util.c ---- udev-127/extras/volume_id/lib/util.c.p2 2008-08-28 23:22:03.000000000 +0200 -+++ udev-127/extras/volume_id/lib/util.c 2008-10-16 14:24:17.000000000 +0200 -@@ -16,6 +16,8 @@ - # include - #endif - -+#include -+ - #include - #include - #include diff --git a/udev-132-memstickrules.patch b/udev-132-memstickrules.patch deleted file mode 100644 index 8c618b5..0000000 --- a/udev-132-memstickrules.patch +++ /dev/null @@ -1,11 +0,0 @@ -diff -up udev-132/rules/redhat/40-redhat.rules.memstickrules udev-132/rules/redhat/40-redhat.rules ---- udev-132/rules/redhat/40-redhat.rules.memstickrules 2008-10-16 18:03:43.000000000 +0200 -+++ udev-132/rules/redhat/40-redhat.rules 2008-11-10 11:42:31.000000000 +0100 -@@ -25,3 +25,7 @@ KERNEL=="vcsa[0-9]*", OWNER="vc - KERNEL=="vcc/*", OWNER="vcsa", GROUP="tty" - - KERNEL=="event*", ATTRS{idVendor}=="03f0", ATTRS{interface}=="Virtual Mouse", ATTRS{bInterfaceProtocol}=="02", SYMLINK+="input/hp_ilo_mouse" -+ -+KERNEL=="mspblk[0-9]", SUBSYSTEMS=="memstick", ATTRS{name}=="?*", ATTRS{serial}=="?*", ENV{ID_NAME}="$attr{name}", ENV{ID_SERIAL}="$attr{serial}", SYMLINK+="disk/by-id/memstick-$env{ID_NAME}_$env{ID_SERIAL}" -+KERNEL=="mspblk[0-9]p[0-9]", ENV{ID_NAME}=="?*", ENV{ID_SERIAL}=="?*", SYMLINK+="disk/by-id/memstick-$env{ID_NAME}_$env{ID_SERIAL}-part%n" -+ diff --git a/udev-127.tar.bz2.sign b/udev-135.tar.bz2.sign similarity index 61% rename from udev-127.tar.bz2.sign rename to udev-135.tar.bz2.sign index 473f50d..7c3d5ca 100644 --- a/udev-127.tar.bz2.sign +++ b/udev-135.tar.bz2.sign @@ -2,7 +2,7 @@ Version: GnuPG v1.4.9 (GNU/Linux) Comment: See http://www.kernel.org/signature.html for info -iD8DBQBIuFtayGugalF9Dw4RApeuAJ9+7UghTzMsbLjLshA6+YxwGgM2FgCfbnj8 -ylD6q64gmtAMRzK4pebQbKg= -=41ir +iD8DBQBJNJNdyGugalF9Dw4RAg4uAJ9fpmhP/VtQJc1uP1w4268P8nBGAgCdHxQU +5nRE8nro4r16+VDfJ+CfqlA= +=+RMU -----END PGP SIGNATURE----- diff --git a/udev.spec b/udev.spec index 20aa86d..faf2422 100644 --- a/udev.spec +++ b/udev.spec @@ -5,7 +5,7 @@ Summary: A userspace implementation of devfs Name: udev -Version: 133 +Version: 135 Release: 1%{?dist} License: GPLv2 Group: System Environment/Base @@ -18,7 +18,6 @@ Source3: udev-post.init Source4: fw_unit_symlinks.sh Source5: udev.sysconfig -Patch1: udev-132-memstickrules.patch Patch102: udev-118-sysconf.patch ExclusiveOS: Linux @@ -91,7 +90,6 @@ dynamic library, which provides access to udev device information. %prep %setup -q -%patch1 -p1 -b .memstickrules %patch102 -p1 -b .sysconf rm rules/redhat/95-pam-console.rules @@ -163,7 +161,6 @@ done for i in \ rules/redhat/40-redhat.rules \ - rules/suse/40-suse.rules \ %ifarch ia64 rules/packages/40-ia64.rules \ %endif @@ -364,6 +361,9 @@ rm -rf $RPM_BUILD_ROOT %changelog +* Tue Dec 02 2008 Harald Hoyer 135-1 +- version 135 + * Wed Nov 19 2008 Harald Hoyer 133-1 - version 133 diff --git a/upstream b/upstream index 0a3c741..565f528 100644 --- a/upstream +++ b/upstream @@ -1 +1 @@ -udev-114.tar.bz2 +udev-135.tar.bz2 From 00844ad8716d00397f2ae11a22a44d5f0c5113db Mon Sep 17 00:00:00 2001 From: Harald Hoyer Date: Tue, 16 Dec 2008 09:31:55 +0000 Subject: [PATCH 005/142] /sbin/udevsettle -> /sbin/udevadm settle --- start_udev | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/start_udev b/start_udev index 5af4599..8785c10 100755 --- a/start_udev +++ b/start_udev @@ -192,9 +192,9 @@ wait_for_queue() { local timeout=${1:-0} local ret=0 if [ $timeout -gt 0 ]; then - /sbin/udevsettle --timeout=$timeout + /sbin/udevadm settle --timeout=$timeout else - /sbin/udevsettle + /sbin/udevadm settle fi ret=$? if [ $ret -ne 0 ]; then From 6e30c7cb5958717d471126c60a471f965fcd92d3 Mon Sep 17 00:00:00 2001 From: Harald Hoyer Date: Tue, 16 Dec 2008 09:42:56 +0000 Subject: [PATCH 006/142] - changed udevsettle -> udevadm settle - added doc to libudev-devel - added more attr and defattr - various rpmlint fixes --- udev.spec | 65 +++++++++++++++++++++++++++++++++++-------------------- 1 file changed, 42 insertions(+), 23 deletions(-) diff --git a/udev.spec b/udev.spec index faf2422..168d2be 100644 --- a/udev.spec +++ b/udev.spec @@ -6,7 +6,7 @@ Summary: A userspace implementation of devfs Name: udev Version: 135 -Release: 1%{?dist} +Release: 2%{?dist} License: GPLv2 Group: System Environment/Base Provides: udev-persistent = %{version}-%{release} @@ -18,6 +18,7 @@ Source3: udev-post.init Source4: fw_unit_symlinks.sh Source5: udev.sysconfig +Patch1: udev-135-sepol.patch Patch102: udev-118-sysconf.patch ExclusiveOS: Linux @@ -29,6 +30,7 @@ BuildRequires: sed libselinux-devel >= 0:1.17.9-2 flex libsepol-devel BuildRequires: glib2-devel bison findutils MAKEDEV %if %{with_static} BuildRequires: libselinux-static libsepol-static +BuildRequires: autoconf libtool %endif Requires: libselinux >= 0:1.17.9-2 sed Conflicts: kernel < 0:2.6 mkinitrd <= 0:4.1.11-1 initscripts < 7.84 @@ -90,24 +92,29 @@ dynamic library, which provides access to udev device information. %prep %setup -q +%if %{with_static} +%patch1 -p1 -b .sepol +%endif %patch102 -p1 -b .sysconf rm rules/redhat/95-pam-console.rules %build -%configure --with-selinux --prefix=%{_prefix} --exec-prefix="" --sysconfdir=%{_sysconfdir} --with-libdir-name=%{_lib} --sbindir="/sbin" --enable-static %if %{with_static} -make LDFLAGS=-static %{?_smp_mflags} +libtoolize -f +autoreconf +%configure --with-selinux --prefix=%{_prefix} --exec-prefix="" --sysconfdir=%{_sysconfdir} --with-libdir-name=%{_lib} --sbindir="/sbin" --enable-static +make LDFLAGS="-all-static" %{?_smp_mflags} for i in udev/udevd \ - udev/udevadm \ - extras/scsi_id/scsi_id \ - extras/ata_id/ata_id \ - extras/edd_id/edd_id \ - extras/usb_id/usb_id \ - extras/cdrom_id/cdrom_id \ - extras/volume_id/vol_id \ - extras/floppy/create_floppy_devices \ - ; do - mv $i $i.static + udev/udevadm \ + extras/scsi_id/scsi_id \ + extras/ata_id/ata_id \ + extras/edd_id/edd_id \ + extras/usb_id/usb_id \ + extras/cdrom_id/cdrom_id \ + extras/volume_id/vol_id \ + extras/floppy/create_floppy_devices \ + ; do + mv $i $i.static done make clean %endif @@ -157,6 +164,7 @@ done for i in udev/udevd udev/udevadm; do install -m 0755 $i.static $RPM_BUILD_ROOT/sbin/$(basename $i).static done + %endif for i in \ @@ -256,7 +264,7 @@ rm -f /var/lib/udev/makenode.d/* >/dev/null 2>&1 || : rm -rf $RPM_BUILD_ROOT %files -%defattr(-,root,root) +%defattr(0644, root, root, 0755) %doc COPYING README TODO ChangeLog docs/* %attr(0755,root,root) /sbin/udevadm %attr(0755,root,root) /sbin/udevsettle @@ -295,7 +303,7 @@ rm -rf $RPM_BUILD_ROOT %config(noreplace) %attr(0644,root,root) %{_sysconfdir}/sysconfig/udev %config(noreplace) %attr(0644,root,root) %{_sysconfdir}/udev/udev.conf -%config %attr(0644,root,root) %{udev_scriptdir}/rules.d/*.rules +%attr(0644,root,root) %{udev_scriptdir}/rules.d/*.rules #%config(missingok) %{_sysconfdir}/hotplug.d/default/10-udev.hotplug %config(noreplace) %attr(0644,root,root) %{_sysconfdir}/scsi_id.config @@ -323,22 +331,25 @@ rm -rf $RPM_BUILD_ROOT %if %{with_static} %files static +%defattr(0644, root, root, 0755) %doc COPYING %attr(0755,root,root) /sbin/udevd.static %attr(0755,root,root) /sbin/udevadm.static -%attr(755,root,root) %{udev_scriptdir}/scsi_id.static -%attr(755,root,root) %{udev_scriptdir}/ata_id.static -%attr(755,root,root) %{udev_scriptdir}/edd_id.static -%attr(755,root,root) %{udev_scriptdir}/usb_id.static -%attr(755,root,root) %{udev_scriptdir}/vol_id.static +%attr(0755,root,root) %{udev_scriptdir}/scsi_id.static +%attr(0755,root,root) %{udev_scriptdir}/ata_id.static +%attr(0755,root,root) %{udev_scriptdir}/edd_id.static +%attr(0755,root,root) %{udev_scriptdir}/usb_id.static +%attr(0755,root,root) %{udev_scriptdir}/vol_id.static %attr(0755,root,root) %{udev_scriptdir}/create_floppy_devices.static %endif %files -n libvolume_id +%defattr(0644, root, root, 0755) %doc COPYING %attr(0755,root,root) /%{_lib}/libvolume_id.so.* %files -n libvolume_id-devel +%defattr(0644, root, root, 0755) %doc COPYING %defattr(0644, root, root, 0755) %{_includedir}/libvolume_id.h @@ -347,11 +358,13 @@ rm -rf $RPM_BUILD_ROOT %{_libdir}/pkgconfig/libvolume_id.pc %files -n libudev0 -%defattr(-,root,root) -/%{_lib}/libudev.so.* +%defattr(0644, root, root, 0755) +%doc COPYING +%attr(0755,root,root) /%{_lib}/libudev.so.* %files -n libudev-devel -%defattr(-,root,root) +%defattr(0644, root, root, 0755) +%doc COPYING %{_includedir}/libudev.h %{_libdir}/libudev.so %{_libdir}/pkgconfig/libudev.pc @@ -361,6 +374,12 @@ rm -rf $RPM_BUILD_ROOT %changelog +* Tue Dec 16 2008 Harald Hoyer 135-2 +- changed udevsettle -> udevadm settle +- added doc to libudev-devel +- added more attr and defattr +- various rpmlint fixes + * Tue Dec 02 2008 Harald Hoyer 135-1 - version 135 From b5dbf93f17ae1631d0e9653990f258e4ca116c17 Mon Sep 17 00:00:00 2001 From: Harald Hoyer Date: Tue, 16 Dec 2008 16:04:52 +0000 Subject: [PATCH 007/142] - added sepol patch --- udev-135-sepol.patch | 17 +++++++++++++++++ udev.spec | 5 ++++- 2 files changed, 21 insertions(+), 1 deletion(-) create mode 100644 udev-135-sepol.patch diff --git a/udev-135-sepol.patch b/udev-135-sepol.patch new file mode 100644 index 0000000..32c9afb --- /dev/null +++ b/udev-135-sepol.patch @@ -0,0 +1,17 @@ +diff -up udev-135/configure.ac.sepol udev-135/configure.ac +--- udev-135/configure.ac.sepol 2008-12-02 01:05:43.000000000 +0100 ++++ udev-135/configure.ac 2008-12-16 10:45:24.000000000 +0100 +@@ -55,6 +55,13 @@ if test "x$with_selinux" = xyes; then + AC_DEFINE(USE_SELINUX, [1] ,[compile with SELinux support]) + SELINUX_LIBS="-lselinux" + fi ++if test "x$with_selinux" = xyes; then ++ LIBS_save=$LIBS ++ AC_CHECK_LIB(sepol, sepol_genbools, ++ [SELINUX_LIBS="$SELINUX_LIBS -lsepol"], ++ []) ++ LIBS=$LIBS_save ++fi + AC_SUBST([SELINUX_LIBS]) + AM_CONDITIONAL(USE_SELINUX, [test "x$with_selinux" = xyes], [compile with SELinux support]) + diff --git a/udev.spec b/udev.spec index 168d2be..f76b926 100644 --- a/udev.spec +++ b/udev.spec @@ -6,7 +6,7 @@ Summary: A userspace implementation of devfs Name: udev Version: 135 -Release: 2%{?dist} +Release: 3%{?dist} License: GPLv2 Group: System Environment/Base Provides: udev-persistent = %{version}-%{release} @@ -374,6 +374,9 @@ rm -rf $RPM_BUILD_ROOT %changelog +* Tue Dec 16 2008 Harald Hoyer 135-3 +- added sepol patch + * Tue Dec 16 2008 Harald Hoyer 135-2 - changed udevsettle -> udevadm settle - added doc to libudev-devel From 975b6aaa58b34eaba97fc16ad0e37b1f2cc4c238 Mon Sep 17 00:00:00 2001 From: Harald Hoyer Date: Tue, 20 Jan 2009 11:16:28 +0000 Subject: [PATCH 008/142] test for restorecon before using it --- start_udev | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/start_udev b/start_udev index 8785c10..530c3c1 100755 --- a/start_udev +++ b/start_udev @@ -128,7 +128,7 @@ make_extra_nodes () { /bin/chown root:lp /dev/lp2 /bin/mknod -m 0660 /dev/lp3 c 6 3 /bin/chown root:lp /dev/lp3 - /sbin/restorecon /dev/loop0 /dev/loop1 /dev/loop2 /dev/loop3 /dev/loop4 /dev/loop5 /dev/loop6 /dev/loop7 /dev/net/tun /dev/ppp /dev/lp0 /dev/lp1 /dev/lp2 /dev/lp3 + [ -x /sbin/restorecon ] && /sbin/restorecon /dev/loop0 /dev/loop1 /dev/loop2 /dev/loop3 /dev/loop4 /dev/loop5 /dev/loop6 /dev/loop7 /dev/net/tun /dev/ppp /dev/lp0 /dev/lp1 /dev/lp2 /dev/lp3 if [ -x "$MAKEDEV" ]; then for i in /etc/udev/makedev.d/*.nodes; do From 80a542a733590891928bf5aa302cef3fe942ed9c Mon Sep 17 00:00:00 2001 From: Harald Hoyer Date: Tue, 20 Jan 2009 11:58:53 +0000 Subject: [PATCH 009/142] - test for restorecon in start_udev before it is used (bug #480608) - added groups video audio cdrom tape dialout in post (might be moved to MAKEDEV) - version 136 --- .cvsignore | 2 +- sources | 2 +- udev.spec | 30 ++++++++++++++++++++---------- 3 files changed, 22 insertions(+), 12 deletions(-) diff --git a/.cvsignore b/.cvsignore index 565f528..634ab85 100644 --- a/.cvsignore +++ b/.cvsignore @@ -1 +1 @@ -udev-135.tar.bz2 +udev-136.tar.bz2 diff --git a/sources b/sources index b3ce601..75739d3 100644 --- a/sources +++ b/sources @@ -1 +1 @@ -661b9df34e1304dad10f595d95b472bb udev-135.tar.bz2 +9a27ccd96cf8d529c4e424520547b72a udev-136.tar.bz2 diff --git a/udev.spec b/udev.spec index f76b926..05a2b0f 100644 --- a/udev.spec +++ b/udev.spec @@ -5,8 +5,8 @@ Summary: A userspace implementation of devfs Name: udev -Version: 135 -Release: 3%{?dist} +Version: 136 +Release: 1%{?dist} License: GPLv2 Group: System Environment/Base Provides: udev-persistent = %{version}-%{release} @@ -18,14 +18,13 @@ Source3: udev-post.init Source4: fw_unit_symlinks.sh Source5: udev.sysconfig -Patch1: udev-135-sepol.patch Patch102: udev-118-sysconf.patch ExclusiveOS: Linux URL: http://www.kernel.org/pub/linux/utils/kernel/hotplug/udev.html BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n) Requires(pre): /bin/sh fileutils /sbin/chkconfig /sbin/service -Requires(pre): MAKEDEV >= 0:3.11 +Requires(pre): MAKEDEV >= 0:3.11 /usr/bin/getent /usr/sbin/groupadd BuildRequires: sed libselinux-devel >= 0:1.17.9-2 flex libsepol-devel BuildRequires: glib2-devel bison findutils MAKEDEV %if %{with_static} @@ -89,19 +88,13 @@ Requires: libudev0 = %{version}-%{release} This package contains the development files for the library libudev, a dynamic library, which provides access to udev device information. - %prep %setup -q -%if %{with_static} -%patch1 -p1 -b .sepol -%endif %patch102 -p1 -b .sysconf rm rules/redhat/95-pam-console.rules %build %if %{with_static} -libtoolize -f -autoreconf %configure --with-selinux --prefix=%{_prefix} --exec-prefix="" --sysconfdir=%{_sysconfdir} --with-libdir-name=%{_lib} --sbindir="/sbin" --enable-static make LDFLAGS="-all-static" %{?_smp_mflags} for i in udev/udevd \ @@ -117,6 +110,8 @@ for i in udev/udevd \ mv $i $i.static done make clean +%else +%configure --with-selinux --prefix=%{_prefix} --exec-prefix="" --sysconfdir=%{_sysconfdir} --with-libdir-name=%{_lib} --sbindir="/sbin" %endif make %{?_smp_mflags} @@ -232,6 +227,15 @@ if [ "$1" -gt 1 -a -x /sbin/pidof ]; then fi /sbin/chkconfig --add udev-post + +# to be removed after F10 EOL (and for RHEL-6) +getent group video >/dev/null || /usr/sbin/groupadd -g 39 video || : +getent group audio >/dev/null || /usr/sbin/groupadd -g 63 audio || : +# to be kept +getent group cdrom >/dev/null || /usr/sbin/groupadd -g 11 cdrom || : +getent group tape >/dev/null || /usr/sbin/groupadd -g 33 tape || : +getent group dialout >/dev/null || /usr/sbin/groupadd -g 87 dialout || : + exit 0 %triggerpostun -- dev <= 0:3.12-1 @@ -374,6 +378,12 @@ rm -rf $RPM_BUILD_ROOT %changelog +* Tue Jan 20 2009 Harald Hoyer 136-1 +- test for restorecon in start_udev before it is used (bug #480608) +- added groups video audio cdrom tape dialout in post + (might be moved to MAKEDEV) +- version 136 + * Tue Dec 16 2008 Harald Hoyer 135-3 - added sepol patch From e4cfa15239f00f165548d3eb67e5f3a81329cd86 Mon Sep 17 00:00:00 2001 From: Harald Hoyer Date: Tue, 20 Jan 2009 12:17:14 +0000 Subject: [PATCH 010/142] - added some rule fixes, which will be in udev-137 --- udev-136-cdrom.patch | 21 +++++++++++++++++++++ udev-136-tape.patch | 23 +++++++++++++++++++++++ udev-136-video.patch | 20 ++++++++++++++++++++ udev.spec | 13 ++++++++++++- 4 files changed, 76 insertions(+), 1 deletion(-) create mode 100644 udev-136-cdrom.patch create mode 100644 udev-136-tape.patch create mode 100644 udev-136-video.patch diff --git a/udev-136-cdrom.patch b/udev-136-cdrom.patch new file mode 100644 index 0000000..1ceaa44 --- /dev/null +++ b/udev-136-cdrom.patch @@ -0,0 +1,21 @@ +commit 18cff5c3b2e3591fa46107288ea2d7026a15ccf3 +Author: Kay Sievers +Date: Sat Jan 10 17:44:09 2009 +0100 + + rules: fix typo in ide cd rule + + Thanks to Scott, who found that. + +diff --git a/rules/rules.d/50-udev-default.rules b/rules/rules.d/50-udev-default.rules +index 119941b..7730f0d 100644 +--- a/rules/rules.d/50-udev-default.rules ++++ b/rules/rules.d/50-udev-default.rules +@@ -68,7 +68,7 @@ KERNEL=="hd*", SUBSYSTEMS=="ide", ATTRS{media}=="floppy", OPTIONS+="all_partitio + + # cdrom + SUBSYSTEM=="block", KERNEL=="sr[0-9]*", SYMLINK+="scd%n", GROUP="cdrom" +-SUBSYSTEM=="block", KERNEL=="hd[0-9]*", SUBSYSTEMS=="ide", ATTRS{media}=="cdrom", GROUP="cdrom" ++SUBSYSTEM=="block", KERNEL=="hd*", SUBSYSTEMS=="ide", ATTRS{media}=="cdrom", GROUP="cdrom" + SUBSYSTEMS=="scsi", ATTRS{type}=="4|5", GROUP="cdrom" + KERNEL=="pktcdvd[0-9]*", NAME="pktcdvd/%k", GROUP="cdrom" + KERNEL=="pktcdvd", NAME="pktcdvd/control", GROUP="cdrom" diff --git a/udev-136-tape.patch b/udev-136-tape.patch new file mode 100644 index 0000000..93bcbd1 --- /dev/null +++ b/udev-136-tape.patch @@ -0,0 +1,23 @@ +commit 8b739dec53f8bca23e46e2d2a9732abee9b8d591 +Author: Lennart Poettering +Date: Sat Jan 10 01:37:03 2009 +0100 + + fix naming for tape nst devices in /dev/tape/by-path/ + + $env{ID_PATH} includes the "-nst" suffix anyway, so we shouldn't append + it a second time as part of the rule creating the device file symlink. + + Signed-off-by: Lennart Poettering + +diff --git a/rules/rules.d/60-persistent-storage-tape.rules b/rules/rules.d/60-persistent-storage-tape.rules +index d3226f1..8d53888 100644 +--- a/rules/rules.d/60-persistent-storage-tape.rules ++++ b/rules/rules.d/60-persistent-storage-tape.rules +@@ -19,6 +19,6 @@ KERNEL=="nst*[0-9]", ENV{ID_SERIAL}=="?*", SYMLINK+="tape/by-id/$env{ID_BUS}-$en + # by-path (parent device path) + KERNEL=="st*[0-9]|nst*[0-9]", IMPORT{program}="path_id %p" + KERNEL=="st*[0-9]", ENV{ID_PATH}=="?*", SYMLINK+="tape/by-path/$env{ID_PATH}" +-KERNEL=="nst*[0-9]", ENV{ID_PATH}=="?*", SYMLINK+="tape/by-path/$env{ID_PATH}-nst" ++KERNEL=="nst*[0-9]", ENV{ID_PATH}=="?*", SYMLINK+="tape/by-path/$env{ID_PATH}" + + LABEL="persistent_storage_tape_end" diff --git a/udev-136-video.patch b/udev-136-video.patch new file mode 100644 index 0000000..dd9d31a --- /dev/null +++ b/udev-136-video.patch @@ -0,0 +1,20 @@ +commit 66d9b44f8302efe383ada6a52d8431655614bf76 +Author: Kay Sievers +Date: Thu Jan 15 17:06:14 2009 +0100 + + rules: add drm devices to group "video" + + https://bugs.launchpad.net/bugs/317430 + +diff --git a/rules/rules.d/50-udev-default.rules b/rules/rules.d/50-udev-default.rules +index 7730f0d..95d82d7 100644 +--- a/rules/rules.d/50-udev-default.rules ++++ b/rules/rules.d/50-udev-default.rules +@@ -38,6 +38,7 @@ KERNEL=="card[0-9]*", NAME="dri/%k" + KERNEL=="pmu", GROUP="video" + KERNEL=="nvidia*|nvidiactl*", GROUP="video" + SUBSYSTEM=="graphics", GROUP="video" ++SUBSYSTEM=="drm", GROUP="video" + + # DVB (video) + SUBSYSTEM=="dvb", ENV{DVB_ADAPTER_NUM}=="?*", NAME="dvb/adapter$env{DVB_ADAPTER_NUM}/$env{DVB_DEVICE_TYPE}$env{DVB_DEVICE_NUM}", GROUP="video" diff --git a/udev.spec b/udev.spec index 05a2b0f..cb2de4e 100644 --- a/udev.spec +++ b/udev.spec @@ -6,7 +6,7 @@ Summary: A userspace implementation of devfs Name: udev Version: 136 -Release: 1%{?dist} +Release: 2%{?dist} License: GPLv2 Group: System Environment/Base Provides: udev-persistent = %{version}-%{release} @@ -18,6 +18,10 @@ Source3: udev-post.init Source4: fw_unit_symlinks.sh Source5: udev.sysconfig +Patch1: udev-136-tape.patch +Patch2: udev-136-cdrom.patch +Patch3: udev-136-video.patch + Patch102: udev-118-sysconf.patch ExclusiveOS: Linux @@ -90,6 +94,10 @@ dynamic library, which provides access to udev device information. %prep %setup -q +%patch1 -p1 +%patch2 -p1 +%patch3 -p1 + %patch102 -p1 -b .sysconf rm rules/redhat/95-pam-console.rules @@ -378,6 +386,9 @@ rm -rf $RPM_BUILD_ROOT %changelog +* Tue Jan 20 2009 Harald Hoyer 136-2 +- added some rule fixes, which will be in udev-137 + * Tue Jan 20 2009 Harald Hoyer 136-1 - test for restorecon in start_udev before it is used (bug #480608) - added groups video audio cdrom tape dialout in post From 4db620ffcdb84402aa6ba7c3e1574dc048d8c60c Mon Sep 17 00:00:00 2001 From: Harald Hoyer Date: Thu, 29 Jan 2009 11:49:39 +0000 Subject: [PATCH 011/142] - version 137 - add vol_id patches from kzak - dialout group has gid 18 now --- .cvsignore | 2 +- sources | 2 +- udev-137-vol_id1.patch | 20 +++++++++++++ udev-137-vol_id2.patch | 30 +++++++++++++++++++ ...-135.tar.bz2.sign => udev-137.tar.bz2.sign | 6 ++-- udev.spec | 22 +++++++------- upstream | 2 +- 7 files changed, 68 insertions(+), 16 deletions(-) create mode 100644 udev-137-vol_id1.patch create mode 100644 udev-137-vol_id2.patch rename udev-135.tar.bz2.sign => udev-137.tar.bz2.sign (61%) diff --git a/.cvsignore b/.cvsignore index 634ab85..260ace6 100644 --- a/.cvsignore +++ b/.cvsignore @@ -1 +1 @@ -udev-136.tar.bz2 +udev-137.tar.bz2 diff --git a/sources b/sources index 75739d3..0abe86b 100644 --- a/sources +++ b/sources @@ -1 +1 @@ -9a27ccd96cf8d529c4e424520547b72a udev-136.tar.bz2 +9d5960024da9c80b54c8273ee05b31e1 udev-137.tar.bz2 diff --git a/udev-137-vol_id1.patch b/udev-137-vol_id1.patch new file mode 100644 index 0000000..41f7403 --- /dev/null +++ b/udev-137-vol_id1.patch @@ -0,0 +1,20 @@ +commit 7e5861ff70994fdc2e383e227ff24225ac5f7ce5 +Author: Karel Zak +Date: Sat Jan 24 00:37:23 2009 +0100 + + vol_id: add missing id->type to swap0 + + Signed-off-by: Karel Zak + +diff --git a/extras/volume_id/lib/linux_swap.c b/extras/volume_id/lib/linux_swap.c +index 1698e9d..53649bd 100644 +--- a/extras/volume_id/lib/linux_swap.c ++++ b/extras/volume_id/lib/linux_swap.c +@@ -57,6 +57,7 @@ int volume_id_probe_linux_swap(struct volume_id *id, uint64_t off, uint64_t size + return -1; + + if (memcmp(buf, "SWAP-SPACE", 10) == 0) { ++ id->type = "swap"; + strcpy(id->type_version, "1"); + goto found; + } diff --git a/udev-137-vol_id2.patch b/udev-137-vol_id2.patch new file mode 100644 index 0000000..34815ca --- /dev/null +++ b/udev-137-vol_id2.patch @@ -0,0 +1,30 @@ +commit 3e2084614b4d8308d5c0ceb34ec3634eb3353c00 +Author: Karel Zak +Date: Sat Jan 24 00:37:22 2009 +0100 + + vol_id: fix ddf version string + + The version string in DDF suberblock does not include the null terminator + and the snprintf() function writes at most "size" bytes *including* the + null byte. + + old version: + ID_FS_VERSION=02.00.0 + new version: + ID_FS_VERSION=02.00.00 + + Signed-off-by: Karel Zak + +diff --git a/extras/volume_id/lib/ddf_raid.c b/extras/volume_id/lib/ddf_raid.c +index 58bdae9..32f20ce 100644 +--- a/extras/volume_id/lib/ddf_raid.c ++++ b/extras/volume_id/lib/ddf_raid.c +@@ -87,7 +87,7 @@ int volume_id_probe_ddf_raid(struct volume_id *id, uint64_t off, uint64_t size) + return -1; + found: + volume_id_set_uuid(id, ddf->guid, DDF_GUID_LENGTH, UUID_STRING); +- snprintf(id->type_version, DDF_REV_LENGTH, "%s", ddf->ddf_rev); ++ snprintf(id->type_version, DDF_REV_LENGTH + 1, "%s", ddf->ddf_rev); + volume_id_set_usage(id, VOLUME_ID_RAID); + id->type = "ddf_raid_member"; + return 0; diff --git a/udev-135.tar.bz2.sign b/udev-137.tar.bz2.sign similarity index 61% rename from udev-135.tar.bz2.sign rename to udev-137.tar.bz2.sign index 7c3d5ca..bde1723 100644 --- a/udev-135.tar.bz2.sign +++ b/udev-137.tar.bz2.sign @@ -2,7 +2,7 @@ Version: GnuPG v1.4.9 (GNU/Linux) Comment: See http://www.kernel.org/signature.html for info -iD8DBQBJNJNdyGugalF9Dw4RAg4uAJ9fpmhP/VtQJc1uP1w4268P8nBGAgCdHxQU -5nRE8nro4r16+VDfJ+CfqlA= -=+RMU +iD8DBQBJeTdlyGugalF9Dw4RAolBAJ9sKq3V9mpanhvpOMkYXky7DwF7sACgg0N4 +SsPqKyBV4nkSMxxLQwxJEdw= +=PEri -----END PGP SIGNATURE----- diff --git a/udev.spec b/udev.spec index cb2de4e..74540c7 100644 --- a/udev.spec +++ b/udev.spec @@ -5,8 +5,8 @@ Summary: A userspace implementation of devfs Name: udev -Version: 136 -Release: 2%{?dist} +Version: 137 +Release: 1%{?dist} License: GPLv2 Group: System Environment/Base Provides: udev-persistent = %{version}-%{release} @@ -18,10 +18,8 @@ Source3: udev-post.init Source4: fw_unit_symlinks.sh Source5: udev.sysconfig -Patch1: udev-136-tape.patch -Patch2: udev-136-cdrom.patch -Patch3: udev-136-video.patch - +Patch1: udev-137-vol_id1.patch +Patch2: udev-137-vol_id2.patch Patch102: udev-118-sysconf.patch ExclusiveOS: Linux @@ -94,10 +92,9 @@ dynamic library, which provides access to udev device information. %prep %setup -q -%patch1 -p1 -%patch2 -p1 -%patch3 -p1 +%patch1 -p1 +%patch2 -p1 %patch102 -p1 -b .sysconf rm rules/redhat/95-pam-console.rules @@ -242,7 +239,7 @@ getent group audio >/dev/null || /usr/sbin/groupadd -g 63 audio || : # to be kept getent group cdrom >/dev/null || /usr/sbin/groupadd -g 11 cdrom || : getent group tape >/dev/null || /usr/sbin/groupadd -g 33 tape || : -getent group dialout >/dev/null || /usr/sbin/groupadd -g 87 dialout || : +getent group dialout >/dev/null || /usr/sbin/groupadd -g 18 dialout || : exit 0 @@ -386,6 +383,11 @@ rm -rf $RPM_BUILD_ROOT %changelog +* Thu Jan 29 2009 Harald Hoyer 137-1 +- version 137 +- add vol_id patches from kzak +- dialout group has gid 18 now + * Tue Jan 20 2009 Harald Hoyer 136-2 - added some rule fixes, which will be in udev-137 diff --git a/upstream b/upstream index 565f528..260ace6 100644 --- a/upstream +++ b/upstream @@ -1 +1 @@ -udev-135.tar.bz2 +udev-137.tar.bz2 From 021d639f1a6d7befaff1e93662cd253c6a1e829f Mon Sep 17 00:00:00 2001 From: Harald Hoyer Date: Fri, 30 Jan 2009 09:26:48 +0000 Subject: [PATCH 012/142] - moved groupadd to pre section (bug #483089) --- udev.spec | 23 +++++++++++++---------- 1 file changed, 13 insertions(+), 10 deletions(-) diff --git a/udev.spec b/udev.spec index 74540c7..d231ccc 100644 --- a/udev.spec +++ b/udev.spec @@ -6,7 +6,7 @@ Summary: A userspace implementation of devfs Name: udev Version: 137 -Release: 1%{?dist} +Release: 2%{?dist} License: GPLv2 Group: System Environment/Base Provides: udev-persistent = %{version}-%{release} @@ -222,6 +222,15 @@ if [ "$1" -eq 0 ]; then fi exit 0 +%pre +# to be removed after F10 EOL (and for RHEL-6) +getent group video >/dev/null || /usr/sbin/groupadd -g 39 video || : +getent group audio >/dev/null || /usr/sbin/groupadd -g 63 audio || : +# to be kept +getent group cdrom >/dev/null || /usr/sbin/groupadd -g 11 cdrom || : +getent group tape >/dev/null || /usr/sbin/groupadd -g 33 tape || : +getent group dialout >/dev/null || /usr/sbin/groupadd -g 18 dialout || : + %post if [ "$1" -gt 1 -a -x /sbin/pidof ]; then pid=$(/sbin/pidof -c udevd) @@ -232,15 +241,6 @@ if [ "$1" -gt 1 -a -x /sbin/pidof ]; then fi /sbin/chkconfig --add udev-post - -# to be removed after F10 EOL (and for RHEL-6) -getent group video >/dev/null || /usr/sbin/groupadd -g 39 video || : -getent group audio >/dev/null || /usr/sbin/groupadd -g 63 audio || : -# to be kept -getent group cdrom >/dev/null || /usr/sbin/groupadd -g 11 cdrom || : -getent group tape >/dev/null || /usr/sbin/groupadd -g 33 tape || : -getent group dialout >/dev/null || /usr/sbin/groupadd -g 18 dialout || : - exit 0 %triggerpostun -- dev <= 0:3.12-1 @@ -383,6 +383,9 @@ rm -rf $RPM_BUILD_ROOT %changelog +* Fri Jan 30 2009 Harald Hoyer 137-2 +- moved groupadd to pre section (bug #483089) + * Thu Jan 29 2009 Harald Hoyer 137-1 - version 137 - add vol_id patches from kzak From fe7fc4b385d7a921c25314e5a0efc1ba544675c2 Mon Sep 17 00:00:00 2001 From: Harald Hoyer Date: Thu, 5 Feb 2009 07:35:24 +0000 Subject: [PATCH 013/142] - added 5 second sleep for "modprobedebug" to catch bad modules --- start_udev | 2 ++ udev.spec | 5 ++++- 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/start_udev b/start_udev index 530c3c1..8e9228f 100755 --- a/start_udev +++ b/start_udev @@ -296,6 +296,8 @@ if [ -f "/sys/class/tty/console/uevent" ]; then echo findalias /sys | while read modules ; do if [ -n "$modules" ]; then + echo "Loading modules for $modules in 5 seconds" + sleep 5 /sbin/modprobe -a -v -q $modules wait_for_queue $udevtimeout fi diff --git a/udev.spec b/udev.spec index d231ccc..31213f4 100644 --- a/udev.spec +++ b/udev.spec @@ -6,7 +6,7 @@ Summary: A userspace implementation of devfs Name: udev Version: 137 -Release: 2%{?dist} +Release: 3%{?dist} License: GPLv2 Group: System Environment/Base Provides: udev-persistent = %{version}-%{release} @@ -383,6 +383,9 @@ rm -rf $RPM_BUILD_ROOT %changelog +* Thu Feb 05 2009 Harald Hoyer 137-3 +- added 5 second sleep for "modprobedebug" to catch bad modules + * Fri Jan 30 2009 Harald Hoyer 137-2 - moved groupadd to pre section (bug #483089) From b0b79fa1f4c0ffea76e2be7cdfe058617f2345ee Mon Sep 17 00:00:00 2001 From: Harald Hoyer Date: Thu, 5 Feb 2009 07:49:49 +0000 Subject: [PATCH 014/142] - fixed md change/remove event handling --- udev-137-mdremove.patch | 13 +++++++++++++ udev.spec | 7 ++++++- 2 files changed, 19 insertions(+), 1 deletion(-) create mode 100644 udev-137-mdremove.patch diff --git a/udev-137-mdremove.patch b/udev-137-mdremove.patch new file mode 100644 index 0000000..d144bd6 --- /dev/null +++ b/udev-137-mdremove.patch @@ -0,0 +1,13 @@ +diff -up udev-137/rules/packages/64-md-raid.rules.mdremove udev-137/rules/packages/64-md-raid.rules +--- udev-137/rules/packages/64-md-raid.rules.mdremove 2009-02-05 08:47:35.000000000 +0100 ++++ udev-137/rules/packages/64-md-raid.rules 2009-02-05 08:47:58.000000000 +0100 +@@ -11,7 +11,8 @@ KERNEL!="md*", GOTO="md_end" + # container devices have a metadata version of e.g. 'external:ddf' and + # never leave state 'inactive' + ATTR{md/metadata_version}=="external:[A-Za-z]*", ATTR{md/array_state}=="inactive", GOTO="md_ignore_state" +-ATTR{md/array_state}=="|clear|inactive", GOTO="md_end" ++ATTR{md/array_state}=="clear|inactive", GOTO="md_end" ++ATTR{md/array_state}!="?*", GOTO="md_end" + LABEL="md_ignore_state" + + IMPORT{program}="/sbin/mdadm --detail --export $tempnode" diff --git a/udev.spec b/udev.spec index 31213f4..5676485 100644 --- a/udev.spec +++ b/udev.spec @@ -6,7 +6,7 @@ Summary: A userspace implementation of devfs Name: udev Version: 137 -Release: 3%{?dist} +Release: 4%{?dist} License: GPLv2 Group: System Environment/Base Provides: udev-persistent = %{version}-%{release} @@ -20,6 +20,7 @@ Source5: udev.sysconfig Patch1: udev-137-vol_id1.patch Patch2: udev-137-vol_id2.patch +Patch3: udev-137-mdremove.patch Patch102: udev-118-sysconf.patch ExclusiveOS: Linux @@ -95,6 +96,7 @@ dynamic library, which provides access to udev device information. %patch1 -p1 %patch2 -p1 +%patch3 -p1 .remove %patch102 -p1 -b .sysconf rm rules/redhat/95-pam-console.rules @@ -383,6 +385,9 @@ rm -rf $RPM_BUILD_ROOT %changelog +* Thu Feb 05 2009 Harald Hoyer 137-4 +- fixed md change/remove event handling + * Thu Feb 05 2009 Harald Hoyer 137-3 - added 5 second sleep for "modprobedebug" to catch bad modules From 75cb6aeb761e33481145665d423b8d68914206c4 Mon Sep 17 00:00:00 2001 From: Harald Hoyer Date: Thu, 5 Feb 2009 07:52:35 +0000 Subject: [PATCH 015/142] fixed typo --- udev.spec | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/udev.spec b/udev.spec index 5676485..a97ac46 100644 --- a/udev.spec +++ b/udev.spec @@ -96,7 +96,7 @@ dynamic library, which provides access to udev device information. %patch1 -p1 %patch2 -p1 -%patch3 -p1 .remove +%patch3 -p1 -b .remove %patch102 -p1 -b .sysconf rm rules/redhat/95-pam-console.rules From 0b109e9f9ee60a1cc836256d4532b9aaba639161 Mon Sep 17 00:00:00 2001 From: Jesse Keating Date: Wed, 25 Feb 2009 22:30:47 +0000 Subject: [PATCH 016/142] - Rebuilt for https://fedoraproject.org/wiki/Fedora_11_Mass_Rebuild --- udev.spec | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/udev.spec b/udev.spec index a97ac46..08d36b4 100644 --- a/udev.spec +++ b/udev.spec @@ -6,7 +6,7 @@ Summary: A userspace implementation of devfs Name: udev Version: 137 -Release: 4%{?dist} +Release: 5%{?dist} License: GPLv2 Group: System Environment/Base Provides: udev-persistent = %{version}-%{release} @@ -385,6 +385,9 @@ rm -rf $RPM_BUILD_ROOT %changelog +* Wed Feb 25 2009 Fedora Release Engineering - 137-5 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_11_Mass_Rebuild + * Thu Feb 05 2009 Harald Hoyer 137-4 - fixed md change/remove event handling From ab646bebe42a651244643ec25f74b54013a26e22 Mon Sep 17 00:00:00 2001 From: Harald Hoyer Date: Fri, 27 Feb 2009 07:49:44 +0000 Subject: [PATCH 017/142] - version 139 --- .cvsignore | 2 +- sources | 2 +- udev.spec | 13 +++++-------- 3 files changed, 7 insertions(+), 10 deletions(-) diff --git a/.cvsignore b/.cvsignore index 260ace6..8379465 100644 --- a/.cvsignore +++ b/.cvsignore @@ -1 +1 @@ -udev-137.tar.bz2 +udev-139.tar.bz2 diff --git a/sources b/sources index 0abe86b..8a9b035 100644 --- a/sources +++ b/sources @@ -1 +1 @@ -9d5960024da9c80b54c8273ee05b31e1 udev-137.tar.bz2 +7e705e237d29734c77bc26f6ccbc4594 udev-139.tar.bz2 diff --git a/udev.spec b/udev.spec index 08d36b4..cd0b5bb 100644 --- a/udev.spec +++ b/udev.spec @@ -5,8 +5,8 @@ Summary: A userspace implementation of devfs Name: udev -Version: 137 -Release: 5%{?dist} +Version: 139 +Release: 1%{?dist} License: GPLv2 Group: System Environment/Base Provides: udev-persistent = %{version}-%{release} @@ -18,9 +18,6 @@ Source3: udev-post.init Source4: fw_unit_symlinks.sh Source5: udev.sysconfig -Patch1: udev-137-vol_id1.patch -Patch2: udev-137-vol_id2.patch -Patch3: udev-137-mdremove.patch Patch102: udev-118-sysconf.patch ExclusiveOS: Linux @@ -94,9 +91,6 @@ dynamic library, which provides access to udev device information. %prep %setup -q -%patch1 -p1 -%patch2 -p1 -%patch3 -p1 -b .remove %patch102 -p1 -b .sysconf rm rules/redhat/95-pam-console.rules @@ -385,6 +379,9 @@ rm -rf $RPM_BUILD_ROOT %changelog +* Fri Feb 27 2009 Harald Hoyer 139-1 +- version 139 + * Wed Feb 25 2009 Fedora Release Engineering - 137-5 - Rebuilt for https://fedoraproject.org/wiki/Fedora_11_Mass_Rebuild From 9f98e34d403d9d7826fe7dc51a81b7f04f752166 Mon Sep 17 00:00:00 2001 From: Harald Hoyer Date: Tue, 3 Mar 2009 13:11:08 +0000 Subject: [PATCH 018/142] - speedup of start_udev by doing make_extra_nodes in parallel to the daemon start --- start_udev | 41 +++++++++++++++++++++-------------------- udev.spec | 6 +++++- 2 files changed, 26 insertions(+), 21 deletions(-) diff --git a/start_udev b/start_udev index 8e9228f..f67958e 100755 --- a/start_udev +++ b/start_udev @@ -188,6 +188,25 @@ findalias () { done } +# returns OK if $1 contains $2 +strstr() { + [ "${1#*$2*}" = "$1" ] && return 1 + return 0 +} + +getval() { + what=$1 + shift + for arg; do + if strstr "$arg" "$what="; then + val=${arg#${what}=*} + echo $val + return 0 + fi + done + return 1 +} + wait_for_queue() { local timeout=${1:-0} local ret=0 @@ -235,26 +254,7 @@ LANG=C awk "\$2 == \"${udev_root%/}\" && \$3 == \"tmpfs\" { exit 1 }" /proc/moun ret=$[$ret + $?] } -# returns OK if $1 contains $2 -strstr() { - [ "${1#*$2*}" = "$1" ] && return 1 - return 0 -} - -getval() { - what=$1 - shift - for arg; do - if strstr "$arg" "$what="; then - val=${arg#${what}=*} - echo $val - return 0 - fi - done - return 1 -} - -make_extra_nodes +make_extra_nodes & cmdline=$(cat /proc/cmdline) kill_udevd > "$udev_root/null" 2>&1 rm -fr $udev_root/.udev > "$udev_root/null" 2>&1 @@ -267,6 +267,7 @@ if [ -f "/sys/class/tty/console/uevent" ]; then UDEV_OPTS="$UDEV_OPTS --debug-trace" fi /sbin/udevd -d $UDEV_OPTS + wait ret=$[$ret + $?] udevtimeout=$(getval udevtimeout $cmdline) diff --git a/udev.spec b/udev.spec index cd0b5bb..828f709 100644 --- a/udev.spec +++ b/udev.spec @@ -6,7 +6,7 @@ Summary: A userspace implementation of devfs Name: udev Version: 139 -Release: 1%{?dist} +Release: 2%{?dist} License: GPLv2 Group: System Environment/Base Provides: udev-persistent = %{version}-%{release} @@ -379,6 +379,10 @@ rm -rf $RPM_BUILD_ROOT %changelog +* Tue Mar 03 2009 Harald Hoyer 139-2 +- speedup of start_udev by doing make_extra_nodes in parallel to + the daemon start + * Fri Feb 27 2009 Harald Hoyer 139-1 - version 139 From 2a1f66d75f51e160e69f9ac0a5101207743b3729 Mon Sep 17 00:00:00 2001 From: Harald Hoyer Date: Wed, 1 Apr 2009 13:29:30 +0000 Subject: [PATCH 019/142] - renamed modprobe /etc/modprobe.d/floppy-pnp to /etc/modprobe.d/floppy-pnp.conf (bug #492732 #488768) - Resolves: rhbz#492732 --- udev.spec | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/udev.spec b/udev.spec index 828f709..61b7e1c 100644 --- a/udev.spec +++ b/udev.spec @@ -6,7 +6,7 @@ Summary: A userspace implementation of devfs Name: udev Version: 139 -Release: 2%{?dist} +Release: 3%{?dist} License: GPLv2 Group: System Environment/Base Provides: udev-persistent = %{version}-%{release} @@ -191,7 +191,7 @@ install -m 0755 %{SOURCE1} $RPM_BUILD_ROOT/sbin/start_udev mkdir -p -m 0755 $RPM_BUILD_ROOT%{firmwaredir} mkdir -p -m 0755 $RPM_BUILD_ROOT%{_sysconfdir}/modprobe.d -cat > $RPM_BUILD_ROOT%{_sysconfdir}/modprobe.d/floppy-pnp < $RPM_BUILD_ROOT%{_sysconfdir}/modprobe.d/floppy-pnp.conf < 139-3 +- renamed modprobe /etc/modprobe.d/floppy-pnp to + /etc/modprobe.d/floppy-pnp.conf (bug #492732 #488768) +- Resolves: rhbz#492732 + * Tue Mar 03 2009 Harald Hoyer 139-2 - speedup of start_udev by doing make_extra_nodes in parallel to the daemon start From ffe7cacec802300f4c44f2e3ee2fffef779da9ab Mon Sep 17 00:00:00 2001 From: Harald Hoyer Date: Wed, 1 Apr 2009 13:40:26 +0000 Subject: [PATCH 020/142] - double the IMPORT buffer (bug #488554) - Resolves: rhbz#488554 --- udev-import-buffer.patch | 21 +++++++++++++++++++++ udev.spec | 8 +++++++- 2 files changed, 28 insertions(+), 1 deletion(-) create mode 100644 udev-import-buffer.patch diff --git a/udev-import-buffer.patch b/udev-import-buffer.patch new file mode 100644 index 0000000..5b74593 --- /dev/null +++ b/udev-import-buffer.patch @@ -0,0 +1,21 @@ +From: Kay Sievers +Date: Mon, 30 Mar 2009 18:09:08 +0000 (+0200) +Subject: IMPORT: 2048 -> 4096 bytes buffer +X-Git-Url: http://git.kernel.org/?p=linux%2Fhotplug%2Fudev.git;a=commitdiff_plain;h=52761bb0a99cb80ccb19c9edf23963fdad67060d;hp=f2b937440c682bca3837263a1bafd78e30b17e4d + +IMPORT: 2048 -> 4096 bytes buffer +--- + +diff --git a/udev/udev-rules.c b/udev/udev-rules.c +index 663a6d4..e4594c3 100644 +--- a/udev/udev-rules.c ++++ b/udev/udev-rules.c +@@ -737,7 +737,7 @@ static int import_program_into_properties(struct udev_device *dev, const char *p + { + struct udev *udev = udev_device_get_udev(dev); + char **envp; +- char result[2048]; ++ char result[4096]; + size_t reslen; + char *line; + diff --git a/udev.spec b/udev.spec index 61b7e1c..199e3c4 100644 --- a/udev.spec +++ b/udev.spec @@ -6,7 +6,7 @@ Summary: A userspace implementation of devfs Name: udev Version: 139 -Release: 3%{?dist} +Release: 4%{?dist} License: GPLv2 Group: System Environment/Base Provides: udev-persistent = %{version}-%{release} @@ -19,6 +19,7 @@ Source4: fw_unit_symlinks.sh Source5: udev.sysconfig Patch102: udev-118-sysconf.patch +Patch103: udev-import-buffer.patch ExclusiveOS: Linux URL: http://www.kernel.org/pub/linux/utils/kernel/hotplug/udev.html @@ -92,6 +93,7 @@ dynamic library, which provides access to udev device information. %setup -q %patch102 -p1 -b .sysconf +%patch103 -p1 -b .import rm rules/redhat/95-pam-console.rules %build @@ -379,6 +381,10 @@ rm -rf $RPM_BUILD_ROOT %changelog +* Wed Apr 01 2009 Harald Hoyer 139-4 +- double the IMPORT buffer (bug #488554) +- Resolves: rhbz#488554 + * Wed Apr 01 2009 Harald Hoyer 139-3 - renamed modprobe /etc/modprobe.d/floppy-pnp to /etc/modprobe.d/floppy-pnp.conf (bug #492732 #488768) From e07ce5575e93541eb1a64264d4292f6e6104a557 Mon Sep 17 00:00:00 2001 From: Harald Hoyer Date: Tue, 14 Apr 2009 13:47:31 +0000 Subject: [PATCH 021/142] - version 141 --- .cvsignore | 2 +- sources | 2 +- udev-import-buffer.patch | 21 --------------------- udev.spec | 11 ++++++----- 4 files changed, 8 insertions(+), 28 deletions(-) delete mode 100644 udev-import-buffer.patch diff --git a/.cvsignore b/.cvsignore index 8379465..16e8f8d 100644 --- a/.cvsignore +++ b/.cvsignore @@ -1 +1 @@ -udev-139.tar.bz2 +udev-141.tar.bz2 diff --git a/sources b/sources index 8a9b035..8c0586a 100644 --- a/sources +++ b/sources @@ -1 +1 @@ -7e705e237d29734c77bc26f6ccbc4594 udev-139.tar.bz2 +1670fe81cabf5161319c52084cf81134 udev-141.tar.bz2 diff --git a/udev-import-buffer.patch b/udev-import-buffer.patch deleted file mode 100644 index 5b74593..0000000 --- a/udev-import-buffer.patch +++ /dev/null @@ -1,21 +0,0 @@ -From: Kay Sievers -Date: Mon, 30 Mar 2009 18:09:08 +0000 (+0200) -Subject: IMPORT: 2048 -> 4096 bytes buffer -X-Git-Url: http://git.kernel.org/?p=linux%2Fhotplug%2Fudev.git;a=commitdiff_plain;h=52761bb0a99cb80ccb19c9edf23963fdad67060d;hp=f2b937440c682bca3837263a1bafd78e30b17e4d - -IMPORT: 2048 -> 4096 bytes buffer ---- - -diff --git a/udev/udev-rules.c b/udev/udev-rules.c -index 663a6d4..e4594c3 100644 ---- a/udev/udev-rules.c -+++ b/udev/udev-rules.c -@@ -737,7 +737,7 @@ static int import_program_into_properties(struct udev_device *dev, const char *p - { - struct udev *udev = udev_device_get_udev(dev); - char **envp; -- char result[2048]; -+ char result[4096]; - size_t reslen; - char *line; - diff --git a/udev.spec b/udev.spec index 199e3c4..e3e6e9f 100644 --- a/udev.spec +++ b/udev.spec @@ -5,8 +5,8 @@ Summary: A userspace implementation of devfs Name: udev -Version: 139 -Release: 4%{?dist} +Version: 141 +Release: 1%{?dist} License: GPLv2 Group: System Environment/Base Provides: udev-persistent = %{version}-%{release} @@ -19,7 +19,6 @@ Source4: fw_unit_symlinks.sh Source5: udev.sysconfig Patch102: udev-118-sysconf.patch -Patch103: udev-import-buffer.patch ExclusiveOS: Linux URL: http://www.kernel.org/pub/linux/utils/kernel/hotplug/udev.html @@ -93,8 +92,6 @@ dynamic library, which provides access to udev device information. %setup -q %patch102 -p1 -b .sysconf -%patch103 -p1 -b .import -rm rules/redhat/95-pam-console.rules %build %if %{with_static} @@ -326,6 +323,7 @@ rm -rf $RPM_BUILD_ROOT %attr(0644,root,root) %{_mandir}/man8/vol_id*.8* %attr(0644,root,root) %{_mandir}/man8/path_id*.8* %attr(0644,root,root) %{_mandir}/man8/cdrom_id*.8* +%attr(0644,root,root) %{_mandir}/man8/usb_id*.8* %attr(0644,root,root) %{_mandir}/man8/create_floppy_devices*.8* %dir %attr(0755,root,root) /var/lib/udev @@ -381,6 +379,9 @@ rm -rf $RPM_BUILD_ROOT %changelog +* Tue Apr 14 2009 Harald Hoyer 141-1 +- version 141 + * Wed Apr 01 2009 Harald Hoyer 139-4 - double the IMPORT buffer (bug #488554) - Resolves: rhbz#488554 From fdc9d097a5b010512198440b9265622b623ea157 Mon Sep 17 00:00:00 2001 From: Harald Hoyer Date: Wed, 15 Apr 2009 17:42:26 +0000 Subject: [PATCH 022/142] - fix for CVE-2009-1186 (bug #495052) - Resolves: rhbz#495052 --- udev-CVE-2009-1186.patch | 20 ++++++++++++++++++++ udev.spec | 32 ++++++++++++++++++++++++++------ 2 files changed, 46 insertions(+), 6 deletions(-) create mode 100644 udev-CVE-2009-1186.patch diff --git a/udev-CVE-2009-1186.patch b/udev-CVE-2009-1186.patch new file mode 100644 index 0000000..56332ca --- /dev/null +++ b/udev-CVE-2009-1186.patch @@ -0,0 +1,20 @@ +--- udev-141/udev/lib/libudev-util.c.CVE-2009-1186 2009-04-08 09:04:26.000000000 -0400 ++++ udev-141/udev/lib/libudev-util.c 2009-04-15 13:25:10.000000000 -0400 +@@ -9,6 +9,7 @@ + * version 2.1 of the License, or (at your option) any later version. + */ + ++#include + #include + #include + #include +@@ -103,6 +104,9 @@ int util_log_priority(const char *priori + + size_t util_path_encode(char *s, size_t len) + { ++ if (len == 0 || len > (SIZE_MAX - 1) / 4) ++ return 0; ++ + char t[(len * 4)+1]; + size_t i, j; + diff --git a/udev.spec b/udev.spec index e3e6e9f..c09e24c 100644 --- a/udev.spec +++ b/udev.spec @@ -6,7 +6,7 @@ Summary: A userspace implementation of devfs Name: udev Version: 141 -Release: 1%{?dist} +Release: 2%{?dist} License: GPLv2 Group: System Environment/Base Provides: udev-persistent = %{version}-%{release} @@ -19,11 +19,13 @@ Source4: fw_unit_symlinks.sh Source5: udev.sysconfig Patch102: udev-118-sysconf.patch +Patch103: udev-CVE-2009-1186.patch ExclusiveOS: Linux URL: http://www.kernel.org/pub/linux/utils/kernel/hotplug/udev.html BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n) Requires(pre): /bin/sh fileutils /sbin/chkconfig /sbin/service +Requires(pre): /usr/bin/stat /sbin/pidof Requires(pre): MAKEDEV >= 0:3.11 /usr/bin/getent /usr/sbin/groupadd BuildRequires: sed libselinux-devel >= 0:1.17.9-2 flex libsepol-devel BuildRequires: glib2-devel bison findutils MAKEDEV @@ -92,6 +94,7 @@ dynamic library, which provides access to udev device information. %setup -q %patch102 -p1 -b .sysconf +%patch103 -p1 -b .CVE-2009-1186 %build %if %{with_static} @@ -226,16 +229,29 @@ getent group cdrom >/dev/null || /usr/sbin/groupadd -g 11 cdrom || : getent group tape >/dev/null || /usr/sbin/groupadd -g 33 tape || : getent group dialout >/dev/null || /usr/sbin/groupadd -g 18 dialout || : +# kill daemon if we are not in a chroot +if test -f /proc/1/exe -a -d /proc/1/root; then + if test -x /usr/bin/stat -a "$(/usr/bin/stat -Lc '%%D-%%i' /)" = "$(/usr/bin/stat -Lc '%%D-%%i' /proc/1/root)"; then + if test -x /sbin/udevd -a -x /sbin/pidof ; then + pid=$(/sbin/pidof -c udevd) + if [ -n "$pid" ]; then + kill $pid + fi + fi + fi +fi +exit 0 + %post -if [ "$1" -gt 1 -a -x /sbin/pidof ]; then - pid=$(/sbin/pidof -c udevd) - if [ -n "$pid" ]; then - kill $pid +# start daemon if we are not in a chroot +if test -f /proc/1/exe -a -d /proc/1/root; then + if test "$(/usr/bin/stat -Lc '%%D-%%i' /)" = "$(/usr/bin/stat -Lc '%%D-%%i' /proc/1/root)"; then + if test -x /sbin/udevd; then /sbin/udevd -d + fi fi fi -/sbin/chkconfig --add udev-post exit 0 %triggerpostun -- dev <= 0:3.12-1 @@ -379,6 +395,10 @@ rm -rf $RPM_BUILD_ROOT %changelog +* Wed Apr 15 2009 Harald Hoyer 141-2 +- fix for CVE-2009-1186 (bug #495052) +- Resolves: rhbz#495052 + * Tue Apr 14 2009 Harald Hoyer 141-1 - version 141 From c47b803b68de627a934d65bd479576fcf25e0fdf Mon Sep 17 00:00:00 2001 From: Harald Hoyer Date: Thu, 16 Apr 2009 06:49:39 +0000 Subject: [PATCH 023/142] - fixed post and pre --- udev.spec | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/udev.spec b/udev.spec index c09e24c..89dbc01 100644 --- a/udev.spec +++ b/udev.spec @@ -19,7 +19,6 @@ Source4: fw_unit_symlinks.sh Source5: udev.sysconfig Patch102: udev-118-sysconf.patch -Patch103: udev-CVE-2009-1186.patch ExclusiveOS: Linux URL: http://www.kernel.org/pub/linux/utils/kernel/hotplug/udev.html @@ -94,7 +93,6 @@ dynamic library, which provides access to udev device information. %setup -q %patch102 -p1 -b .sysconf -%patch103 -p1 -b .CVE-2009-1186 %build %if %{with_static} @@ -395,9 +393,8 @@ rm -rf $RPM_BUILD_ROOT %changelog -* Wed Apr 15 2009 Harald Hoyer 141-2 -- fix for CVE-2009-1186 (bug #495052) -- Resolves: rhbz#495052 +* Thu Apr 16 2009 Harald Hoyer 141-2 +- fixed post and pre * Tue Apr 14 2009 Harald Hoyer 141-1 - version 141 From 825b6c98020646f06456b0bcd6b16d7942bd67d3 Mon Sep 17 00:00:00 2001 From: Harald Hoyer Date: Fri, 15 May 2009 14:41:18 +0000 Subject: [PATCH 024/142] - version 142 - no more libvolume_id and vol_id --- .cvsignore | 2 +- sources | 2 +- start_udev | 13 ++-- udev-118-sysconf.patch | 24 -------- ...-137.tar.bz2.sign => udev-142.tar.bz2.sign | 6 +- udev.spec | 60 ++++--------------- udev.sysconfig | 4 -- 7 files changed, 20 insertions(+), 91 deletions(-) delete mode 100644 udev-118-sysconf.patch rename udev-137.tar.bz2.sign => udev-142.tar.bz2.sign (61%) diff --git a/.cvsignore b/.cvsignore index 16e8f8d..de680dd 100644 --- a/.cvsignore +++ b/.cvsignore @@ -1 +1 @@ -udev-141.tar.bz2 +udev-142.tar.bz2 diff --git a/sources b/sources index 8c0586a..ed8a92a 100644 --- a/sources +++ b/sources @@ -1 +1 @@ -1670fe81cabf5161319c52084cf81134 udev-141.tar.bz2 +3edc4cf383dccb06d866c5156d59ddd5 udev-142.tar.bz2 diff --git a/start_udev b/start_udev index f67958e..99a67fa 100755 --- a/start_udev +++ b/start_udev @@ -128,7 +128,10 @@ make_extra_nodes () { /bin/chown root:lp /dev/lp2 /bin/mknod -m 0660 /dev/lp3 c 6 3 /bin/chown root:lp /dev/lp3 - [ -x /sbin/restorecon ] && /sbin/restorecon /dev/loop0 /dev/loop1 /dev/loop2 /dev/loop3 /dev/loop4 /dev/loop5 /dev/loop6 /dev/loop7 /dev/net/tun /dev/ppp /dev/lp0 /dev/lp1 /dev/lp2 /dev/lp3 + /bin/mknod -m 0666 /dev/fuse c 10 229 + /bin/chown root:root /dev/fuse + + [ -x /sbin/restorecon ] && /sbin/restorecon /dev/loop0 /dev/loop1 /dev/loop2 /dev/loop3 /dev/loop4 /dev/loop5 /dev/loop6 /dev/loop7 /dev/net/tun /dev/ppp /dev/lp0 /dev/lp1 /dev/lp2 /dev/lp3 /dev/fuse if [ -x "$MAKEDEV" ]; then for i in /etc/udev/makedev.d/*.nodes; do @@ -282,14 +285,6 @@ if [ -f "/sys/class/tty/console/uevent" ]; then /sbin/udevadm control --max_childs_running=$(getval udevchilds $cmdline) fi - if [ "$UDEV_PERSISTENT_STORAGE" == "no" ]; then - /sbin/udevadm control --env=UDEV_NO_PERSISTENT_STORAGE=1 - fi - - if strstr "$cmdline" udevnopersist; then - /sbin/udevadm control --env=UDEV_NO_PERSISTENT_STORAGE=1 - fi - /sbin/udevadm control --env=STARTUP=1 if strstr "$cmdline" modprobedebug; then diff --git a/udev-118-sysconf.patch b/udev-118-sysconf.patch deleted file mode 100644 index 30de6ab..0000000 --- a/udev-118-sysconf.patch +++ /dev/null @@ -1,24 +0,0 @@ -diff -up udev-126/rules/rules.d/60-persistent-storage.rules.sysconf udev-126/rules/rules.d/60-persistent-storage.rules ---- udev-126/rules/rules.d/60-persistent-storage.rules.sysconf 2008-07-31 09:40:37.000000000 +0200 -+++ udev-126/rules/rules.d/60-persistent-storage.rules 2008-08-08 15:35:57.000000000 +0200 -@@ -6,6 +6,8 @@ - # forward scsi device event to corresponding block device - ACTION=="change", SUBSYSTEM=="scsi", ENV{DEVTYPE}=="scsi_device", TEST=="block", ATTR{block/*/uevent}="change" - -+ENV{UDEV_NO_PERSISTENT_STORAGE}=="1", GOTO="persistent_storage_end" -+ - ACTION!="add|change", GOTO="persistent_storage_end" - SUBSYSTEM!="block", GOTO="persistent_storage_end" - -diff -up udev-126/rules/rules.d/60-persistent-storage-tape.rules.sysconf udev-126/rules/rules.d/60-persistent-storage-tape.rules ---- udev-126/rules/rules.d/60-persistent-storage-tape.rules.sysconf 2008-07-24 16:55:12.000000000 +0200 -+++ udev-126/rules/rules.d/60-persistent-storage-tape.rules 2008-08-08 15:35:57.000000000 +0200 -@@ -2,6 +2,8 @@ - - # persistent storage links: /dev/tape/{by-id,by-path} - -+ENV{UDEV_NO_PERSISTENT_STORAGE}=="1", GOTO="persistent_storage_tape_end" -+ - ACTION!="add|change", GOTO="persistent_storage_tape_end" - - # type 8 devices are "Medium Changers" diff --git a/udev-137.tar.bz2.sign b/udev-142.tar.bz2.sign similarity index 61% rename from udev-137.tar.bz2.sign rename to udev-142.tar.bz2.sign index bde1723..32394f1 100644 --- a/udev-137.tar.bz2.sign +++ b/udev-142.tar.bz2.sign @@ -2,7 +2,7 @@ Version: GnuPG v1.4.9 (GNU/Linux) Comment: See http://www.kernel.org/signature.html for info -iD8DBQBJeTdlyGugalF9Dw4RAolBAJ9sKq3V9mpanhvpOMkYXky7DwF7sACgg0N4 -SsPqKyBV4nkSMxxLQwxJEdw= -=PEri +iD8DBQBKCkrhyGugalF9Dw4RAq/BAJ9jlPzsGL1AY6oGAe9k/w40yh8PAACdFb4X +uCq/RlDaoybxMChpTXmrdSY= +=KJLi -----END PGP SIGNATURE----- diff --git a/udev.spec b/udev.spec index 89dbc01..bfab5a2 100644 --- a/udev.spec +++ b/udev.spec @@ -5,8 +5,8 @@ Summary: A userspace implementation of devfs Name: udev -Version: 141 -Release: 2%{?dist} +Version: 142 +Release: 1%{?dist} License: GPLv2 Group: System Environment/Base Provides: udev-persistent = %{version}-%{release} @@ -18,8 +18,6 @@ Source3: udev-post.init Source4: fw_unit_symlinks.sh Source5: udev.sysconfig -Patch102: udev-118-sysconf.patch - ExclusiveOS: Linux URL: http://www.kernel.org/pub/linux/utils/kernel/hotplug/udev.html BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n) @@ -34,6 +32,8 @@ BuildRequires: autoconf libtool %endif Requires: libselinux >= 0:1.17.9-2 sed Conflicts: kernel < 0:2.6 mkinitrd <= 0:4.1.11-1 initscripts < 7.84 +Requires: util-linux-ng >= 2.15 +Conflicts: device-mapper <= 1.02.31-4 Obsoletes: dev <= 0:3.12-1 Provides: dev = 0:3.12-1 @@ -52,24 +52,6 @@ This package contains static versions of the udev binaries, to build e.g. an initramfs. %endif -%package -n libvolume_id-devel -Summary: Static libraries and headers for libvolume_id -Group: Development/Libraries -Requires: libvolume_id = %{version}-%{release} - -%description -n libvolume_id-devel -This package contains libraries and include files, -which needed to link against libvolume_id. - -%package -n libvolume_id -Summary: Dynamic libraries to get volume ids -Group: System Environment/Libraries - -%description -n libvolume_id -This package contains the libvolume_id.so dynamic library, -which contains functions to get volume ids. - - %package -n libudev0 Summary: Dynamic library to access udev device information Group: System Environment/Libraries @@ -92,8 +74,6 @@ dynamic library, which provides access to udev device information. %prep %setup -q -%patch102 -p1 -b .sysconf - %build %if %{with_static} %configure --with-selinux --prefix=%{_prefix} --exec-prefix="" --sysconfdir=%{_sysconfdir} --with-libdir-name=%{_lib} --sbindir="/sbin" --enable-static @@ -105,7 +85,6 @@ for i in udev/udevd \ extras/edd_id/edd_id \ extras/usb_id/usb_id \ extras/cdrom_id/cdrom_id \ - extras/volume_id/vol_id \ extras/floppy/create_floppy_devices \ ; do mv $i $i.static @@ -135,8 +114,6 @@ mkdir -p $RPM_BUILD_ROOT%{_bindir} # force relative symlinks ln -sf ..%{udev_scriptdir}/scsi_id $RPM_BUILD_ROOT/sbin/scsi_id -ln -sf ../../%{_lib}/$(basename $RPM_BUILD_ROOT/%{_lib}/libvolume_id.so.*.*) \ - $RPM_BUILD_ROOT%{_libdir}/libvolume_id.so ln -sf ../../sbin/udevadm $RPM_BUILD_ROOT%{_bindir}/udevinfo ln -sf ../../sbin/udevadm $RPM_BUILD_ROOT%{_bindir}/udevtest @@ -151,7 +128,6 @@ for i in extras/scsi_id/scsi_id \ extras/ata_id/ata_id \ extras/edd_id/edd_id \ extras/usb_id/usb_id \ - extras/volume_id/vol_id \ extras/floppy/create_floppy_devices \ ; do install -m 0755 $i.static $RPM_BUILD_ROOT%{udev_scriptdir}/$(basename $i).static @@ -176,7 +152,6 @@ for i in \ %endif rules/packages/40-alsa.rules \ rules/packages/64-md-raid.rules \ - rules/packages/64-device-mapper.rules \ ; do install -m 0644 "$i" "$RPM_BUILD_ROOT%{udev_scriptdir}/rules.d/${i##*/}" done @@ -272,9 +247,6 @@ rm -f /var/lib/udev/makenode.d/* >/dev/null 2>&1 || : %triggerin -- MAKEDEV rm -f /var/lib/udev/makenode.d/* >/dev/null 2>&1 || : -%post -n libvolume_id -p /sbin/ldconfig -%postun -n libvolume_id -p /sbin/ldconfig - %post -n libudev0 -p /sbin/ldconfig %postun -n libudev0 -p /sbin/ldconfig @@ -295,7 +267,6 @@ rm -rf $RPM_BUILD_ROOT %attr(0755,root,root) %{udev_scriptdir}/ata_id %attr(0755,root,root) %{udev_scriptdir}/edd_id %attr(0755,root,root) %{udev_scriptdir}/usb_id -%attr(0755,root,root) %{udev_scriptdir}/vol_id %attr(0755,root,root) %{udev_scriptdir}/cdrom_id %attr(0755,root,root) %{udev_scriptdir}/path_id %attr(0755,root,root) %{udev_scriptdir}/create_floppy_devices @@ -334,7 +305,6 @@ rm -rf $RPM_BUILD_ROOT %attr(0644,root,root) %{_mandir}/man8/scsi_id*.8* %attr(0644,root,root) %{_mandir}/man8/ata_id*.8* %attr(0644,root,root) %{_mandir}/man8/edd_id*.8* -%attr(0644,root,root) %{_mandir}/man8/vol_id*.8* %attr(0644,root,root) %{_mandir}/man8/path_id*.8* %attr(0644,root,root) %{_mandir}/man8/cdrom_id*.8* %attr(0644,root,root) %{_mandir}/man8/usb_id*.8* @@ -358,24 +328,9 @@ rm -rf $RPM_BUILD_ROOT %attr(0755,root,root) %{udev_scriptdir}/ata_id.static %attr(0755,root,root) %{udev_scriptdir}/edd_id.static %attr(0755,root,root) %{udev_scriptdir}/usb_id.static -%attr(0755,root,root) %{udev_scriptdir}/vol_id.static %attr(0755,root,root) %{udev_scriptdir}/create_floppy_devices.static %endif -%files -n libvolume_id -%defattr(0644, root, root, 0755) -%doc COPYING -%attr(0755,root,root) /%{_lib}/libvolume_id.so.* - -%files -n libvolume_id-devel -%defattr(0644, root, root, 0755) -%doc COPYING -%defattr(0644, root, root, 0755) -%{_includedir}/libvolume_id.h -%{_libdir}/libvolume_id.so -%{_libdir}/libvolume_id.a -%{_libdir}/pkgconfig/libvolume_id.pc - %files -n libudev0 %defattr(0644, root, root, 0755) %doc COPYING @@ -393,6 +348,13 @@ rm -rf $RPM_BUILD_ROOT %changelog +* Fri May 15 2009 Harald Hoyer 142-1 +- version 142 +- no more libvolume_id and vol_id + +* Fri Apr 17 2009 Harald Hoyer 141-3 +- added /dev/fuse creation to start_udev + * Thu Apr 16 2009 Harald Hoyer 141-2 - fixed post and pre diff --git a/udev.sysconfig b/udev.sysconfig index e7c13cf..9a58d98 100644 --- a/udev.sysconfig +++ b/udev.sysconfig @@ -2,7 +2,3 @@ # May speedup some systems with slow disks. # EXPERIMENTAL - use at your own risk UDEV_USE_MAKEDEV_CACHE="no" - -# Generates /dev/disk/by* symlinks. -# Set to "no", if you *really* don't need them and want a speedup at boot time. -UDEV_PERSISTENT_STORAGE="yes" From 518b087e2a7b1346fcf32a12c713d169dc600480 Mon Sep 17 00:00:00 2001 From: Bastien Nocera Date: Fri, 5 Jun 2009 15:08:49 +0000 Subject: [PATCH 025/142] - Rebuild in dist-f12 --- udev.spec | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/udev.spec b/udev.spec index bfab5a2..26443f1 100644 --- a/udev.spec +++ b/udev.spec @@ -6,7 +6,7 @@ Summary: A userspace implementation of devfs Name: udev Version: 142 -Release: 1%{?dist} +Release: 2%{?dist} License: GPLv2 Group: System Environment/Base Provides: udev-persistent = %{version}-%{release} @@ -348,6 +348,9 @@ rm -rf $RPM_BUILD_ROOT %changelog +* Fri Jun 05 2009 Bastien Nocera 142-2 +- Rebuild in dist-f12 + * Fri May 15 2009 Harald Hoyer 142-1 - version 142 - no more libvolume_id and vol_id From c0058968a2f66dd822b2273859e839e2d02316a7 Mon Sep 17 00:00:00 2001 From: Harald Hoyer Date: Mon, 8 Jun 2009 08:56:38 +0000 Subject: [PATCH 026/142] - delay device-mapper changes --- udev.spec | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/udev.spec b/udev.spec index 26443f1..7aea0d7 100644 --- a/udev.spec +++ b/udev.spec @@ -6,7 +6,7 @@ Summary: A userspace implementation of devfs Name: udev Version: 142 -Release: 2%{?dist} +Release: 3%{?dist} License: GPLv2 Group: System Environment/Base Provides: udev-persistent = %{version}-%{release} @@ -32,8 +32,7 @@ BuildRequires: autoconf libtool %endif Requires: libselinux >= 0:1.17.9-2 sed Conflicts: kernel < 0:2.6 mkinitrd <= 0:4.1.11-1 initscripts < 7.84 -Requires: util-linux-ng >= 2.15 -Conflicts: device-mapper <= 1.02.31-4 +Requires: util-linux-ng >= 2.15.1 Obsoletes: dev <= 0:3.12-1 Provides: dev = 0:3.12-1 @@ -152,6 +151,7 @@ for i in \ %endif rules/packages/40-alsa.rules \ rules/packages/64-md-raid.rules \ + rules/packages/64-device-mapper.rules \ ; do install -m 0644 "$i" "$RPM_BUILD_ROOT%{udev_scriptdir}/rules.d/${i##*/}" done @@ -348,6 +348,9 @@ rm -rf $RPM_BUILD_ROOT %changelog +* Thu Jun 04 2009 Harald Hoyer 142-3 +- delay device-mapper changes + * Fri Jun 05 2009 Bastien Nocera 142-2 - Rebuild in dist-f12 From d6ea95d064e6222ba9d4d41b5c35a4b0b2f617a5 Mon Sep 17 00:00:00 2001 From: Harald Hoyer Date: Mon, 8 Jun 2009 09:10:26 +0000 Subject: [PATCH 027/142] - git fix: udevadm: settle - fix timeout - git fix: OWNER/GROUP: fix if logic - git fix: rule-generator: cd - skip by-path links if we create by-id links - git fix: fix possible endless loop for GOTO to non-existent LABEL - git fix: cdrom_id: suppress ID_CDROM_MEDIA_STATE=blank for plain non-writable CDROM media --- ...40edc647d8ccfc27c9cd3163ab5dbf63ed6c.patch | 35 +++++++++++ ...798916bc87d72f5f1399d9e050307901db84.patch | 31 ++++++++++ ...1b67f86c9555cbb41c57774761730f6b8939.patch | 45 ++++++++++++++ ...231e738dd286591c1becc2f327ed55ed89d1.patch | 62 +++++++++++++++++++ ...9099bb2b18f3f683615324a4382b95446305.patch | 28 +++++++++ udev.spec | 24 ++++++- 6 files changed, 223 insertions(+), 2 deletions(-) create mode 100644 udev.git-055e40edc647d8ccfc27c9cd3163ab5dbf63ed6c.patch create mode 100644 udev.git-0c37798916bc87d72f5f1399d9e050307901db84.patch create mode 100644 udev.git-b4fa1b67f86c9555cbb41c57774761730f6b8939.patch create mode 100644 udev.git-d3c8231e738dd286591c1becc2f327ed55ed89d1.patch create mode 100644 udev.git-f58a9099bb2b18f3f683615324a4382b95446305.patch diff --git a/udev.git-055e40edc647d8ccfc27c9cd3163ab5dbf63ed6c.patch b/udev.git-055e40edc647d8ccfc27c9cd3163ab5dbf63ed6c.patch new file mode 100644 index 0000000..5915df3 --- /dev/null +++ b/udev.git-055e40edc647d8ccfc27c9cd3163ab5dbf63ed6c.patch @@ -0,0 +1,35 @@ +From: Scott James Remnant +Date: Thu, 14 May 2009 11:42:44 +0000 (+0100) +Subject: OWNER/GROUP: fix if logic +X-Git-Url: http://git.kernel.org/?p=linux%2Fhotplug%2Fudev.git;a=commitdiff_plain;h=055e40edc647d8ccfc27c9cd3163ab5dbf63ed6c + +OWNER/GROUP: fix if logic + +The introduction of the --resolve-names=early/never code introduced a +bug to the OWNER/GROUP lookup. Previously if the name had contained $, +lookup would have been performed later; after the patch, the key ended +up being ignored! +--- + +diff --git a/udev/udev-rules.c b/udev/udev-rules.c +index b8b7e52..39fe55a 100644 +--- a/udev/udev-rules.c ++++ b/udev/udev-rules.c +@@ -1431,7 +1431,7 @@ static int add_rule(struct udev_rules *rules, char *line, + } else if ((rules->resolve_names > 0) && strchr("$%", value[0]) == NULL) { + uid = add_uid(rules, value); + rule_add_key(&rule_tmp, TK_A_OWNER_ID, op, NULL, &uid); +- } else if (rules->resolve_names == 0) { ++ } else if (rules->resolve_names >= 0) { + rule_add_key(&rule_tmp, TK_A_OWNER, op, value, NULL); + } + rule_tmp.rule.rule.flags = 1; +@@ -1448,7 +1448,7 @@ static int add_rule(struct udev_rules *rules, char *line, + } else if ((rules->resolve_names > 0) && strchr("$%", value[0]) == NULL) { + gid = add_gid(rules, value); + rule_add_key(&rule_tmp, TK_A_GROUP_ID, op, NULL, &gid); +- } else if (rules->resolve_names == 0) { ++ } else if (rules->resolve_names >= 0) { + rule_add_key(&rule_tmp, TK_A_GROUP, op, value, NULL); + } + rule_tmp.rule.rule.flags = 1; diff --git a/udev.git-0c37798916bc87d72f5f1399d9e050307901db84.patch b/udev.git-0c37798916bc87d72f5f1399d9e050307901db84.patch new file mode 100644 index 0000000..fc6fcd6 --- /dev/null +++ b/udev.git-0c37798916bc87d72f5f1399d9e050307901db84.patch @@ -0,0 +1,31 @@ +From: Kay Sievers +Date: Wed, 13 May 2009 16:01:32 +0000 (+0200) +Subject: fix possible endless loop for GOTO to non-existent LABEL +X-Git-Url: http://git.kernel.org/?p=linux%2Fhotplug%2Fudev.git;a=commitdiff_plain;h=0c37798916bc87d72f5f1399d9e050307901db84 + +fix possible endless loop for GOTO to non-existent LABEL + +http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=526365 +--- + +diff --git a/udev/udev-rules.c b/udev/udev-rules.c +index fac418e..b8b7e52 100644 +--- a/udev/udev-rules.c ++++ b/udev/udev-rules.c +@@ -1610,6 +1610,7 @@ static int parse_file(struct udev_rules *rules, const char *filename, unsigned s + if (strcmp(label, &rules->buf[rules->tokens[j].rule.label_off]) != 0) + continue; + rules->tokens[i].key.rule_goto = j; ++ break; + } + if (rules->tokens[i].key.rule_goto == 0) + err(rules->udev, "GOTO '%s' has no matching label in: '%s'\n", label, filename); +@@ -2504,6 +2505,8 @@ int udev_rules_apply_to_event(struct udev_rules *rules, struct udev_event *event + break; + } + case TK_A_GOTO: ++ if (cur->key.rule_goto == 0) ++ break; + cur = &rules->tokens[cur->key.rule_goto]; + continue; + case TK_A_LAST_RULE: diff --git a/udev.git-b4fa1b67f86c9555cbb41c57774761730f6b8939.patch b/udev.git-b4fa1b67f86c9555cbb41c57774761730f6b8939.patch new file mode 100644 index 0000000..697af69 --- /dev/null +++ b/udev.git-b4fa1b67f86c9555cbb41c57774761730f6b8939.patch @@ -0,0 +1,45 @@ +From: Kay Sievers +Date: Thu, 14 May 2009 10:57:19 +0000 (+0200) +Subject: rule-generator: cd - skip by-path links if we create by-id links +X-Git-Url: http://git.kernel.org/?p=linux%2Fhotplug%2Fudev.git;a=commitdiff_plain;h=b4fa1b67f86c9555cbb41c57774761730f6b8939 + +rule-generator: cd - skip by-path links if we create by-id links +--- + +diff --git a/extras/rule_generator/75-cd-aliases-generator.rules b/extras/rule_generator/75-cd-aliases-generator.rules +index e357a6a..e6da010 100644 +--- a/extras/rule_generator/75-cd-aliases-generator.rules ++++ b/extras/rule_generator/75-cd-aliases-generator.rules +@@ -1,6 +1,9 @@ + # these rules generate rules for the /dev/{cdrom,dvd,...} symlinks + +-# the path of removable devices changes frequently +-ACTION=="add", SUBSYSTEM=="block", SUBSYSTEMS=="usb|ieee1394", ENV{ID_CDROM}=="?*", ENV{GENERATED}!="?*", PROGRAM="write_cd_rules by-id", SYMLINK+="%c" ++# the "path" of usb/ieee1394 devices changes frequently, use "id" ++ACTION=="add", SUBSYSTEM=="block", SUBSYSTEMS=="usb|ieee1394", ENV{ID_CDROM}=="?*", ENV{GENERATED}!="?*", \ ++ PROGRAM="write_cd_rules by-id", SYMLINK+="%c", GOTO="persistent_cd_end" + + ACTION=="add", SUBSYSTEM=="block", ENV{ID_CDROM}=="?*", ENV{GENERATED}!="?*", PROGRAM="write_cd_rules", SYMLINK+="%c" ++ ++LABEL="persistent_cd_end" +diff --git a/extras/rule_generator/write_cd_rules b/extras/rule_generator/write_cd_rules +index 398cd27..0d16fe6 100644 +--- a/extras/rule_generator/write_cd_rules ++++ b/extras/rule_generator/write_cd_rules +@@ -97,7 +97,7 @@ choose_rules_file + + link_num=$(find_next_available 'cdrom[0-9]*') + +-match="ENV{ID_CDROM}==\"?*\", $RULE" ++match="SUBSYSTEM==\"block\", ENV{ID_CDROM}==\"?*\", $RULE" + + comment="$ID_MODEL ($ID_PATH)" + +@@ -108,6 +108,7 @@ comment="$ID_MODEL ($ID_PATH)" + write_rule "$match" "dvd$link_num" + [ "$ID_CDROM_DVD_R" -o "$ID_CDROM_DVD_RW" -o "$ID_CDROM_DVD_RAM" ] && \ + write_rule "$match" "dvdrw$link_num" ++echo >> $RULES_FILE + + unlock_rules_file + diff --git a/udev.git-d3c8231e738dd286591c1becc2f327ed55ed89d1.patch b/udev.git-d3c8231e738dd286591c1becc2f327ed55ed89d1.patch new file mode 100644 index 0000000..3ba1820 --- /dev/null +++ b/udev.git-d3c8231e738dd286591c1becc2f327ed55ed89d1.patch @@ -0,0 +1,62 @@ +From: Kay Sievers +Date: Mon, 25 May 2009 22:50:45 +0000 (+0200) +Subject: cdrom_id: suppress ID_CDROM_MEDIA_STATE=blank for plain non-writable CDROM media +X-Git-Url: http://git.kernel.org/?p=linux%2Fhotplug%2Fudev.git;a=commitdiff_plain;h=d3c8231e738dd286591c1becc2f327ed55ed89d1 + +cdrom_id: suppress ID_CDROM_MEDIA_STATE=blank for plain non-writable CDROM media + +Some broken fake cdrom drives return ID_CDROM_MEDIA_STATE=blank. + + $ /lib/udev/cdrom_id -d /dev/sr1 + main: probing: '/dev/sr1' + cd_inquiry: INQUIRY: [Nokia ][S60 ][1.0 ] + cd_profiles: GET CONFIGURATION: number of profiles 76 + cd_profiles: current profile 0x08 + cd_media_toc: READ TOC: len: 12 + cd_media_toc: last track 1 starts at block 0 + cd_media_info: disk type 00 + ID_CDROM=1 + ID_CDROM_MRW=1 + ID_CDROM_MRW_W=1 + ID_CDROM_MEDIA=1 + ID_CDROM_MEDIA_CD=1 + ID_CDROM_MEDIA_STATE=blank + +Others work fine, but ID_CDROM_MEDIA_STATE is not needed for non-writable CDROM media: + + $ /lib/udev/cdrom_id -d /dev/sr1 + main: probing: '/dev/sr1' + cd_inquiry: INQUIRY: [SanDisk ][U3 Cruzer Micro ][8.02] + cd_profiles: GET CONFIGURATION: number of profiles 72 + cd_profiles: current profile 0x08 + cd_media_toc: READ TOC: len: 20 + cd_media_toc: track=1 info=0x4(data) start_block=0 + cd_media_toc: last track 1 starts at block 0 + cd_media_info: disk type 00 + ID_CDROM=1 + ID_CDROM_MRW=1 + ID_CDROM_MRW_W=1 + ID_CDROM_MEDIA=1 + ID_CDROM_MEDIA_CD=1 + ID_CDROM_MEDIA_STATE=complete + ID_CDROM_MEDIA_SESSION_COUNT=1 + ID_CDROM_MEDIA_TRACK_COUNT=1 + ID_CDROM_MEDIA_TRACK_COUNT_DATA=1 +--- + +diff --git a/extras/cdrom_id/cdrom_id.c b/extras/cdrom_id/cdrom_id.c +index 0d873ae..921e534 100644 +--- a/extras/cdrom_id/cdrom_id.c ++++ b/extras/cdrom_id/cdrom_id.c +@@ -426,8 +426,10 @@ static int cd_media_info(struct udev *udev, int fd) + + info(udev, "disk type %02x\n", header[8]); + +- if ((header[2] & 3) < 4) ++ /* exclude plain CDROM, some fake cdroms return 0 for "blank" media here */ ++ if (!cd_media_cd_rom && (header[2] & 3) < 4) + cd_media_state = media_status[header[2] & 3]; ++ + if ((header[2] & 3) != 2) + cd_media_session_next = header[10] << 8 | header[5]; + cd_media_session_count = header[9] << 8 | header[4]; diff --git a/udev.git-f58a9099bb2b18f3f683615324a4382b95446305.patch b/udev.git-f58a9099bb2b18f3f683615324a4382b95446305.patch new file mode 100644 index 0000000..aac97b5 --- /dev/null +++ b/udev.git-f58a9099bb2b18f3f683615324a4382b95446305.patch @@ -0,0 +1,28 @@ +From: Alan Jenkins +Date: Wed, 20 May 2009 14:12:22 +0000 (+0200) +Subject: udevadm: settle - fix timeout +X-Git-Url: http://git.kernel.org/?p=linux%2Fhotplug%2Fudev.git;a=commitdiff_plain;h=f58a9099bb2b18f3f683615324a4382b95446305 + +udevadm: settle - fix timeout + +The timeout wasn't working when settle was run as root: + # udevadm control --stop-exec-queue + # udevadm trigger + # udevadm settle --timeout=1 + ... (hangs) + +Signed-off-by: Alan Jenkins +--- + +diff --git a/udev/udevadm-settle.c b/udev/udevadm-settle.c +index 3b26f10..52d9c0b 100644 +--- a/udev/udevadm-settle.c ++++ b/udev/udevadm-settle.c +@@ -167,6 +167,7 @@ int udevadm_settle(struct udev *udev, int argc, char *argv[]) + sigprocmask(SIG_BLOCK, &mask, &oldmask); + if (udev_ctrl_send_settle(uctrl) > 0) + sigsuspend(&oldmask); ++ sigprocmask(SIG_SETMASK, &oldmask, NULL); + udev_ctrl_unref(uctrl); + } + } diff --git a/udev.spec b/udev.spec index 7aea0d7..a8bce69 100644 --- a/udev.spec +++ b/udev.spec @@ -6,7 +6,7 @@ Summary: A userspace implementation of devfs Name: udev Version: 142 -Release: 3%{?dist} +Release: 4%{?dist} License: GPLv2 Group: System Environment/Base Provides: udev-persistent = %{version}-%{release} @@ -18,6 +18,12 @@ Source3: udev-post.init Source4: fw_unit_symlinks.sh Source5: udev.sysconfig +Patch1: udev.git-055e40edc647d8ccfc27c9cd3163ab5dbf63ed6c.patch +Patch2: udev.git-0c37798916bc87d72f5f1399d9e050307901db84.patch +Patch3: udev.git-b4fa1b67f86c9555cbb41c57774761730f6b8939.patch +Patch4: udev.git-d3c8231e738dd286591c1becc2f327ed55ed89d1.patch +Patch5: udev.git-f58a9099bb2b18f3f683615324a4382b95446305.patch + ExclusiveOS: Linux URL: http://www.kernel.org/pub/linux/utils/kernel/hotplug/udev.html BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n) @@ -73,6 +79,12 @@ dynamic library, which provides access to udev device information. %prep %setup -q +%patch1 -p1 +%patch2 -p1 +%patch3 -p1 +%patch4 -p1 +%patch5 -p1 + %build %if %{with_static} %configure --with-selinux --prefix=%{_prefix} --exec-prefix="" --sysconfdir=%{_sysconfdir} --with-libdir-name=%{_lib} --sbindir="/sbin" --enable-static @@ -348,7 +360,15 @@ rm -rf $RPM_BUILD_ROOT %changelog -* Thu Jun 04 2009 Harald Hoyer 142-3 +* Thu Jun 08 2009 Harald Hoyer 142-4 +- git fix: udevadm: settle - fix timeout +- git fix: OWNER/GROUP: fix if logic +- git fix: rule-generator: cd - skip by-path links if we create by-id links +- git fix: fix possible endless loop for GOTO to non-existent LABEL +- git fix: cdrom_id: suppress ID_CDROM_MEDIA_STATE=blank for plain non-writable + CDROM media + +* Thu Jun 08 2009 Harald Hoyer 142-3 - delay device-mapper changes * Fri Jun 05 2009 Bastien Nocera 142-2 From d2639a068dfd628f922bfaed20185a61df42da16 Mon Sep 17 00:00:00 2001 From: Harald Hoyer Date: Fri, 19 Jun 2009 14:36:59 +0000 Subject: [PATCH 028/142] - version 143 --- udev.spec | 166 ++++++++++++++++++++++++------------------------------ 1 file changed, 75 insertions(+), 91 deletions(-) diff --git a/udev.spec b/udev.spec index a8bce69..4225337 100644 --- a/udev.spec +++ b/udev.spec @@ -1,16 +1,17 @@ %define debug true -%define with_static 1 %define udev_scriptdir /lib/udev %define firmwaredir /lib/firmware Summary: A userspace implementation of devfs Name: udev -Version: 142 -Release: 4%{?dist} +Version: 143 +Release: 1%{?dist} License: GPLv2 Group: System Environment/Base Provides: udev-persistent = %{version}-%{release} Obsoletes: udev-persistent < 0:030-5 +Obsoletes: udev-extras < 20090618 +Provides: udev-extras = 20090618-1 Source: ftp://ftp.kernel.org/pub/linux/utils/kernel/hotplug/%{name}-%{version}.tar.bz2 Source1: start_udev @@ -18,24 +19,24 @@ Source3: udev-post.init Source4: fw_unit_symlinks.sh Source5: udev.sysconfig -Patch1: udev.git-055e40edc647d8ccfc27c9cd3163ab5dbf63ed6c.patch -Patch2: udev.git-0c37798916bc87d72f5f1399d9e050307901db84.patch -Patch3: udev.git-b4fa1b67f86c9555cbb41c57774761730f6b8939.patch -Patch4: udev.git-d3c8231e738dd286591c1becc2f327ed55ed89d1.patch -Patch5: udev.git-f58a9099bb2b18f3f683615324a4382b95446305.patch - ExclusiveOS: Linux URL: http://www.kernel.org/pub/linux/utils/kernel/hotplug/udev.html BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n) Requires(pre): /bin/sh fileutils /sbin/chkconfig /sbin/service Requires(pre): /usr/bin/stat /sbin/pidof Requires(pre): MAKEDEV >= 0:3.11 /usr/bin/getent /usr/sbin/groupadd +Requires: hwdata + BuildRequires: sed libselinux-devel >= 0:1.17.9-2 flex libsepol-devel BuildRequires: glib2-devel bison findutils MAKEDEV -%if %{with_static} -BuildRequires: libselinux-static libsepol-static -BuildRequires: autoconf libtool -%endif +BuildRequires: glib2-devel +BuildRequires: libusb-devel +BuildRequires: libxslt +BuildRequires: hwdata +BuildRequires: gobject-introspection-devel >= 0.6.2 +BuildRequires: gtk-doc +BuildRequires: usbutils + Requires: libselinux >= 0:1.17.9-2 sed Conflicts: kernel < 0:2.6 mkinitrd <= 0:4.1.11-1 initscripts < 7.84 Requires: util-linux-ng >= 2.15.1 @@ -46,20 +47,10 @@ Provides: dev = 0:3.12-1 The udev package contains an implementation of devfs in userspace using sysfs and netlink. -%if %{with_static} -%package static -Summary: Static udev binaries for init environments -Group: System Environment/Base -Requires: udev = %{version}-%{release} - -%description static -This package contains static versions of the udev binaries, -to build e.g. an initramfs. -%endif - %package -n libudev0 Summary: Dynamic library to access udev device information Group: System Environment/Libraries +Obsoletes: libudev0 < 143 %description -n libudev0 This package contains the dynamic library libudev, which provides access @@ -76,37 +67,35 @@ Requires: libudev0 = %{version}-%{release} This package contains the development files for the library libudev, a dynamic library, which provides access to udev device information. +%package -n libgudev-1.0-0 +Summary: Libraries for adding libudev support to applications that use glib. +Group: Development/Libraries +Requires: libudev >= 142 + +%description -n libgudev-1.0-0 +This package contains the libraries that make it easier to use libudev +functionality from applications that use glib. + +%package -n libgudev-devel +Summary: Header files for adding libudev support to applications that use glib. +Group: Development/Libraries +Requires: libudev-devel >= 142 +Requires: libgudev-1.0-0 = %{version}-%{release} + +%description -n libgudev-devel +This package contains the header and pkg-config files for developing +glib-based applications using libudev functionality. + %prep %setup -q -%patch1 -p1 -%patch2 -p1 -%patch3 -p1 -%patch4 -p1 -%patch5 -p1 - %build -%if %{with_static} -%configure --with-selinux --prefix=%{_prefix} --exec-prefix="" --sysconfdir=%{_sysconfdir} --with-libdir-name=%{_lib} --sbindir="/sbin" --enable-static -make LDFLAGS="-all-static" %{?_smp_mflags} -for i in udev/udevd \ - udev/udevadm \ - extras/scsi_id/scsi_id \ - extras/ata_id/ata_id \ - extras/edd_id/edd_id \ - extras/usb_id/usb_id \ - extras/cdrom_id/cdrom_id \ - extras/floppy/create_floppy_devices \ - ; do - mv $i $i.static -done -make clean -%else -%configure --with-selinux --prefix=%{_prefix} --exec-prefix="" --sysconfdir=%{_sysconfdir} --with-libdir-name=%{_lib} --sbindir="/sbin" -%endif +%configure --with-selinux --prefix=%{_prefix} --exec-prefix="" \ + --sysconfdir=%{_sysconfdir} --with-libdir-name=%{_lib} \ + --sbindir="/sbin" --libexecdir=%{udev_scriptdir} \ + --with-rootlibdir=/%{_lib} --enable-introspection make %{?_smp_mflags} - %install rm -rf $RPM_BUILD_ROOT @@ -114,9 +103,11 @@ mkdir -p $RPM_BUILD_ROOT%{_sbindir} make install DESTDIR=$RPM_BUILD_ROOT -rm -f $RPM_BUILD_ROOT%{_sysconfdir}/udev/udev.rules -rm -f $RPM_BUILD_ROOT%{_sysconfdir}/init.d/udev -rm -f $RPM_BUILD_ROOT%{_sysconfdir}/hotplug.d/default/10-udev.hotplug +#rm -f $RPM_BUILD_ROOT%{_sysconfdir}/udev/udev.rules +#rm -f $RPM_BUILD_ROOT%{_sysconfdir}/init.d/udev +#rm -f $RPM_BUILD_ROOT%{_sysconfdir}/hotplug.d/default/10-udev.hotplug +rm -f $RPM_BUILD_ROOT%{_docdir}/udev/README.keymap.txt +rmdir $RPM_BUILD_ROOT%{_docdir}/udev # Deprecated, but keep the ownership mkdir -p $RPM_BUILD_ROOT%{_sysconfdir}/udev/{rules.d,makedev.d,scripts,devices} @@ -134,24 +125,8 @@ ln -sf ../../sbin/udevadm $RPM_BUILD_ROOT/sbin/udevtrigger ln -sf ../../sbin/udevadm $RPM_BUILD_ROOT/sbin/udevsettle ln -sf ../../sbin/udevadm $RPM_BUILD_ROOT/sbin/udevcontrol -%if %{with_static} -for i in extras/scsi_id/scsi_id \ - extras/ata_id/ata_id \ - extras/edd_id/edd_id \ - extras/usb_id/usb_id \ - extras/floppy/create_floppy_devices \ - ; do - install -m 0755 $i.static $RPM_BUILD_ROOT%{udev_scriptdir}/$(basename $i).static -done - -for i in udev/udevd udev/udevadm; do - install -m 0755 $i.static $RPM_BUILD_ROOT/sbin/$(basename $i).static -done - -%endif - for i in \ - rules/redhat/40-redhat.rules \ + rules/redhat/40-redhat.rules \ %ifarch ia64 rules/packages/40-ia64.rules \ %endif @@ -262,12 +237,15 @@ rm -f /var/lib/udev/makenode.d/* >/dev/null 2>&1 || : %post -n libudev0 -p /sbin/ldconfig %postun -n libudev0 -p /sbin/ldconfig +%post -n libgudev-1.0-0 -p /sbin/ldconfig +%postun -n libgudev-1.0-0 -p /sbin/ldconfig + %clean rm -rf $RPM_BUILD_ROOT %files %defattr(0644, root, root, 0755) -%doc COPYING README TODO ChangeLog docs/* +%doc COPYING README TODO ChangeLog docs/* extras/keymap/README.keymap.txt %attr(0755,root,root) /sbin/udevadm %attr(0755,root,root) /sbin/udevsettle %attr(0755,root,root) /sbin/udevtrigger @@ -281,6 +259,7 @@ rm -rf $RPM_BUILD_ROOT %attr(0755,root,root) %{udev_scriptdir}/usb_id %attr(0755,root,root) %{udev_scriptdir}/cdrom_id %attr(0755,root,root) %{udev_scriptdir}/path_id +%attr(0755,root,root) %{udev_scriptdir}/hid2hci %attr(0755,root,root) %{udev_scriptdir}/create_floppy_devices %attr(0755,root,root) %{udev_scriptdir}/fw_unit_symlinks.sh %attr(0755,root,root) %{udev_scriptdir}/firmware.sh @@ -315,12 +294,6 @@ rm -rf $RPM_BUILD_ROOT %attr(0644,root,root) %{_mandir}/man8/udev*.8* %attr(0644,root,root) %{_mandir}/man7/udev*.7* %attr(0644,root,root) %{_mandir}/man8/scsi_id*.8* -%attr(0644,root,root) %{_mandir}/man8/ata_id*.8* -%attr(0644,root,root) %{_mandir}/man8/edd_id*.8* -%attr(0644,root,root) %{_mandir}/man8/path_id*.8* -%attr(0644,root,root) %{_mandir}/man8/cdrom_id*.8* -%attr(0644,root,root) %{_mandir}/man8/usb_id*.8* -%attr(0644,root,root) %{_mandir}/man8/create_floppy_devices*.8* %dir %attr(0755,root,root) /var/lib/udev %dir %attr(0755,root,root) /var/lib/udev/makedev.d @@ -330,18 +303,16 @@ rm -rf $RPM_BUILD_ROOT %ghost %dir %{_sysconfdir}/udev/devices/ %ghost %dir %{_sysconfdir}/dev.d/ -%if %{with_static} -%files static -%defattr(0644, root, root, 0755) -%doc COPYING -%attr(0755,root,root) /sbin/udevd.static -%attr(0755,root,root) /sbin/udevadm.static -%attr(0755,root,root) %{udev_scriptdir}/scsi_id.static -%attr(0755,root,root) %{udev_scriptdir}/ata_id.static -%attr(0755,root,root) %{udev_scriptdir}/edd_id.static -%attr(0755,root,root) %{udev_scriptdir}/usb_id.static -%attr(0755,root,root) %{udev_scriptdir}/create_floppy_devices.static -%endif +%attr(0755,root,root) %{udev_scriptdir}/modem-modeswitch +%attr(0755,root,root) %{udev_scriptdir}/pci-db +%attr(0755,root,root) %{udev_scriptdir}/usb-db +%attr(0755,root,root) %{udev_scriptdir}/keymap +%attr(0755,root,root) %{udev_scriptdir}/udev-acl +%attr(0755,root,root) %{udev_scriptdir}/v4l_id +%attr(0755,root,root) %{_datadir}/udev/findkeyboards +%attr(0755,root,root) %{udev_scriptdir}/keymaps/* +%attr(0644,root,root) %{_prefix}/lib/ConsoleKit/run-session.d/udev-acl.ck + %files -n libudev0 %defattr(0644, root, root, 0755) @@ -354,12 +325,25 @@ rm -rf $RPM_BUILD_ROOT %{_includedir}/libudev.h %{_libdir}/libudev.so %{_libdir}/pkgconfig/libudev.pc -%if %{with_static} -%{_libdir}/libudev.a -%endif +%{_datadir}/gtk-doc/html/libudev/* +%files -n libgudev-1.0-0 +%defattr(0644, root, root, 0755) +%attr(0755,root,root) %{_libdir}/libgudev-1.0* +%attr(0644,root,root) %{_libdir}/girepository-1.0/GUdev-1.0.typelib + +%files -n libgudev-devel +%defattr(0644, root, root, 0755) +%attr(0644,root,root) %{_includedir}/gudev-1.0/gudev/*.h +%attr(0644,root,root) %{_datadir}/gir-1.0/GUdev-1.0.gir +%dir %{_datadir}/gtk-doc/html/gudev +%attr(0644,root,root) %{_datadir}/gtk-doc/html/gudev/* +%attr(0755,root,root) %{_libdir}/pkgconfig/gudev-1.0* %changelog +* Fri Jun 19 2009 Harald Hoyer 143-1 +- version 143 + * Thu Jun 08 2009 Harald Hoyer 142-4 - git fix: udevadm: settle - fix timeout - git fix: OWNER/GROUP: fix if logic From 6e123c68b91fefcff2211ee66be5a38a39818f4e Mon Sep 17 00:00:00 2001 From: Harald Hoyer Date: Fri, 19 Jun 2009 14:41:31 +0000 Subject: [PATCH 029/142] obsolete libgudev --- udev.spec | 2 ++ 1 file changed, 2 insertions(+) diff --git a/udev.spec b/udev.spec index 4225337..24072f5 100644 --- a/udev.spec +++ b/udev.spec @@ -71,6 +71,8 @@ dynamic library, which provides access to udev device information. Summary: Libraries for adding libudev support to applications that use glib. Group: Development/Libraries Requires: libudev >= 142 +Provides: libgudev = 20090517 +Obsoletes: libgudev <= 20090516 %description -n libgudev-1.0-0 This package contains the libraries that make it easier to use libudev From b4fc0641396120d4e9329c3577809dc528484147 Mon Sep 17 00:00:00 2001 From: Harald Hoyer Date: Mon, 22 Jun 2009 09:59:16 +0000 Subject: [PATCH 030/142] - version 143 --- .cvsignore | 2 +- sources | 2 +- udev-135-sepol.patch | 17 ----- udev-136-cdrom.patch | 21 ------- udev-136-tape.patch | 23 ------- udev-136-video.patch | 20 ------ udev-137-mdremove.patch | 13 ---- udev-137-vol_id1.patch | 20 ------ udev-137-vol_id2.patch | 30 --------- ...-142.tar.bz2.sign => udev-143.tar.bz2.sign | 6 +- udev-CVE-2009-1186.patch | 20 ------ ...40edc647d8ccfc27c9cd3163ab5dbf63ed6c.patch | 35 ----------- ...798916bc87d72f5f1399d9e050307901db84.patch | 31 ---------- ...1b67f86c9555cbb41c57774761730f6b8939.patch | 45 -------------- ...231e738dd286591c1becc2f327ed55ed89d1.patch | 62 ------------------- ...9099bb2b18f3f683615324a4382b95446305.patch | 28 --------- udev.spec | 48 +++++++------- upstream | 2 +- 18 files changed, 31 insertions(+), 394 deletions(-) delete mode 100644 udev-135-sepol.patch delete mode 100644 udev-136-cdrom.patch delete mode 100644 udev-136-tape.patch delete mode 100644 udev-136-video.patch delete mode 100644 udev-137-mdremove.patch delete mode 100644 udev-137-vol_id1.patch delete mode 100644 udev-137-vol_id2.patch rename udev-142.tar.bz2.sign => udev-143.tar.bz2.sign (61%) delete mode 100644 udev-CVE-2009-1186.patch delete mode 100644 udev.git-055e40edc647d8ccfc27c9cd3163ab5dbf63ed6c.patch delete mode 100644 udev.git-0c37798916bc87d72f5f1399d9e050307901db84.patch delete mode 100644 udev.git-b4fa1b67f86c9555cbb41c57774761730f6b8939.patch delete mode 100644 udev.git-d3c8231e738dd286591c1becc2f327ed55ed89d1.patch delete mode 100644 udev.git-f58a9099bb2b18f3f683615324a4382b95446305.patch diff --git a/.cvsignore b/.cvsignore index de680dd..e126628 100644 --- a/.cvsignore +++ b/.cvsignore @@ -1 +1 @@ -udev-142.tar.bz2 +udev-143.tar.bz2 diff --git a/sources b/sources index ed8a92a..31b43f7 100644 --- a/sources +++ b/sources @@ -1 +1 @@ -3edc4cf383dccb06d866c5156d59ddd5 udev-142.tar.bz2 +d15d1886c0bfa756969f25ddaecf34da udev-143.tar.bz2 diff --git a/udev-135-sepol.patch b/udev-135-sepol.patch deleted file mode 100644 index 32c9afb..0000000 --- a/udev-135-sepol.patch +++ /dev/null @@ -1,17 +0,0 @@ -diff -up udev-135/configure.ac.sepol udev-135/configure.ac ---- udev-135/configure.ac.sepol 2008-12-02 01:05:43.000000000 +0100 -+++ udev-135/configure.ac 2008-12-16 10:45:24.000000000 +0100 -@@ -55,6 +55,13 @@ if test "x$with_selinux" = xyes; then - AC_DEFINE(USE_SELINUX, [1] ,[compile with SELinux support]) - SELINUX_LIBS="-lselinux" - fi -+if test "x$with_selinux" = xyes; then -+ LIBS_save=$LIBS -+ AC_CHECK_LIB(sepol, sepol_genbools, -+ [SELINUX_LIBS="$SELINUX_LIBS -lsepol"], -+ []) -+ LIBS=$LIBS_save -+fi - AC_SUBST([SELINUX_LIBS]) - AM_CONDITIONAL(USE_SELINUX, [test "x$with_selinux" = xyes], [compile with SELinux support]) - diff --git a/udev-136-cdrom.patch b/udev-136-cdrom.patch deleted file mode 100644 index 1ceaa44..0000000 --- a/udev-136-cdrom.patch +++ /dev/null @@ -1,21 +0,0 @@ -commit 18cff5c3b2e3591fa46107288ea2d7026a15ccf3 -Author: Kay Sievers -Date: Sat Jan 10 17:44:09 2009 +0100 - - rules: fix typo in ide cd rule - - Thanks to Scott, who found that. - -diff --git a/rules/rules.d/50-udev-default.rules b/rules/rules.d/50-udev-default.rules -index 119941b..7730f0d 100644 ---- a/rules/rules.d/50-udev-default.rules -+++ b/rules/rules.d/50-udev-default.rules -@@ -68,7 +68,7 @@ KERNEL=="hd*", SUBSYSTEMS=="ide", ATTRS{media}=="floppy", OPTIONS+="all_partitio - - # cdrom - SUBSYSTEM=="block", KERNEL=="sr[0-9]*", SYMLINK+="scd%n", GROUP="cdrom" --SUBSYSTEM=="block", KERNEL=="hd[0-9]*", SUBSYSTEMS=="ide", ATTRS{media}=="cdrom", GROUP="cdrom" -+SUBSYSTEM=="block", KERNEL=="hd*", SUBSYSTEMS=="ide", ATTRS{media}=="cdrom", GROUP="cdrom" - SUBSYSTEMS=="scsi", ATTRS{type}=="4|5", GROUP="cdrom" - KERNEL=="pktcdvd[0-9]*", NAME="pktcdvd/%k", GROUP="cdrom" - KERNEL=="pktcdvd", NAME="pktcdvd/control", GROUP="cdrom" diff --git a/udev-136-tape.patch b/udev-136-tape.patch deleted file mode 100644 index 93bcbd1..0000000 --- a/udev-136-tape.patch +++ /dev/null @@ -1,23 +0,0 @@ -commit 8b739dec53f8bca23e46e2d2a9732abee9b8d591 -Author: Lennart Poettering -Date: Sat Jan 10 01:37:03 2009 +0100 - - fix naming for tape nst devices in /dev/tape/by-path/ - - $env{ID_PATH} includes the "-nst" suffix anyway, so we shouldn't append - it a second time as part of the rule creating the device file symlink. - - Signed-off-by: Lennart Poettering - -diff --git a/rules/rules.d/60-persistent-storage-tape.rules b/rules/rules.d/60-persistent-storage-tape.rules -index d3226f1..8d53888 100644 ---- a/rules/rules.d/60-persistent-storage-tape.rules -+++ b/rules/rules.d/60-persistent-storage-tape.rules -@@ -19,6 +19,6 @@ KERNEL=="nst*[0-9]", ENV{ID_SERIAL}=="?*", SYMLINK+="tape/by-id/$env{ID_BUS}-$en - # by-path (parent device path) - KERNEL=="st*[0-9]|nst*[0-9]", IMPORT{program}="path_id %p" - KERNEL=="st*[0-9]", ENV{ID_PATH}=="?*", SYMLINK+="tape/by-path/$env{ID_PATH}" --KERNEL=="nst*[0-9]", ENV{ID_PATH}=="?*", SYMLINK+="tape/by-path/$env{ID_PATH}-nst" -+KERNEL=="nst*[0-9]", ENV{ID_PATH}=="?*", SYMLINK+="tape/by-path/$env{ID_PATH}" - - LABEL="persistent_storage_tape_end" diff --git a/udev-136-video.patch b/udev-136-video.patch deleted file mode 100644 index dd9d31a..0000000 --- a/udev-136-video.patch +++ /dev/null @@ -1,20 +0,0 @@ -commit 66d9b44f8302efe383ada6a52d8431655614bf76 -Author: Kay Sievers -Date: Thu Jan 15 17:06:14 2009 +0100 - - rules: add drm devices to group "video" - - https://bugs.launchpad.net/bugs/317430 - -diff --git a/rules/rules.d/50-udev-default.rules b/rules/rules.d/50-udev-default.rules -index 7730f0d..95d82d7 100644 ---- a/rules/rules.d/50-udev-default.rules -+++ b/rules/rules.d/50-udev-default.rules -@@ -38,6 +38,7 @@ KERNEL=="card[0-9]*", NAME="dri/%k" - KERNEL=="pmu", GROUP="video" - KERNEL=="nvidia*|nvidiactl*", GROUP="video" - SUBSYSTEM=="graphics", GROUP="video" -+SUBSYSTEM=="drm", GROUP="video" - - # DVB (video) - SUBSYSTEM=="dvb", ENV{DVB_ADAPTER_NUM}=="?*", NAME="dvb/adapter$env{DVB_ADAPTER_NUM}/$env{DVB_DEVICE_TYPE}$env{DVB_DEVICE_NUM}", GROUP="video" diff --git a/udev-137-mdremove.patch b/udev-137-mdremove.patch deleted file mode 100644 index d144bd6..0000000 --- a/udev-137-mdremove.patch +++ /dev/null @@ -1,13 +0,0 @@ -diff -up udev-137/rules/packages/64-md-raid.rules.mdremove udev-137/rules/packages/64-md-raid.rules ---- udev-137/rules/packages/64-md-raid.rules.mdremove 2009-02-05 08:47:35.000000000 +0100 -+++ udev-137/rules/packages/64-md-raid.rules 2009-02-05 08:47:58.000000000 +0100 -@@ -11,7 +11,8 @@ KERNEL!="md*", GOTO="md_end" - # container devices have a metadata version of e.g. 'external:ddf' and - # never leave state 'inactive' - ATTR{md/metadata_version}=="external:[A-Za-z]*", ATTR{md/array_state}=="inactive", GOTO="md_ignore_state" --ATTR{md/array_state}=="|clear|inactive", GOTO="md_end" -+ATTR{md/array_state}=="clear|inactive", GOTO="md_end" -+ATTR{md/array_state}!="?*", GOTO="md_end" - LABEL="md_ignore_state" - - IMPORT{program}="/sbin/mdadm --detail --export $tempnode" diff --git a/udev-137-vol_id1.patch b/udev-137-vol_id1.patch deleted file mode 100644 index 41f7403..0000000 --- a/udev-137-vol_id1.patch +++ /dev/null @@ -1,20 +0,0 @@ -commit 7e5861ff70994fdc2e383e227ff24225ac5f7ce5 -Author: Karel Zak -Date: Sat Jan 24 00:37:23 2009 +0100 - - vol_id: add missing id->type to swap0 - - Signed-off-by: Karel Zak - -diff --git a/extras/volume_id/lib/linux_swap.c b/extras/volume_id/lib/linux_swap.c -index 1698e9d..53649bd 100644 ---- a/extras/volume_id/lib/linux_swap.c -+++ b/extras/volume_id/lib/linux_swap.c -@@ -57,6 +57,7 @@ int volume_id_probe_linux_swap(struct volume_id *id, uint64_t off, uint64_t size - return -1; - - if (memcmp(buf, "SWAP-SPACE", 10) == 0) { -+ id->type = "swap"; - strcpy(id->type_version, "1"); - goto found; - } diff --git a/udev-137-vol_id2.patch b/udev-137-vol_id2.patch deleted file mode 100644 index 34815ca..0000000 --- a/udev-137-vol_id2.patch +++ /dev/null @@ -1,30 +0,0 @@ -commit 3e2084614b4d8308d5c0ceb34ec3634eb3353c00 -Author: Karel Zak -Date: Sat Jan 24 00:37:22 2009 +0100 - - vol_id: fix ddf version string - - The version string in DDF suberblock does not include the null terminator - and the snprintf() function writes at most "size" bytes *including* the - null byte. - - old version: - ID_FS_VERSION=02.00.0 - new version: - ID_FS_VERSION=02.00.00 - - Signed-off-by: Karel Zak - -diff --git a/extras/volume_id/lib/ddf_raid.c b/extras/volume_id/lib/ddf_raid.c -index 58bdae9..32f20ce 100644 ---- a/extras/volume_id/lib/ddf_raid.c -+++ b/extras/volume_id/lib/ddf_raid.c -@@ -87,7 +87,7 @@ int volume_id_probe_ddf_raid(struct volume_id *id, uint64_t off, uint64_t size) - return -1; - found: - volume_id_set_uuid(id, ddf->guid, DDF_GUID_LENGTH, UUID_STRING); -- snprintf(id->type_version, DDF_REV_LENGTH, "%s", ddf->ddf_rev); -+ snprintf(id->type_version, DDF_REV_LENGTH + 1, "%s", ddf->ddf_rev); - volume_id_set_usage(id, VOLUME_ID_RAID); - id->type = "ddf_raid_member"; - return 0; diff --git a/udev-142.tar.bz2.sign b/udev-143.tar.bz2.sign similarity index 61% rename from udev-142.tar.bz2.sign rename to udev-143.tar.bz2.sign index 32394f1..a080c1e 100644 --- a/udev-142.tar.bz2.sign +++ b/udev-143.tar.bz2.sign @@ -2,7 +2,7 @@ Version: GnuPG v1.4.9 (GNU/Linux) Comment: See http://www.kernel.org/signature.html for info -iD8DBQBKCkrhyGugalF9Dw4RAq/BAJ9jlPzsGL1AY6oGAe9k/w40yh8PAACdFb4X -uCq/RlDaoybxMChpTXmrdSY= -=KJLi +iD8DBQBKO9c+yGugalF9Dw4RAm+eAJ92SgVdT1dgfJRsblhgec8982aNvACfdJPn +vGonPNcM/qytpkbb6v8/7Jg= +=WRP9 -----END PGP SIGNATURE----- diff --git a/udev-CVE-2009-1186.patch b/udev-CVE-2009-1186.patch deleted file mode 100644 index 56332ca..0000000 --- a/udev-CVE-2009-1186.patch +++ /dev/null @@ -1,20 +0,0 @@ ---- udev-141/udev/lib/libudev-util.c.CVE-2009-1186 2009-04-08 09:04:26.000000000 -0400 -+++ udev-141/udev/lib/libudev-util.c 2009-04-15 13:25:10.000000000 -0400 -@@ -9,6 +9,7 @@ - * version 2.1 of the License, or (at your option) any later version. - */ - -+#include - #include - #include - #include -@@ -103,6 +104,9 @@ int util_log_priority(const char *priori - - size_t util_path_encode(char *s, size_t len) - { -+ if (len == 0 || len > (SIZE_MAX - 1) / 4) -+ return 0; -+ - char t[(len * 4)+1]; - size_t i, j; - diff --git a/udev.git-055e40edc647d8ccfc27c9cd3163ab5dbf63ed6c.patch b/udev.git-055e40edc647d8ccfc27c9cd3163ab5dbf63ed6c.patch deleted file mode 100644 index 5915df3..0000000 --- a/udev.git-055e40edc647d8ccfc27c9cd3163ab5dbf63ed6c.patch +++ /dev/null @@ -1,35 +0,0 @@ -From: Scott James Remnant -Date: Thu, 14 May 2009 11:42:44 +0000 (+0100) -Subject: OWNER/GROUP: fix if logic -X-Git-Url: http://git.kernel.org/?p=linux%2Fhotplug%2Fudev.git;a=commitdiff_plain;h=055e40edc647d8ccfc27c9cd3163ab5dbf63ed6c - -OWNER/GROUP: fix if logic - -The introduction of the --resolve-names=early/never code introduced a -bug to the OWNER/GROUP lookup. Previously if the name had contained $, -lookup would have been performed later; after the patch, the key ended -up being ignored! ---- - -diff --git a/udev/udev-rules.c b/udev/udev-rules.c -index b8b7e52..39fe55a 100644 ---- a/udev/udev-rules.c -+++ b/udev/udev-rules.c -@@ -1431,7 +1431,7 @@ static int add_rule(struct udev_rules *rules, char *line, - } else if ((rules->resolve_names > 0) && strchr("$%", value[0]) == NULL) { - uid = add_uid(rules, value); - rule_add_key(&rule_tmp, TK_A_OWNER_ID, op, NULL, &uid); -- } else if (rules->resolve_names == 0) { -+ } else if (rules->resolve_names >= 0) { - rule_add_key(&rule_tmp, TK_A_OWNER, op, value, NULL); - } - rule_tmp.rule.rule.flags = 1; -@@ -1448,7 +1448,7 @@ static int add_rule(struct udev_rules *rules, char *line, - } else if ((rules->resolve_names > 0) && strchr("$%", value[0]) == NULL) { - gid = add_gid(rules, value); - rule_add_key(&rule_tmp, TK_A_GROUP_ID, op, NULL, &gid); -- } else if (rules->resolve_names == 0) { -+ } else if (rules->resolve_names >= 0) { - rule_add_key(&rule_tmp, TK_A_GROUP, op, value, NULL); - } - rule_tmp.rule.rule.flags = 1; diff --git a/udev.git-0c37798916bc87d72f5f1399d9e050307901db84.patch b/udev.git-0c37798916bc87d72f5f1399d9e050307901db84.patch deleted file mode 100644 index fc6fcd6..0000000 --- a/udev.git-0c37798916bc87d72f5f1399d9e050307901db84.patch +++ /dev/null @@ -1,31 +0,0 @@ -From: Kay Sievers -Date: Wed, 13 May 2009 16:01:32 +0000 (+0200) -Subject: fix possible endless loop for GOTO to non-existent LABEL -X-Git-Url: http://git.kernel.org/?p=linux%2Fhotplug%2Fudev.git;a=commitdiff_plain;h=0c37798916bc87d72f5f1399d9e050307901db84 - -fix possible endless loop for GOTO to non-existent LABEL - -http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=526365 ---- - -diff --git a/udev/udev-rules.c b/udev/udev-rules.c -index fac418e..b8b7e52 100644 ---- a/udev/udev-rules.c -+++ b/udev/udev-rules.c -@@ -1610,6 +1610,7 @@ static int parse_file(struct udev_rules *rules, const char *filename, unsigned s - if (strcmp(label, &rules->buf[rules->tokens[j].rule.label_off]) != 0) - continue; - rules->tokens[i].key.rule_goto = j; -+ break; - } - if (rules->tokens[i].key.rule_goto == 0) - err(rules->udev, "GOTO '%s' has no matching label in: '%s'\n", label, filename); -@@ -2504,6 +2505,8 @@ int udev_rules_apply_to_event(struct udev_rules *rules, struct udev_event *event - break; - } - case TK_A_GOTO: -+ if (cur->key.rule_goto == 0) -+ break; - cur = &rules->tokens[cur->key.rule_goto]; - continue; - case TK_A_LAST_RULE: diff --git a/udev.git-b4fa1b67f86c9555cbb41c57774761730f6b8939.patch b/udev.git-b4fa1b67f86c9555cbb41c57774761730f6b8939.patch deleted file mode 100644 index 697af69..0000000 --- a/udev.git-b4fa1b67f86c9555cbb41c57774761730f6b8939.patch +++ /dev/null @@ -1,45 +0,0 @@ -From: Kay Sievers -Date: Thu, 14 May 2009 10:57:19 +0000 (+0200) -Subject: rule-generator: cd - skip by-path links if we create by-id links -X-Git-Url: http://git.kernel.org/?p=linux%2Fhotplug%2Fudev.git;a=commitdiff_plain;h=b4fa1b67f86c9555cbb41c57774761730f6b8939 - -rule-generator: cd - skip by-path links if we create by-id links ---- - -diff --git a/extras/rule_generator/75-cd-aliases-generator.rules b/extras/rule_generator/75-cd-aliases-generator.rules -index e357a6a..e6da010 100644 ---- a/extras/rule_generator/75-cd-aliases-generator.rules -+++ b/extras/rule_generator/75-cd-aliases-generator.rules -@@ -1,6 +1,9 @@ - # these rules generate rules for the /dev/{cdrom,dvd,...} symlinks - --# the path of removable devices changes frequently --ACTION=="add", SUBSYSTEM=="block", SUBSYSTEMS=="usb|ieee1394", ENV{ID_CDROM}=="?*", ENV{GENERATED}!="?*", PROGRAM="write_cd_rules by-id", SYMLINK+="%c" -+# the "path" of usb/ieee1394 devices changes frequently, use "id" -+ACTION=="add", SUBSYSTEM=="block", SUBSYSTEMS=="usb|ieee1394", ENV{ID_CDROM}=="?*", ENV{GENERATED}!="?*", \ -+ PROGRAM="write_cd_rules by-id", SYMLINK+="%c", GOTO="persistent_cd_end" - - ACTION=="add", SUBSYSTEM=="block", ENV{ID_CDROM}=="?*", ENV{GENERATED}!="?*", PROGRAM="write_cd_rules", SYMLINK+="%c" -+ -+LABEL="persistent_cd_end" -diff --git a/extras/rule_generator/write_cd_rules b/extras/rule_generator/write_cd_rules -index 398cd27..0d16fe6 100644 ---- a/extras/rule_generator/write_cd_rules -+++ b/extras/rule_generator/write_cd_rules -@@ -97,7 +97,7 @@ choose_rules_file - - link_num=$(find_next_available 'cdrom[0-9]*') - --match="ENV{ID_CDROM}==\"?*\", $RULE" -+match="SUBSYSTEM==\"block\", ENV{ID_CDROM}==\"?*\", $RULE" - - comment="$ID_MODEL ($ID_PATH)" - -@@ -108,6 +108,7 @@ comment="$ID_MODEL ($ID_PATH)" - write_rule "$match" "dvd$link_num" - [ "$ID_CDROM_DVD_R" -o "$ID_CDROM_DVD_RW" -o "$ID_CDROM_DVD_RAM" ] && \ - write_rule "$match" "dvdrw$link_num" -+echo >> $RULES_FILE - - unlock_rules_file - diff --git a/udev.git-d3c8231e738dd286591c1becc2f327ed55ed89d1.patch b/udev.git-d3c8231e738dd286591c1becc2f327ed55ed89d1.patch deleted file mode 100644 index 3ba1820..0000000 --- a/udev.git-d3c8231e738dd286591c1becc2f327ed55ed89d1.patch +++ /dev/null @@ -1,62 +0,0 @@ -From: Kay Sievers -Date: Mon, 25 May 2009 22:50:45 +0000 (+0200) -Subject: cdrom_id: suppress ID_CDROM_MEDIA_STATE=blank for plain non-writable CDROM media -X-Git-Url: http://git.kernel.org/?p=linux%2Fhotplug%2Fudev.git;a=commitdiff_plain;h=d3c8231e738dd286591c1becc2f327ed55ed89d1 - -cdrom_id: suppress ID_CDROM_MEDIA_STATE=blank for plain non-writable CDROM media - -Some broken fake cdrom drives return ID_CDROM_MEDIA_STATE=blank. - - $ /lib/udev/cdrom_id -d /dev/sr1 - main: probing: '/dev/sr1' - cd_inquiry: INQUIRY: [Nokia ][S60 ][1.0 ] - cd_profiles: GET CONFIGURATION: number of profiles 76 - cd_profiles: current profile 0x08 - cd_media_toc: READ TOC: len: 12 - cd_media_toc: last track 1 starts at block 0 - cd_media_info: disk type 00 - ID_CDROM=1 - ID_CDROM_MRW=1 - ID_CDROM_MRW_W=1 - ID_CDROM_MEDIA=1 - ID_CDROM_MEDIA_CD=1 - ID_CDROM_MEDIA_STATE=blank - -Others work fine, but ID_CDROM_MEDIA_STATE is not needed for non-writable CDROM media: - - $ /lib/udev/cdrom_id -d /dev/sr1 - main: probing: '/dev/sr1' - cd_inquiry: INQUIRY: [SanDisk ][U3 Cruzer Micro ][8.02] - cd_profiles: GET CONFIGURATION: number of profiles 72 - cd_profiles: current profile 0x08 - cd_media_toc: READ TOC: len: 20 - cd_media_toc: track=1 info=0x4(data) start_block=0 - cd_media_toc: last track 1 starts at block 0 - cd_media_info: disk type 00 - ID_CDROM=1 - ID_CDROM_MRW=1 - ID_CDROM_MRW_W=1 - ID_CDROM_MEDIA=1 - ID_CDROM_MEDIA_CD=1 - ID_CDROM_MEDIA_STATE=complete - ID_CDROM_MEDIA_SESSION_COUNT=1 - ID_CDROM_MEDIA_TRACK_COUNT=1 - ID_CDROM_MEDIA_TRACK_COUNT_DATA=1 ---- - -diff --git a/extras/cdrom_id/cdrom_id.c b/extras/cdrom_id/cdrom_id.c -index 0d873ae..921e534 100644 ---- a/extras/cdrom_id/cdrom_id.c -+++ b/extras/cdrom_id/cdrom_id.c -@@ -426,8 +426,10 @@ static int cd_media_info(struct udev *udev, int fd) - - info(udev, "disk type %02x\n", header[8]); - -- if ((header[2] & 3) < 4) -+ /* exclude plain CDROM, some fake cdroms return 0 for "blank" media here */ -+ if (!cd_media_cd_rom && (header[2] & 3) < 4) - cd_media_state = media_status[header[2] & 3]; -+ - if ((header[2] & 3) != 2) - cd_media_session_next = header[10] << 8 | header[5]; - cd_media_session_count = header[9] << 8 | header[4]; diff --git a/udev.git-f58a9099bb2b18f3f683615324a4382b95446305.patch b/udev.git-f58a9099bb2b18f3f683615324a4382b95446305.patch deleted file mode 100644 index aac97b5..0000000 --- a/udev.git-f58a9099bb2b18f3f683615324a4382b95446305.patch +++ /dev/null @@ -1,28 +0,0 @@ -From: Alan Jenkins -Date: Wed, 20 May 2009 14:12:22 +0000 (+0200) -Subject: udevadm: settle - fix timeout -X-Git-Url: http://git.kernel.org/?p=linux%2Fhotplug%2Fudev.git;a=commitdiff_plain;h=f58a9099bb2b18f3f683615324a4382b95446305 - -udevadm: settle - fix timeout - -The timeout wasn't working when settle was run as root: - # udevadm control --stop-exec-queue - # udevadm trigger - # udevadm settle --timeout=1 - ... (hangs) - -Signed-off-by: Alan Jenkins ---- - -diff --git a/udev/udevadm-settle.c b/udev/udevadm-settle.c -index 3b26f10..52d9c0b 100644 ---- a/udev/udevadm-settle.c -+++ b/udev/udevadm-settle.c -@@ -167,6 +167,7 @@ int udevadm_settle(struct udev *udev, int argc, char *argv[]) - sigprocmask(SIG_BLOCK, &mask, &oldmask); - if (udev_ctrl_send_settle(uctrl) > 0) - sigsuspend(&oldmask); -+ sigprocmask(SIG_SETMASK, &oldmask, NULL); - udev_ctrl_unref(uctrl); - } - } diff --git a/udev.spec b/udev.spec index 24072f5..bc3446f 100644 --- a/udev.spec +++ b/udev.spec @@ -47,44 +47,48 @@ Provides: dev = 0:3.12-1 The udev package contains an implementation of devfs in userspace using sysfs and netlink. -%package -n libudev0 +%package -n libudev Summary: Dynamic library to access udev device information Group: System Environment/Libraries -Obsoletes: libudev0 < 143 +Obsoletes: libudev0 <= 142 +Provides: libudev0 = 143 -%description -n libudev0 +%description -n libudev This package contains the dynamic library libudev, which provides access to udev device information, and an interface to search devices in sysfs. - %package -n libudev-devel Summary: Development files for libudev Group: Development/Libraries Requires: udev = %{version}-%{release} -Requires: libudev0 = %{version}-%{release} +Requires: libudev = %{version}-%{release} %description -n libudev-devel This package contains the development files for the library libudev, a dynamic library, which provides access to udev device information. -%package -n libgudev-1.0-0 +%package -n libgudev1 Summary: Libraries for adding libudev support to applications that use glib. Group: Development/Libraries Requires: libudev >= 142 +# remove the following lines for libgudev so major 1 Provides: libgudev = 20090517 Obsoletes: libgudev <= 20090516 -%description -n libgudev-1.0-0 +%description -n libgudev1 This package contains the libraries that make it easier to use libudev functionality from applications that use glib. -%package -n libgudev-devel +%package -n libgudev1-devel Summary: Header files for adding libudev support to applications that use glib. Group: Development/Libraries Requires: libudev-devel >= 142 -Requires: libgudev-1.0-0 = %{version}-%{release} +Provides: libgudev-devel = 20090517 +Obsoletes: libgudev-devel <= 20090516 -%description -n libgudev-devel +Requires: libgudev1 = %{version}-%{release} + +%description -n libgudev1-devel This package contains the header and pkg-config files for developing glib-based applications using libudev functionality. @@ -105,11 +109,7 @@ mkdir -p $RPM_BUILD_ROOT%{_sbindir} make install DESTDIR=$RPM_BUILD_ROOT -#rm -f $RPM_BUILD_ROOT%{_sysconfdir}/udev/udev.rules -#rm -f $RPM_BUILD_ROOT%{_sysconfdir}/init.d/udev -#rm -f $RPM_BUILD_ROOT%{_sysconfdir}/hotplug.d/default/10-udev.hotplug -rm -f $RPM_BUILD_ROOT%{_docdir}/udev/README.keymap.txt -rmdir $RPM_BUILD_ROOT%{_docdir}/udev +rm -fr $RPM_BUILD_ROOT%{_docdir}/udev # Deprecated, but keep the ownership mkdir -p $RPM_BUILD_ROOT%{_sysconfdir}/udev/{rules.d,makedev.d,scripts,devices} @@ -138,6 +138,7 @@ for i in \ %ifarch s390 s390x rules/packages/40-s390.rules \ %endif + rules/packages/40-isdn.rules \ rules/packages/40-alsa.rules \ rules/packages/64-md-raid.rules \ rules/packages/64-device-mapper.rules \ @@ -236,11 +237,11 @@ rm -f /var/lib/udev/makenode.d/* >/dev/null 2>&1 || : %triggerin -- MAKEDEV rm -f /var/lib/udev/makenode.d/* >/dev/null 2>&1 || : -%post -n libudev0 -p /sbin/ldconfig -%postun -n libudev0 -p /sbin/ldconfig +%post -n libudev -p /sbin/ldconfig +%postun -n libudev -p /sbin/ldconfig -%post -n libgudev-1.0-0 -p /sbin/ldconfig -%postun -n libgudev-1.0-0 -p /sbin/ldconfig +%post -n libgudev1 -p /sbin/ldconfig +%postun -n libgudev1 -p /sbin/ldconfig %clean rm -rf $RPM_BUILD_ROOT @@ -311,12 +312,12 @@ rm -rf $RPM_BUILD_ROOT %attr(0755,root,root) %{udev_scriptdir}/keymap %attr(0755,root,root) %{udev_scriptdir}/udev-acl %attr(0755,root,root) %{udev_scriptdir}/v4l_id -%attr(0755,root,root) %{_datadir}/udev/findkeyboards +%attr(0755,root,root) %{udev_scriptdir}/findkeyboards %attr(0755,root,root) %{udev_scriptdir}/keymaps/* %attr(0644,root,root) %{_prefix}/lib/ConsoleKit/run-session.d/udev-acl.ck -%files -n libudev0 +%files -n libudev %defattr(0644, root, root, 0755) %doc COPYING %attr(0755,root,root) /%{_lib}/libudev.so.* @@ -327,14 +328,15 @@ rm -rf $RPM_BUILD_ROOT %{_includedir}/libudev.h %{_libdir}/libudev.so %{_libdir}/pkgconfig/libudev.pc +%{_datadir}/pkgconfig/udev.pc %{_datadir}/gtk-doc/html/libudev/* -%files -n libgudev-1.0-0 +%files -n libgudev1 %defattr(0644, root, root, 0755) %attr(0755,root,root) %{_libdir}/libgudev-1.0* %attr(0644,root,root) %{_libdir}/girepository-1.0/GUdev-1.0.typelib -%files -n libgudev-devel +%files -n libgudev1-devel %defattr(0644, root, root, 0755) %attr(0644,root,root) %{_includedir}/gudev-1.0/gudev/*.h %attr(0644,root,root) %{_datadir}/gir-1.0/GUdev-1.0.gir diff --git a/upstream b/upstream index 260ace6..e126628 100644 --- a/upstream +++ b/upstream @@ -1 +1 @@ -udev-137.tar.bz2 +udev-143.tar.bz2 From 367c089c3ead9600dd3a06206cba0d0d6f9d5c52 Mon Sep 17 00:00:00 2001 From: Harald Hoyer Date: Mon, 22 Jun 2009 10:04:58 +0000 Subject: [PATCH 031/142] add gperf to BuildRequires --- udev.spec | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/udev.spec b/udev.spec index bc3446f..de558ef 100644 --- a/udev.spec +++ b/udev.spec @@ -29,7 +29,7 @@ Requires: hwdata BuildRequires: sed libselinux-devel >= 0:1.17.9-2 flex libsepol-devel BuildRequires: glib2-devel bison findutils MAKEDEV -BuildRequires: glib2-devel +BuildRequires: gperf BuildRequires: libusb-devel BuildRequires: libxslt BuildRequires: hwdata From ab3b43336245acfa8e54054aff543b8ff9f43ad8 Mon Sep 17 00:00:00 2001 From: Harald Hoyer Date: Mon, 22 Jun 2009 10:27:37 +0000 Subject: [PATCH 032/142] add libacl-devel to BuildRequires --- udev.spec | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/udev.spec b/udev.spec index de558ef..87c1134 100644 --- a/udev.spec +++ b/udev.spec @@ -30,7 +30,7 @@ Requires: hwdata BuildRequires: sed libselinux-devel >= 0:1.17.9-2 flex libsepol-devel BuildRequires: glib2-devel bison findutils MAKEDEV BuildRequires: gperf -BuildRequires: libusb-devel +BuildRequires: libusb-devel libacl-devel BuildRequires: libxslt BuildRequires: hwdata BuildRequires: gobject-introspection-devel >= 0.6.2 From 5b53a68b94d1aa17e4b4f70d3df7bb562a4e1f5d Mon Sep 17 00:00:00 2001 From: Harald Hoyer Date: Mon, 22 Jun 2009 10:47:52 +0000 Subject: [PATCH 033/142] add libtool to BuildRequires --- udev.spec | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/udev.spec b/udev.spec index 87c1134..d4982dc 100644 --- a/udev.spec +++ b/udev.spec @@ -29,7 +29,7 @@ Requires: hwdata BuildRequires: sed libselinux-devel >= 0:1.17.9-2 flex libsepol-devel BuildRequires: glib2-devel bison findutils MAKEDEV -BuildRequires: gperf +BuildRequires: gperf libtool BuildRequires: libusb-devel libacl-devel BuildRequires: libxslt BuildRequires: hwdata From 6a426a60726142b4e3d0a8f3e7676c6aab1c0131 Mon Sep 17 00:00:00 2001 From: Harald Hoyer Date: Fri, 3 Jul 2009 13:48:12 +0000 Subject: [PATCH 034/142] - add acpi floppy modalias - add retrigger of failed events in udev-post.init - killall pids of udev in %pre --- udev-post.init | 6 ++++++ udev.spec | 40 ++++++++++++++++++---------------------- 2 files changed, 24 insertions(+), 22 deletions(-) diff --git a/udev-post.init b/udev-post.init index cfffd3c..2c9943a 100644 --- a/udev-post.init +++ b/udev-post.init @@ -22,6 +22,12 @@ # See how we were called. case "$1" in start|reload) + STRING=$"Retrigger failed udev events" + echo -n $STRING + /sbin/udevadm trigger --retry-failed + success "$STRING" + echo + STRING=$"Adding udev persistent rules" # copy the rules generated before / was mounted read-write diff --git a/udev.spec b/udev.spec index d4982dc..e11b34e 100644 --- a/udev.spec +++ b/udev.spec @@ -5,7 +5,7 @@ Summary: A userspace implementation of devfs Name: udev Version: 143 -Release: 1%{?dist} +Release: 2%{?dist} License: GPLv2 Group: System Environment/Base Provides: udev-persistent = %{version}-%{release} @@ -128,7 +128,7 @@ ln -sf ../../sbin/udevadm $RPM_BUILD_ROOT/sbin/udevsettle ln -sf ../../sbin/udevadm $RPM_BUILD_ROOT/sbin/udevcontrol for i in \ - rules/redhat/40-redhat.rules \ + rules/redhat/40-redhat.rules \ %ifarch ia64 rules/packages/40-ia64.rules \ %endif @@ -158,6 +158,7 @@ mkdir -p -m 0755 $RPM_BUILD_ROOT%{firmwaredir} mkdir -p -m 0755 $RPM_BUILD_ROOT%{_sysconfdir}/modprobe.d cat > $RPM_BUILD_ROOT%{_sysconfdir}/modprobe.d/floppy-pnp.conf </dev/null || /usr/sbin/groupadd -g 18 dialout || : if test -f /proc/1/exe -a -d /proc/1/root; then if test -x /usr/bin/stat -a "$(/usr/bin/stat -Lc '%%D-%%i' /)" = "$(/usr/bin/stat -Lc '%%D-%%i' /proc/1/root)"; then if test -x /sbin/udevd -a -x /sbin/pidof ; then + /sbin/udevadm control --stop-exec-queue pid=$(/sbin/pidof -c udevd) - if [ -n "$pid" ]; then - kill $pid - fi + while [ -n "$pid" ]; do + for p in $pid; do + kill $hard $p; + done + pid=$(/sbin/pidof -c udevd) + hard="-9" + done fi fi fi @@ -209,28 +215,13 @@ exit 0 # start daemon if we are not in a chroot if test -f /proc/1/exe -a -d /proc/1/root; then if test "$(/usr/bin/stat -Lc '%%D-%%i' /)" = "$(/usr/bin/stat -Lc '%%D-%%i' /proc/1/root)"; then - if test -x /sbin/udevd; then /sbin/udevd -d - fi + /sbin/udevadm control --start-exec-queue fi fi exit 0 -%triggerpostun -- dev <= 0:3.12-1 -if [ $2 = 0 ]; then - if [ -x /sbin/MAKEDEV ]; then - /sbin/MAKEDEV null - else - /bin/mknod /dev/null c 1 3 - fi - /sbin/start_udev >/dev/null 2>&1 - if [ -e /dev/mapper/control -a -x /sbin/lvm ]; then - /sbin/lvm vgmknodes >/dev/null 2>&1 - fi -fi -exit 0 - %triggerin -- selinux-policy rm -f /var/lib/udev/makenode.d/* >/dev/null 2>&1 || : @@ -345,6 +336,11 @@ rm -rf $RPM_BUILD_ROOT %attr(0755,root,root) %{_libdir}/pkgconfig/gudev-1.0* %changelog +* Fri Jul 03 2009 Harald Hoyer 143-2 +- add acpi floppy modalias +- add retrigger of failed events in udev-post.init +- killall pids of udev in %%pre + * Fri Jun 19 2009 Harald Hoyer 143-1 - version 143 @@ -354,7 +350,7 @@ rm -rf $RPM_BUILD_ROOT - git fix: rule-generator: cd - skip by-path links if we create by-id links - git fix: fix possible endless loop for GOTO to non-existent LABEL - git fix: cdrom_id: suppress ID_CDROM_MEDIA_STATE=blank for plain non-writable - CDROM media + CDROM media * Thu Jun 08 2009 Harald Hoyer 142-3 - delay device-mapper changes From b13ebc6c3079a5d7d5ba72985859c6d52e62ee11 Mon Sep 17 00:00:00 2001 From: Harald Hoyer Date: Tue, 14 Jul 2009 10:32:55 +0000 Subject: [PATCH 035/142] - version 145 - add "udevlog" kernel command line option to redirect the output of udevd to /dev/.udev/udev.log --- start_udev | 58 +++++++++---------- ...-143.tar.bz2.sign => udev-145.tar.bz2.sign | 6 +- udev.spec | 9 ++- upstream | 2 +- 4 files changed, 38 insertions(+), 37 deletions(-) rename udev-143.tar.bz2.sign => udev-145.tar.bz2.sign (61%) diff --git a/start_udev b/start_udev index 99a67fa..9a11d65 100755 --- a/start_udev +++ b/start_udev @@ -99,37 +99,25 @@ make_extra_nodes () { USE_MD5="false" [ -x /usr/bin/md5sum -a "$UDEV_USE_MAKEDEV_CACHE" == "yes" ] && USE_MD5="true" + for i in 0 1 2 3 4 5 6 7; do + [ -b /dev/loop$i ] || /bin/mknod -m 0640 /dev/loop$i b 7 $i + /bin/chown root:disk /dev/loop$i + done + + for i in 0 1 2 3; do + [ -c /dev/lp$i ] || /bin/mknod -m 0660 /dev/lp$i c 6 $i + /bin/chown root:lp /dev/lp$i + done + [ -d /dev/net ] || mkdir -p /dev/net - /bin/mknod -m 0640 /dev/loop0 b 7 0 - /bin/chown root:disk /dev/loop0 - /bin/mknod -m 0640 /dev/loop1 b 7 1 - /bin/chown root:disk /dev/loop1 - /bin/mknod -m 0640 /dev/loop2 b 7 2 - /bin/chown root:disk /dev/loop2 - /bin/mknod -m 0640 /dev/loop3 b 7 3 - /bin/chown root:disk /dev/loop3 - /bin/mknod -m 0640 /dev/loop4 b 7 4 - /bin/chown root:disk /dev/loop4 - /bin/mknod -m 0640 /dev/loop5 b 7 5 - /bin/chown root:disk /dev/loop5 - /bin/mknod -m 0640 /dev/loop6 b 7 6 - /bin/chown root:disk /dev/loop6 - /bin/mknod -m 0640 /dev/loop7 b 7 7 - /bin/chown root:disk /dev/loop7 - /bin/mknod -m 0600 /dev/net/tun c 10 200 - /bin/chown root:root /dev/net/tun - /bin/mknod -m 0600 /dev/ppp c 108 0 - /bin/chown root:root /dev/ppp - /bin/mknod -m 0660 /dev/lp0 c 6 0 - /bin/chown root:lp /dev/lp0 - /bin/mknod -m 0660 /dev/lp1 c 6 1 - /bin/chown root:lp /dev/lp1 - /bin/mknod -m 0660 /dev/lp2 c 6 2 - /bin/chown root:lp /dev/lp2 - /bin/mknod -m 0660 /dev/lp3 c 6 3 - /bin/chown root:lp /dev/lp3 - /bin/mknod -m 0666 /dev/fuse c 10 229 - /bin/chown root:root /dev/fuse + [ -c /dev/net/tun ] || /bin/mknod -m 0600 /dev/net/tun c 10 200 + #/bin/chown root:root /dev/net/tun + + [ -c /dev/ppp ] || /bin/mknod -m 0600 /dev/ppp c 108 0 + #/bin/chown root:root /dev/ppp + + [ -c /dev/fuse ] || /bin/mknod -m 0666 /dev/fuse c 10 229 + #/bin/chown root:root /dev/fuse [ -x /sbin/restorecon ] && /sbin/restorecon /dev/loop0 /dev/loop1 /dev/loop2 /dev/loop3 /dev/loop4 /dev/loop5 /dev/loop6 /dev/loop7 /dev/net/tun /dev/ppp /dev/lp0 /dev/lp1 /dev/lp2 /dev/lp3 /dev/fuse @@ -261,6 +249,7 @@ make_extra_nodes & cmdline=$(cat /proc/cmdline) kill_udevd > "$udev_root/null" 2>&1 rm -fr $udev_root/.udev > "$udev_root/null" 2>&1 +mkdir -p $udev_root/.udev > "$udev_root/null" 2>&1 UDEV_OPTS="" if [ -f "/sys/class/tty/console/uevent" ]; then # trigger the sorted events @@ -269,7 +258,14 @@ if [ -f "/sys/class/tty/console/uevent" ]; then if strstr "$cmdline" udevtrace; then UDEV_OPTS="$UDEV_OPTS --debug-trace" fi - /sbin/udevd -d $UDEV_OPTS + + if strstr "$cmdline" udevlog; then + UDEV_OPTS="$UDEV_OPTS --debug" + /sbin/udevd -d $UDEV_OPTS 2>$udev_root/.udev/udev.log + else + /sbin/udevd -d $UDEV_OPTS + fi + wait ret=$[$ret + $?] diff --git a/udev-143.tar.bz2.sign b/udev-145.tar.bz2.sign similarity index 61% rename from udev-143.tar.bz2.sign rename to udev-145.tar.bz2.sign index a080c1e..23c18c4 100644 --- a/udev-143.tar.bz2.sign +++ b/udev-145.tar.bz2.sign @@ -2,7 +2,7 @@ Version: GnuPG v1.4.9 (GNU/Linux) Comment: See http://www.kernel.org/signature.html for info -iD8DBQBKO9c+yGugalF9Dw4RAm+eAJ92SgVdT1dgfJRsblhgec8982aNvACfdJPn -vGonPNcM/qytpkbb6v8/7Jg= -=WRP9 +iD8DBQBKWxhnyGugalF9Dw4RAvvjAJ9ed+RMRi8gXcFyTPxXsHZpbLSROgCfdpCc +lr5nSwsGGO9e0+wBbD7WDoc= +=5/z0 -----END PGP SIGNATURE----- diff --git a/udev.spec b/udev.spec index e11b34e..7922d8a 100644 --- a/udev.spec +++ b/udev.spec @@ -4,8 +4,8 @@ Summary: A userspace implementation of devfs Name: udev -Version: 143 -Release: 2%{?dist} +Version: 145 +Release: 1%{?dist} License: GPLv2 Group: System Environment/Base Provides: udev-persistent = %{version}-%{release} @@ -336,6 +336,11 @@ rm -rf $RPM_BUILD_ROOT %attr(0755,root,root) %{_libdir}/pkgconfig/gudev-1.0* %changelog +* Tue Jul 14 2009 Harald Hoyer 145-1 +- version 145 +- add "udevlog" kernel command line option to redirect the + output of udevd to /dev/.udev/udev.log + * Fri Jul 03 2009 Harald Hoyer 143-2 - add acpi floppy modalias - add retrigger of failed events in udev-post.init diff --git a/upstream b/upstream index e126628..287b708 100644 --- a/upstream +++ b/upstream @@ -1 +1 @@ -udev-143.tar.bz2 +udev-145.tar.bz2 From c6a10bffc716fc29a132d88d6183c4203182184c Mon Sep 17 00:00:00 2001 From: Harald Hoyer Date: Tue, 14 Jul 2009 12:09:01 +0000 Subject: [PATCH 036/142] - version 145 - add "udevlog" kernel command line option to redirect the output of udevd to /dev/.udev/udev.log --- .cvsignore | 2 +- sources | 2 +- udev.spec | 8 +++++--- 3 files changed, 7 insertions(+), 5 deletions(-) diff --git a/.cvsignore b/.cvsignore index e126628..287b708 100644 --- a/.cvsignore +++ b/.cvsignore @@ -1 +1 @@ -udev-143.tar.bz2 +udev-145.tar.bz2 diff --git a/sources b/sources index 31b43f7..433028f 100644 --- a/sources +++ b/sources @@ -1 +1 @@ -d15d1886c0bfa756969f25ddaecf34da udev-143.tar.bz2 +b3d3b5f88c7b81e7615700a04db685e1 udev-145.tar.bz2 diff --git a/udev.spec b/udev.spec index 7922d8a..36b56d6 100644 --- a/udev.spec +++ b/udev.spec @@ -110,11 +110,13 @@ mkdir -p $RPM_BUILD_ROOT%{_sbindir} make install DESTDIR=$RPM_BUILD_ROOT rm -fr $RPM_BUILD_ROOT%{_docdir}/udev +rm -f $RPM_BUILD_ROOT/%{_libdir}/*.la # Deprecated, but keep the ownership mkdir -p $RPM_BUILD_ROOT%{_sysconfdir}/udev/{rules.d,makedev.d,scripts,devices} mkdir -p $RPM_BUILD_ROOT%{_sysconfdir}/dev.d mkdir -p $RPM_BUILD_ROOT%{_bindir} +touch $RPM_BUILD_ROOT%{_sysconfdir}/scsi_id.config # force relative symlinks ln -sf ..%{udev_scriptdir}/scsi_id $RPM_BUILD_ROOT/sbin/scsi_id @@ -279,8 +281,7 @@ rm -rf $RPM_BUILD_ROOT %config(noreplace) %attr(0644,root,root) %{_sysconfdir}/udev/udev.conf %attr(0644,root,root) %{udev_scriptdir}/rules.d/*.rules -#%config(missingok) %{_sysconfdir}/hotplug.d/default/10-udev.hotplug -%config(noreplace) %attr(0644,root,root) %{_sysconfdir}/scsi_id.config +%ghost %config(noreplace,missingok) %attr(0644,root,root) %{_sysconfdir}/scsi_id.config %config %attr(0644,root,root) %{_sysconfdir}/modprobe.d/floppy-pnp.conf @@ -324,11 +325,12 @@ rm -rf $RPM_BUILD_ROOT %files -n libgudev1 %defattr(0644, root, root, 0755) -%attr(0755,root,root) %{_libdir}/libgudev-1.0* +%attr(0755,root,root) %{_libdir}/libgudev-1.0.so.* %attr(0644,root,root) %{_libdir}/girepository-1.0/GUdev-1.0.typelib %files -n libgudev1-devel %defattr(0644, root, root, 0755) +%attr(0755,root,root) %{_libdir}/libgudev-1.0.so %attr(0644,root,root) %{_includedir}/gudev-1.0/gudev/*.h %attr(0644,root,root) %{_datadir}/gir-1.0/GUdev-1.0.gir %dir %{_datadir}/gtk-doc/html/gudev From 11f08c47bd65d4f965b39ac775d838275306dc51 Mon Sep 17 00:00:00 2001 From: Harald Hoyer Date: Fri, 24 Jul 2009 08:17:35 +0000 Subject: [PATCH 037/142] - fix file permissions - remove rpath - chkconfig --add for udev-post - fix summaries - add "Required-Stop" to udev-post --- udev-post.init | 1 + udev.spec | 31 +++++++++++++++++++++++-------- 2 files changed, 24 insertions(+), 8 deletions(-) diff --git a/udev-post.init b/udev-post.init index 2c9943a..51bc184 100644 --- a/udev-post.init +++ b/udev-post.init @@ -11,6 +11,7 @@ # Default-Start: 12345 # Default-Stop: 0 6 # Required-Start: $local_fs +# Required-Stop: # Short-Description: Moves the generated persistent udev rules to /etc/udev/rules.d # Description: Moves the generated persistent udev rules to /etc/udev/rules.d # Provides: udev-post diff --git a/udev.spec b/udev.spec index 36b56d6..adab3ba 100644 --- a/udev.spec +++ b/udev.spec @@ -5,7 +5,7 @@ Summary: A userspace implementation of devfs Name: udev Version: 145 -Release: 1%{?dist} +Release: 2%{?dist} License: GPLv2 Group: System Environment/Base Provides: udev-persistent = %{version}-%{release} @@ -36,12 +36,13 @@ BuildRequires: hwdata BuildRequires: gobject-introspection-devel >= 0.6.2 BuildRequires: gtk-doc BuildRequires: usbutils +BuildRequires: libtool >= 2.2.6 Requires: libselinux >= 0:1.17.9-2 sed Conflicts: kernel < 0:2.6 mkinitrd <= 0:4.1.11-1 initscripts < 7.84 Requires: util-linux-ng >= 2.15.1 Obsoletes: dev <= 0:3.12-1 -Provides: dev = 0:3.12-1 +Provides: dev = 0:3.12-2 %description The udev package contains an implementation of devfs in @@ -68,7 +69,7 @@ This package contains the development files for the library libudev, a dynamic library, which provides access to udev device information. %package -n libgudev1 -Summary: Libraries for adding libudev support to applications that use glib. +Summary: Libraries for adding libudev support to applications that use glib Group: Development/Libraries Requires: libudev >= 142 # remove the following lines for libgudev so major 1 @@ -80,7 +81,7 @@ This package contains the libraries that make it easier to use libudev functionality from applications that use glib. %package -n libgudev1-devel -Summary: Header files for adding libudev support to applications that use glib. +Summary: Header files for adding libudev support to applications that use glib Group: Development/Libraries Requires: libudev-devel >= 142 Provides: libgudev-devel = 20090517 @@ -96,10 +97,14 @@ glib-based applications using libudev functionality. %setup -q %build +# get rid of rpath +libtoolize -f -c %configure --with-selinux --prefix=%{_prefix} --exec-prefix="" \ --sysconfdir=%{_sysconfdir} --with-libdir-name=%{_lib} \ --sbindir="/sbin" --libexecdir=%{udev_scriptdir} \ - --with-rootlibdir=/%{_lib} --enable-introspection + --with-rootlibdir=/%{_lib} --enable-introspection \ + --disable-rpath + make %{?_smp_mflags} %install @@ -221,6 +226,7 @@ if test -f /proc/1/exe -a -d /proc/1/root; then /sbin/udevadm control --start-exec-queue fi fi +/sbin/chkconfig --add udev-post exit 0 @@ -283,7 +289,7 @@ rm -rf $RPM_BUILD_ROOT %ghost %config(noreplace,missingok) %attr(0644,root,root) %{_sysconfdir}/scsi_id.config -%config %attr(0644,root,root) %{_sysconfdir}/modprobe.d/floppy-pnp.conf +%config(noreplace) %attr(0644,root,root) %{_sysconfdir}/modprobe.d/floppy-pnp.conf %dir %attr(0755,root,root) %{firmwaredir} %attr(0644,root,root) %{_mandir}/man8/udev*.8* @@ -305,7 +311,7 @@ rm -rf $RPM_BUILD_ROOT %attr(0755,root,root) %{udev_scriptdir}/udev-acl %attr(0755,root,root) %{udev_scriptdir}/v4l_id %attr(0755,root,root) %{udev_scriptdir}/findkeyboards -%attr(0755,root,root) %{udev_scriptdir}/keymaps/* +%attr(0644,root,root) %{udev_scriptdir}/keymaps/* %attr(0644,root,root) %{_prefix}/lib/ConsoleKit/run-session.d/udev-acl.ck @@ -325,19 +331,28 @@ rm -rf $RPM_BUILD_ROOT %files -n libgudev1 %defattr(0644, root, root, 0755) +%doc COPYING %attr(0755,root,root) %{_libdir}/libgudev-1.0.so.* %attr(0644,root,root) %{_libdir}/girepository-1.0/GUdev-1.0.typelib %files -n libgudev1-devel %defattr(0644, root, root, 0755) +%doc COPYING %attr(0755,root,root) %{_libdir}/libgudev-1.0.so %attr(0644,root,root) %{_includedir}/gudev-1.0/gudev/*.h %attr(0644,root,root) %{_datadir}/gir-1.0/GUdev-1.0.gir %dir %{_datadir}/gtk-doc/html/gudev %attr(0644,root,root) %{_datadir}/gtk-doc/html/gudev/* -%attr(0755,root,root) %{_libdir}/pkgconfig/gudev-1.0* +%attr(0644,root,root) %{_libdir}/pkgconfig/gudev-1.0* %changelog +* Fri Jul 24 2009 Harald Hoyer 145-2 +- fix file permissions +- remove rpath +- chkconfig --add for udev-post +- fix summaries +- add "Required-Stop" to udev-post + * Tue Jul 14 2009 Harald Hoyer 145-1 - version 145 - add "udevlog" kernel command line option to redirect the From f90281fa86d8be614c0180b5a870733b3c2905a9 Mon Sep 17 00:00:00 2001 From: Harald Hoyer Date: Wed, 29 Jul 2009 12:07:18 +0000 Subject: [PATCH 038/142] - add patch from upstream git to fix bug #514086 - add version to usbutils build requirement --- ...68245b98479a14190e1e1d32ef5fae3ddf8a.patch | 114 ++++++++++++++++++ udev.spec | 11 +- 2 files changed, 123 insertions(+), 2 deletions(-) create mode 100644 udev.git-3bf768245b98479a14190e1e1d32ef5fae3ddf8a.patch diff --git a/udev.git-3bf768245b98479a14190e1e1d32ef5fae3ddf8a.patch b/udev.git-3bf768245b98479a14190e1e1d32ef5fae3ddf8a.patch new file mode 100644 index 0000000..fbc9cef --- /dev/null +++ b/udev.git-3bf768245b98479a14190e1e1d32ef5fae3ddf8a.patch @@ -0,0 +1,114 @@ +From: Lennart Poettering +Date: Mon, 27 Jul 2009 21:24:27 +0000 (+0200) +Subject: enumeration: move ALSA control devices to the end of the enumerated devices of each ... +X-Git-Url: http://git.kernel.org/?p=linux%2Fhotplug%2Fudev.git;a=commitdiff_plain;h=3bf768245b98479a14190e1e1d32ef5fae3ddf8a + +enumeration: move ALSA control devices to the end of the enumerated devices of each card + +Generally ALSA control devices should be the last ones to be processed +for ACL changes and similar operations because they can then be used as +indicators that ACL management finished for all device nodes of a +specific card. + +This patch simple moves each controlC device behind all the pcmC devices +(and similar). +--- + +diff --git a/libudev/libudev-enumerate.c b/libudev/libudev-enumerate.c +index 96cf060..986c1fc 100644 +--- a/libudev/libudev-enumerate.c ++++ b/libudev/libudev-enumerate.c +@@ -190,7 +190,8 @@ static int syspath_cmp(const void *p1, const void *p2) + return ret; + } + +-static int devices_delay(struct udev *udev, const char *syspath) ++/* For devices that should be moved to the absolute end of the list */ ++static int devices_delay_end(struct udev *udev, const char *syspath) + { + static const char *delay_device_list[] = { + "/block/md", +@@ -210,6 +211,32 @@ static int devices_delay(struct udev *udev, const char *syspath) + return 0; + } + ++/* For devices that should just be moved a little bit later, just ++ * before the point where some common path prefix changes. Returns the ++ * number of characters that make up that common prefix */ ++static size_t devices_delay_later(struct udev *udev, const char *syspath) ++{ ++ const char *c; ++ ++ /* For sound cards the control device must be enumerated last ++ * to make sure it's the final device node that gets ACLs ++ * applied. Applications rely on this fact and use ACL changes ++ * on the control node as an indicator that the ACL change of ++ * the entire sound card completed. The kernel makes this ++ * guarantee when creating those devices, and hence we should ++ * too when enumerating them. */ ++ ++ if ((c = strstr(syspath, "/sound/card"))) { ++ c += 11; ++ c += strcspn(c, "/"); ++ ++ if (strncmp(c, "/controlC", 9) == 0) ++ return c - syspath + 1; ++ } ++ ++ return 0; ++} ++ + /** + * udev_enumerate_get_list_entry: + * @udev_enumerate: context +@@ -223,7 +250,8 @@ struct udev_list_entry *udev_enumerate_get_list_entry(struct udev_enumerate *ude + if (!udev_enumerate->devices_uptodate) { + unsigned int i; + unsigned int max; +- struct syspath *prev = NULL; ++ struct syspath *prev = NULL, *move_later = NULL; ++ size_t move_later_prefix; + + udev_list_cleanup_entries(udev_enumerate->udev, &udev_enumerate->devices_list); + qsort(udev_enumerate->devices, udev_enumerate->devices_cur, sizeof(struct syspath), syspath_cmp); +@@ -240,14 +268,39 @@ struct udev_list_entry *udev_enumerate_get_list_entry(struct udev_enumerate *ude + prev = entry; + + /* skip to be delayed devices, and add them to the end of the list */ +- if (devices_delay(udev_enumerate->udev, entry->syspath)) { ++ if (devices_delay_end(udev_enumerate->udev, entry->syspath)) { + syspath_add(udev_enumerate, entry->syspath); + continue; + } + ++ /* skip to be delayed devices, and move the to ++ * the point where the prefix changes. We can ++ * only move one item at a time. */ ++ if (!move_later) { ++ move_later_prefix = devices_delay_later(udev_enumerate->udev, entry->syspath); ++ ++ if (move_later_prefix > 0) { ++ move_later = entry; ++ continue; ++ } ++ } ++ ++ if (move_later && ++ strncmp(entry->syspath, move_later->syspath, move_later_prefix) != 0) { ++ ++ udev_list_entry_add(udev_enumerate->udev, &udev_enumerate->devices_list, ++ move_later->syspath, NULL, 0, 0); ++ move_later = NULL; ++ } ++ + udev_list_entry_add(udev_enumerate->udev, &udev_enumerate->devices_list, + entry->syspath, NULL, 0, 0); + } ++ ++ if (move_later) ++ udev_list_entry_add(udev_enumerate->udev, &udev_enumerate->devices_list, ++ move_later->syspath, NULL, 0, 0); ++ + /* add and cleanup delayed devices from end of list */ + for (i = max; i < udev_enumerate->devices_cur; i++) { + struct syspath *entry = &udev_enumerate->devices[i]; diff --git a/udev.spec b/udev.spec index adab3ba..72aac31 100644 --- a/udev.spec +++ b/udev.spec @@ -5,7 +5,7 @@ Summary: A userspace implementation of devfs Name: udev Version: 145 -Release: 2%{?dist} +Release: 3%{?dist} License: GPLv2 Group: System Environment/Base Provides: udev-persistent = %{version}-%{release} @@ -14,6 +14,8 @@ Obsoletes: udev-extras < 20090618 Provides: udev-extras = 20090618-1 Source: ftp://ftp.kernel.org/pub/linux/utils/kernel/hotplug/%{name}-%{version}.tar.bz2 +Patch1: udev.git-3bf768245b98479a14190e1e1d32ef5fae3ddf8a.patch + Source1: start_udev Source3: udev-post.init Source4: fw_unit_symlinks.sh @@ -35,7 +37,7 @@ BuildRequires: libxslt BuildRequires: hwdata BuildRequires: gobject-introspection-devel >= 0.6.2 BuildRequires: gtk-doc -BuildRequires: usbutils +BuildRequires: usbutils >= 0.82 BuildRequires: libtool >= 2.2.6 Requires: libselinux >= 0:1.17.9-2 sed @@ -95,6 +97,7 @@ glib-based applications using libudev functionality. %prep %setup -q +%patch1 -p1 %build # get rid of rpath @@ -346,6 +349,10 @@ rm -rf $RPM_BUILD_ROOT %attr(0644,root,root) %{_libdir}/pkgconfig/gudev-1.0* %changelog +* Wed Jul 29 2009 Harald Hoyer 145-3 +- add patch from upstream git to fix bug #514086 +- add version to usbutils build requirement + * Fri Jul 24 2009 Harald Hoyer 145-2 - fix file permissions - remove rpath From e87fdf7d4638e8551c74354275c1e29055a8215e Mon Sep 17 00:00:00 2001 From: Harald Hoyer Date: Tue, 4 Aug 2009 09:16:53 +0000 Subject: [PATCH 039/142] - --enable-debug - add patch for timestamps in debugging output --- ...c48f249012c673eb38f63dd8b5ee039627d0.patch | 67 +++++++++++++++++++ udev.spec | 10 ++- 2 files changed, 75 insertions(+), 2 deletions(-) create mode 100644 udev.git-820fc48f249012c673eb38f63dd8b5ee039627d0.patch diff --git a/udev.git-820fc48f249012c673eb38f63dd8b5ee039627d0.patch b/udev.git-820fc48f249012c673eb38f63dd8b5ee039627d0.patch new file mode 100644 index 0000000..7887df4 --- /dev/null +++ b/udev.git-820fc48f249012c673eb38f63dd8b5ee039627d0.patch @@ -0,0 +1,67 @@ +From: Kay Sievers +Date: Fri, 17 Jul 2009 11:24:37 +0000 (+0200) +Subject: udevd: add timestamp to --debug output +X-Git-Url: http://git.kernel.org/?p=linux%2Fhotplug%2Fudev.git;a=commitdiff_plain;h=820fc48f249012c673eb38f63dd8b5ee039627d0 + +udevd: add timestamp to --debug output +--- + +diff --git a/libudev/libudev-util-private.c b/libudev/libudev-util-private.c +index 5f5f4c1..f7daa94 100644 +--- a/libudev/libudev-util-private.c ++++ b/libudev/libudev-util-private.c +@@ -249,6 +249,8 @@ int util_run_program(struct udev *udev, const char *command, char **envp, + int i; + int err = 0; + ++ info(udev, "'%s' started\n", command); ++ + /* build argv from command */ + util_strscpy(arg, sizeof(arg), command); + i = 0; +@@ -273,7 +275,6 @@ int util_run_program(struct udev *udev, const char *command, char **envp, + argv[0] = arg; + argv[1] = NULL; + } +- info(udev, "'%s'\n", command); + + /* prepare pipes from child to parent */ + if (result != NULL || udev_get_log_priority(udev) >= LOG_INFO) { +diff --git a/udev/udevd.c b/udev/udevd.c +index 2cdc18b..69d509c 100644 +--- a/udev/udevd.c ++++ b/udev/udevd.c +@@ -31,6 +31,7 @@ + #include + #include + #include ++#include + #include + #include + #include +@@ -53,8 +54,15 @@ static void log_fn(struct udev *udev, int priority, + const char *format, va_list args) + { + if (debug) { +- fprintf(stderr, "[%d] %s: ", (int) getpid(), fn); +- vfprintf(stderr, format, args); ++ char buf[1024]; ++ struct timeval tv; ++ struct timezone tz; ++ ++ vsnprintf(buf, sizeof(buf), format, args); ++ gettimeofday(&tv, &tz); ++ fprintf(stderr, "%llu.%06u [%u] %s: %s", ++ (unsigned long long) tv.tv_sec, (unsigned int) tv.tv_usec, ++ (int) getpid(), fn, buf); + } else { + vsyslog(priority, format, args); + } +@@ -266,6 +274,7 @@ static void worker_new(struct event *event) + struct worker_message msg; + int err; + ++ info(event->udev, "seq %llu running\n", udev_device_get_seqnum(dev)); + udev_event = udev_event_new(dev); + if (udev_event == NULL) + _exit(3); diff --git a/udev.spec b/udev.spec index 72aac31..ef10922 100644 --- a/udev.spec +++ b/udev.spec @@ -5,7 +5,7 @@ Summary: A userspace implementation of devfs Name: udev Version: 145 -Release: 3%{?dist} +Release: 4%{?dist} License: GPLv2 Group: System Environment/Base Provides: udev-persistent = %{version}-%{release} @@ -15,6 +15,7 @@ Provides: udev-extras = 20090618-1 Source: ftp://ftp.kernel.org/pub/linux/utils/kernel/hotplug/%{name}-%{version}.tar.bz2 Patch1: udev.git-3bf768245b98479a14190e1e1d32ef5fae3ddf8a.patch +Patch2: udev.git-820fc48f249012c673eb38f63dd8b5ee039627d0.patch Source1: start_udev Source3: udev-post.init @@ -98,6 +99,7 @@ glib-based applications using libudev functionality. %prep %setup -q %patch1 -p1 +%patch2 -p1 %build # get rid of rpath @@ -106,7 +108,7 @@ libtoolize -f -c --sysconfdir=%{_sysconfdir} --with-libdir-name=%{_lib} \ --sbindir="/sbin" --libexecdir=%{udev_scriptdir} \ --with-rootlibdir=/%{_lib} --enable-introspection \ - --disable-rpath + --disable-rpath --enable-debug make %{?_smp_mflags} @@ -349,6 +351,10 @@ rm -rf $RPM_BUILD_ROOT %attr(0644,root,root) %{_libdir}/pkgconfig/gudev-1.0* %changelog +* Tue Aug 04 2009 Harald Hoyer 145-4 +- --enable-debug +- add patch for timestamps in debugging output + * Wed Jul 29 2009 Harald Hoyer 145-3 - add patch from upstream git to fix bug #514086 - add version to usbutils build requirement From 468c4865b8b738567b694f1c53e55125fb6d8e64 Mon Sep 17 00:00:00 2001 From: Harald Hoyer Date: Mon, 24 Aug 2009 13:03:47 +0000 Subject: [PATCH 040/142] - ifnarch s390 for usbutils Tue Aug 04 2009 Harald Hoyer 145-5 - do not make extra nodes in parallel - restorecon on /dev --- start_udev | 14 ++++++++------ udev.spec | 12 ++++++++++-- 2 files changed, 18 insertions(+), 8 deletions(-) diff --git a/start_udev b/start_udev index 9a11d65..dfa36a8 100755 --- a/start_udev +++ b/start_udev @@ -119,7 +119,9 @@ make_extra_nodes () { [ -c /dev/fuse ] || /bin/mknod -m 0666 /dev/fuse c 10 229 #/bin/chown root:root /dev/fuse - [ -x /sbin/restorecon ] && /sbin/restorecon /dev/loop0 /dev/loop1 /dev/loop2 /dev/loop3 /dev/loop4 /dev/loop5 /dev/loop6 /dev/loop7 /dev/net/tun /dev/ppp /dev/lp0 /dev/lp1 /dev/lp2 /dev/lp3 /dev/fuse + if [ -x /sbin/restorecon ]; then + /sbin/restorecon -R /dev + fi if [ -x "$MAKEDEV" ]; then for i in /etc/udev/makedev.d/*.nodes; do @@ -139,7 +141,7 @@ make_extra_nodes () { xargs_simple -n 100 $MAKEDEV -x -a -S ) \ > "$md5file" fi - . "$md5file" >/dev/null 2>&1 + . "$md5file" >$udev_root/null 2>&1 else ( sed -e 's,#.*,,g' "$i" | \ xargs_simple -n 100 $MAKEDEV -x ) @@ -245,7 +247,7 @@ LANG=C awk "\$2 == \"${udev_root%/}\" && \$3 == \"tmpfs\" { exit 1 }" /proc/moun ret=$[$ret + $?] } -make_extra_nodes & +make_extra_nodes cmdline=$(cat /proc/cmdline) kill_udevd > "$udev_root/null" 2>&1 rm -fr $udev_root/.udev > "$udev_root/null" 2>&1 @@ -272,13 +274,13 @@ if [ -f "/sys/class/tty/console/uevent" ]; then udevtimeout=$(getval udevtimeout $cmdline) if strstr "$cmdline" udevdebug; then - /sbin/udevadm control --log_priority=debug + /sbin/udevadm control --log-priority=debug fi if strstr "$cmdline" udevinfo; then - /sbin/udevadm control --log_priority=info + /sbin/udevadm control --log-priority=info fi if strstr "$cmdline" udevchilds; then - /sbin/udevadm control --max_childs_running=$(getval udevchilds $cmdline) + /sbin/udevadm control --max-childs=$(getval udevchilds $cmdline) fi /sbin/udevadm control --env=STARTUP=1 diff --git a/udev.spec b/udev.spec index ef10922..6600c20 100644 --- a/udev.spec +++ b/udev.spec @@ -5,7 +5,7 @@ Summary: A userspace implementation of devfs Name: udev Version: 145 -Release: 4%{?dist} +Release: 6%{?dist} License: GPLv2 Group: System Environment/Base Provides: udev-persistent = %{version}-%{release} @@ -38,9 +38,10 @@ BuildRequires: libxslt BuildRequires: hwdata BuildRequires: gobject-introspection-devel >= 0.6.2 BuildRequires: gtk-doc +%ifnarch s390 s390x BuildRequires: usbutils >= 0.82 +%endif BuildRequires: libtool >= 2.2.6 - Requires: libselinux >= 0:1.17.9-2 sed Conflicts: kernel < 0:2.6 mkinitrd <= 0:4.1.11-1 initscripts < 7.84 Requires: util-linux-ng >= 2.15.1 @@ -351,6 +352,13 @@ rm -rf $RPM_BUILD_ROOT %attr(0644,root,root) %{_libdir}/pkgconfig/gudev-1.0* %changelog +* Mon Aug 24 2009 Harald Hoyer 145-6 +- ifnarch s390 for usbutils + +* Tue Aug 04 2009 Harald Hoyer 145-5 +- do not make extra nodes in parallel +- restorecon on /dev + * Tue Aug 04 2009 Harald Hoyer 145-4 - --enable-debug - add patch for timestamps in debugging output From ad3d6b626003319909d6180437bd3af2e5998607 Mon Sep 17 00:00:00 2001 From: Karsten Hopp Date: Mon, 24 Aug 2009 15:19:15 +0000 Subject: [PATCH 041/142] - drop ifnarch s390x for usbutils, as we now have usbutils for s390x --- udev.spec | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/udev.spec b/udev.spec index 6600c20..cbb7cba 100644 --- a/udev.spec +++ b/udev.spec @@ -5,7 +5,7 @@ Summary: A userspace implementation of devfs Name: udev Version: 145 -Release: 6%{?dist} +Release: 7%{?dist} License: GPLv2 Group: System Environment/Base Provides: udev-persistent = %{version}-%{release} @@ -38,9 +38,7 @@ BuildRequires: libxslt BuildRequires: hwdata BuildRequires: gobject-introspection-devel >= 0.6.2 BuildRequires: gtk-doc -%ifnarch s390 s390x BuildRequires: usbutils >= 0.82 -%endif BuildRequires: libtool >= 2.2.6 Requires: libselinux >= 0:1.17.9-2 sed Conflicts: kernel < 0:2.6 mkinitrd <= 0:4.1.11-1 initscripts < 7.84 @@ -352,6 +350,9 @@ rm -rf $RPM_BUILD_ROOT %attr(0644,root,root) %{_libdir}/pkgconfig/gudev-1.0* %changelog +* Mon Aug 24 2009 Karsten Hopp 145-7 +- drop ifnarch s390x for usbutils, as we now have usbutils for s390x + * Mon Aug 24 2009 Harald Hoyer 145-6 - ifnarch s390 for usbutils From da9416e2a2614f0474c16f9ab468c5e101c116c1 Mon Sep 17 00:00:00 2001 From: Harald Hoyer Date: Wed, 23 Sep 2009 17:27:00 +0000 Subject: [PATCH 042/142] - obsolete libgudev and libgudev-devel (bug #523569) --- udev.spec | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/udev.spec b/udev.spec index cbb7cba..edafeb8 100644 --- a/udev.spec +++ b/udev.spec @@ -5,7 +5,7 @@ Summary: A userspace implementation of devfs Name: udev Version: 145 -Release: 7%{?dist} +Release: 8%{?dist} License: GPLv2 Group: System Environment/Base Provides: udev-persistent = %{version}-%{release} @@ -75,8 +75,8 @@ Summary: Libraries for adding libudev support to applications that use glib Group: Development/Libraries Requires: libudev >= 142 # remove the following lines for libgudev so major 1 -Provides: libgudev = 20090517 -Obsoletes: libgudev <= 20090516 +Provides: libgudev = 20090518 +Obsoletes: libgudev <= 20090517 %description -n libgudev1 This package contains the libraries that make it easier to use libudev @@ -86,8 +86,8 @@ functionality from applications that use glib. Summary: Header files for adding libudev support to applications that use glib Group: Development/Libraries Requires: libudev-devel >= 142 -Provides: libgudev-devel = 20090517 -Obsoletes: libgudev-devel <= 20090516 +Provides: libgudev-devel = 20090518 +Obsoletes: libgudev-devel <= 20090517 Requires: libgudev1 = %{version}-%{release} @@ -350,6 +350,9 @@ rm -rf $RPM_BUILD_ROOT %attr(0644,root,root) %{_libdir}/pkgconfig/gudev-1.0* %changelog +* Wed Sep 23 2009 harald@redhat.com 145-8 +- obsolete libgudev and libgudev-devel (bug #523569) + * Mon Aug 24 2009 Karsten Hopp 145-7 - drop ifnarch s390x for usbutils, as we now have usbutils for s390x From 38fd08cab960744760dc78b225c059e136f7b232 Mon Sep 17 00:00:00 2001 From: Harald Hoyer Date: Fri, 25 Sep 2009 17:05:23 +0000 Subject: [PATCH 043/142] - add patches to fix cdrom_id - add patch to fix the inotify bug (bug #524752) --- ...-ALSA-control-devices-to-the-end-of-.patch | 23 +++++---- ...-udevd-add-timestamp-to-debug-output.patch | 13 +++-- ...ong-parameter-size-on-ioctl-FIONREAD.patch | 49 +++++++++++++++++++ 0004-fix-single-session-CD-detection.patch | 38 ++++++++++++++ ...fix-previous-commit-for-CD-detection.patch | 26 ++++++++++ udev.spec | 17 +++++-- 6 files changed, 149 insertions(+), 17 deletions(-) rename udev.git-3bf768245b98479a14190e1e1d32ef5fae3ddf8a.patch => 0001-enumeration-move-ALSA-control-devices-to-the-end-of-.patch (84%) rename udev.git-820fc48f249012c673eb38f63dd8b5ee039627d0.patch => 0002-udevd-add-timestamp-to-debug-output.patch (84%) create mode 100644 0003-fix-wrong-parameter-size-on-ioctl-FIONREAD.patch create mode 100644 0004-fix-single-session-CD-detection.patch create mode 100644 0005-fix-previous-commit-for-CD-detection.patch diff --git a/udev.git-3bf768245b98479a14190e1e1d32ef5fae3ddf8a.patch b/0001-enumeration-move-ALSA-control-devices-to-the-end-of-.patch similarity index 84% rename from udev.git-3bf768245b98479a14190e1e1d32ef5fae3ddf8a.patch rename to 0001-enumeration-move-ALSA-control-devices-to-the-end-of-.patch index fbc9cef..b5261ff 100644 --- a/udev.git-3bf768245b98479a14190e1e1d32ef5fae3ddf8a.patch +++ b/0001-enumeration-move-ALSA-control-devices-to-the-end-of-.patch @@ -1,9 +1,7 @@ +From 1dc0ee343df6b6e2ce0591ff08a0aeae2aa2196f Mon Sep 17 00:00:00 2001 From: Lennart Poettering -Date: Mon, 27 Jul 2009 21:24:27 +0000 (+0200) -Subject: enumeration: move ALSA control devices to the end of the enumerated devices of each ... -X-Git-Url: http://git.kernel.org/?p=linux%2Fhotplug%2Fudev.git;a=commitdiff_plain;h=3bf768245b98479a14190e1e1d32ef5fae3ddf8a - -enumeration: move ALSA control devices to the end of the enumerated devices of each card +Date: Mon, 27 Jul 2009 23:24:27 +0200 +Subject: [PATCH 1/5] enumeration: move ALSA control devices to the end of the enumerated devices of each card Generally ALSA control devices should be the last ones to be processed for ACL changes and similar operations because they can then be used as @@ -13,12 +11,14 @@ specific card. This patch simple moves each controlC device behind all the pcmC devices (and similar). --- + libudev/libudev-enumerate.c | 59 ++++++++++++++++++++++++++++++++++++++++-- + 1 files changed, 56 insertions(+), 3 deletions(-) diff --git a/libudev/libudev-enumerate.c b/libudev/libudev-enumerate.c -index 96cf060..986c1fc 100644 +index db8c514..e372079 100644 --- a/libudev/libudev-enumerate.c +++ b/libudev/libudev-enumerate.c -@@ -190,7 +190,8 @@ static int syspath_cmp(const void *p1, const void *p2) +@@ -187,7 +187,8 @@ static int syspath_cmp(const void *p1, const void *p2) return ret; } @@ -28,7 +28,7 @@ index 96cf060..986c1fc 100644 { static const char *delay_device_list[] = { "/block/md", -@@ -210,6 +211,32 @@ static int devices_delay(struct udev *udev, const char *syspath) +@@ -207,6 +208,32 @@ static int devices_delay(struct udev *udev, const char *syspath) return 0; } @@ -61,7 +61,7 @@ index 96cf060..986c1fc 100644 /** * udev_enumerate_get_list_entry: * @udev_enumerate: context -@@ -223,7 +250,8 @@ struct udev_list_entry *udev_enumerate_get_list_entry(struct udev_enumerate *ude +@@ -220,7 +247,8 @@ struct udev_list_entry *udev_enumerate_get_list_entry(struct udev_enumerate *ude if (!udev_enumerate->devices_uptodate) { unsigned int i; unsigned int max; @@ -71,7 +71,7 @@ index 96cf060..986c1fc 100644 udev_list_cleanup_entries(udev_enumerate->udev, &udev_enumerate->devices_list); qsort(udev_enumerate->devices, udev_enumerate->devices_cur, sizeof(struct syspath), syspath_cmp); -@@ -240,14 +268,39 @@ struct udev_list_entry *udev_enumerate_get_list_entry(struct udev_enumerate *ude +@@ -237,14 +265,39 @@ struct udev_list_entry *udev_enumerate_get_list_entry(struct udev_enumerate *ude prev = entry; /* skip to be delayed devices, and add them to the end of the list */ @@ -112,3 +112,6 @@ index 96cf060..986c1fc 100644 /* add and cleanup delayed devices from end of list */ for (i = max; i < udev_enumerate->devices_cur; i++) { struct syspath *entry = &udev_enumerate->devices[i]; +-- +1.6.4.4 + diff --git a/udev.git-820fc48f249012c673eb38f63dd8b5ee039627d0.patch b/0002-udevd-add-timestamp-to-debug-output.patch similarity index 84% rename from udev.git-820fc48f249012c673eb38f63dd8b5ee039627d0.patch rename to 0002-udevd-add-timestamp-to-debug-output.patch index 7887df4..4deaff6 100644 --- a/udev.git-820fc48f249012c673eb38f63dd8b5ee039627d0.patch +++ b/0002-udevd-add-timestamp-to-debug-output.patch @@ -1,10 +1,12 @@ +From 4db7e84ad817944c624256b310d44bd888121c8e Mon Sep 17 00:00:00 2001 From: Kay Sievers -Date: Fri, 17 Jul 2009 11:24:37 +0000 (+0200) -Subject: udevd: add timestamp to --debug output -X-Git-Url: http://git.kernel.org/?p=linux%2Fhotplug%2Fudev.git;a=commitdiff_plain;h=820fc48f249012c673eb38f63dd8b5ee039627d0 +Date: Fri, 17 Jul 2009 13:24:37 +0200 +Subject: [PATCH 2/5] udevd: add timestamp to --debug output -udevd: add timestamp to --debug output --- + libudev/libudev-util-private.c | 3 ++- + udev/udevd.c | 13 +++++++++++-- + 2 files changed, 13 insertions(+), 3 deletions(-) diff --git a/libudev/libudev-util-private.c b/libudev/libudev-util-private.c index 5f5f4c1..f7daa94 100644 @@ -65,3 +67,6 @@ index 2cdc18b..69d509c 100644 udev_event = udev_event_new(dev); if (udev_event == NULL) _exit(3); +-- +1.6.4.4 + diff --git a/0003-fix-wrong-parameter-size-on-ioctl-FIONREAD.patch b/0003-fix-wrong-parameter-size-on-ioctl-FIONREAD.patch new file mode 100644 index 0000000..c7bbca8 --- /dev/null +++ b/0003-fix-wrong-parameter-size-on-ioctl-FIONREAD.patch @@ -0,0 +1,49 @@ +From 7766066b221302d75002cd5d5a021281388ee56c Mon Sep 17 00:00:00 2001 +From: Andrew Church +Date: Thu, 24 Sep 2009 10:51:12 -0700 +Subject: [PATCH 3/5] fix wrong parameter size on ioctl FIONREAD + +On Wed, Sep 23, 2009 at 23:11, Matthias Schwarzott wrote: +> It is about ioctl failures on amd64: +> http://bugs.gentoo.org/show_bug.cgi?id=286041 +> +> A bad parameter type to an ioctl() call causes udev-146 to generate "error +> getting buffer for inotify" messages in syslog. The offending code is +> roughly: +> +> ssize_t nbytes, pos; +> // ... +> ioctl(fd, FIONREAD, &nbytes); +> +> where ssize_t is 64 bits on amd64, but the kernel code for FIONREAD (at least +> through gentoo-sources-2.6.31) uses type int: +> +> p = (void __user *) arg; +> switch (cmd) { +> case FIONREAD: +> // ... +> ret = put_user(send_len, (int __user *) p); +> +> so the upper 32 bits of "nbytes" are left uninitialized, and the subsequent +> malloc(nbytes) fails unless those 32 bits happen to be zero (or the system has +> a LOT of memory). +--- + udev/udevd.c | 2 +- + 1 files changed, 1 insertions(+), 1 deletions(-) + +diff --git a/udev/udevd.c b/udev/udevd.c +index 69d509c..511cb4b 100644 +--- a/udev/udevd.c ++++ b/udev/udevd.c +@@ -656,7 +656,7 @@ static void handle_ctrl_msg(struct udev_ctrl *uctrl) + /* read inotify messages */ + static int handle_inotify(struct udev *udev) + { +- ssize_t nbytes, pos; ++ int nbytes, pos; + char *buf; + struct inotify_event *ev; + +-- +1.6.4.4 + diff --git a/0004-fix-single-session-CD-detection.patch b/0004-fix-single-session-CD-detection.patch new file mode 100644 index 0000000..6c933a6 --- /dev/null +++ b/0004-fix-single-session-CD-detection.patch @@ -0,0 +1,38 @@ +From 36b35c884fc06bc2babf0ec840cb423b94a45f93 Mon Sep 17 00:00:00 2001 +From: Martin Pitt +Date: Sun, 20 Sep 2009 19:07:51 +0200 +Subject: [PATCH 4/5] fix single-session CD detection + +ID_CDROM_MEDIA_SESSION_LAST_OFFSET is not set for CDs with only a single +session (i. e. for the vast majority of CDs out there). The previous rules ran +blkid with invalid arguments for these, causing CD detection to fail in +DK-disks and gvfs. + +Now check whether we actually have ID_CDROM_MEDIA_SESSION_LAST_OFFSET, and if +not, call blkid without -O for specifying the offset. + +Many thanks to Maxim Levitsky for tracking this down! + +https://launchpad.net/bugs/431055 +--- + rules/rules.d/60-persistent-storage.rules | 4 +++- + 1 files changed, 3 insertions(+), 1 deletions(-) + +diff --git a/rules/rules.d/60-persistent-storage.rules b/rules/rules.d/60-persistent-storage.rules +index 64e9578..1b85156 100644 +--- a/rules/rules.d/60-persistent-storage.rules ++++ b/rules/rules.d/60-persistent-storage.rules +@@ -61,7 +61,9 @@ ENV{DEVTYPE}=="partition", ENV{ID_PATH}=="?*", SYMLINK+="disk/by-path/$env{ID_PA + ENV{DEVTYPE}=="disk", KERNEL!="sd*|sr*", ATTR{removable}=="1", GOTO="persistent_storage_end" + + # probe filesystem metadata of optical drives which have a media inserted +-KERNEL=="sr*", ENV{ID_CDROM_MEDIA}=="?*", IMPORT{program}="/sbin/blkid -o udev -p -u noraid -O $env{ID_CDROM_MEDIA_SESSION_LAST_OFFSET} $tempnode" ++KERNEL=="sr*", ENV{ID_CDROM_MEDIA}=="?*", ENV{ID_CDROM_MEDIA_SESSION_LAST_OFFSET}=="?*", IMPORT{program}="/sbin/blkid -o udev -p -u noraid -O $env{ID_CDROM_MEDIA_SESSION_LAST_OFFSET} $tempnode" ++# single-session CDs do not have ID_CDROM_MEDIA_SESSION_LAST_OFFSET ++KERNEL=="sr*", ENV{ID_CDROM_MEDIA}=="?*", IMPORT{program}="/sbin/blkid -o udev -p -u noraid $tempnode" + + # probe filesystem metadata of disks + KERNEL!="sr*", IMPORT{program}="/sbin/blkid -o udev -p $tempnode" +-- +1.6.4.4 + diff --git a/0005-fix-previous-commit-for-CD-detection.patch b/0005-fix-previous-commit-for-CD-detection.patch new file mode 100644 index 0000000..4b4eee4 --- /dev/null +++ b/0005-fix-previous-commit-for-CD-detection.patch @@ -0,0 +1,26 @@ +From a09ac6a6ae39512fafe9df331a311113d2a1d9f6 Mon Sep 17 00:00:00 2001 +From: Martin Pitt +Date: Sun, 20 Sep 2009 19:21:04 +0200 +Subject: [PATCH 5/5] fix previous commit for CD detection + +Do not run blkid twice. *brown paperbag* +--- + rules/rules.d/60-persistent-storage.rules | 2 +- + 1 files changed, 1 insertions(+), 1 deletions(-) + +diff --git a/rules/rules.d/60-persistent-storage.rules b/rules/rules.d/60-persistent-storage.rules +index 1b85156..0950847 100644 +--- a/rules/rules.d/60-persistent-storage.rules ++++ b/rules/rules.d/60-persistent-storage.rules +@@ -63,7 +63,7 @@ ENV{DEVTYPE}=="disk", KERNEL!="sd*|sr*", ATTR{removable}=="1", GOTO="persistent_ + # probe filesystem metadata of optical drives which have a media inserted + KERNEL=="sr*", ENV{ID_CDROM_MEDIA}=="?*", ENV{ID_CDROM_MEDIA_SESSION_LAST_OFFSET}=="?*", IMPORT{program}="/sbin/blkid -o udev -p -u noraid -O $env{ID_CDROM_MEDIA_SESSION_LAST_OFFSET} $tempnode" + # single-session CDs do not have ID_CDROM_MEDIA_SESSION_LAST_OFFSET +-KERNEL=="sr*", ENV{ID_CDROM_MEDIA}=="?*", IMPORT{program}="/sbin/blkid -o udev -p -u noraid $tempnode" ++KERNEL=="sr*", ENV{ID_CDROM_MEDIA}=="?*", ENV{ID_CDROM_MEDIA_SESSION_LAST_OFFSET}=="", IMPORT{program}="/sbin/blkid -o udev -p -u noraid $tempnode" + + # probe filesystem metadata of disks + KERNEL!="sr*", IMPORT{program}="/sbin/blkid -o udev -p $tempnode" +-- +1.6.4.4 + diff --git a/udev.spec b/udev.spec index edafeb8..f3ea6ff 100644 --- a/udev.spec +++ b/udev.spec @@ -5,7 +5,7 @@ Summary: A userspace implementation of devfs Name: udev Version: 145 -Release: 8%{?dist} +Release: 9%{?dist} License: GPLv2 Group: System Environment/Base Provides: udev-persistent = %{version}-%{release} @@ -14,8 +14,12 @@ Obsoletes: udev-extras < 20090618 Provides: udev-extras = 20090618-1 Source: ftp://ftp.kernel.org/pub/linux/utils/kernel/hotplug/%{name}-%{version}.tar.bz2 -Patch1: udev.git-3bf768245b98479a14190e1e1d32ef5fae3ddf8a.patch -Patch2: udev.git-820fc48f249012c673eb38f63dd8b5ee039627d0.patch +Patch1: 0001-enumeration-move-ALSA-control-devices-to-the-end-of-.patch +Patch2: 0002-udevd-add-timestamp-to-debug-output.patch +Patch3: 0003-fix-wrong-parameter-size-on-ioctl-FIONREAD.patch +Patch4: 0004-fix-single-session-CD-detection.patch +Patch5: 0005-fix-previous-commit-for-CD-detection.patch + Source1: start_udev Source3: udev-post.init @@ -99,6 +103,9 @@ glib-based applications using libudev functionality. %setup -q %patch1 -p1 %patch2 -p1 +%patch3 -p1 +%patch4 -p1 +%patch5 -p1 %build # get rid of rpath @@ -350,6 +357,10 @@ rm -rf $RPM_BUILD_ROOT %attr(0644,root,root) %{_libdir}/pkgconfig/gudev-1.0* %changelog +* Fri Sep 25 2009 harald@redhat.com 145-9 +- add patches to fix cdrom_id +- add patch to fix the inotify bug (bug #524752) + * Wed Sep 23 2009 harald@redhat.com 145-8 - obsolete libgudev and libgudev-devel (bug #523569) From 401942f50d323fcad9ed8fc880802193b9e8c8ed Mon Sep 17 00:00:00 2001 From: Harald Hoyer Date: Tue, 29 Sep 2009 13:09:11 +0000 Subject: [PATCH 044/142] - add ConsoleKit patch for ConsoleKit 0.4.1 --- ck-runseat.patch | 295 +++++++++++++++++++++++++++++++++++++++++++++++ udev.spec | 10 +- 2 files changed, 302 insertions(+), 3 deletions(-) create mode 100644 ck-runseat.patch diff --git a/ck-runseat.patch b/ck-runseat.patch new file mode 100644 index 0000000..8804bc7 --- /dev/null +++ b/ck-runseat.patch @@ -0,0 +1,295 @@ +--- udev-145/extras/udev-acl/Makefile.am.runseat 2009-06-16 19:47:37.000000000 -0400 ++++ udev-145/extras/udev-acl/Makefile.am 2009-09-25 20:21:41.959583372 -0400 +@@ -15,5 +15,5 @@ udev_acl_LDADD = \ + dist_udevrules_DATA = 70-acl.rules + + install-exec-hook: +- mkdir -p $(DESTDIR)$(prefix)/lib/ConsoleKit/run-session.d +- ln -sf $(libexecdir)/udev-acl $(DESTDIR)$(prefix)/lib/ConsoleKit/run-session.d/udev-acl.ck ++ mkdir -p $(DESTDIR)$(prefix)/lib/ConsoleKit/run-seat.d ++ ln -sf $(libexecdir)/udev-acl $(DESTDIR)$(prefix)/lib/ConsoleKit/run-seat.d/udev-acl.ck +--- udev-145/extras/udev-acl/udev-acl.c.runseat 2009-06-16 12:10:58.000000000 -0400 ++++ udev-145/extras/udev-acl/udev-acl.c 2009-09-25 20:57:32.502573825 -0400 +@@ -1,4 +1,5 @@ +-/* ++/* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- ++ * + * Copyright (C) 2009 Kay Sievers + * + * This program is free software; you can redistribute it and/or +@@ -29,6 +30,13 @@ + + static int debug; + ++enum{ ++ ACTION_NONE = 0, ++ ACTION_REMOVE, ++ ACTION_ADD, ++ ACTION_CHANGE ++}; ++ + static int set_facl(const char* filename, uid_t uid, int add) + { + int get; +@@ -152,44 +160,123 @@ static GSList *uids_with_local_active_se + } + + /* ConsoleKit calls us with special variables */ +-static int consolekit_called(const char *action, uid_t *uid, const char **own_session, int *add) ++static int consolekit_called(const char *ck_action, uid_t *uid, uid_t *uid2, const char **remove_session_id, int *action) + { +- int a; +- uid_t u; ++ int a = ACTION_NONE; ++ uid_t u = 0; ++ uid_t u2 = 0; + const char *s; +- const char *session; +- +- if (action == NULL || strcmp(action, "session_active_changed") != 0) +- return -1; ++ const char *s2; ++ const char *old_session = NULL; + +- s = getenv("CK_SESSION_IS_LOCAL"); +- if (s == NULL) ++ if (ck_action == NULL || strcmp(ck_action, "seat_active_session_changed") != 0) + return -1; +- if (strcmp(s, "true") != 0) +- return 0; + +- s = getenv("CK_SESSION_IS_ACTIVE"); +- if (s == NULL) ++ /* We can have one of: remove, add, change, no-change */ ++ s = getenv("CK_SEAT_OLD_SESSION_ID"); ++ s2 = getenv("CK_SEAT_SESSION_ID"); ++ if (s == NULL && s2 == NULL) { + return -1; +- if (strcmp(s, "true") == 0) +- a = 1; +- else +- a = 0; ++ } else if (s2 == NULL) { ++ a = ACTION_REMOVE; ++ } else if (s == NULL) { ++ a = ACTION_ADD; ++ } else { ++ a = ACTION_CHANGE; ++ } + +- session = getenv("CK_SESSION_ID"); +- if (session == NULL) +- return -1; ++ switch (a) { ++ case ACTION_ADD: ++ s = getenv("CK_SEAT_SESSION_USER_UID"); ++ if (s == NULL) ++ return -1; ++ u = strtoul(s, NULL, 10); ++ if (u == 0) ++ return 0; ++ ++ s = getenv("CK_SEAT_SESSION_IS_LOCAL"); ++ if (s == NULL) ++ return -1; ++ if (strcmp(s, "true") != 0) ++ return 0; ++ ++ break; ++ case ACTION_REMOVE: ++ s = getenv("CK_SEAT_OLD_SESSION_USER_UID"); ++ if (s == NULL) ++ return -1; ++ u = strtoul(s, NULL, 10); ++ if (u == 0) ++ return 0; ++ ++ s = getenv("CK_SEAT_OLD_SESSION_IS_LOCAL"); ++ if (s == NULL) ++ return -1; ++ if (strcmp(s, "true") != 0) ++ return 0; ++ ++ old_session = getenv("CK_SEAT_OLD_SESSION_ID"); ++ if (old_session == NULL) ++ return -1; ++ ++ break; ++ case ACTION_CHANGE: ++ s = getenv("CK_SEAT_OLD_SESSION_USER_UID"); ++ if (s == NULL) ++ return -1; ++ u = strtoul(s, NULL, 10); ++ if (u == 0) ++ return 0; ++ s = getenv("CK_SEAT_SESSION_USER_UID"); ++ if (s == NULL) ++ return -1; ++ u2 = strtoul(s, NULL, 10); ++ if (u2 == 0) ++ return 0; ++ ++ s = getenv("CK_SEAT_OLD_SESSION_IS_LOCAL"); ++ s2 = getenv("CK_SEAT_SESSION_IS_LOCAL"); ++ if (s == NULL || s2 == NULL) ++ return -1; ++ /* don't process non-local session changes */ ++ if (strcmp(s, "true") != 0 && strcmp(s2, "true") != 0) ++ return 0; ++ ++ if (strcmp(s, "true") == 0 && strcmp(s, "true") == 0) { ++ /* process the change */ ++ if (u == u2) { ++ /* special case: we noop if we are ++ * changing between local sessions for ++ * the same uid */ ++ a = ACTION_NONE; ++ } ++ old_session = getenv("CK_SEAT_OLD_SESSION_ID"); ++ if (old_session == NULL) ++ return -1; ++ } else if (strcmp(s, "true") == 0) { ++ /* only process the removal */ ++ a = ACTION_REMOVE; ++ old_session = getenv("CK_SEAT_OLD_SESSION_ID"); ++ if (old_session == NULL) ++ return -1; ++ } else if (strcmp(s2, "true") == 0) { ++ /* only process the addition */ ++ a = ACTION_ADD; ++ u = u2; ++ } + +- s = getenv("CK_SESSION_USER_UID"); +- if (s == NULL) +- return -1; +- u = strtoul(s, NULL, 10); +- if (u == 0) +- return 0; ++ break; ++ case ACTION_NONE: ++ break; ++ default: ++ g_assert_not_reached (); ++ break; ++ } + +- *own_session = session; ++ *remove_session_id = old_session; + *uid = u; +- *add = a; ++ *uid2 = u2; ++ *action = a; + return 0; + } + +@@ -223,6 +310,21 @@ static void apply_acl_to_devices(uid_t u + udev_unref(udev); + } + ++static void ++remove_uid (uid_t uid, const char *remove_session_id) ++{ ++ /* ++ * Remove ACL for given uid from all matching devices ++ * when there is currently no local active session. ++ */ ++ GSList *list; ++ ++ list = uids_with_local_active_session(remove_session_id); ++ if (!uid_in_list(list, uid)) ++ apply_acl_to_devices(uid, 0); ++ g_slist_free(list); ++} ++ + int main (int argc, char* argv[]) + { + static const struct option options[] = { +@@ -233,10 +335,11 @@ int main (int argc, char* argv[]) + { "help", no_argument, NULL, 'h' }, + {} + }; +- int add = -1; ++ int action = -1; + const char *device = NULL; + uid_t uid = 0; +- const char* own_session = NULL; ++ uid_t uid2 = 0; ++ const char* remove_session_id = NULL; + int rc = 0; + + /* valgrind is more important to us than a slice allocator */ +@@ -252,9 +355,9 @@ int main (int argc, char* argv[]) + switch (option) { + case 'a': + if (strcmp(optarg, "add") == 0 || strcmp(optarg, "change") == 0) +- add = 1; ++ action = ACTION_ADD; + else if (strcmp(optarg, "remove") == 0) +- add = 0; ++ action = ACTION_REMOVE; + else + goto out; + break; +@@ -274,10 +377,10 @@ int main (int argc, char* argv[]) + } + } + +- if (add < 0 && device == NULL && uid == 0) +- consolekit_called(argv[optind], &uid, &own_session, &add); ++ if (action < 0 && device == NULL && uid == 0) ++ consolekit_called(argv[optind], &uid, &uid2, &remove_session_id, &action); + +- if (add < 0) { ++ if (action < 0) { + fprintf(stderr, "missing action\n\n"); + rc = 2; + goto out; +@@ -290,20 +393,24 @@ int main (int argc, char* argv[]) + } + + if (uid != 0) { +- if (add) { ++ switch (action) { ++ case ACTION_ADD: + /* Add ACL for given uid to all matching devices. */ + apply_acl_to_devices(uid, 1); +- } else { +- /* +- * Remove ACL for given uid from all matching devices +- * when there is currently no local active session. +- */ +- GSList *list; +- +- list = uids_with_local_active_session(own_session); +- if (!uid_in_list(list, uid)) +- apply_acl_to_devices(uid, 0); +- g_slist_free(list); ++ break; ++ case ACTION_REMOVE: ++ remove_uid(uid, remove_session_id); ++ break; ++ case ACTION_CHANGE: ++ remove_uid(uid, remove_session_id); ++ apply_acl_to_devices(uid2, 1); ++ break; ++ case ACTION_NONE: ++ goto out; ++ break; ++ default: ++ g_assert_not_reached(); ++ break; + } + } else if (device != NULL) { + /* +@@ -321,8 +428,8 @@ int main (int argc, char* argv[]) + uid_t u; + + u = GPOINTER_TO_UINT(l->data); +- if (add || !uid_in_list(list, u)) +- set_facl(device, u, add); ++ if (action == ACTION_ADD || !uid_in_list(list, u)) ++ set_facl(device, u, action == ACTION_ADD); + } + g_slist_free(list); + } else { diff --git a/udev.spec b/udev.spec index f3ea6ff..210eaf0 100644 --- a/udev.spec +++ b/udev.spec @@ -5,7 +5,7 @@ Summary: A userspace implementation of devfs Name: udev Version: 145 -Release: 9%{?dist} +Release: 10%{?dist} License: GPLv2 Group: System Environment/Base Provides: udev-persistent = %{version}-%{release} @@ -19,7 +19,7 @@ Patch2: 0002-udevd-add-timestamp-to-debug-output.patch Patch3: 0003-fix-wrong-parameter-size-on-ioctl-FIONREAD.patch Patch4: 0004-fix-single-session-CD-detection.patch Patch5: 0005-fix-previous-commit-for-CD-detection.patch - +Patch6: ck-runseat.patch Source1: start_udev Source3: udev-post.init @@ -106,6 +106,7 @@ glib-based applications using libudev functionality. %patch3 -p1 %patch4 -p1 %patch5 -p1 +%patch6 -p1 -b .ck041 %build # get rid of rpath @@ -323,7 +324,7 @@ rm -rf $RPM_BUILD_ROOT %attr(0755,root,root) %{udev_scriptdir}/v4l_id %attr(0755,root,root) %{udev_scriptdir}/findkeyboards %attr(0644,root,root) %{udev_scriptdir}/keymaps/* -%attr(0644,root,root) %{_prefix}/lib/ConsoleKit/run-session.d/udev-acl.ck +%attr(0644,root,root) %{_prefix}/lib/ConsoleKit/run-seat.d/udev-acl.ck %files -n libudev @@ -357,6 +358,9 @@ rm -rf $RPM_BUILD_ROOT %attr(0644,root,root) %{_libdir}/pkgconfig/gudev-1.0* %changelog +* Tue Sep 29 2009 Harald Hoyer 145-10 +- add ConsoleKit patch for ConsoleKit 0.4.1 + * Fri Sep 25 2009 harald@redhat.com 145-9 - add patches to fix cdrom_id - add patch to fix the inotify bug (bug #524752) From 4152795a09838c44a944d267c7041e2e7aec6eea Mon Sep 17 00:00:00 2001 From: Harald Hoyer Date: Fri, 9 Oct 2009 10:48:57 +0000 Subject: [PATCH 045/142] - pre 147 - database format changed - lots of potential buffer overflow fixes --- .cvsignore | 2 +- ...-ALSA-control-devices-to-the-end-of-.patch | 117 ------- ...-udevd-add-timestamp-to-debug-output.patch | 72 ----- ...ong-parameter-size-on-ioctl-FIONREAD.patch | 49 --- 0004-fix-single-session-CD-detection.patch | 38 --- ...fix-previous-commit-for-CD-detection.patch | 26 -- ck-runseat.patch | 295 ------------------ sources | 2 +- udev.spec | 28 +- 9 files changed, 12 insertions(+), 617 deletions(-) delete mode 100644 0001-enumeration-move-ALSA-control-devices-to-the-end-of-.patch delete mode 100644 0002-udevd-add-timestamp-to-debug-output.patch delete mode 100644 0003-fix-wrong-parameter-size-on-ioctl-FIONREAD.patch delete mode 100644 0004-fix-single-session-CD-detection.patch delete mode 100644 0005-fix-previous-commit-for-CD-detection.patch delete mode 100644 ck-runseat.patch diff --git a/.cvsignore b/.cvsignore index 287b708..513dfdb 100644 --- a/.cvsignore +++ b/.cvsignore @@ -1 +1 @@ -udev-145.tar.bz2 +udev-147-0.gitdf3e07d.tar.bz2 diff --git a/0001-enumeration-move-ALSA-control-devices-to-the-end-of-.patch b/0001-enumeration-move-ALSA-control-devices-to-the-end-of-.patch deleted file mode 100644 index b5261ff..0000000 --- a/0001-enumeration-move-ALSA-control-devices-to-the-end-of-.patch +++ /dev/null @@ -1,117 +0,0 @@ -From 1dc0ee343df6b6e2ce0591ff08a0aeae2aa2196f Mon Sep 17 00:00:00 2001 -From: Lennart Poettering -Date: Mon, 27 Jul 2009 23:24:27 +0200 -Subject: [PATCH 1/5] enumeration: move ALSA control devices to the end of the enumerated devices of each card - -Generally ALSA control devices should be the last ones to be processed -for ACL changes and similar operations because they can then be used as -indicators that ACL management finished for all device nodes of a -specific card. - -This patch simple moves each controlC device behind all the pcmC devices -(and similar). ---- - libudev/libudev-enumerate.c | 59 ++++++++++++++++++++++++++++++++++++++++-- - 1 files changed, 56 insertions(+), 3 deletions(-) - -diff --git a/libudev/libudev-enumerate.c b/libudev/libudev-enumerate.c -index db8c514..e372079 100644 ---- a/libudev/libudev-enumerate.c -+++ b/libudev/libudev-enumerate.c -@@ -187,7 +187,8 @@ static int syspath_cmp(const void *p1, const void *p2) - return ret; - } - --static int devices_delay(struct udev *udev, const char *syspath) -+/* For devices that should be moved to the absolute end of the list */ -+static int devices_delay_end(struct udev *udev, const char *syspath) - { - static const char *delay_device_list[] = { - "/block/md", -@@ -207,6 +208,32 @@ static int devices_delay(struct udev *udev, const char *syspath) - return 0; - } - -+/* For devices that should just be moved a little bit later, just -+ * before the point where some common path prefix changes. Returns the -+ * number of characters that make up that common prefix */ -+static size_t devices_delay_later(struct udev *udev, const char *syspath) -+{ -+ const char *c; -+ -+ /* For sound cards the control device must be enumerated last -+ * to make sure it's the final device node that gets ACLs -+ * applied. Applications rely on this fact and use ACL changes -+ * on the control node as an indicator that the ACL change of -+ * the entire sound card completed. The kernel makes this -+ * guarantee when creating those devices, and hence we should -+ * too when enumerating them. */ -+ -+ if ((c = strstr(syspath, "/sound/card"))) { -+ c += 11; -+ c += strcspn(c, "/"); -+ -+ if (strncmp(c, "/controlC", 9) == 0) -+ return c - syspath + 1; -+ } -+ -+ return 0; -+} -+ - /** - * udev_enumerate_get_list_entry: - * @udev_enumerate: context -@@ -220,7 +247,8 @@ struct udev_list_entry *udev_enumerate_get_list_entry(struct udev_enumerate *ude - if (!udev_enumerate->devices_uptodate) { - unsigned int i; - unsigned int max; -- struct syspath *prev = NULL; -+ struct syspath *prev = NULL, *move_later = NULL; -+ size_t move_later_prefix; - - udev_list_cleanup_entries(udev_enumerate->udev, &udev_enumerate->devices_list); - qsort(udev_enumerate->devices, udev_enumerate->devices_cur, sizeof(struct syspath), syspath_cmp); -@@ -237,14 +265,39 @@ struct udev_list_entry *udev_enumerate_get_list_entry(struct udev_enumerate *ude - prev = entry; - - /* skip to be delayed devices, and add them to the end of the list */ -- if (devices_delay(udev_enumerate->udev, entry->syspath)) { -+ if (devices_delay_end(udev_enumerate->udev, entry->syspath)) { - syspath_add(udev_enumerate, entry->syspath); - continue; - } - -+ /* skip to be delayed devices, and move the to -+ * the point where the prefix changes. We can -+ * only move one item at a time. */ -+ if (!move_later) { -+ move_later_prefix = devices_delay_later(udev_enumerate->udev, entry->syspath); -+ -+ if (move_later_prefix > 0) { -+ move_later = entry; -+ continue; -+ } -+ } -+ -+ if (move_later && -+ strncmp(entry->syspath, move_later->syspath, move_later_prefix) != 0) { -+ -+ udev_list_entry_add(udev_enumerate->udev, &udev_enumerate->devices_list, -+ move_later->syspath, NULL, 0, 0); -+ move_later = NULL; -+ } -+ - udev_list_entry_add(udev_enumerate->udev, &udev_enumerate->devices_list, - entry->syspath, NULL, 0, 0); - } -+ -+ if (move_later) -+ udev_list_entry_add(udev_enumerate->udev, &udev_enumerate->devices_list, -+ move_later->syspath, NULL, 0, 0); -+ - /* add and cleanup delayed devices from end of list */ - for (i = max; i < udev_enumerate->devices_cur; i++) { - struct syspath *entry = &udev_enumerate->devices[i]; --- -1.6.4.4 - diff --git a/0002-udevd-add-timestamp-to-debug-output.patch b/0002-udevd-add-timestamp-to-debug-output.patch deleted file mode 100644 index 4deaff6..0000000 --- a/0002-udevd-add-timestamp-to-debug-output.patch +++ /dev/null @@ -1,72 +0,0 @@ -From 4db7e84ad817944c624256b310d44bd888121c8e Mon Sep 17 00:00:00 2001 -From: Kay Sievers -Date: Fri, 17 Jul 2009 13:24:37 +0200 -Subject: [PATCH 2/5] udevd: add timestamp to --debug output - ---- - libudev/libudev-util-private.c | 3 ++- - udev/udevd.c | 13 +++++++++++-- - 2 files changed, 13 insertions(+), 3 deletions(-) - -diff --git a/libudev/libudev-util-private.c b/libudev/libudev-util-private.c -index 5f5f4c1..f7daa94 100644 ---- a/libudev/libudev-util-private.c -+++ b/libudev/libudev-util-private.c -@@ -249,6 +249,8 @@ int util_run_program(struct udev *udev, const char *command, char **envp, - int i; - int err = 0; - -+ info(udev, "'%s' started\n", command); -+ - /* build argv from command */ - util_strscpy(arg, sizeof(arg), command); - i = 0; -@@ -273,7 +275,6 @@ int util_run_program(struct udev *udev, const char *command, char **envp, - argv[0] = arg; - argv[1] = NULL; - } -- info(udev, "'%s'\n", command); - - /* prepare pipes from child to parent */ - if (result != NULL || udev_get_log_priority(udev) >= LOG_INFO) { -diff --git a/udev/udevd.c b/udev/udevd.c -index 2cdc18b..69d509c 100644 ---- a/udev/udevd.c -+++ b/udev/udevd.c -@@ -31,6 +31,7 @@ - #include - #include - #include -+#include - #include - #include - #include -@@ -53,8 +54,15 @@ static void log_fn(struct udev *udev, int priority, - const char *format, va_list args) - { - if (debug) { -- fprintf(stderr, "[%d] %s: ", (int) getpid(), fn); -- vfprintf(stderr, format, args); -+ char buf[1024]; -+ struct timeval tv; -+ struct timezone tz; -+ -+ vsnprintf(buf, sizeof(buf), format, args); -+ gettimeofday(&tv, &tz); -+ fprintf(stderr, "%llu.%06u [%u] %s: %s", -+ (unsigned long long) tv.tv_sec, (unsigned int) tv.tv_usec, -+ (int) getpid(), fn, buf); - } else { - vsyslog(priority, format, args); - } -@@ -266,6 +274,7 @@ static void worker_new(struct event *event) - struct worker_message msg; - int err; - -+ info(event->udev, "seq %llu running\n", udev_device_get_seqnum(dev)); - udev_event = udev_event_new(dev); - if (udev_event == NULL) - _exit(3); --- -1.6.4.4 - diff --git a/0003-fix-wrong-parameter-size-on-ioctl-FIONREAD.patch b/0003-fix-wrong-parameter-size-on-ioctl-FIONREAD.patch deleted file mode 100644 index c7bbca8..0000000 --- a/0003-fix-wrong-parameter-size-on-ioctl-FIONREAD.patch +++ /dev/null @@ -1,49 +0,0 @@ -From 7766066b221302d75002cd5d5a021281388ee56c Mon Sep 17 00:00:00 2001 -From: Andrew Church -Date: Thu, 24 Sep 2009 10:51:12 -0700 -Subject: [PATCH 3/5] fix wrong parameter size on ioctl FIONREAD - -On Wed, Sep 23, 2009 at 23:11, Matthias Schwarzott wrote: -> It is about ioctl failures on amd64: -> http://bugs.gentoo.org/show_bug.cgi?id=286041 -> -> A bad parameter type to an ioctl() call causes udev-146 to generate "error -> getting buffer for inotify" messages in syslog. The offending code is -> roughly: -> -> ssize_t nbytes, pos; -> // ... -> ioctl(fd, FIONREAD, &nbytes); -> -> where ssize_t is 64 bits on amd64, but the kernel code for FIONREAD (at least -> through gentoo-sources-2.6.31) uses type int: -> -> p = (void __user *) arg; -> switch (cmd) { -> case FIONREAD: -> // ... -> ret = put_user(send_len, (int __user *) p); -> -> so the upper 32 bits of "nbytes" are left uninitialized, and the subsequent -> malloc(nbytes) fails unless those 32 bits happen to be zero (or the system has -> a LOT of memory). ---- - udev/udevd.c | 2 +- - 1 files changed, 1 insertions(+), 1 deletions(-) - -diff --git a/udev/udevd.c b/udev/udevd.c -index 69d509c..511cb4b 100644 ---- a/udev/udevd.c -+++ b/udev/udevd.c -@@ -656,7 +656,7 @@ static void handle_ctrl_msg(struct udev_ctrl *uctrl) - /* read inotify messages */ - static int handle_inotify(struct udev *udev) - { -- ssize_t nbytes, pos; -+ int nbytes, pos; - char *buf; - struct inotify_event *ev; - --- -1.6.4.4 - diff --git a/0004-fix-single-session-CD-detection.patch b/0004-fix-single-session-CD-detection.patch deleted file mode 100644 index 6c933a6..0000000 --- a/0004-fix-single-session-CD-detection.patch +++ /dev/null @@ -1,38 +0,0 @@ -From 36b35c884fc06bc2babf0ec840cb423b94a45f93 Mon Sep 17 00:00:00 2001 -From: Martin Pitt -Date: Sun, 20 Sep 2009 19:07:51 +0200 -Subject: [PATCH 4/5] fix single-session CD detection - -ID_CDROM_MEDIA_SESSION_LAST_OFFSET is not set for CDs with only a single -session (i. e. for the vast majority of CDs out there). The previous rules ran -blkid with invalid arguments for these, causing CD detection to fail in -DK-disks and gvfs. - -Now check whether we actually have ID_CDROM_MEDIA_SESSION_LAST_OFFSET, and if -not, call blkid without -O for specifying the offset. - -Many thanks to Maxim Levitsky for tracking this down! - -https://launchpad.net/bugs/431055 ---- - rules/rules.d/60-persistent-storage.rules | 4 +++- - 1 files changed, 3 insertions(+), 1 deletions(-) - -diff --git a/rules/rules.d/60-persistent-storage.rules b/rules/rules.d/60-persistent-storage.rules -index 64e9578..1b85156 100644 ---- a/rules/rules.d/60-persistent-storage.rules -+++ b/rules/rules.d/60-persistent-storage.rules -@@ -61,7 +61,9 @@ ENV{DEVTYPE}=="partition", ENV{ID_PATH}=="?*", SYMLINK+="disk/by-path/$env{ID_PA - ENV{DEVTYPE}=="disk", KERNEL!="sd*|sr*", ATTR{removable}=="1", GOTO="persistent_storage_end" - - # probe filesystem metadata of optical drives which have a media inserted --KERNEL=="sr*", ENV{ID_CDROM_MEDIA}=="?*", IMPORT{program}="/sbin/blkid -o udev -p -u noraid -O $env{ID_CDROM_MEDIA_SESSION_LAST_OFFSET} $tempnode" -+KERNEL=="sr*", ENV{ID_CDROM_MEDIA}=="?*", ENV{ID_CDROM_MEDIA_SESSION_LAST_OFFSET}=="?*", IMPORT{program}="/sbin/blkid -o udev -p -u noraid -O $env{ID_CDROM_MEDIA_SESSION_LAST_OFFSET} $tempnode" -+# single-session CDs do not have ID_CDROM_MEDIA_SESSION_LAST_OFFSET -+KERNEL=="sr*", ENV{ID_CDROM_MEDIA}=="?*", IMPORT{program}="/sbin/blkid -o udev -p -u noraid $tempnode" - - # probe filesystem metadata of disks - KERNEL!="sr*", IMPORT{program}="/sbin/blkid -o udev -p $tempnode" --- -1.6.4.4 - diff --git a/0005-fix-previous-commit-for-CD-detection.patch b/0005-fix-previous-commit-for-CD-detection.patch deleted file mode 100644 index 4b4eee4..0000000 --- a/0005-fix-previous-commit-for-CD-detection.patch +++ /dev/null @@ -1,26 +0,0 @@ -From a09ac6a6ae39512fafe9df331a311113d2a1d9f6 Mon Sep 17 00:00:00 2001 -From: Martin Pitt -Date: Sun, 20 Sep 2009 19:21:04 +0200 -Subject: [PATCH 5/5] fix previous commit for CD detection - -Do not run blkid twice. *brown paperbag* ---- - rules/rules.d/60-persistent-storage.rules | 2 +- - 1 files changed, 1 insertions(+), 1 deletions(-) - -diff --git a/rules/rules.d/60-persistent-storage.rules b/rules/rules.d/60-persistent-storage.rules -index 1b85156..0950847 100644 ---- a/rules/rules.d/60-persistent-storage.rules -+++ b/rules/rules.d/60-persistent-storage.rules -@@ -63,7 +63,7 @@ ENV{DEVTYPE}=="disk", KERNEL!="sd*|sr*", ATTR{removable}=="1", GOTO="persistent_ - # probe filesystem metadata of optical drives which have a media inserted - KERNEL=="sr*", ENV{ID_CDROM_MEDIA}=="?*", ENV{ID_CDROM_MEDIA_SESSION_LAST_OFFSET}=="?*", IMPORT{program}="/sbin/blkid -o udev -p -u noraid -O $env{ID_CDROM_MEDIA_SESSION_LAST_OFFSET} $tempnode" - # single-session CDs do not have ID_CDROM_MEDIA_SESSION_LAST_OFFSET --KERNEL=="sr*", ENV{ID_CDROM_MEDIA}=="?*", IMPORT{program}="/sbin/blkid -o udev -p -u noraid $tempnode" -+KERNEL=="sr*", ENV{ID_CDROM_MEDIA}=="?*", ENV{ID_CDROM_MEDIA_SESSION_LAST_OFFSET}=="", IMPORT{program}="/sbin/blkid -o udev -p -u noraid $tempnode" - - # probe filesystem metadata of disks - KERNEL!="sr*", IMPORT{program}="/sbin/blkid -o udev -p $tempnode" --- -1.6.4.4 - diff --git a/ck-runseat.patch b/ck-runseat.patch deleted file mode 100644 index 8804bc7..0000000 --- a/ck-runseat.patch +++ /dev/null @@ -1,295 +0,0 @@ ---- udev-145/extras/udev-acl/Makefile.am.runseat 2009-06-16 19:47:37.000000000 -0400 -+++ udev-145/extras/udev-acl/Makefile.am 2009-09-25 20:21:41.959583372 -0400 -@@ -15,5 +15,5 @@ udev_acl_LDADD = \ - dist_udevrules_DATA = 70-acl.rules - - install-exec-hook: -- mkdir -p $(DESTDIR)$(prefix)/lib/ConsoleKit/run-session.d -- ln -sf $(libexecdir)/udev-acl $(DESTDIR)$(prefix)/lib/ConsoleKit/run-session.d/udev-acl.ck -+ mkdir -p $(DESTDIR)$(prefix)/lib/ConsoleKit/run-seat.d -+ ln -sf $(libexecdir)/udev-acl $(DESTDIR)$(prefix)/lib/ConsoleKit/run-seat.d/udev-acl.ck ---- udev-145/extras/udev-acl/udev-acl.c.runseat 2009-06-16 12:10:58.000000000 -0400 -+++ udev-145/extras/udev-acl/udev-acl.c 2009-09-25 20:57:32.502573825 -0400 -@@ -1,4 +1,5 @@ --/* -+/* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- -+ * - * Copyright (C) 2009 Kay Sievers - * - * This program is free software; you can redistribute it and/or -@@ -29,6 +30,13 @@ - - static int debug; - -+enum{ -+ ACTION_NONE = 0, -+ ACTION_REMOVE, -+ ACTION_ADD, -+ ACTION_CHANGE -+}; -+ - static int set_facl(const char* filename, uid_t uid, int add) - { - int get; -@@ -152,44 +160,123 @@ static GSList *uids_with_local_active_se - } - - /* ConsoleKit calls us with special variables */ --static int consolekit_called(const char *action, uid_t *uid, const char **own_session, int *add) -+static int consolekit_called(const char *ck_action, uid_t *uid, uid_t *uid2, const char **remove_session_id, int *action) - { -- int a; -- uid_t u; -+ int a = ACTION_NONE; -+ uid_t u = 0; -+ uid_t u2 = 0; - const char *s; -- const char *session; -- -- if (action == NULL || strcmp(action, "session_active_changed") != 0) -- return -1; -+ const char *s2; -+ const char *old_session = NULL; - -- s = getenv("CK_SESSION_IS_LOCAL"); -- if (s == NULL) -+ if (ck_action == NULL || strcmp(ck_action, "seat_active_session_changed") != 0) - return -1; -- if (strcmp(s, "true") != 0) -- return 0; - -- s = getenv("CK_SESSION_IS_ACTIVE"); -- if (s == NULL) -+ /* We can have one of: remove, add, change, no-change */ -+ s = getenv("CK_SEAT_OLD_SESSION_ID"); -+ s2 = getenv("CK_SEAT_SESSION_ID"); -+ if (s == NULL && s2 == NULL) { - return -1; -- if (strcmp(s, "true") == 0) -- a = 1; -- else -- a = 0; -+ } else if (s2 == NULL) { -+ a = ACTION_REMOVE; -+ } else if (s == NULL) { -+ a = ACTION_ADD; -+ } else { -+ a = ACTION_CHANGE; -+ } - -- session = getenv("CK_SESSION_ID"); -- if (session == NULL) -- return -1; -+ switch (a) { -+ case ACTION_ADD: -+ s = getenv("CK_SEAT_SESSION_USER_UID"); -+ if (s == NULL) -+ return -1; -+ u = strtoul(s, NULL, 10); -+ if (u == 0) -+ return 0; -+ -+ s = getenv("CK_SEAT_SESSION_IS_LOCAL"); -+ if (s == NULL) -+ return -1; -+ if (strcmp(s, "true") != 0) -+ return 0; -+ -+ break; -+ case ACTION_REMOVE: -+ s = getenv("CK_SEAT_OLD_SESSION_USER_UID"); -+ if (s == NULL) -+ return -1; -+ u = strtoul(s, NULL, 10); -+ if (u == 0) -+ return 0; -+ -+ s = getenv("CK_SEAT_OLD_SESSION_IS_LOCAL"); -+ if (s == NULL) -+ return -1; -+ if (strcmp(s, "true") != 0) -+ return 0; -+ -+ old_session = getenv("CK_SEAT_OLD_SESSION_ID"); -+ if (old_session == NULL) -+ return -1; -+ -+ break; -+ case ACTION_CHANGE: -+ s = getenv("CK_SEAT_OLD_SESSION_USER_UID"); -+ if (s == NULL) -+ return -1; -+ u = strtoul(s, NULL, 10); -+ if (u == 0) -+ return 0; -+ s = getenv("CK_SEAT_SESSION_USER_UID"); -+ if (s == NULL) -+ return -1; -+ u2 = strtoul(s, NULL, 10); -+ if (u2 == 0) -+ return 0; -+ -+ s = getenv("CK_SEAT_OLD_SESSION_IS_LOCAL"); -+ s2 = getenv("CK_SEAT_SESSION_IS_LOCAL"); -+ if (s == NULL || s2 == NULL) -+ return -1; -+ /* don't process non-local session changes */ -+ if (strcmp(s, "true") != 0 && strcmp(s2, "true") != 0) -+ return 0; -+ -+ if (strcmp(s, "true") == 0 && strcmp(s, "true") == 0) { -+ /* process the change */ -+ if (u == u2) { -+ /* special case: we noop if we are -+ * changing between local sessions for -+ * the same uid */ -+ a = ACTION_NONE; -+ } -+ old_session = getenv("CK_SEAT_OLD_SESSION_ID"); -+ if (old_session == NULL) -+ return -1; -+ } else if (strcmp(s, "true") == 0) { -+ /* only process the removal */ -+ a = ACTION_REMOVE; -+ old_session = getenv("CK_SEAT_OLD_SESSION_ID"); -+ if (old_session == NULL) -+ return -1; -+ } else if (strcmp(s2, "true") == 0) { -+ /* only process the addition */ -+ a = ACTION_ADD; -+ u = u2; -+ } - -- s = getenv("CK_SESSION_USER_UID"); -- if (s == NULL) -- return -1; -- u = strtoul(s, NULL, 10); -- if (u == 0) -- return 0; -+ break; -+ case ACTION_NONE: -+ break; -+ default: -+ g_assert_not_reached (); -+ break; -+ } - -- *own_session = session; -+ *remove_session_id = old_session; - *uid = u; -- *add = a; -+ *uid2 = u2; -+ *action = a; - return 0; - } - -@@ -223,6 +310,21 @@ static void apply_acl_to_devices(uid_t u - udev_unref(udev); - } - -+static void -+remove_uid (uid_t uid, const char *remove_session_id) -+{ -+ /* -+ * Remove ACL for given uid from all matching devices -+ * when there is currently no local active session. -+ */ -+ GSList *list; -+ -+ list = uids_with_local_active_session(remove_session_id); -+ if (!uid_in_list(list, uid)) -+ apply_acl_to_devices(uid, 0); -+ g_slist_free(list); -+} -+ - int main (int argc, char* argv[]) - { - static const struct option options[] = { -@@ -233,10 +335,11 @@ int main (int argc, char* argv[]) - { "help", no_argument, NULL, 'h' }, - {} - }; -- int add = -1; -+ int action = -1; - const char *device = NULL; - uid_t uid = 0; -- const char* own_session = NULL; -+ uid_t uid2 = 0; -+ const char* remove_session_id = NULL; - int rc = 0; - - /* valgrind is more important to us than a slice allocator */ -@@ -252,9 +355,9 @@ int main (int argc, char* argv[]) - switch (option) { - case 'a': - if (strcmp(optarg, "add") == 0 || strcmp(optarg, "change") == 0) -- add = 1; -+ action = ACTION_ADD; - else if (strcmp(optarg, "remove") == 0) -- add = 0; -+ action = ACTION_REMOVE; - else - goto out; - break; -@@ -274,10 +377,10 @@ int main (int argc, char* argv[]) - } - } - -- if (add < 0 && device == NULL && uid == 0) -- consolekit_called(argv[optind], &uid, &own_session, &add); -+ if (action < 0 && device == NULL && uid == 0) -+ consolekit_called(argv[optind], &uid, &uid2, &remove_session_id, &action); - -- if (add < 0) { -+ if (action < 0) { - fprintf(stderr, "missing action\n\n"); - rc = 2; - goto out; -@@ -290,20 +393,24 @@ int main (int argc, char* argv[]) - } - - if (uid != 0) { -- if (add) { -+ switch (action) { -+ case ACTION_ADD: - /* Add ACL for given uid to all matching devices. */ - apply_acl_to_devices(uid, 1); -- } else { -- /* -- * Remove ACL for given uid from all matching devices -- * when there is currently no local active session. -- */ -- GSList *list; -- -- list = uids_with_local_active_session(own_session); -- if (!uid_in_list(list, uid)) -- apply_acl_to_devices(uid, 0); -- g_slist_free(list); -+ break; -+ case ACTION_REMOVE: -+ remove_uid(uid, remove_session_id); -+ break; -+ case ACTION_CHANGE: -+ remove_uid(uid, remove_session_id); -+ apply_acl_to_devices(uid2, 1); -+ break; -+ case ACTION_NONE: -+ goto out; -+ break; -+ default: -+ g_assert_not_reached(); -+ break; - } - } else if (device != NULL) { - /* -@@ -321,8 +428,8 @@ int main (int argc, char* argv[]) - uid_t u; - - u = GPOINTER_TO_UINT(l->data); -- if (add || !uid_in_list(list, u)) -- set_facl(device, u, add); -+ if (action == ACTION_ADD || !uid_in_list(list, u)) -+ set_facl(device, u, action == ACTION_ADD); - } - g_slist_free(list); - } else { diff --git a/sources b/sources index 433028f..8b59f95 100644 --- a/sources +++ b/sources @@ -1 +1 @@ -b3d3b5f88c7b81e7615700a04db685e1 udev-145.tar.bz2 +9cbae4cf95e5c510d7974ea195dfb2a4 udev-147-0.gitdf3e07d.tar.bz2 diff --git a/udev.spec b/udev.spec index 210eaf0..bdc3100 100644 --- a/udev.spec +++ b/udev.spec @@ -4,22 +4,16 @@ Summary: A userspace implementation of devfs Name: udev -Version: 145 -Release: 10%{?dist} +Version: 147 +Release: 0.1.gitdf3e07d%{?dist} License: GPLv2 Group: System Environment/Base Provides: udev-persistent = %{version}-%{release} Obsoletes: udev-persistent < 0:030-5 Obsoletes: udev-extras < 20090618 Provides: udev-extras = 20090618-1 -Source: ftp://ftp.kernel.org/pub/linux/utils/kernel/hotplug/%{name}-%{version}.tar.bz2 - -Patch1: 0001-enumeration-move-ALSA-control-devices-to-the-end-of-.patch -Patch2: 0002-udevd-add-timestamp-to-debug-output.patch -Patch3: 0003-fix-wrong-parameter-size-on-ioctl-FIONREAD.patch -Patch4: 0004-fix-single-session-CD-detection.patch -Patch5: 0005-fix-previous-commit-for-CD-detection.patch -Patch6: ck-runseat.patch +Source: udev-147-0.gitdf3e07d.tar.bz2 +#Source: ftp://ftp.kernel.org/pub/linux/utils/kernel/hotplug/%{name}-%{version}.tar.bz2 Source1: start_udev Source3: udev-post.init @@ -99,14 +93,8 @@ Requires: libgudev1 = %{version}-%{release} This package contains the header and pkg-config files for developing glib-based applications using libudev functionality. -%prep +%prep %setup -q -%patch1 -p1 -%patch2 -p1 -%patch3 -p1 -%patch4 -p1 -%patch5 -p1 -%patch6 -p1 -b .ck041 %build # get rid of rpath @@ -158,7 +146,6 @@ for i in \ rules/packages/40-s390.rules \ %endif rules/packages/40-isdn.rules \ - rules/packages/40-alsa.rules \ rules/packages/64-md-raid.rules \ rules/packages/64-device-mapper.rules \ ; do @@ -358,6 +345,11 @@ rm -rf $RPM_BUILD_ROOT %attr(0644,root,root) %{_libdir}/pkgconfig/gudev-1.0* %changelog +* Fri Oct 09 2009 Harald Hoyer 147-0.1.gitdf3e07d +- pre 147 +- database format changed +- lots of potential buffer overflow fixes + * Tue Sep 29 2009 Harald Hoyer 145-10 - add ConsoleKit patch for ConsoleKit 0.4.1 From 93b6fcbee77e9a930f0ea44c72261d97b142f884 Mon Sep 17 00:00:00 2001 From: Harald Hoyer Date: Thu, 12 Nov 2009 09:58:24 +0000 Subject: [PATCH 046/142] - version 147 - Fix upgrade from Fedora 11 with bluez installed (#533925) - obsolete DeviceKit and DeviceKit-devel (#532961) - fixed udev-post exit codes (#523976) - own directory /lib/udev/keymaps (#521801) - no more floppy modaliases (#514329) - added one more modems to modem-modeswitch.rules (#515349) - add NEWS file to the doc section - automatically turn on hotplugged CPUs (rhbz#523127) - recognize a devtmpfs on /dev (bug #528488) --- udev.spec | 43 ++++++++++++++++++++++++++++++++----------- 1 file changed, 32 insertions(+), 11 deletions(-) diff --git a/udev.spec b/udev.spec index bdc3100..ea3adc4 100644 --- a/udev.spec +++ b/udev.spec @@ -5,15 +5,20 @@ Summary: A userspace implementation of devfs Name: udev Version: 147 -Release: 0.1.gitdf3e07d%{?dist} +Release: 1%{?dist} License: GPLv2 Group: System Environment/Base Provides: udev-persistent = %{version}-%{release} Obsoletes: udev-persistent < 0:030-5 Obsoletes: udev-extras < 20090618 Provides: udev-extras = 20090618-1 -Source: udev-147-0.gitdf3e07d.tar.bz2 +Source: udev-147-0.git495d408.tar.bz2 #Source: ftp://ftp.kernel.org/pub/linux/utils/kernel/hotplug/%{name}-%{version}.tar.bz2 +#Snapshot of +#http://git.kernel.org/?p=linux/hotplug/udev.git;a=snapshot;h=495d408;sf=tgz +Patch1: udev-141-cpu-online.patch +Patch2: 0001-cdrom_id-Still-check-profiles-even-if-there-is-no-me.patch +Patch3: udev-147-modem-modeswitch.patch Source1: start_udev Source3: udev-post.init @@ -43,6 +48,10 @@ Conflicts: kernel < 0:2.6 mkinitrd <= 0:4.1.11-1 initscripts < 7.84 Requires: util-linux-ng >= 2.15.1 Obsoletes: dev <= 0:3.12-1 Provides: dev = 0:3.12-2 +Obsoletes: DeviceKit < 004 +Obsoletes: DeviceKit-devel < 004 +# hid2hci moved to udev +Conflicts: bluez < 4.47 %description The udev package contains an implementation of devfs in @@ -53,6 +62,7 @@ Summary: Dynamic library to access udev device information Group: System Environment/Libraries Obsoletes: libudev0 <= 142 Provides: libudev0 = 143 +License: LGPLv2+ %description -n libudev This package contains the dynamic library libudev, which provides access @@ -63,6 +73,7 @@ Summary: Development files for libudev Group: Development/Libraries Requires: udev = %{version}-%{release} Requires: libudev = %{version}-%{release} +License: LGPLv2+ %description -n libudev-devel This package contains the development files for the library libudev, a @@ -75,6 +86,7 @@ Requires: libudev >= 142 # remove the following lines for libgudev so major 1 Provides: libgudev = 20090518 Obsoletes: libgudev <= 20090517 +License: LGPLv2+ %description -n libgudev1 This package contains the libraries that make it easier to use libudev @@ -86,6 +98,7 @@ Group: Development/Libraries Requires: libudev-devel >= 142 Provides: libgudev-devel = 20090518 Obsoletes: libgudev-devel <= 20090517 +License: LGPLv2+ Requires: libgudev1 = %{version}-%{release} @@ -95,6 +108,9 @@ glib-based applications using libudev functionality. %prep %setup -q +%patch1 -p1 +%patch2 -p1 +%patch3 -p1 %build # get rid of rpath @@ -161,12 +177,6 @@ install -m 0755 %{SOURCE1} $RPM_BUILD_ROOT/sbin/start_udev mkdir -p -m 0755 $RPM_BUILD_ROOT%{firmwaredir} -mkdir -p -m 0755 $RPM_BUILD_ROOT%{_sysconfdir}/modprobe.d -cat > $RPM_BUILD_ROOT%{_sysconfdir}/modprobe.d/floppy-pnp.conf < 147-1 +- version 147 +- Fix upgrade from Fedora 11 with bluez installed (#533925) +- obsolete DeviceKit and DeviceKit-devel (#532961) +- fixed udev-post exit codes (#523976) +- own directory /lib/udev/keymaps (#521801) +- no more floppy modaliases (#514329) +- added one more modems to modem-modeswitch.rules (#515349) +- add NEWS file to the doc section +- automatically turn on hotplugged CPUs (rhbz#523127) +- recognize a devtmpfs on /dev (bug #528488) + * Fri Oct 09 2009 Harald Hoyer 147-0.1.gitdf3e07d - pre 147 - database format changed From c82df992b80b3439e10b165f782746a7ed6ccef4 Mon Sep 17 00:00:00 2001 From: Harald Hoyer Date: Thu, 12 Nov 2009 10:11:06 +0000 Subject: [PATCH 047/142] - version 147 - Fix upgrade from Fedora 11 with bluez installed (#533925) - obsolete DeviceKit and DeviceKit-devel (#532961) - fixed udev-post exit codes (#523976) - own directory /lib/udev/keymaps (#521801) - no more floppy modaliases (#514329) - added one more modems to modem-modeswitch.rules (#515349) - add NEWS file to the doc section - automatically turn on hotplugged CPUs (rhbz#523127) - recognize a devtmpfs on /dev (bug #528488) --- .cvsignore | 2 +- ...heck-profiles-even-if-there-is-no-me.patch | 38 +++++++++++++++++++ sources | 2 +- start_udev | 6 ++- udev-141-cpu-online.patch | 8 ++++ udev-147-modem-modeswitch.patch | 10 +++++ udev-post.init | 6 ++- udev.spec | 6 +-- 8 files changed, 68 insertions(+), 10 deletions(-) create mode 100644 0001-cdrom_id-Still-check-profiles-even-if-there-is-no-me.patch create mode 100644 udev-141-cpu-online.patch create mode 100644 udev-147-modem-modeswitch.patch diff --git a/.cvsignore b/.cvsignore index 513dfdb..a2a13aa 100644 --- a/.cvsignore +++ b/.cvsignore @@ -1 +1 @@ -udev-147-0.gitdf3e07d.tar.bz2 +udev-147.tar.bz2 diff --git a/0001-cdrom_id-Still-check-profiles-even-if-there-is-no-me.patch b/0001-cdrom_id-Still-check-profiles-even-if-there-is-no-me.patch new file mode 100644 index 0000000..dad08af --- /dev/null +++ b/0001-cdrom_id-Still-check-profiles-even-if-there-is-no-me.patch @@ -0,0 +1,38 @@ +From 7505831b7ee7b04d84424d2ed306a76abd32871c Mon Sep 17 00:00:00 2001 +From: David Zeuthen +Date: Tue, 10 Nov 2009 12:32:38 -0500 +Subject: [PATCH] cdrom_id: Still check profiles even if there is no media + +Even when there is no medium in the drive, we should still check the +profiles supported by the drive. Otherwise we fail to detect things +like Blu-ray drives. See + + https://bugzilla.gnome.org/show_bug.cgi?id=600273 + +for more information. + +Signed-off-by: David Zeuthen +--- + extras/cdrom_id/cdrom_id.c | 6 +++--- + 1 files changed, 3 insertions(+), 3 deletions(-) + +diff --git a/extras/cdrom_id/cdrom_id.c b/extras/cdrom_id/cdrom_id.c +index 6ea763b..2380b15 100644 +--- a/extras/cdrom_id/cdrom_id.c ++++ b/extras/cdrom_id/cdrom_id.c +@@ -583,9 +583,9 @@ int main(int argc, char *argv[]) + goto exit; + } + +- /* check for media */ +- if (cd_media_compat(udev, fd) < 0) +- goto print; ++ /* check for media - don't bail if there's no media as we still need to ++ * to read profiles */ ++ cd_media_compat(udev, fd); + + /* check if drive talks MMC */ + if (cd_inquiry(udev, fd) < 0) +-- +1.6.5.2 + diff --git a/sources b/sources index 8b59f95..eccbdfc 100644 --- a/sources +++ b/sources @@ -1 +1 @@ -9cbae4cf95e5c510d7974ea195dfb2a4 udev-147-0.gitdf3e07d.tar.bz2 +aed0129c5a00e01d1be75ffda7d2e0f1 udev-147.tar.bz2 diff --git a/start_udev b/start_udev index dfa36a8..6487666 100755 --- a/start_udev +++ b/start_udev @@ -223,7 +223,7 @@ STRING=$"Starting $prog: " echo -n "$STRING" # mount the tmpfs on ${udev_root%/}, if not already done -LANG=C awk "\$2 == \"${udev_root%/}\" && \$3 == \"tmpfs\" { exit 1 }" /proc/mounts && { +LANG=C awk "\$2 == \"${udev_root%/}\" && ( \$3 == \"devtmpfs\" || \$3 == \"tmpfs\" ) { exit 1 }" /proc/mounts && { if LANG=C fgrep -q "none ${udev_root%/}/pts " /proc/mounts; then PTSDIR=$(mktemp -d) mount --move $udev_root/pts "$PTSDIR" @@ -232,7 +232,9 @@ LANG=C awk "\$2 == \"${udev_root%/}\" && \$3 == \"tmpfs\" { exit 1 }" /proc/moun SHMDIR=$(mktemp -d) mount --move $udev_root/shm "$SHMDIR" fi - mount -n -o mode=0755 -t tmpfs none "$udev_root" + # First try to mount a devtmpfs on $udev_root + mount -n -o mode=0755 -t devtmpfs none "$udev_root" 2>/dev/null \ + || mount -n -o mode=0755 -t tmpfs none "$udev_root" mkdir -m 0755 $udev_root/pts mkdir -m 0755 $udev_root/shm if [ -n "$PTSDIR" ]; then diff --git a/udev-141-cpu-online.patch b/udev-141-cpu-online.patch new file mode 100644 index 0000000..909e6e5 --- /dev/null +++ b/udev-141-cpu-online.patch @@ -0,0 +1,8 @@ +--- udev-141/rules/redhat/40-redhat.rules 2008-10-16 11:03:43.000000000 -0500 ++++ udev-141.cpu/rules/redhat/40-redhat.rules 2009-05-20 11:23:12.000000000 -0500 +@@ -25,3 +25,5 @@ + KERNEL=="vcc/*", OWNER="vcsa", GROUP="tty" + + KERNEL=="event*", ATTRS{idVendor}=="03f0", ATTRS{interface}=="Virtual Mouse", ATTRS{bInterfaceProtocol}=="02", SYMLINK+="input/hp_ilo_mouse" ++ ++ACTION=="add", KERNEL=="cpu[0-9]*", RUN+="/bin/bash -c 'echo 1 > /sys/devices/system/cpu/%k/online'" diff --git a/udev-147-modem-modeswitch.patch b/udev-147-modem-modeswitch.patch new file mode 100644 index 0000000..b25e245 --- /dev/null +++ b/udev-147-modem-modeswitch.patch @@ -0,0 +1,10 @@ +diff -up udev-147/extras/modem-modeswitch/61-option-modem-modeswitch.rules.orig udev-147/extras/modem-modeswitch/61-option-modem-modeswitch.rules +--- udev-147/extras/modem-modeswitch/61-option-modem-modeswitch.rules.orig 2009-07-31 12:48:49.000000000 +0200 ++++ udev-147/extras/modem-modeswitch/61-option-modem-modeswitch.rules 2009-11-12 10:47:49.000000000 +0100 +@@ -35,5 +35,6 @@ ATTRS{idVendor}=="0af0", ATTRS{idProduct + ATTRS{idVendor}=="0af0", ATTRS{idProduct}=="7601", RUN+="modem-modeswitch -v 0x%s{idVendor} -p 0x%s{idProduct} -t option-zerocd" + ATTRS{idVendor}=="0af0", ATTRS{idProduct}=="7901", RUN+="modem-modeswitch -v 0x%s{idVendor} -p 0x%s{idProduct} -t option-zerocd" + ATTRS{idVendor}=="12d1", ATTRS{idProduct}=="1446", RUN+="modem-modeswitch -v 0x%s{idVendor} -p 0x%s{idProduct} -t option-zerocd" ++ATTRS{idVendor}=="19d2", ATTRS{idProduct}=="2000", RUN+="modem-modeswitch -v 0x%s{idVendor} -p 0x%s{idProduct} -t option-zerocd" + + LABEL="option_zerocd_end" diff --git a/udev-post.init b/udev-post.init index 51bc184..1676e78 100644 --- a/udev-post.init +++ b/udev-post.init @@ -23,6 +23,7 @@ # See how we were called. case "$1" in start|reload) + [ -w /var/lock/subsys/udev-post ] || exit 4 STRING=$"Retrigger failed udev events" echo -n $STRING /sbin/udevadm trigger --retry-failed @@ -53,6 +54,7 @@ case "$1" in exit 0 ;; stop) + [ -w /var/lock/subsys/udev-post ] || exit 4 STRING=$"Generating udev makedev cache file" MAKEDEV="/sbin/MAKEDEV" USE_MD5="false" @@ -85,10 +87,10 @@ case "$1" in exit 0 ;; status) - exit 0 + exit 3 ;; *) echo $"Usage: $0 {start|stop|reload}" - exit 1 + exit 3 esac exit 0 diff --git a/udev.spec b/udev.spec index ea3adc4..0603367 100644 --- a/udev.spec +++ b/udev.spec @@ -12,10 +12,7 @@ Provides: udev-persistent = %{version}-%{release} Obsoletes: udev-persistent < 0:030-5 Obsoletes: udev-extras < 20090618 Provides: udev-extras = 20090618-1 -Source: udev-147-0.git495d408.tar.bz2 -#Source: ftp://ftp.kernel.org/pub/linux/utils/kernel/hotplug/%{name}-%{version}.tar.bz2 -#Snapshot of -#http://git.kernel.org/?p=linux/hotplug/udev.git;a=snapshot;h=495d408;sf=tgz +Source: ftp://ftp.kernel.org/pub/linux/utils/kernel/hotplug/%{name}-%{version}.tar.bz2 Patch1: udev-141-cpu-online.patch Patch2: 0001-cdrom_id-Still-check-profiles-even-if-there-is-no-me.patch Patch3: udev-147-modem-modeswitch.patch @@ -50,6 +47,7 @@ Obsoletes: dev <= 0:3.12-1 Provides: dev = 0:3.12-2 Obsoletes: DeviceKit < 004 Obsoletes: DeviceKit-devel < 004 +Provides: DeviceKit = 004 DeviceKit-devel = 004 # hid2hci moved to udev Conflicts: bluez < 4.47 From f4ef922fde9c7da047dcf8a86be063dbac2a57a5 Mon Sep 17 00:00:00 2001 From: Harald Hoyer Date: Tue, 24 Nov 2009 11:26:19 +0000 Subject: [PATCH 048/142] - require s390utils, because it's essential on s390 --- udev.spec | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/udev.spec b/udev.spec index 0603367..68c6c65 100644 --- a/udev.spec +++ b/udev.spec @@ -5,7 +5,7 @@ Summary: A userspace implementation of devfs Name: udev Version: 147 -Release: 1%{?dist} +Release: 2%{?dist} License: GPLv2 Group: System Environment/Base Provides: udev-persistent = %{version}-%{release} @@ -30,6 +30,11 @@ Requires(pre): /usr/bin/stat /sbin/pidof Requires(pre): MAKEDEV >= 0:3.11 /usr/bin/getent /usr/sbin/groupadd Requires: hwdata +%ifarch s390 s390x +# Require s390utils, because it's essential on s390 +Requires: s390utils +%endif + BuildRequires: sed libselinux-devel >= 0:1.17.9-2 flex libsepol-devel BuildRequires: glib2-devel bison findutils MAKEDEV BuildRequires: gperf libtool @@ -352,6 +357,9 @@ rm -rf $RPM_BUILD_ROOT %attr(0644,root,root) %{_libdir}/pkgconfig/gudev-1.0* %changelog +* Tue Nov 24 2009 Harald Hoyer 147-2 +- require s390utils, because it's essential on s390 + * Thu Nov 12 2009 Harald Hoyer 147-1 - version 147 - Fix upgrade from Fedora 11 with bluez installed (#533925) From 7ff3775e4dbaad9362eb4b7cba5acf3abe61c5c4 Mon Sep 17 00:00:00 2001 From: Bill Nottingham Date: Wed, 25 Nov 2009 22:52:46 +0000 Subject: [PATCH 049/142] Fix typo that causes a failure to update the common directory. (releng #2781) --- Makefile | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Makefile b/Makefile index 79bd188..c72f44b 100644 --- a/Makefile +++ b/Makefile @@ -1,11 +1,11 @@ # Makefile for source rpm: udev -# $Id: Makefile,v 1.2 2004/11/04 16:16:37 harald Exp $ +# $Id: Makefile,v 1.3 2007/10/15 19:29:11 notting Exp $ NAME := udev SPECFILE = $(firstword $(wildcard *.spec)) UPSTREAM_CHECKS = sign define find-makefile-common -for d in common ../common ../../common ; do if [ -f $$d/Makefile.common ] ; then if [ -f $$d/CVS/Root -a -w $$/Makefile.common ] ; then cd $$d ; cvs -Q update ; fi ; echo "$$d/Makefile.common" ; break ; fi ; done +for d in common ../common ../../common ; do if [ -f $$d/Makefile.common ] ; then if [ -f $$d/CVS/Root -a -w $$d/Makefile.common ] ; then cd $$d ; cvs -Q update ; fi ; echo "$$d/Makefile.common" ; break ; fi ; done endef MAKEFILE_COMMON := $(shell $(find-makefile-common)) From bcb2d05c810fa9df5dc061eb6c3affd210420716 Mon Sep 17 00:00:00 2001 From: Harald Hoyer Date: Wed, 27 Jan 2010 15:44:40 +0000 Subject: [PATCH 050/142] - version 151 - fixed udev-post initscript - only require s390utils-base, rather than s390utils (#553156) --- .cvsignore | 2 +- ...heck-profiles-even-if-there-is-no-me.patch | 38 ------------------- sources | 2 +- udev-147-modem-modeswitch.patch | 10 ----- udev-post.init | 6 +-- udev.spec | 30 ++++++++------- 6 files changed, 22 insertions(+), 66 deletions(-) delete mode 100644 0001-cdrom_id-Still-check-profiles-even-if-there-is-no-me.patch delete mode 100644 udev-147-modem-modeswitch.patch diff --git a/.cvsignore b/.cvsignore index a2a13aa..d05c54f 100644 --- a/.cvsignore +++ b/.cvsignore @@ -1 +1 @@ -udev-147.tar.bz2 +udev-151.tar.bz2 diff --git a/0001-cdrom_id-Still-check-profiles-even-if-there-is-no-me.patch b/0001-cdrom_id-Still-check-profiles-even-if-there-is-no-me.patch deleted file mode 100644 index dad08af..0000000 --- a/0001-cdrom_id-Still-check-profiles-even-if-there-is-no-me.patch +++ /dev/null @@ -1,38 +0,0 @@ -From 7505831b7ee7b04d84424d2ed306a76abd32871c Mon Sep 17 00:00:00 2001 -From: David Zeuthen -Date: Tue, 10 Nov 2009 12:32:38 -0500 -Subject: [PATCH] cdrom_id: Still check profiles even if there is no media - -Even when there is no medium in the drive, we should still check the -profiles supported by the drive. Otherwise we fail to detect things -like Blu-ray drives. See - - https://bugzilla.gnome.org/show_bug.cgi?id=600273 - -for more information. - -Signed-off-by: David Zeuthen ---- - extras/cdrom_id/cdrom_id.c | 6 +++--- - 1 files changed, 3 insertions(+), 3 deletions(-) - -diff --git a/extras/cdrom_id/cdrom_id.c b/extras/cdrom_id/cdrom_id.c -index 6ea763b..2380b15 100644 ---- a/extras/cdrom_id/cdrom_id.c -+++ b/extras/cdrom_id/cdrom_id.c -@@ -583,9 +583,9 @@ int main(int argc, char *argv[]) - goto exit; - } - -- /* check for media */ -- if (cd_media_compat(udev, fd) < 0) -- goto print; -+ /* check for media - don't bail if there's no media as we still need to -+ * to read profiles */ -+ cd_media_compat(udev, fd); - - /* check if drive talks MMC */ - if (cd_inquiry(udev, fd) < 0) --- -1.6.5.2 - diff --git a/sources b/sources index eccbdfc..3161bc7 100644 --- a/sources +++ b/sources @@ -1 +1 @@ -aed0129c5a00e01d1be75ffda7d2e0f1 udev-147.tar.bz2 +aeae0e6273dcbec246c3c1b9868ebed1 udev-151.tar.bz2 diff --git a/udev-147-modem-modeswitch.patch b/udev-147-modem-modeswitch.patch deleted file mode 100644 index b25e245..0000000 --- a/udev-147-modem-modeswitch.patch +++ /dev/null @@ -1,10 +0,0 @@ -diff -up udev-147/extras/modem-modeswitch/61-option-modem-modeswitch.rules.orig udev-147/extras/modem-modeswitch/61-option-modem-modeswitch.rules ---- udev-147/extras/modem-modeswitch/61-option-modem-modeswitch.rules.orig 2009-07-31 12:48:49.000000000 +0200 -+++ udev-147/extras/modem-modeswitch/61-option-modem-modeswitch.rules 2009-11-12 10:47:49.000000000 +0100 -@@ -35,5 +35,6 @@ ATTRS{idVendor}=="0af0", ATTRS{idProduct - ATTRS{idVendor}=="0af0", ATTRS{idProduct}=="7601", RUN+="modem-modeswitch -v 0x%s{idVendor} -p 0x%s{idProduct} -t option-zerocd" - ATTRS{idVendor}=="0af0", ATTRS{idProduct}=="7901", RUN+="modem-modeswitch -v 0x%s{idVendor} -p 0x%s{idProduct} -t option-zerocd" - ATTRS{idVendor}=="12d1", ATTRS{idProduct}=="1446", RUN+="modem-modeswitch -v 0x%s{idVendor} -p 0x%s{idProduct} -t option-zerocd" -+ATTRS{idVendor}=="19d2", ATTRS{idProduct}=="2000", RUN+="modem-modeswitch -v 0x%s{idVendor} -p 0x%s{idProduct} -t option-zerocd" - - LABEL="option_zerocd_end" diff --git a/udev-post.init b/udev-post.init index 1676e78..409f552 100644 --- a/udev-post.init +++ b/udev-post.init @@ -23,7 +23,7 @@ # See how we were called. case "$1" in start|reload) - [ -w /var/lock/subsys/udev-post ] || exit 4 + [ -w /var/lock/subsys ] || exit 4 STRING=$"Retrigger failed udev events" echo -n $STRING /sbin/udevadm trigger --retry-failed @@ -54,7 +54,7 @@ case "$1" in exit 0 ;; stop) - [ -w /var/lock/subsys/udev-post ] || exit 4 + [ -w /var/lock/subsys ] || exit 4 STRING=$"Generating udev makedev cache file" MAKEDEV="/sbin/MAKEDEV" USE_MD5="false" @@ -91,6 +91,6 @@ case "$1" in ;; *) echo $"Usage: $0 {start|stop|reload}" - exit 3 + exit 2 esac exit 0 diff --git a/udev.spec b/udev.spec index 68c6c65..a1d2966 100644 --- a/udev.spec +++ b/udev.spec @@ -4,8 +4,8 @@ Summary: A userspace implementation of devfs Name: udev -Version: 147 -Release: 2%{?dist} +Version: 151 +Release: 1%{?dist} License: GPLv2 Group: System Environment/Base Provides: udev-persistent = %{version}-%{release} @@ -14,8 +14,6 @@ Obsoletes: udev-extras < 20090618 Provides: udev-extras = 20090618-1 Source: ftp://ftp.kernel.org/pub/linux/utils/kernel/hotplug/%{name}-%{version}.tar.bz2 Patch1: udev-141-cpu-online.patch -Patch2: 0001-cdrom_id-Still-check-profiles-even-if-there-is-no-me.patch -Patch3: udev-147-modem-modeswitch.patch Source1: start_udev Source3: udev-post.init @@ -31,8 +29,8 @@ Requires(pre): MAKEDEV >= 0:3.11 /usr/bin/getent /usr/sbin/groupadd Requires: hwdata %ifarch s390 s390x -# Require s390utils, because it's essential on s390 -Requires: s390utils +# Require s390utils-base, because it's essential on s390 +Requires: s390utils-base %endif BuildRequires: sed libselinux-devel >= 0:1.17.9-2 flex libsepol-devel @@ -112,8 +110,6 @@ glib-based applications using libudev functionality. %prep %setup -q %patch1 -p1 -%patch2 -p1 -%patch3 -p1 %build # get rid of rpath @@ -259,7 +255,7 @@ rm -rf $RPM_BUILD_ROOT %files %defattr(0644, root, root, 0755) -%doc NEWS COPYING README TODO ChangeLog docs/* extras/keymap/README.keymap.txt +%doc NEWS COPYING README TODO ChangeLog extras/keymap/README.keymap.txt %attr(0755,root,root) /sbin/udevadm %attr(0755,root,root) /sbin/udevsettle %attr(0755,root,root) /sbin/udevtrigger @@ -276,12 +272,15 @@ rm -rf $RPM_BUILD_ROOT %attr(0755,root,root) %{udev_scriptdir}/hid2hci %attr(0755,root,root) %{udev_scriptdir}/create_floppy_devices %attr(0755,root,root) %{udev_scriptdir}/fw_unit_symlinks.sh -%attr(0755,root,root) %{udev_scriptdir}/firmware.sh +%attr(0755,root,root) %{udev_scriptdir}/firmware %attr(0644,root,root) %{udev_scriptdir}/rule_generator.functions %attr(0755,root,root) %{udev_scriptdir}/write_cd_rules %attr(0755,root,root) %{udev_scriptdir}/write_net_rules %attr(0755,root,root) %{udev_scriptdir}/collect %attr(0755,root,root) %{udev_scriptdir}/fstab_import +%attr(0755,root,root) %{udev_scriptdir}/input_id +%attr(0755,root,root) %{udev_scriptdir}/keyboard-force-release.sh + %attr(0755,root,root) %dir %{udev_scriptdir}/rules.d/ %attr(0755,root,root) %{_sysconfdir}/rc.d/init.d/udev-post @@ -328,12 +327,12 @@ rm -rf $RPM_BUILD_ROOT %files -n libudev %defattr(0644, root, root, 0755) -%doc COPYING +%doc COPYING %attr(0755,root,root) /%{_lib}/libudev.so.* %files -n libudev-devel %defattr(0644, root, root, 0755) -%doc COPYING +%doc COPYING libudev/docs/html/* %{_includedir}/libudev.h %{_libdir}/libudev.so %{_libdir}/pkgconfig/libudev.pc @@ -348,7 +347,7 @@ rm -rf $RPM_BUILD_ROOT %files -n libgudev1-devel %defattr(0644, root, root, 0755) -%doc COPYING +%doc COPYING extras/gudev/docs/html/* %attr(0755,root,root) %{_libdir}/libgudev-1.0.so %attr(0644,root,root) %{_includedir}/gudev-1.0/gudev/*.h %attr(0644,root,root) %{_datadir}/gir-1.0/GUdev-1.0.gir @@ -357,6 +356,11 @@ rm -rf $RPM_BUILD_ROOT %attr(0644,root,root) %{_libdir}/pkgconfig/gudev-1.0* %changelog +* Wed Jan 27 2010 Harald Hoyer 151-1 +- version 151 +- fixed udev-post initscript +- only require s390utils-base, rather than s390utils (#553156) + * Tue Nov 24 2009 Harald Hoyer 147-2 - require s390utils, because it's essential on s390 From e0288040af85adf674d062fb89e883a4b913605b Mon Sep 17 00:00:00 2001 From: Harald Hoyer Date: Fri, 29 Jan 2010 09:57:03 +0000 Subject: [PATCH 051/142] - version 151 - fixed udev-post initscript - only require s390utils-base, rather than s390utils (#553156) --- udev-141-cpu-online.patch | 8 -------- udev-151-rules.patch | 25 +++++++++++++++++++++++++ udev-post.init | 2 +- udev.spec | 7 +++++-- 4 files changed, 31 insertions(+), 11 deletions(-) delete mode 100644 udev-141-cpu-online.patch create mode 100644 udev-151-rules.patch diff --git a/udev-141-cpu-online.patch b/udev-141-cpu-online.patch deleted file mode 100644 index 909e6e5..0000000 --- a/udev-141-cpu-online.patch +++ /dev/null @@ -1,8 +0,0 @@ ---- udev-141/rules/redhat/40-redhat.rules 2008-10-16 11:03:43.000000000 -0500 -+++ udev-141.cpu/rules/redhat/40-redhat.rules 2009-05-20 11:23:12.000000000 -0500 -@@ -25,3 +25,5 @@ - KERNEL=="vcc/*", OWNER="vcsa", GROUP="tty" - - KERNEL=="event*", ATTRS{idVendor}=="03f0", ATTRS{interface}=="Virtual Mouse", ATTRS{bInterfaceProtocol}=="02", SYMLINK+="input/hp_ilo_mouse" -+ -+ACTION=="add", KERNEL=="cpu[0-9]*", RUN+="/bin/bash -c 'echo 1 > /sys/devices/system/cpu/%k/online'" diff --git a/udev-151-rules.patch b/udev-151-rules.patch new file mode 100644 index 0000000..0fc647a --- /dev/null +++ b/udev-151-rules.patch @@ -0,0 +1,25 @@ +diff --git a/rules/redhat/40-redhat.rules b/rules/redhat/40-redhat.rules +index 47ce9e5..aaba82b 100644 +--- a/rules/redhat/40-redhat.rules ++++ b/rules/redhat/40-redhat.rules +@@ -5,11 +5,11 @@ KERNEL=="hd*[0-9]", ATTRS{media}=="floppy", ATTRS{removable}=="1", SYMLINK+="flo + + KERNEL=="fw*", PROGRAM="fw_unit_symlinks.sh %k %n", SYMLINK+="$result" + +-ACTION=="add", KERNEL=="sg[0-9]*", BUS=="scsi", ATTRS{type}=="3|6", SYMLINK+="scanner scanner-%k", MODE="0660" ++ACTION=="add", KERNEL=="sg[0-9]*", SUBSYSTEM=="scsi_device", ATTRS{type}=="3|6", SYMLINK+="scanner scanner-%k", MODE="0660" + +-ACTION=="add", KERNEL=="sg[0-9]*", BUS=="scsi", ATTRS{type}=="8", SYMLINK+="changer changer-%k", MODE="0660", GROUP="disk" ++ACTION=="add", KERNEL=="sg[0-9]*", SUBSYSTEM=="scsi_device", ATTRS{type}=="8", SYMLINK+="changer changer-%k", MODE="0660", GROUP="disk" + +-BUS=="usb", KERNEL=="sd*", ATTRS{bInterfaceClass}=="08", ATTRS{bInterfaceSubClass}=="04", GROUP="floppy", MODE="0660", SYMLINK+="floppy floppy-%k" ++SUBSYSTEM=="usb", KERNEL=="sd*", ATTRS{bInterfaceClass}=="08", ATTRS{bInterfaceSubClass}=="04", GROUP="floppy", MODE="0660", SYMLINK+="floppy floppy-%k" + + KERNEL=="fd[0-9]*", SYMLINK+="floppy floppy-%k" + +@@ -25,3 +25,5 @@ KERNEL=="vcsa[0-9]*", OWNER="vcsa", GROUP="tty" + KERNEL=="vcc/*", OWNER="vcsa", GROUP="tty" + + KERNEL=="event*", ATTRS{idVendor}=="03f0", ATTRS{interface}=="Virtual Mouse", ATTRS{bInterfaceProtocol}=="02", SYMLINK+="input/hp_ilo_mouse" ++ ++ACTION=="add", KERNEL=="cpu[0-9]*", RUN+="/bin/bash -c 'echo 1 > /sys/devices/system/cpu/%k/online'" diff --git a/udev-post.init b/udev-post.init index 409f552..f040950 100644 --- a/udev-post.init +++ b/udev-post.init @@ -26,7 +26,7 @@ case "$1" in [ -w /var/lock/subsys ] || exit 4 STRING=$"Retrigger failed udev events" echo -n $STRING - /sbin/udevadm trigger --retry-failed + /sbin/udevadm trigger --type=failed success "$STRING" echo diff --git a/udev.spec b/udev.spec index a1d2966..2b55c1f 100644 --- a/udev.spec +++ b/udev.spec @@ -5,7 +5,7 @@ Summary: A userspace implementation of devfs Name: udev Version: 151 -Release: 1%{?dist} +Release: 2%{?dist} License: GPLv2 Group: System Environment/Base Provides: udev-persistent = %{version}-%{release} @@ -13,7 +13,7 @@ Obsoletes: udev-persistent < 0:030-5 Obsoletes: udev-extras < 20090618 Provides: udev-extras = 20090618-1 Source: ftp://ftp.kernel.org/pub/linux/utils/kernel/hotplug/%{name}-%{version}.tar.bz2 -Patch1: udev-141-cpu-online.patch +Patch1: udev-151-rules.patch Source1: start_udev Source3: udev-post.init @@ -356,6 +356,9 @@ rm -rf $RPM_BUILD_ROOT %attr(0644,root,root) %{_libdir}/pkgconfig/gudev-1.0* %changelog +* Fri Jan 29 2010 Harald Hoyer 151-2 +- fixed rules and startup script (#559844) + * Wed Jan 27 2010 Harald Hoyer 151-1 - version 151 - fixed udev-post initscript From 52b32c5a0df50a1b45b61f8f99099e8e29a109ae Mon Sep 17 00:00:00 2001 From: Harald Hoyer Date: Tue, 9 Feb 2010 09:59:25 +0000 Subject: [PATCH 052/142] - udev-86a7a2f-fix-missing-firmware.patch: fix hang when loading microcode (since microcode_intel tries to probe firmware which does not exist. *sigh*) --- start_udev | 2 +- udev-151-rules.patch | 2 +- udev-86a7a2f-fix-missing-firmware.patch | 43 +++++++++++++++++++++++++ udev.spec | 9 +++++- 4 files changed, 53 insertions(+), 3 deletions(-) create mode 100644 udev-86a7a2f-fix-missing-firmware.patch diff --git a/start_udev b/start_udev index 6487666..57801aa 100755 --- a/start_udev +++ b/start_udev @@ -110,7 +110,7 @@ make_extra_nodes () { done [ -d /dev/net ] || mkdir -p /dev/net - [ -c /dev/net/tun ] || /bin/mknod -m 0600 /dev/net/tun c 10 200 + [ -c /dev/net/tun ] || /bin/mknod -m 0666 /dev/net/tun c 10 200 #/bin/chown root:root /dev/net/tun [ -c /dev/ppp ] || /bin/mknod -m 0600 /dev/ppp c 108 0 diff --git a/udev-151-rules.patch b/udev-151-rules.patch index 0fc647a..b713f03 100644 --- a/udev-151-rules.patch +++ b/udev-151-rules.patch @@ -22,4 +22,4 @@ index 47ce9e5..aaba82b 100644 KERNEL=="event*", ATTRS{idVendor}=="03f0", ATTRS{interface}=="Virtual Mouse", ATTRS{bInterfaceProtocol}=="02", SYMLINK+="input/hp_ilo_mouse" + -+ACTION=="add", KERNEL=="cpu[0-9]*", RUN+="/bin/bash -c 'echo 1 > /sys/devices/system/cpu/%k/online'" ++ACTION=="add", SUBSYSTEM=="cpu", KERNEL=="cpu[0-9]*", ATTR{online}="1" diff --git a/udev-86a7a2f-fix-missing-firmware.patch b/udev-86a7a2f-fix-missing-firmware.patch new file mode 100644 index 0000000..0213bdf --- /dev/null +++ b/udev-86a7a2f-fix-missing-firmware.patch @@ -0,0 +1,43 @@ +From 86a7a2f853fe6022c5b0c1b415918047b65533be Mon Sep 17 00:00:00 2001 +From: =?UTF-8?q?Thomas=20B=C3=A4chler?= +Date: Sun, 31 Jan 2010 13:49:02 +0100 +Subject: firmware: fix error reporting on missing firmware files + +The new firmware loader does not report an error to the kernel if a firmware file +is missing. This results in modprobe stalling for 60 seconds for each firmware +a module tries to load. +--- + extras/firmware/firmware.c | 3 ++- + 1 files changed, 2 insertions(+), 1 deletions(-) + +diff --git a/extras/firmware/firmware.c b/extras/firmware/firmware.c +index 8f70be4..16455de 100644 +--- a/extras/firmware/firmware.c ++++ b/extras/firmware/firmware.c +@@ -149,6 +149,7 @@ int main(int argc, char **argv) + + util_path_encode(firmware, fwencpath, sizeof(fwencpath)); + util_strscpyl(misspath, sizeof(misspath), udev_get_dev_path(udev), "/.udev/firmware-missing/", fwencpath, NULL); ++ util_strscpyl(loadpath, sizeof(loadpath), udev_get_sys_path(udev), devpath, "/loading", NULL); + + if (fwfile == NULL) { + int err; +@@ -166,6 +167,7 @@ int main(int argc, char **argv) + udev_selinux_resetfscreatecon(udev); + } while (err == -ENOENT); + rc = 2; ++ set_loading(udev, loadpath, "-1"); + goto exit; + } + +@@ -176,7 +178,6 @@ int main(int argc, char **argv) + if (unlink(misspath) == 0) + util_delete_path(udev, misspath); + +- util_strscpyl(loadpath, sizeof(loadpath), udev_get_sys_path(udev), devpath, "/loading", NULL); + set_loading(udev, loadpath, "1"); + + util_strscpyl(datapath, sizeof(datapath), udev_get_sys_path(udev), devpath, "/data", NULL); +-- +1.6.6 + diff --git a/udev.spec b/udev.spec index 2b55c1f..edce2f8 100644 --- a/udev.spec +++ b/udev.spec @@ -5,7 +5,7 @@ Summary: A userspace implementation of devfs Name: udev Version: 151 -Release: 2%{?dist} +Release: 3%{?dist} License: GPLv2 Group: System Environment/Base Provides: udev-persistent = %{version}-%{release} @@ -14,6 +14,7 @@ Obsoletes: udev-extras < 20090618 Provides: udev-extras = 20090618-1 Source: ftp://ftp.kernel.org/pub/linux/utils/kernel/hotplug/%{name}-%{version}.tar.bz2 Patch1: udev-151-rules.patch +Patch2: udev-86a7a2f-fix-missing-firmware.patch Source1: start_udev Source3: udev-post.init @@ -110,6 +111,7 @@ glib-based applications using libudev functionality. %prep %setup -q %patch1 -p1 +%patch2 -p1 %build # get rid of rpath @@ -356,6 +358,11 @@ rm -rf $RPM_BUILD_ROOT %attr(0644,root,root) %{_libdir}/pkgconfig/gudev-1.0* %changelog +* Sun Feb 07 2010 Kyle McMartin 151-3 +- udev-86a7a2f-fix-missing-firmware.patch: fix hang when loading + microcode (since microcode_intel tries to probe firmware which does + not exist. *sigh*) + * Fri Jan 29 2010 Harald Hoyer 151-2 - fixed rules and startup script (#559844) From 977de72a58f265f8bc8d6376bb3b64d44ac5ace7 Mon Sep 17 00:00:00 2001 From: Harald Hoyer Date: Fri, 19 Mar 2010 12:48:14 +0000 Subject: [PATCH 053/142] - add patch for virtio-ports (#569700) - own libgudev dirs (#561319) - minor udev startup script improvements (#549518) - create /dev/hugepages subdir in start_udev (#541998) - remove GPL COPYING file from LGPL subpackages (#536843) - removed symlinks to udevadm - touch all device nodes after udev settled for the timezone timestamp (#569335) - add some upstream bugfixes --- ...or-reporting-on-missing-firmware-fil.patch | 43 + ...eymap-Add-Dell-Inspiron-1011-Mini-10.patch | 26 + ...ix-brightness-keys-on-MSI-Wind-U-100.patch | 37 + ...ort-for-Gateway-AOA110-AOA150-clones.patch | 29 + 0005-keymap-Fix-LG-X110.patch | 64 + ...e-for-volume-keys-on-Dell-Studio-155.patch | 55 + 0007-keymap-Add-Toshiba-Satellite-M30X.patch | 55 + ...amsung-Q210-P210-force-release-quirk.patch | 30 + ...tsu-Amilo-1848-u-force-release-quirk.patch | 53 + ...er-size-when-advancing-past-NUL-byte.patch | 29 + ...ZE-not-UTIL_PATH_SIZE-to-truncate-pr.patch | 26 + ...se-UTIL_LINE_SIZE-from-2048-to-16384.patch | 37 + ...rts-rule-to-use-attr-instead-of-ATTR.patch | 29 + ...cl-Correctly-handle-ENV-ACL_MANAGE-0.patch | 47 + 0021-input_id-Fix-linking.patch | 27 + 0022-replace-utimes-with-utimensat.patch | 34 + ...sible-segfault-when-firmware-device-.patch | 40 + ...create-by-path-links-for-pci-devices.patch | 25 + ...gitech-bluetooth-adapters-into-hci-m.patch | 29 + ...inux-context-when-the-node-was-not-t.patch | 88 + ...dd-LGPL-COPYING-to-libudev-and-GUdev.patch | 1035 ++++++++ ...on-mounted-optical-media-with-O_EXCL.patch | 58 + ...-into-tool-that-only-switches-Mobile.patch | 2142 +++++++++++++++++ start_udev | 30 +- udev-151-3.patch | 89 + udev-151-virtio.patch | 30 + udev-post.init | 4 +- udev.spec | 180 +- 28 files changed, 4295 insertions(+), 76 deletions(-) create mode 100644 0001-firmware-fix-error-reporting-on-missing-firmware-fil.patch create mode 100644 0002-keymap-Add-Dell-Inspiron-1011-Mini-10.patch create mode 100644 0003-Fix-brightness-keys-on-MSI-Wind-U-100.patch create mode 100644 0004-keymap-Add-support-for-Gateway-AOA110-AOA150-clones.patch create mode 100644 0005-keymap-Fix-LG-X110.patch create mode 100644 0006-Force-key-release-for-volume-keys-on-Dell-Studio-155.patch create mode 100644 0007-keymap-Add-Toshiba-Satellite-M30X.patch create mode 100644 0013-keymap-Add-Samsung-Q210-P210-force-release-quirk.patch create mode 100644 0014-keymap-Add-Fujitsu-Amilo-1848-u-force-release-quirk.patch create mode 100644 0015-Decrease-buffer-size-when-advancing-past-NUL-byte.patch create mode 100644 0016-Use-UTIL_LINE_SIZE-not-UTIL_PATH_SIZE-to-truncate-pr.patch create mode 100644 0017-Increase-UTIL_LINE_SIZE-from-2048-to-16384.patch create mode 100644 0018-Fix-virtio-ports-rule-to-use-attr-instead-of-ATTR.patch create mode 100644 0019-udev-acl-Correctly-handle-ENV-ACL_MANAGE-0.patch create mode 100644 0021-input_id-Fix-linking.patch create mode 100644 0022-replace-utimes-with-utimensat.patch create mode 100644 0029-firmware-fix-possible-segfault-when-firmware-device-.patch create mode 100644 0030-rules-input-create-by-path-links-for-pci-devices.patch create mode 100644 0031-Fix-switching-Logitech-bluetooth-adapters-into-hci-m.patch create mode 100644 0032-do-not-reset-SELinux-context-when-the-node-was-not-t.patch create mode 100644 0034-add-LGPL-COPYING-to-libudev-and-GUdev.patch create mode 100644 0035-cdrom_id-open-non-mounted-optical-media-with-O_EXCL.patch create mode 100644 0036-modeswitch-morph-into-tool-that-only-switches-Mobile.patch create mode 100644 udev-151-3.patch create mode 100644 udev-151-virtio.patch diff --git a/0001-firmware-fix-error-reporting-on-missing-firmware-fil.patch b/0001-firmware-fix-error-reporting-on-missing-firmware-fil.patch new file mode 100644 index 0000000..933407f --- /dev/null +++ b/0001-firmware-fix-error-reporting-on-missing-firmware-fil.patch @@ -0,0 +1,43 @@ +From 86a7a2f853fe6022c5b0c1b415918047b65533be Mon Sep 17 00:00:00 2001 +From: =?UTF-8?q?Thomas=20B=C3=A4chler?= +Date: Sun, 31 Jan 2010 13:49:02 +0100 +Subject: [PATCH 01/36] firmware: fix error reporting on missing firmware files + +The new firmware loader does not report an error to the kernel if a firmware file +is missing. This results in modprobe stalling for 60 seconds for each firmware +a module tries to load. +--- + extras/firmware/firmware.c | 3 ++- + 1 files changed, 2 insertions(+), 1 deletions(-) + +diff --git a/extras/firmware/firmware.c b/extras/firmware/firmware.c +index 8f70be4..16455de 100644 +--- a/extras/firmware/firmware.c ++++ b/extras/firmware/firmware.c +@@ -149,6 +149,7 @@ int main(int argc, char **argv) + + util_path_encode(firmware, fwencpath, sizeof(fwencpath)); + util_strscpyl(misspath, sizeof(misspath), udev_get_dev_path(udev), "/.udev/firmware-missing/", fwencpath, NULL); ++ util_strscpyl(loadpath, sizeof(loadpath), udev_get_sys_path(udev), devpath, "/loading", NULL); + + if (fwfile == NULL) { + int err; +@@ -166,6 +167,7 @@ int main(int argc, char **argv) + udev_selinux_resetfscreatecon(udev); + } while (err == -ENOENT); + rc = 2; ++ set_loading(udev, loadpath, "-1"); + goto exit; + } + +@@ -176,7 +178,6 @@ int main(int argc, char **argv) + if (unlink(misspath) == 0) + util_delete_path(udev, misspath); + +- util_strscpyl(loadpath, sizeof(loadpath), udev_get_sys_path(udev), devpath, "/loading", NULL); + set_loading(udev, loadpath, "1"); + + util_strscpyl(datapath, sizeof(datapath), udev_get_sys_path(udev), devpath, "/data", NULL); +-- +1.6.6 + diff --git a/0002-keymap-Add-Dell-Inspiron-1011-Mini-10.patch b/0002-keymap-Add-Dell-Inspiron-1011-Mini-10.patch new file mode 100644 index 0000000..47cc9fa --- /dev/null +++ b/0002-keymap-Add-Dell-Inspiron-1011-Mini-10.patch @@ -0,0 +1,26 @@ +From fc47e0b56779ceeaaa40d2dc3248fa002af63aaa Mon Sep 17 00:00:00 2001 +From: Martin Pitt +Date: Mon, 1 Feb 2010 15:27:46 -0800 +Subject: [PATCH 02/36] keymap: Add Dell Inspiron 1011 (Mini 10) + +This fixes the broken WLAN key. +--- + extras/keymap/95-keymap.rules | 2 ++ + 1 files changed, 2 insertions(+), 0 deletions(-) + +diff --git a/extras/keymap/95-keymap.rules b/extras/keymap/95-keymap.rules +index 2b1c4bd..51c8c3b 100644 +--- a/extras/keymap/95-keymap.rules ++++ b/extras/keymap/95-keymap.rules +@@ -53,6 +53,8 @@ GOTO="keyboard_end" + LABEL="keyboard_vendorcheck" + + ENV{DMI_VENDOR}=="Dell*", RUN+="keymap $name dell" ++ENV{DMI_VENDOR}=="Dell*", ATTR{[dmi/id]product_name}=="Inspiron 1011", RUN+="keymap $name 0x84 wlan" ++ + ENV{DMI_VENDOR}=="Compaq*", ATTR{[dmi/id]product_name}=="*E500*|*Evo N*", RUN+="keymap $name compaq-e_evo" + + ENV{DMI_VENDOR}=="LENOVO*", ATTR{[dmi/id]product_version}=="*3000*", RUN+="keymap $name lenovo-3000" +-- +1.6.6 + diff --git a/0003-Fix-brightness-keys-on-MSI-Wind-U-100.patch b/0003-Fix-brightness-keys-on-MSI-Wind-U-100.patch new file mode 100644 index 0000000..c00f51e --- /dev/null +++ b/0003-Fix-brightness-keys-on-MSI-Wind-U-100.patch @@ -0,0 +1,37 @@ +From d7e2d38c1f0ead2239808dd117577a99a3ad3cde Mon Sep 17 00:00:00 2001 +From: Martin Pitt +Date: Tue, 9 Feb 2010 15:47:47 +0100 +Subject: [PATCH 03/36] Fix brightness keys on MSI Wind U-100 + +The MSI Wind 100 generates ACPI/input events on the LNXVIDEO input device. On +top of that, the video module/BIOS synthesize some extra event on atkbd as an +echo of actually changing the brightness. + +Ignore the wrong and useless atkbd ones, to avoid event loops. + +Many thanks to Hans de Goede for tracking this down! + +https://launchpad.net/bugs/415023 +--- + extras/keymap/95-keymap.rules | 5 +++++ + 1 files changed, 5 insertions(+), 0 deletions(-) + +diff --git a/extras/keymap/95-keymap.rules b/extras/keymap/95-keymap.rules +index 51c8c3b..684619b 100644 +--- a/extras/keymap/95-keymap.rules ++++ b/extras/keymap/95-keymap.rules +@@ -98,6 +98,11 @@ ENV{DMI_VENDOR}=="MEDIONNB", ATTR{[dmi/id]product_name}=="A555*", RUN+="keymap $ + + ENV{DMI_VENDOR}=="MICRO-STAR*", RUN+="keymap $name micro-star" + ++# some MSI models generate ACPI/input events on the LNXVIDEO input devices, ++# plus some extra synthesized ones on atkbd as an echo of actually changing the ++# brightness; so ignore those atkbd ones, to avoid loops ++ENV{DMI_VENDOR}=="MICRO-STAR*", ATTR{[dmi/id]product_name}=="*U-100*|*U100*|*N033", RUN+="keymap $name 0xF7 reserved 0xF8 reserved" ++ + ENV{DMI_VENDOR}=="INVENTEC", ATTR{[dmi/id]product_name}=="SYMPHONY 6.0/7.0", RUN+="keymap $name inventec-symphony_6.0_7.0" + + ENV{DMI_VENDOR}=="MAXDATA", ATTR{[dmi/id]product_name}=="Pro 7000*", RUN+="keymap $name maxdata-pro_7000" +-- +1.6.6 + diff --git a/0004-keymap-Add-support-for-Gateway-AOA110-AOA150-clones.patch b/0004-keymap-Add-support-for-Gateway-AOA110-AOA150-clones.patch new file mode 100644 index 0000000..a7167c4 --- /dev/null +++ b/0004-keymap-Add-support-for-Gateway-AOA110-AOA150-clones.patch @@ -0,0 +1,29 @@ +From 063985ef7dd6050f33920700777831426b221697 Mon Sep 17 00:00:00 2001 +From: Robert Hooker +Date: Sun, 7 Feb 2010 13:56:27 -0500 +Subject: [PATCH 04/36] keymap: Add support for Gateway AOA110/AOA150 clones. + +https://launchpad.net/bugs/518496 + +Signed-off-by: Martin Pitt +--- + extras/keymap/95-keymap.rules | 3 +++ + 1 files changed, 3 insertions(+), 0 deletions(-) + +diff --git a/extras/keymap/95-keymap.rules b/extras/keymap/95-keymap.rules +index 684619b..d3690bb 100644 +--- a/extras/keymap/95-keymap.rules ++++ b/extras/keymap/95-keymap.rules +@@ -71,6 +71,9 @@ ENV{DMI_VENDOR}=="Hewlett-Packard", ATTR{[dmi/id]product_name}=="Presario 2100*" + # HP Pavillion dv6315ea has empty DMI_VENDOR + ATTR{[dmi/id]board_vendor}=="Quanta", ATTR{[dmi/id]board_name}=="30B7", ATTR{[dmi/id]board_version}=="65.2B", RUN+="keymap $name 0x88 media" # "quick play + ++# Gateway clone of Acer Aspire One AOA110/AOA150 ++ENV{DMI_VENDOR}=="Gateway*", ATTR{[dmi/id]product_name}=="*AOA1*", RUN+="keymap $name acer" ++ + ENV{DMI_VENDOR}=="Acer*", RUN+="keymap $name acer" + ENV{DMI_VENDOR}=="Acer*", ATTR{[dmi/id]product_name}=="Extensa*", ATTR{[dmi/id]product_name}=="*5210*|*5220*|*5610*|*5620*|*5720*", RUN+="keymap $name 0xEE screenlock" + ENV{DMI_VENDOR}=="Acer*", ATTR{[dmi/id]product_name}=="TravelMate*C300*", RUN+="keymap $name acer-travelmate_c300" +-- +1.6.6 + diff --git a/0005-keymap-Fix-LG-X110.patch b/0005-keymap-Fix-LG-X110.patch new file mode 100644 index 0000000..380ecf0 --- /dev/null +++ b/0005-keymap-Fix-LG-X110.patch @@ -0,0 +1,64 @@ +From 4c514e31734a704ca58e543fa4330616ba584b39 Mon Sep 17 00:00:00 2001 +From: Martin Pitt +Date: Fri, 12 Feb 2010 19:25:47 +0100 +Subject: [PATCH 05/36] keymap: Fix LG X110 + +The LG X110 is not a perfect clone of the MSI Wind after all, and needs its own +keymap. Thanks to Konstantin Lavrov! + +https://launchpad.net/bugs/520650 +--- + Makefile.am | 1 + + extras/keymap/95-keymap.rules | 3 +-- + extras/keymap/keymaps/lg-x110 | 12 ++++++++++++ + 3 files changed, 14 insertions(+), 2 deletions(-) + create mode 100644 extras/keymap/keymaps/lg-x110 + +diff --git a/Makefile.am b/Makefile.am +index 728076a..069bf7f 100644 +--- a/Makefile.am ++++ b/Makefile.am +@@ -518,6 +518,7 @@ dist_udevkeymap_DATA = \ + extras/keymap/keymaps/lenovo-thinkpad-usb-keyboard-trackpoint \ + extras/keymap/keymaps/lenovo-thinkpad_x6_tablet \ + extras/keymap/keymaps/lenovo-thinkpad_x200_tablet \ ++ extras/keymap/keymaps/lg-x110 \ + extras/keymap/keymaps/logitech-wave \ + extras/keymap/keymaps/logitech-wave-cordless \ + extras/keymap/keymaps/maxdata-pro_7000 \ +diff --git a/extras/keymap/95-keymap.rules b/extras/keymap/95-keymap.rules +index d3690bb..fcd42aa 100644 +--- a/extras/keymap/95-keymap.rules ++++ b/extras/keymap/95-keymap.rules +@@ -93,8 +93,7 @@ ENV{DMI_VENDOR}=="FUJITSU*", ATTR{[dmi/id]product_name}=="*Amilo Si 1520*", RUN+ + ENV{DMI_VENDOR}=="FUJITSU*", ATTR{[dmi/id]product_name}=="AMILO*M*", RUN+="keymap $name 0x97 prog2 0x9F prog1" + ENV{DMI_VENDOR}=="FUJITSU*", ATTR{[dmi/id]product_name}=="Amilo Li 1718", RUN+="keymap $name 0xD6 wlan" + +-# MSI Wind clone +-ENV{DMI_VENDOR}=="LG*", ATTR{[dmi/id]product_name}=="*X110*", RUN+="keymap $name micro-star" ++ENV{DMI_VENDOR}=="LG*", ATTR{[dmi/id]product_name}=="*X110*", RUN+="keymap $name lg-x110" + + ENV{DMI_VENDOR}=="MEDION*", ATTR{[dmi/id]product_name}=="*FID2060*", RUN+="keymap $name medion-fid2060" + ENV{DMI_VENDOR}=="MEDIONNB", ATTR{[dmi/id]product_name}=="A555*", RUN+="keymap $name medionnb-a555" +diff --git a/extras/keymap/keymaps/lg-x110 b/extras/keymap/keymaps/lg-x110 +new file mode 100644 +index 0000000..a61cf3d +--- /dev/null ++++ b/extras/keymap/keymaps/lg-x110 +@@ -0,0 +1,12 @@ ++0xA0 mute # Fn-F9 ++0xAE volumedown # Fn-Left ++0xAF search # Fn-F3 ++0xB0 volumeup # Fn-Right ++0xB1 battery # Fn-F10 Info ++0xB3 suspend # Fn-F12 ++0xDF sleep # Fn-F4 ++# 0xE2 bluetooth # satellite dish2 ++0xE4 f22 # Fn-F5 Touchpad disable ++0xF6 wlan # Fn-F6 ++0xF7 reserved # brightnessdown # Fn-Down ++0xF8 reserved # brightnessup # Fn-Up +\ No newline at end of file +-- +1.6.6 + diff --git a/0006-Force-key-release-for-volume-keys-on-Dell-Studio-155.patch b/0006-Force-key-release-for-volume-keys-on-Dell-Studio-155.patch new file mode 100644 index 0000000..2f147fc --- /dev/null +++ b/0006-Force-key-release-for-volume-keys-on-Dell-Studio-155.patch @@ -0,0 +1,55 @@ +From b15bb8019094797aee65f35e3e654354b61bfd7b Mon Sep 17 00:00:00 2001 +From: Jerone Young +Date: Fri, 12 Feb 2010 18:08:08 -0600 +Subject: [PATCH 06/36] Force key release for volume keys on Dell Studio 1557 + +Dell Studio 1557 does not generate a release code when the volume keys +are pressed, causing them to generate infinite key presses. This forces +key release of these keys. + +Signed-off-by: Jerone Young +Signed-off-by: Martin Pitt +--- + Makefile.am | 3 ++- + extras/keymap/95-keyboard-force-release.rules | 2 ++ + extras/keymap/force-release-maps/dell-studio-1557 | 3 +++ + 3 files changed, 7 insertions(+), 1 deletions(-) + create mode 100755 extras/keymap/force-release-maps/dell-studio-1557 + +diff --git a/Makefile.am b/Makefile.am +index 069bf7f..1b4e2ea 100644 +--- a/Makefile.am ++++ b/Makefile.am +@@ -541,7 +541,8 @@ dist_udevkeymap_DATA = \ + + udevkeymapforcereldir = $(libexecdir)/keymaps/force-release + dist_udevkeymapforcerel_DATA = \ +- extras/keymap/force-release-maps/samsung-other ++ extras/keymap/force-release-maps/samsung-other \ ++ extras/keymap/force-release-maps/dell-studio-1557 + + extras/keymap/keys.txt: $(INCLUDE_PREFIX)/linux/input.h + mkdir -p extras/keymap +diff --git a/extras/keymap/95-keyboard-force-release.rules b/extras/keymap/95-keyboard-force-release.rules +index 689afe9..659ee95 100644 +--- a/extras/keymap/95-keyboard-force-release.rules ++++ b/extras/keymap/95-keyboard-force-release.rules +@@ -21,4 +21,6 @@ ENV{DMI_VENDOR}="$attr{[dmi/id]sys_vendor}" + + ENV{DMI_VENDOR}=="[sS][aA][mM][sS][uU][nN][gG]*", ATTR{[dmi/id]product_name}=="*N130*|*N140*|*SR70S/SR71S*", RUN+="keyboard-force-release.sh $devpath samsung-other" + ++ENV{DMI_VENDOR}=="Dell Inc.", ATTR{[dmi/id]product_name}=="Studio 1557", RUN+="keyboard-force-release.sh $devpath dell-studio-1557" ++ + LABEL="force_release_end" +diff --git a/extras/keymap/force-release-maps/dell-studio-1557 b/extras/keymap/force-release-maps/dell-studio-1557 +new file mode 100755 +index 0000000..1718673 +--- /dev/null ++++ b/extras/keymap/force-release-maps/dell-studio-1557 +@@ -0,0 +1,3 @@ ++0xa0 #mute ++0xae #volume up ++0xb0 #volume down +-- +1.6.6 + diff --git a/0007-keymap-Add-Toshiba-Satellite-M30X.patch b/0007-keymap-Add-Toshiba-Satellite-M30X.patch new file mode 100644 index 0000000..4d17c00 --- /dev/null +++ b/0007-keymap-Add-Toshiba-Satellite-M30X.patch @@ -0,0 +1,55 @@ +From 4ca91a04e8b727a079a973fdd9bc2b093e8315a5 Mon Sep 17 00:00:00 2001 +From: Martin Pitt +Date: Mon, 15 Feb 2010 13:15:25 +0100 +Subject: [PATCH 07/36] keymap: Add Toshiba Satellite M30X + +Thanks to Alessio Gaeta! + +https://launchpad.net/bugs/510019 +--- + Makefile.am | 1 + + extras/keymap/95-keymap.rules | 1 + + extras/keymap/keymaps/toshiba-satellite_m30x | 7 +++++++ + 3 files changed, 9 insertions(+), 0 deletions(-) + create mode 100644 extras/keymap/keymaps/toshiba-satellite_m30x + +diff --git a/Makefile.am b/Makefile.am +index 1b4e2ea..db23f16 100644 +--- a/Makefile.am ++++ b/Makefile.am +@@ -537,6 +537,7 @@ dist_udevkeymap_DATA = \ + extras/keymap/keymaps/samsung-sx20s \ + extras/keymap/keymaps/toshiba-satellite_a100 \ + extras/keymap/keymaps/toshiba-satellite_a110 \ ++ extras/keymap/keymaps/toshiba-satellite_m30x \ + extras/keymap/keymaps/zepto-znote + + udevkeymapforcereldir = $(libexecdir)/keymaps/force-release +diff --git a/extras/keymap/95-keymap.rules b/extras/keymap/95-keymap.rules +index fcd42aa..65b0d6e 100644 +--- a/extras/keymap/95-keymap.rules ++++ b/extras/keymap/95-keymap.rules +@@ -115,6 +115,7 @@ ENV{DMI_VENDOR}=="[sS][aA][mM][sS][uU][nN][gG]*", ATTR{[dmi/id]product_name}=="S + + ENV{DMI_VENDOR}=="TOSHIBA", ATTR{[dmi/id]product_name}=="SATELLITE A100", RUN+="keymap $name toshiba-satellite_a100" + ENV{DMI_VENDOR}=="TOSHIBA", ATTR{[dmi/id]product_name}=="Satellite A110", RUN+="keymap $name toshiba-satellite_a110" ++ENV{DMI_VENDOR}=="TOSHIBA", ATTR{[dmi/id]product_name}=="Satellite M30X", RUN+="keymap $name toshiba-satellite_m30x" + + ENV{DMI_VENDOR}=="OQO Inc.*", ATTR{[dmi/id]product_name}=="OQO Model 2*", RUN+="keymap $name oqo-model2" + +diff --git a/extras/keymap/keymaps/toshiba-satellite_m30x b/extras/keymap/keymaps/toshiba-satellite_m30x +new file mode 100644 +index 0000000..cf6d912 +--- /dev/null ++++ b/extras/keymap/keymaps/toshiba-satellite_m30x +@@ -0,0 +1,7 @@ ++0xef brightnessdown ++0xd9 brightnessup ++0xee screenlock ++0x93 media ++0x9e prog1 #touchpad_enable ++0x9f prog2 #touchpad_disable ++ +-- +1.6.6 + diff --git a/0013-keymap-Add-Samsung-Q210-P210-force-release-quirk.patch b/0013-keymap-Add-Samsung-Q210-P210-force-release-quirk.patch new file mode 100644 index 0000000..328a2b4 --- /dev/null +++ b/0013-keymap-Add-Samsung-Q210-P210-force-release-quirk.patch @@ -0,0 +1,30 @@ +From 20b48c3727eef1f266cbfd6bf5854b5c1419beb9 Mon Sep 17 00:00:00 2001 +From: Andy Whitcroft +Date: Tue, 2 Mar 2010 13:55:03 +0100 +Subject: [PATCH 13/36] keymap: Add Samsung Q210/P210 force-release quirk + +The Samsung Q210/P210 laptop also needs all of its function keys quirked. + +https://launchpad.net/bugs/530093 + +Signed-off-by: Martin Pitt +--- + extras/keymap/95-keyboard-force-release.rules | 2 +- + 1 files changed, 1 insertions(+), 1 deletions(-) + +diff --git a/extras/keymap/95-keyboard-force-release.rules b/extras/keymap/95-keyboard-force-release.rules +index 659ee95..48b896d 100644 +--- a/extras/keymap/95-keyboard-force-release.rules ++++ b/extras/keymap/95-keyboard-force-release.rules +@@ -19,7 +19,7 @@ DRIVER!="atkbd", GOTO="force_release_end" + ENV{DMI_VENDOR}="$attr{[dmi/id]sys_vendor}" + + +-ENV{DMI_VENDOR}=="[sS][aA][mM][sS][uU][nN][gG]*", ATTR{[dmi/id]product_name}=="*N130*|*N140*|*SR70S/SR71S*", RUN+="keyboard-force-release.sh $devpath samsung-other" ++ENV{DMI_VENDOR}=="[sS][aA][mM][sS][uU][nN][gG]*", ATTR{[dmi/id]product_name}=="*N130*|*N140*|*SR70S/SR71S*|*Q210/P210*", RUN+="keyboard-force-release.sh $devpath samsung-other" + + ENV{DMI_VENDOR}=="Dell Inc.", ATTR{[dmi/id]product_name}=="Studio 1557", RUN+="keyboard-force-release.sh $devpath dell-studio-1557" + +-- +1.6.6 + diff --git a/0014-keymap-Add-Fujitsu-Amilo-1848-u-force-release-quirk.patch b/0014-keymap-Add-Fujitsu-Amilo-1848-u-force-release-quirk.patch new file mode 100644 index 0000000..9bedd1e --- /dev/null +++ b/0014-keymap-Add-Fujitsu-Amilo-1848-u-force-release-quirk.patch @@ -0,0 +1,53 @@ +From da96a11b9c9164447bef206db47c405342ab8daa Mon Sep 17 00:00:00 2001 +From: Andy Whitcroft +Date: Tue, 2 Mar 2010 14:00:32 +0100 +Subject: [PATCH 14/36] keymap: Add Fujitsu Amilo 1848+u force-release quirk + +The Fujitsu Amilo Si 1848+u laptop requires the volume and mute keys +quirking. + +https://launchpad.net/bugs/530089 + +Signed-off-by: Martin Pitt +--- + Makefile.am | 1 + + extras/keymap/95-keyboard-force-release.rules | 2 ++ + .../keymap/force-release-maps/fujitsu-amilo-si1848 | 3 +++ + 3 files changed, 6 insertions(+), 0 deletions(-) + create mode 100644 extras/keymap/force-release-maps/fujitsu-amilo-si1848 + +diff --git a/Makefile.am b/Makefile.am +index 3780f50..471c5dd 100644 +--- a/Makefile.am ++++ b/Makefile.am +@@ -543,6 +543,7 @@ dist_udevkeymap_DATA = \ + udevkeymapforcereldir = $(libexecdir)/keymaps/force-release + dist_udevkeymapforcerel_DATA = \ + extras/keymap/force-release-maps/samsung-other \ ++ extras/keymap/force-release-maps/fujitsu-amilo-si1848 \ + extras/keymap/force-release-maps/dell-studio-1557 + + extras/keymap/keys.txt: $(INCLUDE_PREFIX)/linux/input.h +diff --git a/extras/keymap/95-keyboard-force-release.rules b/extras/keymap/95-keyboard-force-release.rules +index 48b896d..28639a5 100644 +--- a/extras/keymap/95-keyboard-force-release.rules ++++ b/extras/keymap/95-keyboard-force-release.rules +@@ -23,4 +23,6 @@ ENV{DMI_VENDOR}=="[sS][aA][mM][sS][uU][nN][gG]*", ATTR{[dmi/id]product_name}=="* + + ENV{DMI_VENDOR}=="Dell Inc.", ATTR{[dmi/id]product_name}=="Studio 1557", RUN+="keyboard-force-release.sh $devpath dell-studio-1557" + ++ENV{DMI_VENDOR}=="FUJITSU SIEMENS", ATTR{[dmi/id]product_name}=="AMILO Si 1848+u", RUN+="keyboard-force-release.sh $devpath fujitsu-amilo-si1848" ++ + LABEL="force_release_end" +diff --git a/extras/keymap/force-release-maps/fujitsu-amilo-si1848 b/extras/keymap/force-release-maps/fujitsu-amilo-si1848 +new file mode 100644 +index 0000000..1718673 +--- /dev/null ++++ b/extras/keymap/force-release-maps/fujitsu-amilo-si1848 +@@ -0,0 +1,3 @@ ++0xa0 #mute ++0xae #volume up ++0xb0 #volume down +-- +1.6.6 + diff --git a/0015-Decrease-buffer-size-when-advancing-past-NUL-byte.patch b/0015-Decrease-buffer-size-when-advancing-past-NUL-byte.patch new file mode 100644 index 0000000..4ad5dce --- /dev/null +++ b/0015-Decrease-buffer-size-when-advancing-past-NUL-byte.patch @@ -0,0 +1,29 @@ +From ecd42de2c56b4fcf0069b8b4a4d6607710e5de61 Mon Sep 17 00:00:00 2001 +From: David Zeuthen +Date: Tue, 2 Mar 2010 17:06:33 -0500 +Subject: [PATCH 15/36] Decrease buffer size when advancing past NUL byte + +Otherwise we'll overflow the buffer if space is tight. Also add a comment explaining this. + +Signed-off-by: David Zeuthen +--- + libudev/libudev-device.c | 2 ++ + 1 files changed, 2 insertions(+), 0 deletions(-) + +diff --git a/libudev/libudev-device.c b/libudev/libudev-device.c +index 71fc775..4f42aa2 100644 +--- a/libudev/libudev-device.c ++++ b/libudev/libudev-device.c +@@ -1166,7 +1166,9 @@ static int update_envp_monitor_buf(struct udev_device *udev_device) + l = util_strpcpyl(&s, l, key, "=", udev_list_entry_get_value(list_entry), NULL); + if (l == 0) + return -EINVAL; ++ /* advance past the trailing '\0' that util_strpcpyl() guarantees */ + s++; ++ l--; + } + udev_device->envp[i] = NULL; + udev_device->monitor_buf_len = s - udev_device->monitor_buf; +-- +1.6.6 + diff --git a/0016-Use-UTIL_LINE_SIZE-not-UTIL_PATH_SIZE-to-truncate-pr.patch b/0016-Use-UTIL_LINE_SIZE-not-UTIL_PATH_SIZE-to-truncate-pr.patch new file mode 100644 index 0000000..174767d --- /dev/null +++ b/0016-Use-UTIL_LINE_SIZE-not-UTIL_PATH_SIZE-to-truncate-pr.patch @@ -0,0 +1,26 @@ +From 3a19299202b5d34b89d5910fde25e8a4cfa2b31a Mon Sep 17 00:00:00 2001 +From: David Zeuthen +Date: Tue, 2 Mar 2010 17:07:14 -0500 +Subject: [PATCH 16/36] Use UTIL_LINE_SIZE, not UTIL_PATH_SIZE to truncate properties + +Signed-off-by: David Zeuthen +--- + libudev/libudev-device.c | 2 +- + 1 files changed, 1 insertions(+), 1 deletions(-) + +diff --git a/libudev/libudev-device.c b/libudev/libudev-device.c +index 4f42aa2..b841745 100644 +--- a/libudev/libudev-device.c ++++ b/libudev/libudev-device.c +@@ -1089,7 +1089,7 @@ struct udev_list_entry *udev_device_add_property(struct udev_device *udev_device + + struct udev_list_entry *udev_device_add_property_from_string(struct udev_device *udev_device, const char *property) + { +- char name[UTIL_PATH_SIZE]; ++ char name[UTIL_LINE_SIZE]; + char *val; + + util_strscpy(name, sizeof(name), property); +-- +1.6.6 + diff --git a/0017-Increase-UTIL_LINE_SIZE-from-2048-to-16384.patch b/0017-Increase-UTIL_LINE_SIZE-from-2048-to-16384.patch new file mode 100644 index 0000000..802351e --- /dev/null +++ b/0017-Increase-UTIL_LINE_SIZE-from-2048-to-16384.patch @@ -0,0 +1,37 @@ +From e32d5237ea045045c621edba7341631abd602d74 Mon Sep 17 00:00:00 2001 +From: David Zeuthen +Date: Tue, 2 Mar 2010 17:10:02 -0500 +Subject: [PATCH 17/36] Increase UTIL_LINE_SIZE from 2048 to 16384 + +Recent udisks versions, for LVM2 integration, ships with probers that +produce very long lines such as + +UDISKS_LVM2_PV_VG_PV_LIST= + uuid=98lyZl-Ya7U-p26Z-Ia7b-xf8u-xZqP-jc4njb;size=2000397795328;allocated_size=2000397795328 + uuid=iFs0cM-sxCF-ceQK-hZl1-kbwo-ZTjq-gSewQR;size=2000397795328;allocated_size=2000397795328 + [...] + +e.g. roughly 100 bytes per LVM2 physical volume for each LVM2 +PV encountered. + +Signed-off-by: David Zeuthen +--- + libudev/libudev-private.h | 2 +- + 1 files changed, 1 insertions(+), 1 deletions(-) + +diff --git a/libudev/libudev-private.h b/libudev/libudev-private.h +index 0d28b80..e0c51dc 100644 +--- a/libudev/libudev-private.h ++++ b/libudev/libudev-private.h +@@ -187,7 +187,7 @@ int udev_queue_export_device_failed(struct udev_queue_export *udev_queue_export, + /* libudev-util.c */ + #define UTIL_PATH_SIZE 1024 + #define UTIL_NAME_SIZE 512 +-#define UTIL_LINE_SIZE 2048 ++#define UTIL_LINE_SIZE 16384 + #define UDEV_ALLOWED_CHARS_INPUT "/ $%?," + ssize_t util_get_sys_subsystem(struct udev *udev, const char *syspath, char *subsystem, size_t size); + ssize_t util_get_sys_driver(struct udev *udev, const char *syspath, char *driver, size_t size); +-- +1.6.6 + diff --git a/0018-Fix-virtio-ports-rule-to-use-attr-instead-of-ATTR.patch b/0018-Fix-virtio-ports-rule-to-use-attr-instead-of-ATTR.patch new file mode 100644 index 0000000..f02f3f0 --- /dev/null +++ b/0018-Fix-virtio-ports-rule-to-use-attr-instead-of-ATTR.patch @@ -0,0 +1,29 @@ +From 3c4b1738a9d591d7ddce361ea184b76b253c4e87 Mon Sep 17 00:00:00 2001 +From: Amit Shah +Date: Fri, 26 Feb 2010 14:05:41 +0530 +Subject: [PATCH 18/36] Fix virtio-ports rule to use $attr instead of $ATTR + +Newer udev versions don't understand $ATTR. + +Signed-off-by: Amit Shah +Signed-off-by: Martin Pitt +--- + rules/rules.d/50-udev-default.rules | 2 +- + 1 files changed, 1 insertions(+), 1 deletions(-) + +diff --git a/rules/rules.d/50-udev-default.rules b/rules/rules.d/50-udev-default.rules +index f8556d1..da1535f 100644 +--- a/rules/rules.d/50-udev-default.rules ++++ b/rules/rules.d/50-udev-default.rules +@@ -18,7 +18,7 @@ KERNEL=="mwave", GROUP="dialout" + KERNEL=="hvc*|hvsi*", GROUP="dialout" + + # virtio serial / console ports +-KERNEL=="vport*", SYMLINK+="virtio-ports/$ATTR{name}" ++KERNEL=="vport*", SYMLINK+="virtio-ports/$attr{name}" + + # mem + KERNEL=="null|zero|full|random|urandom", MODE="0666" +-- +1.6.6 + diff --git a/0019-udev-acl-Correctly-handle-ENV-ACL_MANAGE-0.patch b/0019-udev-acl-Correctly-handle-ENV-ACL_MANAGE-0.patch new file mode 100644 index 0000000..29f81f1 --- /dev/null +++ b/0019-udev-acl-Correctly-handle-ENV-ACL_MANAGE-0.patch @@ -0,0 +1,47 @@ +From 5c3ebbf35a2c101e0212c7066f0d65e457fcf40c Mon Sep 17 00:00:00 2001 +From: Martin Pitt +Date: Thu, 4 Mar 2010 00:48:59 +0100 +Subject: [PATCH 19/36] udev-acl: Correctly handle ENV{ACL_MANAGE}==0 +MIME-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit + +When a custom rule sets ACL_MANAGE to 0 to disable ACL management for a +particular device, handle this as "disabled", by explicitly checking against +"1" instead of "nonempty". + +Thanks to Rafał Rzepecki for pointing this out. +--- + extras/udev-acl/70-acl.rules | 2 +- + extras/udev-acl/udev-acl.c | 2 +- + 2 files changed, 2 insertions(+), 2 deletions(-) + +diff --git a/extras/udev-acl/70-acl.rules b/extras/udev-acl/70-acl.rules +index 8380f53..874667c 100644 +--- a/extras/udev-acl/70-acl.rules ++++ b/extras/udev-acl/70-acl.rules +@@ -69,7 +69,7 @@ SUBSYSTEM=="usb", ATTR{idVendor}=="0bb4", ATTR{idProduct}=="0c02", ENV{ACL_MANAG + ENV{COLOR_MEASUREMENT_DEVICE}=="*?", ENV{ACL_MANAGE}="1" + + # apply ACL for all locally logged in users +-LABEL="acl_apply", ENV{ACL_MANAGE}=="?*", TEST=="/var/run/ConsoleKit/database", \ ++LABEL="acl_apply", ENV{ACL_MANAGE}=="1", TEST=="/var/run/ConsoleKit/database", \ + RUN+="udev-acl --action=$env{ACTION} --device=$env{DEVNAME}" + + LABEL="acl_end" +diff --git a/extras/udev-acl/udev-acl.c b/extras/udev-acl/udev-acl.c +index e670ce7..c070fcc 100644 +--- a/extras/udev-acl/udev-acl.c ++++ b/extras/udev-acl/udev-acl.c +@@ -289,7 +289,7 @@ static void apply_acl_to_devices(uid_t uid, int add) + /* iterate over all devices tagged with ACL_SET */ + udev = udev_new(); + enumerate = udev_enumerate_new(udev); +- udev_enumerate_add_match_property(enumerate, "ACL_MANAGE", "*"); ++ udev_enumerate_add_match_property(enumerate, "ACL_MANAGE", "1"); + udev_enumerate_scan_devices(enumerate); + udev_list_entry_foreach(list_entry, udev_enumerate_get_list_entry(enumerate)) { + struct udev_device *device; +-- +1.6.6 + diff --git a/0021-input_id-Fix-linking.patch b/0021-input_id-Fix-linking.patch new file mode 100644 index 0000000..2e822bc --- /dev/null +++ b/0021-input_id-Fix-linking.patch @@ -0,0 +1,27 @@ +From a245a97b4e805c65ce22659742371550ccf002c1 Mon Sep 17 00:00:00 2001 +From: Martin Pitt +Date: Wed, 10 Mar 2010 12:17:03 +0100 +Subject: [PATCH 21/36] input_id: Fix linking + +Link against libudev-private.a instead of libudev.a, to avoid runtime +dependency to libudev. +--- + Makefile.am | 2 +- + 1 files changed, 1 insertions(+), 1 deletions(-) + +diff --git a/Makefile.am b/Makefile.am +index 471c5dd..99a0133 100644 +--- a/Makefile.am ++++ b/Makefile.am +@@ -239,7 +239,7 @@ dist_udevrules_DATA += extras/floppy/60-floppy.rules + # input_id - import input device class + # ------------------------------------------------------------------------------ + extras_input_id_input_id_SOURCES = extras/input_id/input_id.c +-extras_input_id_input_id_LDADD = libudev/libudev.la ++extras_input_id_input_id_LDADD = libudev/libudev-private.la + libexec_PROGRAMS += extras/input_id/input_id + + # ------------------------------------------------------------------------------ +-- +1.6.6 + diff --git a/0022-replace-utimes-with-utimensat.patch b/0022-replace-utimes-with-utimensat.patch new file mode 100644 index 0000000..7a42304 --- /dev/null +++ b/0022-replace-utimes-with-utimensat.patch @@ -0,0 +1,34 @@ +From 455f792e4791e037eb0406005b92c345cf0baf56 Mon Sep 17 00:00:00 2001 +From: Kay Sievers +Date: Wed, 10 Mar 2010 14:43:07 +0100 +Subject: [PATCH 22/36] replace utimes() with utimensat() + +--- + udev/udev-node.c | 4 ++-- + 1 files changed, 2 insertions(+), 2 deletions(-) + +diff --git a/udev/udev-node.c b/udev/udev-node.c +index a70c147..307a76b 100644 +--- a/udev/udev-node.c ++++ b/udev/udev-node.c +@@ -57,7 +57,7 @@ int udev_node_mknod(struct udev_device *dev, const char *file, dev_t devnum, mod + preserve = 1; + udev_selinux_lsetfilecon(udev, file, mode); + /* update time stamp when we re-use the node, like on media change events */ +- utimes(file, NULL); ++ utimensat(AT_FDCWD, file, NULL, 0); + } else { + char file_tmp[UTIL_PATH_SIZE + sizeof(TMP_FILE_EXT)]; + +@@ -178,7 +178,7 @@ static int node_symlink(struct udev *udev, const char *node, const char *slink) + info(udev, "preserve already existing symlink '%s' to '%s'\n", + slink, target); + udev_selinux_lsetfilecon(udev, slink, S_IFLNK); +- lutimes(slink, NULL); ++ utimensat(AT_FDCWD, slink, NULL, AT_SYMLINK_NOFOLLOW); + goto exit; + } + } +-- +1.6.6 + diff --git a/0029-firmware-fix-possible-segfault-when-firmware-device-.patch b/0029-firmware-fix-possible-segfault-when-firmware-device-.patch new file mode 100644 index 0000000..05c1939 --- /dev/null +++ b/0029-firmware-fix-possible-segfault-when-firmware-device-.patch @@ -0,0 +1,40 @@ +From d44c27c5ab71dbbcfcf4745977027502309dd795 Mon Sep 17 00:00:00 2001 +From: Kay Sievers +Date: Tue, 16 Mar 2010 10:57:44 +0100 +Subject: [PATCH 29/36] firmware: fix possible segfault when firmware device goes away while loading + +Thanks to Ruediger Oertel. +--- + extras/firmware/firmware.c | 9 ++++++--- + 1 files changed, 6 insertions(+), 3 deletions(-) + +diff --git a/extras/firmware/firmware.c b/extras/firmware/firmware.c +index 16455de..92f0918 100644 +--- a/extras/firmware/firmware.c ++++ b/extras/firmware/firmware.c +@@ -63,8 +63,10 @@ static bool copy_firmware(struct udev *udev, const char *source, const char *tar + if (fwrite(buf, size, 1, ftarget) == 1) + ret = true; + exit: +- fclose(ftarget); +- fclose(fsource); ++ if (ftarget != NULL) ++ fclose(ftarget); ++ if (fsource != NULL) ++ fclose(fsource); + free(buf); + return ret; + } +@@ -178,7 +180,8 @@ int main(int argc, char **argv) + if (unlink(misspath) == 0) + util_delete_path(udev, misspath); + +- set_loading(udev, loadpath, "1"); ++ if (!set_loading(udev, loadpath, "1")) ++ goto exit; + + util_strscpyl(datapath, sizeof(datapath), udev_get_sys_path(udev), devpath, "/data", NULL); + if (!copy_firmware(udev, fwpath, datapath, statbuf.st_size)) { +-- +1.6.6 + diff --git a/0030-rules-input-create-by-path-links-for-pci-devices.patch b/0030-rules-input-create-by-path-links-for-pci-devices.patch new file mode 100644 index 0000000..c35bd60 --- /dev/null +++ b/0030-rules-input-create-by-path-links-for-pci-devices.patch @@ -0,0 +1,25 @@ +From 6b32e8192934619f787c3b5b6f0fe40c32d7d94a Mon Sep 17 00:00:00 2001 +From: Marco d'Itri +Date: Tue, 16 Mar 2010 12:44:43 +0100 +Subject: [PATCH 30/36] rules: input - create by-path/ links for pci devices + +--- + rules/rules.d/60-persistent-input.rules | 2 +- + 1 files changed, 1 insertions(+), 1 deletions(-) + +diff --git a/rules/rules.d/60-persistent-input.rules b/rules/rules.d/60-persistent-input.rules +index e4675ae..1ea4431 100644 +--- a/rules/rules.d/60-persistent-input.rules ++++ b/rules/rules.d/60-persistent-input.rules +@@ -27,7 +27,7 @@ SUBSYSTEMS=="usb", ENV{ID_BUS}=="?*", KERNEL=="event*", ENV{.INPUT_CLASS}=="", A + SYMLINK+="input/by-id/$env{ID_BUS}-$env{ID_SERIAL}-event-if$attr{bInterfaceNumber}" + + # by-path +-SUBSYSTEMS=="usb|platform", IMPORT{program}="path_id %p" ++SUBSYSTEMS=="pci|usb|platform", IMPORT{program}="path_id %p" + ENV{ID_PATH}=="?*", KERNEL=="mouse*|js*", ENV{.INPUT_CLASS}=="?*", SYMLINK+="input/by-path/$env{ID_PATH}-$env{.INPUT_CLASS}" + ENV{ID_PATH}=="?*", KERNEL=="event*", ENV{.INPUT_CLASS}=="?*", SYMLINK+="input/by-path/$env{ID_PATH}-event-$env{.INPUT_CLASS}" + # allow empty class for platform and usb devices; platform supports only a single interface that way +-- +1.6.6 + diff --git a/0031-Fix-switching-Logitech-bluetooth-adapters-into-hci-m.patch b/0031-Fix-switching-Logitech-bluetooth-adapters-into-hci-m.patch new file mode 100644 index 0000000..a773b94 --- /dev/null +++ b/0031-Fix-switching-Logitech-bluetooth-adapters-into-hci-m.patch @@ -0,0 +1,29 @@ +From 2b463cb050cbf77d9c6b51e0f5a9d89bf7eb1bc3 Mon Sep 17 00:00:00 2001 +From: Marco d'Itri +Date: Tue, 16 Mar 2010 12:47:42 +0100 +Subject: [PATCH 31/36] Fix switching Logitech bluetooth adapters into hci mode. + +http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=567237 +https://bugs.launchpad.net/ubuntu/+source/udev/+bug/444420 +--- + extras/hid2hci/70-hid2hci.rules | 4 ++-- + 1 files changed, 2 insertions(+), 2 deletions(-) + +diff --git a/extras/hid2hci/70-hid2hci.rules b/extras/hid2hci/70-hid2hci.rules +index e133afd..01ff30d 100644 +--- a/extras/hid2hci/70-hid2hci.rules ++++ b/extras/hid2hci/70-hid2hci.rules +@@ -10,8 +10,8 @@ ATTR{bInterfaceClass}=="03", ATTR{bInterfaceSubClass}=="01", ATTR{bInterfaceProt + ATTRS{bDeviceClass}=="00", ATTRS{idVendor}=="413c", ATTRS{bmAttributes}=="e0", \ + RUN+="hid2hci --method=dell --devpath=%p", ENV{HID2HCI_SWITCH}="1" + +-# Logitech devices (hidraw) +-KERNEL=="hidraw*", ATTRS{idVendor}=="046d", ATTRS{idProduct}=="c70[345abce]|c71[34bc]", \ ++# Logitech devices ++KERNEL=="hiddev*", ATTRS{idVendor}=="046d", ATTRS{idProduct}=="c70[345abce]|c71[34bc]", \ + RUN+="hid2hci --method=logitech-hid --devpath=%p" + + ENV{DEVTYPE}!="usb_device", GOTO="hid2hci_end" +-- +1.6.6 + diff --git a/0032-do-not-reset-SELinux-context-when-the-node-was-not-t.patch b/0032-do-not-reset-SELinux-context-when-the-node-was-not-t.patch new file mode 100644 index 0000000..ca136bd --- /dev/null +++ b/0032-do-not-reset-SELinux-context-when-the-node-was-not-t.patch @@ -0,0 +1,88 @@ +From 578cc8a8085a47c963b5940459e475ac5f07219c Mon Sep 17 00:00:00 2001 +From: Kay Sievers +Date: Wed, 17 Mar 2010 09:15:18 +0100 +Subject: [PATCH 32/36] do not reset SELinux context when the node was not touched + +--- + udev/udev-node.c | 42 +++++++++++++++++------------------------- + 1 files changed, 17 insertions(+), 25 deletions(-) + +diff --git a/udev/udev-node.c b/udev/udev-node.c +index 4314cce..3aee15b 100644 +--- a/udev/udev-node.c ++++ b/udev/udev-node.c +@@ -37,7 +37,6 @@ int udev_node_mknod(struct udev_device *dev, const char *file, dev_t devnum, mod + { + struct udev *udev = udev_device_get_udev(dev); + struct stat stats; +- int preserve = 0; + int err = 0; + + if (major(devnum) == 0) +@@ -54,9 +53,15 @@ int udev_node_mknod(struct udev_device *dev, const char *file, dev_t devnum, mod + if (lstat(file, &stats) == 0) { + if (((stats.st_mode & S_IFMT) == (mode & S_IFMT)) && (stats.st_rdev == devnum)) { + info(udev, "preserve file '%s', because it has correct dev_t\n", file); +- preserve = 1; +- udev_selinux_lsetfilecon(udev, file, mode); +- /* update time stamp when we re-use the node, like on media change events */ ++ if (stats.st_mode != mode || stats.st_uid != uid || stats.st_gid != gid) { ++ info(udev, "set permissions %s, %#o, uid=%u, gid=%u\n", file, mode, uid, gid); ++ chmod(file, mode); ++ chown(file, uid, gid); ++ udev_selinux_lsetfilecon(udev, file, mode); ++ } else { ++ info(udev, "preserve permissions %s, %#o, uid=%u, gid=%u\n", file, mode, uid, gid); ++ } ++ /* always update timestamp when we re-use the node, like on media change events */ + utimensat(AT_FDCWD, file, NULL, 0); + } else { + char file_tmp[UTIL_PATH_SIZE + sizeof(TMP_FILE_EXT)]; +@@ -76,7 +81,11 @@ int udev_node_mknod(struct udev_device *dev, const char *file, dev_t devnum, mod + if (err != 0) { + err(udev, "rename(%s, %s) failed: %m\n", file_tmp, file); + unlink(file_tmp); ++ goto exit; + } ++ info(udev, "set permissions %s, %#o, uid=%u, gid=%u\n", file, mode, uid, gid); ++ chmod(file, mode); ++ chown(file, uid, gid); + } + } else { + info(udev, "mknod(%s, %#o, (%u,%u))\n", file, mode, major(devnum), minor(devnum)); +@@ -90,28 +99,11 @@ int udev_node_mknod(struct udev_device *dev, const char *file, dev_t devnum, mod + err = -errno; + udev_selinux_resetfscreatecon(udev); + } while (err == -ENOENT); +- if (err != 0) { ++ if (err != 0) + err(udev, "mknod(%s, %#o, (%u,%u) failed: %m\n", file, mode, major(devnum), minor(devnum)); +- goto exit; +- } +- } +- +- if (!preserve || stats.st_mode != mode) { +- info(udev, "chmod(%s, %#o)\n", file, mode); +- err = chmod(file, mode); +- if (err != 0) { +- err(udev, "chmod(%s, %#o) failed: %m\n", file, mode); +- goto exit; +- } +- } +- +- if (!preserve || stats.st_uid != uid || stats.st_gid != gid) { +- info(udev, "chown(%s, %u, %u)\n", file, uid, gid); +- err = chown(file, uid, gid); +- if (err != 0) { +- err(udev, "chown(%s, %u, %u) failed: %m\n", file, uid, gid); +- goto exit; +- } ++ info(udev, "set permissions %s, %#o, uid=%u, gid=%u\n", file, mode, uid, gid); ++ chmod(file, mode); ++ chown(file, uid, gid); + } + exit: + return err; +-- +1.6.6 + diff --git a/0034-add-LGPL-COPYING-to-libudev-and-GUdev.patch b/0034-add-LGPL-COPYING-to-libudev-and-GUdev.patch new file mode 100644 index 0000000..8440ea9 --- /dev/null +++ b/0034-add-LGPL-COPYING-to-libudev-and-GUdev.patch @@ -0,0 +1,1035 @@ +From 23325a66ccf3a2f90a4f5d1702f60408187de28a Mon Sep 17 00:00:00 2001 +From: Kay Sievers +Date: Thu, 18 Mar 2010 09:57:44 +0100 +Subject: [PATCH 34/36] add LGPL COPYING to libudev and GUdev + +--- + extras/gudev/COPYING | 504 ++++++++++++++++++++++++++++++++++++++++++++++++++ + libudev/COPYING | 504 ++++++++++++++++++++++++++++++++++++++++++++++++++ + 2 files changed, 1008 insertions(+), 0 deletions(-) + create mode 100644 extras/gudev/COPYING + create mode 100644 libudev/COPYING + +diff --git a/extras/gudev/COPYING b/extras/gudev/COPYING +new file mode 100644 +index 0000000..8add30a +--- /dev/null ++++ b/extras/gudev/COPYING +@@ -0,0 +1,504 @@ ++ GNU LESSER GENERAL PUBLIC LICENSE ++ Version 2.1, February 1999 ++ ++ Copyright (C) 1991, 1999 Free Software Foundation, Inc. ++ 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA ++ Everyone is permitted to copy and distribute verbatim copies ++ of this license document, but changing it is not allowed. ++ ++[This is the first released version of the Lesser GPL. It also counts ++ as the successor of the GNU Library Public License, version 2, hence ++ the version number 2.1.] ++ ++ Preamble ++ ++ The licenses for most software are designed to take away your ++freedom to share and change it. By contrast, the GNU General Public ++Licenses are intended to guarantee your freedom to share and change ++free software--to make sure the software is free for all its users. ++ ++ This license, the Lesser General Public License, applies to some ++specially designated software packages--typically libraries--of the ++Free Software Foundation and other authors who decide to use it. You ++can use it too, but we suggest you first think carefully about whether ++this license or the ordinary General Public License is the better ++strategy to use in any particular case, based on the explanations below. ++ ++ When we speak of free software, we are referring to freedom of use, ++not price. Our General Public Licenses are designed to make sure that ++you have the freedom to distribute copies of free software (and charge ++for this service if you wish); that you receive source code or can get ++it if you want it; that you can change the software and use pieces of ++it in new free programs; and that you are informed that you can do ++these things. ++ ++ To protect your rights, we need to make restrictions that forbid ++distributors to deny you these rights or to ask you to surrender these ++rights. These restrictions translate to certain responsibilities for ++you if you distribute copies of the library or if you modify it. ++ ++ For example, if you distribute copies of the library, whether gratis ++or for a fee, you must give the recipients all the rights that we gave ++you. You must make sure that they, too, receive or can get the source ++code. If you link other code with the library, you must provide ++complete object files to the recipients, so that they can relink them ++with the library after making changes to the library and recompiling ++it. And you must show them these terms so they know their rights. ++ ++ We protect your rights with a two-step method: (1) we copyright the ++library, and (2) we offer you this license, which gives you legal ++permission to copy, distribute and/or modify the library. ++ ++ To protect each distributor, we want to make it very clear that ++there is no warranty for the free library. Also, if the library is ++modified by someone else and passed on, the recipients should know ++that what they have is not the original version, so that the original ++author's reputation will not be affected by problems that might be ++introduced by others. ++ ++ Finally, software patents pose a constant threat to the existence of ++any free program. We wish to make sure that a company cannot ++effectively restrict the users of a free program by obtaining a ++restrictive license from a patent holder. Therefore, we insist that ++any patent license obtained for a version of the library must be ++consistent with the full freedom of use specified in this license. ++ ++ Most GNU software, including some libraries, is covered by the ++ordinary GNU General Public License. This license, the GNU Lesser ++General Public License, applies to certain designated libraries, and ++is quite different from the ordinary General Public License. We use ++this license for certain libraries in order to permit linking those ++libraries into non-free programs. ++ ++ When a program is linked with a library, whether statically or using ++a shared library, the combination of the two is legally speaking a ++combined work, a derivative of the original library. The ordinary ++General Public License therefore permits such linking only if the ++entire combination fits its criteria of freedom. The Lesser General ++Public License permits more lax criteria for linking other code with ++the library. ++ ++ We call this license the "Lesser" General Public License because it ++does Less to protect the user's freedom than the ordinary General ++Public License. It also provides other free software developers Less ++of an advantage over competing non-free programs. These disadvantages ++are the reason we use the ordinary General Public License for many ++libraries. However, the Lesser license provides advantages in certain ++special circumstances. ++ ++ For example, on rare occasions, there may be a special need to ++encourage the widest possible use of a certain library, so that it becomes ++a de-facto standard. To achieve this, non-free programs must be ++allowed to use the library. A more frequent case is that a free ++library does the same job as widely used non-free libraries. In this ++case, there is little to gain by limiting the free library to free ++software only, so we use the Lesser General Public License. ++ ++ In other cases, permission to use a particular library in non-free ++programs enables a greater number of people to use a large body of ++free software. For example, permission to use the GNU C Library in ++non-free programs enables many more people to use the whole GNU ++operating system, as well as its variant, the GNU/Linux operating ++system. ++ ++ Although the Lesser General Public License is Less protective of the ++users' freedom, it does ensure that the user of a program that is ++linked with the Library has the freedom and the wherewithal to run ++that program using a modified version of the Library. ++ ++ The precise terms and conditions for copying, distribution and ++modification follow. Pay close attention to the difference between a ++"work based on the library" and a "work that uses the library". The ++former contains code derived from the library, whereas the latter must ++be combined with the library in order to run. ++ ++ GNU LESSER GENERAL PUBLIC LICENSE ++ TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION ++ ++ 0. This License Agreement applies to any software library or other ++program which contains a notice placed by the copyright holder or ++other authorized party saying it may be distributed under the terms of ++this Lesser General Public License (also called "this License"). ++Each licensee is addressed as "you". ++ ++ A "library" means a collection of software functions and/or data ++prepared so as to be conveniently linked with application programs ++(which use some of those functions and data) to form executables. ++ ++ The "Library", below, refers to any such software library or work ++which has been distributed under these terms. A "work based on the ++Library" means either the Library or any derivative work under ++copyright law: that is to say, a work containing the Library or a ++portion of it, either verbatim or with modifications and/or translated ++straightforwardly into another language. (Hereinafter, translation is ++included without limitation in the term "modification".) ++ ++ "Source code" for a work means the preferred form of the work for ++making modifications to it. For a library, complete source code means ++all the source code for all modules it contains, plus any associated ++interface definition files, plus the scripts used to control compilation ++and installation of the library. ++ ++ Activities other than copying, distribution and modification are not ++covered by this License; they are outside its scope. The act of ++running a program using the Library is not restricted, and output from ++such a program is covered only if its contents constitute a work based ++on the Library (independent of the use of the Library in a tool for ++writing it). Whether that is true depends on what the Library does ++and what the program that uses the Library does. ++ ++ 1. You may copy and distribute verbatim copies of the Library's ++complete source code as you receive it, in any medium, provided that ++you conspicuously and appropriately publish on each copy an ++appropriate copyright notice and disclaimer of warranty; keep intact ++all the notices that refer to this License and to the absence of any ++warranty; and distribute a copy of this License along with the ++Library. ++ ++ You may charge a fee for the physical act of transferring a copy, ++and you may at your option offer warranty protection in exchange for a ++fee. ++ ++ 2. You may modify your copy or copies of the Library or any portion ++of it, thus forming a work based on the Library, and copy and ++distribute such modifications or work under the terms of Section 1 ++above, provided that you also meet all of these conditions: ++ ++ a) The modified work must itself be a software library. ++ ++ b) You must cause the files modified to carry prominent notices ++ stating that you changed the files and the date of any change. ++ ++ c) You must cause the whole of the work to be licensed at no ++ charge to all third parties under the terms of this License. ++ ++ d) If a facility in the modified Library refers to a function or a ++ table of data to be supplied by an application program that uses ++ the facility, other than as an argument passed when the facility ++ is invoked, then you must make a good faith effort to ensure that, ++ in the event an application does not supply such function or ++ table, the facility still operates, and performs whatever part of ++ its purpose remains meaningful. ++ ++ (For example, a function in a library to compute square roots has ++ a purpose that is entirely well-defined independent of the ++ application. Therefore, Subsection 2d requires that any ++ application-supplied function or table used by this function must ++ be optional: if the application does not supply it, the square ++ root function must still compute square roots.) ++ ++These requirements apply to the modified work as a whole. If ++identifiable sections of that work are not derived from the Library, ++and can be reasonably considered independent and separate works in ++themselves, then this License, and its terms, do not apply to those ++sections when you distribute them as separate works. But when you ++distribute the same sections as part of a whole which is a work based ++on the Library, the distribution of the whole must be on the terms of ++this License, whose permissions for other licensees extend to the ++entire whole, and thus to each and every part regardless of who wrote ++it. ++ ++Thus, it is not the intent of this section to claim rights or contest ++your rights to work written entirely by you; rather, the intent is to ++exercise the right to control the distribution of derivative or ++collective works based on the Library. ++ ++In addition, mere aggregation of another work not based on the Library ++with the Library (or with a work based on the Library) on a volume of ++a storage or distribution medium does not bring the other work under ++the scope of this License. ++ ++ 3. You may opt to apply the terms of the ordinary GNU General Public ++License instead of this License to a given copy of the Library. To do ++this, you must alter all the notices that refer to this License, so ++that they refer to the ordinary GNU General Public License, version 2, ++instead of to this License. (If a newer version than version 2 of the ++ordinary GNU General Public License has appeared, then you can specify ++that version instead if you wish.) Do not make any other change in ++these notices. ++ ++ Once this change is made in a given copy, it is irreversible for ++that copy, so the ordinary GNU General Public License applies to all ++subsequent copies and derivative works made from that copy. ++ ++ This option is useful when you wish to copy part of the code of ++the Library into a program that is not a library. ++ ++ 4. You may copy and distribute the Library (or a portion or ++derivative of it, under Section 2) in object code or executable form ++under the terms of Sections 1 and 2 above provided that you accompany ++it with the complete corresponding machine-readable source code, which ++must be distributed under the terms of Sections 1 and 2 above on a ++medium customarily used for software interchange. ++ ++ If distribution of object code is made by offering access to copy ++from a designated place, then offering equivalent access to copy the ++source code from the same place satisfies the requirement to ++distribute the source code, even though third parties are not ++compelled to copy the source along with the object code. ++ ++ 5. A program that contains no derivative of any portion of the ++Library, but is designed to work with the Library by being compiled or ++linked with it, is called a "work that uses the Library". Such a ++work, in isolation, is not a derivative work of the Library, and ++therefore falls outside the scope of this License. ++ ++ However, linking a "work that uses the Library" with the Library ++creates an executable that is a derivative of the Library (because it ++contains portions of the Library), rather than a "work that uses the ++library". The executable is therefore covered by this License. ++Section 6 states terms for distribution of such executables. ++ ++ When a "work that uses the Library" uses material from a header file ++that is part of the Library, the object code for the work may be a ++derivative work of the Library even though the source code is not. ++Whether this is true is especially significant if the work can be ++linked without the Library, or if the work is itself a library. The ++threshold for this to be true is not precisely defined by law. ++ ++ If such an object file uses only numerical parameters, data ++structure layouts and accessors, and small macros and small inline ++functions (ten lines or less in length), then the use of the object ++file is unrestricted, regardless of whether it is legally a derivative ++work. (Executables containing this object code plus portions of the ++Library will still fall under Section 6.) ++ ++ Otherwise, if the work is a derivative of the Library, you may ++distribute the object code for the work under the terms of Section 6. ++Any executables containing that work also fall under Section 6, ++whether or not they are linked directly with the Library itself. ++ ++ 6. As an exception to the Sections above, you may also combine or ++link a "work that uses the Library" with the Library to produce a ++work containing portions of the Library, and distribute that work ++under terms of your choice, provided that the terms permit ++modification of the work for the customer's own use and reverse ++engineering for debugging such modifications. ++ ++ You must give prominent notice with each copy of the work that the ++Library is used in it and that the Library and its use are covered by ++this License. You must supply a copy of this License. If the work ++during execution displays copyright notices, you must include the ++copyright notice for the Library among them, as well as a reference ++directing the user to the copy of this License. Also, you must do one ++of these things: ++ ++ a) Accompany the work with the complete corresponding ++ machine-readable source code for the Library including whatever ++ changes were used in the work (which must be distributed under ++ Sections 1 and 2 above); and, if the work is an executable linked ++ with the Library, with the complete machine-readable "work that ++ uses the Library", as object code and/or source code, so that the ++ user can modify the Library and then relink to produce a modified ++ executable containing the modified Library. (It is understood ++ that the user who changes the contents of definitions files in the ++ Library will not necessarily be able to recompile the application ++ to use the modified definitions.) ++ ++ b) Use a suitable shared library mechanism for linking with the ++ Library. A suitable mechanism is one that (1) uses at run time a ++ copy of the library already present on the user's computer system, ++ rather than copying library functions into the executable, and (2) ++ will operate properly with a modified version of the library, if ++ the user installs one, as long as the modified version is ++ interface-compatible with the version that the work was made with. ++ ++ c) Accompany the work with a written offer, valid for at ++ least three years, to give the same user the materials ++ specified in Subsection 6a, above, for a charge no more ++ than the cost of performing this distribution. ++ ++ d) If distribution of the work is made by offering access to copy ++ from a designated place, offer equivalent access to copy the above ++ specified materials from the same place. ++ ++ e) Verify that the user has already received a copy of these ++ materials or that you have already sent this user a copy. ++ ++ For an executable, the required form of the "work that uses the ++Library" must include any data and utility programs needed for ++reproducing the executable from it. However, as a special exception, ++the materials to be distributed need not include anything that is ++normally distributed (in either source or binary form) with the major ++components (compiler, kernel, and so on) of the operating system on ++which the executable runs, unless that component itself accompanies ++the executable. ++ ++ It may happen that this requirement contradicts the license ++restrictions of other proprietary libraries that do not normally ++accompany the operating system. Such a contradiction means you cannot ++use both them and the Library together in an executable that you ++distribute. ++ ++ 7. You may place library facilities that are a work based on the ++Library side-by-side in a single library together with other library ++facilities not covered by this License, and distribute such a combined ++library, provided that the separate distribution of the work based on ++the Library and of the other library facilities is otherwise ++permitted, and provided that you do these two things: ++ ++ a) Accompany the combined library with a copy of the same work ++ based on the Library, uncombined with any other library ++ facilities. This must be distributed under the terms of the ++ Sections above. ++ ++ b) Give prominent notice with the combined library of the fact ++ that part of it is a work based on the Library, and explaining ++ where to find the accompanying uncombined form of the same work. ++ ++ 8. You may not copy, modify, sublicense, link with, or distribute ++the Library except as expressly provided under this License. Any ++attempt otherwise to copy, modify, sublicense, link with, or ++distribute the Library is void, and will automatically terminate your ++rights under this License. However, parties who have received copies, ++or rights, from you under this License will not have their licenses ++terminated so long as such parties remain in full compliance. ++ ++ 9. You are not required to accept this License, since you have not ++signed it. However, nothing else grants you permission to modify or ++distribute the Library or its derivative works. These actions are ++prohibited by law if you do not accept this License. Therefore, by ++modifying or distributing the Library (or any work based on the ++Library), you indicate your acceptance of this License to do so, and ++all its terms and conditions for copying, distributing or modifying ++the Library or works based on it. ++ ++ 10. Each time you redistribute the Library (or any work based on the ++Library), the recipient automatically receives a license from the ++original licensor to copy, distribute, link with or modify the Library ++subject to these terms and conditions. You may not impose any further ++restrictions on the recipients' exercise of the rights granted herein. ++You are not responsible for enforcing compliance by third parties with ++this License. ++ ++ 11. If, as a consequence of a court judgment or allegation of patent ++infringement or for any other reason (not limited to patent issues), ++conditions are imposed on you (whether by court order, agreement or ++otherwise) that contradict the conditions of this License, they do not ++excuse you from the conditions of this License. If you cannot ++distribute so as to satisfy simultaneously your obligations under this ++License and any other pertinent obligations, then as a consequence you ++may not distribute the Library at all. For example, if a patent ++license would not permit royalty-free redistribution of the Library by ++all those who receive copies directly or indirectly through you, then ++the only way you could satisfy both it and this License would be to ++refrain entirely from distribution of the Library. ++ ++If any portion of this section is held invalid or unenforceable under any ++particular circumstance, the balance of the section is intended to apply, ++and the section as a whole is intended to apply in other circumstances. ++ ++It is not the purpose of this section to induce you to infringe any ++patents or other property right claims or to contest validity of any ++such claims; this section has the sole purpose of protecting the ++integrity of the free software distribution system which is ++implemented by public license practices. Many people have made ++generous contributions to the wide range of software distributed ++through that system in reliance on consistent application of that ++system; it is up to the author/donor to decide if he or she is willing ++to distribute software through any other system and a licensee cannot ++impose that choice. ++ ++This section is intended to make thoroughly clear what is believed to ++be a consequence of the rest of this License. ++ ++ 12. If the distribution and/or use of the Library is restricted in ++certain countries either by patents or by copyrighted interfaces, the ++original copyright holder who places the Library under this License may add ++an explicit geographical distribution limitation excluding those countries, ++so that distribution is permitted only in or among countries not thus ++excluded. In such case, this License incorporates the limitation as if ++written in the body of this License. ++ ++ 13. The Free Software Foundation may publish revised and/or new ++versions of the Lesser General Public License from time to time. ++Such new versions will be similar in spirit to the present version, ++but may differ in detail to address new problems or concerns. ++ ++Each version is given a distinguishing version number. If the Library ++specifies a version number of this License which applies to it and ++"any later version", you have the option of following the terms and ++conditions either of that version or of any later version published by ++the Free Software Foundation. If the Library does not specify a ++license version number, you may choose any version ever published by ++the Free Software Foundation. ++ ++ 14. If you wish to incorporate parts of the Library into other free ++programs whose distribution conditions are incompatible with these, ++write to the author to ask for permission. For software which is ++copyrighted by the Free Software Foundation, write to the Free ++Software Foundation; we sometimes make exceptions for this. Our ++decision will be guided by the two goals of preserving the free status ++of all derivatives of our free software and of promoting the sharing ++and reuse of software generally. ++ ++ NO WARRANTY ++ ++ 15. BECAUSE THE LIBRARY IS LICENSED FREE OF CHARGE, THERE IS NO ++WARRANTY FOR THE LIBRARY, TO THE EXTENT PERMITTED BY APPLICABLE LAW. ++EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR ++OTHER PARTIES PROVIDE THE LIBRARY "AS IS" WITHOUT WARRANTY OF ANY ++KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE ++IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR ++PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE ++LIBRARY IS WITH YOU. SHOULD THE LIBRARY PROVE DEFECTIVE, YOU ASSUME ++THE COST OF ALL NECESSARY SERVICING, REPAIR OR CORRECTION. ++ ++ 16. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN ++WRITING WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY ++AND/OR REDISTRIBUTE THE LIBRARY AS PERMITTED ABOVE, BE LIABLE TO YOU ++FOR DAMAGES, INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR ++CONSEQUENTIAL DAMAGES ARISING OUT OF THE USE OR INABILITY TO USE THE ++LIBRARY (INCLUDING BUT NOT LIMITED TO LOSS OF DATA OR DATA BEING ++RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD PARTIES OR A ++FAILURE OF THE LIBRARY TO OPERATE WITH ANY OTHER SOFTWARE), EVEN IF ++SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH ++DAMAGES. ++ ++ END OF TERMS AND CONDITIONS ++ ++ How to Apply These Terms to Your New Libraries ++ ++ If you develop a new library, and you want it to be of the greatest ++possible use to the public, we recommend making it free software that ++everyone can redistribute and change. You can do so by permitting ++redistribution under these terms (or, alternatively, under the terms of the ++ordinary General Public License). ++ ++ To apply these terms, attach the following notices to the library. It is ++safest to attach them to the start of each source file to most effectively ++convey the exclusion of warranty; and each file should have at least the ++"copyright" line and a pointer to where the full notice is found. ++ ++ ++ Copyright (C) ++ ++ This library is free software; you can redistribute it and/or ++ modify it under the terms of the GNU Lesser General Public ++ License as published by the Free Software Foundation; either ++ version 2.1 of the License, or (at your option) any later version. ++ ++ This library is distributed in the hope that it will be useful, ++ but WITHOUT ANY WARRANTY; without even the implied warranty of ++ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU ++ Lesser General Public License for more details. ++ ++ You should have received a copy of the GNU Lesser General Public ++ License along with this library; if not, write to the Free Software ++ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA ++ ++Also add information on how to contact you by electronic and paper mail. ++ ++You should also get your employer (if you work as a programmer) or your ++school, if any, to sign a "copyright disclaimer" for the library, if ++necessary. Here is a sample; alter the names: ++ ++ Yoyodyne, Inc., hereby disclaims all copyright interest in the ++ library `Frob' (a library for tweaking knobs) written by James Random Hacker. ++ ++ , 1 April 1990 ++ Ty Coon, President of Vice ++ ++That's all there is to it! ++ ++ +diff --git a/libudev/COPYING b/libudev/COPYING +new file mode 100644 +index 0000000..8add30a +--- /dev/null ++++ b/libudev/COPYING +@@ -0,0 +1,504 @@ ++ GNU LESSER GENERAL PUBLIC LICENSE ++ Version 2.1, February 1999 ++ ++ Copyright (C) 1991, 1999 Free Software Foundation, Inc. ++ 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA ++ Everyone is permitted to copy and distribute verbatim copies ++ of this license document, but changing it is not allowed. ++ ++[This is the first released version of the Lesser GPL. It also counts ++ as the successor of the GNU Library Public License, version 2, hence ++ the version number 2.1.] ++ ++ Preamble ++ ++ The licenses for most software are designed to take away your ++freedom to share and change it. By contrast, the GNU General Public ++Licenses are intended to guarantee your freedom to share and change ++free software--to make sure the software is free for all its users. ++ ++ This license, the Lesser General Public License, applies to some ++specially designated software packages--typically libraries--of the ++Free Software Foundation and other authors who decide to use it. You ++can use it too, but we suggest you first think carefully about whether ++this license or the ordinary General Public License is the better ++strategy to use in any particular case, based on the explanations below. ++ ++ When we speak of free software, we are referring to freedom of use, ++not price. Our General Public Licenses are designed to make sure that ++you have the freedom to distribute copies of free software (and charge ++for this service if you wish); that you receive source code or can get ++it if you want it; that you can change the software and use pieces of ++it in new free programs; and that you are informed that you can do ++these things. ++ ++ To protect your rights, we need to make restrictions that forbid ++distributors to deny you these rights or to ask you to surrender these ++rights. These restrictions translate to certain responsibilities for ++you if you distribute copies of the library or if you modify it. ++ ++ For example, if you distribute copies of the library, whether gratis ++or for a fee, you must give the recipients all the rights that we gave ++you. You must make sure that they, too, receive or can get the source ++code. If you link other code with the library, you must provide ++complete object files to the recipients, so that they can relink them ++with the library after making changes to the library and recompiling ++it. And you must show them these terms so they know their rights. ++ ++ We protect your rights with a two-step method: (1) we copyright the ++library, and (2) we offer you this license, which gives you legal ++permission to copy, distribute and/or modify the library. ++ ++ To protect each distributor, we want to make it very clear that ++there is no warranty for the free library. Also, if the library is ++modified by someone else and passed on, the recipients should know ++that what they have is not the original version, so that the original ++author's reputation will not be affected by problems that might be ++introduced by others. ++ ++ Finally, software patents pose a constant threat to the existence of ++any free program. We wish to make sure that a company cannot ++effectively restrict the users of a free program by obtaining a ++restrictive license from a patent holder. Therefore, we insist that ++any patent license obtained for a version of the library must be ++consistent with the full freedom of use specified in this license. ++ ++ Most GNU software, including some libraries, is covered by the ++ordinary GNU General Public License. This license, the GNU Lesser ++General Public License, applies to certain designated libraries, and ++is quite different from the ordinary General Public License. We use ++this license for certain libraries in order to permit linking those ++libraries into non-free programs. ++ ++ When a program is linked with a library, whether statically or using ++a shared library, the combination of the two is legally speaking a ++combined work, a derivative of the original library. The ordinary ++General Public License therefore permits such linking only if the ++entire combination fits its criteria of freedom. The Lesser General ++Public License permits more lax criteria for linking other code with ++the library. ++ ++ We call this license the "Lesser" General Public License because it ++does Less to protect the user's freedom than the ordinary General ++Public License. It also provides other free software developers Less ++of an advantage over competing non-free programs. These disadvantages ++are the reason we use the ordinary General Public License for many ++libraries. However, the Lesser license provides advantages in certain ++special circumstances. ++ ++ For example, on rare occasions, there may be a special need to ++encourage the widest possible use of a certain library, so that it becomes ++a de-facto standard. To achieve this, non-free programs must be ++allowed to use the library. A more frequent case is that a free ++library does the same job as widely used non-free libraries. In this ++case, there is little to gain by limiting the free library to free ++software only, so we use the Lesser General Public License. ++ ++ In other cases, permission to use a particular library in non-free ++programs enables a greater number of people to use a large body of ++free software. For example, permission to use the GNU C Library in ++non-free programs enables many more people to use the whole GNU ++operating system, as well as its variant, the GNU/Linux operating ++system. ++ ++ Although the Lesser General Public License is Less protective of the ++users' freedom, it does ensure that the user of a program that is ++linked with the Library has the freedom and the wherewithal to run ++that program using a modified version of the Library. ++ ++ The precise terms and conditions for copying, distribution and ++modification follow. Pay close attention to the difference between a ++"work based on the library" and a "work that uses the library". The ++former contains code derived from the library, whereas the latter must ++be combined with the library in order to run. ++ ++ GNU LESSER GENERAL PUBLIC LICENSE ++ TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION ++ ++ 0. This License Agreement applies to any software library or other ++program which contains a notice placed by the copyright holder or ++other authorized party saying it may be distributed under the terms of ++this Lesser General Public License (also called "this License"). ++Each licensee is addressed as "you". ++ ++ A "library" means a collection of software functions and/or data ++prepared so as to be conveniently linked with application programs ++(which use some of those functions and data) to form executables. ++ ++ The "Library", below, refers to any such software library or work ++which has been distributed under these terms. A "work based on the ++Library" means either the Library or any derivative work under ++copyright law: that is to say, a work containing the Library or a ++portion of it, either verbatim or with modifications and/or translated ++straightforwardly into another language. (Hereinafter, translation is ++included without limitation in the term "modification".) ++ ++ "Source code" for a work means the preferred form of the work for ++making modifications to it. For a library, complete source code means ++all the source code for all modules it contains, plus any associated ++interface definition files, plus the scripts used to control compilation ++and installation of the library. ++ ++ Activities other than copying, distribution and modification are not ++covered by this License; they are outside its scope. The act of ++running a program using the Library is not restricted, and output from ++such a program is covered only if its contents constitute a work based ++on the Library (independent of the use of the Library in a tool for ++writing it). Whether that is true depends on what the Library does ++and what the program that uses the Library does. ++ ++ 1. You may copy and distribute verbatim copies of the Library's ++complete source code as you receive it, in any medium, provided that ++you conspicuously and appropriately publish on each copy an ++appropriate copyright notice and disclaimer of warranty; keep intact ++all the notices that refer to this License and to the absence of any ++warranty; and distribute a copy of this License along with the ++Library. ++ ++ You may charge a fee for the physical act of transferring a copy, ++and you may at your option offer warranty protection in exchange for a ++fee. ++ ++ 2. You may modify your copy or copies of the Library or any portion ++of it, thus forming a work based on the Library, and copy and ++distribute such modifications or work under the terms of Section 1 ++above, provided that you also meet all of these conditions: ++ ++ a) The modified work must itself be a software library. ++ ++ b) You must cause the files modified to carry prominent notices ++ stating that you changed the files and the date of any change. ++ ++ c) You must cause the whole of the work to be licensed at no ++ charge to all third parties under the terms of this License. ++ ++ d) If a facility in the modified Library refers to a function or a ++ table of data to be supplied by an application program that uses ++ the facility, other than as an argument passed when the facility ++ is invoked, then you must make a good faith effort to ensure that, ++ in the event an application does not supply such function or ++ table, the facility still operates, and performs whatever part of ++ its purpose remains meaningful. ++ ++ (For example, a function in a library to compute square roots has ++ a purpose that is entirely well-defined independent of the ++ application. Therefore, Subsection 2d requires that any ++ application-supplied function or table used by this function must ++ be optional: if the application does not supply it, the square ++ root function must still compute square roots.) ++ ++These requirements apply to the modified work as a whole. If ++identifiable sections of that work are not derived from the Library, ++and can be reasonably considered independent and separate works in ++themselves, then this License, and its terms, do not apply to those ++sections when you distribute them as separate works. But when you ++distribute the same sections as part of a whole which is a work based ++on the Library, the distribution of the whole must be on the terms of ++this License, whose permissions for other licensees extend to the ++entire whole, and thus to each and every part regardless of who wrote ++it. ++ ++Thus, it is not the intent of this section to claim rights or contest ++your rights to work written entirely by you; rather, the intent is to ++exercise the right to control the distribution of derivative or ++collective works based on the Library. ++ ++In addition, mere aggregation of another work not based on the Library ++with the Library (or with a work based on the Library) on a volume of ++a storage or distribution medium does not bring the other work under ++the scope of this License. ++ ++ 3. You may opt to apply the terms of the ordinary GNU General Public ++License instead of this License to a given copy of the Library. To do ++this, you must alter all the notices that refer to this License, so ++that they refer to the ordinary GNU General Public License, version 2, ++instead of to this License. (If a newer version than version 2 of the ++ordinary GNU General Public License has appeared, then you can specify ++that version instead if you wish.) Do not make any other change in ++these notices. ++ ++ Once this change is made in a given copy, it is irreversible for ++that copy, so the ordinary GNU General Public License applies to all ++subsequent copies and derivative works made from that copy. ++ ++ This option is useful when you wish to copy part of the code of ++the Library into a program that is not a library. ++ ++ 4. You may copy and distribute the Library (or a portion or ++derivative of it, under Section 2) in object code or executable form ++under the terms of Sections 1 and 2 above provided that you accompany ++it with the complete corresponding machine-readable source code, which ++must be distributed under the terms of Sections 1 and 2 above on a ++medium customarily used for software interchange. ++ ++ If distribution of object code is made by offering access to copy ++from a designated place, then offering equivalent access to copy the ++source code from the same place satisfies the requirement to ++distribute the source code, even though third parties are not ++compelled to copy the source along with the object code. ++ ++ 5. A program that contains no derivative of any portion of the ++Library, but is designed to work with the Library by being compiled or ++linked with it, is called a "work that uses the Library". Such a ++work, in isolation, is not a derivative work of the Library, and ++therefore falls outside the scope of this License. ++ ++ However, linking a "work that uses the Library" with the Library ++creates an executable that is a derivative of the Library (because it ++contains portions of the Library), rather than a "work that uses the ++library". The executable is therefore covered by this License. ++Section 6 states terms for distribution of such executables. ++ ++ When a "work that uses the Library" uses material from a header file ++that is part of the Library, the object code for the work may be a ++derivative work of the Library even though the source code is not. ++Whether this is true is especially significant if the work can be ++linked without the Library, or if the work is itself a library. The ++threshold for this to be true is not precisely defined by law. ++ ++ If such an object file uses only numerical parameters, data ++structure layouts and accessors, and small macros and small inline ++functions (ten lines or less in length), then the use of the object ++file is unrestricted, regardless of whether it is legally a derivative ++work. (Executables containing this object code plus portions of the ++Library will still fall under Section 6.) ++ ++ Otherwise, if the work is a derivative of the Library, you may ++distribute the object code for the work under the terms of Section 6. ++Any executables containing that work also fall under Section 6, ++whether or not they are linked directly with the Library itself. ++ ++ 6. As an exception to the Sections above, you may also combine or ++link a "work that uses the Library" with the Library to produce a ++work containing portions of the Library, and distribute that work ++under terms of your choice, provided that the terms permit ++modification of the work for the customer's own use and reverse ++engineering for debugging such modifications. ++ ++ You must give prominent notice with each copy of the work that the ++Library is used in it and that the Library and its use are covered by ++this License. You must supply a copy of this License. If the work ++during execution displays copyright notices, you must include the ++copyright notice for the Library among them, as well as a reference ++directing the user to the copy of this License. Also, you must do one ++of these things: ++ ++ a) Accompany the work with the complete corresponding ++ machine-readable source code for the Library including whatever ++ changes were used in the work (which must be distributed under ++ Sections 1 and 2 above); and, if the work is an executable linked ++ with the Library, with the complete machine-readable "work that ++ uses the Library", as object code and/or source code, so that the ++ user can modify the Library and then relink to produce a modified ++ executable containing the modified Library. (It is understood ++ that the user who changes the contents of definitions files in the ++ Library will not necessarily be able to recompile the application ++ to use the modified definitions.) ++ ++ b) Use a suitable shared library mechanism for linking with the ++ Library. A suitable mechanism is one that (1) uses at run time a ++ copy of the library already present on the user's computer system, ++ rather than copying library functions into the executable, and (2) ++ will operate properly with a modified version of the library, if ++ the user installs one, as long as the modified version is ++ interface-compatible with the version that the work was made with. ++ ++ c) Accompany the work with a written offer, valid for at ++ least three years, to give the same user the materials ++ specified in Subsection 6a, above, for a charge no more ++ than the cost of performing this distribution. ++ ++ d) If distribution of the work is made by offering access to copy ++ from a designated place, offer equivalent access to copy the above ++ specified materials from the same place. ++ ++ e) Verify that the user has already received a copy of these ++ materials or that you have already sent this user a copy. ++ ++ For an executable, the required form of the "work that uses the ++Library" must include any data and utility programs needed for ++reproducing the executable from it. However, as a special exception, ++the materials to be distributed need not include anything that is ++normally distributed (in either source or binary form) with the major ++components (compiler, kernel, and so on) of the operating system on ++which the executable runs, unless that component itself accompanies ++the executable. ++ ++ It may happen that this requirement contradicts the license ++restrictions of other proprietary libraries that do not normally ++accompany the operating system. Such a contradiction means you cannot ++use both them and the Library together in an executable that you ++distribute. ++ ++ 7. You may place library facilities that are a work based on the ++Library side-by-side in a single library together with other library ++facilities not covered by this License, and distribute such a combined ++library, provided that the separate distribution of the work based on ++the Library and of the other library facilities is otherwise ++permitted, and provided that you do these two things: ++ ++ a) Accompany the combined library with a copy of the same work ++ based on the Library, uncombined with any other library ++ facilities. This must be distributed under the terms of the ++ Sections above. ++ ++ b) Give prominent notice with the combined library of the fact ++ that part of it is a work based on the Library, and explaining ++ where to find the accompanying uncombined form of the same work. ++ ++ 8. You may not copy, modify, sublicense, link with, or distribute ++the Library except as expressly provided under this License. Any ++attempt otherwise to copy, modify, sublicense, link with, or ++distribute the Library is void, and will automatically terminate your ++rights under this License. However, parties who have received copies, ++or rights, from you under this License will not have their licenses ++terminated so long as such parties remain in full compliance. ++ ++ 9. You are not required to accept this License, since you have not ++signed it. However, nothing else grants you permission to modify or ++distribute the Library or its derivative works. These actions are ++prohibited by law if you do not accept this License. Therefore, by ++modifying or distributing the Library (or any work based on the ++Library), you indicate your acceptance of this License to do so, and ++all its terms and conditions for copying, distributing or modifying ++the Library or works based on it. ++ ++ 10. Each time you redistribute the Library (or any work based on the ++Library), the recipient automatically receives a license from the ++original licensor to copy, distribute, link with or modify the Library ++subject to these terms and conditions. You may not impose any further ++restrictions on the recipients' exercise of the rights granted herein. ++You are not responsible for enforcing compliance by third parties with ++this License. ++ ++ 11. If, as a consequence of a court judgment or allegation of patent ++infringement or for any other reason (not limited to patent issues), ++conditions are imposed on you (whether by court order, agreement or ++otherwise) that contradict the conditions of this License, they do not ++excuse you from the conditions of this License. If you cannot ++distribute so as to satisfy simultaneously your obligations under this ++License and any other pertinent obligations, then as a consequence you ++may not distribute the Library at all. For example, if a patent ++license would not permit royalty-free redistribution of the Library by ++all those who receive copies directly or indirectly through you, then ++the only way you could satisfy both it and this License would be to ++refrain entirely from distribution of the Library. ++ ++If any portion of this section is held invalid or unenforceable under any ++particular circumstance, the balance of the section is intended to apply, ++and the section as a whole is intended to apply in other circumstances. ++ ++It is not the purpose of this section to induce you to infringe any ++patents or other property right claims or to contest validity of any ++such claims; this section has the sole purpose of protecting the ++integrity of the free software distribution system which is ++implemented by public license practices. Many people have made ++generous contributions to the wide range of software distributed ++through that system in reliance on consistent application of that ++system; it is up to the author/donor to decide if he or she is willing ++to distribute software through any other system and a licensee cannot ++impose that choice. ++ ++This section is intended to make thoroughly clear what is believed to ++be a consequence of the rest of this License. ++ ++ 12. If the distribution and/or use of the Library is restricted in ++certain countries either by patents or by copyrighted interfaces, the ++original copyright holder who places the Library under this License may add ++an explicit geographical distribution limitation excluding those countries, ++so that distribution is permitted only in or among countries not thus ++excluded. In such case, this License incorporates the limitation as if ++written in the body of this License. ++ ++ 13. The Free Software Foundation may publish revised and/or new ++versions of the Lesser General Public License from time to time. ++Such new versions will be similar in spirit to the present version, ++but may differ in detail to address new problems or concerns. ++ ++Each version is given a distinguishing version number. If the Library ++specifies a version number of this License which applies to it and ++"any later version", you have the option of following the terms and ++conditions either of that version or of any later version published by ++the Free Software Foundation. If the Library does not specify a ++license version number, you may choose any version ever published by ++the Free Software Foundation. ++ ++ 14. If you wish to incorporate parts of the Library into other free ++programs whose distribution conditions are incompatible with these, ++write to the author to ask for permission. For software which is ++copyrighted by the Free Software Foundation, write to the Free ++Software Foundation; we sometimes make exceptions for this. Our ++decision will be guided by the two goals of preserving the free status ++of all derivatives of our free software and of promoting the sharing ++and reuse of software generally. ++ ++ NO WARRANTY ++ ++ 15. BECAUSE THE LIBRARY IS LICENSED FREE OF CHARGE, THERE IS NO ++WARRANTY FOR THE LIBRARY, TO THE EXTENT PERMITTED BY APPLICABLE LAW. ++EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR ++OTHER PARTIES PROVIDE THE LIBRARY "AS IS" WITHOUT WARRANTY OF ANY ++KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE ++IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR ++PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE ++LIBRARY IS WITH YOU. SHOULD THE LIBRARY PROVE DEFECTIVE, YOU ASSUME ++THE COST OF ALL NECESSARY SERVICING, REPAIR OR CORRECTION. ++ ++ 16. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN ++WRITING WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY ++AND/OR REDISTRIBUTE THE LIBRARY AS PERMITTED ABOVE, BE LIABLE TO YOU ++FOR DAMAGES, INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR ++CONSEQUENTIAL DAMAGES ARISING OUT OF THE USE OR INABILITY TO USE THE ++LIBRARY (INCLUDING BUT NOT LIMITED TO LOSS OF DATA OR DATA BEING ++RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD PARTIES OR A ++FAILURE OF THE LIBRARY TO OPERATE WITH ANY OTHER SOFTWARE), EVEN IF ++SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH ++DAMAGES. ++ ++ END OF TERMS AND CONDITIONS ++ ++ How to Apply These Terms to Your New Libraries ++ ++ If you develop a new library, and you want it to be of the greatest ++possible use to the public, we recommend making it free software that ++everyone can redistribute and change. You can do so by permitting ++redistribution under these terms (or, alternatively, under the terms of the ++ordinary General Public License). ++ ++ To apply these terms, attach the following notices to the library. It is ++safest to attach them to the start of each source file to most effectively ++convey the exclusion of warranty; and each file should have at least the ++"copyright" line and a pointer to where the full notice is found. ++ ++ ++ Copyright (C) ++ ++ This library is free software; you can redistribute it and/or ++ modify it under the terms of the GNU Lesser General Public ++ License as published by the Free Software Foundation; either ++ version 2.1 of the License, or (at your option) any later version. ++ ++ This library is distributed in the hope that it will be useful, ++ but WITHOUT ANY WARRANTY; without even the implied warranty of ++ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU ++ Lesser General Public License for more details. ++ ++ You should have received a copy of the GNU Lesser General Public ++ License along with this library; if not, write to the Free Software ++ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA ++ ++Also add information on how to contact you by electronic and paper mail. ++ ++You should also get your employer (if you work as a programmer) or your ++school, if any, to sign a "copyright disclaimer" for the library, if ++necessary. Here is a sample; alter the names: ++ ++ Yoyodyne, Inc., hereby disclaims all copyright interest in the ++ library `Frob' (a library for tweaking knobs) written by James Random Hacker. ++ ++ , 1 April 1990 ++ Ty Coon, President of Vice ++ ++That's all there is to it! ++ ++ +-- +1.6.6 + diff --git a/0035-cdrom_id-open-non-mounted-optical-media-with-O_EXCL.patch b/0035-cdrom_id-open-non-mounted-optical-media-with-O_EXCL.patch new file mode 100644 index 0000000..870a344 --- /dev/null +++ b/0035-cdrom_id-open-non-mounted-optical-media-with-O_EXCL.patch @@ -0,0 +1,58 @@ +From 38a3cde11bc77af49a96245b8a8a0f2b583a344c Mon Sep 17 00:00:00 2001 +From: Kay Sievers +Date: Thu, 18 Mar 2010 11:14:32 +0100 +Subject: [PATCH 35/36] cdrom_id: open non-mounted optical media with O_EXCL + +This should prevent confusing drives during CD burning sessions. Based +on a patch from Harald Hoyer. +--- + extras/cdrom_id/cdrom_id.c | 26 +++++++++++++++++++++++++- + 1 files changed, 25 insertions(+), 1 deletions(-) + +diff --git a/extras/cdrom_id/cdrom_id.c b/extras/cdrom_id/cdrom_id.c +index 2380b15..e485768 100644 +--- a/extras/cdrom_id/cdrom_id.c ++++ b/extras/cdrom_id/cdrom_id.c +@@ -112,6 +112,30 @@ static unsigned long long int cd_media_session_last_offset; + #define ASC(errcode) (((errcode) >> 8) & 0xFF) + #define ASCQ(errcode) ((errcode) & 0xFF) + ++static int is_mounted(const char *device) ++{ ++ struct stat statbuf; ++ FILE *fp; ++ int maj, min; ++ int mounted = 0; ++ ++ if (stat(device, &statbuf) < 0) ++ return -ENODEV; ++ ++ fp = fopen("/proc/self/mountinfo", "r"); ++ if (fp == NULL) ++ return -ENOSYS; ++ while (fscanf(fp, "%*s %*s %i:%i %*[^\n]", &maj, &min) == 2) { ++ printf("got %u %u\n", maj, min); ++ if (makedev(maj, min) == statbuf.st_rdev) { ++ mounted = 1; ++ break; ++ } ++ } ++ fclose(fp); ++ return mounted; ++} ++ + static void info_scsi_cmd_err(struct udev *udev, char *cmd, int err) + { + if (err == -1) { +@@ -568,7 +592,7 @@ int main(int argc, char *argv[]) + goto exit; + } + +- fd = open(node, O_RDONLY | O_NONBLOCK); ++ fd = open(node, O_RDONLY|O_NONBLOCK|(is_mounted(node) ? 0 : O_EXCL)); + if (fd < 0) { + info(udev, "unable to open '%s'\n", node); + fprintf(stderr, "unable to open '%s'\n", node); +-- +1.6.6 + diff --git a/0036-modeswitch-morph-into-tool-that-only-switches-Mobile.patch b/0036-modeswitch-morph-into-tool-that-only-switches-Mobile.patch new file mode 100644 index 0000000..45f1397 --- /dev/null +++ b/0036-modeswitch-morph-into-tool-that-only-switches-Mobile.patch @@ -0,0 +1,2142 @@ +From 4dd9b291354e76f34b0d6d7b5c3b28d03a624418 Mon Sep 17 00:00:00 2001 +From: Dan Williams +Date: Thu, 18 Mar 2010 17:13:59 -0700 +Subject: [PATCH 36/36] modeswitch: morph into tool that only switches Mobile Action cables + +Remove option modeswitching code; use usb_modeswitch already, people. +--- + Makefile.am | 27 +- + extras/mobile-action-modeswitch/.gitignore | 1 + + .../61-mobile-action.rules | 15 + + extras/mobile-action-modeswitch/ma8280p_us.c | 462 ++++++++++++++++++++ + extras/mobile-action-modeswitch/ma8280p_us.h | 24 + + .../mobile-action-modeswitch.c | 262 +++++++++++ + extras/mobile-action-modeswitch/utils.c | 83 ++++ + extras/mobile-action-modeswitch/utils.h | 32 ++ + extras/modem-modeswitch/.gitignore | 1 - + extras/modem-modeswitch/61-mobile-action.rules | 15 - + .../61-option-modem-modeswitch.rules | 44 -- + extras/modem-modeswitch/ma8280p_us.c | 462 -------------------- + extras/modem-modeswitch/ma8280p_us.h | 24 - + extras/modem-modeswitch/modem-modeswitch.c | 266 ----------- + extras/modem-modeswitch/option.c | 131 ------ + extras/modem-modeswitch/option.h | 29 -- + extras/modem-modeswitch/utils.c | 83 ---- + extras/modem-modeswitch/utils.h | 32 -- + 18 files changed, 891 insertions(+), 1102 deletions(-) + create mode 100644 extras/mobile-action-modeswitch/.gitignore + create mode 100644 extras/mobile-action-modeswitch/61-mobile-action.rules + create mode 100644 extras/mobile-action-modeswitch/ma8280p_us.c + create mode 100644 extras/mobile-action-modeswitch/ma8280p_us.h + create mode 100644 extras/mobile-action-modeswitch/mobile-action-modeswitch.c + create mode 100644 extras/mobile-action-modeswitch/utils.c + create mode 100644 extras/mobile-action-modeswitch/utils.h + delete mode 100644 extras/modem-modeswitch/.gitignore + delete mode 100644 extras/modem-modeswitch/61-mobile-action.rules + delete mode 100644 extras/modem-modeswitch/61-option-modem-modeswitch.rules + delete mode 100644 extras/modem-modeswitch/ma8280p_us.c + delete mode 100644 extras/modem-modeswitch/ma8280p_us.h + delete mode 100644 extras/modem-modeswitch/modem-modeswitch.c + delete mode 100644 extras/modem-modeswitch/option.c + delete mode 100644 extras/modem-modeswitch/option.h + delete mode 100644 extras/modem-modeswitch/utils.c + delete mode 100644 extras/modem-modeswitch/utils.h + +diff --git a/Makefile.am b/Makefile.am +index 99a0133..68a68d9 100644 +--- a/Makefile.am ++++ b/Makefile.am +@@ -448,24 +448,21 @@ extras_usb_db_pci_db_LDADD = libudev/libudev-private.la + libexec_PROGRAMS += extras/usb-db/pci-db + + # ------------------------------------------------------------------------------ +-# modem-modeswitch - magic config switch for 3G modems +-# ------------------------------------------------------------------------------ +-extras_modem_modeswitch_modem_modeswitch_SOURCES =\ +- extras/modem-modeswitch/modem-modeswitch.c \ +- extras/modem-modeswitch/utils.c \ +- extras/modem-modeswitch/utils.h \ +- extras/modem-modeswitch/ma8280p_us.c \ +- extras/modem-modeswitch/ma8280p_us.h \ +- extras/modem-modeswitch/option.c \ +- extras/modem-modeswitch/option.h +-extras_modem_modeswitch_modem_modeswitch_CPPFLAGS = $(AM_CPPFLAGS) $(LIBUSB_CFLAGS) +-extras_modem_modeswitch_modem_modeswitch_LDADD = libudev/libudev-private.la $(LIBUSB_LIBS) ++# mobile-action-modeswitch - switch Mobile Action cables into serial mode ++# ------------------------------------------------------------------------------ ++extras_mobile_action_modeswitch_mobile_action_modeswitch_SOURCES =\ ++ extras/mobile-action-modeswitch/mobile-action-modeswitch.c \ ++ extras/mobile-action-modeswitch/utils.c \ ++ extras/mobile-action-modeswitch/utils.h \ ++ extras/mobile-action-modeswitch/ma8280p_us.c \ ++ extras/mobile-action-modeswitch/ma8280p_us.h ++extras_mobile_action_modeswitch_mobile_action_modeswitch_CPPFLAGS = $(AM_CPPFLAGS) $(LIBUSB_CFLAGS) ++extras_mobile_action_modeswitch_mobile_action_modeswitch_LDADD = libudev/libudev-private.la $(LIBUSB_LIBS) + + dist_udevrules_DATA += \ +- extras/modem-modeswitch/61-option-modem-modeswitch.rules \ +- extras/modem-modeswitch/61-mobile-action.rules ++ extras/mobile-action-modeswitch/61-mobile-action.rules + +-libexec_PROGRAMS += extras/modem-modeswitch/modem-modeswitch ++libexec_PROGRAMS += extras/mobile-action-modeswitch/mobile-action-modeswitch + + # ------------------------------------------------------------------------------ + # keymap - map custom hardware's multimedia keys +diff --git a/extras/mobile-action-modeswitch/61-mobile-action.rules b/extras/mobile-action-modeswitch/61-mobile-action.rules +new file mode 100644 +index 0000000..0af27a5 +--- /dev/null ++++ b/extras/mobile-action-modeswitch/61-mobile-action.rules +@@ -0,0 +1,15 @@ ++ACTION!="add", GOTO="mobile_action_end" ++ ++# ATTENTION: DO NOT USE THIS FILE FOR ANYTHING EXCEPT ++# MOBILE ACTION CABLES. DO NOT USE IT FOR 3G DEVICES! ++ ++SUBSYSTEM=="usb", ATTR{bDeviceClass}=="00|ff", ATTR{bDeviceSubClass}=="00|ff", ENV{DEVTYPE}=="usb_device", GOTO="mobile_action_switch" ++GOTO="mobile_action_end" ++ ++LABEL="mobile_action_switch" ++ ++# Mobile Action cables like the 8280p and 8230p ++ATTRS{idVendor}=="0df7", ATTRS{idProduct}=="0800", RUN+="mobile-action-modeswitch -v 0x%s{idVendor} -p 0x%s{idProduct} -t mobile-action-8280p" ++ ++LABEL="mobile_action_end" ++ +diff --git a/extras/mobile-action-modeswitch/ma8280p_us.c b/extras/mobile-action-modeswitch/ma8280p_us.c +new file mode 100644 +index 0000000..d7cf4f4 +--- /dev/null ++++ b/extras/mobile-action-modeswitch/ma8280p_us.c +@@ -0,0 +1,462 @@ ++/* http://www.natox.be/ma8280p/ ++ * http://www.leopold.dk/~martin/ma-8230p.html ++ * http://figvam.blogspot.com/2007/01/mobile-action-8730p-usb-cable-and-linux.html ++ */ ++ ++/* ++ * ++ * Code by davy hollevoet. This is simply an adaptation of code ++ * generated by usbsnoop2libusb. (http://iki.fi/lindi/usb/usbsnoop2libusb.pl) ++ * ++ * This code is released under both the GPL version 2 and BSD licenses. ++ * Either license may be used. ++ * ++ * GPLv2 ++ * ******** ++ * This program is free software; you can redistribute it and/or ++ * modify it under the terms of the GNU General Public License ++ * as published by the Free Software Foundation; either version 2 ++ * of the License, or (at your option) any later version. ++ * ++ * This program is distributed in the hope that it will be useful, ++ * but WITHOUT ANY WARRANTY; without even the implied warranty of ++ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the ++ * GNU General Public License for more details. ++ * ++ * In addition: ++ * ++ * Redistribution and use in source and binary forms, with or without ++ * modification, are permitted provided that the following conditions ++ * are met: ++ * ++ * 1. Redistributions of source code must retain the above copyright ++ * notice, this list of conditions and the following disclaimer. ++ * 2. Redistributions in binary form must reproduce the above copyright ++ * notice, this list of conditions and the following disclaimer in the ++ * documentation and/or other materials provided with the distribution. ++ * 3. The name of the author may not be used to endorse or promote ++ * products derived from this software without specific prior written ++ * permission. ++ * ++ * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR ++ * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED ++ * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ++ * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, ++ * INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES ++ * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR ++ * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) ++ * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, ++ * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING ++ * IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE ++ * POSSIBILITY OF SUCH DAMAGE. ++ * ++ * BSD ++ * ****** ++ * Copyright (c) 1998, Regents of the University of California ++ * All rights reserved. ++ * Redistribution and use in source and binary forms, with or without ++ * modification, are permitted provided that the following conditions are met: ++ * ++ * * Redistributions of source code must retain the above copyright ++ * notice, this list of conditions and the following disclaimer. ++ * * Redistributions in binary form must reproduce the above copyright ++ * notice, this list of conditions and the following disclaimer in the ++ * documentation and/or other materials provided with the distribution. ++ * * Neither the name of the University of California, Berkeley nor the ++ * names of its contributors may be used to endorse or promote products ++ * derived from this software without specific prior written permission. ++ * ++ * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS "AS IS" AND ANY ++ * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED ++ * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE ++ * DISCLAIMED. IN NO EVENT SHALL THE REGENTS AND CONTRIBUTORS BE LIABLE FOR ANY ++ * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES ++ * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; ++ * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ++ * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT ++ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS ++ * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. ++ * ++ */ ++ ++/* This file is (mostly) generated with usbsnoop2libusb.pl from a usbsnoop log file. */ ++/* Latest version of the script should be in http://iki.fi/lindi/usb/usbsnoop2libusb.pl */ ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++ ++#include "utils.h" ++#include "ma8280p_us.h" ++ ++static void msleep(long msec) ++{ ++ struct timespec duration = { 0, msec * 1000 * 1000 }; ++ ++ nanosleep(&duration, NULL); ++} ++ ++int ma8280p_switch (struct usb_dev_handle *devh, struct usb_device *dev) ++{ ++ int ret = 1; ++ char *buf = NULL; ++ ++ buf = malloc (65535); ++ if (!buf) { ++ error ("%s: not enough memory", dev->filename, ret); ++ return -1; ++ } ++ ++ usb_get_descriptor(devh, 0x0000001, 0x0000000, buf, 0x0000012); ++ msleep(6); ++ usb_get_descriptor(devh, 0x0000001, 0x0000000, buf, 0x0000012); ++ msleep(6); ++ usb_get_descriptor(devh, 0x0000002, 0x0000000, buf, 0x0000400); ++ msleep(10); ++ ret = usb_release_interface(devh, 0); ++ if (ret != 0) ++ debug ("%s: failed to release interface before set_configuration: %d", dev->filename, ret); ++ usb_set_configuration(devh, 0x0000001); ++ ret = usb_claim_interface(devh, 0); ++ if (ret != 0) ++ debug ("%s: claim after set_configuration failed with error %d", dev->filename, ret); ++ //usb_set_altinterface(devh, 0); ++ //msleep(33); ++ usb_control_msg(devh, USB_TYPE_CLASS + USB_RECIP_INTERFACE + USB_ENDPOINT_IN, 0x0000001, 0x0000300, 0x0000000, buf, 0x0000008, 1000); ++ msleep(5); ++ memcpy(buf, "\xb0\x04\x00\x00\x02\x90\x26\x86", 0x0000008); ++ usb_control_msg(devh, USB_TYPE_CLASS + USB_RECIP_INTERFACE, 0x0000009, 0x0000300, 0x0000000, buf, 0x0000008, 1000); ++ msleep(4); ++ memcpy(buf, "\xb0\x04\x00\x00\x02\x90\x26\x86", 0x0000008); ++ usb_control_msg(devh, USB_TYPE_CLASS + USB_RECIP_INTERFACE, 0x0000009, 0x0000300, 0x0000000, buf, 0x0000008, 1000); ++ msleep(4); ++ ++ msleep(4); ++ usb_interrupt_read(devh, 0x00000081, buf, 0x0000008, 1000); ++ msleep(6); ++ usb_interrupt_read(devh, 0x00000081, buf, 0x0000008, 1000); ++ msleep(1); ++ //URB_FUNCTION_GET_STATUS_FROM_ENDPOINT skipped ++ msleep(4); ++ memcpy(buf, "\x37\x01\xfe\xdb\xc1\x33\x1f\x83", 0x0000008); ++ usb_interrupt_write(devh, 0x00000002, buf, 0x0000008, 1000); ++ msleep(3); ++ usb_interrupt_read(devh, 0x00000081, buf, 0x0000008, 1000); ++ msleep(1); ++ memcpy(buf, "\x37\x0e\xb5\x9d\x3b\x8a\x91\x51", 0x0000008); ++ usb_interrupt_write(devh, 0x00000002, buf, 0x0000008, 1000); ++ msleep(7); ++ usb_interrupt_read(devh, 0x00000081, buf, 0x0000008, 1000); ++ msleep(1); ++ memcpy(buf, "\x34\x87\xba\x0d\xfc\x8a\x91\x51", 0x0000008); ++ usb_interrupt_write(devh, 0x00000002, buf, 0x0000008, 1000); ++ msleep(7); ++ usb_interrupt_read(devh, 0x00000081, buf, 0x0000008, 1000); ++ msleep(8); ++ usb_interrupt_read(devh, 0x00000081, buf, 0x0000008, 1000); ++ msleep(8); ++ usb_interrupt_read(devh, 0x00000081, buf, 0x0000008, 1000); ++ msleep(8); ++ usb_interrupt_read(devh, 0x00000081, buf, 0x0000008, 1000); ++ msleep(8); ++ usb_interrupt_read(devh, 0x00000081, buf, 0x0000008, 1000); ++ msleep(8); ++ usb_interrupt_read(devh, 0x00000081, buf, 0x0000008, 1000); ++ msleep(8); ++ usb_interrupt_read(devh, 0x00000081, buf, 0x0000008, 1000); ++ msleep(8); ++ usb_interrupt_read(devh, 0x00000081, buf, 0x0000008, 1000); ++ msleep(8); ++ usb_interrupt_read(devh, 0x00000081, buf, 0x0000008, 1000); ++ msleep(8); ++ usb_interrupt_read(devh, 0x00000081, buf, 0x0000008, 1000); ++ msleep(8); ++ usb_interrupt_read(devh, 0x00000081, buf, 0x0000008, 1000); ++ msleep(8); ++ usb_interrupt_read(devh, 0x00000081, buf, 0x0000008, 1000); ++ msleep(8); ++ usb_interrupt_read(devh, 0x00000081, buf, 0x0000008, 1000); ++ msleep(8); ++ usb_interrupt_read(devh, 0x00000081, buf, 0x0000008, 1000); ++ msleep(8); ++ usb_interrupt_read(devh, 0x00000081, buf, 0x0000008, 1000); ++ msleep(8); ++ usb_interrupt_read(devh, 0x00000081, buf, 0x0000008, 1000); ++ msleep(8); ++ usb_interrupt_read(devh, 0x00000081, buf, 0x0000008, 1000); ++ msleep(8); ++ usb_interrupt_read(devh, 0x00000081, buf, 0x0000008, 1000); ++ msleep(8); ++ usb_interrupt_read(devh, 0x00000081, buf, 0x0000008, 1000); ++ msleep(8); ++ usb_interrupt_read(devh, 0x00000081, buf, 0x0000008, 1000); ++ msleep(8); ++ usb_interrupt_read(devh, 0x00000081, buf, 0x0000008, 1000); ++ msleep(8); ++ usb_interrupt_read(devh, 0x00000081, buf, 0x0000008, 1000); ++ msleep(8); ++ usb_interrupt_read(devh, 0x00000081, buf, 0x0000008, 1000); ++ msleep(8); ++ usb_interrupt_read(devh, 0x00000081, buf, 0x0000008, 1000); ++ msleep(8); ++ usb_interrupt_read(devh, 0x00000081, buf, 0x0000008, 1000); ++ msleep(8); ++ usb_interrupt_read(devh, 0x00000081, buf, 0x0000008, 1000); ++ msleep(8); ++ usb_interrupt_read(devh, 0x00000081, buf, 0x0000008, 1000); ++ msleep(8); ++ usb_interrupt_read(devh, 0x00000081, buf, 0x0000008, 1000); ++ msleep(8); ++ usb_interrupt_read(devh, 0x00000081, buf, 0x0000008, 1000); ++ msleep(8); ++ usb_interrupt_read(devh, 0x00000081, buf, 0x0000008, 1000); ++ msleep(8); ++ usb_interrupt_read(devh, 0x00000081, buf, 0x0000008, 1000); ++ msleep(8); ++ usb_interrupt_read(devh, 0x00000081, buf, 0x0000008, 1000); ++ msleep(8); ++ usb_interrupt_read(devh, 0x00000081, buf, 0x0000008, 1000); ++ msleep(8); ++ usb_interrupt_read(devh, 0x00000081, buf, 0x0000008, 1000); ++ msleep(8); ++ usb_interrupt_read(devh, 0x00000081, buf, 0x0000008, 1000); ++ msleep(8); ++ usb_interrupt_read(devh, 0x00000081, buf, 0x0000008, 1000); ++ msleep(8); ++ usb_interrupt_read(devh, 0x00000081, buf, 0x0000008, 1000); ++ msleep(8); ++ usb_interrupt_read(devh, 0x00000081, buf, 0x0000008, 1000); ++ msleep(8); ++ usb_interrupt_read(devh, 0x00000081, buf, 0x0000008, 1000); ++ msleep(8); ++ usb_interrupt_read(devh, 0x00000081, buf, 0x0000008, 1000); ++ msleep(8); ++ usb_interrupt_read(devh, 0x00000081, buf, 0x0000008, 1000); ++ msleep(8); ++ usb_interrupt_read(devh, 0x00000081, buf, 0x0000008, 1000); ++ msleep(8); ++ usb_interrupt_read(devh, 0x00000081, buf, 0x0000008, 1000); ++ msleep(8); ++ usb_interrupt_read(devh, 0x00000081, buf, 0x0000008, 1000); ++ msleep(8); ++ usb_interrupt_read(devh, 0x00000081, buf, 0x0000008, 1000); ++ msleep(8); ++ usb_interrupt_read(devh, 0x00000081, buf, 0x0000008, 1000); ++ msleep(8); ++ usb_interrupt_read(devh, 0x00000081, buf, 0x0000008, 1000); ++ msleep(8); ++ usb_interrupt_read(devh, 0x00000081, buf, 0x0000008, 1000); ++ msleep(8); ++ usb_interrupt_read(devh, 0x00000081, buf, 0x0000008, 1000); ++ msleep(8); ++ usb_interrupt_read(devh, 0x00000081, buf, 0x0000008, 1000); ++ msleep(8); ++ usb_interrupt_read(devh, 0x00000081, buf, 0x0000008, 1000); ++ msleep(8); ++ usb_interrupt_read(devh, 0x00000081, buf, 0x0000008, 1000); ++ msleep(8); ++ usb_interrupt_read(devh, 0x00000081, buf, 0x0000008, 1000); ++ msleep(8); ++ usb_interrupt_read(devh, 0x00000081, buf, 0x0000008, 1000); ++ msleep(8); ++ usb_interrupt_read(devh, 0x00000081, buf, 0x0000008, 1000); ++ msleep(8); ++ usb_interrupt_read(devh, 0x00000081, buf, 0x0000008, 1000); ++ msleep(8); ++ usb_interrupt_read(devh, 0x00000081, buf, 0x0000008, 1000); ++ msleep(8); ++ usb_interrupt_read(devh, 0x00000081, buf, 0x0000008, 1000); ++ msleep(8); ++ usb_interrupt_read(devh, 0x00000081, buf, 0x0000008, 1000); ++ msleep(8); ++ usb_interrupt_read(devh, 0x00000081, buf, 0x0000008, 1000); ++ msleep(8); ++ usb_interrupt_read(devh, 0x00000081, buf, 0x0000008, 1000); ++ msleep(8); ++ usb_interrupt_read(devh, 0x00000081, buf, 0x0000008, 1000); ++ msleep(8); ++ usb_interrupt_read(devh, 0x00000081, buf, 0x0000008, 1000); ++ msleep(2); ++ //URB_FUNCTION_GET_STATUS_FROM_ENDPOINT skipped ++ msleep(4); ++ memcpy(buf, "\x37\x01\xfe\xdb\xc1\x33\x1f\x83", 0x0000008); ++ usb_interrupt_write(devh, 0x00000002, buf, 0x0000008, 1000); ++ msleep(2); ++ usb_interrupt_read(devh, 0x00000081, buf, 0x0000008, 1000); ++ msleep(1); ++ memcpy(buf, "\x37\x0e\xb5\x9d\x3b\x8a\x91\x51", 0x0000008); ++ usb_interrupt_write(devh, 0x00000002, buf, 0x0000008, 1000); ++ msleep(7); ++ usb_interrupt_read(devh, 0x00000081, buf, 0x0000008, 1000); ++ msleep(1); ++ memcpy(buf, "\x34\x87\xba\x0d\xfc\x8a\x91\x51", 0x0000008); ++ usb_interrupt_write(devh, 0x00000002, buf, 0x0000008, 1000); ++ msleep(7); ++ usb_interrupt_read(devh, 0x00000081, buf, 0x0000008, 1000); ++ msleep(8); ++ usb_interrupt_read(devh, 0x00000081, buf, 0x0000008, 1000); ++ msleep(8); ++ usb_interrupt_read(devh, 0x00000081, buf, 0x0000008, 1000); ++ msleep(8); ++ usb_interrupt_read(devh, 0x00000081, buf, 0x0000008, 1000); ++ msleep(8); ++ usb_interrupt_read(devh, 0x00000081, buf, 0x0000008, 1000); ++ msleep(8); ++ usb_interrupt_read(devh, 0x00000081, buf, 0x0000008, 1000); ++ msleep(8); ++ usb_interrupt_read(devh, 0x00000081, buf, 0x0000008, 1000); ++ msleep(8); ++ usb_interrupt_read(devh, 0x00000081, buf, 0x0000008, 1000); ++ msleep(8); ++ usb_interrupt_read(devh, 0x00000081, buf, 0x0000008, 1000); ++ msleep(8); ++ usb_interrupt_read(devh, 0x00000081, buf, 0x0000008, 1000); ++ msleep(8); ++ usb_interrupt_read(devh, 0x00000081, buf, 0x0000008, 1000); ++ msleep(8); ++ usb_interrupt_read(devh, 0x00000081, buf, 0x0000008, 1000); ++ msleep(8); ++ usb_interrupt_read(devh, 0x00000081, buf, 0x0000008, 1000); ++ msleep(8); ++ usb_interrupt_read(devh, 0x00000081, buf, 0x0000008, 1000); ++ msleep(8); ++ usb_interrupt_read(devh, 0x00000081, buf, 0x0000008, 1000); ++ msleep(8); ++ usb_interrupt_read(devh, 0x00000081, buf, 0x0000008, 1000); ++ msleep(8); ++ usb_interrupt_read(devh, 0x00000081, buf, 0x0000008, 1000); ++ msleep(8); ++ usb_interrupt_read(devh, 0x00000081, buf, 0x0000008, 1000); ++ msleep(8); ++ usb_interrupt_read(devh, 0x00000081, buf, 0x0000008, 1000); ++ msleep(8); ++ usb_interrupt_read(devh, 0x00000081, buf, 0x0000008, 1000); ++ msleep(8); ++ usb_interrupt_read(devh, 0x00000081, buf, 0x0000008, 1000); ++ msleep(8); ++ usb_interrupt_read(devh, 0x00000081, buf, 0x0000008, 1000); ++ msleep(8); ++ usb_interrupt_read(devh, 0x00000081, buf, 0x0000008, 1000); ++ msleep(8); ++ usb_interrupt_read(devh, 0x00000081, buf, 0x0000008, 1000); ++ msleep(8); ++ usb_interrupt_read(devh, 0x00000081, buf, 0x0000008, 1000); ++ msleep(8); ++ usb_interrupt_read(devh, 0x00000081, buf, 0x0000008, 1000); ++ msleep(8); ++ usb_interrupt_read(devh, 0x00000081, buf, 0x0000008, 1000); ++ msleep(8); ++ usb_interrupt_read(devh, 0x00000081, buf, 0x0000008, 1000); ++ msleep(8); ++ usb_interrupt_read(devh, 0x00000081, buf, 0x0000008, 1000); ++ msleep(8); ++ usb_interrupt_read(devh, 0x00000081, buf, 0x0000008, 1000); ++ msleep(8); ++ usb_interrupt_read(devh, 0x00000081, buf, 0x0000008, 1000); ++ msleep(8); ++ usb_interrupt_read(devh, 0x00000081, buf, 0x0000008, 1000); ++ msleep(8); ++ usb_interrupt_read(devh, 0x00000081, buf, 0x0000008, 1000); ++ msleep(8); ++ usb_interrupt_read(devh, 0x00000081, buf, 0x0000008, 1000); ++ msleep(8); ++ usb_interrupt_read(devh, 0x00000081, buf, 0x0000008, 1000); ++ msleep(8); ++ usb_interrupt_read(devh, 0x00000081, buf, 0x0000008, 1000); ++ msleep(8); ++ usb_interrupt_read(devh, 0x00000081, buf, 0x0000008, 1000); ++ msleep(8); ++ usb_interrupt_read(devh, 0x00000081, buf, 0x0000008, 1000); ++ msleep(8); ++ usb_interrupt_read(devh, 0x00000081, buf, 0x0000008, 1000); ++ msleep(8); ++ usb_interrupt_read(devh, 0x00000081, buf, 0x0000008, 1000); ++ msleep(8); ++ usb_interrupt_read(devh, 0x00000081, buf, 0x0000008, 1000); ++ msleep(8); ++ usb_interrupt_read(devh, 0x00000081, buf, 0x0000008, 1000); ++ msleep(8); ++ usb_interrupt_read(devh, 0x00000081, buf, 0x0000008, 1000); ++ msleep(8); ++ usb_interrupt_read(devh, 0x00000081, buf, 0x0000008, 1000); ++ msleep(8); ++ usb_interrupt_read(devh, 0x00000081, buf, 0x0000008, 1000); ++ msleep(8); ++ usb_interrupt_read(devh, 0x00000081, buf, 0x0000008, 1000); ++ msleep(8); ++ usb_interrupt_read(devh, 0x00000081, buf, 0x0000008, 1000); ++ msleep(8); ++ usb_interrupt_read(devh, 0x00000081, buf, 0x0000008, 1000); ++ msleep(8); ++ usb_interrupt_read(devh, 0x00000081, buf, 0x0000008, 1000); ++ msleep(8); ++ usb_interrupt_read(devh, 0x00000081, buf, 0x0000008, 1000); ++ msleep(8); ++ usb_interrupt_read(devh, 0x00000081, buf, 0x0000008, 1000); ++ msleep(8); ++ usb_interrupt_read(devh, 0x00000081, buf, 0x0000008, 1000); ++ msleep(8); ++ usb_interrupt_read(devh, 0x00000081, buf, 0x0000008, 1000); ++ msleep(8); ++ usb_interrupt_read(devh, 0x00000081, buf, 0x0000008, 1000); ++ msleep(8); ++ usb_interrupt_read(devh, 0x00000081, buf, 0x0000008, 1000); ++ msleep(8); ++ usb_interrupt_read(devh, 0x00000081, buf, 0x0000008, 1000); ++ msleep(8); ++ usb_interrupt_read(devh, 0x00000081, buf, 0x0000008, 1000); ++ msleep(8); ++ usb_interrupt_read(devh, 0x00000081, buf, 0x0000008, 1000); ++ msleep(8); ++ usb_interrupt_read(devh, 0x00000081, buf, 0x0000008, 1000); ++ msleep(8); ++ usb_interrupt_read(devh, 0x00000081, buf, 0x0000008, 1000); ++ msleep(8); ++ usb_interrupt_read(devh, 0x00000081, buf, 0x0000008, 1000); ++ msleep(8); ++ usb_interrupt_read(devh, 0x00000081, buf, 0x0000008, 1000); ++ msleep(8); ++ usb_interrupt_read(devh, 0x00000081, buf, 0x0000008, 1000); ++ msleep(8); ++ usb_interrupt_read(devh, 0x00000081, buf, 0x0000008, 1000); ++ msleep(8); ++ usb_interrupt_read(devh, 0x00000081, buf, 0x0000008, 1000); ++ msleep(8); ++ usb_interrupt_read(devh, 0x00000081, buf, 0x0000008, 1000); ++ msleep(8); ++ usb_interrupt_read(devh, 0x00000081, buf, 0x0000008, 1000); ++ msleep(8); ++ usb_interrupt_read(devh, 0x00000081, buf, 0x0000008, 1000); ++ msleep(8); ++ usb_interrupt_read(devh, 0x00000081, buf, 0x0000008, 1000); ++ msleep(8); ++ usb_interrupt_read(devh, 0x00000081, buf, 0x0000008, 1000); ++ msleep(8); ++ usb_interrupt_read(devh, 0x00000081, buf, 0x0000008, 1000); ++ msleep(8); ++ usb_interrupt_read(devh, 0x00000081, buf, 0x0000008, 1000); ++ msleep(8); ++ usb_interrupt_read(devh, 0x00000081, buf, 0x0000008, 1000); ++ msleep(1); ++ //URB_FUNCTION_GET_STATUS_FROM_ENDPOINT skipped ++ msleep(4); ++ memcpy(buf, "\x33\x04\xfe\x00\xf4\x6c\x1f\xf0", 0x0000008); ++ usb_interrupt_write(devh, 0x00000002, buf, 0x0000008, 1000); ++ msleep(3); ++ usb_interrupt_read(devh, 0x00000081, buf, 0x0000008, 1000); ++ msleep(1); ++ //URB_FUNCTION_GET_STATUS_FROM_ENDPOINT skipped ++ msleep(4); ++ memcpy(buf, "\x32\x07\xfe\xf0\x29\xb9\x3a\xf0", 0x0000008); ++ usb_interrupt_write(devh, 0x00000002, buf, 0x0000008, 1000); ++ msleep(3); ++ usb_interrupt_read(devh, 0x00000081, buf, 0x0000008, 1000); ++ ++ if (buf) ++ free (buf); ++ return 0; ++} +diff --git a/extras/mobile-action-modeswitch/ma8280p_us.h b/extras/mobile-action-modeswitch/ma8280p_us.h +new file mode 100644 +index 0000000..bf0e304 +--- /dev/null ++++ b/extras/mobile-action-modeswitch/ma8280p_us.h +@@ -0,0 +1,24 @@ ++/* ++ * Modem mode switcher ++ * ++ * Copyright (C) 2009 Dan Williams ++ * ++ * This program is free software; you can redistribute it and/or modify ++ * it under the terms of the GNU General Public License as published by ++ * the Free Software Foundation; either version 2 of the License, or ++ * (at your option) any later version. ++ * ++ * This program is distributed in the hope that it will be useful, ++ * but WITHOUT ANY WARRANTY; without even the implied warranty of ++ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the ++ * GNU General Public License for more details: ++ */ ++ ++#ifndef __MA8280P_H__ ++#define __MA8280P_H__ ++ ++#include ++ ++int ma8280p_switch (struct usb_dev_handle *devh, struct usb_device *dev); ++ ++#endif /* __MA8280P_H__ */ +diff --git a/extras/mobile-action-modeswitch/mobile-action-modeswitch.c b/extras/mobile-action-modeswitch/mobile-action-modeswitch.c +new file mode 100644 +index 0000000..36d7d81 +--- /dev/null ++++ b/extras/mobile-action-modeswitch/mobile-action-modeswitch.c +@@ -0,0 +1,262 @@ ++/* ++ * Mobile action cable mode switcher ++ * ++ * Copyright (C) 2008 - 2010 Dan Williams ++ * Copyright (C) 2008 Peter Henn ++ * ++ * Heavily based on the 'ozerocdoff' tool by Peter Henn. ++ * ++ * This program is free software; you can redistribute it and/or modify ++ * it under the terms of the GNU General Public License as published by ++ * the Free Software Foundation; either version 2 of the License, or ++ * (at your option) any later version. ++ * ++ * This program is distributed in the hope that it will be useful, ++ * but WITHOUT ANY WARRANTY; without even the implied warranty of ++ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the ++ * GNU General Public License for more details: ++ */ ++ ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++ ++#include ++ ++#include "utils.h" ++ ++#include "ma8280p_us.h" ++ ++struct usb_dev_handle *handle = NULL; ++ ++typedef struct usb_device * (*FindFunc) (int vid, int pid); ++typedef int (*SwitchFunc) (struct usb_dev_handle *dh, struct usb_device *dev); ++ ++typedef enum { ++ ST_UNKNOWN = 0, ++ ST_MA8280P ++} SwitchType; ++ ++typedef struct SwitchEntry { ++ SwitchType st; ++ const char *clopt; ++ FindFunc find_func; ++ SwitchFunc switch_func; ++} SwitchEntry; ++ ++static SwitchEntry switch_types[] = { ++ { ST_MA8280P, "mobile-action-8280p", NULL, ma8280p_switch }, ++ { ST_UNKNOWN, NULL, NULL } ++}; ++ ++static struct usb_device * ++generic_find (int vid, int pid) ++{ ++ struct usb_bus *bus; ++ struct usb_device *dev; ++ ++ for (bus = usb_get_busses(); bus; bus = bus->next) { ++ for (dev = bus->devices; dev; dev = dev->next) { ++ if (dev->descriptor.idVendor == vid && dev->descriptor.idProduct == pid) { ++ debug ("Found device '%s'", dev->filename); ++ return dev; ++ } ++ } ++ } ++ return NULL; ++} ++ ++static void ++release_usb_device (int param) ++{ ++ usb_release_interface (handle, 0); ++ usb_close (handle); ++} ++ ++static void ++print_usage (void) ++{ ++ printf ("Usage: mobile-action-modeswitch [-hdq] [-l ] -v -p -t \n" ++ " -h, --help show this help message\n" ++ " -v, --vendor target USB vendor ID\n" ++ " -p, --product target USB product ID\n" ++ " -t, --type type of switch to attempt, varies by device:\n" ++ " mobile-action-8280p - For Mobile Action 8xxxP USB cables\n" ++ " -l, --log log output to a file\n" ++ " -q, --quiet don't print anything to stdout\n" ++ " -d, --debug display debugging messages\n\n" ++ "Examples:\n" ++ " mobile-action-modeswitch -v 0x0df7 -p 0x8000 -t mobile-action-8280p\n"); ++} ++ ++static SwitchEntry * ++parse_type (const char *s) ++{ ++ SwitchEntry *entry = &switch_types[0]; ++ ++ while (entry->clopt) { ++ if (!strcmp (entry->clopt, s)) ++ return entry; ++ entry++; ++ } ++ ++ return NULL; ++} ++ ++static void ++do_exit (int val) ++{ ++ log_shutdown (); ++ exit (val); ++} ++ ++int main(int argc, char **argv) ++{ ++ static struct option options[] = { ++ { "help", no_argument, NULL, 'h' }, ++ { "vendor", required_argument, NULL, 'v' }, ++ { "product", required_argument, NULL, 'p' }, ++ { "type", required_argument, NULL, 't' }, ++ { "log", required_argument, NULL, 'l' }, ++ { "debug", no_argument, NULL, 'd' }, ++ { "quiet", no_argument, NULL, 'q' }, ++ { NULL, 0, NULL, 0} ++ }; ++ ++ struct usb_device *dev; ++ int vid = 0, pid = 0; ++ const char *logpath = NULL; ++ char buffer[256]; ++ int ret, quiet = 0, debug = 0; ++ SwitchEntry *sentry = NULL; ++ ++ while (1) { ++ int option; ++ ++ option = getopt_long(argc, argv, "hv:p:l:t:dq", options, NULL); ++ if (option == -1) ++ break; ++ ++ switch (option) { ++ case 'v': ++ vid = strtol (optarg, NULL, 0); ++ break; ++ case 'p': ++ pid = strtol (optarg, NULL, 0); ++ break; ++ case 't': ++ sentry = parse_type (optarg); ++ if (!sentry) { ++ error ("unknown switch type '%s'", optarg); ++ print_usage (); ++ exit (1); ++ } ++ break; ++ case 'l': ++ logpath = optarg; ++ break; ++ case 'q': ++ quiet = 1; ++ break; ++ case 'd': ++ debug = 1; ++ break; ++ case 'h': ++ default: ++ print_usage (); ++ exit (1); ++ } ++ } ++ ++ if (log_startup (logpath, debug, quiet)) { ++ fprintf (stderr, "Couldn't open/create logfile %s", logpath); ++ exit (2); ++ } ++ ++ if (!sentry) { ++ if (!quiet) ++ print_usage (); ++ else ++ error ("missing device switch type."); ++ do_exit (3); ++ } ++ ++ if (!vid || !pid) { ++ if (!quiet) ++ print_usage (); ++ else ++ error ("missing vendor and device IDs."); ++ do_exit (3); ++ } ++ ++ usb_init(); ++ ++ if (usb_find_busses() < 0) { ++ error ("no USB busses found."); ++ do_exit (4); ++ } ++ ++ if (usb_find_devices() < 0) { ++ error ("no USB devices found."); ++ do_exit (4); ++ } ++ ++ if (sentry->find_func) ++ dev = (*sentry->find_func) (vid, pid); ++ else ++ dev = generic_find (vid, pid); ++ if (dev == NULL) { ++ error ("no device found."); ++ do_exit (5); ++ } ++ ++ handle = usb_open (dev); ++ if (handle == NULL) { ++ error ("%s: could not access the device.", ++ dev->filename); ++ do_exit (6); ++ } ++ ++ /* detach running default driver */ ++ signal (SIGTERM, release_usb_device); ++ ret = usb_get_driver_np (handle, 0, buffer, sizeof (buffer)); ++ if (ret == 0) { ++ debug ("%s: found already attached driver '%s'", dev->filename, buffer); ++ ++ ret = usb_detach_kernel_driver_np (handle, 0); ++ if (ret != 0) { ++ debug ("%s: error: unable to detach current driver.", dev->filename); ++ usb_close (handle); ++ do_exit (7); ++ } ++ } ++ ++ ret = usb_claim_interface (handle, 0); ++ if (ret != 0) { ++ debug ("%s: couldn't claim device's USB interface: %d.", ++ dev->filename, ret); ++ usb_close (handle); ++ do_exit (8); ++ } ++ ++ ret = (*sentry->switch_func) (handle, dev); ++ if (ret < 0) { ++ debug ("%s: failed to switch device to serial mode.", dev->filename); ++ usb_release_interface (handle, 0); ++ usb_close (handle); ++ do_exit(9); ++ } ++ ++ usb_release_interface (handle, 0); ++ ++ ret = usb_close (handle); ++ if (ret < 0) ++ debug ("%s: failed to close the device.", dev->filename); ++ ++ do_exit (0); ++ return 0; ++} +diff --git a/extras/mobile-action-modeswitch/utils.c b/extras/mobile-action-modeswitch/utils.c +new file mode 100644 +index 0000000..37d0df4 +--- /dev/null ++++ b/extras/mobile-action-modeswitch/utils.c +@@ -0,0 +1,83 @@ ++/* ++ * Modem mode switcher ++ * ++ * Copyright (C) 2009 Dan Williams ++ * ++ * This program is free software; you can redistribute it and/or modify ++ * it under the terms of the GNU General Public License as published by ++ * the Free Software Foundation; either version 2 of the License, or ++ * (at your option) any later version. ++ * ++ * This program is distributed in the hope that it will be useful, ++ * but WITHOUT ANY WARRANTY; without even the implied warranty of ++ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the ++ * GNU General Public License for more details: ++ */ ++ ++#include ++#include ++#include ++#include ++#include ++#include ++ ++#include "utils.h" ++ ++static int debug_on = 0; ++static int quiet = 0; ++FILE *logfile = NULL; ++ ++void ++do_log (int level, const char *fmt, ...) ++{ ++ va_list args; ++ char buffer[1024]; ++ char tag = 'L'; ++ ++ if (level >= LOG_DBG && !debug_on) ++ return; ++ ++ va_start (args, fmt); ++ vsnprintf (buffer, sizeof (buffer), fmt, args); ++ va_end (args); ++ ++ if (level == LOG_ERR) ++ tag = 'E'; ++ else if (level == LOG_MSG) ++ tag = 'L'; ++ else if (level == LOG_DBG) ++ tag = 'D'; ++ ++ if (logfile) ++ fprintf (logfile, "%c: %s\n", tag, buffer); ++ if (!quiet) ++ fprintf ((level == LOG_ERR) ? stderr : stdout, "%c: %s\n", tag, buffer); ++} ++ ++int ++log_startup (const char *path, int do_debug, int be_quiet) ++{ ++ time_t t; ++ ++ quiet = be_quiet; ++ debug_on = do_debug; ++ ++ if (!path) ++ return 0; ++ ++ logfile = fopen (path, "a+"); ++ if (!logfile) ++ return 1; ++ ++ t = time (NULL); ++ message ("\n**** Started: %s\n", ctime (&t)); ++ return 0; ++} ++ ++void ++log_shutdown (void) ++{ ++ if (logfile) ++ fclose (logfile); ++} ++ +diff --git a/extras/mobile-action-modeswitch/utils.h b/extras/mobile-action-modeswitch/utils.h +new file mode 100644 +index 0000000..1ef557a +--- /dev/null ++++ b/extras/mobile-action-modeswitch/utils.h +@@ -0,0 +1,32 @@ ++/* ++ * Modem mode switcher ++ * ++ * Copyright (C) 2009 Dan Williams ++ * ++ * This program is free software; you can redistribute it and/or modify ++ * it under the terms of the GNU General Public License as published by ++ * the Free Software Foundation; either version 2 of the License, or ++ * (at your option) any later version. ++ * ++ * This program is distributed in the hope that it will be useful, ++ * but WITHOUT ANY WARRANTY; without even the implied warranty of ++ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the ++ * GNU General Public License for more details: ++ */ ++ ++#ifndef __UTILS_H__ ++#define __UTILS_H__ ++ ++#define LOG_ERR 0 ++#define LOG_MSG 1 ++#define LOG_DBG 2 ++ ++#define message(fmt, args...) do_log (LOG_MSG, fmt, ##args); ++#define error(fmt, args...) do_log (LOG_ERR, fmt, ##args); ++#define debug(fmt, args...) do_log (LOG_DBG, fmt, ##args); ++ ++void do_log (int level, const char *fmt, ...); ++int log_startup (const char *path, int do_debug, int be_quiet); ++void log_shutdown (void); ++ ++#endif /* __UTILS_H__ */ +diff --git a/extras/modem-modeswitch/61-mobile-action.rules b/extras/modem-modeswitch/61-mobile-action.rules +deleted file mode 100644 +index 29d460d..0000000 +--- a/extras/modem-modeswitch/61-mobile-action.rules ++++ /dev/null +@@ -1,15 +0,0 @@ +-ACTION!="add", GOTO="mobile_action_end" +- +-SUBSYSTEM=="usb", ATTR{bDeviceClass}=="00|ff", ATTR{bDeviceSubClass}=="00|ff", ENV{DEVTYPE}=="usb_device", GOTO="mobile_action_switch" +-GOTO="mobile_action_end" +- +-LABEL="mobile_action_switch" +-ATTRS{idVendor}=="0df7", ATTRS{idProduct}=="0800", RUN+="modem-modeswitch -v 0x%s{idVendor} -p 0x%s{idProduct} -t mobile-action-8280p" +- +-LABEL="mobile_action_end" +- +-# modem-modeswitch does not work with these devices, the fake CD-ROM needs to be ejected +- +-# ZTE MF6xx +-ACTION=="add", ENV{ID_CDROM}=="1", ENV{ID_VENDOR_ID}=="19d2", ENV{ID_MODEL_ID}=="2000", RUN+="/usr/bin/eject %k" +- +diff --git a/extras/modem-modeswitch/61-option-modem-modeswitch.rules b/extras/modem-modeswitch/61-option-modem-modeswitch.rules +deleted file mode 100644 +index 053733e..0000000 +--- a/extras/modem-modeswitch/61-option-modem-modeswitch.rules ++++ /dev/null +@@ -1,44 +0,0 @@ +-# NOTE: only for devices manufactured by Option NV +-# DO NOT add devices that are not manufactured by Option NV +- +-ACTION!="add", GOTO="option_zerocd_end" +- +-SUBSYSTEM=="usb", ATTR{bDeviceClass}!="ff", ENV{DEVTYPE}=="usb_device", GOTO="option_zerocd_disable" +-SUBSYSTEM=="scsi", ENV{DEVTYPE}=="scsi_device", GOTO="option_zerocd_disable" +-GOTO="option_zerocd_end" +- +-LABEL="option_zerocd_disable" +-ATTRS{idVendor}=="05c6", ATTRS{idProduct}=="1000", RUN+="modem-modeswitch -v 0x%s{idVendor} -p 0x%s{idProduct} -t option-zerocd" +-ATTRS{idVendor}=="0af0", ATTRS{idProduct}=="6711", RUN+="modem-modeswitch -v 0x%s{idVendor} -p 0x%s{idProduct} -t option-zerocd" +-ATTRS{idVendor}=="0af0", ATTRS{idProduct}=="6711", RUN+="modem-modeswitch -v 0x%s{idVendor} -p 0x%s{idProduct} -t option-zerocd" +-ATTRS{idVendor}=="0af0", ATTRS{idProduct}=="6731", RUN+="modem-modeswitch -v 0x%s{idVendor} -p 0x%s{idProduct} -t option-zerocd" +-ATTRS{idVendor}=="0af0", ATTRS{idProduct}=="6751", RUN+="modem-modeswitch -v 0x%s{idVendor} -p 0x%s{idProduct} -t option-zerocd" +-ATTRS{idVendor}=="0af0", ATTRS{idProduct}=="6771", RUN+="modem-modeswitch -v 0x%s{idVendor} -p 0x%s{idProduct} -t option-zerocd" +-ATTRS{idVendor}=="0af0", ATTRS{idProduct}=="6791", RUN+="modem-modeswitch -v 0x%s{idVendor} -p 0x%s{idProduct} -t option-zerocd" +-ATTRS{idVendor}=="0af0", ATTRS{idProduct}=="6811", RUN+="modem-modeswitch -v 0x%s{idVendor} -p 0x%s{idProduct} -t option-zerocd" +-ATTRS{idVendor}=="0af0", ATTRS{idProduct}=="6911", RUN+="modem-modeswitch -v 0x%s{idVendor} -p 0x%s{idProduct} -t option-zerocd" +-ATTRS{idVendor}=="0af0", ATTRS{idProduct}=="6951", RUN+="modem-modeswitch -v 0x%s{idVendor} -p 0x%s{idProduct} -t option-zerocd" +-ATTRS{idVendor}=="0af0", ATTRS{idProduct}=="6971", RUN+="modem-modeswitch -v 0x%s{idVendor} -p 0x%s{idProduct} -t option-zerocd" +-ATTRS{idVendor}=="0af0", ATTRS{idProduct}=="7011", RUN+="modem-modeswitch -v 0x%s{idVendor} -p 0x%s{idProduct} -t option-zerocd" +-ATTRS{idVendor}=="0af0", ATTRS{idProduct}=="7031", RUN+="modem-modeswitch -v 0x%s{idVendor} -p 0x%s{idProduct} -t option-zerocd" +-ATTRS{idVendor}=="0af0", ATTRS{idProduct}=="7051", RUN+="modem-modeswitch -v 0x%s{idVendor} -p 0x%s{idProduct} -t option-zerocd" +-ATTRS{idVendor}=="0af0", ATTRS{idProduct}=="7071", RUN+="modem-modeswitch -v 0x%s{idVendor} -p 0x%s{idProduct} -t option-zerocd" +-ATTRS{idVendor}=="0af0", ATTRS{idProduct}=="7111", RUN+="modem-modeswitch -v 0x%s{idVendor} -p 0x%s{idProduct} -t option-zerocd" +-ATTRS{idVendor}=="0af0", ATTRS{idProduct}=="7211", RUN+="modem-modeswitch -v 0x%s{idVendor} -p 0x%s{idProduct} -t option-zerocd" +-ATTRS{idVendor}=="0af0", ATTRS{idProduct}=="7251", RUN+="modem-modeswitch -v 0x%s{idVendor} -p 0x%s{idProduct} -t option-zerocd" +-ATTRS{idVendor}=="0af0", ATTRS{idProduct}=="7271", RUN+="modem-modeswitch -v 0x%s{idVendor} -p 0x%s{idProduct} -t option-zerocd" +-ATTRS{idVendor}=="0af0", ATTRS{idProduct}=="7311", RUN+="modem-modeswitch -v 0x%s{idVendor} -p 0x%s{idProduct} -t option-zerocd" +-ATTRS{idVendor}=="0af0", ATTRS{idProduct}=="c031", RUN+="modem-modeswitch -v 0x%s{idVendor} -p 0x%s{idProduct} -t option-zerocd" +-ATTRS{idVendor}=="0af0", ATTRS{idProduct}=="d031", RUN+="modem-modeswitch -v 0x%s{idVendor} -p 0x%s{idProduct} -t option-zerocd" +-ATTRS{idVendor}=="0af0", ATTRS{idProduct}=="d033", RUN+="modem-modeswitch -v 0x%s{idVendor} -p 0x%s{idProduct} -t option-zerocd" +-ATTRS{idVendor}=="0af0", ATTRS{idProduct}=="7301", RUN+="modem-modeswitch -v 0x%s{idVendor} -p 0x%s{idProduct} -t option-zerocd" +-ATTRS{idVendor}=="0af0", ATTRS{idProduct}=="7361", RUN+="modem-modeswitch -v 0x%s{idVendor} -p 0x%s{idProduct} -t option-zerocd" +-ATTRS{idVendor}=="0af0", ATTRS{idProduct}=="7401", RUN+="modem-modeswitch -v 0x%s{idVendor} -p 0x%s{idProduct} -t option-zerocd" +-ATTRS{idVendor}=="0af0", ATTRS{idProduct}=="7501", RUN+="modem-modeswitch -v 0x%s{idVendor} -p 0x%s{idProduct} -t option-zerocd" +-ATTRS{idVendor}=="0af0", ATTRS{idProduct}=="7601", RUN+="modem-modeswitch -v 0x%s{idVendor} -p 0x%s{idProduct} -t option-zerocd" +-ATTRS{idVendor}=="0af0", ATTRS{idProduct}=="7901", RUN+="modem-modeswitch -v 0x%s{idVendor} -p 0x%s{idProduct} -t option-zerocd" +- +-# NOTE: only for devices manufactured by Option NV +-# DO NOT add devices that are not manufactured by Option NV +- +-LABEL="option_zerocd_end" +diff --git a/extras/modem-modeswitch/ma8280p_us.c b/extras/modem-modeswitch/ma8280p_us.c +deleted file mode 100644 +index d7cf4f4..0000000 +--- a/extras/modem-modeswitch/ma8280p_us.c ++++ /dev/null +@@ -1,462 +0,0 @@ +-/* http://www.natox.be/ma8280p/ +- * http://www.leopold.dk/~martin/ma-8230p.html +- * http://figvam.blogspot.com/2007/01/mobile-action-8730p-usb-cable-and-linux.html +- */ +- +-/* +- * +- * Code by davy hollevoet. This is simply an adaptation of code +- * generated by usbsnoop2libusb. (http://iki.fi/lindi/usb/usbsnoop2libusb.pl) +- * +- * This code is released under both the GPL version 2 and BSD licenses. +- * Either license may be used. +- * +- * GPLv2 +- * ******** +- * This program is free software; you can redistribute it and/or +- * modify it under the terms of the GNU General Public License +- * as published by the Free Software Foundation; either version 2 +- * of the License, or (at your option) any later version. +- * +- * This program is distributed in the hope that it will be useful, +- * but WITHOUT ANY WARRANTY; without even the implied warranty of +- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +- * GNU General Public License for more details. +- * +- * In addition: +- * +- * Redistribution and use in source and binary forms, with or without +- * modification, are permitted provided that the following conditions +- * are met: +- * +- * 1. Redistributions of source code must retain the above copyright +- * notice, this list of conditions and the following disclaimer. +- * 2. Redistributions in binary form must reproduce the above copyright +- * notice, this list of conditions and the following disclaimer in the +- * documentation and/or other materials provided with the distribution. +- * 3. The name of the author may not be used to endorse or promote +- * products derived from this software without specific prior written +- * permission. +- * +- * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR +- * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +- * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE +- * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, +- * INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES +- * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR +- * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) +- * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, +- * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING +- * IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE +- * POSSIBILITY OF SUCH DAMAGE. +- * +- * BSD +- * ****** +- * Copyright (c) 1998, Regents of the University of California +- * All rights reserved. +- * Redistribution and use in source and binary forms, with or without +- * modification, are permitted provided that the following conditions are met: +- * +- * * Redistributions of source code must retain the above copyright +- * notice, this list of conditions and the following disclaimer. +- * * Redistributions in binary form must reproduce the above copyright +- * notice, this list of conditions and the following disclaimer in the +- * documentation and/or other materials provided with the distribution. +- * * Neither the name of the University of California, Berkeley nor the +- * names of its contributors may be used to endorse or promote products +- * derived from this software without specific prior written permission. +- * +- * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS "AS IS" AND ANY +- * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +- * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE +- * DISCLAIMED. IN NO EVENT SHALL THE REGENTS AND CONTRIBUTORS BE LIABLE FOR ANY +- * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES +- * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; +- * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND +- * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +- * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS +- * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +- * +- */ +- +-/* This file is (mostly) generated with usbsnoop2libusb.pl from a usbsnoop log file. */ +-/* Latest version of the script should be in http://iki.fi/lindi/usb/usbsnoop2libusb.pl */ +-#include +-#include +-#include +-#include +-#include +-#include +-#include +-#include +- +-#include "utils.h" +-#include "ma8280p_us.h" +- +-static void msleep(long msec) +-{ +- struct timespec duration = { 0, msec * 1000 * 1000 }; +- +- nanosleep(&duration, NULL); +-} +- +-int ma8280p_switch (struct usb_dev_handle *devh, struct usb_device *dev) +-{ +- int ret = 1; +- char *buf = NULL; +- +- buf = malloc (65535); +- if (!buf) { +- error ("%s: not enough memory", dev->filename, ret); +- return -1; +- } +- +- usb_get_descriptor(devh, 0x0000001, 0x0000000, buf, 0x0000012); +- msleep(6); +- usb_get_descriptor(devh, 0x0000001, 0x0000000, buf, 0x0000012); +- msleep(6); +- usb_get_descriptor(devh, 0x0000002, 0x0000000, buf, 0x0000400); +- msleep(10); +- ret = usb_release_interface(devh, 0); +- if (ret != 0) +- debug ("%s: failed to release interface before set_configuration: %d", dev->filename, ret); +- usb_set_configuration(devh, 0x0000001); +- ret = usb_claim_interface(devh, 0); +- if (ret != 0) +- debug ("%s: claim after set_configuration failed with error %d", dev->filename, ret); +- //usb_set_altinterface(devh, 0); +- //msleep(33); +- usb_control_msg(devh, USB_TYPE_CLASS + USB_RECIP_INTERFACE + USB_ENDPOINT_IN, 0x0000001, 0x0000300, 0x0000000, buf, 0x0000008, 1000); +- msleep(5); +- memcpy(buf, "\xb0\x04\x00\x00\x02\x90\x26\x86", 0x0000008); +- usb_control_msg(devh, USB_TYPE_CLASS + USB_RECIP_INTERFACE, 0x0000009, 0x0000300, 0x0000000, buf, 0x0000008, 1000); +- msleep(4); +- memcpy(buf, "\xb0\x04\x00\x00\x02\x90\x26\x86", 0x0000008); +- usb_control_msg(devh, USB_TYPE_CLASS + USB_RECIP_INTERFACE, 0x0000009, 0x0000300, 0x0000000, buf, 0x0000008, 1000); +- msleep(4); +- +- msleep(4); +- usb_interrupt_read(devh, 0x00000081, buf, 0x0000008, 1000); +- msleep(6); +- usb_interrupt_read(devh, 0x00000081, buf, 0x0000008, 1000); +- msleep(1); +- //URB_FUNCTION_GET_STATUS_FROM_ENDPOINT skipped +- msleep(4); +- memcpy(buf, "\x37\x01\xfe\xdb\xc1\x33\x1f\x83", 0x0000008); +- usb_interrupt_write(devh, 0x00000002, buf, 0x0000008, 1000); +- msleep(3); +- usb_interrupt_read(devh, 0x00000081, buf, 0x0000008, 1000); +- msleep(1); +- memcpy(buf, "\x37\x0e\xb5\x9d\x3b\x8a\x91\x51", 0x0000008); +- usb_interrupt_write(devh, 0x00000002, buf, 0x0000008, 1000); +- msleep(7); +- usb_interrupt_read(devh, 0x00000081, buf, 0x0000008, 1000); +- msleep(1); +- memcpy(buf, "\x34\x87\xba\x0d\xfc\x8a\x91\x51", 0x0000008); +- usb_interrupt_write(devh, 0x00000002, buf, 0x0000008, 1000); +- msleep(7); +- usb_interrupt_read(devh, 0x00000081, buf, 0x0000008, 1000); +- msleep(8); +- usb_interrupt_read(devh, 0x00000081, buf, 0x0000008, 1000); +- msleep(8); +- usb_interrupt_read(devh, 0x00000081, buf, 0x0000008, 1000); +- msleep(8); +- usb_interrupt_read(devh, 0x00000081, buf, 0x0000008, 1000); +- msleep(8); +- usb_interrupt_read(devh, 0x00000081, buf, 0x0000008, 1000); +- msleep(8); +- usb_interrupt_read(devh, 0x00000081, buf, 0x0000008, 1000); +- msleep(8); +- usb_interrupt_read(devh, 0x00000081, buf, 0x0000008, 1000); +- msleep(8); +- usb_interrupt_read(devh, 0x00000081, buf, 0x0000008, 1000); +- msleep(8); +- usb_interrupt_read(devh, 0x00000081, buf, 0x0000008, 1000); +- msleep(8); +- usb_interrupt_read(devh, 0x00000081, buf, 0x0000008, 1000); +- msleep(8); +- usb_interrupt_read(devh, 0x00000081, buf, 0x0000008, 1000); +- msleep(8); +- usb_interrupt_read(devh, 0x00000081, buf, 0x0000008, 1000); +- msleep(8); +- usb_interrupt_read(devh, 0x00000081, buf, 0x0000008, 1000); +- msleep(8); +- usb_interrupt_read(devh, 0x00000081, buf, 0x0000008, 1000); +- msleep(8); +- usb_interrupt_read(devh, 0x00000081, buf, 0x0000008, 1000); +- msleep(8); +- usb_interrupt_read(devh, 0x00000081, buf, 0x0000008, 1000); +- msleep(8); +- usb_interrupt_read(devh, 0x00000081, buf, 0x0000008, 1000); +- msleep(8); +- usb_interrupt_read(devh, 0x00000081, buf, 0x0000008, 1000); +- msleep(8); +- usb_interrupt_read(devh, 0x00000081, buf, 0x0000008, 1000); +- msleep(8); +- usb_interrupt_read(devh, 0x00000081, buf, 0x0000008, 1000); +- msleep(8); +- usb_interrupt_read(devh, 0x00000081, buf, 0x0000008, 1000); +- msleep(8); +- usb_interrupt_read(devh, 0x00000081, buf, 0x0000008, 1000); +- msleep(8); +- usb_interrupt_read(devh, 0x00000081, buf, 0x0000008, 1000); +- msleep(8); +- usb_interrupt_read(devh, 0x00000081, buf, 0x0000008, 1000); +- msleep(8); +- usb_interrupt_read(devh, 0x00000081, buf, 0x0000008, 1000); +- msleep(8); +- usb_interrupt_read(devh, 0x00000081, buf, 0x0000008, 1000); +- msleep(8); +- usb_interrupt_read(devh, 0x00000081, buf, 0x0000008, 1000); +- msleep(8); +- usb_interrupt_read(devh, 0x00000081, buf, 0x0000008, 1000); +- msleep(8); +- usb_interrupt_read(devh, 0x00000081, buf, 0x0000008, 1000); +- msleep(8); +- usb_interrupt_read(devh, 0x00000081, buf, 0x0000008, 1000); +- msleep(8); +- usb_interrupt_read(devh, 0x00000081, buf, 0x0000008, 1000); +- msleep(8); +- usb_interrupt_read(devh, 0x00000081, buf, 0x0000008, 1000); +- msleep(8); +- usb_interrupt_read(devh, 0x00000081, buf, 0x0000008, 1000); +- msleep(8); +- usb_interrupt_read(devh, 0x00000081, buf, 0x0000008, 1000); +- msleep(8); +- usb_interrupt_read(devh, 0x00000081, buf, 0x0000008, 1000); +- msleep(8); +- usb_interrupt_read(devh, 0x00000081, buf, 0x0000008, 1000); +- msleep(8); +- usb_interrupt_read(devh, 0x00000081, buf, 0x0000008, 1000); +- msleep(8); +- usb_interrupt_read(devh, 0x00000081, buf, 0x0000008, 1000); +- msleep(8); +- usb_interrupt_read(devh, 0x00000081, buf, 0x0000008, 1000); +- msleep(8); +- usb_interrupt_read(devh, 0x00000081, buf, 0x0000008, 1000); +- msleep(8); +- usb_interrupt_read(devh, 0x00000081, buf, 0x0000008, 1000); +- msleep(8); +- usb_interrupt_read(devh, 0x00000081, buf, 0x0000008, 1000); +- msleep(8); +- usb_interrupt_read(devh, 0x00000081, buf, 0x0000008, 1000); +- msleep(8); +- usb_interrupt_read(devh, 0x00000081, buf, 0x0000008, 1000); +- msleep(8); +- usb_interrupt_read(devh, 0x00000081, buf, 0x0000008, 1000); +- msleep(8); +- usb_interrupt_read(devh, 0x00000081, buf, 0x0000008, 1000); +- msleep(8); +- usb_interrupt_read(devh, 0x00000081, buf, 0x0000008, 1000); +- msleep(8); +- usb_interrupt_read(devh, 0x00000081, buf, 0x0000008, 1000); +- msleep(8); +- usb_interrupt_read(devh, 0x00000081, buf, 0x0000008, 1000); +- msleep(8); +- usb_interrupt_read(devh, 0x00000081, buf, 0x0000008, 1000); +- msleep(8); +- usb_interrupt_read(devh, 0x00000081, buf, 0x0000008, 1000); +- msleep(8); +- usb_interrupt_read(devh, 0x00000081, buf, 0x0000008, 1000); +- msleep(8); +- usb_interrupt_read(devh, 0x00000081, buf, 0x0000008, 1000); +- msleep(8); +- usb_interrupt_read(devh, 0x00000081, buf, 0x0000008, 1000); +- msleep(8); +- usb_interrupt_read(devh, 0x00000081, buf, 0x0000008, 1000); +- msleep(8); +- usb_interrupt_read(devh, 0x00000081, buf, 0x0000008, 1000); +- msleep(8); +- usb_interrupt_read(devh, 0x00000081, buf, 0x0000008, 1000); +- msleep(8); +- usb_interrupt_read(devh, 0x00000081, buf, 0x0000008, 1000); +- msleep(8); +- usb_interrupt_read(devh, 0x00000081, buf, 0x0000008, 1000); +- msleep(8); +- usb_interrupt_read(devh, 0x00000081, buf, 0x0000008, 1000); +- msleep(8); +- usb_interrupt_read(devh, 0x00000081, buf, 0x0000008, 1000); +- msleep(8); +- usb_interrupt_read(devh, 0x00000081, buf, 0x0000008, 1000); +- msleep(8); +- usb_interrupt_read(devh, 0x00000081, buf, 0x0000008, 1000); +- msleep(2); +- //URB_FUNCTION_GET_STATUS_FROM_ENDPOINT skipped +- msleep(4); +- memcpy(buf, "\x37\x01\xfe\xdb\xc1\x33\x1f\x83", 0x0000008); +- usb_interrupt_write(devh, 0x00000002, buf, 0x0000008, 1000); +- msleep(2); +- usb_interrupt_read(devh, 0x00000081, buf, 0x0000008, 1000); +- msleep(1); +- memcpy(buf, "\x37\x0e\xb5\x9d\x3b\x8a\x91\x51", 0x0000008); +- usb_interrupt_write(devh, 0x00000002, buf, 0x0000008, 1000); +- msleep(7); +- usb_interrupt_read(devh, 0x00000081, buf, 0x0000008, 1000); +- msleep(1); +- memcpy(buf, "\x34\x87\xba\x0d\xfc\x8a\x91\x51", 0x0000008); +- usb_interrupt_write(devh, 0x00000002, buf, 0x0000008, 1000); +- msleep(7); +- usb_interrupt_read(devh, 0x00000081, buf, 0x0000008, 1000); +- msleep(8); +- usb_interrupt_read(devh, 0x00000081, buf, 0x0000008, 1000); +- msleep(8); +- usb_interrupt_read(devh, 0x00000081, buf, 0x0000008, 1000); +- msleep(8); +- usb_interrupt_read(devh, 0x00000081, buf, 0x0000008, 1000); +- msleep(8); +- usb_interrupt_read(devh, 0x00000081, buf, 0x0000008, 1000); +- msleep(8); +- usb_interrupt_read(devh, 0x00000081, buf, 0x0000008, 1000); +- msleep(8); +- usb_interrupt_read(devh, 0x00000081, buf, 0x0000008, 1000); +- msleep(8); +- usb_interrupt_read(devh, 0x00000081, buf, 0x0000008, 1000); +- msleep(8); +- usb_interrupt_read(devh, 0x00000081, buf, 0x0000008, 1000); +- msleep(8); +- usb_interrupt_read(devh, 0x00000081, buf, 0x0000008, 1000); +- msleep(8); +- usb_interrupt_read(devh, 0x00000081, buf, 0x0000008, 1000); +- msleep(8); +- usb_interrupt_read(devh, 0x00000081, buf, 0x0000008, 1000); +- msleep(8); +- usb_interrupt_read(devh, 0x00000081, buf, 0x0000008, 1000); +- msleep(8); +- usb_interrupt_read(devh, 0x00000081, buf, 0x0000008, 1000); +- msleep(8); +- usb_interrupt_read(devh, 0x00000081, buf, 0x0000008, 1000); +- msleep(8); +- usb_interrupt_read(devh, 0x00000081, buf, 0x0000008, 1000); +- msleep(8); +- usb_interrupt_read(devh, 0x00000081, buf, 0x0000008, 1000); +- msleep(8); +- usb_interrupt_read(devh, 0x00000081, buf, 0x0000008, 1000); +- msleep(8); +- usb_interrupt_read(devh, 0x00000081, buf, 0x0000008, 1000); +- msleep(8); +- usb_interrupt_read(devh, 0x00000081, buf, 0x0000008, 1000); +- msleep(8); +- usb_interrupt_read(devh, 0x00000081, buf, 0x0000008, 1000); +- msleep(8); +- usb_interrupt_read(devh, 0x00000081, buf, 0x0000008, 1000); +- msleep(8); +- usb_interrupt_read(devh, 0x00000081, buf, 0x0000008, 1000); +- msleep(8); +- usb_interrupt_read(devh, 0x00000081, buf, 0x0000008, 1000); +- msleep(8); +- usb_interrupt_read(devh, 0x00000081, buf, 0x0000008, 1000); +- msleep(8); +- usb_interrupt_read(devh, 0x00000081, buf, 0x0000008, 1000); +- msleep(8); +- usb_interrupt_read(devh, 0x00000081, buf, 0x0000008, 1000); +- msleep(8); +- usb_interrupt_read(devh, 0x00000081, buf, 0x0000008, 1000); +- msleep(8); +- usb_interrupt_read(devh, 0x00000081, buf, 0x0000008, 1000); +- msleep(8); +- usb_interrupt_read(devh, 0x00000081, buf, 0x0000008, 1000); +- msleep(8); +- usb_interrupt_read(devh, 0x00000081, buf, 0x0000008, 1000); +- msleep(8); +- usb_interrupt_read(devh, 0x00000081, buf, 0x0000008, 1000); +- msleep(8); +- usb_interrupt_read(devh, 0x00000081, buf, 0x0000008, 1000); +- msleep(8); +- usb_interrupt_read(devh, 0x00000081, buf, 0x0000008, 1000); +- msleep(8); +- usb_interrupt_read(devh, 0x00000081, buf, 0x0000008, 1000); +- msleep(8); +- usb_interrupt_read(devh, 0x00000081, buf, 0x0000008, 1000); +- msleep(8); +- usb_interrupt_read(devh, 0x00000081, buf, 0x0000008, 1000); +- msleep(8); +- usb_interrupt_read(devh, 0x00000081, buf, 0x0000008, 1000); +- msleep(8); +- usb_interrupt_read(devh, 0x00000081, buf, 0x0000008, 1000); +- msleep(8); +- usb_interrupt_read(devh, 0x00000081, buf, 0x0000008, 1000); +- msleep(8); +- usb_interrupt_read(devh, 0x00000081, buf, 0x0000008, 1000); +- msleep(8); +- usb_interrupt_read(devh, 0x00000081, buf, 0x0000008, 1000); +- msleep(8); +- usb_interrupt_read(devh, 0x00000081, buf, 0x0000008, 1000); +- msleep(8); +- usb_interrupt_read(devh, 0x00000081, buf, 0x0000008, 1000); +- msleep(8); +- usb_interrupt_read(devh, 0x00000081, buf, 0x0000008, 1000); +- msleep(8); +- usb_interrupt_read(devh, 0x00000081, buf, 0x0000008, 1000); +- msleep(8); +- usb_interrupt_read(devh, 0x00000081, buf, 0x0000008, 1000); +- msleep(8); +- usb_interrupt_read(devh, 0x00000081, buf, 0x0000008, 1000); +- msleep(8); +- usb_interrupt_read(devh, 0x00000081, buf, 0x0000008, 1000); +- msleep(8); +- usb_interrupt_read(devh, 0x00000081, buf, 0x0000008, 1000); +- msleep(8); +- usb_interrupt_read(devh, 0x00000081, buf, 0x0000008, 1000); +- msleep(8); +- usb_interrupt_read(devh, 0x00000081, buf, 0x0000008, 1000); +- msleep(8); +- usb_interrupt_read(devh, 0x00000081, buf, 0x0000008, 1000); +- msleep(8); +- usb_interrupt_read(devh, 0x00000081, buf, 0x0000008, 1000); +- msleep(8); +- usb_interrupt_read(devh, 0x00000081, buf, 0x0000008, 1000); +- msleep(8); +- usb_interrupt_read(devh, 0x00000081, buf, 0x0000008, 1000); +- msleep(8); +- usb_interrupt_read(devh, 0x00000081, buf, 0x0000008, 1000); +- msleep(8); +- usb_interrupt_read(devh, 0x00000081, buf, 0x0000008, 1000); +- msleep(8); +- usb_interrupt_read(devh, 0x00000081, buf, 0x0000008, 1000); +- msleep(8); +- usb_interrupt_read(devh, 0x00000081, buf, 0x0000008, 1000); +- msleep(8); +- usb_interrupt_read(devh, 0x00000081, buf, 0x0000008, 1000); +- msleep(8); +- usb_interrupt_read(devh, 0x00000081, buf, 0x0000008, 1000); +- msleep(8); +- usb_interrupt_read(devh, 0x00000081, buf, 0x0000008, 1000); +- msleep(8); +- usb_interrupt_read(devh, 0x00000081, buf, 0x0000008, 1000); +- msleep(8); +- usb_interrupt_read(devh, 0x00000081, buf, 0x0000008, 1000); +- msleep(8); +- usb_interrupt_read(devh, 0x00000081, buf, 0x0000008, 1000); +- msleep(8); +- usb_interrupt_read(devh, 0x00000081, buf, 0x0000008, 1000); +- msleep(8); +- usb_interrupt_read(devh, 0x00000081, buf, 0x0000008, 1000); +- msleep(8); +- usb_interrupt_read(devh, 0x00000081, buf, 0x0000008, 1000); +- msleep(8); +- usb_interrupt_read(devh, 0x00000081, buf, 0x0000008, 1000); +- msleep(8); +- usb_interrupt_read(devh, 0x00000081, buf, 0x0000008, 1000); +- msleep(8); +- usb_interrupt_read(devh, 0x00000081, buf, 0x0000008, 1000); +- msleep(8); +- usb_interrupt_read(devh, 0x00000081, buf, 0x0000008, 1000); +- msleep(1); +- //URB_FUNCTION_GET_STATUS_FROM_ENDPOINT skipped +- msleep(4); +- memcpy(buf, "\x33\x04\xfe\x00\xf4\x6c\x1f\xf0", 0x0000008); +- usb_interrupt_write(devh, 0x00000002, buf, 0x0000008, 1000); +- msleep(3); +- usb_interrupt_read(devh, 0x00000081, buf, 0x0000008, 1000); +- msleep(1); +- //URB_FUNCTION_GET_STATUS_FROM_ENDPOINT skipped +- msleep(4); +- memcpy(buf, "\x32\x07\xfe\xf0\x29\xb9\x3a\xf0", 0x0000008); +- usb_interrupt_write(devh, 0x00000002, buf, 0x0000008, 1000); +- msleep(3); +- usb_interrupt_read(devh, 0x00000081, buf, 0x0000008, 1000); +- +- if (buf) +- free (buf); +- return 0; +-} +diff --git a/extras/modem-modeswitch/ma8280p_us.h b/extras/modem-modeswitch/ma8280p_us.h +deleted file mode 100644 +index bf0e304..0000000 +--- a/extras/modem-modeswitch/ma8280p_us.h ++++ /dev/null +@@ -1,24 +0,0 @@ +-/* +- * Modem mode switcher +- * +- * Copyright (C) 2009 Dan Williams +- * +- * This program is free software; you can redistribute it and/or modify +- * it under the terms of the GNU General Public License as published by +- * the Free Software Foundation; either version 2 of the License, or +- * (at your option) any later version. +- * +- * This program is distributed in the hope that it will be useful, +- * but WITHOUT ANY WARRANTY; without even the implied warranty of +- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +- * GNU General Public License for more details: +- */ +- +-#ifndef __MA8280P_H__ +-#define __MA8280P_H__ +- +-#include +- +-int ma8280p_switch (struct usb_dev_handle *devh, struct usb_device *dev); +- +-#endif /* __MA8280P_H__ */ +diff --git a/extras/modem-modeswitch/modem-modeswitch.c b/extras/modem-modeswitch/modem-modeswitch.c +deleted file mode 100644 +index a60ce7a..0000000 +--- a/extras/modem-modeswitch/modem-modeswitch.c ++++ /dev/null +@@ -1,266 +0,0 @@ +-/* +- * Modem mode switcher +- * +- * Copyright (C) 2008 Dan Williams +- * Copyright (C) 2008 Peter Henn +- * +- * Heavily based on the 'ozerocdoff' tool by Peter Henn. +- * +- * This program is free software; you can redistribute it and/or modify +- * it under the terms of the GNU General Public License as published by +- * the Free Software Foundation; either version 2 of the License, or +- * (at your option) any later version. +- * +- * This program is distributed in the hope that it will be useful, +- * but WITHOUT ANY WARRANTY; without even the implied warranty of +- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +- * GNU General Public License for more details: +- */ +- +-#include +-#include +-#include +-#include +-#include +-#include +-#include +- +-#include +- +-#include "utils.h" +- +-#include "ma8280p_us.h" +-#include "option.h" +- +-struct usb_dev_handle *handle = NULL; +- +-typedef struct usb_device * (*FindFunc) (int vid, int pid); +-typedef int (*SwitchFunc) (struct usb_dev_handle *dh, struct usb_device *dev); +- +-typedef enum { +- ST_UNKNOWN = 0, +- ST_OPTION_ZEROCD, +- ST_MA8280P +-} SwitchType; +- +-typedef struct SwitchEntry { +- SwitchType st; +- const char *clopt; +- FindFunc find_func; +- SwitchFunc switch_func; +-} SwitchEntry; +- +-static SwitchEntry switch_types[] = { +- { ST_OPTION_ZEROCD, "option-zerocd", option_zerocd_find, option_zerocd_switch }, +- { ST_MA8280P, "mobile-action-8280p", NULL, ma8280p_switch }, +- { ST_UNKNOWN, NULL, NULL } +-}; +- +-static struct usb_device * +-generic_find (int vid, int pid) +-{ +- struct usb_bus *bus; +- struct usb_device *dev; +- +- for (bus = usb_get_busses(); bus; bus = bus->next) { +- for (dev = bus->devices; dev; dev = dev->next) { +- if (dev->descriptor.idVendor == vid && dev->descriptor.idProduct == pid) { +- debug ("Found device '%s'", dev->filename); +- return dev; +- } +- } +- } +- return NULL; +-} +- +-static void +-release_usb_device (int param) +-{ +- usb_release_interface (handle, 0); +- usb_close (handle); +-} +- +-static void +-print_usage (void) +-{ +- printf ("Usage: modem-modeswitch [-hdq] [-l ] -v -p -t \n" +- " -h, --help show this help message\n" +- " -v, --vendor target USB vendor ID\n" +- " -p, --product target USB product ID\n" +- " -t, --type type of switch to attempt, varies by device:\n" +- " option-zerocd - For many newer Option N.V. devices\n" +- " mobile-action-8280p - For Mobile Action 8xxxP USB cables\n" +- " -l, --log log output to a file\n" +- " -q, --quiet don't print anything to stdout\n" +- " -d, --debug display debugging messages\n\n" +- "Examples:\n" +- " modem-modeswitch -v 0x0af0 -p 0xc031 -t option-zerocd\n"); +-} +- +-static SwitchEntry * +-parse_type (const char *s) +-{ +- SwitchEntry *entry = &switch_types[0]; +- +- while (entry->clopt) { +- if (!strcmp (entry->clopt, s)) +- return entry; +- entry++; +- } +- +- return NULL; +-} +- +-static void +-do_exit (int val) +-{ +- log_shutdown (); +- exit (val); +-} +- +-int main(int argc, char **argv) +-{ +- static struct option options[] = { +- { "help", no_argument, NULL, 'h' }, +- { "vendor", required_argument, NULL, 'v' }, +- { "product", required_argument, NULL, 'p' }, +- { "type", required_argument, NULL, 't' }, +- { "log", required_argument, NULL, 'l' }, +- { "debug", no_argument, NULL, 'd' }, +- { "quiet", no_argument, NULL, 'q' }, +- { NULL, 0, NULL, 0} +- }; +- +- struct usb_device *dev; +- int vid = 0, pid = 0; +- const char *logpath = NULL; +- char buffer[256]; +- int ret, quiet = 0, debug = 0; +- SwitchEntry *sentry = NULL; +- +- while (1) { +- int option; +- +- option = getopt_long(argc, argv, "hv:p:l:t:dq", options, NULL); +- if (option == -1) +- break; +- +- switch (option) { +- case 'v': +- vid = strtol (optarg, NULL, 0); +- break; +- case 'p': +- pid = strtol (optarg, NULL, 0); +- break; +- case 't': +- sentry = parse_type (optarg); +- if (!sentry) { +- error ("unknown switch type '%s'", optarg); +- print_usage (); +- exit (1); +- } +- break; +- case 'l': +- logpath = optarg; +- break; +- case 'q': +- quiet = 1; +- break; +- case 'd': +- debug = 1; +- break; +- case 'h': +- default: +- print_usage (); +- exit (1); +- } +- } +- +- if (log_startup (logpath, debug, quiet)) { +- fprintf (stderr, "Couldn't open/create logfile %s", logpath); +- exit (2); +- } +- +- if (!sentry) { +- if (!quiet) +- print_usage (); +- else +- error ("missing device switch type."); +- do_exit (3); +- } +- +- if (!vid || !pid) { +- if (!quiet) +- print_usage (); +- else +- error ("missing vendor and device IDs."); +- do_exit (3); +- } +- +- usb_init(); +- +- if (usb_find_busses() < 0) { +- error ("no USB busses found."); +- do_exit (4); +- } +- +- if (usb_find_devices() < 0) { +- error ("no USB devices found."); +- do_exit (4); +- } +- +- if (sentry->find_func) +- dev = (*sentry->find_func) (vid, pid); +- else +- dev = generic_find (vid, pid); +- if (dev == NULL) { +- error ("no device found."); +- do_exit (5); +- } +- +- handle = usb_open (dev); +- if (handle == NULL) { +- error ("%s: could not access the device.", +- dev->filename); +- do_exit (6); +- } +- +- /* detach running default driver */ +- signal (SIGTERM, release_usb_device); +- ret = usb_get_driver_np (handle, 0, buffer, sizeof (buffer)); +- if (ret == 0) { +- debug ("%s: found already attached driver '%s'", dev->filename, buffer); +- +- ret = usb_detach_kernel_driver_np (handle, 0); +- if (ret != 0) { +- debug ("%s: error: unable to detach current driver.", dev->filename); +- usb_close (handle); +- do_exit (7); +- } +- } +- +- ret = usb_claim_interface (handle, 0); +- if (ret != 0) { +- debug ("%s: couldn't claim device's USB interface: %d.", +- dev->filename, ret); +- usb_close (handle); +- do_exit (8); +- } +- +- ret = (*sentry->switch_func) (handle, dev); +- if (ret < 0) { +- debug ("%s: failed to switch device to modem mode.", dev->filename); +- usb_release_interface (handle, 0); +- usb_close (handle); +- do_exit(9); +- } +- +- usb_release_interface (handle, 0); +- +- ret = usb_close (handle); +- if (ret < 0) +- debug ("%s: failed to close the device.", dev->filename); +- +- do_exit (0); +- return 0; +-} +diff --git a/extras/modem-modeswitch/option.c b/extras/modem-modeswitch/option.c +deleted file mode 100644 +index 5b299fd..0000000 +--- a/extras/modem-modeswitch/option.c ++++ /dev/null +@@ -1,131 +0,0 @@ +-/* +- * Modem mode switcher +- * +- * Copyright (C) 2008 Dan Williams +- * Copyright (C) 2008 Peter Henn +- * +- * Heavily based on the 'ozerocdoff' tool by Peter Henn. +- * +- * This program is free software; you can redistribute it and/or modify +- * it under the terms of the GNU General Public License as published by +- * the Free Software Foundation; either version 2 of the License, or +- * (at your option) any later version. +- * +- * This program is distributed in the hope that it will be useful, +- * but WITHOUT ANY WARRANTY; without even the implied warranty of +- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +- * GNU General Public License for more details: +- */ +- +-#include +- +-#include "utils.h" +-#include "option.h" +- +-/* Borrowed from /usr/include/linux/usb/ch9.h */ +-#define USB_ENDPOINT_XFERTYPE_MASK 0x03 /* in bmAttributes */ +-#define USB_ENDPOINT_XFER_BULK 2 +-#define USB_ENDPOINT_DIR_MASK 0x80 +-#define USB_DIR_OUT 0 /* to device */ +-#define USB_DIR_IN 0x80 /* to host */ +- +-struct usb_device * +-option_zerocd_find (int vid, int pid) +-{ +- struct usb_bus *bus; +- struct usb_device *dev; +- +- for (bus = usb_get_busses(); bus; bus = bus->next) { +- for (dev = bus->devices; dev; dev = dev->next) { +- if (dev->descriptor.idVendor == vid && dev->descriptor.idProduct == pid) { +- debug ("Found mass storage device:"); +- debug (" Endpoints: %d", dev->config[0].interface[0].altsetting[0].bNumEndpoints); +- debug (" Class: 0x%X", dev->config[0].interface[0].altsetting[0].bInterfaceClass); +- debug (" SubClass: 0x%X", dev->config[0].interface[0].altsetting[0].bInterfaceSubClass); +- debug (" Protocol: 0x%X", dev->config[0].interface[0].altsetting[0].bInterfaceProtocol); +- +- if ( (dev->config[0].interface[0].altsetting[0].bNumEndpoints == 2) +- && (dev->config[0].interface[0].altsetting[0].bInterfaceClass == 0x08) +- && (dev->config[0].interface[0].altsetting[0].bInterfaceSubClass == 0x06) +- && (dev->config[0].interface[0].altsetting[0].bInterfaceProtocol == 0x50) ) { +- debug ("Found modem mass storage device '%s'", dev->filename); +- return dev; +- } +- } +- } +- } +- return NULL; +-} +- +-static int +-find_endpoints (struct usb_device *dev, int *in_ep, int *out_ep) +-{ +- int i; +- +- for (i = 0; i < dev->config[0].interface[0].altsetting[0].bNumEndpoints; i++) { +- struct usb_endpoint_descriptor *ep = &(dev->config[0].interface[0].altsetting[0].endpoint[i]); +- +- if ((ep->bmAttributes & USB_ENDPOINT_XFERTYPE_MASK) == USB_ENDPOINT_XFER_BULK) { +- unsigned int direction = ep->bEndpointAddress & USB_ENDPOINT_DIR_MASK; +- +- if (!*out_ep && (direction == USB_DIR_OUT)) +- *out_ep = ep->bEndpointAddress; +- else if (!*in_ep && (direction == USB_DIR_IN)) +- *in_ep = ep->bEndpointAddress; +- } +- +- if (*in_ep && *out_ep) +- return 0; +- } +- +- return -1; +-} +- +-int +-option_zerocd_switch (struct usb_dev_handle *dh, struct usb_device *dev) +-{ +- const char const rezero_cbw[] = { +- 0x55, 0x53, 0x42, 0x43, /* bulk command signature (LE) */ +- 0x78, 0x56, 0x34, 0x12, /* bulk command host tag */ +- 0x01, 0x00, 0x00, 0x00, /* bulk command data transfer length (LE) */ +- 0x80, /* flags: direction data-in */ +- 0x00, /* LUN */ +- 0x06, /* SCSI command length */ +- 0x01, /* SCSI command: REZERO */ +- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* filler */ +- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 +- }; +- +- int ret = -1, ep_in = 0, ep_out = 0; +- char buffer[256]; +- +- /* Find the device's bulk in and out endpoints */ +- if (find_endpoints (dev, &ep_in, &ep_out) < 0) { +- debug ("%s: couldn't find correct USB endpoints.", dev->filename); +- goto out; +- } +- +- usb_clear_halt (dh, ep_out); +- ret = usb_set_altinterface (dh, 0); +- if (ret != 0) { +- debug ("%s: couldn't set device alternate interface.", dev->filename); +- goto out; +- } +- +- /* Let the mass storage device settle */ +- sleep (1); +- +- /* Send the modeswitch command */ +- ret = usb_bulk_write (dh, ep_out, (char *) rezero_cbw, sizeof (rezero_cbw), 1000); +- if (ret < 0) +- return ret; +- +- debug ("%s: REZERO command sent.", dev->filename); +- +- /* Some devices need to be read from */ +- ret = usb_bulk_read (dh, ep_in, buffer, sizeof (buffer), 1000); +- +-out: +- return ret; +-} +- +diff --git a/extras/modem-modeswitch/option.h b/extras/modem-modeswitch/option.h +deleted file mode 100644 +index e00dabf..0000000 +--- a/extras/modem-modeswitch/option.h ++++ /dev/null +@@ -1,29 +0,0 @@ +-/* +- * Modem mode switcher +- * +- * Copyright (C) 2008 Dan Williams +- * Copyright (C) 2008 Peter Henn +- * +- * Heavily based on the 'ozerocdoff' tool by Peter Henn. +- * +- * This program is free software; you can redistribute it and/or modify +- * it under the terms of the GNU General Public License as published by +- * the Free Software Foundation; either version 2 of the License, or +- * (at your option) any later version. +- * +- * This program is distributed in the hope that it will be useful, +- * but WITHOUT ANY WARRANTY; without even the implied warranty of +- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +- * GNU General Public License for more details: +- */ +- +-#ifndef __OPTION_H__ +-#define __OPTION_H__ +- +-#include +- +-struct usb_device *option_zerocd_find (int vid, int pid); +- +-int option_zerocd_switch (struct usb_dev_handle *dh, struct usb_device *dev); +- +-#endif /* __OPTION_H__ */ +diff --git a/extras/modem-modeswitch/utils.c b/extras/modem-modeswitch/utils.c +deleted file mode 100644 +index 37d0df4..0000000 +--- a/extras/modem-modeswitch/utils.c ++++ /dev/null +@@ -1,83 +0,0 @@ +-/* +- * Modem mode switcher +- * +- * Copyright (C) 2009 Dan Williams +- * +- * This program is free software; you can redistribute it and/or modify +- * it under the terms of the GNU General Public License as published by +- * the Free Software Foundation; either version 2 of the License, or +- * (at your option) any later version. +- * +- * This program is distributed in the hope that it will be useful, +- * but WITHOUT ANY WARRANTY; without even the implied warranty of +- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +- * GNU General Public License for more details: +- */ +- +-#include +-#include +-#include +-#include +-#include +-#include +- +-#include "utils.h" +- +-static int debug_on = 0; +-static int quiet = 0; +-FILE *logfile = NULL; +- +-void +-do_log (int level, const char *fmt, ...) +-{ +- va_list args; +- char buffer[1024]; +- char tag = 'L'; +- +- if (level >= LOG_DBG && !debug_on) +- return; +- +- va_start (args, fmt); +- vsnprintf (buffer, sizeof (buffer), fmt, args); +- va_end (args); +- +- if (level == LOG_ERR) +- tag = 'E'; +- else if (level == LOG_MSG) +- tag = 'L'; +- else if (level == LOG_DBG) +- tag = 'D'; +- +- if (logfile) +- fprintf (logfile, "%c: %s\n", tag, buffer); +- if (!quiet) +- fprintf ((level == LOG_ERR) ? stderr : stdout, "%c: %s\n", tag, buffer); +-} +- +-int +-log_startup (const char *path, int do_debug, int be_quiet) +-{ +- time_t t; +- +- quiet = be_quiet; +- debug_on = do_debug; +- +- if (!path) +- return 0; +- +- logfile = fopen (path, "a+"); +- if (!logfile) +- return 1; +- +- t = time (NULL); +- message ("\n**** Started: %s\n", ctime (&t)); +- return 0; +-} +- +-void +-log_shutdown (void) +-{ +- if (logfile) +- fclose (logfile); +-} +- +diff --git a/extras/modem-modeswitch/utils.h b/extras/modem-modeswitch/utils.h +deleted file mode 100644 +index 1ef557a..0000000 +--- a/extras/modem-modeswitch/utils.h ++++ /dev/null +@@ -1,32 +0,0 @@ +-/* +- * Modem mode switcher +- * +- * Copyright (C) 2009 Dan Williams +- * +- * This program is free software; you can redistribute it and/or modify +- * it under the terms of the GNU General Public License as published by +- * the Free Software Foundation; either version 2 of the License, or +- * (at your option) any later version. +- * +- * This program is distributed in the hope that it will be useful, +- * but WITHOUT ANY WARRANTY; without even the implied warranty of +- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +- * GNU General Public License for more details: +- */ +- +-#ifndef __UTILS_H__ +-#define __UTILS_H__ +- +-#define LOG_ERR 0 +-#define LOG_MSG 1 +-#define LOG_DBG 2 +- +-#define message(fmt, args...) do_log (LOG_MSG, fmt, ##args); +-#define error(fmt, args...) do_log (LOG_ERR, fmt, ##args); +-#define debug(fmt, args...) do_log (LOG_DBG, fmt, ##args); +- +-void do_log (int level, const char *fmt, ...); +-int log_startup (const char *path, int do_debug, int be_quiet); +-void log_shutdown (void); +- +-#endif /* __UTILS_H__ */ +-- +1.6.6 + diff --git a/start_udev b/start_udev index 57801aa..0da55f4 100755 --- a/start_udev +++ b/start_udev @@ -56,7 +56,13 @@ if [ -n "$selinuxfs" ] && [ "`cat /proc/self/attr/current`" != "kernel" ]; then fi fi - +touch_recursive() { + ( cd $1; + for i in *; do + [[ -c "$i" || -b "$i" ]] && touch "$i" + [ -d "$i" ] && touch_recursive "$i" + done ) +} xargs_simple () { if [ "$1" = "-n" ]; then @@ -94,10 +100,11 @@ make_extra_nodes () { [ -d $udev_root/pts ] || mkdir -m 0755 $udev_root/pts [ -d $udev_root/shm ] || mkdir -m 0755 $udev_root/shm + [ -d $udev_root/hugepages ] || mkdir -m 0755 $udev_root/hugepages [ -a /dev/MAKEDEV ] || ln -s $MAKEDEV /dev/MAKEDEV; USE_MD5="false" - [ -x /usr/bin/md5sum -a "$UDEV_USE_MAKEDEV_CACHE" == "yes" ] && USE_MD5="true" + [[ "$UDEV_USE_MAKEDEV_CACHE" == "yes" && -x /usr/bin/md5sum ]] && USE_MD5="true" for i in 0 1 2 3 4 5 6 7; do [ -b /dev/loop$i ] || /bin/mknod -m 0640 /dev/loop$i b 7 $i @@ -157,9 +164,11 @@ make_extra_nodes () { if [ "$1" != "*" ]; then #echo "Warning: $devdir is deprecated. Please use /etc/udev/makedev.d/." cp -ar "$@" $udev_root/ - pushd "$udev_root" &> "$udev_root/null" - [ -x /sbin/restorecon ] && /sbin/restorecon "$@" - popd &> "$udev_root/null" + if [ -x /sbin/restorecon ]; then + pushd "$udev_root" &> "$udev_root/null" + /sbin/restorecon "$@" + popd &> "$udev_root/null" + fi fi popd &> "$udev_root/null" done @@ -224,11 +233,11 @@ echo -n "$STRING" # mount the tmpfs on ${udev_root%/}, if not already done LANG=C awk "\$2 == \"${udev_root%/}\" && ( \$3 == \"devtmpfs\" || \$3 == \"tmpfs\" ) { exit 1 }" /proc/mounts && { - if LANG=C fgrep -q "none ${udev_root%/}/pts " /proc/mounts; then + if LANG=C grep -Fq "none ${udev_root%/}/pts " /proc/mounts; then PTSDIR=$(mktemp -d) mount --move $udev_root/pts "$PTSDIR" fi - if LANG=C fgrep -q "none ${udev_root%/}/shm " /proc/mounts; then + if LANG=C grep -Fq "none ${udev_root%/}/shm " /proc/mounts; then SHMDIR=$(mktemp -d) mount --move $udev_root/shm "$SHMDIR" fi @@ -250,7 +259,6 @@ LANG=C awk "\$2 == \"${udev_root%/}\" && ( \$3 == \"devtmpfs\" || \$3 == \"tmpfs } make_extra_nodes -cmdline=$(cat /proc/cmdline) kill_udevd > "$udev_root/null" 2>&1 rm -fr $udev_root/.udev > "$udev_root/null" 2>&1 mkdir -p $udev_root/.udev > "$udev_root/null" 2>&1 @@ -259,6 +267,8 @@ if [ -f "/sys/class/tty/console/uevent" ]; then # trigger the sorted events echo -e '\000\000\000\000' > /proc/sys/kernel/hotplug + cmdline=$(cat /proc/cmdline) + if strstr "$cmdline" udevtrace; then UDEV_OPTS="$UDEV_OPTS --debug-trace" fi @@ -307,6 +317,10 @@ if [ -f "/sys/class/tty/console/uevent" ]; then ret=$[$ret + $?] wait /sbin/udevadm control --env=STARTUP= + # touch all device files for timezone glitches + # "find" is in /usr/bin and might not be available + touch_recursive /dev > "$udev_root/null" 2>&1 + else echo -n " kernel too old for this udev version " /sbin/udevd -d $UDEV_OPTS diff --git a/udev-151-3.patch b/udev-151-3.patch new file mode 100644 index 0000000..3dfcab0 --- /dev/null +++ b/udev-151-3.patch @@ -0,0 +1,89 @@ +? udev-147 +? udev-147.tar.bz2 +? udev-151 +? udev-151-2.fc13.src.rpm +Index: udev-86a7a2f-fix-missing-firmware.patch +=================================================================== +RCS file: udev-86a7a2f-fix-missing-firmware.patch +diff -N udev-86a7a2f-fix-missing-firmware.patch +--- /dev/null 1 Jan 1970 00:00:00 -0000 ++++ udev-86a7a2f-fix-missing-firmware.patch 7 Feb 2010 04:22:50 -0000 +@@ -0,0 +1,43 @@ ++From 86a7a2f853fe6022c5b0c1b415918047b65533be Mon Sep 17 00:00:00 2001 ++From: =?UTF-8?q?Thomas=20B=C3=A4chler?= ++Date: Sun, 31 Jan 2010 13:49:02 +0100 ++Subject: firmware: fix error reporting on missing firmware files ++ ++The new firmware loader does not report an error to the kernel if a firmware file ++is missing. This results in modprobe stalling for 60 seconds for each firmware ++a module tries to load. ++--- ++ extras/firmware/firmware.c | 3 ++- ++ 1 files changed, 2 insertions(+), 1 deletions(-) ++ ++diff --git a/extras/firmware/firmware.c b/extras/firmware/firmware.c ++index 8f70be4..16455de 100644 ++--- a/extras/firmware/firmware.c +++++ b/extras/firmware/firmware.c ++@@ -149,6 +149,7 @@ int main(int argc, char **argv) ++ ++ util_path_encode(firmware, fwencpath, sizeof(fwencpath)); ++ util_strscpyl(misspath, sizeof(misspath), udev_get_dev_path(udev), "/.udev/firmware-missing/", fwencpath, NULL); +++ util_strscpyl(loadpath, sizeof(loadpath), udev_get_sys_path(udev), devpath, "/loading", NULL); ++ ++ if (fwfile == NULL) { ++ int err; ++@@ -166,6 +167,7 @@ int main(int argc, char **argv) ++ udev_selinux_resetfscreatecon(udev); ++ } while (err == -ENOENT); ++ rc = 2; +++ set_loading(udev, loadpath, "-1"); ++ goto exit; ++ } ++ ++@@ -176,7 +178,6 @@ int main(int argc, char **argv) ++ if (unlink(misspath) == 0) ++ util_delete_path(udev, misspath); ++ ++- util_strscpyl(loadpath, sizeof(loadpath), udev_get_sys_path(udev), devpath, "/loading", NULL); ++ set_loading(udev, loadpath, "1"); ++ ++ util_strscpyl(datapath, sizeof(datapath), udev_get_sys_path(udev), devpath, "/data", NULL); ++-- ++1.6.6 ++ +Index: udev.spec +=================================================================== +RCS file: /cvs/pkgs/rpms/udev/devel/udev.spec,v +retrieving revision 1.300 +diff -u -p -r1.300 udev.spec +--- udev.spec 29 Jan 2010 09:57:03 -0000 1.300 ++++ udev.spec 7 Feb 2010 04:22:50 -0000 +@@ -14,6 +14,7 @@ Obsoletes: udev-extras < 20090618 + Provides: udev-extras = 20090618-1 + Source: ftp://ftp.kernel.org/pub/linux/utils/kernel/hotplug/%{name}-%{version}.tar.bz2 + Patch1: udev-151-rules.patch ++Patch2: udev-86a7a2f-fix-missing-firmware.patch + + Source1: start_udev + Source3: udev-post.init +@@ -110,6 +111,7 @@ glib-based applications using libudev fu + %prep + %setup -q + %patch1 -p1 ++%patch2 -p1 + + %build + # get rid of rpath +@@ -356,6 +358,11 @@ rm -rf $RPM_BUILD_ROOT + %attr(0644,root,root) %{_libdir}/pkgconfig/gudev-1.0* + + %changelog ++* Sun Feb 07 2010 Kyle McMartin 151-3 ++- udev-86a7a2f-fix-missing-firmware.patch: fix hang when loading ++ microcode (since microcode_intel tries to probe firmware which does ++ not exist. *sigh*) ++ + * Fri Jan 29 2010 Harald Hoyer 151-2 + - fixed rules and startup script (#559844) + diff --git a/udev-151-virtio.patch b/udev-151-virtio.patch new file mode 100644 index 0000000..d1a7644 --- /dev/null +++ b/udev-151-virtio.patch @@ -0,0 +1,30 @@ +From 764304885705e51ef3eb1d078eed3cf6604c4684 Mon Sep 17 00:00:00 2001 +From: Amit Shah +Date: Fri, 26 Feb 2010 14:02:51 +0530 +Subject: [PATCH] Fix virtio-ports rule to use $attr instead of $ATTR + +Newer udev versions don't understand $ATTR. + +Signed-off-by: Amit Shah +--- + rules/rules.d/50-udev-default.rules | 2 +- + 1 files changed, 1 insertions(+), 1 deletions(-) + +Changed by Harald Hoyer + +diff --git a/rules/rules.d/50-udev-default.rules b/rules/rules.d/50-udev-default.rules +index f8556d1..da1535f 100644 +--- a/rules/rules.d/50-udev-default.rules ++++ b/rules/rules.d/50-udev-default.rules +@@ -18,7 +18,7 @@ KERNEL=="mwave", GROUP="dialout" + KERNEL=="hvc*|hvsi*", GROUP="dialout" + + # virtio serial / console ports +-KERNEL=="vport*", SYMLINK+="virtio-ports/$attr{name}" ++KERNEL=="vport*", ATTRS{name}=="?*", SYMLINK+="virtio-ports/$attr{name}" + + # mem + KERNEL=="null|zero|full|random|urandom", MODE="0666" +-- +1.6.2.5 + diff --git a/udev-post.init b/udev-post.init index f040950..67ed0c9 100644 --- a/udev-post.init +++ b/udev-post.init @@ -58,8 +58,8 @@ case "$1" in STRING=$"Generating udev makedev cache file" MAKEDEV="/sbin/MAKEDEV" USE_MD5="false" - [ -x /usr/bin/md5sum -a "$UDEV_USE_MAKEDEV_CACHE" == "yes" ] && USE_MD5="true" - if [ "$USE_MD5" == "true" -a -x "$MAKEDEV" ]; then + [[ "$UDEV_USE_MAKEDEV_CACHE" == "yes" && -x /usr/bin/md5sum ]] && USE_MD5="true" + if [[ "$USE_MD5" == "true" && -x "$MAKEDEV" ]]; then for i in /etc/udev/makedev.d/*.nodes; do if [ -f "$i" ]; then # use a little caching to speedup things diff --git a/udev.spec b/udev.spec index edce2f8..2684220 100644 --- a/udev.spec +++ b/udev.spec @@ -5,7 +5,7 @@ Summary: A userspace implementation of devfs Name: udev Version: 151 -Release: 3%{?dist} +Release: 4%{?dist} License: GPLv2 Group: System Environment/Base Provides: udev-persistent = %{version}-%{release} @@ -13,8 +13,32 @@ Obsoletes: udev-persistent < 0:030-5 Obsoletes: udev-extras < 20090618 Provides: udev-extras = 20090618-1 Source: ftp://ftp.kernel.org/pub/linux/utils/kernel/hotplug/%{name}-%{version}.tar.bz2 -Patch1: udev-151-rules.patch -Patch2: udev-86a7a2f-fix-missing-firmware.patch +Patch1: 0001-firmware-fix-error-reporting-on-missing-firmware-fil.patch +Patch2: 0002-keymap-Add-Dell-Inspiron-1011-Mini-10.patch +Patch3: 0003-Fix-brightness-keys-on-MSI-Wind-U-100.patch +Patch4: 0004-keymap-Add-support-for-Gateway-AOA110-AOA150-clones.patch +Patch5: 0005-keymap-Fix-LG-X110.patch +Patch6: 0006-Force-key-release-for-volume-keys-on-Dell-Studio-155.patch +Patch7: 0007-keymap-Add-Toshiba-Satellite-M30X.patch +Patch13: 0013-keymap-Add-Samsung-Q210-P210-force-release-quirk.patch +Patch14: 0014-keymap-Add-Fujitsu-Amilo-1848-u-force-release-quirk.patch +Patch15: 0015-Decrease-buffer-size-when-advancing-past-NUL-byte.patch +Patch16: 0016-Use-UTIL_LINE_SIZE-not-UTIL_PATH_SIZE-to-truncate-pr.patch +Patch17: 0017-Increase-UTIL_LINE_SIZE-from-2048-to-16384.patch +Patch18: 0018-Fix-virtio-ports-rule-to-use-attr-instead-of-ATTR.patch +Patch19: 0019-udev-acl-Correctly-handle-ENV-ACL_MANAGE-0.patch +Patch21: 0021-input_id-Fix-linking.patch +Patch22: 0022-replace-utimes-with-utimensat.patch +Patch29: 0029-firmware-fix-possible-segfault-when-firmware-device-.patch +Patch30: 0030-rules-input-create-by-path-links-for-pci-devices.patch +Patch31: 0031-Fix-switching-Logitech-bluetooth-adapters-into-hci-m.patch +Patch32: 0032-do-not-reset-SELinux-context-when-the-node-was-not-t.patch +Patch34: 0034-add-LGPL-COPYING-to-libudev-and-GUdev.patch +Patch35: 0035-cdrom_id-open-non-mounted-optical-media-with-O_EXCL.patch +Patch36: 0036-modeswitch-morph-into-tool-that-only-switches-Mobile.patch + +Patch101: udev-151-rules.patch +Patch102: udev-151-virtio.patch Source1: start_udev Source3: udev-post.init @@ -110,17 +134,42 @@ glib-based applications using libudev functionality. %prep %setup -q -%patch1 -p1 -%patch2 -p1 + +%patch1 -p1 -b .git1 +%patch2 -p1 -b .git2 +%patch3 -p1 -b .git3 +%patch4 -p1 -b .git4 +%patch5 -p1 -b .git5 +%patch6 -p1 -b .git6 +%patch7 -p1 -b .git7 +%patch13 -p1 -b .git13 +%patch14 -p1 -b .git14 +%patch15 -p1 -b .git15 +%patch16 -p1 -b .git16 +%patch17 -p1 -b .git17 +%patch18 -p1 -b .git18 +%patch19 -p1 -b .git19 +%patch21 -p1 -b .git21 +%patch22 -p1 -b .git22 +%patch29 -p1 -b .git29 +%patch30 -p1 -b .git30 +%patch31 -p1 -b .git31 +%patch32 -p1 -b .git32 +%patch34 -p1 -b .git34 +%patch35 -p1 -b .git35 +%patch36 -p1 -b .git36 + +%patch101 -p1 +%patch102 -p1 %build # get rid of rpath libtoolize -f -c %configure --with-selinux --prefix=%{_prefix} --exec-prefix="" \ - --sysconfdir=%{_sysconfdir} --with-libdir-name=%{_lib} \ - --sbindir="/sbin" --libexecdir=%{udev_scriptdir} \ - --with-rootlibdir=/%{_lib} --enable-introspection \ - --disable-rpath --enable-debug + --sysconfdir=%{_sysconfdir} --with-libdir-name=%{_lib} \ + --sbindir="/sbin" --libexecdir=%{udev_scriptdir} \ + --with-rootlibdir=/%{_lib} --enable-introspection \ + --disable-rpath --enable-debug make %{?_smp_mflags} @@ -143,32 +192,24 @@ touch $RPM_BUILD_ROOT%{_sysconfdir}/scsi_id.config # force relative symlinks ln -sf ..%{udev_scriptdir}/scsi_id $RPM_BUILD_ROOT/sbin/scsi_id -ln -sf ../../sbin/udevadm $RPM_BUILD_ROOT%{_bindir}/udevinfo -ln -sf ../../sbin/udevadm $RPM_BUILD_ROOT%{_bindir}/udevtest -ln -sf ../../sbin/udevadm $RPM_BUILD_ROOT%{_sbindir}/udevmonitor - -ln -sf ../../sbin/udevadm $RPM_BUILD_ROOT/sbin/udevtrigger -ln -sf ../../sbin/udevadm $RPM_BUILD_ROOT/sbin/udevsettle -ln -sf ../../sbin/udevadm $RPM_BUILD_ROOT/sbin/udevcontrol - for i in \ - rules/redhat/40-redhat.rules \ + rules/redhat/40-redhat.rules \ %ifarch ia64 - rules/packages/40-ia64.rules \ + rules/packages/40-ia64.rules \ %endif %ifarch ppc ppc64 - rules/packages/40-ppc.rules \ + rules/packages/40-ppc.rules \ %endif %ifarch s390 s390x - rules/packages/40-s390.rules \ + rules/packages/40-s390.rules \ %endif - rules/packages/40-isdn.rules \ - rules/packages/64-md-raid.rules \ - rules/packages/64-device-mapper.rules \ - ; do - install -m 0644 "$i" "$RPM_BUILD_ROOT%{udev_scriptdir}/rules.d/${i##*/}" + rules/packages/40-isdn.rules \ + rules/packages/64-md-raid.rules \ + rules/packages/64-device-mapper.rules \ + ; do + install -m 0644 "$i" "$RPM_BUILD_ROOT%{udev_scriptdir}/rules.d/${i##*/}" done - + mkdir -p $RPM_BUILD_ROOT%{udev_scriptdir}/{,devices} install -m 0755 %{SOURCE4} $RPM_BUILD_ROOT%{udev_scriptdir}/fw_unit_symlinks.sh @@ -188,16 +229,16 @@ mkdir -p $RPM_BUILD_ROOT/var/lib/udev/makedev.d %preun if [ "$1" -eq 0 -a -f %{_initrddir}/udev ]; then - if [ -x /sbin/pidof ]; then - pid=$(/sbin/pidof -c udevd) - if [ -n "$pid" ]; then - kill $pid - fi - fi - /sbin/chkconfig --del udev + if [ -x /sbin/pidof ]; then + pid=$(/sbin/pidof -c udevd) + if [ -n "$pid" ]; then + kill $pid + fi + fi + /sbin/chkconfig --del udev fi if [ "$1" -eq 0 ]; then - /sbin/chkconfig --del udev-post + /sbin/chkconfig --del udev-post fi exit 0 @@ -212,29 +253,29 @@ getent group dialout >/dev/null || /usr/sbin/groupadd -g 18 dialout || : # kill daemon if we are not in a chroot if test -f /proc/1/exe -a -d /proc/1/root; then - if test -x /usr/bin/stat -a "$(/usr/bin/stat -Lc '%%D-%%i' /)" = "$(/usr/bin/stat -Lc '%%D-%%i' /proc/1/root)"; then - if test -x /sbin/udevd -a -x /sbin/pidof ; then - /sbin/udevadm control --stop-exec-queue - pid=$(/sbin/pidof -c udevd) - while [ -n "$pid" ]; do - for p in $pid; do - kill $hard $p; - done - pid=$(/sbin/pidof -c udevd) - hard="-9" - done - fi - fi + if test -x /usr/bin/stat -a "$(/usr/bin/stat -Lc '%%D-%%i' /)" = "$(/usr/bin/stat -Lc '%%D-%%i' /proc/1/root)"; then + if test -x /sbin/udevd -a -x /sbin/pidof ; then + /sbin/udevadm control --stop-exec-queue + pid=$(/sbin/pidof -c udevd) + while [ -n "$pid" ]; do + for p in $pid; do + kill $hard $p; + done + pid=$(/sbin/pidof -c udevd) + hard="-9" + done + fi + fi fi exit 0 %post # start daemon if we are not in a chroot if test -f /proc/1/exe -a -d /proc/1/root; then - if test "$(/usr/bin/stat -Lc '%%D-%%i' /)" = "$(/usr/bin/stat -Lc '%%D-%%i' /proc/1/root)"; then - /sbin/udevd -d - /sbin/udevadm control --start-exec-queue - fi + if test "$(/usr/bin/stat -Lc '%%D-%%i' /)" = "$(/usr/bin/stat -Lc '%%D-%%i' /proc/1/root)"; then + /sbin/udevd -d + /sbin/udevadm control --start-exec-queue + fi fi /sbin/chkconfig --add udev-post @@ -259,9 +300,6 @@ rm -rf $RPM_BUILD_ROOT %defattr(0644, root, root, 0755) %doc NEWS COPYING README TODO ChangeLog extras/keymap/README.keymap.txt %attr(0755,root,root) /sbin/udevadm -%attr(0755,root,root) /sbin/udevsettle -%attr(0755,root,root) /sbin/udevtrigger -%attr(0755,root,root) /sbin/udevcontrol %attr(0755,root,root) /sbin/udevd %attr(0755,root,root) /sbin/start_udev %attr(0755,root,root) /sbin/scsi_id @@ -286,9 +324,6 @@ rm -rf $RPM_BUILD_ROOT %attr(0755,root,root) %dir %{udev_scriptdir}/rules.d/ %attr(0755,root,root) %{_sysconfdir}/rc.d/init.d/udev-post -%attr(0755,root,root) %{_bindir}/udevtest -%attr(0755,root,root) %{_bindir}/udevinfo -%attr(0755,root,root) %{_sbindir}/udevmonitor %attr(0755,root,root) %dir %{_sysconfdir}/udev/ %attr(0755,root,root) %dir %{_sysconfdir}/udev/rules.d/ %attr(0755,root,root) %dir %{udev_scriptdir}/ @@ -315,26 +350,26 @@ rm -rf $RPM_BUILD_ROOT %ghost %dir %{_sysconfdir}/udev/devices/ %ghost %dir %{_sysconfdir}/dev.d/ -%attr(0755,root,root) %{udev_scriptdir}/modem-modeswitch +%attr(0755,root,root) %{udev_scriptdir}/mobile-action-modeswitch %attr(0755,root,root) %{udev_scriptdir}/pci-db %attr(0755,root,root) %{udev_scriptdir}/usb-db %attr(0755,root,root) %{udev_scriptdir}/keymap %attr(0755,root,root) %{udev_scriptdir}/udev-acl %attr(0755,root,root) %{udev_scriptdir}/v4l_id %attr(0755,root,root) %{udev_scriptdir}/findkeyboards -%dir %attr(0755,root,root) %{udev_scriptdir}/keymaps -%attr(0644,root,root) %{udev_scriptdir}/keymaps/* +%dir %{udev_scriptdir}/keymaps +%{udev_scriptdir}/keymaps/* %attr(0644,root,root) %{_prefix}/lib/ConsoleKit/run-seat.d/udev-acl.ck %files -n libudev %defattr(0644, root, root, 0755) -%doc COPYING +%doc libudev/COPYING %attr(0755,root,root) /%{_lib}/libudev.so.* %files -n libudev-devel %defattr(0644, root, root, 0755) -%doc COPYING libudev/docs/html/* +%doc libudev/COPYING libudev/docs/html/* %{_includedir}/libudev.h %{_libdir}/libudev.so %{_libdir}/pkgconfig/libudev.pc @@ -343,14 +378,16 @@ rm -rf $RPM_BUILD_ROOT %files -n libgudev1 %defattr(0644, root, root, 0755) -%doc COPYING +%doc extras/gudev/COPYING %attr(0755,root,root) %{_libdir}/libgudev-1.0.so.* %attr(0644,root,root) %{_libdir}/girepository-1.0/GUdev-1.0.typelib %files -n libgudev1-devel %defattr(0644, root, root, 0755) -%doc COPYING extras/gudev/docs/html/* +%doc extras/gudev/COPYING extras/gudev/docs/html/* %attr(0755,root,root) %{_libdir}/libgudev-1.0.so +%dir %attr(0755,root,root) %{_includedir}/gudev-1.0 +%dir %attr(0755,root,root) %{_includedir}/gudev-1.0/gudev %attr(0644,root,root) %{_includedir}/gudev-1.0/gudev/*.h %attr(0644,root,root) %{_datadir}/gir-1.0/GUdev-1.0.gir %dir %{_datadir}/gtk-doc/html/gudev @@ -358,6 +395,17 @@ rm -rf $RPM_BUILD_ROOT %attr(0644,root,root) %{_libdir}/pkgconfig/gudev-1.0* %changelog +* Fri Mar 19 2010 Harald Hoyer 151-4 +- add patch for virtio-ports (#569700) +- own libgudev dirs (#561319) +- minor udev startup script improvements (#549518) +- create /dev/hugepages subdir in start_udev (#541998) +- remove GPL COPYING file from LGPL subpackages (#536843) +- removed symlinks to udevadm +- touch all device nodes after udev settled for the timezone + timestamp (#569335) +- add some upstream bugfixes + * Sun Feb 07 2010 Kyle McMartin 151-3 - udev-86a7a2f-fix-missing-firmware.patch: fix hang when loading microcode (since microcode_intel tries to probe firmware which does @@ -445,7 +493,7 @@ rm -rf $RPM_BUILD_ROOT - git fix: rule-generator: cd - skip by-path links if we create by-id links - git fix: fix possible endless loop for GOTO to non-existent LABEL - git fix: cdrom_id: suppress ID_CDROM_MEDIA_STATE=blank for plain non-writable - CDROM media + CDROM media * Thu Jun 08 2009 Harald Hoyer 142-3 - delay device-mapper changes From ad37a7c9650cb9daee47b809a89791aed12852f6 Mon Sep 17 00:00:00 2001 From: Harald Hoyer Date: Fri, 19 Mar 2010 13:20:44 +0000 Subject: [PATCH 054/142] add "-D" to gperf call --- udev-151-gperf.patch | 13 +++++++++++++ udev.spec | 5 +++++ 2 files changed, 18 insertions(+) create mode 100644 udev-151-gperf.patch diff --git a/udev-151-gperf.patch b/udev-151-gperf.patch new file mode 100644 index 0000000..db93ba7 --- /dev/null +++ b/udev-151-gperf.patch @@ -0,0 +1,13 @@ +diff -up udev-151/extras/keymap/keys-from-name.gperf udev-151/extras/keymap/keys-from-name +diff -up udev-151/Makefile.am.gperf udev-151/Makefile.am +--- udev-151/Makefile.am.gperf 2010-03-19 14:04:36.000000000 +0100 ++++ udev-151/Makefile.am 2010-03-19 14:04:52.000000000 +0100 +@@ -550,7 +550,7 @@ extras/keymap/keys-from-name.gperf: extr + $(AM_V_GEN)$(AWK) 'BEGIN{ print "struct key { const char* name; unsigned short id; };"; print "%null-strings"; print "%%";} { print $$1 ", " $$1 }' < $< > $@ + + extras/keymap/keys-from-name.h: extras/keymap/keys-from-name.gperf Makefile +- $(AM_V_GEN)$(GPERF) -L ANSI-C -t --ignore-case -N lookup_key -H hash_key_name -p -C < $< > $@ ++ $(AM_V_GEN)$(GPERF) -L ANSI-C -t --ignore-case -N lookup_key -H hash_key_name -p -C -D < $< > $@ + + extras/keymap/keys-to-name.h: extras/keymap/keys.txt Makefile + $(AM_V_GEN)$(AWK) 'BEGIN{ print "const char* const key_names[KEY_CNT] = { "} { print "[" $$1 "] = \"" $$1 "\"," } END{print "};"}' < $< > $@ diff --git a/udev.spec b/udev.spec index 2684220..e4ffd5b 100644 --- a/udev.spec +++ b/udev.spec @@ -39,6 +39,7 @@ Patch36: 0036-modeswitch-morph-into-tool-that-only-switches-Mobile.patch Patch101: udev-151-rules.patch Patch102: udev-151-virtio.patch +Patch103: udev-151-gperf.patch Source1: start_udev Source3: udev-post.init @@ -161,8 +162,11 @@ glib-based applications using libudev functionality. %patch101 -p1 %patch102 -p1 +%patch103 -p1 %build +autoreconf -i +automake # get rid of rpath libtoolize -f -c %configure --with-selinux --prefix=%{_prefix} --exec-prefix="" \ @@ -405,6 +409,7 @@ rm -rf $RPM_BUILD_ROOT - touch all device nodes after udev settled for the timezone timestamp (#569335) - add some upstream bugfixes +- add "-D" to gperf call * Sun Feb 07 2010 Kyle McMartin 151-3 - udev-86a7a2f-fix-missing-firmware.patch: fix hang when loading From 1bb5602ec725eb90b658b8d05dbdcda59e5636ef Mon Sep 17 00:00:00 2001 From: Harald Hoyer Date: Fri, 19 Mar 2010 13:24:17 +0000 Subject: [PATCH 055/142] - add "-D" to gperf call --- udev.spec | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/udev.spec b/udev.spec index e4ffd5b..195817f 100644 --- a/udev.spec +++ b/udev.spec @@ -5,7 +5,7 @@ Summary: A userspace implementation of devfs Name: udev Version: 151 -Release: 4%{?dist} +Release: 5%{?dist} License: GPLv2 Group: System Environment/Base Provides: udev-persistent = %{version}-%{release} @@ -399,6 +399,9 @@ rm -rf $RPM_BUILD_ROOT %attr(0644,root,root) %{_libdir}/pkgconfig/gudev-1.0* %changelog +* Fri Mar 19 2010 Harald Hoyer 151-5 +- add "-D" to gperf call + * Fri Mar 19 2010 Harald Hoyer 151-4 - add patch for virtio-ports (#569700) - own libgudev dirs (#561319) @@ -409,7 +412,6 @@ rm -rf $RPM_BUILD_ROOT - touch all device nodes after udev settled for the timezone timestamp (#569335) - add some upstream bugfixes -- add "-D" to gperf call * Sun Feb 07 2010 Kyle McMartin 151-3 - udev-86a7a2f-fix-missing-firmware.patch: fix hang when loading From a444fba28072314ed74037c6f2165fd1e2e1eab2 Mon Sep 17 00:00:00 2001 From: Harald Hoyer Date: Mon, 22 Mar 2010 10:08:46 +0000 Subject: [PATCH 056/142] - fixed return code of touching the device nodes [FAIL] -> [OK] --- start_udev | 5 +++-- udev.spec | 5 ++++- 2 files changed, 7 insertions(+), 3 deletions(-) diff --git a/start_udev b/start_udev index 0da55f4..ac06e3c 100755 --- a/start_udev +++ b/start_udev @@ -62,6 +62,7 @@ touch_recursive() { [[ -c "$i" || -b "$i" ]] && touch "$i" [ -d "$i" ] && touch_recursive "$i" done ) + return 0 } xargs_simple () { @@ -316,11 +317,11 @@ if [ -f "/sys/class/tty/console/uevent" ]; then wait_for_queue $udevtimeout ret=$[$ret + $?] wait + ret=$[$ret + $?] /sbin/udevadm control --env=STARTUP= # touch all device files for timezone glitches # "find" is in /usr/bin and might not be available - touch_recursive /dev > "$udev_root/null" 2>&1 - + touch_recursive /dev > "$udev_root/null" 2>&1 else echo -n " kernel too old for this udev version " /sbin/udevd -d $UDEV_OPTS diff --git a/udev.spec b/udev.spec index 195817f..d64ff0d 100644 --- a/udev.spec +++ b/udev.spec @@ -5,7 +5,7 @@ Summary: A userspace implementation of devfs Name: udev Version: 151 -Release: 5%{?dist} +Release: 6%{?dist} License: GPLv2 Group: System Environment/Base Provides: udev-persistent = %{version}-%{release} @@ -399,6 +399,9 @@ rm -rf $RPM_BUILD_ROOT %attr(0644,root,root) %{_libdir}/pkgconfig/gudev-1.0* %changelog +* Mon Mar 22 2010 Harald Hoyer 151-6 +- fixed return code of touching the device nodes [FAIL] -> [OK] + * Fri Mar 19 2010 Harald Hoyer 151-5 - add "-D" to gperf call From db587cb8c229354ae10f4fed02d3e5127ca84365 Mon Sep 17 00:00:00 2001 From: Harald Hoyer Date: Mon, 22 Mar 2010 13:34:41 +0000 Subject: [PATCH 057/142] - touch with "--no-create", will not use open() and trigger devs/watchdogs (bug #575417) --- start_udev | 2 +- udev-151-virtio.patch | 2 +- udev.spec | 6 +++++- 3 files changed, 7 insertions(+), 3 deletions(-) diff --git a/start_udev b/start_udev index ac06e3c..f6ca868 100755 --- a/start_udev +++ b/start_udev @@ -59,7 +59,7 @@ fi touch_recursive() { ( cd $1; for i in *; do - [[ -c "$i" || -b "$i" ]] && touch "$i" + [[ -c "$i" || -b "$i" ]] && touch --no-create "$i" [ -d "$i" ] && touch_recursive "$i" done ) return 0 diff --git a/udev-151-virtio.patch b/udev-151-virtio.patch index d1a7644..53bbef6 100644 --- a/udev-151-virtio.patch +++ b/udev-151-virtio.patch @@ -21,7 +21,7 @@ index f8556d1..da1535f 100644 # virtio serial / console ports -KERNEL=="vport*", SYMLINK+="virtio-ports/$attr{name}" -+KERNEL=="vport*", ATTRS{name}=="?*", SYMLINK+="virtio-ports/$attr{name}" ++KERNEL=="vport*", ATTR{name}=="?*", SYMLINK+="virtio-ports/$attr{name}" # mem KERNEL=="null|zero|full|random|urandom", MODE="0666" diff --git a/udev.spec b/udev.spec index d64ff0d..061713c 100644 --- a/udev.spec +++ b/udev.spec @@ -5,7 +5,7 @@ Summary: A userspace implementation of devfs Name: udev Version: 151 -Release: 6%{?dist} +Release: 7%{?dist} License: GPLv2 Group: System Environment/Base Provides: udev-persistent = %{version}-%{release} @@ -399,6 +399,10 @@ rm -rf $RPM_BUILD_ROOT %attr(0644,root,root) %{_libdir}/pkgconfig/gudev-1.0* %changelog +* Mon Mar 22 2010 Harald Hoyer 151-7 +- touch with "--no-create", will not use open() + and trigger devs/watchdogs (bug #575417) + * Mon Mar 22 2010 Harald Hoyer 151-6 - fixed return code of touching the device nodes [FAIL] -> [OK] From 89b0f29d8bedc9c6bba19d010b4f4025f6c02d4d Mon Sep 17 00:00:00 2001 From: Harald Hoyer Date: Mon, 22 Mar 2010 14:25:24 +0000 Subject: [PATCH 058/142] - only correct the timestamp, if UTC=="no" --- start_udev | 8 +++++--- udev.spec | 5 ++++- 2 files changed, 9 insertions(+), 4 deletions(-) diff --git a/start_udev b/start_udev index f6ca868..df6c41b 100755 --- a/start_udev +++ b/start_udev @@ -321,15 +321,17 @@ if [ -f "/sys/class/tty/console/uevent" ]; then /sbin/udevadm control --env=STARTUP= # touch all device files for timezone glitches # "find" is in /usr/bin and might not be available - touch_recursive /dev > "$udev_root/null" 2>&1 + if [ -f /etc/sysconfig/clock ]; then + . /etc/sysconfig/clock + [[ "$UTC" == "false" || "$UTC" == "no" ]] \ + && touch_recursive /dev > "$udev_root/null" 2>&1 + fi else echo -n " kernel too old for this udev version " /sbin/udevd -d $UDEV_OPTS ret=10 - fi -ret=$[$ret + $?] [ $ret -eq 0 ] && success $"$STRING" || failure $"$STRING" echo exit 0 diff --git a/udev.spec b/udev.spec index 061713c..d4bca7d 100644 --- a/udev.spec +++ b/udev.spec @@ -5,7 +5,7 @@ Summary: A userspace implementation of devfs Name: udev Version: 151 -Release: 7%{?dist} +Release: 8%{?dist} License: GPLv2 Group: System Environment/Base Provides: udev-persistent = %{version}-%{release} @@ -399,6 +399,9 @@ rm -rf $RPM_BUILD_ROOT %attr(0644,root,root) %{_libdir}/pkgconfig/gudev-1.0* %changelog +* Mon Mar 22 2010 Harald Hoyer 151-8 +- only correct the timestamp, if UTC=="no" + * Mon Mar 22 2010 Harald Hoyer 151-7 - touch with "--no-create", will not use open() and trigger devs/watchdogs (bug #575417) From 0d812c700ea84b6fbf1429db5eb497e183f376b1 Mon Sep 17 00:00:00 2001 From: Harald Hoyer Date: Tue, 13 Apr 2010 15:09:40 +0000 Subject: [PATCH 059/142] - pre release of version 152 --- udev.spec | 98 +++++++++++++++++++++++++++++++++++++++++++++++++++---- 1 file changed, 91 insertions(+), 7 deletions(-) diff --git a/udev.spec b/udev.spec index d4bca7d..8a5922e 100644 --- a/udev.spec +++ b/udev.spec @@ -4,8 +4,8 @@ Summary: A userspace implementation of devfs Name: udev -Version: 151 -Release: 8%{?dist} +Version: 152 +Release: 0.1.20100413git%{?dist} License: GPLv2 Group: System Environment/Base Provides: udev-persistent = %{version}-%{release} @@ -13,6 +13,7 @@ Obsoletes: udev-persistent < 0:030-5 Obsoletes: udev-extras < 20090618 Provides: udev-extras = 20090618-1 Source: ftp://ftp.kernel.org/pub/linux/utils/kernel/hotplug/%{name}-%{version}.tar.bz2 + Patch1: 0001-firmware-fix-error-reporting-on-missing-firmware-fil.patch Patch2: 0002-keymap-Add-Dell-Inspiron-1011-Mini-10.patch Patch3: 0003-Fix-brightness-keys-on-MSI-Wind-U-100.patch @@ -20,6 +21,11 @@ Patch4: 0004-keymap-Add-support-for-Gateway-AOA110-AOA150-clones.patch Patch5: 0005-keymap-Fix-LG-X110.patch Patch6: 0006-Force-key-release-for-volume-keys-on-Dell-Studio-155.patch Patch7: 0007-keymap-Add-Toshiba-Satellite-M30X.patch +Patch8: 0008-libudev-export-udev_monitor_set_receive_buffer_size.patch +Patch9: 0009-udevadm-monitor-increase-netlink-buffer-size.patch +Patch10: 0010-libudev-bump-minor-version.patch +Patch11: 0011-udevadm-fix-untested-and-broken-commit-to-set-buffer.patch +Patch12: 0012-configure.ac-version-bump.patch Patch13: 0013-keymap-Add-Samsung-Q210-P210-force-release-quirk.patch Patch14: 0014-keymap-Add-Fujitsu-Amilo-1848-u-force-release-quirk.patch Patch15: 0015-Decrease-buffer-size-when-advancing-past-NUL-byte.patch @@ -27,18 +33,54 @@ Patch16: 0016-Use-UTIL_LINE_SIZE-not-UTIL_PATH_SIZE-to-truncate-pr.patch Patch17: 0017-Increase-UTIL_LINE_SIZE-from-2048-to-16384.patch Patch18: 0018-Fix-virtio-ports-rule-to-use-attr-instead-of-ATTR.patch Patch19: 0019-udev-acl-Correctly-handle-ENV-ACL_MANAGE-0.patch +Patch20: 0020-udev-acl-no-not-encourage-use-of-ACL_MANAGE-outside-.patch Patch21: 0021-input_id-Fix-linking.patch Patch22: 0022-replace-utimes-with-utimensat.patch +Patch23: 0023-libbudev-private-rename-udev_list_entry_get_flag.patch +Patch24: 0024-udevadm-monitor-use-as-separator-in-subsystem-match-.patch +Patch25: 0025-use-major-minor-as-entries-in-symlink-stack-instead-.patch +Patch26: 0026-use-major-minor-as-entries-in-watch-directory.patch +#Patch27: 0027-libudev-docs-.gitignore-backup-files.patch +Patch28: 0028-udev-needs-automake-1.10.patch Patch29: 0029-firmware-fix-possible-segfault-when-firmware-device-.patch Patch30: 0030-rules-input-create-by-path-links-for-pci-devices.patch Patch31: 0031-Fix-switching-Logitech-bluetooth-adapters-into-hci-m.patch Patch32: 0032-do-not-reset-SELinux-context-when-the-node-was-not-t.patch +Patch33: 0033-libudev-add-udev_device_new_from_environment.patch Patch34: 0034-add-LGPL-COPYING-to-libudev-and-GUdev.patch Patch35: 0035-cdrom_id-open-non-mounted-optical-media-with-O_EXCL.patch Patch36: 0036-modeswitch-morph-into-tool-that-only-switches-Mobile.patch +Patch37: 0037-rules-virtio-fix-is-to-check-if-the-name-attribute-i.patch +Patch38: 0038-keymap-Add-Acer-TravelMate-6593G-and-Acer-Aspire-164.patch +Patch39: 0039-keymap-Fix-another-key-for-Acer-TravelMate-6593.patch +Patch40: 0040-libudev-update-documentation.patch +Patch41: 0041-Fix-Keymapping-for-upcoming-Dell-Laptops.patch +Patch42: 0042-Add-new-Dell-touchpad-keycode.patch +Patch43: 0043-Revert-special-casing-0xD8-to-latitude-XT-only.patch +Patch44: 0044-Fix-Dell-Studio-1558-volume-keys-not-releasing.patch +Patch45: 0045-Add-support-for-another-Dell-touchpad-toggle-key.patch +#Patch46: 0046-extras-mobile-action-modeswitch-update-gitignore.patch +Patch47: 0047-scsi_id-add-rand-in-retry-loop.patch +Patch48: 0048-cdrom_id-remove-debugging-code.patch +Patch49: 0049-cdrom_id-retry-to-open-the-device-if-EBUSY.patch +Patch50: 0050-cdrom_id-check-mount-state-in-retry-loop.patch +Patch51: 0051-cdrom_id-always-set-ID_CDROM-regardless-if-we-can-ru.patch +Patch52: 0052-rules-delete-outdated-packagees-rules.patch +Patch53: 0053-rules-we-do-not-have-static-devices-which-are-rename.patch +Patch54: 0054-unify-cleanup-event-handling.patch +Patch55: 0055-allow-IMPORT-db-KEY.patch +Patch56: 0056-usb-db-remove-double.patch +Patch57: 0057-replace-add-change-with-remove.patch +Patch58: 0058-update-NEWS.patch +Patch59: 0059-log-info-only-if-we-actually-delete-the-node.patch +Patch60: 0060-udevadm-trigger-switch-default-action-from-add-to-ch.patch +Patch61: 0061-remove-all_partitions-option.patch +Patch62: 0062-cdrom_id-Fix-uninitialized-variables.patch +Patch63: 0063-rules-call-modprobe-on-all-events-but-remove.patch +Patch64: 0064-remove-ignore_remove-option.patch +Patch65: 0065-cdrom_id-Fix-uninitialized-buffers.patch Patch101: udev-151-rules.patch -Patch102: udev-151-virtio.patch Patch103: udev-151-gperf.patch Source1: start_udev @@ -143,6 +185,11 @@ glib-based applications using libudev functionality. %patch5 -p1 -b .git5 %patch6 -p1 -b .git6 %patch7 -p1 -b .git7 +%patch8 -p1 -b .git8 +%patch9 -p1 -b .git9 +%patch10 -p1 -b .git10 +%patch11 -p1 -b .git11 +%patch12 -p1 -b .git12 %patch13 -p1 -b .git13 %patch14 -p1 -b .git14 %patch15 -p1 -b .git15 @@ -150,18 +197,55 @@ glib-based applications using libudev functionality. %patch17 -p1 -b .git17 %patch18 -p1 -b .git18 %patch19 -p1 -b .git19 +%patch20 -p1 -b .git20 %patch21 -p1 -b .git21 %patch22 -p1 -b .git22 +%patch23 -p1 -b .git23 +%patch24 -p1 -b .git24 +%patch25 -p1 -b .git25 +%patch26 -p1 -b .git26 +#%patch27 -p1 -b .git27 +%patch28 -p1 -b .git28 %patch29 -p1 -b .git29 %patch30 -p1 -b .git30 %patch31 -p1 -b .git31 %patch32 -p1 -b .git32 +%patch33 -p1 -b .git33 %patch34 -p1 -b .git34 %patch35 -p1 -b .git35 %patch36 -p1 -b .git36 +%patch37 -p1 -b .git37 +%patch38 -p1 -b .git38 +%patch39 -p1 -b .git39 +%patch40 -p1 -b .git40 +%patch41 -p1 -b .git41 +%patch42 -p1 -b .git42 +%patch43 -p1 -b .git43 +%patch44 -p1 -b .git44 +%patch45 -p1 -b .git45 +#%patch46 -p1 -b .git46 +%patch47 -p1 -b .git47 +%patch48 -p1 -b .git48 +%patch49 -p1 -b .git49 +%patch50 -p1 -b .git50 +%patch51 -p1 -b .git51 +%patch52 -p1 -b .git52 +%patch53 -p1 -b .git53 +%patch54 -p1 -b .git54 +%patch55 -p1 -b .git55 +%patch56 -p1 -b .git56 +%patch57 -p1 -b .git57 +%patch58 -p1 -b .git58 +%patch59 -p1 -b .git59 +%patch60 -p1 -b .git60 +%patch61 -p1 -b .git61 +%patch62 -p1 -b .git62 +%patch63 -p1 -b .git63 +%patch64 -p1 -b .git64 +%patch65 -p1 -b .git65 + %patch101 -p1 -%patch102 -p1 %patch103 -p1 %build @@ -207,9 +291,6 @@ for i in \ %ifarch s390 s390x rules/packages/40-s390.rules \ %endif - rules/packages/40-isdn.rules \ - rules/packages/64-md-raid.rules \ - rules/packages/64-device-mapper.rules \ ; do install -m 0644 "$i" "$RPM_BUILD_ROOT%{udev_scriptdir}/rules.d/${i##*/}" done @@ -399,6 +480,9 @@ rm -rf $RPM_BUILD_ROOT %attr(0644,root,root) %{_libdir}/pkgconfig/gudev-1.0* %changelog +* Tue Apr 13 2010 Harald Hoyer 152-0.1.20100413git +- pre release of version 152 + * Mon Mar 22 2010 Harald Hoyer 151-8 - only correct the timestamp, if UTC=="no" From 9e1428cd3efbdc0cb3774b8085aae4a45cda617d Mon Sep 17 00:00:00 2001 From: Harald Hoyer Date: Tue, 13 Apr 2010 15:17:30 +0000 Subject: [PATCH 060/142] - pre release of version 152 --- ...or-reporting-on-missing-firmware-fil.patch | 2 +- ...eymap-Add-Dell-Inspiron-1011-Mini-10.patch | 2 +- ...ix-brightness-keys-on-MSI-Wind-U-100.patch | 2 +- ...ort-for-Gateway-AOA110-AOA150-clones.patch | 2 +- 0005-keymap-Fix-LG-X110.patch | 2 +- ...e-for-volume-keys-on-Dell-Studio-155.patch | 2 +- 0007-keymap-Add-Toshiba-Satellite-M30X.patch | 2 +- ...udev_monitor_set_receive_buffer_size.patch | 58 +++ ...monitor-increase-netlink-buffer-size.patch | 37 ++ 0010-libudev-bump-minor-version.patch | 29 ++ ...sted-and-broken-commit-to-set-buffer.patch | 25 + 0012-configure.ac-version-bump.patch | 37 ++ ...amsung-Q210-P210-force-release-quirk.patch | 2 +- ...tsu-Amilo-1848-u-force-release-quirk.patch | 2 +- ...er-size-when-advancing-past-NUL-byte.patch | 2 +- ...ZE-not-UTIL_PATH_SIZE-to-truncate-pr.patch | 2 +- ...se-UTIL_LINE_SIZE-from-2048-to-16384.patch | 2 +- ...rts-rule-to-use-attr-instead-of-ATTR.patch | 2 +- ...cl-Correctly-handle-ENV-ACL_MANAGE-0.patch | 2 +- ...encourage-use-of-ACL_MANAGE-outside-.patch | 27 + 0021-input_id-Fix-linking.patch | 2 +- 0022-replace-utimes-with-utimensat.patch | 2 +- ...vate-rename-udev_list_entry_get_flag.patch | 212 ++++++++ ...use-as-separator-in-subsystem-match-.patch | 65 +++ ...as-entries-in-symlink-stack-instead-.patch | 81 +++ ...-minor-as-entries-in-watch-directory.patch | 120 +++++ 0028-udev-needs-automake-1.10.patch | 28 + ...sible-segfault-when-firmware-device-.patch | 2 +- ...create-by-path-links-for-pci-devices.patch | 2 +- ...gitech-bluetooth-adapters-into-hci-m.patch | 2 +- ...inux-context-when-the-node-was-not-t.patch | 2 +- ...add-udev_device_new_from_environment.patch | 480 ++++++++++++++++++ ...dd-LGPL-COPYING-to-libudev-and-GUdev.patch | 2 +- ...on-mounted-optical-media-with-O_EXCL.patch | 2 +- ...-into-tool-that-only-switches-Mobile.patch | 2 +- ...-is-to-check-if-the-name-attribute-i.patch | 28 + ...TravelMate-6593G-and-Acer-Aspire-164.patch | 25 + ...another-key-for-Acer-TravelMate-6593.patch | 26 + 0040-libudev-update-documentation.patch | 108 ++++ ...Keymapping-for-upcoming-Dell-Laptops.patch | 50 ++ 0042-Add-new-Dell-touchpad-keycode.patch | 32 ++ ...cial-casing-0xD8-to-latitude-XT-only.patch | 42 ++ ...tudio-1558-volume-keys-not-releasing.patch | 30 ++ ...for-another-Dell-touchpad-toggle-key.patch | 29 ++ 0047-scsi_id-add-rand-in-retry-loop.patch | 45 ++ 0048-cdrom_id-remove-debugging-code.patch | 24 + ...id-retry-to-open-the-device-if-EBUSY.patch | 53 ++ ...m_id-check-mount-state-in-retry-loop.patch | 55 ++ ...set-ID_CDROM-regardless-if-we-can-ru.patch | 31 ++ ...ules-delete-outdated-packagees-rules.patch | 124 +++++ ...have-static-devices-which-are-rename.patch | 21 + 0054-unify-cleanup-event-handling.patch | 362 +++++++++++++ 0055-allow-IMPORT-db-KEY.patch | 109 ++++ 0056-usb-db-remove-double.patch | 31 ++ 0057-replace-add-change-with-remove.patch | 276 ++++++++++ 0058-update-NEWS.patch | 30 ++ ...-only-if-we-actually-delete-the-node.patch | 27 + ...switch-default-action-from-add-to-ch.patch | 49 ++ 0061-remove-all_partitions-option.patch | 363 +++++++++++++ ...cdrom_id-Fix-uninitialized-variables.patch | 131 +++++ ...ll-modprobe-on-all-events-but-remove.patch | 36 ++ 0064-remove-ignore_remove-option.patch | 273 ++++++++++ 0065-cdrom_id-Fix-uninitialized-buffers.patch | 82 +++ udev.spec | 5 +- 64 files changed, 3717 insertions(+), 25 deletions(-) create mode 100644 0008-libudev-export-udev_monitor_set_receive_buffer_size.patch create mode 100644 0009-udevadm-monitor-increase-netlink-buffer-size.patch create mode 100644 0010-libudev-bump-minor-version.patch create mode 100644 0011-udevadm-fix-untested-and-broken-commit-to-set-buffer.patch create mode 100644 0012-configure.ac-version-bump.patch create mode 100644 0020-udev-acl-no-not-encourage-use-of-ACL_MANAGE-outside-.patch create mode 100644 0023-libbudev-private-rename-udev_list_entry_get_flag.patch create mode 100644 0024-udevadm-monitor-use-as-separator-in-subsystem-match-.patch create mode 100644 0025-use-major-minor-as-entries-in-symlink-stack-instead-.patch create mode 100644 0026-use-major-minor-as-entries-in-watch-directory.patch create mode 100644 0028-udev-needs-automake-1.10.patch create mode 100644 0033-libudev-add-udev_device_new_from_environment.patch create mode 100644 0037-rules-virtio-fix-is-to-check-if-the-name-attribute-i.patch create mode 100644 0038-keymap-Add-Acer-TravelMate-6593G-and-Acer-Aspire-164.patch create mode 100644 0039-keymap-Fix-another-key-for-Acer-TravelMate-6593.patch create mode 100644 0040-libudev-update-documentation.patch create mode 100644 0041-Fix-Keymapping-for-upcoming-Dell-Laptops.patch create mode 100644 0042-Add-new-Dell-touchpad-keycode.patch create mode 100644 0043-Revert-special-casing-0xD8-to-latitude-XT-only.patch create mode 100644 0044-Fix-Dell-Studio-1558-volume-keys-not-releasing.patch create mode 100644 0045-Add-support-for-another-Dell-touchpad-toggle-key.patch create mode 100644 0047-scsi_id-add-rand-in-retry-loop.patch create mode 100644 0048-cdrom_id-remove-debugging-code.patch create mode 100644 0049-cdrom_id-retry-to-open-the-device-if-EBUSY.patch create mode 100644 0050-cdrom_id-check-mount-state-in-retry-loop.patch create mode 100644 0051-cdrom_id-always-set-ID_CDROM-regardless-if-we-can-ru.patch create mode 100644 0052-rules-delete-outdated-packagees-rules.patch create mode 100644 0053-rules-we-do-not-have-static-devices-which-are-rename.patch create mode 100644 0054-unify-cleanup-event-handling.patch create mode 100644 0055-allow-IMPORT-db-KEY.patch create mode 100644 0056-usb-db-remove-double.patch create mode 100644 0057-replace-add-change-with-remove.patch create mode 100644 0058-update-NEWS.patch create mode 100644 0059-log-info-only-if-we-actually-delete-the-node.patch create mode 100644 0060-udevadm-trigger-switch-default-action-from-add-to-ch.patch create mode 100644 0061-remove-all_partitions-option.patch create mode 100644 0062-cdrom_id-Fix-uninitialized-variables.patch create mode 100644 0063-rules-call-modprobe-on-all-events-but-remove.patch create mode 100644 0064-remove-ignore_remove-option.patch create mode 100644 0065-cdrom_id-Fix-uninitialized-buffers.patch diff --git a/0001-firmware-fix-error-reporting-on-missing-firmware-fil.patch b/0001-firmware-fix-error-reporting-on-missing-firmware-fil.patch index 933407f..41727ad 100644 --- a/0001-firmware-fix-error-reporting-on-missing-firmware-fil.patch +++ b/0001-firmware-fix-error-reporting-on-missing-firmware-fil.patch @@ -1,7 +1,7 @@ From 86a7a2f853fe6022c5b0c1b415918047b65533be Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Thomas=20B=C3=A4chler?= Date: Sun, 31 Jan 2010 13:49:02 +0100 -Subject: [PATCH 01/36] firmware: fix error reporting on missing firmware files +Subject: [PATCH 01/65] firmware: fix error reporting on missing firmware files The new firmware loader does not report an error to the kernel if a firmware file is missing. This results in modprobe stalling for 60 seconds for each firmware diff --git a/0002-keymap-Add-Dell-Inspiron-1011-Mini-10.patch b/0002-keymap-Add-Dell-Inspiron-1011-Mini-10.patch index 47cc9fa..a2b2e5e 100644 --- a/0002-keymap-Add-Dell-Inspiron-1011-Mini-10.patch +++ b/0002-keymap-Add-Dell-Inspiron-1011-Mini-10.patch @@ -1,7 +1,7 @@ From fc47e0b56779ceeaaa40d2dc3248fa002af63aaa Mon Sep 17 00:00:00 2001 From: Martin Pitt Date: Mon, 1 Feb 2010 15:27:46 -0800 -Subject: [PATCH 02/36] keymap: Add Dell Inspiron 1011 (Mini 10) +Subject: [PATCH 02/65] keymap: Add Dell Inspiron 1011 (Mini 10) This fixes the broken WLAN key. --- diff --git a/0003-Fix-brightness-keys-on-MSI-Wind-U-100.patch b/0003-Fix-brightness-keys-on-MSI-Wind-U-100.patch index c00f51e..e1a366c 100644 --- a/0003-Fix-brightness-keys-on-MSI-Wind-U-100.patch +++ b/0003-Fix-brightness-keys-on-MSI-Wind-U-100.patch @@ -1,7 +1,7 @@ From d7e2d38c1f0ead2239808dd117577a99a3ad3cde Mon Sep 17 00:00:00 2001 From: Martin Pitt Date: Tue, 9 Feb 2010 15:47:47 +0100 -Subject: [PATCH 03/36] Fix brightness keys on MSI Wind U-100 +Subject: [PATCH 03/65] Fix brightness keys on MSI Wind U-100 The MSI Wind 100 generates ACPI/input events on the LNXVIDEO input device. On top of that, the video module/BIOS synthesize some extra event on atkbd as an diff --git a/0004-keymap-Add-support-for-Gateway-AOA110-AOA150-clones.patch b/0004-keymap-Add-support-for-Gateway-AOA110-AOA150-clones.patch index a7167c4..3d927d2 100644 --- a/0004-keymap-Add-support-for-Gateway-AOA110-AOA150-clones.patch +++ b/0004-keymap-Add-support-for-Gateway-AOA110-AOA150-clones.patch @@ -1,7 +1,7 @@ From 063985ef7dd6050f33920700777831426b221697 Mon Sep 17 00:00:00 2001 From: Robert Hooker Date: Sun, 7 Feb 2010 13:56:27 -0500 -Subject: [PATCH 04/36] keymap: Add support for Gateway AOA110/AOA150 clones. +Subject: [PATCH 04/65] keymap: Add support for Gateway AOA110/AOA150 clones. https://launchpad.net/bugs/518496 diff --git a/0005-keymap-Fix-LG-X110.patch b/0005-keymap-Fix-LG-X110.patch index 380ecf0..d36d5c0 100644 --- a/0005-keymap-Fix-LG-X110.patch +++ b/0005-keymap-Fix-LG-X110.patch @@ -1,7 +1,7 @@ From 4c514e31734a704ca58e543fa4330616ba584b39 Mon Sep 17 00:00:00 2001 From: Martin Pitt Date: Fri, 12 Feb 2010 19:25:47 +0100 -Subject: [PATCH 05/36] keymap: Fix LG X110 +Subject: [PATCH 05/65] keymap: Fix LG X110 The LG X110 is not a perfect clone of the MSI Wind after all, and needs its own keymap. Thanks to Konstantin Lavrov! diff --git a/0006-Force-key-release-for-volume-keys-on-Dell-Studio-155.patch b/0006-Force-key-release-for-volume-keys-on-Dell-Studio-155.patch index 2f147fc..d274d6c 100644 --- a/0006-Force-key-release-for-volume-keys-on-Dell-Studio-155.patch +++ b/0006-Force-key-release-for-volume-keys-on-Dell-Studio-155.patch @@ -1,7 +1,7 @@ From b15bb8019094797aee65f35e3e654354b61bfd7b Mon Sep 17 00:00:00 2001 From: Jerone Young Date: Fri, 12 Feb 2010 18:08:08 -0600 -Subject: [PATCH 06/36] Force key release for volume keys on Dell Studio 1557 +Subject: [PATCH 06/65] Force key release for volume keys on Dell Studio 1557 Dell Studio 1557 does not generate a release code when the volume keys are pressed, causing them to generate infinite key presses. This forces diff --git a/0007-keymap-Add-Toshiba-Satellite-M30X.patch b/0007-keymap-Add-Toshiba-Satellite-M30X.patch index 4d17c00..98a893b 100644 --- a/0007-keymap-Add-Toshiba-Satellite-M30X.patch +++ b/0007-keymap-Add-Toshiba-Satellite-M30X.patch @@ -1,7 +1,7 @@ From 4ca91a04e8b727a079a973fdd9bc2b093e8315a5 Mon Sep 17 00:00:00 2001 From: Martin Pitt Date: Mon, 15 Feb 2010 13:15:25 +0100 -Subject: [PATCH 07/36] keymap: Add Toshiba Satellite M30X +Subject: [PATCH 07/65] keymap: Add Toshiba Satellite M30X Thanks to Alessio Gaeta! diff --git a/0008-libudev-export-udev_monitor_set_receive_buffer_size.patch b/0008-libudev-export-udev_monitor_set_receive_buffer_size.patch new file mode 100644 index 0000000..34a10cf --- /dev/null +++ b/0008-libudev-export-udev_monitor_set_receive_buffer_size.patch @@ -0,0 +1,58 @@ +From a571c23e954cb88cdd5faa28593b19bd7c340130 Mon Sep 17 00:00:00 2001 +From: Scott James Remnant +Date: Wed, 17 Feb 2010 15:26:00 +0000 +Subject: [PATCH 08/65] libudev: export udev_monitor_set_receive_buffer_size() + +This function is useful for anything that's likely to be running +alongside udevd during cold-plugging, and is using libudev to +receive the events. + +It makes little sense for it to be private, or to require other +software to relearn how to adjust the buffer size. + +Signed-off-by: Scott James Remnant +--- + libudev/exported_symbols | 1 + + libudev/libudev-private.h | 1 - + libudev/libudev.h | 1 + + 3 files changed, 2 insertions(+), 1 deletions(-) + +diff --git a/libudev/exported_symbols b/libudev/exported_symbols +index 018463d..f48025a 100644 +--- a/libudev/exported_symbols ++++ b/libudev/exported_symbols +@@ -51,6 +51,7 @@ udev_enumerate_scan_subsystems + udev_enumerate_add_syspath + udev_monitor_new_from_socket + udev_monitor_new_from_netlink ++udev_monitor_set_receive_buffer_size + udev_monitor_enable_receiving + udev_monitor_ref + udev_monitor_unref +diff --git a/libudev/libudev-private.h b/libudev/libudev-private.h +index c2fff00..0d28b80 100644 +--- a/libudev/libudev-private.h ++++ b/libudev/libudev-private.h +@@ -109,7 +109,6 @@ int udev_monitor_disconnect(struct udev_monitor *udev_monitor); + int udev_monitor_allow_unicast_sender(struct udev_monitor *udev_monitor, struct udev_monitor *sender); + int udev_monitor_send_device(struct udev_monitor *udev_monitor, + struct udev_monitor *destination, struct udev_device *udev_device); +-int udev_monitor_set_receive_buffer_size(struct udev_monitor *udev_monitor, int size); + + /* libudev-ctrl.c - daemon runtime setup */ + struct udev_ctrl; +diff --git a/libudev/libudev.h b/libudev/libudev.h +index ad11059..9576ad4 100644 +--- a/libudev/libudev.h ++++ b/libudev/libudev.h +@@ -111,6 +111,7 @@ struct udev_monitor *udev_monitor_new_from_netlink(struct udev *udev, const char + struct udev_monitor *udev_monitor_new_from_socket(struct udev *udev, const char *socket_path); + /* bind socket */ + int udev_monitor_enable_receiving(struct udev_monitor *udev_monitor); ++int udev_monitor_set_receive_buffer_size(struct udev_monitor *udev_monitor, int size); + int udev_monitor_get_fd(struct udev_monitor *udev_monitor); + struct udev_device *udev_monitor_receive_device(struct udev_monitor *udev_monitor); + /* in-kernel socket filters to select messages that get delivered to a listener */ +-- +1.6.6 + diff --git a/0009-udevadm-monitor-increase-netlink-buffer-size.patch b/0009-udevadm-monitor-increase-netlink-buffer-size.patch new file mode 100644 index 0000000..db69f85 --- /dev/null +++ b/0009-udevadm-monitor-increase-netlink-buffer-size.patch @@ -0,0 +1,37 @@ +From 0fe3c26eab97c4ee381918e6925a6cd798be5f39 Mon Sep 17 00:00:00 2001 +From: Scott James Remnant +Date: Wed, 17 Feb 2010 15:27:36 +0000 +Subject: [PATCH 09/65] udevadm monitor: increase netlink buffer size + +A common use (e.g. in Ubuntu) for udevadm monitor is to log the events +received by udev during boot; events can be lost of the buffer size isn't +increased as udevd does. + +Signed-off-by: Scott James Remnant +--- + udev/udevadm-monitor.c | 2 ++ + 1 files changed, 2 insertions(+), 0 deletions(-) + +diff --git a/udev/udevadm-monitor.c b/udev/udevadm-monitor.c +index 00b130d..ea4b7dc 100644 +--- a/udev/udevadm-monitor.c ++++ b/udev/udevadm-monitor.c +@@ -158,6 +158,7 @@ int udevadm_monitor(struct udev *udev, int argc, char *argv[]) + rc = 1; + goto out; + } ++ udev_monitor_set_receive_buffer_size(udev_monitor, 128*1024*1024); + + udev_list_entry_foreach(entry, udev_list_get_entry(&subsystem_match_list)) { + const char *subsys = udev_list_entry_get_name(entry); +@@ -183,6 +184,7 @@ int udevadm_monitor(struct udev *udev, int argc, char *argv[]) + rc = 3; + goto out; + } ++ udev_monitor_set_receive_buffer_size(udev, 128*1024*1024); + + udev_list_entry_foreach(entry, udev_list_get_entry(&subsystem_match_list)) { + const char *subsys = udev_list_entry_get_name(entry); +-- +1.6.6 + diff --git a/0010-libudev-bump-minor-version.patch b/0010-libudev-bump-minor-version.patch new file mode 100644 index 0000000..6e79298 --- /dev/null +++ b/0010-libudev-bump-minor-version.patch @@ -0,0 +1,29 @@ +From e0fcf21c030027101338c7673c5cb814b82261d1 Mon Sep 17 00:00:00 2001 +From: Kay Sievers +Date: Thu, 18 Feb 2010 11:03:09 +0100 +Subject: [PATCH 10/65] libudev: bump minor version + +--- + Makefile.am | 6 +++--- + 1 files changed, 3 insertions(+), 3 deletions(-) + +diff --git a/Makefile.am b/Makefile.am +index db23f16..3780f50 100644 +--- a/Makefile.am ++++ b/Makefile.am +@@ -28,9 +28,9 @@ CLEANFILES = + # ------------------------------------------------------------------------------ + # libudev + # ------------------------------------------------------------------------------ +-LIBUDEV_CURRENT=6 +-LIBUDEV_REVISION=1 +-LIBUDEV_AGE=6 ++LIBUDEV_CURRENT=7 ++LIBUDEV_REVISION=0 ++LIBUDEV_AGE=7 + + SUBDIRS += libudev/docs + +-- +1.6.6 + diff --git a/0011-udevadm-fix-untested-and-broken-commit-to-set-buffer.patch b/0011-udevadm-fix-untested-and-broken-commit-to-set-buffer.patch new file mode 100644 index 0000000..382e057 --- /dev/null +++ b/0011-udevadm-fix-untested-and-broken-commit-to-set-buffer.patch @@ -0,0 +1,25 @@ +From 044bd2bcc7a160c97f7dd052d6de50d35186df13 Mon Sep 17 00:00:00 2001 +From: Kay Sievers +Date: Thu, 18 Feb 2010 11:03:28 +0100 +Subject: [PATCH 11/65] udevadm: fix untested and broken commit to set buffer size + +--- + udev/udevadm-monitor.c | 2 +- + 1 files changed, 1 insertions(+), 1 deletions(-) + +diff --git a/udev/udevadm-monitor.c b/udev/udevadm-monitor.c +index ea4b7dc..4063c48 100644 +--- a/udev/udevadm-monitor.c ++++ b/udev/udevadm-monitor.c +@@ -184,7 +184,7 @@ int udevadm_monitor(struct udev *udev, int argc, char *argv[]) + rc = 3; + goto out; + } +- udev_monitor_set_receive_buffer_size(udev, 128*1024*1024); ++ udev_monitor_set_receive_buffer_size(kernel_monitor, 128*1024*1024); + + udev_list_entry_foreach(entry, udev_list_get_entry(&subsystem_match_list)) { + const char *subsys = udev_list_entry_get_name(entry); +-- +1.6.6 + diff --git a/0012-configure.ac-version-bump.patch b/0012-configure.ac-version-bump.patch new file mode 100644 index 0000000..8193aea --- /dev/null +++ b/0012-configure.ac-version-bump.patch @@ -0,0 +1,37 @@ +From fff82e9d77415111193d9547bbe3618892147b39 Mon Sep 17 00:00:00 2001 +From: Kay Sievers +Date: Thu, 18 Feb 2010 11:09:25 +0100 +Subject: [PATCH 12/65] configure.ac: version bump + +--- + NEWS | 6 ++++++ + configure.ac | 2 +- + 2 files changed, 7 insertions(+), 1 deletions(-) + +diff --git a/NEWS b/NEWS +index 5b23a8b..a4d46d7 100644 +--- a/NEWS ++++ b/NEWS +@@ -1,3 +1,9 @@ ++udev 152 ++======== ++Bugfixes. ++ ++New and fixed keymaps. ++ + udev 151 + ======== + Bugfixes. +diff --git a/configure.ac b/configure.ac +index 4cecb86..88824b6 100644 +--- a/configure.ac ++++ b/configure.ac +@@ -1,4 +1,4 @@ +-AC_INIT([udev], [151], [linux-hotplug@vger.kernel.org]) ++AC_INIT([udev], [152], [linux-hotplug@vger.kernel.org]) + AC_PREREQ(2.60) + AM_INIT_AUTOMAKE([check-news foreign 1.9 dist-bzip2 subdir-objects]) + m4_ifdef([AM_SILENT_RULES], [AM_SILENT_RULES([yes])]) +-- +1.6.6 + diff --git a/0013-keymap-Add-Samsung-Q210-P210-force-release-quirk.patch b/0013-keymap-Add-Samsung-Q210-P210-force-release-quirk.patch index 328a2b4..488a6e0 100644 --- a/0013-keymap-Add-Samsung-Q210-P210-force-release-quirk.patch +++ b/0013-keymap-Add-Samsung-Q210-P210-force-release-quirk.patch @@ -1,7 +1,7 @@ From 20b48c3727eef1f266cbfd6bf5854b5c1419beb9 Mon Sep 17 00:00:00 2001 From: Andy Whitcroft Date: Tue, 2 Mar 2010 13:55:03 +0100 -Subject: [PATCH 13/36] keymap: Add Samsung Q210/P210 force-release quirk +Subject: [PATCH 13/65] keymap: Add Samsung Q210/P210 force-release quirk The Samsung Q210/P210 laptop also needs all of its function keys quirked. diff --git a/0014-keymap-Add-Fujitsu-Amilo-1848-u-force-release-quirk.patch b/0014-keymap-Add-Fujitsu-Amilo-1848-u-force-release-quirk.patch index 9bedd1e..8ce3972 100644 --- a/0014-keymap-Add-Fujitsu-Amilo-1848-u-force-release-quirk.patch +++ b/0014-keymap-Add-Fujitsu-Amilo-1848-u-force-release-quirk.patch @@ -1,7 +1,7 @@ From da96a11b9c9164447bef206db47c405342ab8daa Mon Sep 17 00:00:00 2001 From: Andy Whitcroft Date: Tue, 2 Mar 2010 14:00:32 +0100 -Subject: [PATCH 14/36] keymap: Add Fujitsu Amilo 1848+u force-release quirk +Subject: [PATCH 14/65] keymap: Add Fujitsu Amilo 1848+u force-release quirk The Fujitsu Amilo Si 1848+u laptop requires the volume and mute keys quirking. diff --git a/0015-Decrease-buffer-size-when-advancing-past-NUL-byte.patch b/0015-Decrease-buffer-size-when-advancing-past-NUL-byte.patch index 4ad5dce..98541ed 100644 --- a/0015-Decrease-buffer-size-when-advancing-past-NUL-byte.patch +++ b/0015-Decrease-buffer-size-when-advancing-past-NUL-byte.patch @@ -1,7 +1,7 @@ From ecd42de2c56b4fcf0069b8b4a4d6607710e5de61 Mon Sep 17 00:00:00 2001 From: David Zeuthen Date: Tue, 2 Mar 2010 17:06:33 -0500 -Subject: [PATCH 15/36] Decrease buffer size when advancing past NUL byte +Subject: [PATCH 15/65] Decrease buffer size when advancing past NUL byte Otherwise we'll overflow the buffer if space is tight. Also add a comment explaining this. diff --git a/0016-Use-UTIL_LINE_SIZE-not-UTIL_PATH_SIZE-to-truncate-pr.patch b/0016-Use-UTIL_LINE_SIZE-not-UTIL_PATH_SIZE-to-truncate-pr.patch index 174767d..024ee15 100644 --- a/0016-Use-UTIL_LINE_SIZE-not-UTIL_PATH_SIZE-to-truncate-pr.patch +++ b/0016-Use-UTIL_LINE_SIZE-not-UTIL_PATH_SIZE-to-truncate-pr.patch @@ -1,7 +1,7 @@ From 3a19299202b5d34b89d5910fde25e8a4cfa2b31a Mon Sep 17 00:00:00 2001 From: David Zeuthen Date: Tue, 2 Mar 2010 17:07:14 -0500 -Subject: [PATCH 16/36] Use UTIL_LINE_SIZE, not UTIL_PATH_SIZE to truncate properties +Subject: [PATCH 16/65] Use UTIL_LINE_SIZE, not UTIL_PATH_SIZE to truncate properties Signed-off-by: David Zeuthen --- diff --git a/0017-Increase-UTIL_LINE_SIZE-from-2048-to-16384.patch b/0017-Increase-UTIL_LINE_SIZE-from-2048-to-16384.patch index 802351e..d7419a1 100644 --- a/0017-Increase-UTIL_LINE_SIZE-from-2048-to-16384.patch +++ b/0017-Increase-UTIL_LINE_SIZE-from-2048-to-16384.patch @@ -1,7 +1,7 @@ From e32d5237ea045045c621edba7341631abd602d74 Mon Sep 17 00:00:00 2001 From: David Zeuthen Date: Tue, 2 Mar 2010 17:10:02 -0500 -Subject: [PATCH 17/36] Increase UTIL_LINE_SIZE from 2048 to 16384 +Subject: [PATCH 17/65] Increase UTIL_LINE_SIZE from 2048 to 16384 Recent udisks versions, for LVM2 integration, ships with probers that produce very long lines such as diff --git a/0018-Fix-virtio-ports-rule-to-use-attr-instead-of-ATTR.patch b/0018-Fix-virtio-ports-rule-to-use-attr-instead-of-ATTR.patch index f02f3f0..a536914 100644 --- a/0018-Fix-virtio-ports-rule-to-use-attr-instead-of-ATTR.patch +++ b/0018-Fix-virtio-ports-rule-to-use-attr-instead-of-ATTR.patch @@ -1,7 +1,7 @@ From 3c4b1738a9d591d7ddce361ea184b76b253c4e87 Mon Sep 17 00:00:00 2001 From: Amit Shah Date: Fri, 26 Feb 2010 14:05:41 +0530 -Subject: [PATCH 18/36] Fix virtio-ports rule to use $attr instead of $ATTR +Subject: [PATCH 18/65] Fix virtio-ports rule to use $attr instead of $ATTR Newer udev versions don't understand $ATTR. diff --git a/0019-udev-acl-Correctly-handle-ENV-ACL_MANAGE-0.patch b/0019-udev-acl-Correctly-handle-ENV-ACL_MANAGE-0.patch index 29f81f1..d9aed68 100644 --- a/0019-udev-acl-Correctly-handle-ENV-ACL_MANAGE-0.patch +++ b/0019-udev-acl-Correctly-handle-ENV-ACL_MANAGE-0.patch @@ -1,7 +1,7 @@ From 5c3ebbf35a2c101e0212c7066f0d65e457fcf40c Mon Sep 17 00:00:00 2001 From: Martin Pitt Date: Thu, 4 Mar 2010 00:48:59 +0100 -Subject: [PATCH 19/36] udev-acl: Correctly handle ENV{ACL_MANAGE}==0 +Subject: [PATCH 19/65] udev-acl: Correctly handle ENV{ACL_MANAGE}==0 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit diff --git a/0020-udev-acl-no-not-encourage-use-of-ACL_MANAGE-outside-.patch b/0020-udev-acl-no-not-encourage-use-of-ACL_MANAGE-outside-.patch new file mode 100644 index 0000000..b65e4e4 --- /dev/null +++ b/0020-udev-acl-no-not-encourage-use-of-ACL_MANAGE-outside-.patch @@ -0,0 +1,27 @@ +From 9a87132677191e49c3d464c91aac7fc218e1eb18 Mon Sep 17 00:00:00 2001 +From: Kay Sievers +Date: Sun, 7 Mar 2010 13:47:34 +0100 +Subject: [PATCH 20/65] udev-acl: no not encourage use of ACL_MANAGE outside of rules file + +--- + extras/udev-acl/70-acl.rules | 4 +++- + 1 files changed, 3 insertions(+), 1 deletions(-) + +diff --git a/extras/udev-acl/70-acl.rules b/extras/udev-acl/70-acl.rules +index 874667c..fde2656 100644 +--- a/extras/udev-acl/70-acl.rules ++++ b/extras/udev-acl/70-acl.rules +@@ -1,7 +1,9 @@ + # do not edit this file, it will be overwritten on update + ++# Do not use ACL_MANAGE outside of this file. This variable is private to ++# udev-acl of this udev release and may be replaced at any time. ++ + ENV{MAJOR}=="", GOTO="acl_end" +-ENV{ACL_MANAGE}=="0", GOTO="acl_end" + ACTION!="add|change", GOTO="acl_apply" + + # PTP/MTP protocol devices, cameras, portable media players +-- +1.6.6 + diff --git a/0021-input_id-Fix-linking.patch b/0021-input_id-Fix-linking.patch index 2e822bc..1e3734b 100644 --- a/0021-input_id-Fix-linking.patch +++ b/0021-input_id-Fix-linking.patch @@ -1,7 +1,7 @@ From a245a97b4e805c65ce22659742371550ccf002c1 Mon Sep 17 00:00:00 2001 From: Martin Pitt Date: Wed, 10 Mar 2010 12:17:03 +0100 -Subject: [PATCH 21/36] input_id: Fix linking +Subject: [PATCH 21/65] input_id: Fix linking Link against libudev-private.a instead of libudev.a, to avoid runtime dependency to libudev. diff --git a/0022-replace-utimes-with-utimensat.patch b/0022-replace-utimes-with-utimensat.patch index 7a42304..57599d5 100644 --- a/0022-replace-utimes-with-utimensat.patch +++ b/0022-replace-utimes-with-utimensat.patch @@ -1,7 +1,7 @@ From 455f792e4791e037eb0406005b92c345cf0baf56 Mon Sep 17 00:00:00 2001 From: Kay Sievers Date: Wed, 10 Mar 2010 14:43:07 +0100 -Subject: [PATCH 22/36] replace utimes() with utimensat() +Subject: [PATCH 22/65] replace utimes() with utimensat() --- udev/udev-node.c | 4 ++-- diff --git a/0023-libbudev-private-rename-udev_list_entry_get_flag.patch b/0023-libbudev-private-rename-udev_list_entry_get_flag.patch new file mode 100644 index 0000000..bb2ceb1 --- /dev/null +++ b/0023-libbudev-private-rename-udev_list_entry_get_flag.patch @@ -0,0 +1,212 @@ +From fbb31cd6e10fe66d2da781db0ba9a8d671a4c6aa Mon Sep 17 00:00:00 2001 +From: Kay Sievers +Date: Wed, 10 Mar 2010 14:52:42 +0100 +Subject: [PATCH 23/65] libbudev-private: rename udev_list_entry_get_flag() + +--- + libudev/libudev-device-private.c | 4 ++-- + libudev/libudev-device.c | 4 ++-- + libudev/libudev-list.c | 10 +++++----- + libudev/libudev-private.h | 9 ++++++--- + udev/udev-event.c | 2 +- + udev/udev-node.c | 2 +- + udev/udev-rules.c | 12 ++++++------ + 7 files changed, 23 insertions(+), 20 deletions(-) + +diff --git a/libudev/libudev-device-private.c b/libudev/libudev-device-private.c +index 07249c3..1bcf441 100644 +--- a/libudev/libudev-device-private.c ++++ b/libudev/libudev-device-private.c +@@ -39,7 +39,7 @@ int udev_device_update_db(struct udev_device *udev_device) + util_strscpyl(filename_tmp, sizeof(filename_tmp), filename, ".tmp", NULL); + + udev_list_entry_foreach(list_entry, udev_device_get_properties_list_entry(udev_device)) +- if (udev_list_entry_get_flag(list_entry)) ++ if (udev_list_entry_get_flags(list_entry)) + goto file; + if (udev_device_get_num_fake_partitions(udev_device) != 0) + goto file; +@@ -102,7 +102,7 @@ file: + if (udev_device_get_watch_handle(udev_device) >= 0) + fprintf(f, "W:%i\n", udev_device_get_watch_handle(udev_device)); + udev_list_entry_foreach(list_entry, udev_device_get_properties_list_entry(udev_device)) { +- if (!udev_list_entry_get_flag(list_entry)) ++ if (!udev_list_entry_get_flags(list_entry)) + continue; + fprintf(f, "E:%s=%s\n", + udev_list_entry_get_name(list_entry), +diff --git a/libudev/libudev-device.c b/libudev/libudev-device.c +index b841745..aec5fb5 100644 +--- a/libudev/libudev-device.c ++++ b/libudev/libudev-device.c +@@ -1,7 +1,7 @@ + /* + * libudev - interface to udev device information + * +- * Copyright (C) 2008-2009 Kay Sievers ++ * Copyright (C) 2008-2010 Kay Sievers + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public +@@ -1068,7 +1068,7 @@ int udev_device_add_devlink(struct udev_device *udev_device, const char *devlink + if (list_entry == NULL) + return -ENOMEM; + if (unique) +- udev_list_entry_set_flag(list_entry, 1); ++ udev_list_entry_set_flags(list_entry, 1); + return 0; + } + +diff --git a/libudev/libudev-list.c b/libudev/libudev-list.c +index f6637fc..b5e9645 100644 +--- a/libudev/libudev-list.c ++++ b/libudev/libudev-list.c +@@ -38,7 +38,7 @@ struct udev_list_entry { + struct udev_list_node *list; + char *name; + char *value; +- int flag; ++ unsigned int flags; + }; + + /* list head point to itself if empty */ +@@ -258,16 +258,16 @@ const char *udev_list_entry_get_value(struct udev_list_entry *list_entry) + return list_entry->value; + } + +-int udev_list_entry_get_flag(struct udev_list_entry *list_entry) ++unsigned int udev_list_entry_get_flags(struct udev_list_entry *list_entry) + { + if (list_entry == NULL) + return -EINVAL; +- return list_entry->flag; ++ return list_entry->flags; + } + +-void udev_list_entry_set_flag(struct udev_list_entry *list_entry, int flag) ++void udev_list_entry_set_flags(struct udev_list_entry *list_entry, unsigned int flags) + { + if (list_entry == NULL) + return; +- list_entry->flag = flag; ++ list_entry->flags = flags; + } +diff --git a/libudev/libudev-private.h b/libudev/libudev-private.h +index e0c51dc..5ee0c58 100644 +--- a/libudev/libudev-private.h ++++ b/libudev/libudev-private.h +@@ -1,7 +1,7 @@ + /* + * libudev - interface to udev device information + * +- * Copyright (C) 2008-2009 Kay Sievers ++ * Copyright (C) 2008-2010 Kay Sievers + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public +@@ -82,6 +82,9 @@ const char *udev_device_get_devpath_old(struct udev_device *udev_device); + const char *udev_device_get_sysname_old(struct udev_device *udev_device); + int udev_device_set_devpath_old(struct udev_device *udev_device, const char *devpath_old); + const char *udev_device_get_knodename(struct udev_device *udev_device); ++int udev_device_add_tag(struct udev_device *udev_device, const char *tag); ++struct udev_list_entry *udev_device_get_tag_list_entry(struct udev_device *udev_device); ++int udev_device_has_tag(struct udev_device *udev_device, const char *tag); + int udev_device_set_knodename(struct udev_device *udev_device, const char *knodename); + int udev_device_get_timeout(struct udev_device *udev_device); + int udev_device_set_timeout(struct udev_device *udev_device, int timeout); +@@ -163,8 +166,8 @@ void udev_list_entry_insert_before(struct udev_list_entry *new, struct udev_list + void udev_list_entry_append(struct udev_list_entry *new, struct udev_list_node *list); + void udev_list_cleanup_entries(struct udev *udev, struct udev_list_node *name_list); + struct udev_list_entry *udev_list_get_entry(struct udev_list_node *list); +-int udev_list_entry_get_flag(struct udev_list_entry *list_entry); +-void udev_list_entry_set_flag(struct udev_list_entry *list_entry, int flag); ++unsigned int udev_list_entry_get_flags(struct udev_list_entry *list_entry); ++void udev_list_entry_set_flags(struct udev_list_entry *list_entry, unsigned int flags); + #define udev_list_entry_foreach_safe(entry, tmp, first) \ + for (entry = first, tmp = udev_list_entry_get_next(entry); \ + entry != NULL; \ +diff --git a/udev/udev-event.c b/udev/udev-event.c +index 4e1773f..986c119 100644 +--- a/udev/udev-event.c ++++ b/udev/udev-event.c +@@ -729,7 +729,7 @@ int udev_event_execute_run(struct udev_event *event, const sigset_t *sigmask) + udev_event_apply_format(event, cmd, program, sizeof(program)); + envp = udev_device_get_properties_envp(event->dev); + if (util_run_program(event->udev, program, envp, NULL, 0, NULL, sigmask) != 0) { +- if (udev_list_entry_get_flag(list_entry)) ++ if (udev_list_entry_get_flags(list_entry)) + err = -1; + } + } +diff --git a/udev/udev-node.c b/udev/udev-node.c +index 307a76b..23bfade 100644 +--- a/udev/udev-node.c ++++ b/udev/udev-node.c +@@ -405,7 +405,7 @@ int udev_node_add(struct udev_device *dev, mode_t mode, uid_t uid, gid_t gid) + + /* create/update symlinks, add symlinks to name index */ + udev_list_entry_foreach(list_entry, udev_device_get_devlinks_list_entry(dev)) { +- if (udev_list_entry_get_flag(list_entry)) ++ if (udev_list_entry_get_flags(list_entry)) + /* simple unmanaged link name */ + node_symlink(udev, udev_device_get_devnode(dev), udev_list_entry_get_name(list_entry)); + else +diff --git a/udev/udev-rules.c b/udev/udev-rules.c +index 3da2033..60daad5 100644 +--- a/udev/udev-rules.c ++++ b/udev/udev-rules.c +@@ -717,7 +717,7 @@ static int import_property_from_string(struct udev_device *dev, char *line) + entry = udev_device_add_property(dev, key, val); + /* store in db, skip private keys */ + if (key[0] != '.') +- udev_list_entry_set_flag(entry, 1); ++ udev_list_entry_set_flags(entry, 1); + } + return 0; + } +@@ -785,7 +785,7 @@ static int import_parent_into_properties(struct udev_device *dev, const char *fi + entry = udev_device_add_property(dev, key, val); + /* store in db, skip private keys */ + if (key[0] != '.') +- udev_list_entry_set_flag(entry, 1); ++ udev_list_entry_set_flags(entry, 1); + } + } + return 0; +@@ -1831,13 +1831,13 @@ struct udev_rules *udev_rules_new(struct udev *udev, int resolve_names) + filename_off = add_string(rules, filename); + /* the offset in the rule is limited to unsigned short */ + if (filename_off < USHRT_MAX) +- udev_list_entry_set_flag(file_loop, filename_off); ++ udev_list_entry_set_flags(file_loop, filename_off); + } + + /* parse list of files */ + udev_list_entry_foreach_safe(file_loop, file_tmp, udev_list_get_entry(&file_list)) { + const char *filename = udev_list_entry_get_name(file_loop); +- unsigned int filename_off = udev_list_entry_get_flag(file_loop); ++ unsigned int filename_off = udev_list_entry_get_flags(file_loop); + + if (stat(filename, &statbuf) == 0 && statbuf.st_size > 0) + parse_file(rules, filename, filename_off); +@@ -2420,7 +2420,7 @@ int udev_rules_apply_to_event(struct udev_rules *rules, struct udev_event *event + entry = udev_device_add_property(event->dev, name, temp_value); + /* store in db, skip private keys */ + if (name[0] != '.') +- udev_list_entry_set_flag(entry, 1); ++ udev_list_entry_set_flags(entry, 1); + } else { + udev_device_add_property(event->dev, name, NULL); + } +@@ -2542,7 +2542,7 @@ int udev_rules_apply_to_event(struct udev_rules *rules, struct udev_event *event + list_entry = udev_list_entry_add(event->udev, &event->run_list, + &rules->buf[cur->key.value_off], NULL, 1, 0); + if (cur->key.fail_on_error) +- udev_list_entry_set_flag(list_entry, 1); ++ udev_list_entry_set_flags(list_entry, 1); + break; + } + case TK_A_GOTO: +-- +1.6.6 + diff --git a/0024-udevadm-monitor-use-as-separator-in-subsystem-match-.patch b/0024-udevadm-monitor-use-as-separator-in-subsystem-match-.patch new file mode 100644 index 0000000..6a6a349 --- /dev/null +++ b/0024-udevadm-monitor-use-as-separator-in-subsystem-match-.patch @@ -0,0 +1,65 @@ +From a00ff5db021b50864ba50cce15865bca2d52f91f Mon Sep 17 00:00:00 2001 +From: Kay Sievers +Date: Wed, 10 Mar 2010 15:00:00 +0100 +Subject: [PATCH 24/65] udevadm: monitor - use / as separator in --subsystem-match=subsystem[/devtype] + +--- + udev/udevadm-monitor.c | 12 ++++++------ + udev/udevadm.xml | 6 ++++++ + 2 files changed, 12 insertions(+), 6 deletions(-) + +diff --git a/udev/udevadm-monitor.c b/udev/udevadm-monitor.c +index 4063c48..d136c60 100644 +--- a/udev/udevadm-monitor.c ++++ b/udev/udevadm-monitor.c +@@ -1,5 +1,5 @@ + /* +- * Copyright (C) 2004-2009 Kay Sievers ++ * Copyright (C) 2004-2010 Kay Sievers + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by +@@ -111,7 +111,7 @@ int udevadm_monitor(struct udev *udev, int argc, char *argv[]) + char *devtype; + + util_strscpy(subsys, sizeof(subsys), optarg); +- devtype = strchr(subsys, ':'); ++ devtype = strchr(subsys, '/'); + if (devtype != NULL) { + devtype[0] = '\0'; + devtype++; +@@ -121,10 +121,10 @@ int udevadm_monitor(struct udev *udev, int argc, char *argv[]) + } + case 'h': + printf("Usage: udevadm monitor [--property] [--kernel] [--udev] [--help]\n" +- " --property print the event properties\n" +- " --kernel print kernel uevents\n" +- " --udev print udev events\n" +- " --subsystem-match= filter events\n" ++ " --property print the event properties\n" ++ " --kernel print kernel uevents\n" ++ " --udev print udev events\n" ++ " --subsystem-match= filter events by subsystem\n" + " --help\n\n"); + default: + goto out; +diff --git a/udev/udevadm.xml b/udev/udevadm.xml +index ad49249..fa1742b 100644 +--- a/udev/udevadm.xml ++++ b/udev/udevadm.xml +@@ -350,6 +350,12 @@ + + + ++ ++ ++ Filter events by subsystem[/devtype]. Only udev events with a matching subsystem value will pass. ++ ++ ++ + + + Print help text. +-- +1.6.6 + diff --git a/0025-use-major-minor-as-entries-in-symlink-stack-instead-.patch b/0025-use-major-minor-as-entries-in-symlink-stack-instead-.patch new file mode 100644 index 0000000..be5f864 --- /dev/null +++ b/0025-use-major-minor-as-entries-in-symlink-stack-instead-.patch @@ -0,0 +1,81 @@ +From af24bb178eec6adcf4f04d3b183cd50a831c8b7e Mon Sep 17 00:00:00 2001 +From: Kay Sievers +Date: Wed, 10 Mar 2010 17:29:27 +0100 +Subject: [PATCH 25/65] use major:minor as entries in symlink stack instead of devpath + +--- + udev/udev-node.c | 30 ++++++++++++++++-------------- + 1 files changed, 16 insertions(+), 14 deletions(-) + +diff --git a/udev/udev-node.c b/udev/udev-node.c +index 23bfade..4314cce 100644 +--- a/udev/udev-node.c ++++ b/udev/udev-node.c +@@ -245,28 +245,26 @@ static const char *link_find_prioritized(struct udev_device *dev, bool add, cons + for (;;) { + struct udev_device *dev_db; + struct dirent *dent; +- char devpath[UTIL_PATH_SIZE]; +- char syspath[UTIL_PATH_SIZE]; +- ssize_t len; ++ int maj, min; ++ char type, type2; ++ dev_t devnum; + + dent = readdir(dir); + if (dent == NULL || dent->d_name[0] == '\0') + break; + if (dent->d_name[0] == '.') + continue; +- dbg(udev, "found '%s/%s'\n", stackdir, dent->d_name); +- len = readlinkat(dirfd(dir), dent->d_name, devpath, sizeof(devpath)); +- if (len <= 0 || len == (ssize_t)sizeof(devpath)) ++ if (sscanf(dent->d_name, "%c%i:%i", &type, &maj, &min) != 3) + continue; +- devpath[len] = '\0'; +- util_strscpyl(syspath, sizeof(syspath), udev_get_sys_path(udev), devpath, NULL); +- info(udev, "found '%s' claiming '%s'\n", syspath, stackdir); ++ info(udev, "found '%c%i:%i' claiming '%s'\n", type, maj, min, stackdir); ++ devnum = makedev(maj, min); + + /* did we find ourself? */ +- if (strcmp(udev_device_get_syspath(dev), syspath) == 0) ++ type2 = strcmp(udev_device_get_subsystem(dev), "block") == 0 ? 'b' : 'c'; ++ if (udev_device_get_devnum(dev) == devnum && type == type2) + continue; + +- dev_db = udev_device_new_from_syspath(udev, syspath); ++ dev_db = udev_device_new_from_devnum(udev, type, devnum); + if (dev_db != NULL) { + const char *devnode; + +@@ -276,7 +274,7 @@ static const char *link_find_prioritized(struct udev_device *dev, bool add, cons + udev_device_get_devnode(dev_db), udev_device_get_devlink_priority(dev_db)); + if (target == NULL || udev_device_get_devlink_priority(dev_db) > priority) { + info(udev, "'%s' claims priority %i for '%s'\n", +- syspath, udev_device_get_devlink_priority(dev_db), stackdir); ++ udev_device_get_syspath(dev_db), udev_device_get_devlink_priority(dev_db), stackdir); + priority = udev_device_get_devlink_priority(dev_db); + util_strscpy(buf, bufsize, devnode); + target = buf; +@@ -328,11 +326,15 @@ static void link_update(struct udev_device *dev, const char *slink, bool add) + + dbg(udev, "creating index: '%s'\n", filename); + do { ++ int fd; ++ + err = util_create_path(udev, filename); + if (err != 0 && err != -ENOENT) + break; +- err = symlink(udev_device_get_devpath(dev), filename); +- if (err != 0) ++ fd = open(filename, O_WRONLY|O_CREAT, 0444); ++ if (fd >= 0) ++ close(fd); ++ else + err = -errno; + } while (err == -ENOENT); + } +-- +1.6.6 + diff --git a/0026-use-major-minor-as-entries-in-watch-directory.patch b/0026-use-major-minor-as-entries-in-watch-directory.patch new file mode 100644 index 0000000..ceb2939 --- /dev/null +++ b/0026-use-major-minor-as-entries-in-watch-directory.patch @@ -0,0 +1,120 @@ +From 777239cb211ade308abb0a2b57d055614061f417 Mon Sep 17 00:00:00 2001 +From: Kay Sievers +Date: Wed, 10 Mar 2010 18:54:35 +0100 +Subject: [PATCH 26/65] use major:minor as entries in watch directory + +--- + udev/udev-watch.c | 47 +++++++++++++++++++++++++++++------------------ + 1 files changed, 29 insertions(+), 18 deletions(-) + +diff --git a/udev/udev-watch.c b/udev/udev-watch.c +index d67083b..7135d9f 100644 +--- a/udev/udev-watch.c ++++ b/udev/udev-watch.c +@@ -1,5 +1,5 @@ + /* +- * Copyright (C) 2004-2008 Kay Sievers ++ * Copyright (C) 2004-2010 Kay Sievers + * Copyright (C) 2009 Canonical Ltd. + * Copyright (C) 2009 Scott James Remnant + * +@@ -72,29 +72,29 @@ void udev_watch_restore(struct udev *udev) + size_t l; + ssize_t len; + struct udev_device *dev; ++ int maj, min; ++ char type; + +- if (ent->d_name[0] < '0' || ent->d_name[0] > '9') ++ if (ent->d_name[0] == '.') + continue; + + s = device; + l = util_strpcpy(&s, sizeof(device), udev_get_sys_path(udev)); + len = readlinkat(dirfd(dir), ent->d_name, s, l); +- if (len <= 0 || len >= (ssize_t)l) { +- unlinkat(dirfd(dir), ent->d_name, 0); +- continue; +- } ++ if (len <= 0 || len >= (ssize_t)l) ++ goto unlink; + s[len] = '\0'; +- dbg(udev, "old watch to '%s' found\n", device); +- dev = udev_device_new_from_syspath(udev, device); +- if (dev == NULL) { +- unlinkat(dirfd(dir), ent->d_name, 0); +- continue; +- } ++ ++ if (sscanf(s, "%c%i:%i", &type, &maj, &min) != 3) ++ goto unlink; ++ dev = udev_device_new_from_devnum(udev, type, makedev(maj, min)); ++ if (dev == NULL) ++ goto unlink; + + info(udev, "restoring old watch on '%s'\n", udev_device_get_devnode(dev)); + udev_watch_begin(udev, dev); +- + udev_device_unref(dev); ++unlink: + unlinkat(dirfd(dir), ent->d_name, 0); + } + +@@ -109,6 +109,7 @@ void udev_watch_restore(struct udev *udev) + void udev_watch_begin(struct udev *udev, struct udev_device *dev) + { + char filename[UTIL_PATH_SIZE]; ++ char majmin[UTIL_PATH_SIZE]; + int wd; + + if (inotify_fd < 0) +@@ -122,10 +123,13 @@ void udev_watch_begin(struct udev *udev, struct udev_device *dev) + return; + } + ++ snprintf(majmin, sizeof(majmin), "%c%i:%i", ++ strcmp(udev_device_get_subsystem(dev), "block") == 0 ? 'b' : 'c', ++ major(udev_device_get_devnum(dev)), minor(udev_device_get_devnum(dev))); + snprintf(filename, sizeof(filename), "%s/.udev/watch/%d", udev_get_dev_path(udev), wd); + util_create_path(udev, filename); + unlink(filename); +- symlink(udev_device_get_devpath(dev), filename); ++ symlink(majmin, filename); + + udev_device_set_watch_handle(dev, wd); + } +@@ -154,20 +158,27 @@ void udev_watch_end(struct udev *udev, struct udev_device *dev) + struct udev_device *udev_watch_lookup(struct udev *udev, int wd) + { + char filename[UTIL_PATH_SIZE]; +- char syspath[UTIL_PATH_SIZE]; ++ char majmin[UTIL_PATH_SIZE]; + char *s; + size_t l; + ssize_t len; ++ int maj, min; ++ char type; ++ dev_t devnum; + + if (inotify_fd < 0 || wd < 0) + return NULL; + + snprintf(filename, sizeof(filename), "%s/.udev/watch/%d", udev_get_dev_path(udev), wd); +- s = syspath; +- l = util_strpcpy(&s, sizeof(syspath), udev_get_sys_path(udev)); ++ s = majmin; ++ l = util_strpcpy(&s, sizeof(majmin), udev_get_sys_path(udev)); + len = readlink(filename, s, l); + if (len < 0 || (size_t)len >= l) + return NULL; + s[len] = '\0'; +- return udev_device_new_from_syspath(udev, syspath); ++ ++ if (sscanf(s, "%c%i:%i", &type, &maj, &min) != 3) ++ return NULL; ++ devnum = makedev(maj, min); ++ return udev_device_new_from_devnum(udev, type, devnum); + } +-- +1.6.6 + diff --git a/0028-udev-needs-automake-1.10.patch b/0028-udev-needs-automake-1.10.patch new file mode 100644 index 0000000..9cd9024 --- /dev/null +++ b/0028-udev-needs-automake-1.10.patch @@ -0,0 +1,28 @@ +From b41102757d9d1f71aa04f3d264d57d573360d957 Mon Sep 17 00:00:00 2001 +From: Adrian Bunk +Date: Thu, 11 Mar 2010 15:05:42 +0200 +Subject: [PATCH 28/65] udev needs automake 1.10 + +extras/gudev/docs/Makefile.am:4: require Automake 1.10, but have 1.9.6 +libudev/docs/Makefile.am:4: require Automake 1.10, but have 1.9.6 + +Signed-off-by: Martin Pitt +--- + configure.ac | 2 +- + 1 files changed, 1 insertions(+), 1 deletions(-) + +diff --git a/configure.ac b/configure.ac +index 88824b6..d53dd12 100644 +--- a/configure.ac ++++ b/configure.ac +@@ -1,6 +1,6 @@ + AC_INIT([udev], [152], [linux-hotplug@vger.kernel.org]) + AC_PREREQ(2.60) +-AM_INIT_AUTOMAKE([check-news foreign 1.9 dist-bzip2 subdir-objects]) ++AM_INIT_AUTOMAKE([check-news foreign 1.10 dist-bzip2 subdir-objects]) + m4_ifdef([AM_SILENT_RULES], [AM_SILENT_RULES([yes])]) + AC_DISABLE_STATIC + AC_USE_SYSTEM_EXTENSIONS +-- +1.6.6 + diff --git a/0029-firmware-fix-possible-segfault-when-firmware-device-.patch b/0029-firmware-fix-possible-segfault-when-firmware-device-.patch index 05c1939..e48406f 100644 --- a/0029-firmware-fix-possible-segfault-when-firmware-device-.patch +++ b/0029-firmware-fix-possible-segfault-when-firmware-device-.patch @@ -1,7 +1,7 @@ From d44c27c5ab71dbbcfcf4745977027502309dd795 Mon Sep 17 00:00:00 2001 From: Kay Sievers Date: Tue, 16 Mar 2010 10:57:44 +0100 -Subject: [PATCH 29/36] firmware: fix possible segfault when firmware device goes away while loading +Subject: [PATCH 29/65] firmware: fix possible segfault when firmware device goes away while loading Thanks to Ruediger Oertel. --- diff --git a/0030-rules-input-create-by-path-links-for-pci-devices.patch b/0030-rules-input-create-by-path-links-for-pci-devices.patch index c35bd60..836fad5 100644 --- a/0030-rules-input-create-by-path-links-for-pci-devices.patch +++ b/0030-rules-input-create-by-path-links-for-pci-devices.patch @@ -1,7 +1,7 @@ From 6b32e8192934619f787c3b5b6f0fe40c32d7d94a Mon Sep 17 00:00:00 2001 From: Marco d'Itri Date: Tue, 16 Mar 2010 12:44:43 +0100 -Subject: [PATCH 30/36] rules: input - create by-path/ links for pci devices +Subject: [PATCH 30/65] rules: input - create by-path/ links for pci devices --- rules/rules.d/60-persistent-input.rules | 2 +- diff --git a/0031-Fix-switching-Logitech-bluetooth-adapters-into-hci-m.patch b/0031-Fix-switching-Logitech-bluetooth-adapters-into-hci-m.patch index a773b94..cf17eed 100644 --- a/0031-Fix-switching-Logitech-bluetooth-adapters-into-hci-m.patch +++ b/0031-Fix-switching-Logitech-bluetooth-adapters-into-hci-m.patch @@ -1,7 +1,7 @@ From 2b463cb050cbf77d9c6b51e0f5a9d89bf7eb1bc3 Mon Sep 17 00:00:00 2001 From: Marco d'Itri Date: Tue, 16 Mar 2010 12:47:42 +0100 -Subject: [PATCH 31/36] Fix switching Logitech bluetooth adapters into hci mode. +Subject: [PATCH 31/65] Fix switching Logitech bluetooth adapters into hci mode. http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=567237 https://bugs.launchpad.net/ubuntu/+source/udev/+bug/444420 diff --git a/0032-do-not-reset-SELinux-context-when-the-node-was-not-t.patch b/0032-do-not-reset-SELinux-context-when-the-node-was-not-t.patch index ca136bd..864f039 100644 --- a/0032-do-not-reset-SELinux-context-when-the-node-was-not-t.patch +++ b/0032-do-not-reset-SELinux-context-when-the-node-was-not-t.patch @@ -1,7 +1,7 @@ From 578cc8a8085a47c963b5940459e475ac5f07219c Mon Sep 17 00:00:00 2001 From: Kay Sievers Date: Wed, 17 Mar 2010 09:15:18 +0100 -Subject: [PATCH 32/36] do not reset SELinux context when the node was not touched +Subject: [PATCH 32/65] do not reset SELinux context when the node was not touched --- udev/udev-node.c | 42 +++++++++++++++++------------------------- diff --git a/0033-libudev-add-udev_device_new_from_environment.patch b/0033-libudev-add-udev_device_new_from_environment.patch new file mode 100644 index 0000000..f84c44e --- /dev/null +++ b/0033-libudev-add-udev_device_new_from_environment.patch @@ -0,0 +1,480 @@ +From fc8d61c53d6c181dc1e9f5a23c0f805c32a392af Mon Sep 17 00:00:00 2001 +From: Kay Sievers +Date: Wed, 17 Mar 2010 17:42:35 +0100 +Subject: [PATCH 33/65] libudev: add udev_device_new_from_environment() + +--- + extras/usb_id/usb_id.c | 34 ++++--- + libudev/docs/libudev-sections.txt | 1 + + libudev/exported_symbols | 1 + + libudev/libudev-device.c | 214 ++++++++++++++++++++++++++++--------- + libudev/libudev-monitor.c | 66 +----------- + libudev/libudev-private.h | 3 +- + libudev/libudev.h | 1 + + 7 files changed, 192 insertions(+), 128 deletions(-) + +diff --git a/extras/usb_id/usb_id.c b/extras/usb_id/usb_id.c +index b412598..42ccddf 100644 +--- a/extras/usb_id/usb_id.c ++++ b/extras/usb_id/usb_id.c +@@ -456,8 +456,6 @@ int main(int argc, char **argv) + }; + struct udev *udev; + struct udev_device *dev = NULL; +- char syspath[UTIL_PATH_SIZE]; +- const char *devpath; + static int export; + int retval = 0; + +@@ -492,7 +490,7 @@ int main(int argc, char **argv) + export = 1; + break; + case 'h': +- printf("Usage: usb_id [--usb-info] [--num-info] [--export] [--help] \n" ++ printf("Usage: usb_id [--usb-info] [--num-info] [--export] [--help] []\n" + " --usb-info use usb strings instead\n" + " --num-info use numerical values\n" + " --export print values as environment keys\n" +@@ -503,18 +501,26 @@ int main(int argc, char **argv) + } + } + +- devpath = argv[optind]; +- if (devpath == NULL) { +- fprintf(stderr, "No device specified\n"); +- retval = 1; +- goto exit; +- } +- +- util_strscpyl(syspath, sizeof(syspath), udev_get_sys_path(udev), devpath, NULL); +- dev = udev_device_new_from_syspath(udev, syspath); ++ dev = udev_device_new_from_environment(udev); + if (dev == NULL) { +- err(udev, "unable to access '%s'\n", devpath); +- return 1; ++ char syspath[UTIL_PATH_SIZE]; ++ const char *devpath; ++ ++ devpath = argv[optind]; ++ if (devpath == NULL) { ++ fprintf(stderr, "missing device\n"); ++ retval = 1; ++ goto exit; ++ } ++ ++ util_strscpyl(syspath, sizeof(syspath), udev_get_sys_path(udev), devpath, NULL); ++ dev = udev_device_new_from_syspath(udev, syspath); ++ if (dev == NULL) { ++ err(udev, "unable to access '%s'\n", devpath); ++ retval = 1; ++ goto exit; ++ return 1; ++ } + } + + retval = usb_id(dev); +diff --git a/libudev/docs/libudev-sections.txt b/libudev/docs/libudev-sections.txt +index c11a273..ca781ff 100644 +--- a/libudev/docs/libudev-sections.txt ++++ b/libudev/docs/libudev-sections.txt +@@ -35,6 +35,7 @@ udev_device_get_udev + udev_device_new_from_syspath + udev_device_new_from_devnum + udev_device_new_from_subsystem_sysname ++udev_device_new_from_environment + udev_device_get_parent + udev_device_get_parent_with_subsystem_devtype + udev_device_get_devpath +diff --git a/libudev/exported_symbols b/libudev/exported_symbols +index f48025a..61486c6 100644 +--- a/libudev/exported_symbols ++++ b/libudev/exported_symbols +@@ -15,6 +15,7 @@ udev_list_entry_get_value + udev_device_new_from_syspath + udev_device_new_from_devnum + udev_device_new_from_subsystem_sysname ++udev_device_new_from_environment + udev_device_get_parent + udev_device_get_parent_with_subsystem_devtype + udev_device_ref +diff --git a/libudev/libudev-device.c b/libudev/libudev-device.c +index aec5fb5..fe45880 100644 +--- a/libudev/libudev-device.c ++++ b/libudev/libudev-device.c +@@ -13,6 +13,7 @@ + #include + #include + #include ++#include + #include + #include + #include +@@ -67,6 +68,7 @@ struct udev_device { + int refcount; + dev_t devnum; + int watch_handle; ++ int maj, min; + unsigned int parent_set:1; + unsigned int subsystem_set:1; + unsigned int devtype_set:1; +@@ -77,6 +79,130 @@ struct udev_device { + unsigned int ignore_remove:1; + }; + ++struct udev_list_entry *udev_device_add_property(struct udev_device *udev_device, const char *key, const char *value) ++{ ++ udev_device->envp_uptodate = 0; ++ if (value == NULL) { ++ struct udev_list_entry *list_entry; ++ ++ list_entry = udev_device_get_properties_list_entry(udev_device); ++ list_entry = udev_list_entry_get_by_name(list_entry, key); ++ if (list_entry != NULL) ++ udev_list_entry_delete(list_entry); ++ return NULL; ++ } ++ return udev_list_entry_add(udev_device->udev, &udev_device->properties_list, key, value, 1, 0); ++} ++ ++static struct udev_list_entry *udev_device_add_property_from_string(struct udev_device *udev_device, const char *property) ++{ ++ char name[UTIL_LINE_SIZE]; ++ char *val; ++ ++ util_strscpy(name, sizeof(name), property); ++ val = strchr(name, '='); ++ if (val == NULL) ++ return NULL; ++ val[0] = '\0'; ++ val = &val[1]; ++ if (val[0] == '\0') ++ val = NULL; ++ return udev_device_add_property(udev_device, name, val); ++} ++ ++/* ++ * parse property string, and if needed, update internal values accordingly ++ * ++ * udev_device_add_property_from_string_parse_finish() needs to be ++ * called after adding properties, and its return value checked ++ * ++ * udev_device_set_info_loaded() needs to be set, to avoid trying ++ * to use a device without a DEVPATH set ++ */ ++void udev_device_add_property_from_string_parse(struct udev_device *udev_device, const char *property) ++{ ++ if (strncmp(property, "DEVPATH=", 8) == 0) { ++ char path[UTIL_PATH_SIZE]; ++ ++ util_strscpyl(path, sizeof(path), udev_get_sys_path(udev_device->udev), &property[8], NULL); ++ udev_device_set_syspath(udev_device, path); ++ } else if (strncmp(property, "SUBSYSTEM=", 10) == 0) { ++ udev_device_set_subsystem(udev_device, &property[10]); ++ } else if (strncmp(property, "DEVTYPE=", 8) == 0) { ++ udev_device_set_devtype(udev_device, &property[8]); ++ } else if (strncmp(property, "DEVNAME=", 8) == 0) { ++ if (property[8] == '/') ++ udev_device_set_devnode(udev_device, &property[8]); ++ else ++ udev_device_set_knodename(udev_device, &property[8]); ++ } else if (strncmp(property, "DEVLINKS=", 9) == 0) { ++ char devlinks[UTIL_PATH_SIZE]; ++ char *slink; ++ char *next; ++ ++ util_strscpy(devlinks, sizeof(devlinks), &property[9]); ++ slink = devlinks; ++ next = strchr(slink, ' '); ++ while (next != NULL) { ++ next[0] = '\0'; ++ udev_device_add_devlink(udev_device, slink, 0); ++ slink = &next[1]; ++ next = strchr(slink, ' '); ++ } ++ if (slink[0] != '\0') ++ udev_device_add_devlink(udev_device, slink, 0); ++ } else if (strncmp(property, "DRIVER=", 7) == 0) { ++ udev_device_set_driver(udev_device, &property[7]); ++ } else if (strncmp(property, "ACTION=", 7) == 0) { ++ udev_device_set_action(udev_device, &property[7]); ++ } else if (strncmp(property, "MAJOR=", 6) == 0) { ++ udev_device->maj = strtoull(&property[6], NULL, 10); ++ } else if (strncmp(property, "MINOR=", 6) == 0) { ++ udev_device->min = strtoull(&property[6], NULL, 10); ++ } else if (strncmp(property, "DEVPATH_OLD=", 12) == 0) { ++ udev_device_set_devpath_old(udev_device, &property[12]); ++ } else if (strncmp(property, "SEQNUM=", 7) == 0) { ++ udev_device_set_seqnum(udev_device, strtoull(&property[7], NULL, 10)); ++ } else if (strncmp(property, "TIMEOUT=", 8) == 0) { ++ udev_device_set_timeout(udev_device, strtoull(&property[8], NULL, 10)); ++ } else { ++ udev_device_add_property_from_string(udev_device, property); ++ } ++} ++ ++int udev_device_add_property_from_string_parse_finish(struct udev_device *udev_device) ++{ ++ if (udev_device->maj > 0) ++ udev_device_set_devnum(udev_device, makedev(udev_device->maj, udev_device->min)); ++ udev_device->maj = 0; ++ udev_device->min = 0; ++ ++ if (udev_device->devpath == NULL || udev_device->subsystem == NULL) ++ return -EINVAL; ++ return 0; ++} ++ ++/** ++ * udev_device_get_property_value: ++ * @udev_device: udev device ++ * @key: property name ++ * ++ * Returns: the value of a device property, or #NULL if there is no such property. ++ **/ ++const char *udev_device_get_property_value(struct udev_device *udev_device, const char *key) ++{ ++ struct udev_list_entry *list_entry; ++ ++ if (udev_device == NULL) ++ return NULL; ++ if (key == NULL) ++ return NULL; ++ ++ list_entry = udev_device_get_properties_list_entry(udev_device); ++ list_entry = udev_list_entry_get_by_name(list_entry, key); ++ return udev_list_entry_get_value(list_entry); ++} ++ + int udev_device_read_db(struct udev_device *udev_device) + { + struct stat stats; +@@ -451,6 +577,42 @@ found: + return udev_device_new_from_syspath(udev, path_full); + } + ++/** ++ * udev_device_new_from_environment ++ * @udev: udev library context ++ * ++ * Create new udev device, and fill in information from the ++ * current process environment. This only works reliable if ++ * the process is called from a udev rule. It is usually used ++ * for tools executed from IMPORT= rules. ++ * ++ * The initial refcount is 1, and needs to be decremented to ++ * release the resources of the udev device. ++ * ++ * Returns: a new udev device, or #NULL, if it does not exist ++ **/ ++struct udev_device *udev_device_new_from_environment(struct udev *udev) ++{ ++ int i; ++ struct udev_device *udev_device; ++ ++ udev_device = udev_device_new(udev); ++ if (udev_device == NULL) ++ return NULL; ++ udev_device_set_info_loaded(udev_device); ++ ++ for (i = 0; environ[i] != NULL; i++) ++ udev_device_add_property_from_string_parse(udev_device, environ[i]); ++ ++ if (udev_device_add_property_from_string_parse_finish(udev_device) < 0) { ++ info(udev, "missing values, invalid device\n"); ++ udev_device_unref(udev_device); ++ udev_device = NULL; ++ } ++ ++ return udev_device; ++} ++ + static struct udev_device *device_new_from_parent(struct udev_device *udev_device) + { + struct udev_device *udev_device_parent = NULL; +@@ -1072,58 +1234,6 @@ int udev_device_add_devlink(struct udev_device *udev_device, const char *devlink + return 0; + } + +-struct udev_list_entry *udev_device_add_property(struct udev_device *udev_device, const char *key, const char *value) +-{ +- udev_device->envp_uptodate = 0; +- if (value == NULL) { +- struct udev_list_entry *list_entry; +- +- list_entry = udev_device_get_properties_list_entry(udev_device); +- list_entry = udev_list_entry_get_by_name(list_entry, key); +- if (list_entry != NULL) +- udev_list_entry_delete(list_entry); +- return NULL; +- } +- return udev_list_entry_add(udev_device->udev, &udev_device->properties_list, key, value, 1, 0); +-} +- +-struct udev_list_entry *udev_device_add_property_from_string(struct udev_device *udev_device, const char *property) +-{ +- char name[UTIL_LINE_SIZE]; +- char *val; +- +- util_strscpy(name, sizeof(name), property); +- val = strchr(name, '='); +- if (val == NULL) +- return NULL; +- val[0] = '\0'; +- val = &val[1]; +- if (val[0] == '\0') +- val = NULL; +- return udev_device_add_property(udev_device, name, val); +-} +- +-/** +- * udev_device_get_property_value: +- * @udev_device: udev device +- * @key: property name +- * +- * Returns: the value of a device property, or #NULL if there is no such property. +- **/ +-const char *udev_device_get_property_value(struct udev_device *udev_device, const char *key) +-{ +- struct udev_list_entry *list_entry; +- +- if (udev_device == NULL) +- return NULL; +- if (key == NULL) +- return NULL; +- +- list_entry = udev_device_get_properties_list_entry(udev_device); +- list_entry = udev_list_entry_get_by_name(list_entry, key); +- return udev_list_entry_get_value(list_entry); +-} +- + #define ENVP_SIZE 128 + #define MONITOR_BUF_SIZE 4096 + static int update_envp_monitor_buf(struct udev_device *udev_device) +diff --git a/libudev/libudev-monitor.c b/libudev/libudev-monitor.c +index 96c153f..97e52c4 100644 +--- a/libudev/libudev-monitor.c ++++ b/libudev/libudev-monitor.c +@@ -497,11 +497,6 @@ struct udev_device *udev_monitor_receive_device(struct udev_monitor *udev_monito + ssize_t buflen; + ssize_t bufpos; + struct udev_monitor_netlink_header *nlh; +- int devpath_set = 0; +- int subsystem_set = 0; +- int action_set = 0; +- int maj = 0; +- int min = 0; + + retry: + if (udev_monitor == NULL) +@@ -589,6 +584,7 @@ retry: + udev_device = udev_device_new(udev_monitor->udev); + if (udev_device == NULL) + return NULL; ++ udev_device_set_info_loaded(udev_device); + + while (bufpos < buflen) { + char *key; +@@ -599,60 +595,11 @@ retry: + if (keylen == 0) + break; + bufpos += keylen + 1; +- +- if (strncmp(key, "DEVPATH=", 8) == 0) { +- char path[UTIL_PATH_SIZE]; +- +- util_strscpyl(path, sizeof(path), udev_get_sys_path(udev_monitor->udev), &key[8], NULL); +- udev_device_set_syspath(udev_device, path); +- devpath_set = 1; +- } else if (strncmp(key, "SUBSYSTEM=", 10) == 0) { +- udev_device_set_subsystem(udev_device, &key[10]); +- subsystem_set = 1; +- } else if (strncmp(key, "DEVTYPE=", 8) == 0) { +- udev_device_set_devtype(udev_device, &key[8]); +- } else if (strncmp(key, "DEVNAME=", 8) == 0) { +- if (key[8] == '/') +- udev_device_set_devnode(udev_device, &key[8]); +- else +- udev_device_set_knodename(udev_device, &key[8]); +- } else if (strncmp(key, "DEVLINKS=", 9) == 0) { +- char devlinks[UTIL_PATH_SIZE]; +- char *slink; +- char *next; +- +- util_strscpy(devlinks, sizeof(devlinks), &key[9]); +- slink = devlinks; +- next = strchr(slink, ' '); +- while (next != NULL) { +- next[0] = '\0'; +- udev_device_add_devlink(udev_device, slink, 0); +- slink = &next[1]; +- next = strchr(slink, ' '); +- } +- if (slink[0] != '\0') +- udev_device_add_devlink(udev_device, slink, 0); +- } else if (strncmp(key, "DRIVER=", 7) == 0) { +- udev_device_set_driver(udev_device, &key[7]); +- } else if (strncmp(key, "ACTION=", 7) == 0) { +- udev_device_set_action(udev_device, &key[7]); +- action_set = 1; +- } else if (strncmp(key, "MAJOR=", 6) == 0) { +- maj = strtoull(&key[6], NULL, 10); +- } else if (strncmp(key, "MINOR=", 6) == 0) { +- min = strtoull(&key[6], NULL, 10); +- } else if (strncmp(key, "DEVPATH_OLD=", 12) == 0) { +- udev_device_set_devpath_old(udev_device, &key[12]); +- } else if (strncmp(key, "SEQNUM=", 7) == 0) { +- udev_device_set_seqnum(udev_device, strtoull(&key[7], NULL, 10)); +- } else if (strncmp(key, "TIMEOUT=", 8) == 0) { +- udev_device_set_timeout(udev_device, strtoull(&key[8], NULL, 10)); +- } else { +- udev_device_add_property_from_string(udev_device, key); +- } ++ udev_device_add_property_from_string_parse(udev_device, key); + } +- if (!devpath_set || !subsystem_set || !action_set) { +- info(udev_monitor->udev, "missing values, skip\n"); ++ ++ if (udev_device_add_property_from_string_parse_finish(udev_device) < 0) { ++ info(udev_monitor->udev, "missing values, invalid device\n"); + udev_device_unref(udev_device); + return NULL; + } +@@ -673,9 +620,6 @@ retry: + return NULL; + } + +- if (maj > 0) +- udev_device_set_devnum(udev_device, makedev(maj, min)); +- udev_device_set_info_loaded(udev_device); + return udev_device; + } + +diff --git a/libudev/libudev-private.h b/libudev/libudev-private.h +index 5ee0c58..3f2861f 100644 +--- a/libudev/libudev-private.h ++++ b/libudev/libudev-private.h +@@ -71,7 +71,8 @@ int udev_device_set_devnode(struct udev_device *udev_device, const char *devnode + int udev_device_add_devlink(struct udev_device *udev_device, const char *devlink, int unique); + void udev_device_cleanup_devlinks_list(struct udev_device *udev_device); + struct udev_list_entry *udev_device_add_property(struct udev_device *udev_device, const char *key, const char *value); +-struct udev_list_entry *udev_device_add_property_from_string(struct udev_device *udev_device, const char *property); ++void udev_device_add_property_from_string_parse(struct udev_device *udev_device, const char *property); ++int udev_device_add_property_from_string_parse_finish(struct udev_device *udev_device); + char **udev_device_get_properties_envp(struct udev_device *udev_device); + ssize_t udev_device_get_properties_monitor_buf(struct udev_device *udev_device, const char **buf); + int udev_device_read_db(struct udev_device *udev_device); +diff --git a/libudev/libudev.h b/libudev/libudev.h +index 9576ad4..750664f 100644 +--- a/libudev/libudev.h ++++ b/libudev/libudev.h +@@ -75,6 +75,7 @@ struct udev *udev_device_get_udev(struct udev_device *udev_device); + struct udev_device *udev_device_new_from_syspath(struct udev *udev, const char *syspath); + struct udev_device *udev_device_new_from_devnum(struct udev *udev, char type, dev_t devnum); + struct udev_device *udev_device_new_from_subsystem_sysname(struct udev *udev, const char *subsystem, const char *sysname); ++struct udev_device *udev_device_new_from_environment(struct udev *udev); + /* udev_device_get_parent_*() does not take a reference on the returned device, it is automatically unref'd with the parent */ + struct udev_device *udev_device_get_parent(struct udev_device *udev_device); + struct udev_device *udev_device_get_parent_with_subsystem_devtype(struct udev_device *udev_device, +-- +1.6.6 + diff --git a/0034-add-LGPL-COPYING-to-libudev-and-GUdev.patch b/0034-add-LGPL-COPYING-to-libudev-and-GUdev.patch index 8440ea9..4b8ca14 100644 --- a/0034-add-LGPL-COPYING-to-libudev-and-GUdev.patch +++ b/0034-add-LGPL-COPYING-to-libudev-and-GUdev.patch @@ -1,7 +1,7 @@ From 23325a66ccf3a2f90a4f5d1702f60408187de28a Mon Sep 17 00:00:00 2001 From: Kay Sievers Date: Thu, 18 Mar 2010 09:57:44 +0100 -Subject: [PATCH 34/36] add LGPL COPYING to libudev and GUdev +Subject: [PATCH 34/65] add LGPL COPYING to libudev and GUdev --- extras/gudev/COPYING | 504 ++++++++++++++++++++++++++++++++++++++++++++++++++ diff --git a/0035-cdrom_id-open-non-mounted-optical-media-with-O_EXCL.patch b/0035-cdrom_id-open-non-mounted-optical-media-with-O_EXCL.patch index 870a344..0d34327 100644 --- a/0035-cdrom_id-open-non-mounted-optical-media-with-O_EXCL.patch +++ b/0035-cdrom_id-open-non-mounted-optical-media-with-O_EXCL.patch @@ -1,7 +1,7 @@ From 38a3cde11bc77af49a96245b8a8a0f2b583a344c Mon Sep 17 00:00:00 2001 From: Kay Sievers Date: Thu, 18 Mar 2010 11:14:32 +0100 -Subject: [PATCH 35/36] cdrom_id: open non-mounted optical media with O_EXCL +Subject: [PATCH 35/65] cdrom_id: open non-mounted optical media with O_EXCL This should prevent confusing drives during CD burning sessions. Based on a patch from Harald Hoyer. diff --git a/0036-modeswitch-morph-into-tool-that-only-switches-Mobile.patch b/0036-modeswitch-morph-into-tool-that-only-switches-Mobile.patch index 45f1397..d3cf673 100644 --- a/0036-modeswitch-morph-into-tool-that-only-switches-Mobile.patch +++ b/0036-modeswitch-morph-into-tool-that-only-switches-Mobile.patch @@ -1,7 +1,7 @@ From 4dd9b291354e76f34b0d6d7b5c3b28d03a624418 Mon Sep 17 00:00:00 2001 From: Dan Williams Date: Thu, 18 Mar 2010 17:13:59 -0700 -Subject: [PATCH 36/36] modeswitch: morph into tool that only switches Mobile Action cables +Subject: [PATCH 36/65] modeswitch: morph into tool that only switches Mobile Action cables Remove option modeswitching code; use usb_modeswitch already, people. --- diff --git a/0037-rules-virtio-fix-is-to-check-if-the-name-attribute-i.patch b/0037-rules-virtio-fix-is-to-check-if-the-name-attribute-i.patch new file mode 100644 index 0000000..bc8aa52 --- /dev/null +++ b/0037-rules-virtio-fix-is-to-check-if-the-name-attribute-i.patch @@ -0,0 +1,28 @@ +From 00e43e357ea709d8c1def0aed13192abbf9ac193 Mon Sep 17 00:00:00 2001 +From: Amit Shah +Date: Mon, 22 Mar 2010 10:59:46 +0100 +Subject: [PATCH 37/65] rules: virtio - fix is to check if the 'name' attribute is present + +Fix provided by Harald Hoyer. + +Signed-off-by: Amit Shah +--- + rules/rules.d/50-udev-default.rules | 2 +- + 1 files changed, 1 insertions(+), 1 deletions(-) + +diff --git a/rules/rules.d/50-udev-default.rules b/rules/rules.d/50-udev-default.rules +index da1535f..e8116a3 100644 +--- a/rules/rules.d/50-udev-default.rules ++++ b/rules/rules.d/50-udev-default.rules +@@ -18,7 +18,7 @@ KERNEL=="mwave", GROUP="dialout" + KERNEL=="hvc*|hvsi*", GROUP="dialout" + + # virtio serial / console ports +-KERNEL=="vport*", SYMLINK+="virtio-ports/$attr{name}" ++KERNEL=="vport*", ATTR{name}=="?*", SYMLINK+="virtio-ports/$attr{name}" + + # mem + KERNEL=="null|zero|full|random|urandom", MODE="0666" +-- +1.6.6 + diff --git a/0038-keymap-Add-Acer-TravelMate-6593G-and-Acer-Aspire-164.patch b/0038-keymap-Add-Acer-TravelMate-6593G-and-Acer-Aspire-164.patch new file mode 100644 index 0000000..56aaa23 --- /dev/null +++ b/0038-keymap-Add-Acer-TravelMate-6593G-and-Acer-Aspire-164.patch @@ -0,0 +1,25 @@ +From 5b6172b1d9b5d582d05ea89985efd0ea7a0c8ad7 Mon Sep 17 00:00:00 2001 +From: Martin Pitt +Date: Wed, 24 Mar 2010 17:44:39 +0100 +Subject: [PATCH 38/65] keymap: Add Acer TravelMate 6593G and Acer Aspire 1640 + +https://launchpad.net/bugs/536914 +--- + extras/keymap/95-keymap.rules | 1 + + 1 files changed, 1 insertions(+), 0 deletions(-) + +diff --git a/extras/keymap/95-keymap.rules b/extras/keymap/95-keymap.rules +index 65b0d6e..b3b08ae 100644 +--- a/extras/keymap/95-keymap.rules ++++ b/extras/keymap/95-keymap.rules +@@ -78,6 +78,7 @@ ENV{DMI_VENDOR}=="Acer*", RUN+="keymap $name acer" + ENV{DMI_VENDOR}=="Acer*", ATTR{[dmi/id]product_name}=="Extensa*", ATTR{[dmi/id]product_name}=="*5210*|*5220*|*5610*|*5620*|*5720*", RUN+="keymap $name 0xEE screenlock" + ENV{DMI_VENDOR}=="Acer*", ATTR{[dmi/id]product_name}=="TravelMate*C300*", RUN+="keymap $name acer-travelmate_c300" + ENV{DMI_VENDOR}=="Acer*", ATTR{[dmi/id]product_name}=="TravelMate*6292*|TravelMate*8471*|Aspire 1810T*|AO751h|AO531h", RUN+="keymap $name 0xD9 bluetooth" ++ENV{DMI_VENDOR}=="Acer*", ATTR{[dmi/id]product_name}=="TravelMate 6593|Aspire 1640", RUN+="keymap $name 0xB2 www" + ENV{DMI_VENDOR}=="Acer*", ATTR{[dmi/id]product_name}=="Aspire 6920", RUN+="keymap $name acer-aspire_6920" + ENV{DMI_VENDOR}=="Acer*", ATTR{[dmi/id]product_name}=="Aspire 5920G", RUN+="keymap $name acer-aspire_5920g" + ENV{DMI_VENDOR}=="Acer*", ATTR{[dmi/id]product_name}=="Aspire 5720*", RUN+="keymap $name acer-aspire_5720" +-- +1.6.6 + diff --git a/0039-keymap-Fix-another-key-for-Acer-TravelMate-6593.patch b/0039-keymap-Fix-another-key-for-Acer-TravelMate-6593.patch new file mode 100644 index 0000000..41641dd --- /dev/null +++ b/0039-keymap-Fix-another-key-for-Acer-TravelMate-6593.patch @@ -0,0 +1,26 @@ +From 43d08246dbb3a01e88062d5315194ee889e52dd4 Mon Sep 17 00:00:00 2001 +From: Martin Pitt +Date: Wed, 24 Mar 2010 18:56:20 +0100 +Subject: [PATCH 39/65] keymap: Fix another key for Acer TravelMate 6593 + +https://launchpad.net/bugs/536914 +--- + extras/keymap/95-keymap.rules | 2 +- + 1 files changed, 1 insertions(+), 1 deletions(-) + +diff --git a/extras/keymap/95-keymap.rules b/extras/keymap/95-keymap.rules +index b3b08ae..dd58453 100644 +--- a/extras/keymap/95-keymap.rules ++++ b/extras/keymap/95-keymap.rules +@@ -78,7 +78,7 @@ ENV{DMI_VENDOR}=="Acer*", RUN+="keymap $name acer" + ENV{DMI_VENDOR}=="Acer*", ATTR{[dmi/id]product_name}=="Extensa*", ATTR{[dmi/id]product_name}=="*5210*|*5220*|*5610*|*5620*|*5720*", RUN+="keymap $name 0xEE screenlock" + ENV{DMI_VENDOR}=="Acer*", ATTR{[dmi/id]product_name}=="TravelMate*C300*", RUN+="keymap $name acer-travelmate_c300" + ENV{DMI_VENDOR}=="Acer*", ATTR{[dmi/id]product_name}=="TravelMate*6292*|TravelMate*8471*|Aspire 1810T*|AO751h|AO531h", RUN+="keymap $name 0xD9 bluetooth" +-ENV{DMI_VENDOR}=="Acer*", ATTR{[dmi/id]product_name}=="TravelMate 6593|Aspire 1640", RUN+="keymap $name 0xB2 www" ++ENV{DMI_VENDOR}=="Acer*", ATTR{[dmi/id]product_name}=="TravelMate 6593|Aspire 1640", RUN+="keymap $name 0xB2 www 0xEE screenlock" + ENV{DMI_VENDOR}=="Acer*", ATTR{[dmi/id]product_name}=="Aspire 6920", RUN+="keymap $name acer-aspire_6920" + ENV{DMI_VENDOR}=="Acer*", ATTR{[dmi/id]product_name}=="Aspire 5920G", RUN+="keymap $name acer-aspire_5920g" + ENV{DMI_VENDOR}=="Acer*", ATTR{[dmi/id]product_name}=="Aspire 5720*", RUN+="keymap $name acer-aspire_5720" +-- +1.6.6 + diff --git a/0040-libudev-update-documentation.patch b/0040-libudev-update-documentation.patch new file mode 100644 index 0000000..3b404c8 --- /dev/null +++ b/0040-libudev-update-documentation.patch @@ -0,0 +1,108 @@ +From dbba7e4029e2eb8157232e6b5ddd9ee0f68b51b5 Mon Sep 17 00:00:00 2001 +From: Kay Sievers +Date: Thu, 25 Mar 2010 16:45:15 +0100 +Subject: [PATCH 40/65] libudev: update documentation + +--- + libudev/docs/libudev-docs.xml | 2 +- + libudev/libudev-device.c | 14 ++++++-------- + libudev/libudev.c | 14 +++++++------- + 3 files changed, 14 insertions(+), 16 deletions(-) + +diff --git a/libudev/docs/libudev-docs.xml b/libudev/docs/libudev-docs.xml +index b037281..f470916 100644 +--- a/libudev/docs/libudev-docs.xml ++++ b/libudev/docs/libudev-docs.xml +@@ -9,7 +9,7 @@ + libudev Reference Manual + for libudev version &version; + +- 2009 ++ 2009-2010 + Kay Sievers <kay.sievers@vrfy.org> + + +diff --git a/libudev/libudev-device.c b/libudev/libudev-device.c +index fe45880..410f75b 100644 +--- a/libudev/libudev-device.c ++++ b/libudev/libudev-device.c +@@ -463,10 +463,9 @@ struct udev_device *udev_device_new_from_syspath(struct udev *udev, const char * + * @devnum: device major/minor number + * + * Create new udev device, and fill in information from the sys +- * device and the udev database entry. The device is looked up +- * by its major/minor number. Character and block device numbers +- * are not unique across the two types, they do not share the same +- * range of numbers. ++ * device and the udev database entry. The device is looked-up ++ * by its major/minor number and type. Character and block device ++ * numbers are not unique across the two types. + * + * The initial refcount is 1, and needs to be decremented to + * release the resources of the udev device. +@@ -497,10 +496,9 @@ struct udev_device *udev_device_new_from_devnum(struct udev *udev, char type, de + * @subsystem: the subsystem of the device + * @sysname: the name of the device + * +- * Create new udev device, and fill in information from the sys +- * device and the udev database entry. The device is looked up +- * by the subsystem and name string of the device, like "mem", +- * "zero", or "block", "sda". ++ * Create new udev device, and fill in information from the sys device ++ * and the udev database entry. The device is looked up by the subsystem ++ * and name string of the device, like "mem" / "zero", or "block" / "sda". + * + * The initial refcount is 1, and needs to be decremented to + * release the resources of the udev device. +diff --git a/libudev/libudev.c b/libudev/libudev.c +index 411e9ae..0ae5a91 100644 +--- a/libudev/libudev.c ++++ b/libudev/libudev.c +@@ -1,7 +1,7 @@ + /* + * libudev - interface to udev device information + * +- * Copyright (C) 2008-2009 Kay Sievers ++ * Copyright (C) 2008-2010 Kay Sievers + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public +@@ -71,7 +71,7 @@ static void log_stderr(struct udev *udev, + * @udev: udev library context + * + * Retrieve stored data pointer from library context. This might be useful +- * to access from callbacks. ++ * to access from callbacks like a custom logging function. + * + * Returns: stored userdata + **/ +@@ -321,10 +321,10 @@ void udev_set_log_fn(struct udev *udev, + * udev_get_log_priority: + * @udev: udev library context + * +- * The initial syslog priority is read from the udev config file ++ * The initial logging priority is read from the udev config file + * at startup. + * +- * Returns: the current syslog priority ++ * Returns: the current logging priority + **/ + int udev_get_log_priority(struct udev *udev) + { +@@ -334,10 +334,10 @@ int udev_get_log_priority(struct udev *udev) + /** + * udev_set_log_priority: + * @udev: udev library context +- * @priority: the new syslog priority ++ * @priority: the new logging priority + * +- * Set the current syslog priority. The value controls which messages +- * are send to syslog. ++ * Set the current logging priority. The value controls which messages ++ * are logged. + **/ + void udev_set_log_priority(struct udev *udev, int priority) + { +-- +1.6.6 + diff --git a/0041-Fix-Keymapping-for-upcoming-Dell-Laptops.patch b/0041-Fix-Keymapping-for-upcoming-Dell-Laptops.patch new file mode 100644 index 0000000..c7a2394 --- /dev/null +++ b/0041-Fix-Keymapping-for-upcoming-Dell-Laptops.patch @@ -0,0 +1,50 @@ +From 233a922112408c7ed49bd72e73be228e231d46ba Mon Sep 17 00:00:00 2001 +From: Jerone Young +Date: Wed, 24 Mar 2010 20:14:23 -0500 +Subject: [PATCH 41/65] Fix Keymapping for upcoming Dell Laptops + +This patch fixes it so that new upcoming Dell machines will work +correctly if users presses the touchpad toggle key. + +Currently 0xD8 is being mapped to sleep. Though this is only done by the +Latitude XT* laptops. Many upcoming Laptops from Dell are mapping this +key to "toogle touchpad off" .. giving the OS notification that it has +just turned off the touchpad. + +Though their is an issue in that if this key is mapped the hardware +first toogles .. then the software tries to do the samething after, if +they fall out of sync ... no more touchpad. So leave out mapping these +keys for now. + +Signed-off-by: Jerone Young +Signed-off-by: Martin Pitt +--- + extras/keymap/95-keymap.rules | 1 + + extras/keymap/keymaps/dell | 1 - + 2 files changed, 1 insertions(+), 1 deletions(-) + +diff --git a/extras/keymap/95-keymap.rules b/extras/keymap/95-keymap.rules +index dd58453..af39c21 100644 +--- a/extras/keymap/95-keymap.rules ++++ b/extras/keymap/95-keymap.rules +@@ -54,6 +54,7 @@ LABEL="keyboard_vendorcheck" + + ENV{DMI_VENDOR}=="Dell*", RUN+="keymap $name dell" + ENV{DMI_VENDOR}=="Dell*", ATTR{[dmi/id]product_name}=="Inspiron 1011", RUN+="keymap $name 0x84 wlan" ++ENV{DMI_VENDOR}=="Dell*", ATTR{[dmi/id]product_name}=="Latitude XT*", RUN+="keymap $name 0xD8 screenlock" + + ENV{DMI_VENDOR}=="Compaq*", ATTR{[dmi/id]product_name}=="*E500*|*Evo N*", RUN+="keymap $name compaq-e_evo" + +diff --git a/extras/keymap/keymaps/dell b/extras/keymap/keymaps/dell +index 5ff44d6..84e5b4e 100644 +--- a/extras/keymap/keymaps/dell ++++ b/extras/keymap/keymaps/dell +@@ -23,5 +23,4 @@ + 0x9B switchvideomode # Display Toggle button + 0xA2 playpause # Front panel play/pause + 0xA4 stopcd # Front panel stop +-0xD8 screenlock # FIXME: Tablet lock button + 0xED media # MediaDirect button +-- +1.6.6 + diff --git a/0042-Add-new-Dell-touchpad-keycode.patch b/0042-Add-new-Dell-touchpad-keycode.patch new file mode 100644 index 0000000..c63b194 --- /dev/null +++ b/0042-Add-new-Dell-touchpad-keycode.patch @@ -0,0 +1,32 @@ +From e22aa83ba0b09796d02ebe831a4a66ab7d9f5c1e Mon Sep 17 00:00:00 2001 +From: Jerone Young +Date: Mon, 5 Apr 2010 18:45:34 -0500 +Subject: [PATCH 42/65] Add new Dell touchpad keycode + +After working very closely with Dell. They have now completely changed +the way they have implemented there touchpad hotkey for upcoming +machines. + +It now only generates a single keycode (0xD9). It nolonger does anything +in hardware, nor does it generate more then this keycode. + +This patch properly maps this keycode. + +Signed-off-by: Jerone Young +Signed-off-by: Martin Pitt +--- + extras/keymap/keymaps/dell | 1 + + 1 files changed, 1 insertions(+), 0 deletions(-) + +diff --git a/extras/keymap/keymaps/dell b/extras/keymap/keymaps/dell +index 84e5b4e..f90a4fd 100644 +--- a/extras/keymap/keymaps/dell ++++ b/extras/keymap/keymaps/dell +@@ -24,3 +24,4 @@ + 0xA2 playpause # Front panel play/pause + 0xA4 stopcd # Front panel stop + 0xED media # MediaDirect button ++0xD9 f22 # touchpad toggle +-- +1.6.6 + diff --git a/0043-Revert-special-casing-0xD8-to-latitude-XT-only.patch b/0043-Revert-special-casing-0xD8-to-latitude-XT-only.patch new file mode 100644 index 0000000..e2b6474 --- /dev/null +++ b/0043-Revert-special-casing-0xD8-to-latitude-XT-only.patch @@ -0,0 +1,42 @@ +From 5fa8992c9c2e756aefe84a41f00c7a2555e8d975 Mon Sep 17 00:00:00 2001 +From: Jerone Young +Date: Mon, 5 Apr 2010 18:45:35 -0500 +Subject: [PATCH 43/65] Revert special casing 0xD8 to latitude XT only + +Now that Dell has changed the functionality of upcoming machines with +touchpad toggle to only use keycode 0xD9 .. and not 0xD8 & 0xD9. It +seems best to add this back to the general map of Dell buttons. Just +incase a machine in the future uses this later. + +Signed-off-by: Jerone Young +Signed-off-by: Martin Pitt +--- + extras/keymap/95-keymap.rules | 1 - + extras/keymap/keymaps/dell | 1 + + 2 files changed, 1 insertions(+), 1 deletions(-) + +diff --git a/extras/keymap/95-keymap.rules b/extras/keymap/95-keymap.rules +index af39c21..dd58453 100644 +--- a/extras/keymap/95-keymap.rules ++++ b/extras/keymap/95-keymap.rules +@@ -54,7 +54,6 @@ LABEL="keyboard_vendorcheck" + + ENV{DMI_VENDOR}=="Dell*", RUN+="keymap $name dell" + ENV{DMI_VENDOR}=="Dell*", ATTR{[dmi/id]product_name}=="Inspiron 1011", RUN+="keymap $name 0x84 wlan" +-ENV{DMI_VENDOR}=="Dell*", ATTR{[dmi/id]product_name}=="Latitude XT*", RUN+="keymap $name 0xD8 screenlock" + + ENV{DMI_VENDOR}=="Compaq*", ATTR{[dmi/id]product_name}=="*E500*|*Evo N*", RUN+="keymap $name compaq-e_evo" + +diff --git a/extras/keymap/keymaps/dell b/extras/keymap/keymaps/dell +index f90a4fd..6443b4b 100644 +--- a/extras/keymap/keymaps/dell ++++ b/extras/keymap/keymaps/dell +@@ -24,4 +24,5 @@ + 0xA2 playpause # Front panel play/pause + 0xA4 stopcd # Front panel stop + 0xED media # MediaDirect button ++0xD8 screenlock # FIXME: Tablet lock button + 0xD9 f22 # touchpad toggle +-- +1.6.6 + diff --git a/0044-Fix-Dell-Studio-1558-volume-keys-not-releasing.patch b/0044-Fix-Dell-Studio-1558-volume-keys-not-releasing.patch new file mode 100644 index 0000000..3d7c051 --- /dev/null +++ b/0044-Fix-Dell-Studio-1558-volume-keys-not-releasing.patch @@ -0,0 +1,30 @@ +From f8ede05d7ad5286039319bcb188e86b9117551e2 Mon Sep 17 00:00:00 2001 +From: Jerone Young +Date: Tue, 6 Apr 2010 12:59:12 -0500 +Subject: [PATCH 44/65] Fix Dell Studio 1558 volume keys not releasing + +This patch fixes the Dell Studio 1558 to give a key release when a +volume key is pressed. This is the same as the 1557. + +Signed-off-by: Jerone Young +Signed-off-by: Martin Pitt +--- + extras/keymap/95-keyboard-force-release.rules | 2 +- + 1 files changed, 1 insertions(+), 1 deletions(-) + +diff --git a/extras/keymap/95-keyboard-force-release.rules b/extras/keymap/95-keyboard-force-release.rules +index 28639a5..f0e1ab8 100644 +--- a/extras/keymap/95-keyboard-force-release.rules ++++ b/extras/keymap/95-keyboard-force-release.rules +@@ -21,7 +21,7 @@ ENV{DMI_VENDOR}="$attr{[dmi/id]sys_vendor}" + + ENV{DMI_VENDOR}=="[sS][aA][mM][sS][uU][nN][gG]*", ATTR{[dmi/id]product_name}=="*N130*|*N140*|*SR70S/SR71S*|*Q210/P210*", RUN+="keyboard-force-release.sh $devpath samsung-other" + +-ENV{DMI_VENDOR}=="Dell Inc.", ATTR{[dmi/id]product_name}=="Studio 1557", RUN+="keyboard-force-release.sh $devpath dell-studio-1557" ++ENV{DMI_VENDOR}=="Dell Inc.", ATTR{[dmi/id]product_name}=="Studio 1557|Studio 1558", RUN+="keyboard-force-release.sh $devpath dell-studio-1557" + + ENV{DMI_VENDOR}=="FUJITSU SIEMENS", ATTR{[dmi/id]product_name}=="AMILO Si 1848+u", RUN+="keyboard-force-release.sh $devpath fujitsu-amilo-si1848" + +-- +1.6.6 + diff --git a/0045-Add-support-for-another-Dell-touchpad-toggle-key.patch b/0045-Add-support-for-another-Dell-touchpad-toggle-key.patch new file mode 100644 index 0000000..fae1ca8 --- /dev/null +++ b/0045-Add-support-for-another-Dell-touchpad-toggle-key.patch @@ -0,0 +1,29 @@ +From 6de84dee053a74c95f2200d6d94cfeb61516bc40 Mon Sep 17 00:00:00 2001 +From: Jerone Young +Date: Tue, 6 Apr 2010 16:08:21 -0500 +Subject: [PATCH 45/65] Add support for another Dell touchpad toggle key + +There is another keycode that some Dell machines that are about to ship, +or shipping are using for touchpad toggle. That code is 0x9E. + +Signed-off-by: Jerone Young +Signed-off-by: Martin Pitt +--- + extras/keymap/keymaps/dell | 1 + + 1 files changed, 1 insertions(+), 0 deletions(-) + +diff --git a/extras/keymap/keymaps/dell b/extras/keymap/keymaps/dell +index 6443b4b..1a2e433 100644 +--- a/extras/keymap/keymaps/dell ++++ b/extras/keymap/keymaps/dell +@@ -21,6 +21,7 @@ + 0x99 nextsong # Front panel next song + 0x9A setup # Tablet tools button + 0x9B switchvideomode # Display Toggle button ++0x9E f22 #touchpad toggle + 0xA2 playpause # Front panel play/pause + 0xA4 stopcd # Front panel stop + 0xED media # MediaDirect button +-- +1.6.6 + diff --git a/0047-scsi_id-add-rand-in-retry-loop.patch b/0047-scsi_id-add-rand-in-retry-loop.patch new file mode 100644 index 0000000..c58beb4 --- /dev/null +++ b/0047-scsi_id-add-rand-in-retry-loop.patch @@ -0,0 +1,45 @@ +From 1c8dc990dc20efbd6cd8e56a57c0fa567c2d6fc8 Mon Sep 17 00:00:00 2001 +From: Kay Sievers +Date: Wed, 7 Apr 2010 09:22:30 +0200 +Subject: [PATCH 47/65] scsi_id: add rand() in retry loop + +--- + extras/scsi_id/scsi_serial.c | 14 +++++++------- + 1 files changed, 7 insertions(+), 7 deletions(-) + +diff --git a/extras/scsi_id/scsi_serial.c b/extras/scsi_id/scsi_serial.c +index 0c9d9c3..8752e14 100644 +--- a/extras/scsi_id/scsi_serial.c ++++ b/extras/scsi_id/scsi_serial.c +@@ -863,21 +863,21 @@ int scsi_get_serial(struct udev *udev, + { + unsigned char page0[SCSI_INQ_BUFF_LEN]; + int fd = -1; +- int cnt = 10; ++ int cnt; + int ind; + int retval; + + memset(dev_scsi->serial, 0, len); + dbg(udev, "opening %s\n", devname); +- while (--cnt) { +- const struct timespec duration = { 0, 500 * 1000 * 1000 }; ++ srand((unsigned int)getpid()); ++ for (cnt = 20; cnt > 0; cnt--) { ++ struct timespec duration; + + fd = open(devname, O_RDONLY | O_NONBLOCK); +- if (fd >= 0) +- break; +- info(udev, "%s: cannot open %s: %s\n", dev_scsi->kernel, devname, strerror(errno)); +- if (errno != EBUSY) ++ if (fd >= 0 || errno != EBUSY) + break; ++ duration.tv_sec = 0; ++ duration.tv_nsec = (200 * 1000 * 1000) + (rand() % 100 * 1000 * 1000); + nanosleep(&duration, NULL); + } + if (fd < 0) +-- +1.6.6 + diff --git a/0048-cdrom_id-remove-debugging-code.patch b/0048-cdrom_id-remove-debugging-code.patch new file mode 100644 index 0000000..57a4e07 --- /dev/null +++ b/0048-cdrom_id-remove-debugging-code.patch @@ -0,0 +1,24 @@ +From 36a07a8c34a4cff5ad2bbb6e0fdfed49e8191661 Mon Sep 17 00:00:00 2001 +From: Harald Hoyer +Date: Wed, 7 Apr 2010 09:23:46 +0200 +Subject: [PATCH 48/65] cdrom_id: remove debugging code + +--- + extras/cdrom_id/cdrom_id.c | 1 - + 1 files changed, 0 insertions(+), 1 deletions(-) + +diff --git a/extras/cdrom_id/cdrom_id.c b/extras/cdrom_id/cdrom_id.c +index e485768..036ef28 100644 +--- a/extras/cdrom_id/cdrom_id.c ++++ b/extras/cdrom_id/cdrom_id.c +@@ -126,7 +126,6 @@ static int is_mounted(const char *device) + if (fp == NULL) + return -ENOSYS; + while (fscanf(fp, "%*s %*s %i:%i %*[^\n]", &maj, &min) == 2) { +- printf("got %u %u\n", maj, min); + if (makedev(maj, min) == statbuf.st_rdev) { + mounted = 1; + break; +-- +1.6.6 + diff --git a/0049-cdrom_id-retry-to-open-the-device-if-EBUSY.patch b/0049-cdrom_id-retry-to-open-the-device-if-EBUSY.patch new file mode 100644 index 0000000..f7e6b27 --- /dev/null +++ b/0049-cdrom_id-retry-to-open-the-device-if-EBUSY.patch @@ -0,0 +1,53 @@ +From cccfffbe04c01be12fb42cb12f3f7aa5e2a22dd4 Mon Sep 17 00:00:00 2001 +From: Kay Sievers +Date: Wed, 7 Apr 2010 09:24:25 +0200 +Subject: [PATCH 49/65] cdrom_id: retry to open the device, if EBUSY + +We might fight about the device with polling processes, or other +users who probe the device. Retry a few times if the other one goes +away in the meantime. + +Based on a patch from Harald Hoyer. +--- + extras/cdrom_id/cdrom_id.c | 18 +++++++++++++++++- + 1 files changed, 17 insertions(+), 1 deletions(-) + +diff --git a/extras/cdrom_id/cdrom_id.c b/extras/cdrom_id/cdrom_id.c +index 036ef28..7c9f8cc 100644 +--- a/extras/cdrom_id/cdrom_id.c ++++ b/extras/cdrom_id/cdrom_id.c +@@ -30,6 +30,7 @@ + #include + #include + #include ++#include + #include + #include + #include +@@ -591,7 +592,22 @@ int main(int argc, char *argv[]) + goto exit; + } + +- fd = open(node, O_RDONLY|O_NONBLOCK|(is_mounted(node) ? 0 : O_EXCL)); ++ if (is_mounted(node)) { ++ fd = open(node, O_RDONLY|O_NONBLOCK); ++ } else { ++ int cnt; ++ struct timespec duration; ++ ++ srand((unsigned int)getpid()); ++ for (cnt = 40; cnt > 0; cnt--) { ++ fd = open(node, O_RDONLY|O_NONBLOCK|O_EXCL); ++ if (fd >= 0 || errno != EBUSY) ++ break; ++ duration.tv_sec = 0; ++ duration.tv_nsec = (100 * 1000 * 1000) + (rand() % 100 * 1000 * 1000); ++ nanosleep(&duration, NULL); ++ } ++ } + if (fd < 0) { + info(udev, "unable to open '%s'\n", node); + fprintf(stderr, "unable to open '%s'\n", node); +-- +1.6.6 + diff --git a/0050-cdrom_id-check-mount-state-in-retry-loop.patch b/0050-cdrom_id-check-mount-state-in-retry-loop.patch new file mode 100644 index 0000000..b4fb62b --- /dev/null +++ b/0050-cdrom_id-check-mount-state-in-retry-loop.patch @@ -0,0 +1,55 @@ +From d45c8c8b01c99180f15e24b22f7cf81eaf3cdd1b Mon Sep 17 00:00:00 2001 +From: Kay Sievers +Date: Wed, 7 Apr 2010 11:32:22 +0200 +Subject: [PATCH 50/65] cdrom_id: check mount state in retry loop + +Based on a patch from Harald Hoyer. +--- + extras/cdrom_id/cdrom_id.c | 22 +++++++++------------- + 1 files changed, 9 insertions(+), 13 deletions(-) + +diff --git a/extras/cdrom_id/cdrom_id.c b/extras/cdrom_id/cdrom_id.c +index 7c9f8cc..894a890 100644 +--- a/extras/cdrom_id/cdrom_id.c ++++ b/extras/cdrom_id/cdrom_id.c +@@ -547,6 +547,7 @@ int main(int argc, char *argv[]) + const char *node = NULL; + int export = 0; + int fd = -1; ++ int cnt; + int rc = 0; + + udev = udev_new(); +@@ -592,21 +593,16 @@ int main(int argc, char *argv[]) + goto exit; + } + +- if (is_mounted(node)) { +- fd = open(node, O_RDONLY|O_NONBLOCK); +- } else { +- int cnt; ++ srand((unsigned int)getpid()); ++ for (cnt = 20; cnt > 0; cnt--) { + struct timespec duration; + +- srand((unsigned int)getpid()); +- for (cnt = 40; cnt > 0; cnt--) { +- fd = open(node, O_RDONLY|O_NONBLOCK|O_EXCL); +- if (fd >= 0 || errno != EBUSY) +- break; +- duration.tv_sec = 0; +- duration.tv_nsec = (100 * 1000 * 1000) + (rand() % 100 * 1000 * 1000); +- nanosleep(&duration, NULL); +- } ++ fd = open(node, O_RDONLY|O_NONBLOCK|(is_mounted(node) ? 0 : O_EXCL)); ++ if (fd >= 0 || errno != EBUSY) ++ break; ++ duration.tv_sec = 0; ++ duration.tv_nsec = (100 * 1000 * 1000) + (rand() % 100 * 1000 * 1000); ++ nanosleep(&duration, NULL); + } + if (fd < 0) { + info(udev, "unable to open '%s'\n", node); +-- +1.6.6 + diff --git a/0051-cdrom_id-always-set-ID_CDROM-regardless-if-we-can-ru.patch b/0051-cdrom_id-always-set-ID_CDROM-regardless-if-we-can-ru.patch new file mode 100644 index 0000000..1d3be0e --- /dev/null +++ b/0051-cdrom_id-always-set-ID_CDROM-regardless-if-we-can-ru.patch @@ -0,0 +1,31 @@ +From 5c5ebde711c4560ae0560e87c33fe477b5add354 Mon Sep 17 00:00:00 2001 +From: Kay Sievers +Date: Mon, 12 Apr 2010 01:12:23 +0200 +Subject: [PATCH 51/65] cdrom_id: always set ID_CDROM regardless if we can run cdrom_id + +--- + extras/cdrom_id/60-cdrom_id.rules | 12 +++++++++--- + 1 files changed, 9 insertions(+), 3 deletions(-) + +diff --git a/extras/cdrom_id/60-cdrom_id.rules b/extras/cdrom_id/60-cdrom_id.rules +index 132a680..811c4aa 100644 +--- a/extras/cdrom_id/60-cdrom_id.rules ++++ b/extras/cdrom_id/60-cdrom_id.rules +@@ -1,5 +1,11 @@ + # do not edit this file, it will be overwritten on update + +-# import optical drive properties +-ACTION=="add|change", SUBSYSTEM=="block", ENV{DEVTYPE}=="disk", \ +- KERNEL=="sr[0-9]*|xvd*", IMPORT{program}="cdrom_id --export $tempnode" ++ACTION!="add|change", GOTO="cdrom_end" ++SUBSYSTEM!="block", GOTO="cdrom_end" ++KERNEL!="sr[0-9]*|xvd*", GOTO="cdrom_end" ++ENV{DEVTYPE}!="disk", GOTO="cdrom_end" ++ ++ENV{ID_CDROM}="1" ++IMPORT{program}="cdrom_id --export $tempnode" ++ ++LABEL="cdrom_end" +-- +1.6.6 + diff --git a/0052-rules-delete-outdated-packagees-rules.patch b/0052-rules-delete-outdated-packagees-rules.patch new file mode 100644 index 0000000..eb65f78 --- /dev/null +++ b/0052-rules-delete-outdated-packagees-rules.patch @@ -0,0 +1,124 @@ +From a971fb4d58aee946e151b315453fdd1b18331402 Mon Sep 17 00:00:00 2001 +From: Kay Sievers +Date: Mon, 12 Apr 2010 10:45:27 +0200 +Subject: [PATCH 52/65] rules: delete outdated packagees rules + +--- + rules/packages/40-infiniband.rules | 9 -------- + rules/packages/40-isdn.rules | 4 --- + rules/packages/40-zaptel.rules | 7 ------ + rules/packages/64-device-mapper.rules | 4 --- + rules/packages/64-md-raid.rules | 36 --------------------------------- + rules/suse/64-device-mapper.rules | 2 - + 6 files changed, 0 insertions(+), 62 deletions(-) + delete mode 100644 rules/packages/40-infiniband.rules + delete mode 100644 rules/packages/40-isdn.rules + delete mode 100644 rules/packages/40-zaptel.rules + delete mode 100644 rules/packages/64-device-mapper.rules + delete mode 100644 rules/packages/64-md-raid.rules + +diff --git a/rules/packages/40-infiniband.rules b/rules/packages/40-infiniband.rules +deleted file mode 100644 +index e2e4748..0000000 +--- a/rules/packages/40-infiniband.rules ++++ /dev/null +@@ -1,9 +0,0 @@ +-# do not edit this file, it will be overwritten on update +- +-KERNEL=="umad[0-9]*", NAME="infiniband/%k" +-KERNEL=="issm[0-9]*", NAME="infiniband/%k" +-KERNEL=="ucm[0-9]*", NAME="infiniband/%k", MODE="0666" +-KERNEL=="uverbs[0-9]*", NAME="infiniband/%k", MODE="0666" +-KERNEL=="uat", NAME="infiniband/%k", MODE="0666" +-KERNEL=="ucma", NAME="infiniband/%k", MODE="0666" +-KERNEL=="rdma_cm", NAME="infiniband/%k", MODE="0666" +diff --git a/rules/packages/40-isdn.rules b/rules/packages/40-isdn.rules +deleted file mode 100644 +index 1a31cb6..0000000 +--- a/rules/packages/40-isdn.rules ++++ /dev/null +@@ -1,4 +0,0 @@ +-# do not edit this file, it will be overwritten on update +- +-SUBSYSTEM=="capi", KERNEL=="capi", NAME="capi20", GROUP="dialout" +-SUBSYSTEM=="tty", KERNEL=="capi[0-9]*", NAME="capi/%n" +diff --git a/rules/packages/40-zaptel.rules b/rules/packages/40-zaptel.rules +deleted file mode 100644 +index cbd8b8a..0000000 +--- a/rules/packages/40-zaptel.rules ++++ /dev/null +@@ -1,7 +0,0 @@ +-# do not edit this file, it will be overwritten on update +- +-KERNEL=="zap[0-9]*", NAME="zap/%n", GROUP="dialout" +-KERNEL=="zapchannel", NAME="zap/channel", GROUP="dialout" +-KERNEL=="zapctl", NAME="zap/ctl", GROUP="dialout" +-KERNEL=="zappseudo", NAME="zap/pseudo", GROUP="dialout" +-KERNEL=="zaptimer", NAME="zap/timer", GROUP="dialout" +diff --git a/rules/packages/64-device-mapper.rules b/rules/packages/64-device-mapper.rules +deleted file mode 100644 +index 8154ef3..0000000 +--- a/rules/packages/64-device-mapper.rules ++++ /dev/null +@@ -1,4 +0,0 @@ +-# do not edit this file, it will be overwritten on update +- +-KERNEL=="device-mapper", NAME="mapper/control" +- +diff --git a/rules/packages/64-md-raid.rules b/rules/packages/64-md-raid.rules +deleted file mode 100644 +index 6ba93b6..0000000 +--- a/rules/packages/64-md-raid.rules ++++ /dev/null +@@ -1,36 +0,0 @@ +-# do not edit this file, it will be overwritten on update +- +-SUBSYSTEM!="block", GOTO="md_end" +-ACTION!="add|change", GOTO="md_end" +- +-# import data from a raid member and activate it +-#ENV{ID_FS_TYPE}=="linux_raid_member", IMPORT{program}="/sbin/mdadm --examine --export $tempnode", RUN+="/sbin/mdadm --incremental $env{DEVNAME}" +-# import data from a raid set +-KERNEL!="md*", GOTO="md_end" +- +-# partitions have no md/{array_state,metadata_version} +-ENV{DEVTYPE}=="partition", GOTO="md_ignore_state" +- +-# container devices have a metadata version of e.g. 'external:ddf' and +-# never leave state 'inactive' +-ATTR{md/metadata_version}=="external:[A-Za-z]*", ATTR{md/array_state}=="inactive", GOTO="md_ignore_state" +-TEST!="md/array_state", GOTO="md_end" +-ATTR{md/array_state}=="|clear|inactive", GOTO="md_end" +-LABEL="md_ignore_state" +- +-IMPORT{program}="/sbin/mdadm --detail --export $tempnode" +-ENV{DEVTYPE}=="disk", ENV{MD_NAME}=="?*", SYMLINK+="disk/by-id/md-name-$env{MD_NAME}", OPTIONS+="string_escape=replace" +-ENV{DEVTYPE}=="disk", ENV{MD_UUID}=="?*", SYMLINK+="disk/by-id/md-uuid-$env{MD_UUID}" +-ENV{DEVTYPE}=="disk", ENV{MD_DEVNAME}=="?*", SYMLINK+="md/$env{MD_DEVNAME}" +-ENV{DEVTYPE}=="partition", ENV{MD_NAME}=="?*", SYMLINK+="disk/by-id/md-name-$env{MD_NAME}-part%n", OPTIONS+="string_escape=replace" +-ENV{DEVTYPE}=="partition", ENV{MD_UUID}=="?*", SYMLINK+="disk/by-id/md-uuid-$env{MD_UUID}-part%n" +-ENV{DEVTYPE}=="partition", ENV{MD_DEVNAME}=="*[^0-9]", SYMLINK+="md/$env{MD_DEVNAME}%n" +-ENV{DEVTYPE}=="partition", ENV{MD_DEVNAME}=="*[0-9]", SYMLINK+="md/$env{MD_DEVNAME}p%n" +- +-IMPORT{program}="/sbin/blkid -o udev -p $tempnode" +-OPTIONS+="link_priority=100" +-OPTIONS+="watch" +-ENV{ID_FS_USAGE}=="filesystem|other|crypto", ENV{ID_FS_UUID_ENC}=="?*", SYMLINK+="disk/by-uuid/$env{ID_FS_UUID_ENC}" +-ENV{ID_FS_USAGE}=="filesystem|other", ENV{ID_FS_LABEL_ENC}=="?*", SYMLINK+="disk/by-label/$env{ID_FS_LABEL_ENC}" +- +-LABEL="md_end" +diff --git a/rules/suse/64-device-mapper.rules b/rules/suse/64-device-mapper.rules +index 36ac756..34e3307 100644 +--- a/rules/suse/64-device-mapper.rules ++++ b/rules/suse/64-device-mapper.rules +@@ -1,7 +1,5 @@ + # do not edit this file, it will be overwritten on update + +-KERNEL=="device-mapper", NAME="mapper/control" +- + KERNEL!="dm-*", GOTO="device_mapper_end" + ACTION!="add|change", GOTO="device_mapper_end" + +-- +1.6.6 + diff --git a/0053-rules-we-do-not-have-static-devices-which-are-rename.patch b/0053-rules-we-do-not-have-static-devices-which-are-rename.patch new file mode 100644 index 0000000..54294f0 --- /dev/null +++ b/0053-rules-we-do-not-have-static-devices-which-are-rename.patch @@ -0,0 +1,21 @@ +From 421fbc71c7e951dac900eabd445dfe577158b9c3 Mon Sep 17 00:00:00 2001 +From: Kay Sievers +Date: Mon, 12 Apr 2010 10:50:59 +0200 +Subject: [PATCH 53/65] rules: we do not have static devices which are renamed + +--- + rules/rules.d/50-udev-default.rules | 1 - + 1 files changed, 0 insertions(+), 1 deletions(-) + +diff --git a/rules/rules.d/50-udev-default.rules b/rules/rules.d/50-udev-default.rules +index e8116a3..a5f0823 100644 +--- a/rules/rules.d/50-udev-default.rules ++++ b/rules/rules.d/50-udev-default.rules +@@ -115,4 +115,3 @@ KERNEL=="rrom[0-9]*", MODE="0400" + + # do not delete static device nodes + ACTION=="remove", NAME=="", TEST=="/lib/udev/devices/%k", OPTIONS+="ignore_remove" +-ACTION=="remove", NAME=="?*", TEST=="/lib/udev/devices/$name", OPTIONS+="ignore_remove" +-- +1.6.6 + diff --git a/0054-unify-cleanup-event-handling.patch b/0054-unify-cleanup-event-handling.patch new file mode 100644 index 0000000..8ab3525 --- /dev/null +++ b/0054-unify-cleanup-event-handling.patch @@ -0,0 +1,362 @@ +From 0ec5b5e1429307fa7573aaa9b8f25fbd9b1d71d5 Mon Sep 17 00:00:00 2001 +From: Kay Sievers +Date: Mon, 12 Apr 2010 15:51:16 +0200 +Subject: [PATCH 54/65] unify/cleanup event handling + +--- + udev/udev-event.c | 231 ++++++++++++++++++++++------------------------------- + udev/udev-node.c | 24 ++++-- + udev/udev.h | 3 +- + 3 files changed, 111 insertions(+), 147 deletions(-) + +diff --git a/udev/udev-event.c b/udev/udev-event.c +index 986c119..c3a8281 100644 +--- a/udev/udev-event.c ++++ b/udev/udev-event.c +@@ -1,5 +1,5 @@ + /* +- * Copyright (C) 2003-2009 Kay Sievers ++ * Copyright (C) 2003-2010 Kay Sievers + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by +@@ -541,167 +541,124 @@ int udev_event_execute_rules(struct udev_event *event, struct udev_rules *rules) + udev_device_get_subsystem(dev), udev_device_get_sysname(dev)); + } + +- /* add device node */ +- if (major(udev_device_get_devnum(dev)) != 0 && +- (strcmp(udev_device_get_action(dev), "add") == 0 || strcmp(udev_device_get_action(dev), "change") == 0)) { +- char filename[UTIL_PATH_SIZE]; +- struct udev_device *dev_old; +- int delete_kdevnode = 0; +- +- dbg(event->udev, "device node add '%s'\n", udev_device_get_devpath(dev)); +- +- /* read old database entry */ +- dev_old = udev_device_new_from_syspath(event->udev, udev_device_get_syspath(dev)); +- if (dev_old != NULL) { +- udev_device_read_db(dev_old); +- udev_device_set_info_loaded(dev_old); ++ if (strcmp(udev_device_get_action(dev), "remove") == 0) { ++ udev_device_read_db(dev); ++ udev_device_set_info_loaded(dev); ++ udev_device_delete_db(dev); + +- /* disable watch during event processing */ +- udev_watch_end(event->udev, dev_old); +- } ++ if (major(udev_device_get_devnum(dev)) != 0) ++ udev_watch_end(event->udev, dev); + + udev_rules_apply_to_event(rules, event); +- if (event->tmp_node != NULL) { +- dbg(event->udev, "cleanup temporary device node\n"); +- util_unlink_secure(event->udev, event->tmp_node); +- free(event->tmp_node); +- event->tmp_node = NULL; +- } +- +- if (event->name != NULL && event->name[0] == '\0') { +- info(event->udev, "device node creation suppressed\n"); +- delete_kdevnode = 1; +- goto exit_add; +- } +- +- /* if rule given name disagrees with kernel node name, delete kernel node */ +- if (event->name != NULL && udev_device_get_knodename(dev) != NULL) { +- if (strcmp(event->name, udev_device_get_knodename(dev)) != 0) +- delete_kdevnode = 1; +- } +- +- /* no rule, use kernel provided name */ +- if (event->name == NULL) { +- if (udev_device_get_knodename(dev) != NULL) { +- event->name = strdup(udev_device_get_knodename(dev)); +- info(event->udev, "no node name set, will use kernel supplied name '%s'\n", event->name); +- } else { +- event->name = strdup(udev_device_get_sysname(event->dev)); +- info(event->udev, "no node name set, will use device name '%s'\n", event->name); +- } +- } + +- /* something went wrong */ +- if (event->name == NULL) { +- err(event->udev, "no node name for '%s'\n", udev_device_get_sysname(event->dev)); +- goto exit_add; +- } +- +- /* set device node name */ +- util_strscpyl(filename, sizeof(filename), udev_get_dev_path(event->udev), "/", event->name, NULL); +- udev_device_set_devnode(dev, filename); +- +- /* write current database entry */ +- udev_device_update_db(dev); ++ if (major(udev_device_get_devnum(dev)) != 0) ++ err = udev_node_remove(dev); ++ } else { ++ event->dev_db = udev_device_new_from_syspath(event->udev, udev_device_get_syspath(dev)); ++ if (event->dev_db != NULL) { ++ udev_device_read_db(event->dev_db); ++ udev_device_set_info_loaded(event->dev_db); + +- /* remove/update possible left-over symlinks from old database entry */ +- if (dev_old != NULL) +- udev_node_update_old_links(dev, dev_old); +- +- /* create new node and symlinks */ +- err = udev_node_add(dev, event->mode, event->uid, event->gid); +-exit_add: +- if (delete_kdevnode && udev_device_get_knodename(dev) != NULL) { +- struct stat stats; +- +- util_strscpyl(filename, sizeof(filename), +- udev_get_dev_path(event->udev), "/", udev_device_get_knodename(dev), NULL); +- if (stat(filename, &stats) == 0 && stats.st_rdev == udev_device_get_devnum(dev)) { +- unlink(filename); +- util_delete_path(event->udev, filename); +- info(event->udev, "removed kernel created node '%s'\n", filename); +- } ++ /* disable watch during event processing */ ++ if (major(udev_device_get_devnum(dev)) != 0) ++ udev_watch_end(event->udev, event->dev_db); + } +- udev_device_unref(dev_old); +- goto exit; +- } +- +- /* add netif */ +- if (strcmp(udev_device_get_subsystem(dev), "net") == 0 && strcmp(udev_device_get_action(dev), "add") == 0) { +- dbg(event->udev, "netif add '%s'\n", udev_device_get_devpath(dev)); +- udev_device_delete_db(dev); + + udev_rules_apply_to_event(rules, event); +- if (event->name == NULL) +- goto exit; + +- /* look if we want to change the name of the netif */ +- if (strcmp(event->name, udev_device_get_sysname(dev)) != 0) { ++ /* rename a new network interface, if needed */ ++ if (strcmp(udev_device_get_subsystem(dev), "net") == 0 && strcmp(udev_device_get_action(dev), "add") == 0 && ++ event->name != NULL && strcmp(event->name, udev_device_get_sysname(dev)) != 0) { + char syspath[UTIL_PATH_SIZE]; + char *pos; + + err = rename_netif(event); +- if (err != 0) +- goto exit; +- info(event->udev, "renamed netif to '%s'\n", event->name); +- +- /* remember old name */ +- udev_device_add_property(dev, "INTERFACE_OLD", udev_device_get_sysname(dev)); +- +- /* now change the devpath, because the kernel device name has changed */ +- util_strscpy(syspath, sizeof(syspath), udev_device_get_syspath(dev)); +- pos = strrchr(syspath, '/'); +- if (pos != NULL) { +- pos++; +- util_strscpy(pos, sizeof(syspath) - (pos - syspath), event->name); +- udev_device_set_syspath(event->dev, syspath); +- udev_device_add_property(dev, "INTERFACE", udev_device_get_sysname(dev)); +- info(event->udev, "changed devpath to '%s'\n", udev_device_get_devpath(dev)); ++ if (err == 0) { ++ info(event->udev, "renamed netif to '%s'\n", event->name); ++ ++ /* delete stale db file */ ++ udev_device_delete_db(dev); ++ ++ /* remember old name */ ++ udev_device_add_property(dev, "INTERFACE_OLD", udev_device_get_sysname(dev)); ++ ++ /* now change the devpath, because the kernel device name has changed */ ++ util_strscpy(syspath, sizeof(syspath), udev_device_get_syspath(dev)); ++ pos = strrchr(syspath, '/'); ++ if (pos != NULL) { ++ pos++; ++ util_strscpy(pos, sizeof(syspath) - (pos - syspath), event->name); ++ udev_device_set_syspath(event->dev, syspath); ++ udev_device_add_property(dev, "INTERFACE", udev_device_get_sysname(dev)); ++ info(event->udev, "changed devpath to '%s'\n", udev_device_get_devpath(dev)); ++ } + } + } +- udev_device_update_db(dev); +- goto exit; +- } + +- /* remove device node */ +- if (major(udev_device_get_devnum(dev)) != 0 && strcmp(udev_device_get_action(dev), "remove") == 0) { +- /* import database entry and delete it */ +- udev_device_read_db(dev); +- udev_device_set_info_loaded(dev); +- udev_device_delete_db(dev); ++ if (major(udev_device_get_devnum(dev)) != 0) { ++ char filename[UTIL_PATH_SIZE]; + +- /* remove watch */ +- udev_watch_end(event->udev, dev); ++ if (event->tmp_node != NULL) { ++ info(event->udev, "cleanup temporary device node\n"); ++ util_unlink_secure(event->udev, event->tmp_node); ++ free(event->tmp_node); ++ event->tmp_node = NULL; ++ } + +- if (udev_device_get_devnode(dev) == NULL) { +- char devnode[UTIL_PATH_SIZE]; ++ /* no rule, use kernel provided name */ ++ if (event->name == NULL) { ++ if (udev_device_get_knodename(dev) != NULL) { ++ event->name = strdup(udev_device_get_knodename(dev)); ++ info(event->udev, "no node name set, will use kernel supplied name '%s'\n", event->name); ++ } else { ++ event->name = strdup(udev_device_get_sysname(event->dev)); ++ info(event->udev, "no node name set, will use device name '%s'\n", event->name); ++ } ++ } ++ ++ if (event->name == NULL) { ++ /* things went wrong */ ++ udev_device_delete_db(dev); ++ udev_device_unref(event->dev_db); ++ err = -ENOMEM; ++ goto out; ++ } + +- info(event->udev, "'%s' not found in database, using kernel name '%s'\n", +- udev_device_get_syspath(dev), udev_device_get_knodename(dev)); +- util_strscpyl(devnode, sizeof(devnode), +- udev_get_dev_path(event->udev), "/", udev_device_get_knodename(dev), NULL); +- udev_device_set_devnode(dev, devnode); ++ /* set device node name */ ++ util_strscpyl(filename, sizeof(filename), udev_get_dev_path(event->udev), "/", event->name, NULL); ++ udev_device_set_devnode(dev, filename); + } + +- udev_rules_apply_to_event(rules, event); ++ udev_device_update_db(dev); + +- if (udev_device_get_ignore_remove(dev)) { +- info(event->udev, "ignore_remove for '%s'\n", udev_device_get_devnode(dev)); +- goto exit; ++ if (major(udev_device_get_devnum(dev)) != 0) { ++ /* remove/update possible left-over symlinks from old database entry */ ++ if (event->dev_db != NULL) ++ udev_node_update_old_links(dev, event->dev_db); ++ ++ if (event->name[0] != '\0') ++ err = udev_node_add(dev, event->mode, event->uid, event->gid); ++ else ++ info(event->udev, "device node creation suppressed\n"); ++ ++ /* remove kernel-created node, if needed */ ++ if (udev_device_get_knodename(dev) != NULL && strcmp(event->name, udev_device_get_knodename(dev)) != 0) { ++ struct stat stats; ++ char filename[UTIL_PATH_SIZE]; ++ ++ info(event->udev, "remove kernel created node '%s'\n", udev_device_get_knodename(dev)); ++ util_strscpyl(filename, sizeof(filename), udev_get_dev_path(event->udev), "/", udev_device_get_knodename(dev), NULL); ++ if (stat(filename, &stats) == 0 && stats.st_rdev == udev_device_get_devnum(dev)) { ++ util_unlink_secure(event->udev, filename); ++ util_delete_path(event->udev, filename); ++ } ++ } + } + +- err = udev_node_remove(dev); +- goto exit; ++ udev_device_unref(event->dev_db); ++ event->dev_db = NULL; + } +- +- /* default devices */ +- udev_rules_apply_to_event(rules, event); +- +- if (strcmp(udev_device_get_action(dev), "remove") != 0) +- udev_device_update_db(dev); +- else +- udev_device_delete_db(dev); +-exit: ++out: + return err; + } + +diff --git a/udev/udev-node.c b/udev/udev-node.c +index 3aee15b..3b4eb5f 100644 +--- a/udev/udev-node.c ++++ b/udev/udev-node.c +@@ -1,5 +1,5 @@ + /* +- * Copyright (C) 2003-2009 Kay Sievers ++ * Copyright (C) 2003-2010 Kay Sievers + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by +@@ -416,7 +416,6 @@ int udev_node_remove(struct udev_device *dev) + const char *devnode; + char partitionname[UTIL_PATH_SIZE]; + struct stat stats; +- struct udev_device *dev_check; + int err = 0; + int num; + +@@ -436,15 +435,21 @@ int udev_node_remove(struct udev_device *dev) + return -1; + } + +- dev_check = udev_device_new_from_syspath(udev, udev_device_get_syspath(dev)); +- if (dev_check != NULL && stats.st_rdev == udev_device_get_devnum(dev_check)) { +- /* do not remove device node if the same sys-device is re-created in the meantime */ +- info(udev, "keeping device node of existing device'%s'\n", devnode); ++ if (udev_device_get_ignore_remove(dev)) { ++ info(udev, "ignore_remove for '%s'\n", udev_device_get_devnode(dev)); + } else { +- info(udev, "removing device node '%s'\n", devnode); +- err = util_unlink_secure(udev, devnode); ++ struct udev_device *dev_check; ++ ++ dev_check = udev_device_new_from_syspath(udev, udev_device_get_syspath(dev)); ++ if (dev_check != NULL && stats.st_rdev == udev_device_get_devnum(dev_check)) { ++ /* do not remove device node if the same sys-device is re-created in the meantime */ ++ info(udev, "keeping device node of existing device'%s'\n", devnode); ++ } else { ++ info(udev, "removing device node '%s'\n", devnode); ++ err = util_unlink_secure(udev, devnode); ++ } ++ udev_device_unref(dev_check); + } +- udev_device_unref(dev_check); + + num = udev_device_get_num_fake_partitions(dev); + if (num > 0) { +@@ -459,6 +464,7 @@ int udev_node_remove(struct udev_device *dev) + util_unlink_secure(udev, partitionname); + } + } ++ + util_delete_path(udev, devnode); + return err; + } +diff --git a/udev/udev.h b/udev/udev.h +index 555eae6..2b9bbec 100644 +--- a/udev/udev.h ++++ b/udev/udev.h +@@ -1,6 +1,6 @@ + /* + * Copyright (C) 2003 Greg Kroah-Hartman +- * Copyright (C) 2003-2008 Kay Sievers ++ * Copyright (C) 2003-2010 Kay Sievers + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by +@@ -35,6 +35,7 @@ struct udev_event { + struct udev *udev; + struct udev_device *dev; + struct udev_device *dev_parent; ++ struct udev_device *dev_db; + char *name; + char *tmp_node; + char *program_result; +-- +1.6.6 + diff --git a/0055-allow-IMPORT-db-KEY.patch b/0055-allow-IMPORT-db-KEY.patch new file mode 100644 index 0000000..4a81bfa --- /dev/null +++ b/0055-allow-IMPORT-db-KEY.patch @@ -0,0 +1,109 @@ +From 5539f624e18e948e4e3a1f0d9f5d25de9c8fd8b8 Mon Sep 17 00:00:00 2001 +From: Kay Sievers +Date: Mon, 12 Apr 2010 15:58:05 +0200 +Subject: [PATCH 55/65] allow IMPORT{db}="KEY" + +--- + udev/udev-rules.c | 26 +++++++++++++++++++++++++- + udev/udev.xml | 8 ++++++++ + 2 files changed, 33 insertions(+), 1 deletions(-) + +diff --git a/udev/udev-rules.c b/udev/udev-rules.c +index 60daad5..c4a2724 100644 +--- a/udev/udev-rules.c ++++ b/udev/udev-rules.c +@@ -1,5 +1,5 @@ + /* +- * Copyright (C) 2003-2009 Kay Sievers ++ * Copyright (C) 2003-2010 Kay Sievers + * Copyright (C) 2008 Alan Jenkins + * + * This program is free software: you can redistribute it and/or modify +@@ -141,6 +141,7 @@ enum token_type { + TK_M_PROGRAM, /* val */ + TK_M_IMPORT_FILE, /* val */ + TK_M_IMPORT_PROG, /* val */ ++ TK_M_IMPORT_DB, /* val */ + TK_M_IMPORT_PARENT, /* val */ + TK_M_RESULT, /* val */ + TK_M_MAX, +@@ -271,6 +272,7 @@ static const char *token_str(enum token_type type) + [TK_M_PROGRAM] = "M PROGRAM", + [TK_M_IMPORT_FILE] = "M IMPORT_FILE", + [TK_M_IMPORT_PROG] = "M IMPORT_PROG", ++ [TK_M_IMPORT_DB] = "M IMPORT_DB", + [TK_M_IMPORT_PARENT] = "M IMPORT_PARENT", + [TK_M_RESULT] = "M RESULT", + [TK_M_MAX] = "M MAX", +@@ -337,6 +339,7 @@ static void dump_token(struct udev_rules *rules, struct token *token) + case TK_M_PROGRAM: + case TK_M_IMPORT_FILE: + case TK_M_IMPORT_PROG: ++ case TK_M_IMPORT_DB: + case TK_M_IMPORT_PARENT: + case TK_M_RESULT: + case TK_A_NAME: +@@ -1001,6 +1004,7 @@ static int rule_add_key(struct rule_tmp *rule_tmp, enum token_type type, + case TK_M_PROGRAM: + case TK_M_IMPORT_FILE: + case TK_M_IMPORT_PROG: ++ case TK_M_IMPORT_DB: + case TK_M_IMPORT_PARENT: + case TK_M_RESULT: + case TK_A_OWNER: +@@ -1379,6 +1383,9 @@ static int add_rule(struct udev_rules *rules, char *line, + } else if (attr != NULL && strstr(attr, "file")) { + dbg(rules->udev, "IMPORT will be included as file\n"); + rule_add_key(&rule_tmp, TK_M_IMPORT_FILE, op, value, NULL); ++ } else if (attr != NULL && strstr(attr, "db")) { ++ dbg(rules->udev, "IMPORT will include db values\n"); ++ rule_add_key(&rule_tmp, TK_M_IMPORT_DB, op, value, NULL); + } else if (attr != NULL && strstr(attr, "parent")) { + dbg(rules->udev, "IMPORT will include the parent values\n"); + rule_add_key(&rule_tmp, TK_M_IMPORT_PARENT, op, value, NULL); +@@ -2288,6 +2295,23 @@ int udev_rules_apply_to_event(struct udev_rules *rules, struct udev_event *event + goto nomatch; + break; + } ++ case TK_M_IMPORT_DB: ++ { ++ const char *key = &rules->buf[cur->key.value_off]; ++ const char *value; ++ ++ value = udev_device_get_property_value(event->dev_db, key); ++ if (value != NULL) { ++ struct udev_list_entry *entry; ++ ++ entry = udev_device_add_property(event->dev, key, value); ++ udev_list_entry_set_flags(entry, 1); ++ } else { ++ if (cur->key.op != OP_NOMATCH) ++ goto nomatch; ++ } ++ break; ++ } + case TK_M_IMPORT_PARENT: + { + char import[UTIL_PATH_SIZE]; +diff --git a/udev/udev.xml b/udev/udev.xml +index b6c5933..175cdbe 100644 +--- a/udev/udev.xml ++++ b/udev/udev.xml +@@ -399,6 +399,14 @@ + + + ++ ++ ++ Import a single property specified as the assigned value from the ++ current device database. This works only if the database is already populated ++ by an earlier event. ++ ++ ++ + + + Import the stored keys from the parent device by reading +-- +1.6.6 + diff --git a/0056-usb-db-remove-double.patch b/0056-usb-db-remove-double.patch new file mode 100644 index 0000000..0f0d612 --- /dev/null +++ b/0056-usb-db-remove-double.patch @@ -0,0 +1,31 @@ +From 86dc9133f88e8690aa89ccb5a240ff915b1fb69f Mon Sep 17 00:00:00 2001 +From: Kay Sievers +Date: Mon, 12 Apr 2010 16:10:05 +0200 +Subject: [PATCH 56/65] usb-db: remove double '/' + +--- + extras/usb-db/usb-db.c | 4 +--- + 1 files changed, 1 insertions(+), 3 deletions(-) + +diff --git a/extras/usb-db/usb-db.c b/extras/usb-db/usb-db.c +index db1f843..fe563c2 100644 +--- a/extras/usb-db/usb-db.c ++++ b/extras/usb-db/usb-db.c +@@ -1,5 +1,3 @@ +-/*-*- linux-c -*-*/ +- + /* + * Copyright (C) 2009 Lennart Poettering + * +@@ -223,7 +221,7 @@ int main(int argc, char*argv[]) { + if (!(udev = udev_new())) + goto finish; + +- if (asprintf(&sp, "%s/%s", udev_get_sys_path(udev), argv[1]) < 0) { ++ if (asprintf(&sp, "%s%s", udev_get_sys_path(udev), argv[1]) < 0) { + fprintf(stderr, "Failed to allocate sysfs path.\n"); + goto finish; + } +-- +1.6.6 + diff --git a/0057-replace-add-change-with-remove.patch b/0057-replace-add-change-with-remove.patch new file mode 100644 index 0000000..6ea9548 --- /dev/null +++ b/0057-replace-add-change-with-remove.patch @@ -0,0 +1,276 @@ +From 4b06c409350d26af5e6ace0f368d01b80d75438e Mon Sep 17 00:00:00 2001 +From: Kay Sievers +Date: Mon, 12 Apr 2010 16:52:41 +0200 +Subject: [PATCH 57/65] replace "add|change" with "!remove" + +--- + extras/cdrom_id/60-cdrom_id.rules | 2 +- + extras/edd_id/61-persistent-storage-edd.rules | 2 +- + extras/fstab_import/79-fstab_import.rules | 2 +- + extras/hid2hci/70-hid2hci.rules | 2 +- + extras/keymap/95-keyboard-force-release.rules | 2 +- + extras/keymap/95-keymap.rules | 2 +- + extras/udev-acl/70-acl.rules | 2 +- + extras/udev-acl/udev-acl.c | 6 ++---- + extras/v4l_id/60-persistent-v4l.rules | 2 +- + rules/rules.d/60-persistent-alsa.rules | 2 +- + rules/rules.d/60-persistent-input.rules | 2 +- + rules/rules.d/60-persistent-serial.rules | 2 +- + rules/rules.d/60-persistent-storage-tape.rules | 2 +- + rules/rules.d/60-persistent-storage.rules | 2 +- + rules/rules.d/75-net-description.rules | 2 +- + rules/rules.d/75-tty-description.rules | 2 +- + rules/suse/64-device-mapper.rules | 2 +- + udev/udev-rules.c | 5 ++--- + udev/udevd.c | 2 +- + 19 files changed, 21 insertions(+), 24 deletions(-) + +diff --git a/extras/cdrom_id/60-cdrom_id.rules b/extras/cdrom_id/60-cdrom_id.rules +index 811c4aa..16b3af9 100644 +--- a/extras/cdrom_id/60-cdrom_id.rules ++++ b/extras/cdrom_id/60-cdrom_id.rules +@@ -1,6 +1,6 @@ + # do not edit this file, it will be overwritten on update + +-ACTION!="add|change", GOTO="cdrom_end" ++ACTION=="remove", GOTO="cdrom_end" + SUBSYSTEM!="block", GOTO="cdrom_end" + KERNEL!="sr[0-9]*|xvd*", GOTO="cdrom_end" + ENV{DEVTYPE}!="disk", GOTO="cdrom_end" +diff --git a/extras/edd_id/61-persistent-storage-edd.rules b/extras/edd_id/61-persistent-storage-edd.rules +index 54ae086..1ab1be3 100644 +--- a/extras/edd_id/61-persistent-storage-edd.rules ++++ b/extras/edd_id/61-persistent-storage-edd.rules +@@ -1,6 +1,6 @@ + # do not edit this file, it will be overwritten on update + +-ACTION!="add|change", GOTO="persistent_storage_edd_end" ++ACTION=="remove", GOTO="persistent_storage_edd_end" + SUBSYSTEM!="block", GOTO="persistent_storage_edd_end" + KERNEL!="sd*|hd*|cciss*", GOTO="persistent_storage_edd_end" + +diff --git a/extras/fstab_import/79-fstab_import.rules b/extras/fstab_import/79-fstab_import.rules +index 2adfe04..2ded7d3 100644 +--- a/extras/fstab_import/79-fstab_import.rules ++++ b/extras/fstab_import/79-fstab_import.rules +@@ -1,2 +1,2 @@ +-ACTION=="add|change", SUBSYSTEM=="block", ENV{ID_FS_USAGE}=="filesystem|other", IMPORT="fstab_import $name $links mapper/$env{DM_NAME}" ++ACTION!="remove", SUBSYSTEM=="block", ENV{ID_FS_USAGE}=="filesystem|other", IMPORT="fstab_import $name $links mapper/$env{DM_NAME}" + +diff --git a/extras/hid2hci/70-hid2hci.rules b/extras/hid2hci/70-hid2hci.rules +index 01ff30d..0687c8a 100644 +--- a/extras/hid2hci/70-hid2hci.rules ++++ b/extras/hid2hci/70-hid2hci.rules +@@ -1,6 +1,6 @@ + # do not edit this file, it will be overwritten on update + +-ACTION!="add|change", GOTO="hid2hci_end" ++ACTION=="remove", GOTO="hid2hci_end" + SUBSYSTEM!="usb", GOTO="hid2hci_end" + + # Variety of Dell Bluetooth devices - match on a mouse device that is +diff --git a/extras/keymap/95-keyboard-force-release.rules b/extras/keymap/95-keyboard-force-release.rules +index f0e1ab8..b973614 100644 +--- a/extras/keymap/95-keyboard-force-release.rules ++++ b/extras/keymap/95-keyboard-force-release.rules +@@ -11,7 +11,7 @@ + # /lib/udev/keymap -i /dev/input/eventX + # on a Linux vt to find out. + +-ACTION!="add|change", GOTO="force_release_end" ++ACTION=="remove", GOTO="force_release_end" + SUBSYSTEM!="serio", GOTO="force_release_end" + KERNEL!="serio*", GOTO="force_release_end" + DRIVER!="atkbd", GOTO="force_release_end" +diff --git a/extras/keymap/95-keymap.rules b/extras/keymap/95-keymap.rules +index dd58453..2f41cb4 100644 +--- a/extras/keymap/95-keymap.rules ++++ b/extras/keymap/95-keymap.rules +@@ -5,7 +5,7 @@ + # a file name (in /lib/udev/keymaps), which has to contain scancode/keyname + # pairs. + +-ACTION!="add|change", GOTO="keyboard_end" ++ACTION=="remove", GOTO="keyboard_end" + SUBSYSTEM!="input", GOTO="keyboard_end" + KERNEL!="event*", GOTO="keyboard_end" + +diff --git a/extras/udev-acl/70-acl.rules b/extras/udev-acl/70-acl.rules +index fde2656..5b00bf8 100644 +--- a/extras/udev-acl/70-acl.rules ++++ b/extras/udev-acl/70-acl.rules +@@ -4,7 +4,7 @@ + # udev-acl of this udev release and may be replaced at any time. + + ENV{MAJOR}=="", GOTO="acl_end" +-ACTION!="add|change", GOTO="acl_apply" ++ACTION=="remove", GOTO="acl_apply" + + # PTP/MTP protocol devices, cameras, portable media players + SUBSYSTEM=="usb", ENV{ID_USB_INTERFACES}=="", ENV{DEVTYPE}=="usb_device", IMPORT{program}="usb_id --export %p" +diff --git a/extras/udev-acl/udev-acl.c b/extras/udev-acl/udev-acl.c +index c070fcc..ce51590 100644 +--- a/extras/udev-acl/udev-acl.c ++++ b/extras/udev-acl/udev-acl.c +@@ -353,12 +353,10 @@ int main (int argc, char* argv[]) + + switch (option) { + case 'a': +- if (strcmp(optarg, "add") == 0 || strcmp(optarg, "change") == 0) +- action = ACTION_ADD; +- else if (strcmp(optarg, "remove") == 0) ++ if (strcmp(optarg, "remove") == 0) + action = ACTION_REMOVE; + else +- goto out; ++ action = ACTION_ADD; + break; + case 'D': + device = optarg; +diff --git a/extras/v4l_id/60-persistent-v4l.rules b/extras/v4l_id/60-persistent-v4l.rules +index a342a71..b6e1313 100644 +--- a/extras/v4l_id/60-persistent-v4l.rules ++++ b/extras/v4l_id/60-persistent-v4l.rules +@@ -1,6 +1,6 @@ + # do not edit this file, it will be overwritten on update + +-ACTION!="add|change", GOTO="persistent_v4l_end" ++ACTION=="remove", GOTO="persistent_v4l_end" + SUBSYSTEM!="video4linux", GOTO="persistent_v4l_end" + ENV{MAJOR}=="", GOTO="persistent_v4l_end" + +diff --git a/rules/rules.d/60-persistent-alsa.rules b/rules/rules.d/60-persistent-alsa.rules +index a5206fd..39a3652 100644 +--- a/rules/rules.d/60-persistent-alsa.rules ++++ b/rules/rules.d/60-persistent-alsa.rules +@@ -1,6 +1,6 @@ + # do not edit this file, it will be overwritten on update + +-ACTION!="add|change", GOTO="persistent_alsa_end" ++ACTION=="remove", GOTO="persistent_alsa_end" + SUBSYSTEM!="sound", GOTO="persistent_alsa_end" + KERNEL!="controlC[0-9]*", GOTO="persistent_alsa_end" + +diff --git a/rules/rules.d/60-persistent-input.rules b/rules/rules.d/60-persistent-input.rules +index 1ea4431..634c4db 100644 +--- a/rules/rules.d/60-persistent-input.rules ++++ b/rules/rules.d/60-persistent-input.rules +@@ -1,6 +1,6 @@ + # do not edit this file, it will be overwritten on update + +-ACTION!="add|change", GOTO="persistent_input_end" ++ACTION=="remove", GOTO="persistent_input_end" + SUBSYSTEM!="input", GOTO="persistent_input_end" + KERNEL=="input[0-9]*", GOTO="persistent_input_end" + +diff --git a/rules/rules.d/60-persistent-serial.rules b/rules/rules.d/60-persistent-serial.rules +index 351b385..3e1a565 100644 +--- a/rules/rules.d/60-persistent-serial.rules ++++ b/rules/rules.d/60-persistent-serial.rules +@@ -1,6 +1,6 @@ + # do not edit this file, it will be overwritten on update + +-ACTION!="add|change", GOTO="persistent_serial_end" ++ACTION=="remove", GOTO="persistent_serial_end" + SUBSYSTEM!="tty", GOTO="persistent_serial_end" + KERNEL!="ttyUSB[0-9]*|ttyACM[0-9]*", GOTO="persistent_serial_end" + +diff --git a/rules/rules.d/60-persistent-storage-tape.rules b/rules/rules.d/60-persistent-storage-tape.rules +index 968528d..833ef94 100644 +--- a/rules/rules.d/60-persistent-storage-tape.rules ++++ b/rules/rules.d/60-persistent-storage-tape.rules +@@ -2,7 +2,7 @@ + + # persistent storage links: /dev/tape/{by-id,by-path} + +-ACTION!="add|change", GOTO="persistent_storage_tape_end" ++ACTION=="remove", GOTO="persistent_storage_tape_end" + + # type 8 devices are "Medium Changers" + SUBSYSTEM=="scsi_generic", SUBSYSTEMS=="scsi", ATTRS{type}=="8", IMPORT{program}="scsi_id --sg-version=3 --export --whitelisted -d $tempnode", SYMLINK+="tape/by-id/scsi-$env{ID_SERIAL}" +diff --git a/rules/rules.d/60-persistent-storage.rules b/rules/rules.d/60-persistent-storage.rules +index 89041a9..d9f8003 100644 +--- a/rules/rules.d/60-persistent-storage.rules ++++ b/rules/rules.d/60-persistent-storage.rules +@@ -6,7 +6,7 @@ + # forward scsi device event to corresponding block device + ACTION=="change", SUBSYSTEM=="scsi", ENV{DEVTYPE}=="scsi_device", TEST=="block", ATTR{block/*/uevent}="change" + +-ACTION!="add|change", GOTO="persistent_storage_end" ++ACTION=="remove", GOTO="persistent_storage_end" + SUBSYSTEM!="block", GOTO="persistent_storage_end" + + # skip rules for inappropriate block devices +diff --git a/rules/rules.d/75-net-description.rules b/rules/rules.d/75-net-description.rules +index 1c4c401..490fcce 100644 +--- a/rules/rules.d/75-net-description.rules ++++ b/rules/rules.d/75-net-description.rules +@@ -1,6 +1,6 @@ + # do not edit this file, it will be overwritten on update + +-ACTION!="add|change", GOTO="net_end" ++ACTION=="remove", GOTO="net_end" + SUBSYSTEM!="net", GOTO="net_end" + + SUBSYSTEMS=="usb", ENV{ID_MODEL}=="", IMPORT{program}="usb_id --export %p" +diff --git a/rules/rules.d/75-tty-description.rules b/rules/rules.d/75-tty-description.rules +index ac868ad..c2980cf 100644 +--- a/rules/rules.d/75-tty-description.rules ++++ b/rules/rules.d/75-tty-description.rules +@@ -1,6 +1,6 @@ + # do not edit this file, it will be overwritten on update + +-ACTION!="add|change", GOTO="tty_end" ++ACTION=="remove", GOTO="tty_end" + SUBSYSTEM!="tty", GOTO="tty_end" + + SUBSYSTEMS=="usb", ENV{ID_MODEL}=="", IMPORT{program}="usb_id --export %p" +diff --git a/rules/suse/64-device-mapper.rules b/rules/suse/64-device-mapper.rules +index 34e3307..12cae35 100644 +--- a/rules/suse/64-device-mapper.rules ++++ b/rules/suse/64-device-mapper.rules +@@ -1,7 +1,7 @@ + # do not edit this file, it will be overwritten on update + + KERNEL!="dm-*", GOTO="device_mapper_end" +-ACTION!="add|change", GOTO="device_mapper_end" ++ACTION=="remove", GOTO="device_mapper_end" + + IMPORT{program}="/sbin/dmsetup export -j%M -m%m" + ENV{DM_NAME}!="?*", GOTO="device_mapper_end" +diff --git a/udev/udev-rules.c b/udev/udev-rules.c +index c4a2724..0361f68 100644 +--- a/udev/udev-rules.c ++++ b/udev/udev-rules.c +@@ -2055,13 +2055,12 @@ int udev_rules_apply_to_event(struct udev_rules *rules, struct udev_event *event + struct token *cur; + struct token *rule; + enum escape_type esc = ESCAPE_UNSET; +- int can_set_name; ++ bool can_set_name; + + if (rules->tokens == NULL) + return -1; + +- can_set_name = ((strcmp(udev_device_get_action(event->dev), "add") == 0 || +- strcmp(udev_device_get_action(event->dev), "change") == 0) && ++ can_set_name = ((strcmp(udev_device_get_action(event->dev), "remove") != 0) && + (major(udev_device_get_devnum(event->dev)) > 0 || + strcmp(udev_device_get_subsystem(event->dev), "net") == 0)); + +diff --git a/udev/udevd.c b/udev/udevd.c +index fe3352c..c27b4cd 100644 +--- a/udev/udevd.c ++++ b/udev/udevd.c +@@ -168,7 +168,7 @@ static void event_queue_delete(struct event *event) + udev_list_node_remove(&event->node); + + /* mark as failed, if "add" event returns non-zero */ +- if (event->exitcode != 0 && strcmp(udev_device_get_action(event->dev), "add") == 0) ++ if (event->exitcode != 0 && strcmp(udev_device_get_action(event->dev), "remove") != 0) + udev_queue_export_device_failed(udev_queue_export, event->dev); + else + udev_queue_export_device_finished(udev_queue_export, event->dev); +-- +1.6.6 + diff --git a/0058-update-NEWS.patch b/0058-update-NEWS.patch new file mode 100644 index 0000000..3f1774b --- /dev/null +++ b/0058-update-NEWS.patch @@ -0,0 +1,30 @@ +From 5c4c389bba6cf986a8dd743b43017c2f60604cca Mon Sep 17 00:00:00 2001 +From: Kay Sievers +Date: Mon, 12 Apr 2010 17:00:16 +0200 +Subject: [PATCH 58/65] update NEWS + +--- + NEWS | 7 +++++++ + 1 files changed, 7 insertions(+), 0 deletions(-) + +diff --git a/NEWS b/NEWS +index a4d46d7..687bcdf 100644 +--- a/NEWS ++++ b/NEWS +@@ -2,6 +2,13 @@ udev 152 + ======== + Bugfixes. + ++All "add|change" matches are replaced by "!remove" in the rules and ++in the udev logic. All types of events will update possible symlinks ++and permissions, only "remove" is handled special now. ++ ++The modem mode switch extra was removed and the external usb_modeswitch ++program should be used instead. ++ + New and fixed keymaps. + + udev 151 +-- +1.6.6 + diff --git a/0059-log-info-only-if-we-actually-delete-the-node.patch b/0059-log-info-only-if-we-actually-delete-the-node.patch new file mode 100644 index 0000000..eb54add --- /dev/null +++ b/0059-log-info-only-if-we-actually-delete-the-node.patch @@ -0,0 +1,27 @@ +From 3ba7e651ad36e4f37d9bfffadb638bc2ef784217 Mon Sep 17 00:00:00 2001 +From: Kay Sievers +Date: Mon, 12 Apr 2010 17:13:37 +0200 +Subject: [PATCH 59/65] log info only if we actually delete the node + +--- + udev/udev-event.c | 2 +- + 1 files changed, 1 insertions(+), 1 deletions(-) + +diff --git a/udev/udev-event.c b/udev/udev-event.c +index c3a8281..26939e7 100644 +--- a/udev/udev-event.c ++++ b/udev/udev-event.c +@@ -646,9 +646,9 @@ int udev_event_execute_rules(struct udev_event *event, struct udev_rules *rules) + struct stat stats; + char filename[UTIL_PATH_SIZE]; + +- info(event->udev, "remove kernel created node '%s'\n", udev_device_get_knodename(dev)); + util_strscpyl(filename, sizeof(filename), udev_get_dev_path(event->udev), "/", udev_device_get_knodename(dev), NULL); + if (stat(filename, &stats) == 0 && stats.st_rdev == udev_device_get_devnum(dev)) { ++ info(event->udev, "remove kernel created node '%s'\n", udev_device_get_knodename(dev)); + util_unlink_secure(event->udev, filename); + util_delete_path(event->udev, filename); + } +-- +1.6.6 + diff --git a/0060-udevadm-trigger-switch-default-action-from-add-to-ch.patch b/0060-udevadm-trigger-switch-default-action-from-add-to-ch.patch new file mode 100644 index 0000000..17c2b1f --- /dev/null +++ b/0060-udevadm-trigger-switch-default-action-from-add-to-ch.patch @@ -0,0 +1,49 @@ +From 236fae6cf1a619a92174efdf84cd7d91e7d4348d Mon Sep 17 00:00:00 2001 +From: Kay Sievers +Date: Mon, 12 Apr 2010 17:56:32 +0200 +Subject: [PATCH 60/65] udevadm: trigger - switch default action from "add" to "change" + +--- + NEWS | 3 +++ + udev/udevadm-trigger.c | 4 ++-- + 2 files changed, 5 insertions(+), 2 deletions(-) + +diff --git a/NEWS b/NEWS +index 687bcdf..c5fbbe1 100644 +--- a/NEWS ++++ b/NEWS +@@ -2,6 +2,9 @@ udev 152 + ======== + Bugfixes. + ++"udevadm trigger" default to "change" events now, instead of "add" ++events. ++ + All "add|change" matches are replaced by "!remove" in the rules and + in the udev logic. All types of events will update possible symlinks + and permissions, only "remove" is handled special now. +diff --git a/udev/udevadm-trigger.c b/udev/udevadm-trigger.c +index dbcaee3..03aa534 100644 +--- a/udev/udevadm-trigger.c ++++ b/udev/udevadm-trigger.c +@@ -110,7 +110,7 @@ int udevadm_trigger(struct udev *udev, int argc, char *argv[]) + TYPE_SUBSYSTEMS, + TYPE_FAILED, + } device_type = TYPE_DEVICES; +- const char *action = "add"; ++ const char *action = "change"; + struct udev_enumerate *udev_enumerate; + int rc = 0; + +@@ -184,7 +184,7 @@ int udevadm_trigger(struct udev *udev, int argc, char *argv[]) + " subsystems sys subsystems and drivers\n" + " failed trigger only the events which have been\n" + " marked as failed during a previous run\n" +- " --action= event action value, default is \"add\"\n" ++ " --action= event action value, default is \"change\"\n" + " --subsystem-match= trigger devices from a matching subsystem\n" + " --subsystem-nomatch= exclude devices from a matching subsystem\n" + " --attr-match=]> trigger devices with a matching attribute\n" +-- +1.6.6 + diff --git a/0061-remove-all_partitions-option.patch b/0061-remove-all_partitions-option.patch new file mode 100644 index 0000000..cd1d372 --- /dev/null +++ b/0061-remove-all_partitions-option.patch @@ -0,0 +1,363 @@ +From 1f084fe5811ce251d516a8022f8c7c27d0ef1f53 Mon Sep 17 00:00:00 2001 +From: Kay Sievers +Date: Tue, 13 Apr 2010 08:52:48 +0200 +Subject: [PATCH 61/65] remove "all_partitions" option + +We can not predict the major/minor of non-existing devices: + $ grep . /sys/class/block/sd*/dev + /sys/class/block/sda1/dev:259:524288 + /sys/class/block/sda2/dev:259:262144 + /sys/class/block/sda3/dev:259:786432 + /sys/class/block/sda4/dev:259:131072 + /sys/class/block/sda/dev:259:0 + /sys/class/block/sdb/dev:259:655360 + /sys/class/block/sdc/dev:259:393216 + +If this functionality is still needed for some broken hardware, it needs to be +solved with a tool not part of the udev package. Because such option is unreliable +and unsafe to use. +--- + NEWS | 7 +++++- + libudev/libudev-device-private.c | 4 --- + libudev/libudev-device.c | 17 --------------- + libudev/libudev-private.h | 2 - + test/udev-test.pl | 43 -------------------------------------- + udev/udev-node.c | 35 ------------------------------ + udev/udev-rules.c | 23 -------------------- + udev/udev.xml | 8 ------- + udev/udevadm-info.c | 4 --- + 9 files changed, 6 insertions(+), 137 deletions(-) + +diff --git a/NEWS b/NEWS +index c5fbbe1..c422eaa 100644 +--- a/NEWS ++++ b/NEWS +@@ -2,9 +2,14 @@ udev 152 + ======== + Bugfixes. + +-"udevadm trigger" default to "change" events now, instead of "add" ++"udevadm trigger" defaults to "change" events now, instead of "add" + events. + ++The option "all_partitons" was removed from udev. This should not be ++needed for usual hardware. Udev can not safely make assumptions ++about non-exixting partition major/minor numbers, and therefore no ++longer provide such an unreliable and unsafe option. ++ + All "add|change" matches are replaced by "!remove" in the rules and + in the udev logic. All types of events will update possible symlinks + and permissions, only "remove" is handled special now. +diff --git a/libudev/libudev-device-private.c b/libudev/libudev-device-private.c +index 1bcf441..19c20b2 100644 +--- a/libudev/libudev-device-private.c ++++ b/libudev/libudev-device-private.c +@@ -41,8 +41,6 @@ int udev_device_update_db(struct udev_device *udev_device) + udev_list_entry_foreach(list_entry, udev_device_get_properties_list_entry(udev_device)) + if (udev_list_entry_get_flags(list_entry)) + goto file; +- if (udev_device_get_num_fake_partitions(udev_device) != 0) +- goto file; + if (udev_device_get_ignore_remove(udev_device)) + goto file; + if (udev_device_get_devlink_priority(udev_device) != 0) +@@ -95,8 +93,6 @@ file: + fprintf(f, "L:%i\n", udev_device_get_devlink_priority(udev_device)); + if (udev_device_get_event_timeout(udev_device) >= 0) + fprintf(f, "T:%i\n", udev_device_get_event_timeout(udev_device)); +- if (udev_device_get_num_fake_partitions(udev_device) != 0) +- fprintf(f, "A:%i\n", udev_device_get_num_fake_partitions(udev_device)); + if (udev_device_get_ignore_remove(udev_device)) + fprintf(f, "R:%i\n", udev_device_get_ignore_remove(udev_device)); + if (udev_device_get_watch_handle(udev_device) >= 0) +diff --git a/libudev/libudev-device.c b/libudev/libudev-device.c +index 410f75b..75cc61c 100644 +--- a/libudev/libudev-device.c ++++ b/libudev/libudev-device.c +@@ -63,7 +63,6 @@ struct udev_device { + unsigned long long int seqnum; + int event_timeout; + int timeout; +- int num_fake_partitions; + int devlink_priority; + int refcount; + dev_t devnum; +@@ -284,9 +283,6 @@ int udev_device_read_db(struct udev_device *udev_device) + case 'T': + udev_device_set_event_timeout(udev_device, atoi(val)); + break; +- case 'A': +- udev_device_set_num_fake_partitions(udev_device, atoi(val)); +- break; + case 'R': + udev_device_set_ignore_remove(udev_device, atoi(val)); + break; +@@ -1425,19 +1421,6 @@ int udev_device_set_devnum(struct udev_device *udev_device, dev_t devnum) + return 0; + } + +-int udev_device_get_num_fake_partitions(struct udev_device *udev_device) +-{ +- if (!udev_device->info_loaded) +- device_load_info(udev_device); +- return udev_device->num_fake_partitions; +-} +- +-int udev_device_set_num_fake_partitions(struct udev_device *udev_device, int num) +-{ +- udev_device->num_fake_partitions = num; +- return 0; +-} +- + int udev_device_get_devlink_priority(struct udev_device *udev_device) + { + if (!udev_device->info_loaded) +diff --git a/libudev/libudev-private.h b/libudev/libudev-private.h +index 3f2861f..bf9e923 100644 +--- a/libudev/libudev-private.h ++++ b/libudev/libudev-private.h +@@ -93,8 +93,6 @@ int udev_device_get_event_timeout(struct udev_device *udev_device); + int udev_device_set_event_timeout(struct udev_device *udev_device, int event_timeout); + int udev_device_set_devnum(struct udev_device *udev_device, dev_t devnum); + int udev_device_set_seqnum(struct udev_device *udev_device, unsigned long long int seqnum); +-int udev_device_get_num_fake_partitions(struct udev_device *udev_device); +-int udev_device_set_num_fake_partitions(struct udev_device *udev_device, int num); + int udev_device_get_devlink_priority(struct udev_device *udev_device); + int udev_device_set_devlink_priority(struct udev_device *udev_device, int prio); + int udev_device_get_ignore_remove(struct udev_device *udev_device); +diff --git a/test/udev-test.pl b/test/udev-test.pl +index aeca948..4633d6b 100755 +--- a/test/udev-test.pl ++++ b/test/udev-test.pl +@@ -493,16 +493,6 @@ SUBSYSTEMS=="foo", PROGRAM=="/bin/echo -n foo-%b", SYMLINK+="%c" + EOF + }, + { +- desc => "create all possible partitions", +- subsys => "block", +- devpath => "/devices/pci0000:00/0000:00:1f.2/host0/target0:0:0/0:0:0:0/block/sda", +- exp_name => "sda15" , +- exp_majorminor => "8:15", +- rules => < "sysfs parent hierarchy", + subsys => "tty", + devpath => "/devices/pci0000:00/0000:00:1d.7/usb5/5-2/5-2:1.0/tty/ttyACM0", +@@ -988,28 +978,6 @@ SUBSYSTEMS=="scsi", PROGRAM=="/bin/echo -n node link1 link2 link3 link4", RESULT + EOF + }, + { +- desc => "all_partitions, option-only rule", +- subsys => "block", +- devpath => "/devices/pci0000:00/0000:00:1f.2/host0/target0:0:0/0:0:0:0/block/sda", +- exp_name => "node6", +- exp_rem_error => "yes", +- rules => < "all_partitions, option-only rule (fail on partition)", +- subsys => "block", +- devpath => "/devices/pci0000:00/0000:00:1f.2/host0/target0:0:0/0:0:0:0/block/sda/sda1", +- exp_name => "node6", +- exp_add_error => "yes", +- rules => < "ignore remove event test", + subsys => "block", + devpath => "/devices/pci0000:00/0000:00:1f.2/host0/target0:0:0/0:0:0:0/block/sda", +@@ -1020,17 +988,6 @@ SUBSYSTEMS=="scsi", KERNEL=="sda", SYMLINK+="node", OPTIONS="ignore_remove" + EOF + }, + { +- desc => "ignore remove event test (with all partitions)", +- subsys => "block", +- devpath => "/devices/pci0000:00/0000:00:1f.2/host0/target0:0:0/0:0:0:0/block/sda", +- exp_name => "sda14", +- exp_rem_error => "yes", +- option => "clean", +- rules => < "SUBSYSTEM match test", + subsys => "block", + devpath => "/devices/pci0000:00/0000:00:1f.2/host0/target0:0:0/0:0:0:0/block/sda", +diff --git a/udev/udev-node.c b/udev/udev-node.c +index 3b4eb5f..4492c2e 100644 +--- a/udev/udev-node.c ++++ b/udev/udev-node.c +@@ -365,8 +365,6 @@ void udev_node_update_old_links(struct udev_device *dev, struct udev_device *dev + int udev_node_add(struct udev_device *dev, mode_t mode, uid_t uid, gid_t gid) + { + struct udev *udev = udev_device_get_udev(dev); +- int i; +- int num; + struct udev_list_entry *list_entry; + int err = 0; + +@@ -380,23 +378,6 @@ int udev_node_add(struct udev_device *dev, mode_t mode, uid_t uid, gid_t gid) + goto exit; + } + +- /* create all_partitions if requested */ +- num = udev_device_get_num_fake_partitions(dev); +- if (num > 0) { +- info(udev, "creating device partition nodes '%s[1-%i]'\n", udev_device_get_devnode(dev), num); +- for (i = 1; i <= num; i++) { +- char partitionname[UTIL_PATH_SIZE]; +- dev_t part_devnum; +- +- snprintf(partitionname, sizeof(partitionname), "%s%d", +- udev_device_get_devnode(dev), i); +- partitionname[sizeof(partitionname)-1] = '\0'; +- part_devnum = makedev(major(udev_device_get_devnum(dev)), +- minor(udev_device_get_devnum(dev)) + i); +- udev_node_mknod(dev, partitionname, part_devnum, mode, uid, gid); +- } +- } +- + /* create/update symlinks, add symlinks to name index */ + udev_list_entry_foreach(list_entry, udev_device_get_devlinks_list_entry(dev)) { + if (udev_list_entry_get_flags(list_entry)) +@@ -414,10 +395,8 @@ int udev_node_remove(struct udev_device *dev) + struct udev *udev = udev_device_get_udev(dev); + struct udev_list_entry *list_entry; + const char *devnode; +- char partitionname[UTIL_PATH_SIZE]; + struct stat stats; + int err = 0; +- int num; + + /* remove/update symlinks, remove symlinks from name index */ + udev_list_entry_foreach(list_entry, udev_device_get_devlinks_list_entry(dev)) +@@ -451,20 +430,6 @@ int udev_node_remove(struct udev_device *dev) + udev_device_unref(dev_check); + } + +- num = udev_device_get_num_fake_partitions(dev); +- if (num > 0) { +- int i; +- +- info(udev, "removing all_partitions '%s[1-%i]'\n", devnode, num); +- if (num > 255) +- return -1; +- for (i = 1; i <= num; i++) { +- snprintf(partitionname, sizeof(partitionname), "%s%d", devnode, i); +- partitionname[sizeof(partitionname)-1] = '\0'; +- util_unlink_secure(udev, partitionname); +- } +- } +- + util_delete_path(udev, devnode); + return err; + } +diff --git a/udev/udev-rules.c b/udev/udev-rules.c +index 0361f68..a4a86b6 100644 +--- a/udev/udev-rules.c ++++ b/udev/udev-rules.c +@@ -196,7 +196,6 @@ struct token { + mode_t mode; + uid_t uid; + gid_t gid; +- int num_fake_part; + int devlink_prio; + int event_timeout; + int watch; +@@ -371,9 +370,6 @@ static void dump_token(struct udev_rules *rules, struct token *token) + case TK_A_INOTIFY_WATCH: + dbg(rules->udev, "%s %u\n", token_str(type), token->key.watch); + break; +- case TK_A_NUM_FAKE_PART: +- dbg(rules->udev, "%s %u\n", token_str(type), token->key.num_fake_part); +- break; + case TK_A_DEVLINK_PRIO: + dbg(rules->udev, "%s %s %u\n", token_str(type), operation_str(op), token->key.devlink_prio); + break; +@@ -1469,12 +1465,6 @@ static int add_rule(struct udev_rules *rules, char *line, + rule_add_key(&rule_tmp, TK_A_NAME, op, value, NULL); + attr = get_key_attribute(rules->udev, key + sizeof("NAME")-1); + if (attr != NULL) { +- if (strstr(attr, "all_partitions") != NULL) { +- int num = DEFAULT_FAKE_PARTITIONS_COUNT; +- +- dbg(rules->udev, "creation of partition nodes requested\n"); +- rule_add_key(&rule_tmp, TK_A_NUM_FAKE_PART, 0, NULL, &num); +- } + if (strstr(attr, "ignore_remove") != NULL) { + dbg(rules->udev, "remove event should be ignored\n"); + rule_add_key(&rule_tmp, TK_A_IGNORE_REMOVE, 0, NULL, NULL); +@@ -1576,12 +1566,6 @@ static int add_rule(struct udev_rules *rules, char *line, + else if (strncmp(pos, "replace", strlen("replace")) == 0) + rule_add_key(&rule_tmp, TK_A_STRING_ESCAPE_REPLACE, 0, NULL, NULL); + } +- if (strstr(value, "all_partitions") != NULL) { +- int num = DEFAULT_FAKE_PARTITIONS_COUNT; +- +- rule_add_key(&rule_tmp, TK_A_NUM_FAKE_PART, 0, NULL, &num); +- dbg(rules->udev, "creation of partition nodes requested\n"); +- } + pos = strstr(value, "nowatch"); + if (pos != NULL) { + const int off = 0; +@@ -2331,13 +2315,6 @@ int udev_rules_apply_to_event(struct udev_rules *rules, struct udev_event *event + case TK_A_STRING_ESCAPE_REPLACE: + esc = ESCAPE_REPLACE; + break; +- case TK_A_NUM_FAKE_PART: +- if (strcmp(udev_device_get_subsystem(event->dev), "block") != 0) +- break; +- if (udev_device_get_sysnum(event->dev) != NULL) +- break; +- udev_device_set_num_fake_partitions(event->dev, cur->key.num_fake_part); +- break; + case TK_A_INOTIFY_WATCH: + event->inotify_watch = cur->key.watch; + break; +diff --git a/udev/udev.xml b/udev/udev.xml +index 175cdbe..9275e0f 100644 +--- a/udev/udev.xml ++++ b/udev/udev.xml +@@ -450,14 +450,6 @@ + + + +- +- +- Create the device nodes for all available partitions of a block device. +- This may be useful for removable media devices where media changes are not +- detected. +- +- +- + + + Number of seconds an event will wait for operations to finish, before it +diff --git a/udev/udevadm-info.c b/udev/udevadm-info.c +index 4711409..c57620f 100644 +--- a/udev/udevadm-info.c ++++ b/udev/udevadm-info.c +@@ -142,10 +142,6 @@ static void print_record(struct udev_device *device) + if (i != 0) + printf("L: %i\n", i); + +- i = udev_device_get_num_fake_partitions(device); +- if (i != 0) +- printf("A: %u\n", i); +- + i = udev_device_get_ignore_remove(device); + if (i != 0) + printf("R: %u\n", i); +-- +1.6.6 + diff --git a/0062-cdrom_id-Fix-uninitialized-variables.patch b/0062-cdrom_id-Fix-uninitialized-variables.patch new file mode 100644 index 0000000..1caba57 --- /dev/null +++ b/0062-cdrom_id-Fix-uninitialized-variables.patch @@ -0,0 +1,131 @@ +From 816e6bf0fb0849d03696a4b4ec2334e35e819425 Mon Sep 17 00:00:00 2001 +From: Martin Pitt +Date: Tue, 13 Apr 2010 10:49:24 +0200 +Subject: [PATCH 62/65] cdrom_id: Fix uninitialized variables + +In cases where cdrom_id does not go through the entire code path and one of the +probing functions returns -1 or exits early, the remaining variables were never +initialized. This caused effects like "phantom" audio CDs on empty drives, or +bogus data like ID_CDROM_MEDIA_TRACK_COUNT=22528. + +Initialize the variables right away to avoid that. + +Bug-Ubuntu: https://launchpad.net/bugs/559723 +--- + extras/cdrom_id/cdrom_id.c | 96 ++++++++++++++++++++++---------------------- + 1 files changed, 48 insertions(+), 48 deletions(-) + +diff --git a/extras/cdrom_id/cdrom_id.c b/extras/cdrom_id/cdrom_id.c +index 894a890..db3867c 100644 +--- a/extras/cdrom_id/cdrom_id.c ++++ b/extras/cdrom_id/cdrom_id.c +@@ -56,57 +56,57 @@ static void log_fn(struct udev *udev, int priority, + } + + /* device info */ +-static unsigned int cd_cd_rom; +-static unsigned int cd_cd_r; +-static unsigned int cd_cd_rw; +-static unsigned int cd_dvd_rom; +-static unsigned int cd_dvd_r; +-static unsigned int cd_dvd_rw; +-static unsigned int cd_dvd_ram; +-static unsigned int cd_dvd_plus_r; +-static unsigned int cd_dvd_plus_rw; +-static unsigned int cd_dvd_plus_r_dl; +-static unsigned int cd_dvd_plus_rw_dl; +-static unsigned int cd_bd; +-static unsigned int cd_bd_r; +-static unsigned int cd_bd_re; +-static unsigned int cd_hddvd; +-static unsigned int cd_hddvd_r; +-static unsigned int cd_hddvd_rw; +-static unsigned int cd_mo; +-static unsigned int cd_mrw; +-static unsigned int cd_mrw_w; ++static unsigned int cd_cd_rom = 0; ++static unsigned int cd_cd_r = 0; ++static unsigned int cd_cd_rw = 0; ++static unsigned int cd_dvd_rom = 0; ++static unsigned int cd_dvd_r = 0; ++static unsigned int cd_dvd_rw = 0; ++static unsigned int cd_dvd_ram = 0; ++static unsigned int cd_dvd_plus_r = 0; ++static unsigned int cd_dvd_plus_rw = 0; ++static unsigned int cd_dvd_plus_r_dl = 0; ++static unsigned int cd_dvd_plus_rw_dl = 0; ++static unsigned int cd_bd = 0; ++static unsigned int cd_bd_r = 0; ++static unsigned int cd_bd_re = 0; ++static unsigned int cd_hddvd = 0; ++static unsigned int cd_hddvd_r = 0; ++static unsigned int cd_hddvd_rw = 0; ++static unsigned int cd_mo = 0; ++static unsigned int cd_mrw = 0; ++static unsigned int cd_mrw_w = 0; + + /* media info */ +-static unsigned int cd_media; +-static unsigned int cd_media_cd_rom; +-static unsigned int cd_media_cd_r; +-static unsigned int cd_media_cd_rw; +-static unsigned int cd_media_dvd_rom; +-static unsigned int cd_media_dvd_r; +-static unsigned int cd_media_dvd_rw; +-static unsigned int cd_media_dvd_ram; +-static unsigned int cd_media_dvd_plus_r; +-static unsigned int cd_media_dvd_plus_rw; +-static unsigned int cd_media_dvd_plus_r_dl; +-static unsigned int cd_media_dvd_plus_rw_dl; +-static unsigned int cd_media_bd; +-static unsigned int cd_media_bd_r; +-static unsigned int cd_media_bd_re; +-static unsigned int cd_media_hddvd; +-static unsigned int cd_media_hddvd_r; +-static unsigned int cd_media_hddvd_rw; +-static unsigned int cd_media_mo; +-static unsigned int cd_media_mrw; +-static unsigned int cd_media_mrw_w; +- +-static const char *cd_media_state; +-static unsigned int cd_media_session_next; +-static unsigned int cd_media_session_count; +-static unsigned int cd_media_track_count; +-static unsigned int cd_media_track_count_data; +-static unsigned int cd_media_track_count_audio; +-static unsigned long long int cd_media_session_last_offset; ++static unsigned int cd_media = 0; ++static unsigned int cd_media_cd_rom = 0; ++static unsigned int cd_media_cd_r = 0; ++static unsigned int cd_media_cd_rw = 0; ++static unsigned int cd_media_dvd_rom = 0; ++static unsigned int cd_media_dvd_r = 0; ++static unsigned int cd_media_dvd_rw = 0; ++static unsigned int cd_media_dvd_ram = 0; ++static unsigned int cd_media_dvd_plus_r = 0; ++static unsigned int cd_media_dvd_plus_rw = 0; ++static unsigned int cd_media_dvd_plus_r_dl = 0; ++static unsigned int cd_media_dvd_plus_rw_dl = 0; ++static unsigned int cd_media_bd = 0; ++static unsigned int cd_media_bd_r = 0; ++static unsigned int cd_media_bd_re = 0; ++static unsigned int cd_media_hddvd = 0; ++static unsigned int cd_media_hddvd_r = 0; ++static unsigned int cd_media_hddvd_rw = 0; ++static unsigned int cd_media_mo = 0; ++static unsigned int cd_media_mrw = 0; ++static unsigned int cd_media_mrw_w = 0; ++ ++static const char *cd_media_state = NULL; ++static unsigned int cd_media_session_next = 0; ++static unsigned int cd_media_session_count = 0; ++static unsigned int cd_media_track_count = 0; ++static unsigned int cd_media_track_count_data = 0; ++static unsigned int cd_media_track_count_audio = 0; ++static unsigned long long int cd_media_session_last_offset = 0; + + #define ERRCODE(s) ((((s)[2] & 0x0F) << 16) | ((s)[12] << 8) | ((s)[13])) + #define SK(errcode) (((errcode) >> 16) & 0xF) +-- +1.6.6 + diff --git a/0063-rules-call-modprobe-on-all-events-but-remove.patch b/0063-rules-call-modprobe-on-all-events-but-remove.patch new file mode 100644 index 0000000..97ce921 --- /dev/null +++ b/0063-rules-call-modprobe-on-all-events-but-remove.patch @@ -0,0 +1,36 @@ +From 06ba47d8336c6d017a67d11f480341db07b9bc4b Mon Sep 17 00:00:00 2001 +From: Kay Sievers +Date: Tue, 13 Apr 2010 12:12:08 +0200 +Subject: [PATCH 63/65] rules: call modprobe on all events but "remove" + +--- + rules/rules.d/50-udev-default.rules | 3 --- + rules/rules.d/80-drivers.rules | 2 +- + 2 files changed, 1 insertions(+), 4 deletions(-) + +diff --git a/rules/rules.d/50-udev-default.rules b/rules/rules.d/50-udev-default.rules +index a5f0823..7e09ea1 100644 +--- a/rules/rules.d/50-udev-default.rules ++++ b/rules/rules.d/50-udev-default.rules +@@ -112,6 +112,3 @@ SUBSYSTEM=="rtc", DRIVERS=="rtc_cmos", SYMLINK+="rtc" + KERNEL=="mmtimer", MODE="0644" + KERNEL=="rflash[0-9]*", MODE="0400" + KERNEL=="rrom[0-9]*", MODE="0400" +- +-# do not delete static device nodes +-ACTION=="remove", NAME=="", TEST=="/lib/udev/devices/%k", OPTIONS+="ignore_remove" +diff --git a/rules/rules.d/80-drivers.rules b/rules/rules.d/80-drivers.rules +index d0485e1..86eb918 100644 +--- a/rules/rules.d/80-drivers.rules ++++ b/rules/rules.d/80-drivers.rules +@@ -1,6 +1,6 @@ + # do not edit this file, it will be overwritten on update + +-ACTION!="add", GOTO="drivers_end" ++ACTION=="remove", GOTO="drivers_end" + + DRIVER!="?*", ENV{MODALIAS}=="?*", RUN+="/sbin/modprobe -b $env{MODALIAS}" + SUBSYSTEM=="tifm", ENV{TIFM_CARD_TYPE}=="SD", RUN+="/sbin/modprobe -b tifm_sd" +-- +1.6.6 + diff --git a/0064-remove-ignore_remove-option.patch b/0064-remove-ignore_remove-option.patch new file mode 100644 index 0000000..a1e8046 --- /dev/null +++ b/0064-remove-ignore_remove-option.patch @@ -0,0 +1,273 @@ +From a89d342dfb45b54e29381af9dbc495bbb2b057af Mon Sep 17 00:00:00 2001 +From: Kay Sievers +Date: Tue, 13 Apr 2010 12:45:38 +0200 +Subject: [PATCH 64/65] remove "ignore_remove" option + +--- + NEWS | 6 ++++++ + libudev/libudev-device-private.c | 4 ---- + libudev/libudev-device.c | 17 ----------------- + libudev/libudev-private.h | 2 -- + test/udev-test.pl | 10 ---------- + udev/udev-node.c | 38 ++++++++++++++++++++++---------------- + udev/udev-rules.c | 14 -------------- + udev/udev.xml | 7 ------- + udev/udevadm-info.c | 4 ---- + 9 files changed, 28 insertions(+), 74 deletions(-) + +diff --git a/NEWS b/NEWS +index c422eaa..ea5c19d 100644 +--- a/NEWS ++++ b/NEWS +@@ -10,6 +10,12 @@ needed for usual hardware. Udev can not safely make assumptions + about non-exixting partition major/minor numbers, and therefore no + longer provide such an unreliable and unsafe option. + ++The option "ignore_remove" was removed from udev. With devtmpfs ++udev passed control over device nodes to the kernel. This option ++should no longer be needed, or can not work as advertised. Neither ++udev nor the kernel will remove device nodes which are copied from ++the /lib/udev/devices/ directory. ++ + All "add|change" matches are replaced by "!remove" in the rules and + in the udev logic. All types of events will update possible symlinks + and permissions, only "remove" is handled special now. +diff --git a/libudev/libudev-device-private.c b/libudev/libudev-device-private.c +index 19c20b2..5e4381e 100644 +--- a/libudev/libudev-device-private.c ++++ b/libudev/libudev-device-private.c +@@ -41,8 +41,6 @@ int udev_device_update_db(struct udev_device *udev_device) + udev_list_entry_foreach(list_entry, udev_device_get_properties_list_entry(udev_device)) + if (udev_list_entry_get_flags(list_entry)) + goto file; +- if (udev_device_get_ignore_remove(udev_device)) +- goto file; + if (udev_device_get_devlink_priority(udev_device) != 0) + goto file; + if (udev_device_get_event_timeout(udev_device) >= 0) +@@ -93,8 +91,6 @@ file: + fprintf(f, "L:%i\n", udev_device_get_devlink_priority(udev_device)); + if (udev_device_get_event_timeout(udev_device) >= 0) + fprintf(f, "T:%i\n", udev_device_get_event_timeout(udev_device)); +- if (udev_device_get_ignore_remove(udev_device)) +- fprintf(f, "R:%i\n", udev_device_get_ignore_remove(udev_device)); + if (udev_device_get_watch_handle(udev_device) >= 0) + fprintf(f, "W:%i\n", udev_device_get_watch_handle(udev_device)); + udev_list_entry_foreach(list_entry, udev_device_get_properties_list_entry(udev_device)) { +diff --git a/libudev/libudev-device.c b/libudev/libudev-device.c +index 75cc61c..b3b6a63 100644 +--- a/libudev/libudev-device.c ++++ b/libudev/libudev-device.c +@@ -75,7 +75,6 @@ struct udev_device { + unsigned int envp_uptodate:1; + unsigned int driver_set:1; + unsigned int info_loaded:1; +- unsigned int ignore_remove:1; + }; + + struct udev_list_entry *udev_device_add_property(struct udev_device *udev_device, const char *key, const char *value) +@@ -283,9 +282,6 @@ int udev_device_read_db(struct udev_device *udev_device) + case 'T': + udev_device_set_event_timeout(udev_device, atoi(val)); + break; +- case 'R': +- udev_device_set_ignore_remove(udev_device, atoi(val)); +- break; + case 'E': + udev_device_add_property_from_string(udev_device, val); + break; +@@ -1434,19 +1430,6 @@ int udev_device_set_devlink_priority(struct udev_device *udev_device, int prio) + return 0; + } + +-int udev_device_get_ignore_remove(struct udev_device *udev_device) +-{ +- if (!udev_device->info_loaded) +- device_load_info(udev_device); +- return udev_device->ignore_remove; +-} +- +-int udev_device_set_ignore_remove(struct udev_device *udev_device, int ignore) +-{ +- udev_device->ignore_remove = ignore; +- return 0; +-} +- + int udev_device_get_watch_handle(struct udev_device *udev_device) + { + if (!udev_device->info_loaded) +diff --git a/libudev/libudev-private.h b/libudev/libudev-private.h +index bf9e923..8dc469e 100644 +--- a/libudev/libudev-private.h ++++ b/libudev/libudev-private.h +@@ -95,8 +95,6 @@ int udev_device_set_devnum(struct udev_device *udev_device, dev_t devnum); + int udev_device_set_seqnum(struct udev_device *udev_device, unsigned long long int seqnum); + int udev_device_get_devlink_priority(struct udev_device *udev_device); + int udev_device_set_devlink_priority(struct udev_device *udev_device, int prio); +-int udev_device_get_ignore_remove(struct udev_device *udev_device); +-int udev_device_set_ignore_remove(struct udev_device *udev_device, int ignore); + int udev_device_get_watch_handle(struct udev_device *udev_device); + int udev_device_set_watch_handle(struct udev_device *udev_device, int handle); + void udev_device_set_info_loaded(struct udev_device *device); +diff --git a/test/udev-test.pl b/test/udev-test.pl +index 4633d6b..a4d3a72 100755 +--- a/test/udev-test.pl ++++ b/test/udev-test.pl +@@ -978,16 +978,6 @@ SUBSYSTEMS=="scsi", PROGRAM=="/bin/echo -n node link1 link2 link3 link4", RESULT + EOF + }, + { +- desc => "ignore remove event test", +- subsys => "block", +- devpath => "/devices/pci0000:00/0000:00:1f.2/host0/target0:0:0/0:0:0:0/block/sda", +- exp_name => "node", +- exp_rem_error => "yes", +- rules => < "SUBSYSTEM match test", + subsys => "block", + devpath => "/devices/pci0000:00/0000:00:1f.2/host0/target0:0:0/0:0:0:0/block/sda", +diff --git a/udev/udev-node.c b/udev/udev-node.c +index 4492c2e..34de268 100644 +--- a/udev/udev-node.c ++++ b/udev/udev-node.c +@@ -396,6 +396,8 @@ int udev_node_remove(struct udev_device *dev) + struct udev_list_entry *list_entry; + const char *devnode; + struct stat stats; ++ struct udev_device *dev_check; ++ char filename[UTIL_PATH_SIZE]; + int err = 0; + + /* remove/update symlinks, remove symlinks from name index */ +@@ -404,32 +406,36 @@ int udev_node_remove(struct udev_device *dev) + + devnode = udev_device_get_devnode(dev); + if (devnode == NULL) +- return 0; ++ goto out; ++ + if (stat(devnode, &stats) != 0) { + info(udev, "device node '%s' not found\n", devnode); +- return 0; ++ goto out; + } ++ + if (stats.st_rdev != udev_device_get_devnum(dev)) { + info(udev, "device node '%s' points to a different device, skip removal\n", devnode); +- return -1; ++ err = -1; ++ goto out; + } + +- if (udev_device_get_ignore_remove(dev)) { +- info(udev, "ignore_remove for '%s'\n", udev_device_get_devnode(dev)); +- } else { +- struct udev_device *dev_check; +- +- dev_check = udev_device_new_from_syspath(udev, udev_device_get_syspath(dev)); +- if (dev_check != NULL && stats.st_rdev == udev_device_get_devnum(dev_check)) { +- /* do not remove device node if the same sys-device is re-created in the meantime */ +- info(udev, "keeping device node of existing device'%s'\n", devnode); +- } else { +- info(udev, "removing device node '%s'\n", devnode); +- err = util_unlink_secure(udev, devnode); +- } ++ dev_check = udev_device_new_from_syspath(udev, udev_device_get_syspath(dev)); ++ if (dev_check != NULL) { ++ /* do not remove device node if the same sys-device is re-created in the meantime */ ++ info(udev, "keeping device node of existing device'%s'\n", devnode); + udev_device_unref(dev_check); ++ goto out; ++ } ++ ++ util_strscpyl(filename, sizeof(filename), LIBEXECDIR "/devices", &devnode[strlen(udev_get_dev_path(udev))], NULL); ++ if (stat(filename, &stats) == 0 || stats.st_rdev == udev_device_get_devnum(dev)) { ++ info(udev, "static device entry found '%s', skip removal\n", devnode); ++ goto out; + } + ++ info(udev, "removing device node '%s'\n", devnode); ++ err = util_unlink_secure(udev, devnode); + util_delete_path(udev, devnode); ++out: + return err; + } +diff --git a/udev/udev-rules.c b/udev/udev-rules.c +index a4a86b6..4f18aca 100644 +--- a/udev/udev-rules.c ++++ b/udev/udev-rules.c +@@ -1463,13 +1463,6 @@ static int add_rule(struct udev_rules *rules, char *line, + err(rules->udev, "NAME=\"%%k\" is superfluous and breaks " + "kernel supplied names, please remove it from %s:%u\n", filename, lineno); + rule_add_key(&rule_tmp, TK_A_NAME, op, value, NULL); +- attr = get_key_attribute(rules->udev, key + sizeof("NAME")-1); +- if (attr != NULL) { +- if (strstr(attr, "ignore_remove") != NULL) { +- dbg(rules->udev, "remove event should be ignored\n"); +- rule_add_key(&rule_tmp, TK_A_IGNORE_REMOVE, 0, NULL, NULL); +- } +- } + } + rule_tmp.rule.rule.flags = 1; + continue; +@@ -1540,10 +1533,6 @@ static int add_rule(struct udev_rules *rules, char *line, + if (strcmp(key, "OPTIONS") == 0) { + const char *pos; + +- if (strstr(value, "ignore_remove") != NULL) { +- dbg(rules->udev, "remove event should be ignored\n"); +- rule_add_key(&rule_tmp, TK_A_IGNORE_REMOVE, 0, NULL, NULL); +- } + pos = strstr(value, "link_priority="); + if (pos != NULL) { + int prio = atoi(&pos[strlen("link_priority=")]); +@@ -2501,9 +2490,6 @@ int udev_rules_apply_to_event(struct udev_rules *rules, struct udev_event *event + case TK_A_EVENT_TIMEOUT: + udev_device_set_event_timeout(event->dev, cur->key.event_timeout); + break; +- case TK_A_IGNORE_REMOVE: +- udev_device_set_ignore_remove(event->dev, 1); +- break; + case TK_A_ATTR: + { + const char *key_name = &rules->buf[cur->key.attr_off]; +diff --git a/udev/udev.xml b/udev/udev.xml +index 9275e0f..dce953d 100644 +--- a/udev/udev.xml ++++ b/udev/udev.xml +@@ -436,13 +436,6 @@ + Rule and device options: + + +- +- +- Do not remove the device node when the device goes away. This may be +- useful as a workaround for broken device drivers. +- +- +- + + + Specify the priority of the created symlinks. Devices with higher +diff --git a/udev/udevadm-info.c b/udev/udevadm-info.c +index c57620f..5f6209a 100644 +--- a/udev/udevadm-info.c ++++ b/udev/udevadm-info.c +@@ -142,10 +142,6 @@ static void print_record(struct udev_device *device) + if (i != 0) + printf("L: %i\n", i); + +- i = udev_device_get_ignore_remove(device); +- if (i != 0) +- printf("R: %u\n", i); +- + i = udev_device_get_watch_handle(device); + if (i >= 0) + printf("W: %u\n", i); +-- +1.6.6 + diff --git a/0065-cdrom_id-Fix-uninitialized-buffers.patch b/0065-cdrom_id-Fix-uninitialized-buffers.patch new file mode 100644 index 0000000..310e3c6 --- /dev/null +++ b/0065-cdrom_id-Fix-uninitialized-buffers.patch @@ -0,0 +1,82 @@ +From 2b861dc92757b9a3214c2b8e9d8b1c3f3c162391 Mon Sep 17 00:00:00 2001 +From: Martin Pitt +Date: Tue, 13 Apr 2010 15:25:48 +0200 +Subject: [PATCH 65/65] cdrom_id: Fix uninitialized buffers + +Commit 5c6954f is actually a no-op, since static variables are already zero'ed +by default anyway (but we keep it for clarity). The real difference was that a +build with -O0 wor while a build with -O2 didn't. + +Turns out that some ioctls do not actually touch the result buffer in some +cases, so we need to zero the result buffers to avoid interpreting random da as +CD properties. + +https://launchpad.net/bugs/559723 +https://launchpad.net/bugs/561585 +--- + extras/cdrom_id/cdrom_id.c | 7 +++++++ + 1 files changed, 7 insertions(+), 0 deletions(-) + +diff --git a/extras/cdrom_id/cdrom_id.c b/extras/cdrom_id/cdrom_id.c +index db3867c..b6797cd 100644 +--- a/extras/cdrom_id/cdrom_id.c ++++ b/extras/cdrom_id/cdrom_id.c +@@ -237,6 +237,7 @@ static int cd_inquiry(struct udev *udev, int fd) { + unsigned char inq[128]; + int err; + ++ memset (inq, 0, sizeof (inq)); + scsi_cmd_set(udev, &sc, 0, 0x12); + scsi_cmd_set(udev, &sc, 4, 36); + scsi_cmd_set(udev, &sc, 5, 0); +@@ -265,6 +266,7 @@ static int cd_profiles(struct udev *udev, int fd) + unsigned int i; + int err; + ++ memset (header, 0, sizeof (header)); + scsi_cmd_set(udev, &sc, 0, 0x46); + scsi_cmd_set(udev, &sc, 1, 0); + scsi_cmd_set(udev, &sc, 8, sizeof(header)); +@@ -282,6 +284,7 @@ static int cd_profiles(struct udev *udev, int fd) + return -1; + } + ++ memset (profiles, 0, sizeof (profiles)); + scsi_cmd_set(udev, &sc, 0, 0x46); + scsi_cmd_set(udev, &sc, 1, 1); + scsi_cmd_set(udev, &sc, 6, len >> 16); +@@ -440,6 +443,7 @@ static int cd_media_info(struct udev *udev, int fd) + }; + int err; + ++ memset (header, 0, sizeof (header)); + scsi_cmd_set(udev, &sc, 0, 0x51); + scsi_cmd_set(udev, &sc, 8, sizeof(header)); + scsi_cmd_set(udev, &sc, 9, 0); +@@ -472,6 +476,7 @@ static int cd_media_toc(struct udev *udev, int fd) + unsigned char *p; + int err; + ++ memset (header, 0, sizeof (header)); + scsi_cmd_set(udev, &sc, 0, 0x43); + scsi_cmd_set(udev, &sc, 6, 1); + scsi_cmd_set(udev, &sc, 8, sizeof(header)); +@@ -493,6 +498,7 @@ static int cd_media_toc(struct udev *udev, int fd) + if (len < 8) + return 0; + ++ memset (toc, 0, sizeof (toc)); + scsi_cmd_set(udev, &sc, 0, 0x43); + scsi_cmd_set(udev, &sc, 6, header[2]); /* First Track/Session Number */ + scsi_cmd_set(udev, &sc, 7, len >> 8); +@@ -520,6 +526,7 @@ static int cd_media_toc(struct udev *udev, int fd) + cd_media_track_count_audio++; + } + ++ memset (header, 0, sizeof (header)); + scsi_cmd_set(udev, &sc, 0, 0x43); + scsi_cmd_set(udev, &sc, 2, 1); /* Session Info */ + scsi_cmd_set(udev, &sc, 8, 12); +-- +1.6.6 + diff --git a/udev.spec b/udev.spec index 8a5922e..60d3651 100644 --- a/udev.spec +++ b/udev.spec @@ -12,7 +12,8 @@ Provides: udev-persistent = %{version}-%{release} Obsoletes: udev-persistent < 0:030-5 Obsoletes: udev-extras < 20090618 Provides: udev-extras = 20090618-1 -Source: ftp://ftp.kernel.org/pub/linux/utils/kernel/hotplug/%{name}-%{version}.tar.bz2 +#Source: ftp://ftp.kernel.org/pub/linux/utils/kernel/hotplug/%{name}-%{version}.tar.bz2 +Source: ftp://ftp.kernel.org/pub/linux/utils/kernel/hotplug/%{name}-151.tar.bz2 Patch1: 0001-firmware-fix-error-reporting-on-missing-firmware-fil.patch Patch2: 0002-keymap-Add-Dell-Inspiron-1011-Mini-10.patch @@ -176,7 +177,7 @@ This package contains the header and pkg-config files for developing glib-based applications using libudev functionality. %prep -%setup -q +%setup -q -n udev-151 %patch1 -p1 -b .git1 %patch2 -p1 -b .git2 From 31132ed7f529b2baa23b80286c9665fe3e993f53 Mon Sep 17 00:00:00 2001 From: Harald Hoyer Date: Tue, 27 Apr 2010 10:29:33 +0000 Subject: [PATCH 061/142] - version 153 --- .cvsignore | 2 +- 0001-configure.ac-version-bump.patch | 34 + ...or-reporting-on-missing-firmware-fil.patch | 43 - ...eymap-Add-Dell-Inspiron-1011-Mini-10.patch | 26 - ...buffer-overrun-risk-in-readlink-call.patch | 32 + ...ix-brightness-keys-on-MSI-Wind-U-100.patch | 37 - 0003-more-readlink-buffer-size-handling.patch | 113 + ...ort-for-Gateway-AOA110-AOA150-clones.patch | 29 - ...-from-ignore_remove-and-all_partitio.patch | 73 + 0005-fix-previous-commit.patch | 33 + 0005-keymap-Fix-LG-X110.patch | 64 - ...-not-releasing-for-Pegatron-platform.patch | 29 + ...e-for-volume-keys-on-Dell-Studio-155.patch | 55 - 0007-keymap-Add-Toshiba-Satellite-M30X.patch | 55 - ...export-db-remove-watch-handle-export.patch | 27 + ...ve-event-filtering-and-device-enumer.patch | 1706 +++++++++++++ ...udev_monitor_set_receive_buffer_size.patch | 58 - 0009-all-to-match-against-a-given-TAG.patch | 101 + ...monitor-increase-netlink-buffer-size.patch | 37 - 0010-libudev-bump-minor-version.patch | 29 - ...ag-instead-of-a-property-to-mark-dev.patch | 125 + ...mand-loading-logic-for-db-and-uevent.patch | 49 + ...sted-and-broken-commit-to-set-buffer.patch | 25 - 0012-configure.ac-version-bump.patch | 37 - 0012-use-the-usual-TAG-TAG-logic.patch | 129 + ...-old-tags-when-configuration-changes.patch | 168 ++ ...amsung-Q210-P210-force-release-quirk.patch | 30 - ...tsu-Amilo-1848-u-force-release-quirk.patch | 53 - ...ULL-in-udev_device_get_tags_list_ent.patch | 39 + ...er-size-when-advancing-past-NUL-byte.patch | 29 - 0015-export-tag-functions.patch | 24 + ...ZE-not-UTIL_PATH_SIZE-to-truncate-pr.patch | 26 - ...port-udev_device_get_tags_list_entry.patch | 50 + ...se-UTIL_LINE_SIZE-from-2048-to-16384.patch | 37 - ...e-firmware-path-setting-out-of-extra.patch | 68 + ...rts-rule-to-use-attr-instead-of-ATTR.patch | 29 - ...luetooth-key-on-Acer-TravelMate-4720.patch | 22 +- ...cl-Correctly-handle-ENV-ACL_MANAGE-0.patch | 47 - ...-to-find-an-idle-worker-instead-of-f.patch | 58 + ...encourage-use-of-ACL_MANAGE-outside-.patch | 27 - 0021-input_id-Fix-linking.patch | 27 - 0022-replace-utimes-with-utimensat.patch | 34 - ...vate-rename-udev_list_entry_get_flag.patch | 212 -- ...use-as-separator-in-subsystem-match-.patch | 65 - ...as-entries-in-symlink-stack-instead-.patch | 81 - ...-minor-as-entries-in-watch-directory.patch | 120 - 0028-udev-needs-automake-1.10.patch | 28 - ...sible-segfault-when-firmware-device-.patch | 40 - ...create-by-path-links-for-pci-devices.patch | 25 - ...gitech-bluetooth-adapters-into-hci-m.patch | 29 - ...inux-context-when-the-node-was-not-t.patch | 88 - ...add-udev_device_new_from_environment.patch | 480 ---- ...on-mounted-optical-media-with-O_EXCL.patch | 58 - ...-into-tool-that-only-switches-Mobile.patch | 2142 ----------------- ...-is-to-check-if-the-name-attribute-i.patch | 28 - ...TravelMate-6593G-and-Acer-Aspire-164.patch | 25 - 0040-libudev-update-documentation.patch | 108 - ...Keymapping-for-upcoming-Dell-Laptops.patch | 50 - 0042-Add-new-Dell-touchpad-keycode.patch | 32 - ...cial-casing-0xD8-to-latitude-XT-only.patch | 42 - ...tudio-1558-volume-keys-not-releasing.patch | 30 - ...for-another-Dell-touchpad-toggle-key.patch | 29 - 0047-scsi_id-add-rand-in-retry-loop.patch | 45 - 0048-cdrom_id-remove-debugging-code.patch | 24 - ...id-retry-to-open-the-device-if-EBUSY.patch | 53 - ...m_id-check-mount-state-in-retry-loop.patch | 55 - ...set-ID_CDROM-regardless-if-we-can-ru.patch | 31 - ...ules-delete-outdated-packagees-rules.patch | 124 - ...have-static-devices-which-are-rename.patch | 21 - 0054-unify-cleanup-event-handling.patch | 362 --- 0055-allow-IMPORT-db-KEY.patch | 109 - 0056-usb-db-remove-double.patch | 31 - 0057-replace-add-change-with-remove.patch | 276 --- 0058-update-NEWS.patch | 30 - ...-only-if-we-actually-delete-the-node.patch | 27 - ...switch-default-action-from-add-to-ch.patch | 49 - 0061-remove-all_partitions-option.patch | 363 --- ...cdrom_id-Fix-uninitialized-variables.patch | 131 - ...ll-modprobe-on-all-events-but-remove.patch | 36 - 0064-remove-ignore_remove-option.patch | 273 --- 0065-cdrom_id-Fix-uninitialized-buffers.patch | 82 - sources | 2 +- start_udev | 2 +- ...dev-and-GUdev.patch => udev-153-LGPL.patch | 17 +- ...-145.tar.bz2.sign => udev-153.tar.bz2.sign | 6 +- udev.spec | 146 +- 86 files changed, 2908 insertions(+), 6815 deletions(-) create mode 100644 0001-configure.ac-version-bump.patch delete mode 100644 0001-firmware-fix-error-reporting-on-missing-firmware-fil.patch delete mode 100644 0002-keymap-Add-Dell-Inspiron-1011-Mini-10.patch create mode 100644 0002-remove-buffer-overrun-risk-in-readlink-call.patch delete mode 100644 0003-Fix-brightness-keys-on-MSI-Wind-U-100.patch create mode 100644 0003-more-readlink-buffer-size-handling.patch delete mode 100644 0004-keymap-Add-support-for-Gateway-AOA110-AOA150-clones.patch create mode 100644 0004-remove-left-over-from-ignore_remove-and-all_partitio.patch create mode 100644 0005-fix-previous-commit.patch delete mode 100644 0005-keymap-Fix-LG-X110.patch create mode 100644 0006-Fix-volume-keys-not-releasing-for-Pegatron-platform.patch delete mode 100644 0006-Force-key-release-for-volume-keys-on-Dell-Studio-155.patch delete mode 100644 0007-keymap-Add-Toshiba-Satellite-M30X.patch create mode 100644 0007-udevadm-info-export-db-remove-watch-handle-export.patch create mode 100644 0008-add-TAG-to-improve-event-filtering-and-device-enumer.patch delete mode 100644 0008-libudev-export-udev_monitor_set_receive_buffer_size.patch create mode 100644 0009-all-to-match-against-a-given-TAG.patch delete mode 100644 0009-udevadm-monitor-increase-netlink-buffer-size.patch delete mode 100644 0010-libudev-bump-minor-version.patch create mode 100644 0010-udev-acl-use-a-tag-instead-of-a-property-to-mark-dev.patch create mode 100644 0011-fix-logic-on-demand-loading-logic-for-db-and-uevent.patch delete mode 100644 0011-udevadm-fix-untested-and-broken-commit-to-set-buffer.patch delete mode 100644 0012-configure.ac-version-bump.patch create mode 100644 0012-use-the-usual-TAG-TAG-logic.patch create mode 100644 0013-delete-old-tags-when-configuration-changes.patch delete mode 100644 0013-keymap-Add-Samsung-Q210-P210-force-release-quirk.patch delete mode 100644 0014-keymap-Add-Fujitsu-Amilo-1848-u-force-release-quirk.patch create mode 100644 0014-libudev-accept-NULL-in-udev_device_get_tags_list_ent.patch delete mode 100644 0015-Decrease-buffer-size-when-advancing-past-NUL-byte.patch create mode 100644 0015-export-tag-functions.patch delete mode 100644 0016-Use-UTIL_LINE_SIZE-not-UTIL_PATH_SIZE-to-truncate-pr.patch create mode 100644 0016-export-udev_device_get_tags_list_entry.patch delete mode 100644 0017-Increase-UTIL_LINE_SIZE-from-2048-to-16384.patch create mode 100644 0017-configure.ac-move-firmware-path-setting-out-of-extra.patch delete mode 100644 0018-Fix-virtio-ports-rule-to-use-attr-instead-of-ATTR.patch rename 0039-keymap-Fix-another-key-for-Acer-TravelMate-6593.patch => 0018-keymap-Fix-Bluetooth-key-on-Acer-TravelMate-4720.patch (69%) delete mode 100644 0019-udev-acl-Correctly-handle-ENV-ACL_MANAGE-0.patch create mode 100644 0019-udevd-always-try-to-find-an-idle-worker-instead-of-f.patch delete mode 100644 0020-udev-acl-no-not-encourage-use-of-ACL_MANAGE-outside-.patch delete mode 100644 0021-input_id-Fix-linking.patch delete mode 100644 0022-replace-utimes-with-utimensat.patch delete mode 100644 0023-libbudev-private-rename-udev_list_entry_get_flag.patch delete mode 100644 0024-udevadm-monitor-use-as-separator-in-subsystem-match-.patch delete mode 100644 0025-use-major-minor-as-entries-in-symlink-stack-instead-.patch delete mode 100644 0026-use-major-minor-as-entries-in-watch-directory.patch delete mode 100644 0028-udev-needs-automake-1.10.patch delete mode 100644 0029-firmware-fix-possible-segfault-when-firmware-device-.patch delete mode 100644 0030-rules-input-create-by-path-links-for-pci-devices.patch delete mode 100644 0031-Fix-switching-Logitech-bluetooth-adapters-into-hci-m.patch delete mode 100644 0032-do-not-reset-SELinux-context-when-the-node-was-not-t.patch delete mode 100644 0033-libudev-add-udev_device_new_from_environment.patch delete mode 100644 0035-cdrom_id-open-non-mounted-optical-media-with-O_EXCL.patch delete mode 100644 0036-modeswitch-morph-into-tool-that-only-switches-Mobile.patch delete mode 100644 0037-rules-virtio-fix-is-to-check-if-the-name-attribute-i.patch delete mode 100644 0038-keymap-Add-Acer-TravelMate-6593G-and-Acer-Aspire-164.patch delete mode 100644 0040-libudev-update-documentation.patch delete mode 100644 0041-Fix-Keymapping-for-upcoming-Dell-Laptops.patch delete mode 100644 0042-Add-new-Dell-touchpad-keycode.patch delete mode 100644 0043-Revert-special-casing-0xD8-to-latitude-XT-only.patch delete mode 100644 0044-Fix-Dell-Studio-1558-volume-keys-not-releasing.patch delete mode 100644 0045-Add-support-for-another-Dell-touchpad-toggle-key.patch delete mode 100644 0047-scsi_id-add-rand-in-retry-loop.patch delete mode 100644 0048-cdrom_id-remove-debugging-code.patch delete mode 100644 0049-cdrom_id-retry-to-open-the-device-if-EBUSY.patch delete mode 100644 0050-cdrom_id-check-mount-state-in-retry-loop.patch delete mode 100644 0051-cdrom_id-always-set-ID_CDROM-regardless-if-we-can-ru.patch delete mode 100644 0052-rules-delete-outdated-packagees-rules.patch delete mode 100644 0053-rules-we-do-not-have-static-devices-which-are-rename.patch delete mode 100644 0054-unify-cleanup-event-handling.patch delete mode 100644 0055-allow-IMPORT-db-KEY.patch delete mode 100644 0056-usb-db-remove-double.patch delete mode 100644 0057-replace-add-change-with-remove.patch delete mode 100644 0058-update-NEWS.patch delete mode 100644 0059-log-info-only-if-we-actually-delete-the-node.patch delete mode 100644 0060-udevadm-trigger-switch-default-action-from-add-to-ch.patch delete mode 100644 0061-remove-all_partitions-option.patch delete mode 100644 0062-cdrom_id-Fix-uninitialized-variables.patch delete mode 100644 0063-rules-call-modprobe-on-all-events-but-remove.patch delete mode 100644 0064-remove-ignore_remove-option.patch delete mode 100644 0065-cdrom_id-Fix-uninitialized-buffers.patch rename 0034-add-LGPL-COPYING-to-libudev-and-GUdev.patch => udev-153-LGPL.patch (99%) rename udev-145.tar.bz2.sign => udev-153.tar.bz2.sign (61%) diff --git a/.cvsignore b/.cvsignore index d05c54f..e15c73e 100644 --- a/.cvsignore +++ b/.cvsignore @@ -1 +1 @@ -udev-151.tar.bz2 +udev-153.tar.bz2 diff --git a/0001-configure.ac-version-bump.patch b/0001-configure.ac-version-bump.patch new file mode 100644 index 0000000..b54be08 --- /dev/null +++ b/0001-configure.ac-version-bump.patch @@ -0,0 +1,34 @@ +From c51d2f2746a54c8418965f22d1882b1ac3a18ed8 Mon Sep 17 00:00:00 2001 +From: Kay Sievers +Date: Wed, 21 Apr 2010 08:50:59 +0200 +Subject: [PATCH 01/19] configure.ac: version bump + +--- + NEWS | 3 +++ + configure.ac | 2 +- + 2 files changed, 4 insertions(+), 1 deletions(-) + +diff --git a/NEWS b/NEWS +index 87d5343..f3163ec 100644 +--- a/NEWS ++++ b/NEWS +@@ -1,3 +1,6 @@ ++udev 154 ++======== ++ + udev 153 + ======== + Fix broken firmware loader search path. +diff --git a/configure.ac b/configure.ac +index 4fcdbcd..d4d29c4 100644 +--- a/configure.ac ++++ b/configure.ac +@@ -1,4 +1,4 @@ +-AC_INIT([udev], [153], [linux-hotplug@vger.kernel.org]) ++AC_INIT([udev], [154], [linux-hotplug@vger.kernel.org]) + AC_PREREQ(2.60) + AM_INIT_AUTOMAKE([check-news foreign 1.10 dist-bzip2 subdir-objects]) + m4_ifdef([AM_SILENT_RULES], [AM_SILENT_RULES([yes])]) +-- +1.7.0.1 + diff --git a/0001-firmware-fix-error-reporting-on-missing-firmware-fil.patch b/0001-firmware-fix-error-reporting-on-missing-firmware-fil.patch deleted file mode 100644 index 41727ad..0000000 --- a/0001-firmware-fix-error-reporting-on-missing-firmware-fil.patch +++ /dev/null @@ -1,43 +0,0 @@ -From 86a7a2f853fe6022c5b0c1b415918047b65533be Mon Sep 17 00:00:00 2001 -From: =?UTF-8?q?Thomas=20B=C3=A4chler?= -Date: Sun, 31 Jan 2010 13:49:02 +0100 -Subject: [PATCH 01/65] firmware: fix error reporting on missing firmware files - -The new firmware loader does not report an error to the kernel if a firmware file -is missing. This results in modprobe stalling for 60 seconds for each firmware -a module tries to load. ---- - extras/firmware/firmware.c | 3 ++- - 1 files changed, 2 insertions(+), 1 deletions(-) - -diff --git a/extras/firmware/firmware.c b/extras/firmware/firmware.c -index 8f70be4..16455de 100644 ---- a/extras/firmware/firmware.c -+++ b/extras/firmware/firmware.c -@@ -149,6 +149,7 @@ int main(int argc, char **argv) - - util_path_encode(firmware, fwencpath, sizeof(fwencpath)); - util_strscpyl(misspath, sizeof(misspath), udev_get_dev_path(udev), "/.udev/firmware-missing/", fwencpath, NULL); -+ util_strscpyl(loadpath, sizeof(loadpath), udev_get_sys_path(udev), devpath, "/loading", NULL); - - if (fwfile == NULL) { - int err; -@@ -166,6 +167,7 @@ int main(int argc, char **argv) - udev_selinux_resetfscreatecon(udev); - } while (err == -ENOENT); - rc = 2; -+ set_loading(udev, loadpath, "-1"); - goto exit; - } - -@@ -176,7 +178,6 @@ int main(int argc, char **argv) - if (unlink(misspath) == 0) - util_delete_path(udev, misspath); - -- util_strscpyl(loadpath, sizeof(loadpath), udev_get_sys_path(udev), devpath, "/loading", NULL); - set_loading(udev, loadpath, "1"); - - util_strscpyl(datapath, sizeof(datapath), udev_get_sys_path(udev), devpath, "/data", NULL); --- -1.6.6 - diff --git a/0002-keymap-Add-Dell-Inspiron-1011-Mini-10.patch b/0002-keymap-Add-Dell-Inspiron-1011-Mini-10.patch deleted file mode 100644 index a2b2e5e..0000000 --- a/0002-keymap-Add-Dell-Inspiron-1011-Mini-10.patch +++ /dev/null @@ -1,26 +0,0 @@ -From fc47e0b56779ceeaaa40d2dc3248fa002af63aaa Mon Sep 17 00:00:00 2001 -From: Martin Pitt -Date: Mon, 1 Feb 2010 15:27:46 -0800 -Subject: [PATCH 02/65] keymap: Add Dell Inspiron 1011 (Mini 10) - -This fixes the broken WLAN key. ---- - extras/keymap/95-keymap.rules | 2 ++ - 1 files changed, 2 insertions(+), 0 deletions(-) - -diff --git a/extras/keymap/95-keymap.rules b/extras/keymap/95-keymap.rules -index 2b1c4bd..51c8c3b 100644 ---- a/extras/keymap/95-keymap.rules -+++ b/extras/keymap/95-keymap.rules -@@ -53,6 +53,8 @@ GOTO="keyboard_end" - LABEL="keyboard_vendorcheck" - - ENV{DMI_VENDOR}=="Dell*", RUN+="keymap $name dell" -+ENV{DMI_VENDOR}=="Dell*", ATTR{[dmi/id]product_name}=="Inspiron 1011", RUN+="keymap $name 0x84 wlan" -+ - ENV{DMI_VENDOR}=="Compaq*", ATTR{[dmi/id]product_name}=="*E500*|*Evo N*", RUN+="keymap $name compaq-e_evo" - - ENV{DMI_VENDOR}=="LENOVO*", ATTR{[dmi/id]product_version}=="*3000*", RUN+="keymap $name lenovo-3000" --- -1.6.6 - diff --git a/0002-remove-buffer-overrun-risk-in-readlink-call.patch b/0002-remove-buffer-overrun-risk-in-readlink-call.patch new file mode 100644 index 0000000..4e64f31 --- /dev/null +++ b/0002-remove-buffer-overrun-risk-in-readlink-call.patch @@ -0,0 +1,32 @@ +From e925018786d85fb3aed3b62a0a89309f9a7d5e4f Mon Sep 17 00:00:00 2001 +From: Mathias Nyman +Date: Wed, 21 Apr 2010 13:52:52 +0300 +Subject: [PATCH 02/19] remove buffer-overrun risk in readlink call + +readlink does not write a nul character to the end of the +string it returns. Therefore ask for one fewer character +than the buffer size so there's always room for an extra \0. + +Signed-off-by: Mathias Nyman +Signed-off-by: Phil Carmody +Signed-off-by: Martin Pitt +--- + udev/udev-node.c | 2 +- + 1 files changed, 1 insertions(+), 1 deletions(-) + +diff --git a/udev/udev-node.c b/udev/udev-node.c +index 2a2c2cf..ceb1d52 100644 +--- a/udev/udev-node.c ++++ b/udev/udev-node.c +@@ -163,7 +163,7 @@ static int node_symlink(struct udev *udev, const char *node, const char *slink) + int len; + + dbg(udev, "found existing symlink '%s'\n", slink); +- len = readlink(slink, buf, sizeof(buf)); ++ len = readlink(slink, buf, sizeof(buf) - 1); + if (len > 0) { + buf[len] = '\0'; + if (strcmp(target, buf) == 0) { +-- +1.7.0.1 + diff --git a/0003-Fix-brightness-keys-on-MSI-Wind-U-100.patch b/0003-Fix-brightness-keys-on-MSI-Wind-U-100.patch deleted file mode 100644 index e1a366c..0000000 --- a/0003-Fix-brightness-keys-on-MSI-Wind-U-100.patch +++ /dev/null @@ -1,37 +0,0 @@ -From d7e2d38c1f0ead2239808dd117577a99a3ad3cde Mon Sep 17 00:00:00 2001 -From: Martin Pitt -Date: Tue, 9 Feb 2010 15:47:47 +0100 -Subject: [PATCH 03/65] Fix brightness keys on MSI Wind U-100 - -The MSI Wind 100 generates ACPI/input events on the LNXVIDEO input device. On -top of that, the video module/BIOS synthesize some extra event on atkbd as an -echo of actually changing the brightness. - -Ignore the wrong and useless atkbd ones, to avoid event loops. - -Many thanks to Hans de Goede for tracking this down! - -https://launchpad.net/bugs/415023 ---- - extras/keymap/95-keymap.rules | 5 +++++ - 1 files changed, 5 insertions(+), 0 deletions(-) - -diff --git a/extras/keymap/95-keymap.rules b/extras/keymap/95-keymap.rules -index 51c8c3b..684619b 100644 ---- a/extras/keymap/95-keymap.rules -+++ b/extras/keymap/95-keymap.rules -@@ -98,6 +98,11 @@ ENV{DMI_VENDOR}=="MEDIONNB", ATTR{[dmi/id]product_name}=="A555*", RUN+="keymap $ - - ENV{DMI_VENDOR}=="MICRO-STAR*", RUN+="keymap $name micro-star" - -+# some MSI models generate ACPI/input events on the LNXVIDEO input devices, -+# plus some extra synthesized ones on atkbd as an echo of actually changing the -+# brightness; so ignore those atkbd ones, to avoid loops -+ENV{DMI_VENDOR}=="MICRO-STAR*", ATTR{[dmi/id]product_name}=="*U-100*|*U100*|*N033", RUN+="keymap $name 0xF7 reserved 0xF8 reserved" -+ - ENV{DMI_VENDOR}=="INVENTEC", ATTR{[dmi/id]product_name}=="SYMPHONY 6.0/7.0", RUN+="keymap $name inventec-symphony_6.0_7.0" - - ENV{DMI_VENDOR}=="MAXDATA", ATTR{[dmi/id]product_name}=="Pro 7000*", RUN+="keymap $name maxdata-pro_7000" --- -1.6.6 - diff --git a/0003-more-readlink-buffer-size-handling.patch b/0003-more-readlink-buffer-size-handling.patch new file mode 100644 index 0000000..870fb72 --- /dev/null +++ b/0003-more-readlink-buffer-size-handling.patch @@ -0,0 +1,113 @@ +From 60067cc75ac7dd583beea584f87f2f6d3358f3c1 Mon Sep 17 00:00:00 2001 +From: Kay Sievers +Date: Wed, 21 Apr 2010 14:44:33 +0200 +Subject: [PATCH 03/19] more readlink buffer size handling + +--- + libudev/libudev-device.c | 27 ++++++++++++++------------- + libudev/libudev-queue.c | 2 +- + udev/udev-node.c | 4 ++-- + udev/udev-watch.c | 4 ++-- + 4 files changed, 19 insertions(+), 18 deletions(-) + +diff --git a/libudev/libudev-device.c b/libudev/libudev-device.c +index b3b6a63..4003545 100644 +--- a/libudev/libudev-device.c ++++ b/libudev/libudev-device.c +@@ -222,12 +222,11 @@ int udev_device_read_db(struct udev_device *udev_device) + char *next; + + target_len = readlink(filename, target, sizeof(target)); +- if (target_len > 0) +- target[target_len] = '\0'; +- else { +- dbg(udev_device->udev, "error reading db link %s: %m\n", filename); ++ if (target_len <= 0 || target_len == sizeof(target)) { ++ info(udev_device->udev, "error reading db link %s: %m\n", filename); + return -1; + } ++ target[target_len] = '\0'; + + next = strchr(target, ' '); + if (next != NULL) { +@@ -1095,16 +1094,18 @@ const char *udev_device_get_sysattr_value(struct udev_device *udev_device, const + goto out; + + len = readlink(path, target, sizeof(target)); +- if (len > 0) { +- target[len] = '\0'; +- pos = strrchr(target, '/'); +- if (pos != NULL) { +- pos = &pos[1]; +- dbg(udev_device->udev, "cache '%s' with link value '%s'\n", sysattr, pos); +- list_entry = udev_list_entry_add(udev_device->udev, &udev_device->sysattr_list, sysattr, pos, 0, 0); +- val = udev_list_entry_get_value(list_entry); +- } ++ if (len <= 0 || len == sizeof(target)) ++ goto out; ++ target[len] = '\0'; ++ ++ pos = strrchr(target, '/'); ++ if (pos != NULL) { ++ pos = &pos[1]; ++ dbg(udev_device->udev, "cache '%s' with link value '%s'\n", sysattr, pos); ++ list_entry = udev_list_entry_add(udev_device->udev, &udev_device->sysattr_list, sysattr, pos, 0, 0); ++ val = udev_list_entry_get_value(list_entry); + } ++ + goto out; + } + +diff --git a/libudev/libudev-queue.c b/libudev/libudev-queue.c +index f06c9e8..5a4a3dc 100644 +--- a/libudev/libudev-queue.c ++++ b/libudev/libudev-queue.c +@@ -488,7 +488,7 @@ struct udev_list_entry *udev_queue_get_failed_list_entry(struct udev_queue *udev + s = syspath; + l = util_strpcpyl(&s, sizeof(syspath), udev_get_sys_path(udev_queue->udev), NULL); + len = readlinkat(dirfd(dir), dent->d_name, s, l); +- if (len < 0 || (size_t)len >= l) ++ if (len <= 0 || (size_t)len == l) + continue; + s[len] = '\0'; + dbg(udev_queue->udev, "found '%s' [%s]\n", syspath, dent->d_name); +diff --git a/udev/udev-node.c b/udev/udev-node.c +index ceb1d52..5c1b04b 100644 +--- a/udev/udev-node.c ++++ b/udev/udev-node.c +@@ -163,8 +163,8 @@ static int node_symlink(struct udev *udev, const char *node, const char *slink) + int len; + + dbg(udev, "found existing symlink '%s'\n", slink); +- len = readlink(slink, buf, sizeof(buf) - 1); +- if (len > 0) { ++ len = readlink(slink, buf, sizeof(buf)); ++ if (len > 0 && len < (int)sizeof(buf)) { + buf[len] = '\0'; + if (strcmp(target, buf) == 0) { + info(udev, "preserve already existing symlink '%s' to '%s'\n", +diff --git a/udev/udev-watch.c b/udev/udev-watch.c +index 7135d9f..5fa6010 100644 +--- a/udev/udev-watch.c ++++ b/udev/udev-watch.c +@@ -81,7 +81,7 @@ void udev_watch_restore(struct udev *udev) + s = device; + l = util_strpcpy(&s, sizeof(device), udev_get_sys_path(udev)); + len = readlinkat(dirfd(dir), ent->d_name, s, l); +- if (len <= 0 || len >= (ssize_t)l) ++ if (len <= 0 || len == (ssize_t)l) + goto unlink; + s[len] = '\0'; + +@@ -173,7 +173,7 @@ struct udev_device *udev_watch_lookup(struct udev *udev, int wd) + s = majmin; + l = util_strpcpy(&s, sizeof(majmin), udev_get_sys_path(udev)); + len = readlink(filename, s, l); +- if (len < 0 || (size_t)len >= l) ++ if (len <= 0 || (size_t)len == l) + return NULL; + s[len] = '\0'; + +-- +1.7.0.1 + diff --git a/0004-keymap-Add-support-for-Gateway-AOA110-AOA150-clones.patch b/0004-keymap-Add-support-for-Gateway-AOA110-AOA150-clones.patch deleted file mode 100644 index 3d927d2..0000000 --- a/0004-keymap-Add-support-for-Gateway-AOA110-AOA150-clones.patch +++ /dev/null @@ -1,29 +0,0 @@ -From 063985ef7dd6050f33920700777831426b221697 Mon Sep 17 00:00:00 2001 -From: Robert Hooker -Date: Sun, 7 Feb 2010 13:56:27 -0500 -Subject: [PATCH 04/65] keymap: Add support for Gateway AOA110/AOA150 clones. - -https://launchpad.net/bugs/518496 - -Signed-off-by: Martin Pitt ---- - extras/keymap/95-keymap.rules | 3 +++ - 1 files changed, 3 insertions(+), 0 deletions(-) - -diff --git a/extras/keymap/95-keymap.rules b/extras/keymap/95-keymap.rules -index 684619b..d3690bb 100644 ---- a/extras/keymap/95-keymap.rules -+++ b/extras/keymap/95-keymap.rules -@@ -71,6 +71,9 @@ ENV{DMI_VENDOR}=="Hewlett-Packard", ATTR{[dmi/id]product_name}=="Presario 2100*" - # HP Pavillion dv6315ea has empty DMI_VENDOR - ATTR{[dmi/id]board_vendor}=="Quanta", ATTR{[dmi/id]board_name}=="30B7", ATTR{[dmi/id]board_version}=="65.2B", RUN+="keymap $name 0x88 media" # "quick play - -+# Gateway clone of Acer Aspire One AOA110/AOA150 -+ENV{DMI_VENDOR}=="Gateway*", ATTR{[dmi/id]product_name}=="*AOA1*", RUN+="keymap $name acer" -+ - ENV{DMI_VENDOR}=="Acer*", RUN+="keymap $name acer" - ENV{DMI_VENDOR}=="Acer*", ATTR{[dmi/id]product_name}=="Extensa*", ATTR{[dmi/id]product_name}=="*5210*|*5220*|*5610*|*5620*|*5720*", RUN+="keymap $name 0xEE screenlock" - ENV{DMI_VENDOR}=="Acer*", ATTR{[dmi/id]product_name}=="TravelMate*C300*", RUN+="keymap $name acer-travelmate_c300" --- -1.6.6 - diff --git a/0004-remove-left-over-from-ignore_remove-and-all_partitio.patch b/0004-remove-left-over-from-ignore_remove-and-all_partitio.patch new file mode 100644 index 0000000..b14f0a0 --- /dev/null +++ b/0004-remove-left-over-from-ignore_remove-and-all_partitio.patch @@ -0,0 +1,73 @@ +From e9906fec711192761f27468244d3012041bcb0ee Mon Sep 17 00:00:00 2001 +From: Kay Sievers +Date: Wed, 21 Apr 2010 15:11:57 +0200 +Subject: [PATCH 04/19] remove left-over from ignore_remove and all_partitions + +--- + udev/udev-rules.c | 10 ---------- + 1 files changed, 0 insertions(+), 10 deletions(-) + +diff --git a/udev/udev-rules.c b/udev/udev-rules.c +index 4f18aca..f5d23b4 100644 +--- a/udev/udev-rules.c ++++ b/udev/udev-rules.c +@@ -149,7 +149,6 @@ enum token_type { + TK_A_STRING_ESCAPE_NONE, + TK_A_STRING_ESCAPE_REPLACE, + TK_A_INOTIFY_WATCH, /* int */ +- TK_A_NUM_FAKE_PART, /* int */ + TK_A_DEVLINK_PRIO, /* int */ + TK_A_OWNER, /* val */ + TK_A_GROUP, /* val */ +@@ -161,7 +160,6 @@ enum token_type { + TK_A_NAME, /* val */ + TK_A_DEVLINK, /* val */ + TK_A_EVENT_TIMEOUT, /* int */ +- TK_A_IGNORE_REMOVE, + TK_A_ATTR, /* val, attr */ + TK_A_RUN, /* val, bool */ + TK_A_GOTO, /* size_t */ +@@ -279,7 +277,6 @@ static const char *token_str(enum token_type type) + [TK_A_STRING_ESCAPE_NONE] = "A STRING_ESCAPE_NONE", + [TK_A_STRING_ESCAPE_REPLACE] = "A STRING_ESCAPE_REPLACE", + [TK_A_INOTIFY_WATCH] = "A INOTIFY_WATCH", +- [TK_A_NUM_FAKE_PART] = "A NUM_FAKE_PART", + [TK_A_DEVLINK_PRIO] = "A DEVLINK_PRIO", + [TK_A_OWNER] = "A OWNER", + [TK_A_GROUP] = "A GROUP", +@@ -291,7 +288,6 @@ static const char *token_str(enum token_type type) + [TK_A_NAME] = "A NAME", + [TK_A_DEVLINK] = "A DEVLINK", + [TK_A_EVENT_TIMEOUT] = "A EVENT_TIMEOUT", +- [TK_A_IGNORE_REMOVE] = "A IGNORE_REMOVE", + [TK_A_ATTR] = "A ATTR", + [TK_A_RUN] = "A RUN", + [TK_A_GOTO] = "A GOTO", +@@ -360,9 +356,6 @@ static void dump_token(struct udev_rules *rules, struct token *token) + break; + case TK_A_STRING_ESCAPE_NONE: + case TK_A_STRING_ESCAPE_REPLACE: +- case TK_A_IGNORE_REMOVE: +- dbg(rules->udev, "%s\n", token_str(type)); +- break; + case TK_M_TEST: + dbg(rules->udev, "%s %s '%s'(%s) %#o\n", + token_str(type), operation_str(op), value, string_glob_str(glob), token->key.mode); +@@ -1030,14 +1023,11 @@ static int rule_add_key(struct rule_tmp *rule_tmp, enum token_type type, + break; + case TK_A_STRING_ESCAPE_NONE: + case TK_A_STRING_ESCAPE_REPLACE: +- case TK_A_IGNORE_REMOVE: +- break; + case TK_A_RUN: + token->key.value_off = add_string(rule_tmp->rules, value); + token->key.fail_on_error = *(int *)data; + break; + case TK_A_INOTIFY_WATCH: +- case TK_A_NUM_FAKE_PART: + case TK_A_DEVLINK_PRIO: + token->key.devlink_prio = *(int *)data; + break; +-- +1.7.0.1 + diff --git a/0005-fix-previous-commit.patch b/0005-fix-previous-commit.patch new file mode 100644 index 0000000..9ade8ad --- /dev/null +++ b/0005-fix-previous-commit.patch @@ -0,0 +1,33 @@ +From 5d69a34caffd595d918dd859a5b079f95d250064 Mon Sep 17 00:00:00 2001 +From: Kay Sievers +Date: Wed, 21 Apr 2010 15:43:05 +0200 +Subject: [PATCH 05/19] fix previous commit + +--- + udev/udev-rules.c | 3 +++ + 1 files changed, 3 insertions(+), 0 deletions(-) + +diff --git a/udev/udev-rules.c b/udev/udev-rules.c +index f5d23b4..6eb8350 100644 +--- a/udev/udev-rules.c ++++ b/udev/udev-rules.c +@@ -356,6 +356,8 @@ static void dump_token(struct udev_rules *rules, struct token *token) + break; + case TK_A_STRING_ESCAPE_NONE: + case TK_A_STRING_ESCAPE_REPLACE: ++ dbg(rules->udev, "%s\n", token_str(type)); ++ break; + case TK_M_TEST: + dbg(rules->udev, "%s %s '%s'(%s) %#o\n", + token_str(type), operation_str(op), value, string_glob_str(glob), token->key.mode); +@@ -1023,6 +1025,7 @@ static int rule_add_key(struct rule_tmp *rule_tmp, enum token_type type, + break; + case TK_A_STRING_ESCAPE_NONE: + case TK_A_STRING_ESCAPE_REPLACE: ++ break; + case TK_A_RUN: + token->key.value_off = add_string(rule_tmp->rules, value); + token->key.fail_on_error = *(int *)data; +-- +1.7.0.1 + diff --git a/0005-keymap-Fix-LG-X110.patch b/0005-keymap-Fix-LG-X110.patch deleted file mode 100644 index d36d5c0..0000000 --- a/0005-keymap-Fix-LG-X110.patch +++ /dev/null @@ -1,64 +0,0 @@ -From 4c514e31734a704ca58e543fa4330616ba584b39 Mon Sep 17 00:00:00 2001 -From: Martin Pitt -Date: Fri, 12 Feb 2010 19:25:47 +0100 -Subject: [PATCH 05/65] keymap: Fix LG X110 - -The LG X110 is not a perfect clone of the MSI Wind after all, and needs its own -keymap. Thanks to Konstantin Lavrov! - -https://launchpad.net/bugs/520650 ---- - Makefile.am | 1 + - extras/keymap/95-keymap.rules | 3 +-- - extras/keymap/keymaps/lg-x110 | 12 ++++++++++++ - 3 files changed, 14 insertions(+), 2 deletions(-) - create mode 100644 extras/keymap/keymaps/lg-x110 - -diff --git a/Makefile.am b/Makefile.am -index 728076a..069bf7f 100644 ---- a/Makefile.am -+++ b/Makefile.am -@@ -518,6 +518,7 @@ dist_udevkeymap_DATA = \ - extras/keymap/keymaps/lenovo-thinkpad-usb-keyboard-trackpoint \ - extras/keymap/keymaps/lenovo-thinkpad_x6_tablet \ - extras/keymap/keymaps/lenovo-thinkpad_x200_tablet \ -+ extras/keymap/keymaps/lg-x110 \ - extras/keymap/keymaps/logitech-wave \ - extras/keymap/keymaps/logitech-wave-cordless \ - extras/keymap/keymaps/maxdata-pro_7000 \ -diff --git a/extras/keymap/95-keymap.rules b/extras/keymap/95-keymap.rules -index d3690bb..fcd42aa 100644 ---- a/extras/keymap/95-keymap.rules -+++ b/extras/keymap/95-keymap.rules -@@ -93,8 +93,7 @@ ENV{DMI_VENDOR}=="FUJITSU*", ATTR{[dmi/id]product_name}=="*Amilo Si 1520*", RUN+ - ENV{DMI_VENDOR}=="FUJITSU*", ATTR{[dmi/id]product_name}=="AMILO*M*", RUN+="keymap $name 0x97 prog2 0x9F prog1" - ENV{DMI_VENDOR}=="FUJITSU*", ATTR{[dmi/id]product_name}=="Amilo Li 1718", RUN+="keymap $name 0xD6 wlan" - --# MSI Wind clone --ENV{DMI_VENDOR}=="LG*", ATTR{[dmi/id]product_name}=="*X110*", RUN+="keymap $name micro-star" -+ENV{DMI_VENDOR}=="LG*", ATTR{[dmi/id]product_name}=="*X110*", RUN+="keymap $name lg-x110" - - ENV{DMI_VENDOR}=="MEDION*", ATTR{[dmi/id]product_name}=="*FID2060*", RUN+="keymap $name medion-fid2060" - ENV{DMI_VENDOR}=="MEDIONNB", ATTR{[dmi/id]product_name}=="A555*", RUN+="keymap $name medionnb-a555" -diff --git a/extras/keymap/keymaps/lg-x110 b/extras/keymap/keymaps/lg-x110 -new file mode 100644 -index 0000000..a61cf3d ---- /dev/null -+++ b/extras/keymap/keymaps/lg-x110 -@@ -0,0 +1,12 @@ -+0xA0 mute # Fn-F9 -+0xAE volumedown # Fn-Left -+0xAF search # Fn-F3 -+0xB0 volumeup # Fn-Right -+0xB1 battery # Fn-F10 Info -+0xB3 suspend # Fn-F12 -+0xDF sleep # Fn-F4 -+# 0xE2 bluetooth # satellite dish2 -+0xE4 f22 # Fn-F5 Touchpad disable -+0xF6 wlan # Fn-F6 -+0xF7 reserved # brightnessdown # Fn-Down -+0xF8 reserved # brightnessup # Fn-Up -\ No newline at end of file --- -1.6.6 - diff --git a/0006-Fix-volume-keys-not-releasing-for-Pegatron-platform.patch b/0006-Fix-volume-keys-not-releasing-for-Pegatron-platform.patch new file mode 100644 index 0000000..3c27d50 --- /dev/null +++ b/0006-Fix-volume-keys-not-releasing-for-Pegatron-platform.patch @@ -0,0 +1,29 @@ +From d05137cca5f92a102a0bdd55e42de9852a739913 Mon Sep 17 00:00:00 2001 +From: Jerone Young +Date: Wed, 21 Apr 2010 12:19:37 -0500 +Subject: [PATCH 06/19] Fix volume keys not releasing for Pegatron platform + +Pegatron has a new platform coming out being sold by many small +manufacturers. This platform has volume keys that are not sending a key +release. This patch ensures those keys send release. + +Signed-off-by: Jerone Young +Signed-off-by: Martin Pitt +--- + extras/keymap/95-keyboard-force-release.rules | 2 ++ + 1 files changed, 2 insertions(+), 0 deletions(-) + +diff --git a/extras/keymap/95-keyboard-force-release.rules b/extras/keymap/95-keyboard-force-release.rules +index c9edacf..011b2e3 100644 +--- a/extras/keymap/95-keyboard-force-release.rules ++++ b/extras/keymap/95-keyboard-force-release.rules +@@ -29,4 +29,6 @@ ENV{DMI_VENDOR}=="FOXCONN", ATTR{[dmi/id]product_name}=="QBOOK", RUN+="keyboard- + + ENV{DMI_VENDOR}=="MTC", ATTR{[dmi/id]product_version}=="A0", RUN+="keyboard-force-release.sh $devpath common-volume-keys" + ++ENV{DMI_VENDOR}=="PEGATRON CORP.", ATTR{[dmi/id]product_name}=="Spring Peak", RUN+="keyboard-force-release.sh $devpath common-volume-keys" ++ + LABEL="force_release_end" +-- +1.7.0.1 + diff --git a/0006-Force-key-release-for-volume-keys-on-Dell-Studio-155.patch b/0006-Force-key-release-for-volume-keys-on-Dell-Studio-155.patch deleted file mode 100644 index d274d6c..0000000 --- a/0006-Force-key-release-for-volume-keys-on-Dell-Studio-155.patch +++ /dev/null @@ -1,55 +0,0 @@ -From b15bb8019094797aee65f35e3e654354b61bfd7b Mon Sep 17 00:00:00 2001 -From: Jerone Young -Date: Fri, 12 Feb 2010 18:08:08 -0600 -Subject: [PATCH 06/65] Force key release for volume keys on Dell Studio 1557 - -Dell Studio 1557 does not generate a release code when the volume keys -are pressed, causing them to generate infinite key presses. This forces -key release of these keys. - -Signed-off-by: Jerone Young -Signed-off-by: Martin Pitt ---- - Makefile.am | 3 ++- - extras/keymap/95-keyboard-force-release.rules | 2 ++ - extras/keymap/force-release-maps/dell-studio-1557 | 3 +++ - 3 files changed, 7 insertions(+), 1 deletions(-) - create mode 100755 extras/keymap/force-release-maps/dell-studio-1557 - -diff --git a/Makefile.am b/Makefile.am -index 069bf7f..1b4e2ea 100644 ---- a/Makefile.am -+++ b/Makefile.am -@@ -541,7 +541,8 @@ dist_udevkeymap_DATA = \ - - udevkeymapforcereldir = $(libexecdir)/keymaps/force-release - dist_udevkeymapforcerel_DATA = \ -- extras/keymap/force-release-maps/samsung-other -+ extras/keymap/force-release-maps/samsung-other \ -+ extras/keymap/force-release-maps/dell-studio-1557 - - extras/keymap/keys.txt: $(INCLUDE_PREFIX)/linux/input.h - mkdir -p extras/keymap -diff --git a/extras/keymap/95-keyboard-force-release.rules b/extras/keymap/95-keyboard-force-release.rules -index 689afe9..659ee95 100644 ---- a/extras/keymap/95-keyboard-force-release.rules -+++ b/extras/keymap/95-keyboard-force-release.rules -@@ -21,4 +21,6 @@ ENV{DMI_VENDOR}="$attr{[dmi/id]sys_vendor}" - - ENV{DMI_VENDOR}=="[sS][aA][mM][sS][uU][nN][gG]*", ATTR{[dmi/id]product_name}=="*N130*|*N140*|*SR70S/SR71S*", RUN+="keyboard-force-release.sh $devpath samsung-other" - -+ENV{DMI_VENDOR}=="Dell Inc.", ATTR{[dmi/id]product_name}=="Studio 1557", RUN+="keyboard-force-release.sh $devpath dell-studio-1557" -+ - LABEL="force_release_end" -diff --git a/extras/keymap/force-release-maps/dell-studio-1557 b/extras/keymap/force-release-maps/dell-studio-1557 -new file mode 100755 -index 0000000..1718673 ---- /dev/null -+++ b/extras/keymap/force-release-maps/dell-studio-1557 -@@ -0,0 +1,3 @@ -+0xa0 #mute -+0xae #volume up -+0xb0 #volume down --- -1.6.6 - diff --git a/0007-keymap-Add-Toshiba-Satellite-M30X.patch b/0007-keymap-Add-Toshiba-Satellite-M30X.patch deleted file mode 100644 index 98a893b..0000000 --- a/0007-keymap-Add-Toshiba-Satellite-M30X.patch +++ /dev/null @@ -1,55 +0,0 @@ -From 4ca91a04e8b727a079a973fdd9bc2b093e8315a5 Mon Sep 17 00:00:00 2001 -From: Martin Pitt -Date: Mon, 15 Feb 2010 13:15:25 +0100 -Subject: [PATCH 07/65] keymap: Add Toshiba Satellite M30X - -Thanks to Alessio Gaeta! - -https://launchpad.net/bugs/510019 ---- - Makefile.am | 1 + - extras/keymap/95-keymap.rules | 1 + - extras/keymap/keymaps/toshiba-satellite_m30x | 7 +++++++ - 3 files changed, 9 insertions(+), 0 deletions(-) - create mode 100644 extras/keymap/keymaps/toshiba-satellite_m30x - -diff --git a/Makefile.am b/Makefile.am -index 1b4e2ea..db23f16 100644 ---- a/Makefile.am -+++ b/Makefile.am -@@ -537,6 +537,7 @@ dist_udevkeymap_DATA = \ - extras/keymap/keymaps/samsung-sx20s \ - extras/keymap/keymaps/toshiba-satellite_a100 \ - extras/keymap/keymaps/toshiba-satellite_a110 \ -+ extras/keymap/keymaps/toshiba-satellite_m30x \ - extras/keymap/keymaps/zepto-znote - - udevkeymapforcereldir = $(libexecdir)/keymaps/force-release -diff --git a/extras/keymap/95-keymap.rules b/extras/keymap/95-keymap.rules -index fcd42aa..65b0d6e 100644 ---- a/extras/keymap/95-keymap.rules -+++ b/extras/keymap/95-keymap.rules -@@ -115,6 +115,7 @@ ENV{DMI_VENDOR}=="[sS][aA][mM][sS][uU][nN][gG]*", ATTR{[dmi/id]product_name}=="S - - ENV{DMI_VENDOR}=="TOSHIBA", ATTR{[dmi/id]product_name}=="SATELLITE A100", RUN+="keymap $name toshiba-satellite_a100" - ENV{DMI_VENDOR}=="TOSHIBA", ATTR{[dmi/id]product_name}=="Satellite A110", RUN+="keymap $name toshiba-satellite_a110" -+ENV{DMI_VENDOR}=="TOSHIBA", ATTR{[dmi/id]product_name}=="Satellite M30X", RUN+="keymap $name toshiba-satellite_m30x" - - ENV{DMI_VENDOR}=="OQO Inc.*", ATTR{[dmi/id]product_name}=="OQO Model 2*", RUN+="keymap $name oqo-model2" - -diff --git a/extras/keymap/keymaps/toshiba-satellite_m30x b/extras/keymap/keymaps/toshiba-satellite_m30x -new file mode 100644 -index 0000000..cf6d912 ---- /dev/null -+++ b/extras/keymap/keymaps/toshiba-satellite_m30x -@@ -0,0 +1,7 @@ -+0xef brightnessdown -+0xd9 brightnessup -+0xee screenlock -+0x93 media -+0x9e prog1 #touchpad_enable -+0x9f prog2 #touchpad_disable -+ --- -1.6.6 - diff --git a/0007-udevadm-info-export-db-remove-watch-handle-export.patch b/0007-udevadm-info-export-db-remove-watch-handle-export.patch new file mode 100644 index 0000000..8fa424e --- /dev/null +++ b/0007-udevadm-info-export-db-remove-watch-handle-export.patch @@ -0,0 +1,27 @@ +From e7964b93e826274d0e92d58e458decb49e502bf5 Mon Sep 17 00:00:00 2001 +From: Kay Sievers +Date: Thu, 22 Apr 2010 06:23:16 +0200 +Subject: [PATCH 07/19] udevadm: info --export-db -- remove watch handle export + +--- + udev/udevadm-info.c | 4 ---- + 1 files changed, 0 insertions(+), 4 deletions(-) + +diff --git a/udev/udevadm-info.c b/udev/udevadm-info.c +index 5f6209a..b395ad9 100644 +--- a/udev/udevadm-info.c ++++ b/udev/udevadm-info.c +@@ -142,10 +142,6 @@ static void print_record(struct udev_device *device) + if (i != 0) + printf("L: %i\n", i); + +- i = udev_device_get_watch_handle(device); +- if (i >= 0) +- printf("W: %u\n", i); +- + udev_list_entry_foreach(list_entry, udev_device_get_devlinks_list_entry(device)) { + len = strlen(udev_get_dev_path(udev_device_get_udev(device))); + printf("S: %s\n", &udev_list_entry_get_name(list_entry)[len+1]); +-- +1.7.0.1 + diff --git a/0008-add-TAG-to-improve-event-filtering-and-device-enumer.patch b/0008-add-TAG-to-improve-event-filtering-and-device-enumer.patch new file mode 100644 index 0000000..d40b240 --- /dev/null +++ b/0008-add-TAG-to-improve-event-filtering-and-device-enumer.patch @@ -0,0 +1,1706 @@ +From 28460195c2ae90892bf556aff2b80705a8f37795 Mon Sep 17 00:00:00 2001 +From: Kay Sievers +Date: Thu, 22 Apr 2010 18:12:36 +0200 +Subject: [PATCH 08/19] add TAG= to improve event filtering and device enumeration + +--- + Makefile.am | 4 +- + libudev/docs/libudev-sections.txt | 2 + + libudev/exported_symbols | 1 + + libudev/libudev-device-private.c | 46 ++++++++- + libudev/libudev-device.c | 159 ++++++++++++++++++++------- + libudev/libudev-enumerate.c | 197 ++++++++++++++++++++++----------- + libudev/libudev-monitor.c | 218 +++++++++++++++++++++++++++---------- + libudev/libudev-private.h | 8 +- + libudev/libudev-util.c | 75 +++++++++++-- + libudev/libudev.h | 4 +- + udev/udev-event.c | 1 - + udev/udev-rules.c | 14 +++ + udev/udev.xml | 13 ++ + udev/udevadm-monitor.c | 17 +++- + udev/udevadm-trigger.c | 7 +- + udev/udevadm.xml | 13 ++ + 16 files changed, 595 insertions(+), 184 deletions(-) + +diff --git a/Makefile.am b/Makefile.am +index 7403949..9d3fefd 100644 +--- a/Makefile.am ++++ b/Makefile.am +@@ -28,9 +28,9 @@ CLEANFILES = + # ------------------------------------------------------------------------------ + # libudev + # ------------------------------------------------------------------------------ +-LIBUDEV_CURRENT=7 ++LIBUDEV_CURRENT=8 + LIBUDEV_REVISION=0 +-LIBUDEV_AGE=7 ++LIBUDEV_AGE=8 + + SUBDIRS += libudev/docs + +diff --git a/libudev/docs/libudev-sections.txt b/libudev/docs/libudev-sections.txt +index ca781ff..3f8c107 100644 +--- a/libudev/docs/libudev-sections.txt ++++ b/libudev/docs/libudev-sections.txt +@@ -68,6 +68,7 @@ udev_monitor_enable_receiving + udev_monitor_get_fd + udev_monitor_receive_device + udev_monitor_filter_add_match_subsystem_devtype ++udev_monitor_filter_add_match_tag + udev_monitor_filter_update + udev_monitor_filter_remove + +@@ -85,6 +86,7 @@ udev_enumerate_add_nomatch_subsystem + udev_enumerate_add_match_sysattr + udev_enumerate_add_nomatch_sysattr + udev_enumerate_add_match_property ++udev_enumerate_add_match_tag + udev_enumerate_add_match_sysname + udev_enumerate_add_syspath + udev_enumerate_scan_devices +diff --git a/libudev/exported_symbols b/libudev/exported_symbols +index 61486c6..c0ca4b9 100644 +--- a/libudev/exported_symbols ++++ b/libudev/exported_symbols +@@ -60,6 +60,7 @@ udev_monitor_get_udev + udev_monitor_get_fd + udev_monitor_receive_device + udev_monitor_filter_add_match_subsystem_devtype ++udev_monitor_filter_add_match_tag + udev_monitor_filter_update + udev_monitor_filter_remove + udev_queue_new +diff --git a/libudev/libudev-device-private.c b/libudev/libudev-device-private.c +index 5e4381e..13f1ebf 100644 +--- a/libudev/libudev-device-private.c ++++ b/libudev/libudev-device-private.c +@@ -1,7 +1,7 @@ + /* + * libudev - interface to udev device information + * +- * Copyright (C) 2008 Kay Sievers ++ * Copyright (C) 2008-2010 Kay Sievers + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public +@@ -13,6 +13,7 @@ + #include + #include + #include ++#include + #include + #include + #include +@@ -21,6 +22,37 @@ + #include "libudev.h" + #include "libudev-private.h" + ++static int udev_device_tag_index(struct udev_device *udev_device, bool add) ++{ ++ struct udev *udev = udev_device_get_udev(udev_device); ++ struct udev_list_entry *list_entry; ++ ++ udev_list_entry_foreach(list_entry, udev_device_get_tags_list_entry(udev_device)) { ++ char filename[UTIL_PATH_SIZE]; ++ ++ util_strscpyl(filename, sizeof(filename), udev_get_dev_path(udev), "/.udev/tags/", ++ udev_list_entry_get_name(list_entry), "/", ++ udev_device_get_subsystem(udev_device), ":", udev_device_get_sysname(udev_device), NULL); ++ ++ if (add) { ++ util_create_path(udev, filename); ++ symlink(udev_device_get_devpath(udev_device), filename); ++ if (udev_device_get_sysname_old(udev_device) != NULL) { ++ char filename_old[UTIL_PATH_SIZE]; ++ ++ util_strscpyl(filename, sizeof(filename), udev_get_dev_path(udev), "/.udev/tags/", ++ udev_list_entry_get_name(list_entry), ++ udev_device_get_subsystem(udev_device), ":", udev_device_get_sysname_old(udev_device), NULL); ++ unlink(filename_old); ++ } ++ } else { ++ unlink(filename); ++ util_delete_path(udev, filename); ++ } ++ } ++ return 0; ++} ++ + int udev_device_update_db(struct udev_device *udev_device) + { + struct udev *udev = udev_device_get_udev(udev_device); +@@ -41,6 +73,8 @@ int udev_device_update_db(struct udev_device *udev_device) + udev_list_entry_foreach(list_entry, udev_device_get_properties_list_entry(udev_device)) + if (udev_list_entry_get_flags(list_entry)) + goto file; ++ if (udev_device_get_tags_list_entry(udev_device) != NULL) ++ goto file; + if (udev_device_get_devlink_priority(udev_device) != 0) + goto file; + if (udev_device_get_event_timeout(udev_device) >= 0) +@@ -80,7 +114,7 @@ file: + if (f == NULL) { + err(udev, "unable to create temporary db file '%s': %m\n", filename_tmp); + return -1; +- } ++ } + + if (udev_device_get_devnode(udev_device) != NULL) { + fprintf(f, "N:%s\n", &udev_device_get_devnode(udev_device)[devlen]); +@@ -100,10 +134,13 @@ file: + udev_list_entry_get_name(list_entry), + udev_list_entry_get_value(list_entry)); + } ++ udev_list_entry_foreach(list_entry, udev_device_get_tags_list_entry(udev_device)) ++ fprintf(f, "G:%s\n", udev_list_entry_get_name(list_entry)); + fclose(f); + rename(filename_tmp, filename); + info(udev, "created db file for '%s' in '%s'\n", udev_device_get_devpath(udev_device), filename); + out: ++ udev_device_tag_index(udev_device, true); + return 0; + } + +@@ -112,6 +149,7 @@ int udev_device_delete_db(struct udev_device *udev_device) + struct udev *udev = udev_device_get_udev(udev_device); + char filename[UTIL_PATH_SIZE]; + ++ udev_device_tag_index(udev_device, false); + util_strscpyl(filename, sizeof(filename), udev_get_dev_path(udev), "/.udev/db/", + udev_device_get_subsystem(udev_device), ":", udev_device_get_sysname(udev_device), NULL); + unlink(filename); +@@ -124,9 +162,13 @@ int udev_device_rename_db(struct udev_device *udev_device) + char filename_old[UTIL_PATH_SIZE]; + char filename[UTIL_PATH_SIZE]; + ++ if (strcmp(udev_device_get_sysname(udev_device), udev_device_get_sysname_old(udev_device)) == 0) ++ return 0; ++ + util_strscpyl(filename_old, sizeof(filename_old), udev_get_dev_path(udev), "/.udev/db/", + udev_device_get_subsystem(udev_device), ":", udev_device_get_sysname_old(udev_device), NULL); + util_strscpyl(filename, sizeof(filename), udev_get_dev_path(udev), "/.udev/db/", + udev_device_get_subsystem(udev_device), ":", udev_device_get_sysname(udev_device), NULL); ++ udev_device_tag_index(udev_device, true); + return rename(filename_old, filename); + } +diff --git a/libudev/libudev-device.c b/libudev/libudev-device.c +index 4003545..478fdcb 100644 +--- a/libudev/libudev-device.c ++++ b/libudev/libudev-device.c +@@ -60,6 +60,7 @@ struct udev_device { + struct udev_list_node devlinks_list; + struct udev_list_node properties_list; + struct udev_list_node sysattr_list; ++ struct udev_list_node tags_list; + unsigned long long int seqnum; + int event_timeout; + int timeout; +@@ -68,18 +69,21 @@ struct udev_device { + dev_t devnum; + int watch_handle; + int maj, min; +- unsigned int parent_set:1; +- unsigned int subsystem_set:1; +- unsigned int devtype_set:1; +- unsigned int devlinks_uptodate:1; +- unsigned int envp_uptodate:1; +- unsigned int driver_set:1; +- unsigned int info_loaded:1; ++ bool parent_set; ++ bool subsystem_set; ++ bool devtype_set; ++ bool devlinks_uptodate; ++ bool envp_uptodate; ++ bool tags_uptodate; ++ bool driver_set; ++ bool info_loaded; ++ bool db_loaded; ++ bool uevent_loaded; + }; + + struct udev_list_entry *udev_device_add_property(struct udev_device *udev_device, const char *key, const char *value) + { +- udev_device->envp_uptodate = 0; ++ udev_device->envp_uptodate = false; + if (value == NULL) { + struct udev_list_entry *list_entry; + +@@ -149,6 +153,26 @@ void udev_device_add_property_from_string_parse(struct udev_device *udev_device, + } + if (slink[0] != '\0') + udev_device_add_devlink(udev_device, slink, 0); ++ } else if (strncmp(property, "TAGS=", 5) == 0) { ++ char tags[UTIL_PATH_SIZE]; ++ char *next; ++ ++ util_strscpy(tags, sizeof(tags), &property[5]); ++ next = strchr(tags, ':'); ++ if (next != NULL) { ++ next++; ++ while (next[0] != '\0') { ++ char *tag; ++ ++ tag = next; ++ next = strchr(tag, ':'); ++ if (next == NULL) ++ break; ++ next[0] = '\0'; ++ next++; ++ udev_device_add_tag(udev_device, tag); ++ } ++ } + } else if (strncmp(property, "DRIVER=", 7) == 0) { + udev_device_set_driver(udev_device, &property[7]); + } else if (strncmp(property, "ACTION=", 7) == 0) { +@@ -208,6 +232,9 @@ int udev_device_read_db(struct udev_device *udev_device) + char line[UTIL_LINE_SIZE]; + FILE *f; + ++ if (udev_device->db_loaded) ++ return 0; ++ + util_strscpyl(filename, sizeof(filename), udev_get_dev_path(udev_device->udev), "/.udev/db/", + udev_device_get_subsystem(udev_device), ":", udev_device_get_sysname(udev_device), NULL); + +@@ -284,6 +311,9 @@ int udev_device_read_db(struct udev_device *udev_device) + case 'E': + udev_device_add_property_from_string(udev_device, val); + break; ++ case 'G': ++ udev_device_add_tag(udev_device, val); ++ break; + case 'W': + udev_device_set_watch_handle(udev_device, atoi(val)); + break; +@@ -292,6 +322,7 @@ int udev_device_read_db(struct udev_device *udev_device) + fclose(f); + + info(udev_device->udev, "device %p filled with db file data\n", udev_device); ++ udev_device->db_loaded = true; + return 0; + } + +@@ -303,6 +334,9 @@ int udev_device_read_uevent_file(struct udev_device *udev_device) + int maj = 0; + int min = 0; + ++ if (udev_device->uevent_loaded) ++ return 0; ++ + util_strscpyl(filename, sizeof(filename), udev_device->syspath, "/uevent", NULL); + f = fopen(filename, "r"); + if (f == NULL) +@@ -329,21 +363,14 @@ int udev_device_read_uevent_file(struct udev_device *udev_device) + } + + udev_device->devnum = makedev(maj, min); +- + fclose(f); ++ udev_device->uevent_loaded = true; + return 0; + } + +-static void device_load_info(struct udev_device *device) +-{ +- device->info_loaded = 1; +- udev_device_read_uevent_file(device); +- udev_device_read_db(device); +-} +- + void udev_device_set_info_loaded(struct udev_device *device) + { +- device->info_loaded = 1; ++ device->info_loaded = true; + } + + struct udev_device *udev_device_new(struct udev *udev) +@@ -362,6 +389,7 @@ struct udev_device *udev_device_new(struct udev *udev) + udev_list_init(&udev_device->devlinks_list); + udev_list_init(&udev_device->properties_list); + udev_list_init(&udev_device->sysattr_list); ++ udev_list_init(&udev_device->tags_list); + udev_device->event_timeout = -1; + udev_device->watch_handle = -1; + /* copy global properties */ +@@ -420,7 +448,7 @@ struct udev_device *udev_device_new_from_syspath(struct udev *udev, const char * + util_strscpy(path, sizeof(path), syspath); + util_resolve_sys_link(udev, path, sizeof(path)); + +- if (strncmp(&syspath[len], "/devices/", 9) == 0) { ++ if (strncmp(&path[len], "/devices/", 9) == 0) { + char file[UTIL_PATH_SIZE]; + + /* all "devices" require a "uevent" file */ +@@ -648,7 +676,7 @@ struct udev_device *udev_device_get_parent(struct udev_device *udev_device) + if (udev_device == NULL) + return NULL; + if (!udev_device->parent_set) { +- udev_device->parent_set = 1; ++ udev_device->parent_set = true; + udev_device->parent_device = device_new_from_parent(udev_device); + } + if (udev_device->parent_device != NULL) +@@ -758,12 +786,13 @@ void udev_device_unref(struct udev_device *udev_device) + free(udev_device->devtype); + udev_list_cleanup_entries(udev_device->udev, &udev_device->devlinks_list); + udev_list_cleanup_entries(udev_device->udev, &udev_device->properties_list); ++ udev_list_cleanup_entries(udev_device->udev, &udev_device->sysattr_list); ++ udev_list_cleanup_entries(udev_device->udev, &udev_device->tags_list); + free(udev_device->action); + free(udev_device->driver); + free(udev_device->devpath_old); + free(udev_device->sysname_old); + free(udev_device->knodename); +- udev_list_cleanup_entries(udev_device->udev, &udev_device->sysattr_list); + free(udev_device->envp); + free(udev_device->monitor_buf); + dbg(udev_device->udev, "udev_device: %p released\n", udev_device); +@@ -842,7 +871,7 @@ const char *udev_device_get_devnode(struct udev_device *udev_device) + if (udev_device == NULL) + return NULL; + if (!udev_device->info_loaded) +- device_load_info(udev_device); ++ udev_device_read_db(udev_device); + return udev_device->devnode; + } + +@@ -862,7 +891,7 @@ const char *udev_device_get_subsystem(struct udev_device *udev_device) + if (udev_device == NULL) + return NULL; + if (!udev_device->subsystem_set) { +- udev_device->subsystem_set = 1; ++ udev_device->subsystem_set = true; + /* read "subsystem" link */ + if (util_get_sys_subsystem(udev_device->udev, udev_device->syspath, subsystem, sizeof(subsystem)) > 0) { + udev_device_set_subsystem(udev_device, subsystem); +@@ -900,9 +929,8 @@ const char *udev_device_get_devtype(struct udev_device *udev_device) + if (udev_device == NULL) + return NULL; + if (!udev_device->devtype_set) { +- udev_device->devtype_set = 1; +- if (!udev_device->info_loaded) +- udev_device_read_uevent_file(udev_device); ++ udev_device->devtype_set = true; ++ udev_device_read_uevent_file(udev_device); + } + return udev_device->devtype; + } +@@ -925,13 +953,13 @@ struct udev_list_entry *udev_device_get_devlinks_list_entry(struct udev_device * + if (udev_device == NULL) + return NULL; + if (!udev_device->info_loaded) +- device_load_info(udev_device); ++ udev_device_read_db(udev_device); + return udev_list_get_entry(&udev_device->devlinks_list); + } + + void udev_device_cleanup_devlinks_list(struct udev_device *udev_device) + { +- udev_device->devlinks_uptodate = 0; ++ udev_device->devlinks_uptodate = false; + udev_list_cleanup_entries(udev_device->udev, &udev_device->devlinks_list); + } + +@@ -951,13 +979,15 @@ struct udev_list_entry *udev_device_get_properties_list_entry(struct udev_device + { + if (udev_device == NULL) + return NULL; +- if (!udev_device->info_loaded) +- device_load_info(udev_device); ++ if (!udev_device->info_loaded) { ++ udev_device_read_uevent_file(udev_device); ++ udev_device_read_db(udev_device); ++ } + if (!udev_device->devlinks_uptodate) { + char symlinks[UTIL_PATH_SIZE]; + struct udev_list_entry *list_entry; + +- udev_device->devlinks_uptodate = 1; ++ udev_device->devlinks_uptodate = true; + list_entry = udev_device_get_devlinks_list_entry(udev_device); + if (list_entry != NULL) { + char *s; +@@ -970,6 +1000,21 @@ struct udev_list_entry *udev_device_get_properties_list_entry(struct udev_device + udev_device_add_property(udev_device, "DEVLINKS", symlinks); + } + } ++ if (!udev_device->tags_uptodate) { ++ udev_device->tags_uptodate = true; ++ if (udev_device_get_tags_list_entry(udev_device) != NULL) { ++ char tags[UTIL_PATH_SIZE]; ++ struct udev_list_entry *list_entry; ++ char *s; ++ size_t l; ++ ++ s = tags; ++ l = util_strpcpyl(&s, sizeof(tags), ":", NULL); ++ udev_list_entry_foreach(list_entry, udev_device_get_tags_list_entry(udev_device)) ++ l = util_strpcpyl(&s, l, udev_list_entry_get_name(list_entry), ":", NULL); ++ udev_device_add_property(udev_device, "TAGS", tags); ++ } ++ } + return udev_list_get_entry(&udev_device->properties_list); + } + +@@ -986,7 +1031,7 @@ const char *udev_device_get_driver(struct udev_device *udev_device) + if (udev_device == NULL) + return NULL; + if (!udev_device->driver_set) { +- udev_device->driver_set = 1; ++ udev_device->driver_set = true; + if (util_get_sys_driver(udev_device->udev, udev_device->syspath, driver, sizeof(driver)) > 0) + udev_device->driver = strdup(driver); + } +@@ -1004,7 +1049,7 @@ dev_t udev_device_get_devnum(struct udev_device *udev_device) + if (udev_device == NULL) + return makedev(0, 0); + if (!udev_device->info_loaded) +- device_load_info(udev_device); ++ udev_device_read_uevent_file(udev_device); + return udev_device->devnum; + } + +@@ -1184,7 +1229,7 @@ int udev_device_set_subsystem(struct udev_device *udev_device, const char *subsy + udev_device->subsystem = strdup(subsystem); + if (udev_device->subsystem == NULL) + return -ENOMEM; +- udev_device->subsystem_set = 1; ++ udev_device->subsystem_set = true; + udev_device_add_property(udev_device, "SUBSYSTEM", udev_device->subsystem); + return 0; + } +@@ -1195,7 +1240,7 @@ int udev_device_set_devtype(struct udev_device *udev_device, const char *devtype + udev_device->devtype = strdup(devtype); + if (udev_device->devtype == NULL) + return -ENOMEM; +- udev_device->devtype_set = 1; ++ udev_device->devtype_set = true; + udev_device_add_property(udev_device, "DEVTYPE", udev_device->devtype); + return 0; + } +@@ -1216,7 +1261,7 @@ int udev_device_add_devlink(struct udev_device *udev_device, const char *devlink + { + struct udev_list_entry *list_entry; + +- udev_device->devlinks_uptodate = 0; ++ udev_device->devlinks_uptodate = false; + list_entry = udev_list_entry_add(udev_device->udev, &udev_device->devlinks_list, devlink, NULL, 1, 0); + if (list_entry == NULL) + return -ENOMEM; +@@ -1225,6 +1270,40 @@ int udev_device_add_devlink(struct udev_device *udev_device, const char *devlink + return 0; + } + ++int udev_device_add_tag(struct udev_device *udev_device, const char *tag) ++{ ++ if (strchr(tag, ':') != NULL || strchr(tag, ' ') != NULL) ++ return -EINVAL; ++ udev_device->tags_uptodate = false; ++ if (udev_list_entry_add(udev_device->udev, &udev_device->tags_list, tag, NULL, 1, 0) != NULL) ++ return 0; ++ return -ENOMEM; ++} ++ ++void udev_device_cleanup_tags_list(struct udev_device *udev_device) ++{ ++ udev_device->tags_uptodate = false; ++ udev_list_cleanup_entries(udev_device->udev, &udev_device->tags_list); ++} ++ ++struct udev_list_entry *udev_device_get_tags_list_entry(struct udev_device *udev_device) ++{ ++ return udev_list_get_entry(&udev_device->tags_list); ++} ++ ++int udev_device_has_tag(struct udev_device *udev_device, const char *tag) ++{ ++ struct udev_list_entry *list_entry; ++ ++ if (!udev_device->info_loaded) ++ udev_device_read_db(udev_device); ++ list_entry = udev_device_get_tags_list_entry(udev_device); ++ list_entry = udev_list_entry_get_by_name(list_entry, tag); ++ if (list_entry != NULL) ++ return 1; ++ return 0; ++} ++ + #define ENVP_SIZE 128 + #define MONITOR_BUF_SIZE 4096 + static int update_envp_monitor_buf(struct udev_device *udev_device) +@@ -1273,7 +1352,7 @@ static int update_envp_monitor_buf(struct udev_device *udev_device) + } + udev_device->envp[i] = NULL; + udev_device->monitor_buf_len = s - udev_device->monitor_buf; +- udev_device->envp_uptodate = 1; ++ udev_device->envp_uptodate = true; + dbg(udev_device->udev, "filled envp/monitor buffer, %u properties, %zu bytes\n", + i, udev_device->monitor_buf_len); + return 0; +@@ -1312,7 +1391,7 @@ int udev_device_set_driver(struct udev_device *udev_device, const char *driver) + udev_device->driver = strdup(driver); + if (udev_device->driver == NULL) + return -ENOMEM; +- udev_device->driver_set = 1; ++ udev_device->driver_set = true; + udev_device_add_property(udev_device, "DRIVER", udev_device->driver); + return 0; + } +@@ -1385,7 +1464,7 @@ int udev_device_set_timeout(struct udev_device *udev_device, int timeout) + int udev_device_get_event_timeout(struct udev_device *udev_device) + { + if (!udev_device->info_loaded) +- device_load_info(udev_device); ++ udev_device_read_db(udev_device); + return udev_device->event_timeout; + } + +@@ -1421,7 +1500,7 @@ int udev_device_set_devnum(struct udev_device *udev_device, dev_t devnum) + int udev_device_get_devlink_priority(struct udev_device *udev_device) + { + if (!udev_device->info_loaded) +- device_load_info(udev_device); ++ udev_device_read_db(udev_device); + return udev_device->devlink_priority; + } + +@@ -1434,7 +1513,7 @@ int udev_device_set_devlink_priority(struct udev_device *udev_device, int prio) + int udev_device_get_watch_handle(struct udev_device *udev_device) + { + if (!udev_device->info_loaded) +- device_load_info(udev_device); ++ udev_device_read_db(udev_device); + return udev_device->watch_handle; + } + +diff --git a/libudev/libudev-enumerate.c b/libudev/libudev-enumerate.c +index 9a61a61..da83144 100644 +--- a/libudev/libudev-enumerate.c ++++ b/libudev/libudev-enumerate.c +@@ -1,7 +1,7 @@ + /* + * libudev - interface to udev device information + * +- * Copyright (C) 2008 Kay Sievers ++ * Copyright (C) 2008-2010 Kay Sievers + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public +@@ -51,6 +51,7 @@ struct udev_enumerate { + struct udev_list_node subsystem_nomatch_list; + struct udev_list_node sysname_match_list; + struct udev_list_node properties_match_list; ++ struct udev_list_node tags_match_list; + struct udev_list_node devices_list; + struct syspath *devices; + unsigned int devices_cur; +@@ -79,6 +80,7 @@ struct udev_enumerate *udev_enumerate_new(struct udev *udev) + udev_list_init(&udev_enumerate->subsystem_nomatch_list); + udev_list_init(&udev_enumerate->sysname_match_list); + udev_list_init(&udev_enumerate->properties_match_list); ++ udev_list_init(&udev_enumerate->tags_match_list); + udev_list_init(&udev_enumerate->devices_list); + return udev_enumerate; + } +@@ -121,6 +123,7 @@ void udev_enumerate_unref(struct udev_enumerate *udev_enumerate) + udev_list_cleanup_entries(udev_enumerate->udev, &udev_enumerate->subsystem_nomatch_list); + udev_list_cleanup_entries(udev_enumerate->udev, &udev_enumerate->sysname_match_list); + udev_list_cleanup_entries(udev_enumerate->udev, &udev_enumerate->properties_match_list); ++ udev_list_cleanup_entries(udev_enumerate->udev, &udev_enumerate->tags_match_list); + udev_list_cleanup_entries(udev_enumerate->udev, &udev_enumerate->devices_list); + for (i = 0; i < udev_enumerate->devices_cur; i++) + free(udev_enumerate->devices[i].syspath); +@@ -191,7 +194,7 @@ static int syspath_cmp(const void *p1, const void *p2) + } + + /* For devices that should be moved to the absolute end of the list */ +-static int devices_delay_end(struct udev *udev, const char *syspath) ++static bool devices_delay_end(struct udev *udev, const char *syspath) + { + static const char *delay_device_list[] = { + "/block/md", +@@ -205,10 +208,10 @@ static int devices_delay_end(struct udev *udev, const char *syspath) + for (i = 0; delay_device_list[i] != NULL; i++) { + if (strstr(&syspath[len], delay_device_list[i]) != NULL) { + dbg(udev, "delaying: %s\n", syspath); +- return 1; ++ return true; + } + } +- return 0; ++ return false; + } + + /* For devices that should just be moved a little bit later, just +@@ -394,16 +397,12 @@ int udev_enumerate_add_nomatch_sysattr(struct udev_enumerate *udev_enumerate, co + return 0; + } + +-static int match_sysattr_value(struct udev *udev, const char *syspath, const char *sysattr, const char *match_val) ++static int match_sysattr_value(struct udev_device *dev, const char *sysattr, const char *match_val) + { +- struct udev_device *device; + const char *val = NULL; + bool match = false; + +- device = udev_device_new_from_syspath(udev, syspath); +- if (device == NULL) +- return -EINVAL; +- val = udev_device_get_sysattr_value(device, sysattr); ++ val = udev_device_get_sysattr_value(dev, sysattr); + if (val == NULL) + goto exit; + if (match_val == NULL) { +@@ -415,7 +414,6 @@ static int match_sysattr_value(struct udev *udev, const char *syspath, const cha + goto exit; + } + exit: +- udev_device_unref(device); + return match; + } + +@@ -440,6 +438,25 @@ int udev_enumerate_add_match_property(struct udev_enumerate *udev_enumerate, con + } + + /** ++ * udev_enumerate_add_match_tag: ++ * @udev_enumerate: context ++ * @tag: filter for a tag of the device to include in the list ++ * ++ * Returns: 0 on success, otherwise a negative error value. ++ */ ++int udev_enumerate_add_match_tag(struct udev_enumerate *udev_enumerate, const char *tag) ++{ ++ if (udev_enumerate == NULL) ++ return -EINVAL; ++ if (tag == NULL) ++ return 0; ++ if (udev_list_entry_add(udev_enumerate_get_udev(udev_enumerate), ++ &udev_enumerate->tags_match_list, tag, NULL, 1, 0) == NULL) ++ return -ENOMEM; ++ return 0; ++} ++ ++/** + * udev_enumerate_add_match_sysname: + * @udev_enumerate: context + * @sysname: filter for the name of the device to include in the list +@@ -458,46 +475,37 @@ int udev_enumerate_add_match_sysname(struct udev_enumerate *udev_enumerate, cons + return 0; + } + +-static int match_sysattr(struct udev_enumerate *udev_enumerate, const char *syspath) ++static bool match_sysattr(struct udev_enumerate *udev_enumerate, struct udev_device *dev) + { +- struct udev *udev = udev_enumerate_get_udev(udev_enumerate); + struct udev_list_entry *list_entry; + + /* skip list */ + udev_list_entry_foreach(list_entry, udev_list_get_entry(&udev_enumerate->sysattr_nomatch_list)) { +- if (match_sysattr_value(udev, syspath, +- udev_list_entry_get_name(list_entry), +- udev_list_entry_get_value(list_entry))) +- return 0; ++ if (match_sysattr_value(dev, udev_list_entry_get_name(list_entry), ++ udev_list_entry_get_value(list_entry))) ++ return false; + } + /* include list */ + if (udev_list_get_entry(&udev_enumerate->sysattr_match_list) != NULL) { + udev_list_entry_foreach(list_entry, udev_list_get_entry(&udev_enumerate->sysattr_match_list)) { + /* anything that does not match, will make it FALSE */ +- if (!match_sysattr_value(udev, syspath, +- udev_list_entry_get_name(list_entry), +- udev_list_entry_get_value(list_entry))) +- return 0; ++ if (!match_sysattr_value(dev, udev_list_entry_get_name(list_entry), ++ udev_list_entry_get_value(list_entry))) ++ return false; + } +- return 1; ++ return true; + } +- return 1; ++ return true; + } + +-static int match_property(struct udev_enumerate *udev_enumerate, const char *syspath) ++static bool match_property(struct udev_enumerate *udev_enumerate, struct udev_device *dev) + { +- struct udev_device *dev; + struct udev_list_entry *list_entry; +- int match = false; ++ bool match = false; + + /* no match always matches */ + if (udev_list_get_entry(&udev_enumerate->properties_match_list) == NULL) +- return 1; +- +- /* no device does not match */ +- dev = udev_device_new_from_syspath(udev_enumerate->udev, syspath); +- if (dev == NULL) +- return 0; ++ return true; + + /* loop over matches */ + udev_list_entry_foreach(list_entry, udev_list_get_entry(&udev_enumerate->properties_match_list)) { +@@ -525,23 +533,38 @@ static int match_property(struct udev_enumerate *udev_enumerate, const char *sys + } + } + out: +- udev_device_unref(dev); + return match; + } + +-static int match_sysname(struct udev_enumerate *udev_enumerate, const char *sysname) ++static bool match_tag(struct udev_enumerate *udev_enumerate, struct udev_device *dev) ++{ ++ struct udev_list_entry *list_entry; ++ ++ /* no match always matches */ ++ if (udev_list_get_entry(&udev_enumerate->tags_match_list) == NULL) ++ return true; ++ ++ /* loop over matches */ ++ udev_list_entry_foreach(list_entry, udev_list_get_entry(&udev_enumerate->tags_match_list)) ++ if (!udev_device_has_tag(dev, udev_list_entry_get_name(list_entry))) ++ return false; ++ ++ return true; ++} ++ ++static bool match_sysname(struct udev_enumerate *udev_enumerate, const char *sysname) + { + struct udev_list_entry *list_entry; + + if (udev_list_get_entry(&udev_enumerate->sysname_match_list) == NULL) +- return 1; ++ return true; + + udev_list_entry_foreach(list_entry, udev_list_get_entry(&udev_enumerate->sysname_match_list)) { + if (fnmatch(udev_list_entry_get_name(list_entry), sysname, 0) != 0) + continue; +- return 1; ++ return true; + } +- return 0; ++ return false; + } + + static int scan_dir_and_add_devices(struct udev_enumerate *udev_enumerate, +@@ -562,54 +585,53 @@ static int scan_dir_and_add_devices(struct udev_enumerate *udev_enumerate, + util_strpcpyl(&s, l, "/", subdir2, NULL); + dir = opendir(path); + if (dir == NULL) +- return -1; ++ return -ENOENT; + for (dent = readdir(dir); dent != NULL; dent = readdir(dir)) { + char syspath[UTIL_PATH_SIZE]; +- char filename[UTIL_PATH_SIZE]; +- struct stat statbuf; ++ struct udev_device *dev; + + if (dent->d_name[0] == '.') + continue; ++ + if (!match_sysname(udev_enumerate, dent->d_name)) + continue; + + util_strscpyl(syspath, sizeof(syspath), path, "/", dent->d_name, NULL); +- if (!match_property(udev_enumerate, syspath)) +- continue; +- if (lstat(syspath, &statbuf) != 0) +- continue; +- if (S_ISREG(statbuf.st_mode)) ++ dev = udev_device_new_from_syspath(udev_enumerate->udev, syspath); ++ if (dev == NULL) + continue; +- if (S_ISLNK(statbuf.st_mode)) +- util_resolve_sys_link(udev, syspath, sizeof(syspath)); + +- util_strscpyl(filename, sizeof(filename), syspath, "/uevent", NULL); +- if (stat(filename, &statbuf) != 0) +- continue; +- if (!match_sysattr(udev_enumerate, syspath)) +- continue; +- syspath_add(udev_enumerate, syspath); ++ if (!match_tag(udev_enumerate, dev)) ++ goto nomatch; ++ if (!match_property(udev_enumerate, dev)) ++ goto nomatch; ++ if (!match_sysattr(udev_enumerate, dev)) ++ goto nomatch; ++ ++ syspath_add(udev_enumerate, udev_device_get_syspath(dev)); ++nomatch: ++ udev_device_unref(dev); + } + closedir(dir); + return 0; + } + +-static int match_subsystem(struct udev_enumerate *udev_enumerate, const char *subsystem) ++static bool match_subsystem(struct udev_enumerate *udev_enumerate, const char *subsystem) + { + struct udev_list_entry *list_entry; + + udev_list_entry_foreach(list_entry, udev_list_get_entry(&udev_enumerate->subsystem_nomatch_list)) { + if (fnmatch(udev_list_entry_get_name(list_entry), subsystem, 0) == 0) +- return 0; ++ return false; + } + if (udev_list_get_entry(&udev_enumerate->subsystem_match_list) != NULL) { + udev_list_entry_foreach(list_entry, udev_list_get_entry(&udev_enumerate->subsystem_match_list)) { + if (fnmatch(udev_list_entry_get_name(list_entry), subsystem, 0) == 0) +- return 1; ++ return true; + } +- return 0; ++ return false; + } +- return 1; ++ return true; + } + + static int scan_dir(struct udev_enumerate *udev_enumerate, const char *basedir, const char *subdir, const char *subsystem) +@@ -675,17 +697,59 @@ int udev_enumerate_scan_devices(struct udev_enumerate *udev_enumerate) + + if (udev_enumerate == NULL) + return -EINVAL; +- util_strscpyl(base, sizeof(base), udev_get_sys_path(udev), "/subsystem", NULL); +- if (stat(base, &statbuf) == 0) { +- /* we have /subsystem/, forget all the old stuff */ +- dbg(udev, "searching '/subsystem/*/devices/*' dir\n"); +- scan_dir(udev_enumerate, "subsystem", "devices", NULL); ++ ++ if (udev_list_get_entry(&udev_enumerate->tags_match_list) != NULL) { ++ struct udev_list_entry *list_entry; ++ ++ /* scan only tagged devices, use tags reverse-index, instead of searching all devices in /sys */ ++ udev_list_entry_foreach(list_entry, udev_list_get_entry(&udev_enumerate->tags_match_list)) { ++ DIR *dir; ++ struct dirent *dent; ++ char path[UTIL_PATH_SIZE]; ++ ++ util_strscpyl(path, sizeof(path), udev_get_dev_path(udev), "/.udev/tags/", ++ udev_list_entry_get_name(list_entry), NULL); ++ dir = opendir(path); ++ if (dir == NULL) ++ continue; ++ for (dent = readdir(dir); dent != NULL; dent = readdir(dir)) { ++ struct udev_device *dev; ++ char syspath[UTIL_PATH_SIZE]; ++ char *s; ++ size_t l; ++ ssize_t len; ++ ++ if (dent->d_name[0] == '.') ++ continue; ++ ++ s = syspath; ++ l = util_strpcpyl(&s, sizeof(syspath), udev_get_sys_path(udev), NULL); ++ len = readlinkat(dirfd(dir), dent->d_name, s, l); ++ if (len <= 0 || (size_t)len == l) ++ continue; ++ s[len] = '\0'; ++ ++ dev = udev_device_new_from_syspath(udev_enumerate->udev, syspath); ++ if (dev == NULL) ++ continue; ++ syspath_add(udev_enumerate, udev_device_get_syspath(dev)); ++ udev_device_unref(dev); ++ } ++ } + } else { ++ util_strscpyl(base, sizeof(base), udev_get_sys_path(udev), "/subsystem", NULL); ++ if (stat(base, &statbuf) == 0) { ++ /* we have /subsystem/, forget all the old stuff */ ++ dbg(udev, "searching '/subsystem/*/devices/*' dir\n"); ++ scan_dir(udev_enumerate, "subsystem", "devices", NULL); ++ } else { + dbg(udev, "searching '/bus/*/devices/*' dir\n"); +- scan_dir(udev_enumerate, "bus", "devices", NULL); +- dbg(udev, "searching '/class/*' dir\n"); +- scan_dir(udev_enumerate, "class", NULL, NULL); ++ scan_dir(udev_enumerate, "bus", "devices", NULL); ++ dbg(udev, "searching '/class/*' dir\n"); ++ scan_dir(udev_enumerate, "class", NULL, NULL); ++ } + } ++ + return 0; + } + +@@ -704,6 +768,7 @@ int udev_enumerate_scan_subsystems(struct udev_enumerate *udev_enumerate) + + if (udev_enumerate == NULL) + return -EINVAL; ++ + util_strscpyl(base, sizeof(base), udev_get_sys_path(udev), "/subsystem", NULL); + if (stat(base, &statbuf) == 0) + subsysdir = "subsystem"; +diff --git a/libudev/libudev-monitor.c b/libudev/libudev-monitor.c +index 97e52c4..24e8aea 100644 +--- a/libudev/libudev-monitor.c ++++ b/libudev/libudev-monitor.c +@@ -1,7 +1,7 @@ + /* + * libudev - interface to udev device information + * +- * Copyright (C) 2008-2009 Kay Sievers ++ * Copyright (C) 2008-2010 Kay Sievers + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public +@@ -49,6 +49,7 @@ struct udev_monitor { + struct sockaddr_un sun; + socklen_t addrlen; + struct udev_list_node filter_subsystem_list; ++ struct udev_list_node filter_tag_list; + }; + + enum udev_monitor_netlink_group { +@@ -57,25 +58,28 @@ enum udev_monitor_netlink_group { + UDEV_MONITOR_UDEV, + }; + +-#define UDEV_MONITOR_MAGIC 0xcafe1dea ++#define UDEV_MONITOR_MAGIC 0xfeedcafe + struct udev_monitor_netlink_header { +- /* udev version text */ +- char version[16]; ++ /* "libudev" prefix to distinguish libudev and kernel messages */ ++ char prefix[8]; + /* + * magic to protect against daemon <-> library message format mismatch + * used in the kernel from socket filter rules; needs to be stored in network order + */ + unsigned int magic; +- /* properties buffer */ +- unsigned short properties_off; +- unsigned short properties_len; ++ /* total length of header structure known to the sender */ ++ unsigned int header_size; ++ /* properties string buffer */ ++ unsigned int properties_off; ++ unsigned int properties_len; + /* +- * hashes of some common device properties strings to filter with socket filters in +- * the client used in the kernel from socket filter rules; needs to be stored in +- * network order ++ * hashes of primary device properties strings, to let libudev subscribers ++ * use in-kernel socket filters; values need to be stored in network order + */ +- unsigned int filter_subsystem; +- unsigned int filter_devtype; ++ unsigned int filter_subsystem_hash; ++ unsigned int filter_devtype_hash; ++ unsigned int filter_tag_bloom_hi; ++ unsigned int filter_tag_bloom_lo; + }; + + static struct udev_monitor *udev_monitor_new(struct udev *udev) +@@ -88,6 +92,7 @@ static struct udev_monitor *udev_monitor_new(struct udev *udev) + udev_monitor->refcount = 1; + udev_monitor->udev = udev; + udev_list_init(&udev_monitor->filter_subsystem_list); ++ udev_list_init(&udev_monitor->filter_tag_list); + return udev_monitor; + } + +@@ -247,13 +252,14 @@ static inline void bpf_jmp(struct sock_filter *inss, unsigned int *i, + */ + int udev_monitor_filter_update(struct udev_monitor *udev_monitor) + { +- static struct sock_filter ins[256]; +- static struct sock_fprog filter; ++ struct sock_filter ins[512]; ++ struct sock_fprog filter; + unsigned int i; + struct udev_list_entry *list_entry; + int err; + +- if (udev_list_get_entry(&udev_monitor->filter_subsystem_list) == NULL) ++ if (udev_list_get_entry(&udev_monitor->filter_subsystem_list) == NULL && ++ udev_list_get_entry(&udev_monitor->filter_tag_list) == NULL) + return 0; + + memset(ins, 0x00, sizeof(ins)); +@@ -266,35 +272,74 @@ int udev_monitor_filter_update(struct udev_monitor *udev_monitor) + /* wrong magic, pass packet */ + bpf_stmt(ins, &i, BPF_RET|BPF_K, 0xffffffff); + +- /* add all subsystem match values */ +- udev_list_entry_foreach(list_entry, udev_list_get_entry(&udev_monitor->filter_subsystem_list)) { +- unsigned int hash; +- +- /* load filter_subsystem value in A */ +- bpf_stmt(ins, &i, BPF_LD|BPF_W|BPF_ABS, offsetof(struct udev_monitor_netlink_header, filter_subsystem)); +- hash = util_string_hash32(udev_list_entry_get_name(list_entry)); +- if (udev_list_entry_get_value(list_entry) == NULL) { +- /* jump if subsystem does not match */ +- bpf_jmp(ins, &i, BPF_JMP|BPF_JEQ|BPF_K, hash, 0, 1); +- } else { +- /* jump if subsystem does not match */ +- bpf_jmp(ins, &i, BPF_JMP|BPF_JEQ|BPF_K, hash, 0, 3); +- +- /* load filter_devtype value in A */ +- bpf_stmt(ins, &i, BPF_LD|BPF_W|BPF_ABS, offsetof(struct udev_monitor_netlink_header, filter_devtype)); +- /* jump if value does not match */ +- hash = util_string_hash32(udev_list_entry_get_value(list_entry)); +- bpf_jmp(ins, &i, BPF_JMP|BPF_JEQ|BPF_K, hash, 0, 1); ++ if (udev_list_get_entry(&udev_monitor->filter_tag_list) != NULL) { ++ int tag_matches; ++ ++ /* count tag matches, to calculate end of tag match block */ ++ tag_matches = 0; ++ udev_list_entry_foreach(list_entry, udev_list_get_entry(&udev_monitor->filter_tag_list)) ++ tag_matches++; ++ ++ /* add all tags matches */ ++ udev_list_entry_foreach(list_entry, udev_list_get_entry(&udev_monitor->filter_tag_list)) { ++ uint64_t tag_bloom_bits = util_string_bloom64(udev_list_entry_get_name(list_entry)); ++ uint32_t tag_bloom_hi = tag_bloom_bits >> 32; ++ uint32_t tag_bloom_lo = tag_bloom_bits & 0xffffffff; ++ ++ /* load device bloom bits in A */ ++ bpf_stmt(ins, &i, BPF_LD|BPF_W|BPF_ABS, offsetof(struct udev_monitor_netlink_header, filter_tag_bloom_hi)); ++ /* clear bits (tag bits & bloom bits) */ ++ bpf_stmt(ins, &i, BPF_ALU|BPF_AND|BPF_K, tag_bloom_hi); ++ /* jump to next tag if it does not match */ ++ bpf_jmp(ins, &i, BPF_JMP|BPF_JEQ|BPF_K, tag_bloom_hi, 0, 3); ++ ++ /* load device bloom bits in A */ ++ bpf_stmt(ins, &i, BPF_LD|BPF_W|BPF_ABS, offsetof(struct udev_monitor_netlink_header, filter_tag_bloom_lo)); ++ /* clear bits (tag bits & bloom bits) */ ++ bpf_stmt(ins, &i, BPF_ALU|BPF_AND|BPF_K, tag_bloom_lo); ++ /* jump behind end of tag match block if tag matches */ ++ tag_matches--; ++ bpf_jmp(ins, &i, BPF_JMP|BPF_JEQ|BPF_K, tag_bloom_lo, 1 + (tag_matches * 6), 0); + } + +- /* matched, pass packet */ +- bpf_stmt(ins, &i, BPF_RET|BPF_K, 0xffffffff); ++ /* nothing matched, drop packet */ ++ bpf_stmt(ins, &i, BPF_RET|BPF_K, 0); ++ } + +- if (i+1 >= ARRAY_SIZE(ins)) +- return -1; ++ /* add all subsystem matches */ ++ if (udev_list_get_entry(&udev_monitor->filter_subsystem_list) != NULL) { ++ udev_list_entry_foreach(list_entry, udev_list_get_entry(&udev_monitor->filter_subsystem_list)) { ++ unsigned int hash = util_string_hash32(udev_list_entry_get_name(list_entry)); ++ ++ /* load device subsystem value in A */ ++ bpf_stmt(ins, &i, BPF_LD|BPF_W|BPF_ABS, offsetof(struct udev_monitor_netlink_header, filter_subsystem_hash)); ++ if (udev_list_entry_get_value(list_entry) == NULL) { ++ /* jump if subsystem does not match */ ++ bpf_jmp(ins, &i, BPF_JMP|BPF_JEQ|BPF_K, hash, 0, 1); ++ } else { ++ /* jump if subsystem does not match */ ++ bpf_jmp(ins, &i, BPF_JMP|BPF_JEQ|BPF_K, hash, 0, 3); ++ ++ /* load device devtype value in A */ ++ bpf_stmt(ins, &i, BPF_LD|BPF_W|BPF_ABS, offsetof(struct udev_monitor_netlink_header, filter_devtype_hash)); ++ /* jump if value does not match */ ++ hash = util_string_hash32(udev_list_entry_get_value(list_entry)); ++ bpf_jmp(ins, &i, BPF_JMP|BPF_JEQ|BPF_K, hash, 0, 1); ++ } ++ ++ /* matched, pass packet */ ++ bpf_stmt(ins, &i, BPF_RET|BPF_K, 0xffffffff); ++ ++ if (i+1 >= ARRAY_SIZE(ins)) ++ return -1; ++ } ++ ++ /* nothing matched, drop packet */ ++ bpf_stmt(ins, &i, BPF_RET|BPF_K, 0); + } +- /* nothing matched, drop packet */ +- bpf_stmt(ins, &i, BPF_RET|BPF_K, 0); ++ ++ /* matched, pass packet */ ++ bpf_stmt(ins, &i, BPF_RET|BPF_K, 0xffffffff); + + /* install filter */ + filter.len = i; +@@ -406,6 +451,7 @@ void udev_monitor_unref(struct udev_monitor *udev_monitor) + if (udev_monitor->sock >= 0) + close(udev_monitor->sock); + udev_list_cleanup_entries(udev_monitor->udev, &udev_monitor->filter_subsystem_list); ++ udev_list_cleanup_entries(udev_monitor->udev, &udev_monitor->filter_tag_list); + dbg(udev_monitor->udev, "monitor %p released\n", udev_monitor); + free(udev_monitor); + } +@@ -445,8 +491,7 @@ static int passes_filter(struct udev_monitor *udev_monitor, struct udev_device * + struct udev_list_entry *list_entry; + + if (udev_list_get_entry(&udev_monitor->filter_subsystem_list) == NULL) +- return 1; +- ++ goto tag; + udev_list_entry_foreach(list_entry, udev_list_get_entry(&udev_monitor->filter_subsystem_list)) { + const char *subsys = udev_list_entry_get_name(list_entry); + const char *dsubsys = udev_device_get_subsystem(udev_device); +@@ -458,11 +503,22 @@ static int passes_filter(struct udev_monitor *udev_monitor, struct udev_device * + + devtype = udev_list_entry_get_value(list_entry); + if (devtype == NULL) +- return 1; ++ goto tag; + ddevtype = udev_device_get_devtype(udev_device); + if (ddevtype == NULL) + continue; + if (strcmp(ddevtype, devtype) == 0) ++ goto tag; ++ } ++ return 0; ++ ++tag: ++ if (udev_list_get_entry(&udev_monitor->filter_tag_list) == NULL) ++ return 1; ++ udev_list_entry_foreach(list_entry, udev_list_get_entry(&udev_monitor->filter_tag_list)) { ++ const char *tag = udev_list_entry_get_name(list_entry); ++ ++ if (udev_device_has_tag(udev_device, tag)) + return 1; + } + return 0; +@@ -556,13 +612,11 @@ retry: + return NULL; + } + +- if (strncmp(buf, "udev-", 5) == 0) { ++ if (memcmp(buf, "libudev", 8) == 0) { + /* udev message needs proper version magic */ + nlh = (struct udev_monitor_netlink_header *) buf; + if (nlh->magic != htonl(UDEV_MONITOR_MAGIC)) + return NULL; +- if (nlh->properties_off < sizeof(struct udev_monitor_netlink_header)) +- return NULL; + if (nlh->properties_off+32 > buflen) + return NULL; + bufpos = nlh->properties_off; +@@ -626,17 +680,17 @@ retry: + int udev_monitor_send_device(struct udev_monitor *udev_monitor, + struct udev_monitor *destination, struct udev_device *udev_device) + { +- struct msghdr smsg; +- struct iovec iov[2]; + const char *buf; + ssize_t blen; + ssize_t count; + + blen = udev_device_get_properties_monitor_buf(udev_device, &buf); + if (blen < 32) +- return -1; ++ return -EINVAL; + + if (udev_monitor->sun.sun_family != 0) { ++ struct msghdr smsg; ++ struct iovec iov[2]; + const char *action; + char header[2048]; + char *s; +@@ -660,23 +714,41 @@ int udev_monitor_send_device(struct udev_monitor *udev_monitor, + smsg.msg_iovlen = 2; + smsg.msg_name = &udev_monitor->sun; + smsg.msg_namelen = udev_monitor->addrlen; +- } else if (udev_monitor->snl.nl_family != 0) { ++ count = sendmsg(udev_monitor->sock, &smsg, 0); ++ info(udev_monitor->udev, "passed %zi bytes to socket monitor %p\n", count, udev_monitor); ++ return count; ++ } ++ ++ if (udev_monitor->snl.nl_family != 0) { ++ struct msghdr smsg; ++ struct iovec iov[2]; + const char *val; + struct udev_monitor_netlink_header nlh; +- ++ struct udev_list_entry *list_entry; ++ uint64_t tag_bloom_bits; + + /* add versioned header */ + memset(&nlh, 0x00, sizeof(struct udev_monitor_netlink_header)); +- util_strscpy(nlh.version, sizeof(nlh.version), "udev-" VERSION); ++ memcpy(nlh.prefix, "libudev", 8); + nlh.magic = htonl(UDEV_MONITOR_MAGIC); ++ nlh.header_size = sizeof(struct udev_monitor_netlink_header); + val = udev_device_get_subsystem(udev_device); +- nlh.filter_subsystem = htonl(util_string_hash32(val)); ++ nlh.filter_subsystem_hash = htonl(util_string_hash32(val)); + val = udev_device_get_devtype(udev_device); + if (val != NULL) +- nlh.filter_devtype = htonl(util_string_hash32(val)); ++ nlh.filter_devtype_hash = htonl(util_string_hash32(val)); + iov[0].iov_base = &nlh; + iov[0].iov_len = sizeof(struct udev_monitor_netlink_header); + ++ /* add tag bloom filter */ ++ tag_bloom_bits = 0; ++ udev_list_entry_foreach(list_entry, udev_device_get_tags_list_entry(udev_device)) ++ tag_bloom_bits |= util_string_bloom64(udev_list_entry_get_name(list_entry)); ++ if (tag_bloom_bits > 0) { ++ nlh.filter_tag_bloom_hi = htonl(tag_bloom_bits >> 32); ++ nlh.filter_tag_bloom_lo = htonl(tag_bloom_bits & 0xffffffff); ++ } ++ + /* add properties list */ + nlh.properties_off = iov[0].iov_len; + nlh.properties_len = blen; +@@ -697,13 +769,12 @@ int udev_monitor_send_device(struct udev_monitor *udev_monitor, + else + smsg.msg_name = &udev_monitor->snl_destination; + smsg.msg_namelen = sizeof(struct sockaddr_nl); +- } else { +- return -1; ++ count = sendmsg(udev_monitor->sock, &smsg, 0); ++ info(udev_monitor->udev, "passed %zi bytes to netlink monitor %p\n", count, udev_monitor); ++ return count; + } + +- count = sendmsg(udev_monitor->sock, &smsg, 0); +- info(udev_monitor->udev, "passed %zi bytes to monitor %p\n", count, udev_monitor); +- return count; ++ return -EINVAL; + } + + /** +@@ -712,6 +783,9 @@ int udev_monitor_send_device(struct udev_monitor *udev_monitor, + * @subsystem: the subsystem value to match the incoming devices against + * @devtype: the devtype value to match the incoming devices against + * ++ * This filer is efficiently executed inside the kernel, and libudev subscribers ++ * will usually not be woken up for devices which do not match. ++ * + * The filter must be installed before the monitor is switched to listening mode. + * + * Returns: 0 on success, otherwise a negative error value. +@@ -721,7 +795,7 @@ int udev_monitor_filter_add_match_subsystem_devtype(struct udev_monitor *udev_mo + if (udev_monitor == NULL) + return -EINVAL; + if (subsystem == NULL) +- return 0; ++ return -EINVAL; + if (udev_list_entry_add(udev_monitor->udev, + &udev_monitor->filter_subsystem_list, subsystem, devtype, 0, 0) == NULL) + return -ENOMEM; +@@ -729,6 +803,30 @@ int udev_monitor_filter_add_match_subsystem_devtype(struct udev_monitor *udev_mo + } + + /** ++ * udev_monitor_filter_add_match_tag: ++ * @udev_monitor: the monitor ++ * @tag: the name of a tag ++ * ++ * This filer is efficiently executed inside the kernel, and libudev subscribers ++ * will usually not be woken up for devices which do not match. ++ * ++ * The filter must be installed before the monitor is switched to listening mode. ++ * ++ * Returns: 0 on success, otherwise a negative error value. ++ */ ++int udev_monitor_filter_add_match_tag(struct udev_monitor *udev_monitor, const char *tag) ++{ ++ if (udev_monitor == NULL) ++ return -EINVAL; ++ if (tag == NULL) ++ return -EINVAL; ++ if (udev_list_entry_add(udev_monitor->udev, ++ &udev_monitor->filter_tag_list, tag, NULL, 0, 0) == NULL) ++ return -ENOMEM; ++ return 0; ++} ++ ++/** + * udev_monitor_filter_remove: + * @udev_monitor: monitor + * +diff --git a/libudev/libudev-private.h b/libudev/libudev-private.h +index 8dc469e..548f4ad 100644 +--- a/libudev/libudev-private.h ++++ b/libudev/libudev-private.h +@@ -14,6 +14,8 @@ + + #include + #include ++#include ++#include + #include "libudev.h" + + #define ARRAY_SIZE(x) (sizeof(x) / sizeof((x)[0])) +@@ -84,7 +86,8 @@ const char *udev_device_get_sysname_old(struct udev_device *udev_device); + int udev_device_set_devpath_old(struct udev_device *udev_device, const char *devpath_old); + const char *udev_device_get_knodename(struct udev_device *udev_device); + int udev_device_add_tag(struct udev_device *udev_device, const char *tag); +-struct udev_list_entry *udev_device_get_tag_list_entry(struct udev_device *udev_device); ++void udev_device_cleanup_tags_list(struct udev_device *udev_device); ++struct udev_list_entry *udev_device_get_tags_list_entry(struct udev_device *udev_device); + int udev_device_has_tag(struct udev_device *udev_device, const char *tag); + int udev_device_set_knodename(struct udev_device *udev_device, const char *knodename); + int udev_device_get_timeout(struct udev_device *udev_device); +@@ -203,7 +206,8 @@ size_t util_strscpyl(char *dest, size_t size, const char *src, ...) __attribute_ + int udev_util_replace_whitespace(const char *str, char *to, size_t len); + int udev_util_replace_chars(char *str, const char *white); + int udev_util_encode_string(const char *str, char *str_enc, size_t len); +-unsigned int util_string_hash32(const char *str); ++unsigned int util_string_hash32(const char *key); ++uint64_t util_string_bloom64(const char *str); + + /* libudev-util-private.c */ + int util_create_path(struct udev *udev, const char *path); +diff --git a/libudev/libudev-util.c b/libudev/libudev-util.c +index c0209f9..3a67b0c 100644 +--- a/libudev/libudev-util.c ++++ b/libudev/libudev-util.c +@@ -481,15 +481,74 @@ err: + return -1; + } + ++/* ++ * http://sites.google.com/site/murmurhash/ ++ * ++ * All code is released to the public domain. For business purposes, ++ * Murmurhash is under the MIT license. ++ * ++ */ ++static unsigned int murmur_hash2(const char *key, int len, unsigned int seed) ++{ ++ /* ++ * 'm' and 'r' are mixing constants generated offline. ++ * They're not really 'magic', they just happen to work well. ++ */ ++ const unsigned int m = 0x5bd1e995; ++ const int r = 24; ++ ++ /* initialize the hash to a 'random' value */ ++ unsigned int h = seed ^ len; ++ ++ /* mix 4 bytes at a time into the hash */ ++ const unsigned char * data = (const unsigned char *)key; ++ ++ while(len >= 4) { ++ unsigned int k = *(unsigned int *)data; ++ ++ k *= m; ++ k ^= k >> r; ++ k *= m; ++ h *= m; ++ h ^= k; ++ ++ data += 4; ++ len -= 4; ++ } ++ ++ /* handle the last few bytes of the input array */ ++ switch(len) { ++ case 3: ++ h ^= data[2] << 16; ++ case 2: ++ h ^= data[1] << 8; ++ case 1: ++ h ^= data[0]; ++ h *= m; ++ }; ++ ++ /* do a few final mixes of the hash to ensure the last few bytes are well-incorporated */ ++ h ^= h >> 13; ++ h *= m; ++ h ^= h >> 15; ++ ++ return h; ++} ++ + unsigned int util_string_hash32(const char *str) + { +- unsigned int hash = 0; ++ return murmur_hash2(str, strlen(str), 0); ++} + +- while (str[0] != '\0') { +- hash += str[0] << 4; +- hash += str[0] >> 4; +- hash *= 11; +- str++; +- } +- return hash; ++/* get a bunch of bit numbers out of the hash, and set the bits in our bit field */ ++uint64_t util_string_bloom64(const char *str) ++{ ++ uint64_t bits = 0; ++ unsigned int hash = util_string_hash32(str); ++ ++ bits |= 1LLU << (hash & 63); ++ bits |= 1LLU << ((hash >> 6) & 63); ++ bits |= 1LLU << ((hash >> 12) & 63); ++ bits |= 1LLU << ((hash >> 18) & 63); ++ return bits; + } +diff --git a/libudev/libudev.h b/libudev/libudev.h +index 750664f..3b73fbd 100644 +--- a/libudev/libudev.h ++++ b/libudev/libudev.h +@@ -1,7 +1,7 @@ + /* + * libudev - interface to udev device information + * +- * Copyright (C) 2008-2009 Kay Sievers ++ * Copyright (C) 2008-2010 Kay Sievers + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public +@@ -118,6 +118,7 @@ struct udev_device *udev_monitor_receive_device(struct udev_monitor *udev_monito + /* in-kernel socket filters to select messages that get delivered to a listener */ + int udev_monitor_filter_add_match_subsystem_devtype(struct udev_monitor *udev_monitor, + const char *subsystem, const char *devtype); ++int udev_monitor_filter_add_match_tag(struct udev_monitor *udev_monitor, const char *tag); + int udev_monitor_filter_update(struct udev_monitor *udev_monitor); + int udev_monitor_filter_remove(struct udev_monitor *udev_monitor); + +@@ -138,6 +139,7 @@ int udev_enumerate_add_match_sysattr(struct udev_enumerate *udev_enumerate, cons + int udev_enumerate_add_nomatch_sysattr(struct udev_enumerate *udev_enumerate, const char *sysattr, const char *value); + int udev_enumerate_add_match_property(struct udev_enumerate *udev_enumerate, const char *property, const char *value); + int udev_enumerate_add_match_sysname(struct udev_enumerate *udev_enumerate, const char *sysname); ++int udev_enumerate_add_match_tag(struct udev_enumerate *udev_enumerate, const char *tag); + int udev_enumerate_add_syspath(struct udev_enumerate *udev_enumerate, const char *syspath); + /* run enumeration with active filters */ + int udev_enumerate_scan_devices(struct udev_enumerate *udev_enumerate); +diff --git a/udev/udev-event.c b/udev/udev-event.c +index b2e1bae..212ccc7 100644 +--- a/udev/udev-event.c ++++ b/udev/udev-event.c +@@ -543,7 +543,6 @@ int udev_event_execute_rules(struct udev_event *event, struct udev_rules *rules) + + if (strcmp(udev_device_get_action(dev), "remove") == 0) { + udev_device_read_db(dev); +- udev_device_set_info_loaded(dev); + udev_device_delete_db(dev); + + if (major(udev_device_get_devnum(dev)) != 0) +diff --git a/udev/udev-rules.c b/udev/udev-rules.c +index 6eb8350..b5016d0 100644 +--- a/udev/udev-rules.c ++++ b/udev/udev-rules.c +@@ -157,6 +157,7 @@ enum token_type { + TK_A_GROUP_ID, /* gid_t */ + TK_A_MODE_ID, /* mode_t */ + TK_A_ENV, /* val, attr */ ++ TK_A_TAG, /* val */ + TK_A_NAME, /* val */ + TK_A_DEVLINK, /* val */ + TK_A_EVENT_TIMEOUT, /* int */ +@@ -285,6 +286,7 @@ static const char *token_str(enum token_type type) + [TK_A_GROUP_ID] = "A GROUP_ID", + [TK_A_MODE_ID] = "A MODE_ID", + [TK_A_ENV] = "A ENV", ++ [TK_A_TAG] = "A ENV", + [TK_A_NAME] = "A NAME", + [TK_A_DEVLINK] = "A DEVLINK", + [TK_A_EVENT_TIMEOUT] = "A EVENT_TIMEOUT", +@@ -354,6 +356,9 @@ static void dump_token(struct udev_rules *rules, struct token *token) + dbg(rules->udev, "%s %s '%s' '%s'(%s)\n", + token_str(type), operation_str(op), attr, value, string_glob_str(glob)); + break; ++ case TK_A_TAG: ++ dbg(rules->udev, "%s %s '%s'\n", token_str(type), operation_str(op), value); ++ break; + case TK_A_STRING_ESCAPE_NONE: + case TK_A_STRING_ESCAPE_REPLACE: + dbg(rules->udev, "%s\n", token_str(type)); +@@ -1003,6 +1008,7 @@ static int rule_add_key(struct rule_tmp *rule_tmp, enum token_type type, + case TK_A_MODE: + case TK_A_NAME: + case TK_A_GOTO: ++ case TK_A_TAG: + token->key.value_off = add_string(rule_tmp->rules, value); + break; + case TK_M_ENV: +@@ -1350,6 +1356,11 @@ static int add_rule(struct udev_rules *rules, char *line, + continue; + } + ++ if (strcmp(key, "TAG") == 0) { ++ rule_add_key(&rule_tmp, TK_A_TAG, op, value, NULL); ++ continue; ++ } ++ + if (strcmp(key, "PROGRAM") == 0) { + rule_add_key(&rule_tmp, TK_M_PROGRAM, op, value, NULL); + continue; +@@ -2408,6 +2419,9 @@ int udev_rules_apply_to_event(struct udev_rules *rules, struct udev_event *event + } + break; + } ++ case TK_A_TAG: ++ udev_device_add_tag(event->dev, &rules->buf[cur->key.value_off]); ++ break; + case TK_A_NAME: + { + const char *name = &rules->buf[cur->key.value_off]; +diff --git a/udev/udev.xml b/udev/udev.xml +index 192a6f1..842fd5d 100644 +--- a/udev/udev.xml ++++ b/udev/udev.xml +@@ -349,6 +349,19 @@ + + + ++ ++ ++ Attach a tag to a device. This is used to filter events for users ++ of libudev's monitor functionality, or to enumerate a group of tagged ++ devices. The implementation can only work efficiently if only a few ++ tags are attached to a device. It is only meant to be used in ++ contexts with specific device filter requirements, and not as a ++ general-purpose flag. Excessive use might result in inefficient event ++ handling. ++ ++ ++ ++ + + + Add a program to the list of programs to be executed for a specific +diff --git a/udev/udevadm-monitor.c b/udev/udevadm-monitor.c +index d136c60..fb65084 100644 +--- a/udev/udevadm-monitor.c ++++ b/udev/udevadm-monitor.c +@@ -73,6 +73,7 @@ int udevadm_monitor(struct udev *udev, int argc, char *argv[]) + int print_kernel = 0; + int print_udev = 0; + struct udev_list_node subsystem_match_list; ++ struct udev_list_node tag_match_list; + struct udev_monitor *udev_monitor = NULL; + struct udev_monitor *kernel_monitor = NULL; + fd_set readfds; +@@ -84,13 +85,15 @@ int udevadm_monitor(struct udev *udev, int argc, char *argv[]) + { "kernel", no_argument, NULL, 'k' }, + { "udev", no_argument, NULL, 'u' }, + { "subsystem-match", required_argument, NULL, 's' }, ++ { "tag-match", required_argument, NULL, 't' }, + { "help", no_argument, NULL, 'h' }, + {} + }; + + udev_list_init(&subsystem_match_list); ++ udev_list_init(&tag_match_list); + while (1) { +- option = getopt_long(argc, argv, "epkus:h", options, NULL); ++ option = getopt_long(argc, argv, "pekus:t:h", options, NULL); + if (option == -1) + break; + +@@ -119,12 +122,16 @@ int udevadm_monitor(struct udev *udev, int argc, char *argv[]) + udev_list_entry_add(udev, &subsystem_match_list, subsys, devtype, 0, 0); + break; + } ++ case 't': ++ udev_list_entry_add(udev, &tag_match_list, optarg, NULL, 0, 0); ++ break; + case 'h': + printf("Usage: udevadm monitor [--property] [--kernel] [--udev] [--help]\n" + " --property print the event properties\n" + " --kernel print kernel uevents\n" + " --udev print udev events\n" + " --subsystem-match= filter events by subsystem\n" ++ " --tag-match= filter events by tag\n" + " --help\n\n"); + default: + goto out; +@@ -168,6 +175,13 @@ int udevadm_monitor(struct udev *udev, int argc, char *argv[]) + fprintf(stderr, "error: unable to apply subsystem filter '%s'\n", subsys); + } + ++ udev_list_entry_foreach(entry, udev_list_get_entry(&tag_match_list)) { ++ const char *tag = udev_list_entry_get_name(entry); ++ ++ if (udev_monitor_filter_add_match_tag(udev_monitor, tag) < 0) ++ fprintf(stderr, "error: unable to apply tag filter '%s'\n", tag); ++ } ++ + if (udev_monitor_enable_receiving(udev_monitor) < 0) { + fprintf(stderr, "error: unable to subscribe to udev events\n"); + rc = 2; +@@ -244,5 +258,6 @@ out: + udev_monitor_unref(udev_monitor); + udev_monitor_unref(kernel_monitor); + udev_list_cleanup_entries(udev, &subsystem_match_list); ++ udev_list_cleanup_entries(udev, &tag_match_list); + return rc; + } +diff --git a/udev/udevadm-trigger.c b/udev/udevadm-trigger.c +index 03aa534..3cb07dd 100644 +--- a/udev/udevadm-trigger.c ++++ b/udev/udevadm-trigger.c +@@ -101,6 +101,7 @@ int udevadm_trigger(struct udev *udev, int argc, char *argv[]) + { "attr-match", required_argument, NULL, 'a' }, + { "attr-nomatch", required_argument, NULL, 'A' }, + { "property-match", required_argument, NULL, 'p' }, ++ { "tag-match", required_argument, NULL, 'g' }, + { "sysname-match", required_argument, NULL, 'y' }, + { "help", no_argument, NULL, 'h' }, + {} +@@ -127,7 +128,7 @@ int udevadm_trigger(struct udev *udev, int argc, char *argv[]) + const char *val; + char buf[UTIL_PATH_SIZE]; + +- option = getopt_long(argc, argv, "vnFo:t:hcp:s:S:a:A:y:", options, NULL); ++ option = getopt_long(argc, argv, "vng:o:t:hcp:s:S:a:A:y:", options, NULL); + if (option == -1) + break; + +@@ -172,6 +173,9 @@ int udevadm_trigger(struct udev *udev, int argc, char *argv[]) + key = keyval(optarg, &val, buf, sizeof(buf)); + udev_enumerate_add_match_property(udev_enumerate, key, val); + break; ++ case 'g': ++ udev_enumerate_add_match_tag(udev_enumerate, optarg); ++ break; + case 'y': + udev_enumerate_add_match_sysname(udev_enumerate, optarg); + break; +@@ -190,6 +194,7 @@ int udevadm_trigger(struct udev *udev, int argc, char *argv[]) + " --attr-match=]> trigger devices with a matching attribute\n" + " --attr-nomatch=]> exclude devices with a matching attribute\n" + " --property-match== trigger devices with a matching property\n" ++ " --tag-match== trigger devices with a matching property\n" + " --sysname-match= trigger devices with a matching name\n" + " --help\n\n"); + goto exit; +diff --git a/udev/udevadm.xml b/udev/udevadm.xml +index fa1742b..73e6f11 100644 +--- a/udev/udevadm.xml ++++ b/udev/udevadm.xml +@@ -217,6 +217,13 @@ + + + ++ ++ ++ Trigger events for devices with a matching tag. This option can be ++ specified multiple times. ++ ++ ++ + + + Trigger events for devices with a matching sys device name. This option can be +@@ -356,6 +363,12 @@ + + + ++ ++ ++ Filter events by property. Only udev events with a given tag attached will pass. ++ ++ ++ + + + Print help text. +-- +1.7.0.1 + diff --git a/0008-libudev-export-udev_monitor_set_receive_buffer_size.patch b/0008-libudev-export-udev_monitor_set_receive_buffer_size.patch deleted file mode 100644 index 34a10cf..0000000 --- a/0008-libudev-export-udev_monitor_set_receive_buffer_size.patch +++ /dev/null @@ -1,58 +0,0 @@ -From a571c23e954cb88cdd5faa28593b19bd7c340130 Mon Sep 17 00:00:00 2001 -From: Scott James Remnant -Date: Wed, 17 Feb 2010 15:26:00 +0000 -Subject: [PATCH 08/65] libudev: export udev_monitor_set_receive_buffer_size() - -This function is useful for anything that's likely to be running -alongside udevd during cold-plugging, and is using libudev to -receive the events. - -It makes little sense for it to be private, or to require other -software to relearn how to adjust the buffer size. - -Signed-off-by: Scott James Remnant ---- - libudev/exported_symbols | 1 + - libudev/libudev-private.h | 1 - - libudev/libudev.h | 1 + - 3 files changed, 2 insertions(+), 1 deletions(-) - -diff --git a/libudev/exported_symbols b/libudev/exported_symbols -index 018463d..f48025a 100644 ---- a/libudev/exported_symbols -+++ b/libudev/exported_symbols -@@ -51,6 +51,7 @@ udev_enumerate_scan_subsystems - udev_enumerate_add_syspath - udev_monitor_new_from_socket - udev_monitor_new_from_netlink -+udev_monitor_set_receive_buffer_size - udev_monitor_enable_receiving - udev_monitor_ref - udev_monitor_unref -diff --git a/libudev/libudev-private.h b/libudev/libudev-private.h -index c2fff00..0d28b80 100644 ---- a/libudev/libudev-private.h -+++ b/libudev/libudev-private.h -@@ -109,7 +109,6 @@ int udev_monitor_disconnect(struct udev_monitor *udev_monitor); - int udev_monitor_allow_unicast_sender(struct udev_monitor *udev_monitor, struct udev_monitor *sender); - int udev_monitor_send_device(struct udev_monitor *udev_monitor, - struct udev_monitor *destination, struct udev_device *udev_device); --int udev_monitor_set_receive_buffer_size(struct udev_monitor *udev_monitor, int size); - - /* libudev-ctrl.c - daemon runtime setup */ - struct udev_ctrl; -diff --git a/libudev/libudev.h b/libudev/libudev.h -index ad11059..9576ad4 100644 ---- a/libudev/libudev.h -+++ b/libudev/libudev.h -@@ -111,6 +111,7 @@ struct udev_monitor *udev_monitor_new_from_netlink(struct udev *udev, const char - struct udev_monitor *udev_monitor_new_from_socket(struct udev *udev, const char *socket_path); - /* bind socket */ - int udev_monitor_enable_receiving(struct udev_monitor *udev_monitor); -+int udev_monitor_set_receive_buffer_size(struct udev_monitor *udev_monitor, int size); - int udev_monitor_get_fd(struct udev_monitor *udev_monitor); - struct udev_device *udev_monitor_receive_device(struct udev_monitor *udev_monitor); - /* in-kernel socket filters to select messages that get delivered to a listener */ --- -1.6.6 - diff --git a/0009-all-to-match-against-a-given-TAG.patch b/0009-all-to-match-against-a-given-TAG.patch new file mode 100644 index 0000000..7366d27 --- /dev/null +++ b/0009-all-to-match-against-a-given-TAG.patch @@ -0,0 +1,101 @@ +From 3f896a2abd76972eafe636cac4110608b6d3ff2f Mon Sep 17 00:00:00 2001 +From: Kay Sievers +Date: Thu, 22 Apr 2010 18:33:24 +0200 +Subject: [PATCH 09/19] all to match against a given TAG== + +--- + udev/udev-rules.c | 24 +++++++++++++++++++++++- + udev/udev.xml | 7 +++++++ + 2 files changed, 30 insertions(+), 1 deletions(-) + +diff --git a/udev/udev-rules.c b/udev/udev-rules.c +index b5016d0..5965723 100644 +--- a/udev/udev-rules.c ++++ b/udev/udev-rules.c +@@ -125,6 +125,7 @@ enum token_type { + TK_M_DEVLINK, /* val */ + TK_M_NAME, /* val */ + TK_M_ENV, /* val, attr */ ++ TK_M_TAG, /* val */ + TK_M_SUBSYSTEM, /* val */ + TK_M_DRIVER, /* val */ + TK_M_WAITFOR, /* val */ +@@ -254,6 +255,7 @@ static const char *token_str(enum token_type type) + [TK_M_DEVLINK] = "M DEVLINK", + [TK_M_NAME] = "M NAME", + [TK_M_ENV] = "M ENV", ++ [TK_M_TAG] = "M TAG", + [TK_M_SUBSYSTEM] = "M SUBSYSTEM", + [TK_M_DRIVER] = "M DRIVER", + [TK_M_WAITFOR] = "M WAITFOR", +@@ -356,6 +358,7 @@ static void dump_token(struct udev_rules *rules, struct token *token) + dbg(rules->udev, "%s %s '%s' '%s'(%s)\n", + token_str(type), operation_str(op), attr, value, string_glob_str(glob)); + break; ++ case TK_M_TAG: + case TK_A_TAG: + dbg(rules->udev, "%s %s '%s'\n", token_str(type), operation_str(op), value); + break; +@@ -1008,6 +1011,7 @@ static int rule_add_key(struct rule_tmp *rule_tmp, enum token_type type, + case TK_A_MODE: + case TK_A_NAME: + case TK_A_GOTO: ++ case TK_M_TAG: + case TK_A_TAG: + token->key.value_off = add_string(rule_tmp->rules, value); + break; +@@ -1357,7 +1361,10 @@ static int add_rule(struct udev_rules *rules, char *line, + } + + if (strcmp(key, "TAG") == 0) { +- rule_add_key(&rule_tmp, TK_A_TAG, op, value, NULL); ++ if (op < OP_MATCH_MAX) ++ rule_add_key(&rule_tmp, TK_M_TAG, op, value, NULL); ++ else ++ rule_add_key(&rule_tmp, TK_A_TAG, op, value, NULL); + continue; + } + +@@ -2104,6 +2111,21 @@ int udev_rules_apply_to_event(struct udev_rules *rules, struct udev_event *event + goto nomatch; + break; + } ++ case TK_M_TAG: ++ { ++ struct udev_list_entry *list_entry; ++ bool match = false; ++ ++ udev_list_entry_foreach(list_entry, udev_device_get_tags_list_entry(event->dev)) { ++ if (strcmp(&rules->buf[cur->key.value_off], udev_list_entry_get_name(list_entry)) == 0) { ++ match = true; ++ break; ++ } ++ } ++ if (!match && (cur->key.op != OP_NOMATCH)) ++ goto nomatch; ++ break; ++ } + case TK_M_SUBSYSTEM: + if (match_key(rules, cur, udev_device_get_subsystem(event->dev)) != 0) + goto nomatch; +diff --git a/udev/udev.xml b/udev/udev.xml +index 842fd5d..d2277c9 100644 +--- a/udev/udev.xml ++++ b/udev/udev.xml +@@ -238,6 +238,13 @@ + + + ++ ++ ++ Match against a device tag. ++ ++ ++ ++ + + + Test the existence of a file. An octal mode mask can be specified +-- +1.7.0.1 + diff --git a/0009-udevadm-monitor-increase-netlink-buffer-size.patch b/0009-udevadm-monitor-increase-netlink-buffer-size.patch deleted file mode 100644 index db69f85..0000000 --- a/0009-udevadm-monitor-increase-netlink-buffer-size.patch +++ /dev/null @@ -1,37 +0,0 @@ -From 0fe3c26eab97c4ee381918e6925a6cd798be5f39 Mon Sep 17 00:00:00 2001 -From: Scott James Remnant -Date: Wed, 17 Feb 2010 15:27:36 +0000 -Subject: [PATCH 09/65] udevadm monitor: increase netlink buffer size - -A common use (e.g. in Ubuntu) for udevadm monitor is to log the events -received by udev during boot; events can be lost of the buffer size isn't -increased as udevd does. - -Signed-off-by: Scott James Remnant ---- - udev/udevadm-monitor.c | 2 ++ - 1 files changed, 2 insertions(+), 0 deletions(-) - -diff --git a/udev/udevadm-monitor.c b/udev/udevadm-monitor.c -index 00b130d..ea4b7dc 100644 ---- a/udev/udevadm-monitor.c -+++ b/udev/udevadm-monitor.c -@@ -158,6 +158,7 @@ int udevadm_monitor(struct udev *udev, int argc, char *argv[]) - rc = 1; - goto out; - } -+ udev_monitor_set_receive_buffer_size(udev_monitor, 128*1024*1024); - - udev_list_entry_foreach(entry, udev_list_get_entry(&subsystem_match_list)) { - const char *subsys = udev_list_entry_get_name(entry); -@@ -183,6 +184,7 @@ int udevadm_monitor(struct udev *udev, int argc, char *argv[]) - rc = 3; - goto out; - } -+ udev_monitor_set_receive_buffer_size(udev, 128*1024*1024); - - udev_list_entry_foreach(entry, udev_list_get_entry(&subsystem_match_list)) { - const char *subsys = udev_list_entry_get_name(entry); --- -1.6.6 - diff --git a/0010-libudev-bump-minor-version.patch b/0010-libudev-bump-minor-version.patch deleted file mode 100644 index 6e79298..0000000 --- a/0010-libudev-bump-minor-version.patch +++ /dev/null @@ -1,29 +0,0 @@ -From e0fcf21c030027101338c7673c5cb814b82261d1 Mon Sep 17 00:00:00 2001 -From: Kay Sievers -Date: Thu, 18 Feb 2010 11:03:09 +0100 -Subject: [PATCH 10/65] libudev: bump minor version - ---- - Makefile.am | 6 +++--- - 1 files changed, 3 insertions(+), 3 deletions(-) - -diff --git a/Makefile.am b/Makefile.am -index db23f16..3780f50 100644 ---- a/Makefile.am -+++ b/Makefile.am -@@ -28,9 +28,9 @@ CLEANFILES = - # ------------------------------------------------------------------------------ - # libudev - # ------------------------------------------------------------------------------ --LIBUDEV_CURRENT=6 --LIBUDEV_REVISION=1 --LIBUDEV_AGE=6 -+LIBUDEV_CURRENT=7 -+LIBUDEV_REVISION=0 -+LIBUDEV_AGE=7 - - SUBDIRS += libudev/docs - --- -1.6.6 - diff --git a/0010-udev-acl-use-a-tag-instead-of-a-property-to-mark-dev.patch b/0010-udev-acl-use-a-tag-instead-of-a-property-to-mark-dev.patch new file mode 100644 index 0000000..cff2caa --- /dev/null +++ b/0010-udev-acl-use-a-tag-instead-of-a-property-to-mark-dev.patch @@ -0,0 +1,125 @@ +From f24362441f6165544888d8d97d63ff881e78f13f Mon Sep 17 00:00:00 2001 +From: Kay Sievers +Date: Thu, 22 Apr 2010 18:33:49 +0200 +Subject: [PATCH 10/19] udev-acl: use a tag instead of a property to mark devices + +--- + extras/udev-acl/70-acl.rules | 48 +++++++++++++++++++++--------------------- + extras/udev-acl/udev-acl.c | 2 +- + 2 files changed, 25 insertions(+), 25 deletions(-) + +diff --git a/extras/udev-acl/70-acl.rules b/extras/udev-acl/70-acl.rules +index 5b00bf8..cf6b0ea 100644 +--- a/extras/udev-acl/70-acl.rules ++++ b/extras/udev-acl/70-acl.rules +@@ -8,70 +8,70 @@ ACTION=="remove", GOTO="acl_apply" + + # PTP/MTP protocol devices, cameras, portable media players + SUBSYSTEM=="usb", ENV{ID_USB_INTERFACES}=="", ENV{DEVTYPE}=="usb_device", IMPORT{program}="usb_id --export %p" +-SUBSYSTEM=="usb", ENV{ID_USB_INTERFACES}=="*:060101:*", ENV{ACL_MANAGE}="1" ++SUBSYSTEM=="usb", ENV{ID_USB_INTERFACES}=="*:060101:*", TAG="udev-acl" + + # digicams with proprietary protocol +-ENV{ID_GPHOTO2}=="*?", ENV{ACL_MANAGE}="1" ++ENV{ID_GPHOTO2}=="*?", TAG="udev-acl" + + # SCSI scanners +-KERNEL=="sg[0-9]*", ATTRS{type}=="6", ENV{ACL_MANAGE}="1" +-KERNEL=="sg[0-9]*", ATTRS{type}=="3", ATTRS{vendor}=="HP|EPSON|Epson", ENV{ACL_MANAGE}="1" ++KERNEL=="sg[0-9]*", ATTRS{type}=="6", TAG="udev-acl" ++KERNEL=="sg[0-9]*", ATTRS{type}=="3", ATTRS{vendor}=="HP|EPSON|Epson", TAG="udev-acl" + + # USB scanners +-ENV{libsane_matched}=="yes", ENV{ACL_MANAGE}="1" ++ENV{libsane_matched}=="yes", TAG="udev-acl" + + # HPLIP devices (necessary for ink level check and HP tool maintenance) +-ENV{ID_HPLIP}=="1", ENV{ACL_MANAGE}="1" ++ENV{ID_HPLIP}=="1", TAG="udev-acl" + + # optical drives +-SUBSYSTEM=="block", ENV{ID_CDROM}=="1", ENV{ACL_MANAGE}="1" ++SUBSYSTEM=="block", ENV{ID_CDROM}=="1", TAG="udev-acl" + + # sound devices +-SUBSYSTEM=="sound", ENV{ACL_MANAGE}="1" ++SUBSYSTEM=="sound", TAG="udev-acl" + # sound jack-sense +-SUBSYSTEM=="input", SUBSYSTEMS=="sound", ENV{ACL_MANAGE}="1" ++SUBSYSTEM=="input", SUBSYSTEMS=="sound", TAG="udev-acl" + + # webcams, frame grabber, TV cards +-SUBSYSTEM=="video4linux", ENV{ACL_MANAGE}="1" +-SUBSYSTEM=="dvb", ENV{ACL_MANAGE}="1" ++SUBSYSTEM=="video4linux", TAG="udev-acl" ++SUBSYSTEM=="dvb", TAG="udev-acl" + + # IIDC devices: industrial cameras and some webcams +-SUBSYSTEM=="firewire", ATTR{units}=="*0x00a02d:0x00010*", ENV{ACL_MANAGE}="1" ++SUBSYSTEM=="firewire", ATTR{units}=="*0x00a02d:0x00010*", TAG="udev-acl" + # AV/C devices: camcorders, set-top boxes, TV sets, audio devices, and more +-SUBSYSTEM=="firewire", ATTR{units}=="*0x00a02d:0x010001*", ENV{ACL_MANAGE}="1" ++SUBSYSTEM=="firewire", ATTR{units}=="*0x00a02d:0x010001*", TAG="udev-acl" + + # old style firewire devices +-KERNEL=="dv1394-[0-9]*", ENV{ACL_MANAGE}="1" +-KERNEL=="video1394-[0-9]*", ENV{ACL_MANAGE}="1" ++KERNEL=="dv1394-[0-9]*", TAG="udev-acl" ++KERNEL=="video1394-[0-9]*", TAG="udev-acl" + + # fingerprint readers +-SUBSYSTEM=="usb", ATTR{idVendor}=="0483", ATTR{idProduct}=="2016", ENV{ACL_MANAGE}="1" ++SUBSYSTEM=="usb", ATTR{idVendor}=="0483", ATTR{idProduct}=="2016", TAG="udev-acl" + + # GPS devices + # Garmin GPSMap 60 +-SUBSYSTEM=="usb", ATTR{idVendor}=="091e", ATTR{idProduct}=="0003", ENV{ACL_MANAGE}="1" ++SUBSYSTEM=="usb", ATTR{idVendor}=="091e", ATTR{idProduct}=="0003", TAG="udev-acl" + + + # DRI video devices +-SUBSYSTEM=="drm", KERNEL=="card*", ENV{ACL_MANAGE}="1" ++SUBSYSTEM=="drm", KERNEL=="card*", TAG="udev-acl" + + # KVM +-SUBSYSTEM=="misc", KERNEL=="kvm", ENV{ACL_MANAGE}="1" ++SUBSYSTEM=="misc", KERNEL=="kvm", TAG="udev-acl" + + # smart-card readers +-ENV{ID_SMARTCARD_READER}=="*?", ENV{ACL_MANAGE}="1" ++ENV{ID_SMARTCARD_READER}=="*?", TAG="udev-acl" + + # joysticks +-SUBSYSTEM=="input", ENV{ID_INPUT_JOYSTICK}=="?*", ENV{ACL_MANAGE}="1" ++SUBSYSTEM=="input", ENV{ID_INPUT_JOYSTICK}=="?*", TAG="udev-acl" + + # smart phones +-SUBSYSTEM=="usb", ATTR{idVendor}=="0bb4", ATTR{idProduct}=="0c02", ENV{ACL_MANAGE}="1" ++SUBSYSTEM=="usb", ATTR{idVendor}=="0bb4", ATTR{idProduct}=="0c02", TAG="udev-acl" + + # color measurement devices +-ENV{COLOR_MEASUREMENT_DEVICE}=="*?", ENV{ACL_MANAGE}="1" ++ENV{COLOR_MEASUREMENT_DEVICE}=="*?", TAG="udev-acl" + + # apply ACL for all locally logged in users +-LABEL="acl_apply", ENV{ACL_MANAGE}=="1", TEST=="/var/run/ConsoleKit/database", \ ++LABEL="acl_apply", TAG=="udev-acl", TEST=="/var/run/ConsoleKit/database", \ + RUN+="udev-acl --action=$env{ACTION} --device=$env{DEVNAME}" + + LABEL="acl_end" +diff --git a/extras/udev-acl/udev-acl.c b/extras/udev-acl/udev-acl.c +index ce51590..ff04ec6 100644 +--- a/extras/udev-acl/udev-acl.c ++++ b/extras/udev-acl/udev-acl.c +@@ -289,7 +289,7 @@ static void apply_acl_to_devices(uid_t uid, int add) + /* iterate over all devices tagged with ACL_SET */ + udev = udev_new(); + enumerate = udev_enumerate_new(udev); +- udev_enumerate_add_match_property(enumerate, "ACL_MANAGE", "1"); ++ udev_enumerate_add_match_tag(enumerate, "udev-acl"); + udev_enumerate_scan_devices(enumerate); + udev_list_entry_foreach(list_entry, udev_enumerate_get_list_entry(enumerate)) { + struct udev_device *device; +-- +1.7.0.1 + diff --git a/0011-fix-logic-on-demand-loading-logic-for-db-and-uevent.patch b/0011-fix-logic-on-demand-loading-logic-for-db-and-uevent.patch new file mode 100644 index 0000000..5224fc8 --- /dev/null +++ b/0011-fix-logic-on-demand-loading-logic-for-db-and-uevent.patch @@ -0,0 +1,49 @@ +From bfd88b1d7b689ce86a2b04f62ac5a2b23b0aef84 Mon Sep 17 00:00:00 2001 +From: Kay Sievers +Date: Thu, 22 Apr 2010 18:50:43 +0200 +Subject: [PATCH 11/19] fix logic on-demand loading logic for db and uevent + +--- + libudev/libudev-device.c | 5 +++-- + 1 files changed, 3 insertions(+), 2 deletions(-) + +diff --git a/libudev/libudev-device.c b/libudev/libudev-device.c +index 478fdcb..3f441d0 100644 +--- a/libudev/libudev-device.c ++++ b/libudev/libudev-device.c +@@ -284,6 +284,8 @@ int udev_device_read_db(struct udev_device *udev_device) + dbg(udev_device->udev, "error reading db file %s: %m\n", filename); + return -1; + } ++ udev_device->db_loaded = true; ++ + while (fgets(line, sizeof(line), f)) { + ssize_t len; + const char *val; +@@ -322,7 +324,6 @@ int udev_device_read_db(struct udev_device *udev_device) + fclose(f); + + info(udev_device->udev, "device %p filled with db file data\n", udev_device); +- udev_device->db_loaded = true; + return 0; + } + +@@ -341,6 +342,7 @@ int udev_device_read_uevent_file(struct udev_device *udev_device) + f = fopen(filename, "r"); + if (f == NULL) + return -1; ++ udev_device->uevent_loaded = true; + + while (fgets(line, sizeof(line), f)) { + char *pos; +@@ -364,7 +366,6 @@ int udev_device_read_uevent_file(struct udev_device *udev_device) + + udev_device->devnum = makedev(maj, min); + fclose(f); +- udev_device->uevent_loaded = true; + return 0; + } + +-- +1.7.0.1 + diff --git a/0011-udevadm-fix-untested-and-broken-commit-to-set-buffer.patch b/0011-udevadm-fix-untested-and-broken-commit-to-set-buffer.patch deleted file mode 100644 index 382e057..0000000 --- a/0011-udevadm-fix-untested-and-broken-commit-to-set-buffer.patch +++ /dev/null @@ -1,25 +0,0 @@ -From 044bd2bcc7a160c97f7dd052d6de50d35186df13 Mon Sep 17 00:00:00 2001 -From: Kay Sievers -Date: Thu, 18 Feb 2010 11:03:28 +0100 -Subject: [PATCH 11/65] udevadm: fix untested and broken commit to set buffer size - ---- - udev/udevadm-monitor.c | 2 +- - 1 files changed, 1 insertions(+), 1 deletions(-) - -diff --git a/udev/udevadm-monitor.c b/udev/udevadm-monitor.c -index ea4b7dc..4063c48 100644 ---- a/udev/udevadm-monitor.c -+++ b/udev/udevadm-monitor.c -@@ -184,7 +184,7 @@ int udevadm_monitor(struct udev *udev, int argc, char *argv[]) - rc = 3; - goto out; - } -- udev_monitor_set_receive_buffer_size(udev, 128*1024*1024); -+ udev_monitor_set_receive_buffer_size(kernel_monitor, 128*1024*1024); - - udev_list_entry_foreach(entry, udev_list_get_entry(&subsystem_match_list)) { - const char *subsys = udev_list_entry_get_name(entry); --- -1.6.6 - diff --git a/0012-configure.ac-version-bump.patch b/0012-configure.ac-version-bump.patch deleted file mode 100644 index 8193aea..0000000 --- a/0012-configure.ac-version-bump.patch +++ /dev/null @@ -1,37 +0,0 @@ -From fff82e9d77415111193d9547bbe3618892147b39 Mon Sep 17 00:00:00 2001 -From: Kay Sievers -Date: Thu, 18 Feb 2010 11:09:25 +0100 -Subject: [PATCH 12/65] configure.ac: version bump - ---- - NEWS | 6 ++++++ - configure.ac | 2 +- - 2 files changed, 7 insertions(+), 1 deletions(-) - -diff --git a/NEWS b/NEWS -index 5b23a8b..a4d46d7 100644 ---- a/NEWS -+++ b/NEWS -@@ -1,3 +1,9 @@ -+udev 152 -+======== -+Bugfixes. -+ -+New and fixed keymaps. -+ - udev 151 - ======== - Bugfixes. -diff --git a/configure.ac b/configure.ac -index 4cecb86..88824b6 100644 ---- a/configure.ac -+++ b/configure.ac -@@ -1,4 +1,4 @@ --AC_INIT([udev], [151], [linux-hotplug@vger.kernel.org]) -+AC_INIT([udev], [152], [linux-hotplug@vger.kernel.org]) - AC_PREREQ(2.60) - AM_INIT_AUTOMAKE([check-news foreign 1.9 dist-bzip2 subdir-objects]) - m4_ifdef([AM_SILENT_RULES], [AM_SILENT_RULES([yes])]) --- -1.6.6 - diff --git a/0012-use-the-usual-TAG-TAG-logic.patch b/0012-use-the-usual-TAG-TAG-logic.patch new file mode 100644 index 0000000..c898ed7 --- /dev/null +++ b/0012-use-the-usual-TAG-TAG-logic.patch @@ -0,0 +1,129 @@ +From 1dbfbfbea6d80971fba6bb57469b5c437a8980d6 Mon Sep 17 00:00:00 2001 +From: Kay Sievers +Date: Thu, 22 Apr 2010 19:03:11 +0200 +Subject: [PATCH 12/19] use the usual TAG+=, TAG= logic + +--- + extras/udev-acl/70-acl.rules | 48 +++++++++++++++++++++--------------------- + udev/udev-rules.c | 2 + + 2 files changed, 26 insertions(+), 24 deletions(-) + +diff --git a/extras/udev-acl/70-acl.rules b/extras/udev-acl/70-acl.rules +index cf6b0ea..8300ec2 100644 +--- a/extras/udev-acl/70-acl.rules ++++ b/extras/udev-acl/70-acl.rules +@@ -1,6 +1,6 @@ + # do not edit this file, it will be overwritten on update + +-# Do not use ACL_MANAGE outside of this file. This variable is private to ++# Do not use TAG+="udev-acl" outside of this file. This variable is private to + # udev-acl of this udev release and may be replaced at any time. + + ENV{MAJOR}=="", GOTO="acl_end" +@@ -8,67 +8,67 @@ ACTION=="remove", GOTO="acl_apply" + + # PTP/MTP protocol devices, cameras, portable media players + SUBSYSTEM=="usb", ENV{ID_USB_INTERFACES}=="", ENV{DEVTYPE}=="usb_device", IMPORT{program}="usb_id --export %p" +-SUBSYSTEM=="usb", ENV{ID_USB_INTERFACES}=="*:060101:*", TAG="udev-acl" ++SUBSYSTEM=="usb", ENV{ID_USB_INTERFACES}=="*:060101:*", TAG+="udev-acl" + + # digicams with proprietary protocol +-ENV{ID_GPHOTO2}=="*?", TAG="udev-acl" ++ENV{ID_GPHOTO2}=="*?", TAG+="udev-acl" + + # SCSI scanners +-KERNEL=="sg[0-9]*", ATTRS{type}=="6", TAG="udev-acl" +-KERNEL=="sg[0-9]*", ATTRS{type}=="3", ATTRS{vendor}=="HP|EPSON|Epson", TAG="udev-acl" ++KERNEL=="sg[0-9]*", ATTRS{type}=="6", TAG+="udev-acl" ++KERNEL=="sg[0-9]*", ATTRS{type}=="3", ATTRS{vendor}=="HP|EPSON|Epson", TAG+="udev-acl" + + # USB scanners +-ENV{libsane_matched}=="yes", TAG="udev-acl" ++ENV{libsane_matched}=="yes", TAG+="udev-acl" + + # HPLIP devices (necessary for ink level check and HP tool maintenance) +-ENV{ID_HPLIP}=="1", TAG="udev-acl" ++ENV{ID_HPLIP}=="1", TAG+="udev-acl" + + # optical drives +-SUBSYSTEM=="block", ENV{ID_CDROM}=="1", TAG="udev-acl" ++SUBSYSTEM=="block", ENV{ID_CDROM}=="1", TAG+="udev-acl" + + # sound devices +-SUBSYSTEM=="sound", TAG="udev-acl" ++SUBSYSTEM=="sound", TAG+="udev-acl" + # sound jack-sense +-SUBSYSTEM=="input", SUBSYSTEMS=="sound", TAG="udev-acl" ++SUBSYSTEM=="input", SUBSYSTEMS=="sound", TAG+="udev-acl" + + # webcams, frame grabber, TV cards +-SUBSYSTEM=="video4linux", TAG="udev-acl" +-SUBSYSTEM=="dvb", TAG="udev-acl" ++SUBSYSTEM=="video4linux", TAG+="udev-acl" ++SUBSYSTEM=="dvb", TAG+="udev-acl" + + # IIDC devices: industrial cameras and some webcams +-SUBSYSTEM=="firewire", ATTR{units}=="*0x00a02d:0x00010*", TAG="udev-acl" ++SUBSYSTEM=="firewire", ATTR{units}=="*0x00a02d:0x00010*", TAG+="udev-acl" + # AV/C devices: camcorders, set-top boxes, TV sets, audio devices, and more +-SUBSYSTEM=="firewire", ATTR{units}=="*0x00a02d:0x010001*", TAG="udev-acl" ++SUBSYSTEM=="firewire", ATTR{units}=="*0x00a02d:0x010001*", TAG+="udev-acl" + + # old style firewire devices +-KERNEL=="dv1394-[0-9]*", TAG="udev-acl" +-KERNEL=="video1394-[0-9]*", TAG="udev-acl" ++KERNEL=="dv1394-[0-9]*", TAG+="udev-acl" ++KERNEL=="video1394-[0-9]*", TAG+="udev-acl" + + # fingerprint readers +-SUBSYSTEM=="usb", ATTR{idVendor}=="0483", ATTR{idProduct}=="2016", TAG="udev-acl" ++SUBSYSTEM=="usb", ATTR{idVendor}=="0483", ATTR{idProduct}=="2016", TAG+="udev-acl" + + # GPS devices + # Garmin GPSMap 60 +-SUBSYSTEM=="usb", ATTR{idVendor}=="091e", ATTR{idProduct}=="0003", TAG="udev-acl" ++SUBSYSTEM=="usb", ATTR{idVendor}=="091e", ATTR{idProduct}=="0003", TAG+="udev-acl" + + + # DRI video devices +-SUBSYSTEM=="drm", KERNEL=="card*", TAG="udev-acl" ++SUBSYSTEM=="drm", KERNEL=="card*", TAG+="udev-acl" + + # KVM +-SUBSYSTEM=="misc", KERNEL=="kvm", TAG="udev-acl" ++SUBSYSTEM=="misc", KERNEL=="kvm", TAG+="udev-acl" + + # smart-card readers +-ENV{ID_SMARTCARD_READER}=="*?", TAG="udev-acl" ++ENV{ID_SMARTCARD_READER}=="*?", TAG+="udev-acl" + + # joysticks +-SUBSYSTEM=="input", ENV{ID_INPUT_JOYSTICK}=="?*", TAG="udev-acl" ++SUBSYSTEM=="input", ENV{ID_INPUT_JOYSTICK}=="?*", TAG+="udev-acl" + + # smart phones +-SUBSYSTEM=="usb", ATTR{idVendor}=="0bb4", ATTR{idProduct}=="0c02", TAG="udev-acl" ++SUBSYSTEM=="usb", ATTR{idVendor}=="0bb4", ATTR{idProduct}=="0c02", TAG+="udev-acl" + + # color measurement devices +-ENV{COLOR_MEASUREMENT_DEVICE}=="*?", TAG="udev-acl" ++ENV{COLOR_MEASUREMENT_DEVICE}=="*?", TAG+="udev-acl" + + # apply ACL for all locally logged in users + LABEL="acl_apply", TAG=="udev-acl", TEST=="/var/run/ConsoleKit/database", \ +diff --git a/udev/udev-rules.c b/udev/udev-rules.c +index 5965723..6f3335b 100644 +--- a/udev/udev-rules.c ++++ b/udev/udev-rules.c +@@ -2442,6 +2442,8 @@ int udev_rules_apply_to_event(struct udev_rules *rules, struct udev_event *event + break; + } + case TK_A_TAG: ++ if (cur->key.op == OP_ASSIGN || cur->key.op == OP_ASSIGN_FINAL) ++ udev_device_cleanup_tags_list(event->dev); + udev_device_add_tag(event->dev, &rules->buf[cur->key.value_off]); + break; + case TK_A_NAME: +-- +1.7.0.1 + diff --git a/0013-delete-old-tags-when-configuration-changes.patch b/0013-delete-old-tags-when-configuration-changes.patch new file mode 100644 index 0000000..ed0d4da --- /dev/null +++ b/0013-delete-old-tags-when-configuration-changes.patch @@ -0,0 +1,168 @@ +From c1dbe11dc336f9faf02073a66fe30a12bd438e23 Mon Sep 17 00:00:00 2001 +From: Kay Sievers +Date: Fri, 23 Apr 2010 09:01:56 +0200 +Subject: [PATCH 13/19] delete old tags when configuration changes + +--- + libudev/libudev-device-private.c | 67 +++++++++++++++++++++++++------------- + libudev/libudev-private.h | 1 + + udev/udev-event.c | 4 ++ + 3 files changed, 49 insertions(+), 23 deletions(-) + +diff --git a/libudev/libudev-device-private.c b/libudev/libudev-device-private.c +index 13f1ebf..7e5fcbc 100644 +--- a/libudev/libudev-device-private.c ++++ b/libudev/libudev-device-private.c +@@ -22,34 +22,58 @@ + #include "libudev.h" + #include "libudev-private.h" + +-static int udev_device_tag_index(struct udev_device *udev_device, bool add) ++static void udev_device_tag(struct udev_device *dev, const char *tag, bool add) + { +- struct udev *udev = udev_device_get_udev(udev_device); +- struct udev_list_entry *list_entry; ++ struct udev *udev = udev_device_get_udev(dev); ++ char filename[UTIL_PATH_SIZE]; + +- udev_list_entry_foreach(list_entry, udev_device_get_tags_list_entry(udev_device)) { +- char filename[UTIL_PATH_SIZE]; ++ util_strscpyl(filename, sizeof(filename), udev_get_dev_path(udev), "/.udev/tags/", tag, "/", ++ udev_device_get_subsystem(dev), ":", udev_device_get_sysname(dev), NULL); + +- util_strscpyl(filename, sizeof(filename), udev_get_dev_path(udev), "/.udev/tags/", +- udev_list_entry_get_name(list_entry), "/", +- udev_device_get_subsystem(udev_device), ":", udev_device_get_sysname(udev_device), NULL); ++ if (add) { ++ util_create_path(udev, filename); ++ symlink(udev_device_get_devpath(dev), filename); ++ /* possibly cleanup old entries after a device renaming */ ++ if (udev_device_get_sysname_old(dev) != NULL) { ++ char filename_old[UTIL_PATH_SIZE]; + +- if (add) { +- util_create_path(udev, filename); +- symlink(udev_device_get_devpath(udev_device), filename); +- if (udev_device_get_sysname_old(udev_device) != NULL) { +- char filename_old[UTIL_PATH_SIZE]; ++ util_strscpyl(filename_old, sizeof(filename_old), udev_get_dev_path(udev), "/.udev/tags/", tag, "/", ++ udev_device_get_subsystem(dev), ":", udev_device_get_sysname_old(dev), NULL); ++ unlink(filename_old); ++ } ++ } else { ++ unlink(filename); ++ } ++} + +- util_strscpyl(filename, sizeof(filename), udev_get_dev_path(udev), "/.udev/tags/", +- udev_list_entry_get_name(list_entry), +- udev_device_get_subsystem(udev_device), ":", udev_device_get_sysname_old(udev_device), NULL); +- unlink(filename_old); ++int udev_device_tag_index(struct udev_device *dev, struct udev_device *dev_old, bool add) ++{ ++ struct udev_list_entry *list_entry; ++ bool found; ++ ++ if (add) { ++ /* delete possible left-over tags */ ++ udev_list_entry_foreach(list_entry, udev_device_get_tags_list_entry(dev_old)) { ++ const char *tag_old = udev_list_entry_get_name(list_entry); ++ struct udev_list_entry *list_entry_current; ++ ++ found = false; ++ udev_list_entry_foreach(list_entry_current, udev_device_get_tags_list_entry(dev)) { ++ const char *tag = udev_list_entry_get_name(list_entry_current); ++ ++ if (strcmp(tag, tag_old) == 0) { ++ found = true; ++ break; ++ } + } +- } else { +- unlink(filename); +- util_delete_path(udev, filename); ++ if (!found) ++ udev_device_tag(dev_old, tag_old, false); + } + } ++ ++ udev_list_entry_foreach(list_entry, udev_device_get_tags_list_entry(dev)) ++ udev_device_tag(dev, udev_list_entry_get_name(list_entry), add); ++ + return 0; + } + +@@ -140,7 +164,6 @@ file: + rename(filename_tmp, filename); + info(udev, "created db file for '%s' in '%s'\n", udev_device_get_devpath(udev_device), filename); + out: +- udev_device_tag_index(udev_device, true); + return 0; + } + +@@ -149,7 +172,6 @@ int udev_device_delete_db(struct udev_device *udev_device) + struct udev *udev = udev_device_get_udev(udev_device); + char filename[UTIL_PATH_SIZE]; + +- udev_device_tag_index(udev_device, false); + util_strscpyl(filename, sizeof(filename), udev_get_dev_path(udev), "/.udev/db/", + udev_device_get_subsystem(udev_device), ":", udev_device_get_sysname(udev_device), NULL); + unlink(filename); +@@ -169,6 +191,5 @@ int udev_device_rename_db(struct udev_device *udev_device) + udev_device_get_subsystem(udev_device), ":", udev_device_get_sysname_old(udev_device), NULL); + util_strscpyl(filename, sizeof(filename), udev_get_dev_path(udev), "/.udev/db/", + udev_device_get_subsystem(udev_device), ":", udev_device_get_sysname(udev_device), NULL); +- udev_device_tag_index(udev_device, true); + return rename(filename_old, filename); + } +diff --git a/libudev/libudev-private.h b/libudev/libudev-private.h +index 548f4ad..3f38a32 100644 +--- a/libudev/libudev-private.h ++++ b/libudev/libudev-private.h +@@ -106,6 +106,7 @@ void udev_device_set_info_loaded(struct udev_device *device); + int udev_device_update_db(struct udev_device *udev_device); + int udev_device_delete_db(struct udev_device *udev_device); + int udev_device_rename_db(struct udev_device *udev_device); ++int udev_device_tag_index(struct udev_device *dev, struct udev_device *dev_old, bool add); + + /* libudev-monitor.c - netlink/unix socket communication */ + int udev_monitor_disconnect(struct udev_monitor *udev_monitor); +diff --git a/udev/udev-event.c b/udev/udev-event.c +index 212ccc7..2d8becd 100644 +--- a/udev/udev-event.c ++++ b/udev/udev-event.c +@@ -544,6 +544,7 @@ int udev_event_execute_rules(struct udev_event *event, struct udev_rules *rules) + if (strcmp(udev_device_get_action(dev), "remove") == 0) { + udev_device_read_db(dev); + udev_device_delete_db(dev); ++ udev_device_tag_index(dev, NULL, false); + + if (major(udev_device_get_devnum(dev)) != 0) + udev_watch_end(event->udev, dev); +@@ -577,6 +578,7 @@ int udev_event_execute_rules(struct udev_event *event, struct udev_rules *rules) + + /* delete stale db file */ + udev_device_delete_db(dev); ++ udev_device_tag_index(dev, NULL, false); + + /* remember old name */ + udev_device_add_property(dev, "INTERFACE_OLD", udev_device_get_sysname(dev)); +@@ -618,6 +620,7 @@ int udev_event_execute_rules(struct udev_event *event, struct udev_rules *rules) + if (event->name == NULL) { + /* things went wrong */ + udev_device_delete_db(dev); ++ udev_device_tag_index(dev, NULL, false); + udev_device_unref(event->dev_db); + err = -ENOMEM; + goto out; +@@ -629,6 +632,7 @@ int udev_event_execute_rules(struct udev_event *event, struct udev_rules *rules) + } + + udev_device_update_db(dev); ++ udev_device_tag_index(dev, event->dev_db, true); + + if (major(udev_device_get_devnum(dev)) != 0) { + /* remove/update possible left-over symlinks from old database entry */ +-- +1.7.0.1 + diff --git a/0013-keymap-Add-Samsung-Q210-P210-force-release-quirk.patch b/0013-keymap-Add-Samsung-Q210-P210-force-release-quirk.patch deleted file mode 100644 index 488a6e0..0000000 --- a/0013-keymap-Add-Samsung-Q210-P210-force-release-quirk.patch +++ /dev/null @@ -1,30 +0,0 @@ -From 20b48c3727eef1f266cbfd6bf5854b5c1419beb9 Mon Sep 17 00:00:00 2001 -From: Andy Whitcroft -Date: Tue, 2 Mar 2010 13:55:03 +0100 -Subject: [PATCH 13/65] keymap: Add Samsung Q210/P210 force-release quirk - -The Samsung Q210/P210 laptop also needs all of its function keys quirked. - -https://launchpad.net/bugs/530093 - -Signed-off-by: Martin Pitt ---- - extras/keymap/95-keyboard-force-release.rules | 2 +- - 1 files changed, 1 insertions(+), 1 deletions(-) - -diff --git a/extras/keymap/95-keyboard-force-release.rules b/extras/keymap/95-keyboard-force-release.rules -index 659ee95..48b896d 100644 ---- a/extras/keymap/95-keyboard-force-release.rules -+++ b/extras/keymap/95-keyboard-force-release.rules -@@ -19,7 +19,7 @@ DRIVER!="atkbd", GOTO="force_release_end" - ENV{DMI_VENDOR}="$attr{[dmi/id]sys_vendor}" - - --ENV{DMI_VENDOR}=="[sS][aA][mM][sS][uU][nN][gG]*", ATTR{[dmi/id]product_name}=="*N130*|*N140*|*SR70S/SR71S*", RUN+="keyboard-force-release.sh $devpath samsung-other" -+ENV{DMI_VENDOR}=="[sS][aA][mM][sS][uU][nN][gG]*", ATTR{[dmi/id]product_name}=="*N130*|*N140*|*SR70S/SR71S*|*Q210/P210*", RUN+="keyboard-force-release.sh $devpath samsung-other" - - ENV{DMI_VENDOR}=="Dell Inc.", ATTR{[dmi/id]product_name}=="Studio 1557", RUN+="keyboard-force-release.sh $devpath dell-studio-1557" - --- -1.6.6 - diff --git a/0014-keymap-Add-Fujitsu-Amilo-1848-u-force-release-quirk.patch b/0014-keymap-Add-Fujitsu-Amilo-1848-u-force-release-quirk.patch deleted file mode 100644 index 8ce3972..0000000 --- a/0014-keymap-Add-Fujitsu-Amilo-1848-u-force-release-quirk.patch +++ /dev/null @@ -1,53 +0,0 @@ -From da96a11b9c9164447bef206db47c405342ab8daa Mon Sep 17 00:00:00 2001 -From: Andy Whitcroft -Date: Tue, 2 Mar 2010 14:00:32 +0100 -Subject: [PATCH 14/65] keymap: Add Fujitsu Amilo 1848+u force-release quirk - -The Fujitsu Amilo Si 1848+u laptop requires the volume and mute keys -quirking. - -https://launchpad.net/bugs/530089 - -Signed-off-by: Martin Pitt ---- - Makefile.am | 1 + - extras/keymap/95-keyboard-force-release.rules | 2 ++ - .../keymap/force-release-maps/fujitsu-amilo-si1848 | 3 +++ - 3 files changed, 6 insertions(+), 0 deletions(-) - create mode 100644 extras/keymap/force-release-maps/fujitsu-amilo-si1848 - -diff --git a/Makefile.am b/Makefile.am -index 3780f50..471c5dd 100644 ---- a/Makefile.am -+++ b/Makefile.am -@@ -543,6 +543,7 @@ dist_udevkeymap_DATA = \ - udevkeymapforcereldir = $(libexecdir)/keymaps/force-release - dist_udevkeymapforcerel_DATA = \ - extras/keymap/force-release-maps/samsung-other \ -+ extras/keymap/force-release-maps/fujitsu-amilo-si1848 \ - extras/keymap/force-release-maps/dell-studio-1557 - - extras/keymap/keys.txt: $(INCLUDE_PREFIX)/linux/input.h -diff --git a/extras/keymap/95-keyboard-force-release.rules b/extras/keymap/95-keyboard-force-release.rules -index 48b896d..28639a5 100644 ---- a/extras/keymap/95-keyboard-force-release.rules -+++ b/extras/keymap/95-keyboard-force-release.rules -@@ -23,4 +23,6 @@ ENV{DMI_VENDOR}=="[sS][aA][mM][sS][uU][nN][gG]*", ATTR{[dmi/id]product_name}=="* - - ENV{DMI_VENDOR}=="Dell Inc.", ATTR{[dmi/id]product_name}=="Studio 1557", RUN+="keyboard-force-release.sh $devpath dell-studio-1557" - -+ENV{DMI_VENDOR}=="FUJITSU SIEMENS", ATTR{[dmi/id]product_name}=="AMILO Si 1848+u", RUN+="keyboard-force-release.sh $devpath fujitsu-amilo-si1848" -+ - LABEL="force_release_end" -diff --git a/extras/keymap/force-release-maps/fujitsu-amilo-si1848 b/extras/keymap/force-release-maps/fujitsu-amilo-si1848 -new file mode 100644 -index 0000000..1718673 ---- /dev/null -+++ b/extras/keymap/force-release-maps/fujitsu-amilo-si1848 -@@ -0,0 +1,3 @@ -+0xa0 #mute -+0xae #volume up -+0xb0 #volume down --- -1.6.6 - diff --git a/0014-libudev-accept-NULL-in-udev_device_get_tags_list_ent.patch b/0014-libudev-accept-NULL-in-udev_device_get_tags_list_ent.patch new file mode 100644 index 0000000..cd35b0d --- /dev/null +++ b/0014-libudev-accept-NULL-in-udev_device_get_tags_list_ent.patch @@ -0,0 +1,39 @@ +From 65f099c721fa568350f8ac019e3a99fda1966082 Mon Sep 17 00:00:00 2001 +From: Kay Sievers +Date: Fri, 23 Apr 2010 09:22:42 +0200 +Subject: [PATCH 14/19] libudev: accept NULL in udev_device_get_tags_list_entry() + +--- + libudev/libudev-device-private.c | 2 +- + libudev/libudev-device.c | 2 ++ + 2 files changed, 3 insertions(+), 1 deletions(-) + +diff --git a/libudev/libudev-device-private.c b/libudev/libudev-device-private.c +index 7e5fcbc..8c8ac24 100644 +--- a/libudev/libudev-device-private.c ++++ b/libudev/libudev-device-private.c +@@ -51,7 +51,7 @@ int udev_device_tag_index(struct udev_device *dev, struct udev_device *dev_old, + struct udev_list_entry *list_entry; + bool found; + +- if (add) { ++ if (add && dev_old != NULL) { + /* delete possible left-over tags */ + udev_list_entry_foreach(list_entry, udev_device_get_tags_list_entry(dev_old)) { + const char *tag_old = udev_list_entry_get_name(list_entry); +diff --git a/libudev/libudev-device.c b/libudev/libudev-device.c +index 3f441d0..a6a1ecb 100644 +--- a/libudev/libudev-device.c ++++ b/libudev/libudev-device.c +@@ -1289,6 +1289,8 @@ void udev_device_cleanup_tags_list(struct udev_device *udev_device) + + struct udev_list_entry *udev_device_get_tags_list_entry(struct udev_device *udev_device) + { ++ if (udev_device == NULL) ++ return NULL; + return udev_list_get_entry(&udev_device->tags_list); + } + +-- +1.7.0.1 + diff --git a/0015-Decrease-buffer-size-when-advancing-past-NUL-byte.patch b/0015-Decrease-buffer-size-when-advancing-past-NUL-byte.patch deleted file mode 100644 index 98541ed..0000000 --- a/0015-Decrease-buffer-size-when-advancing-past-NUL-byte.patch +++ /dev/null @@ -1,29 +0,0 @@ -From ecd42de2c56b4fcf0069b8b4a4d6607710e5de61 Mon Sep 17 00:00:00 2001 -From: David Zeuthen -Date: Tue, 2 Mar 2010 17:06:33 -0500 -Subject: [PATCH 15/65] Decrease buffer size when advancing past NUL byte - -Otherwise we'll overflow the buffer if space is tight. Also add a comment explaining this. - -Signed-off-by: David Zeuthen ---- - libudev/libudev-device.c | 2 ++ - 1 files changed, 2 insertions(+), 0 deletions(-) - -diff --git a/libudev/libudev-device.c b/libudev/libudev-device.c -index 71fc775..4f42aa2 100644 ---- a/libudev/libudev-device.c -+++ b/libudev/libudev-device.c -@@ -1166,7 +1166,9 @@ static int update_envp_monitor_buf(struct udev_device *udev_device) - l = util_strpcpyl(&s, l, key, "=", udev_list_entry_get_value(list_entry), NULL); - if (l == 0) - return -EINVAL; -+ /* advance past the trailing '\0' that util_strpcpyl() guarantees */ - s++; -+ l--; - } - udev_device->envp[i] = NULL; - udev_device->monitor_buf_len = s - udev_device->monitor_buf; --- -1.6.6 - diff --git a/0015-export-tag-functions.patch b/0015-export-tag-functions.patch new file mode 100644 index 0000000..2d6f066 --- /dev/null +++ b/0015-export-tag-functions.patch @@ -0,0 +1,24 @@ +From 2a34f9c31e17f4a6c4fc99a369f56e843a063390 Mon Sep 17 00:00:00 2001 +From: Kay Sievers +Date: Fri, 23 Apr 2010 10:46:00 +0200 +Subject: [PATCH 15/19] export tag functions + +--- + libudev/exported_symbols | 1 + + 1 files changed, 1 insertions(+), 0 deletions(-) + +diff --git a/libudev/exported_symbols b/libudev/exported_symbols +index c0ca4b9..d2c458e 100644 +--- a/libudev/exported_symbols ++++ b/libudev/exported_symbols +@@ -46,6 +46,7 @@ udev_enumerate_add_nomatch_subsystem + udev_enumerate_add_match_sysattr + udev_enumerate_add_nomatch_sysattr + udev_enumerate_add_match_property ++udev_enumerate_add_match_tag + udev_enumerate_add_match_sysname + udev_enumerate_scan_devices + udev_enumerate_scan_subsystems +-- +1.7.0.1 + diff --git a/0016-Use-UTIL_LINE_SIZE-not-UTIL_PATH_SIZE-to-truncate-pr.patch b/0016-Use-UTIL_LINE_SIZE-not-UTIL_PATH_SIZE-to-truncate-pr.patch deleted file mode 100644 index 024ee15..0000000 --- a/0016-Use-UTIL_LINE_SIZE-not-UTIL_PATH_SIZE-to-truncate-pr.patch +++ /dev/null @@ -1,26 +0,0 @@ -From 3a19299202b5d34b89d5910fde25e8a4cfa2b31a Mon Sep 17 00:00:00 2001 -From: David Zeuthen -Date: Tue, 2 Mar 2010 17:07:14 -0500 -Subject: [PATCH 16/65] Use UTIL_LINE_SIZE, not UTIL_PATH_SIZE to truncate properties - -Signed-off-by: David Zeuthen ---- - libudev/libudev-device.c | 2 +- - 1 files changed, 1 insertions(+), 1 deletions(-) - -diff --git a/libudev/libudev-device.c b/libudev/libudev-device.c -index 4f42aa2..b841745 100644 ---- a/libudev/libudev-device.c -+++ b/libudev/libudev-device.c -@@ -1089,7 +1089,7 @@ struct udev_list_entry *udev_device_add_property(struct udev_device *udev_device - - struct udev_list_entry *udev_device_add_property_from_string(struct udev_device *udev_device, const char *property) - { -- char name[UTIL_PATH_SIZE]; -+ char name[UTIL_LINE_SIZE]; - char *val; - - util_strscpy(name, sizeof(name), property); --- -1.6.6 - diff --git a/0016-export-udev_device_get_tags_list_entry.patch b/0016-export-udev_device_get_tags_list_entry.patch new file mode 100644 index 0000000..1ce2e3d --- /dev/null +++ b/0016-export-udev_device_get_tags_list_entry.patch @@ -0,0 +1,50 @@ +From 2793f4e34bdf4f1a46d0263f7dbdb8fcffe78e32 Mon Sep 17 00:00:00 2001 +From: Kay Sievers +Date: Fri, 23 Apr 2010 16:05:38 +0200 +Subject: [PATCH 16/19] export udev_device_get_tags_list_entry() + +--- + libudev/exported_symbols | 1 + + libudev/libudev-private.h | 1 - + libudev/libudev.h | 1 + + 3 files changed, 2 insertions(+), 1 deletions(-) + +diff --git a/libudev/exported_symbols b/libudev/exported_symbols +index d2c458e..935e361 100644 +--- a/libudev/exported_symbols ++++ b/libudev/exported_symbols +@@ -30,6 +30,7 @@ udev_device_get_subsystem + udev_device_get_devtype + udev_device_get_devlinks_list_entry + udev_device_get_properties_list_entry ++udev_device_get_tags_list_entry + udev_device_get_property_value + udev_device_get_action + udev_device_get_driver +diff --git a/libudev/libudev-private.h b/libudev/libudev-private.h +index 3f38a32..7132357 100644 +--- a/libudev/libudev-private.h ++++ b/libudev/libudev-private.h +@@ -87,7 +87,6 @@ int udev_device_set_devpath_old(struct udev_device *udev_device, const char *dev + const char *udev_device_get_knodename(struct udev_device *udev_device); + int udev_device_add_tag(struct udev_device *udev_device, const char *tag); + void udev_device_cleanup_tags_list(struct udev_device *udev_device); +-struct udev_list_entry *udev_device_get_tags_list_entry(struct udev_device *udev_device); + int udev_device_has_tag(struct udev_device *udev_device, const char *tag); + int udev_device_set_knodename(struct udev_device *udev_device, const char *knodename); + int udev_device_get_timeout(struct udev_device *udev_device); +diff --git a/libudev/libudev.h b/libudev/libudev.h +index 3b73fbd..5bc42df 100644 +--- a/libudev/libudev.h ++++ b/libudev/libudev.h +@@ -90,6 +90,7 @@ const char *udev_device_get_sysnum(struct udev_device *udev_device); + const char *udev_device_get_devnode(struct udev_device *udev_device); + struct udev_list_entry *udev_device_get_devlinks_list_entry(struct udev_device *udev_device); + struct udev_list_entry *udev_device_get_properties_list_entry(struct udev_device *udev_device); ++struct udev_list_entry *udev_device_get_tags_list_entry(struct udev_device *udev_device); + const char *udev_device_get_property_value(struct udev_device *udev_device, const char *key); + const char *udev_device_get_driver(struct udev_device *udev_device); + dev_t udev_device_get_devnum(struct udev_device *udev_device); +-- +1.7.0.1 + diff --git a/0017-Increase-UTIL_LINE_SIZE-from-2048-to-16384.patch b/0017-Increase-UTIL_LINE_SIZE-from-2048-to-16384.patch deleted file mode 100644 index d7419a1..0000000 --- a/0017-Increase-UTIL_LINE_SIZE-from-2048-to-16384.patch +++ /dev/null @@ -1,37 +0,0 @@ -From e32d5237ea045045c621edba7341631abd602d74 Mon Sep 17 00:00:00 2001 -From: David Zeuthen -Date: Tue, 2 Mar 2010 17:10:02 -0500 -Subject: [PATCH 17/65] Increase UTIL_LINE_SIZE from 2048 to 16384 - -Recent udisks versions, for LVM2 integration, ships with probers that -produce very long lines such as - -UDISKS_LVM2_PV_VG_PV_LIST= - uuid=98lyZl-Ya7U-p26Z-Ia7b-xf8u-xZqP-jc4njb;size=2000397795328;allocated_size=2000397795328 - uuid=iFs0cM-sxCF-ceQK-hZl1-kbwo-ZTjq-gSewQR;size=2000397795328;allocated_size=2000397795328 - [...] - -e.g. roughly 100 bytes per LVM2 physical volume for each LVM2 -PV encountered. - -Signed-off-by: David Zeuthen ---- - libudev/libudev-private.h | 2 +- - 1 files changed, 1 insertions(+), 1 deletions(-) - -diff --git a/libudev/libudev-private.h b/libudev/libudev-private.h -index 0d28b80..e0c51dc 100644 ---- a/libudev/libudev-private.h -+++ b/libudev/libudev-private.h -@@ -187,7 +187,7 @@ int udev_queue_export_device_failed(struct udev_queue_export *udev_queue_export, - /* libudev-util.c */ - #define UTIL_PATH_SIZE 1024 - #define UTIL_NAME_SIZE 512 --#define UTIL_LINE_SIZE 2048 -+#define UTIL_LINE_SIZE 16384 - #define UDEV_ALLOWED_CHARS_INPUT "/ $%?," - ssize_t util_get_sys_subsystem(struct udev *udev, const char *syspath, char *subsystem, size_t size); - ssize_t util_get_sys_driver(struct udev *udev, const char *syspath, char *driver, size_t size); --- -1.6.6 - diff --git a/0017-configure.ac-move-firmware-path-setting-out-of-extra.patch b/0017-configure.ac-move-firmware-path-setting-out-of-extra.patch new file mode 100644 index 0000000..a54acaf --- /dev/null +++ b/0017-configure.ac-move-firmware-path-setting-out-of-extra.patch @@ -0,0 +1,68 @@ +From 0c6a3f48357ed4a49c2c49c43f669f930d628382 Mon Sep 17 00:00:00 2001 +From: Robby Workman +Date: Sat, 24 Apr 2010 21:38:37 +0200 +Subject: [PATCH 17/19] configure.ac: move firmware-path setting out of extras section + +--- + configure.ac | 38 ++++++++++++++++++-------------------- + 1 files changed, 18 insertions(+), 20 deletions(-) + +diff --git a/configure.ac b/configure.ac +index d4d29c4..4fe8c3c 100644 +--- a/configure.ac ++++ b/configure.ac +@@ -46,6 +46,24 @@ if test "x$enable_logging" = "xyes"; then + AC_DEFINE(ENABLE_LOGGING, [1], [System logging.]) + fi + ++AC_ARG_WITH(firmware-path, ++ AS_HELP_STRING([--with-firmware-path=DIR[[[:DIR[...]]]]], ++ [Firmware search path (default=/lib/firmware/updates:/lib/firmware)]), ++ [], [with_firmware_path="/lib/firmware/updates:/lib/firmware"] ++ ) ++OLD_IFS=$IFS ++IFS=: ++for i in $with_firmware_path ++do ++ if test "x${FIRMWARE_PATH}" = "x"; then ++ FIRMWARE_PATH="\\\"${i}/\\\"" ++ else ++ FIRMWARE_PATH="${FIRMWARE_PATH}, \\\"${i}/\\\"" ++ fi ++done ++IFS=$OLD_IFS ++AC_SUBST([FIRMWARE_PATH], [$FIRMWARE_PATH]) ++ + AC_ARG_ENABLE([extras], + AS_HELP_STRING([--disable-extras], [disable extras with external dependencies]), + [], [enable_extras=yes]) +@@ -82,26 +100,6 @@ if test "x$enable_extras" = xyes; then + fi]) + AC_SUBST(PCI_DATABASE) + +- AC_ARG_WITH(firmware-path, +- AS_HELP_STRING([--with-firmware-path=DIR[[[:DIR[...]]]]], +- [Firmware search path (default=/lib/firmware/updates:/lib/firmware)]), +- [], +- [with_firmware_path="/lib/firmware/updates:/lib/firmware"] +- ) +- OLD_IFS=$IFS +- IFS=: +- for i in $with_firmware_path +- do +- if test "x${FIRMWARE_PATH}" = "x" +- then +- FIRMWARE_PATH="\\\"${i}/\\\"" +- else +- FIRMWARE_PATH="${FIRMWARE_PATH}, \\\"${i}/\\\"" +- fi +- done +- IFS=$OLD_IFS +- AC_SUBST([FIRMWARE_PATH], [$FIRMWARE_PATH]) +- + AC_CHECK_HEADER([linux/input.h], [:], AC_MSG_ERROR([kernel headers not found])) + AC_SUBST([INCLUDE_PREFIX], [$(echo '#include ' | eval $ac_cpp -E - | sed -n '/linux\/input.h/ {s:.*"\(.*\)/linux/input.h".*:\1:; p; q}')]) + fi +-- +1.7.0.1 + diff --git a/0018-Fix-virtio-ports-rule-to-use-attr-instead-of-ATTR.patch b/0018-Fix-virtio-ports-rule-to-use-attr-instead-of-ATTR.patch deleted file mode 100644 index a536914..0000000 --- a/0018-Fix-virtio-ports-rule-to-use-attr-instead-of-ATTR.patch +++ /dev/null @@ -1,29 +0,0 @@ -From 3c4b1738a9d591d7ddce361ea184b76b253c4e87 Mon Sep 17 00:00:00 2001 -From: Amit Shah -Date: Fri, 26 Feb 2010 14:05:41 +0530 -Subject: [PATCH 18/65] Fix virtio-ports rule to use $attr instead of $ATTR - -Newer udev versions don't understand $ATTR. - -Signed-off-by: Amit Shah -Signed-off-by: Martin Pitt ---- - rules/rules.d/50-udev-default.rules | 2 +- - 1 files changed, 1 insertions(+), 1 deletions(-) - -diff --git a/rules/rules.d/50-udev-default.rules b/rules/rules.d/50-udev-default.rules -index f8556d1..da1535f 100644 ---- a/rules/rules.d/50-udev-default.rules -+++ b/rules/rules.d/50-udev-default.rules -@@ -18,7 +18,7 @@ KERNEL=="mwave", GROUP="dialout" - KERNEL=="hvc*|hvsi*", GROUP="dialout" - - # virtio serial / console ports --KERNEL=="vport*", SYMLINK+="virtio-ports/$ATTR{name}" -+KERNEL=="vport*", SYMLINK+="virtio-ports/$attr{name}" - - # mem - KERNEL=="null|zero|full|random|urandom", MODE="0666" --- -1.6.6 - diff --git a/0039-keymap-Fix-another-key-for-Acer-TravelMate-6593.patch b/0018-keymap-Fix-Bluetooth-key-on-Acer-TravelMate-4720.patch similarity index 69% rename from 0039-keymap-Fix-another-key-for-Acer-TravelMate-6593.patch rename to 0018-keymap-Fix-Bluetooth-key-on-Acer-TravelMate-4720.patch index 41641dd..ac23c46 100644 --- a/0039-keymap-Fix-another-key-for-Acer-TravelMate-6593.patch +++ b/0018-keymap-Fix-Bluetooth-key-on-Acer-TravelMate-4720.patch @@ -1,26 +1,26 @@ -From 43d08246dbb3a01e88062d5315194ee889e52dd4 Mon Sep 17 00:00:00 2001 +From ad3d4198439f06cab8a2a65190ad501b803666a1 Mon Sep 17 00:00:00 2001 From: Martin Pitt -Date: Wed, 24 Mar 2010 18:56:20 +0100 -Subject: [PATCH 39/65] keymap: Fix another key for Acer TravelMate 6593 +Date: Mon, 26 Apr 2010 08:28:36 +0200 +Subject: [PATCH 18/19] keymap: Fix Bluetooth key on Acer TravelMate 4720 -https://launchpad.net/bugs/536914 +https://launchpad.net/bugs/569815 --- extras/keymap/95-keymap.rules | 2 +- 1 files changed, 1 insertions(+), 1 deletions(-) diff --git a/extras/keymap/95-keymap.rules b/extras/keymap/95-keymap.rules -index b3b08ae..dd58453 100644 +index 2f41cb4..a27bc6d 100644 --- a/extras/keymap/95-keymap.rules +++ b/extras/keymap/95-keymap.rules -@@ -78,7 +78,7 @@ ENV{DMI_VENDOR}=="Acer*", RUN+="keymap $name acer" +@@ -77,7 +77,7 @@ ENV{DMI_VENDOR}=="Gateway*", ATTR{[dmi/id]product_name}=="*AOA1*", RUN+="keymap + ENV{DMI_VENDOR}=="Acer*", RUN+="keymap $name acer" ENV{DMI_VENDOR}=="Acer*", ATTR{[dmi/id]product_name}=="Extensa*", ATTR{[dmi/id]product_name}=="*5210*|*5220*|*5610*|*5620*|*5720*", RUN+="keymap $name 0xEE screenlock" ENV{DMI_VENDOR}=="Acer*", ATTR{[dmi/id]product_name}=="TravelMate*C300*", RUN+="keymap $name acer-travelmate_c300" - ENV{DMI_VENDOR}=="Acer*", ATTR{[dmi/id]product_name}=="TravelMate*6292*|TravelMate*8471*|Aspire 1810T*|AO751h|AO531h", RUN+="keymap $name 0xD9 bluetooth" --ENV{DMI_VENDOR}=="Acer*", ATTR{[dmi/id]product_name}=="TravelMate 6593|Aspire 1640", RUN+="keymap $name 0xB2 www" -+ENV{DMI_VENDOR}=="Acer*", ATTR{[dmi/id]product_name}=="TravelMate 6593|Aspire 1640", RUN+="keymap $name 0xB2 www 0xEE screenlock" +-ENV{DMI_VENDOR}=="Acer*", ATTR{[dmi/id]product_name}=="TravelMate*6292*|TravelMate*8471*|Aspire 1810T*|AO751h|AO531h", RUN+="keymap $name 0xD9 bluetooth" ++ENV{DMI_VENDOR}=="Acer*", ATTR{[dmi/id]product_name}=="TravelMate*6292*|TravelMate*8471*|TravelMate*4720*|Aspire 1810T*|AO751h|AO531h", RUN+="keymap $name 0xD9 bluetooth" + ENV{DMI_VENDOR}=="Acer*", ATTR{[dmi/id]product_name}=="TravelMate 6593|Aspire 1640", RUN+="keymap $name 0xB2 www 0xEE screenlock" ENV{DMI_VENDOR}=="Acer*", ATTR{[dmi/id]product_name}=="Aspire 6920", RUN+="keymap $name acer-aspire_6920" ENV{DMI_VENDOR}=="Acer*", ATTR{[dmi/id]product_name}=="Aspire 5920G", RUN+="keymap $name acer-aspire_5920g" - ENV{DMI_VENDOR}=="Acer*", ATTR{[dmi/id]product_name}=="Aspire 5720*", RUN+="keymap $name acer-aspire_5720" -- -1.6.6 +1.7.0.1 diff --git a/0019-udev-acl-Correctly-handle-ENV-ACL_MANAGE-0.patch b/0019-udev-acl-Correctly-handle-ENV-ACL_MANAGE-0.patch deleted file mode 100644 index d9aed68..0000000 --- a/0019-udev-acl-Correctly-handle-ENV-ACL_MANAGE-0.patch +++ /dev/null @@ -1,47 +0,0 @@ -From 5c3ebbf35a2c101e0212c7066f0d65e457fcf40c Mon Sep 17 00:00:00 2001 -From: Martin Pitt -Date: Thu, 4 Mar 2010 00:48:59 +0100 -Subject: [PATCH 19/65] udev-acl: Correctly handle ENV{ACL_MANAGE}==0 -MIME-Version: 1.0 -Content-Type: text/plain; charset=UTF-8 -Content-Transfer-Encoding: 8bit - -When a custom rule sets ACL_MANAGE to 0 to disable ACL management for a -particular device, handle this as "disabled", by explicitly checking against -"1" instead of "nonempty". - -Thanks to Rafał Rzepecki for pointing this out. ---- - extras/udev-acl/70-acl.rules | 2 +- - extras/udev-acl/udev-acl.c | 2 +- - 2 files changed, 2 insertions(+), 2 deletions(-) - -diff --git a/extras/udev-acl/70-acl.rules b/extras/udev-acl/70-acl.rules -index 8380f53..874667c 100644 ---- a/extras/udev-acl/70-acl.rules -+++ b/extras/udev-acl/70-acl.rules -@@ -69,7 +69,7 @@ SUBSYSTEM=="usb", ATTR{idVendor}=="0bb4", ATTR{idProduct}=="0c02", ENV{ACL_MANAG - ENV{COLOR_MEASUREMENT_DEVICE}=="*?", ENV{ACL_MANAGE}="1" - - # apply ACL for all locally logged in users --LABEL="acl_apply", ENV{ACL_MANAGE}=="?*", TEST=="/var/run/ConsoleKit/database", \ -+LABEL="acl_apply", ENV{ACL_MANAGE}=="1", TEST=="/var/run/ConsoleKit/database", \ - RUN+="udev-acl --action=$env{ACTION} --device=$env{DEVNAME}" - - LABEL="acl_end" -diff --git a/extras/udev-acl/udev-acl.c b/extras/udev-acl/udev-acl.c -index e670ce7..c070fcc 100644 ---- a/extras/udev-acl/udev-acl.c -+++ b/extras/udev-acl/udev-acl.c -@@ -289,7 +289,7 @@ static void apply_acl_to_devices(uid_t uid, int add) - /* iterate over all devices tagged with ACL_SET */ - udev = udev_new(); - enumerate = udev_enumerate_new(udev); -- udev_enumerate_add_match_property(enumerate, "ACL_MANAGE", "*"); -+ udev_enumerate_add_match_property(enumerate, "ACL_MANAGE", "1"); - udev_enumerate_scan_devices(enumerate); - udev_list_entry_foreach(list_entry, udev_enumerate_get_list_entry(enumerate)) { - struct udev_device *device; --- -1.6.6 - diff --git a/0019-udevd-always-try-to-find-an-idle-worker-instead-of-f.patch b/0019-udevd-always-try-to-find-an-idle-worker-instead-of-f.patch new file mode 100644 index 0000000..3864b50 --- /dev/null +++ b/0019-udevd-always-try-to-find-an-idle-worker-instead-of-f.patch @@ -0,0 +1,58 @@ +From 665ee17def2caa6811ae032ae68ebf8239a18cf8 Mon Sep 17 00:00:00 2001 +From: Kay Sievers +Date: Mon, 26 Apr 2010 12:21:16 +0200 +Subject: [PATCH 19/19] udevd: always try to find an idle worker instead of forking a new one + +We special-handle events with a TIMEOUT= set, so they don't get queued +or wait for parent events to finish, to make sure we can handle them +as fast as possible. + +With this change we first try to find an idle worker process before +forking a new one. +--- + udev/udevd.c | 8 ++++---- + 1 files changed, 4 insertions(+), 4 deletions(-) + +diff --git a/udev/udevd.c b/udev/udevd.c +index c27b4cd..7712543 100644 +--- a/udev/udevd.c ++++ b/udev/udevd.c +@@ -360,7 +360,7 @@ static void worker_new(struct event *event) + } + } + +-static void event_run(struct event *event) ++static void event_run(struct event *event, bool force) + { + struct udev_list_node *loop; + +@@ -385,7 +385,7 @@ static void event_run(struct event *event) + return; + } + +- if (childs >= max_childs) { ++ if (!force && childs >= max_childs) { + info(event->udev, "maximum number (%i) of childs reached\n", childs); + return; + } +@@ -420,7 +420,7 @@ static void event_queue_insert(struct udev_device *dev) + + /* run all events with a timeout set immediately */ + if (udev_device_get_timeout(dev) > 0) { +- worker_new(event); ++ event_run(event, true); + return; + } + } +@@ -552,7 +552,7 @@ static void events_start(struct udev *udev) + continue; + } + +- event_run(event); ++ event_run(event, false); + } + } + +-- +1.7.0.1 + diff --git a/0020-udev-acl-no-not-encourage-use-of-ACL_MANAGE-outside-.patch b/0020-udev-acl-no-not-encourage-use-of-ACL_MANAGE-outside-.patch deleted file mode 100644 index b65e4e4..0000000 --- a/0020-udev-acl-no-not-encourage-use-of-ACL_MANAGE-outside-.patch +++ /dev/null @@ -1,27 +0,0 @@ -From 9a87132677191e49c3d464c91aac7fc218e1eb18 Mon Sep 17 00:00:00 2001 -From: Kay Sievers -Date: Sun, 7 Mar 2010 13:47:34 +0100 -Subject: [PATCH 20/65] udev-acl: no not encourage use of ACL_MANAGE outside of rules file - ---- - extras/udev-acl/70-acl.rules | 4 +++- - 1 files changed, 3 insertions(+), 1 deletions(-) - -diff --git a/extras/udev-acl/70-acl.rules b/extras/udev-acl/70-acl.rules -index 874667c..fde2656 100644 ---- a/extras/udev-acl/70-acl.rules -+++ b/extras/udev-acl/70-acl.rules -@@ -1,7 +1,9 @@ - # do not edit this file, it will be overwritten on update - -+# Do not use ACL_MANAGE outside of this file. This variable is private to -+# udev-acl of this udev release and may be replaced at any time. -+ - ENV{MAJOR}=="", GOTO="acl_end" --ENV{ACL_MANAGE}=="0", GOTO="acl_end" - ACTION!="add|change", GOTO="acl_apply" - - # PTP/MTP protocol devices, cameras, portable media players --- -1.6.6 - diff --git a/0021-input_id-Fix-linking.patch b/0021-input_id-Fix-linking.patch deleted file mode 100644 index 1e3734b..0000000 --- a/0021-input_id-Fix-linking.patch +++ /dev/null @@ -1,27 +0,0 @@ -From a245a97b4e805c65ce22659742371550ccf002c1 Mon Sep 17 00:00:00 2001 -From: Martin Pitt -Date: Wed, 10 Mar 2010 12:17:03 +0100 -Subject: [PATCH 21/65] input_id: Fix linking - -Link against libudev-private.a instead of libudev.a, to avoid runtime -dependency to libudev. ---- - Makefile.am | 2 +- - 1 files changed, 1 insertions(+), 1 deletions(-) - -diff --git a/Makefile.am b/Makefile.am -index 471c5dd..99a0133 100644 ---- a/Makefile.am -+++ b/Makefile.am -@@ -239,7 +239,7 @@ dist_udevrules_DATA += extras/floppy/60-floppy.rules - # input_id - import input device class - # ------------------------------------------------------------------------------ - extras_input_id_input_id_SOURCES = extras/input_id/input_id.c --extras_input_id_input_id_LDADD = libudev/libudev.la -+extras_input_id_input_id_LDADD = libudev/libudev-private.la - libexec_PROGRAMS += extras/input_id/input_id - - # ------------------------------------------------------------------------------ --- -1.6.6 - diff --git a/0022-replace-utimes-with-utimensat.patch b/0022-replace-utimes-with-utimensat.patch deleted file mode 100644 index 57599d5..0000000 --- a/0022-replace-utimes-with-utimensat.patch +++ /dev/null @@ -1,34 +0,0 @@ -From 455f792e4791e037eb0406005b92c345cf0baf56 Mon Sep 17 00:00:00 2001 -From: Kay Sievers -Date: Wed, 10 Mar 2010 14:43:07 +0100 -Subject: [PATCH 22/65] replace utimes() with utimensat() - ---- - udev/udev-node.c | 4 ++-- - 1 files changed, 2 insertions(+), 2 deletions(-) - -diff --git a/udev/udev-node.c b/udev/udev-node.c -index a70c147..307a76b 100644 ---- a/udev/udev-node.c -+++ b/udev/udev-node.c -@@ -57,7 +57,7 @@ int udev_node_mknod(struct udev_device *dev, const char *file, dev_t devnum, mod - preserve = 1; - udev_selinux_lsetfilecon(udev, file, mode); - /* update time stamp when we re-use the node, like on media change events */ -- utimes(file, NULL); -+ utimensat(AT_FDCWD, file, NULL, 0); - } else { - char file_tmp[UTIL_PATH_SIZE + sizeof(TMP_FILE_EXT)]; - -@@ -178,7 +178,7 @@ static int node_symlink(struct udev *udev, const char *node, const char *slink) - info(udev, "preserve already existing symlink '%s' to '%s'\n", - slink, target); - udev_selinux_lsetfilecon(udev, slink, S_IFLNK); -- lutimes(slink, NULL); -+ utimensat(AT_FDCWD, slink, NULL, AT_SYMLINK_NOFOLLOW); - goto exit; - } - } --- -1.6.6 - diff --git a/0023-libbudev-private-rename-udev_list_entry_get_flag.patch b/0023-libbudev-private-rename-udev_list_entry_get_flag.patch deleted file mode 100644 index bb2ceb1..0000000 --- a/0023-libbudev-private-rename-udev_list_entry_get_flag.patch +++ /dev/null @@ -1,212 +0,0 @@ -From fbb31cd6e10fe66d2da781db0ba9a8d671a4c6aa Mon Sep 17 00:00:00 2001 -From: Kay Sievers -Date: Wed, 10 Mar 2010 14:52:42 +0100 -Subject: [PATCH 23/65] libbudev-private: rename udev_list_entry_get_flag() - ---- - libudev/libudev-device-private.c | 4 ++-- - libudev/libudev-device.c | 4 ++-- - libudev/libudev-list.c | 10 +++++----- - libudev/libudev-private.h | 9 ++++++--- - udev/udev-event.c | 2 +- - udev/udev-node.c | 2 +- - udev/udev-rules.c | 12 ++++++------ - 7 files changed, 23 insertions(+), 20 deletions(-) - -diff --git a/libudev/libudev-device-private.c b/libudev/libudev-device-private.c -index 07249c3..1bcf441 100644 ---- a/libudev/libudev-device-private.c -+++ b/libudev/libudev-device-private.c -@@ -39,7 +39,7 @@ int udev_device_update_db(struct udev_device *udev_device) - util_strscpyl(filename_tmp, sizeof(filename_tmp), filename, ".tmp", NULL); - - udev_list_entry_foreach(list_entry, udev_device_get_properties_list_entry(udev_device)) -- if (udev_list_entry_get_flag(list_entry)) -+ if (udev_list_entry_get_flags(list_entry)) - goto file; - if (udev_device_get_num_fake_partitions(udev_device) != 0) - goto file; -@@ -102,7 +102,7 @@ file: - if (udev_device_get_watch_handle(udev_device) >= 0) - fprintf(f, "W:%i\n", udev_device_get_watch_handle(udev_device)); - udev_list_entry_foreach(list_entry, udev_device_get_properties_list_entry(udev_device)) { -- if (!udev_list_entry_get_flag(list_entry)) -+ if (!udev_list_entry_get_flags(list_entry)) - continue; - fprintf(f, "E:%s=%s\n", - udev_list_entry_get_name(list_entry), -diff --git a/libudev/libudev-device.c b/libudev/libudev-device.c -index b841745..aec5fb5 100644 ---- a/libudev/libudev-device.c -+++ b/libudev/libudev-device.c -@@ -1,7 +1,7 @@ - /* - * libudev - interface to udev device information - * -- * Copyright (C) 2008-2009 Kay Sievers -+ * Copyright (C) 2008-2010 Kay Sievers - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public -@@ -1068,7 +1068,7 @@ int udev_device_add_devlink(struct udev_device *udev_device, const char *devlink - if (list_entry == NULL) - return -ENOMEM; - if (unique) -- udev_list_entry_set_flag(list_entry, 1); -+ udev_list_entry_set_flags(list_entry, 1); - return 0; - } - -diff --git a/libudev/libudev-list.c b/libudev/libudev-list.c -index f6637fc..b5e9645 100644 ---- a/libudev/libudev-list.c -+++ b/libudev/libudev-list.c -@@ -38,7 +38,7 @@ struct udev_list_entry { - struct udev_list_node *list; - char *name; - char *value; -- int flag; -+ unsigned int flags; - }; - - /* list head point to itself if empty */ -@@ -258,16 +258,16 @@ const char *udev_list_entry_get_value(struct udev_list_entry *list_entry) - return list_entry->value; - } - --int udev_list_entry_get_flag(struct udev_list_entry *list_entry) -+unsigned int udev_list_entry_get_flags(struct udev_list_entry *list_entry) - { - if (list_entry == NULL) - return -EINVAL; -- return list_entry->flag; -+ return list_entry->flags; - } - --void udev_list_entry_set_flag(struct udev_list_entry *list_entry, int flag) -+void udev_list_entry_set_flags(struct udev_list_entry *list_entry, unsigned int flags) - { - if (list_entry == NULL) - return; -- list_entry->flag = flag; -+ list_entry->flags = flags; - } -diff --git a/libudev/libudev-private.h b/libudev/libudev-private.h -index e0c51dc..5ee0c58 100644 ---- a/libudev/libudev-private.h -+++ b/libudev/libudev-private.h -@@ -1,7 +1,7 @@ - /* - * libudev - interface to udev device information - * -- * Copyright (C) 2008-2009 Kay Sievers -+ * Copyright (C) 2008-2010 Kay Sievers - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public -@@ -82,6 +82,9 @@ const char *udev_device_get_devpath_old(struct udev_device *udev_device); - const char *udev_device_get_sysname_old(struct udev_device *udev_device); - int udev_device_set_devpath_old(struct udev_device *udev_device, const char *devpath_old); - const char *udev_device_get_knodename(struct udev_device *udev_device); -+int udev_device_add_tag(struct udev_device *udev_device, const char *tag); -+struct udev_list_entry *udev_device_get_tag_list_entry(struct udev_device *udev_device); -+int udev_device_has_tag(struct udev_device *udev_device, const char *tag); - int udev_device_set_knodename(struct udev_device *udev_device, const char *knodename); - int udev_device_get_timeout(struct udev_device *udev_device); - int udev_device_set_timeout(struct udev_device *udev_device, int timeout); -@@ -163,8 +166,8 @@ void udev_list_entry_insert_before(struct udev_list_entry *new, struct udev_list - void udev_list_entry_append(struct udev_list_entry *new, struct udev_list_node *list); - void udev_list_cleanup_entries(struct udev *udev, struct udev_list_node *name_list); - struct udev_list_entry *udev_list_get_entry(struct udev_list_node *list); --int udev_list_entry_get_flag(struct udev_list_entry *list_entry); --void udev_list_entry_set_flag(struct udev_list_entry *list_entry, int flag); -+unsigned int udev_list_entry_get_flags(struct udev_list_entry *list_entry); -+void udev_list_entry_set_flags(struct udev_list_entry *list_entry, unsigned int flags); - #define udev_list_entry_foreach_safe(entry, tmp, first) \ - for (entry = first, tmp = udev_list_entry_get_next(entry); \ - entry != NULL; \ -diff --git a/udev/udev-event.c b/udev/udev-event.c -index 4e1773f..986c119 100644 ---- a/udev/udev-event.c -+++ b/udev/udev-event.c -@@ -729,7 +729,7 @@ int udev_event_execute_run(struct udev_event *event, const sigset_t *sigmask) - udev_event_apply_format(event, cmd, program, sizeof(program)); - envp = udev_device_get_properties_envp(event->dev); - if (util_run_program(event->udev, program, envp, NULL, 0, NULL, sigmask) != 0) { -- if (udev_list_entry_get_flag(list_entry)) -+ if (udev_list_entry_get_flags(list_entry)) - err = -1; - } - } -diff --git a/udev/udev-node.c b/udev/udev-node.c -index 307a76b..23bfade 100644 ---- a/udev/udev-node.c -+++ b/udev/udev-node.c -@@ -405,7 +405,7 @@ int udev_node_add(struct udev_device *dev, mode_t mode, uid_t uid, gid_t gid) - - /* create/update symlinks, add symlinks to name index */ - udev_list_entry_foreach(list_entry, udev_device_get_devlinks_list_entry(dev)) { -- if (udev_list_entry_get_flag(list_entry)) -+ if (udev_list_entry_get_flags(list_entry)) - /* simple unmanaged link name */ - node_symlink(udev, udev_device_get_devnode(dev), udev_list_entry_get_name(list_entry)); - else -diff --git a/udev/udev-rules.c b/udev/udev-rules.c -index 3da2033..60daad5 100644 ---- a/udev/udev-rules.c -+++ b/udev/udev-rules.c -@@ -717,7 +717,7 @@ static int import_property_from_string(struct udev_device *dev, char *line) - entry = udev_device_add_property(dev, key, val); - /* store in db, skip private keys */ - if (key[0] != '.') -- udev_list_entry_set_flag(entry, 1); -+ udev_list_entry_set_flags(entry, 1); - } - return 0; - } -@@ -785,7 +785,7 @@ static int import_parent_into_properties(struct udev_device *dev, const char *fi - entry = udev_device_add_property(dev, key, val); - /* store in db, skip private keys */ - if (key[0] != '.') -- udev_list_entry_set_flag(entry, 1); -+ udev_list_entry_set_flags(entry, 1); - } - } - return 0; -@@ -1831,13 +1831,13 @@ struct udev_rules *udev_rules_new(struct udev *udev, int resolve_names) - filename_off = add_string(rules, filename); - /* the offset in the rule is limited to unsigned short */ - if (filename_off < USHRT_MAX) -- udev_list_entry_set_flag(file_loop, filename_off); -+ udev_list_entry_set_flags(file_loop, filename_off); - } - - /* parse list of files */ - udev_list_entry_foreach_safe(file_loop, file_tmp, udev_list_get_entry(&file_list)) { - const char *filename = udev_list_entry_get_name(file_loop); -- unsigned int filename_off = udev_list_entry_get_flag(file_loop); -+ unsigned int filename_off = udev_list_entry_get_flags(file_loop); - - if (stat(filename, &statbuf) == 0 && statbuf.st_size > 0) - parse_file(rules, filename, filename_off); -@@ -2420,7 +2420,7 @@ int udev_rules_apply_to_event(struct udev_rules *rules, struct udev_event *event - entry = udev_device_add_property(event->dev, name, temp_value); - /* store in db, skip private keys */ - if (name[0] != '.') -- udev_list_entry_set_flag(entry, 1); -+ udev_list_entry_set_flags(entry, 1); - } else { - udev_device_add_property(event->dev, name, NULL); - } -@@ -2542,7 +2542,7 @@ int udev_rules_apply_to_event(struct udev_rules *rules, struct udev_event *event - list_entry = udev_list_entry_add(event->udev, &event->run_list, - &rules->buf[cur->key.value_off], NULL, 1, 0); - if (cur->key.fail_on_error) -- udev_list_entry_set_flag(list_entry, 1); -+ udev_list_entry_set_flags(list_entry, 1); - break; - } - case TK_A_GOTO: --- -1.6.6 - diff --git a/0024-udevadm-monitor-use-as-separator-in-subsystem-match-.patch b/0024-udevadm-monitor-use-as-separator-in-subsystem-match-.patch deleted file mode 100644 index 6a6a349..0000000 --- a/0024-udevadm-monitor-use-as-separator-in-subsystem-match-.patch +++ /dev/null @@ -1,65 +0,0 @@ -From a00ff5db021b50864ba50cce15865bca2d52f91f Mon Sep 17 00:00:00 2001 -From: Kay Sievers -Date: Wed, 10 Mar 2010 15:00:00 +0100 -Subject: [PATCH 24/65] udevadm: monitor - use / as separator in --subsystem-match=subsystem[/devtype] - ---- - udev/udevadm-monitor.c | 12 ++++++------ - udev/udevadm.xml | 6 ++++++ - 2 files changed, 12 insertions(+), 6 deletions(-) - -diff --git a/udev/udevadm-monitor.c b/udev/udevadm-monitor.c -index 4063c48..d136c60 100644 ---- a/udev/udevadm-monitor.c -+++ b/udev/udevadm-monitor.c -@@ -1,5 +1,5 @@ - /* -- * Copyright (C) 2004-2009 Kay Sievers -+ * Copyright (C) 2004-2010 Kay Sievers - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by -@@ -111,7 +111,7 @@ int udevadm_monitor(struct udev *udev, int argc, char *argv[]) - char *devtype; - - util_strscpy(subsys, sizeof(subsys), optarg); -- devtype = strchr(subsys, ':'); -+ devtype = strchr(subsys, '/'); - if (devtype != NULL) { - devtype[0] = '\0'; - devtype++; -@@ -121,10 +121,10 @@ int udevadm_monitor(struct udev *udev, int argc, char *argv[]) - } - case 'h': - printf("Usage: udevadm monitor [--property] [--kernel] [--udev] [--help]\n" -- " --property print the event properties\n" -- " --kernel print kernel uevents\n" -- " --udev print udev events\n" -- " --subsystem-match= filter events\n" -+ " --property print the event properties\n" -+ " --kernel print kernel uevents\n" -+ " --udev print udev events\n" -+ " --subsystem-match= filter events by subsystem\n" - " --help\n\n"); - default: - goto out; -diff --git a/udev/udevadm.xml b/udev/udevadm.xml -index ad49249..fa1742b 100644 ---- a/udev/udevadm.xml -+++ b/udev/udevadm.xml -@@ -350,6 +350,12 @@ - - - -+ -+ -+ Filter events by subsystem[/devtype]. Only udev events with a matching subsystem value will pass. -+ -+ -+ - - - Print help text. --- -1.6.6 - diff --git a/0025-use-major-minor-as-entries-in-symlink-stack-instead-.patch b/0025-use-major-minor-as-entries-in-symlink-stack-instead-.patch deleted file mode 100644 index be5f864..0000000 --- a/0025-use-major-minor-as-entries-in-symlink-stack-instead-.patch +++ /dev/null @@ -1,81 +0,0 @@ -From af24bb178eec6adcf4f04d3b183cd50a831c8b7e Mon Sep 17 00:00:00 2001 -From: Kay Sievers -Date: Wed, 10 Mar 2010 17:29:27 +0100 -Subject: [PATCH 25/65] use major:minor as entries in symlink stack instead of devpath - ---- - udev/udev-node.c | 30 ++++++++++++++++-------------- - 1 files changed, 16 insertions(+), 14 deletions(-) - -diff --git a/udev/udev-node.c b/udev/udev-node.c -index 23bfade..4314cce 100644 ---- a/udev/udev-node.c -+++ b/udev/udev-node.c -@@ -245,28 +245,26 @@ static const char *link_find_prioritized(struct udev_device *dev, bool add, cons - for (;;) { - struct udev_device *dev_db; - struct dirent *dent; -- char devpath[UTIL_PATH_SIZE]; -- char syspath[UTIL_PATH_SIZE]; -- ssize_t len; -+ int maj, min; -+ char type, type2; -+ dev_t devnum; - - dent = readdir(dir); - if (dent == NULL || dent->d_name[0] == '\0') - break; - if (dent->d_name[0] == '.') - continue; -- dbg(udev, "found '%s/%s'\n", stackdir, dent->d_name); -- len = readlinkat(dirfd(dir), dent->d_name, devpath, sizeof(devpath)); -- if (len <= 0 || len == (ssize_t)sizeof(devpath)) -+ if (sscanf(dent->d_name, "%c%i:%i", &type, &maj, &min) != 3) - continue; -- devpath[len] = '\0'; -- util_strscpyl(syspath, sizeof(syspath), udev_get_sys_path(udev), devpath, NULL); -- info(udev, "found '%s' claiming '%s'\n", syspath, stackdir); -+ info(udev, "found '%c%i:%i' claiming '%s'\n", type, maj, min, stackdir); -+ devnum = makedev(maj, min); - - /* did we find ourself? */ -- if (strcmp(udev_device_get_syspath(dev), syspath) == 0) -+ type2 = strcmp(udev_device_get_subsystem(dev), "block") == 0 ? 'b' : 'c'; -+ if (udev_device_get_devnum(dev) == devnum && type == type2) - continue; - -- dev_db = udev_device_new_from_syspath(udev, syspath); -+ dev_db = udev_device_new_from_devnum(udev, type, devnum); - if (dev_db != NULL) { - const char *devnode; - -@@ -276,7 +274,7 @@ static const char *link_find_prioritized(struct udev_device *dev, bool add, cons - udev_device_get_devnode(dev_db), udev_device_get_devlink_priority(dev_db)); - if (target == NULL || udev_device_get_devlink_priority(dev_db) > priority) { - info(udev, "'%s' claims priority %i for '%s'\n", -- syspath, udev_device_get_devlink_priority(dev_db), stackdir); -+ udev_device_get_syspath(dev_db), udev_device_get_devlink_priority(dev_db), stackdir); - priority = udev_device_get_devlink_priority(dev_db); - util_strscpy(buf, bufsize, devnode); - target = buf; -@@ -328,11 +326,15 @@ static void link_update(struct udev_device *dev, const char *slink, bool add) - - dbg(udev, "creating index: '%s'\n", filename); - do { -+ int fd; -+ - err = util_create_path(udev, filename); - if (err != 0 && err != -ENOENT) - break; -- err = symlink(udev_device_get_devpath(dev), filename); -- if (err != 0) -+ fd = open(filename, O_WRONLY|O_CREAT, 0444); -+ if (fd >= 0) -+ close(fd); -+ else - err = -errno; - } while (err == -ENOENT); - } --- -1.6.6 - diff --git a/0026-use-major-minor-as-entries-in-watch-directory.patch b/0026-use-major-minor-as-entries-in-watch-directory.patch deleted file mode 100644 index ceb2939..0000000 --- a/0026-use-major-minor-as-entries-in-watch-directory.patch +++ /dev/null @@ -1,120 +0,0 @@ -From 777239cb211ade308abb0a2b57d055614061f417 Mon Sep 17 00:00:00 2001 -From: Kay Sievers -Date: Wed, 10 Mar 2010 18:54:35 +0100 -Subject: [PATCH 26/65] use major:minor as entries in watch directory - ---- - udev/udev-watch.c | 47 +++++++++++++++++++++++++++++------------------ - 1 files changed, 29 insertions(+), 18 deletions(-) - -diff --git a/udev/udev-watch.c b/udev/udev-watch.c -index d67083b..7135d9f 100644 ---- a/udev/udev-watch.c -+++ b/udev/udev-watch.c -@@ -1,5 +1,5 @@ - /* -- * Copyright (C) 2004-2008 Kay Sievers -+ * Copyright (C) 2004-2010 Kay Sievers - * Copyright (C) 2009 Canonical Ltd. - * Copyright (C) 2009 Scott James Remnant - * -@@ -72,29 +72,29 @@ void udev_watch_restore(struct udev *udev) - size_t l; - ssize_t len; - struct udev_device *dev; -+ int maj, min; -+ char type; - -- if (ent->d_name[0] < '0' || ent->d_name[0] > '9') -+ if (ent->d_name[0] == '.') - continue; - - s = device; - l = util_strpcpy(&s, sizeof(device), udev_get_sys_path(udev)); - len = readlinkat(dirfd(dir), ent->d_name, s, l); -- if (len <= 0 || len >= (ssize_t)l) { -- unlinkat(dirfd(dir), ent->d_name, 0); -- continue; -- } -+ if (len <= 0 || len >= (ssize_t)l) -+ goto unlink; - s[len] = '\0'; -- dbg(udev, "old watch to '%s' found\n", device); -- dev = udev_device_new_from_syspath(udev, device); -- if (dev == NULL) { -- unlinkat(dirfd(dir), ent->d_name, 0); -- continue; -- } -+ -+ if (sscanf(s, "%c%i:%i", &type, &maj, &min) != 3) -+ goto unlink; -+ dev = udev_device_new_from_devnum(udev, type, makedev(maj, min)); -+ if (dev == NULL) -+ goto unlink; - - info(udev, "restoring old watch on '%s'\n", udev_device_get_devnode(dev)); - udev_watch_begin(udev, dev); -- - udev_device_unref(dev); -+unlink: - unlinkat(dirfd(dir), ent->d_name, 0); - } - -@@ -109,6 +109,7 @@ void udev_watch_restore(struct udev *udev) - void udev_watch_begin(struct udev *udev, struct udev_device *dev) - { - char filename[UTIL_PATH_SIZE]; -+ char majmin[UTIL_PATH_SIZE]; - int wd; - - if (inotify_fd < 0) -@@ -122,10 +123,13 @@ void udev_watch_begin(struct udev *udev, struct udev_device *dev) - return; - } - -+ snprintf(majmin, sizeof(majmin), "%c%i:%i", -+ strcmp(udev_device_get_subsystem(dev), "block") == 0 ? 'b' : 'c', -+ major(udev_device_get_devnum(dev)), minor(udev_device_get_devnum(dev))); - snprintf(filename, sizeof(filename), "%s/.udev/watch/%d", udev_get_dev_path(udev), wd); - util_create_path(udev, filename); - unlink(filename); -- symlink(udev_device_get_devpath(dev), filename); -+ symlink(majmin, filename); - - udev_device_set_watch_handle(dev, wd); - } -@@ -154,20 +158,27 @@ void udev_watch_end(struct udev *udev, struct udev_device *dev) - struct udev_device *udev_watch_lookup(struct udev *udev, int wd) - { - char filename[UTIL_PATH_SIZE]; -- char syspath[UTIL_PATH_SIZE]; -+ char majmin[UTIL_PATH_SIZE]; - char *s; - size_t l; - ssize_t len; -+ int maj, min; -+ char type; -+ dev_t devnum; - - if (inotify_fd < 0 || wd < 0) - return NULL; - - snprintf(filename, sizeof(filename), "%s/.udev/watch/%d", udev_get_dev_path(udev), wd); -- s = syspath; -- l = util_strpcpy(&s, sizeof(syspath), udev_get_sys_path(udev)); -+ s = majmin; -+ l = util_strpcpy(&s, sizeof(majmin), udev_get_sys_path(udev)); - len = readlink(filename, s, l); - if (len < 0 || (size_t)len >= l) - return NULL; - s[len] = '\0'; -- return udev_device_new_from_syspath(udev, syspath); -+ -+ if (sscanf(s, "%c%i:%i", &type, &maj, &min) != 3) -+ return NULL; -+ devnum = makedev(maj, min); -+ return udev_device_new_from_devnum(udev, type, devnum); - } --- -1.6.6 - diff --git a/0028-udev-needs-automake-1.10.patch b/0028-udev-needs-automake-1.10.patch deleted file mode 100644 index 9cd9024..0000000 --- a/0028-udev-needs-automake-1.10.patch +++ /dev/null @@ -1,28 +0,0 @@ -From b41102757d9d1f71aa04f3d264d57d573360d957 Mon Sep 17 00:00:00 2001 -From: Adrian Bunk -Date: Thu, 11 Mar 2010 15:05:42 +0200 -Subject: [PATCH 28/65] udev needs automake 1.10 - -extras/gudev/docs/Makefile.am:4: require Automake 1.10, but have 1.9.6 -libudev/docs/Makefile.am:4: require Automake 1.10, but have 1.9.6 - -Signed-off-by: Martin Pitt ---- - configure.ac | 2 +- - 1 files changed, 1 insertions(+), 1 deletions(-) - -diff --git a/configure.ac b/configure.ac -index 88824b6..d53dd12 100644 ---- a/configure.ac -+++ b/configure.ac -@@ -1,6 +1,6 @@ - AC_INIT([udev], [152], [linux-hotplug@vger.kernel.org]) - AC_PREREQ(2.60) --AM_INIT_AUTOMAKE([check-news foreign 1.9 dist-bzip2 subdir-objects]) -+AM_INIT_AUTOMAKE([check-news foreign 1.10 dist-bzip2 subdir-objects]) - m4_ifdef([AM_SILENT_RULES], [AM_SILENT_RULES([yes])]) - AC_DISABLE_STATIC - AC_USE_SYSTEM_EXTENSIONS --- -1.6.6 - diff --git a/0029-firmware-fix-possible-segfault-when-firmware-device-.patch b/0029-firmware-fix-possible-segfault-when-firmware-device-.patch deleted file mode 100644 index e48406f..0000000 --- a/0029-firmware-fix-possible-segfault-when-firmware-device-.patch +++ /dev/null @@ -1,40 +0,0 @@ -From d44c27c5ab71dbbcfcf4745977027502309dd795 Mon Sep 17 00:00:00 2001 -From: Kay Sievers -Date: Tue, 16 Mar 2010 10:57:44 +0100 -Subject: [PATCH 29/65] firmware: fix possible segfault when firmware device goes away while loading - -Thanks to Ruediger Oertel. ---- - extras/firmware/firmware.c | 9 ++++++--- - 1 files changed, 6 insertions(+), 3 deletions(-) - -diff --git a/extras/firmware/firmware.c b/extras/firmware/firmware.c -index 16455de..92f0918 100644 ---- a/extras/firmware/firmware.c -+++ b/extras/firmware/firmware.c -@@ -63,8 +63,10 @@ static bool copy_firmware(struct udev *udev, const char *source, const char *tar - if (fwrite(buf, size, 1, ftarget) == 1) - ret = true; - exit: -- fclose(ftarget); -- fclose(fsource); -+ if (ftarget != NULL) -+ fclose(ftarget); -+ if (fsource != NULL) -+ fclose(fsource); - free(buf); - return ret; - } -@@ -178,7 +180,8 @@ int main(int argc, char **argv) - if (unlink(misspath) == 0) - util_delete_path(udev, misspath); - -- set_loading(udev, loadpath, "1"); -+ if (!set_loading(udev, loadpath, "1")) -+ goto exit; - - util_strscpyl(datapath, sizeof(datapath), udev_get_sys_path(udev), devpath, "/data", NULL); - if (!copy_firmware(udev, fwpath, datapath, statbuf.st_size)) { --- -1.6.6 - diff --git a/0030-rules-input-create-by-path-links-for-pci-devices.patch b/0030-rules-input-create-by-path-links-for-pci-devices.patch deleted file mode 100644 index 836fad5..0000000 --- a/0030-rules-input-create-by-path-links-for-pci-devices.patch +++ /dev/null @@ -1,25 +0,0 @@ -From 6b32e8192934619f787c3b5b6f0fe40c32d7d94a Mon Sep 17 00:00:00 2001 -From: Marco d'Itri -Date: Tue, 16 Mar 2010 12:44:43 +0100 -Subject: [PATCH 30/65] rules: input - create by-path/ links for pci devices - ---- - rules/rules.d/60-persistent-input.rules | 2 +- - 1 files changed, 1 insertions(+), 1 deletions(-) - -diff --git a/rules/rules.d/60-persistent-input.rules b/rules/rules.d/60-persistent-input.rules -index e4675ae..1ea4431 100644 ---- a/rules/rules.d/60-persistent-input.rules -+++ b/rules/rules.d/60-persistent-input.rules -@@ -27,7 +27,7 @@ SUBSYSTEMS=="usb", ENV{ID_BUS}=="?*", KERNEL=="event*", ENV{.INPUT_CLASS}=="", A - SYMLINK+="input/by-id/$env{ID_BUS}-$env{ID_SERIAL}-event-if$attr{bInterfaceNumber}" - - # by-path --SUBSYSTEMS=="usb|platform", IMPORT{program}="path_id %p" -+SUBSYSTEMS=="pci|usb|platform", IMPORT{program}="path_id %p" - ENV{ID_PATH}=="?*", KERNEL=="mouse*|js*", ENV{.INPUT_CLASS}=="?*", SYMLINK+="input/by-path/$env{ID_PATH}-$env{.INPUT_CLASS}" - ENV{ID_PATH}=="?*", KERNEL=="event*", ENV{.INPUT_CLASS}=="?*", SYMLINK+="input/by-path/$env{ID_PATH}-event-$env{.INPUT_CLASS}" - # allow empty class for platform and usb devices; platform supports only a single interface that way --- -1.6.6 - diff --git a/0031-Fix-switching-Logitech-bluetooth-adapters-into-hci-m.patch b/0031-Fix-switching-Logitech-bluetooth-adapters-into-hci-m.patch deleted file mode 100644 index cf17eed..0000000 --- a/0031-Fix-switching-Logitech-bluetooth-adapters-into-hci-m.patch +++ /dev/null @@ -1,29 +0,0 @@ -From 2b463cb050cbf77d9c6b51e0f5a9d89bf7eb1bc3 Mon Sep 17 00:00:00 2001 -From: Marco d'Itri -Date: Tue, 16 Mar 2010 12:47:42 +0100 -Subject: [PATCH 31/65] Fix switching Logitech bluetooth adapters into hci mode. - -http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=567237 -https://bugs.launchpad.net/ubuntu/+source/udev/+bug/444420 ---- - extras/hid2hci/70-hid2hci.rules | 4 ++-- - 1 files changed, 2 insertions(+), 2 deletions(-) - -diff --git a/extras/hid2hci/70-hid2hci.rules b/extras/hid2hci/70-hid2hci.rules -index e133afd..01ff30d 100644 ---- a/extras/hid2hci/70-hid2hci.rules -+++ b/extras/hid2hci/70-hid2hci.rules -@@ -10,8 +10,8 @@ ATTR{bInterfaceClass}=="03", ATTR{bInterfaceSubClass}=="01", ATTR{bInterfaceProt - ATTRS{bDeviceClass}=="00", ATTRS{idVendor}=="413c", ATTRS{bmAttributes}=="e0", \ - RUN+="hid2hci --method=dell --devpath=%p", ENV{HID2HCI_SWITCH}="1" - --# Logitech devices (hidraw) --KERNEL=="hidraw*", ATTRS{idVendor}=="046d", ATTRS{idProduct}=="c70[345abce]|c71[34bc]", \ -+# Logitech devices -+KERNEL=="hiddev*", ATTRS{idVendor}=="046d", ATTRS{idProduct}=="c70[345abce]|c71[34bc]", \ - RUN+="hid2hci --method=logitech-hid --devpath=%p" - - ENV{DEVTYPE}!="usb_device", GOTO="hid2hci_end" --- -1.6.6 - diff --git a/0032-do-not-reset-SELinux-context-when-the-node-was-not-t.patch b/0032-do-not-reset-SELinux-context-when-the-node-was-not-t.patch deleted file mode 100644 index 864f039..0000000 --- a/0032-do-not-reset-SELinux-context-when-the-node-was-not-t.patch +++ /dev/null @@ -1,88 +0,0 @@ -From 578cc8a8085a47c963b5940459e475ac5f07219c Mon Sep 17 00:00:00 2001 -From: Kay Sievers -Date: Wed, 17 Mar 2010 09:15:18 +0100 -Subject: [PATCH 32/65] do not reset SELinux context when the node was not touched - ---- - udev/udev-node.c | 42 +++++++++++++++++------------------------- - 1 files changed, 17 insertions(+), 25 deletions(-) - -diff --git a/udev/udev-node.c b/udev/udev-node.c -index 4314cce..3aee15b 100644 ---- a/udev/udev-node.c -+++ b/udev/udev-node.c -@@ -37,7 +37,6 @@ int udev_node_mknod(struct udev_device *dev, const char *file, dev_t devnum, mod - { - struct udev *udev = udev_device_get_udev(dev); - struct stat stats; -- int preserve = 0; - int err = 0; - - if (major(devnum) == 0) -@@ -54,9 +53,15 @@ int udev_node_mknod(struct udev_device *dev, const char *file, dev_t devnum, mod - if (lstat(file, &stats) == 0) { - if (((stats.st_mode & S_IFMT) == (mode & S_IFMT)) && (stats.st_rdev == devnum)) { - info(udev, "preserve file '%s', because it has correct dev_t\n", file); -- preserve = 1; -- udev_selinux_lsetfilecon(udev, file, mode); -- /* update time stamp when we re-use the node, like on media change events */ -+ if (stats.st_mode != mode || stats.st_uid != uid || stats.st_gid != gid) { -+ info(udev, "set permissions %s, %#o, uid=%u, gid=%u\n", file, mode, uid, gid); -+ chmod(file, mode); -+ chown(file, uid, gid); -+ udev_selinux_lsetfilecon(udev, file, mode); -+ } else { -+ info(udev, "preserve permissions %s, %#o, uid=%u, gid=%u\n", file, mode, uid, gid); -+ } -+ /* always update timestamp when we re-use the node, like on media change events */ - utimensat(AT_FDCWD, file, NULL, 0); - } else { - char file_tmp[UTIL_PATH_SIZE + sizeof(TMP_FILE_EXT)]; -@@ -76,7 +81,11 @@ int udev_node_mknod(struct udev_device *dev, const char *file, dev_t devnum, mod - if (err != 0) { - err(udev, "rename(%s, %s) failed: %m\n", file_tmp, file); - unlink(file_tmp); -+ goto exit; - } -+ info(udev, "set permissions %s, %#o, uid=%u, gid=%u\n", file, mode, uid, gid); -+ chmod(file, mode); -+ chown(file, uid, gid); - } - } else { - info(udev, "mknod(%s, %#o, (%u,%u))\n", file, mode, major(devnum), minor(devnum)); -@@ -90,28 +99,11 @@ int udev_node_mknod(struct udev_device *dev, const char *file, dev_t devnum, mod - err = -errno; - udev_selinux_resetfscreatecon(udev); - } while (err == -ENOENT); -- if (err != 0) { -+ if (err != 0) - err(udev, "mknod(%s, %#o, (%u,%u) failed: %m\n", file, mode, major(devnum), minor(devnum)); -- goto exit; -- } -- } -- -- if (!preserve || stats.st_mode != mode) { -- info(udev, "chmod(%s, %#o)\n", file, mode); -- err = chmod(file, mode); -- if (err != 0) { -- err(udev, "chmod(%s, %#o) failed: %m\n", file, mode); -- goto exit; -- } -- } -- -- if (!preserve || stats.st_uid != uid || stats.st_gid != gid) { -- info(udev, "chown(%s, %u, %u)\n", file, uid, gid); -- err = chown(file, uid, gid); -- if (err != 0) { -- err(udev, "chown(%s, %u, %u) failed: %m\n", file, uid, gid); -- goto exit; -- } -+ info(udev, "set permissions %s, %#o, uid=%u, gid=%u\n", file, mode, uid, gid); -+ chmod(file, mode); -+ chown(file, uid, gid); - } - exit: - return err; --- -1.6.6 - diff --git a/0033-libudev-add-udev_device_new_from_environment.patch b/0033-libudev-add-udev_device_new_from_environment.patch deleted file mode 100644 index f84c44e..0000000 --- a/0033-libudev-add-udev_device_new_from_environment.patch +++ /dev/null @@ -1,480 +0,0 @@ -From fc8d61c53d6c181dc1e9f5a23c0f805c32a392af Mon Sep 17 00:00:00 2001 -From: Kay Sievers -Date: Wed, 17 Mar 2010 17:42:35 +0100 -Subject: [PATCH 33/65] libudev: add udev_device_new_from_environment() - ---- - extras/usb_id/usb_id.c | 34 ++++--- - libudev/docs/libudev-sections.txt | 1 + - libudev/exported_symbols | 1 + - libudev/libudev-device.c | 214 ++++++++++++++++++++++++++++--------- - libudev/libudev-monitor.c | 66 +----------- - libudev/libudev-private.h | 3 +- - libudev/libudev.h | 1 + - 7 files changed, 192 insertions(+), 128 deletions(-) - -diff --git a/extras/usb_id/usb_id.c b/extras/usb_id/usb_id.c -index b412598..42ccddf 100644 ---- a/extras/usb_id/usb_id.c -+++ b/extras/usb_id/usb_id.c -@@ -456,8 +456,6 @@ int main(int argc, char **argv) - }; - struct udev *udev; - struct udev_device *dev = NULL; -- char syspath[UTIL_PATH_SIZE]; -- const char *devpath; - static int export; - int retval = 0; - -@@ -492,7 +490,7 @@ int main(int argc, char **argv) - export = 1; - break; - case 'h': -- printf("Usage: usb_id [--usb-info] [--num-info] [--export] [--help] \n" -+ printf("Usage: usb_id [--usb-info] [--num-info] [--export] [--help] []\n" - " --usb-info use usb strings instead\n" - " --num-info use numerical values\n" - " --export print values as environment keys\n" -@@ -503,18 +501,26 @@ int main(int argc, char **argv) - } - } - -- devpath = argv[optind]; -- if (devpath == NULL) { -- fprintf(stderr, "No device specified\n"); -- retval = 1; -- goto exit; -- } -- -- util_strscpyl(syspath, sizeof(syspath), udev_get_sys_path(udev), devpath, NULL); -- dev = udev_device_new_from_syspath(udev, syspath); -+ dev = udev_device_new_from_environment(udev); - if (dev == NULL) { -- err(udev, "unable to access '%s'\n", devpath); -- return 1; -+ char syspath[UTIL_PATH_SIZE]; -+ const char *devpath; -+ -+ devpath = argv[optind]; -+ if (devpath == NULL) { -+ fprintf(stderr, "missing device\n"); -+ retval = 1; -+ goto exit; -+ } -+ -+ util_strscpyl(syspath, sizeof(syspath), udev_get_sys_path(udev), devpath, NULL); -+ dev = udev_device_new_from_syspath(udev, syspath); -+ if (dev == NULL) { -+ err(udev, "unable to access '%s'\n", devpath); -+ retval = 1; -+ goto exit; -+ return 1; -+ } - } - - retval = usb_id(dev); -diff --git a/libudev/docs/libudev-sections.txt b/libudev/docs/libudev-sections.txt -index c11a273..ca781ff 100644 ---- a/libudev/docs/libudev-sections.txt -+++ b/libudev/docs/libudev-sections.txt -@@ -35,6 +35,7 @@ udev_device_get_udev - udev_device_new_from_syspath - udev_device_new_from_devnum - udev_device_new_from_subsystem_sysname -+udev_device_new_from_environment - udev_device_get_parent - udev_device_get_parent_with_subsystem_devtype - udev_device_get_devpath -diff --git a/libudev/exported_symbols b/libudev/exported_symbols -index f48025a..61486c6 100644 ---- a/libudev/exported_symbols -+++ b/libudev/exported_symbols -@@ -15,6 +15,7 @@ udev_list_entry_get_value - udev_device_new_from_syspath - udev_device_new_from_devnum - udev_device_new_from_subsystem_sysname -+udev_device_new_from_environment - udev_device_get_parent - udev_device_get_parent_with_subsystem_devtype - udev_device_ref -diff --git a/libudev/libudev-device.c b/libudev/libudev-device.c -index aec5fb5..fe45880 100644 ---- a/libudev/libudev-device.c -+++ b/libudev/libudev-device.c -@@ -13,6 +13,7 @@ - #include - #include - #include -+#include - #include - #include - #include -@@ -67,6 +68,7 @@ struct udev_device { - int refcount; - dev_t devnum; - int watch_handle; -+ int maj, min; - unsigned int parent_set:1; - unsigned int subsystem_set:1; - unsigned int devtype_set:1; -@@ -77,6 +79,130 @@ struct udev_device { - unsigned int ignore_remove:1; - }; - -+struct udev_list_entry *udev_device_add_property(struct udev_device *udev_device, const char *key, const char *value) -+{ -+ udev_device->envp_uptodate = 0; -+ if (value == NULL) { -+ struct udev_list_entry *list_entry; -+ -+ list_entry = udev_device_get_properties_list_entry(udev_device); -+ list_entry = udev_list_entry_get_by_name(list_entry, key); -+ if (list_entry != NULL) -+ udev_list_entry_delete(list_entry); -+ return NULL; -+ } -+ return udev_list_entry_add(udev_device->udev, &udev_device->properties_list, key, value, 1, 0); -+} -+ -+static struct udev_list_entry *udev_device_add_property_from_string(struct udev_device *udev_device, const char *property) -+{ -+ char name[UTIL_LINE_SIZE]; -+ char *val; -+ -+ util_strscpy(name, sizeof(name), property); -+ val = strchr(name, '='); -+ if (val == NULL) -+ return NULL; -+ val[0] = '\0'; -+ val = &val[1]; -+ if (val[0] == '\0') -+ val = NULL; -+ return udev_device_add_property(udev_device, name, val); -+} -+ -+/* -+ * parse property string, and if needed, update internal values accordingly -+ * -+ * udev_device_add_property_from_string_parse_finish() needs to be -+ * called after adding properties, and its return value checked -+ * -+ * udev_device_set_info_loaded() needs to be set, to avoid trying -+ * to use a device without a DEVPATH set -+ */ -+void udev_device_add_property_from_string_parse(struct udev_device *udev_device, const char *property) -+{ -+ if (strncmp(property, "DEVPATH=", 8) == 0) { -+ char path[UTIL_PATH_SIZE]; -+ -+ util_strscpyl(path, sizeof(path), udev_get_sys_path(udev_device->udev), &property[8], NULL); -+ udev_device_set_syspath(udev_device, path); -+ } else if (strncmp(property, "SUBSYSTEM=", 10) == 0) { -+ udev_device_set_subsystem(udev_device, &property[10]); -+ } else if (strncmp(property, "DEVTYPE=", 8) == 0) { -+ udev_device_set_devtype(udev_device, &property[8]); -+ } else if (strncmp(property, "DEVNAME=", 8) == 0) { -+ if (property[8] == '/') -+ udev_device_set_devnode(udev_device, &property[8]); -+ else -+ udev_device_set_knodename(udev_device, &property[8]); -+ } else if (strncmp(property, "DEVLINKS=", 9) == 0) { -+ char devlinks[UTIL_PATH_SIZE]; -+ char *slink; -+ char *next; -+ -+ util_strscpy(devlinks, sizeof(devlinks), &property[9]); -+ slink = devlinks; -+ next = strchr(slink, ' '); -+ while (next != NULL) { -+ next[0] = '\0'; -+ udev_device_add_devlink(udev_device, slink, 0); -+ slink = &next[1]; -+ next = strchr(slink, ' '); -+ } -+ if (slink[0] != '\0') -+ udev_device_add_devlink(udev_device, slink, 0); -+ } else if (strncmp(property, "DRIVER=", 7) == 0) { -+ udev_device_set_driver(udev_device, &property[7]); -+ } else if (strncmp(property, "ACTION=", 7) == 0) { -+ udev_device_set_action(udev_device, &property[7]); -+ } else if (strncmp(property, "MAJOR=", 6) == 0) { -+ udev_device->maj = strtoull(&property[6], NULL, 10); -+ } else if (strncmp(property, "MINOR=", 6) == 0) { -+ udev_device->min = strtoull(&property[6], NULL, 10); -+ } else if (strncmp(property, "DEVPATH_OLD=", 12) == 0) { -+ udev_device_set_devpath_old(udev_device, &property[12]); -+ } else if (strncmp(property, "SEQNUM=", 7) == 0) { -+ udev_device_set_seqnum(udev_device, strtoull(&property[7], NULL, 10)); -+ } else if (strncmp(property, "TIMEOUT=", 8) == 0) { -+ udev_device_set_timeout(udev_device, strtoull(&property[8], NULL, 10)); -+ } else { -+ udev_device_add_property_from_string(udev_device, property); -+ } -+} -+ -+int udev_device_add_property_from_string_parse_finish(struct udev_device *udev_device) -+{ -+ if (udev_device->maj > 0) -+ udev_device_set_devnum(udev_device, makedev(udev_device->maj, udev_device->min)); -+ udev_device->maj = 0; -+ udev_device->min = 0; -+ -+ if (udev_device->devpath == NULL || udev_device->subsystem == NULL) -+ return -EINVAL; -+ return 0; -+} -+ -+/** -+ * udev_device_get_property_value: -+ * @udev_device: udev device -+ * @key: property name -+ * -+ * Returns: the value of a device property, or #NULL if there is no such property. -+ **/ -+const char *udev_device_get_property_value(struct udev_device *udev_device, const char *key) -+{ -+ struct udev_list_entry *list_entry; -+ -+ if (udev_device == NULL) -+ return NULL; -+ if (key == NULL) -+ return NULL; -+ -+ list_entry = udev_device_get_properties_list_entry(udev_device); -+ list_entry = udev_list_entry_get_by_name(list_entry, key); -+ return udev_list_entry_get_value(list_entry); -+} -+ - int udev_device_read_db(struct udev_device *udev_device) - { - struct stat stats; -@@ -451,6 +577,42 @@ found: - return udev_device_new_from_syspath(udev, path_full); - } - -+/** -+ * udev_device_new_from_environment -+ * @udev: udev library context -+ * -+ * Create new udev device, and fill in information from the -+ * current process environment. This only works reliable if -+ * the process is called from a udev rule. It is usually used -+ * for tools executed from IMPORT= rules. -+ * -+ * The initial refcount is 1, and needs to be decremented to -+ * release the resources of the udev device. -+ * -+ * Returns: a new udev device, or #NULL, if it does not exist -+ **/ -+struct udev_device *udev_device_new_from_environment(struct udev *udev) -+{ -+ int i; -+ struct udev_device *udev_device; -+ -+ udev_device = udev_device_new(udev); -+ if (udev_device == NULL) -+ return NULL; -+ udev_device_set_info_loaded(udev_device); -+ -+ for (i = 0; environ[i] != NULL; i++) -+ udev_device_add_property_from_string_parse(udev_device, environ[i]); -+ -+ if (udev_device_add_property_from_string_parse_finish(udev_device) < 0) { -+ info(udev, "missing values, invalid device\n"); -+ udev_device_unref(udev_device); -+ udev_device = NULL; -+ } -+ -+ return udev_device; -+} -+ - static struct udev_device *device_new_from_parent(struct udev_device *udev_device) - { - struct udev_device *udev_device_parent = NULL; -@@ -1072,58 +1234,6 @@ int udev_device_add_devlink(struct udev_device *udev_device, const char *devlink - return 0; - } - --struct udev_list_entry *udev_device_add_property(struct udev_device *udev_device, const char *key, const char *value) --{ -- udev_device->envp_uptodate = 0; -- if (value == NULL) { -- struct udev_list_entry *list_entry; -- -- list_entry = udev_device_get_properties_list_entry(udev_device); -- list_entry = udev_list_entry_get_by_name(list_entry, key); -- if (list_entry != NULL) -- udev_list_entry_delete(list_entry); -- return NULL; -- } -- return udev_list_entry_add(udev_device->udev, &udev_device->properties_list, key, value, 1, 0); --} -- --struct udev_list_entry *udev_device_add_property_from_string(struct udev_device *udev_device, const char *property) --{ -- char name[UTIL_LINE_SIZE]; -- char *val; -- -- util_strscpy(name, sizeof(name), property); -- val = strchr(name, '='); -- if (val == NULL) -- return NULL; -- val[0] = '\0'; -- val = &val[1]; -- if (val[0] == '\0') -- val = NULL; -- return udev_device_add_property(udev_device, name, val); --} -- --/** -- * udev_device_get_property_value: -- * @udev_device: udev device -- * @key: property name -- * -- * Returns: the value of a device property, or #NULL if there is no such property. -- **/ --const char *udev_device_get_property_value(struct udev_device *udev_device, const char *key) --{ -- struct udev_list_entry *list_entry; -- -- if (udev_device == NULL) -- return NULL; -- if (key == NULL) -- return NULL; -- -- list_entry = udev_device_get_properties_list_entry(udev_device); -- list_entry = udev_list_entry_get_by_name(list_entry, key); -- return udev_list_entry_get_value(list_entry); --} -- - #define ENVP_SIZE 128 - #define MONITOR_BUF_SIZE 4096 - static int update_envp_monitor_buf(struct udev_device *udev_device) -diff --git a/libudev/libudev-monitor.c b/libudev/libudev-monitor.c -index 96c153f..97e52c4 100644 ---- a/libudev/libudev-monitor.c -+++ b/libudev/libudev-monitor.c -@@ -497,11 +497,6 @@ struct udev_device *udev_monitor_receive_device(struct udev_monitor *udev_monito - ssize_t buflen; - ssize_t bufpos; - struct udev_monitor_netlink_header *nlh; -- int devpath_set = 0; -- int subsystem_set = 0; -- int action_set = 0; -- int maj = 0; -- int min = 0; - - retry: - if (udev_monitor == NULL) -@@ -589,6 +584,7 @@ retry: - udev_device = udev_device_new(udev_monitor->udev); - if (udev_device == NULL) - return NULL; -+ udev_device_set_info_loaded(udev_device); - - while (bufpos < buflen) { - char *key; -@@ -599,60 +595,11 @@ retry: - if (keylen == 0) - break; - bufpos += keylen + 1; -- -- if (strncmp(key, "DEVPATH=", 8) == 0) { -- char path[UTIL_PATH_SIZE]; -- -- util_strscpyl(path, sizeof(path), udev_get_sys_path(udev_monitor->udev), &key[8], NULL); -- udev_device_set_syspath(udev_device, path); -- devpath_set = 1; -- } else if (strncmp(key, "SUBSYSTEM=", 10) == 0) { -- udev_device_set_subsystem(udev_device, &key[10]); -- subsystem_set = 1; -- } else if (strncmp(key, "DEVTYPE=", 8) == 0) { -- udev_device_set_devtype(udev_device, &key[8]); -- } else if (strncmp(key, "DEVNAME=", 8) == 0) { -- if (key[8] == '/') -- udev_device_set_devnode(udev_device, &key[8]); -- else -- udev_device_set_knodename(udev_device, &key[8]); -- } else if (strncmp(key, "DEVLINKS=", 9) == 0) { -- char devlinks[UTIL_PATH_SIZE]; -- char *slink; -- char *next; -- -- util_strscpy(devlinks, sizeof(devlinks), &key[9]); -- slink = devlinks; -- next = strchr(slink, ' '); -- while (next != NULL) { -- next[0] = '\0'; -- udev_device_add_devlink(udev_device, slink, 0); -- slink = &next[1]; -- next = strchr(slink, ' '); -- } -- if (slink[0] != '\0') -- udev_device_add_devlink(udev_device, slink, 0); -- } else if (strncmp(key, "DRIVER=", 7) == 0) { -- udev_device_set_driver(udev_device, &key[7]); -- } else if (strncmp(key, "ACTION=", 7) == 0) { -- udev_device_set_action(udev_device, &key[7]); -- action_set = 1; -- } else if (strncmp(key, "MAJOR=", 6) == 0) { -- maj = strtoull(&key[6], NULL, 10); -- } else if (strncmp(key, "MINOR=", 6) == 0) { -- min = strtoull(&key[6], NULL, 10); -- } else if (strncmp(key, "DEVPATH_OLD=", 12) == 0) { -- udev_device_set_devpath_old(udev_device, &key[12]); -- } else if (strncmp(key, "SEQNUM=", 7) == 0) { -- udev_device_set_seqnum(udev_device, strtoull(&key[7], NULL, 10)); -- } else if (strncmp(key, "TIMEOUT=", 8) == 0) { -- udev_device_set_timeout(udev_device, strtoull(&key[8], NULL, 10)); -- } else { -- udev_device_add_property_from_string(udev_device, key); -- } -+ udev_device_add_property_from_string_parse(udev_device, key); - } -- if (!devpath_set || !subsystem_set || !action_set) { -- info(udev_monitor->udev, "missing values, skip\n"); -+ -+ if (udev_device_add_property_from_string_parse_finish(udev_device) < 0) { -+ info(udev_monitor->udev, "missing values, invalid device\n"); - udev_device_unref(udev_device); - return NULL; - } -@@ -673,9 +620,6 @@ retry: - return NULL; - } - -- if (maj > 0) -- udev_device_set_devnum(udev_device, makedev(maj, min)); -- udev_device_set_info_loaded(udev_device); - return udev_device; - } - -diff --git a/libudev/libudev-private.h b/libudev/libudev-private.h -index 5ee0c58..3f2861f 100644 ---- a/libudev/libudev-private.h -+++ b/libudev/libudev-private.h -@@ -71,7 +71,8 @@ int udev_device_set_devnode(struct udev_device *udev_device, const char *devnode - int udev_device_add_devlink(struct udev_device *udev_device, const char *devlink, int unique); - void udev_device_cleanup_devlinks_list(struct udev_device *udev_device); - struct udev_list_entry *udev_device_add_property(struct udev_device *udev_device, const char *key, const char *value); --struct udev_list_entry *udev_device_add_property_from_string(struct udev_device *udev_device, const char *property); -+void udev_device_add_property_from_string_parse(struct udev_device *udev_device, const char *property); -+int udev_device_add_property_from_string_parse_finish(struct udev_device *udev_device); - char **udev_device_get_properties_envp(struct udev_device *udev_device); - ssize_t udev_device_get_properties_monitor_buf(struct udev_device *udev_device, const char **buf); - int udev_device_read_db(struct udev_device *udev_device); -diff --git a/libudev/libudev.h b/libudev/libudev.h -index 9576ad4..750664f 100644 ---- a/libudev/libudev.h -+++ b/libudev/libudev.h -@@ -75,6 +75,7 @@ struct udev *udev_device_get_udev(struct udev_device *udev_device); - struct udev_device *udev_device_new_from_syspath(struct udev *udev, const char *syspath); - struct udev_device *udev_device_new_from_devnum(struct udev *udev, char type, dev_t devnum); - struct udev_device *udev_device_new_from_subsystem_sysname(struct udev *udev, const char *subsystem, const char *sysname); -+struct udev_device *udev_device_new_from_environment(struct udev *udev); - /* udev_device_get_parent_*() does not take a reference on the returned device, it is automatically unref'd with the parent */ - struct udev_device *udev_device_get_parent(struct udev_device *udev_device); - struct udev_device *udev_device_get_parent_with_subsystem_devtype(struct udev_device *udev_device, --- -1.6.6 - diff --git a/0035-cdrom_id-open-non-mounted-optical-media-with-O_EXCL.patch b/0035-cdrom_id-open-non-mounted-optical-media-with-O_EXCL.patch deleted file mode 100644 index 0d34327..0000000 --- a/0035-cdrom_id-open-non-mounted-optical-media-with-O_EXCL.patch +++ /dev/null @@ -1,58 +0,0 @@ -From 38a3cde11bc77af49a96245b8a8a0f2b583a344c Mon Sep 17 00:00:00 2001 -From: Kay Sievers -Date: Thu, 18 Mar 2010 11:14:32 +0100 -Subject: [PATCH 35/65] cdrom_id: open non-mounted optical media with O_EXCL - -This should prevent confusing drives during CD burning sessions. Based -on a patch from Harald Hoyer. ---- - extras/cdrom_id/cdrom_id.c | 26 +++++++++++++++++++++++++- - 1 files changed, 25 insertions(+), 1 deletions(-) - -diff --git a/extras/cdrom_id/cdrom_id.c b/extras/cdrom_id/cdrom_id.c -index 2380b15..e485768 100644 ---- a/extras/cdrom_id/cdrom_id.c -+++ b/extras/cdrom_id/cdrom_id.c -@@ -112,6 +112,30 @@ static unsigned long long int cd_media_session_last_offset; - #define ASC(errcode) (((errcode) >> 8) & 0xFF) - #define ASCQ(errcode) ((errcode) & 0xFF) - -+static int is_mounted(const char *device) -+{ -+ struct stat statbuf; -+ FILE *fp; -+ int maj, min; -+ int mounted = 0; -+ -+ if (stat(device, &statbuf) < 0) -+ return -ENODEV; -+ -+ fp = fopen("/proc/self/mountinfo", "r"); -+ if (fp == NULL) -+ return -ENOSYS; -+ while (fscanf(fp, "%*s %*s %i:%i %*[^\n]", &maj, &min) == 2) { -+ printf("got %u %u\n", maj, min); -+ if (makedev(maj, min) == statbuf.st_rdev) { -+ mounted = 1; -+ break; -+ } -+ } -+ fclose(fp); -+ return mounted; -+} -+ - static void info_scsi_cmd_err(struct udev *udev, char *cmd, int err) - { - if (err == -1) { -@@ -568,7 +592,7 @@ int main(int argc, char *argv[]) - goto exit; - } - -- fd = open(node, O_RDONLY | O_NONBLOCK); -+ fd = open(node, O_RDONLY|O_NONBLOCK|(is_mounted(node) ? 0 : O_EXCL)); - if (fd < 0) { - info(udev, "unable to open '%s'\n", node); - fprintf(stderr, "unable to open '%s'\n", node); --- -1.6.6 - diff --git a/0036-modeswitch-morph-into-tool-that-only-switches-Mobile.patch b/0036-modeswitch-morph-into-tool-that-only-switches-Mobile.patch deleted file mode 100644 index d3cf673..0000000 --- a/0036-modeswitch-morph-into-tool-that-only-switches-Mobile.patch +++ /dev/null @@ -1,2142 +0,0 @@ -From 4dd9b291354e76f34b0d6d7b5c3b28d03a624418 Mon Sep 17 00:00:00 2001 -From: Dan Williams -Date: Thu, 18 Mar 2010 17:13:59 -0700 -Subject: [PATCH 36/65] modeswitch: morph into tool that only switches Mobile Action cables - -Remove option modeswitching code; use usb_modeswitch already, people. ---- - Makefile.am | 27 +- - extras/mobile-action-modeswitch/.gitignore | 1 + - .../61-mobile-action.rules | 15 + - extras/mobile-action-modeswitch/ma8280p_us.c | 462 ++++++++++++++++++++ - extras/mobile-action-modeswitch/ma8280p_us.h | 24 + - .../mobile-action-modeswitch.c | 262 +++++++++++ - extras/mobile-action-modeswitch/utils.c | 83 ++++ - extras/mobile-action-modeswitch/utils.h | 32 ++ - extras/modem-modeswitch/.gitignore | 1 - - extras/modem-modeswitch/61-mobile-action.rules | 15 - - .../61-option-modem-modeswitch.rules | 44 -- - extras/modem-modeswitch/ma8280p_us.c | 462 -------------------- - extras/modem-modeswitch/ma8280p_us.h | 24 - - extras/modem-modeswitch/modem-modeswitch.c | 266 ----------- - extras/modem-modeswitch/option.c | 131 ------ - extras/modem-modeswitch/option.h | 29 -- - extras/modem-modeswitch/utils.c | 83 ---- - extras/modem-modeswitch/utils.h | 32 -- - 18 files changed, 891 insertions(+), 1102 deletions(-) - create mode 100644 extras/mobile-action-modeswitch/.gitignore - create mode 100644 extras/mobile-action-modeswitch/61-mobile-action.rules - create mode 100644 extras/mobile-action-modeswitch/ma8280p_us.c - create mode 100644 extras/mobile-action-modeswitch/ma8280p_us.h - create mode 100644 extras/mobile-action-modeswitch/mobile-action-modeswitch.c - create mode 100644 extras/mobile-action-modeswitch/utils.c - create mode 100644 extras/mobile-action-modeswitch/utils.h - delete mode 100644 extras/modem-modeswitch/.gitignore - delete mode 100644 extras/modem-modeswitch/61-mobile-action.rules - delete mode 100644 extras/modem-modeswitch/61-option-modem-modeswitch.rules - delete mode 100644 extras/modem-modeswitch/ma8280p_us.c - delete mode 100644 extras/modem-modeswitch/ma8280p_us.h - delete mode 100644 extras/modem-modeswitch/modem-modeswitch.c - delete mode 100644 extras/modem-modeswitch/option.c - delete mode 100644 extras/modem-modeswitch/option.h - delete mode 100644 extras/modem-modeswitch/utils.c - delete mode 100644 extras/modem-modeswitch/utils.h - -diff --git a/Makefile.am b/Makefile.am -index 99a0133..68a68d9 100644 ---- a/Makefile.am -+++ b/Makefile.am -@@ -448,24 +448,21 @@ extras_usb_db_pci_db_LDADD = libudev/libudev-private.la - libexec_PROGRAMS += extras/usb-db/pci-db - - # ------------------------------------------------------------------------------ --# modem-modeswitch - magic config switch for 3G modems --# ------------------------------------------------------------------------------ --extras_modem_modeswitch_modem_modeswitch_SOURCES =\ -- extras/modem-modeswitch/modem-modeswitch.c \ -- extras/modem-modeswitch/utils.c \ -- extras/modem-modeswitch/utils.h \ -- extras/modem-modeswitch/ma8280p_us.c \ -- extras/modem-modeswitch/ma8280p_us.h \ -- extras/modem-modeswitch/option.c \ -- extras/modem-modeswitch/option.h --extras_modem_modeswitch_modem_modeswitch_CPPFLAGS = $(AM_CPPFLAGS) $(LIBUSB_CFLAGS) --extras_modem_modeswitch_modem_modeswitch_LDADD = libudev/libudev-private.la $(LIBUSB_LIBS) -+# mobile-action-modeswitch - switch Mobile Action cables into serial mode -+# ------------------------------------------------------------------------------ -+extras_mobile_action_modeswitch_mobile_action_modeswitch_SOURCES =\ -+ extras/mobile-action-modeswitch/mobile-action-modeswitch.c \ -+ extras/mobile-action-modeswitch/utils.c \ -+ extras/mobile-action-modeswitch/utils.h \ -+ extras/mobile-action-modeswitch/ma8280p_us.c \ -+ extras/mobile-action-modeswitch/ma8280p_us.h -+extras_mobile_action_modeswitch_mobile_action_modeswitch_CPPFLAGS = $(AM_CPPFLAGS) $(LIBUSB_CFLAGS) -+extras_mobile_action_modeswitch_mobile_action_modeswitch_LDADD = libudev/libudev-private.la $(LIBUSB_LIBS) - - dist_udevrules_DATA += \ -- extras/modem-modeswitch/61-option-modem-modeswitch.rules \ -- extras/modem-modeswitch/61-mobile-action.rules -+ extras/mobile-action-modeswitch/61-mobile-action.rules - --libexec_PROGRAMS += extras/modem-modeswitch/modem-modeswitch -+libexec_PROGRAMS += extras/mobile-action-modeswitch/mobile-action-modeswitch - - # ------------------------------------------------------------------------------ - # keymap - map custom hardware's multimedia keys -diff --git a/extras/mobile-action-modeswitch/61-mobile-action.rules b/extras/mobile-action-modeswitch/61-mobile-action.rules -new file mode 100644 -index 0000000..0af27a5 ---- /dev/null -+++ b/extras/mobile-action-modeswitch/61-mobile-action.rules -@@ -0,0 +1,15 @@ -+ACTION!="add", GOTO="mobile_action_end" -+ -+# ATTENTION: DO NOT USE THIS FILE FOR ANYTHING EXCEPT -+# MOBILE ACTION CABLES. DO NOT USE IT FOR 3G DEVICES! -+ -+SUBSYSTEM=="usb", ATTR{bDeviceClass}=="00|ff", ATTR{bDeviceSubClass}=="00|ff", ENV{DEVTYPE}=="usb_device", GOTO="mobile_action_switch" -+GOTO="mobile_action_end" -+ -+LABEL="mobile_action_switch" -+ -+# Mobile Action cables like the 8280p and 8230p -+ATTRS{idVendor}=="0df7", ATTRS{idProduct}=="0800", RUN+="mobile-action-modeswitch -v 0x%s{idVendor} -p 0x%s{idProduct} -t mobile-action-8280p" -+ -+LABEL="mobile_action_end" -+ -diff --git a/extras/mobile-action-modeswitch/ma8280p_us.c b/extras/mobile-action-modeswitch/ma8280p_us.c -new file mode 100644 -index 0000000..d7cf4f4 ---- /dev/null -+++ b/extras/mobile-action-modeswitch/ma8280p_us.c -@@ -0,0 +1,462 @@ -+/* http://www.natox.be/ma8280p/ -+ * http://www.leopold.dk/~martin/ma-8230p.html -+ * http://figvam.blogspot.com/2007/01/mobile-action-8730p-usb-cable-and-linux.html -+ */ -+ -+/* -+ * -+ * Code by davy hollevoet. This is simply an adaptation of code -+ * generated by usbsnoop2libusb. (http://iki.fi/lindi/usb/usbsnoop2libusb.pl) -+ * -+ * This code is released under both the GPL version 2 and BSD licenses. -+ * Either license may be used. -+ * -+ * GPLv2 -+ * ******** -+ * This program is free software; you can redistribute it and/or -+ * modify it under the terms of the GNU General Public License -+ * as published by the Free Software Foundation; either version 2 -+ * of the License, or (at your option) any later version. -+ * -+ * This program is distributed in the hope that it will be useful, -+ * but WITHOUT ANY WARRANTY; without even the implied warranty of -+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -+ * GNU General Public License for more details. -+ * -+ * In addition: -+ * -+ * Redistribution and use in source and binary forms, with or without -+ * modification, are permitted provided that the following conditions -+ * are met: -+ * -+ * 1. Redistributions of source code must retain the above copyright -+ * notice, this list of conditions and the following disclaimer. -+ * 2. Redistributions in binary form must reproduce the above copyright -+ * notice, this list of conditions and the following disclaimer in the -+ * documentation and/or other materials provided with the distribution. -+ * 3. The name of the author may not be used to endorse or promote -+ * products derived from this software without specific prior written -+ * permission. -+ * -+ * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR -+ * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED -+ * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE -+ * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, -+ * INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES -+ * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR -+ * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) -+ * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, -+ * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING -+ * IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE -+ * POSSIBILITY OF SUCH DAMAGE. -+ * -+ * BSD -+ * ****** -+ * Copyright (c) 1998, Regents of the University of California -+ * All rights reserved. -+ * Redistribution and use in source and binary forms, with or without -+ * modification, are permitted provided that the following conditions are met: -+ * -+ * * Redistributions of source code must retain the above copyright -+ * notice, this list of conditions and the following disclaimer. -+ * * Redistributions in binary form must reproduce the above copyright -+ * notice, this list of conditions and the following disclaimer in the -+ * documentation and/or other materials provided with the distribution. -+ * * Neither the name of the University of California, Berkeley nor the -+ * names of its contributors may be used to endorse or promote products -+ * derived from this software without specific prior written permission. -+ * -+ * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS "AS IS" AND ANY -+ * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED -+ * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE -+ * DISCLAIMED. IN NO EVENT SHALL THE REGENTS AND CONTRIBUTORS BE LIABLE FOR ANY -+ * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES -+ * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; -+ * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND -+ * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS -+ * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -+ * -+ */ -+ -+/* This file is (mostly) generated with usbsnoop2libusb.pl from a usbsnoop log file. */ -+/* Latest version of the script should be in http://iki.fi/lindi/usb/usbsnoop2libusb.pl */ -+#include -+#include -+#include -+#include -+#include -+#include -+#include -+#include -+ -+#include "utils.h" -+#include "ma8280p_us.h" -+ -+static void msleep(long msec) -+{ -+ struct timespec duration = { 0, msec * 1000 * 1000 }; -+ -+ nanosleep(&duration, NULL); -+} -+ -+int ma8280p_switch (struct usb_dev_handle *devh, struct usb_device *dev) -+{ -+ int ret = 1; -+ char *buf = NULL; -+ -+ buf = malloc (65535); -+ if (!buf) { -+ error ("%s: not enough memory", dev->filename, ret); -+ return -1; -+ } -+ -+ usb_get_descriptor(devh, 0x0000001, 0x0000000, buf, 0x0000012); -+ msleep(6); -+ usb_get_descriptor(devh, 0x0000001, 0x0000000, buf, 0x0000012); -+ msleep(6); -+ usb_get_descriptor(devh, 0x0000002, 0x0000000, buf, 0x0000400); -+ msleep(10); -+ ret = usb_release_interface(devh, 0); -+ if (ret != 0) -+ debug ("%s: failed to release interface before set_configuration: %d", dev->filename, ret); -+ usb_set_configuration(devh, 0x0000001); -+ ret = usb_claim_interface(devh, 0); -+ if (ret != 0) -+ debug ("%s: claim after set_configuration failed with error %d", dev->filename, ret); -+ //usb_set_altinterface(devh, 0); -+ //msleep(33); -+ usb_control_msg(devh, USB_TYPE_CLASS + USB_RECIP_INTERFACE + USB_ENDPOINT_IN, 0x0000001, 0x0000300, 0x0000000, buf, 0x0000008, 1000); -+ msleep(5); -+ memcpy(buf, "\xb0\x04\x00\x00\x02\x90\x26\x86", 0x0000008); -+ usb_control_msg(devh, USB_TYPE_CLASS + USB_RECIP_INTERFACE, 0x0000009, 0x0000300, 0x0000000, buf, 0x0000008, 1000); -+ msleep(4); -+ memcpy(buf, "\xb0\x04\x00\x00\x02\x90\x26\x86", 0x0000008); -+ usb_control_msg(devh, USB_TYPE_CLASS + USB_RECIP_INTERFACE, 0x0000009, 0x0000300, 0x0000000, buf, 0x0000008, 1000); -+ msleep(4); -+ -+ msleep(4); -+ usb_interrupt_read(devh, 0x00000081, buf, 0x0000008, 1000); -+ msleep(6); -+ usb_interrupt_read(devh, 0x00000081, buf, 0x0000008, 1000); -+ msleep(1); -+ //URB_FUNCTION_GET_STATUS_FROM_ENDPOINT skipped -+ msleep(4); -+ memcpy(buf, "\x37\x01\xfe\xdb\xc1\x33\x1f\x83", 0x0000008); -+ usb_interrupt_write(devh, 0x00000002, buf, 0x0000008, 1000); -+ msleep(3); -+ usb_interrupt_read(devh, 0x00000081, buf, 0x0000008, 1000); -+ msleep(1); -+ memcpy(buf, "\x37\x0e\xb5\x9d\x3b\x8a\x91\x51", 0x0000008); -+ usb_interrupt_write(devh, 0x00000002, buf, 0x0000008, 1000); -+ msleep(7); -+ usb_interrupt_read(devh, 0x00000081, buf, 0x0000008, 1000); -+ msleep(1); -+ memcpy(buf, "\x34\x87\xba\x0d\xfc\x8a\x91\x51", 0x0000008); -+ usb_interrupt_write(devh, 0x00000002, buf, 0x0000008, 1000); -+ msleep(7); -+ usb_interrupt_read(devh, 0x00000081, buf, 0x0000008, 1000); -+ msleep(8); -+ usb_interrupt_read(devh, 0x00000081, buf, 0x0000008, 1000); -+ msleep(8); -+ usb_interrupt_read(devh, 0x00000081, buf, 0x0000008, 1000); -+ msleep(8); -+ usb_interrupt_read(devh, 0x00000081, buf, 0x0000008, 1000); -+ msleep(8); -+ usb_interrupt_read(devh, 0x00000081, buf, 0x0000008, 1000); -+ msleep(8); -+ usb_interrupt_read(devh, 0x00000081, buf, 0x0000008, 1000); -+ msleep(8); -+ usb_interrupt_read(devh, 0x00000081, buf, 0x0000008, 1000); -+ msleep(8); -+ usb_interrupt_read(devh, 0x00000081, buf, 0x0000008, 1000); -+ msleep(8); -+ usb_interrupt_read(devh, 0x00000081, buf, 0x0000008, 1000); -+ msleep(8); -+ usb_interrupt_read(devh, 0x00000081, buf, 0x0000008, 1000); -+ msleep(8); -+ usb_interrupt_read(devh, 0x00000081, buf, 0x0000008, 1000); -+ msleep(8); -+ usb_interrupt_read(devh, 0x00000081, buf, 0x0000008, 1000); -+ msleep(8); -+ usb_interrupt_read(devh, 0x00000081, buf, 0x0000008, 1000); -+ msleep(8); -+ usb_interrupt_read(devh, 0x00000081, buf, 0x0000008, 1000); -+ msleep(8); -+ usb_interrupt_read(devh, 0x00000081, buf, 0x0000008, 1000); -+ msleep(8); -+ usb_interrupt_read(devh, 0x00000081, buf, 0x0000008, 1000); -+ msleep(8); -+ usb_interrupt_read(devh, 0x00000081, buf, 0x0000008, 1000); -+ msleep(8); -+ usb_interrupt_read(devh, 0x00000081, buf, 0x0000008, 1000); -+ msleep(8); -+ usb_interrupt_read(devh, 0x00000081, buf, 0x0000008, 1000); -+ msleep(8); -+ usb_interrupt_read(devh, 0x00000081, buf, 0x0000008, 1000); -+ msleep(8); -+ usb_interrupt_read(devh, 0x00000081, buf, 0x0000008, 1000); -+ msleep(8); -+ usb_interrupt_read(devh, 0x00000081, buf, 0x0000008, 1000); -+ msleep(8); -+ usb_interrupt_read(devh, 0x00000081, buf, 0x0000008, 1000); -+ msleep(8); -+ usb_interrupt_read(devh, 0x00000081, buf, 0x0000008, 1000); -+ msleep(8); -+ usb_interrupt_read(devh, 0x00000081, buf, 0x0000008, 1000); -+ msleep(8); -+ usb_interrupt_read(devh, 0x00000081, buf, 0x0000008, 1000); -+ msleep(8); -+ usb_interrupt_read(devh, 0x00000081, buf, 0x0000008, 1000); -+ msleep(8); -+ usb_interrupt_read(devh, 0x00000081, buf, 0x0000008, 1000); -+ msleep(8); -+ usb_interrupt_read(devh, 0x00000081, buf, 0x0000008, 1000); -+ msleep(8); -+ usb_interrupt_read(devh, 0x00000081, buf, 0x0000008, 1000); -+ msleep(8); -+ usb_interrupt_read(devh, 0x00000081, buf, 0x0000008, 1000); -+ msleep(8); -+ usb_interrupt_read(devh, 0x00000081, buf, 0x0000008, 1000); -+ msleep(8); -+ usb_interrupt_read(devh, 0x00000081, buf, 0x0000008, 1000); -+ msleep(8); -+ usb_interrupt_read(devh, 0x00000081, buf, 0x0000008, 1000); -+ msleep(8); -+ usb_interrupt_read(devh, 0x00000081, buf, 0x0000008, 1000); -+ msleep(8); -+ usb_interrupt_read(devh, 0x00000081, buf, 0x0000008, 1000); -+ msleep(8); -+ usb_interrupt_read(devh, 0x00000081, buf, 0x0000008, 1000); -+ msleep(8); -+ usb_interrupt_read(devh, 0x00000081, buf, 0x0000008, 1000); -+ msleep(8); -+ usb_interrupt_read(devh, 0x00000081, buf, 0x0000008, 1000); -+ msleep(8); -+ usb_interrupt_read(devh, 0x00000081, buf, 0x0000008, 1000); -+ msleep(8); -+ usb_interrupt_read(devh, 0x00000081, buf, 0x0000008, 1000); -+ msleep(8); -+ usb_interrupt_read(devh, 0x00000081, buf, 0x0000008, 1000); -+ msleep(8); -+ usb_interrupt_read(devh, 0x00000081, buf, 0x0000008, 1000); -+ msleep(8); -+ usb_interrupt_read(devh, 0x00000081, buf, 0x0000008, 1000); -+ msleep(8); -+ usb_interrupt_read(devh, 0x00000081, buf, 0x0000008, 1000); -+ msleep(8); -+ usb_interrupt_read(devh, 0x00000081, buf, 0x0000008, 1000); -+ msleep(8); -+ usb_interrupt_read(devh, 0x00000081, buf, 0x0000008, 1000); -+ msleep(8); -+ usb_interrupt_read(devh, 0x00000081, buf, 0x0000008, 1000); -+ msleep(8); -+ usb_interrupt_read(devh, 0x00000081, buf, 0x0000008, 1000); -+ msleep(8); -+ usb_interrupt_read(devh, 0x00000081, buf, 0x0000008, 1000); -+ msleep(8); -+ usb_interrupt_read(devh, 0x00000081, buf, 0x0000008, 1000); -+ msleep(8); -+ usb_interrupt_read(devh, 0x00000081, buf, 0x0000008, 1000); -+ msleep(8); -+ usb_interrupt_read(devh, 0x00000081, buf, 0x0000008, 1000); -+ msleep(8); -+ usb_interrupt_read(devh, 0x00000081, buf, 0x0000008, 1000); -+ msleep(8); -+ usb_interrupt_read(devh, 0x00000081, buf, 0x0000008, 1000); -+ msleep(8); -+ usb_interrupt_read(devh, 0x00000081, buf, 0x0000008, 1000); -+ msleep(8); -+ usb_interrupt_read(devh, 0x00000081, buf, 0x0000008, 1000); -+ msleep(8); -+ usb_interrupt_read(devh, 0x00000081, buf, 0x0000008, 1000); -+ msleep(8); -+ usb_interrupt_read(devh, 0x00000081, buf, 0x0000008, 1000); -+ msleep(8); -+ usb_interrupt_read(devh, 0x00000081, buf, 0x0000008, 1000); -+ msleep(8); -+ usb_interrupt_read(devh, 0x00000081, buf, 0x0000008, 1000); -+ msleep(8); -+ usb_interrupt_read(devh, 0x00000081, buf, 0x0000008, 1000); -+ msleep(8); -+ usb_interrupt_read(devh, 0x00000081, buf, 0x0000008, 1000); -+ msleep(2); -+ //URB_FUNCTION_GET_STATUS_FROM_ENDPOINT skipped -+ msleep(4); -+ memcpy(buf, "\x37\x01\xfe\xdb\xc1\x33\x1f\x83", 0x0000008); -+ usb_interrupt_write(devh, 0x00000002, buf, 0x0000008, 1000); -+ msleep(2); -+ usb_interrupt_read(devh, 0x00000081, buf, 0x0000008, 1000); -+ msleep(1); -+ memcpy(buf, "\x37\x0e\xb5\x9d\x3b\x8a\x91\x51", 0x0000008); -+ usb_interrupt_write(devh, 0x00000002, buf, 0x0000008, 1000); -+ msleep(7); -+ usb_interrupt_read(devh, 0x00000081, buf, 0x0000008, 1000); -+ msleep(1); -+ memcpy(buf, "\x34\x87\xba\x0d\xfc\x8a\x91\x51", 0x0000008); -+ usb_interrupt_write(devh, 0x00000002, buf, 0x0000008, 1000); -+ msleep(7); -+ usb_interrupt_read(devh, 0x00000081, buf, 0x0000008, 1000); -+ msleep(8); -+ usb_interrupt_read(devh, 0x00000081, buf, 0x0000008, 1000); -+ msleep(8); -+ usb_interrupt_read(devh, 0x00000081, buf, 0x0000008, 1000); -+ msleep(8); -+ usb_interrupt_read(devh, 0x00000081, buf, 0x0000008, 1000); -+ msleep(8); -+ usb_interrupt_read(devh, 0x00000081, buf, 0x0000008, 1000); -+ msleep(8); -+ usb_interrupt_read(devh, 0x00000081, buf, 0x0000008, 1000); -+ msleep(8); -+ usb_interrupt_read(devh, 0x00000081, buf, 0x0000008, 1000); -+ msleep(8); -+ usb_interrupt_read(devh, 0x00000081, buf, 0x0000008, 1000); -+ msleep(8); -+ usb_interrupt_read(devh, 0x00000081, buf, 0x0000008, 1000); -+ msleep(8); -+ usb_interrupt_read(devh, 0x00000081, buf, 0x0000008, 1000); -+ msleep(8); -+ usb_interrupt_read(devh, 0x00000081, buf, 0x0000008, 1000); -+ msleep(8); -+ usb_interrupt_read(devh, 0x00000081, buf, 0x0000008, 1000); -+ msleep(8); -+ usb_interrupt_read(devh, 0x00000081, buf, 0x0000008, 1000); -+ msleep(8); -+ usb_interrupt_read(devh, 0x00000081, buf, 0x0000008, 1000); -+ msleep(8); -+ usb_interrupt_read(devh, 0x00000081, buf, 0x0000008, 1000); -+ msleep(8); -+ usb_interrupt_read(devh, 0x00000081, buf, 0x0000008, 1000); -+ msleep(8); -+ usb_interrupt_read(devh, 0x00000081, buf, 0x0000008, 1000); -+ msleep(8); -+ usb_interrupt_read(devh, 0x00000081, buf, 0x0000008, 1000); -+ msleep(8); -+ usb_interrupt_read(devh, 0x00000081, buf, 0x0000008, 1000); -+ msleep(8); -+ usb_interrupt_read(devh, 0x00000081, buf, 0x0000008, 1000); -+ msleep(8); -+ usb_interrupt_read(devh, 0x00000081, buf, 0x0000008, 1000); -+ msleep(8); -+ usb_interrupt_read(devh, 0x00000081, buf, 0x0000008, 1000); -+ msleep(8); -+ usb_interrupt_read(devh, 0x00000081, buf, 0x0000008, 1000); -+ msleep(8); -+ usb_interrupt_read(devh, 0x00000081, buf, 0x0000008, 1000); -+ msleep(8); -+ usb_interrupt_read(devh, 0x00000081, buf, 0x0000008, 1000); -+ msleep(8); -+ usb_interrupt_read(devh, 0x00000081, buf, 0x0000008, 1000); -+ msleep(8); -+ usb_interrupt_read(devh, 0x00000081, buf, 0x0000008, 1000); -+ msleep(8); -+ usb_interrupt_read(devh, 0x00000081, buf, 0x0000008, 1000); -+ msleep(8); -+ usb_interrupt_read(devh, 0x00000081, buf, 0x0000008, 1000); -+ msleep(8); -+ usb_interrupt_read(devh, 0x00000081, buf, 0x0000008, 1000); -+ msleep(8); -+ usb_interrupt_read(devh, 0x00000081, buf, 0x0000008, 1000); -+ msleep(8); -+ usb_interrupt_read(devh, 0x00000081, buf, 0x0000008, 1000); -+ msleep(8); -+ usb_interrupt_read(devh, 0x00000081, buf, 0x0000008, 1000); -+ msleep(8); -+ usb_interrupt_read(devh, 0x00000081, buf, 0x0000008, 1000); -+ msleep(8); -+ usb_interrupt_read(devh, 0x00000081, buf, 0x0000008, 1000); -+ msleep(8); -+ usb_interrupt_read(devh, 0x00000081, buf, 0x0000008, 1000); -+ msleep(8); -+ usb_interrupt_read(devh, 0x00000081, buf, 0x0000008, 1000); -+ msleep(8); -+ usb_interrupt_read(devh, 0x00000081, buf, 0x0000008, 1000); -+ msleep(8); -+ usb_interrupt_read(devh, 0x00000081, buf, 0x0000008, 1000); -+ msleep(8); -+ usb_interrupt_read(devh, 0x00000081, buf, 0x0000008, 1000); -+ msleep(8); -+ usb_interrupt_read(devh, 0x00000081, buf, 0x0000008, 1000); -+ msleep(8); -+ usb_interrupt_read(devh, 0x00000081, buf, 0x0000008, 1000); -+ msleep(8); -+ usb_interrupt_read(devh, 0x00000081, buf, 0x0000008, 1000); -+ msleep(8); -+ usb_interrupt_read(devh, 0x00000081, buf, 0x0000008, 1000); -+ msleep(8); -+ usb_interrupt_read(devh, 0x00000081, buf, 0x0000008, 1000); -+ msleep(8); -+ usb_interrupt_read(devh, 0x00000081, buf, 0x0000008, 1000); -+ msleep(8); -+ usb_interrupt_read(devh, 0x00000081, buf, 0x0000008, 1000); -+ msleep(8); -+ usb_interrupt_read(devh, 0x00000081, buf, 0x0000008, 1000); -+ msleep(8); -+ usb_interrupt_read(devh, 0x00000081, buf, 0x0000008, 1000); -+ msleep(8); -+ usb_interrupt_read(devh, 0x00000081, buf, 0x0000008, 1000); -+ msleep(8); -+ usb_interrupt_read(devh, 0x00000081, buf, 0x0000008, 1000); -+ msleep(8); -+ usb_interrupt_read(devh, 0x00000081, buf, 0x0000008, 1000); -+ msleep(8); -+ usb_interrupt_read(devh, 0x00000081, buf, 0x0000008, 1000); -+ msleep(8); -+ usb_interrupt_read(devh, 0x00000081, buf, 0x0000008, 1000); -+ msleep(8); -+ usb_interrupt_read(devh, 0x00000081, buf, 0x0000008, 1000); -+ msleep(8); -+ usb_interrupt_read(devh, 0x00000081, buf, 0x0000008, 1000); -+ msleep(8); -+ usb_interrupt_read(devh, 0x00000081, buf, 0x0000008, 1000); -+ msleep(8); -+ usb_interrupt_read(devh, 0x00000081, buf, 0x0000008, 1000); -+ msleep(8); -+ usb_interrupt_read(devh, 0x00000081, buf, 0x0000008, 1000); -+ msleep(8); -+ usb_interrupt_read(devh, 0x00000081, buf, 0x0000008, 1000); -+ msleep(8); -+ usb_interrupt_read(devh, 0x00000081, buf, 0x0000008, 1000); -+ msleep(8); -+ usb_interrupt_read(devh, 0x00000081, buf, 0x0000008, 1000); -+ msleep(8); -+ usb_interrupt_read(devh, 0x00000081, buf, 0x0000008, 1000); -+ msleep(8); -+ usb_interrupt_read(devh, 0x00000081, buf, 0x0000008, 1000); -+ msleep(8); -+ usb_interrupt_read(devh, 0x00000081, buf, 0x0000008, 1000); -+ msleep(8); -+ usb_interrupt_read(devh, 0x00000081, buf, 0x0000008, 1000); -+ msleep(8); -+ usb_interrupt_read(devh, 0x00000081, buf, 0x0000008, 1000); -+ msleep(8); -+ usb_interrupt_read(devh, 0x00000081, buf, 0x0000008, 1000); -+ msleep(8); -+ usb_interrupt_read(devh, 0x00000081, buf, 0x0000008, 1000); -+ msleep(8); -+ usb_interrupt_read(devh, 0x00000081, buf, 0x0000008, 1000); -+ msleep(8); -+ usb_interrupt_read(devh, 0x00000081, buf, 0x0000008, 1000); -+ msleep(8); -+ usb_interrupt_read(devh, 0x00000081, buf, 0x0000008, 1000); -+ msleep(8); -+ usb_interrupt_read(devh, 0x00000081, buf, 0x0000008, 1000); -+ msleep(1); -+ //URB_FUNCTION_GET_STATUS_FROM_ENDPOINT skipped -+ msleep(4); -+ memcpy(buf, "\x33\x04\xfe\x00\xf4\x6c\x1f\xf0", 0x0000008); -+ usb_interrupt_write(devh, 0x00000002, buf, 0x0000008, 1000); -+ msleep(3); -+ usb_interrupt_read(devh, 0x00000081, buf, 0x0000008, 1000); -+ msleep(1); -+ //URB_FUNCTION_GET_STATUS_FROM_ENDPOINT skipped -+ msleep(4); -+ memcpy(buf, "\x32\x07\xfe\xf0\x29\xb9\x3a\xf0", 0x0000008); -+ usb_interrupt_write(devh, 0x00000002, buf, 0x0000008, 1000); -+ msleep(3); -+ usb_interrupt_read(devh, 0x00000081, buf, 0x0000008, 1000); -+ -+ if (buf) -+ free (buf); -+ return 0; -+} -diff --git a/extras/mobile-action-modeswitch/ma8280p_us.h b/extras/mobile-action-modeswitch/ma8280p_us.h -new file mode 100644 -index 0000000..bf0e304 ---- /dev/null -+++ b/extras/mobile-action-modeswitch/ma8280p_us.h -@@ -0,0 +1,24 @@ -+/* -+ * Modem mode switcher -+ * -+ * Copyright (C) 2009 Dan Williams -+ * -+ * This program is free software; you can redistribute it and/or modify -+ * it under the terms of the GNU General Public License as published by -+ * the Free Software Foundation; either version 2 of the License, or -+ * (at your option) any later version. -+ * -+ * This program is distributed in the hope that it will be useful, -+ * but WITHOUT ANY WARRANTY; without even the implied warranty of -+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -+ * GNU General Public License for more details: -+ */ -+ -+#ifndef __MA8280P_H__ -+#define __MA8280P_H__ -+ -+#include -+ -+int ma8280p_switch (struct usb_dev_handle *devh, struct usb_device *dev); -+ -+#endif /* __MA8280P_H__ */ -diff --git a/extras/mobile-action-modeswitch/mobile-action-modeswitch.c b/extras/mobile-action-modeswitch/mobile-action-modeswitch.c -new file mode 100644 -index 0000000..36d7d81 ---- /dev/null -+++ b/extras/mobile-action-modeswitch/mobile-action-modeswitch.c -@@ -0,0 +1,262 @@ -+/* -+ * Mobile action cable mode switcher -+ * -+ * Copyright (C) 2008 - 2010 Dan Williams -+ * Copyright (C) 2008 Peter Henn -+ * -+ * Heavily based on the 'ozerocdoff' tool by Peter Henn. -+ * -+ * This program is free software; you can redistribute it and/or modify -+ * it under the terms of the GNU General Public License as published by -+ * the Free Software Foundation; either version 2 of the License, or -+ * (at your option) any later version. -+ * -+ * This program is distributed in the hope that it will be useful, -+ * but WITHOUT ANY WARRANTY; without even the implied warranty of -+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -+ * GNU General Public License for more details: -+ */ -+ -+#include -+#include -+#include -+#include -+#include -+#include -+#include -+ -+#include -+ -+#include "utils.h" -+ -+#include "ma8280p_us.h" -+ -+struct usb_dev_handle *handle = NULL; -+ -+typedef struct usb_device * (*FindFunc) (int vid, int pid); -+typedef int (*SwitchFunc) (struct usb_dev_handle *dh, struct usb_device *dev); -+ -+typedef enum { -+ ST_UNKNOWN = 0, -+ ST_MA8280P -+} SwitchType; -+ -+typedef struct SwitchEntry { -+ SwitchType st; -+ const char *clopt; -+ FindFunc find_func; -+ SwitchFunc switch_func; -+} SwitchEntry; -+ -+static SwitchEntry switch_types[] = { -+ { ST_MA8280P, "mobile-action-8280p", NULL, ma8280p_switch }, -+ { ST_UNKNOWN, NULL, NULL } -+}; -+ -+static struct usb_device * -+generic_find (int vid, int pid) -+{ -+ struct usb_bus *bus; -+ struct usb_device *dev; -+ -+ for (bus = usb_get_busses(); bus; bus = bus->next) { -+ for (dev = bus->devices; dev; dev = dev->next) { -+ if (dev->descriptor.idVendor == vid && dev->descriptor.idProduct == pid) { -+ debug ("Found device '%s'", dev->filename); -+ return dev; -+ } -+ } -+ } -+ return NULL; -+} -+ -+static void -+release_usb_device (int param) -+{ -+ usb_release_interface (handle, 0); -+ usb_close (handle); -+} -+ -+static void -+print_usage (void) -+{ -+ printf ("Usage: mobile-action-modeswitch [-hdq] [-l ] -v -p -t \n" -+ " -h, --help show this help message\n" -+ " -v, --vendor target USB vendor ID\n" -+ " -p, --product target USB product ID\n" -+ " -t, --type type of switch to attempt, varies by device:\n" -+ " mobile-action-8280p - For Mobile Action 8xxxP USB cables\n" -+ " -l, --log log output to a file\n" -+ " -q, --quiet don't print anything to stdout\n" -+ " -d, --debug display debugging messages\n\n" -+ "Examples:\n" -+ " mobile-action-modeswitch -v 0x0df7 -p 0x8000 -t mobile-action-8280p\n"); -+} -+ -+static SwitchEntry * -+parse_type (const char *s) -+{ -+ SwitchEntry *entry = &switch_types[0]; -+ -+ while (entry->clopt) { -+ if (!strcmp (entry->clopt, s)) -+ return entry; -+ entry++; -+ } -+ -+ return NULL; -+} -+ -+static void -+do_exit (int val) -+{ -+ log_shutdown (); -+ exit (val); -+} -+ -+int main(int argc, char **argv) -+{ -+ static struct option options[] = { -+ { "help", no_argument, NULL, 'h' }, -+ { "vendor", required_argument, NULL, 'v' }, -+ { "product", required_argument, NULL, 'p' }, -+ { "type", required_argument, NULL, 't' }, -+ { "log", required_argument, NULL, 'l' }, -+ { "debug", no_argument, NULL, 'd' }, -+ { "quiet", no_argument, NULL, 'q' }, -+ { NULL, 0, NULL, 0} -+ }; -+ -+ struct usb_device *dev; -+ int vid = 0, pid = 0; -+ const char *logpath = NULL; -+ char buffer[256]; -+ int ret, quiet = 0, debug = 0; -+ SwitchEntry *sentry = NULL; -+ -+ while (1) { -+ int option; -+ -+ option = getopt_long(argc, argv, "hv:p:l:t:dq", options, NULL); -+ if (option == -1) -+ break; -+ -+ switch (option) { -+ case 'v': -+ vid = strtol (optarg, NULL, 0); -+ break; -+ case 'p': -+ pid = strtol (optarg, NULL, 0); -+ break; -+ case 't': -+ sentry = parse_type (optarg); -+ if (!sentry) { -+ error ("unknown switch type '%s'", optarg); -+ print_usage (); -+ exit (1); -+ } -+ break; -+ case 'l': -+ logpath = optarg; -+ break; -+ case 'q': -+ quiet = 1; -+ break; -+ case 'd': -+ debug = 1; -+ break; -+ case 'h': -+ default: -+ print_usage (); -+ exit (1); -+ } -+ } -+ -+ if (log_startup (logpath, debug, quiet)) { -+ fprintf (stderr, "Couldn't open/create logfile %s", logpath); -+ exit (2); -+ } -+ -+ if (!sentry) { -+ if (!quiet) -+ print_usage (); -+ else -+ error ("missing device switch type."); -+ do_exit (3); -+ } -+ -+ if (!vid || !pid) { -+ if (!quiet) -+ print_usage (); -+ else -+ error ("missing vendor and device IDs."); -+ do_exit (3); -+ } -+ -+ usb_init(); -+ -+ if (usb_find_busses() < 0) { -+ error ("no USB busses found."); -+ do_exit (4); -+ } -+ -+ if (usb_find_devices() < 0) { -+ error ("no USB devices found."); -+ do_exit (4); -+ } -+ -+ if (sentry->find_func) -+ dev = (*sentry->find_func) (vid, pid); -+ else -+ dev = generic_find (vid, pid); -+ if (dev == NULL) { -+ error ("no device found."); -+ do_exit (5); -+ } -+ -+ handle = usb_open (dev); -+ if (handle == NULL) { -+ error ("%s: could not access the device.", -+ dev->filename); -+ do_exit (6); -+ } -+ -+ /* detach running default driver */ -+ signal (SIGTERM, release_usb_device); -+ ret = usb_get_driver_np (handle, 0, buffer, sizeof (buffer)); -+ if (ret == 0) { -+ debug ("%s: found already attached driver '%s'", dev->filename, buffer); -+ -+ ret = usb_detach_kernel_driver_np (handle, 0); -+ if (ret != 0) { -+ debug ("%s: error: unable to detach current driver.", dev->filename); -+ usb_close (handle); -+ do_exit (7); -+ } -+ } -+ -+ ret = usb_claim_interface (handle, 0); -+ if (ret != 0) { -+ debug ("%s: couldn't claim device's USB interface: %d.", -+ dev->filename, ret); -+ usb_close (handle); -+ do_exit (8); -+ } -+ -+ ret = (*sentry->switch_func) (handle, dev); -+ if (ret < 0) { -+ debug ("%s: failed to switch device to serial mode.", dev->filename); -+ usb_release_interface (handle, 0); -+ usb_close (handle); -+ do_exit(9); -+ } -+ -+ usb_release_interface (handle, 0); -+ -+ ret = usb_close (handle); -+ if (ret < 0) -+ debug ("%s: failed to close the device.", dev->filename); -+ -+ do_exit (0); -+ return 0; -+} -diff --git a/extras/mobile-action-modeswitch/utils.c b/extras/mobile-action-modeswitch/utils.c -new file mode 100644 -index 0000000..37d0df4 ---- /dev/null -+++ b/extras/mobile-action-modeswitch/utils.c -@@ -0,0 +1,83 @@ -+/* -+ * Modem mode switcher -+ * -+ * Copyright (C) 2009 Dan Williams -+ * -+ * This program is free software; you can redistribute it and/or modify -+ * it under the terms of the GNU General Public License as published by -+ * the Free Software Foundation; either version 2 of the License, or -+ * (at your option) any later version. -+ * -+ * This program is distributed in the hope that it will be useful, -+ * but WITHOUT ANY WARRANTY; without even the implied warranty of -+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -+ * GNU General Public License for more details: -+ */ -+ -+#include -+#include -+#include -+#include -+#include -+#include -+ -+#include "utils.h" -+ -+static int debug_on = 0; -+static int quiet = 0; -+FILE *logfile = NULL; -+ -+void -+do_log (int level, const char *fmt, ...) -+{ -+ va_list args; -+ char buffer[1024]; -+ char tag = 'L'; -+ -+ if (level >= LOG_DBG && !debug_on) -+ return; -+ -+ va_start (args, fmt); -+ vsnprintf (buffer, sizeof (buffer), fmt, args); -+ va_end (args); -+ -+ if (level == LOG_ERR) -+ tag = 'E'; -+ else if (level == LOG_MSG) -+ tag = 'L'; -+ else if (level == LOG_DBG) -+ tag = 'D'; -+ -+ if (logfile) -+ fprintf (logfile, "%c: %s\n", tag, buffer); -+ if (!quiet) -+ fprintf ((level == LOG_ERR) ? stderr : stdout, "%c: %s\n", tag, buffer); -+} -+ -+int -+log_startup (const char *path, int do_debug, int be_quiet) -+{ -+ time_t t; -+ -+ quiet = be_quiet; -+ debug_on = do_debug; -+ -+ if (!path) -+ return 0; -+ -+ logfile = fopen (path, "a+"); -+ if (!logfile) -+ return 1; -+ -+ t = time (NULL); -+ message ("\n**** Started: %s\n", ctime (&t)); -+ return 0; -+} -+ -+void -+log_shutdown (void) -+{ -+ if (logfile) -+ fclose (logfile); -+} -+ -diff --git a/extras/mobile-action-modeswitch/utils.h b/extras/mobile-action-modeswitch/utils.h -new file mode 100644 -index 0000000..1ef557a ---- /dev/null -+++ b/extras/mobile-action-modeswitch/utils.h -@@ -0,0 +1,32 @@ -+/* -+ * Modem mode switcher -+ * -+ * Copyright (C) 2009 Dan Williams -+ * -+ * This program is free software; you can redistribute it and/or modify -+ * it under the terms of the GNU General Public License as published by -+ * the Free Software Foundation; either version 2 of the License, or -+ * (at your option) any later version. -+ * -+ * This program is distributed in the hope that it will be useful, -+ * but WITHOUT ANY WARRANTY; without even the implied warranty of -+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -+ * GNU General Public License for more details: -+ */ -+ -+#ifndef __UTILS_H__ -+#define __UTILS_H__ -+ -+#define LOG_ERR 0 -+#define LOG_MSG 1 -+#define LOG_DBG 2 -+ -+#define message(fmt, args...) do_log (LOG_MSG, fmt, ##args); -+#define error(fmt, args...) do_log (LOG_ERR, fmt, ##args); -+#define debug(fmt, args...) do_log (LOG_DBG, fmt, ##args); -+ -+void do_log (int level, const char *fmt, ...); -+int log_startup (const char *path, int do_debug, int be_quiet); -+void log_shutdown (void); -+ -+#endif /* __UTILS_H__ */ -diff --git a/extras/modem-modeswitch/61-mobile-action.rules b/extras/modem-modeswitch/61-mobile-action.rules -deleted file mode 100644 -index 29d460d..0000000 ---- a/extras/modem-modeswitch/61-mobile-action.rules -+++ /dev/null -@@ -1,15 +0,0 @@ --ACTION!="add", GOTO="mobile_action_end" -- --SUBSYSTEM=="usb", ATTR{bDeviceClass}=="00|ff", ATTR{bDeviceSubClass}=="00|ff", ENV{DEVTYPE}=="usb_device", GOTO="mobile_action_switch" --GOTO="mobile_action_end" -- --LABEL="mobile_action_switch" --ATTRS{idVendor}=="0df7", ATTRS{idProduct}=="0800", RUN+="modem-modeswitch -v 0x%s{idVendor} -p 0x%s{idProduct} -t mobile-action-8280p" -- --LABEL="mobile_action_end" -- --# modem-modeswitch does not work with these devices, the fake CD-ROM needs to be ejected -- --# ZTE MF6xx --ACTION=="add", ENV{ID_CDROM}=="1", ENV{ID_VENDOR_ID}=="19d2", ENV{ID_MODEL_ID}=="2000", RUN+="/usr/bin/eject %k" -- -diff --git a/extras/modem-modeswitch/61-option-modem-modeswitch.rules b/extras/modem-modeswitch/61-option-modem-modeswitch.rules -deleted file mode 100644 -index 053733e..0000000 ---- a/extras/modem-modeswitch/61-option-modem-modeswitch.rules -+++ /dev/null -@@ -1,44 +0,0 @@ --# NOTE: only for devices manufactured by Option NV --# DO NOT add devices that are not manufactured by Option NV -- --ACTION!="add", GOTO="option_zerocd_end" -- --SUBSYSTEM=="usb", ATTR{bDeviceClass}!="ff", ENV{DEVTYPE}=="usb_device", GOTO="option_zerocd_disable" --SUBSYSTEM=="scsi", ENV{DEVTYPE}=="scsi_device", GOTO="option_zerocd_disable" --GOTO="option_zerocd_end" -- --LABEL="option_zerocd_disable" --ATTRS{idVendor}=="05c6", ATTRS{idProduct}=="1000", RUN+="modem-modeswitch -v 0x%s{idVendor} -p 0x%s{idProduct} -t option-zerocd" --ATTRS{idVendor}=="0af0", ATTRS{idProduct}=="6711", RUN+="modem-modeswitch -v 0x%s{idVendor} -p 0x%s{idProduct} -t option-zerocd" --ATTRS{idVendor}=="0af0", ATTRS{idProduct}=="6711", RUN+="modem-modeswitch -v 0x%s{idVendor} -p 0x%s{idProduct} -t option-zerocd" --ATTRS{idVendor}=="0af0", ATTRS{idProduct}=="6731", RUN+="modem-modeswitch -v 0x%s{idVendor} -p 0x%s{idProduct} -t option-zerocd" --ATTRS{idVendor}=="0af0", ATTRS{idProduct}=="6751", RUN+="modem-modeswitch -v 0x%s{idVendor} -p 0x%s{idProduct} -t option-zerocd" --ATTRS{idVendor}=="0af0", ATTRS{idProduct}=="6771", RUN+="modem-modeswitch -v 0x%s{idVendor} -p 0x%s{idProduct} -t option-zerocd" --ATTRS{idVendor}=="0af0", ATTRS{idProduct}=="6791", RUN+="modem-modeswitch -v 0x%s{idVendor} -p 0x%s{idProduct} -t option-zerocd" --ATTRS{idVendor}=="0af0", ATTRS{idProduct}=="6811", RUN+="modem-modeswitch -v 0x%s{idVendor} -p 0x%s{idProduct} -t option-zerocd" --ATTRS{idVendor}=="0af0", ATTRS{idProduct}=="6911", RUN+="modem-modeswitch -v 0x%s{idVendor} -p 0x%s{idProduct} -t option-zerocd" --ATTRS{idVendor}=="0af0", ATTRS{idProduct}=="6951", RUN+="modem-modeswitch -v 0x%s{idVendor} -p 0x%s{idProduct} -t option-zerocd" --ATTRS{idVendor}=="0af0", ATTRS{idProduct}=="6971", RUN+="modem-modeswitch -v 0x%s{idVendor} -p 0x%s{idProduct} -t option-zerocd" --ATTRS{idVendor}=="0af0", ATTRS{idProduct}=="7011", RUN+="modem-modeswitch -v 0x%s{idVendor} -p 0x%s{idProduct} -t option-zerocd" --ATTRS{idVendor}=="0af0", ATTRS{idProduct}=="7031", RUN+="modem-modeswitch -v 0x%s{idVendor} -p 0x%s{idProduct} -t option-zerocd" --ATTRS{idVendor}=="0af0", ATTRS{idProduct}=="7051", RUN+="modem-modeswitch -v 0x%s{idVendor} -p 0x%s{idProduct} -t option-zerocd" --ATTRS{idVendor}=="0af0", ATTRS{idProduct}=="7071", RUN+="modem-modeswitch -v 0x%s{idVendor} -p 0x%s{idProduct} -t option-zerocd" --ATTRS{idVendor}=="0af0", ATTRS{idProduct}=="7111", RUN+="modem-modeswitch -v 0x%s{idVendor} -p 0x%s{idProduct} -t option-zerocd" --ATTRS{idVendor}=="0af0", ATTRS{idProduct}=="7211", RUN+="modem-modeswitch -v 0x%s{idVendor} -p 0x%s{idProduct} -t option-zerocd" --ATTRS{idVendor}=="0af0", ATTRS{idProduct}=="7251", RUN+="modem-modeswitch -v 0x%s{idVendor} -p 0x%s{idProduct} -t option-zerocd" --ATTRS{idVendor}=="0af0", ATTRS{idProduct}=="7271", RUN+="modem-modeswitch -v 0x%s{idVendor} -p 0x%s{idProduct} -t option-zerocd" --ATTRS{idVendor}=="0af0", ATTRS{idProduct}=="7311", RUN+="modem-modeswitch -v 0x%s{idVendor} -p 0x%s{idProduct} -t option-zerocd" --ATTRS{idVendor}=="0af0", ATTRS{idProduct}=="c031", RUN+="modem-modeswitch -v 0x%s{idVendor} -p 0x%s{idProduct} -t option-zerocd" --ATTRS{idVendor}=="0af0", ATTRS{idProduct}=="d031", RUN+="modem-modeswitch -v 0x%s{idVendor} -p 0x%s{idProduct} -t option-zerocd" --ATTRS{idVendor}=="0af0", ATTRS{idProduct}=="d033", RUN+="modem-modeswitch -v 0x%s{idVendor} -p 0x%s{idProduct} -t option-zerocd" --ATTRS{idVendor}=="0af0", ATTRS{idProduct}=="7301", RUN+="modem-modeswitch -v 0x%s{idVendor} -p 0x%s{idProduct} -t option-zerocd" --ATTRS{idVendor}=="0af0", ATTRS{idProduct}=="7361", RUN+="modem-modeswitch -v 0x%s{idVendor} -p 0x%s{idProduct} -t option-zerocd" --ATTRS{idVendor}=="0af0", ATTRS{idProduct}=="7401", RUN+="modem-modeswitch -v 0x%s{idVendor} -p 0x%s{idProduct} -t option-zerocd" --ATTRS{idVendor}=="0af0", ATTRS{idProduct}=="7501", RUN+="modem-modeswitch -v 0x%s{idVendor} -p 0x%s{idProduct} -t option-zerocd" --ATTRS{idVendor}=="0af0", ATTRS{idProduct}=="7601", RUN+="modem-modeswitch -v 0x%s{idVendor} -p 0x%s{idProduct} -t option-zerocd" --ATTRS{idVendor}=="0af0", ATTRS{idProduct}=="7901", RUN+="modem-modeswitch -v 0x%s{idVendor} -p 0x%s{idProduct} -t option-zerocd" -- --# NOTE: only for devices manufactured by Option NV --# DO NOT add devices that are not manufactured by Option NV -- --LABEL="option_zerocd_end" -diff --git a/extras/modem-modeswitch/ma8280p_us.c b/extras/modem-modeswitch/ma8280p_us.c -deleted file mode 100644 -index d7cf4f4..0000000 ---- a/extras/modem-modeswitch/ma8280p_us.c -+++ /dev/null -@@ -1,462 +0,0 @@ --/* http://www.natox.be/ma8280p/ -- * http://www.leopold.dk/~martin/ma-8230p.html -- * http://figvam.blogspot.com/2007/01/mobile-action-8730p-usb-cable-and-linux.html -- */ -- --/* -- * -- * Code by davy hollevoet. This is simply an adaptation of code -- * generated by usbsnoop2libusb. (http://iki.fi/lindi/usb/usbsnoop2libusb.pl) -- * -- * This code is released under both the GPL version 2 and BSD licenses. -- * Either license may be used. -- * -- * GPLv2 -- * ******** -- * This program is free software; you can redistribute it and/or -- * modify it under the terms of the GNU General Public License -- * as published by the Free Software Foundation; either version 2 -- * of the License, or (at your option) any later version. -- * -- * This program is distributed in the hope that it will be useful, -- * but WITHOUT ANY WARRANTY; without even the implied warranty of -- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -- * GNU General Public License for more details. -- * -- * In addition: -- * -- * Redistribution and use in source and binary forms, with or without -- * modification, are permitted provided that the following conditions -- * are met: -- * -- * 1. Redistributions of source code must retain the above copyright -- * notice, this list of conditions and the following disclaimer. -- * 2. Redistributions in binary form must reproduce the above copyright -- * notice, this list of conditions and the following disclaimer in the -- * documentation and/or other materials provided with the distribution. -- * 3. The name of the author may not be used to endorse or promote -- * products derived from this software without specific prior written -- * permission. -- * -- * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR -- * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED -- * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE -- * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, -- * INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES -- * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR -- * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) -- * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, -- * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING -- * IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE -- * POSSIBILITY OF SUCH DAMAGE. -- * -- * BSD -- * ****** -- * Copyright (c) 1998, Regents of the University of California -- * All rights reserved. -- * Redistribution and use in source and binary forms, with or without -- * modification, are permitted provided that the following conditions are met: -- * -- * * Redistributions of source code must retain the above copyright -- * notice, this list of conditions and the following disclaimer. -- * * Redistributions in binary form must reproduce the above copyright -- * notice, this list of conditions and the following disclaimer in the -- * documentation and/or other materials provided with the distribution. -- * * Neither the name of the University of California, Berkeley nor the -- * names of its contributors may be used to endorse or promote products -- * derived from this software without specific prior written permission. -- * -- * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS "AS IS" AND ANY -- * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED -- * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE -- * DISCLAIMED. IN NO EVENT SHALL THE REGENTS AND CONTRIBUTORS BE LIABLE FOR ANY -- * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES -- * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; -- * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND -- * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -- * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS -- * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -- * -- */ -- --/* This file is (mostly) generated with usbsnoop2libusb.pl from a usbsnoop log file. */ --/* Latest version of the script should be in http://iki.fi/lindi/usb/usbsnoop2libusb.pl */ --#include --#include --#include --#include --#include --#include --#include --#include -- --#include "utils.h" --#include "ma8280p_us.h" -- --static void msleep(long msec) --{ -- struct timespec duration = { 0, msec * 1000 * 1000 }; -- -- nanosleep(&duration, NULL); --} -- --int ma8280p_switch (struct usb_dev_handle *devh, struct usb_device *dev) --{ -- int ret = 1; -- char *buf = NULL; -- -- buf = malloc (65535); -- if (!buf) { -- error ("%s: not enough memory", dev->filename, ret); -- return -1; -- } -- -- usb_get_descriptor(devh, 0x0000001, 0x0000000, buf, 0x0000012); -- msleep(6); -- usb_get_descriptor(devh, 0x0000001, 0x0000000, buf, 0x0000012); -- msleep(6); -- usb_get_descriptor(devh, 0x0000002, 0x0000000, buf, 0x0000400); -- msleep(10); -- ret = usb_release_interface(devh, 0); -- if (ret != 0) -- debug ("%s: failed to release interface before set_configuration: %d", dev->filename, ret); -- usb_set_configuration(devh, 0x0000001); -- ret = usb_claim_interface(devh, 0); -- if (ret != 0) -- debug ("%s: claim after set_configuration failed with error %d", dev->filename, ret); -- //usb_set_altinterface(devh, 0); -- //msleep(33); -- usb_control_msg(devh, USB_TYPE_CLASS + USB_RECIP_INTERFACE + USB_ENDPOINT_IN, 0x0000001, 0x0000300, 0x0000000, buf, 0x0000008, 1000); -- msleep(5); -- memcpy(buf, "\xb0\x04\x00\x00\x02\x90\x26\x86", 0x0000008); -- usb_control_msg(devh, USB_TYPE_CLASS + USB_RECIP_INTERFACE, 0x0000009, 0x0000300, 0x0000000, buf, 0x0000008, 1000); -- msleep(4); -- memcpy(buf, "\xb0\x04\x00\x00\x02\x90\x26\x86", 0x0000008); -- usb_control_msg(devh, USB_TYPE_CLASS + USB_RECIP_INTERFACE, 0x0000009, 0x0000300, 0x0000000, buf, 0x0000008, 1000); -- msleep(4); -- -- msleep(4); -- usb_interrupt_read(devh, 0x00000081, buf, 0x0000008, 1000); -- msleep(6); -- usb_interrupt_read(devh, 0x00000081, buf, 0x0000008, 1000); -- msleep(1); -- //URB_FUNCTION_GET_STATUS_FROM_ENDPOINT skipped -- msleep(4); -- memcpy(buf, "\x37\x01\xfe\xdb\xc1\x33\x1f\x83", 0x0000008); -- usb_interrupt_write(devh, 0x00000002, buf, 0x0000008, 1000); -- msleep(3); -- usb_interrupt_read(devh, 0x00000081, buf, 0x0000008, 1000); -- msleep(1); -- memcpy(buf, "\x37\x0e\xb5\x9d\x3b\x8a\x91\x51", 0x0000008); -- usb_interrupt_write(devh, 0x00000002, buf, 0x0000008, 1000); -- msleep(7); -- usb_interrupt_read(devh, 0x00000081, buf, 0x0000008, 1000); -- msleep(1); -- memcpy(buf, "\x34\x87\xba\x0d\xfc\x8a\x91\x51", 0x0000008); -- usb_interrupt_write(devh, 0x00000002, buf, 0x0000008, 1000); -- msleep(7); -- usb_interrupt_read(devh, 0x00000081, buf, 0x0000008, 1000); -- msleep(8); -- usb_interrupt_read(devh, 0x00000081, buf, 0x0000008, 1000); -- msleep(8); -- usb_interrupt_read(devh, 0x00000081, buf, 0x0000008, 1000); -- msleep(8); -- usb_interrupt_read(devh, 0x00000081, buf, 0x0000008, 1000); -- msleep(8); -- usb_interrupt_read(devh, 0x00000081, buf, 0x0000008, 1000); -- msleep(8); -- usb_interrupt_read(devh, 0x00000081, buf, 0x0000008, 1000); -- msleep(8); -- usb_interrupt_read(devh, 0x00000081, buf, 0x0000008, 1000); -- msleep(8); -- usb_interrupt_read(devh, 0x00000081, buf, 0x0000008, 1000); -- msleep(8); -- usb_interrupt_read(devh, 0x00000081, buf, 0x0000008, 1000); -- msleep(8); -- usb_interrupt_read(devh, 0x00000081, buf, 0x0000008, 1000); -- msleep(8); -- usb_interrupt_read(devh, 0x00000081, buf, 0x0000008, 1000); -- msleep(8); -- usb_interrupt_read(devh, 0x00000081, buf, 0x0000008, 1000); -- msleep(8); -- usb_interrupt_read(devh, 0x00000081, buf, 0x0000008, 1000); -- msleep(8); -- usb_interrupt_read(devh, 0x00000081, buf, 0x0000008, 1000); -- msleep(8); -- usb_interrupt_read(devh, 0x00000081, buf, 0x0000008, 1000); -- msleep(8); -- usb_interrupt_read(devh, 0x00000081, buf, 0x0000008, 1000); -- msleep(8); -- usb_interrupt_read(devh, 0x00000081, buf, 0x0000008, 1000); -- msleep(8); -- usb_interrupt_read(devh, 0x00000081, buf, 0x0000008, 1000); -- msleep(8); -- usb_interrupt_read(devh, 0x00000081, buf, 0x0000008, 1000); -- msleep(8); -- usb_interrupt_read(devh, 0x00000081, buf, 0x0000008, 1000); -- msleep(8); -- usb_interrupt_read(devh, 0x00000081, buf, 0x0000008, 1000); -- msleep(8); -- usb_interrupt_read(devh, 0x00000081, buf, 0x0000008, 1000); -- msleep(8); -- usb_interrupt_read(devh, 0x00000081, buf, 0x0000008, 1000); -- msleep(8); -- usb_interrupt_read(devh, 0x00000081, buf, 0x0000008, 1000); -- msleep(8); -- usb_interrupt_read(devh, 0x00000081, buf, 0x0000008, 1000); -- msleep(8); -- usb_interrupt_read(devh, 0x00000081, buf, 0x0000008, 1000); -- msleep(8); -- usb_interrupt_read(devh, 0x00000081, buf, 0x0000008, 1000); -- msleep(8); -- usb_interrupt_read(devh, 0x00000081, buf, 0x0000008, 1000); -- msleep(8); -- usb_interrupt_read(devh, 0x00000081, buf, 0x0000008, 1000); -- msleep(8); -- usb_interrupt_read(devh, 0x00000081, buf, 0x0000008, 1000); -- msleep(8); -- usb_interrupt_read(devh, 0x00000081, buf, 0x0000008, 1000); -- msleep(8); -- usb_interrupt_read(devh, 0x00000081, buf, 0x0000008, 1000); -- msleep(8); -- usb_interrupt_read(devh, 0x00000081, buf, 0x0000008, 1000); -- msleep(8); -- usb_interrupt_read(devh, 0x00000081, buf, 0x0000008, 1000); -- msleep(8); -- usb_interrupt_read(devh, 0x00000081, buf, 0x0000008, 1000); -- msleep(8); -- usb_interrupt_read(devh, 0x00000081, buf, 0x0000008, 1000); -- msleep(8); -- usb_interrupt_read(devh, 0x00000081, buf, 0x0000008, 1000); -- msleep(8); -- usb_interrupt_read(devh, 0x00000081, buf, 0x0000008, 1000); -- msleep(8); -- usb_interrupt_read(devh, 0x00000081, buf, 0x0000008, 1000); -- msleep(8); -- usb_interrupt_read(devh, 0x00000081, buf, 0x0000008, 1000); -- msleep(8); -- usb_interrupt_read(devh, 0x00000081, buf, 0x0000008, 1000); -- msleep(8); -- usb_interrupt_read(devh, 0x00000081, buf, 0x0000008, 1000); -- msleep(8); -- usb_interrupt_read(devh, 0x00000081, buf, 0x0000008, 1000); -- msleep(8); -- usb_interrupt_read(devh, 0x00000081, buf, 0x0000008, 1000); -- msleep(8); -- usb_interrupt_read(devh, 0x00000081, buf, 0x0000008, 1000); -- msleep(8); -- usb_interrupt_read(devh, 0x00000081, buf, 0x0000008, 1000); -- msleep(8); -- usb_interrupt_read(devh, 0x00000081, buf, 0x0000008, 1000); -- msleep(8); -- usb_interrupt_read(devh, 0x00000081, buf, 0x0000008, 1000); -- msleep(8); -- usb_interrupt_read(devh, 0x00000081, buf, 0x0000008, 1000); -- msleep(8); -- usb_interrupt_read(devh, 0x00000081, buf, 0x0000008, 1000); -- msleep(8); -- usb_interrupt_read(devh, 0x00000081, buf, 0x0000008, 1000); -- msleep(8); -- usb_interrupt_read(devh, 0x00000081, buf, 0x0000008, 1000); -- msleep(8); -- usb_interrupt_read(devh, 0x00000081, buf, 0x0000008, 1000); -- msleep(8); -- usb_interrupt_read(devh, 0x00000081, buf, 0x0000008, 1000); -- msleep(8); -- usb_interrupt_read(devh, 0x00000081, buf, 0x0000008, 1000); -- msleep(8); -- usb_interrupt_read(devh, 0x00000081, buf, 0x0000008, 1000); -- msleep(8); -- usb_interrupt_read(devh, 0x00000081, buf, 0x0000008, 1000); -- msleep(8); -- usb_interrupt_read(devh, 0x00000081, buf, 0x0000008, 1000); -- msleep(8); -- usb_interrupt_read(devh, 0x00000081, buf, 0x0000008, 1000); -- msleep(8); -- usb_interrupt_read(devh, 0x00000081, buf, 0x0000008, 1000); -- msleep(8); -- usb_interrupt_read(devh, 0x00000081, buf, 0x0000008, 1000); -- msleep(8); -- usb_interrupt_read(devh, 0x00000081, buf, 0x0000008, 1000); -- msleep(8); -- usb_interrupt_read(devh, 0x00000081, buf, 0x0000008, 1000); -- msleep(2); -- //URB_FUNCTION_GET_STATUS_FROM_ENDPOINT skipped -- msleep(4); -- memcpy(buf, "\x37\x01\xfe\xdb\xc1\x33\x1f\x83", 0x0000008); -- usb_interrupt_write(devh, 0x00000002, buf, 0x0000008, 1000); -- msleep(2); -- usb_interrupt_read(devh, 0x00000081, buf, 0x0000008, 1000); -- msleep(1); -- memcpy(buf, "\x37\x0e\xb5\x9d\x3b\x8a\x91\x51", 0x0000008); -- usb_interrupt_write(devh, 0x00000002, buf, 0x0000008, 1000); -- msleep(7); -- usb_interrupt_read(devh, 0x00000081, buf, 0x0000008, 1000); -- msleep(1); -- memcpy(buf, "\x34\x87\xba\x0d\xfc\x8a\x91\x51", 0x0000008); -- usb_interrupt_write(devh, 0x00000002, buf, 0x0000008, 1000); -- msleep(7); -- usb_interrupt_read(devh, 0x00000081, buf, 0x0000008, 1000); -- msleep(8); -- usb_interrupt_read(devh, 0x00000081, buf, 0x0000008, 1000); -- msleep(8); -- usb_interrupt_read(devh, 0x00000081, buf, 0x0000008, 1000); -- msleep(8); -- usb_interrupt_read(devh, 0x00000081, buf, 0x0000008, 1000); -- msleep(8); -- usb_interrupt_read(devh, 0x00000081, buf, 0x0000008, 1000); -- msleep(8); -- usb_interrupt_read(devh, 0x00000081, buf, 0x0000008, 1000); -- msleep(8); -- usb_interrupt_read(devh, 0x00000081, buf, 0x0000008, 1000); -- msleep(8); -- usb_interrupt_read(devh, 0x00000081, buf, 0x0000008, 1000); -- msleep(8); -- usb_interrupt_read(devh, 0x00000081, buf, 0x0000008, 1000); -- msleep(8); -- usb_interrupt_read(devh, 0x00000081, buf, 0x0000008, 1000); -- msleep(8); -- usb_interrupt_read(devh, 0x00000081, buf, 0x0000008, 1000); -- msleep(8); -- usb_interrupt_read(devh, 0x00000081, buf, 0x0000008, 1000); -- msleep(8); -- usb_interrupt_read(devh, 0x00000081, buf, 0x0000008, 1000); -- msleep(8); -- usb_interrupt_read(devh, 0x00000081, buf, 0x0000008, 1000); -- msleep(8); -- usb_interrupt_read(devh, 0x00000081, buf, 0x0000008, 1000); -- msleep(8); -- usb_interrupt_read(devh, 0x00000081, buf, 0x0000008, 1000); -- msleep(8); -- usb_interrupt_read(devh, 0x00000081, buf, 0x0000008, 1000); -- msleep(8); -- usb_interrupt_read(devh, 0x00000081, buf, 0x0000008, 1000); -- msleep(8); -- usb_interrupt_read(devh, 0x00000081, buf, 0x0000008, 1000); -- msleep(8); -- usb_interrupt_read(devh, 0x00000081, buf, 0x0000008, 1000); -- msleep(8); -- usb_interrupt_read(devh, 0x00000081, buf, 0x0000008, 1000); -- msleep(8); -- usb_interrupt_read(devh, 0x00000081, buf, 0x0000008, 1000); -- msleep(8); -- usb_interrupt_read(devh, 0x00000081, buf, 0x0000008, 1000); -- msleep(8); -- usb_interrupt_read(devh, 0x00000081, buf, 0x0000008, 1000); -- msleep(8); -- usb_interrupt_read(devh, 0x00000081, buf, 0x0000008, 1000); -- msleep(8); -- usb_interrupt_read(devh, 0x00000081, buf, 0x0000008, 1000); -- msleep(8); -- usb_interrupt_read(devh, 0x00000081, buf, 0x0000008, 1000); -- msleep(8); -- usb_interrupt_read(devh, 0x00000081, buf, 0x0000008, 1000); -- msleep(8); -- usb_interrupt_read(devh, 0x00000081, buf, 0x0000008, 1000); -- msleep(8); -- usb_interrupt_read(devh, 0x00000081, buf, 0x0000008, 1000); -- msleep(8); -- usb_interrupt_read(devh, 0x00000081, buf, 0x0000008, 1000); -- msleep(8); -- usb_interrupt_read(devh, 0x00000081, buf, 0x0000008, 1000); -- msleep(8); -- usb_interrupt_read(devh, 0x00000081, buf, 0x0000008, 1000); -- msleep(8); -- usb_interrupt_read(devh, 0x00000081, buf, 0x0000008, 1000); -- msleep(8); -- usb_interrupt_read(devh, 0x00000081, buf, 0x0000008, 1000); -- msleep(8); -- usb_interrupt_read(devh, 0x00000081, buf, 0x0000008, 1000); -- msleep(8); -- usb_interrupt_read(devh, 0x00000081, buf, 0x0000008, 1000); -- msleep(8); -- usb_interrupt_read(devh, 0x00000081, buf, 0x0000008, 1000); -- msleep(8); -- usb_interrupt_read(devh, 0x00000081, buf, 0x0000008, 1000); -- msleep(8); -- usb_interrupt_read(devh, 0x00000081, buf, 0x0000008, 1000); -- msleep(8); -- usb_interrupt_read(devh, 0x00000081, buf, 0x0000008, 1000); -- msleep(8); -- usb_interrupt_read(devh, 0x00000081, buf, 0x0000008, 1000); -- msleep(8); -- usb_interrupt_read(devh, 0x00000081, buf, 0x0000008, 1000); -- msleep(8); -- usb_interrupt_read(devh, 0x00000081, buf, 0x0000008, 1000); -- msleep(8); -- usb_interrupt_read(devh, 0x00000081, buf, 0x0000008, 1000); -- msleep(8); -- usb_interrupt_read(devh, 0x00000081, buf, 0x0000008, 1000); -- msleep(8); -- usb_interrupt_read(devh, 0x00000081, buf, 0x0000008, 1000); -- msleep(8); -- usb_interrupt_read(devh, 0x00000081, buf, 0x0000008, 1000); -- msleep(8); -- usb_interrupt_read(devh, 0x00000081, buf, 0x0000008, 1000); -- msleep(8); -- usb_interrupt_read(devh, 0x00000081, buf, 0x0000008, 1000); -- msleep(8); -- usb_interrupt_read(devh, 0x00000081, buf, 0x0000008, 1000); -- msleep(8); -- usb_interrupt_read(devh, 0x00000081, buf, 0x0000008, 1000); -- msleep(8); -- usb_interrupt_read(devh, 0x00000081, buf, 0x0000008, 1000); -- msleep(8); -- usb_interrupt_read(devh, 0x00000081, buf, 0x0000008, 1000); -- msleep(8); -- usb_interrupt_read(devh, 0x00000081, buf, 0x0000008, 1000); -- msleep(8); -- usb_interrupt_read(devh, 0x00000081, buf, 0x0000008, 1000); -- msleep(8); -- usb_interrupt_read(devh, 0x00000081, buf, 0x0000008, 1000); -- msleep(8); -- usb_interrupt_read(devh, 0x00000081, buf, 0x0000008, 1000); -- msleep(8); -- usb_interrupt_read(devh, 0x00000081, buf, 0x0000008, 1000); -- msleep(8); -- usb_interrupt_read(devh, 0x00000081, buf, 0x0000008, 1000); -- msleep(8); -- usb_interrupt_read(devh, 0x00000081, buf, 0x0000008, 1000); -- msleep(8); -- usb_interrupt_read(devh, 0x00000081, buf, 0x0000008, 1000); -- msleep(8); -- usb_interrupt_read(devh, 0x00000081, buf, 0x0000008, 1000); -- msleep(8); -- usb_interrupt_read(devh, 0x00000081, buf, 0x0000008, 1000); -- msleep(8); -- usb_interrupt_read(devh, 0x00000081, buf, 0x0000008, 1000); -- msleep(8); -- usb_interrupt_read(devh, 0x00000081, buf, 0x0000008, 1000); -- msleep(8); -- usb_interrupt_read(devh, 0x00000081, buf, 0x0000008, 1000); -- msleep(8); -- usb_interrupt_read(devh, 0x00000081, buf, 0x0000008, 1000); -- msleep(8); -- usb_interrupt_read(devh, 0x00000081, buf, 0x0000008, 1000); -- msleep(8); -- usb_interrupt_read(devh, 0x00000081, buf, 0x0000008, 1000); -- msleep(8); -- usb_interrupt_read(devh, 0x00000081, buf, 0x0000008, 1000); -- msleep(8); -- usb_interrupt_read(devh, 0x00000081, buf, 0x0000008, 1000); -- msleep(8); -- usb_interrupt_read(devh, 0x00000081, buf, 0x0000008, 1000); -- msleep(1); -- //URB_FUNCTION_GET_STATUS_FROM_ENDPOINT skipped -- msleep(4); -- memcpy(buf, "\x33\x04\xfe\x00\xf4\x6c\x1f\xf0", 0x0000008); -- usb_interrupt_write(devh, 0x00000002, buf, 0x0000008, 1000); -- msleep(3); -- usb_interrupt_read(devh, 0x00000081, buf, 0x0000008, 1000); -- msleep(1); -- //URB_FUNCTION_GET_STATUS_FROM_ENDPOINT skipped -- msleep(4); -- memcpy(buf, "\x32\x07\xfe\xf0\x29\xb9\x3a\xf0", 0x0000008); -- usb_interrupt_write(devh, 0x00000002, buf, 0x0000008, 1000); -- msleep(3); -- usb_interrupt_read(devh, 0x00000081, buf, 0x0000008, 1000); -- -- if (buf) -- free (buf); -- return 0; --} -diff --git a/extras/modem-modeswitch/ma8280p_us.h b/extras/modem-modeswitch/ma8280p_us.h -deleted file mode 100644 -index bf0e304..0000000 ---- a/extras/modem-modeswitch/ma8280p_us.h -+++ /dev/null -@@ -1,24 +0,0 @@ --/* -- * Modem mode switcher -- * -- * Copyright (C) 2009 Dan Williams -- * -- * This program is free software; you can redistribute it and/or modify -- * it under the terms of the GNU General Public License as published by -- * the Free Software Foundation; either version 2 of the License, or -- * (at your option) any later version. -- * -- * This program is distributed in the hope that it will be useful, -- * but WITHOUT ANY WARRANTY; without even the implied warranty of -- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -- * GNU General Public License for more details: -- */ -- --#ifndef __MA8280P_H__ --#define __MA8280P_H__ -- --#include -- --int ma8280p_switch (struct usb_dev_handle *devh, struct usb_device *dev); -- --#endif /* __MA8280P_H__ */ -diff --git a/extras/modem-modeswitch/modem-modeswitch.c b/extras/modem-modeswitch/modem-modeswitch.c -deleted file mode 100644 -index a60ce7a..0000000 ---- a/extras/modem-modeswitch/modem-modeswitch.c -+++ /dev/null -@@ -1,266 +0,0 @@ --/* -- * Modem mode switcher -- * -- * Copyright (C) 2008 Dan Williams -- * Copyright (C) 2008 Peter Henn -- * -- * Heavily based on the 'ozerocdoff' tool by Peter Henn. -- * -- * This program is free software; you can redistribute it and/or modify -- * it under the terms of the GNU General Public License as published by -- * the Free Software Foundation; either version 2 of the License, or -- * (at your option) any later version. -- * -- * This program is distributed in the hope that it will be useful, -- * but WITHOUT ANY WARRANTY; without even the implied warranty of -- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -- * GNU General Public License for more details: -- */ -- --#include --#include --#include --#include --#include --#include --#include -- --#include -- --#include "utils.h" -- --#include "ma8280p_us.h" --#include "option.h" -- --struct usb_dev_handle *handle = NULL; -- --typedef struct usb_device * (*FindFunc) (int vid, int pid); --typedef int (*SwitchFunc) (struct usb_dev_handle *dh, struct usb_device *dev); -- --typedef enum { -- ST_UNKNOWN = 0, -- ST_OPTION_ZEROCD, -- ST_MA8280P --} SwitchType; -- --typedef struct SwitchEntry { -- SwitchType st; -- const char *clopt; -- FindFunc find_func; -- SwitchFunc switch_func; --} SwitchEntry; -- --static SwitchEntry switch_types[] = { -- { ST_OPTION_ZEROCD, "option-zerocd", option_zerocd_find, option_zerocd_switch }, -- { ST_MA8280P, "mobile-action-8280p", NULL, ma8280p_switch }, -- { ST_UNKNOWN, NULL, NULL } --}; -- --static struct usb_device * --generic_find (int vid, int pid) --{ -- struct usb_bus *bus; -- struct usb_device *dev; -- -- for (bus = usb_get_busses(); bus; bus = bus->next) { -- for (dev = bus->devices; dev; dev = dev->next) { -- if (dev->descriptor.idVendor == vid && dev->descriptor.idProduct == pid) { -- debug ("Found device '%s'", dev->filename); -- return dev; -- } -- } -- } -- return NULL; --} -- --static void --release_usb_device (int param) --{ -- usb_release_interface (handle, 0); -- usb_close (handle); --} -- --static void --print_usage (void) --{ -- printf ("Usage: modem-modeswitch [-hdq] [-l ] -v -p -t \n" -- " -h, --help show this help message\n" -- " -v, --vendor target USB vendor ID\n" -- " -p, --product target USB product ID\n" -- " -t, --type type of switch to attempt, varies by device:\n" -- " option-zerocd - For many newer Option N.V. devices\n" -- " mobile-action-8280p - For Mobile Action 8xxxP USB cables\n" -- " -l, --log log output to a file\n" -- " -q, --quiet don't print anything to stdout\n" -- " -d, --debug display debugging messages\n\n" -- "Examples:\n" -- " modem-modeswitch -v 0x0af0 -p 0xc031 -t option-zerocd\n"); --} -- --static SwitchEntry * --parse_type (const char *s) --{ -- SwitchEntry *entry = &switch_types[0]; -- -- while (entry->clopt) { -- if (!strcmp (entry->clopt, s)) -- return entry; -- entry++; -- } -- -- return NULL; --} -- --static void --do_exit (int val) --{ -- log_shutdown (); -- exit (val); --} -- --int main(int argc, char **argv) --{ -- static struct option options[] = { -- { "help", no_argument, NULL, 'h' }, -- { "vendor", required_argument, NULL, 'v' }, -- { "product", required_argument, NULL, 'p' }, -- { "type", required_argument, NULL, 't' }, -- { "log", required_argument, NULL, 'l' }, -- { "debug", no_argument, NULL, 'd' }, -- { "quiet", no_argument, NULL, 'q' }, -- { NULL, 0, NULL, 0} -- }; -- -- struct usb_device *dev; -- int vid = 0, pid = 0; -- const char *logpath = NULL; -- char buffer[256]; -- int ret, quiet = 0, debug = 0; -- SwitchEntry *sentry = NULL; -- -- while (1) { -- int option; -- -- option = getopt_long(argc, argv, "hv:p:l:t:dq", options, NULL); -- if (option == -1) -- break; -- -- switch (option) { -- case 'v': -- vid = strtol (optarg, NULL, 0); -- break; -- case 'p': -- pid = strtol (optarg, NULL, 0); -- break; -- case 't': -- sentry = parse_type (optarg); -- if (!sentry) { -- error ("unknown switch type '%s'", optarg); -- print_usage (); -- exit (1); -- } -- break; -- case 'l': -- logpath = optarg; -- break; -- case 'q': -- quiet = 1; -- break; -- case 'd': -- debug = 1; -- break; -- case 'h': -- default: -- print_usage (); -- exit (1); -- } -- } -- -- if (log_startup (logpath, debug, quiet)) { -- fprintf (stderr, "Couldn't open/create logfile %s", logpath); -- exit (2); -- } -- -- if (!sentry) { -- if (!quiet) -- print_usage (); -- else -- error ("missing device switch type."); -- do_exit (3); -- } -- -- if (!vid || !pid) { -- if (!quiet) -- print_usage (); -- else -- error ("missing vendor and device IDs."); -- do_exit (3); -- } -- -- usb_init(); -- -- if (usb_find_busses() < 0) { -- error ("no USB busses found."); -- do_exit (4); -- } -- -- if (usb_find_devices() < 0) { -- error ("no USB devices found."); -- do_exit (4); -- } -- -- if (sentry->find_func) -- dev = (*sentry->find_func) (vid, pid); -- else -- dev = generic_find (vid, pid); -- if (dev == NULL) { -- error ("no device found."); -- do_exit (5); -- } -- -- handle = usb_open (dev); -- if (handle == NULL) { -- error ("%s: could not access the device.", -- dev->filename); -- do_exit (6); -- } -- -- /* detach running default driver */ -- signal (SIGTERM, release_usb_device); -- ret = usb_get_driver_np (handle, 0, buffer, sizeof (buffer)); -- if (ret == 0) { -- debug ("%s: found already attached driver '%s'", dev->filename, buffer); -- -- ret = usb_detach_kernel_driver_np (handle, 0); -- if (ret != 0) { -- debug ("%s: error: unable to detach current driver.", dev->filename); -- usb_close (handle); -- do_exit (7); -- } -- } -- -- ret = usb_claim_interface (handle, 0); -- if (ret != 0) { -- debug ("%s: couldn't claim device's USB interface: %d.", -- dev->filename, ret); -- usb_close (handle); -- do_exit (8); -- } -- -- ret = (*sentry->switch_func) (handle, dev); -- if (ret < 0) { -- debug ("%s: failed to switch device to modem mode.", dev->filename); -- usb_release_interface (handle, 0); -- usb_close (handle); -- do_exit(9); -- } -- -- usb_release_interface (handle, 0); -- -- ret = usb_close (handle); -- if (ret < 0) -- debug ("%s: failed to close the device.", dev->filename); -- -- do_exit (0); -- return 0; --} -diff --git a/extras/modem-modeswitch/option.c b/extras/modem-modeswitch/option.c -deleted file mode 100644 -index 5b299fd..0000000 ---- a/extras/modem-modeswitch/option.c -+++ /dev/null -@@ -1,131 +0,0 @@ --/* -- * Modem mode switcher -- * -- * Copyright (C) 2008 Dan Williams -- * Copyright (C) 2008 Peter Henn -- * -- * Heavily based on the 'ozerocdoff' tool by Peter Henn. -- * -- * This program is free software; you can redistribute it and/or modify -- * it under the terms of the GNU General Public License as published by -- * the Free Software Foundation; either version 2 of the License, or -- * (at your option) any later version. -- * -- * This program is distributed in the hope that it will be useful, -- * but WITHOUT ANY WARRANTY; without even the implied warranty of -- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -- * GNU General Public License for more details: -- */ -- --#include -- --#include "utils.h" --#include "option.h" -- --/* Borrowed from /usr/include/linux/usb/ch9.h */ --#define USB_ENDPOINT_XFERTYPE_MASK 0x03 /* in bmAttributes */ --#define USB_ENDPOINT_XFER_BULK 2 --#define USB_ENDPOINT_DIR_MASK 0x80 --#define USB_DIR_OUT 0 /* to device */ --#define USB_DIR_IN 0x80 /* to host */ -- --struct usb_device * --option_zerocd_find (int vid, int pid) --{ -- struct usb_bus *bus; -- struct usb_device *dev; -- -- for (bus = usb_get_busses(); bus; bus = bus->next) { -- for (dev = bus->devices; dev; dev = dev->next) { -- if (dev->descriptor.idVendor == vid && dev->descriptor.idProduct == pid) { -- debug ("Found mass storage device:"); -- debug (" Endpoints: %d", dev->config[0].interface[0].altsetting[0].bNumEndpoints); -- debug (" Class: 0x%X", dev->config[0].interface[0].altsetting[0].bInterfaceClass); -- debug (" SubClass: 0x%X", dev->config[0].interface[0].altsetting[0].bInterfaceSubClass); -- debug (" Protocol: 0x%X", dev->config[0].interface[0].altsetting[0].bInterfaceProtocol); -- -- if ( (dev->config[0].interface[0].altsetting[0].bNumEndpoints == 2) -- && (dev->config[0].interface[0].altsetting[0].bInterfaceClass == 0x08) -- && (dev->config[0].interface[0].altsetting[0].bInterfaceSubClass == 0x06) -- && (dev->config[0].interface[0].altsetting[0].bInterfaceProtocol == 0x50) ) { -- debug ("Found modem mass storage device '%s'", dev->filename); -- return dev; -- } -- } -- } -- } -- return NULL; --} -- --static int --find_endpoints (struct usb_device *dev, int *in_ep, int *out_ep) --{ -- int i; -- -- for (i = 0; i < dev->config[0].interface[0].altsetting[0].bNumEndpoints; i++) { -- struct usb_endpoint_descriptor *ep = &(dev->config[0].interface[0].altsetting[0].endpoint[i]); -- -- if ((ep->bmAttributes & USB_ENDPOINT_XFERTYPE_MASK) == USB_ENDPOINT_XFER_BULK) { -- unsigned int direction = ep->bEndpointAddress & USB_ENDPOINT_DIR_MASK; -- -- if (!*out_ep && (direction == USB_DIR_OUT)) -- *out_ep = ep->bEndpointAddress; -- else if (!*in_ep && (direction == USB_DIR_IN)) -- *in_ep = ep->bEndpointAddress; -- } -- -- if (*in_ep && *out_ep) -- return 0; -- } -- -- return -1; --} -- --int --option_zerocd_switch (struct usb_dev_handle *dh, struct usb_device *dev) --{ -- const char const rezero_cbw[] = { -- 0x55, 0x53, 0x42, 0x43, /* bulk command signature (LE) */ -- 0x78, 0x56, 0x34, 0x12, /* bulk command host tag */ -- 0x01, 0x00, 0x00, 0x00, /* bulk command data transfer length (LE) */ -- 0x80, /* flags: direction data-in */ -- 0x00, /* LUN */ -- 0x06, /* SCSI command length */ -- 0x01, /* SCSI command: REZERO */ -- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* filler */ -- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 -- }; -- -- int ret = -1, ep_in = 0, ep_out = 0; -- char buffer[256]; -- -- /* Find the device's bulk in and out endpoints */ -- if (find_endpoints (dev, &ep_in, &ep_out) < 0) { -- debug ("%s: couldn't find correct USB endpoints.", dev->filename); -- goto out; -- } -- -- usb_clear_halt (dh, ep_out); -- ret = usb_set_altinterface (dh, 0); -- if (ret != 0) { -- debug ("%s: couldn't set device alternate interface.", dev->filename); -- goto out; -- } -- -- /* Let the mass storage device settle */ -- sleep (1); -- -- /* Send the modeswitch command */ -- ret = usb_bulk_write (dh, ep_out, (char *) rezero_cbw, sizeof (rezero_cbw), 1000); -- if (ret < 0) -- return ret; -- -- debug ("%s: REZERO command sent.", dev->filename); -- -- /* Some devices need to be read from */ -- ret = usb_bulk_read (dh, ep_in, buffer, sizeof (buffer), 1000); -- --out: -- return ret; --} -- -diff --git a/extras/modem-modeswitch/option.h b/extras/modem-modeswitch/option.h -deleted file mode 100644 -index e00dabf..0000000 ---- a/extras/modem-modeswitch/option.h -+++ /dev/null -@@ -1,29 +0,0 @@ --/* -- * Modem mode switcher -- * -- * Copyright (C) 2008 Dan Williams -- * Copyright (C) 2008 Peter Henn -- * -- * Heavily based on the 'ozerocdoff' tool by Peter Henn. -- * -- * This program is free software; you can redistribute it and/or modify -- * it under the terms of the GNU General Public License as published by -- * the Free Software Foundation; either version 2 of the License, or -- * (at your option) any later version. -- * -- * This program is distributed in the hope that it will be useful, -- * but WITHOUT ANY WARRANTY; without even the implied warranty of -- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -- * GNU General Public License for more details: -- */ -- --#ifndef __OPTION_H__ --#define __OPTION_H__ -- --#include -- --struct usb_device *option_zerocd_find (int vid, int pid); -- --int option_zerocd_switch (struct usb_dev_handle *dh, struct usb_device *dev); -- --#endif /* __OPTION_H__ */ -diff --git a/extras/modem-modeswitch/utils.c b/extras/modem-modeswitch/utils.c -deleted file mode 100644 -index 37d0df4..0000000 ---- a/extras/modem-modeswitch/utils.c -+++ /dev/null -@@ -1,83 +0,0 @@ --/* -- * Modem mode switcher -- * -- * Copyright (C) 2009 Dan Williams -- * -- * This program is free software; you can redistribute it and/or modify -- * it under the terms of the GNU General Public License as published by -- * the Free Software Foundation; either version 2 of the License, or -- * (at your option) any later version. -- * -- * This program is distributed in the hope that it will be useful, -- * but WITHOUT ANY WARRANTY; without even the implied warranty of -- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -- * GNU General Public License for more details: -- */ -- --#include --#include --#include --#include --#include --#include -- --#include "utils.h" -- --static int debug_on = 0; --static int quiet = 0; --FILE *logfile = NULL; -- --void --do_log (int level, const char *fmt, ...) --{ -- va_list args; -- char buffer[1024]; -- char tag = 'L'; -- -- if (level >= LOG_DBG && !debug_on) -- return; -- -- va_start (args, fmt); -- vsnprintf (buffer, sizeof (buffer), fmt, args); -- va_end (args); -- -- if (level == LOG_ERR) -- tag = 'E'; -- else if (level == LOG_MSG) -- tag = 'L'; -- else if (level == LOG_DBG) -- tag = 'D'; -- -- if (logfile) -- fprintf (logfile, "%c: %s\n", tag, buffer); -- if (!quiet) -- fprintf ((level == LOG_ERR) ? stderr : stdout, "%c: %s\n", tag, buffer); --} -- --int --log_startup (const char *path, int do_debug, int be_quiet) --{ -- time_t t; -- -- quiet = be_quiet; -- debug_on = do_debug; -- -- if (!path) -- return 0; -- -- logfile = fopen (path, "a+"); -- if (!logfile) -- return 1; -- -- t = time (NULL); -- message ("\n**** Started: %s\n", ctime (&t)); -- return 0; --} -- --void --log_shutdown (void) --{ -- if (logfile) -- fclose (logfile); --} -- -diff --git a/extras/modem-modeswitch/utils.h b/extras/modem-modeswitch/utils.h -deleted file mode 100644 -index 1ef557a..0000000 ---- a/extras/modem-modeswitch/utils.h -+++ /dev/null -@@ -1,32 +0,0 @@ --/* -- * Modem mode switcher -- * -- * Copyright (C) 2009 Dan Williams -- * -- * This program is free software; you can redistribute it and/or modify -- * it under the terms of the GNU General Public License as published by -- * the Free Software Foundation; either version 2 of the License, or -- * (at your option) any later version. -- * -- * This program is distributed in the hope that it will be useful, -- * but WITHOUT ANY WARRANTY; without even the implied warranty of -- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -- * GNU General Public License for more details: -- */ -- --#ifndef __UTILS_H__ --#define __UTILS_H__ -- --#define LOG_ERR 0 --#define LOG_MSG 1 --#define LOG_DBG 2 -- --#define message(fmt, args...) do_log (LOG_MSG, fmt, ##args); --#define error(fmt, args...) do_log (LOG_ERR, fmt, ##args); --#define debug(fmt, args...) do_log (LOG_DBG, fmt, ##args); -- --void do_log (int level, const char *fmt, ...); --int log_startup (const char *path, int do_debug, int be_quiet); --void log_shutdown (void); -- --#endif /* __UTILS_H__ */ --- -1.6.6 - diff --git a/0037-rules-virtio-fix-is-to-check-if-the-name-attribute-i.patch b/0037-rules-virtio-fix-is-to-check-if-the-name-attribute-i.patch deleted file mode 100644 index bc8aa52..0000000 --- a/0037-rules-virtio-fix-is-to-check-if-the-name-attribute-i.patch +++ /dev/null @@ -1,28 +0,0 @@ -From 00e43e357ea709d8c1def0aed13192abbf9ac193 Mon Sep 17 00:00:00 2001 -From: Amit Shah -Date: Mon, 22 Mar 2010 10:59:46 +0100 -Subject: [PATCH 37/65] rules: virtio - fix is to check if the 'name' attribute is present - -Fix provided by Harald Hoyer. - -Signed-off-by: Amit Shah ---- - rules/rules.d/50-udev-default.rules | 2 +- - 1 files changed, 1 insertions(+), 1 deletions(-) - -diff --git a/rules/rules.d/50-udev-default.rules b/rules/rules.d/50-udev-default.rules -index da1535f..e8116a3 100644 ---- a/rules/rules.d/50-udev-default.rules -+++ b/rules/rules.d/50-udev-default.rules -@@ -18,7 +18,7 @@ KERNEL=="mwave", GROUP="dialout" - KERNEL=="hvc*|hvsi*", GROUP="dialout" - - # virtio serial / console ports --KERNEL=="vport*", SYMLINK+="virtio-ports/$attr{name}" -+KERNEL=="vport*", ATTR{name}=="?*", SYMLINK+="virtio-ports/$attr{name}" - - # mem - KERNEL=="null|zero|full|random|urandom", MODE="0666" --- -1.6.6 - diff --git a/0038-keymap-Add-Acer-TravelMate-6593G-and-Acer-Aspire-164.patch b/0038-keymap-Add-Acer-TravelMate-6593G-and-Acer-Aspire-164.patch deleted file mode 100644 index 56aaa23..0000000 --- a/0038-keymap-Add-Acer-TravelMate-6593G-and-Acer-Aspire-164.patch +++ /dev/null @@ -1,25 +0,0 @@ -From 5b6172b1d9b5d582d05ea89985efd0ea7a0c8ad7 Mon Sep 17 00:00:00 2001 -From: Martin Pitt -Date: Wed, 24 Mar 2010 17:44:39 +0100 -Subject: [PATCH 38/65] keymap: Add Acer TravelMate 6593G and Acer Aspire 1640 - -https://launchpad.net/bugs/536914 ---- - extras/keymap/95-keymap.rules | 1 + - 1 files changed, 1 insertions(+), 0 deletions(-) - -diff --git a/extras/keymap/95-keymap.rules b/extras/keymap/95-keymap.rules -index 65b0d6e..b3b08ae 100644 ---- a/extras/keymap/95-keymap.rules -+++ b/extras/keymap/95-keymap.rules -@@ -78,6 +78,7 @@ ENV{DMI_VENDOR}=="Acer*", RUN+="keymap $name acer" - ENV{DMI_VENDOR}=="Acer*", ATTR{[dmi/id]product_name}=="Extensa*", ATTR{[dmi/id]product_name}=="*5210*|*5220*|*5610*|*5620*|*5720*", RUN+="keymap $name 0xEE screenlock" - ENV{DMI_VENDOR}=="Acer*", ATTR{[dmi/id]product_name}=="TravelMate*C300*", RUN+="keymap $name acer-travelmate_c300" - ENV{DMI_VENDOR}=="Acer*", ATTR{[dmi/id]product_name}=="TravelMate*6292*|TravelMate*8471*|Aspire 1810T*|AO751h|AO531h", RUN+="keymap $name 0xD9 bluetooth" -+ENV{DMI_VENDOR}=="Acer*", ATTR{[dmi/id]product_name}=="TravelMate 6593|Aspire 1640", RUN+="keymap $name 0xB2 www" - ENV{DMI_VENDOR}=="Acer*", ATTR{[dmi/id]product_name}=="Aspire 6920", RUN+="keymap $name acer-aspire_6920" - ENV{DMI_VENDOR}=="Acer*", ATTR{[dmi/id]product_name}=="Aspire 5920G", RUN+="keymap $name acer-aspire_5920g" - ENV{DMI_VENDOR}=="Acer*", ATTR{[dmi/id]product_name}=="Aspire 5720*", RUN+="keymap $name acer-aspire_5720" --- -1.6.6 - diff --git a/0040-libudev-update-documentation.patch b/0040-libudev-update-documentation.patch deleted file mode 100644 index 3b404c8..0000000 --- a/0040-libudev-update-documentation.patch +++ /dev/null @@ -1,108 +0,0 @@ -From dbba7e4029e2eb8157232e6b5ddd9ee0f68b51b5 Mon Sep 17 00:00:00 2001 -From: Kay Sievers -Date: Thu, 25 Mar 2010 16:45:15 +0100 -Subject: [PATCH 40/65] libudev: update documentation - ---- - libudev/docs/libudev-docs.xml | 2 +- - libudev/libudev-device.c | 14 ++++++-------- - libudev/libudev.c | 14 +++++++------- - 3 files changed, 14 insertions(+), 16 deletions(-) - -diff --git a/libudev/docs/libudev-docs.xml b/libudev/docs/libudev-docs.xml -index b037281..f470916 100644 ---- a/libudev/docs/libudev-docs.xml -+++ b/libudev/docs/libudev-docs.xml -@@ -9,7 +9,7 @@ - libudev Reference Manual - for libudev version &version; - -- 2009 -+ 2009-2010 - Kay Sievers <kay.sievers@vrfy.org> - - -diff --git a/libudev/libudev-device.c b/libudev/libudev-device.c -index fe45880..410f75b 100644 ---- a/libudev/libudev-device.c -+++ b/libudev/libudev-device.c -@@ -463,10 +463,9 @@ struct udev_device *udev_device_new_from_syspath(struct udev *udev, const char * - * @devnum: device major/minor number - * - * Create new udev device, and fill in information from the sys -- * device and the udev database entry. The device is looked up -- * by its major/minor number. Character and block device numbers -- * are not unique across the two types, they do not share the same -- * range of numbers. -+ * device and the udev database entry. The device is looked-up -+ * by its major/minor number and type. Character and block device -+ * numbers are not unique across the two types. - * - * The initial refcount is 1, and needs to be decremented to - * release the resources of the udev device. -@@ -497,10 +496,9 @@ struct udev_device *udev_device_new_from_devnum(struct udev *udev, char type, de - * @subsystem: the subsystem of the device - * @sysname: the name of the device - * -- * Create new udev device, and fill in information from the sys -- * device and the udev database entry. The device is looked up -- * by the subsystem and name string of the device, like "mem", -- * "zero", or "block", "sda". -+ * Create new udev device, and fill in information from the sys device -+ * and the udev database entry. The device is looked up by the subsystem -+ * and name string of the device, like "mem" / "zero", or "block" / "sda". - * - * The initial refcount is 1, and needs to be decremented to - * release the resources of the udev device. -diff --git a/libudev/libudev.c b/libudev/libudev.c -index 411e9ae..0ae5a91 100644 ---- a/libudev/libudev.c -+++ b/libudev/libudev.c -@@ -1,7 +1,7 @@ - /* - * libudev - interface to udev device information - * -- * Copyright (C) 2008-2009 Kay Sievers -+ * Copyright (C) 2008-2010 Kay Sievers - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public -@@ -71,7 +71,7 @@ static void log_stderr(struct udev *udev, - * @udev: udev library context - * - * Retrieve stored data pointer from library context. This might be useful -- * to access from callbacks. -+ * to access from callbacks like a custom logging function. - * - * Returns: stored userdata - **/ -@@ -321,10 +321,10 @@ void udev_set_log_fn(struct udev *udev, - * udev_get_log_priority: - * @udev: udev library context - * -- * The initial syslog priority is read from the udev config file -+ * The initial logging priority is read from the udev config file - * at startup. - * -- * Returns: the current syslog priority -+ * Returns: the current logging priority - **/ - int udev_get_log_priority(struct udev *udev) - { -@@ -334,10 +334,10 @@ int udev_get_log_priority(struct udev *udev) - /** - * udev_set_log_priority: - * @udev: udev library context -- * @priority: the new syslog priority -+ * @priority: the new logging priority - * -- * Set the current syslog priority. The value controls which messages -- * are send to syslog. -+ * Set the current logging priority. The value controls which messages -+ * are logged. - **/ - void udev_set_log_priority(struct udev *udev, int priority) - { --- -1.6.6 - diff --git a/0041-Fix-Keymapping-for-upcoming-Dell-Laptops.patch b/0041-Fix-Keymapping-for-upcoming-Dell-Laptops.patch deleted file mode 100644 index c7a2394..0000000 --- a/0041-Fix-Keymapping-for-upcoming-Dell-Laptops.patch +++ /dev/null @@ -1,50 +0,0 @@ -From 233a922112408c7ed49bd72e73be228e231d46ba Mon Sep 17 00:00:00 2001 -From: Jerone Young -Date: Wed, 24 Mar 2010 20:14:23 -0500 -Subject: [PATCH 41/65] Fix Keymapping for upcoming Dell Laptops - -This patch fixes it so that new upcoming Dell machines will work -correctly if users presses the touchpad toggle key. - -Currently 0xD8 is being mapped to sleep. Though this is only done by the -Latitude XT* laptops. Many upcoming Laptops from Dell are mapping this -key to "toogle touchpad off" .. giving the OS notification that it has -just turned off the touchpad. - -Though their is an issue in that if this key is mapped the hardware -first toogles .. then the software tries to do the samething after, if -they fall out of sync ... no more touchpad. So leave out mapping these -keys for now. - -Signed-off-by: Jerone Young -Signed-off-by: Martin Pitt ---- - extras/keymap/95-keymap.rules | 1 + - extras/keymap/keymaps/dell | 1 - - 2 files changed, 1 insertions(+), 1 deletions(-) - -diff --git a/extras/keymap/95-keymap.rules b/extras/keymap/95-keymap.rules -index dd58453..af39c21 100644 ---- a/extras/keymap/95-keymap.rules -+++ b/extras/keymap/95-keymap.rules -@@ -54,6 +54,7 @@ LABEL="keyboard_vendorcheck" - - ENV{DMI_VENDOR}=="Dell*", RUN+="keymap $name dell" - ENV{DMI_VENDOR}=="Dell*", ATTR{[dmi/id]product_name}=="Inspiron 1011", RUN+="keymap $name 0x84 wlan" -+ENV{DMI_VENDOR}=="Dell*", ATTR{[dmi/id]product_name}=="Latitude XT*", RUN+="keymap $name 0xD8 screenlock" - - ENV{DMI_VENDOR}=="Compaq*", ATTR{[dmi/id]product_name}=="*E500*|*Evo N*", RUN+="keymap $name compaq-e_evo" - -diff --git a/extras/keymap/keymaps/dell b/extras/keymap/keymaps/dell -index 5ff44d6..84e5b4e 100644 ---- a/extras/keymap/keymaps/dell -+++ b/extras/keymap/keymaps/dell -@@ -23,5 +23,4 @@ - 0x9B switchvideomode # Display Toggle button - 0xA2 playpause # Front panel play/pause - 0xA4 stopcd # Front panel stop --0xD8 screenlock # FIXME: Tablet lock button - 0xED media # MediaDirect button --- -1.6.6 - diff --git a/0042-Add-new-Dell-touchpad-keycode.patch b/0042-Add-new-Dell-touchpad-keycode.patch deleted file mode 100644 index c63b194..0000000 --- a/0042-Add-new-Dell-touchpad-keycode.patch +++ /dev/null @@ -1,32 +0,0 @@ -From e22aa83ba0b09796d02ebe831a4a66ab7d9f5c1e Mon Sep 17 00:00:00 2001 -From: Jerone Young -Date: Mon, 5 Apr 2010 18:45:34 -0500 -Subject: [PATCH 42/65] Add new Dell touchpad keycode - -After working very closely with Dell. They have now completely changed -the way they have implemented there touchpad hotkey for upcoming -machines. - -It now only generates a single keycode (0xD9). It nolonger does anything -in hardware, nor does it generate more then this keycode. - -This patch properly maps this keycode. - -Signed-off-by: Jerone Young -Signed-off-by: Martin Pitt ---- - extras/keymap/keymaps/dell | 1 + - 1 files changed, 1 insertions(+), 0 deletions(-) - -diff --git a/extras/keymap/keymaps/dell b/extras/keymap/keymaps/dell -index 84e5b4e..f90a4fd 100644 ---- a/extras/keymap/keymaps/dell -+++ b/extras/keymap/keymaps/dell -@@ -24,3 +24,4 @@ - 0xA2 playpause # Front panel play/pause - 0xA4 stopcd # Front panel stop - 0xED media # MediaDirect button -+0xD9 f22 # touchpad toggle --- -1.6.6 - diff --git a/0043-Revert-special-casing-0xD8-to-latitude-XT-only.patch b/0043-Revert-special-casing-0xD8-to-latitude-XT-only.patch deleted file mode 100644 index e2b6474..0000000 --- a/0043-Revert-special-casing-0xD8-to-latitude-XT-only.patch +++ /dev/null @@ -1,42 +0,0 @@ -From 5fa8992c9c2e756aefe84a41f00c7a2555e8d975 Mon Sep 17 00:00:00 2001 -From: Jerone Young -Date: Mon, 5 Apr 2010 18:45:35 -0500 -Subject: [PATCH 43/65] Revert special casing 0xD8 to latitude XT only - -Now that Dell has changed the functionality of upcoming machines with -touchpad toggle to only use keycode 0xD9 .. and not 0xD8 & 0xD9. It -seems best to add this back to the general map of Dell buttons. Just -incase a machine in the future uses this later. - -Signed-off-by: Jerone Young -Signed-off-by: Martin Pitt ---- - extras/keymap/95-keymap.rules | 1 - - extras/keymap/keymaps/dell | 1 + - 2 files changed, 1 insertions(+), 1 deletions(-) - -diff --git a/extras/keymap/95-keymap.rules b/extras/keymap/95-keymap.rules -index af39c21..dd58453 100644 ---- a/extras/keymap/95-keymap.rules -+++ b/extras/keymap/95-keymap.rules -@@ -54,7 +54,6 @@ LABEL="keyboard_vendorcheck" - - ENV{DMI_VENDOR}=="Dell*", RUN+="keymap $name dell" - ENV{DMI_VENDOR}=="Dell*", ATTR{[dmi/id]product_name}=="Inspiron 1011", RUN+="keymap $name 0x84 wlan" --ENV{DMI_VENDOR}=="Dell*", ATTR{[dmi/id]product_name}=="Latitude XT*", RUN+="keymap $name 0xD8 screenlock" - - ENV{DMI_VENDOR}=="Compaq*", ATTR{[dmi/id]product_name}=="*E500*|*Evo N*", RUN+="keymap $name compaq-e_evo" - -diff --git a/extras/keymap/keymaps/dell b/extras/keymap/keymaps/dell -index f90a4fd..6443b4b 100644 ---- a/extras/keymap/keymaps/dell -+++ b/extras/keymap/keymaps/dell -@@ -24,4 +24,5 @@ - 0xA2 playpause # Front panel play/pause - 0xA4 stopcd # Front panel stop - 0xED media # MediaDirect button -+0xD8 screenlock # FIXME: Tablet lock button - 0xD9 f22 # touchpad toggle --- -1.6.6 - diff --git a/0044-Fix-Dell-Studio-1558-volume-keys-not-releasing.patch b/0044-Fix-Dell-Studio-1558-volume-keys-not-releasing.patch deleted file mode 100644 index 3d7c051..0000000 --- a/0044-Fix-Dell-Studio-1558-volume-keys-not-releasing.patch +++ /dev/null @@ -1,30 +0,0 @@ -From f8ede05d7ad5286039319bcb188e86b9117551e2 Mon Sep 17 00:00:00 2001 -From: Jerone Young -Date: Tue, 6 Apr 2010 12:59:12 -0500 -Subject: [PATCH 44/65] Fix Dell Studio 1558 volume keys not releasing - -This patch fixes the Dell Studio 1558 to give a key release when a -volume key is pressed. This is the same as the 1557. - -Signed-off-by: Jerone Young -Signed-off-by: Martin Pitt ---- - extras/keymap/95-keyboard-force-release.rules | 2 +- - 1 files changed, 1 insertions(+), 1 deletions(-) - -diff --git a/extras/keymap/95-keyboard-force-release.rules b/extras/keymap/95-keyboard-force-release.rules -index 28639a5..f0e1ab8 100644 ---- a/extras/keymap/95-keyboard-force-release.rules -+++ b/extras/keymap/95-keyboard-force-release.rules -@@ -21,7 +21,7 @@ ENV{DMI_VENDOR}="$attr{[dmi/id]sys_vendor}" - - ENV{DMI_VENDOR}=="[sS][aA][mM][sS][uU][nN][gG]*", ATTR{[dmi/id]product_name}=="*N130*|*N140*|*SR70S/SR71S*|*Q210/P210*", RUN+="keyboard-force-release.sh $devpath samsung-other" - --ENV{DMI_VENDOR}=="Dell Inc.", ATTR{[dmi/id]product_name}=="Studio 1557", RUN+="keyboard-force-release.sh $devpath dell-studio-1557" -+ENV{DMI_VENDOR}=="Dell Inc.", ATTR{[dmi/id]product_name}=="Studio 1557|Studio 1558", RUN+="keyboard-force-release.sh $devpath dell-studio-1557" - - ENV{DMI_VENDOR}=="FUJITSU SIEMENS", ATTR{[dmi/id]product_name}=="AMILO Si 1848+u", RUN+="keyboard-force-release.sh $devpath fujitsu-amilo-si1848" - --- -1.6.6 - diff --git a/0045-Add-support-for-another-Dell-touchpad-toggle-key.patch b/0045-Add-support-for-another-Dell-touchpad-toggle-key.patch deleted file mode 100644 index fae1ca8..0000000 --- a/0045-Add-support-for-another-Dell-touchpad-toggle-key.patch +++ /dev/null @@ -1,29 +0,0 @@ -From 6de84dee053a74c95f2200d6d94cfeb61516bc40 Mon Sep 17 00:00:00 2001 -From: Jerone Young -Date: Tue, 6 Apr 2010 16:08:21 -0500 -Subject: [PATCH 45/65] Add support for another Dell touchpad toggle key - -There is another keycode that some Dell machines that are about to ship, -or shipping are using for touchpad toggle. That code is 0x9E. - -Signed-off-by: Jerone Young -Signed-off-by: Martin Pitt ---- - extras/keymap/keymaps/dell | 1 + - 1 files changed, 1 insertions(+), 0 deletions(-) - -diff --git a/extras/keymap/keymaps/dell b/extras/keymap/keymaps/dell -index 6443b4b..1a2e433 100644 ---- a/extras/keymap/keymaps/dell -+++ b/extras/keymap/keymaps/dell -@@ -21,6 +21,7 @@ - 0x99 nextsong # Front panel next song - 0x9A setup # Tablet tools button - 0x9B switchvideomode # Display Toggle button -+0x9E f22 #touchpad toggle - 0xA2 playpause # Front panel play/pause - 0xA4 stopcd # Front panel stop - 0xED media # MediaDirect button --- -1.6.6 - diff --git a/0047-scsi_id-add-rand-in-retry-loop.patch b/0047-scsi_id-add-rand-in-retry-loop.patch deleted file mode 100644 index c58beb4..0000000 --- a/0047-scsi_id-add-rand-in-retry-loop.patch +++ /dev/null @@ -1,45 +0,0 @@ -From 1c8dc990dc20efbd6cd8e56a57c0fa567c2d6fc8 Mon Sep 17 00:00:00 2001 -From: Kay Sievers -Date: Wed, 7 Apr 2010 09:22:30 +0200 -Subject: [PATCH 47/65] scsi_id: add rand() in retry loop - ---- - extras/scsi_id/scsi_serial.c | 14 +++++++------- - 1 files changed, 7 insertions(+), 7 deletions(-) - -diff --git a/extras/scsi_id/scsi_serial.c b/extras/scsi_id/scsi_serial.c -index 0c9d9c3..8752e14 100644 ---- a/extras/scsi_id/scsi_serial.c -+++ b/extras/scsi_id/scsi_serial.c -@@ -863,21 +863,21 @@ int scsi_get_serial(struct udev *udev, - { - unsigned char page0[SCSI_INQ_BUFF_LEN]; - int fd = -1; -- int cnt = 10; -+ int cnt; - int ind; - int retval; - - memset(dev_scsi->serial, 0, len); - dbg(udev, "opening %s\n", devname); -- while (--cnt) { -- const struct timespec duration = { 0, 500 * 1000 * 1000 }; -+ srand((unsigned int)getpid()); -+ for (cnt = 20; cnt > 0; cnt--) { -+ struct timespec duration; - - fd = open(devname, O_RDONLY | O_NONBLOCK); -- if (fd >= 0) -- break; -- info(udev, "%s: cannot open %s: %s\n", dev_scsi->kernel, devname, strerror(errno)); -- if (errno != EBUSY) -+ if (fd >= 0 || errno != EBUSY) - break; -+ duration.tv_sec = 0; -+ duration.tv_nsec = (200 * 1000 * 1000) + (rand() % 100 * 1000 * 1000); - nanosleep(&duration, NULL); - } - if (fd < 0) --- -1.6.6 - diff --git a/0048-cdrom_id-remove-debugging-code.patch b/0048-cdrom_id-remove-debugging-code.patch deleted file mode 100644 index 57a4e07..0000000 --- a/0048-cdrom_id-remove-debugging-code.patch +++ /dev/null @@ -1,24 +0,0 @@ -From 36a07a8c34a4cff5ad2bbb6e0fdfed49e8191661 Mon Sep 17 00:00:00 2001 -From: Harald Hoyer -Date: Wed, 7 Apr 2010 09:23:46 +0200 -Subject: [PATCH 48/65] cdrom_id: remove debugging code - ---- - extras/cdrom_id/cdrom_id.c | 1 - - 1 files changed, 0 insertions(+), 1 deletions(-) - -diff --git a/extras/cdrom_id/cdrom_id.c b/extras/cdrom_id/cdrom_id.c -index e485768..036ef28 100644 ---- a/extras/cdrom_id/cdrom_id.c -+++ b/extras/cdrom_id/cdrom_id.c -@@ -126,7 +126,6 @@ static int is_mounted(const char *device) - if (fp == NULL) - return -ENOSYS; - while (fscanf(fp, "%*s %*s %i:%i %*[^\n]", &maj, &min) == 2) { -- printf("got %u %u\n", maj, min); - if (makedev(maj, min) == statbuf.st_rdev) { - mounted = 1; - break; --- -1.6.6 - diff --git a/0049-cdrom_id-retry-to-open-the-device-if-EBUSY.patch b/0049-cdrom_id-retry-to-open-the-device-if-EBUSY.patch deleted file mode 100644 index f7e6b27..0000000 --- a/0049-cdrom_id-retry-to-open-the-device-if-EBUSY.patch +++ /dev/null @@ -1,53 +0,0 @@ -From cccfffbe04c01be12fb42cb12f3f7aa5e2a22dd4 Mon Sep 17 00:00:00 2001 -From: Kay Sievers -Date: Wed, 7 Apr 2010 09:24:25 +0200 -Subject: [PATCH 49/65] cdrom_id: retry to open the device, if EBUSY - -We might fight about the device with polling processes, or other -users who probe the device. Retry a few times if the other one goes -away in the meantime. - -Based on a patch from Harald Hoyer. ---- - extras/cdrom_id/cdrom_id.c | 18 +++++++++++++++++- - 1 files changed, 17 insertions(+), 1 deletions(-) - -diff --git a/extras/cdrom_id/cdrom_id.c b/extras/cdrom_id/cdrom_id.c -index 036ef28..7c9f8cc 100644 ---- a/extras/cdrom_id/cdrom_id.c -+++ b/extras/cdrom_id/cdrom_id.c -@@ -30,6 +30,7 @@ - #include - #include - #include -+#include - #include - #include - #include -@@ -591,7 +592,22 @@ int main(int argc, char *argv[]) - goto exit; - } - -- fd = open(node, O_RDONLY|O_NONBLOCK|(is_mounted(node) ? 0 : O_EXCL)); -+ if (is_mounted(node)) { -+ fd = open(node, O_RDONLY|O_NONBLOCK); -+ } else { -+ int cnt; -+ struct timespec duration; -+ -+ srand((unsigned int)getpid()); -+ for (cnt = 40; cnt > 0; cnt--) { -+ fd = open(node, O_RDONLY|O_NONBLOCK|O_EXCL); -+ if (fd >= 0 || errno != EBUSY) -+ break; -+ duration.tv_sec = 0; -+ duration.tv_nsec = (100 * 1000 * 1000) + (rand() % 100 * 1000 * 1000); -+ nanosleep(&duration, NULL); -+ } -+ } - if (fd < 0) { - info(udev, "unable to open '%s'\n", node); - fprintf(stderr, "unable to open '%s'\n", node); --- -1.6.6 - diff --git a/0050-cdrom_id-check-mount-state-in-retry-loop.patch b/0050-cdrom_id-check-mount-state-in-retry-loop.patch deleted file mode 100644 index b4fb62b..0000000 --- a/0050-cdrom_id-check-mount-state-in-retry-loop.patch +++ /dev/null @@ -1,55 +0,0 @@ -From d45c8c8b01c99180f15e24b22f7cf81eaf3cdd1b Mon Sep 17 00:00:00 2001 -From: Kay Sievers -Date: Wed, 7 Apr 2010 11:32:22 +0200 -Subject: [PATCH 50/65] cdrom_id: check mount state in retry loop - -Based on a patch from Harald Hoyer. ---- - extras/cdrom_id/cdrom_id.c | 22 +++++++++------------- - 1 files changed, 9 insertions(+), 13 deletions(-) - -diff --git a/extras/cdrom_id/cdrom_id.c b/extras/cdrom_id/cdrom_id.c -index 7c9f8cc..894a890 100644 ---- a/extras/cdrom_id/cdrom_id.c -+++ b/extras/cdrom_id/cdrom_id.c -@@ -547,6 +547,7 @@ int main(int argc, char *argv[]) - const char *node = NULL; - int export = 0; - int fd = -1; -+ int cnt; - int rc = 0; - - udev = udev_new(); -@@ -592,21 +593,16 @@ int main(int argc, char *argv[]) - goto exit; - } - -- if (is_mounted(node)) { -- fd = open(node, O_RDONLY|O_NONBLOCK); -- } else { -- int cnt; -+ srand((unsigned int)getpid()); -+ for (cnt = 20; cnt > 0; cnt--) { - struct timespec duration; - -- srand((unsigned int)getpid()); -- for (cnt = 40; cnt > 0; cnt--) { -- fd = open(node, O_RDONLY|O_NONBLOCK|O_EXCL); -- if (fd >= 0 || errno != EBUSY) -- break; -- duration.tv_sec = 0; -- duration.tv_nsec = (100 * 1000 * 1000) + (rand() % 100 * 1000 * 1000); -- nanosleep(&duration, NULL); -- } -+ fd = open(node, O_RDONLY|O_NONBLOCK|(is_mounted(node) ? 0 : O_EXCL)); -+ if (fd >= 0 || errno != EBUSY) -+ break; -+ duration.tv_sec = 0; -+ duration.tv_nsec = (100 * 1000 * 1000) + (rand() % 100 * 1000 * 1000); -+ nanosleep(&duration, NULL); - } - if (fd < 0) { - info(udev, "unable to open '%s'\n", node); --- -1.6.6 - diff --git a/0051-cdrom_id-always-set-ID_CDROM-regardless-if-we-can-ru.patch b/0051-cdrom_id-always-set-ID_CDROM-regardless-if-we-can-ru.patch deleted file mode 100644 index 1d3be0e..0000000 --- a/0051-cdrom_id-always-set-ID_CDROM-regardless-if-we-can-ru.patch +++ /dev/null @@ -1,31 +0,0 @@ -From 5c5ebde711c4560ae0560e87c33fe477b5add354 Mon Sep 17 00:00:00 2001 -From: Kay Sievers -Date: Mon, 12 Apr 2010 01:12:23 +0200 -Subject: [PATCH 51/65] cdrom_id: always set ID_CDROM regardless if we can run cdrom_id - ---- - extras/cdrom_id/60-cdrom_id.rules | 12 +++++++++--- - 1 files changed, 9 insertions(+), 3 deletions(-) - -diff --git a/extras/cdrom_id/60-cdrom_id.rules b/extras/cdrom_id/60-cdrom_id.rules -index 132a680..811c4aa 100644 ---- a/extras/cdrom_id/60-cdrom_id.rules -+++ b/extras/cdrom_id/60-cdrom_id.rules -@@ -1,5 +1,11 @@ - # do not edit this file, it will be overwritten on update - --# import optical drive properties --ACTION=="add|change", SUBSYSTEM=="block", ENV{DEVTYPE}=="disk", \ -- KERNEL=="sr[0-9]*|xvd*", IMPORT{program}="cdrom_id --export $tempnode" -+ACTION!="add|change", GOTO="cdrom_end" -+SUBSYSTEM!="block", GOTO="cdrom_end" -+KERNEL!="sr[0-9]*|xvd*", GOTO="cdrom_end" -+ENV{DEVTYPE}!="disk", GOTO="cdrom_end" -+ -+ENV{ID_CDROM}="1" -+IMPORT{program}="cdrom_id --export $tempnode" -+ -+LABEL="cdrom_end" --- -1.6.6 - diff --git a/0052-rules-delete-outdated-packagees-rules.patch b/0052-rules-delete-outdated-packagees-rules.patch deleted file mode 100644 index eb65f78..0000000 --- a/0052-rules-delete-outdated-packagees-rules.patch +++ /dev/null @@ -1,124 +0,0 @@ -From a971fb4d58aee946e151b315453fdd1b18331402 Mon Sep 17 00:00:00 2001 -From: Kay Sievers -Date: Mon, 12 Apr 2010 10:45:27 +0200 -Subject: [PATCH 52/65] rules: delete outdated packagees rules - ---- - rules/packages/40-infiniband.rules | 9 -------- - rules/packages/40-isdn.rules | 4 --- - rules/packages/40-zaptel.rules | 7 ------ - rules/packages/64-device-mapper.rules | 4 --- - rules/packages/64-md-raid.rules | 36 --------------------------------- - rules/suse/64-device-mapper.rules | 2 - - 6 files changed, 0 insertions(+), 62 deletions(-) - delete mode 100644 rules/packages/40-infiniband.rules - delete mode 100644 rules/packages/40-isdn.rules - delete mode 100644 rules/packages/40-zaptel.rules - delete mode 100644 rules/packages/64-device-mapper.rules - delete mode 100644 rules/packages/64-md-raid.rules - -diff --git a/rules/packages/40-infiniband.rules b/rules/packages/40-infiniband.rules -deleted file mode 100644 -index e2e4748..0000000 ---- a/rules/packages/40-infiniband.rules -+++ /dev/null -@@ -1,9 +0,0 @@ --# do not edit this file, it will be overwritten on update -- --KERNEL=="umad[0-9]*", NAME="infiniband/%k" --KERNEL=="issm[0-9]*", NAME="infiniband/%k" --KERNEL=="ucm[0-9]*", NAME="infiniband/%k", MODE="0666" --KERNEL=="uverbs[0-9]*", NAME="infiniband/%k", MODE="0666" --KERNEL=="uat", NAME="infiniband/%k", MODE="0666" --KERNEL=="ucma", NAME="infiniband/%k", MODE="0666" --KERNEL=="rdma_cm", NAME="infiniband/%k", MODE="0666" -diff --git a/rules/packages/40-isdn.rules b/rules/packages/40-isdn.rules -deleted file mode 100644 -index 1a31cb6..0000000 ---- a/rules/packages/40-isdn.rules -+++ /dev/null -@@ -1,4 +0,0 @@ --# do not edit this file, it will be overwritten on update -- --SUBSYSTEM=="capi", KERNEL=="capi", NAME="capi20", GROUP="dialout" --SUBSYSTEM=="tty", KERNEL=="capi[0-9]*", NAME="capi/%n" -diff --git a/rules/packages/40-zaptel.rules b/rules/packages/40-zaptel.rules -deleted file mode 100644 -index cbd8b8a..0000000 ---- a/rules/packages/40-zaptel.rules -+++ /dev/null -@@ -1,7 +0,0 @@ --# do not edit this file, it will be overwritten on update -- --KERNEL=="zap[0-9]*", NAME="zap/%n", GROUP="dialout" --KERNEL=="zapchannel", NAME="zap/channel", GROUP="dialout" --KERNEL=="zapctl", NAME="zap/ctl", GROUP="dialout" --KERNEL=="zappseudo", NAME="zap/pseudo", GROUP="dialout" --KERNEL=="zaptimer", NAME="zap/timer", GROUP="dialout" -diff --git a/rules/packages/64-device-mapper.rules b/rules/packages/64-device-mapper.rules -deleted file mode 100644 -index 8154ef3..0000000 ---- a/rules/packages/64-device-mapper.rules -+++ /dev/null -@@ -1,4 +0,0 @@ --# do not edit this file, it will be overwritten on update -- --KERNEL=="device-mapper", NAME="mapper/control" -- -diff --git a/rules/packages/64-md-raid.rules b/rules/packages/64-md-raid.rules -deleted file mode 100644 -index 6ba93b6..0000000 ---- a/rules/packages/64-md-raid.rules -+++ /dev/null -@@ -1,36 +0,0 @@ --# do not edit this file, it will be overwritten on update -- --SUBSYSTEM!="block", GOTO="md_end" --ACTION!="add|change", GOTO="md_end" -- --# import data from a raid member and activate it --#ENV{ID_FS_TYPE}=="linux_raid_member", IMPORT{program}="/sbin/mdadm --examine --export $tempnode", RUN+="/sbin/mdadm --incremental $env{DEVNAME}" --# import data from a raid set --KERNEL!="md*", GOTO="md_end" -- --# partitions have no md/{array_state,metadata_version} --ENV{DEVTYPE}=="partition", GOTO="md_ignore_state" -- --# container devices have a metadata version of e.g. 'external:ddf' and --# never leave state 'inactive' --ATTR{md/metadata_version}=="external:[A-Za-z]*", ATTR{md/array_state}=="inactive", GOTO="md_ignore_state" --TEST!="md/array_state", GOTO="md_end" --ATTR{md/array_state}=="|clear|inactive", GOTO="md_end" --LABEL="md_ignore_state" -- --IMPORT{program}="/sbin/mdadm --detail --export $tempnode" --ENV{DEVTYPE}=="disk", ENV{MD_NAME}=="?*", SYMLINK+="disk/by-id/md-name-$env{MD_NAME}", OPTIONS+="string_escape=replace" --ENV{DEVTYPE}=="disk", ENV{MD_UUID}=="?*", SYMLINK+="disk/by-id/md-uuid-$env{MD_UUID}" --ENV{DEVTYPE}=="disk", ENV{MD_DEVNAME}=="?*", SYMLINK+="md/$env{MD_DEVNAME}" --ENV{DEVTYPE}=="partition", ENV{MD_NAME}=="?*", SYMLINK+="disk/by-id/md-name-$env{MD_NAME}-part%n", OPTIONS+="string_escape=replace" --ENV{DEVTYPE}=="partition", ENV{MD_UUID}=="?*", SYMLINK+="disk/by-id/md-uuid-$env{MD_UUID}-part%n" --ENV{DEVTYPE}=="partition", ENV{MD_DEVNAME}=="*[^0-9]", SYMLINK+="md/$env{MD_DEVNAME}%n" --ENV{DEVTYPE}=="partition", ENV{MD_DEVNAME}=="*[0-9]", SYMLINK+="md/$env{MD_DEVNAME}p%n" -- --IMPORT{program}="/sbin/blkid -o udev -p $tempnode" --OPTIONS+="link_priority=100" --OPTIONS+="watch" --ENV{ID_FS_USAGE}=="filesystem|other|crypto", ENV{ID_FS_UUID_ENC}=="?*", SYMLINK+="disk/by-uuid/$env{ID_FS_UUID_ENC}" --ENV{ID_FS_USAGE}=="filesystem|other", ENV{ID_FS_LABEL_ENC}=="?*", SYMLINK+="disk/by-label/$env{ID_FS_LABEL_ENC}" -- --LABEL="md_end" -diff --git a/rules/suse/64-device-mapper.rules b/rules/suse/64-device-mapper.rules -index 36ac756..34e3307 100644 ---- a/rules/suse/64-device-mapper.rules -+++ b/rules/suse/64-device-mapper.rules -@@ -1,7 +1,5 @@ - # do not edit this file, it will be overwritten on update - --KERNEL=="device-mapper", NAME="mapper/control" -- - KERNEL!="dm-*", GOTO="device_mapper_end" - ACTION!="add|change", GOTO="device_mapper_end" - --- -1.6.6 - diff --git a/0053-rules-we-do-not-have-static-devices-which-are-rename.patch b/0053-rules-we-do-not-have-static-devices-which-are-rename.patch deleted file mode 100644 index 54294f0..0000000 --- a/0053-rules-we-do-not-have-static-devices-which-are-rename.patch +++ /dev/null @@ -1,21 +0,0 @@ -From 421fbc71c7e951dac900eabd445dfe577158b9c3 Mon Sep 17 00:00:00 2001 -From: Kay Sievers -Date: Mon, 12 Apr 2010 10:50:59 +0200 -Subject: [PATCH 53/65] rules: we do not have static devices which are renamed - ---- - rules/rules.d/50-udev-default.rules | 1 - - 1 files changed, 0 insertions(+), 1 deletions(-) - -diff --git a/rules/rules.d/50-udev-default.rules b/rules/rules.d/50-udev-default.rules -index e8116a3..a5f0823 100644 ---- a/rules/rules.d/50-udev-default.rules -+++ b/rules/rules.d/50-udev-default.rules -@@ -115,4 +115,3 @@ KERNEL=="rrom[0-9]*", MODE="0400" - - # do not delete static device nodes - ACTION=="remove", NAME=="", TEST=="/lib/udev/devices/%k", OPTIONS+="ignore_remove" --ACTION=="remove", NAME=="?*", TEST=="/lib/udev/devices/$name", OPTIONS+="ignore_remove" --- -1.6.6 - diff --git a/0054-unify-cleanup-event-handling.patch b/0054-unify-cleanup-event-handling.patch deleted file mode 100644 index 8ab3525..0000000 --- a/0054-unify-cleanup-event-handling.patch +++ /dev/null @@ -1,362 +0,0 @@ -From 0ec5b5e1429307fa7573aaa9b8f25fbd9b1d71d5 Mon Sep 17 00:00:00 2001 -From: Kay Sievers -Date: Mon, 12 Apr 2010 15:51:16 +0200 -Subject: [PATCH 54/65] unify/cleanup event handling - ---- - udev/udev-event.c | 231 ++++++++++++++++++++++------------------------------- - udev/udev-node.c | 24 ++++-- - udev/udev.h | 3 +- - 3 files changed, 111 insertions(+), 147 deletions(-) - -diff --git a/udev/udev-event.c b/udev/udev-event.c -index 986c119..c3a8281 100644 ---- a/udev/udev-event.c -+++ b/udev/udev-event.c -@@ -1,5 +1,5 @@ - /* -- * Copyright (C) 2003-2009 Kay Sievers -+ * Copyright (C) 2003-2010 Kay Sievers - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by -@@ -541,167 +541,124 @@ int udev_event_execute_rules(struct udev_event *event, struct udev_rules *rules) - udev_device_get_subsystem(dev), udev_device_get_sysname(dev)); - } - -- /* add device node */ -- if (major(udev_device_get_devnum(dev)) != 0 && -- (strcmp(udev_device_get_action(dev), "add") == 0 || strcmp(udev_device_get_action(dev), "change") == 0)) { -- char filename[UTIL_PATH_SIZE]; -- struct udev_device *dev_old; -- int delete_kdevnode = 0; -- -- dbg(event->udev, "device node add '%s'\n", udev_device_get_devpath(dev)); -- -- /* read old database entry */ -- dev_old = udev_device_new_from_syspath(event->udev, udev_device_get_syspath(dev)); -- if (dev_old != NULL) { -- udev_device_read_db(dev_old); -- udev_device_set_info_loaded(dev_old); -+ if (strcmp(udev_device_get_action(dev), "remove") == 0) { -+ udev_device_read_db(dev); -+ udev_device_set_info_loaded(dev); -+ udev_device_delete_db(dev); - -- /* disable watch during event processing */ -- udev_watch_end(event->udev, dev_old); -- } -+ if (major(udev_device_get_devnum(dev)) != 0) -+ udev_watch_end(event->udev, dev); - - udev_rules_apply_to_event(rules, event); -- if (event->tmp_node != NULL) { -- dbg(event->udev, "cleanup temporary device node\n"); -- util_unlink_secure(event->udev, event->tmp_node); -- free(event->tmp_node); -- event->tmp_node = NULL; -- } -- -- if (event->name != NULL && event->name[0] == '\0') { -- info(event->udev, "device node creation suppressed\n"); -- delete_kdevnode = 1; -- goto exit_add; -- } -- -- /* if rule given name disagrees with kernel node name, delete kernel node */ -- if (event->name != NULL && udev_device_get_knodename(dev) != NULL) { -- if (strcmp(event->name, udev_device_get_knodename(dev)) != 0) -- delete_kdevnode = 1; -- } -- -- /* no rule, use kernel provided name */ -- if (event->name == NULL) { -- if (udev_device_get_knodename(dev) != NULL) { -- event->name = strdup(udev_device_get_knodename(dev)); -- info(event->udev, "no node name set, will use kernel supplied name '%s'\n", event->name); -- } else { -- event->name = strdup(udev_device_get_sysname(event->dev)); -- info(event->udev, "no node name set, will use device name '%s'\n", event->name); -- } -- } - -- /* something went wrong */ -- if (event->name == NULL) { -- err(event->udev, "no node name for '%s'\n", udev_device_get_sysname(event->dev)); -- goto exit_add; -- } -- -- /* set device node name */ -- util_strscpyl(filename, sizeof(filename), udev_get_dev_path(event->udev), "/", event->name, NULL); -- udev_device_set_devnode(dev, filename); -- -- /* write current database entry */ -- udev_device_update_db(dev); -+ if (major(udev_device_get_devnum(dev)) != 0) -+ err = udev_node_remove(dev); -+ } else { -+ event->dev_db = udev_device_new_from_syspath(event->udev, udev_device_get_syspath(dev)); -+ if (event->dev_db != NULL) { -+ udev_device_read_db(event->dev_db); -+ udev_device_set_info_loaded(event->dev_db); - -- /* remove/update possible left-over symlinks from old database entry */ -- if (dev_old != NULL) -- udev_node_update_old_links(dev, dev_old); -- -- /* create new node and symlinks */ -- err = udev_node_add(dev, event->mode, event->uid, event->gid); --exit_add: -- if (delete_kdevnode && udev_device_get_knodename(dev) != NULL) { -- struct stat stats; -- -- util_strscpyl(filename, sizeof(filename), -- udev_get_dev_path(event->udev), "/", udev_device_get_knodename(dev), NULL); -- if (stat(filename, &stats) == 0 && stats.st_rdev == udev_device_get_devnum(dev)) { -- unlink(filename); -- util_delete_path(event->udev, filename); -- info(event->udev, "removed kernel created node '%s'\n", filename); -- } -+ /* disable watch during event processing */ -+ if (major(udev_device_get_devnum(dev)) != 0) -+ udev_watch_end(event->udev, event->dev_db); - } -- udev_device_unref(dev_old); -- goto exit; -- } -- -- /* add netif */ -- if (strcmp(udev_device_get_subsystem(dev), "net") == 0 && strcmp(udev_device_get_action(dev), "add") == 0) { -- dbg(event->udev, "netif add '%s'\n", udev_device_get_devpath(dev)); -- udev_device_delete_db(dev); - - udev_rules_apply_to_event(rules, event); -- if (event->name == NULL) -- goto exit; - -- /* look if we want to change the name of the netif */ -- if (strcmp(event->name, udev_device_get_sysname(dev)) != 0) { -+ /* rename a new network interface, if needed */ -+ if (strcmp(udev_device_get_subsystem(dev), "net") == 0 && strcmp(udev_device_get_action(dev), "add") == 0 && -+ event->name != NULL && strcmp(event->name, udev_device_get_sysname(dev)) != 0) { - char syspath[UTIL_PATH_SIZE]; - char *pos; - - err = rename_netif(event); -- if (err != 0) -- goto exit; -- info(event->udev, "renamed netif to '%s'\n", event->name); -- -- /* remember old name */ -- udev_device_add_property(dev, "INTERFACE_OLD", udev_device_get_sysname(dev)); -- -- /* now change the devpath, because the kernel device name has changed */ -- util_strscpy(syspath, sizeof(syspath), udev_device_get_syspath(dev)); -- pos = strrchr(syspath, '/'); -- if (pos != NULL) { -- pos++; -- util_strscpy(pos, sizeof(syspath) - (pos - syspath), event->name); -- udev_device_set_syspath(event->dev, syspath); -- udev_device_add_property(dev, "INTERFACE", udev_device_get_sysname(dev)); -- info(event->udev, "changed devpath to '%s'\n", udev_device_get_devpath(dev)); -+ if (err == 0) { -+ info(event->udev, "renamed netif to '%s'\n", event->name); -+ -+ /* delete stale db file */ -+ udev_device_delete_db(dev); -+ -+ /* remember old name */ -+ udev_device_add_property(dev, "INTERFACE_OLD", udev_device_get_sysname(dev)); -+ -+ /* now change the devpath, because the kernel device name has changed */ -+ util_strscpy(syspath, sizeof(syspath), udev_device_get_syspath(dev)); -+ pos = strrchr(syspath, '/'); -+ if (pos != NULL) { -+ pos++; -+ util_strscpy(pos, sizeof(syspath) - (pos - syspath), event->name); -+ udev_device_set_syspath(event->dev, syspath); -+ udev_device_add_property(dev, "INTERFACE", udev_device_get_sysname(dev)); -+ info(event->udev, "changed devpath to '%s'\n", udev_device_get_devpath(dev)); -+ } - } - } -- udev_device_update_db(dev); -- goto exit; -- } - -- /* remove device node */ -- if (major(udev_device_get_devnum(dev)) != 0 && strcmp(udev_device_get_action(dev), "remove") == 0) { -- /* import database entry and delete it */ -- udev_device_read_db(dev); -- udev_device_set_info_loaded(dev); -- udev_device_delete_db(dev); -+ if (major(udev_device_get_devnum(dev)) != 0) { -+ char filename[UTIL_PATH_SIZE]; - -- /* remove watch */ -- udev_watch_end(event->udev, dev); -+ if (event->tmp_node != NULL) { -+ info(event->udev, "cleanup temporary device node\n"); -+ util_unlink_secure(event->udev, event->tmp_node); -+ free(event->tmp_node); -+ event->tmp_node = NULL; -+ } - -- if (udev_device_get_devnode(dev) == NULL) { -- char devnode[UTIL_PATH_SIZE]; -+ /* no rule, use kernel provided name */ -+ if (event->name == NULL) { -+ if (udev_device_get_knodename(dev) != NULL) { -+ event->name = strdup(udev_device_get_knodename(dev)); -+ info(event->udev, "no node name set, will use kernel supplied name '%s'\n", event->name); -+ } else { -+ event->name = strdup(udev_device_get_sysname(event->dev)); -+ info(event->udev, "no node name set, will use device name '%s'\n", event->name); -+ } -+ } -+ -+ if (event->name == NULL) { -+ /* things went wrong */ -+ udev_device_delete_db(dev); -+ udev_device_unref(event->dev_db); -+ err = -ENOMEM; -+ goto out; -+ } - -- info(event->udev, "'%s' not found in database, using kernel name '%s'\n", -- udev_device_get_syspath(dev), udev_device_get_knodename(dev)); -- util_strscpyl(devnode, sizeof(devnode), -- udev_get_dev_path(event->udev), "/", udev_device_get_knodename(dev), NULL); -- udev_device_set_devnode(dev, devnode); -+ /* set device node name */ -+ util_strscpyl(filename, sizeof(filename), udev_get_dev_path(event->udev), "/", event->name, NULL); -+ udev_device_set_devnode(dev, filename); - } - -- udev_rules_apply_to_event(rules, event); -+ udev_device_update_db(dev); - -- if (udev_device_get_ignore_remove(dev)) { -- info(event->udev, "ignore_remove for '%s'\n", udev_device_get_devnode(dev)); -- goto exit; -+ if (major(udev_device_get_devnum(dev)) != 0) { -+ /* remove/update possible left-over symlinks from old database entry */ -+ if (event->dev_db != NULL) -+ udev_node_update_old_links(dev, event->dev_db); -+ -+ if (event->name[0] != '\0') -+ err = udev_node_add(dev, event->mode, event->uid, event->gid); -+ else -+ info(event->udev, "device node creation suppressed\n"); -+ -+ /* remove kernel-created node, if needed */ -+ if (udev_device_get_knodename(dev) != NULL && strcmp(event->name, udev_device_get_knodename(dev)) != 0) { -+ struct stat stats; -+ char filename[UTIL_PATH_SIZE]; -+ -+ info(event->udev, "remove kernel created node '%s'\n", udev_device_get_knodename(dev)); -+ util_strscpyl(filename, sizeof(filename), udev_get_dev_path(event->udev), "/", udev_device_get_knodename(dev), NULL); -+ if (stat(filename, &stats) == 0 && stats.st_rdev == udev_device_get_devnum(dev)) { -+ util_unlink_secure(event->udev, filename); -+ util_delete_path(event->udev, filename); -+ } -+ } - } - -- err = udev_node_remove(dev); -- goto exit; -+ udev_device_unref(event->dev_db); -+ event->dev_db = NULL; - } -- -- /* default devices */ -- udev_rules_apply_to_event(rules, event); -- -- if (strcmp(udev_device_get_action(dev), "remove") != 0) -- udev_device_update_db(dev); -- else -- udev_device_delete_db(dev); --exit: -+out: - return err; - } - -diff --git a/udev/udev-node.c b/udev/udev-node.c -index 3aee15b..3b4eb5f 100644 ---- a/udev/udev-node.c -+++ b/udev/udev-node.c -@@ -1,5 +1,5 @@ - /* -- * Copyright (C) 2003-2009 Kay Sievers -+ * Copyright (C) 2003-2010 Kay Sievers - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by -@@ -416,7 +416,6 @@ int udev_node_remove(struct udev_device *dev) - const char *devnode; - char partitionname[UTIL_PATH_SIZE]; - struct stat stats; -- struct udev_device *dev_check; - int err = 0; - int num; - -@@ -436,15 +435,21 @@ int udev_node_remove(struct udev_device *dev) - return -1; - } - -- dev_check = udev_device_new_from_syspath(udev, udev_device_get_syspath(dev)); -- if (dev_check != NULL && stats.st_rdev == udev_device_get_devnum(dev_check)) { -- /* do not remove device node if the same sys-device is re-created in the meantime */ -- info(udev, "keeping device node of existing device'%s'\n", devnode); -+ if (udev_device_get_ignore_remove(dev)) { -+ info(udev, "ignore_remove for '%s'\n", udev_device_get_devnode(dev)); - } else { -- info(udev, "removing device node '%s'\n", devnode); -- err = util_unlink_secure(udev, devnode); -+ struct udev_device *dev_check; -+ -+ dev_check = udev_device_new_from_syspath(udev, udev_device_get_syspath(dev)); -+ if (dev_check != NULL && stats.st_rdev == udev_device_get_devnum(dev_check)) { -+ /* do not remove device node if the same sys-device is re-created in the meantime */ -+ info(udev, "keeping device node of existing device'%s'\n", devnode); -+ } else { -+ info(udev, "removing device node '%s'\n", devnode); -+ err = util_unlink_secure(udev, devnode); -+ } -+ udev_device_unref(dev_check); - } -- udev_device_unref(dev_check); - - num = udev_device_get_num_fake_partitions(dev); - if (num > 0) { -@@ -459,6 +464,7 @@ int udev_node_remove(struct udev_device *dev) - util_unlink_secure(udev, partitionname); - } - } -+ - util_delete_path(udev, devnode); - return err; - } -diff --git a/udev/udev.h b/udev/udev.h -index 555eae6..2b9bbec 100644 ---- a/udev/udev.h -+++ b/udev/udev.h -@@ -1,6 +1,6 @@ - /* - * Copyright (C) 2003 Greg Kroah-Hartman -- * Copyright (C) 2003-2008 Kay Sievers -+ * Copyright (C) 2003-2010 Kay Sievers - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by -@@ -35,6 +35,7 @@ struct udev_event { - struct udev *udev; - struct udev_device *dev; - struct udev_device *dev_parent; -+ struct udev_device *dev_db; - char *name; - char *tmp_node; - char *program_result; --- -1.6.6 - diff --git a/0055-allow-IMPORT-db-KEY.patch b/0055-allow-IMPORT-db-KEY.patch deleted file mode 100644 index 4a81bfa..0000000 --- a/0055-allow-IMPORT-db-KEY.patch +++ /dev/null @@ -1,109 +0,0 @@ -From 5539f624e18e948e4e3a1f0d9f5d25de9c8fd8b8 Mon Sep 17 00:00:00 2001 -From: Kay Sievers -Date: Mon, 12 Apr 2010 15:58:05 +0200 -Subject: [PATCH 55/65] allow IMPORT{db}="KEY" - ---- - udev/udev-rules.c | 26 +++++++++++++++++++++++++- - udev/udev.xml | 8 ++++++++ - 2 files changed, 33 insertions(+), 1 deletions(-) - -diff --git a/udev/udev-rules.c b/udev/udev-rules.c -index 60daad5..c4a2724 100644 ---- a/udev/udev-rules.c -+++ b/udev/udev-rules.c -@@ -1,5 +1,5 @@ - /* -- * Copyright (C) 2003-2009 Kay Sievers -+ * Copyright (C) 2003-2010 Kay Sievers - * Copyright (C) 2008 Alan Jenkins - * - * This program is free software: you can redistribute it and/or modify -@@ -141,6 +141,7 @@ enum token_type { - TK_M_PROGRAM, /* val */ - TK_M_IMPORT_FILE, /* val */ - TK_M_IMPORT_PROG, /* val */ -+ TK_M_IMPORT_DB, /* val */ - TK_M_IMPORT_PARENT, /* val */ - TK_M_RESULT, /* val */ - TK_M_MAX, -@@ -271,6 +272,7 @@ static const char *token_str(enum token_type type) - [TK_M_PROGRAM] = "M PROGRAM", - [TK_M_IMPORT_FILE] = "M IMPORT_FILE", - [TK_M_IMPORT_PROG] = "M IMPORT_PROG", -+ [TK_M_IMPORT_DB] = "M IMPORT_DB", - [TK_M_IMPORT_PARENT] = "M IMPORT_PARENT", - [TK_M_RESULT] = "M RESULT", - [TK_M_MAX] = "M MAX", -@@ -337,6 +339,7 @@ static void dump_token(struct udev_rules *rules, struct token *token) - case TK_M_PROGRAM: - case TK_M_IMPORT_FILE: - case TK_M_IMPORT_PROG: -+ case TK_M_IMPORT_DB: - case TK_M_IMPORT_PARENT: - case TK_M_RESULT: - case TK_A_NAME: -@@ -1001,6 +1004,7 @@ static int rule_add_key(struct rule_tmp *rule_tmp, enum token_type type, - case TK_M_PROGRAM: - case TK_M_IMPORT_FILE: - case TK_M_IMPORT_PROG: -+ case TK_M_IMPORT_DB: - case TK_M_IMPORT_PARENT: - case TK_M_RESULT: - case TK_A_OWNER: -@@ -1379,6 +1383,9 @@ static int add_rule(struct udev_rules *rules, char *line, - } else if (attr != NULL && strstr(attr, "file")) { - dbg(rules->udev, "IMPORT will be included as file\n"); - rule_add_key(&rule_tmp, TK_M_IMPORT_FILE, op, value, NULL); -+ } else if (attr != NULL && strstr(attr, "db")) { -+ dbg(rules->udev, "IMPORT will include db values\n"); -+ rule_add_key(&rule_tmp, TK_M_IMPORT_DB, op, value, NULL); - } else if (attr != NULL && strstr(attr, "parent")) { - dbg(rules->udev, "IMPORT will include the parent values\n"); - rule_add_key(&rule_tmp, TK_M_IMPORT_PARENT, op, value, NULL); -@@ -2288,6 +2295,23 @@ int udev_rules_apply_to_event(struct udev_rules *rules, struct udev_event *event - goto nomatch; - break; - } -+ case TK_M_IMPORT_DB: -+ { -+ const char *key = &rules->buf[cur->key.value_off]; -+ const char *value; -+ -+ value = udev_device_get_property_value(event->dev_db, key); -+ if (value != NULL) { -+ struct udev_list_entry *entry; -+ -+ entry = udev_device_add_property(event->dev, key, value); -+ udev_list_entry_set_flags(entry, 1); -+ } else { -+ if (cur->key.op != OP_NOMATCH) -+ goto nomatch; -+ } -+ break; -+ } - case TK_M_IMPORT_PARENT: - { - char import[UTIL_PATH_SIZE]; -diff --git a/udev/udev.xml b/udev/udev.xml -index b6c5933..175cdbe 100644 ---- a/udev/udev.xml -+++ b/udev/udev.xml -@@ -399,6 +399,14 @@ - - - -+ -+ -+ Import a single property specified as the assigned value from the -+ current device database. This works only if the database is already populated -+ by an earlier event. -+ -+ -+ - - - Import the stored keys from the parent device by reading --- -1.6.6 - diff --git a/0056-usb-db-remove-double.patch b/0056-usb-db-remove-double.patch deleted file mode 100644 index 0f0d612..0000000 --- a/0056-usb-db-remove-double.patch +++ /dev/null @@ -1,31 +0,0 @@ -From 86dc9133f88e8690aa89ccb5a240ff915b1fb69f Mon Sep 17 00:00:00 2001 -From: Kay Sievers -Date: Mon, 12 Apr 2010 16:10:05 +0200 -Subject: [PATCH 56/65] usb-db: remove double '/' - ---- - extras/usb-db/usb-db.c | 4 +--- - 1 files changed, 1 insertions(+), 3 deletions(-) - -diff --git a/extras/usb-db/usb-db.c b/extras/usb-db/usb-db.c -index db1f843..fe563c2 100644 ---- a/extras/usb-db/usb-db.c -+++ b/extras/usb-db/usb-db.c -@@ -1,5 +1,3 @@ --/*-*- linux-c -*-*/ -- - /* - * Copyright (C) 2009 Lennart Poettering - * -@@ -223,7 +221,7 @@ int main(int argc, char*argv[]) { - if (!(udev = udev_new())) - goto finish; - -- if (asprintf(&sp, "%s/%s", udev_get_sys_path(udev), argv[1]) < 0) { -+ if (asprintf(&sp, "%s%s", udev_get_sys_path(udev), argv[1]) < 0) { - fprintf(stderr, "Failed to allocate sysfs path.\n"); - goto finish; - } --- -1.6.6 - diff --git a/0057-replace-add-change-with-remove.patch b/0057-replace-add-change-with-remove.patch deleted file mode 100644 index 6ea9548..0000000 --- a/0057-replace-add-change-with-remove.patch +++ /dev/null @@ -1,276 +0,0 @@ -From 4b06c409350d26af5e6ace0f368d01b80d75438e Mon Sep 17 00:00:00 2001 -From: Kay Sievers -Date: Mon, 12 Apr 2010 16:52:41 +0200 -Subject: [PATCH 57/65] replace "add|change" with "!remove" - ---- - extras/cdrom_id/60-cdrom_id.rules | 2 +- - extras/edd_id/61-persistent-storage-edd.rules | 2 +- - extras/fstab_import/79-fstab_import.rules | 2 +- - extras/hid2hci/70-hid2hci.rules | 2 +- - extras/keymap/95-keyboard-force-release.rules | 2 +- - extras/keymap/95-keymap.rules | 2 +- - extras/udev-acl/70-acl.rules | 2 +- - extras/udev-acl/udev-acl.c | 6 ++---- - extras/v4l_id/60-persistent-v4l.rules | 2 +- - rules/rules.d/60-persistent-alsa.rules | 2 +- - rules/rules.d/60-persistent-input.rules | 2 +- - rules/rules.d/60-persistent-serial.rules | 2 +- - rules/rules.d/60-persistent-storage-tape.rules | 2 +- - rules/rules.d/60-persistent-storage.rules | 2 +- - rules/rules.d/75-net-description.rules | 2 +- - rules/rules.d/75-tty-description.rules | 2 +- - rules/suse/64-device-mapper.rules | 2 +- - udev/udev-rules.c | 5 ++--- - udev/udevd.c | 2 +- - 19 files changed, 21 insertions(+), 24 deletions(-) - -diff --git a/extras/cdrom_id/60-cdrom_id.rules b/extras/cdrom_id/60-cdrom_id.rules -index 811c4aa..16b3af9 100644 ---- a/extras/cdrom_id/60-cdrom_id.rules -+++ b/extras/cdrom_id/60-cdrom_id.rules -@@ -1,6 +1,6 @@ - # do not edit this file, it will be overwritten on update - --ACTION!="add|change", GOTO="cdrom_end" -+ACTION=="remove", GOTO="cdrom_end" - SUBSYSTEM!="block", GOTO="cdrom_end" - KERNEL!="sr[0-9]*|xvd*", GOTO="cdrom_end" - ENV{DEVTYPE}!="disk", GOTO="cdrom_end" -diff --git a/extras/edd_id/61-persistent-storage-edd.rules b/extras/edd_id/61-persistent-storage-edd.rules -index 54ae086..1ab1be3 100644 ---- a/extras/edd_id/61-persistent-storage-edd.rules -+++ b/extras/edd_id/61-persistent-storage-edd.rules -@@ -1,6 +1,6 @@ - # do not edit this file, it will be overwritten on update - --ACTION!="add|change", GOTO="persistent_storage_edd_end" -+ACTION=="remove", GOTO="persistent_storage_edd_end" - SUBSYSTEM!="block", GOTO="persistent_storage_edd_end" - KERNEL!="sd*|hd*|cciss*", GOTO="persistent_storage_edd_end" - -diff --git a/extras/fstab_import/79-fstab_import.rules b/extras/fstab_import/79-fstab_import.rules -index 2adfe04..2ded7d3 100644 ---- a/extras/fstab_import/79-fstab_import.rules -+++ b/extras/fstab_import/79-fstab_import.rules -@@ -1,2 +1,2 @@ --ACTION=="add|change", SUBSYSTEM=="block", ENV{ID_FS_USAGE}=="filesystem|other", IMPORT="fstab_import $name $links mapper/$env{DM_NAME}" -+ACTION!="remove", SUBSYSTEM=="block", ENV{ID_FS_USAGE}=="filesystem|other", IMPORT="fstab_import $name $links mapper/$env{DM_NAME}" - -diff --git a/extras/hid2hci/70-hid2hci.rules b/extras/hid2hci/70-hid2hci.rules -index 01ff30d..0687c8a 100644 ---- a/extras/hid2hci/70-hid2hci.rules -+++ b/extras/hid2hci/70-hid2hci.rules -@@ -1,6 +1,6 @@ - # do not edit this file, it will be overwritten on update - --ACTION!="add|change", GOTO="hid2hci_end" -+ACTION=="remove", GOTO="hid2hci_end" - SUBSYSTEM!="usb", GOTO="hid2hci_end" - - # Variety of Dell Bluetooth devices - match on a mouse device that is -diff --git a/extras/keymap/95-keyboard-force-release.rules b/extras/keymap/95-keyboard-force-release.rules -index f0e1ab8..b973614 100644 ---- a/extras/keymap/95-keyboard-force-release.rules -+++ b/extras/keymap/95-keyboard-force-release.rules -@@ -11,7 +11,7 @@ - # /lib/udev/keymap -i /dev/input/eventX - # on a Linux vt to find out. - --ACTION!="add|change", GOTO="force_release_end" -+ACTION=="remove", GOTO="force_release_end" - SUBSYSTEM!="serio", GOTO="force_release_end" - KERNEL!="serio*", GOTO="force_release_end" - DRIVER!="atkbd", GOTO="force_release_end" -diff --git a/extras/keymap/95-keymap.rules b/extras/keymap/95-keymap.rules -index dd58453..2f41cb4 100644 ---- a/extras/keymap/95-keymap.rules -+++ b/extras/keymap/95-keymap.rules -@@ -5,7 +5,7 @@ - # a file name (in /lib/udev/keymaps), which has to contain scancode/keyname - # pairs. - --ACTION!="add|change", GOTO="keyboard_end" -+ACTION=="remove", GOTO="keyboard_end" - SUBSYSTEM!="input", GOTO="keyboard_end" - KERNEL!="event*", GOTO="keyboard_end" - -diff --git a/extras/udev-acl/70-acl.rules b/extras/udev-acl/70-acl.rules -index fde2656..5b00bf8 100644 ---- a/extras/udev-acl/70-acl.rules -+++ b/extras/udev-acl/70-acl.rules -@@ -4,7 +4,7 @@ - # udev-acl of this udev release and may be replaced at any time. - - ENV{MAJOR}=="", GOTO="acl_end" --ACTION!="add|change", GOTO="acl_apply" -+ACTION=="remove", GOTO="acl_apply" - - # PTP/MTP protocol devices, cameras, portable media players - SUBSYSTEM=="usb", ENV{ID_USB_INTERFACES}=="", ENV{DEVTYPE}=="usb_device", IMPORT{program}="usb_id --export %p" -diff --git a/extras/udev-acl/udev-acl.c b/extras/udev-acl/udev-acl.c -index c070fcc..ce51590 100644 ---- a/extras/udev-acl/udev-acl.c -+++ b/extras/udev-acl/udev-acl.c -@@ -353,12 +353,10 @@ int main (int argc, char* argv[]) - - switch (option) { - case 'a': -- if (strcmp(optarg, "add") == 0 || strcmp(optarg, "change") == 0) -- action = ACTION_ADD; -- else if (strcmp(optarg, "remove") == 0) -+ if (strcmp(optarg, "remove") == 0) - action = ACTION_REMOVE; - else -- goto out; -+ action = ACTION_ADD; - break; - case 'D': - device = optarg; -diff --git a/extras/v4l_id/60-persistent-v4l.rules b/extras/v4l_id/60-persistent-v4l.rules -index a342a71..b6e1313 100644 ---- a/extras/v4l_id/60-persistent-v4l.rules -+++ b/extras/v4l_id/60-persistent-v4l.rules -@@ -1,6 +1,6 @@ - # do not edit this file, it will be overwritten on update - --ACTION!="add|change", GOTO="persistent_v4l_end" -+ACTION=="remove", GOTO="persistent_v4l_end" - SUBSYSTEM!="video4linux", GOTO="persistent_v4l_end" - ENV{MAJOR}=="", GOTO="persistent_v4l_end" - -diff --git a/rules/rules.d/60-persistent-alsa.rules b/rules/rules.d/60-persistent-alsa.rules -index a5206fd..39a3652 100644 ---- a/rules/rules.d/60-persistent-alsa.rules -+++ b/rules/rules.d/60-persistent-alsa.rules -@@ -1,6 +1,6 @@ - # do not edit this file, it will be overwritten on update - --ACTION!="add|change", GOTO="persistent_alsa_end" -+ACTION=="remove", GOTO="persistent_alsa_end" - SUBSYSTEM!="sound", GOTO="persistent_alsa_end" - KERNEL!="controlC[0-9]*", GOTO="persistent_alsa_end" - -diff --git a/rules/rules.d/60-persistent-input.rules b/rules/rules.d/60-persistent-input.rules -index 1ea4431..634c4db 100644 ---- a/rules/rules.d/60-persistent-input.rules -+++ b/rules/rules.d/60-persistent-input.rules -@@ -1,6 +1,6 @@ - # do not edit this file, it will be overwritten on update - --ACTION!="add|change", GOTO="persistent_input_end" -+ACTION=="remove", GOTO="persistent_input_end" - SUBSYSTEM!="input", GOTO="persistent_input_end" - KERNEL=="input[0-9]*", GOTO="persistent_input_end" - -diff --git a/rules/rules.d/60-persistent-serial.rules b/rules/rules.d/60-persistent-serial.rules -index 351b385..3e1a565 100644 ---- a/rules/rules.d/60-persistent-serial.rules -+++ b/rules/rules.d/60-persistent-serial.rules -@@ -1,6 +1,6 @@ - # do not edit this file, it will be overwritten on update - --ACTION!="add|change", GOTO="persistent_serial_end" -+ACTION=="remove", GOTO="persistent_serial_end" - SUBSYSTEM!="tty", GOTO="persistent_serial_end" - KERNEL!="ttyUSB[0-9]*|ttyACM[0-9]*", GOTO="persistent_serial_end" - -diff --git a/rules/rules.d/60-persistent-storage-tape.rules b/rules/rules.d/60-persistent-storage-tape.rules -index 968528d..833ef94 100644 ---- a/rules/rules.d/60-persistent-storage-tape.rules -+++ b/rules/rules.d/60-persistent-storage-tape.rules -@@ -2,7 +2,7 @@ - - # persistent storage links: /dev/tape/{by-id,by-path} - --ACTION!="add|change", GOTO="persistent_storage_tape_end" -+ACTION=="remove", GOTO="persistent_storage_tape_end" - - # type 8 devices are "Medium Changers" - SUBSYSTEM=="scsi_generic", SUBSYSTEMS=="scsi", ATTRS{type}=="8", IMPORT{program}="scsi_id --sg-version=3 --export --whitelisted -d $tempnode", SYMLINK+="tape/by-id/scsi-$env{ID_SERIAL}" -diff --git a/rules/rules.d/60-persistent-storage.rules b/rules/rules.d/60-persistent-storage.rules -index 89041a9..d9f8003 100644 ---- a/rules/rules.d/60-persistent-storage.rules -+++ b/rules/rules.d/60-persistent-storage.rules -@@ -6,7 +6,7 @@ - # forward scsi device event to corresponding block device - ACTION=="change", SUBSYSTEM=="scsi", ENV{DEVTYPE}=="scsi_device", TEST=="block", ATTR{block/*/uevent}="change" - --ACTION!="add|change", GOTO="persistent_storage_end" -+ACTION=="remove", GOTO="persistent_storage_end" - SUBSYSTEM!="block", GOTO="persistent_storage_end" - - # skip rules for inappropriate block devices -diff --git a/rules/rules.d/75-net-description.rules b/rules/rules.d/75-net-description.rules -index 1c4c401..490fcce 100644 ---- a/rules/rules.d/75-net-description.rules -+++ b/rules/rules.d/75-net-description.rules -@@ -1,6 +1,6 @@ - # do not edit this file, it will be overwritten on update - --ACTION!="add|change", GOTO="net_end" -+ACTION=="remove", GOTO="net_end" - SUBSYSTEM!="net", GOTO="net_end" - - SUBSYSTEMS=="usb", ENV{ID_MODEL}=="", IMPORT{program}="usb_id --export %p" -diff --git a/rules/rules.d/75-tty-description.rules b/rules/rules.d/75-tty-description.rules -index ac868ad..c2980cf 100644 ---- a/rules/rules.d/75-tty-description.rules -+++ b/rules/rules.d/75-tty-description.rules -@@ -1,6 +1,6 @@ - # do not edit this file, it will be overwritten on update - --ACTION!="add|change", GOTO="tty_end" -+ACTION=="remove", GOTO="tty_end" - SUBSYSTEM!="tty", GOTO="tty_end" - - SUBSYSTEMS=="usb", ENV{ID_MODEL}=="", IMPORT{program}="usb_id --export %p" -diff --git a/rules/suse/64-device-mapper.rules b/rules/suse/64-device-mapper.rules -index 34e3307..12cae35 100644 ---- a/rules/suse/64-device-mapper.rules -+++ b/rules/suse/64-device-mapper.rules -@@ -1,7 +1,7 @@ - # do not edit this file, it will be overwritten on update - - KERNEL!="dm-*", GOTO="device_mapper_end" --ACTION!="add|change", GOTO="device_mapper_end" -+ACTION=="remove", GOTO="device_mapper_end" - - IMPORT{program}="/sbin/dmsetup export -j%M -m%m" - ENV{DM_NAME}!="?*", GOTO="device_mapper_end" -diff --git a/udev/udev-rules.c b/udev/udev-rules.c -index c4a2724..0361f68 100644 ---- a/udev/udev-rules.c -+++ b/udev/udev-rules.c -@@ -2055,13 +2055,12 @@ int udev_rules_apply_to_event(struct udev_rules *rules, struct udev_event *event - struct token *cur; - struct token *rule; - enum escape_type esc = ESCAPE_UNSET; -- int can_set_name; -+ bool can_set_name; - - if (rules->tokens == NULL) - return -1; - -- can_set_name = ((strcmp(udev_device_get_action(event->dev), "add") == 0 || -- strcmp(udev_device_get_action(event->dev), "change") == 0) && -+ can_set_name = ((strcmp(udev_device_get_action(event->dev), "remove") != 0) && - (major(udev_device_get_devnum(event->dev)) > 0 || - strcmp(udev_device_get_subsystem(event->dev), "net") == 0)); - -diff --git a/udev/udevd.c b/udev/udevd.c -index fe3352c..c27b4cd 100644 ---- a/udev/udevd.c -+++ b/udev/udevd.c -@@ -168,7 +168,7 @@ static void event_queue_delete(struct event *event) - udev_list_node_remove(&event->node); - - /* mark as failed, if "add" event returns non-zero */ -- if (event->exitcode != 0 && strcmp(udev_device_get_action(event->dev), "add") == 0) -+ if (event->exitcode != 0 && strcmp(udev_device_get_action(event->dev), "remove") != 0) - udev_queue_export_device_failed(udev_queue_export, event->dev); - else - udev_queue_export_device_finished(udev_queue_export, event->dev); --- -1.6.6 - diff --git a/0058-update-NEWS.patch b/0058-update-NEWS.patch deleted file mode 100644 index 3f1774b..0000000 --- a/0058-update-NEWS.patch +++ /dev/null @@ -1,30 +0,0 @@ -From 5c4c389bba6cf986a8dd743b43017c2f60604cca Mon Sep 17 00:00:00 2001 -From: Kay Sievers -Date: Mon, 12 Apr 2010 17:00:16 +0200 -Subject: [PATCH 58/65] update NEWS - ---- - NEWS | 7 +++++++ - 1 files changed, 7 insertions(+), 0 deletions(-) - -diff --git a/NEWS b/NEWS -index a4d46d7..687bcdf 100644 ---- a/NEWS -+++ b/NEWS -@@ -2,6 +2,13 @@ udev 152 - ======== - Bugfixes. - -+All "add|change" matches are replaced by "!remove" in the rules and -+in the udev logic. All types of events will update possible symlinks -+and permissions, only "remove" is handled special now. -+ -+The modem mode switch extra was removed and the external usb_modeswitch -+program should be used instead. -+ - New and fixed keymaps. - - udev 151 --- -1.6.6 - diff --git a/0059-log-info-only-if-we-actually-delete-the-node.patch b/0059-log-info-only-if-we-actually-delete-the-node.patch deleted file mode 100644 index eb54add..0000000 --- a/0059-log-info-only-if-we-actually-delete-the-node.patch +++ /dev/null @@ -1,27 +0,0 @@ -From 3ba7e651ad36e4f37d9bfffadb638bc2ef784217 Mon Sep 17 00:00:00 2001 -From: Kay Sievers -Date: Mon, 12 Apr 2010 17:13:37 +0200 -Subject: [PATCH 59/65] log info only if we actually delete the node - ---- - udev/udev-event.c | 2 +- - 1 files changed, 1 insertions(+), 1 deletions(-) - -diff --git a/udev/udev-event.c b/udev/udev-event.c -index c3a8281..26939e7 100644 ---- a/udev/udev-event.c -+++ b/udev/udev-event.c -@@ -646,9 +646,9 @@ int udev_event_execute_rules(struct udev_event *event, struct udev_rules *rules) - struct stat stats; - char filename[UTIL_PATH_SIZE]; - -- info(event->udev, "remove kernel created node '%s'\n", udev_device_get_knodename(dev)); - util_strscpyl(filename, sizeof(filename), udev_get_dev_path(event->udev), "/", udev_device_get_knodename(dev), NULL); - if (stat(filename, &stats) == 0 && stats.st_rdev == udev_device_get_devnum(dev)) { -+ info(event->udev, "remove kernel created node '%s'\n", udev_device_get_knodename(dev)); - util_unlink_secure(event->udev, filename); - util_delete_path(event->udev, filename); - } --- -1.6.6 - diff --git a/0060-udevadm-trigger-switch-default-action-from-add-to-ch.patch b/0060-udevadm-trigger-switch-default-action-from-add-to-ch.patch deleted file mode 100644 index 17c2b1f..0000000 --- a/0060-udevadm-trigger-switch-default-action-from-add-to-ch.patch +++ /dev/null @@ -1,49 +0,0 @@ -From 236fae6cf1a619a92174efdf84cd7d91e7d4348d Mon Sep 17 00:00:00 2001 -From: Kay Sievers -Date: Mon, 12 Apr 2010 17:56:32 +0200 -Subject: [PATCH 60/65] udevadm: trigger - switch default action from "add" to "change" - ---- - NEWS | 3 +++ - udev/udevadm-trigger.c | 4 ++-- - 2 files changed, 5 insertions(+), 2 deletions(-) - -diff --git a/NEWS b/NEWS -index 687bcdf..c5fbbe1 100644 ---- a/NEWS -+++ b/NEWS -@@ -2,6 +2,9 @@ udev 152 - ======== - Bugfixes. - -+"udevadm trigger" default to "change" events now, instead of "add" -+events. -+ - All "add|change" matches are replaced by "!remove" in the rules and - in the udev logic. All types of events will update possible symlinks - and permissions, only "remove" is handled special now. -diff --git a/udev/udevadm-trigger.c b/udev/udevadm-trigger.c -index dbcaee3..03aa534 100644 ---- a/udev/udevadm-trigger.c -+++ b/udev/udevadm-trigger.c -@@ -110,7 +110,7 @@ int udevadm_trigger(struct udev *udev, int argc, char *argv[]) - TYPE_SUBSYSTEMS, - TYPE_FAILED, - } device_type = TYPE_DEVICES; -- const char *action = "add"; -+ const char *action = "change"; - struct udev_enumerate *udev_enumerate; - int rc = 0; - -@@ -184,7 +184,7 @@ int udevadm_trigger(struct udev *udev, int argc, char *argv[]) - " subsystems sys subsystems and drivers\n" - " failed trigger only the events which have been\n" - " marked as failed during a previous run\n" -- " --action= event action value, default is \"add\"\n" -+ " --action= event action value, default is \"change\"\n" - " --subsystem-match= trigger devices from a matching subsystem\n" - " --subsystem-nomatch= exclude devices from a matching subsystem\n" - " --attr-match=]> trigger devices with a matching attribute\n" --- -1.6.6 - diff --git a/0061-remove-all_partitions-option.patch b/0061-remove-all_partitions-option.patch deleted file mode 100644 index cd1d372..0000000 --- a/0061-remove-all_partitions-option.patch +++ /dev/null @@ -1,363 +0,0 @@ -From 1f084fe5811ce251d516a8022f8c7c27d0ef1f53 Mon Sep 17 00:00:00 2001 -From: Kay Sievers -Date: Tue, 13 Apr 2010 08:52:48 +0200 -Subject: [PATCH 61/65] remove "all_partitions" option - -We can not predict the major/minor of non-existing devices: - $ grep . /sys/class/block/sd*/dev - /sys/class/block/sda1/dev:259:524288 - /sys/class/block/sda2/dev:259:262144 - /sys/class/block/sda3/dev:259:786432 - /sys/class/block/sda4/dev:259:131072 - /sys/class/block/sda/dev:259:0 - /sys/class/block/sdb/dev:259:655360 - /sys/class/block/sdc/dev:259:393216 - -If this functionality is still needed for some broken hardware, it needs to be -solved with a tool not part of the udev package. Because such option is unreliable -and unsafe to use. ---- - NEWS | 7 +++++- - libudev/libudev-device-private.c | 4 --- - libudev/libudev-device.c | 17 --------------- - libudev/libudev-private.h | 2 - - test/udev-test.pl | 43 -------------------------------------- - udev/udev-node.c | 35 ------------------------------ - udev/udev-rules.c | 23 -------------------- - udev/udev.xml | 8 ------- - udev/udevadm-info.c | 4 --- - 9 files changed, 6 insertions(+), 137 deletions(-) - -diff --git a/NEWS b/NEWS -index c5fbbe1..c422eaa 100644 ---- a/NEWS -+++ b/NEWS -@@ -2,9 +2,14 @@ udev 152 - ======== - Bugfixes. - --"udevadm trigger" default to "change" events now, instead of "add" -+"udevadm trigger" defaults to "change" events now, instead of "add" - events. - -+The option "all_partitons" was removed from udev. This should not be -+needed for usual hardware. Udev can not safely make assumptions -+about non-exixting partition major/minor numbers, and therefore no -+longer provide such an unreliable and unsafe option. -+ - All "add|change" matches are replaced by "!remove" in the rules and - in the udev logic. All types of events will update possible symlinks - and permissions, only "remove" is handled special now. -diff --git a/libudev/libudev-device-private.c b/libudev/libudev-device-private.c -index 1bcf441..19c20b2 100644 ---- a/libudev/libudev-device-private.c -+++ b/libudev/libudev-device-private.c -@@ -41,8 +41,6 @@ int udev_device_update_db(struct udev_device *udev_device) - udev_list_entry_foreach(list_entry, udev_device_get_properties_list_entry(udev_device)) - if (udev_list_entry_get_flags(list_entry)) - goto file; -- if (udev_device_get_num_fake_partitions(udev_device) != 0) -- goto file; - if (udev_device_get_ignore_remove(udev_device)) - goto file; - if (udev_device_get_devlink_priority(udev_device) != 0) -@@ -95,8 +93,6 @@ file: - fprintf(f, "L:%i\n", udev_device_get_devlink_priority(udev_device)); - if (udev_device_get_event_timeout(udev_device) >= 0) - fprintf(f, "T:%i\n", udev_device_get_event_timeout(udev_device)); -- if (udev_device_get_num_fake_partitions(udev_device) != 0) -- fprintf(f, "A:%i\n", udev_device_get_num_fake_partitions(udev_device)); - if (udev_device_get_ignore_remove(udev_device)) - fprintf(f, "R:%i\n", udev_device_get_ignore_remove(udev_device)); - if (udev_device_get_watch_handle(udev_device) >= 0) -diff --git a/libudev/libudev-device.c b/libudev/libudev-device.c -index 410f75b..75cc61c 100644 ---- a/libudev/libudev-device.c -+++ b/libudev/libudev-device.c -@@ -63,7 +63,6 @@ struct udev_device { - unsigned long long int seqnum; - int event_timeout; - int timeout; -- int num_fake_partitions; - int devlink_priority; - int refcount; - dev_t devnum; -@@ -284,9 +283,6 @@ int udev_device_read_db(struct udev_device *udev_device) - case 'T': - udev_device_set_event_timeout(udev_device, atoi(val)); - break; -- case 'A': -- udev_device_set_num_fake_partitions(udev_device, atoi(val)); -- break; - case 'R': - udev_device_set_ignore_remove(udev_device, atoi(val)); - break; -@@ -1425,19 +1421,6 @@ int udev_device_set_devnum(struct udev_device *udev_device, dev_t devnum) - return 0; - } - --int udev_device_get_num_fake_partitions(struct udev_device *udev_device) --{ -- if (!udev_device->info_loaded) -- device_load_info(udev_device); -- return udev_device->num_fake_partitions; --} -- --int udev_device_set_num_fake_partitions(struct udev_device *udev_device, int num) --{ -- udev_device->num_fake_partitions = num; -- return 0; --} -- - int udev_device_get_devlink_priority(struct udev_device *udev_device) - { - if (!udev_device->info_loaded) -diff --git a/libudev/libudev-private.h b/libudev/libudev-private.h -index 3f2861f..bf9e923 100644 ---- a/libudev/libudev-private.h -+++ b/libudev/libudev-private.h -@@ -93,8 +93,6 @@ int udev_device_get_event_timeout(struct udev_device *udev_device); - int udev_device_set_event_timeout(struct udev_device *udev_device, int event_timeout); - int udev_device_set_devnum(struct udev_device *udev_device, dev_t devnum); - int udev_device_set_seqnum(struct udev_device *udev_device, unsigned long long int seqnum); --int udev_device_get_num_fake_partitions(struct udev_device *udev_device); --int udev_device_set_num_fake_partitions(struct udev_device *udev_device, int num); - int udev_device_get_devlink_priority(struct udev_device *udev_device); - int udev_device_set_devlink_priority(struct udev_device *udev_device, int prio); - int udev_device_get_ignore_remove(struct udev_device *udev_device); -diff --git a/test/udev-test.pl b/test/udev-test.pl -index aeca948..4633d6b 100755 ---- a/test/udev-test.pl -+++ b/test/udev-test.pl -@@ -493,16 +493,6 @@ SUBSYSTEMS=="foo", PROGRAM=="/bin/echo -n foo-%b", SYMLINK+="%c" - EOF - }, - { -- desc => "create all possible partitions", -- subsys => "block", -- devpath => "/devices/pci0000:00/0000:00:1f.2/host0/target0:0:0/0:0:0:0/block/sda", -- exp_name => "sda15" , -- exp_majorminor => "8:15", -- rules => < "sysfs parent hierarchy", - subsys => "tty", - devpath => "/devices/pci0000:00/0000:00:1d.7/usb5/5-2/5-2:1.0/tty/ttyACM0", -@@ -988,28 +978,6 @@ SUBSYSTEMS=="scsi", PROGRAM=="/bin/echo -n node link1 link2 link3 link4", RESULT - EOF - }, - { -- desc => "all_partitions, option-only rule", -- subsys => "block", -- devpath => "/devices/pci0000:00/0000:00:1f.2/host0/target0:0:0/0:0:0:0/block/sda", -- exp_name => "node6", -- exp_rem_error => "yes", -- rules => < "all_partitions, option-only rule (fail on partition)", -- subsys => "block", -- devpath => "/devices/pci0000:00/0000:00:1f.2/host0/target0:0:0/0:0:0:0/block/sda/sda1", -- exp_name => "node6", -- exp_add_error => "yes", -- rules => < "ignore remove event test", - subsys => "block", - devpath => "/devices/pci0000:00/0000:00:1f.2/host0/target0:0:0/0:0:0:0/block/sda", -@@ -1020,17 +988,6 @@ SUBSYSTEMS=="scsi", KERNEL=="sda", SYMLINK+="node", OPTIONS="ignore_remove" - EOF - }, - { -- desc => "ignore remove event test (with all partitions)", -- subsys => "block", -- devpath => "/devices/pci0000:00/0000:00:1f.2/host0/target0:0:0/0:0:0:0/block/sda", -- exp_name => "sda14", -- exp_rem_error => "yes", -- option => "clean", -- rules => < "SUBSYSTEM match test", - subsys => "block", - devpath => "/devices/pci0000:00/0000:00:1f.2/host0/target0:0:0/0:0:0:0/block/sda", -diff --git a/udev/udev-node.c b/udev/udev-node.c -index 3b4eb5f..4492c2e 100644 ---- a/udev/udev-node.c -+++ b/udev/udev-node.c -@@ -365,8 +365,6 @@ void udev_node_update_old_links(struct udev_device *dev, struct udev_device *dev - int udev_node_add(struct udev_device *dev, mode_t mode, uid_t uid, gid_t gid) - { - struct udev *udev = udev_device_get_udev(dev); -- int i; -- int num; - struct udev_list_entry *list_entry; - int err = 0; - -@@ -380,23 +378,6 @@ int udev_node_add(struct udev_device *dev, mode_t mode, uid_t uid, gid_t gid) - goto exit; - } - -- /* create all_partitions if requested */ -- num = udev_device_get_num_fake_partitions(dev); -- if (num > 0) { -- info(udev, "creating device partition nodes '%s[1-%i]'\n", udev_device_get_devnode(dev), num); -- for (i = 1; i <= num; i++) { -- char partitionname[UTIL_PATH_SIZE]; -- dev_t part_devnum; -- -- snprintf(partitionname, sizeof(partitionname), "%s%d", -- udev_device_get_devnode(dev), i); -- partitionname[sizeof(partitionname)-1] = '\0'; -- part_devnum = makedev(major(udev_device_get_devnum(dev)), -- minor(udev_device_get_devnum(dev)) + i); -- udev_node_mknod(dev, partitionname, part_devnum, mode, uid, gid); -- } -- } -- - /* create/update symlinks, add symlinks to name index */ - udev_list_entry_foreach(list_entry, udev_device_get_devlinks_list_entry(dev)) { - if (udev_list_entry_get_flags(list_entry)) -@@ -414,10 +395,8 @@ int udev_node_remove(struct udev_device *dev) - struct udev *udev = udev_device_get_udev(dev); - struct udev_list_entry *list_entry; - const char *devnode; -- char partitionname[UTIL_PATH_SIZE]; - struct stat stats; - int err = 0; -- int num; - - /* remove/update symlinks, remove symlinks from name index */ - udev_list_entry_foreach(list_entry, udev_device_get_devlinks_list_entry(dev)) -@@ -451,20 +430,6 @@ int udev_node_remove(struct udev_device *dev) - udev_device_unref(dev_check); - } - -- num = udev_device_get_num_fake_partitions(dev); -- if (num > 0) { -- int i; -- -- info(udev, "removing all_partitions '%s[1-%i]'\n", devnode, num); -- if (num > 255) -- return -1; -- for (i = 1; i <= num; i++) { -- snprintf(partitionname, sizeof(partitionname), "%s%d", devnode, i); -- partitionname[sizeof(partitionname)-1] = '\0'; -- util_unlink_secure(udev, partitionname); -- } -- } -- - util_delete_path(udev, devnode); - return err; - } -diff --git a/udev/udev-rules.c b/udev/udev-rules.c -index 0361f68..a4a86b6 100644 ---- a/udev/udev-rules.c -+++ b/udev/udev-rules.c -@@ -196,7 +196,6 @@ struct token { - mode_t mode; - uid_t uid; - gid_t gid; -- int num_fake_part; - int devlink_prio; - int event_timeout; - int watch; -@@ -371,9 +370,6 @@ static void dump_token(struct udev_rules *rules, struct token *token) - case TK_A_INOTIFY_WATCH: - dbg(rules->udev, "%s %u\n", token_str(type), token->key.watch); - break; -- case TK_A_NUM_FAKE_PART: -- dbg(rules->udev, "%s %u\n", token_str(type), token->key.num_fake_part); -- break; - case TK_A_DEVLINK_PRIO: - dbg(rules->udev, "%s %s %u\n", token_str(type), operation_str(op), token->key.devlink_prio); - break; -@@ -1469,12 +1465,6 @@ static int add_rule(struct udev_rules *rules, char *line, - rule_add_key(&rule_tmp, TK_A_NAME, op, value, NULL); - attr = get_key_attribute(rules->udev, key + sizeof("NAME")-1); - if (attr != NULL) { -- if (strstr(attr, "all_partitions") != NULL) { -- int num = DEFAULT_FAKE_PARTITIONS_COUNT; -- -- dbg(rules->udev, "creation of partition nodes requested\n"); -- rule_add_key(&rule_tmp, TK_A_NUM_FAKE_PART, 0, NULL, &num); -- } - if (strstr(attr, "ignore_remove") != NULL) { - dbg(rules->udev, "remove event should be ignored\n"); - rule_add_key(&rule_tmp, TK_A_IGNORE_REMOVE, 0, NULL, NULL); -@@ -1576,12 +1566,6 @@ static int add_rule(struct udev_rules *rules, char *line, - else if (strncmp(pos, "replace", strlen("replace")) == 0) - rule_add_key(&rule_tmp, TK_A_STRING_ESCAPE_REPLACE, 0, NULL, NULL); - } -- if (strstr(value, "all_partitions") != NULL) { -- int num = DEFAULT_FAKE_PARTITIONS_COUNT; -- -- rule_add_key(&rule_tmp, TK_A_NUM_FAKE_PART, 0, NULL, &num); -- dbg(rules->udev, "creation of partition nodes requested\n"); -- } - pos = strstr(value, "nowatch"); - if (pos != NULL) { - const int off = 0; -@@ -2331,13 +2315,6 @@ int udev_rules_apply_to_event(struct udev_rules *rules, struct udev_event *event - case TK_A_STRING_ESCAPE_REPLACE: - esc = ESCAPE_REPLACE; - break; -- case TK_A_NUM_FAKE_PART: -- if (strcmp(udev_device_get_subsystem(event->dev), "block") != 0) -- break; -- if (udev_device_get_sysnum(event->dev) != NULL) -- break; -- udev_device_set_num_fake_partitions(event->dev, cur->key.num_fake_part); -- break; - case TK_A_INOTIFY_WATCH: - event->inotify_watch = cur->key.watch; - break; -diff --git a/udev/udev.xml b/udev/udev.xml -index 175cdbe..9275e0f 100644 ---- a/udev/udev.xml -+++ b/udev/udev.xml -@@ -450,14 +450,6 @@ - - - -- -- -- Create the device nodes for all available partitions of a block device. -- This may be useful for removable media devices where media changes are not -- detected. -- -- -- - - - Number of seconds an event will wait for operations to finish, before it -diff --git a/udev/udevadm-info.c b/udev/udevadm-info.c -index 4711409..c57620f 100644 ---- a/udev/udevadm-info.c -+++ b/udev/udevadm-info.c -@@ -142,10 +142,6 @@ static void print_record(struct udev_device *device) - if (i != 0) - printf("L: %i\n", i); - -- i = udev_device_get_num_fake_partitions(device); -- if (i != 0) -- printf("A: %u\n", i); -- - i = udev_device_get_ignore_remove(device); - if (i != 0) - printf("R: %u\n", i); --- -1.6.6 - diff --git a/0062-cdrom_id-Fix-uninitialized-variables.patch b/0062-cdrom_id-Fix-uninitialized-variables.patch deleted file mode 100644 index 1caba57..0000000 --- a/0062-cdrom_id-Fix-uninitialized-variables.patch +++ /dev/null @@ -1,131 +0,0 @@ -From 816e6bf0fb0849d03696a4b4ec2334e35e819425 Mon Sep 17 00:00:00 2001 -From: Martin Pitt -Date: Tue, 13 Apr 2010 10:49:24 +0200 -Subject: [PATCH 62/65] cdrom_id: Fix uninitialized variables - -In cases where cdrom_id does not go through the entire code path and one of the -probing functions returns -1 or exits early, the remaining variables were never -initialized. This caused effects like "phantom" audio CDs on empty drives, or -bogus data like ID_CDROM_MEDIA_TRACK_COUNT=22528. - -Initialize the variables right away to avoid that. - -Bug-Ubuntu: https://launchpad.net/bugs/559723 ---- - extras/cdrom_id/cdrom_id.c | 96 ++++++++++++++++++++++---------------------- - 1 files changed, 48 insertions(+), 48 deletions(-) - -diff --git a/extras/cdrom_id/cdrom_id.c b/extras/cdrom_id/cdrom_id.c -index 894a890..db3867c 100644 ---- a/extras/cdrom_id/cdrom_id.c -+++ b/extras/cdrom_id/cdrom_id.c -@@ -56,57 +56,57 @@ static void log_fn(struct udev *udev, int priority, - } - - /* device info */ --static unsigned int cd_cd_rom; --static unsigned int cd_cd_r; --static unsigned int cd_cd_rw; --static unsigned int cd_dvd_rom; --static unsigned int cd_dvd_r; --static unsigned int cd_dvd_rw; --static unsigned int cd_dvd_ram; --static unsigned int cd_dvd_plus_r; --static unsigned int cd_dvd_plus_rw; --static unsigned int cd_dvd_plus_r_dl; --static unsigned int cd_dvd_plus_rw_dl; --static unsigned int cd_bd; --static unsigned int cd_bd_r; --static unsigned int cd_bd_re; --static unsigned int cd_hddvd; --static unsigned int cd_hddvd_r; --static unsigned int cd_hddvd_rw; --static unsigned int cd_mo; --static unsigned int cd_mrw; --static unsigned int cd_mrw_w; -+static unsigned int cd_cd_rom = 0; -+static unsigned int cd_cd_r = 0; -+static unsigned int cd_cd_rw = 0; -+static unsigned int cd_dvd_rom = 0; -+static unsigned int cd_dvd_r = 0; -+static unsigned int cd_dvd_rw = 0; -+static unsigned int cd_dvd_ram = 0; -+static unsigned int cd_dvd_plus_r = 0; -+static unsigned int cd_dvd_plus_rw = 0; -+static unsigned int cd_dvd_plus_r_dl = 0; -+static unsigned int cd_dvd_plus_rw_dl = 0; -+static unsigned int cd_bd = 0; -+static unsigned int cd_bd_r = 0; -+static unsigned int cd_bd_re = 0; -+static unsigned int cd_hddvd = 0; -+static unsigned int cd_hddvd_r = 0; -+static unsigned int cd_hddvd_rw = 0; -+static unsigned int cd_mo = 0; -+static unsigned int cd_mrw = 0; -+static unsigned int cd_mrw_w = 0; - - /* media info */ --static unsigned int cd_media; --static unsigned int cd_media_cd_rom; --static unsigned int cd_media_cd_r; --static unsigned int cd_media_cd_rw; --static unsigned int cd_media_dvd_rom; --static unsigned int cd_media_dvd_r; --static unsigned int cd_media_dvd_rw; --static unsigned int cd_media_dvd_ram; --static unsigned int cd_media_dvd_plus_r; --static unsigned int cd_media_dvd_plus_rw; --static unsigned int cd_media_dvd_plus_r_dl; --static unsigned int cd_media_dvd_plus_rw_dl; --static unsigned int cd_media_bd; --static unsigned int cd_media_bd_r; --static unsigned int cd_media_bd_re; --static unsigned int cd_media_hddvd; --static unsigned int cd_media_hddvd_r; --static unsigned int cd_media_hddvd_rw; --static unsigned int cd_media_mo; --static unsigned int cd_media_mrw; --static unsigned int cd_media_mrw_w; -- --static const char *cd_media_state; --static unsigned int cd_media_session_next; --static unsigned int cd_media_session_count; --static unsigned int cd_media_track_count; --static unsigned int cd_media_track_count_data; --static unsigned int cd_media_track_count_audio; --static unsigned long long int cd_media_session_last_offset; -+static unsigned int cd_media = 0; -+static unsigned int cd_media_cd_rom = 0; -+static unsigned int cd_media_cd_r = 0; -+static unsigned int cd_media_cd_rw = 0; -+static unsigned int cd_media_dvd_rom = 0; -+static unsigned int cd_media_dvd_r = 0; -+static unsigned int cd_media_dvd_rw = 0; -+static unsigned int cd_media_dvd_ram = 0; -+static unsigned int cd_media_dvd_plus_r = 0; -+static unsigned int cd_media_dvd_plus_rw = 0; -+static unsigned int cd_media_dvd_plus_r_dl = 0; -+static unsigned int cd_media_dvd_plus_rw_dl = 0; -+static unsigned int cd_media_bd = 0; -+static unsigned int cd_media_bd_r = 0; -+static unsigned int cd_media_bd_re = 0; -+static unsigned int cd_media_hddvd = 0; -+static unsigned int cd_media_hddvd_r = 0; -+static unsigned int cd_media_hddvd_rw = 0; -+static unsigned int cd_media_mo = 0; -+static unsigned int cd_media_mrw = 0; -+static unsigned int cd_media_mrw_w = 0; -+ -+static const char *cd_media_state = NULL; -+static unsigned int cd_media_session_next = 0; -+static unsigned int cd_media_session_count = 0; -+static unsigned int cd_media_track_count = 0; -+static unsigned int cd_media_track_count_data = 0; -+static unsigned int cd_media_track_count_audio = 0; -+static unsigned long long int cd_media_session_last_offset = 0; - - #define ERRCODE(s) ((((s)[2] & 0x0F) << 16) | ((s)[12] << 8) | ((s)[13])) - #define SK(errcode) (((errcode) >> 16) & 0xF) --- -1.6.6 - diff --git a/0063-rules-call-modprobe-on-all-events-but-remove.patch b/0063-rules-call-modprobe-on-all-events-but-remove.patch deleted file mode 100644 index 97ce921..0000000 --- a/0063-rules-call-modprobe-on-all-events-but-remove.patch +++ /dev/null @@ -1,36 +0,0 @@ -From 06ba47d8336c6d017a67d11f480341db07b9bc4b Mon Sep 17 00:00:00 2001 -From: Kay Sievers -Date: Tue, 13 Apr 2010 12:12:08 +0200 -Subject: [PATCH 63/65] rules: call modprobe on all events but "remove" - ---- - rules/rules.d/50-udev-default.rules | 3 --- - rules/rules.d/80-drivers.rules | 2 +- - 2 files changed, 1 insertions(+), 4 deletions(-) - -diff --git a/rules/rules.d/50-udev-default.rules b/rules/rules.d/50-udev-default.rules -index a5f0823..7e09ea1 100644 ---- a/rules/rules.d/50-udev-default.rules -+++ b/rules/rules.d/50-udev-default.rules -@@ -112,6 +112,3 @@ SUBSYSTEM=="rtc", DRIVERS=="rtc_cmos", SYMLINK+="rtc" - KERNEL=="mmtimer", MODE="0644" - KERNEL=="rflash[0-9]*", MODE="0400" - KERNEL=="rrom[0-9]*", MODE="0400" -- --# do not delete static device nodes --ACTION=="remove", NAME=="", TEST=="/lib/udev/devices/%k", OPTIONS+="ignore_remove" -diff --git a/rules/rules.d/80-drivers.rules b/rules/rules.d/80-drivers.rules -index d0485e1..86eb918 100644 ---- a/rules/rules.d/80-drivers.rules -+++ b/rules/rules.d/80-drivers.rules -@@ -1,6 +1,6 @@ - # do not edit this file, it will be overwritten on update - --ACTION!="add", GOTO="drivers_end" -+ACTION=="remove", GOTO="drivers_end" - - DRIVER!="?*", ENV{MODALIAS}=="?*", RUN+="/sbin/modprobe -b $env{MODALIAS}" - SUBSYSTEM=="tifm", ENV{TIFM_CARD_TYPE}=="SD", RUN+="/sbin/modprobe -b tifm_sd" --- -1.6.6 - diff --git a/0064-remove-ignore_remove-option.patch b/0064-remove-ignore_remove-option.patch deleted file mode 100644 index a1e8046..0000000 --- a/0064-remove-ignore_remove-option.patch +++ /dev/null @@ -1,273 +0,0 @@ -From a89d342dfb45b54e29381af9dbc495bbb2b057af Mon Sep 17 00:00:00 2001 -From: Kay Sievers -Date: Tue, 13 Apr 2010 12:45:38 +0200 -Subject: [PATCH 64/65] remove "ignore_remove" option - ---- - NEWS | 6 ++++++ - libudev/libudev-device-private.c | 4 ---- - libudev/libudev-device.c | 17 ----------------- - libudev/libudev-private.h | 2 -- - test/udev-test.pl | 10 ---------- - udev/udev-node.c | 38 ++++++++++++++++++++++---------------- - udev/udev-rules.c | 14 -------------- - udev/udev.xml | 7 ------- - udev/udevadm-info.c | 4 ---- - 9 files changed, 28 insertions(+), 74 deletions(-) - -diff --git a/NEWS b/NEWS -index c422eaa..ea5c19d 100644 ---- a/NEWS -+++ b/NEWS -@@ -10,6 +10,12 @@ needed for usual hardware. Udev can not safely make assumptions - about non-exixting partition major/minor numbers, and therefore no - longer provide such an unreliable and unsafe option. - -+The option "ignore_remove" was removed from udev. With devtmpfs -+udev passed control over device nodes to the kernel. This option -+should no longer be needed, or can not work as advertised. Neither -+udev nor the kernel will remove device nodes which are copied from -+the /lib/udev/devices/ directory. -+ - All "add|change" matches are replaced by "!remove" in the rules and - in the udev logic. All types of events will update possible symlinks - and permissions, only "remove" is handled special now. -diff --git a/libudev/libudev-device-private.c b/libudev/libudev-device-private.c -index 19c20b2..5e4381e 100644 ---- a/libudev/libudev-device-private.c -+++ b/libudev/libudev-device-private.c -@@ -41,8 +41,6 @@ int udev_device_update_db(struct udev_device *udev_device) - udev_list_entry_foreach(list_entry, udev_device_get_properties_list_entry(udev_device)) - if (udev_list_entry_get_flags(list_entry)) - goto file; -- if (udev_device_get_ignore_remove(udev_device)) -- goto file; - if (udev_device_get_devlink_priority(udev_device) != 0) - goto file; - if (udev_device_get_event_timeout(udev_device) >= 0) -@@ -93,8 +91,6 @@ file: - fprintf(f, "L:%i\n", udev_device_get_devlink_priority(udev_device)); - if (udev_device_get_event_timeout(udev_device) >= 0) - fprintf(f, "T:%i\n", udev_device_get_event_timeout(udev_device)); -- if (udev_device_get_ignore_remove(udev_device)) -- fprintf(f, "R:%i\n", udev_device_get_ignore_remove(udev_device)); - if (udev_device_get_watch_handle(udev_device) >= 0) - fprintf(f, "W:%i\n", udev_device_get_watch_handle(udev_device)); - udev_list_entry_foreach(list_entry, udev_device_get_properties_list_entry(udev_device)) { -diff --git a/libudev/libudev-device.c b/libudev/libudev-device.c -index 75cc61c..b3b6a63 100644 ---- a/libudev/libudev-device.c -+++ b/libudev/libudev-device.c -@@ -75,7 +75,6 @@ struct udev_device { - unsigned int envp_uptodate:1; - unsigned int driver_set:1; - unsigned int info_loaded:1; -- unsigned int ignore_remove:1; - }; - - struct udev_list_entry *udev_device_add_property(struct udev_device *udev_device, const char *key, const char *value) -@@ -283,9 +282,6 @@ int udev_device_read_db(struct udev_device *udev_device) - case 'T': - udev_device_set_event_timeout(udev_device, atoi(val)); - break; -- case 'R': -- udev_device_set_ignore_remove(udev_device, atoi(val)); -- break; - case 'E': - udev_device_add_property_from_string(udev_device, val); - break; -@@ -1434,19 +1430,6 @@ int udev_device_set_devlink_priority(struct udev_device *udev_device, int prio) - return 0; - } - --int udev_device_get_ignore_remove(struct udev_device *udev_device) --{ -- if (!udev_device->info_loaded) -- device_load_info(udev_device); -- return udev_device->ignore_remove; --} -- --int udev_device_set_ignore_remove(struct udev_device *udev_device, int ignore) --{ -- udev_device->ignore_remove = ignore; -- return 0; --} -- - int udev_device_get_watch_handle(struct udev_device *udev_device) - { - if (!udev_device->info_loaded) -diff --git a/libudev/libudev-private.h b/libudev/libudev-private.h -index bf9e923..8dc469e 100644 ---- a/libudev/libudev-private.h -+++ b/libudev/libudev-private.h -@@ -95,8 +95,6 @@ int udev_device_set_devnum(struct udev_device *udev_device, dev_t devnum); - int udev_device_set_seqnum(struct udev_device *udev_device, unsigned long long int seqnum); - int udev_device_get_devlink_priority(struct udev_device *udev_device); - int udev_device_set_devlink_priority(struct udev_device *udev_device, int prio); --int udev_device_get_ignore_remove(struct udev_device *udev_device); --int udev_device_set_ignore_remove(struct udev_device *udev_device, int ignore); - int udev_device_get_watch_handle(struct udev_device *udev_device); - int udev_device_set_watch_handle(struct udev_device *udev_device, int handle); - void udev_device_set_info_loaded(struct udev_device *device); -diff --git a/test/udev-test.pl b/test/udev-test.pl -index 4633d6b..a4d3a72 100755 ---- a/test/udev-test.pl -+++ b/test/udev-test.pl -@@ -978,16 +978,6 @@ SUBSYSTEMS=="scsi", PROGRAM=="/bin/echo -n node link1 link2 link3 link4", RESULT - EOF - }, - { -- desc => "ignore remove event test", -- subsys => "block", -- devpath => "/devices/pci0000:00/0000:00:1f.2/host0/target0:0:0/0:0:0:0/block/sda", -- exp_name => "node", -- exp_rem_error => "yes", -- rules => < "SUBSYSTEM match test", - subsys => "block", - devpath => "/devices/pci0000:00/0000:00:1f.2/host0/target0:0:0/0:0:0:0/block/sda", -diff --git a/udev/udev-node.c b/udev/udev-node.c -index 4492c2e..34de268 100644 ---- a/udev/udev-node.c -+++ b/udev/udev-node.c -@@ -396,6 +396,8 @@ int udev_node_remove(struct udev_device *dev) - struct udev_list_entry *list_entry; - const char *devnode; - struct stat stats; -+ struct udev_device *dev_check; -+ char filename[UTIL_PATH_SIZE]; - int err = 0; - - /* remove/update symlinks, remove symlinks from name index */ -@@ -404,32 +406,36 @@ int udev_node_remove(struct udev_device *dev) - - devnode = udev_device_get_devnode(dev); - if (devnode == NULL) -- return 0; -+ goto out; -+ - if (stat(devnode, &stats) != 0) { - info(udev, "device node '%s' not found\n", devnode); -- return 0; -+ goto out; - } -+ - if (stats.st_rdev != udev_device_get_devnum(dev)) { - info(udev, "device node '%s' points to a different device, skip removal\n", devnode); -- return -1; -+ err = -1; -+ goto out; - } - -- if (udev_device_get_ignore_remove(dev)) { -- info(udev, "ignore_remove for '%s'\n", udev_device_get_devnode(dev)); -- } else { -- struct udev_device *dev_check; -- -- dev_check = udev_device_new_from_syspath(udev, udev_device_get_syspath(dev)); -- if (dev_check != NULL && stats.st_rdev == udev_device_get_devnum(dev_check)) { -- /* do not remove device node if the same sys-device is re-created in the meantime */ -- info(udev, "keeping device node of existing device'%s'\n", devnode); -- } else { -- info(udev, "removing device node '%s'\n", devnode); -- err = util_unlink_secure(udev, devnode); -- } -+ dev_check = udev_device_new_from_syspath(udev, udev_device_get_syspath(dev)); -+ if (dev_check != NULL) { -+ /* do not remove device node if the same sys-device is re-created in the meantime */ -+ info(udev, "keeping device node of existing device'%s'\n", devnode); - udev_device_unref(dev_check); -+ goto out; -+ } -+ -+ util_strscpyl(filename, sizeof(filename), LIBEXECDIR "/devices", &devnode[strlen(udev_get_dev_path(udev))], NULL); -+ if (stat(filename, &stats) == 0 || stats.st_rdev == udev_device_get_devnum(dev)) { -+ info(udev, "static device entry found '%s', skip removal\n", devnode); -+ goto out; - } - -+ info(udev, "removing device node '%s'\n", devnode); -+ err = util_unlink_secure(udev, devnode); - util_delete_path(udev, devnode); -+out: - return err; - } -diff --git a/udev/udev-rules.c b/udev/udev-rules.c -index a4a86b6..4f18aca 100644 ---- a/udev/udev-rules.c -+++ b/udev/udev-rules.c -@@ -1463,13 +1463,6 @@ static int add_rule(struct udev_rules *rules, char *line, - err(rules->udev, "NAME=\"%%k\" is superfluous and breaks " - "kernel supplied names, please remove it from %s:%u\n", filename, lineno); - rule_add_key(&rule_tmp, TK_A_NAME, op, value, NULL); -- attr = get_key_attribute(rules->udev, key + sizeof("NAME")-1); -- if (attr != NULL) { -- if (strstr(attr, "ignore_remove") != NULL) { -- dbg(rules->udev, "remove event should be ignored\n"); -- rule_add_key(&rule_tmp, TK_A_IGNORE_REMOVE, 0, NULL, NULL); -- } -- } - } - rule_tmp.rule.rule.flags = 1; - continue; -@@ -1540,10 +1533,6 @@ static int add_rule(struct udev_rules *rules, char *line, - if (strcmp(key, "OPTIONS") == 0) { - const char *pos; - -- if (strstr(value, "ignore_remove") != NULL) { -- dbg(rules->udev, "remove event should be ignored\n"); -- rule_add_key(&rule_tmp, TK_A_IGNORE_REMOVE, 0, NULL, NULL); -- } - pos = strstr(value, "link_priority="); - if (pos != NULL) { - int prio = atoi(&pos[strlen("link_priority=")]); -@@ -2501,9 +2490,6 @@ int udev_rules_apply_to_event(struct udev_rules *rules, struct udev_event *event - case TK_A_EVENT_TIMEOUT: - udev_device_set_event_timeout(event->dev, cur->key.event_timeout); - break; -- case TK_A_IGNORE_REMOVE: -- udev_device_set_ignore_remove(event->dev, 1); -- break; - case TK_A_ATTR: - { - const char *key_name = &rules->buf[cur->key.attr_off]; -diff --git a/udev/udev.xml b/udev/udev.xml -index 9275e0f..dce953d 100644 ---- a/udev/udev.xml -+++ b/udev/udev.xml -@@ -436,13 +436,6 @@ - Rule and device options: - - -- -- -- Do not remove the device node when the device goes away. This may be -- useful as a workaround for broken device drivers. -- -- -- - - - Specify the priority of the created symlinks. Devices with higher -diff --git a/udev/udevadm-info.c b/udev/udevadm-info.c -index c57620f..5f6209a 100644 ---- a/udev/udevadm-info.c -+++ b/udev/udevadm-info.c -@@ -142,10 +142,6 @@ static void print_record(struct udev_device *device) - if (i != 0) - printf("L: %i\n", i); - -- i = udev_device_get_ignore_remove(device); -- if (i != 0) -- printf("R: %u\n", i); -- - i = udev_device_get_watch_handle(device); - if (i >= 0) - printf("W: %u\n", i); --- -1.6.6 - diff --git a/0065-cdrom_id-Fix-uninitialized-buffers.patch b/0065-cdrom_id-Fix-uninitialized-buffers.patch deleted file mode 100644 index 310e3c6..0000000 --- a/0065-cdrom_id-Fix-uninitialized-buffers.patch +++ /dev/null @@ -1,82 +0,0 @@ -From 2b861dc92757b9a3214c2b8e9d8b1c3f3c162391 Mon Sep 17 00:00:00 2001 -From: Martin Pitt -Date: Tue, 13 Apr 2010 15:25:48 +0200 -Subject: [PATCH 65/65] cdrom_id: Fix uninitialized buffers - -Commit 5c6954f is actually a no-op, since static variables are already zero'ed -by default anyway (but we keep it for clarity). The real difference was that a -build with -O0 wor while a build with -O2 didn't. - -Turns out that some ioctls do not actually touch the result buffer in some -cases, so we need to zero the result buffers to avoid interpreting random da as -CD properties. - -https://launchpad.net/bugs/559723 -https://launchpad.net/bugs/561585 ---- - extras/cdrom_id/cdrom_id.c | 7 +++++++ - 1 files changed, 7 insertions(+), 0 deletions(-) - -diff --git a/extras/cdrom_id/cdrom_id.c b/extras/cdrom_id/cdrom_id.c -index db3867c..b6797cd 100644 ---- a/extras/cdrom_id/cdrom_id.c -+++ b/extras/cdrom_id/cdrom_id.c -@@ -237,6 +237,7 @@ static int cd_inquiry(struct udev *udev, int fd) { - unsigned char inq[128]; - int err; - -+ memset (inq, 0, sizeof (inq)); - scsi_cmd_set(udev, &sc, 0, 0x12); - scsi_cmd_set(udev, &sc, 4, 36); - scsi_cmd_set(udev, &sc, 5, 0); -@@ -265,6 +266,7 @@ static int cd_profiles(struct udev *udev, int fd) - unsigned int i; - int err; - -+ memset (header, 0, sizeof (header)); - scsi_cmd_set(udev, &sc, 0, 0x46); - scsi_cmd_set(udev, &sc, 1, 0); - scsi_cmd_set(udev, &sc, 8, sizeof(header)); -@@ -282,6 +284,7 @@ static int cd_profiles(struct udev *udev, int fd) - return -1; - } - -+ memset (profiles, 0, sizeof (profiles)); - scsi_cmd_set(udev, &sc, 0, 0x46); - scsi_cmd_set(udev, &sc, 1, 1); - scsi_cmd_set(udev, &sc, 6, len >> 16); -@@ -440,6 +443,7 @@ static int cd_media_info(struct udev *udev, int fd) - }; - int err; - -+ memset (header, 0, sizeof (header)); - scsi_cmd_set(udev, &sc, 0, 0x51); - scsi_cmd_set(udev, &sc, 8, sizeof(header)); - scsi_cmd_set(udev, &sc, 9, 0); -@@ -472,6 +476,7 @@ static int cd_media_toc(struct udev *udev, int fd) - unsigned char *p; - int err; - -+ memset (header, 0, sizeof (header)); - scsi_cmd_set(udev, &sc, 0, 0x43); - scsi_cmd_set(udev, &sc, 6, 1); - scsi_cmd_set(udev, &sc, 8, sizeof(header)); -@@ -493,6 +498,7 @@ static int cd_media_toc(struct udev *udev, int fd) - if (len < 8) - return 0; - -+ memset (toc, 0, sizeof (toc)); - scsi_cmd_set(udev, &sc, 0, 0x43); - scsi_cmd_set(udev, &sc, 6, header[2]); /* First Track/Session Number */ - scsi_cmd_set(udev, &sc, 7, len >> 8); -@@ -520,6 +526,7 @@ static int cd_media_toc(struct udev *udev, int fd) - cd_media_track_count_audio++; - } - -+ memset (header, 0, sizeof (header)); - scsi_cmd_set(udev, &sc, 0, 0x43); - scsi_cmd_set(udev, &sc, 2, 1); /* Session Info */ - scsi_cmd_set(udev, &sc, 8, 12); --- -1.6.6 - diff --git a/sources b/sources index 3161bc7..455487b 100644 --- a/sources +++ b/sources @@ -1 +1 @@ -aeae0e6273dcbec246c3c1b9868ebed1 udev-151.tar.bz2 +76d12a9d97c3409e9ef60a4288227e8f udev-153.tar.bz2 diff --git a/start_udev b/start_udev index df6c41b..72b548e 100755 --- a/start_udev +++ b/start_udev @@ -312,7 +312,7 @@ if [ -f "/sys/class/tty/console/uevent" ]; then echo "Triggering Rest" fi - /sbin/udevadm trigger + /sbin/udevadm trigger --action=add ret=$[$ret + $?] wait_for_queue $udevtimeout ret=$[$ret + $?] diff --git a/0034-add-LGPL-COPYING-to-libudev-and-GUdev.patch b/udev-153-LGPL.patch similarity index 99% rename from 0034-add-LGPL-COPYING-to-libudev-and-GUdev.patch rename to udev-153-LGPL.patch index 4b8ca14..aab0a10 100644 --- a/0034-add-LGPL-COPYING-to-libudev-and-GUdev.patch +++ b/udev-153-LGPL.patch @@ -1,14 +1,8 @@ -From 23325a66ccf3a2f90a4f5d1702f60408187de28a Mon Sep 17 00:00:00 2001 -From: Kay Sievers -Date: Thu, 18 Mar 2010 09:57:44 +0100 -Subject: [PATCH 34/65] add LGPL COPYING to libudev and GUdev +commit 23325a66ccf3a2f90a4f5d1702f60408187de28a +Author: Kay Sievers +Date: Thu Mar 18 09:57:44 2010 +0100 ---- - extras/gudev/COPYING | 504 ++++++++++++++++++++++++++++++++++++++++++++++++++ - libudev/COPYING | 504 ++++++++++++++++++++++++++++++++++++++++++++++++++ - 2 files changed, 1008 insertions(+), 0 deletions(-) - create mode 100644 extras/gudev/COPYING - create mode 100644 libudev/COPYING + add LGPL COPYING to libudev and GUdev diff --git a/extras/gudev/COPYING b/extras/gudev/COPYING new file mode 100644 @@ -1030,6 +1024,3 @@ index 0000000..8add30a +That's all there is to it! + + --- -1.6.6 - diff --git a/udev-145.tar.bz2.sign b/udev-153.tar.bz2.sign similarity index 61% rename from udev-145.tar.bz2.sign rename to udev-153.tar.bz2.sign index 23c18c4..566f6aa 100644 --- a/udev-145.tar.bz2.sign +++ b/udev-153.tar.bz2.sign @@ -2,7 +2,7 @@ Version: GnuPG v1.4.9 (GNU/Linux) Comment: See http://www.kernel.org/signature.html for info -iD8DBQBKWxhnyGugalF9Dw4RAvvjAJ9ed+RMRi8gXcFyTPxXsHZpbLSROgCfdpCc -lr5nSwsGGO9e0+wBbD7WDoc= -=5/z0 +iD8DBQBLzqFNyGugalF9Dw4RAkvzAJ4ureXWse6fF/61NaNe97mDDQMtUwCfegJi +Ar0G12dwUvDR2gYMcPTiRzs= +=vIft -----END PGP SIGNATURE----- diff --git a/udev.spec b/udev.spec index 60d3651..4183371 100644 --- a/udev.spec +++ b/udev.spec @@ -4,84 +4,38 @@ Summary: A userspace implementation of devfs Name: udev -Version: 152 -Release: 0.1.20100413git%{?dist} +Version: 153 +Release: 1.20100427git%{?dist} License: GPLv2 Group: System Environment/Base Provides: udev-persistent = %{version}-%{release} Obsoletes: udev-persistent < 0:030-5 Obsoletes: udev-extras < 20090618 Provides: udev-extras = 20090618-1 -#Source: ftp://ftp.kernel.org/pub/linux/utils/kernel/hotplug/%{name}-%{version}.tar.bz2 -Source: ftp://ftp.kernel.org/pub/linux/utils/kernel/hotplug/%{name}-151.tar.bz2 +Source: ftp://ftp.kernel.org/pub/linux/utils/kernel/hotplug/%{name}-%{version}.tar.bz2 -Patch1: 0001-firmware-fix-error-reporting-on-missing-firmware-fil.patch -Patch2: 0002-keymap-Add-Dell-Inspiron-1011-Mini-10.patch -Patch3: 0003-Fix-brightness-keys-on-MSI-Wind-U-100.patch -Patch4: 0004-keymap-Add-support-for-Gateway-AOA110-AOA150-clones.patch -Patch5: 0005-keymap-Fix-LG-X110.patch -Patch6: 0006-Force-key-release-for-volume-keys-on-Dell-Studio-155.patch -Patch7: 0007-keymap-Add-Toshiba-Satellite-M30X.patch -Patch8: 0008-libudev-export-udev_monitor_set_receive_buffer_size.patch -Patch9: 0009-udevadm-monitor-increase-netlink-buffer-size.patch -Patch10: 0010-libudev-bump-minor-version.patch -Patch11: 0011-udevadm-fix-untested-and-broken-commit-to-set-buffer.patch -Patch12: 0012-configure.ac-version-bump.patch -Patch13: 0013-keymap-Add-Samsung-Q210-P210-force-release-quirk.patch -Patch14: 0014-keymap-Add-Fujitsu-Amilo-1848-u-force-release-quirk.patch -Patch15: 0015-Decrease-buffer-size-when-advancing-past-NUL-byte.patch -Patch16: 0016-Use-UTIL_LINE_SIZE-not-UTIL_PATH_SIZE-to-truncate-pr.patch -Patch17: 0017-Increase-UTIL_LINE_SIZE-from-2048-to-16384.patch -Patch18: 0018-Fix-virtio-ports-rule-to-use-attr-instead-of-ATTR.patch -Patch19: 0019-udev-acl-Correctly-handle-ENV-ACL_MANAGE-0.patch -Patch20: 0020-udev-acl-no-not-encourage-use-of-ACL_MANAGE-outside-.patch -Patch21: 0021-input_id-Fix-linking.patch -Patch22: 0022-replace-utimes-with-utimensat.patch -Patch23: 0023-libbudev-private-rename-udev_list_entry_get_flag.patch -Patch24: 0024-udevadm-monitor-use-as-separator-in-subsystem-match-.patch -Patch25: 0025-use-major-minor-as-entries-in-symlink-stack-instead-.patch -Patch26: 0026-use-major-minor-as-entries-in-watch-directory.patch -#Patch27: 0027-libudev-docs-.gitignore-backup-files.patch -Patch28: 0028-udev-needs-automake-1.10.patch -Patch29: 0029-firmware-fix-possible-segfault-when-firmware-device-.patch -Patch30: 0030-rules-input-create-by-path-links-for-pci-devices.patch -Patch31: 0031-Fix-switching-Logitech-bluetooth-adapters-into-hci-m.patch -Patch32: 0032-do-not-reset-SELinux-context-when-the-node-was-not-t.patch -Patch33: 0033-libudev-add-udev_device_new_from_environment.patch -Patch34: 0034-add-LGPL-COPYING-to-libudev-and-GUdev.patch -Patch35: 0035-cdrom_id-open-non-mounted-optical-media-with-O_EXCL.patch -Patch36: 0036-modeswitch-morph-into-tool-that-only-switches-Mobile.patch -Patch37: 0037-rules-virtio-fix-is-to-check-if-the-name-attribute-i.patch -Patch38: 0038-keymap-Add-Acer-TravelMate-6593G-and-Acer-Aspire-164.patch -Patch39: 0039-keymap-Fix-another-key-for-Acer-TravelMate-6593.patch -Patch40: 0040-libudev-update-documentation.patch -Patch41: 0041-Fix-Keymapping-for-upcoming-Dell-Laptops.patch -Patch42: 0042-Add-new-Dell-touchpad-keycode.patch -Patch43: 0043-Revert-special-casing-0xD8-to-latitude-XT-only.patch -Patch44: 0044-Fix-Dell-Studio-1558-volume-keys-not-releasing.patch -Patch45: 0045-Add-support-for-another-Dell-touchpad-toggle-key.patch -#Patch46: 0046-extras-mobile-action-modeswitch-update-gitignore.patch -Patch47: 0047-scsi_id-add-rand-in-retry-loop.patch -Patch48: 0048-cdrom_id-remove-debugging-code.patch -Patch49: 0049-cdrom_id-retry-to-open-the-device-if-EBUSY.patch -Patch50: 0050-cdrom_id-check-mount-state-in-retry-loop.patch -Patch51: 0051-cdrom_id-always-set-ID_CDROM-regardless-if-we-can-ru.patch -Patch52: 0052-rules-delete-outdated-packagees-rules.patch -Patch53: 0053-rules-we-do-not-have-static-devices-which-are-rename.patch -Patch54: 0054-unify-cleanup-event-handling.patch -Patch55: 0055-allow-IMPORT-db-KEY.patch -Patch56: 0056-usb-db-remove-double.patch -Patch57: 0057-replace-add-change-with-remove.patch -Patch58: 0058-update-NEWS.patch -Patch59: 0059-log-info-only-if-we-actually-delete-the-node.patch -Patch60: 0060-udevadm-trigger-switch-default-action-from-add-to-ch.patch -Patch61: 0061-remove-all_partitions-option.patch -Patch62: 0062-cdrom_id-Fix-uninitialized-variables.patch -Patch63: 0063-rules-call-modprobe-on-all-events-but-remove.patch -Patch64: 0064-remove-ignore_remove-option.patch -Patch65: 0065-cdrom_id-Fix-uninitialized-buffers.patch +Patch1: 0001-configure.ac-version-bump.patch +Patch2: 0002-remove-buffer-overrun-risk-in-readlink-call.patch +Patch3: 0003-more-readlink-buffer-size-handling.patch +Patch4: 0004-remove-left-over-from-ignore_remove-and-all_partitio.patch +Patch5: 0005-fix-previous-commit.patch +Patch6: 0006-Fix-volume-keys-not-releasing-for-Pegatron-platform.patch +Patch7: 0007-udevadm-info-export-db-remove-watch-handle-export.patch +Patch8: 0008-add-TAG-to-improve-event-filtering-and-device-enumer.patch +Patch9: 0009-all-to-match-against-a-given-TAG.patch +Patch10: 0010-udev-acl-use-a-tag-instead-of-a-property-to-mark-dev.patch +Patch11: 0011-fix-logic-on-demand-loading-logic-for-db-and-uevent.patch +Patch12: 0012-use-the-usual-TAG-TAG-logic.patch +Patch13: 0013-delete-old-tags-when-configuration-changes.patch +Patch14: 0014-libudev-accept-NULL-in-udev_device_get_tags_list_ent.patch +Patch15: 0015-export-tag-functions.patch +Patch16: 0016-export-udev_device_get_tags_list_entry.patch +Patch17: 0017-configure.ac-move-firmware-path-setting-out-of-extra.patch +Patch18: 0018-keymap-Fix-Bluetooth-key-on-Acer-TravelMate-4720.patch +Patch19: 0019-udevd-always-try-to-find-an-idle-worker-instead-of-f.patch Patch101: udev-151-rules.patch +Patch102: udev-153-LGPL.patch Patch103: udev-151-gperf.patch Source1: start_udev @@ -177,7 +131,7 @@ This package contains the header and pkg-config files for developing glib-based applications using libudev functionality. %prep -%setup -q -n udev-151 +%setup -q %patch1 -p1 -b .git1 %patch2 -p1 -b .git2 @@ -198,55 +152,10 @@ glib-based applications using libudev functionality. %patch17 -p1 -b .git17 %patch18 -p1 -b .git18 %patch19 -p1 -b .git19 -%patch20 -p1 -b .git20 -%patch21 -p1 -b .git21 -%patch22 -p1 -b .git22 -%patch23 -p1 -b .git23 -%patch24 -p1 -b .git24 -%patch25 -p1 -b .git25 -%patch26 -p1 -b .git26 -#%patch27 -p1 -b .git27 -%patch28 -p1 -b .git28 -%patch29 -p1 -b .git29 -%patch30 -p1 -b .git30 -%patch31 -p1 -b .git31 -%patch32 -p1 -b .git32 -%patch33 -p1 -b .git33 -%patch34 -p1 -b .git34 -%patch35 -p1 -b .git35 -%patch36 -p1 -b .git36 -%patch37 -p1 -b .git37 -%patch38 -p1 -b .git38 -%patch39 -p1 -b .git39 -%patch40 -p1 -b .git40 -%patch41 -p1 -b .git41 -%patch42 -p1 -b .git42 -%patch43 -p1 -b .git43 -%patch44 -p1 -b .git44 -%patch45 -p1 -b .git45 -#%patch46 -p1 -b .git46 -%patch47 -p1 -b .git47 -%patch48 -p1 -b .git48 -%patch49 -p1 -b .git49 -%patch50 -p1 -b .git50 -%patch51 -p1 -b .git51 -%patch52 -p1 -b .git52 -%patch53 -p1 -b .git53 -%patch54 -p1 -b .git54 -%patch55 -p1 -b .git55 -%patch56 -p1 -b .git56 -%patch57 -p1 -b .git57 -%patch58 -p1 -b .git58 -%patch59 -p1 -b .git59 -%patch60 -p1 -b .git60 -%patch61 -p1 -b .git61 -%patch62 -p1 -b .git62 -%patch63 -p1 -b .git63 -%patch64 -p1 -b .git64 -%patch65 -p1 -b .git65 %patch101 -p1 +%patch102 -p1 %patch103 -p1 %build @@ -258,7 +167,7 @@ libtoolize -f -c --sysconfdir=%{_sysconfdir} --with-libdir-name=%{_lib} \ --sbindir="/sbin" --libexecdir=%{udev_scriptdir} \ --with-rootlibdir=/%{_lib} --enable-introspection \ - --disable-rpath --enable-debug + --enable-debug make %{?_smp_mflags} @@ -481,6 +390,9 @@ rm -rf $RPM_BUILD_ROOT %attr(0644,root,root) %{_libdir}/pkgconfig/gudev-1.0* %changelog +* Tue Apr 27 2010 Harald Hoyer 153-1.20100427git +- version 153 + * Tue Apr 13 2010 Harald Hoyer 152-0.1.20100413git - pre release of version 152 From 8ead087df86ebe74702dfb7e50b97047f4218d72 Mon Sep 17 00:00:00 2001 From: Harald Hoyer Date: Wed, 12 May 2010 14:41:26 +0000 Subject: [PATCH 062/142] - version 154 --- .cvsignore | 2 +- 0001-configure.ac-version-bump.patch | 34 - ...buffer-overrun-risk-in-readlink-call.patch | 32 - 0003-more-readlink-buffer-size-handling.patch | 113 -- ...-from-ignore_remove-and-all_partitio.patch | 73 - 0005-fix-previous-commit.patch | 33 - ...-not-releasing-for-Pegatron-platform.patch | 29 - ...export-db-remove-watch-handle-export.patch | 27 - ...ve-event-filtering-and-device-enumer.patch | 1706 ----------------- 0009-all-to-match-against-a-given-TAG.patch | 101 - ...ag-instead-of-a-property-to-mark-dev.patch | 125 -- ...mand-loading-logic-for-db-and-uevent.patch | 49 - 0012-use-the-usual-TAG-TAG-logic.patch | 129 -- ...-old-tags-when-configuration-changes.patch | 168 -- ...ULL-in-udev_device_get_tags_list_ent.patch | 39 - 0015-export-tag-functions.patch | 24 - ...port-udev_device_get_tags_list_entry.patch | 50 - ...e-firmware-path-setting-out-of-extra.patch | 68 - ...luetooth-key-on-Acer-TravelMate-4720.patch | 26 - ...-to-find-an-idle-worker-instead-of-f.patch | 58 - sources | 2 +- start_udev | 18 +- ...-153.tar.bz2.sign => udev-154.tar.bz2.sign | 6 +- udev.spec | 58 +- 24 files changed, 19 insertions(+), 2951 deletions(-) delete mode 100644 0001-configure.ac-version-bump.patch delete mode 100644 0002-remove-buffer-overrun-risk-in-readlink-call.patch delete mode 100644 0003-more-readlink-buffer-size-handling.patch delete mode 100644 0004-remove-left-over-from-ignore_remove-and-all_partitio.patch delete mode 100644 0005-fix-previous-commit.patch delete mode 100644 0006-Fix-volume-keys-not-releasing-for-Pegatron-platform.patch delete mode 100644 0007-udevadm-info-export-db-remove-watch-handle-export.patch delete mode 100644 0008-add-TAG-to-improve-event-filtering-and-device-enumer.patch delete mode 100644 0009-all-to-match-against-a-given-TAG.patch delete mode 100644 0010-udev-acl-use-a-tag-instead-of-a-property-to-mark-dev.patch delete mode 100644 0011-fix-logic-on-demand-loading-logic-for-db-and-uevent.patch delete mode 100644 0012-use-the-usual-TAG-TAG-logic.patch delete mode 100644 0013-delete-old-tags-when-configuration-changes.patch delete mode 100644 0014-libudev-accept-NULL-in-udev_device_get_tags_list_ent.patch delete mode 100644 0015-export-tag-functions.patch delete mode 100644 0016-export-udev_device_get_tags_list_entry.patch delete mode 100644 0017-configure.ac-move-firmware-path-setting-out-of-extra.patch delete mode 100644 0018-keymap-Fix-Bluetooth-key-on-Acer-TravelMate-4720.patch delete mode 100644 0019-udevd-always-try-to-find-an-idle-worker-instead-of-f.patch rename udev-153.tar.bz2.sign => udev-154.tar.bz2.sign (61%) diff --git a/.cvsignore b/.cvsignore index e15c73e..a4264db 100644 --- a/.cvsignore +++ b/.cvsignore @@ -1 +1 @@ -udev-153.tar.bz2 +udev-154.tar.bz2 diff --git a/0001-configure.ac-version-bump.patch b/0001-configure.ac-version-bump.patch deleted file mode 100644 index b54be08..0000000 --- a/0001-configure.ac-version-bump.patch +++ /dev/null @@ -1,34 +0,0 @@ -From c51d2f2746a54c8418965f22d1882b1ac3a18ed8 Mon Sep 17 00:00:00 2001 -From: Kay Sievers -Date: Wed, 21 Apr 2010 08:50:59 +0200 -Subject: [PATCH 01/19] configure.ac: version bump - ---- - NEWS | 3 +++ - configure.ac | 2 +- - 2 files changed, 4 insertions(+), 1 deletions(-) - -diff --git a/NEWS b/NEWS -index 87d5343..f3163ec 100644 ---- a/NEWS -+++ b/NEWS -@@ -1,3 +1,6 @@ -+udev 154 -+======== -+ - udev 153 - ======== - Fix broken firmware loader search path. -diff --git a/configure.ac b/configure.ac -index 4fcdbcd..d4d29c4 100644 ---- a/configure.ac -+++ b/configure.ac -@@ -1,4 +1,4 @@ --AC_INIT([udev], [153], [linux-hotplug@vger.kernel.org]) -+AC_INIT([udev], [154], [linux-hotplug@vger.kernel.org]) - AC_PREREQ(2.60) - AM_INIT_AUTOMAKE([check-news foreign 1.10 dist-bzip2 subdir-objects]) - m4_ifdef([AM_SILENT_RULES], [AM_SILENT_RULES([yes])]) --- -1.7.0.1 - diff --git a/0002-remove-buffer-overrun-risk-in-readlink-call.patch b/0002-remove-buffer-overrun-risk-in-readlink-call.patch deleted file mode 100644 index 4e64f31..0000000 --- a/0002-remove-buffer-overrun-risk-in-readlink-call.patch +++ /dev/null @@ -1,32 +0,0 @@ -From e925018786d85fb3aed3b62a0a89309f9a7d5e4f Mon Sep 17 00:00:00 2001 -From: Mathias Nyman -Date: Wed, 21 Apr 2010 13:52:52 +0300 -Subject: [PATCH 02/19] remove buffer-overrun risk in readlink call - -readlink does not write a nul character to the end of the -string it returns. Therefore ask for one fewer character -than the buffer size so there's always room for an extra \0. - -Signed-off-by: Mathias Nyman -Signed-off-by: Phil Carmody -Signed-off-by: Martin Pitt ---- - udev/udev-node.c | 2 +- - 1 files changed, 1 insertions(+), 1 deletions(-) - -diff --git a/udev/udev-node.c b/udev/udev-node.c -index 2a2c2cf..ceb1d52 100644 ---- a/udev/udev-node.c -+++ b/udev/udev-node.c -@@ -163,7 +163,7 @@ static int node_symlink(struct udev *udev, const char *node, const char *slink) - int len; - - dbg(udev, "found existing symlink '%s'\n", slink); -- len = readlink(slink, buf, sizeof(buf)); -+ len = readlink(slink, buf, sizeof(buf) - 1); - if (len > 0) { - buf[len] = '\0'; - if (strcmp(target, buf) == 0) { --- -1.7.0.1 - diff --git a/0003-more-readlink-buffer-size-handling.patch b/0003-more-readlink-buffer-size-handling.patch deleted file mode 100644 index 870fb72..0000000 --- a/0003-more-readlink-buffer-size-handling.patch +++ /dev/null @@ -1,113 +0,0 @@ -From 60067cc75ac7dd583beea584f87f2f6d3358f3c1 Mon Sep 17 00:00:00 2001 -From: Kay Sievers -Date: Wed, 21 Apr 2010 14:44:33 +0200 -Subject: [PATCH 03/19] more readlink buffer size handling - ---- - libudev/libudev-device.c | 27 ++++++++++++++------------- - libudev/libudev-queue.c | 2 +- - udev/udev-node.c | 4 ++-- - udev/udev-watch.c | 4 ++-- - 4 files changed, 19 insertions(+), 18 deletions(-) - -diff --git a/libudev/libudev-device.c b/libudev/libudev-device.c -index b3b6a63..4003545 100644 ---- a/libudev/libudev-device.c -+++ b/libudev/libudev-device.c -@@ -222,12 +222,11 @@ int udev_device_read_db(struct udev_device *udev_device) - char *next; - - target_len = readlink(filename, target, sizeof(target)); -- if (target_len > 0) -- target[target_len] = '\0'; -- else { -- dbg(udev_device->udev, "error reading db link %s: %m\n", filename); -+ if (target_len <= 0 || target_len == sizeof(target)) { -+ info(udev_device->udev, "error reading db link %s: %m\n", filename); - return -1; - } -+ target[target_len] = '\0'; - - next = strchr(target, ' '); - if (next != NULL) { -@@ -1095,16 +1094,18 @@ const char *udev_device_get_sysattr_value(struct udev_device *udev_device, const - goto out; - - len = readlink(path, target, sizeof(target)); -- if (len > 0) { -- target[len] = '\0'; -- pos = strrchr(target, '/'); -- if (pos != NULL) { -- pos = &pos[1]; -- dbg(udev_device->udev, "cache '%s' with link value '%s'\n", sysattr, pos); -- list_entry = udev_list_entry_add(udev_device->udev, &udev_device->sysattr_list, sysattr, pos, 0, 0); -- val = udev_list_entry_get_value(list_entry); -- } -+ if (len <= 0 || len == sizeof(target)) -+ goto out; -+ target[len] = '\0'; -+ -+ pos = strrchr(target, '/'); -+ if (pos != NULL) { -+ pos = &pos[1]; -+ dbg(udev_device->udev, "cache '%s' with link value '%s'\n", sysattr, pos); -+ list_entry = udev_list_entry_add(udev_device->udev, &udev_device->sysattr_list, sysattr, pos, 0, 0); -+ val = udev_list_entry_get_value(list_entry); - } -+ - goto out; - } - -diff --git a/libudev/libudev-queue.c b/libudev/libudev-queue.c -index f06c9e8..5a4a3dc 100644 ---- a/libudev/libudev-queue.c -+++ b/libudev/libudev-queue.c -@@ -488,7 +488,7 @@ struct udev_list_entry *udev_queue_get_failed_list_entry(struct udev_queue *udev - s = syspath; - l = util_strpcpyl(&s, sizeof(syspath), udev_get_sys_path(udev_queue->udev), NULL); - len = readlinkat(dirfd(dir), dent->d_name, s, l); -- if (len < 0 || (size_t)len >= l) -+ if (len <= 0 || (size_t)len == l) - continue; - s[len] = '\0'; - dbg(udev_queue->udev, "found '%s' [%s]\n", syspath, dent->d_name); -diff --git a/udev/udev-node.c b/udev/udev-node.c -index ceb1d52..5c1b04b 100644 ---- a/udev/udev-node.c -+++ b/udev/udev-node.c -@@ -163,8 +163,8 @@ static int node_symlink(struct udev *udev, const char *node, const char *slink) - int len; - - dbg(udev, "found existing symlink '%s'\n", slink); -- len = readlink(slink, buf, sizeof(buf) - 1); -- if (len > 0) { -+ len = readlink(slink, buf, sizeof(buf)); -+ if (len > 0 && len < (int)sizeof(buf)) { - buf[len] = '\0'; - if (strcmp(target, buf) == 0) { - info(udev, "preserve already existing symlink '%s' to '%s'\n", -diff --git a/udev/udev-watch.c b/udev/udev-watch.c -index 7135d9f..5fa6010 100644 ---- a/udev/udev-watch.c -+++ b/udev/udev-watch.c -@@ -81,7 +81,7 @@ void udev_watch_restore(struct udev *udev) - s = device; - l = util_strpcpy(&s, sizeof(device), udev_get_sys_path(udev)); - len = readlinkat(dirfd(dir), ent->d_name, s, l); -- if (len <= 0 || len >= (ssize_t)l) -+ if (len <= 0 || len == (ssize_t)l) - goto unlink; - s[len] = '\0'; - -@@ -173,7 +173,7 @@ struct udev_device *udev_watch_lookup(struct udev *udev, int wd) - s = majmin; - l = util_strpcpy(&s, sizeof(majmin), udev_get_sys_path(udev)); - len = readlink(filename, s, l); -- if (len < 0 || (size_t)len >= l) -+ if (len <= 0 || (size_t)len == l) - return NULL; - s[len] = '\0'; - --- -1.7.0.1 - diff --git a/0004-remove-left-over-from-ignore_remove-and-all_partitio.patch b/0004-remove-left-over-from-ignore_remove-and-all_partitio.patch deleted file mode 100644 index b14f0a0..0000000 --- a/0004-remove-left-over-from-ignore_remove-and-all_partitio.patch +++ /dev/null @@ -1,73 +0,0 @@ -From e9906fec711192761f27468244d3012041bcb0ee Mon Sep 17 00:00:00 2001 -From: Kay Sievers -Date: Wed, 21 Apr 2010 15:11:57 +0200 -Subject: [PATCH 04/19] remove left-over from ignore_remove and all_partitions - ---- - udev/udev-rules.c | 10 ---------- - 1 files changed, 0 insertions(+), 10 deletions(-) - -diff --git a/udev/udev-rules.c b/udev/udev-rules.c -index 4f18aca..f5d23b4 100644 ---- a/udev/udev-rules.c -+++ b/udev/udev-rules.c -@@ -149,7 +149,6 @@ enum token_type { - TK_A_STRING_ESCAPE_NONE, - TK_A_STRING_ESCAPE_REPLACE, - TK_A_INOTIFY_WATCH, /* int */ -- TK_A_NUM_FAKE_PART, /* int */ - TK_A_DEVLINK_PRIO, /* int */ - TK_A_OWNER, /* val */ - TK_A_GROUP, /* val */ -@@ -161,7 +160,6 @@ enum token_type { - TK_A_NAME, /* val */ - TK_A_DEVLINK, /* val */ - TK_A_EVENT_TIMEOUT, /* int */ -- TK_A_IGNORE_REMOVE, - TK_A_ATTR, /* val, attr */ - TK_A_RUN, /* val, bool */ - TK_A_GOTO, /* size_t */ -@@ -279,7 +277,6 @@ static const char *token_str(enum token_type type) - [TK_A_STRING_ESCAPE_NONE] = "A STRING_ESCAPE_NONE", - [TK_A_STRING_ESCAPE_REPLACE] = "A STRING_ESCAPE_REPLACE", - [TK_A_INOTIFY_WATCH] = "A INOTIFY_WATCH", -- [TK_A_NUM_FAKE_PART] = "A NUM_FAKE_PART", - [TK_A_DEVLINK_PRIO] = "A DEVLINK_PRIO", - [TK_A_OWNER] = "A OWNER", - [TK_A_GROUP] = "A GROUP", -@@ -291,7 +288,6 @@ static const char *token_str(enum token_type type) - [TK_A_NAME] = "A NAME", - [TK_A_DEVLINK] = "A DEVLINK", - [TK_A_EVENT_TIMEOUT] = "A EVENT_TIMEOUT", -- [TK_A_IGNORE_REMOVE] = "A IGNORE_REMOVE", - [TK_A_ATTR] = "A ATTR", - [TK_A_RUN] = "A RUN", - [TK_A_GOTO] = "A GOTO", -@@ -360,9 +356,6 @@ static void dump_token(struct udev_rules *rules, struct token *token) - break; - case TK_A_STRING_ESCAPE_NONE: - case TK_A_STRING_ESCAPE_REPLACE: -- case TK_A_IGNORE_REMOVE: -- dbg(rules->udev, "%s\n", token_str(type)); -- break; - case TK_M_TEST: - dbg(rules->udev, "%s %s '%s'(%s) %#o\n", - token_str(type), operation_str(op), value, string_glob_str(glob), token->key.mode); -@@ -1030,14 +1023,11 @@ static int rule_add_key(struct rule_tmp *rule_tmp, enum token_type type, - break; - case TK_A_STRING_ESCAPE_NONE: - case TK_A_STRING_ESCAPE_REPLACE: -- case TK_A_IGNORE_REMOVE: -- break; - case TK_A_RUN: - token->key.value_off = add_string(rule_tmp->rules, value); - token->key.fail_on_error = *(int *)data; - break; - case TK_A_INOTIFY_WATCH: -- case TK_A_NUM_FAKE_PART: - case TK_A_DEVLINK_PRIO: - token->key.devlink_prio = *(int *)data; - break; --- -1.7.0.1 - diff --git a/0005-fix-previous-commit.patch b/0005-fix-previous-commit.patch deleted file mode 100644 index 9ade8ad..0000000 --- a/0005-fix-previous-commit.patch +++ /dev/null @@ -1,33 +0,0 @@ -From 5d69a34caffd595d918dd859a5b079f95d250064 Mon Sep 17 00:00:00 2001 -From: Kay Sievers -Date: Wed, 21 Apr 2010 15:43:05 +0200 -Subject: [PATCH 05/19] fix previous commit - ---- - udev/udev-rules.c | 3 +++ - 1 files changed, 3 insertions(+), 0 deletions(-) - -diff --git a/udev/udev-rules.c b/udev/udev-rules.c -index f5d23b4..6eb8350 100644 ---- a/udev/udev-rules.c -+++ b/udev/udev-rules.c -@@ -356,6 +356,8 @@ static void dump_token(struct udev_rules *rules, struct token *token) - break; - case TK_A_STRING_ESCAPE_NONE: - case TK_A_STRING_ESCAPE_REPLACE: -+ dbg(rules->udev, "%s\n", token_str(type)); -+ break; - case TK_M_TEST: - dbg(rules->udev, "%s %s '%s'(%s) %#o\n", - token_str(type), operation_str(op), value, string_glob_str(glob), token->key.mode); -@@ -1023,6 +1025,7 @@ static int rule_add_key(struct rule_tmp *rule_tmp, enum token_type type, - break; - case TK_A_STRING_ESCAPE_NONE: - case TK_A_STRING_ESCAPE_REPLACE: -+ break; - case TK_A_RUN: - token->key.value_off = add_string(rule_tmp->rules, value); - token->key.fail_on_error = *(int *)data; --- -1.7.0.1 - diff --git a/0006-Fix-volume-keys-not-releasing-for-Pegatron-platform.patch b/0006-Fix-volume-keys-not-releasing-for-Pegatron-platform.patch deleted file mode 100644 index 3c27d50..0000000 --- a/0006-Fix-volume-keys-not-releasing-for-Pegatron-platform.patch +++ /dev/null @@ -1,29 +0,0 @@ -From d05137cca5f92a102a0bdd55e42de9852a739913 Mon Sep 17 00:00:00 2001 -From: Jerone Young -Date: Wed, 21 Apr 2010 12:19:37 -0500 -Subject: [PATCH 06/19] Fix volume keys not releasing for Pegatron platform - -Pegatron has a new platform coming out being sold by many small -manufacturers. This platform has volume keys that are not sending a key -release. This patch ensures those keys send release. - -Signed-off-by: Jerone Young -Signed-off-by: Martin Pitt ---- - extras/keymap/95-keyboard-force-release.rules | 2 ++ - 1 files changed, 2 insertions(+), 0 deletions(-) - -diff --git a/extras/keymap/95-keyboard-force-release.rules b/extras/keymap/95-keyboard-force-release.rules -index c9edacf..011b2e3 100644 ---- a/extras/keymap/95-keyboard-force-release.rules -+++ b/extras/keymap/95-keyboard-force-release.rules -@@ -29,4 +29,6 @@ ENV{DMI_VENDOR}=="FOXCONN", ATTR{[dmi/id]product_name}=="QBOOK", RUN+="keyboard- - - ENV{DMI_VENDOR}=="MTC", ATTR{[dmi/id]product_version}=="A0", RUN+="keyboard-force-release.sh $devpath common-volume-keys" - -+ENV{DMI_VENDOR}=="PEGATRON CORP.", ATTR{[dmi/id]product_name}=="Spring Peak", RUN+="keyboard-force-release.sh $devpath common-volume-keys" -+ - LABEL="force_release_end" --- -1.7.0.1 - diff --git a/0007-udevadm-info-export-db-remove-watch-handle-export.patch b/0007-udevadm-info-export-db-remove-watch-handle-export.patch deleted file mode 100644 index 8fa424e..0000000 --- a/0007-udevadm-info-export-db-remove-watch-handle-export.patch +++ /dev/null @@ -1,27 +0,0 @@ -From e7964b93e826274d0e92d58e458decb49e502bf5 Mon Sep 17 00:00:00 2001 -From: Kay Sievers -Date: Thu, 22 Apr 2010 06:23:16 +0200 -Subject: [PATCH 07/19] udevadm: info --export-db -- remove watch handle export - ---- - udev/udevadm-info.c | 4 ---- - 1 files changed, 0 insertions(+), 4 deletions(-) - -diff --git a/udev/udevadm-info.c b/udev/udevadm-info.c -index 5f6209a..b395ad9 100644 ---- a/udev/udevadm-info.c -+++ b/udev/udevadm-info.c -@@ -142,10 +142,6 @@ static void print_record(struct udev_device *device) - if (i != 0) - printf("L: %i\n", i); - -- i = udev_device_get_watch_handle(device); -- if (i >= 0) -- printf("W: %u\n", i); -- - udev_list_entry_foreach(list_entry, udev_device_get_devlinks_list_entry(device)) { - len = strlen(udev_get_dev_path(udev_device_get_udev(device))); - printf("S: %s\n", &udev_list_entry_get_name(list_entry)[len+1]); --- -1.7.0.1 - diff --git a/0008-add-TAG-to-improve-event-filtering-and-device-enumer.patch b/0008-add-TAG-to-improve-event-filtering-and-device-enumer.patch deleted file mode 100644 index d40b240..0000000 --- a/0008-add-TAG-to-improve-event-filtering-and-device-enumer.patch +++ /dev/null @@ -1,1706 +0,0 @@ -From 28460195c2ae90892bf556aff2b80705a8f37795 Mon Sep 17 00:00:00 2001 -From: Kay Sievers -Date: Thu, 22 Apr 2010 18:12:36 +0200 -Subject: [PATCH 08/19] add TAG= to improve event filtering and device enumeration - ---- - Makefile.am | 4 +- - libudev/docs/libudev-sections.txt | 2 + - libudev/exported_symbols | 1 + - libudev/libudev-device-private.c | 46 ++++++++- - libudev/libudev-device.c | 159 ++++++++++++++++++++------- - libudev/libudev-enumerate.c | 197 ++++++++++++++++++++++----------- - libudev/libudev-monitor.c | 218 +++++++++++++++++++++++++++---------- - libudev/libudev-private.h | 8 +- - libudev/libudev-util.c | 75 +++++++++++-- - libudev/libudev.h | 4 +- - udev/udev-event.c | 1 - - udev/udev-rules.c | 14 +++ - udev/udev.xml | 13 ++ - udev/udevadm-monitor.c | 17 +++- - udev/udevadm-trigger.c | 7 +- - udev/udevadm.xml | 13 ++ - 16 files changed, 595 insertions(+), 184 deletions(-) - -diff --git a/Makefile.am b/Makefile.am -index 7403949..9d3fefd 100644 ---- a/Makefile.am -+++ b/Makefile.am -@@ -28,9 +28,9 @@ CLEANFILES = - # ------------------------------------------------------------------------------ - # libudev - # ------------------------------------------------------------------------------ --LIBUDEV_CURRENT=7 -+LIBUDEV_CURRENT=8 - LIBUDEV_REVISION=0 --LIBUDEV_AGE=7 -+LIBUDEV_AGE=8 - - SUBDIRS += libudev/docs - -diff --git a/libudev/docs/libudev-sections.txt b/libudev/docs/libudev-sections.txt -index ca781ff..3f8c107 100644 ---- a/libudev/docs/libudev-sections.txt -+++ b/libudev/docs/libudev-sections.txt -@@ -68,6 +68,7 @@ udev_monitor_enable_receiving - udev_monitor_get_fd - udev_monitor_receive_device - udev_monitor_filter_add_match_subsystem_devtype -+udev_monitor_filter_add_match_tag - udev_monitor_filter_update - udev_monitor_filter_remove - -@@ -85,6 +86,7 @@ udev_enumerate_add_nomatch_subsystem - udev_enumerate_add_match_sysattr - udev_enumerate_add_nomatch_sysattr - udev_enumerate_add_match_property -+udev_enumerate_add_match_tag - udev_enumerate_add_match_sysname - udev_enumerate_add_syspath - udev_enumerate_scan_devices -diff --git a/libudev/exported_symbols b/libudev/exported_symbols -index 61486c6..c0ca4b9 100644 ---- a/libudev/exported_symbols -+++ b/libudev/exported_symbols -@@ -60,6 +60,7 @@ udev_monitor_get_udev - udev_monitor_get_fd - udev_monitor_receive_device - udev_monitor_filter_add_match_subsystem_devtype -+udev_monitor_filter_add_match_tag - udev_monitor_filter_update - udev_monitor_filter_remove - udev_queue_new -diff --git a/libudev/libudev-device-private.c b/libudev/libudev-device-private.c -index 5e4381e..13f1ebf 100644 ---- a/libudev/libudev-device-private.c -+++ b/libudev/libudev-device-private.c -@@ -1,7 +1,7 @@ - /* - * libudev - interface to udev device information - * -- * Copyright (C) 2008 Kay Sievers -+ * Copyright (C) 2008-2010 Kay Sievers - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public -@@ -13,6 +13,7 @@ - #include - #include - #include -+#include - #include - #include - #include -@@ -21,6 +22,37 @@ - #include "libudev.h" - #include "libudev-private.h" - -+static int udev_device_tag_index(struct udev_device *udev_device, bool add) -+{ -+ struct udev *udev = udev_device_get_udev(udev_device); -+ struct udev_list_entry *list_entry; -+ -+ udev_list_entry_foreach(list_entry, udev_device_get_tags_list_entry(udev_device)) { -+ char filename[UTIL_PATH_SIZE]; -+ -+ util_strscpyl(filename, sizeof(filename), udev_get_dev_path(udev), "/.udev/tags/", -+ udev_list_entry_get_name(list_entry), "/", -+ udev_device_get_subsystem(udev_device), ":", udev_device_get_sysname(udev_device), NULL); -+ -+ if (add) { -+ util_create_path(udev, filename); -+ symlink(udev_device_get_devpath(udev_device), filename); -+ if (udev_device_get_sysname_old(udev_device) != NULL) { -+ char filename_old[UTIL_PATH_SIZE]; -+ -+ util_strscpyl(filename, sizeof(filename), udev_get_dev_path(udev), "/.udev/tags/", -+ udev_list_entry_get_name(list_entry), -+ udev_device_get_subsystem(udev_device), ":", udev_device_get_sysname_old(udev_device), NULL); -+ unlink(filename_old); -+ } -+ } else { -+ unlink(filename); -+ util_delete_path(udev, filename); -+ } -+ } -+ return 0; -+} -+ - int udev_device_update_db(struct udev_device *udev_device) - { - struct udev *udev = udev_device_get_udev(udev_device); -@@ -41,6 +73,8 @@ int udev_device_update_db(struct udev_device *udev_device) - udev_list_entry_foreach(list_entry, udev_device_get_properties_list_entry(udev_device)) - if (udev_list_entry_get_flags(list_entry)) - goto file; -+ if (udev_device_get_tags_list_entry(udev_device) != NULL) -+ goto file; - if (udev_device_get_devlink_priority(udev_device) != 0) - goto file; - if (udev_device_get_event_timeout(udev_device) >= 0) -@@ -80,7 +114,7 @@ file: - if (f == NULL) { - err(udev, "unable to create temporary db file '%s': %m\n", filename_tmp); - return -1; -- } -+ } - - if (udev_device_get_devnode(udev_device) != NULL) { - fprintf(f, "N:%s\n", &udev_device_get_devnode(udev_device)[devlen]); -@@ -100,10 +134,13 @@ file: - udev_list_entry_get_name(list_entry), - udev_list_entry_get_value(list_entry)); - } -+ udev_list_entry_foreach(list_entry, udev_device_get_tags_list_entry(udev_device)) -+ fprintf(f, "G:%s\n", udev_list_entry_get_name(list_entry)); - fclose(f); - rename(filename_tmp, filename); - info(udev, "created db file for '%s' in '%s'\n", udev_device_get_devpath(udev_device), filename); - out: -+ udev_device_tag_index(udev_device, true); - return 0; - } - -@@ -112,6 +149,7 @@ int udev_device_delete_db(struct udev_device *udev_device) - struct udev *udev = udev_device_get_udev(udev_device); - char filename[UTIL_PATH_SIZE]; - -+ udev_device_tag_index(udev_device, false); - util_strscpyl(filename, sizeof(filename), udev_get_dev_path(udev), "/.udev/db/", - udev_device_get_subsystem(udev_device), ":", udev_device_get_sysname(udev_device), NULL); - unlink(filename); -@@ -124,9 +162,13 @@ int udev_device_rename_db(struct udev_device *udev_device) - char filename_old[UTIL_PATH_SIZE]; - char filename[UTIL_PATH_SIZE]; - -+ if (strcmp(udev_device_get_sysname(udev_device), udev_device_get_sysname_old(udev_device)) == 0) -+ return 0; -+ - util_strscpyl(filename_old, sizeof(filename_old), udev_get_dev_path(udev), "/.udev/db/", - udev_device_get_subsystem(udev_device), ":", udev_device_get_sysname_old(udev_device), NULL); - util_strscpyl(filename, sizeof(filename), udev_get_dev_path(udev), "/.udev/db/", - udev_device_get_subsystem(udev_device), ":", udev_device_get_sysname(udev_device), NULL); -+ udev_device_tag_index(udev_device, true); - return rename(filename_old, filename); - } -diff --git a/libudev/libudev-device.c b/libudev/libudev-device.c -index 4003545..478fdcb 100644 ---- a/libudev/libudev-device.c -+++ b/libudev/libudev-device.c -@@ -60,6 +60,7 @@ struct udev_device { - struct udev_list_node devlinks_list; - struct udev_list_node properties_list; - struct udev_list_node sysattr_list; -+ struct udev_list_node tags_list; - unsigned long long int seqnum; - int event_timeout; - int timeout; -@@ -68,18 +69,21 @@ struct udev_device { - dev_t devnum; - int watch_handle; - int maj, min; -- unsigned int parent_set:1; -- unsigned int subsystem_set:1; -- unsigned int devtype_set:1; -- unsigned int devlinks_uptodate:1; -- unsigned int envp_uptodate:1; -- unsigned int driver_set:1; -- unsigned int info_loaded:1; -+ bool parent_set; -+ bool subsystem_set; -+ bool devtype_set; -+ bool devlinks_uptodate; -+ bool envp_uptodate; -+ bool tags_uptodate; -+ bool driver_set; -+ bool info_loaded; -+ bool db_loaded; -+ bool uevent_loaded; - }; - - struct udev_list_entry *udev_device_add_property(struct udev_device *udev_device, const char *key, const char *value) - { -- udev_device->envp_uptodate = 0; -+ udev_device->envp_uptodate = false; - if (value == NULL) { - struct udev_list_entry *list_entry; - -@@ -149,6 +153,26 @@ void udev_device_add_property_from_string_parse(struct udev_device *udev_device, - } - if (slink[0] != '\0') - udev_device_add_devlink(udev_device, slink, 0); -+ } else if (strncmp(property, "TAGS=", 5) == 0) { -+ char tags[UTIL_PATH_SIZE]; -+ char *next; -+ -+ util_strscpy(tags, sizeof(tags), &property[5]); -+ next = strchr(tags, ':'); -+ if (next != NULL) { -+ next++; -+ while (next[0] != '\0') { -+ char *tag; -+ -+ tag = next; -+ next = strchr(tag, ':'); -+ if (next == NULL) -+ break; -+ next[0] = '\0'; -+ next++; -+ udev_device_add_tag(udev_device, tag); -+ } -+ } - } else if (strncmp(property, "DRIVER=", 7) == 0) { - udev_device_set_driver(udev_device, &property[7]); - } else if (strncmp(property, "ACTION=", 7) == 0) { -@@ -208,6 +232,9 @@ int udev_device_read_db(struct udev_device *udev_device) - char line[UTIL_LINE_SIZE]; - FILE *f; - -+ if (udev_device->db_loaded) -+ return 0; -+ - util_strscpyl(filename, sizeof(filename), udev_get_dev_path(udev_device->udev), "/.udev/db/", - udev_device_get_subsystem(udev_device), ":", udev_device_get_sysname(udev_device), NULL); - -@@ -284,6 +311,9 @@ int udev_device_read_db(struct udev_device *udev_device) - case 'E': - udev_device_add_property_from_string(udev_device, val); - break; -+ case 'G': -+ udev_device_add_tag(udev_device, val); -+ break; - case 'W': - udev_device_set_watch_handle(udev_device, atoi(val)); - break; -@@ -292,6 +322,7 @@ int udev_device_read_db(struct udev_device *udev_device) - fclose(f); - - info(udev_device->udev, "device %p filled with db file data\n", udev_device); -+ udev_device->db_loaded = true; - return 0; - } - -@@ -303,6 +334,9 @@ int udev_device_read_uevent_file(struct udev_device *udev_device) - int maj = 0; - int min = 0; - -+ if (udev_device->uevent_loaded) -+ return 0; -+ - util_strscpyl(filename, sizeof(filename), udev_device->syspath, "/uevent", NULL); - f = fopen(filename, "r"); - if (f == NULL) -@@ -329,21 +363,14 @@ int udev_device_read_uevent_file(struct udev_device *udev_device) - } - - udev_device->devnum = makedev(maj, min); -- - fclose(f); -+ udev_device->uevent_loaded = true; - return 0; - } - --static void device_load_info(struct udev_device *device) --{ -- device->info_loaded = 1; -- udev_device_read_uevent_file(device); -- udev_device_read_db(device); --} -- - void udev_device_set_info_loaded(struct udev_device *device) - { -- device->info_loaded = 1; -+ device->info_loaded = true; - } - - struct udev_device *udev_device_new(struct udev *udev) -@@ -362,6 +389,7 @@ struct udev_device *udev_device_new(struct udev *udev) - udev_list_init(&udev_device->devlinks_list); - udev_list_init(&udev_device->properties_list); - udev_list_init(&udev_device->sysattr_list); -+ udev_list_init(&udev_device->tags_list); - udev_device->event_timeout = -1; - udev_device->watch_handle = -1; - /* copy global properties */ -@@ -420,7 +448,7 @@ struct udev_device *udev_device_new_from_syspath(struct udev *udev, const char * - util_strscpy(path, sizeof(path), syspath); - util_resolve_sys_link(udev, path, sizeof(path)); - -- if (strncmp(&syspath[len], "/devices/", 9) == 0) { -+ if (strncmp(&path[len], "/devices/", 9) == 0) { - char file[UTIL_PATH_SIZE]; - - /* all "devices" require a "uevent" file */ -@@ -648,7 +676,7 @@ struct udev_device *udev_device_get_parent(struct udev_device *udev_device) - if (udev_device == NULL) - return NULL; - if (!udev_device->parent_set) { -- udev_device->parent_set = 1; -+ udev_device->parent_set = true; - udev_device->parent_device = device_new_from_parent(udev_device); - } - if (udev_device->parent_device != NULL) -@@ -758,12 +786,13 @@ void udev_device_unref(struct udev_device *udev_device) - free(udev_device->devtype); - udev_list_cleanup_entries(udev_device->udev, &udev_device->devlinks_list); - udev_list_cleanup_entries(udev_device->udev, &udev_device->properties_list); -+ udev_list_cleanup_entries(udev_device->udev, &udev_device->sysattr_list); -+ udev_list_cleanup_entries(udev_device->udev, &udev_device->tags_list); - free(udev_device->action); - free(udev_device->driver); - free(udev_device->devpath_old); - free(udev_device->sysname_old); - free(udev_device->knodename); -- udev_list_cleanup_entries(udev_device->udev, &udev_device->sysattr_list); - free(udev_device->envp); - free(udev_device->monitor_buf); - dbg(udev_device->udev, "udev_device: %p released\n", udev_device); -@@ -842,7 +871,7 @@ const char *udev_device_get_devnode(struct udev_device *udev_device) - if (udev_device == NULL) - return NULL; - if (!udev_device->info_loaded) -- device_load_info(udev_device); -+ udev_device_read_db(udev_device); - return udev_device->devnode; - } - -@@ -862,7 +891,7 @@ const char *udev_device_get_subsystem(struct udev_device *udev_device) - if (udev_device == NULL) - return NULL; - if (!udev_device->subsystem_set) { -- udev_device->subsystem_set = 1; -+ udev_device->subsystem_set = true; - /* read "subsystem" link */ - if (util_get_sys_subsystem(udev_device->udev, udev_device->syspath, subsystem, sizeof(subsystem)) > 0) { - udev_device_set_subsystem(udev_device, subsystem); -@@ -900,9 +929,8 @@ const char *udev_device_get_devtype(struct udev_device *udev_device) - if (udev_device == NULL) - return NULL; - if (!udev_device->devtype_set) { -- udev_device->devtype_set = 1; -- if (!udev_device->info_loaded) -- udev_device_read_uevent_file(udev_device); -+ udev_device->devtype_set = true; -+ udev_device_read_uevent_file(udev_device); - } - return udev_device->devtype; - } -@@ -925,13 +953,13 @@ struct udev_list_entry *udev_device_get_devlinks_list_entry(struct udev_device * - if (udev_device == NULL) - return NULL; - if (!udev_device->info_loaded) -- device_load_info(udev_device); -+ udev_device_read_db(udev_device); - return udev_list_get_entry(&udev_device->devlinks_list); - } - - void udev_device_cleanup_devlinks_list(struct udev_device *udev_device) - { -- udev_device->devlinks_uptodate = 0; -+ udev_device->devlinks_uptodate = false; - udev_list_cleanup_entries(udev_device->udev, &udev_device->devlinks_list); - } - -@@ -951,13 +979,15 @@ struct udev_list_entry *udev_device_get_properties_list_entry(struct udev_device - { - if (udev_device == NULL) - return NULL; -- if (!udev_device->info_loaded) -- device_load_info(udev_device); -+ if (!udev_device->info_loaded) { -+ udev_device_read_uevent_file(udev_device); -+ udev_device_read_db(udev_device); -+ } - if (!udev_device->devlinks_uptodate) { - char symlinks[UTIL_PATH_SIZE]; - struct udev_list_entry *list_entry; - -- udev_device->devlinks_uptodate = 1; -+ udev_device->devlinks_uptodate = true; - list_entry = udev_device_get_devlinks_list_entry(udev_device); - if (list_entry != NULL) { - char *s; -@@ -970,6 +1000,21 @@ struct udev_list_entry *udev_device_get_properties_list_entry(struct udev_device - udev_device_add_property(udev_device, "DEVLINKS", symlinks); - } - } -+ if (!udev_device->tags_uptodate) { -+ udev_device->tags_uptodate = true; -+ if (udev_device_get_tags_list_entry(udev_device) != NULL) { -+ char tags[UTIL_PATH_SIZE]; -+ struct udev_list_entry *list_entry; -+ char *s; -+ size_t l; -+ -+ s = tags; -+ l = util_strpcpyl(&s, sizeof(tags), ":", NULL); -+ udev_list_entry_foreach(list_entry, udev_device_get_tags_list_entry(udev_device)) -+ l = util_strpcpyl(&s, l, udev_list_entry_get_name(list_entry), ":", NULL); -+ udev_device_add_property(udev_device, "TAGS", tags); -+ } -+ } - return udev_list_get_entry(&udev_device->properties_list); - } - -@@ -986,7 +1031,7 @@ const char *udev_device_get_driver(struct udev_device *udev_device) - if (udev_device == NULL) - return NULL; - if (!udev_device->driver_set) { -- udev_device->driver_set = 1; -+ udev_device->driver_set = true; - if (util_get_sys_driver(udev_device->udev, udev_device->syspath, driver, sizeof(driver)) > 0) - udev_device->driver = strdup(driver); - } -@@ -1004,7 +1049,7 @@ dev_t udev_device_get_devnum(struct udev_device *udev_device) - if (udev_device == NULL) - return makedev(0, 0); - if (!udev_device->info_loaded) -- device_load_info(udev_device); -+ udev_device_read_uevent_file(udev_device); - return udev_device->devnum; - } - -@@ -1184,7 +1229,7 @@ int udev_device_set_subsystem(struct udev_device *udev_device, const char *subsy - udev_device->subsystem = strdup(subsystem); - if (udev_device->subsystem == NULL) - return -ENOMEM; -- udev_device->subsystem_set = 1; -+ udev_device->subsystem_set = true; - udev_device_add_property(udev_device, "SUBSYSTEM", udev_device->subsystem); - return 0; - } -@@ -1195,7 +1240,7 @@ int udev_device_set_devtype(struct udev_device *udev_device, const char *devtype - udev_device->devtype = strdup(devtype); - if (udev_device->devtype == NULL) - return -ENOMEM; -- udev_device->devtype_set = 1; -+ udev_device->devtype_set = true; - udev_device_add_property(udev_device, "DEVTYPE", udev_device->devtype); - return 0; - } -@@ -1216,7 +1261,7 @@ int udev_device_add_devlink(struct udev_device *udev_device, const char *devlink - { - struct udev_list_entry *list_entry; - -- udev_device->devlinks_uptodate = 0; -+ udev_device->devlinks_uptodate = false; - list_entry = udev_list_entry_add(udev_device->udev, &udev_device->devlinks_list, devlink, NULL, 1, 0); - if (list_entry == NULL) - return -ENOMEM; -@@ -1225,6 +1270,40 @@ int udev_device_add_devlink(struct udev_device *udev_device, const char *devlink - return 0; - } - -+int udev_device_add_tag(struct udev_device *udev_device, const char *tag) -+{ -+ if (strchr(tag, ':') != NULL || strchr(tag, ' ') != NULL) -+ return -EINVAL; -+ udev_device->tags_uptodate = false; -+ if (udev_list_entry_add(udev_device->udev, &udev_device->tags_list, tag, NULL, 1, 0) != NULL) -+ return 0; -+ return -ENOMEM; -+} -+ -+void udev_device_cleanup_tags_list(struct udev_device *udev_device) -+{ -+ udev_device->tags_uptodate = false; -+ udev_list_cleanup_entries(udev_device->udev, &udev_device->tags_list); -+} -+ -+struct udev_list_entry *udev_device_get_tags_list_entry(struct udev_device *udev_device) -+{ -+ return udev_list_get_entry(&udev_device->tags_list); -+} -+ -+int udev_device_has_tag(struct udev_device *udev_device, const char *tag) -+{ -+ struct udev_list_entry *list_entry; -+ -+ if (!udev_device->info_loaded) -+ udev_device_read_db(udev_device); -+ list_entry = udev_device_get_tags_list_entry(udev_device); -+ list_entry = udev_list_entry_get_by_name(list_entry, tag); -+ if (list_entry != NULL) -+ return 1; -+ return 0; -+} -+ - #define ENVP_SIZE 128 - #define MONITOR_BUF_SIZE 4096 - static int update_envp_monitor_buf(struct udev_device *udev_device) -@@ -1273,7 +1352,7 @@ static int update_envp_monitor_buf(struct udev_device *udev_device) - } - udev_device->envp[i] = NULL; - udev_device->monitor_buf_len = s - udev_device->monitor_buf; -- udev_device->envp_uptodate = 1; -+ udev_device->envp_uptodate = true; - dbg(udev_device->udev, "filled envp/monitor buffer, %u properties, %zu bytes\n", - i, udev_device->monitor_buf_len); - return 0; -@@ -1312,7 +1391,7 @@ int udev_device_set_driver(struct udev_device *udev_device, const char *driver) - udev_device->driver = strdup(driver); - if (udev_device->driver == NULL) - return -ENOMEM; -- udev_device->driver_set = 1; -+ udev_device->driver_set = true; - udev_device_add_property(udev_device, "DRIVER", udev_device->driver); - return 0; - } -@@ -1385,7 +1464,7 @@ int udev_device_set_timeout(struct udev_device *udev_device, int timeout) - int udev_device_get_event_timeout(struct udev_device *udev_device) - { - if (!udev_device->info_loaded) -- device_load_info(udev_device); -+ udev_device_read_db(udev_device); - return udev_device->event_timeout; - } - -@@ -1421,7 +1500,7 @@ int udev_device_set_devnum(struct udev_device *udev_device, dev_t devnum) - int udev_device_get_devlink_priority(struct udev_device *udev_device) - { - if (!udev_device->info_loaded) -- device_load_info(udev_device); -+ udev_device_read_db(udev_device); - return udev_device->devlink_priority; - } - -@@ -1434,7 +1513,7 @@ int udev_device_set_devlink_priority(struct udev_device *udev_device, int prio) - int udev_device_get_watch_handle(struct udev_device *udev_device) - { - if (!udev_device->info_loaded) -- device_load_info(udev_device); -+ udev_device_read_db(udev_device); - return udev_device->watch_handle; - } - -diff --git a/libudev/libudev-enumerate.c b/libudev/libudev-enumerate.c -index 9a61a61..da83144 100644 ---- a/libudev/libudev-enumerate.c -+++ b/libudev/libudev-enumerate.c -@@ -1,7 +1,7 @@ - /* - * libudev - interface to udev device information - * -- * Copyright (C) 2008 Kay Sievers -+ * Copyright (C) 2008-2010 Kay Sievers - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public -@@ -51,6 +51,7 @@ struct udev_enumerate { - struct udev_list_node subsystem_nomatch_list; - struct udev_list_node sysname_match_list; - struct udev_list_node properties_match_list; -+ struct udev_list_node tags_match_list; - struct udev_list_node devices_list; - struct syspath *devices; - unsigned int devices_cur; -@@ -79,6 +80,7 @@ struct udev_enumerate *udev_enumerate_new(struct udev *udev) - udev_list_init(&udev_enumerate->subsystem_nomatch_list); - udev_list_init(&udev_enumerate->sysname_match_list); - udev_list_init(&udev_enumerate->properties_match_list); -+ udev_list_init(&udev_enumerate->tags_match_list); - udev_list_init(&udev_enumerate->devices_list); - return udev_enumerate; - } -@@ -121,6 +123,7 @@ void udev_enumerate_unref(struct udev_enumerate *udev_enumerate) - udev_list_cleanup_entries(udev_enumerate->udev, &udev_enumerate->subsystem_nomatch_list); - udev_list_cleanup_entries(udev_enumerate->udev, &udev_enumerate->sysname_match_list); - udev_list_cleanup_entries(udev_enumerate->udev, &udev_enumerate->properties_match_list); -+ udev_list_cleanup_entries(udev_enumerate->udev, &udev_enumerate->tags_match_list); - udev_list_cleanup_entries(udev_enumerate->udev, &udev_enumerate->devices_list); - for (i = 0; i < udev_enumerate->devices_cur; i++) - free(udev_enumerate->devices[i].syspath); -@@ -191,7 +194,7 @@ static int syspath_cmp(const void *p1, const void *p2) - } - - /* For devices that should be moved to the absolute end of the list */ --static int devices_delay_end(struct udev *udev, const char *syspath) -+static bool devices_delay_end(struct udev *udev, const char *syspath) - { - static const char *delay_device_list[] = { - "/block/md", -@@ -205,10 +208,10 @@ static int devices_delay_end(struct udev *udev, const char *syspath) - for (i = 0; delay_device_list[i] != NULL; i++) { - if (strstr(&syspath[len], delay_device_list[i]) != NULL) { - dbg(udev, "delaying: %s\n", syspath); -- return 1; -+ return true; - } - } -- return 0; -+ return false; - } - - /* For devices that should just be moved a little bit later, just -@@ -394,16 +397,12 @@ int udev_enumerate_add_nomatch_sysattr(struct udev_enumerate *udev_enumerate, co - return 0; - } - --static int match_sysattr_value(struct udev *udev, const char *syspath, const char *sysattr, const char *match_val) -+static int match_sysattr_value(struct udev_device *dev, const char *sysattr, const char *match_val) - { -- struct udev_device *device; - const char *val = NULL; - bool match = false; - -- device = udev_device_new_from_syspath(udev, syspath); -- if (device == NULL) -- return -EINVAL; -- val = udev_device_get_sysattr_value(device, sysattr); -+ val = udev_device_get_sysattr_value(dev, sysattr); - if (val == NULL) - goto exit; - if (match_val == NULL) { -@@ -415,7 +414,6 @@ static int match_sysattr_value(struct udev *udev, const char *syspath, const cha - goto exit; - } - exit: -- udev_device_unref(device); - return match; - } - -@@ -440,6 +438,25 @@ int udev_enumerate_add_match_property(struct udev_enumerate *udev_enumerate, con - } - - /** -+ * udev_enumerate_add_match_tag: -+ * @udev_enumerate: context -+ * @tag: filter for a tag of the device to include in the list -+ * -+ * Returns: 0 on success, otherwise a negative error value. -+ */ -+int udev_enumerate_add_match_tag(struct udev_enumerate *udev_enumerate, const char *tag) -+{ -+ if (udev_enumerate == NULL) -+ return -EINVAL; -+ if (tag == NULL) -+ return 0; -+ if (udev_list_entry_add(udev_enumerate_get_udev(udev_enumerate), -+ &udev_enumerate->tags_match_list, tag, NULL, 1, 0) == NULL) -+ return -ENOMEM; -+ return 0; -+} -+ -+/** - * udev_enumerate_add_match_sysname: - * @udev_enumerate: context - * @sysname: filter for the name of the device to include in the list -@@ -458,46 +475,37 @@ int udev_enumerate_add_match_sysname(struct udev_enumerate *udev_enumerate, cons - return 0; - } - --static int match_sysattr(struct udev_enumerate *udev_enumerate, const char *syspath) -+static bool match_sysattr(struct udev_enumerate *udev_enumerate, struct udev_device *dev) - { -- struct udev *udev = udev_enumerate_get_udev(udev_enumerate); - struct udev_list_entry *list_entry; - - /* skip list */ - udev_list_entry_foreach(list_entry, udev_list_get_entry(&udev_enumerate->sysattr_nomatch_list)) { -- if (match_sysattr_value(udev, syspath, -- udev_list_entry_get_name(list_entry), -- udev_list_entry_get_value(list_entry))) -- return 0; -+ if (match_sysattr_value(dev, udev_list_entry_get_name(list_entry), -+ udev_list_entry_get_value(list_entry))) -+ return false; - } - /* include list */ - if (udev_list_get_entry(&udev_enumerate->sysattr_match_list) != NULL) { - udev_list_entry_foreach(list_entry, udev_list_get_entry(&udev_enumerate->sysattr_match_list)) { - /* anything that does not match, will make it FALSE */ -- if (!match_sysattr_value(udev, syspath, -- udev_list_entry_get_name(list_entry), -- udev_list_entry_get_value(list_entry))) -- return 0; -+ if (!match_sysattr_value(dev, udev_list_entry_get_name(list_entry), -+ udev_list_entry_get_value(list_entry))) -+ return false; - } -- return 1; -+ return true; - } -- return 1; -+ return true; - } - --static int match_property(struct udev_enumerate *udev_enumerate, const char *syspath) -+static bool match_property(struct udev_enumerate *udev_enumerate, struct udev_device *dev) - { -- struct udev_device *dev; - struct udev_list_entry *list_entry; -- int match = false; -+ bool match = false; - - /* no match always matches */ - if (udev_list_get_entry(&udev_enumerate->properties_match_list) == NULL) -- return 1; -- -- /* no device does not match */ -- dev = udev_device_new_from_syspath(udev_enumerate->udev, syspath); -- if (dev == NULL) -- return 0; -+ return true; - - /* loop over matches */ - udev_list_entry_foreach(list_entry, udev_list_get_entry(&udev_enumerate->properties_match_list)) { -@@ -525,23 +533,38 @@ static int match_property(struct udev_enumerate *udev_enumerate, const char *sys - } - } - out: -- udev_device_unref(dev); - return match; - } - --static int match_sysname(struct udev_enumerate *udev_enumerate, const char *sysname) -+static bool match_tag(struct udev_enumerate *udev_enumerate, struct udev_device *dev) -+{ -+ struct udev_list_entry *list_entry; -+ -+ /* no match always matches */ -+ if (udev_list_get_entry(&udev_enumerate->tags_match_list) == NULL) -+ return true; -+ -+ /* loop over matches */ -+ udev_list_entry_foreach(list_entry, udev_list_get_entry(&udev_enumerate->tags_match_list)) -+ if (!udev_device_has_tag(dev, udev_list_entry_get_name(list_entry))) -+ return false; -+ -+ return true; -+} -+ -+static bool match_sysname(struct udev_enumerate *udev_enumerate, const char *sysname) - { - struct udev_list_entry *list_entry; - - if (udev_list_get_entry(&udev_enumerate->sysname_match_list) == NULL) -- return 1; -+ return true; - - udev_list_entry_foreach(list_entry, udev_list_get_entry(&udev_enumerate->sysname_match_list)) { - if (fnmatch(udev_list_entry_get_name(list_entry), sysname, 0) != 0) - continue; -- return 1; -+ return true; - } -- return 0; -+ return false; - } - - static int scan_dir_and_add_devices(struct udev_enumerate *udev_enumerate, -@@ -562,54 +585,53 @@ static int scan_dir_and_add_devices(struct udev_enumerate *udev_enumerate, - util_strpcpyl(&s, l, "/", subdir2, NULL); - dir = opendir(path); - if (dir == NULL) -- return -1; -+ return -ENOENT; - for (dent = readdir(dir); dent != NULL; dent = readdir(dir)) { - char syspath[UTIL_PATH_SIZE]; -- char filename[UTIL_PATH_SIZE]; -- struct stat statbuf; -+ struct udev_device *dev; - - if (dent->d_name[0] == '.') - continue; -+ - if (!match_sysname(udev_enumerate, dent->d_name)) - continue; - - util_strscpyl(syspath, sizeof(syspath), path, "/", dent->d_name, NULL); -- if (!match_property(udev_enumerate, syspath)) -- continue; -- if (lstat(syspath, &statbuf) != 0) -- continue; -- if (S_ISREG(statbuf.st_mode)) -+ dev = udev_device_new_from_syspath(udev_enumerate->udev, syspath); -+ if (dev == NULL) - continue; -- if (S_ISLNK(statbuf.st_mode)) -- util_resolve_sys_link(udev, syspath, sizeof(syspath)); - -- util_strscpyl(filename, sizeof(filename), syspath, "/uevent", NULL); -- if (stat(filename, &statbuf) != 0) -- continue; -- if (!match_sysattr(udev_enumerate, syspath)) -- continue; -- syspath_add(udev_enumerate, syspath); -+ if (!match_tag(udev_enumerate, dev)) -+ goto nomatch; -+ if (!match_property(udev_enumerate, dev)) -+ goto nomatch; -+ if (!match_sysattr(udev_enumerate, dev)) -+ goto nomatch; -+ -+ syspath_add(udev_enumerate, udev_device_get_syspath(dev)); -+nomatch: -+ udev_device_unref(dev); - } - closedir(dir); - return 0; - } - --static int match_subsystem(struct udev_enumerate *udev_enumerate, const char *subsystem) -+static bool match_subsystem(struct udev_enumerate *udev_enumerate, const char *subsystem) - { - struct udev_list_entry *list_entry; - - udev_list_entry_foreach(list_entry, udev_list_get_entry(&udev_enumerate->subsystem_nomatch_list)) { - if (fnmatch(udev_list_entry_get_name(list_entry), subsystem, 0) == 0) -- return 0; -+ return false; - } - if (udev_list_get_entry(&udev_enumerate->subsystem_match_list) != NULL) { - udev_list_entry_foreach(list_entry, udev_list_get_entry(&udev_enumerate->subsystem_match_list)) { - if (fnmatch(udev_list_entry_get_name(list_entry), subsystem, 0) == 0) -- return 1; -+ return true; - } -- return 0; -+ return false; - } -- return 1; -+ return true; - } - - static int scan_dir(struct udev_enumerate *udev_enumerate, const char *basedir, const char *subdir, const char *subsystem) -@@ -675,17 +697,59 @@ int udev_enumerate_scan_devices(struct udev_enumerate *udev_enumerate) - - if (udev_enumerate == NULL) - return -EINVAL; -- util_strscpyl(base, sizeof(base), udev_get_sys_path(udev), "/subsystem", NULL); -- if (stat(base, &statbuf) == 0) { -- /* we have /subsystem/, forget all the old stuff */ -- dbg(udev, "searching '/subsystem/*/devices/*' dir\n"); -- scan_dir(udev_enumerate, "subsystem", "devices", NULL); -+ -+ if (udev_list_get_entry(&udev_enumerate->tags_match_list) != NULL) { -+ struct udev_list_entry *list_entry; -+ -+ /* scan only tagged devices, use tags reverse-index, instead of searching all devices in /sys */ -+ udev_list_entry_foreach(list_entry, udev_list_get_entry(&udev_enumerate->tags_match_list)) { -+ DIR *dir; -+ struct dirent *dent; -+ char path[UTIL_PATH_SIZE]; -+ -+ util_strscpyl(path, sizeof(path), udev_get_dev_path(udev), "/.udev/tags/", -+ udev_list_entry_get_name(list_entry), NULL); -+ dir = opendir(path); -+ if (dir == NULL) -+ continue; -+ for (dent = readdir(dir); dent != NULL; dent = readdir(dir)) { -+ struct udev_device *dev; -+ char syspath[UTIL_PATH_SIZE]; -+ char *s; -+ size_t l; -+ ssize_t len; -+ -+ if (dent->d_name[0] == '.') -+ continue; -+ -+ s = syspath; -+ l = util_strpcpyl(&s, sizeof(syspath), udev_get_sys_path(udev), NULL); -+ len = readlinkat(dirfd(dir), dent->d_name, s, l); -+ if (len <= 0 || (size_t)len == l) -+ continue; -+ s[len] = '\0'; -+ -+ dev = udev_device_new_from_syspath(udev_enumerate->udev, syspath); -+ if (dev == NULL) -+ continue; -+ syspath_add(udev_enumerate, udev_device_get_syspath(dev)); -+ udev_device_unref(dev); -+ } -+ } - } else { -+ util_strscpyl(base, sizeof(base), udev_get_sys_path(udev), "/subsystem", NULL); -+ if (stat(base, &statbuf) == 0) { -+ /* we have /subsystem/, forget all the old stuff */ -+ dbg(udev, "searching '/subsystem/*/devices/*' dir\n"); -+ scan_dir(udev_enumerate, "subsystem", "devices", NULL); -+ } else { - dbg(udev, "searching '/bus/*/devices/*' dir\n"); -- scan_dir(udev_enumerate, "bus", "devices", NULL); -- dbg(udev, "searching '/class/*' dir\n"); -- scan_dir(udev_enumerate, "class", NULL, NULL); -+ scan_dir(udev_enumerate, "bus", "devices", NULL); -+ dbg(udev, "searching '/class/*' dir\n"); -+ scan_dir(udev_enumerate, "class", NULL, NULL); -+ } - } -+ - return 0; - } - -@@ -704,6 +768,7 @@ int udev_enumerate_scan_subsystems(struct udev_enumerate *udev_enumerate) - - if (udev_enumerate == NULL) - return -EINVAL; -+ - util_strscpyl(base, sizeof(base), udev_get_sys_path(udev), "/subsystem", NULL); - if (stat(base, &statbuf) == 0) - subsysdir = "subsystem"; -diff --git a/libudev/libudev-monitor.c b/libudev/libudev-monitor.c -index 97e52c4..24e8aea 100644 ---- a/libudev/libudev-monitor.c -+++ b/libudev/libudev-monitor.c -@@ -1,7 +1,7 @@ - /* - * libudev - interface to udev device information - * -- * Copyright (C) 2008-2009 Kay Sievers -+ * Copyright (C) 2008-2010 Kay Sievers - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public -@@ -49,6 +49,7 @@ struct udev_monitor { - struct sockaddr_un sun; - socklen_t addrlen; - struct udev_list_node filter_subsystem_list; -+ struct udev_list_node filter_tag_list; - }; - - enum udev_monitor_netlink_group { -@@ -57,25 +58,28 @@ enum udev_monitor_netlink_group { - UDEV_MONITOR_UDEV, - }; - --#define UDEV_MONITOR_MAGIC 0xcafe1dea -+#define UDEV_MONITOR_MAGIC 0xfeedcafe - struct udev_monitor_netlink_header { -- /* udev version text */ -- char version[16]; -+ /* "libudev" prefix to distinguish libudev and kernel messages */ -+ char prefix[8]; - /* - * magic to protect against daemon <-> library message format mismatch - * used in the kernel from socket filter rules; needs to be stored in network order - */ - unsigned int magic; -- /* properties buffer */ -- unsigned short properties_off; -- unsigned short properties_len; -+ /* total length of header structure known to the sender */ -+ unsigned int header_size; -+ /* properties string buffer */ -+ unsigned int properties_off; -+ unsigned int properties_len; - /* -- * hashes of some common device properties strings to filter with socket filters in -- * the client used in the kernel from socket filter rules; needs to be stored in -- * network order -+ * hashes of primary device properties strings, to let libudev subscribers -+ * use in-kernel socket filters; values need to be stored in network order - */ -- unsigned int filter_subsystem; -- unsigned int filter_devtype; -+ unsigned int filter_subsystem_hash; -+ unsigned int filter_devtype_hash; -+ unsigned int filter_tag_bloom_hi; -+ unsigned int filter_tag_bloom_lo; - }; - - static struct udev_monitor *udev_monitor_new(struct udev *udev) -@@ -88,6 +92,7 @@ static struct udev_monitor *udev_monitor_new(struct udev *udev) - udev_monitor->refcount = 1; - udev_monitor->udev = udev; - udev_list_init(&udev_monitor->filter_subsystem_list); -+ udev_list_init(&udev_monitor->filter_tag_list); - return udev_monitor; - } - -@@ -247,13 +252,14 @@ static inline void bpf_jmp(struct sock_filter *inss, unsigned int *i, - */ - int udev_monitor_filter_update(struct udev_monitor *udev_monitor) - { -- static struct sock_filter ins[256]; -- static struct sock_fprog filter; -+ struct sock_filter ins[512]; -+ struct sock_fprog filter; - unsigned int i; - struct udev_list_entry *list_entry; - int err; - -- if (udev_list_get_entry(&udev_monitor->filter_subsystem_list) == NULL) -+ if (udev_list_get_entry(&udev_monitor->filter_subsystem_list) == NULL && -+ udev_list_get_entry(&udev_monitor->filter_tag_list) == NULL) - return 0; - - memset(ins, 0x00, sizeof(ins)); -@@ -266,35 +272,74 @@ int udev_monitor_filter_update(struct udev_monitor *udev_monitor) - /* wrong magic, pass packet */ - bpf_stmt(ins, &i, BPF_RET|BPF_K, 0xffffffff); - -- /* add all subsystem match values */ -- udev_list_entry_foreach(list_entry, udev_list_get_entry(&udev_monitor->filter_subsystem_list)) { -- unsigned int hash; -- -- /* load filter_subsystem value in A */ -- bpf_stmt(ins, &i, BPF_LD|BPF_W|BPF_ABS, offsetof(struct udev_monitor_netlink_header, filter_subsystem)); -- hash = util_string_hash32(udev_list_entry_get_name(list_entry)); -- if (udev_list_entry_get_value(list_entry) == NULL) { -- /* jump if subsystem does not match */ -- bpf_jmp(ins, &i, BPF_JMP|BPF_JEQ|BPF_K, hash, 0, 1); -- } else { -- /* jump if subsystem does not match */ -- bpf_jmp(ins, &i, BPF_JMP|BPF_JEQ|BPF_K, hash, 0, 3); -- -- /* load filter_devtype value in A */ -- bpf_stmt(ins, &i, BPF_LD|BPF_W|BPF_ABS, offsetof(struct udev_monitor_netlink_header, filter_devtype)); -- /* jump if value does not match */ -- hash = util_string_hash32(udev_list_entry_get_value(list_entry)); -- bpf_jmp(ins, &i, BPF_JMP|BPF_JEQ|BPF_K, hash, 0, 1); -+ if (udev_list_get_entry(&udev_monitor->filter_tag_list) != NULL) { -+ int tag_matches; -+ -+ /* count tag matches, to calculate end of tag match block */ -+ tag_matches = 0; -+ udev_list_entry_foreach(list_entry, udev_list_get_entry(&udev_monitor->filter_tag_list)) -+ tag_matches++; -+ -+ /* add all tags matches */ -+ udev_list_entry_foreach(list_entry, udev_list_get_entry(&udev_monitor->filter_tag_list)) { -+ uint64_t tag_bloom_bits = util_string_bloom64(udev_list_entry_get_name(list_entry)); -+ uint32_t tag_bloom_hi = tag_bloom_bits >> 32; -+ uint32_t tag_bloom_lo = tag_bloom_bits & 0xffffffff; -+ -+ /* load device bloom bits in A */ -+ bpf_stmt(ins, &i, BPF_LD|BPF_W|BPF_ABS, offsetof(struct udev_monitor_netlink_header, filter_tag_bloom_hi)); -+ /* clear bits (tag bits & bloom bits) */ -+ bpf_stmt(ins, &i, BPF_ALU|BPF_AND|BPF_K, tag_bloom_hi); -+ /* jump to next tag if it does not match */ -+ bpf_jmp(ins, &i, BPF_JMP|BPF_JEQ|BPF_K, tag_bloom_hi, 0, 3); -+ -+ /* load device bloom bits in A */ -+ bpf_stmt(ins, &i, BPF_LD|BPF_W|BPF_ABS, offsetof(struct udev_monitor_netlink_header, filter_tag_bloom_lo)); -+ /* clear bits (tag bits & bloom bits) */ -+ bpf_stmt(ins, &i, BPF_ALU|BPF_AND|BPF_K, tag_bloom_lo); -+ /* jump behind end of tag match block if tag matches */ -+ tag_matches--; -+ bpf_jmp(ins, &i, BPF_JMP|BPF_JEQ|BPF_K, tag_bloom_lo, 1 + (tag_matches * 6), 0); - } - -- /* matched, pass packet */ -- bpf_stmt(ins, &i, BPF_RET|BPF_K, 0xffffffff); -+ /* nothing matched, drop packet */ -+ bpf_stmt(ins, &i, BPF_RET|BPF_K, 0); -+ } - -- if (i+1 >= ARRAY_SIZE(ins)) -- return -1; -+ /* add all subsystem matches */ -+ if (udev_list_get_entry(&udev_monitor->filter_subsystem_list) != NULL) { -+ udev_list_entry_foreach(list_entry, udev_list_get_entry(&udev_monitor->filter_subsystem_list)) { -+ unsigned int hash = util_string_hash32(udev_list_entry_get_name(list_entry)); -+ -+ /* load device subsystem value in A */ -+ bpf_stmt(ins, &i, BPF_LD|BPF_W|BPF_ABS, offsetof(struct udev_monitor_netlink_header, filter_subsystem_hash)); -+ if (udev_list_entry_get_value(list_entry) == NULL) { -+ /* jump if subsystem does not match */ -+ bpf_jmp(ins, &i, BPF_JMP|BPF_JEQ|BPF_K, hash, 0, 1); -+ } else { -+ /* jump if subsystem does not match */ -+ bpf_jmp(ins, &i, BPF_JMP|BPF_JEQ|BPF_K, hash, 0, 3); -+ -+ /* load device devtype value in A */ -+ bpf_stmt(ins, &i, BPF_LD|BPF_W|BPF_ABS, offsetof(struct udev_monitor_netlink_header, filter_devtype_hash)); -+ /* jump if value does not match */ -+ hash = util_string_hash32(udev_list_entry_get_value(list_entry)); -+ bpf_jmp(ins, &i, BPF_JMP|BPF_JEQ|BPF_K, hash, 0, 1); -+ } -+ -+ /* matched, pass packet */ -+ bpf_stmt(ins, &i, BPF_RET|BPF_K, 0xffffffff); -+ -+ if (i+1 >= ARRAY_SIZE(ins)) -+ return -1; -+ } -+ -+ /* nothing matched, drop packet */ -+ bpf_stmt(ins, &i, BPF_RET|BPF_K, 0); - } -- /* nothing matched, drop packet */ -- bpf_stmt(ins, &i, BPF_RET|BPF_K, 0); -+ -+ /* matched, pass packet */ -+ bpf_stmt(ins, &i, BPF_RET|BPF_K, 0xffffffff); - - /* install filter */ - filter.len = i; -@@ -406,6 +451,7 @@ void udev_monitor_unref(struct udev_monitor *udev_monitor) - if (udev_monitor->sock >= 0) - close(udev_monitor->sock); - udev_list_cleanup_entries(udev_monitor->udev, &udev_monitor->filter_subsystem_list); -+ udev_list_cleanup_entries(udev_monitor->udev, &udev_monitor->filter_tag_list); - dbg(udev_monitor->udev, "monitor %p released\n", udev_monitor); - free(udev_monitor); - } -@@ -445,8 +491,7 @@ static int passes_filter(struct udev_monitor *udev_monitor, struct udev_device * - struct udev_list_entry *list_entry; - - if (udev_list_get_entry(&udev_monitor->filter_subsystem_list) == NULL) -- return 1; -- -+ goto tag; - udev_list_entry_foreach(list_entry, udev_list_get_entry(&udev_monitor->filter_subsystem_list)) { - const char *subsys = udev_list_entry_get_name(list_entry); - const char *dsubsys = udev_device_get_subsystem(udev_device); -@@ -458,11 +503,22 @@ static int passes_filter(struct udev_monitor *udev_monitor, struct udev_device * - - devtype = udev_list_entry_get_value(list_entry); - if (devtype == NULL) -- return 1; -+ goto tag; - ddevtype = udev_device_get_devtype(udev_device); - if (ddevtype == NULL) - continue; - if (strcmp(ddevtype, devtype) == 0) -+ goto tag; -+ } -+ return 0; -+ -+tag: -+ if (udev_list_get_entry(&udev_monitor->filter_tag_list) == NULL) -+ return 1; -+ udev_list_entry_foreach(list_entry, udev_list_get_entry(&udev_monitor->filter_tag_list)) { -+ const char *tag = udev_list_entry_get_name(list_entry); -+ -+ if (udev_device_has_tag(udev_device, tag)) - return 1; - } - return 0; -@@ -556,13 +612,11 @@ retry: - return NULL; - } - -- if (strncmp(buf, "udev-", 5) == 0) { -+ if (memcmp(buf, "libudev", 8) == 0) { - /* udev message needs proper version magic */ - nlh = (struct udev_monitor_netlink_header *) buf; - if (nlh->magic != htonl(UDEV_MONITOR_MAGIC)) - return NULL; -- if (nlh->properties_off < sizeof(struct udev_monitor_netlink_header)) -- return NULL; - if (nlh->properties_off+32 > buflen) - return NULL; - bufpos = nlh->properties_off; -@@ -626,17 +680,17 @@ retry: - int udev_monitor_send_device(struct udev_monitor *udev_monitor, - struct udev_monitor *destination, struct udev_device *udev_device) - { -- struct msghdr smsg; -- struct iovec iov[2]; - const char *buf; - ssize_t blen; - ssize_t count; - - blen = udev_device_get_properties_monitor_buf(udev_device, &buf); - if (blen < 32) -- return -1; -+ return -EINVAL; - - if (udev_monitor->sun.sun_family != 0) { -+ struct msghdr smsg; -+ struct iovec iov[2]; - const char *action; - char header[2048]; - char *s; -@@ -660,23 +714,41 @@ int udev_monitor_send_device(struct udev_monitor *udev_monitor, - smsg.msg_iovlen = 2; - smsg.msg_name = &udev_monitor->sun; - smsg.msg_namelen = udev_monitor->addrlen; -- } else if (udev_monitor->snl.nl_family != 0) { -+ count = sendmsg(udev_monitor->sock, &smsg, 0); -+ info(udev_monitor->udev, "passed %zi bytes to socket monitor %p\n", count, udev_monitor); -+ return count; -+ } -+ -+ if (udev_monitor->snl.nl_family != 0) { -+ struct msghdr smsg; -+ struct iovec iov[2]; - const char *val; - struct udev_monitor_netlink_header nlh; -- -+ struct udev_list_entry *list_entry; -+ uint64_t tag_bloom_bits; - - /* add versioned header */ - memset(&nlh, 0x00, sizeof(struct udev_monitor_netlink_header)); -- util_strscpy(nlh.version, sizeof(nlh.version), "udev-" VERSION); -+ memcpy(nlh.prefix, "libudev", 8); - nlh.magic = htonl(UDEV_MONITOR_MAGIC); -+ nlh.header_size = sizeof(struct udev_monitor_netlink_header); - val = udev_device_get_subsystem(udev_device); -- nlh.filter_subsystem = htonl(util_string_hash32(val)); -+ nlh.filter_subsystem_hash = htonl(util_string_hash32(val)); - val = udev_device_get_devtype(udev_device); - if (val != NULL) -- nlh.filter_devtype = htonl(util_string_hash32(val)); -+ nlh.filter_devtype_hash = htonl(util_string_hash32(val)); - iov[0].iov_base = &nlh; - iov[0].iov_len = sizeof(struct udev_monitor_netlink_header); - -+ /* add tag bloom filter */ -+ tag_bloom_bits = 0; -+ udev_list_entry_foreach(list_entry, udev_device_get_tags_list_entry(udev_device)) -+ tag_bloom_bits |= util_string_bloom64(udev_list_entry_get_name(list_entry)); -+ if (tag_bloom_bits > 0) { -+ nlh.filter_tag_bloom_hi = htonl(tag_bloom_bits >> 32); -+ nlh.filter_tag_bloom_lo = htonl(tag_bloom_bits & 0xffffffff); -+ } -+ - /* add properties list */ - nlh.properties_off = iov[0].iov_len; - nlh.properties_len = blen; -@@ -697,13 +769,12 @@ int udev_monitor_send_device(struct udev_monitor *udev_monitor, - else - smsg.msg_name = &udev_monitor->snl_destination; - smsg.msg_namelen = sizeof(struct sockaddr_nl); -- } else { -- return -1; -+ count = sendmsg(udev_monitor->sock, &smsg, 0); -+ info(udev_monitor->udev, "passed %zi bytes to netlink monitor %p\n", count, udev_monitor); -+ return count; - } - -- count = sendmsg(udev_monitor->sock, &smsg, 0); -- info(udev_monitor->udev, "passed %zi bytes to monitor %p\n", count, udev_monitor); -- return count; -+ return -EINVAL; - } - - /** -@@ -712,6 +783,9 @@ int udev_monitor_send_device(struct udev_monitor *udev_monitor, - * @subsystem: the subsystem value to match the incoming devices against - * @devtype: the devtype value to match the incoming devices against - * -+ * This filer is efficiently executed inside the kernel, and libudev subscribers -+ * will usually not be woken up for devices which do not match. -+ * - * The filter must be installed before the monitor is switched to listening mode. - * - * Returns: 0 on success, otherwise a negative error value. -@@ -721,7 +795,7 @@ int udev_monitor_filter_add_match_subsystem_devtype(struct udev_monitor *udev_mo - if (udev_monitor == NULL) - return -EINVAL; - if (subsystem == NULL) -- return 0; -+ return -EINVAL; - if (udev_list_entry_add(udev_monitor->udev, - &udev_monitor->filter_subsystem_list, subsystem, devtype, 0, 0) == NULL) - return -ENOMEM; -@@ -729,6 +803,30 @@ int udev_monitor_filter_add_match_subsystem_devtype(struct udev_monitor *udev_mo - } - - /** -+ * udev_monitor_filter_add_match_tag: -+ * @udev_monitor: the monitor -+ * @tag: the name of a tag -+ * -+ * This filer is efficiently executed inside the kernel, and libudev subscribers -+ * will usually not be woken up for devices which do not match. -+ * -+ * The filter must be installed before the monitor is switched to listening mode. -+ * -+ * Returns: 0 on success, otherwise a negative error value. -+ */ -+int udev_monitor_filter_add_match_tag(struct udev_monitor *udev_monitor, const char *tag) -+{ -+ if (udev_monitor == NULL) -+ return -EINVAL; -+ if (tag == NULL) -+ return -EINVAL; -+ if (udev_list_entry_add(udev_monitor->udev, -+ &udev_monitor->filter_tag_list, tag, NULL, 0, 0) == NULL) -+ return -ENOMEM; -+ return 0; -+} -+ -+/** - * udev_monitor_filter_remove: - * @udev_monitor: monitor - * -diff --git a/libudev/libudev-private.h b/libudev/libudev-private.h -index 8dc469e..548f4ad 100644 ---- a/libudev/libudev-private.h -+++ b/libudev/libudev-private.h -@@ -14,6 +14,8 @@ - - #include - #include -+#include -+#include - #include "libudev.h" - - #define ARRAY_SIZE(x) (sizeof(x) / sizeof((x)[0])) -@@ -84,7 +86,8 @@ const char *udev_device_get_sysname_old(struct udev_device *udev_device); - int udev_device_set_devpath_old(struct udev_device *udev_device, const char *devpath_old); - const char *udev_device_get_knodename(struct udev_device *udev_device); - int udev_device_add_tag(struct udev_device *udev_device, const char *tag); --struct udev_list_entry *udev_device_get_tag_list_entry(struct udev_device *udev_device); -+void udev_device_cleanup_tags_list(struct udev_device *udev_device); -+struct udev_list_entry *udev_device_get_tags_list_entry(struct udev_device *udev_device); - int udev_device_has_tag(struct udev_device *udev_device, const char *tag); - int udev_device_set_knodename(struct udev_device *udev_device, const char *knodename); - int udev_device_get_timeout(struct udev_device *udev_device); -@@ -203,7 +206,8 @@ size_t util_strscpyl(char *dest, size_t size, const char *src, ...) __attribute_ - int udev_util_replace_whitespace(const char *str, char *to, size_t len); - int udev_util_replace_chars(char *str, const char *white); - int udev_util_encode_string(const char *str, char *str_enc, size_t len); --unsigned int util_string_hash32(const char *str); -+unsigned int util_string_hash32(const char *key); -+uint64_t util_string_bloom64(const char *str); - - /* libudev-util-private.c */ - int util_create_path(struct udev *udev, const char *path); -diff --git a/libudev/libudev-util.c b/libudev/libudev-util.c -index c0209f9..3a67b0c 100644 ---- a/libudev/libudev-util.c -+++ b/libudev/libudev-util.c -@@ -481,15 +481,74 @@ err: - return -1; - } - -+/* -+ * http://sites.google.com/site/murmurhash/ -+ * -+ * All code is released to the public domain. For business purposes, -+ * Murmurhash is under the MIT license. -+ * -+ */ -+static unsigned int murmur_hash2(const char *key, int len, unsigned int seed) -+{ -+ /* -+ * 'm' and 'r' are mixing constants generated offline. -+ * They're not really 'magic', they just happen to work well. -+ */ -+ const unsigned int m = 0x5bd1e995; -+ const int r = 24; -+ -+ /* initialize the hash to a 'random' value */ -+ unsigned int h = seed ^ len; -+ -+ /* mix 4 bytes at a time into the hash */ -+ const unsigned char * data = (const unsigned char *)key; -+ -+ while(len >= 4) { -+ unsigned int k = *(unsigned int *)data; -+ -+ k *= m; -+ k ^= k >> r; -+ k *= m; -+ h *= m; -+ h ^= k; -+ -+ data += 4; -+ len -= 4; -+ } -+ -+ /* handle the last few bytes of the input array */ -+ switch(len) { -+ case 3: -+ h ^= data[2] << 16; -+ case 2: -+ h ^= data[1] << 8; -+ case 1: -+ h ^= data[0]; -+ h *= m; -+ }; -+ -+ /* do a few final mixes of the hash to ensure the last few bytes are well-incorporated */ -+ h ^= h >> 13; -+ h *= m; -+ h ^= h >> 15; -+ -+ return h; -+} -+ - unsigned int util_string_hash32(const char *str) - { -- unsigned int hash = 0; -+ return murmur_hash2(str, strlen(str), 0); -+} - -- while (str[0] != '\0') { -- hash += str[0] << 4; -- hash += str[0] >> 4; -- hash *= 11; -- str++; -- } -- return hash; -+/* get a bunch of bit numbers out of the hash, and set the bits in our bit field */ -+uint64_t util_string_bloom64(const char *str) -+{ -+ uint64_t bits = 0; -+ unsigned int hash = util_string_hash32(str); -+ -+ bits |= 1LLU << (hash & 63); -+ bits |= 1LLU << ((hash >> 6) & 63); -+ bits |= 1LLU << ((hash >> 12) & 63); -+ bits |= 1LLU << ((hash >> 18) & 63); -+ return bits; - } -diff --git a/libudev/libudev.h b/libudev/libudev.h -index 750664f..3b73fbd 100644 ---- a/libudev/libudev.h -+++ b/libudev/libudev.h -@@ -1,7 +1,7 @@ - /* - * libudev - interface to udev device information - * -- * Copyright (C) 2008-2009 Kay Sievers -+ * Copyright (C) 2008-2010 Kay Sievers - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public -@@ -118,6 +118,7 @@ struct udev_device *udev_monitor_receive_device(struct udev_monitor *udev_monito - /* in-kernel socket filters to select messages that get delivered to a listener */ - int udev_monitor_filter_add_match_subsystem_devtype(struct udev_monitor *udev_monitor, - const char *subsystem, const char *devtype); -+int udev_monitor_filter_add_match_tag(struct udev_monitor *udev_monitor, const char *tag); - int udev_monitor_filter_update(struct udev_monitor *udev_monitor); - int udev_monitor_filter_remove(struct udev_monitor *udev_monitor); - -@@ -138,6 +139,7 @@ int udev_enumerate_add_match_sysattr(struct udev_enumerate *udev_enumerate, cons - int udev_enumerate_add_nomatch_sysattr(struct udev_enumerate *udev_enumerate, const char *sysattr, const char *value); - int udev_enumerate_add_match_property(struct udev_enumerate *udev_enumerate, const char *property, const char *value); - int udev_enumerate_add_match_sysname(struct udev_enumerate *udev_enumerate, const char *sysname); -+int udev_enumerate_add_match_tag(struct udev_enumerate *udev_enumerate, const char *tag); - int udev_enumerate_add_syspath(struct udev_enumerate *udev_enumerate, const char *syspath); - /* run enumeration with active filters */ - int udev_enumerate_scan_devices(struct udev_enumerate *udev_enumerate); -diff --git a/udev/udev-event.c b/udev/udev-event.c -index b2e1bae..212ccc7 100644 ---- a/udev/udev-event.c -+++ b/udev/udev-event.c -@@ -543,7 +543,6 @@ int udev_event_execute_rules(struct udev_event *event, struct udev_rules *rules) - - if (strcmp(udev_device_get_action(dev), "remove") == 0) { - udev_device_read_db(dev); -- udev_device_set_info_loaded(dev); - udev_device_delete_db(dev); - - if (major(udev_device_get_devnum(dev)) != 0) -diff --git a/udev/udev-rules.c b/udev/udev-rules.c -index 6eb8350..b5016d0 100644 ---- a/udev/udev-rules.c -+++ b/udev/udev-rules.c -@@ -157,6 +157,7 @@ enum token_type { - TK_A_GROUP_ID, /* gid_t */ - TK_A_MODE_ID, /* mode_t */ - TK_A_ENV, /* val, attr */ -+ TK_A_TAG, /* val */ - TK_A_NAME, /* val */ - TK_A_DEVLINK, /* val */ - TK_A_EVENT_TIMEOUT, /* int */ -@@ -285,6 +286,7 @@ static const char *token_str(enum token_type type) - [TK_A_GROUP_ID] = "A GROUP_ID", - [TK_A_MODE_ID] = "A MODE_ID", - [TK_A_ENV] = "A ENV", -+ [TK_A_TAG] = "A ENV", - [TK_A_NAME] = "A NAME", - [TK_A_DEVLINK] = "A DEVLINK", - [TK_A_EVENT_TIMEOUT] = "A EVENT_TIMEOUT", -@@ -354,6 +356,9 @@ static void dump_token(struct udev_rules *rules, struct token *token) - dbg(rules->udev, "%s %s '%s' '%s'(%s)\n", - token_str(type), operation_str(op), attr, value, string_glob_str(glob)); - break; -+ case TK_A_TAG: -+ dbg(rules->udev, "%s %s '%s'\n", token_str(type), operation_str(op), value); -+ break; - case TK_A_STRING_ESCAPE_NONE: - case TK_A_STRING_ESCAPE_REPLACE: - dbg(rules->udev, "%s\n", token_str(type)); -@@ -1003,6 +1008,7 @@ static int rule_add_key(struct rule_tmp *rule_tmp, enum token_type type, - case TK_A_MODE: - case TK_A_NAME: - case TK_A_GOTO: -+ case TK_A_TAG: - token->key.value_off = add_string(rule_tmp->rules, value); - break; - case TK_M_ENV: -@@ -1350,6 +1356,11 @@ static int add_rule(struct udev_rules *rules, char *line, - continue; - } - -+ if (strcmp(key, "TAG") == 0) { -+ rule_add_key(&rule_tmp, TK_A_TAG, op, value, NULL); -+ continue; -+ } -+ - if (strcmp(key, "PROGRAM") == 0) { - rule_add_key(&rule_tmp, TK_M_PROGRAM, op, value, NULL); - continue; -@@ -2408,6 +2419,9 @@ int udev_rules_apply_to_event(struct udev_rules *rules, struct udev_event *event - } - break; - } -+ case TK_A_TAG: -+ udev_device_add_tag(event->dev, &rules->buf[cur->key.value_off]); -+ break; - case TK_A_NAME: - { - const char *name = &rules->buf[cur->key.value_off]; -diff --git a/udev/udev.xml b/udev/udev.xml -index 192a6f1..842fd5d 100644 ---- a/udev/udev.xml -+++ b/udev/udev.xml -@@ -349,6 +349,19 @@ - - - -+ -+ -+ Attach a tag to a device. This is used to filter events for users -+ of libudev's monitor functionality, or to enumerate a group of tagged -+ devices. The implementation can only work efficiently if only a few -+ tags are attached to a device. It is only meant to be used in -+ contexts with specific device filter requirements, and not as a -+ general-purpose flag. Excessive use might result in inefficient event -+ handling. -+ -+ -+ -+ - - - Add a program to the list of programs to be executed for a specific -diff --git a/udev/udevadm-monitor.c b/udev/udevadm-monitor.c -index d136c60..fb65084 100644 ---- a/udev/udevadm-monitor.c -+++ b/udev/udevadm-monitor.c -@@ -73,6 +73,7 @@ int udevadm_monitor(struct udev *udev, int argc, char *argv[]) - int print_kernel = 0; - int print_udev = 0; - struct udev_list_node subsystem_match_list; -+ struct udev_list_node tag_match_list; - struct udev_monitor *udev_monitor = NULL; - struct udev_monitor *kernel_monitor = NULL; - fd_set readfds; -@@ -84,13 +85,15 @@ int udevadm_monitor(struct udev *udev, int argc, char *argv[]) - { "kernel", no_argument, NULL, 'k' }, - { "udev", no_argument, NULL, 'u' }, - { "subsystem-match", required_argument, NULL, 's' }, -+ { "tag-match", required_argument, NULL, 't' }, - { "help", no_argument, NULL, 'h' }, - {} - }; - - udev_list_init(&subsystem_match_list); -+ udev_list_init(&tag_match_list); - while (1) { -- option = getopt_long(argc, argv, "epkus:h", options, NULL); -+ option = getopt_long(argc, argv, "pekus:t:h", options, NULL); - if (option == -1) - break; - -@@ -119,12 +122,16 @@ int udevadm_monitor(struct udev *udev, int argc, char *argv[]) - udev_list_entry_add(udev, &subsystem_match_list, subsys, devtype, 0, 0); - break; - } -+ case 't': -+ udev_list_entry_add(udev, &tag_match_list, optarg, NULL, 0, 0); -+ break; - case 'h': - printf("Usage: udevadm monitor [--property] [--kernel] [--udev] [--help]\n" - " --property print the event properties\n" - " --kernel print kernel uevents\n" - " --udev print udev events\n" - " --subsystem-match= filter events by subsystem\n" -+ " --tag-match= filter events by tag\n" - " --help\n\n"); - default: - goto out; -@@ -168,6 +175,13 @@ int udevadm_monitor(struct udev *udev, int argc, char *argv[]) - fprintf(stderr, "error: unable to apply subsystem filter '%s'\n", subsys); - } - -+ udev_list_entry_foreach(entry, udev_list_get_entry(&tag_match_list)) { -+ const char *tag = udev_list_entry_get_name(entry); -+ -+ if (udev_monitor_filter_add_match_tag(udev_monitor, tag) < 0) -+ fprintf(stderr, "error: unable to apply tag filter '%s'\n", tag); -+ } -+ - if (udev_monitor_enable_receiving(udev_monitor) < 0) { - fprintf(stderr, "error: unable to subscribe to udev events\n"); - rc = 2; -@@ -244,5 +258,6 @@ out: - udev_monitor_unref(udev_monitor); - udev_monitor_unref(kernel_monitor); - udev_list_cleanup_entries(udev, &subsystem_match_list); -+ udev_list_cleanup_entries(udev, &tag_match_list); - return rc; - } -diff --git a/udev/udevadm-trigger.c b/udev/udevadm-trigger.c -index 03aa534..3cb07dd 100644 ---- a/udev/udevadm-trigger.c -+++ b/udev/udevadm-trigger.c -@@ -101,6 +101,7 @@ int udevadm_trigger(struct udev *udev, int argc, char *argv[]) - { "attr-match", required_argument, NULL, 'a' }, - { "attr-nomatch", required_argument, NULL, 'A' }, - { "property-match", required_argument, NULL, 'p' }, -+ { "tag-match", required_argument, NULL, 'g' }, - { "sysname-match", required_argument, NULL, 'y' }, - { "help", no_argument, NULL, 'h' }, - {} -@@ -127,7 +128,7 @@ int udevadm_trigger(struct udev *udev, int argc, char *argv[]) - const char *val; - char buf[UTIL_PATH_SIZE]; - -- option = getopt_long(argc, argv, "vnFo:t:hcp:s:S:a:A:y:", options, NULL); -+ option = getopt_long(argc, argv, "vng:o:t:hcp:s:S:a:A:y:", options, NULL); - if (option == -1) - break; - -@@ -172,6 +173,9 @@ int udevadm_trigger(struct udev *udev, int argc, char *argv[]) - key = keyval(optarg, &val, buf, sizeof(buf)); - udev_enumerate_add_match_property(udev_enumerate, key, val); - break; -+ case 'g': -+ udev_enumerate_add_match_tag(udev_enumerate, optarg); -+ break; - case 'y': - udev_enumerate_add_match_sysname(udev_enumerate, optarg); - break; -@@ -190,6 +194,7 @@ int udevadm_trigger(struct udev *udev, int argc, char *argv[]) - " --attr-match=]> trigger devices with a matching attribute\n" - " --attr-nomatch=]> exclude devices with a matching attribute\n" - " --property-match== trigger devices with a matching property\n" -+ " --tag-match== trigger devices with a matching property\n" - " --sysname-match= trigger devices with a matching name\n" - " --help\n\n"); - goto exit; -diff --git a/udev/udevadm.xml b/udev/udevadm.xml -index fa1742b..73e6f11 100644 ---- a/udev/udevadm.xml -+++ b/udev/udevadm.xml -@@ -217,6 +217,13 @@ - - - -+ -+ -+ Trigger events for devices with a matching tag. This option can be -+ specified multiple times. -+ -+ -+ - - - Trigger events for devices with a matching sys device name. This option can be -@@ -356,6 +363,12 @@ - - - -+ -+ -+ Filter events by property. Only udev events with a given tag attached will pass. -+ -+ -+ - - - Print help text. --- -1.7.0.1 - diff --git a/0009-all-to-match-against-a-given-TAG.patch b/0009-all-to-match-against-a-given-TAG.patch deleted file mode 100644 index 7366d27..0000000 --- a/0009-all-to-match-against-a-given-TAG.patch +++ /dev/null @@ -1,101 +0,0 @@ -From 3f896a2abd76972eafe636cac4110608b6d3ff2f Mon Sep 17 00:00:00 2001 -From: Kay Sievers -Date: Thu, 22 Apr 2010 18:33:24 +0200 -Subject: [PATCH 09/19] all to match against a given TAG== - ---- - udev/udev-rules.c | 24 +++++++++++++++++++++++- - udev/udev.xml | 7 +++++++ - 2 files changed, 30 insertions(+), 1 deletions(-) - -diff --git a/udev/udev-rules.c b/udev/udev-rules.c -index b5016d0..5965723 100644 ---- a/udev/udev-rules.c -+++ b/udev/udev-rules.c -@@ -125,6 +125,7 @@ enum token_type { - TK_M_DEVLINK, /* val */ - TK_M_NAME, /* val */ - TK_M_ENV, /* val, attr */ -+ TK_M_TAG, /* val */ - TK_M_SUBSYSTEM, /* val */ - TK_M_DRIVER, /* val */ - TK_M_WAITFOR, /* val */ -@@ -254,6 +255,7 @@ static const char *token_str(enum token_type type) - [TK_M_DEVLINK] = "M DEVLINK", - [TK_M_NAME] = "M NAME", - [TK_M_ENV] = "M ENV", -+ [TK_M_TAG] = "M TAG", - [TK_M_SUBSYSTEM] = "M SUBSYSTEM", - [TK_M_DRIVER] = "M DRIVER", - [TK_M_WAITFOR] = "M WAITFOR", -@@ -356,6 +358,7 @@ static void dump_token(struct udev_rules *rules, struct token *token) - dbg(rules->udev, "%s %s '%s' '%s'(%s)\n", - token_str(type), operation_str(op), attr, value, string_glob_str(glob)); - break; -+ case TK_M_TAG: - case TK_A_TAG: - dbg(rules->udev, "%s %s '%s'\n", token_str(type), operation_str(op), value); - break; -@@ -1008,6 +1011,7 @@ static int rule_add_key(struct rule_tmp *rule_tmp, enum token_type type, - case TK_A_MODE: - case TK_A_NAME: - case TK_A_GOTO: -+ case TK_M_TAG: - case TK_A_TAG: - token->key.value_off = add_string(rule_tmp->rules, value); - break; -@@ -1357,7 +1361,10 @@ static int add_rule(struct udev_rules *rules, char *line, - } - - if (strcmp(key, "TAG") == 0) { -- rule_add_key(&rule_tmp, TK_A_TAG, op, value, NULL); -+ if (op < OP_MATCH_MAX) -+ rule_add_key(&rule_tmp, TK_M_TAG, op, value, NULL); -+ else -+ rule_add_key(&rule_tmp, TK_A_TAG, op, value, NULL); - continue; - } - -@@ -2104,6 +2111,21 @@ int udev_rules_apply_to_event(struct udev_rules *rules, struct udev_event *event - goto nomatch; - break; - } -+ case TK_M_TAG: -+ { -+ struct udev_list_entry *list_entry; -+ bool match = false; -+ -+ udev_list_entry_foreach(list_entry, udev_device_get_tags_list_entry(event->dev)) { -+ if (strcmp(&rules->buf[cur->key.value_off], udev_list_entry_get_name(list_entry)) == 0) { -+ match = true; -+ break; -+ } -+ } -+ if (!match && (cur->key.op != OP_NOMATCH)) -+ goto nomatch; -+ break; -+ } - case TK_M_SUBSYSTEM: - if (match_key(rules, cur, udev_device_get_subsystem(event->dev)) != 0) - goto nomatch; -diff --git a/udev/udev.xml b/udev/udev.xml -index 842fd5d..d2277c9 100644 ---- a/udev/udev.xml -+++ b/udev/udev.xml -@@ -238,6 +238,13 @@ - - - -+ -+ -+ Match against a device tag. -+ -+ -+ -+ - - - Test the existence of a file. An octal mode mask can be specified --- -1.7.0.1 - diff --git a/0010-udev-acl-use-a-tag-instead-of-a-property-to-mark-dev.patch b/0010-udev-acl-use-a-tag-instead-of-a-property-to-mark-dev.patch deleted file mode 100644 index cff2caa..0000000 --- a/0010-udev-acl-use-a-tag-instead-of-a-property-to-mark-dev.patch +++ /dev/null @@ -1,125 +0,0 @@ -From f24362441f6165544888d8d97d63ff881e78f13f Mon Sep 17 00:00:00 2001 -From: Kay Sievers -Date: Thu, 22 Apr 2010 18:33:49 +0200 -Subject: [PATCH 10/19] udev-acl: use a tag instead of a property to mark devices - ---- - extras/udev-acl/70-acl.rules | 48 +++++++++++++++++++++--------------------- - extras/udev-acl/udev-acl.c | 2 +- - 2 files changed, 25 insertions(+), 25 deletions(-) - -diff --git a/extras/udev-acl/70-acl.rules b/extras/udev-acl/70-acl.rules -index 5b00bf8..cf6b0ea 100644 ---- a/extras/udev-acl/70-acl.rules -+++ b/extras/udev-acl/70-acl.rules -@@ -8,70 +8,70 @@ ACTION=="remove", GOTO="acl_apply" - - # PTP/MTP protocol devices, cameras, portable media players - SUBSYSTEM=="usb", ENV{ID_USB_INTERFACES}=="", ENV{DEVTYPE}=="usb_device", IMPORT{program}="usb_id --export %p" --SUBSYSTEM=="usb", ENV{ID_USB_INTERFACES}=="*:060101:*", ENV{ACL_MANAGE}="1" -+SUBSYSTEM=="usb", ENV{ID_USB_INTERFACES}=="*:060101:*", TAG="udev-acl" - - # digicams with proprietary protocol --ENV{ID_GPHOTO2}=="*?", ENV{ACL_MANAGE}="1" -+ENV{ID_GPHOTO2}=="*?", TAG="udev-acl" - - # SCSI scanners --KERNEL=="sg[0-9]*", ATTRS{type}=="6", ENV{ACL_MANAGE}="1" --KERNEL=="sg[0-9]*", ATTRS{type}=="3", ATTRS{vendor}=="HP|EPSON|Epson", ENV{ACL_MANAGE}="1" -+KERNEL=="sg[0-9]*", ATTRS{type}=="6", TAG="udev-acl" -+KERNEL=="sg[0-9]*", ATTRS{type}=="3", ATTRS{vendor}=="HP|EPSON|Epson", TAG="udev-acl" - - # USB scanners --ENV{libsane_matched}=="yes", ENV{ACL_MANAGE}="1" -+ENV{libsane_matched}=="yes", TAG="udev-acl" - - # HPLIP devices (necessary for ink level check and HP tool maintenance) --ENV{ID_HPLIP}=="1", ENV{ACL_MANAGE}="1" -+ENV{ID_HPLIP}=="1", TAG="udev-acl" - - # optical drives --SUBSYSTEM=="block", ENV{ID_CDROM}=="1", ENV{ACL_MANAGE}="1" -+SUBSYSTEM=="block", ENV{ID_CDROM}=="1", TAG="udev-acl" - - # sound devices --SUBSYSTEM=="sound", ENV{ACL_MANAGE}="1" -+SUBSYSTEM=="sound", TAG="udev-acl" - # sound jack-sense --SUBSYSTEM=="input", SUBSYSTEMS=="sound", ENV{ACL_MANAGE}="1" -+SUBSYSTEM=="input", SUBSYSTEMS=="sound", TAG="udev-acl" - - # webcams, frame grabber, TV cards --SUBSYSTEM=="video4linux", ENV{ACL_MANAGE}="1" --SUBSYSTEM=="dvb", ENV{ACL_MANAGE}="1" -+SUBSYSTEM=="video4linux", TAG="udev-acl" -+SUBSYSTEM=="dvb", TAG="udev-acl" - - # IIDC devices: industrial cameras and some webcams --SUBSYSTEM=="firewire", ATTR{units}=="*0x00a02d:0x00010*", ENV{ACL_MANAGE}="1" -+SUBSYSTEM=="firewire", ATTR{units}=="*0x00a02d:0x00010*", TAG="udev-acl" - # AV/C devices: camcorders, set-top boxes, TV sets, audio devices, and more --SUBSYSTEM=="firewire", ATTR{units}=="*0x00a02d:0x010001*", ENV{ACL_MANAGE}="1" -+SUBSYSTEM=="firewire", ATTR{units}=="*0x00a02d:0x010001*", TAG="udev-acl" - - # old style firewire devices --KERNEL=="dv1394-[0-9]*", ENV{ACL_MANAGE}="1" --KERNEL=="video1394-[0-9]*", ENV{ACL_MANAGE}="1" -+KERNEL=="dv1394-[0-9]*", TAG="udev-acl" -+KERNEL=="video1394-[0-9]*", TAG="udev-acl" - - # fingerprint readers --SUBSYSTEM=="usb", ATTR{idVendor}=="0483", ATTR{idProduct}=="2016", ENV{ACL_MANAGE}="1" -+SUBSYSTEM=="usb", ATTR{idVendor}=="0483", ATTR{idProduct}=="2016", TAG="udev-acl" - - # GPS devices - # Garmin GPSMap 60 --SUBSYSTEM=="usb", ATTR{idVendor}=="091e", ATTR{idProduct}=="0003", ENV{ACL_MANAGE}="1" -+SUBSYSTEM=="usb", ATTR{idVendor}=="091e", ATTR{idProduct}=="0003", TAG="udev-acl" - - - # DRI video devices --SUBSYSTEM=="drm", KERNEL=="card*", ENV{ACL_MANAGE}="1" -+SUBSYSTEM=="drm", KERNEL=="card*", TAG="udev-acl" - - # KVM --SUBSYSTEM=="misc", KERNEL=="kvm", ENV{ACL_MANAGE}="1" -+SUBSYSTEM=="misc", KERNEL=="kvm", TAG="udev-acl" - - # smart-card readers --ENV{ID_SMARTCARD_READER}=="*?", ENV{ACL_MANAGE}="1" -+ENV{ID_SMARTCARD_READER}=="*?", TAG="udev-acl" - - # joysticks --SUBSYSTEM=="input", ENV{ID_INPUT_JOYSTICK}=="?*", ENV{ACL_MANAGE}="1" -+SUBSYSTEM=="input", ENV{ID_INPUT_JOYSTICK}=="?*", TAG="udev-acl" - - # smart phones --SUBSYSTEM=="usb", ATTR{idVendor}=="0bb4", ATTR{idProduct}=="0c02", ENV{ACL_MANAGE}="1" -+SUBSYSTEM=="usb", ATTR{idVendor}=="0bb4", ATTR{idProduct}=="0c02", TAG="udev-acl" - - # color measurement devices --ENV{COLOR_MEASUREMENT_DEVICE}=="*?", ENV{ACL_MANAGE}="1" -+ENV{COLOR_MEASUREMENT_DEVICE}=="*?", TAG="udev-acl" - - # apply ACL for all locally logged in users --LABEL="acl_apply", ENV{ACL_MANAGE}=="1", TEST=="/var/run/ConsoleKit/database", \ -+LABEL="acl_apply", TAG=="udev-acl", TEST=="/var/run/ConsoleKit/database", \ - RUN+="udev-acl --action=$env{ACTION} --device=$env{DEVNAME}" - - LABEL="acl_end" -diff --git a/extras/udev-acl/udev-acl.c b/extras/udev-acl/udev-acl.c -index ce51590..ff04ec6 100644 ---- a/extras/udev-acl/udev-acl.c -+++ b/extras/udev-acl/udev-acl.c -@@ -289,7 +289,7 @@ static void apply_acl_to_devices(uid_t uid, int add) - /* iterate over all devices tagged with ACL_SET */ - udev = udev_new(); - enumerate = udev_enumerate_new(udev); -- udev_enumerate_add_match_property(enumerate, "ACL_MANAGE", "1"); -+ udev_enumerate_add_match_tag(enumerate, "udev-acl"); - udev_enumerate_scan_devices(enumerate); - udev_list_entry_foreach(list_entry, udev_enumerate_get_list_entry(enumerate)) { - struct udev_device *device; --- -1.7.0.1 - diff --git a/0011-fix-logic-on-demand-loading-logic-for-db-and-uevent.patch b/0011-fix-logic-on-demand-loading-logic-for-db-and-uevent.patch deleted file mode 100644 index 5224fc8..0000000 --- a/0011-fix-logic-on-demand-loading-logic-for-db-and-uevent.patch +++ /dev/null @@ -1,49 +0,0 @@ -From bfd88b1d7b689ce86a2b04f62ac5a2b23b0aef84 Mon Sep 17 00:00:00 2001 -From: Kay Sievers -Date: Thu, 22 Apr 2010 18:50:43 +0200 -Subject: [PATCH 11/19] fix logic on-demand loading logic for db and uevent - ---- - libudev/libudev-device.c | 5 +++-- - 1 files changed, 3 insertions(+), 2 deletions(-) - -diff --git a/libudev/libudev-device.c b/libudev/libudev-device.c -index 478fdcb..3f441d0 100644 ---- a/libudev/libudev-device.c -+++ b/libudev/libudev-device.c -@@ -284,6 +284,8 @@ int udev_device_read_db(struct udev_device *udev_device) - dbg(udev_device->udev, "error reading db file %s: %m\n", filename); - return -1; - } -+ udev_device->db_loaded = true; -+ - while (fgets(line, sizeof(line), f)) { - ssize_t len; - const char *val; -@@ -322,7 +324,6 @@ int udev_device_read_db(struct udev_device *udev_device) - fclose(f); - - info(udev_device->udev, "device %p filled with db file data\n", udev_device); -- udev_device->db_loaded = true; - return 0; - } - -@@ -341,6 +342,7 @@ int udev_device_read_uevent_file(struct udev_device *udev_device) - f = fopen(filename, "r"); - if (f == NULL) - return -1; -+ udev_device->uevent_loaded = true; - - while (fgets(line, sizeof(line), f)) { - char *pos; -@@ -364,7 +366,6 @@ int udev_device_read_uevent_file(struct udev_device *udev_device) - - udev_device->devnum = makedev(maj, min); - fclose(f); -- udev_device->uevent_loaded = true; - return 0; - } - --- -1.7.0.1 - diff --git a/0012-use-the-usual-TAG-TAG-logic.patch b/0012-use-the-usual-TAG-TAG-logic.patch deleted file mode 100644 index c898ed7..0000000 --- a/0012-use-the-usual-TAG-TAG-logic.patch +++ /dev/null @@ -1,129 +0,0 @@ -From 1dbfbfbea6d80971fba6bb57469b5c437a8980d6 Mon Sep 17 00:00:00 2001 -From: Kay Sievers -Date: Thu, 22 Apr 2010 19:03:11 +0200 -Subject: [PATCH 12/19] use the usual TAG+=, TAG= logic - ---- - extras/udev-acl/70-acl.rules | 48 +++++++++++++++++++++--------------------- - udev/udev-rules.c | 2 + - 2 files changed, 26 insertions(+), 24 deletions(-) - -diff --git a/extras/udev-acl/70-acl.rules b/extras/udev-acl/70-acl.rules -index cf6b0ea..8300ec2 100644 ---- a/extras/udev-acl/70-acl.rules -+++ b/extras/udev-acl/70-acl.rules -@@ -1,6 +1,6 @@ - # do not edit this file, it will be overwritten on update - --# Do not use ACL_MANAGE outside of this file. This variable is private to -+# Do not use TAG+="udev-acl" outside of this file. This variable is private to - # udev-acl of this udev release and may be replaced at any time. - - ENV{MAJOR}=="", GOTO="acl_end" -@@ -8,67 +8,67 @@ ACTION=="remove", GOTO="acl_apply" - - # PTP/MTP protocol devices, cameras, portable media players - SUBSYSTEM=="usb", ENV{ID_USB_INTERFACES}=="", ENV{DEVTYPE}=="usb_device", IMPORT{program}="usb_id --export %p" --SUBSYSTEM=="usb", ENV{ID_USB_INTERFACES}=="*:060101:*", TAG="udev-acl" -+SUBSYSTEM=="usb", ENV{ID_USB_INTERFACES}=="*:060101:*", TAG+="udev-acl" - - # digicams with proprietary protocol --ENV{ID_GPHOTO2}=="*?", TAG="udev-acl" -+ENV{ID_GPHOTO2}=="*?", TAG+="udev-acl" - - # SCSI scanners --KERNEL=="sg[0-9]*", ATTRS{type}=="6", TAG="udev-acl" --KERNEL=="sg[0-9]*", ATTRS{type}=="3", ATTRS{vendor}=="HP|EPSON|Epson", TAG="udev-acl" -+KERNEL=="sg[0-9]*", ATTRS{type}=="6", TAG+="udev-acl" -+KERNEL=="sg[0-9]*", ATTRS{type}=="3", ATTRS{vendor}=="HP|EPSON|Epson", TAG+="udev-acl" - - # USB scanners --ENV{libsane_matched}=="yes", TAG="udev-acl" -+ENV{libsane_matched}=="yes", TAG+="udev-acl" - - # HPLIP devices (necessary for ink level check and HP tool maintenance) --ENV{ID_HPLIP}=="1", TAG="udev-acl" -+ENV{ID_HPLIP}=="1", TAG+="udev-acl" - - # optical drives --SUBSYSTEM=="block", ENV{ID_CDROM}=="1", TAG="udev-acl" -+SUBSYSTEM=="block", ENV{ID_CDROM}=="1", TAG+="udev-acl" - - # sound devices --SUBSYSTEM=="sound", TAG="udev-acl" -+SUBSYSTEM=="sound", TAG+="udev-acl" - # sound jack-sense --SUBSYSTEM=="input", SUBSYSTEMS=="sound", TAG="udev-acl" -+SUBSYSTEM=="input", SUBSYSTEMS=="sound", TAG+="udev-acl" - - # webcams, frame grabber, TV cards --SUBSYSTEM=="video4linux", TAG="udev-acl" --SUBSYSTEM=="dvb", TAG="udev-acl" -+SUBSYSTEM=="video4linux", TAG+="udev-acl" -+SUBSYSTEM=="dvb", TAG+="udev-acl" - - # IIDC devices: industrial cameras and some webcams --SUBSYSTEM=="firewire", ATTR{units}=="*0x00a02d:0x00010*", TAG="udev-acl" -+SUBSYSTEM=="firewire", ATTR{units}=="*0x00a02d:0x00010*", TAG+="udev-acl" - # AV/C devices: camcorders, set-top boxes, TV sets, audio devices, and more --SUBSYSTEM=="firewire", ATTR{units}=="*0x00a02d:0x010001*", TAG="udev-acl" -+SUBSYSTEM=="firewire", ATTR{units}=="*0x00a02d:0x010001*", TAG+="udev-acl" - - # old style firewire devices --KERNEL=="dv1394-[0-9]*", TAG="udev-acl" --KERNEL=="video1394-[0-9]*", TAG="udev-acl" -+KERNEL=="dv1394-[0-9]*", TAG+="udev-acl" -+KERNEL=="video1394-[0-9]*", TAG+="udev-acl" - - # fingerprint readers --SUBSYSTEM=="usb", ATTR{idVendor}=="0483", ATTR{idProduct}=="2016", TAG="udev-acl" -+SUBSYSTEM=="usb", ATTR{idVendor}=="0483", ATTR{idProduct}=="2016", TAG+="udev-acl" - - # GPS devices - # Garmin GPSMap 60 --SUBSYSTEM=="usb", ATTR{idVendor}=="091e", ATTR{idProduct}=="0003", TAG="udev-acl" -+SUBSYSTEM=="usb", ATTR{idVendor}=="091e", ATTR{idProduct}=="0003", TAG+="udev-acl" - - - # DRI video devices --SUBSYSTEM=="drm", KERNEL=="card*", TAG="udev-acl" -+SUBSYSTEM=="drm", KERNEL=="card*", TAG+="udev-acl" - - # KVM --SUBSYSTEM=="misc", KERNEL=="kvm", TAG="udev-acl" -+SUBSYSTEM=="misc", KERNEL=="kvm", TAG+="udev-acl" - - # smart-card readers --ENV{ID_SMARTCARD_READER}=="*?", TAG="udev-acl" -+ENV{ID_SMARTCARD_READER}=="*?", TAG+="udev-acl" - - # joysticks --SUBSYSTEM=="input", ENV{ID_INPUT_JOYSTICK}=="?*", TAG="udev-acl" -+SUBSYSTEM=="input", ENV{ID_INPUT_JOYSTICK}=="?*", TAG+="udev-acl" - - # smart phones --SUBSYSTEM=="usb", ATTR{idVendor}=="0bb4", ATTR{idProduct}=="0c02", TAG="udev-acl" -+SUBSYSTEM=="usb", ATTR{idVendor}=="0bb4", ATTR{idProduct}=="0c02", TAG+="udev-acl" - - # color measurement devices --ENV{COLOR_MEASUREMENT_DEVICE}=="*?", TAG="udev-acl" -+ENV{COLOR_MEASUREMENT_DEVICE}=="*?", TAG+="udev-acl" - - # apply ACL for all locally logged in users - LABEL="acl_apply", TAG=="udev-acl", TEST=="/var/run/ConsoleKit/database", \ -diff --git a/udev/udev-rules.c b/udev/udev-rules.c -index 5965723..6f3335b 100644 ---- a/udev/udev-rules.c -+++ b/udev/udev-rules.c -@@ -2442,6 +2442,8 @@ int udev_rules_apply_to_event(struct udev_rules *rules, struct udev_event *event - break; - } - case TK_A_TAG: -+ if (cur->key.op == OP_ASSIGN || cur->key.op == OP_ASSIGN_FINAL) -+ udev_device_cleanup_tags_list(event->dev); - udev_device_add_tag(event->dev, &rules->buf[cur->key.value_off]); - break; - case TK_A_NAME: --- -1.7.0.1 - diff --git a/0013-delete-old-tags-when-configuration-changes.patch b/0013-delete-old-tags-when-configuration-changes.patch deleted file mode 100644 index ed0d4da..0000000 --- a/0013-delete-old-tags-when-configuration-changes.patch +++ /dev/null @@ -1,168 +0,0 @@ -From c1dbe11dc336f9faf02073a66fe30a12bd438e23 Mon Sep 17 00:00:00 2001 -From: Kay Sievers -Date: Fri, 23 Apr 2010 09:01:56 +0200 -Subject: [PATCH 13/19] delete old tags when configuration changes - ---- - libudev/libudev-device-private.c | 67 +++++++++++++++++++++++++------------- - libudev/libudev-private.h | 1 + - udev/udev-event.c | 4 ++ - 3 files changed, 49 insertions(+), 23 deletions(-) - -diff --git a/libudev/libudev-device-private.c b/libudev/libudev-device-private.c -index 13f1ebf..7e5fcbc 100644 ---- a/libudev/libudev-device-private.c -+++ b/libudev/libudev-device-private.c -@@ -22,34 +22,58 @@ - #include "libudev.h" - #include "libudev-private.h" - --static int udev_device_tag_index(struct udev_device *udev_device, bool add) -+static void udev_device_tag(struct udev_device *dev, const char *tag, bool add) - { -- struct udev *udev = udev_device_get_udev(udev_device); -- struct udev_list_entry *list_entry; -+ struct udev *udev = udev_device_get_udev(dev); -+ char filename[UTIL_PATH_SIZE]; - -- udev_list_entry_foreach(list_entry, udev_device_get_tags_list_entry(udev_device)) { -- char filename[UTIL_PATH_SIZE]; -+ util_strscpyl(filename, sizeof(filename), udev_get_dev_path(udev), "/.udev/tags/", tag, "/", -+ udev_device_get_subsystem(dev), ":", udev_device_get_sysname(dev), NULL); - -- util_strscpyl(filename, sizeof(filename), udev_get_dev_path(udev), "/.udev/tags/", -- udev_list_entry_get_name(list_entry), "/", -- udev_device_get_subsystem(udev_device), ":", udev_device_get_sysname(udev_device), NULL); -+ if (add) { -+ util_create_path(udev, filename); -+ symlink(udev_device_get_devpath(dev), filename); -+ /* possibly cleanup old entries after a device renaming */ -+ if (udev_device_get_sysname_old(dev) != NULL) { -+ char filename_old[UTIL_PATH_SIZE]; - -- if (add) { -- util_create_path(udev, filename); -- symlink(udev_device_get_devpath(udev_device), filename); -- if (udev_device_get_sysname_old(udev_device) != NULL) { -- char filename_old[UTIL_PATH_SIZE]; -+ util_strscpyl(filename_old, sizeof(filename_old), udev_get_dev_path(udev), "/.udev/tags/", tag, "/", -+ udev_device_get_subsystem(dev), ":", udev_device_get_sysname_old(dev), NULL); -+ unlink(filename_old); -+ } -+ } else { -+ unlink(filename); -+ } -+} - -- util_strscpyl(filename, sizeof(filename), udev_get_dev_path(udev), "/.udev/tags/", -- udev_list_entry_get_name(list_entry), -- udev_device_get_subsystem(udev_device), ":", udev_device_get_sysname_old(udev_device), NULL); -- unlink(filename_old); -+int udev_device_tag_index(struct udev_device *dev, struct udev_device *dev_old, bool add) -+{ -+ struct udev_list_entry *list_entry; -+ bool found; -+ -+ if (add) { -+ /* delete possible left-over tags */ -+ udev_list_entry_foreach(list_entry, udev_device_get_tags_list_entry(dev_old)) { -+ const char *tag_old = udev_list_entry_get_name(list_entry); -+ struct udev_list_entry *list_entry_current; -+ -+ found = false; -+ udev_list_entry_foreach(list_entry_current, udev_device_get_tags_list_entry(dev)) { -+ const char *tag = udev_list_entry_get_name(list_entry_current); -+ -+ if (strcmp(tag, tag_old) == 0) { -+ found = true; -+ break; -+ } - } -- } else { -- unlink(filename); -- util_delete_path(udev, filename); -+ if (!found) -+ udev_device_tag(dev_old, tag_old, false); - } - } -+ -+ udev_list_entry_foreach(list_entry, udev_device_get_tags_list_entry(dev)) -+ udev_device_tag(dev, udev_list_entry_get_name(list_entry), add); -+ - return 0; - } - -@@ -140,7 +164,6 @@ file: - rename(filename_tmp, filename); - info(udev, "created db file for '%s' in '%s'\n", udev_device_get_devpath(udev_device), filename); - out: -- udev_device_tag_index(udev_device, true); - return 0; - } - -@@ -149,7 +172,6 @@ int udev_device_delete_db(struct udev_device *udev_device) - struct udev *udev = udev_device_get_udev(udev_device); - char filename[UTIL_PATH_SIZE]; - -- udev_device_tag_index(udev_device, false); - util_strscpyl(filename, sizeof(filename), udev_get_dev_path(udev), "/.udev/db/", - udev_device_get_subsystem(udev_device), ":", udev_device_get_sysname(udev_device), NULL); - unlink(filename); -@@ -169,6 +191,5 @@ int udev_device_rename_db(struct udev_device *udev_device) - udev_device_get_subsystem(udev_device), ":", udev_device_get_sysname_old(udev_device), NULL); - util_strscpyl(filename, sizeof(filename), udev_get_dev_path(udev), "/.udev/db/", - udev_device_get_subsystem(udev_device), ":", udev_device_get_sysname(udev_device), NULL); -- udev_device_tag_index(udev_device, true); - return rename(filename_old, filename); - } -diff --git a/libudev/libudev-private.h b/libudev/libudev-private.h -index 548f4ad..3f38a32 100644 ---- a/libudev/libudev-private.h -+++ b/libudev/libudev-private.h -@@ -106,6 +106,7 @@ void udev_device_set_info_loaded(struct udev_device *device); - int udev_device_update_db(struct udev_device *udev_device); - int udev_device_delete_db(struct udev_device *udev_device); - int udev_device_rename_db(struct udev_device *udev_device); -+int udev_device_tag_index(struct udev_device *dev, struct udev_device *dev_old, bool add); - - /* libudev-monitor.c - netlink/unix socket communication */ - int udev_monitor_disconnect(struct udev_monitor *udev_monitor); -diff --git a/udev/udev-event.c b/udev/udev-event.c -index 212ccc7..2d8becd 100644 ---- a/udev/udev-event.c -+++ b/udev/udev-event.c -@@ -544,6 +544,7 @@ int udev_event_execute_rules(struct udev_event *event, struct udev_rules *rules) - if (strcmp(udev_device_get_action(dev), "remove") == 0) { - udev_device_read_db(dev); - udev_device_delete_db(dev); -+ udev_device_tag_index(dev, NULL, false); - - if (major(udev_device_get_devnum(dev)) != 0) - udev_watch_end(event->udev, dev); -@@ -577,6 +578,7 @@ int udev_event_execute_rules(struct udev_event *event, struct udev_rules *rules) - - /* delete stale db file */ - udev_device_delete_db(dev); -+ udev_device_tag_index(dev, NULL, false); - - /* remember old name */ - udev_device_add_property(dev, "INTERFACE_OLD", udev_device_get_sysname(dev)); -@@ -618,6 +620,7 @@ int udev_event_execute_rules(struct udev_event *event, struct udev_rules *rules) - if (event->name == NULL) { - /* things went wrong */ - udev_device_delete_db(dev); -+ udev_device_tag_index(dev, NULL, false); - udev_device_unref(event->dev_db); - err = -ENOMEM; - goto out; -@@ -629,6 +632,7 @@ int udev_event_execute_rules(struct udev_event *event, struct udev_rules *rules) - } - - udev_device_update_db(dev); -+ udev_device_tag_index(dev, event->dev_db, true); - - if (major(udev_device_get_devnum(dev)) != 0) { - /* remove/update possible left-over symlinks from old database entry */ --- -1.7.0.1 - diff --git a/0014-libudev-accept-NULL-in-udev_device_get_tags_list_ent.patch b/0014-libudev-accept-NULL-in-udev_device_get_tags_list_ent.patch deleted file mode 100644 index cd35b0d..0000000 --- a/0014-libudev-accept-NULL-in-udev_device_get_tags_list_ent.patch +++ /dev/null @@ -1,39 +0,0 @@ -From 65f099c721fa568350f8ac019e3a99fda1966082 Mon Sep 17 00:00:00 2001 -From: Kay Sievers -Date: Fri, 23 Apr 2010 09:22:42 +0200 -Subject: [PATCH 14/19] libudev: accept NULL in udev_device_get_tags_list_entry() - ---- - libudev/libudev-device-private.c | 2 +- - libudev/libudev-device.c | 2 ++ - 2 files changed, 3 insertions(+), 1 deletions(-) - -diff --git a/libudev/libudev-device-private.c b/libudev/libudev-device-private.c -index 7e5fcbc..8c8ac24 100644 ---- a/libudev/libudev-device-private.c -+++ b/libudev/libudev-device-private.c -@@ -51,7 +51,7 @@ int udev_device_tag_index(struct udev_device *dev, struct udev_device *dev_old, - struct udev_list_entry *list_entry; - bool found; - -- if (add) { -+ if (add && dev_old != NULL) { - /* delete possible left-over tags */ - udev_list_entry_foreach(list_entry, udev_device_get_tags_list_entry(dev_old)) { - const char *tag_old = udev_list_entry_get_name(list_entry); -diff --git a/libudev/libudev-device.c b/libudev/libudev-device.c -index 3f441d0..a6a1ecb 100644 ---- a/libudev/libudev-device.c -+++ b/libudev/libudev-device.c -@@ -1289,6 +1289,8 @@ void udev_device_cleanup_tags_list(struct udev_device *udev_device) - - struct udev_list_entry *udev_device_get_tags_list_entry(struct udev_device *udev_device) - { -+ if (udev_device == NULL) -+ return NULL; - return udev_list_get_entry(&udev_device->tags_list); - } - --- -1.7.0.1 - diff --git a/0015-export-tag-functions.patch b/0015-export-tag-functions.patch deleted file mode 100644 index 2d6f066..0000000 --- a/0015-export-tag-functions.patch +++ /dev/null @@ -1,24 +0,0 @@ -From 2a34f9c31e17f4a6c4fc99a369f56e843a063390 Mon Sep 17 00:00:00 2001 -From: Kay Sievers -Date: Fri, 23 Apr 2010 10:46:00 +0200 -Subject: [PATCH 15/19] export tag functions - ---- - libudev/exported_symbols | 1 + - 1 files changed, 1 insertions(+), 0 deletions(-) - -diff --git a/libudev/exported_symbols b/libudev/exported_symbols -index c0ca4b9..d2c458e 100644 ---- a/libudev/exported_symbols -+++ b/libudev/exported_symbols -@@ -46,6 +46,7 @@ udev_enumerate_add_nomatch_subsystem - udev_enumerate_add_match_sysattr - udev_enumerate_add_nomatch_sysattr - udev_enumerate_add_match_property -+udev_enumerate_add_match_tag - udev_enumerate_add_match_sysname - udev_enumerate_scan_devices - udev_enumerate_scan_subsystems --- -1.7.0.1 - diff --git a/0016-export-udev_device_get_tags_list_entry.patch b/0016-export-udev_device_get_tags_list_entry.patch deleted file mode 100644 index 1ce2e3d..0000000 --- a/0016-export-udev_device_get_tags_list_entry.patch +++ /dev/null @@ -1,50 +0,0 @@ -From 2793f4e34bdf4f1a46d0263f7dbdb8fcffe78e32 Mon Sep 17 00:00:00 2001 -From: Kay Sievers -Date: Fri, 23 Apr 2010 16:05:38 +0200 -Subject: [PATCH 16/19] export udev_device_get_tags_list_entry() - ---- - libudev/exported_symbols | 1 + - libudev/libudev-private.h | 1 - - libudev/libudev.h | 1 + - 3 files changed, 2 insertions(+), 1 deletions(-) - -diff --git a/libudev/exported_symbols b/libudev/exported_symbols -index d2c458e..935e361 100644 ---- a/libudev/exported_symbols -+++ b/libudev/exported_symbols -@@ -30,6 +30,7 @@ udev_device_get_subsystem - udev_device_get_devtype - udev_device_get_devlinks_list_entry - udev_device_get_properties_list_entry -+udev_device_get_tags_list_entry - udev_device_get_property_value - udev_device_get_action - udev_device_get_driver -diff --git a/libudev/libudev-private.h b/libudev/libudev-private.h -index 3f38a32..7132357 100644 ---- a/libudev/libudev-private.h -+++ b/libudev/libudev-private.h -@@ -87,7 +87,6 @@ int udev_device_set_devpath_old(struct udev_device *udev_device, const char *dev - const char *udev_device_get_knodename(struct udev_device *udev_device); - int udev_device_add_tag(struct udev_device *udev_device, const char *tag); - void udev_device_cleanup_tags_list(struct udev_device *udev_device); --struct udev_list_entry *udev_device_get_tags_list_entry(struct udev_device *udev_device); - int udev_device_has_tag(struct udev_device *udev_device, const char *tag); - int udev_device_set_knodename(struct udev_device *udev_device, const char *knodename); - int udev_device_get_timeout(struct udev_device *udev_device); -diff --git a/libudev/libudev.h b/libudev/libudev.h -index 3b73fbd..5bc42df 100644 ---- a/libudev/libudev.h -+++ b/libudev/libudev.h -@@ -90,6 +90,7 @@ const char *udev_device_get_sysnum(struct udev_device *udev_device); - const char *udev_device_get_devnode(struct udev_device *udev_device); - struct udev_list_entry *udev_device_get_devlinks_list_entry(struct udev_device *udev_device); - struct udev_list_entry *udev_device_get_properties_list_entry(struct udev_device *udev_device); -+struct udev_list_entry *udev_device_get_tags_list_entry(struct udev_device *udev_device); - const char *udev_device_get_property_value(struct udev_device *udev_device, const char *key); - const char *udev_device_get_driver(struct udev_device *udev_device); - dev_t udev_device_get_devnum(struct udev_device *udev_device); --- -1.7.0.1 - diff --git a/0017-configure.ac-move-firmware-path-setting-out-of-extra.patch b/0017-configure.ac-move-firmware-path-setting-out-of-extra.patch deleted file mode 100644 index a54acaf..0000000 --- a/0017-configure.ac-move-firmware-path-setting-out-of-extra.patch +++ /dev/null @@ -1,68 +0,0 @@ -From 0c6a3f48357ed4a49c2c49c43f669f930d628382 Mon Sep 17 00:00:00 2001 -From: Robby Workman -Date: Sat, 24 Apr 2010 21:38:37 +0200 -Subject: [PATCH 17/19] configure.ac: move firmware-path setting out of extras section - ---- - configure.ac | 38 ++++++++++++++++++-------------------- - 1 files changed, 18 insertions(+), 20 deletions(-) - -diff --git a/configure.ac b/configure.ac -index d4d29c4..4fe8c3c 100644 ---- a/configure.ac -+++ b/configure.ac -@@ -46,6 +46,24 @@ if test "x$enable_logging" = "xyes"; then - AC_DEFINE(ENABLE_LOGGING, [1], [System logging.]) - fi - -+AC_ARG_WITH(firmware-path, -+ AS_HELP_STRING([--with-firmware-path=DIR[[[:DIR[...]]]]], -+ [Firmware search path (default=/lib/firmware/updates:/lib/firmware)]), -+ [], [with_firmware_path="/lib/firmware/updates:/lib/firmware"] -+ ) -+OLD_IFS=$IFS -+IFS=: -+for i in $with_firmware_path -+do -+ if test "x${FIRMWARE_PATH}" = "x"; then -+ FIRMWARE_PATH="\\\"${i}/\\\"" -+ else -+ FIRMWARE_PATH="${FIRMWARE_PATH}, \\\"${i}/\\\"" -+ fi -+done -+IFS=$OLD_IFS -+AC_SUBST([FIRMWARE_PATH], [$FIRMWARE_PATH]) -+ - AC_ARG_ENABLE([extras], - AS_HELP_STRING([--disable-extras], [disable extras with external dependencies]), - [], [enable_extras=yes]) -@@ -82,26 +100,6 @@ if test "x$enable_extras" = xyes; then - fi]) - AC_SUBST(PCI_DATABASE) - -- AC_ARG_WITH(firmware-path, -- AS_HELP_STRING([--with-firmware-path=DIR[[[:DIR[...]]]]], -- [Firmware search path (default=/lib/firmware/updates:/lib/firmware)]), -- [], -- [with_firmware_path="/lib/firmware/updates:/lib/firmware"] -- ) -- OLD_IFS=$IFS -- IFS=: -- for i in $with_firmware_path -- do -- if test "x${FIRMWARE_PATH}" = "x" -- then -- FIRMWARE_PATH="\\\"${i}/\\\"" -- else -- FIRMWARE_PATH="${FIRMWARE_PATH}, \\\"${i}/\\\"" -- fi -- done -- IFS=$OLD_IFS -- AC_SUBST([FIRMWARE_PATH], [$FIRMWARE_PATH]) -- - AC_CHECK_HEADER([linux/input.h], [:], AC_MSG_ERROR([kernel headers not found])) - AC_SUBST([INCLUDE_PREFIX], [$(echo '#include ' | eval $ac_cpp -E - | sed -n '/linux\/input.h/ {s:.*"\(.*\)/linux/input.h".*:\1:; p; q}')]) - fi --- -1.7.0.1 - diff --git a/0018-keymap-Fix-Bluetooth-key-on-Acer-TravelMate-4720.patch b/0018-keymap-Fix-Bluetooth-key-on-Acer-TravelMate-4720.patch deleted file mode 100644 index ac23c46..0000000 --- a/0018-keymap-Fix-Bluetooth-key-on-Acer-TravelMate-4720.patch +++ /dev/null @@ -1,26 +0,0 @@ -From ad3d4198439f06cab8a2a65190ad501b803666a1 Mon Sep 17 00:00:00 2001 -From: Martin Pitt -Date: Mon, 26 Apr 2010 08:28:36 +0200 -Subject: [PATCH 18/19] keymap: Fix Bluetooth key on Acer TravelMate 4720 - -https://launchpad.net/bugs/569815 ---- - extras/keymap/95-keymap.rules | 2 +- - 1 files changed, 1 insertions(+), 1 deletions(-) - -diff --git a/extras/keymap/95-keymap.rules b/extras/keymap/95-keymap.rules -index 2f41cb4..a27bc6d 100644 ---- a/extras/keymap/95-keymap.rules -+++ b/extras/keymap/95-keymap.rules -@@ -77,7 +77,7 @@ ENV{DMI_VENDOR}=="Gateway*", ATTR{[dmi/id]product_name}=="*AOA1*", RUN+="keymap - ENV{DMI_VENDOR}=="Acer*", RUN+="keymap $name acer" - ENV{DMI_VENDOR}=="Acer*", ATTR{[dmi/id]product_name}=="Extensa*", ATTR{[dmi/id]product_name}=="*5210*|*5220*|*5610*|*5620*|*5720*", RUN+="keymap $name 0xEE screenlock" - ENV{DMI_VENDOR}=="Acer*", ATTR{[dmi/id]product_name}=="TravelMate*C300*", RUN+="keymap $name acer-travelmate_c300" --ENV{DMI_VENDOR}=="Acer*", ATTR{[dmi/id]product_name}=="TravelMate*6292*|TravelMate*8471*|Aspire 1810T*|AO751h|AO531h", RUN+="keymap $name 0xD9 bluetooth" -+ENV{DMI_VENDOR}=="Acer*", ATTR{[dmi/id]product_name}=="TravelMate*6292*|TravelMate*8471*|TravelMate*4720*|Aspire 1810T*|AO751h|AO531h", RUN+="keymap $name 0xD9 bluetooth" - ENV{DMI_VENDOR}=="Acer*", ATTR{[dmi/id]product_name}=="TravelMate 6593|Aspire 1640", RUN+="keymap $name 0xB2 www 0xEE screenlock" - ENV{DMI_VENDOR}=="Acer*", ATTR{[dmi/id]product_name}=="Aspire 6920", RUN+="keymap $name acer-aspire_6920" - ENV{DMI_VENDOR}=="Acer*", ATTR{[dmi/id]product_name}=="Aspire 5920G", RUN+="keymap $name acer-aspire_5920g" --- -1.7.0.1 - diff --git a/0019-udevd-always-try-to-find-an-idle-worker-instead-of-f.patch b/0019-udevd-always-try-to-find-an-idle-worker-instead-of-f.patch deleted file mode 100644 index 3864b50..0000000 --- a/0019-udevd-always-try-to-find-an-idle-worker-instead-of-f.patch +++ /dev/null @@ -1,58 +0,0 @@ -From 665ee17def2caa6811ae032ae68ebf8239a18cf8 Mon Sep 17 00:00:00 2001 -From: Kay Sievers -Date: Mon, 26 Apr 2010 12:21:16 +0200 -Subject: [PATCH 19/19] udevd: always try to find an idle worker instead of forking a new one - -We special-handle events with a TIMEOUT= set, so they don't get queued -or wait for parent events to finish, to make sure we can handle them -as fast as possible. - -With this change we first try to find an idle worker process before -forking a new one. ---- - udev/udevd.c | 8 ++++---- - 1 files changed, 4 insertions(+), 4 deletions(-) - -diff --git a/udev/udevd.c b/udev/udevd.c -index c27b4cd..7712543 100644 ---- a/udev/udevd.c -+++ b/udev/udevd.c -@@ -360,7 +360,7 @@ static void worker_new(struct event *event) - } - } - --static void event_run(struct event *event) -+static void event_run(struct event *event, bool force) - { - struct udev_list_node *loop; - -@@ -385,7 +385,7 @@ static void event_run(struct event *event) - return; - } - -- if (childs >= max_childs) { -+ if (!force && childs >= max_childs) { - info(event->udev, "maximum number (%i) of childs reached\n", childs); - return; - } -@@ -420,7 +420,7 @@ static void event_queue_insert(struct udev_device *dev) - - /* run all events with a timeout set immediately */ - if (udev_device_get_timeout(dev) > 0) { -- worker_new(event); -+ event_run(event, true); - return; - } - } -@@ -552,7 +552,7 @@ static void events_start(struct udev *udev) - continue; - } - -- event_run(event); -+ event_run(event, false); - } - } - --- -1.7.0.1 - diff --git a/sources b/sources index 455487b..5fbdd93 100644 --- a/sources +++ b/sources @@ -1 +1 @@ -76d12a9d97c3409e9ef60a4288227e8f udev-153.tar.bz2 +28064e0325050a1eedec4c142da65ea7 udev-154.tar.bz2 diff --git a/start_udev b/start_udev index 72b548e..69639e9 100755 --- a/start_udev +++ b/start_udev @@ -127,10 +127,6 @@ make_extra_nodes () { [ -c /dev/fuse ] || /bin/mknod -m 0666 /dev/fuse c 10 229 #/bin/chown root:root /dev/fuse - if [ -x /sbin/restorecon ]; then - /sbin/restorecon -R /dev - fi - if [ -x "$MAKEDEV" ]; then for i in /etc/udev/makedev.d/*.nodes; do if [ -f "$i" ]; then @@ -165,14 +161,15 @@ make_extra_nodes () { if [ "$1" != "*" ]; then #echo "Warning: $devdir is deprecated. Please use /etc/udev/makedev.d/." cp -ar "$@" $udev_root/ - if [ -x /sbin/restorecon ]; then - pushd "$udev_root" &> "$udev_root/null" - /sbin/restorecon "$@" - popd &> "$udev_root/null" - fi fi popd &> "$udev_root/null" done + + if [ -x /sbin/restorecon ]; then + /sbin/restorecon -R /dev + fi + + } kill_udevd() { @@ -296,8 +293,6 @@ if [ -f "/sys/class/tty/console/uevent" ]; then /sbin/udevadm control --max-childs=$(getval udevchilds $cmdline) fi - /sbin/udevadm control --env=STARTUP=1 - if strstr "$cmdline" modprobedebug; then /sbin/udevadm control --env=MODPROBE_OPTIONS="-s -v -q" echo @@ -318,7 +313,6 @@ if [ -f "/sys/class/tty/console/uevent" ]; then ret=$[$ret + $?] wait ret=$[$ret + $?] - /sbin/udevadm control --env=STARTUP= # touch all device files for timezone glitches # "find" is in /usr/bin and might not be available if [ -f /etc/sysconfig/clock ]; then diff --git a/udev-153.tar.bz2.sign b/udev-154.tar.bz2.sign similarity index 61% rename from udev-153.tar.bz2.sign rename to udev-154.tar.bz2.sign index 566f6aa..763fe27 100644 --- a/udev-153.tar.bz2.sign +++ b/udev-154.tar.bz2.sign @@ -2,7 +2,7 @@ Version: GnuPG v1.4.9 (GNU/Linux) Comment: See http://www.kernel.org/signature.html for info -iD8DBQBLzqFNyGugalF9Dw4RAkvzAJ4ureXWse6fF/61NaNe97mDDQMtUwCfegJi -Ar0G12dwUvDR2gYMcPTiRzs= -=vIft +iD8DBQBL6cfoyGugalF9Dw4RAgHRAJ4uiUTYmlpX91E61jQCPORk+rXiLQCfbkaL +GHVrrEPnh6SqXnXN1zRsNco= +=YhCs -----END PGP SIGNATURE----- diff --git a/udev.spec b/udev.spec index 4183371..9036352 100644 --- a/udev.spec +++ b/udev.spec @@ -4,8 +4,8 @@ Summary: A userspace implementation of devfs Name: udev -Version: 153 -Release: 1.20100427git%{?dist} +Version: 154 +Release: 1%{?dist} License: GPLv2 Group: System Environment/Base Provides: udev-persistent = %{version}-%{release} @@ -14,29 +14,8 @@ Obsoletes: udev-extras < 20090618 Provides: udev-extras = 20090618-1 Source: ftp://ftp.kernel.org/pub/linux/utils/kernel/hotplug/%{name}-%{version}.tar.bz2 -Patch1: 0001-configure.ac-version-bump.patch -Patch2: 0002-remove-buffer-overrun-risk-in-readlink-call.patch -Patch3: 0003-more-readlink-buffer-size-handling.patch -Patch4: 0004-remove-left-over-from-ignore_remove-and-all_partitio.patch -Patch5: 0005-fix-previous-commit.patch -Patch6: 0006-Fix-volume-keys-not-releasing-for-Pegatron-platform.patch -Patch7: 0007-udevadm-info-export-db-remove-watch-handle-export.patch -Patch8: 0008-add-TAG-to-improve-event-filtering-and-device-enumer.patch -Patch9: 0009-all-to-match-against-a-given-TAG.patch -Patch10: 0010-udev-acl-use-a-tag-instead-of-a-property-to-mark-dev.patch -Patch11: 0011-fix-logic-on-demand-loading-logic-for-db-and-uevent.patch -Patch12: 0012-use-the-usual-TAG-TAG-logic.patch -Patch13: 0013-delete-old-tags-when-configuration-changes.patch -Patch14: 0014-libudev-accept-NULL-in-udev_device_get_tags_list_ent.patch -Patch15: 0015-export-tag-functions.patch -Patch16: 0016-export-udev_device_get_tags_list_entry.patch -Patch17: 0017-configure.ac-move-firmware-path-setting-out-of-extra.patch -Patch18: 0018-keymap-Fix-Bluetooth-key-on-Acer-TravelMate-4720.patch -Patch19: 0019-udevd-always-try-to-find-an-idle-worker-instead-of-f.patch - Patch101: udev-151-rules.patch -Patch102: udev-153-LGPL.patch -Patch103: udev-151-gperf.patch +#Patch103: udev-151-gperf.patch Source1: start_udev Source3: udev-post.init @@ -133,38 +112,14 @@ glib-based applications using libudev functionality. %prep %setup -q -%patch1 -p1 -b .git1 -%patch2 -p1 -b .git2 -%patch3 -p1 -b .git3 -%patch4 -p1 -b .git4 -%patch5 -p1 -b .git5 -%patch6 -p1 -b .git6 -%patch7 -p1 -b .git7 -%patch8 -p1 -b .git8 -%patch9 -p1 -b .git9 -%patch10 -p1 -b .git10 -%patch11 -p1 -b .git11 -%patch12 -p1 -b .git12 -%patch13 -p1 -b .git13 -%patch14 -p1 -b .git14 -%patch15 -p1 -b .git15 -%patch16 -p1 -b .git16 -%patch17 -p1 -b .git17 -%patch18 -p1 -b .git18 -%patch19 -p1 -b .git19 - %patch101 -p1 -%patch102 -p1 -%patch103 -p1 +#%patch103 -p1 %build -autoreconf -i -automake -# get rid of rpath libtoolize -f -c %configure --with-selinux --prefix=%{_prefix} --exec-prefix="" \ - --sysconfdir=%{_sysconfdir} --with-libdir-name=%{_lib} \ + --sysconfdir=%{_sysconfdir} \ --sbindir="/sbin" --libexecdir=%{udev_scriptdir} \ --with-rootlibdir=/%{_lib} --enable-introspection \ --enable-debug @@ -390,6 +345,9 @@ rm -rf $RPM_BUILD_ROOT %attr(0644,root,root) %{_libdir}/pkgconfig/gudev-1.0* %changelog +* Wed May 12 2010 Harald Hoyer 154-1 +- version 154 + * Tue Apr 27 2010 Harald Hoyer 153-1.20100427git - version 153 From 7b608d10c88acde3703f1df1631d760e2cde9f92 Mon Sep 17 00:00:00 2001 From: Harald Hoyer Date: Tue, 25 May 2010 12:09:05 +0000 Subject: [PATCH 063/142] - version 156 --- .cvsignore | 2 +- sources | 2 +- udev-154.tar.bz2.sign => udev-156.tar.bz2.sign | 6 +++--- udev.spec | 14 ++++++++------ 4 files changed, 13 insertions(+), 11 deletions(-) rename udev-154.tar.bz2.sign => udev-156.tar.bz2.sign (61%) diff --git a/.cvsignore b/.cvsignore index a4264db..ad65381 100644 --- a/.cvsignore +++ b/.cvsignore @@ -1 +1 @@ -udev-154.tar.bz2 +udev-156.tar.bz2 diff --git a/sources b/sources index 5fbdd93..5c65b78 100644 --- a/sources +++ b/sources @@ -1 +1 @@ -28064e0325050a1eedec4c142da65ea7 udev-154.tar.bz2 +5efef35990dd20d8bb459eaff36d1f88 udev-156.tar.bz2 diff --git a/udev-154.tar.bz2.sign b/udev-156.tar.bz2.sign similarity index 61% rename from udev-154.tar.bz2.sign rename to udev-156.tar.bz2.sign index 763fe27..0a620a6 100644 --- a/udev-154.tar.bz2.sign +++ b/udev-156.tar.bz2.sign @@ -2,7 +2,7 @@ Version: GnuPG v1.4.9 (GNU/Linux) Comment: See http://www.kernel.org/signature.html for info -iD8DBQBL6cfoyGugalF9Dw4RAgHRAJ4uiUTYmlpX91E61jQCPORk+rXiLQCfbkaL -GHVrrEPnh6SqXnXN1zRsNco= -=YhCs +iD8DBQBL+6Y0yGugalF9Dw4RAiXCAJ46yjnuIIL1HVdbEgng81WqFdufFACdGo+0 +nOsBxQEHIdTdXHqoC25Aa/s= +=/xG7 -----END PGP SIGNATURE----- diff --git a/udev.spec b/udev.spec index 9036352..5e15845 100644 --- a/udev.spec +++ b/udev.spec @@ -4,7 +4,7 @@ Summary: A userspace implementation of devfs Name: udev -Version: 154 +Version: 156 Release: 1%{?dist} License: GPLv2 Group: System Environment/Base @@ -121,8 +121,7 @@ libtoolize -f -c %configure --with-selinux --prefix=%{_prefix} --exec-prefix="" \ --sysconfdir=%{_sysconfdir} \ --sbindir="/sbin" --libexecdir=%{udev_scriptdir} \ - --with-rootlibdir=/%{_lib} --enable-introspection \ - --enable-debug + --with-rootlibdir=/%{_lib} --enable-introspection make %{?_smp_mflags} @@ -193,9 +192,6 @@ fi exit 0 %pre -# to be removed after F10 EOL (and for RHEL-6) -getent group video >/dev/null || /usr/sbin/groupadd -g 39 video || : -getent group audio >/dev/null || /usr/sbin/groupadd -g 63 audio || : # to be kept getent group cdrom >/dev/null || /usr/sbin/groupadd -g 11 cdrom || : getent group tape >/dev/null || /usr/sbin/groupadd -g 33 tape || : @@ -345,6 +341,12 @@ rm -rf $RPM_BUILD_ROOT %attr(0644,root,root) %{_libdir}/pkgconfig/gudev-1.0* %changelog +* Tue May 25 2010 Harald Hoyer 156-1 +- version 156 + +* Tue May 25 2010 Harald Hoyer 155-1 +- version 155 + * Wed May 12 2010 Harald Hoyer 154-1 - version 154 From 84bd1b90a3f8d2f4240e8cb17994fc4bcb3018b4 Mon Sep 17 00:00:00 2001 From: Harald Hoyer Date: Thu, 27 May 2010 09:31:37 +0000 Subject: [PATCH 064/142] - cleaned up start_udev and udev-post initscript - removed redhat specific rules - removed all the makedev.d stuff, udevd now natively supports /lib/udev/devices - added basic devices in /lib/udev/devices --- start_udev | 275 +++++++++---------------------------------------- udev-post.init | 28 ----- udev.spec | 67 +++++++----- 3 files changed, 89 insertions(+), 281 deletions(-) diff --git a/start_udev b/start_udev index 69639e9..2aa0381 100755 --- a/start_udev +++ b/start_udev @@ -29,32 +29,11 @@ export TZ=/etc/localtime [ -d $sysfs_dir/class ] || exit 1 [ -r /proc/mounts ] || exit 1 [ -x /sbin/udevd ] || exit 1 -[ -f /etc/udev/udev.conf ] && . /etc/udev/udev.conf -udev_root=${udev_root-/dev} - -if [ -f /dev/.in_sysinit ]; then - exec >/dev/console 2>/dev/console "$md5file" - fi - . "$md5file" >$udev_root/null 2>&1 - else - ( sed -e 's,#.*,,g' "$i" | \ - xargs_simple -n 100 $MAKEDEV -x ) - fi - fi - done - fi - - for devdir in /etc/udev/devices /lib/udev/devices; do - [ -d "$devdir" ] || continue - pushd $devdir &> "$udev_root/null" - set * - if [ "$1" != "*" ]; then - #echo "Warning: $devdir is deprecated. Please use /etc/udev/makedev.d/." - cp -ar "$@" $udev_root/ - fi - popd &> "$udev_root/null" - done - - if [ -x /sbin/restorecon ]; then - /sbin/restorecon -R /dev - fi - - -} - -kill_udevd() { - if [ -x /sbin/pidof ]; then - pid=`/sbin/pidof -x udevd` - [ -n "$pid" ] && kill $pid - fi -} - findalias () { local n for n in "$1"/* ; do @@ -223,107 +88,63 @@ wait_for_queue() { } export ACTION=add -prog=udev ret=0 STRING=$"Starting $prog: " -# propagate $udev_root from /sys +# propagate /dev from /sys echo -n "$STRING" -# mount the tmpfs on ${udev_root%/}, if not already done -LANG=C awk "\$2 == \"${udev_root%/}\" && ( \$3 == \"devtmpfs\" || \$3 == \"tmpfs\" ) { exit 1 }" /proc/mounts && { - if LANG=C grep -Fq "none ${udev_root%/}/pts " /proc/mounts; then - PTSDIR=$(mktemp -d) - mount --move $udev_root/pts "$PTSDIR" - fi - if LANG=C grep -Fq "none ${udev_root%/}/shm " /proc/mounts; then - SHMDIR=$(mktemp -d) - mount --move $udev_root/shm "$SHMDIR" - fi - # First try to mount a devtmpfs on $udev_root - mount -n -o mode=0755 -t devtmpfs none "$udev_root" 2>/dev/null \ - || mount -n -o mode=0755 -t tmpfs none "$udev_root" - mkdir -m 0755 $udev_root/pts - mkdir -m 0755 $udev_root/shm - if [ -n "$PTSDIR" ]; then - mount --move "$PTSDIR" $udev_root/pts - rmdir "$PTSDIR" - fi - if [ -n "$SHMDIR" ]; then - mount --move "$SHMDIR" $udev_root/shm - rmdir "$SHMDIR" - fi - - ret=$[$ret + $?] -} +rm -fr /dev/.udev > "/dev/null" 2>&1 -make_extra_nodes -kill_udevd > "$udev_root/null" 2>&1 -rm -fr $udev_root/.udev > "$udev_root/null" 2>&1 -mkdir -p $udev_root/.udev > "$udev_root/null" 2>&1 UDEV_OPTS="" -if [ -f "/sys/class/tty/console/uevent" ]; then - # trigger the sorted events - echo -e '\000\000\000\000' > /proc/sys/kernel/hotplug +cmdline=$(cat /proc/cmdline) - cmdline=$(cat /proc/cmdline) +if strstr "$cmdline" udevtrace; then + UDEV_OPTS="$UDEV_OPTS --debug-trace" +fi - if strstr "$cmdline" udevtrace; then - UDEV_OPTS="$UDEV_OPTS --debug-trace" - fi - - if strstr "$cmdline" udevlog; then - UDEV_OPTS="$UDEV_OPTS --debug" - /sbin/udevd -d $UDEV_OPTS 2>$udev_root/.udev/udev.log - else - /sbin/udevd -d $UDEV_OPTS - fi - - wait - ret=$[$ret + $?] - - udevtimeout=$(getval udevtimeout $cmdline) - - if strstr "$cmdline" udevdebug; then - /sbin/udevadm control --log-priority=debug - fi - if strstr "$cmdline" udevinfo; then - /sbin/udevadm control --log-priority=info - fi - if strstr "$cmdline" udevchilds; then - /sbin/udevadm control --max-childs=$(getval udevchilds $cmdline) - fi - - if strstr "$cmdline" modprobedebug; then - /sbin/udevadm control --env=MODPROBE_OPTIONS="-s -v -q" - echo - findalias /sys | while read modules ; do - if [ -n "$modules" ]; then - echo "Loading modules for $modules in 5 seconds" - sleep 5 - /sbin/modprobe -a -v -q $modules - wait_for_queue $udevtimeout - fi - done - echo "Triggering Rest" - fi - - /sbin/udevadm trigger --action=add - ret=$[$ret + $?] - wait_for_queue $udevtimeout - ret=$[$ret + $?] - wait - ret=$[$ret + $?] - # touch all device files for timezone glitches - # "find" is in /usr/bin and might not be available - if [ -f /etc/sysconfig/clock ]; then - . /etc/sysconfig/clock - [[ "$UTC" == "false" || "$UTC" == "no" ]] \ - && touch_recursive /dev > "$udev_root/null" 2>&1 - fi +if strstr "$cmdline" udevlog; then + UDEV_OPTS="$UDEV_OPTS --debug" + /sbin/udevd -d $UDEV_OPTS 2>/dev/.udev/udev.log else - echo -n " kernel too old for this udev version " - /sbin/udevd -d $UDEV_OPTS - ret=10 + /sbin/udevd -d $UDEV_OPTS +fi + +ret=$[$ret + $?] + +udevtimeout=$(getval udevtimeout $cmdline) + +if strstr "$cmdline" udevdebug; then + /sbin/udevadm control --log-priority=debug +fi +if strstr "$cmdline" udevinfo; then + /sbin/udevadm control --log-priority=info +fi + +if strstr "$cmdline" modprobedebug; then + /sbin/udevadm control --env=MODPROBE_OPTIONS="-s -v -q" + echo + findalias /sys | while read modules ; do + if [ -n "$modules" ]; then + echo "Loading modules for $modules in 5 seconds" + sleep 5 + /sbin/modprobe -a -v -q $modules + wait_for_queue $udevtimeout + fi + done + echo "Triggering Rest" +fi + +/sbin/udevadm trigger --type=subsystems --action=add +/sbin/udevadm trigger --type=devices --action=add +wait_for_queue $udevtimeout +ret=$[$ret + $?] + +# touch all device files for timezone glitches +# "find" is in /usr/bin and might not be available +if [ -f /etc/sysconfig/clock ]; then + . /etc/sysconfig/clock + [[ "$UTC" == "false" || "$UTC" == "no" ]] \ + && touch_recursive /dev > "/dev/null" 2>&1 fi [ $ret -eq 0 ] && success $"$STRING" || failure $"$STRING" diff --git a/udev-post.init b/udev-post.init index 67ed0c9..903f686 100644 --- a/udev-post.init +++ b/udev-post.init @@ -55,34 +55,6 @@ case "$1" in ;; stop) [ -w /var/lock/subsys ] || exit 4 - STRING=$"Generating udev makedev cache file" - MAKEDEV="/sbin/MAKEDEV" - USE_MD5="false" - [[ "$UDEV_USE_MAKEDEV_CACHE" == "yes" && -x /usr/bin/md5sum ]] && USE_MD5="true" - if [[ "$USE_MD5" == "true" && -x "$MAKEDEV" ]]; then - for i in /etc/udev/makedev.d/*.nodes; do - if [ -f "$i" ]; then - # use a little caching to speedup things - md5=$(/usr/bin/md5sum "$i"|(read a b; echo $a)) - md5file="/var/lib/udev/makedev.d/${md5}.sh" - - if [ ! -f "$md5file" ]; then - echo -n $STRING - ( sed -e 's,#.*,,g' "$i" | \ - xargs $MAKEDEV -x -a -S ) \ - > "$md5file" - rc=$? - if [ "$rc" -eq "0" ]; then - success "$STRING" - echo - elif [ "$rc" -eq "1" ]; then - failure "$STRING" - echo - fi - fi - fi - done - fi rm -f /var/lock/subsys/udev-post exit 0 ;; diff --git a/udev.spec b/udev.spec index 5e15845..d8c5129 100644 --- a/udev.spec +++ b/udev.spec @@ -5,7 +5,7 @@ Summary: A userspace implementation of devfs Name: udev Version: 156 -Release: 1%{?dist} +Release: 2%{?dist} License: GPLv2 Group: System Environment/Base Provides: udev-persistent = %{version}-%{release} @@ -27,7 +27,7 @@ URL: http://www.kernel.org/pub/linux/utils/kernel/hotplug/udev.html BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n) Requires(pre): /bin/sh fileutils /sbin/chkconfig /sbin/service Requires(pre): /usr/bin/stat /sbin/pidof -Requires(pre): MAKEDEV >= 0:3.11 /usr/bin/getent /usr/sbin/groupadd +Requires(pre): /usr/bin/getent /usr/sbin/groupadd Requires: hwdata %ifarch s390 s390x @@ -36,7 +36,7 @@ Requires: s390utils-base %endif BuildRequires: sed libselinux-devel >= 0:1.17.9-2 flex libsepol-devel -BuildRequires: glib2-devel bison findutils MAKEDEV +BuildRequires: glib2-devel bison findutils BuildRequires: gperf libtool BuildRequires: libusb-devel libacl-devel BuildRequires: libxslt @@ -136,7 +136,7 @@ rm -fr $RPM_BUILD_ROOT%{_docdir}/udev rm -f $RPM_BUILD_ROOT/%{_libdir}/*.la # Deprecated, but keep the ownership -mkdir -p $RPM_BUILD_ROOT%{_sysconfdir}/udev/{rules.d,makedev.d,scripts,devices} +mkdir -p $RPM_BUILD_ROOT%{_sysconfdir}/udev/{rules.d,scripts,devices} mkdir -p $RPM_BUILD_ROOT%{_sysconfdir}/dev.d mkdir -p $RPM_BUILD_ROOT%{_bindir} touch $RPM_BUILD_ROOT%{_sysconfdir}/scsi_id.config @@ -145,7 +145,6 @@ touch $RPM_BUILD_ROOT%{_sysconfdir}/scsi_id.config ln -sf ..%{udev_scriptdir}/scsi_id $RPM_BUILD_ROOT/sbin/scsi_id for i in \ - rules/redhat/40-redhat.rules \ %ifarch ia64 rules/packages/40-ia64.rules \ %endif @@ -159,7 +158,9 @@ for i in \ install -m 0644 "$i" "$RPM_BUILD_ROOT%{udev_scriptdir}/rules.d/${i##*/}" done -mkdir -p $RPM_BUILD_ROOT%{udev_scriptdir}/{,devices} +mkdir -p $RPM_BUILD_ROOT%{udev_scriptdir}/{,devices,devices/net,devices/pts,devices/shm,devices/hugepages} + +ln -s /sbin/MAKEDEV $RPM_BUILD_ROOT%{udev_scriptdir}/devices/MAKEDEV install -m 0755 %{SOURCE4} $RPM_BUILD_ROOT%{udev_scriptdir}/fw_unit_symlinks.sh @@ -174,8 +175,6 @@ install -m 0755 %{SOURCE3} $RPM_BUILD_ROOT%{_sysconfdir}/rc.d/init.d/udev-post mkdir -p $RPM_BUILD_ROOT%{_sysconfdir}/sysconfig install -m 0755 %{SOURCE5} $RPM_BUILD_ROOT%{_sysconfdir}/sysconfig/udev -mkdir -p $RPM_BUILD_ROOT/var/lib/udev/makedev.d - %preun if [ "$1" -eq 0 -a -f %{_initrddir}/udev ]; then if [ -x /sbin/pidof ]; then @@ -192,7 +191,6 @@ fi exit 0 %pre -# to be kept getent group cdrom >/dev/null || /usr/sbin/groupadd -g 11 cdrom || : getent group tape >/dev/null || /usr/sbin/groupadd -g 33 tape || : getent group dialout >/dev/null || /usr/sbin/groupadd -g 18 dialout || : @@ -227,12 +225,6 @@ fi exit 0 -%triggerin -- selinux-policy -rm -f /var/lib/udev/makenode.d/* >/dev/null 2>&1 || : - -%triggerin -- MAKEDEV -rm -f /var/lib/udev/makenode.d/* >/dev/null 2>&1 || : - %post -n libudev -p /sbin/ldconfig %postun -n libudev -p /sbin/ldconfig @@ -267,15 +259,33 @@ rm -rf $RPM_BUILD_ROOT %attr(0755,root,root) %{udev_scriptdir}/input_id %attr(0755,root,root) %{udev_scriptdir}/keyboard-force-release.sh - %attr(0755,root,root) %dir %{udev_scriptdir}/rules.d/ %attr(0755,root,root) %{_sysconfdir}/rc.d/init.d/udev-post %attr(0755,root,root) %dir %{_sysconfdir}/udev/ %attr(0755,root,root) %dir %{_sysconfdir}/udev/rules.d/ %attr(0755,root,root) %dir %{udev_scriptdir}/ %attr(0755,root,root) %dir %{udev_scriptdir}/devices/ -%attr(0755,root,root) %dir %{_sysconfdir}/udev/makedev.d/ - +%attr(0755,root,root) %dir %{udev_scriptdir}/devices/net +%attr(0755,root,root) %dir %{udev_scriptdir}/devices/hugepages +%attr(0755,root,root) %dir %{udev_scriptdir}/devices/pts +%attr(0755,root,root) %dir %{udev_scriptdir}/devices/shm +%{udev_scriptdir}/devices/MAKEDEV +%attr(666,root,root) %dev(c,10,200) %{udev_scriptdir}/devices/net/tun +%attr(600,root,root) %dev(c,108,0) %{udev_scriptdir}/devices/ppp +%attr(666,root,root) %dev(c,10,229) %{udev_scriptdir}/devices/fuse +%attr(660,root,lp) %dev(c,6,0) %{udev_scriptdir}/devices/lp0 +%attr(660,root,lp) %dev(c,6,1) %{udev_scriptdir}/devices/lp1 +%attr(660,root,lp) %dev(c,6,2) %{udev_scriptdir}/devices/lp2 +%attr(660,root,lp) %dev(c,6,3) %{udev_scriptdir}/devices/lp3 +%attr(640,root,disk) %dev(c,7,0) %{udev_scriptdir}/devices/loop0 +%attr(640,root,disk) %dev(c,7,1) %{udev_scriptdir}/devices/loop1 +%attr(640,root,disk) %dev(c,7,2) %{udev_scriptdir}/devices/loop2 +%attr(640,root,disk) %dev(c,7,3) %{udev_scriptdir}/devices/loop3 +%attr(640,root,disk) %dev(c,7,4) %{udev_scriptdir}/devices/loop4 +%attr(640,root,disk) %dev(c,7,5) %{udev_scriptdir}/devices/loop5 +%attr(640,root,disk) %dev(c,7,6) %{udev_scriptdir}/devices/loop6 +%attr(640,root,disk) %dev(c,7,7) %{udev_scriptdir}/devices/loop7 + %config(noreplace) %attr(0644,root,root) %{_sysconfdir}/sysconfig/udev %config(noreplace) %attr(0644,root,root) %{_sysconfdir}/udev/udev.conf @@ -288,14 +298,6 @@ rm -rf $RPM_BUILD_ROOT %attr(0644,root,root) %{_mandir}/man7/udev*.7* %attr(0644,root,root) %{_mandir}/man8/scsi_id*.8* -%dir %attr(0755,root,root) /var/lib/udev -%dir %attr(0755,root,root) /var/lib/udev/makedev.d - -# Deprecated, but keep the ownership -%ghost %dir %{_sysconfdir}/udev/scripts/ -%ghost %dir %{_sysconfdir}/udev/devices/ -%ghost %dir %{_sysconfdir}/dev.d/ - %attr(0755,root,root) %{udev_scriptdir}/mobile-action-modeswitch %attr(0755,root,root) %{udev_scriptdir}/pci-db %attr(0755,root,root) %{udev_scriptdir}/usb-db @@ -307,6 +309,12 @@ rm -rf $RPM_BUILD_ROOT %{udev_scriptdir}/keymaps/* %attr(0644,root,root) %{_prefix}/lib/ConsoleKit/run-seat.d/udev-acl.ck +# Deprecated, but keep the ownership +%ghost %dir /var/lib/udev +%ghost %dir %{_sysconfdir}/udev/scripts/ +%ghost %dir %{_sysconfdir}/udev/devices/ +%ghost %dir %{_sysconfdir}/dev.d/ +%ghost %dir %{_sysconfdir}/udev/makedev.d/ %files -n libudev %defattr(0644, root, root, 0755) @@ -341,6 +349,13 @@ rm -rf $RPM_BUILD_ROOT %attr(0644,root,root) %{_libdir}/pkgconfig/gudev-1.0* %changelog +* Thu May 27 2010 Harald Hoyer 156-2 +- cleaned up start_udev and udev-post initscript +- removed redhat specific rules +- removed all the makedev.d stuff, udevd now natively supports + /lib/udev/devices +- added basic devices in /lib/udev/devices + * Tue May 25 2010 Harald Hoyer 156-1 - version 156 From cb30ef5c02c0514380c306b71749150ca1fc1d5e Mon Sep 17 00:00:00 2001 From: Harald Hoyer Date: Thu, 24 Jun 2010 12:01:42 +0000 Subject: [PATCH 065/142] - version 158 --- .cvsignore | 2 +- sources | 2 +- start_udev | 9 - udev-151-3.patch | 89 -- udev-151-gperf.patch | 13 - udev-151-rules.patch | 25 - udev-153-LGPL.patch | 1026 ----------------------- udev-86a7a2f-fix-missing-firmware.patch | 43 - udev.spec | 15 +- 9 files changed, 8 insertions(+), 1216 deletions(-) delete mode 100644 udev-151-3.patch delete mode 100644 udev-151-gperf.patch delete mode 100644 udev-151-rules.patch delete mode 100644 udev-153-LGPL.patch delete mode 100644 udev-86a7a2f-fix-missing-firmware.patch diff --git a/.cvsignore b/.cvsignore index ad65381..f62c5e6 100644 --- a/.cvsignore +++ b/.cvsignore @@ -1 +1 @@ -udev-156.tar.bz2 +udev-158.tar.bz2 diff --git a/sources b/sources index 5c65b78..a75a271 100644 --- a/sources +++ b/sources @@ -1 +1 @@ -5efef35990dd20d8bb459eaff36d1f88 udev-156.tar.bz2 +26f99dde11f8e393d659614d7d1a3964 udev-158.tar.bz2 diff --git a/start_udev b/start_udev index 2aa0381..a6e931c 100755 --- a/start_udev +++ b/start_udev @@ -93,8 +93,6 @@ STRING=$"Starting $prog: " # propagate /dev from /sys echo -n "$STRING" -rm -fr /dev/.udev > "/dev/null" 2>&1 - UDEV_OPTS="" cmdline=$(cat /proc/cmdline) @@ -113,13 +111,6 @@ ret=$[$ret + $?] udevtimeout=$(getval udevtimeout $cmdline) -if strstr "$cmdline" udevdebug; then - /sbin/udevadm control --log-priority=debug -fi -if strstr "$cmdline" udevinfo; then - /sbin/udevadm control --log-priority=info -fi - if strstr "$cmdline" modprobedebug; then /sbin/udevadm control --env=MODPROBE_OPTIONS="-s -v -q" echo diff --git a/udev-151-3.patch b/udev-151-3.patch deleted file mode 100644 index 3dfcab0..0000000 --- a/udev-151-3.patch +++ /dev/null @@ -1,89 +0,0 @@ -? udev-147 -? udev-147.tar.bz2 -? udev-151 -? udev-151-2.fc13.src.rpm -Index: udev-86a7a2f-fix-missing-firmware.patch -=================================================================== -RCS file: udev-86a7a2f-fix-missing-firmware.patch -diff -N udev-86a7a2f-fix-missing-firmware.patch ---- /dev/null 1 Jan 1970 00:00:00 -0000 -+++ udev-86a7a2f-fix-missing-firmware.patch 7 Feb 2010 04:22:50 -0000 -@@ -0,0 +1,43 @@ -+From 86a7a2f853fe6022c5b0c1b415918047b65533be Mon Sep 17 00:00:00 2001 -+From: =?UTF-8?q?Thomas=20B=C3=A4chler?= -+Date: Sun, 31 Jan 2010 13:49:02 +0100 -+Subject: firmware: fix error reporting on missing firmware files -+ -+The new firmware loader does not report an error to the kernel if a firmware file -+is missing. This results in modprobe stalling for 60 seconds for each firmware -+a module tries to load. -+--- -+ extras/firmware/firmware.c | 3 ++- -+ 1 files changed, 2 insertions(+), 1 deletions(-) -+ -+diff --git a/extras/firmware/firmware.c b/extras/firmware/firmware.c -+index 8f70be4..16455de 100644 -+--- a/extras/firmware/firmware.c -++++ b/extras/firmware/firmware.c -+@@ -149,6 +149,7 @@ int main(int argc, char **argv) -+ -+ util_path_encode(firmware, fwencpath, sizeof(fwencpath)); -+ util_strscpyl(misspath, sizeof(misspath), udev_get_dev_path(udev), "/.udev/firmware-missing/", fwencpath, NULL); -++ util_strscpyl(loadpath, sizeof(loadpath), udev_get_sys_path(udev), devpath, "/loading", NULL); -+ -+ if (fwfile == NULL) { -+ int err; -+@@ -166,6 +167,7 @@ int main(int argc, char **argv) -+ udev_selinux_resetfscreatecon(udev); -+ } while (err == -ENOENT); -+ rc = 2; -++ set_loading(udev, loadpath, "-1"); -+ goto exit; -+ } -+ -+@@ -176,7 +178,6 @@ int main(int argc, char **argv) -+ if (unlink(misspath) == 0) -+ util_delete_path(udev, misspath); -+ -+- util_strscpyl(loadpath, sizeof(loadpath), udev_get_sys_path(udev), devpath, "/loading", NULL); -+ set_loading(udev, loadpath, "1"); -+ -+ util_strscpyl(datapath, sizeof(datapath), udev_get_sys_path(udev), devpath, "/data", NULL); -+-- -+1.6.6 -+ -Index: udev.spec -=================================================================== -RCS file: /cvs/pkgs/rpms/udev/devel/udev.spec,v -retrieving revision 1.300 -diff -u -p -r1.300 udev.spec ---- udev.spec 29 Jan 2010 09:57:03 -0000 1.300 -+++ udev.spec 7 Feb 2010 04:22:50 -0000 -@@ -14,6 +14,7 @@ Obsoletes: udev-extras < 20090618 - Provides: udev-extras = 20090618-1 - Source: ftp://ftp.kernel.org/pub/linux/utils/kernel/hotplug/%{name}-%{version}.tar.bz2 - Patch1: udev-151-rules.patch -+Patch2: udev-86a7a2f-fix-missing-firmware.patch - - Source1: start_udev - Source3: udev-post.init -@@ -110,6 +111,7 @@ glib-based applications using libudev fu - %prep - %setup -q - %patch1 -p1 -+%patch2 -p1 - - %build - # get rid of rpath -@@ -356,6 +358,11 @@ rm -rf $RPM_BUILD_ROOT - %attr(0644,root,root) %{_libdir}/pkgconfig/gudev-1.0* - - %changelog -+* Sun Feb 07 2010 Kyle McMartin 151-3 -+- udev-86a7a2f-fix-missing-firmware.patch: fix hang when loading -+ microcode (since microcode_intel tries to probe firmware which does -+ not exist. *sigh*) -+ - * Fri Jan 29 2010 Harald Hoyer 151-2 - - fixed rules and startup script (#559844) - diff --git a/udev-151-gperf.patch b/udev-151-gperf.patch deleted file mode 100644 index db93ba7..0000000 --- a/udev-151-gperf.patch +++ /dev/null @@ -1,13 +0,0 @@ -diff -up udev-151/extras/keymap/keys-from-name.gperf udev-151/extras/keymap/keys-from-name -diff -up udev-151/Makefile.am.gperf udev-151/Makefile.am ---- udev-151/Makefile.am.gperf 2010-03-19 14:04:36.000000000 +0100 -+++ udev-151/Makefile.am 2010-03-19 14:04:52.000000000 +0100 -@@ -550,7 +550,7 @@ extras/keymap/keys-from-name.gperf: extr - $(AM_V_GEN)$(AWK) 'BEGIN{ print "struct key { const char* name; unsigned short id; };"; print "%null-strings"; print "%%";} { print $$1 ", " $$1 }' < $< > $@ - - extras/keymap/keys-from-name.h: extras/keymap/keys-from-name.gperf Makefile -- $(AM_V_GEN)$(GPERF) -L ANSI-C -t --ignore-case -N lookup_key -H hash_key_name -p -C < $< > $@ -+ $(AM_V_GEN)$(GPERF) -L ANSI-C -t --ignore-case -N lookup_key -H hash_key_name -p -C -D < $< > $@ - - extras/keymap/keys-to-name.h: extras/keymap/keys.txt Makefile - $(AM_V_GEN)$(AWK) 'BEGIN{ print "const char* const key_names[KEY_CNT] = { "} { print "[" $$1 "] = \"" $$1 "\"," } END{print "};"}' < $< > $@ diff --git a/udev-151-rules.patch b/udev-151-rules.patch deleted file mode 100644 index b713f03..0000000 --- a/udev-151-rules.patch +++ /dev/null @@ -1,25 +0,0 @@ -diff --git a/rules/redhat/40-redhat.rules b/rules/redhat/40-redhat.rules -index 47ce9e5..aaba82b 100644 ---- a/rules/redhat/40-redhat.rules -+++ b/rules/redhat/40-redhat.rules -@@ -5,11 +5,11 @@ KERNEL=="hd*[0-9]", ATTRS{media}=="floppy", ATTRS{removable}=="1", SYMLINK+="flo - - KERNEL=="fw*", PROGRAM="fw_unit_symlinks.sh %k %n", SYMLINK+="$result" - --ACTION=="add", KERNEL=="sg[0-9]*", BUS=="scsi", ATTRS{type}=="3|6", SYMLINK+="scanner scanner-%k", MODE="0660" -+ACTION=="add", KERNEL=="sg[0-9]*", SUBSYSTEM=="scsi_device", ATTRS{type}=="3|6", SYMLINK+="scanner scanner-%k", MODE="0660" - --ACTION=="add", KERNEL=="sg[0-9]*", BUS=="scsi", ATTRS{type}=="8", SYMLINK+="changer changer-%k", MODE="0660", GROUP="disk" -+ACTION=="add", KERNEL=="sg[0-9]*", SUBSYSTEM=="scsi_device", ATTRS{type}=="8", SYMLINK+="changer changer-%k", MODE="0660", GROUP="disk" - --BUS=="usb", KERNEL=="sd*", ATTRS{bInterfaceClass}=="08", ATTRS{bInterfaceSubClass}=="04", GROUP="floppy", MODE="0660", SYMLINK+="floppy floppy-%k" -+SUBSYSTEM=="usb", KERNEL=="sd*", ATTRS{bInterfaceClass}=="08", ATTRS{bInterfaceSubClass}=="04", GROUP="floppy", MODE="0660", SYMLINK+="floppy floppy-%k" - - KERNEL=="fd[0-9]*", SYMLINK+="floppy floppy-%k" - -@@ -25,3 +25,5 @@ KERNEL=="vcsa[0-9]*", OWNER="vcsa", GROUP="tty" - KERNEL=="vcc/*", OWNER="vcsa", GROUP="tty" - - KERNEL=="event*", ATTRS{idVendor}=="03f0", ATTRS{interface}=="Virtual Mouse", ATTRS{bInterfaceProtocol}=="02", SYMLINK+="input/hp_ilo_mouse" -+ -+ACTION=="add", SUBSYSTEM=="cpu", KERNEL=="cpu[0-9]*", ATTR{online}="1" diff --git a/udev-153-LGPL.patch b/udev-153-LGPL.patch deleted file mode 100644 index aab0a10..0000000 --- a/udev-153-LGPL.patch +++ /dev/null @@ -1,1026 +0,0 @@ -commit 23325a66ccf3a2f90a4f5d1702f60408187de28a -Author: Kay Sievers -Date: Thu Mar 18 09:57:44 2010 +0100 - - add LGPL COPYING to libudev and GUdev - -diff --git a/extras/gudev/COPYING b/extras/gudev/COPYING -new file mode 100644 -index 0000000..8add30a ---- /dev/null -+++ b/extras/gudev/COPYING -@@ -0,0 +1,504 @@ -+ GNU LESSER GENERAL PUBLIC LICENSE -+ Version 2.1, February 1999 -+ -+ Copyright (C) 1991, 1999 Free Software Foundation, Inc. -+ 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA -+ Everyone is permitted to copy and distribute verbatim copies -+ of this license document, but changing it is not allowed. -+ -+[This is the first released version of the Lesser GPL. It also counts -+ as the successor of the GNU Library Public License, version 2, hence -+ the version number 2.1.] -+ -+ Preamble -+ -+ The licenses for most software are designed to take away your -+freedom to share and change it. By contrast, the GNU General Public -+Licenses are intended to guarantee your freedom to share and change -+free software--to make sure the software is free for all its users. -+ -+ This license, the Lesser General Public License, applies to some -+specially designated software packages--typically libraries--of the -+Free Software Foundation and other authors who decide to use it. You -+can use it too, but we suggest you first think carefully about whether -+this license or the ordinary General Public License is the better -+strategy to use in any particular case, based on the explanations below. -+ -+ When we speak of free software, we are referring to freedom of use, -+not price. Our General Public Licenses are designed to make sure that -+you have the freedom to distribute copies of free software (and charge -+for this service if you wish); that you receive source code or can get -+it if you want it; that you can change the software and use pieces of -+it in new free programs; and that you are informed that you can do -+these things. -+ -+ To protect your rights, we need to make restrictions that forbid -+distributors to deny you these rights or to ask you to surrender these -+rights. These restrictions translate to certain responsibilities for -+you if you distribute copies of the library or if you modify it. -+ -+ For example, if you distribute copies of the library, whether gratis -+or for a fee, you must give the recipients all the rights that we gave -+you. You must make sure that they, too, receive or can get the source -+code. If you link other code with the library, you must provide -+complete object files to the recipients, so that they can relink them -+with the library after making changes to the library and recompiling -+it. And you must show them these terms so they know their rights. -+ -+ We protect your rights with a two-step method: (1) we copyright the -+library, and (2) we offer you this license, which gives you legal -+permission to copy, distribute and/or modify the library. -+ -+ To protect each distributor, we want to make it very clear that -+there is no warranty for the free library. Also, if the library is -+modified by someone else and passed on, the recipients should know -+that what they have is not the original version, so that the original -+author's reputation will not be affected by problems that might be -+introduced by others. -+ -+ Finally, software patents pose a constant threat to the existence of -+any free program. We wish to make sure that a company cannot -+effectively restrict the users of a free program by obtaining a -+restrictive license from a patent holder. Therefore, we insist that -+any patent license obtained for a version of the library must be -+consistent with the full freedom of use specified in this license. -+ -+ Most GNU software, including some libraries, is covered by the -+ordinary GNU General Public License. This license, the GNU Lesser -+General Public License, applies to certain designated libraries, and -+is quite different from the ordinary General Public License. We use -+this license for certain libraries in order to permit linking those -+libraries into non-free programs. -+ -+ When a program is linked with a library, whether statically or using -+a shared library, the combination of the two is legally speaking a -+combined work, a derivative of the original library. The ordinary -+General Public License therefore permits such linking only if the -+entire combination fits its criteria of freedom. The Lesser General -+Public License permits more lax criteria for linking other code with -+the library. -+ -+ We call this license the "Lesser" General Public License because it -+does Less to protect the user's freedom than the ordinary General -+Public License. It also provides other free software developers Less -+of an advantage over competing non-free programs. These disadvantages -+are the reason we use the ordinary General Public License for many -+libraries. However, the Lesser license provides advantages in certain -+special circumstances. -+ -+ For example, on rare occasions, there may be a special need to -+encourage the widest possible use of a certain library, so that it becomes -+a de-facto standard. To achieve this, non-free programs must be -+allowed to use the library. A more frequent case is that a free -+library does the same job as widely used non-free libraries. In this -+case, there is little to gain by limiting the free library to free -+software only, so we use the Lesser General Public License. -+ -+ In other cases, permission to use a particular library in non-free -+programs enables a greater number of people to use a large body of -+free software. For example, permission to use the GNU C Library in -+non-free programs enables many more people to use the whole GNU -+operating system, as well as its variant, the GNU/Linux operating -+system. -+ -+ Although the Lesser General Public License is Less protective of the -+users' freedom, it does ensure that the user of a program that is -+linked with the Library has the freedom and the wherewithal to run -+that program using a modified version of the Library. -+ -+ The precise terms and conditions for copying, distribution and -+modification follow. Pay close attention to the difference between a -+"work based on the library" and a "work that uses the library". The -+former contains code derived from the library, whereas the latter must -+be combined with the library in order to run. -+ -+ GNU LESSER GENERAL PUBLIC LICENSE -+ TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION -+ -+ 0. This License Agreement applies to any software library or other -+program which contains a notice placed by the copyright holder or -+other authorized party saying it may be distributed under the terms of -+this Lesser General Public License (also called "this License"). -+Each licensee is addressed as "you". -+ -+ A "library" means a collection of software functions and/or data -+prepared so as to be conveniently linked with application programs -+(which use some of those functions and data) to form executables. -+ -+ The "Library", below, refers to any such software library or work -+which has been distributed under these terms. A "work based on the -+Library" means either the Library or any derivative work under -+copyright law: that is to say, a work containing the Library or a -+portion of it, either verbatim or with modifications and/or translated -+straightforwardly into another language. (Hereinafter, translation is -+included without limitation in the term "modification".) -+ -+ "Source code" for a work means the preferred form of the work for -+making modifications to it. For a library, complete source code means -+all the source code for all modules it contains, plus any associated -+interface definition files, plus the scripts used to control compilation -+and installation of the library. -+ -+ Activities other than copying, distribution and modification are not -+covered by this License; they are outside its scope. The act of -+running a program using the Library is not restricted, and output from -+such a program is covered only if its contents constitute a work based -+on the Library (independent of the use of the Library in a tool for -+writing it). Whether that is true depends on what the Library does -+and what the program that uses the Library does. -+ -+ 1. You may copy and distribute verbatim copies of the Library's -+complete source code as you receive it, in any medium, provided that -+you conspicuously and appropriately publish on each copy an -+appropriate copyright notice and disclaimer of warranty; keep intact -+all the notices that refer to this License and to the absence of any -+warranty; and distribute a copy of this License along with the -+Library. -+ -+ You may charge a fee for the physical act of transferring a copy, -+and you may at your option offer warranty protection in exchange for a -+fee. -+ -+ 2. You may modify your copy or copies of the Library or any portion -+of it, thus forming a work based on the Library, and copy and -+distribute such modifications or work under the terms of Section 1 -+above, provided that you also meet all of these conditions: -+ -+ a) The modified work must itself be a software library. -+ -+ b) You must cause the files modified to carry prominent notices -+ stating that you changed the files and the date of any change. -+ -+ c) You must cause the whole of the work to be licensed at no -+ charge to all third parties under the terms of this License. -+ -+ d) If a facility in the modified Library refers to a function or a -+ table of data to be supplied by an application program that uses -+ the facility, other than as an argument passed when the facility -+ is invoked, then you must make a good faith effort to ensure that, -+ in the event an application does not supply such function or -+ table, the facility still operates, and performs whatever part of -+ its purpose remains meaningful. -+ -+ (For example, a function in a library to compute square roots has -+ a purpose that is entirely well-defined independent of the -+ application. Therefore, Subsection 2d requires that any -+ application-supplied function or table used by this function must -+ be optional: if the application does not supply it, the square -+ root function must still compute square roots.) -+ -+These requirements apply to the modified work as a whole. If -+identifiable sections of that work are not derived from the Library, -+and can be reasonably considered independent and separate works in -+themselves, then this License, and its terms, do not apply to those -+sections when you distribute them as separate works. But when you -+distribute the same sections as part of a whole which is a work based -+on the Library, the distribution of the whole must be on the terms of -+this License, whose permissions for other licensees extend to the -+entire whole, and thus to each and every part regardless of who wrote -+it. -+ -+Thus, it is not the intent of this section to claim rights or contest -+your rights to work written entirely by you; rather, the intent is to -+exercise the right to control the distribution of derivative or -+collective works based on the Library. -+ -+In addition, mere aggregation of another work not based on the Library -+with the Library (or with a work based on the Library) on a volume of -+a storage or distribution medium does not bring the other work under -+the scope of this License. -+ -+ 3. You may opt to apply the terms of the ordinary GNU General Public -+License instead of this License to a given copy of the Library. To do -+this, you must alter all the notices that refer to this License, so -+that they refer to the ordinary GNU General Public License, version 2, -+instead of to this License. (If a newer version than version 2 of the -+ordinary GNU General Public License has appeared, then you can specify -+that version instead if you wish.) Do not make any other change in -+these notices. -+ -+ Once this change is made in a given copy, it is irreversible for -+that copy, so the ordinary GNU General Public License applies to all -+subsequent copies and derivative works made from that copy. -+ -+ This option is useful when you wish to copy part of the code of -+the Library into a program that is not a library. -+ -+ 4. You may copy and distribute the Library (or a portion or -+derivative of it, under Section 2) in object code or executable form -+under the terms of Sections 1 and 2 above provided that you accompany -+it with the complete corresponding machine-readable source code, which -+must be distributed under the terms of Sections 1 and 2 above on a -+medium customarily used for software interchange. -+ -+ If distribution of object code is made by offering access to copy -+from a designated place, then offering equivalent access to copy the -+source code from the same place satisfies the requirement to -+distribute the source code, even though third parties are not -+compelled to copy the source along with the object code. -+ -+ 5. A program that contains no derivative of any portion of the -+Library, but is designed to work with the Library by being compiled or -+linked with it, is called a "work that uses the Library". Such a -+work, in isolation, is not a derivative work of the Library, and -+therefore falls outside the scope of this License. -+ -+ However, linking a "work that uses the Library" with the Library -+creates an executable that is a derivative of the Library (because it -+contains portions of the Library), rather than a "work that uses the -+library". The executable is therefore covered by this License. -+Section 6 states terms for distribution of such executables. -+ -+ When a "work that uses the Library" uses material from a header file -+that is part of the Library, the object code for the work may be a -+derivative work of the Library even though the source code is not. -+Whether this is true is especially significant if the work can be -+linked without the Library, or if the work is itself a library. The -+threshold for this to be true is not precisely defined by law. -+ -+ If such an object file uses only numerical parameters, data -+structure layouts and accessors, and small macros and small inline -+functions (ten lines or less in length), then the use of the object -+file is unrestricted, regardless of whether it is legally a derivative -+work. (Executables containing this object code plus portions of the -+Library will still fall under Section 6.) -+ -+ Otherwise, if the work is a derivative of the Library, you may -+distribute the object code for the work under the terms of Section 6. -+Any executables containing that work also fall under Section 6, -+whether or not they are linked directly with the Library itself. -+ -+ 6. As an exception to the Sections above, you may also combine or -+link a "work that uses the Library" with the Library to produce a -+work containing portions of the Library, and distribute that work -+under terms of your choice, provided that the terms permit -+modification of the work for the customer's own use and reverse -+engineering for debugging such modifications. -+ -+ You must give prominent notice with each copy of the work that the -+Library is used in it and that the Library and its use are covered by -+this License. You must supply a copy of this License. If the work -+during execution displays copyright notices, you must include the -+copyright notice for the Library among them, as well as a reference -+directing the user to the copy of this License. Also, you must do one -+of these things: -+ -+ a) Accompany the work with the complete corresponding -+ machine-readable source code for the Library including whatever -+ changes were used in the work (which must be distributed under -+ Sections 1 and 2 above); and, if the work is an executable linked -+ with the Library, with the complete machine-readable "work that -+ uses the Library", as object code and/or source code, so that the -+ user can modify the Library and then relink to produce a modified -+ executable containing the modified Library. (It is understood -+ that the user who changes the contents of definitions files in the -+ Library will not necessarily be able to recompile the application -+ to use the modified definitions.) -+ -+ b) Use a suitable shared library mechanism for linking with the -+ Library. A suitable mechanism is one that (1) uses at run time a -+ copy of the library already present on the user's computer system, -+ rather than copying library functions into the executable, and (2) -+ will operate properly with a modified version of the library, if -+ the user installs one, as long as the modified version is -+ interface-compatible with the version that the work was made with. -+ -+ c) Accompany the work with a written offer, valid for at -+ least three years, to give the same user the materials -+ specified in Subsection 6a, above, for a charge no more -+ than the cost of performing this distribution. -+ -+ d) If distribution of the work is made by offering access to copy -+ from a designated place, offer equivalent access to copy the above -+ specified materials from the same place. -+ -+ e) Verify that the user has already received a copy of these -+ materials or that you have already sent this user a copy. -+ -+ For an executable, the required form of the "work that uses the -+Library" must include any data and utility programs needed for -+reproducing the executable from it. However, as a special exception, -+the materials to be distributed need not include anything that is -+normally distributed (in either source or binary form) with the major -+components (compiler, kernel, and so on) of the operating system on -+which the executable runs, unless that component itself accompanies -+the executable. -+ -+ It may happen that this requirement contradicts the license -+restrictions of other proprietary libraries that do not normally -+accompany the operating system. Such a contradiction means you cannot -+use both them and the Library together in an executable that you -+distribute. -+ -+ 7. You may place library facilities that are a work based on the -+Library side-by-side in a single library together with other library -+facilities not covered by this License, and distribute such a combined -+library, provided that the separate distribution of the work based on -+the Library and of the other library facilities is otherwise -+permitted, and provided that you do these two things: -+ -+ a) Accompany the combined library with a copy of the same work -+ based on the Library, uncombined with any other library -+ facilities. This must be distributed under the terms of the -+ Sections above. -+ -+ b) Give prominent notice with the combined library of the fact -+ that part of it is a work based on the Library, and explaining -+ where to find the accompanying uncombined form of the same work. -+ -+ 8. You may not copy, modify, sublicense, link with, or distribute -+the Library except as expressly provided under this License. Any -+attempt otherwise to copy, modify, sublicense, link with, or -+distribute the Library is void, and will automatically terminate your -+rights under this License. However, parties who have received copies, -+or rights, from you under this License will not have their licenses -+terminated so long as such parties remain in full compliance. -+ -+ 9. You are not required to accept this License, since you have not -+signed it. However, nothing else grants you permission to modify or -+distribute the Library or its derivative works. These actions are -+prohibited by law if you do not accept this License. Therefore, by -+modifying or distributing the Library (or any work based on the -+Library), you indicate your acceptance of this License to do so, and -+all its terms and conditions for copying, distributing or modifying -+the Library or works based on it. -+ -+ 10. Each time you redistribute the Library (or any work based on the -+Library), the recipient automatically receives a license from the -+original licensor to copy, distribute, link with or modify the Library -+subject to these terms and conditions. You may not impose any further -+restrictions on the recipients' exercise of the rights granted herein. -+You are not responsible for enforcing compliance by third parties with -+this License. -+ -+ 11. If, as a consequence of a court judgment or allegation of patent -+infringement or for any other reason (not limited to patent issues), -+conditions are imposed on you (whether by court order, agreement or -+otherwise) that contradict the conditions of this License, they do not -+excuse you from the conditions of this License. If you cannot -+distribute so as to satisfy simultaneously your obligations under this -+License and any other pertinent obligations, then as a consequence you -+may not distribute the Library at all. For example, if a patent -+license would not permit royalty-free redistribution of the Library by -+all those who receive copies directly or indirectly through you, then -+the only way you could satisfy both it and this License would be to -+refrain entirely from distribution of the Library. -+ -+If any portion of this section is held invalid or unenforceable under any -+particular circumstance, the balance of the section is intended to apply, -+and the section as a whole is intended to apply in other circumstances. -+ -+It is not the purpose of this section to induce you to infringe any -+patents or other property right claims or to contest validity of any -+such claims; this section has the sole purpose of protecting the -+integrity of the free software distribution system which is -+implemented by public license practices. Many people have made -+generous contributions to the wide range of software distributed -+through that system in reliance on consistent application of that -+system; it is up to the author/donor to decide if he or she is willing -+to distribute software through any other system and a licensee cannot -+impose that choice. -+ -+This section is intended to make thoroughly clear what is believed to -+be a consequence of the rest of this License. -+ -+ 12. If the distribution and/or use of the Library is restricted in -+certain countries either by patents or by copyrighted interfaces, the -+original copyright holder who places the Library under this License may add -+an explicit geographical distribution limitation excluding those countries, -+so that distribution is permitted only in or among countries not thus -+excluded. In such case, this License incorporates the limitation as if -+written in the body of this License. -+ -+ 13. The Free Software Foundation may publish revised and/or new -+versions of the Lesser General Public License from time to time. -+Such new versions will be similar in spirit to the present version, -+but may differ in detail to address new problems or concerns. -+ -+Each version is given a distinguishing version number. If the Library -+specifies a version number of this License which applies to it and -+"any later version", you have the option of following the terms and -+conditions either of that version or of any later version published by -+the Free Software Foundation. If the Library does not specify a -+license version number, you may choose any version ever published by -+the Free Software Foundation. -+ -+ 14. If you wish to incorporate parts of the Library into other free -+programs whose distribution conditions are incompatible with these, -+write to the author to ask for permission. For software which is -+copyrighted by the Free Software Foundation, write to the Free -+Software Foundation; we sometimes make exceptions for this. Our -+decision will be guided by the two goals of preserving the free status -+of all derivatives of our free software and of promoting the sharing -+and reuse of software generally. -+ -+ NO WARRANTY -+ -+ 15. BECAUSE THE LIBRARY IS LICENSED FREE OF CHARGE, THERE IS NO -+WARRANTY FOR THE LIBRARY, TO THE EXTENT PERMITTED BY APPLICABLE LAW. -+EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR -+OTHER PARTIES PROVIDE THE LIBRARY "AS IS" WITHOUT WARRANTY OF ANY -+KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE -+IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR -+PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE -+LIBRARY IS WITH YOU. SHOULD THE LIBRARY PROVE DEFECTIVE, YOU ASSUME -+THE COST OF ALL NECESSARY SERVICING, REPAIR OR CORRECTION. -+ -+ 16. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN -+WRITING WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY -+AND/OR REDISTRIBUTE THE LIBRARY AS PERMITTED ABOVE, BE LIABLE TO YOU -+FOR DAMAGES, INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR -+CONSEQUENTIAL DAMAGES ARISING OUT OF THE USE OR INABILITY TO USE THE -+LIBRARY (INCLUDING BUT NOT LIMITED TO LOSS OF DATA OR DATA BEING -+RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD PARTIES OR A -+FAILURE OF THE LIBRARY TO OPERATE WITH ANY OTHER SOFTWARE), EVEN IF -+SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH -+DAMAGES. -+ -+ END OF TERMS AND CONDITIONS -+ -+ How to Apply These Terms to Your New Libraries -+ -+ If you develop a new library, and you want it to be of the greatest -+possible use to the public, we recommend making it free software that -+everyone can redistribute and change. You can do so by permitting -+redistribution under these terms (or, alternatively, under the terms of the -+ordinary General Public License). -+ -+ To apply these terms, attach the following notices to the library. It is -+safest to attach them to the start of each source file to most effectively -+convey the exclusion of warranty; and each file should have at least the -+"copyright" line and a pointer to where the full notice is found. -+ -+ -+ Copyright (C) -+ -+ This library is free software; you can redistribute it and/or -+ modify it under the terms of the GNU Lesser General Public -+ License as published by the Free Software Foundation; either -+ version 2.1 of the License, or (at your option) any later version. -+ -+ This library is distributed in the hope that it will be useful, -+ but WITHOUT ANY WARRANTY; without even the implied warranty of -+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -+ Lesser General Public License for more details. -+ -+ You should have received a copy of the GNU Lesser General Public -+ License along with this library; if not, write to the Free Software -+ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA -+ -+Also add information on how to contact you by electronic and paper mail. -+ -+You should also get your employer (if you work as a programmer) or your -+school, if any, to sign a "copyright disclaimer" for the library, if -+necessary. Here is a sample; alter the names: -+ -+ Yoyodyne, Inc., hereby disclaims all copyright interest in the -+ library `Frob' (a library for tweaking knobs) written by James Random Hacker. -+ -+ , 1 April 1990 -+ Ty Coon, President of Vice -+ -+That's all there is to it! -+ -+ -diff --git a/libudev/COPYING b/libudev/COPYING -new file mode 100644 -index 0000000..8add30a ---- /dev/null -+++ b/libudev/COPYING -@@ -0,0 +1,504 @@ -+ GNU LESSER GENERAL PUBLIC LICENSE -+ Version 2.1, February 1999 -+ -+ Copyright (C) 1991, 1999 Free Software Foundation, Inc. -+ 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA -+ Everyone is permitted to copy and distribute verbatim copies -+ of this license document, but changing it is not allowed. -+ -+[This is the first released version of the Lesser GPL. It also counts -+ as the successor of the GNU Library Public License, version 2, hence -+ the version number 2.1.] -+ -+ Preamble -+ -+ The licenses for most software are designed to take away your -+freedom to share and change it. By contrast, the GNU General Public -+Licenses are intended to guarantee your freedom to share and change -+free software--to make sure the software is free for all its users. -+ -+ This license, the Lesser General Public License, applies to some -+specially designated software packages--typically libraries--of the -+Free Software Foundation and other authors who decide to use it. You -+can use it too, but we suggest you first think carefully about whether -+this license or the ordinary General Public License is the better -+strategy to use in any particular case, based on the explanations below. -+ -+ When we speak of free software, we are referring to freedom of use, -+not price. Our General Public Licenses are designed to make sure that -+you have the freedom to distribute copies of free software (and charge -+for this service if you wish); that you receive source code or can get -+it if you want it; that you can change the software and use pieces of -+it in new free programs; and that you are informed that you can do -+these things. -+ -+ To protect your rights, we need to make restrictions that forbid -+distributors to deny you these rights or to ask you to surrender these -+rights. These restrictions translate to certain responsibilities for -+you if you distribute copies of the library or if you modify it. -+ -+ For example, if you distribute copies of the library, whether gratis -+or for a fee, you must give the recipients all the rights that we gave -+you. You must make sure that they, too, receive or can get the source -+code. If you link other code with the library, you must provide -+complete object files to the recipients, so that they can relink them -+with the library after making changes to the library and recompiling -+it. And you must show them these terms so they know their rights. -+ -+ We protect your rights with a two-step method: (1) we copyright the -+library, and (2) we offer you this license, which gives you legal -+permission to copy, distribute and/or modify the library. -+ -+ To protect each distributor, we want to make it very clear that -+there is no warranty for the free library. Also, if the library is -+modified by someone else and passed on, the recipients should know -+that what they have is not the original version, so that the original -+author's reputation will not be affected by problems that might be -+introduced by others. -+ -+ Finally, software patents pose a constant threat to the existence of -+any free program. We wish to make sure that a company cannot -+effectively restrict the users of a free program by obtaining a -+restrictive license from a patent holder. Therefore, we insist that -+any patent license obtained for a version of the library must be -+consistent with the full freedom of use specified in this license. -+ -+ Most GNU software, including some libraries, is covered by the -+ordinary GNU General Public License. This license, the GNU Lesser -+General Public License, applies to certain designated libraries, and -+is quite different from the ordinary General Public License. We use -+this license for certain libraries in order to permit linking those -+libraries into non-free programs. -+ -+ When a program is linked with a library, whether statically or using -+a shared library, the combination of the two is legally speaking a -+combined work, a derivative of the original library. The ordinary -+General Public License therefore permits such linking only if the -+entire combination fits its criteria of freedom. The Lesser General -+Public License permits more lax criteria for linking other code with -+the library. -+ -+ We call this license the "Lesser" General Public License because it -+does Less to protect the user's freedom than the ordinary General -+Public License. It also provides other free software developers Less -+of an advantage over competing non-free programs. These disadvantages -+are the reason we use the ordinary General Public License for many -+libraries. However, the Lesser license provides advantages in certain -+special circumstances. -+ -+ For example, on rare occasions, there may be a special need to -+encourage the widest possible use of a certain library, so that it becomes -+a de-facto standard. To achieve this, non-free programs must be -+allowed to use the library. A more frequent case is that a free -+library does the same job as widely used non-free libraries. In this -+case, there is little to gain by limiting the free library to free -+software only, so we use the Lesser General Public License. -+ -+ In other cases, permission to use a particular library in non-free -+programs enables a greater number of people to use a large body of -+free software. For example, permission to use the GNU C Library in -+non-free programs enables many more people to use the whole GNU -+operating system, as well as its variant, the GNU/Linux operating -+system. -+ -+ Although the Lesser General Public License is Less protective of the -+users' freedom, it does ensure that the user of a program that is -+linked with the Library has the freedom and the wherewithal to run -+that program using a modified version of the Library. -+ -+ The precise terms and conditions for copying, distribution and -+modification follow. Pay close attention to the difference between a -+"work based on the library" and a "work that uses the library". The -+former contains code derived from the library, whereas the latter must -+be combined with the library in order to run. -+ -+ GNU LESSER GENERAL PUBLIC LICENSE -+ TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION -+ -+ 0. This License Agreement applies to any software library or other -+program which contains a notice placed by the copyright holder or -+other authorized party saying it may be distributed under the terms of -+this Lesser General Public License (also called "this License"). -+Each licensee is addressed as "you". -+ -+ A "library" means a collection of software functions and/or data -+prepared so as to be conveniently linked with application programs -+(which use some of those functions and data) to form executables. -+ -+ The "Library", below, refers to any such software library or work -+which has been distributed under these terms. A "work based on the -+Library" means either the Library or any derivative work under -+copyright law: that is to say, a work containing the Library or a -+portion of it, either verbatim or with modifications and/or translated -+straightforwardly into another language. (Hereinafter, translation is -+included without limitation in the term "modification".) -+ -+ "Source code" for a work means the preferred form of the work for -+making modifications to it. For a library, complete source code means -+all the source code for all modules it contains, plus any associated -+interface definition files, plus the scripts used to control compilation -+and installation of the library. -+ -+ Activities other than copying, distribution and modification are not -+covered by this License; they are outside its scope. The act of -+running a program using the Library is not restricted, and output from -+such a program is covered only if its contents constitute a work based -+on the Library (independent of the use of the Library in a tool for -+writing it). Whether that is true depends on what the Library does -+and what the program that uses the Library does. -+ -+ 1. You may copy and distribute verbatim copies of the Library's -+complete source code as you receive it, in any medium, provided that -+you conspicuously and appropriately publish on each copy an -+appropriate copyright notice and disclaimer of warranty; keep intact -+all the notices that refer to this License and to the absence of any -+warranty; and distribute a copy of this License along with the -+Library. -+ -+ You may charge a fee for the physical act of transferring a copy, -+and you may at your option offer warranty protection in exchange for a -+fee. -+ -+ 2. You may modify your copy or copies of the Library or any portion -+of it, thus forming a work based on the Library, and copy and -+distribute such modifications or work under the terms of Section 1 -+above, provided that you also meet all of these conditions: -+ -+ a) The modified work must itself be a software library. -+ -+ b) You must cause the files modified to carry prominent notices -+ stating that you changed the files and the date of any change. -+ -+ c) You must cause the whole of the work to be licensed at no -+ charge to all third parties under the terms of this License. -+ -+ d) If a facility in the modified Library refers to a function or a -+ table of data to be supplied by an application program that uses -+ the facility, other than as an argument passed when the facility -+ is invoked, then you must make a good faith effort to ensure that, -+ in the event an application does not supply such function or -+ table, the facility still operates, and performs whatever part of -+ its purpose remains meaningful. -+ -+ (For example, a function in a library to compute square roots has -+ a purpose that is entirely well-defined independent of the -+ application. Therefore, Subsection 2d requires that any -+ application-supplied function or table used by this function must -+ be optional: if the application does not supply it, the square -+ root function must still compute square roots.) -+ -+These requirements apply to the modified work as a whole. If -+identifiable sections of that work are not derived from the Library, -+and can be reasonably considered independent and separate works in -+themselves, then this License, and its terms, do not apply to those -+sections when you distribute them as separate works. But when you -+distribute the same sections as part of a whole which is a work based -+on the Library, the distribution of the whole must be on the terms of -+this License, whose permissions for other licensees extend to the -+entire whole, and thus to each and every part regardless of who wrote -+it. -+ -+Thus, it is not the intent of this section to claim rights or contest -+your rights to work written entirely by you; rather, the intent is to -+exercise the right to control the distribution of derivative or -+collective works based on the Library. -+ -+In addition, mere aggregation of another work not based on the Library -+with the Library (or with a work based on the Library) on a volume of -+a storage or distribution medium does not bring the other work under -+the scope of this License. -+ -+ 3. You may opt to apply the terms of the ordinary GNU General Public -+License instead of this License to a given copy of the Library. To do -+this, you must alter all the notices that refer to this License, so -+that they refer to the ordinary GNU General Public License, version 2, -+instead of to this License. (If a newer version than version 2 of the -+ordinary GNU General Public License has appeared, then you can specify -+that version instead if you wish.) Do not make any other change in -+these notices. -+ -+ Once this change is made in a given copy, it is irreversible for -+that copy, so the ordinary GNU General Public License applies to all -+subsequent copies and derivative works made from that copy. -+ -+ This option is useful when you wish to copy part of the code of -+the Library into a program that is not a library. -+ -+ 4. You may copy and distribute the Library (or a portion or -+derivative of it, under Section 2) in object code or executable form -+under the terms of Sections 1 and 2 above provided that you accompany -+it with the complete corresponding machine-readable source code, which -+must be distributed under the terms of Sections 1 and 2 above on a -+medium customarily used for software interchange. -+ -+ If distribution of object code is made by offering access to copy -+from a designated place, then offering equivalent access to copy the -+source code from the same place satisfies the requirement to -+distribute the source code, even though third parties are not -+compelled to copy the source along with the object code. -+ -+ 5. A program that contains no derivative of any portion of the -+Library, but is designed to work with the Library by being compiled or -+linked with it, is called a "work that uses the Library". Such a -+work, in isolation, is not a derivative work of the Library, and -+therefore falls outside the scope of this License. -+ -+ However, linking a "work that uses the Library" with the Library -+creates an executable that is a derivative of the Library (because it -+contains portions of the Library), rather than a "work that uses the -+library". The executable is therefore covered by this License. -+Section 6 states terms for distribution of such executables. -+ -+ When a "work that uses the Library" uses material from a header file -+that is part of the Library, the object code for the work may be a -+derivative work of the Library even though the source code is not. -+Whether this is true is especially significant if the work can be -+linked without the Library, or if the work is itself a library. The -+threshold for this to be true is not precisely defined by law. -+ -+ If such an object file uses only numerical parameters, data -+structure layouts and accessors, and small macros and small inline -+functions (ten lines or less in length), then the use of the object -+file is unrestricted, regardless of whether it is legally a derivative -+work. (Executables containing this object code plus portions of the -+Library will still fall under Section 6.) -+ -+ Otherwise, if the work is a derivative of the Library, you may -+distribute the object code for the work under the terms of Section 6. -+Any executables containing that work also fall under Section 6, -+whether or not they are linked directly with the Library itself. -+ -+ 6. As an exception to the Sections above, you may also combine or -+link a "work that uses the Library" with the Library to produce a -+work containing portions of the Library, and distribute that work -+under terms of your choice, provided that the terms permit -+modification of the work for the customer's own use and reverse -+engineering for debugging such modifications. -+ -+ You must give prominent notice with each copy of the work that the -+Library is used in it and that the Library and its use are covered by -+this License. You must supply a copy of this License. If the work -+during execution displays copyright notices, you must include the -+copyright notice for the Library among them, as well as a reference -+directing the user to the copy of this License. Also, you must do one -+of these things: -+ -+ a) Accompany the work with the complete corresponding -+ machine-readable source code for the Library including whatever -+ changes were used in the work (which must be distributed under -+ Sections 1 and 2 above); and, if the work is an executable linked -+ with the Library, with the complete machine-readable "work that -+ uses the Library", as object code and/or source code, so that the -+ user can modify the Library and then relink to produce a modified -+ executable containing the modified Library. (It is understood -+ that the user who changes the contents of definitions files in the -+ Library will not necessarily be able to recompile the application -+ to use the modified definitions.) -+ -+ b) Use a suitable shared library mechanism for linking with the -+ Library. A suitable mechanism is one that (1) uses at run time a -+ copy of the library already present on the user's computer system, -+ rather than copying library functions into the executable, and (2) -+ will operate properly with a modified version of the library, if -+ the user installs one, as long as the modified version is -+ interface-compatible with the version that the work was made with. -+ -+ c) Accompany the work with a written offer, valid for at -+ least three years, to give the same user the materials -+ specified in Subsection 6a, above, for a charge no more -+ than the cost of performing this distribution. -+ -+ d) If distribution of the work is made by offering access to copy -+ from a designated place, offer equivalent access to copy the above -+ specified materials from the same place. -+ -+ e) Verify that the user has already received a copy of these -+ materials or that you have already sent this user a copy. -+ -+ For an executable, the required form of the "work that uses the -+Library" must include any data and utility programs needed for -+reproducing the executable from it. However, as a special exception, -+the materials to be distributed need not include anything that is -+normally distributed (in either source or binary form) with the major -+components (compiler, kernel, and so on) of the operating system on -+which the executable runs, unless that component itself accompanies -+the executable. -+ -+ It may happen that this requirement contradicts the license -+restrictions of other proprietary libraries that do not normally -+accompany the operating system. Such a contradiction means you cannot -+use both them and the Library together in an executable that you -+distribute. -+ -+ 7. You may place library facilities that are a work based on the -+Library side-by-side in a single library together with other library -+facilities not covered by this License, and distribute such a combined -+library, provided that the separate distribution of the work based on -+the Library and of the other library facilities is otherwise -+permitted, and provided that you do these two things: -+ -+ a) Accompany the combined library with a copy of the same work -+ based on the Library, uncombined with any other library -+ facilities. This must be distributed under the terms of the -+ Sections above. -+ -+ b) Give prominent notice with the combined library of the fact -+ that part of it is a work based on the Library, and explaining -+ where to find the accompanying uncombined form of the same work. -+ -+ 8. You may not copy, modify, sublicense, link with, or distribute -+the Library except as expressly provided under this License. Any -+attempt otherwise to copy, modify, sublicense, link with, or -+distribute the Library is void, and will automatically terminate your -+rights under this License. However, parties who have received copies, -+or rights, from you under this License will not have their licenses -+terminated so long as such parties remain in full compliance. -+ -+ 9. You are not required to accept this License, since you have not -+signed it. However, nothing else grants you permission to modify or -+distribute the Library or its derivative works. These actions are -+prohibited by law if you do not accept this License. Therefore, by -+modifying or distributing the Library (or any work based on the -+Library), you indicate your acceptance of this License to do so, and -+all its terms and conditions for copying, distributing or modifying -+the Library or works based on it. -+ -+ 10. Each time you redistribute the Library (or any work based on the -+Library), the recipient automatically receives a license from the -+original licensor to copy, distribute, link with or modify the Library -+subject to these terms and conditions. You may not impose any further -+restrictions on the recipients' exercise of the rights granted herein. -+You are not responsible for enforcing compliance by third parties with -+this License. -+ -+ 11. If, as a consequence of a court judgment or allegation of patent -+infringement or for any other reason (not limited to patent issues), -+conditions are imposed on you (whether by court order, agreement or -+otherwise) that contradict the conditions of this License, they do not -+excuse you from the conditions of this License. If you cannot -+distribute so as to satisfy simultaneously your obligations under this -+License and any other pertinent obligations, then as a consequence you -+may not distribute the Library at all. For example, if a patent -+license would not permit royalty-free redistribution of the Library by -+all those who receive copies directly or indirectly through you, then -+the only way you could satisfy both it and this License would be to -+refrain entirely from distribution of the Library. -+ -+If any portion of this section is held invalid or unenforceable under any -+particular circumstance, the balance of the section is intended to apply, -+and the section as a whole is intended to apply in other circumstances. -+ -+It is not the purpose of this section to induce you to infringe any -+patents or other property right claims or to contest validity of any -+such claims; this section has the sole purpose of protecting the -+integrity of the free software distribution system which is -+implemented by public license practices. Many people have made -+generous contributions to the wide range of software distributed -+through that system in reliance on consistent application of that -+system; it is up to the author/donor to decide if he or she is willing -+to distribute software through any other system and a licensee cannot -+impose that choice. -+ -+This section is intended to make thoroughly clear what is believed to -+be a consequence of the rest of this License. -+ -+ 12. If the distribution and/or use of the Library is restricted in -+certain countries either by patents or by copyrighted interfaces, the -+original copyright holder who places the Library under this License may add -+an explicit geographical distribution limitation excluding those countries, -+so that distribution is permitted only in or among countries not thus -+excluded. In such case, this License incorporates the limitation as if -+written in the body of this License. -+ -+ 13. The Free Software Foundation may publish revised and/or new -+versions of the Lesser General Public License from time to time. -+Such new versions will be similar in spirit to the present version, -+but may differ in detail to address new problems or concerns. -+ -+Each version is given a distinguishing version number. If the Library -+specifies a version number of this License which applies to it and -+"any later version", you have the option of following the terms and -+conditions either of that version or of any later version published by -+the Free Software Foundation. If the Library does not specify a -+license version number, you may choose any version ever published by -+the Free Software Foundation. -+ -+ 14. If you wish to incorporate parts of the Library into other free -+programs whose distribution conditions are incompatible with these, -+write to the author to ask for permission. For software which is -+copyrighted by the Free Software Foundation, write to the Free -+Software Foundation; we sometimes make exceptions for this. Our -+decision will be guided by the two goals of preserving the free status -+of all derivatives of our free software and of promoting the sharing -+and reuse of software generally. -+ -+ NO WARRANTY -+ -+ 15. BECAUSE THE LIBRARY IS LICENSED FREE OF CHARGE, THERE IS NO -+WARRANTY FOR THE LIBRARY, TO THE EXTENT PERMITTED BY APPLICABLE LAW. -+EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR -+OTHER PARTIES PROVIDE THE LIBRARY "AS IS" WITHOUT WARRANTY OF ANY -+KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE -+IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR -+PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE -+LIBRARY IS WITH YOU. SHOULD THE LIBRARY PROVE DEFECTIVE, YOU ASSUME -+THE COST OF ALL NECESSARY SERVICING, REPAIR OR CORRECTION. -+ -+ 16. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN -+WRITING WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY -+AND/OR REDISTRIBUTE THE LIBRARY AS PERMITTED ABOVE, BE LIABLE TO YOU -+FOR DAMAGES, INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR -+CONSEQUENTIAL DAMAGES ARISING OUT OF THE USE OR INABILITY TO USE THE -+LIBRARY (INCLUDING BUT NOT LIMITED TO LOSS OF DATA OR DATA BEING -+RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD PARTIES OR A -+FAILURE OF THE LIBRARY TO OPERATE WITH ANY OTHER SOFTWARE), EVEN IF -+SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH -+DAMAGES. -+ -+ END OF TERMS AND CONDITIONS -+ -+ How to Apply These Terms to Your New Libraries -+ -+ If you develop a new library, and you want it to be of the greatest -+possible use to the public, we recommend making it free software that -+everyone can redistribute and change. You can do so by permitting -+redistribution under these terms (or, alternatively, under the terms of the -+ordinary General Public License). -+ -+ To apply these terms, attach the following notices to the library. It is -+safest to attach them to the start of each source file to most effectively -+convey the exclusion of warranty; and each file should have at least the -+"copyright" line and a pointer to where the full notice is found. -+ -+ -+ Copyright (C) -+ -+ This library is free software; you can redistribute it and/or -+ modify it under the terms of the GNU Lesser General Public -+ License as published by the Free Software Foundation; either -+ version 2.1 of the License, or (at your option) any later version. -+ -+ This library is distributed in the hope that it will be useful, -+ but WITHOUT ANY WARRANTY; without even the implied warranty of -+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -+ Lesser General Public License for more details. -+ -+ You should have received a copy of the GNU Lesser General Public -+ License along with this library; if not, write to the Free Software -+ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA -+ -+Also add information on how to contact you by electronic and paper mail. -+ -+You should also get your employer (if you work as a programmer) or your -+school, if any, to sign a "copyright disclaimer" for the library, if -+necessary. Here is a sample; alter the names: -+ -+ Yoyodyne, Inc., hereby disclaims all copyright interest in the -+ library `Frob' (a library for tweaking knobs) written by James Random Hacker. -+ -+ , 1 April 1990 -+ Ty Coon, President of Vice -+ -+That's all there is to it! -+ -+ diff --git a/udev-86a7a2f-fix-missing-firmware.patch b/udev-86a7a2f-fix-missing-firmware.patch deleted file mode 100644 index 0213bdf..0000000 --- a/udev-86a7a2f-fix-missing-firmware.patch +++ /dev/null @@ -1,43 +0,0 @@ -From 86a7a2f853fe6022c5b0c1b415918047b65533be Mon Sep 17 00:00:00 2001 -From: =?UTF-8?q?Thomas=20B=C3=A4chler?= -Date: Sun, 31 Jan 2010 13:49:02 +0100 -Subject: firmware: fix error reporting on missing firmware files - -The new firmware loader does not report an error to the kernel if a firmware file -is missing. This results in modprobe stalling for 60 seconds for each firmware -a module tries to load. ---- - extras/firmware/firmware.c | 3 ++- - 1 files changed, 2 insertions(+), 1 deletions(-) - -diff --git a/extras/firmware/firmware.c b/extras/firmware/firmware.c -index 8f70be4..16455de 100644 ---- a/extras/firmware/firmware.c -+++ b/extras/firmware/firmware.c -@@ -149,6 +149,7 @@ int main(int argc, char **argv) - - util_path_encode(firmware, fwencpath, sizeof(fwencpath)); - util_strscpyl(misspath, sizeof(misspath), udev_get_dev_path(udev), "/.udev/firmware-missing/", fwencpath, NULL); -+ util_strscpyl(loadpath, sizeof(loadpath), udev_get_sys_path(udev), devpath, "/loading", NULL); - - if (fwfile == NULL) { - int err; -@@ -166,6 +167,7 @@ int main(int argc, char **argv) - udev_selinux_resetfscreatecon(udev); - } while (err == -ENOENT); - rc = 2; -+ set_loading(udev, loadpath, "-1"); - goto exit; - } - -@@ -176,7 +178,6 @@ int main(int argc, char **argv) - if (unlink(misspath) == 0) - util_delete_path(udev, misspath); - -- util_strscpyl(loadpath, sizeof(loadpath), udev_get_sys_path(udev), devpath, "/loading", NULL); - set_loading(udev, loadpath, "1"); - - util_strscpyl(datapath, sizeof(datapath), udev_get_sys_path(udev), devpath, "/data", NULL); --- -1.6.6 - diff --git a/udev.spec b/udev.spec index d8c5129..272bb00 100644 --- a/udev.spec +++ b/udev.spec @@ -4,8 +4,8 @@ Summary: A userspace implementation of devfs Name: udev -Version: 156 -Release: 2%{?dist} +Version: 158 +Release: 1%{?dist} License: GPLv2 Group: System Environment/Base Provides: udev-persistent = %{version}-%{release} @@ -14,9 +14,6 @@ Obsoletes: udev-extras < 20090618 Provides: udev-extras = 20090618-1 Source: ftp://ftp.kernel.org/pub/linux/utils/kernel/hotplug/%{name}-%{version}.tar.bz2 -Patch101: udev-151-rules.patch -#Patch103: udev-151-gperf.patch - Source1: start_udev Source3: udev-post.init Source4: fw_unit_symlinks.sh @@ -112,10 +109,6 @@ glib-based applications using libudev functionality. %prep %setup -q - -%patch101 -p1 -#%patch103 -p1 - %build libtoolize -f -c %configure --with-selinux --prefix=%{_prefix} --exec-prefix="" \ @@ -258,6 +251,7 @@ rm -rf $RPM_BUILD_ROOT %attr(0755,root,root) %{udev_scriptdir}/fstab_import %attr(0755,root,root) %{udev_scriptdir}/input_id %attr(0755,root,root) %{udev_scriptdir}/keyboard-force-release.sh +%attr(0755,root,root) %{udev_scriptdir}/mtd_probe %attr(0755,root,root) %dir %{udev_scriptdir}/rules.d/ %attr(0755,root,root) %{_sysconfdir}/rc.d/init.d/udev-post @@ -349,6 +343,9 @@ rm -rf $RPM_BUILD_ROOT %attr(0644,root,root) %{_libdir}/pkgconfig/gudev-1.0* %changelog +* Thu Jun 24 2010 Harald Hoyer 158-1 +- version 158 + * Thu May 27 2010 Harald Hoyer 156-2 - cleaned up start_udev and udev-post initscript - removed redhat specific rules From fda0e26b466f3b5fda02103e6d320ceb1eccc8f8 Mon Sep 17 00:00:00 2001 From: Harald Hoyer Date: Fri, 25 Jun 2010 13:33:19 +0000 Subject: [PATCH 066/142] - moved udev pkgconfig to base file on authors request - specfile cleanups --- 0001-version-bump.patch | 35 +++ 0002-add-systemd-service-files.patch | 76 +++++ ...-and-install-systemd-service-files-w.patch | 230 ++++++++++++++ 0004-make-fix-make-distcheck.patch | 27 ++ ...ft-over-from-GPLv2-to-GPLv2-or-later.patch | 296 ++++++++++++++++++ 0006-path_id-add-handle_scsi_sas.patch | 88 ++++++ fw_unit_symlinks.sh | 25 -- start_udev | 80 +---- udev-151-virtio.patch | 30 -- ...-156.tar.bz2.sign => udev-158.tar.bz2.sign | 6 +- udev.spec | 55 ++-- 11 files changed, 790 insertions(+), 158 deletions(-) create mode 100644 0001-version-bump.patch create mode 100644 0002-add-systemd-service-files.patch create mode 100644 0003-make-pre-process-and-install-systemd-service-files-w.patch create mode 100644 0004-make-fix-make-distcheck.patch create mode 100644 0005-switch-a-few-left-over-from-GPLv2-to-GPLv2-or-later.patch create mode 100644 0006-path_id-add-handle_scsi_sas.patch delete mode 100644 fw_unit_symlinks.sh delete mode 100644 udev-151-virtio.patch rename udev-156.tar.bz2.sign => udev-158.tar.bz2.sign (61%) diff --git a/0001-version-bump.patch b/0001-version-bump.patch new file mode 100644 index 0000000..4917fbd --- /dev/null +++ b/0001-version-bump.patch @@ -0,0 +1,35 @@ +From cbcb846a4c9c9b8215a3f484d70e3cefde5ba226 Mon Sep 17 00:00:00 2001 +From: Kay Sievers +Date: Thu, 24 Jun 2010 10:17:15 +0200 +Subject: [PATCH 1/6] version bump + +--- + NEWS | 4 ++++ + configure.ac | 2 +- + 2 files changed, 5 insertions(+), 1 deletions(-) + +diff --git a/NEWS b/NEWS +index 002ecba..88dc34d 100644 +--- a/NEWS ++++ b/NEWS +@@ -1,3 +1,7 @@ ++udev 159 ++======== ++Bugfixes. ++ + udev 158 + ======== + Bugfixes. +diff --git a/configure.ac b/configure.ac +index 7e9b1f8..4bac653 100644 +--- a/configure.ac ++++ b/configure.ac +@@ -1,4 +1,4 @@ +-AC_INIT([udev], [158], [linux-hotplug@vger.kernel.org]) ++AC_INIT([udev], [159], [linux-hotplug@vger.kernel.org]) + AC_PREREQ(2.60) + AM_INIT_AUTOMAKE([check-news foreign 1.10 dist-bzip2 subdir-objects]) + m4_ifdef([AM_SILENT_RULES], [AM_SILENT_RULES([yes])]) +-- +1.7.0.1 + diff --git a/0002-add-systemd-service-files.patch b/0002-add-systemd-service-files.patch new file mode 100644 index 0000000..dc6ea1a --- /dev/null +++ b/0002-add-systemd-service-files.patch @@ -0,0 +1,76 @@ +From 43fefbf6f1c528947a77643582bcc34cf3538b2d Mon Sep 17 00:00:00 2001 +From: Kay Sievers +Date: Fri, 25 Jun 2010 01:31:57 +0200 +Subject: [PATCH 2/6] add systemd service files + +--- + init/udev-retry.service | 13 +++++++++++++ + init/udev-settle.service | 13 +++++++++++++ + init/udev.service | 15 +++++++++++++++ + 3 files changed, 41 insertions(+), 0 deletions(-) + create mode 100644 init/udev-retry.service + create mode 100644 init/udev-settle.service + create mode 100644 init/udev.service + +diff --git a/init/udev-retry.service b/init/udev-retry.service +new file mode 100644 +index 0000000..0792875 +--- /dev/null ++++ b/init/udev-retry.service +@@ -0,0 +1,13 @@ ++[Unit] ++Description=re-trigger failed events after filesystems are available ++After=local-fs.target ++ ++[Service] ++Type=finish ++ValidNoProcess=yes ++ExecStart=/sbin/udevadm trigger --type=failed ++ ++[Install] ++WantedBy=sysinit.target ++Also=udev.service ++Also=udev-settle.service +diff --git a/init/udev-settle.service b/init/udev-settle.service +new file mode 100644 +index 0000000..3c73a96 +--- /dev/null ++++ b/init/udev-settle.service +@@ -0,0 +1,13 @@ ++[Unit] ++Description=wait until full initialization ++After=udev.service ++ ++[Service] ++Type=finish ++ValidNoProcess=yes ++ExecStart=/sbin/udevadm settle ++ ++[Install] ++WantedBy=sysinit.target ++Also=udev.service ++Also=udev-retry.service +diff --git a/init/udev.service b/init/udev.service +new file mode 100644 +index 0000000..f6824a2 +--- /dev/null ++++ b/init/udev.service +@@ -0,0 +1,15 @@ ++[Unit] ++Description=/dev and kernel device manager ++Before=sysinit.target ++ ++[Service] ++Type=notify ++ExecStart=/sbin/udevd ++ExecStartPost=/sbin/udevadm trigger --type=subsystems --action=add ++ExecStartPost=/sbin/udevadm trigger --type=devices --action=add ++ ++[Install] ++WantedBy=sysinit.target ++Also=udev-settle.service ++Also=udev-retry.service ++ +-- +1.7.0.1 + diff --git a/0003-make-pre-process-and-install-systemd-service-files-w.patch b/0003-make-pre-process-and-install-systemd-service-files-w.patch new file mode 100644 index 0000000..b7c9383 --- /dev/null +++ b/0003-make-pre-process-and-install-systemd-service-files-w.patch @@ -0,0 +1,230 @@ +From 08b4c88353b48302ae94088b55b2066ad01c63f8 Mon Sep 17 00:00:00 2001 +From: Kay Sievers +Date: Fri, 25 Jun 2010 10:30:55 +0200 +Subject: [PATCH 3/6] make: pre-process and install systemd service files when needed + +--- + Makefile.am | 7 +++++++ + configure.ac | 16 +++++++++++++--- + extras/mtd_probe/.gitignore | 1 + + init/.gitignore | 1 + + init/udev-retry.service | 13 ------------- + init/udev-retry.service.in | 13 +++++++++++++ + init/udev-settle.service | 13 ------------- + init/udev-settle.service.in | 13 +++++++++++++ + init/udev.service | 15 --------------- + init/udev.service.in | 15 +++++++++++++++ + 10 files changed, 63 insertions(+), 44 deletions(-) + create mode 100644 extras/mtd_probe/.gitignore + create mode 100644 init/.gitignore + delete mode 100644 init/udev-retry.service + create mode 100644 init/udev-retry.service.in + delete mode 100644 init/udev-settle.service + create mode 100644 init/udev-settle.service.in + delete mode 100644 init/udev.service + create mode 100644 init/udev.service.in + +diff --git a/Makefile.am b/Makefile.am +index 1916770..198c06c 100644 +--- a/Makefile.am ++++ b/Makefile.am +@@ -114,6 +114,13 @@ dist_udevconf_DATA = udev.conf + sharepkgconfigdir = $(datadir)/pkgconfig + sharepkgconfig_DATA = udev/udev.pc + ++if WITH_SYSTEMD ++systemdsystemunit_DATA = \ ++ init/udev.service \ ++ init/udev-settle.service \ ++ init/udev-retry.service ++endif ++ + sbin_PROGRAMS = \ + udev/udevd \ + udev/udevadm +diff --git a/configure.ac b/configure.ac +index 4bac653..255ee18 100644 +--- a/configure.ac ++++ b/configure.ac +@@ -49,8 +49,7 @@ fi + AC_ARG_WITH(firmware-path, + AS_HELP_STRING([--with-firmware-path=DIR[[[:DIR[...]]]]], + [Firmware search path (default=/lib/firmware/updates:/lib/firmware)]), +- [], [with_firmware_path="/lib/firmware/updates:/lib/firmware"] +- ) ++ [], [with_firmware_path="/lib/firmware/updates:/lib/firmware"]) + OLD_IFS=$IFS + IFS=: + for i in $with_firmware_path +@@ -64,6 +63,12 @@ done + IFS=$OLD_IFS + AC_SUBST([FIRMWARE_PATH], [$FIRMWARE_PATH]) + ++AC_ARG_WITH([systemdsystemunitdir], ++ AS_HELP_STRING([--with-systemdsystemunitdir=DIR], [Directory for systemd service files]), ++ [], [with_systemdsystemunitdir=$($PKG_CONFIG --variable=systemdsystemunitdir systemd)]) ++AC_SUBST([systemdsystemunitdir], [$with_systemdsystemunitdir]) ++AM_CONDITIONAL(WITH_SYSTEMD, [test -n "$with_systemdsystemunitdir"]) ++ + AC_ARG_ENABLE([extras], + AS_HELP_STRING([--disable-extras], [disable extras with external dependencies]), + [], [enable_extras=yes]) +@@ -126,10 +131,13 @@ AM_CONDITIONAL([ENABLE_INTROSPECTION], [test "x$enable_introspection" = xyes]) + AC_CONFIG_HEADERS(config.h) + AC_CONFIG_FILES([ + Makefile ++ udev/udev.pc ++ init/udev.service ++ init/udev-settle.service ++ init/udev-retry.service + libudev/libudev.pc + libudev/docs/Makefile + libudev/docs/version.xml +- udev/udev.pc + extras/gudev/gudev-1.0.pc + extras/gudev/docs/Makefile + extras/gudev/docs/version.xml +@@ -153,6 +161,8 @@ AC_MSG_RESULT([ + + include_prefix: ${INCLUDE_PREFIX} + ++ systemdsystemunitdir: ${systemdsystemunitdir} ++ + logging: ${enable_logging} + debug: ${enable_debug} + selinux: ${with_selinux} +diff --git a/extras/mtd_probe/.gitignore b/extras/mtd_probe/.gitignore +new file mode 100644 +index 0000000..82b8ab5 +--- /dev/null ++++ b/extras/mtd_probe/.gitignore +@@ -0,0 +1 @@ ++mtd_probe +diff --git a/init/.gitignore b/init/.gitignore +new file mode 100644 +index 0000000..904e445 +--- /dev/null ++++ b/init/.gitignore +@@ -0,0 +1 @@ ++udev*.service +diff --git a/init/udev-retry.service b/init/udev-retry.service +deleted file mode 100644 +index 0792875..0000000 +--- a/init/udev-retry.service ++++ /dev/null +@@ -1,13 +0,0 @@ +-[Unit] +-Description=re-trigger failed events after filesystems are available +-After=local-fs.target +- +-[Service] +-Type=finish +-ValidNoProcess=yes +-ExecStart=/sbin/udevadm trigger --type=failed +- +-[Install] +-WantedBy=sysinit.target +-Also=udev.service +-Also=udev-settle.service +diff --git a/init/udev-retry.service.in b/init/udev-retry.service.in +new file mode 100644 +index 0000000..b7d5320 +--- /dev/null ++++ b/init/udev-retry.service.in +@@ -0,0 +1,13 @@ ++[Unit] ++Description=re-trigger failed events after filesystems are available ++After=local-fs.target ++ ++[Service] ++Type=finish ++ValidNoProcess=yes ++ExecStart=@sbindir@/udevadm trigger --type=failed ++ ++[Install] ++WantedBy=sysinit.target ++Also=udev.service ++Also=udev-settle.service +diff --git a/init/udev-settle.service b/init/udev-settle.service +deleted file mode 100644 +index 3c73a96..0000000 +--- a/init/udev-settle.service ++++ /dev/null +@@ -1,13 +0,0 @@ +-[Unit] +-Description=wait until full initialization +-After=udev.service +- +-[Service] +-Type=finish +-ValidNoProcess=yes +-ExecStart=/sbin/udevadm settle +- +-[Install] +-WantedBy=sysinit.target +-Also=udev.service +-Also=udev-retry.service +diff --git a/init/udev-settle.service.in b/init/udev-settle.service.in +new file mode 100644 +index 0000000..d13beae +--- /dev/null ++++ b/init/udev-settle.service.in +@@ -0,0 +1,13 @@ ++[Unit] ++Description=wait until full initialization ++After=udev.service ++ ++[Service] ++Type=finish ++ValidNoProcess=yes ++ExecStart=@sbindir@/udevadm settle ++ ++[Install] ++WantedBy=sysinit.target ++Also=udev.service ++Also=udev-retry.service +diff --git a/init/udev.service b/init/udev.service +deleted file mode 100644 +index f6824a2..0000000 +--- a/init/udev.service ++++ /dev/null +@@ -1,15 +0,0 @@ +-[Unit] +-Description=/dev and kernel device manager +-Before=sysinit.target +- +-[Service] +-Type=notify +-ExecStart=/sbin/udevd +-ExecStartPost=/sbin/udevadm trigger --type=subsystems --action=add +-ExecStartPost=/sbin/udevadm trigger --type=devices --action=add +- +-[Install] +-WantedBy=sysinit.target +-Also=udev-settle.service +-Also=udev-retry.service +- +diff --git a/init/udev.service.in b/init/udev.service.in +new file mode 100644 +index 0000000..a54626d +--- /dev/null ++++ b/init/udev.service.in +@@ -0,0 +1,15 @@ ++[Unit] ++Description=/dev and kernel device manager ++Before=sysinit.target ++ ++[Service] ++Type=notify ++ExecStart=@sbindir@/udevd ++ExecStartPost=@sbindir@/udevadm trigger --type=subsystems --action=add ++ExecStartPost=@sbindir@/udevadm trigger --type=devices --action=add ++ ++[Install] ++WantedBy=sysinit.target ++Also=udev-settle.service ++Also=udev-retry.service ++ +-- +1.7.0.1 + diff --git a/0004-make-fix-make-distcheck.patch b/0004-make-fix-make-distcheck.patch new file mode 100644 index 0000000..91bc78d --- /dev/null +++ b/0004-make-fix-make-distcheck.patch @@ -0,0 +1,27 @@ +From f0565500f499cbc5503edebcacd98f305099df86 Mon Sep 17 00:00:00 2001 +From: Kay Sievers +Date: Fri, 25 Jun 2010 10:42:33 +0200 +Subject: [PATCH 4/6] make: fix 'make distcheck' + udev-159.tar.gz + +--- + Makefile.am | 3 ++- + 1 files changed, 2 insertions(+), 1 deletions(-) + +diff --git a/Makefile.am b/Makefile.am +index 198c06c..8515e14 100644 +--- a/Makefile.am ++++ b/Makefile.am +@@ -21,7 +21,8 @@ AM_LDFLAGS = \ + -Wl,--as-needed + + DISTCHECK_CONFIGURE_FLAGS = \ +- --enable-gtk-doc ++ --enable-gtk-doc \ ++ --with-systemdsystemunitdir=$$dc_install_base/$(systemdsystemunitdir) + + CLEANFILES = + +-- +1.7.0.1 + diff --git a/0005-switch-a-few-left-over-from-GPLv2-to-GPLv2-or-later.patch b/0005-switch-a-few-left-over-from-GPLv2-to-GPLv2-or-later.patch new file mode 100644 index 0000000..0929831 --- /dev/null +++ b/0005-switch-a-few-left-over-from-GPLv2-to-GPLv2-or-later.patch @@ -0,0 +1,296 @@ +From 8b5651bb009bf892b3a5537c5f36b8891f238aa4 Mon Sep 17 00:00:00 2001 +From: Kay Sievers +Date: Fri, 25 Jun 2010 11:39:21 +0200 +Subject: [PATCH 5/6] switch a few left-over from GPLv2 to GPLv2 or later + +--- + extras/edd_id/edd_id.c | 15 +++++++++++-- + extras/floppy/create_floppy_devices.c | 20 ++++++++++++------ + extras/rule_generator/rule_generator.functions | 20 ++++++++++++++++-- + extras/rule_generator/write_cd_rules | 17 ++++++++++++--- + extras/rule_generator/write_net_rules | 25 ++++++++++++++++------- + extras/scsi_id/scsi_id.c | 16 ++++++++++---- + extras/scsi_id/scsi_id.h | 15 +++++++++++-- + extras/scsi_id/scsi_serial.c | 18 ++++++++++++---- + extras/usb_id/usb_id.c | 18 ++++++++++++---- + 9 files changed, 121 insertions(+), 43 deletions(-) + +diff --git a/extras/edd_id/edd_id.c b/extras/edd_id/edd_id.c +index 15295ed..ac4da07 100644 +--- a/extras/edd_id/edd_id.c ++++ b/extras/edd_id/edd_id.c +@@ -4,9 +4,18 @@ + * Copyright (C) 2005 John Hull + * Copyright (C) 2005 Kay Sievers + * +- * This program is free software; you can redistribute it and/or modify it +- * under the terms of the GNU General Public License as published by the +- * Free Software Foundation version 2 of the License. ++ * This program is free software: you can redistribute it and/or modify ++ * it under the terms of the GNU General Public License as published by ++ * the Free Software Foundation, either version 2 of the License, or ++ * (at your option) any later version. ++ * ++ * This program is distributed in the hope that it will be useful, ++ * but WITHOUT ANY WARRANTY; without even the implied warranty of ++ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the ++ * GNU General Public License for more details. ++ * ++ * You should have received a copy of the GNU General Public License ++ * along with this program. If not, see . + */ + + #ifndef _GNU_SOURCE +diff --git a/extras/floppy/create_floppy_devices.c b/extras/floppy/create_floppy_devices.c +index 2fc05cc..47724f8 100644 +--- a/extras/floppy/create_floppy_devices.c ++++ b/extras/floppy/create_floppy_devices.c +@@ -1,17 +1,23 @@ + /* +- * create_floppy_devices +- * + * Create all possible floppy device based on the CMOS type. + * Based upon code from drivers/block/floppy.c + * + * Copyright(C) 2005, SUSE Linux Products GmbH + * +- * Author: +- * Hannes Reinecke ++ * Author: Hannes Reinecke ++ * ++ * This program is free software: you can redistribute it and/or modify ++ * it under the terms of the GNU General Public License as published by ++ * the Free Software Foundation, either version 2 of the License, or ++ * (at your option) any later version. ++ * ++ * This program is distributed in the hope that it will be useful, ++ * but WITHOUT ANY WARRANTY; without even the implied warranty of ++ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the ++ * GNU General Public License for more details. + * +- * This program is free software; you can redistribute it and/or modify it +- * under the terms of the GNU General Public License as published by the +- * Free Software Foundation version 2 of the License. ++ * You should have received a copy of the GNU General Public License ++ * along with this program. If not, see . + */ + + #include +diff --git a/extras/rule_generator/rule_generator.functions b/extras/rule_generator/rule_generator.functions +index b972091..e2060a2 100644 +--- a/extras/rule_generator/rule_generator.functions ++++ b/extras/rule_generator/rule_generator.functions +@@ -1,8 +1,22 @@ + # functions used by the udev rule generator ++ ++# Copyright (C) 2006 Marco d'Itri ++ ++# This program is free software: you can redistribute it and/or modify ++# it under the terms of the GNU General Public License as published by ++# the Free Software Foundation, either version 2 of the License, or ++# (at your option) any later version. ++ ++# This program is distributed in the hope that it will be useful, ++# but WITHOUT ANY WARRANTY; without even the implied warranty of ++# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the ++# GNU General Public License for more details. ++ ++# You should have received a copy of the GNU General Public License ++# along with this program. If not, see . ++ ++PATH='/sbin:/bin' + # +-# This program is free software; you can redistribute it and/or modify it +-# under the terms of the GNU General Public License as published by the +-# Free Software Foundation version 2 of the License. + + PATH='/sbin:/bin' + +diff --git a/extras/rule_generator/write_cd_rules b/extras/rule_generator/write_cd_rules +index 0d16fe6..00382ad 100644 +--- a/extras/rule_generator/write_cd_rules ++++ b/extras/rule_generator/write_cd_rules +@@ -4,12 +4,21 @@ + # + # It adds symlinks for optical drives based on the device class determined + # by cdrom_id and used ID_PATH to identify the device. +-# ++ + # (C) 2006 Marco d'Itri + # +-# This program is free software; you can redistribute it and/or modify it +-# under the terms of the GNU General Public License as published by the +-# Free Software Foundation version 2 of the License. ++# This program is free software: you can redistribute it and/or modify ++# it under the terms of the GNU General Public License as published by ++# the Free Software Foundation, either version 2 of the License, or ++# (at your option) any later version. ++ ++# This program is distributed in the hope that it will be useful, ++# but WITHOUT ANY WARRANTY; without even the implied warranty of ++# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the ++# GNU General Public License for more details. ++ ++# You should have received a copy of the GNU General Public License ++# along with this program. If not, see . + + # debug, if UDEV_LOG= + if [ -n "$UDEV_LOG" ]; then +diff --git a/extras/rule_generator/write_net_rules b/extras/rule_generator/write_net_rules +index cb34675..644fbce 100644 +--- a/extras/rule_generator/write_net_rules ++++ b/extras/rule_generator/write_net_rules +@@ -1,12 +1,5 @@ + #!/bin/sh -e +-# +-# Copyright (C) 2006 Marco d'Itri +-# Copyright (C) 2007 Kay Sievers +-# +-# This program is free software; you can redistribute it and/or modify it +-# under the terms of the GNU General Public License as published by the +-# Free Software Foundation version 2 of the License. +-# ++ + # This script is run to create persistent network device naming rules + # based on properties of the device. + # If the interface needs to be renamed, INTERFACE_NEW= will be printed +@@ -22,6 +15,22 @@ + # INTERFACE_NAME requested name supplied by external tool + # INTERFACE_NEW new interface name returned by rule writer + ++# Copyright (C) 2006 Marco d'Itri ++# Copyright (C) 2007 Kay Sievers ++# ++# This program is free software: you can redistribute it and/or modify ++# it under the terms of the GNU General Public License as published by ++# the Free Software Foundation, either version 2 of the License, or ++# (at your option) any later version. ++# ++# This program is distributed in the hope that it will be useful, ++# but WITHOUT ANY WARRANTY; without even the implied warranty of ++# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the ++# GNU General Public License for more details. ++# ++# You should have received a copy of the GNU General Public License ++# along with this program. If not, see . ++ + # debug, if UDEV_LOG= + if [ -n "$UDEV_LOG" ]; then + if [ "$UDEV_LOG" -ge 7 ]; then +diff --git a/extras/scsi_id/scsi_id.c b/extras/scsi_id/scsi_id.c +index d7dfe3e..3811ea5 100644 +--- a/extras/scsi_id/scsi_id.c ++++ b/extras/scsi_id/scsi_id.c +@@ -2,12 +2,18 @@ + * Copyright (C) IBM Corp. 2003 + * Copyright (C) SUSE Linux Products GmbH, 2006 + * +- * Author: +- * Patrick Mansfield ++ * This program is free software: you can redistribute it and/or modify ++ * it under the terms of the GNU General Public License as published by ++ * the Free Software Foundation, either version 2 of the License, or ++ * (at your option) any later version. + * +- * This program is free software; you can redistribute it and/or modify it +- * under the terms of the GNU General Public License as published by the +- * Free Software Foundation version 2 of the License. ++ * This program is distributed in the hope that it will be useful, ++ * but WITHOUT ANY WARRANTY; without even the implied warranty of ++ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the ++ * GNU General Public License for more details. ++ * ++ * You should have received a copy of the GNU General Public License ++ * along with this program. If not, see . + */ + + #include +diff --git a/extras/scsi_id/scsi_id.h b/extras/scsi_id/scsi_id.h +index ff5b70d..4475eac 100644 +--- a/extras/scsi_id/scsi_id.h ++++ b/extras/scsi_id/scsi_id.h +@@ -1,9 +1,18 @@ + /* + * Copyright (C) IBM Corp. 2003 + * +- * This program is free software; you can redistribute it and/or modify it +- * under the terms of the GNU General Public License as published by the +- * Free Software Foundation version 2 of the License. ++ * This program is free software: you can redistribute it and/or modify ++ * it under the terms of the GNU General Public License as published by ++ * the Free Software Foundation, either version 2 of the License, or ++ * (at your option) any later version. ++ * ++ * This program is distributed in the hope that it will be useful, ++ * but WITHOUT ANY WARRANTY; without even the implied warranty of ++ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the ++ * GNU General Public License for more details. ++ * ++ * You should have received a copy of the GNU General Public License ++ * along with this program. If not, see . + */ + + #define MAX_PATH_LEN 512 +diff --git a/extras/scsi_id/scsi_serial.c b/extras/scsi_id/scsi_serial.c +index 22456b7..dd5e1fd 100644 +--- a/extras/scsi_id/scsi_serial.c ++++ b/extras/scsi_id/scsi_serial.c +@@ -1,12 +1,20 @@ + /* + * Copyright (C) IBM Corp. 2003 + * +- * Author: +- * Patrick Mansfield ++ * Author: Patrick Mansfield + * +- * This program is free software; you can redistribute it and/or modify it +- * under the terms of the GNU General Public License as published by the +- * Free Software Foundation version 2 of the License. ++ * This program is free software: you can redistribute it and/or modify ++ * it under the terms of the GNU General Public License as published by ++ * the Free Software Foundation, either version 2 of the License, or ++ * (at your option) any later version. ++ * ++ * This program is distributed in the hope that it will be useful, ++ * but WITHOUT ANY WARRANTY; without even the implied warranty of ++ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the ++ * GNU General Public License for more details. ++ * ++ * You should have received a copy of the GNU General Public License ++ * along with this program. If not, see . + */ + + #include +diff --git a/extras/usb_id/usb_id.c b/extras/usb_id/usb_id.c +index 42ccddf..fabd092 100644 +--- a/extras/usb_id/usb_id.c ++++ b/extras/usb_id/usb_id.c +@@ -3,12 +3,20 @@ + * + * Copyright (c) 2005 SUSE Linux Products GmbH, Germany + * +- * Author: +- * Hannes Reinecke ++ * Author: Hannes Reinecke + * +- * This program is free software; you can redistribute it and/or modify it +- * under the terms of the GNU General Public License as published by the +- * Free Software Foundation version 2 of the License. ++ * This program is free software: you can redistribute it and/or modify ++ * it under the terms of the GNU General Public License as published by ++ * the Free Software Foundation, either version 2 of the License, or ++ * (at your option) any later version. ++ * ++ * This program is distributed in the hope that it will be useful, ++ * but WITHOUT ANY WARRANTY; without even the implied warranty of ++ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the ++ * GNU General Public License for more details. ++ * ++ * You should have received a copy of the GNU General Public License ++ * along with this program. If not, see . + */ + + #include +-- +1.7.0.1 + diff --git a/0006-path_id-add-handle_scsi_sas.patch b/0006-path_id-add-handle_scsi_sas.patch new file mode 100644 index 0000000..16857cf --- /dev/null +++ b/0006-path_id-add-handle_scsi_sas.patch @@ -0,0 +1,88 @@ +From 3d1b8ed2af6dd8bf3da6983f1bed67afefc5581f Mon Sep 17 00:00:00 2001 +From: Harald Hoyer +Date: Fri, 25 Jun 2010 14:20:41 +0200 +Subject: [PATCH 6/6] path_id: add handle_scsi_sas + +based on code by Jim Garlick. +--- + extras/path_id/path_id.c | 64 +++++++++++++++++++++++++++++++++++++++++++++- + 1 files changed, 63 insertions(+), 1 deletions(-) + +diff --git a/extras/path_id/path_id.c b/extras/path_id/path_id.c +index dcee378..c3d241b 100644 +--- a/extras/path_id/path_id.c ++++ b/extras/path_id/path_id.c +@@ -121,7 +121,69 @@ out: + + static struct udev_device *handle_scsi_sas(struct udev_device *parent, char **path) + { +- return NULL; ++ struct udev *udev = udev_device_get_udev(parent); ++ struct udev_device *end_dev; ++ struct udev_device *sasdev; ++ struct udev_device *phydev; ++ struct udev_device *parent_dev; ++ struct udev_device *child_dev; ++ char syspath[UTIL_PATH_SIZE], *base; ++ char phy_path[UTIL_PATH_SIZE]; ++ const char *end_name, *name, *enc, *bay; ++ const char *port_path; ++ int scsi_host; ++ int num_phys = 8; ++ int i; ++ ++ parent_dev = parent; ++ while (1) { ++ child_dev = parent_dev; ++ parent_dev = udev_device_get_parent(child_dev); ++ if (parent_dev == NULL) ++ return NULL; ++ name = udev_device_get_sysname(parent_dev); ++ if (strstr(name, "end_device-")) { ++ end_dev = parent_dev; ++ end_name = name; ++ } else if (sscanf(name, "host%d", &scsi_host)) { ++ port_path = udev_device_get_syspath(child_dev); ++ break; ++ } ++ } ++ ++ base = strdup(udev_device_get_syspath(end_dev)); ++ if (!base) ++ return NULL; ++ snprintf(syspath, sizeof(syspath), "%s/sas_device/%s", base, end_name); ++ free(base); ++ ++ for (i = 0 ; i < num_phys ; i++) { ++ snprintf(phy_path, sizeof(phy_path), "%s/phy-%d:%d", ++ port_path, scsi_host, i); ++ if (phydev = udev_device_new_from_syspath(udev, phy_path)) { ++ udev_device_unref(phydev); ++ break; ++ } ++ } ++ if (i == num_phys) ++ return NULL; ++ ++ sasdev = udev_device_new_from_syspath(udev, syspath); ++ if (sasdev == NULL) { ++ fprintf(stderr, "unable to access '%s'\n", syspath); ++ return NULL; ++ } ++ enc = udev_device_get_sysattr_value(sasdev, "enclosure_identifier"); ++ bay = udev_device_get_sysattr_value(sasdev, "bay_identifier"); ++ if (bay == NULL) { ++ parent = NULL; ++ goto out; ++ } ++ ++ path_prepend(path, "sas-%s-%s-%s", strrchr(phy_path, '/') + 1, enc ? enc : "unknown", bay); ++out: ++ udev_device_unref(sasdev); ++ return parent; + } + + static struct udev_device *handle_scsi_iscsi(struct udev_device *parent, char **path) +-- +1.7.0.1 + diff --git a/fw_unit_symlinks.sh b/fw_unit_symlinks.sh deleted file mode 100644 index c4cdd6b..0000000 --- a/fw_unit_symlinks.sh +++ /dev/null @@ -1,25 +0,0 @@ -#!/bin/sh - -SYSFS=/sys -NAME=$1 -NUM=$2 - -for i in "${SYSFS}${DEVPATH}/${NAME}.*/specifier_id"; do - if [ ! -f "$i" ]; then - continue - fi - SPECID="`cat $i`" - if [ $((SPECID)) -eq $((0x00609e)) ]; then - echo -n "sbp2-${NUM} " - elif [ $((SPECID)) -eq $((0x00a02d)) ]; then - SWVER="`cat ${i%/specifier_id}/version`" - if [ $((SWVER)) -ge $((0x100)) -a $((SWVER)) -lt $((0x110)) ]; then - echo -n "iidc${NUM} " - elif [ $((SWVER)) -eq $((0x10001)) ]; then - echo -n "avc${NUM} " - elif [ $((SWVER)) -ge $((0x14000)) -a $((SWVER)) -le $((0x14001)) ]; then - echo -n "vendorfw${NUM} " - fi - fi -done -echo diff --git a/start_udev b/start_udev index a6e931c..f8062b6 100755 --- a/start_udev +++ b/start_udev @@ -22,16 +22,14 @@ # # don't use udev if sysfs is not mounted. -sysfs_dir=/sys export TZ=/etc/localtime -[ -d $sysfs_dir/class ] || exit 1 +[ -d /sys/class ] || exit 1 [ -r /proc/mounts ] || exit 1 [ -x /sbin/udevd ] || exit 1 . /etc/init.d/functions -. /etc/sysconfig/udev prog=udev @@ -44,90 +42,18 @@ touch_recursive() { return 0 } -findalias () { - local n - for n in "$1"/* ; do - [ -h "$n" ] && continue - [ -d "$n" ] && { findalias "$n" ; continue; } - [ "${n##*/}" == "modalias" ] && echo $(cat $n) - done -} - -# returns OK if $1 contains $2 -strstr() { - [ "${1#*$2*}" = "$1" ] && return 1 - return 0 -} - -getval() { - what=$1 - shift - for arg; do - if strstr "$arg" "$what="; then - val=${arg#${what}=*} - echo $val - return 0 - fi - done - return 1 -} - -wait_for_queue() { - local timeout=${1:-0} - local ret=0 - if [ $timeout -gt 0 ]; then - /sbin/udevadm settle --timeout=$timeout - else - /sbin/udevadm settle - fi - ret=$? - if [ $ret -ne 0 ]; then - echo -n "Wait timeout. Will continue in the background." - fi - return $ret; -} - -export ACTION=add ret=0 STRING=$"Starting $prog: " # propagate /dev from /sys echo -n "$STRING" -UDEV_OPTS="" -cmdline=$(cat /proc/cmdline) - -if strstr "$cmdline" udevtrace; then - UDEV_OPTS="$UDEV_OPTS --debug-trace" -fi - -if strstr "$cmdline" udevlog; then - UDEV_OPTS="$UDEV_OPTS --debug" - /sbin/udevd -d $UDEV_OPTS 2>/dev/.udev/udev.log -else - /sbin/udevd -d $UDEV_OPTS -fi +/sbin/udevd -d ret=$[$ret + $?] -udevtimeout=$(getval udevtimeout $cmdline) - -if strstr "$cmdline" modprobedebug; then - /sbin/udevadm control --env=MODPROBE_OPTIONS="-s -v -q" - echo - findalias /sys | while read modules ; do - if [ -n "$modules" ]; then - echo "Loading modules for $modules in 5 seconds" - sleep 5 - /sbin/modprobe -a -v -q $modules - wait_for_queue $udevtimeout - fi - done - echo "Triggering Rest" -fi - /sbin/udevadm trigger --type=subsystems --action=add /sbin/udevadm trigger --type=devices --action=add -wait_for_queue $udevtimeout +/sbin/udevadm settle ret=$[$ret + $?] # touch all device files for timezone glitches diff --git a/udev-151-virtio.patch b/udev-151-virtio.patch deleted file mode 100644 index 53bbef6..0000000 --- a/udev-151-virtio.patch +++ /dev/null @@ -1,30 +0,0 @@ -From 764304885705e51ef3eb1d078eed3cf6604c4684 Mon Sep 17 00:00:00 2001 -From: Amit Shah -Date: Fri, 26 Feb 2010 14:02:51 +0530 -Subject: [PATCH] Fix virtio-ports rule to use $attr instead of $ATTR - -Newer udev versions don't understand $ATTR. - -Signed-off-by: Amit Shah ---- - rules/rules.d/50-udev-default.rules | 2 +- - 1 files changed, 1 insertions(+), 1 deletions(-) - -Changed by Harald Hoyer - -diff --git a/rules/rules.d/50-udev-default.rules b/rules/rules.d/50-udev-default.rules -index f8556d1..da1535f 100644 ---- a/rules/rules.d/50-udev-default.rules -+++ b/rules/rules.d/50-udev-default.rules -@@ -18,7 +18,7 @@ KERNEL=="mwave", GROUP="dialout" - KERNEL=="hvc*|hvsi*", GROUP="dialout" - - # virtio serial / console ports --KERNEL=="vport*", SYMLINK+="virtio-ports/$attr{name}" -+KERNEL=="vport*", ATTR{name}=="?*", SYMLINK+="virtio-ports/$attr{name}" - - # mem - KERNEL=="null|zero|full|random|urandom", MODE="0666" --- -1.6.2.5 - diff --git a/udev-156.tar.bz2.sign b/udev-158.tar.bz2.sign similarity index 61% rename from udev-156.tar.bz2.sign rename to udev-158.tar.bz2.sign index 0a620a6..4e3f413 100644 --- a/udev-156.tar.bz2.sign +++ b/udev-158.tar.bz2.sign @@ -2,7 +2,7 @@ Version: GnuPG v1.4.9 (GNU/Linux) Comment: See http://www.kernel.org/signature.html for info -iD8DBQBL+6Y0yGugalF9Dw4RAiXCAJ46yjnuIIL1HVdbEgng81WqFdufFACdGo+0 -nOsBxQEHIdTdXHqoC25Aa/s= -=/xG7 +iD8DBQBMIxfRyGugalF9Dw4RAjKIAKCDl0sXElsnGZRbnHKDc+loyOO3jwCdHeEY +R3NsLuhJGdepccsr1Df6SHg= +=PODk -----END PGP SIGNATURE----- diff --git a/udev.spec b/udev.spec index 272bb00..8c42fc4 100644 --- a/udev.spec +++ b/udev.spec @@ -2,22 +2,25 @@ %define udev_scriptdir /lib/udev %define firmwaredir /lib/firmware -Summary: A userspace implementation of devfs +Summary: A rule-based device node and kernel event manager Name: udev Version: 158 -Release: 1%{?dist} -License: GPLv2 +Release: 2%{?dist} +License: GPLv2+ Group: System Environment/Base Provides: udev-persistent = %{version}-%{release} Obsoletes: udev-persistent < 0:030-5 -Obsoletes: udev-extras < 20090618 -Provides: udev-extras = 20090618-1 Source: ftp://ftp.kernel.org/pub/linux/utils/kernel/hotplug/%{name}-%{version}.tar.bz2 Source1: start_udev -Source3: udev-post.init -Source4: fw_unit_symlinks.sh -Source5: udev.sysconfig +Source2: udev-post.init + +#Patch1: 0001-version-bump.patch +Patch2: 0002-add-systemd-service-files.patch +Patch3: 0003-make-pre-process-and-install-systemd-service-files-w.patch +Patch4: 0004-make-fix-make-distcheck.patch +Patch5: 0005-switch-a-few-left-over-from-GPLv2-to-GPLv2-or-later.patch +Patch6: 0006-path_id-add-handle_scsi_sas.patch ExclusiveOS: Linux URL: http://www.kernel.org/pub/linux/utils/kernel/hotplug/udev.html @@ -26,6 +29,7 @@ Requires(pre): /bin/sh fileutils /sbin/chkconfig /sbin/service Requires(pre): /usr/bin/stat /sbin/pidof Requires(pre): /usr/bin/getent /usr/sbin/groupadd Requires: hwdata +Requires: pkgconfig %ifarch s390 s390x # Require s390utils-base, because it's essential on s390 @@ -47,15 +51,15 @@ Conflicts: kernel < 0:2.6 mkinitrd <= 0:4.1.11-1 initscripts < 7.84 Requires: util-linux-ng >= 2.15.1 Obsoletes: dev <= 0:3.12-1 Provides: dev = 0:3.12-2 -Obsoletes: DeviceKit < 004 -Obsoletes: DeviceKit-devel < 004 -Provides: DeviceKit = 004 DeviceKit-devel = 004 # hid2hci moved to udev Conflicts: bluez < 4.47 %description -The udev package contains an implementation of devfs in -userspace using sysfs and netlink. +udev is a collection of tools and a daemon to manage events received +from the kernel and deal with them in user-space. Primarily this +involves managing permissions, and creating and removing meaningful +symlinks to device nodes in /dev when hardware is discovered or +removed from the system. %package -n libudev Summary: Dynamic library to access udev device information @@ -73,6 +77,7 @@ Summary: Development files for libudev Group: Development/Libraries Requires: udev = %{version}-%{release} Requires: libudev = %{version}-%{release} +Requires: pkgconfig License: LGPLv2+ %description -n libudev-devel @@ -98,6 +103,7 @@ Group: Development/Libraries Requires: libudev-devel >= 142 Provides: libgudev-devel = 20090518 Obsoletes: libgudev-devel <= 20090517 +Requires: pkgconfig License: LGPLv2+ Requires: libgudev1 = %{version}-%{release} @@ -109,6 +115,13 @@ glib-based applications using libudev functionality. %prep %setup -q +#%patch1 -p1 -b .git1 +%patch2 -p1 -b .git2 +%patch3 -p1 -b .git3 +%patch4 -p1 -b .git4 +%patch5 -p1 -b .git5 +%patch6 -p1 -b .git6 + %build libtoolize -f -c %configure --with-selinux --prefix=%{_prefix} --exec-prefix="" \ @@ -155,18 +168,13 @@ mkdir -p $RPM_BUILD_ROOT%{udev_scriptdir}/{,devices,devices/net,devices/pts,devi ln -s /sbin/MAKEDEV $RPM_BUILD_ROOT%{udev_scriptdir}/devices/MAKEDEV -install -m 0755 %{SOURCE4} $RPM_BUILD_ROOT%{udev_scriptdir}/fw_unit_symlinks.sh - mkdir -p $RPM_BUILD_ROOT%{_datadir}/udev install -m 0755 %{SOURCE1} $RPM_BUILD_ROOT/sbin/start_udev mkdir -p -m 0755 $RPM_BUILD_ROOT%{firmwaredir} mkdir -p $RPM_BUILD_ROOT%{_sysconfdir}/rc.d/init.d -install -m 0755 %{SOURCE3} $RPM_BUILD_ROOT%{_sysconfdir}/rc.d/init.d/udev-post - -mkdir -p $RPM_BUILD_ROOT%{_sysconfdir}/sysconfig -install -m 0755 %{SOURCE5} $RPM_BUILD_ROOT%{_sysconfdir}/sysconfig/udev +install -m 0755 %{SOURCE2} $RPM_BUILD_ROOT%{_sysconfdir}/rc.d/init.d/udev-post %preun if [ "$1" -eq 0 -a -f %{_initrddir}/udev ]; then @@ -242,7 +250,6 @@ rm -rf $RPM_BUILD_ROOT %attr(0755,root,root) %{udev_scriptdir}/path_id %attr(0755,root,root) %{udev_scriptdir}/hid2hci %attr(0755,root,root) %{udev_scriptdir}/create_floppy_devices -%attr(0755,root,root) %{udev_scriptdir}/fw_unit_symlinks.sh %attr(0755,root,root) %{udev_scriptdir}/firmware %attr(0644,root,root) %{udev_scriptdir}/rule_generator.functions %attr(0755,root,root) %{udev_scriptdir}/write_cd_rules @@ -280,8 +287,6 @@ rm -rf $RPM_BUILD_ROOT %attr(640,root,disk) %dev(c,7,6) %{udev_scriptdir}/devices/loop6 %attr(640,root,disk) %dev(c,7,7) %{udev_scriptdir}/devices/loop7 -%config(noreplace) %attr(0644,root,root) %{_sysconfdir}/sysconfig/udev - %config(noreplace) %attr(0644,root,root) %{_sysconfdir}/udev/udev.conf %attr(0644,root,root) %{udev_scriptdir}/rules.d/*.rules @@ -302,6 +307,7 @@ rm -rf $RPM_BUILD_ROOT %dir %{udev_scriptdir}/keymaps %{udev_scriptdir}/keymaps/* %attr(0644,root,root) %{_prefix}/lib/ConsoleKit/run-seat.d/udev-acl.ck +%{_datadir}/pkgconfig/udev.pc # Deprecated, but keep the ownership %ghost %dir /var/lib/udev @@ -321,7 +327,6 @@ rm -rf $RPM_BUILD_ROOT %{_includedir}/libudev.h %{_libdir}/libudev.so %{_libdir}/pkgconfig/libudev.pc -%{_datadir}/pkgconfig/udev.pc %{_datadir}/gtk-doc/html/libudev/* %files -n libgudev1 @@ -343,6 +348,10 @@ rm -rf $RPM_BUILD_ROOT %attr(0644,root,root) %{_libdir}/pkgconfig/gudev-1.0* %changelog +* Fri Jun 25 2010 Harald Hoyer 158-2 +- moved udev pkgconfig to base file on authors request +- specfile cleanups + * Thu Jun 24 2010 Harald Hoyer 158-1 - version 158 From 29c9ccefc506a1b50e776dd47e1e07a94bbfef18 Mon Sep 17 00:00:00 2001 From: Harald Hoyer Date: Tue, 13 Jul 2010 19:19:47 +0000 Subject: [PATCH 067/142] - version 160 - add systemd service files - fixed COPYRIGHT files --- .cvsignore | 2 +- 0001-version-bump.patch | 35 --- 0002-add-systemd-service-files.patch | 76 ----- ...-and-install-systemd-service-files-w.patch | 230 -------------- 0004-make-fix-make-distcheck.patch | 27 -- ...ft-over-from-GPLv2-to-GPLv2-or-later.patch | 296 ------------------ 0006-path_id-add-handle_scsi_sas.patch | 88 ------ sources | 2 +- ...-158.tar.bz2.sign => udev-160.tar.bz2.sign | 6 +- udev-post.init | 1 - udev.spec | 44 +-- udev.sysconfig | 4 - 12 files changed, 29 insertions(+), 782 deletions(-) delete mode 100644 0001-version-bump.patch delete mode 100644 0002-add-systemd-service-files.patch delete mode 100644 0003-make-pre-process-and-install-systemd-service-files-w.patch delete mode 100644 0004-make-fix-make-distcheck.patch delete mode 100644 0005-switch-a-few-left-over-from-GPLv2-to-GPLv2-or-later.patch delete mode 100644 0006-path_id-add-handle_scsi_sas.patch rename udev-158.tar.bz2.sign => udev-160.tar.bz2.sign (61%) delete mode 100644 udev.sysconfig diff --git a/.cvsignore b/.cvsignore index f62c5e6..22be2f6 100644 --- a/.cvsignore +++ b/.cvsignore @@ -1 +1 @@ -udev-158.tar.bz2 +udev-160.tar.bz2 diff --git a/0001-version-bump.patch b/0001-version-bump.patch deleted file mode 100644 index 4917fbd..0000000 --- a/0001-version-bump.patch +++ /dev/null @@ -1,35 +0,0 @@ -From cbcb846a4c9c9b8215a3f484d70e3cefde5ba226 Mon Sep 17 00:00:00 2001 -From: Kay Sievers -Date: Thu, 24 Jun 2010 10:17:15 +0200 -Subject: [PATCH 1/6] version bump - ---- - NEWS | 4 ++++ - configure.ac | 2 +- - 2 files changed, 5 insertions(+), 1 deletions(-) - -diff --git a/NEWS b/NEWS -index 002ecba..88dc34d 100644 ---- a/NEWS -+++ b/NEWS -@@ -1,3 +1,7 @@ -+udev 159 -+======== -+Bugfixes. -+ - udev 158 - ======== - Bugfixes. -diff --git a/configure.ac b/configure.ac -index 7e9b1f8..4bac653 100644 ---- a/configure.ac -+++ b/configure.ac -@@ -1,4 +1,4 @@ --AC_INIT([udev], [158], [linux-hotplug@vger.kernel.org]) -+AC_INIT([udev], [159], [linux-hotplug@vger.kernel.org]) - AC_PREREQ(2.60) - AM_INIT_AUTOMAKE([check-news foreign 1.10 dist-bzip2 subdir-objects]) - m4_ifdef([AM_SILENT_RULES], [AM_SILENT_RULES([yes])]) --- -1.7.0.1 - diff --git a/0002-add-systemd-service-files.patch b/0002-add-systemd-service-files.patch deleted file mode 100644 index dc6ea1a..0000000 --- a/0002-add-systemd-service-files.patch +++ /dev/null @@ -1,76 +0,0 @@ -From 43fefbf6f1c528947a77643582bcc34cf3538b2d Mon Sep 17 00:00:00 2001 -From: Kay Sievers -Date: Fri, 25 Jun 2010 01:31:57 +0200 -Subject: [PATCH 2/6] add systemd service files - ---- - init/udev-retry.service | 13 +++++++++++++ - init/udev-settle.service | 13 +++++++++++++ - init/udev.service | 15 +++++++++++++++ - 3 files changed, 41 insertions(+), 0 deletions(-) - create mode 100644 init/udev-retry.service - create mode 100644 init/udev-settle.service - create mode 100644 init/udev.service - -diff --git a/init/udev-retry.service b/init/udev-retry.service -new file mode 100644 -index 0000000..0792875 ---- /dev/null -+++ b/init/udev-retry.service -@@ -0,0 +1,13 @@ -+[Unit] -+Description=re-trigger failed events after filesystems are available -+After=local-fs.target -+ -+[Service] -+Type=finish -+ValidNoProcess=yes -+ExecStart=/sbin/udevadm trigger --type=failed -+ -+[Install] -+WantedBy=sysinit.target -+Also=udev.service -+Also=udev-settle.service -diff --git a/init/udev-settle.service b/init/udev-settle.service -new file mode 100644 -index 0000000..3c73a96 ---- /dev/null -+++ b/init/udev-settle.service -@@ -0,0 +1,13 @@ -+[Unit] -+Description=wait until full initialization -+After=udev.service -+ -+[Service] -+Type=finish -+ValidNoProcess=yes -+ExecStart=/sbin/udevadm settle -+ -+[Install] -+WantedBy=sysinit.target -+Also=udev.service -+Also=udev-retry.service -diff --git a/init/udev.service b/init/udev.service -new file mode 100644 -index 0000000..f6824a2 ---- /dev/null -+++ b/init/udev.service -@@ -0,0 +1,15 @@ -+[Unit] -+Description=/dev and kernel device manager -+Before=sysinit.target -+ -+[Service] -+Type=notify -+ExecStart=/sbin/udevd -+ExecStartPost=/sbin/udevadm trigger --type=subsystems --action=add -+ExecStartPost=/sbin/udevadm trigger --type=devices --action=add -+ -+[Install] -+WantedBy=sysinit.target -+Also=udev-settle.service -+Also=udev-retry.service -+ --- -1.7.0.1 - diff --git a/0003-make-pre-process-and-install-systemd-service-files-w.patch b/0003-make-pre-process-and-install-systemd-service-files-w.patch deleted file mode 100644 index b7c9383..0000000 --- a/0003-make-pre-process-and-install-systemd-service-files-w.patch +++ /dev/null @@ -1,230 +0,0 @@ -From 08b4c88353b48302ae94088b55b2066ad01c63f8 Mon Sep 17 00:00:00 2001 -From: Kay Sievers -Date: Fri, 25 Jun 2010 10:30:55 +0200 -Subject: [PATCH 3/6] make: pre-process and install systemd service files when needed - ---- - Makefile.am | 7 +++++++ - configure.ac | 16 +++++++++++++--- - extras/mtd_probe/.gitignore | 1 + - init/.gitignore | 1 + - init/udev-retry.service | 13 ------------- - init/udev-retry.service.in | 13 +++++++++++++ - init/udev-settle.service | 13 ------------- - init/udev-settle.service.in | 13 +++++++++++++ - init/udev.service | 15 --------------- - init/udev.service.in | 15 +++++++++++++++ - 10 files changed, 63 insertions(+), 44 deletions(-) - create mode 100644 extras/mtd_probe/.gitignore - create mode 100644 init/.gitignore - delete mode 100644 init/udev-retry.service - create mode 100644 init/udev-retry.service.in - delete mode 100644 init/udev-settle.service - create mode 100644 init/udev-settle.service.in - delete mode 100644 init/udev.service - create mode 100644 init/udev.service.in - -diff --git a/Makefile.am b/Makefile.am -index 1916770..198c06c 100644 ---- a/Makefile.am -+++ b/Makefile.am -@@ -114,6 +114,13 @@ dist_udevconf_DATA = udev.conf - sharepkgconfigdir = $(datadir)/pkgconfig - sharepkgconfig_DATA = udev/udev.pc - -+if WITH_SYSTEMD -+systemdsystemunit_DATA = \ -+ init/udev.service \ -+ init/udev-settle.service \ -+ init/udev-retry.service -+endif -+ - sbin_PROGRAMS = \ - udev/udevd \ - udev/udevadm -diff --git a/configure.ac b/configure.ac -index 4bac653..255ee18 100644 ---- a/configure.ac -+++ b/configure.ac -@@ -49,8 +49,7 @@ fi - AC_ARG_WITH(firmware-path, - AS_HELP_STRING([--with-firmware-path=DIR[[[:DIR[...]]]]], - [Firmware search path (default=/lib/firmware/updates:/lib/firmware)]), -- [], [with_firmware_path="/lib/firmware/updates:/lib/firmware"] -- ) -+ [], [with_firmware_path="/lib/firmware/updates:/lib/firmware"]) - OLD_IFS=$IFS - IFS=: - for i in $with_firmware_path -@@ -64,6 +63,12 @@ done - IFS=$OLD_IFS - AC_SUBST([FIRMWARE_PATH], [$FIRMWARE_PATH]) - -+AC_ARG_WITH([systemdsystemunitdir], -+ AS_HELP_STRING([--with-systemdsystemunitdir=DIR], [Directory for systemd service files]), -+ [], [with_systemdsystemunitdir=$($PKG_CONFIG --variable=systemdsystemunitdir systemd)]) -+AC_SUBST([systemdsystemunitdir], [$with_systemdsystemunitdir]) -+AM_CONDITIONAL(WITH_SYSTEMD, [test -n "$with_systemdsystemunitdir"]) -+ - AC_ARG_ENABLE([extras], - AS_HELP_STRING([--disable-extras], [disable extras with external dependencies]), - [], [enable_extras=yes]) -@@ -126,10 +131,13 @@ AM_CONDITIONAL([ENABLE_INTROSPECTION], [test "x$enable_introspection" = xyes]) - AC_CONFIG_HEADERS(config.h) - AC_CONFIG_FILES([ - Makefile -+ udev/udev.pc -+ init/udev.service -+ init/udev-settle.service -+ init/udev-retry.service - libudev/libudev.pc - libudev/docs/Makefile - libudev/docs/version.xml -- udev/udev.pc - extras/gudev/gudev-1.0.pc - extras/gudev/docs/Makefile - extras/gudev/docs/version.xml -@@ -153,6 +161,8 @@ AC_MSG_RESULT([ - - include_prefix: ${INCLUDE_PREFIX} - -+ systemdsystemunitdir: ${systemdsystemunitdir} -+ - logging: ${enable_logging} - debug: ${enable_debug} - selinux: ${with_selinux} -diff --git a/extras/mtd_probe/.gitignore b/extras/mtd_probe/.gitignore -new file mode 100644 -index 0000000..82b8ab5 ---- /dev/null -+++ b/extras/mtd_probe/.gitignore -@@ -0,0 +1 @@ -+mtd_probe -diff --git a/init/.gitignore b/init/.gitignore -new file mode 100644 -index 0000000..904e445 ---- /dev/null -+++ b/init/.gitignore -@@ -0,0 +1 @@ -+udev*.service -diff --git a/init/udev-retry.service b/init/udev-retry.service -deleted file mode 100644 -index 0792875..0000000 ---- a/init/udev-retry.service -+++ /dev/null -@@ -1,13 +0,0 @@ --[Unit] --Description=re-trigger failed events after filesystems are available --After=local-fs.target -- --[Service] --Type=finish --ValidNoProcess=yes --ExecStart=/sbin/udevadm trigger --type=failed -- --[Install] --WantedBy=sysinit.target --Also=udev.service --Also=udev-settle.service -diff --git a/init/udev-retry.service.in b/init/udev-retry.service.in -new file mode 100644 -index 0000000..b7d5320 ---- /dev/null -+++ b/init/udev-retry.service.in -@@ -0,0 +1,13 @@ -+[Unit] -+Description=re-trigger failed events after filesystems are available -+After=local-fs.target -+ -+[Service] -+Type=finish -+ValidNoProcess=yes -+ExecStart=@sbindir@/udevadm trigger --type=failed -+ -+[Install] -+WantedBy=sysinit.target -+Also=udev.service -+Also=udev-settle.service -diff --git a/init/udev-settle.service b/init/udev-settle.service -deleted file mode 100644 -index 3c73a96..0000000 ---- a/init/udev-settle.service -+++ /dev/null -@@ -1,13 +0,0 @@ --[Unit] --Description=wait until full initialization --After=udev.service -- --[Service] --Type=finish --ValidNoProcess=yes --ExecStart=/sbin/udevadm settle -- --[Install] --WantedBy=sysinit.target --Also=udev.service --Also=udev-retry.service -diff --git a/init/udev-settle.service.in b/init/udev-settle.service.in -new file mode 100644 -index 0000000..d13beae ---- /dev/null -+++ b/init/udev-settle.service.in -@@ -0,0 +1,13 @@ -+[Unit] -+Description=wait until full initialization -+After=udev.service -+ -+[Service] -+Type=finish -+ValidNoProcess=yes -+ExecStart=@sbindir@/udevadm settle -+ -+[Install] -+WantedBy=sysinit.target -+Also=udev.service -+Also=udev-retry.service -diff --git a/init/udev.service b/init/udev.service -deleted file mode 100644 -index f6824a2..0000000 ---- a/init/udev.service -+++ /dev/null -@@ -1,15 +0,0 @@ --[Unit] --Description=/dev and kernel device manager --Before=sysinit.target -- --[Service] --Type=notify --ExecStart=/sbin/udevd --ExecStartPost=/sbin/udevadm trigger --type=subsystems --action=add --ExecStartPost=/sbin/udevadm trigger --type=devices --action=add -- --[Install] --WantedBy=sysinit.target --Also=udev-settle.service --Also=udev-retry.service -- -diff --git a/init/udev.service.in b/init/udev.service.in -new file mode 100644 -index 0000000..a54626d ---- /dev/null -+++ b/init/udev.service.in -@@ -0,0 +1,15 @@ -+[Unit] -+Description=/dev and kernel device manager -+Before=sysinit.target -+ -+[Service] -+Type=notify -+ExecStart=@sbindir@/udevd -+ExecStartPost=@sbindir@/udevadm trigger --type=subsystems --action=add -+ExecStartPost=@sbindir@/udevadm trigger --type=devices --action=add -+ -+[Install] -+WantedBy=sysinit.target -+Also=udev-settle.service -+Also=udev-retry.service -+ --- -1.7.0.1 - diff --git a/0004-make-fix-make-distcheck.patch b/0004-make-fix-make-distcheck.patch deleted file mode 100644 index 91bc78d..0000000 --- a/0004-make-fix-make-distcheck.patch +++ /dev/null @@ -1,27 +0,0 @@ -From f0565500f499cbc5503edebcacd98f305099df86 Mon Sep 17 00:00:00 2001 -From: Kay Sievers -Date: Fri, 25 Jun 2010 10:42:33 +0200 -Subject: [PATCH 4/6] make: fix 'make distcheck' - udev-159.tar.gz - ---- - Makefile.am | 3 ++- - 1 files changed, 2 insertions(+), 1 deletions(-) - -diff --git a/Makefile.am b/Makefile.am -index 198c06c..8515e14 100644 ---- a/Makefile.am -+++ b/Makefile.am -@@ -21,7 +21,8 @@ AM_LDFLAGS = \ - -Wl,--as-needed - - DISTCHECK_CONFIGURE_FLAGS = \ -- --enable-gtk-doc -+ --enable-gtk-doc \ -+ --with-systemdsystemunitdir=$$dc_install_base/$(systemdsystemunitdir) - - CLEANFILES = - --- -1.7.0.1 - diff --git a/0005-switch-a-few-left-over-from-GPLv2-to-GPLv2-or-later.patch b/0005-switch-a-few-left-over-from-GPLv2-to-GPLv2-or-later.patch deleted file mode 100644 index 0929831..0000000 --- a/0005-switch-a-few-left-over-from-GPLv2-to-GPLv2-or-later.patch +++ /dev/null @@ -1,296 +0,0 @@ -From 8b5651bb009bf892b3a5537c5f36b8891f238aa4 Mon Sep 17 00:00:00 2001 -From: Kay Sievers -Date: Fri, 25 Jun 2010 11:39:21 +0200 -Subject: [PATCH 5/6] switch a few left-over from GPLv2 to GPLv2 or later - ---- - extras/edd_id/edd_id.c | 15 +++++++++++-- - extras/floppy/create_floppy_devices.c | 20 ++++++++++++------ - extras/rule_generator/rule_generator.functions | 20 ++++++++++++++++-- - extras/rule_generator/write_cd_rules | 17 ++++++++++++--- - extras/rule_generator/write_net_rules | 25 ++++++++++++++++------- - extras/scsi_id/scsi_id.c | 16 ++++++++++---- - extras/scsi_id/scsi_id.h | 15 +++++++++++-- - extras/scsi_id/scsi_serial.c | 18 ++++++++++++---- - extras/usb_id/usb_id.c | 18 ++++++++++++---- - 9 files changed, 121 insertions(+), 43 deletions(-) - -diff --git a/extras/edd_id/edd_id.c b/extras/edd_id/edd_id.c -index 15295ed..ac4da07 100644 ---- a/extras/edd_id/edd_id.c -+++ b/extras/edd_id/edd_id.c -@@ -4,9 +4,18 @@ - * Copyright (C) 2005 John Hull - * Copyright (C) 2005 Kay Sievers - * -- * This program is free software; you can redistribute it and/or modify it -- * under the terms of the GNU General Public License as published by the -- * Free Software Foundation version 2 of the License. -+ * This program is free software: you can redistribute it and/or modify -+ * it under the terms of the GNU General Public License as published by -+ * the Free Software Foundation, either version 2 of the License, or -+ * (at your option) any later version. -+ * -+ * This program is distributed in the hope that it will be useful, -+ * but WITHOUT ANY WARRANTY; without even the implied warranty of -+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -+ * GNU General Public License for more details. -+ * -+ * You should have received a copy of the GNU General Public License -+ * along with this program. If not, see . - */ - - #ifndef _GNU_SOURCE -diff --git a/extras/floppy/create_floppy_devices.c b/extras/floppy/create_floppy_devices.c -index 2fc05cc..47724f8 100644 ---- a/extras/floppy/create_floppy_devices.c -+++ b/extras/floppy/create_floppy_devices.c -@@ -1,17 +1,23 @@ - /* -- * create_floppy_devices -- * - * Create all possible floppy device based on the CMOS type. - * Based upon code from drivers/block/floppy.c - * - * Copyright(C) 2005, SUSE Linux Products GmbH - * -- * Author: -- * Hannes Reinecke -+ * Author: Hannes Reinecke -+ * -+ * This program is free software: you can redistribute it and/or modify -+ * it under the terms of the GNU General Public License as published by -+ * the Free Software Foundation, either version 2 of the License, or -+ * (at your option) any later version. -+ * -+ * This program is distributed in the hope that it will be useful, -+ * but WITHOUT ANY WARRANTY; without even the implied warranty of -+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -+ * GNU General Public License for more details. - * -- * This program is free software; you can redistribute it and/or modify it -- * under the terms of the GNU General Public License as published by the -- * Free Software Foundation version 2 of the License. -+ * You should have received a copy of the GNU General Public License -+ * along with this program. If not, see . - */ - - #include -diff --git a/extras/rule_generator/rule_generator.functions b/extras/rule_generator/rule_generator.functions -index b972091..e2060a2 100644 ---- a/extras/rule_generator/rule_generator.functions -+++ b/extras/rule_generator/rule_generator.functions -@@ -1,8 +1,22 @@ - # functions used by the udev rule generator -+ -+# Copyright (C) 2006 Marco d'Itri -+ -+# This program is free software: you can redistribute it and/or modify -+# it under the terms of the GNU General Public License as published by -+# the Free Software Foundation, either version 2 of the License, or -+# (at your option) any later version. -+ -+# This program is distributed in the hope that it will be useful, -+# but WITHOUT ANY WARRANTY; without even the implied warranty of -+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -+# GNU General Public License for more details. -+ -+# You should have received a copy of the GNU General Public License -+# along with this program. If not, see . -+ -+PATH='/sbin:/bin' - # --# This program is free software; you can redistribute it and/or modify it --# under the terms of the GNU General Public License as published by the --# Free Software Foundation version 2 of the License. - - PATH='/sbin:/bin' - -diff --git a/extras/rule_generator/write_cd_rules b/extras/rule_generator/write_cd_rules -index 0d16fe6..00382ad 100644 ---- a/extras/rule_generator/write_cd_rules -+++ b/extras/rule_generator/write_cd_rules -@@ -4,12 +4,21 @@ - # - # It adds symlinks for optical drives based on the device class determined - # by cdrom_id and used ID_PATH to identify the device. --# -+ - # (C) 2006 Marco d'Itri - # --# This program is free software; you can redistribute it and/or modify it --# under the terms of the GNU General Public License as published by the --# Free Software Foundation version 2 of the License. -+# This program is free software: you can redistribute it and/or modify -+# it under the terms of the GNU General Public License as published by -+# the Free Software Foundation, either version 2 of the License, or -+# (at your option) any later version. -+ -+# This program is distributed in the hope that it will be useful, -+# but WITHOUT ANY WARRANTY; without even the implied warranty of -+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -+# GNU General Public License for more details. -+ -+# You should have received a copy of the GNU General Public License -+# along with this program. If not, see . - - # debug, if UDEV_LOG= - if [ -n "$UDEV_LOG" ]; then -diff --git a/extras/rule_generator/write_net_rules b/extras/rule_generator/write_net_rules -index cb34675..644fbce 100644 ---- a/extras/rule_generator/write_net_rules -+++ b/extras/rule_generator/write_net_rules -@@ -1,12 +1,5 @@ - #!/bin/sh -e --# --# Copyright (C) 2006 Marco d'Itri --# Copyright (C) 2007 Kay Sievers --# --# This program is free software; you can redistribute it and/or modify it --# under the terms of the GNU General Public License as published by the --# Free Software Foundation version 2 of the License. --# -+ - # This script is run to create persistent network device naming rules - # based on properties of the device. - # If the interface needs to be renamed, INTERFACE_NEW= will be printed -@@ -22,6 +15,22 @@ - # INTERFACE_NAME requested name supplied by external tool - # INTERFACE_NEW new interface name returned by rule writer - -+# Copyright (C) 2006 Marco d'Itri -+# Copyright (C) 2007 Kay Sievers -+# -+# This program is free software: you can redistribute it and/or modify -+# it under the terms of the GNU General Public License as published by -+# the Free Software Foundation, either version 2 of the License, or -+# (at your option) any later version. -+# -+# This program is distributed in the hope that it will be useful, -+# but WITHOUT ANY WARRANTY; without even the implied warranty of -+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -+# GNU General Public License for more details. -+# -+# You should have received a copy of the GNU General Public License -+# along with this program. If not, see . -+ - # debug, if UDEV_LOG= - if [ -n "$UDEV_LOG" ]; then - if [ "$UDEV_LOG" -ge 7 ]; then -diff --git a/extras/scsi_id/scsi_id.c b/extras/scsi_id/scsi_id.c -index d7dfe3e..3811ea5 100644 ---- a/extras/scsi_id/scsi_id.c -+++ b/extras/scsi_id/scsi_id.c -@@ -2,12 +2,18 @@ - * Copyright (C) IBM Corp. 2003 - * Copyright (C) SUSE Linux Products GmbH, 2006 - * -- * Author: -- * Patrick Mansfield -+ * This program is free software: you can redistribute it and/or modify -+ * it under the terms of the GNU General Public License as published by -+ * the Free Software Foundation, either version 2 of the License, or -+ * (at your option) any later version. - * -- * This program is free software; you can redistribute it and/or modify it -- * under the terms of the GNU General Public License as published by the -- * Free Software Foundation version 2 of the License. -+ * This program is distributed in the hope that it will be useful, -+ * but WITHOUT ANY WARRANTY; without even the implied warranty of -+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -+ * GNU General Public License for more details. -+ * -+ * You should have received a copy of the GNU General Public License -+ * along with this program. If not, see . - */ - - #include -diff --git a/extras/scsi_id/scsi_id.h b/extras/scsi_id/scsi_id.h -index ff5b70d..4475eac 100644 ---- a/extras/scsi_id/scsi_id.h -+++ b/extras/scsi_id/scsi_id.h -@@ -1,9 +1,18 @@ - /* - * Copyright (C) IBM Corp. 2003 - * -- * This program is free software; you can redistribute it and/or modify it -- * under the terms of the GNU General Public License as published by the -- * Free Software Foundation version 2 of the License. -+ * This program is free software: you can redistribute it and/or modify -+ * it under the terms of the GNU General Public License as published by -+ * the Free Software Foundation, either version 2 of the License, or -+ * (at your option) any later version. -+ * -+ * This program is distributed in the hope that it will be useful, -+ * but WITHOUT ANY WARRANTY; without even the implied warranty of -+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -+ * GNU General Public License for more details. -+ * -+ * You should have received a copy of the GNU General Public License -+ * along with this program. If not, see . - */ - - #define MAX_PATH_LEN 512 -diff --git a/extras/scsi_id/scsi_serial.c b/extras/scsi_id/scsi_serial.c -index 22456b7..dd5e1fd 100644 ---- a/extras/scsi_id/scsi_serial.c -+++ b/extras/scsi_id/scsi_serial.c -@@ -1,12 +1,20 @@ - /* - * Copyright (C) IBM Corp. 2003 - * -- * Author: -- * Patrick Mansfield -+ * Author: Patrick Mansfield - * -- * This program is free software; you can redistribute it and/or modify it -- * under the terms of the GNU General Public License as published by the -- * Free Software Foundation version 2 of the License. -+ * This program is free software: you can redistribute it and/or modify -+ * it under the terms of the GNU General Public License as published by -+ * the Free Software Foundation, either version 2 of the License, or -+ * (at your option) any later version. -+ * -+ * This program is distributed in the hope that it will be useful, -+ * but WITHOUT ANY WARRANTY; without even the implied warranty of -+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -+ * GNU General Public License for more details. -+ * -+ * You should have received a copy of the GNU General Public License -+ * along with this program. If not, see . - */ - - #include -diff --git a/extras/usb_id/usb_id.c b/extras/usb_id/usb_id.c -index 42ccddf..fabd092 100644 ---- a/extras/usb_id/usb_id.c -+++ b/extras/usb_id/usb_id.c -@@ -3,12 +3,20 @@ - * - * Copyright (c) 2005 SUSE Linux Products GmbH, Germany - * -- * Author: -- * Hannes Reinecke -+ * Author: Hannes Reinecke - * -- * This program is free software; you can redistribute it and/or modify it -- * under the terms of the GNU General Public License as published by the -- * Free Software Foundation version 2 of the License. -+ * This program is free software: you can redistribute it and/or modify -+ * it under the terms of the GNU General Public License as published by -+ * the Free Software Foundation, either version 2 of the License, or -+ * (at your option) any later version. -+ * -+ * This program is distributed in the hope that it will be useful, -+ * but WITHOUT ANY WARRANTY; without even the implied warranty of -+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -+ * GNU General Public License for more details. -+ * -+ * You should have received a copy of the GNU General Public License -+ * along with this program. If not, see . - */ - - #include --- -1.7.0.1 - diff --git a/0006-path_id-add-handle_scsi_sas.patch b/0006-path_id-add-handle_scsi_sas.patch deleted file mode 100644 index 16857cf..0000000 --- a/0006-path_id-add-handle_scsi_sas.patch +++ /dev/null @@ -1,88 +0,0 @@ -From 3d1b8ed2af6dd8bf3da6983f1bed67afefc5581f Mon Sep 17 00:00:00 2001 -From: Harald Hoyer -Date: Fri, 25 Jun 2010 14:20:41 +0200 -Subject: [PATCH 6/6] path_id: add handle_scsi_sas - -based on code by Jim Garlick. ---- - extras/path_id/path_id.c | 64 +++++++++++++++++++++++++++++++++++++++++++++- - 1 files changed, 63 insertions(+), 1 deletions(-) - -diff --git a/extras/path_id/path_id.c b/extras/path_id/path_id.c -index dcee378..c3d241b 100644 ---- a/extras/path_id/path_id.c -+++ b/extras/path_id/path_id.c -@@ -121,7 +121,69 @@ out: - - static struct udev_device *handle_scsi_sas(struct udev_device *parent, char **path) - { -- return NULL; -+ struct udev *udev = udev_device_get_udev(parent); -+ struct udev_device *end_dev; -+ struct udev_device *sasdev; -+ struct udev_device *phydev; -+ struct udev_device *parent_dev; -+ struct udev_device *child_dev; -+ char syspath[UTIL_PATH_SIZE], *base; -+ char phy_path[UTIL_PATH_SIZE]; -+ const char *end_name, *name, *enc, *bay; -+ const char *port_path; -+ int scsi_host; -+ int num_phys = 8; -+ int i; -+ -+ parent_dev = parent; -+ while (1) { -+ child_dev = parent_dev; -+ parent_dev = udev_device_get_parent(child_dev); -+ if (parent_dev == NULL) -+ return NULL; -+ name = udev_device_get_sysname(parent_dev); -+ if (strstr(name, "end_device-")) { -+ end_dev = parent_dev; -+ end_name = name; -+ } else if (sscanf(name, "host%d", &scsi_host)) { -+ port_path = udev_device_get_syspath(child_dev); -+ break; -+ } -+ } -+ -+ base = strdup(udev_device_get_syspath(end_dev)); -+ if (!base) -+ return NULL; -+ snprintf(syspath, sizeof(syspath), "%s/sas_device/%s", base, end_name); -+ free(base); -+ -+ for (i = 0 ; i < num_phys ; i++) { -+ snprintf(phy_path, sizeof(phy_path), "%s/phy-%d:%d", -+ port_path, scsi_host, i); -+ if (phydev = udev_device_new_from_syspath(udev, phy_path)) { -+ udev_device_unref(phydev); -+ break; -+ } -+ } -+ if (i == num_phys) -+ return NULL; -+ -+ sasdev = udev_device_new_from_syspath(udev, syspath); -+ if (sasdev == NULL) { -+ fprintf(stderr, "unable to access '%s'\n", syspath); -+ return NULL; -+ } -+ enc = udev_device_get_sysattr_value(sasdev, "enclosure_identifier"); -+ bay = udev_device_get_sysattr_value(sasdev, "bay_identifier"); -+ if (bay == NULL) { -+ parent = NULL; -+ goto out; -+ } -+ -+ path_prepend(path, "sas-%s-%s-%s", strrchr(phy_path, '/') + 1, enc ? enc : "unknown", bay); -+out: -+ udev_device_unref(sasdev); -+ return parent; - } - - static struct udev_device *handle_scsi_iscsi(struct udev_device *parent, char **path) --- -1.7.0.1 - diff --git a/sources b/sources index a75a271..c193652 100644 --- a/sources +++ b/sources @@ -1 +1 @@ -26f99dde11f8e393d659614d7d1a3964 udev-158.tar.bz2 +65459a1f090082c0471bf4e5112208d7 udev-160.tar.bz2 diff --git a/udev-158.tar.bz2.sign b/udev-160.tar.bz2.sign similarity index 61% rename from udev-158.tar.bz2.sign rename to udev-160.tar.bz2.sign index 4e3f413..f5465a6 100644 --- a/udev-158.tar.bz2.sign +++ b/udev-160.tar.bz2.sign @@ -2,7 +2,7 @@ Version: GnuPG v1.4.9 (GNU/Linux) Comment: See http://www.kernel.org/signature.html for info -iD8DBQBMIxfRyGugalF9Dw4RAjKIAKCDl0sXElsnGZRbnHKDc+loyOO3jwCdHeEY -R3NsLuhJGdepccsr1Df6SHg= -=PODk +iD8DBQBMOkG1yGugalF9Dw4RAjB0AJ9ftRX/zmCiRcSyQWhcWJXsnXDn3gCeMFbR +KdR80Jxmitbil01dFfPzwEE= +=8B8M -----END PGP SIGNATURE----- diff --git a/udev-post.init b/udev-post.init index 903f686..f882e0d 100644 --- a/udev-post.init +++ b/udev-post.init @@ -18,7 +18,6 @@ ### END INIT INFO . /etc/rc.d/init.d/functions -. /etc/sysconfig/udev # See how we were called. case "$1" in diff --git a/udev.spec b/udev.spec index 8c42fc4..50c715c 100644 --- a/udev.spec +++ b/udev.spec @@ -4,8 +4,8 @@ Summary: A rule-based device node and kernel event manager Name: udev -Version: 158 -Release: 2%{?dist} +Version: 160 +Release: 1%{?dist} License: GPLv2+ Group: System Environment/Base Provides: udev-persistent = %{version}-%{release} @@ -15,13 +15,6 @@ Source: ftp://ftp.kernel.org/pub/linux/utils/kernel/hotplug/%{name}-%{version}.t Source1: start_udev Source2: udev-post.init -#Patch1: 0001-version-bump.patch -Patch2: 0002-add-systemd-service-files.patch -Patch3: 0003-make-pre-process-and-install-systemd-service-files-w.patch -Patch4: 0004-make-fix-make-distcheck.patch -Patch5: 0005-switch-a-few-left-over-from-GPLv2-to-GPLv2-or-later.patch -Patch6: 0006-path_id-add-handle_scsi_sas.patch - ExclusiveOS: Linux URL: http://www.kernel.org/pub/linux/utils/kernel/hotplug/udev.html BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n) @@ -30,6 +23,8 @@ Requires(pre): /usr/bin/stat /sbin/pidof Requires(pre): /usr/bin/getent /usr/sbin/groupadd Requires: hwdata Requires: pkgconfig +Requires: systemd-units +Conflicts: systemd < 3 %ifarch s390 s390x # Require s390utils-base, because it's essential on s390 @@ -46,6 +41,9 @@ BuildRequires: gobject-introspection-devel >= 0.6.2 BuildRequires: gtk-doc BuildRequires: usbutils >= 0.82 BuildRequires: libtool >= 2.2.6 +BuildRequires: systemd-units +BuildRequires: systemd +BuildRequires: pkgconfig Requires: libselinux >= 0:1.17.9-2 sed Conflicts: kernel < 0:2.6 mkinitrd <= 0:4.1.11-1 initscripts < 7.84 Requires: util-linux-ng >= 2.15.1 @@ -115,19 +113,13 @@ glib-based applications using libudev functionality. %prep %setup -q -#%patch1 -p1 -b .git1 -%patch2 -p1 -b .git2 -%patch3 -p1 -b .git3 -%patch4 -p1 -b .git4 -%patch5 -p1 -b .git5 -%patch6 -p1 -b .git6 - %build libtoolize -f -c %configure --with-selinux --prefix=%{_prefix} --exec-prefix="" \ --sysconfdir=%{_sysconfdir} \ --sbindir="/sbin" --libexecdir=%{udev_scriptdir} \ - --with-rootlibdir=/%{_lib} --enable-introspection + --with-rootlibdir=/%{_lib} \ + --enable-introspection make %{?_smp_mflags} @@ -188,6 +180,7 @@ if [ "$1" -eq 0 -a -f %{_initrddir}/udev ]; then fi if [ "$1" -eq 0 ]; then /sbin/chkconfig --del udev-post + /usr/bin/systemd-install --system --start disable udev.service >/dev/null 2>&1 || : fi exit 0 @@ -223,6 +216,7 @@ if test -f /proc/1/exe -a -d /proc/1/root; then fi fi /sbin/chkconfig --add udev-post +/usr/bin/systemd-install --system --start enable udev.service >/dev/null 2>&1 || : exit 0 @@ -240,7 +234,6 @@ rm -rf $RPM_BUILD_ROOT %doc NEWS COPYING README TODO ChangeLog extras/keymap/README.keymap.txt %attr(0755,root,root) /sbin/udevadm %attr(0755,root,root) /sbin/udevd -%attr(0755,root,root) /sbin/start_udev %attr(0755,root,root) /sbin/scsi_id %attr(0755,root,root) %{udev_scriptdir}/scsi_id %attr(0755,root,root) %{udev_scriptdir}/ata_id @@ -309,6 +302,12 @@ rm -rf $RPM_BUILD_ROOT %attr(0644,root,root) %{_prefix}/lib/ConsoleKit/run-seat.d/udev-acl.ck %{_datadir}/pkgconfig/udev.pc +%attr(0755,root,root) /sbin/start_udev +%define systemdsystemunitdir %(/usr/bin/pkg-config --variable=systemdsystemunitdir systemd) +%attr(0644,root,root) %{systemdsystemunitdir}/udev-retry.service +%attr(0644,root,root) %{systemdsystemunitdir}/udev-settle.service +%attr(0644,root,root) %{systemdsystemunitdir}/udev.service + # Deprecated, but keep the ownership %ghost %dir /var/lib/udev %ghost %dir %{_sysconfdir}/udev/scripts/ @@ -323,7 +322,7 @@ rm -rf $RPM_BUILD_ROOT %files -n libudev-devel %defattr(0644, root, root, 0755) -%doc libudev/COPYING libudev/docs/html/* +%doc libudev/docs/html/* %{_includedir}/libudev.h %{_libdir}/libudev.so %{_libdir}/pkgconfig/libudev.pc @@ -337,7 +336,7 @@ rm -rf $RPM_BUILD_ROOT %files -n libgudev1-devel %defattr(0644, root, root, 0755) -%doc extras/gudev/COPYING extras/gudev/docs/html/* +%doc extras/gudev/docs/html/* %attr(0755,root,root) %{_libdir}/libgudev-1.0.so %dir %attr(0755,root,root) %{_includedir}/gudev-1.0 %dir %attr(0755,root,root) %{_includedir}/gudev-1.0/gudev @@ -348,6 +347,11 @@ rm -rf $RPM_BUILD_ROOT %attr(0644,root,root) %{_libdir}/pkgconfig/gudev-1.0* %changelog +* Tue Jul 13 2010 Harald Hoyer 160-1 +- version 160 +- add systemd service files +- fixed COPYRIGHT files + * Fri Jun 25 2010 Harald Hoyer 158-2 - moved udev pkgconfig to base file on authors request - specfile cleanups diff --git a/udev.sysconfig b/udev.sysconfig deleted file mode 100644 index 9a58d98..0000000 --- a/udev.sysconfig +++ /dev/null @@ -1,4 +0,0 @@ -# If set to "yes", generates cache shell files of what MAKEDEV would do. -# May speedup some systems with slow disks. -# EXPERIMENTAL - use at your own risk -UDEV_USE_MAKEDEV_CACHE="no" From bc17ac23b4362f5ee33068161b3d75deea696214 Mon Sep 17 00:00:00 2001 From: Lennart Poettering Date: Tue, 13 Jul 2010 19:40:37 +0000 Subject: [PATCH 068/142] Don't require systemd .pc file --- udev.spec | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/udev.spec b/udev.spec index 50c715c..bb68cb9 100644 --- a/udev.spec +++ b/udev.spec @@ -5,7 +5,7 @@ Summary: A rule-based device node and kernel event manager Name: udev Version: 160 -Release: 1%{?dist} +Release: 2%{?dist} License: GPLv2+ Group: System Environment/Base Provides: udev-persistent = %{version}-%{release} @@ -22,7 +22,6 @@ Requires(pre): /bin/sh fileutils /sbin/chkconfig /sbin/service Requires(pre): /usr/bin/stat /sbin/pidof Requires(pre): /usr/bin/getent /usr/sbin/groupadd Requires: hwdata -Requires: pkgconfig Requires: systemd-units Conflicts: systemd < 3 @@ -119,7 +118,8 @@ libtoolize -f -c --sysconfdir=%{_sysconfdir} \ --sbindir="/sbin" --libexecdir=%{udev_scriptdir} \ --with-rootlibdir=/%{_lib} \ - --enable-introspection + --enable-introspection \ + --with-systemdsystemunitdir=/lib/systemd/system make %{?_smp_mflags} @@ -303,7 +303,7 @@ rm -rf $RPM_BUILD_ROOT %{_datadir}/pkgconfig/udev.pc %attr(0755,root,root) /sbin/start_udev -%define systemdsystemunitdir %(/usr/bin/pkg-config --variable=systemdsystemunitdir systemd) +%define systemdsystemunitdir %(/lib/systemd/system) %attr(0644,root,root) %{systemdsystemunitdir}/udev-retry.service %attr(0644,root,root) %{systemdsystemunitdir}/udev-settle.service %attr(0644,root,root) %{systemdsystemunitdir}/udev.service @@ -347,6 +347,9 @@ rm -rf $RPM_BUILD_ROOT %attr(0644,root,root) %{_libdir}/pkgconfig/gudev-1.0* %changelog +* Tue Jul 13 2010 Lennart Poettering - 160-2 +- Don't require systemd .pc file, to break build dependency cycle + * Tue Jul 13 2010 Harald Hoyer 160-1 - version 160 - add systemd service files From ef9ccbd582aa31c14c4b27c1bcf456a756b83ca8 Mon Sep 17 00:00:00 2001 From: Lennart Poettering Date: Tue, 13 Jul 2010 19:41:07 +0000 Subject: [PATCH 069/142] fix my email address --- udev.spec | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/udev.spec b/udev.spec index bb68cb9..743ee61 100644 --- a/udev.spec +++ b/udev.spec @@ -347,7 +347,7 @@ rm -rf $RPM_BUILD_ROOT %attr(0644,root,root) %{_libdir}/pkgconfig/gudev-1.0* %changelog -* Tue Jul 13 2010 Lennart Poettering - 160-2 +* Tue Jul 13 2010 Lennart Poettering - 160-2 - Don't require systemd .pc file, to break build dependency cycle * Tue Jul 13 2010 Harald Hoyer 160-1 From 8e5a749a3e94d6c8087d73fbe6f225b752c56dd8 Mon Sep 17 00:00:00 2001 From: Lennart Poettering Date: Tue, 13 Jul 2010 19:54:32 +0000 Subject: [PATCH 070/142] Update systemd-install lines to use --realize instead of --start (which got renamed in systemd) --- udev.spec | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/udev.spec b/udev.spec index 743ee61..9b70948 100644 --- a/udev.spec +++ b/udev.spec @@ -5,7 +5,7 @@ Summary: A rule-based device node and kernel event manager Name: udev Version: 160 -Release: 2%{?dist} +Release: 3%{?dist} License: GPLv2+ Group: System Environment/Base Provides: udev-persistent = %{version}-%{release} @@ -23,6 +23,7 @@ Requires(pre): /usr/bin/stat /sbin/pidof Requires(pre): /usr/bin/getent /usr/sbin/groupadd Requires: hwdata Requires: systemd-units +Requires: pkgconfig Conflicts: systemd < 3 %ifarch s390 s390x @@ -40,8 +41,6 @@ BuildRequires: gobject-introspection-devel >= 0.6.2 BuildRequires: gtk-doc BuildRequires: usbutils >= 0.82 BuildRequires: libtool >= 2.2.6 -BuildRequires: systemd-units -BuildRequires: systemd BuildRequires: pkgconfig Requires: libselinux >= 0:1.17.9-2 sed Conflicts: kernel < 0:2.6 mkinitrd <= 0:4.1.11-1 initscripts < 7.84 @@ -180,7 +179,7 @@ if [ "$1" -eq 0 -a -f %{_initrddir}/udev ]; then fi if [ "$1" -eq 0 ]; then /sbin/chkconfig --del udev-post - /usr/bin/systemd-install --system --start disable udev.service >/dev/null 2>&1 || : + /usr/bin/systemd-install --system --realize disable udev.service >/dev/null 2>&1 || : fi exit 0 @@ -216,7 +215,7 @@ if test -f /proc/1/exe -a -d /proc/1/root; then fi fi /sbin/chkconfig --add udev-post -/usr/bin/systemd-install --system --start enable udev.service >/dev/null 2>&1 || : +/usr/bin/systemd-install --system --realize=minimal enable udev.service >/dev/null 2>&1 || : exit 0 @@ -303,7 +302,7 @@ rm -rf $RPM_BUILD_ROOT %{_datadir}/pkgconfig/udev.pc %attr(0755,root,root) /sbin/start_udev -%define systemdsystemunitdir %(/lib/systemd/system) +%define systemdsystemunitdir /lib/systemd/system %attr(0644,root,root) %{systemdsystemunitdir}/udev-retry.service %attr(0644,root,root) %{systemdsystemunitdir}/udev-settle.service %attr(0644,root,root) %{systemdsystemunitdir}/udev.service @@ -347,6 +346,9 @@ rm -rf $RPM_BUILD_ROOT %attr(0644,root,root) %{_libdir}/pkgconfig/gudev-1.0* %changelog +* Tue Jul 13 2010 Lennart Poettering - 160-3 +- Update systemd-install lines to use --realize instead of --start (which got renamed in systemd) + * Tue Jul 13 2010 Lennart Poettering - 160-2 - Don't require systemd .pc file, to break build dependency cycle From 1fbe74e970a5928df6a0102c8aa2af57add96c64 Mon Sep 17 00:00:00 2001 From: Lennart Poettering Date: Tue, 13 Jul 2010 20:07:15 +0000 Subject: [PATCH 071/142] Comment systemd-install for now as long as sysinit is not split into pieces --- udev.spec | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/udev.spec b/udev.spec index 9b70948..6827f89 100644 --- a/udev.spec +++ b/udev.spec @@ -5,7 +5,7 @@ Summary: A rule-based device node and kernel event manager Name: udev Version: 160 -Release: 3%{?dist} +Release: 4%{?dist} License: GPLv2+ Group: System Environment/Base Provides: udev-persistent = %{version}-%{release} @@ -179,7 +179,7 @@ if [ "$1" -eq 0 -a -f %{_initrddir}/udev ]; then fi if [ "$1" -eq 0 ]; then /sbin/chkconfig --del udev-post - /usr/bin/systemd-install --system --realize disable udev.service >/dev/null 2>&1 || : +# /usr/bin/systemd-install --system --realize disable udev.service >/dev/null 2>&1 || : fi exit 0 @@ -215,7 +215,7 @@ if test -f /proc/1/exe -a -d /proc/1/root; then fi fi /sbin/chkconfig --add udev-post -/usr/bin/systemd-install --system --realize=minimal enable udev.service >/dev/null 2>&1 || : +#/usr/bin/systemd-install --system --realize=minimal enable udev.service >/dev/null 2>&1 || : exit 0 @@ -346,6 +346,9 @@ rm -rf $RPM_BUILD_ROOT %attr(0644,root,root) %{_libdir}/pkgconfig/gudev-1.0* %changelog +* Tue Jul 13 2010 Lennart Poettering - 160-4 +- Comment systemd-install for now as long as sysinit is not split into pieces + * Tue Jul 13 2010 Lennart Poettering - 160-3 - Update systemd-install lines to use --realize instead of --start (which got renamed in systemd) From 120363a3883ef85db017318c2d7c0bc5488a3020 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Dan=20Hor=C3=A1k?= Date: Wed, 14 Jul 2010 08:39:36 +0000 Subject: [PATCH 072/142] - update paths to arch-specific rules --- udev.spec | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/udev.spec b/udev.spec index 6827f89..910ca87 100644 --- a/udev.spec +++ b/udev.spec @@ -5,7 +5,7 @@ Summary: A rule-based device node and kernel event manager Name: udev Version: 160 -Release: 4%{?dist} +Release: 5%{?dist} License: GPLv2+ Group: System Environment/Base Provides: udev-persistent = %{version}-%{release} @@ -143,13 +143,13 @@ ln -sf ..%{udev_scriptdir}/scsi_id $RPM_BUILD_ROOT/sbin/scsi_id for i in \ %ifarch ia64 - rules/packages/40-ia64.rules \ + rules/arch/40-ia64.rules \ %endif %ifarch ppc ppc64 - rules/packages/40-ppc.rules \ + rules/arch/40-ppc.rules \ %endif %ifarch s390 s390x - rules/packages/40-s390.rules \ + rules/arch/40-s390.rules \ %endif ; do install -m 0644 "$i" "$RPM_BUILD_ROOT%{udev_scriptdir}/rules.d/${i##*/}" @@ -346,6 +346,9 @@ rm -rf $RPM_BUILD_ROOT %attr(0644,root,root) %{_libdir}/pkgconfig/gudev-1.0* %changelog +* Wed Jul 14 2010 Dan Horák 160-5 +- update paths to arch-specific rules + * Tue Jul 13 2010 Lennart Poettering - 160-4 - Comment systemd-install for now as long as sysinit is not split into pieces From 2576ac70df20cdcd71b395d1768cbf073fa0e743 Mon Sep 17 00:00:00 2001 From: Harald Hoyer Date: Thu, 15 Jul 2010 06:32:02 +0000 Subject: [PATCH 073/142] - add versioned requires for libudev to udev --- udev.spec | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/udev.spec b/udev.spec index 910ca87..0d67082 100644 --- a/udev.spec +++ b/udev.spec @@ -2,10 +2,12 @@ %define udev_scriptdir /lib/udev %define firmwaredir /lib/firmware +%define systemdsystemunitdir /lib/systemd/system + Summary: A rule-based device node and kernel event manager Name: udev Version: 160 -Release: 5%{?dist} +Release: 6%{?dist} License: GPLv2+ Group: System Environment/Base Provides: udev-persistent = %{version}-%{release} @@ -49,6 +51,7 @@ Obsoletes: dev <= 0:3.12-1 Provides: dev = 0:3.12-2 # hid2hci moved to udev Conflicts: bluez < 4.47 +Requires: libudev = %{version}-%{release} %description udev is a collection of tools and a daemon to manage events received @@ -118,7 +121,7 @@ libtoolize -f -c --sbindir="/sbin" --libexecdir=%{udev_scriptdir} \ --with-rootlibdir=/%{_lib} \ --enable-introspection \ - --with-systemdsystemunitdir=/lib/systemd/system + --with-systemdsystemunitdir=%{systemdsystemunitdir} make %{?_smp_mflags} @@ -302,7 +305,6 @@ rm -rf $RPM_BUILD_ROOT %{_datadir}/pkgconfig/udev.pc %attr(0755,root,root) /sbin/start_udev -%define systemdsystemunitdir /lib/systemd/system %attr(0644,root,root) %{systemdsystemunitdir}/udev-retry.service %attr(0644,root,root) %{systemdsystemunitdir}/udev-settle.service %attr(0644,root,root) %{systemdsystemunitdir}/udev.service @@ -346,6 +348,9 @@ rm -rf $RPM_BUILD_ROOT %attr(0644,root,root) %{_libdir}/pkgconfig/gudev-1.0* %changelog +* Thu Jul 15 2010 Harald Hoyer 160-6 +- add versioned requires for libudev to udev + * Wed Jul 14 2010 Dan Horák 160-5 - update paths to arch-specific rules From 48e3b21647f6c0819753878eebed8ccac4f8e971 Mon Sep 17 00:00:00 2001 From: Harald Hoyer Date: Tue, 20 Jul 2010 11:31:27 +0000 Subject: [PATCH 074/142] - turn off hotplug in /sys/kernel/uevent_helper or /proc/sys/kernel/hotplug --- start_udev | 9 +++++++++ udev.spec | 5 ++++- 2 files changed, 13 insertions(+), 1 deletion(-) diff --git a/start_udev b/start_udev index f8062b6..49fc286 100755 --- a/start_udev +++ b/start_udev @@ -47,6 +47,15 @@ STRING=$"Starting $prog: " # propagate /dev from /sys echo -n "$STRING" +# turn off hotplug binary calling +if ! [ -x /sbin/hotplug ]; then + if [ -e /sys/kernel/uevent_helper ]; then + echo -e '\000\000\000\000' > /sys/kernel/uevent_helper + elif [ -e /proc/sys/kernel/hotplug ]; then + echo -e '\000\000\000\000' > /proc/sys/kernel/hotplug + fi +fi + /sbin/udevd -d ret=$[$ret + $?] diff --git a/udev.spec b/udev.spec index 0d67082..bdd1507 100644 --- a/udev.spec +++ b/udev.spec @@ -7,7 +7,7 @@ Summary: A rule-based device node and kernel event manager Name: udev Version: 160 -Release: 6%{?dist} +Release: 7%{?dist} License: GPLv2+ Group: System Environment/Base Provides: udev-persistent = %{version}-%{release} @@ -348,6 +348,9 @@ rm -rf $RPM_BUILD_ROOT %attr(0644,root,root) %{_libdir}/pkgconfig/gudev-1.0* %changelog +* Tue Jul 20 2010 Harald Hoyer 160-7 +- turn off hotplug in /sys/kernel/uevent_helper or /proc/sys/kernel/hotplug + * Thu Jul 15 2010 Harald Hoyer 160-6 - add versioned requires for libudev to udev From 9c03079ed4a1bc22c78fa540872cb7b719d04490 Mon Sep 17 00:00:00 2001 From: Harald Hoyer Date: Tue, 20 Jul 2010 13:21:05 +0000 Subject: [PATCH 075/142] - make loop block device again --- udev.spec | 21 ++++++++++++--------- 1 file changed, 12 insertions(+), 9 deletions(-) diff --git a/udev.spec b/udev.spec index bdd1507..37d0082 100644 --- a/udev.spec +++ b/udev.spec @@ -7,7 +7,7 @@ Summary: A rule-based device node and kernel event manager Name: udev Version: 160 -Release: 7%{?dist} +Release: 8%{?dist} License: GPLv2+ Group: System Environment/Base Provides: udev-persistent = %{version}-%{release} @@ -273,14 +273,14 @@ rm -rf $RPM_BUILD_ROOT %attr(660,root,lp) %dev(c,6,1) %{udev_scriptdir}/devices/lp1 %attr(660,root,lp) %dev(c,6,2) %{udev_scriptdir}/devices/lp2 %attr(660,root,lp) %dev(c,6,3) %{udev_scriptdir}/devices/lp3 -%attr(640,root,disk) %dev(c,7,0) %{udev_scriptdir}/devices/loop0 -%attr(640,root,disk) %dev(c,7,1) %{udev_scriptdir}/devices/loop1 -%attr(640,root,disk) %dev(c,7,2) %{udev_scriptdir}/devices/loop2 -%attr(640,root,disk) %dev(c,7,3) %{udev_scriptdir}/devices/loop3 -%attr(640,root,disk) %dev(c,7,4) %{udev_scriptdir}/devices/loop4 -%attr(640,root,disk) %dev(c,7,5) %{udev_scriptdir}/devices/loop5 -%attr(640,root,disk) %dev(c,7,6) %{udev_scriptdir}/devices/loop6 -%attr(640,root,disk) %dev(c,7,7) %{udev_scriptdir}/devices/loop7 +%attr(640,root,disk) %dev(b,7,0) %{udev_scriptdir}/devices/loop0 +%attr(640,root,disk) %dev(b,7,1) %{udev_scriptdir}/devices/loop1 +%attr(640,root,disk) %dev(b,7,2) %{udev_scriptdir}/devices/loop2 +%attr(640,root,disk) %dev(b,7,3) %{udev_scriptdir}/devices/loop3 +%attr(640,root,disk) %dev(b,7,4) %{udev_scriptdir}/devices/loop4 +%attr(640,root,disk) %dev(b,7,5) %{udev_scriptdir}/devices/loop5 +%attr(640,root,disk) %dev(b,7,6) %{udev_scriptdir}/devices/loop6 +%attr(640,root,disk) %dev(b,7,7) %{udev_scriptdir}/devices/loop7 %config(noreplace) %attr(0644,root,root) %{_sysconfdir}/udev/udev.conf %attr(0644,root,root) %{udev_scriptdir}/rules.d/*.rules @@ -348,6 +348,9 @@ rm -rf $RPM_BUILD_ROOT %attr(0644,root,root) %{_libdir}/pkgconfig/gudev-1.0* %changelog +* Tue Jul 20 2010 Harald Hoyer 160-8 +- make loop block device again + * Tue Jul 20 2010 Harald Hoyer 160-7 - turn off hotplug in /sys/kernel/uevent_helper or /proc/sys/kernel/hotplug From cd22a06c9a7e17455469443eeb847899b9b5e4fc Mon Sep 17 00:00:00 2001 From: Fedora Release Engineering Date: Thu, 29 Jul 2010 14:38:21 +0000 Subject: [PATCH 076/142] dist-git conversion --- .cvsignore => .gitignore | 0 Makefile | 22 ---------------------- 2 files changed, 22 deletions(-) rename .cvsignore => .gitignore (100%) delete mode 100644 Makefile diff --git a/.cvsignore b/.gitignore similarity index 100% rename from .cvsignore rename to .gitignore diff --git a/Makefile b/Makefile deleted file mode 100644 index c72f44b..0000000 --- a/Makefile +++ /dev/null @@ -1,22 +0,0 @@ -# Makefile for source rpm: udev -# $Id: Makefile,v 1.3 2007/10/15 19:29:11 notting Exp $ -NAME := udev -SPECFILE = $(firstword $(wildcard *.spec)) -UPSTREAM_CHECKS = sign - -define find-makefile-common -for d in common ../common ../../common ; do if [ -f $$d/Makefile.common ] ; then if [ -f $$d/CVS/Root -a -w $$d/Makefile.common ] ; then cd $$d ; cvs -Q update ; fi ; echo "$$d/Makefile.common" ; break ; fi ; done -endef - -MAKEFILE_COMMON := $(shell $(find-makefile-common)) - -ifeq ($(MAKEFILE_COMMON),) -# attempt a checkout -define checkout-makefile-common -test -f CVS/Root && { cvs -Q -d $$(cat CVS/Root) checkout common && echo "common/Makefile.common" ; } || { echo "ERROR: I can't figure out how to checkout the 'common' module." ; exit -1 ; } >&2 -endef - -MAKEFILE_COMMON := $(shell $(checkout-makefile-common)) -endif - -include $(MAKEFILE_COMMON) From d2cb40f302ec24942f7d6d72801e80b7e0be983a Mon Sep 17 00:00:00 2001 From: Harald Hoyer Date: Tue, 17 Aug 2010 11:45:34 +0200 Subject: [PATCH 077/142] - udev-161 with an upstream quirk for the qemu cdrom and more cdrom handling bugfixes Resolves: rhbz#609049 rhbz#624286 - added floppy group Resolves: rhbz#620814 --- sources | 3 ++- udev.spec | 19 +++++++++++++++++-- 2 files changed, 19 insertions(+), 3 deletions(-) diff --git a/sources b/sources index c193652..f53200e 100644 --- a/sources +++ b/sources @@ -1 +1,2 @@ -65459a1f090082c0471bf4e5112208d7 udev-160.tar.bz2 +2f42aff9f8c7258fecde71df321032b7 udev-161.tar.bz2.sign +95b6a0ffc9913f3e8021c65f51eb4f88 udev-161.tar.bz2 diff --git a/udev.spec b/udev.spec index 37d0082..8b8febb 100644 --- a/udev.spec +++ b/udev.spec @@ -6,8 +6,8 @@ Summary: A rule-based device node and kernel event manager Name: udev -Version: 160 -Release: 8%{?dist} +Version: 161 +Release: 1%{?dist} License: GPLv2+ Group: System Environment/Base Provides: udev-persistent = %{version}-%{release} @@ -190,6 +190,7 @@ exit 0 getent group cdrom >/dev/null || /usr/sbin/groupadd -g 11 cdrom || : getent group tape >/dev/null || /usr/sbin/groupadd -g 33 tape || : getent group dialout >/dev/null || /usr/sbin/groupadd -g 18 dialout || : +getent group floppy >/dev/null || /usr/sbin/groupadd -g 19 floppy || : # kill daemon if we are not in a chroot if test -f /proc/1/exe -a -d /proc/1/root; then @@ -348,6 +349,20 @@ rm -rf $RPM_BUILD_ROOT %attr(0644,root,root) %{_libdir}/pkgconfig/gudev-1.0* %changelog +* Tue Aug 17 2010 Harald Hoyer 161-1 +- udev-161 with an upstream quirk for the qemu cdrom and + more cdrom handling bugfixes +Resolves: rhbz#609049 rhbz#624286 +- added floppy group +Resolves: rhbz#620814 + +* Fri Aug 06 2010 Harald Hoyer 160-9 +- added quirk to cdrom_id, to boot from qemu +Resolves: rhbz#609049 +- fix console switching and ACLs +Resolves: rhbz#608712 +- minor bugfixes + * Tue Jul 20 2010 Harald Hoyer 160-8 - make loop block device again From b11538a6c787f92b59f88c73b52069d4bf4f1fe8 Mon Sep 17 00:00:00 2001 From: Harald Hoyer Date: Wed, 1 Sep 2010 11:26:01 +0200 Subject: [PATCH 078/142] - bugfixes for systemd service files - bugfix for selinux labeling - bugfixes for cdrom_id --- ...-cdrom_id-Add-media-status-debugging.patch | 26 ++++++++ ...-Add-keymap-for-Lenovo-IdeaPad-S10-3.patch | 56 +++++++++++++++++ ...rop-MEDIA_SESSION_NEXT-for-DVD-RW-RO.patch | 34 ++++++++++ 0004-init-update-systemd-service-files.patch | 42 +++++++++++++ 0005-init-update-systemd-service-files.patch | 38 +++++++++++ ...mistake-all-SCSI-processor-devices-f.patch | 33 ++++++++++ ...-description-in-systemd-service-file.patch | 47 ++++++++++++++ 0008-udevd-add-pid-to-kmsg-logs.patch | 41 ++++++++++++ ...it-edit-systemd-service-descriptions.patch | 47 ++++++++++++++ ...-required-extension-and-remove-some-.patch | 42 +++++++++++++ 0012-keymap-Add-Onkyo-PC.patch | 63 +++++++++++++++++++ 0013-keymap-Add-HP-G60.patch | 26 ++++++++ ...eeded-credential-passing-from-init_n.patch | 58 +++++++++++++++++ 0015-Add-support-for-oom_score_adj.patch | 48 ++++++++++++++ 0016-keymap-Fix-Sony-VAIO-VGN-SZ2HP-B.patch | 28 +++++++++ ...ev-7-manpage-Fix-description-of-attr.patch | 32 ++++++++++ ...ix-crash-if-netlink-is-not-available.patch | 57 +++++++++++++++++ 0019-keymap-Fix-Acer-TravelMate-4720.patch | 28 +++++++++ ...-cdrom_id-Fix-DVD-RW-media-detection.patch | 53 ++++++++++++++++ ...-blank-detection-for-sloppy-firmware.patch | 42 +++++++++++++ ...text-on-add-but-not-on-change-events.patch | 35 +++++++++++ ...rsistent-name-rules-for-KVM-network-.patch | 28 +++++++++ udev.spec | 52 ++++++++++++++- 23 files changed, 955 insertions(+), 1 deletion(-) create mode 100644 0001-cdrom_id-Add-media-status-debugging.patch create mode 100644 0002-Add-keymap-for-Lenovo-IdeaPad-S10-3.patch create mode 100644 0003-cdrom_id-Drop-MEDIA_SESSION_NEXT-for-DVD-RW-RO.patch create mode 100644 0004-init-update-systemd-service-files.patch create mode 100644 0005-init-update-systemd-service-files.patch create mode 100644 0006-udev-acl-do-not-mistake-all-SCSI-processor-devices-f.patch create mode 100644 0007-init-add-udev-to-description-in-systemd-service-file.patch create mode 100644 0008-udevd-add-pid-to-kmsg-logs.patch create mode 100644 0009-init-edit-systemd-service-descriptions.patch create mode 100644 0011-udev-7-Point-out-required-extension-and-remove-some-.patch create mode 100644 0012-keymap-Add-Onkyo-PC.patch create mode 100644 0013-keymap-Add-HP-G60.patch create mode 100644 0014-udevd-remove-unneeded-credential-passing-from-init_n.patch create mode 100644 0015-Add-support-for-oom_score_adj.patch create mode 100644 0016-keymap-Fix-Sony-VAIO-VGN-SZ2HP-B.patch create mode 100644 0017-udev-7-manpage-Fix-description-of-attr.patch create mode 100644 0018-gudev-fix-crash-if-netlink-is-not-available.patch create mode 100644 0019-keymap-Fix-Acer-TravelMate-4720.patch create mode 100644 0020-cdrom_id-Fix-DVD-RW-media-detection.patch create mode 100644 0021-cdrom_id-Fix-DVD-blank-detection-for-sloppy-firmware.patch create mode 100644 0022-set-SELinux-context-on-add-but-not-on-change-events.patch create mode 100644 0023-do-not-create-persistent-name-rules-for-KVM-network-.patch diff --git a/0001-cdrom_id-Add-media-status-debugging.patch b/0001-cdrom_id-Add-media-status-debugging.patch new file mode 100644 index 0000000..f282114 --- /dev/null +++ b/0001-cdrom_id-Add-media-status-debugging.patch @@ -0,0 +1,26 @@ +From 24af530a543c70ac59fdd244377d648ef77a0e21 Mon Sep 17 00:00:00 2001 +From: Martin Pitt +Date: Thu, 12 Aug 2010 07:10:12 +0200 +Subject: [PATCH 01/23] cdrom_id: Add media status debugging + +Show which media status the hardware originally reports, since we mangle it in +some cases. +--- + extras/cdrom_id/cdrom_id.c | 1 + + 1 files changed, 1 insertions(+), 0 deletions(-) + +diff --git a/extras/cdrom_id/cdrom_id.c b/extras/cdrom_id/cdrom_id.c +index 83e95d5..d59991c 100644 +--- a/extras/cdrom_id/cdrom_id.c ++++ b/extras/cdrom_id/cdrom_id.c +@@ -573,6 +573,7 @@ static int cd_media_info(struct udev *udev, int fd) + + cd_media = 1; + info(udev, "disk type %02x\n", header[8]); ++ info(udev, "hardware reported media status: %s\n", media_status[header[2] & 3]); + + /* exclude plain CDROM, some fake cdroms return 0 for "blank" media here */ + if (!cd_media_cd_rom) +-- +1.7.2.2 + diff --git a/0002-Add-keymap-for-Lenovo-IdeaPad-S10-3.patch b/0002-Add-keymap-for-Lenovo-IdeaPad-S10-3.patch new file mode 100644 index 0000000..486c148 --- /dev/null +++ b/0002-Add-keymap-for-Lenovo-IdeaPad-S10-3.patch @@ -0,0 +1,56 @@ +From 9cd075e35b8f660c75b0d72d4bea496fd6459f29 Mon Sep 17 00:00:00 2001 +From: David Woodhouse +Date: Thu, 12 Aug 2010 17:04:55 +0100 +Subject: [PATCH 02/23] Add keymap for Lenovo IdeaPad S10-3 + +Tested on S10-3, but presumably applicable to all IdeaPads. + +Signed-off-by: Martin Pitt +--- + Makefile.am | 1 + + extras/keymap/95-keymap.rules | 2 ++ + extras/keymap/keymaps/lenovo-ideapad | 7 +++++++ + 3 files changed, 10 insertions(+), 0 deletions(-) + create mode 100644 extras/keymap/keymaps/lenovo-ideapad + +diff --git a/Makefile.am b/Makefile.am +index c16b259..77df6ab 100644 +--- a/Makefile.am ++++ b/Makefile.am +@@ -537,6 +537,7 @@ dist_udevkeymap_DATA = \ + extras/keymap/keymaps/ibm-thinkpad-usb-keyboard-trackpoint \ + extras/keymap/keymaps/inventec-symphony_6.0_7.0 \ + extras/keymap/keymaps/lenovo-3000 \ ++ extras/keymap/keymaps/lenovo-ideapad \ + extras/keymap/keymaps/lenovo-thinkpad-usb-keyboard-trackpoint \ + extras/keymap/keymaps/lenovo-thinkpad_x6_tablet \ + extras/keymap/keymaps/lenovo-thinkpad_x200_tablet \ +diff --git a/extras/keymap/95-keymap.rules b/extras/keymap/95-keymap.rules +index 13b5571..2241422 100644 +--- a/extras/keymap/95-keymap.rules ++++ b/extras/keymap/95-keymap.rules +@@ -65,6 +65,8 @@ ENV{DMI_VENDOR}=="Compaq*", ATTR{[dmi/id]product_name}=="*E500*|*Evo N*", RUN+=" + ENV{DMI_VENDOR}=="LENOVO*", ATTR{[dmi/id]product_version}=="*3000*", RUN+="keymap $name lenovo-3000" + ENV{DMI_VENDOR}=="LENOVO*", ATTR{[dmi/id]product_version}=="ThinkPad X6*", ATTR{[dmi/id]product_version}=="* Tablet" RUN+="keymap $name lenovo-thinkpad_x6_tablet" + ENV{DMI_VENDOR}=="LENOVO*", ATTR{[dmi/id]product_version}=="ThinkPad X200 Tablet*", ATTR{[dmi/id]product_version}=="* Tablet" RUN+="keymap $name lenovo-thinkpad_x200_tablet" ++ENV{DMI_VENDOR}=="LENOVO*", ATTR{[dmi/id]product_version}=="*IdeaPad*", RUN+="keymap $name lenovo-ideapad" ++ENV{DMI_VENDOR}=="LENOVO*", ATTR{[dmi/id]product_name}=="S10-*", RUN+="keymap $name lenovo-ideapad" + + ENV{DMI_VENDOR}=="Hewlett-Packard*", RUN+="keymap $name hewlett-packard" + ENV{DMI_VENDOR}=="Hewlett-Packard*", ATTR{[dmi/id]product_name}=="*[tT][aA][bB][lL][eE][tT]*", RUN+="keymap $name hewlett-packard-tablet" +diff --git a/extras/keymap/keymaps/lenovo-ideapad b/extras/keymap/keymaps/lenovo-ideapad +new file mode 100644 +index 0000000..d5f2567 +--- /dev/null ++++ b/extras/keymap/keymaps/lenovo-ideapad +@@ -0,0 +1,7 @@ ++# Key codes observed on S10-3, assumed valid on other IdeaPad models ++0x81 rfkill # does nothing in BIOS ++0x83 display_off # BIOS toggles screen state ++0xB9 brightnessup # does nothing in BIOS ++0xBA brightnessdown # does nothing in BIOS ++0xF1 camera # BIOS toggles camera power ++0xf2 unknown # trackpad enable/disable (does nothing in BIOS) +-- +1.7.2.2 + diff --git a/0003-cdrom_id-Drop-MEDIA_SESSION_NEXT-for-DVD-RW-RO.patch b/0003-cdrom_id-Drop-MEDIA_SESSION_NEXT-for-DVD-RW-RO.patch new file mode 100644 index 0000000..d476ee5 --- /dev/null +++ b/0003-cdrom_id-Drop-MEDIA_SESSION_NEXT-for-DVD-RW-RO.patch @@ -0,0 +1,34 @@ +From b367a1c9d8a0f565effcdb45f86a365be1c8b622 Mon Sep 17 00:00:00 2001 +From: Jan Drzewiecki +Date: Fri, 13 Aug 2010 07:24:29 +0200 +Subject: [PATCH 03/23] cdrom_id: Drop MEDIA_SESSION_NEXT for DVD-RW-RO + +Commit cf2205a fixed the media status for fresh DVD-RW in restricted overwrite +mode, but missed a detail: We should not report the ID_CDROM_MEDIA_SESSION_NEXT +property either, since in that mode you can never append tracks/sessions; this +just works in sequential mode. + +Signed-off-by: Martin Pitt +--- + extras/cdrom_id/cdrom_id.c | 5 +++-- + 1 files changed, 3 insertions(+), 2 deletions(-) + +diff --git a/extras/cdrom_id/cdrom_id.c b/extras/cdrom_id/cdrom_id.c +index d59991c..f9d6e0b 100644 +--- a/extras/cdrom_id/cdrom_id.c ++++ b/extras/cdrom_id/cdrom_id.c +@@ -690,8 +690,9 @@ static int cd_media_info(struct udev *udev, int fd) + } + + determined: +- /* "other" is e. g. DVD-RAM, can't append sessions there either */ +- if ((header[2] & 3) < 2) ++ /* "other" is e. g. DVD-RAM, can't append sessions there; DVDs in ++ * restricted overwrite mode can never append, only in sequential mode */ ++ if ((header[2] & 3) < 2 && !cd_media_dvd_rw_ro) + cd_media_session_next = header[10] << 8 | header[5]; + cd_media_session_count = header[9] << 8 | header[4]; + cd_media_track_count = header[11] << 8 | header[6]; +-- +1.7.2.2 + diff --git a/0004-init-update-systemd-service-files.patch b/0004-init-update-systemd-service-files.patch new file mode 100644 index 0000000..a68e467 --- /dev/null +++ b/0004-init-update-systemd-service-files.patch @@ -0,0 +1,42 @@ +From 68bc0d7963a22967cc00244c4fad96fb45870712 Mon Sep 17 00:00:00 2001 +From: Kay Sievers +Date: Tue, 17 Aug 2010 09:37:57 +0200 +Subject: [PATCH 04/23] init: update systemd service files + +--- + init/udev-retry.service.in | 4 ++-- + init/udev-settle.service.in | 2 +- + 2 files changed, 3 insertions(+), 3 deletions(-) + +diff --git a/init/udev-retry.service.in b/init/udev-retry.service.in +index 7667899..d8ed8a8 100644 +--- a/init/udev-retry.service.in ++++ b/init/udev-retry.service.in +@@ -4,9 +4,9 @@ DefaultDependencies=no + After=local-fs.target udev.service + + [Service] +-Type=finish ++Type=oneshot + ValidNoProcess=yes +-ExecStart=@sbindir@/udevadm trigger --type=failed ++ExecStart=@sbindir@/udevadm trigger --type=failed --action=add + + [Install] + WantedBy=sysinit.target +diff --git a/init/udev-settle.service.in b/init/udev-settle.service.in +index 0594d72..4db61f2 100644 +--- a/init/udev-settle.service.in ++++ b/init/udev-settle.service.in +@@ -4,7 +4,7 @@ DefaultDependencies=no + After=udev.service + + [Service] +-Type=finish ++Type=oneshot + ValidNoProcess=yes + ExecStart=@sbindir@/udevadm settle + +-- +1.7.2.2 + diff --git a/0005-init-update-systemd-service-files.patch b/0005-init-update-systemd-service-files.patch new file mode 100644 index 0000000..e7865d7 --- /dev/null +++ b/0005-init-update-systemd-service-files.patch @@ -0,0 +1,38 @@ +From bd078c90b97c73ba5fe7475947e6ecd20e2eb048 Mon Sep 17 00:00:00 2001 +From: Kay Sievers +Date: Tue, 17 Aug 2010 18:53:57 +0200 +Subject: [PATCH 05/23] init: update systemd service files + +--- + init/udev-retry.service.in | 1 - + init/udev-settle.service.in | 2 +- + 2 files changed, 1 insertions(+), 2 deletions(-) + +diff --git a/init/udev-retry.service.in b/init/udev-retry.service.in +index d8ed8a8..7a0819c 100644 +--- a/init/udev-retry.service.in ++++ b/init/udev-retry.service.in +@@ -5,7 +5,6 @@ After=local-fs.target udev.service + + [Service] + Type=oneshot +-ValidNoProcess=yes + ExecStart=@sbindir@/udevadm trigger --type=failed --action=add + + [Install] +diff --git a/init/udev-settle.service.in b/init/udev-settle.service.in +index 4db61f2..4cb33aa 100644 +--- a/init/udev-settle.service.in ++++ b/init/udev-settle.service.in +@@ -5,7 +5,7 @@ After=udev.service + + [Service] + Type=oneshot +-ValidNoProcess=yes ++RemainAfterExit=yes + ExecStart=@sbindir@/udevadm settle + + [Install] +-- +1.7.2.2 + diff --git a/0006-udev-acl-do-not-mistake-all-SCSI-processor-devices-f.patch b/0006-udev-acl-do-not-mistake-all-SCSI-processor-devices-f.patch new file mode 100644 index 0000000..0864ad4 --- /dev/null +++ b/0006-udev-acl-do-not-mistake-all-SCSI-processor-devices-f.patch @@ -0,0 +1,33 @@ +From 3bd7b89dc40c4a0440ee5fce2ea907971bfcfb10 Mon Sep 17 00:00:00 2001 +From: Marco d'Itri +Date: Wed, 18 Aug 2010 13:35:25 +0200 +Subject: [PATCH 06/23] udev-acl: do not mistake all SCSI "processor" devices for scanner + +Both rules can be removed since now libsane sets libsane_matched also +for SCSI scanners. + +http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=589751 +--- + extras/udev-acl/70-acl.rules | 6 +----- + 1 files changed, 1 insertions(+), 5 deletions(-) + +diff --git a/extras/udev-acl/70-acl.rules b/extras/udev-acl/70-acl.rules +index 6ec04ee..c7134bc 100644 +--- a/extras/udev-acl/70-acl.rules ++++ b/extras/udev-acl/70-acl.rules +@@ -13,11 +13,7 @@ SUBSYSTEM=="usb", ENV{ID_USB_INTERFACES}=="*:060101:*", TAG+="udev-acl" + # digicams with proprietary protocol + ENV{ID_GPHOTO2}=="*?", TAG+="udev-acl" + +-# SCSI scanners +-KERNEL=="sg[0-9]*", ATTRS{type}=="6", TAG+="udev-acl" +-KERNEL=="sg[0-9]*", ATTRS{type}=="3", ATTRS{vendor}=="HP|EPSON|Epson", TAG+="udev-acl" +- +-# USB scanners ++# SCSI and USB scanners + ENV{libsane_matched}=="yes", TAG+="udev-acl" + + # HPLIP devices (necessary for ink level check and HP tool maintenance) +-- +1.7.2.2 + diff --git a/0007-init-add-udev-to-description-in-systemd-service-file.patch b/0007-init-add-udev-to-description-in-systemd-service-file.patch new file mode 100644 index 0000000..bb13a7b --- /dev/null +++ b/0007-init-add-udev-to-description-in-systemd-service-file.patch @@ -0,0 +1,47 @@ +From d15b727ef1375c665057c0fa278b2ea3778b8d3d Mon Sep 17 00:00:00 2001 +From: Kay Sievers +Date: Thu, 19 Aug 2010 08:48:44 +0200 +Subject: [PATCH 07/23] init: add 'udev -' to description in systemd service files + +--- + init/udev-retry.service.in | 2 +- + init/udev-settle.service.in | 2 +- + init/udev.service.in | 2 +- + 3 files changed, 3 insertions(+), 3 deletions(-) + +diff --git a/init/udev-retry.service.in b/init/udev-retry.service.in +index 7a0819c..a6612da 100644 +--- a/init/udev-retry.service.in ++++ b/init/udev-retry.service.in +@@ -1,5 +1,5 @@ + [Unit] +-Description=re-trigger failed events after filesystems are available ++Description=udev - re-trigger failed events after filesystems are available + DefaultDependencies=no + After=local-fs.target udev.service + +diff --git a/init/udev-settle.service.in b/init/udev-settle.service.in +index 4cb33aa..578a24f 100644 +--- a/init/udev-settle.service.in ++++ b/init/udev-settle.service.in +@@ -1,5 +1,5 @@ + [Unit] +-Description=wait until full initialization ++Description=udev - wait until full initialization + DefaultDependencies=no + After=udev.service + +diff --git a/init/udev.service.in b/init/udev.service.in +index e95cb47..5a63b77 100644 +--- a/init/udev.service.in ++++ b/init/udev.service.in +@@ -1,5 +1,5 @@ + [Unit] +-Description=/dev and kernel device manager ++Description=udev - /dev and kernel device manager + DefaultDependencies=no + Before=sysinit.target + +-- +1.7.2.2 + diff --git a/0008-udevd-add-pid-to-kmsg-logs.patch b/0008-udevd-add-pid-to-kmsg-logs.patch new file mode 100644 index 0000000..5b7a8df --- /dev/null +++ b/0008-udevd-add-pid-to-kmsg-logs.patch @@ -0,0 +1,41 @@ +From c25bfbfb1b20781698ff3c8cbc884a9e190052ee Mon Sep 17 00:00:00 2001 +From: Kay Sievers +Date: Thu, 19 Aug 2010 08:49:43 +0200 +Subject: [PATCH 08/23] udevd: add pid to kmsg logs + +--- + udev/udev-event.c | 4 ++-- + udev/udevd.c | 2 +- + 2 files changed, 3 insertions(+), 3 deletions(-) + +diff --git a/udev/udev-event.c b/udev/udev-event.c +index 9b5326b..ae523f8 100644 +--- a/udev/udev-event.c ++++ b/udev/udev-event.c +@@ -454,8 +454,8 @@ static void rename_netif_kernel_log(struct ifreq ifr) + return; + } + +- fprintf(f, "<6>udev: renamed network interface %s to %s\n", +- ifr.ifr_name, ifr.ifr_newname); ++ fprintf(f, "<6>udev[%u]: renamed network interface %s to %s\n", ++ getpid(), ifr.ifr_name, ifr.ifr_newname); + fclose(f); + } + +diff --git a/udev/udevd.c b/udev/udevd.c +index 61b76f5..ad2ca3b 100644 +--- a/udev/udevd.c ++++ b/udev/udevd.c +@@ -1298,7 +1298,7 @@ int main(int argc, char *argv[]) + + f = fopen("/dev/kmsg", "w"); + if (f != NULL) { +- fprintf(f, "<6>udev: starting version " VERSION "\n"); ++ fprintf(f, "<6>udev[%u]: starting version " VERSION "\n", getpid()); + fclose(f); + } + +-- +1.7.2.2 + diff --git a/0009-init-edit-systemd-service-descriptions.patch b/0009-init-edit-systemd-service-descriptions.patch new file mode 100644 index 0000000..45b8119 --- /dev/null +++ b/0009-init-edit-systemd-service-descriptions.patch @@ -0,0 +1,47 @@ +From 4c9b12a7aa57e43e568b78da9cbed4138b1292df Mon Sep 17 00:00:00 2001 +From: Kay Sievers +Date: Thu, 19 Aug 2010 18:02:20 +0200 +Subject: [PATCH 09/23] init: edit systemd service descriptions + +--- + init/udev-retry.service.in | 2 +- + init/udev-settle.service.in | 2 +- + init/udev.service.in | 2 +- + 3 files changed, 3 insertions(+), 3 deletions(-) + +diff --git a/init/udev-retry.service.in b/init/udev-retry.service.in +index a6612da..ab8241b 100644 +--- a/init/udev-retry.service.in ++++ b/init/udev-retry.service.in +@@ -1,5 +1,5 @@ + [Unit] +-Description=udev - re-trigger failed events after filesystems are available ++Description=udev Retry Failed Events + DefaultDependencies=no + After=local-fs.target udev.service + +diff --git a/init/udev-settle.service.in b/init/udev-settle.service.in +index 578a24f..d58ea9c 100644 +--- a/init/udev-settle.service.in ++++ b/init/udev-settle.service.in +@@ -1,5 +1,5 @@ + [Unit] +-Description=udev - wait until full initialization ++Description=udev Wait for Complete Device Initialization + DefaultDependencies=no + After=udev.service + +diff --git a/init/udev.service.in b/init/udev.service.in +index 5a63b77..b07f4db 100644 +--- a/init/udev.service.in ++++ b/init/udev.service.in +@@ -1,5 +1,5 @@ + [Unit] +-Description=udev - /dev and kernel device manager ++Description=udev Kernel Device Manager + DefaultDependencies=no + Before=sysinit.target + +-- +1.7.2.2 + diff --git a/0011-udev-7-Point-out-required-extension-and-remove-some-.patch b/0011-udev-7-Point-out-required-extension-and-remove-some-.patch new file mode 100644 index 0000000..bd75f26 --- /dev/null +++ b/0011-udev-7-Point-out-required-extension-and-remove-some-.patch @@ -0,0 +1,42 @@ +From 6593e8961afbe0b74d5a67c545a991c7733e88df Mon Sep 17 00:00:00 2001 +From: Martin Pitt +Date: Fri, 20 Aug 2010 12:19:23 +0200 +Subject: [PATCH 11/23] udev(7): Point out required extension, and remove some confusion + +Rules files must end in .rules. + +Also drop the redundant and confusing sentence about "file names must be +unique". What is really meant is explained in a better way in the paragraph +above. + +https://launchpad.net/bugs/616108 +--- + udev/udev.xml | 11 ++++++----- + 1 files changed, 6 insertions(+), 5 deletions(-) + +diff --git a/udev/udev.xml b/udev/udev.xml +index 20c394c..336b203 100644 +--- a/udev/udev.xml ++++ b/udev/udev.xml +@@ -75,12 +75,13 @@ + the custom rules directory /etc/udev/rules.d/ + and the temporary rules directory /dev/.udev/rules.d/. + All rule files are sorted and processed in lexical order, regardless +- in which of these directories they live. ++ in which of these directories they live. Files in ++ /etc/udev/rules.d/ have precedence over files with ++ the same name in /lib/udev/rules.d/. This can be ++ used to ignore a default rules file if needed. + +- Rule files are required to have a unique name, duplicate file names +- are ignored. Files in /etc/udev/rules.d/ have precedence +- over files with the same name in /lib/udev/rules.d/. This +- can be used to ignore a default rules file if needed. ++ Rule files must end in .rules, other extensions ++ are ignored. + + Every line in the rules file contains at least one key value pair. + There are two kind of keys, match and assignment keys. +-- +1.7.2.2 + diff --git a/0012-keymap-Add-Onkyo-PC.patch b/0012-keymap-Add-Onkyo-PC.patch new file mode 100644 index 0000000..e7b283b --- /dev/null +++ b/0012-keymap-Add-Onkyo-PC.patch @@ -0,0 +1,63 @@ +From acf865b68e1a5c78677537b373b6e082c287fc27 Mon Sep 17 00:00:00 2001 +From: Martin Pitt +Date: Sun, 22 Aug 2010 11:00:34 +0200 +Subject: [PATCH 12/23] keymap: Add Onkyo PC + +Thanks to Pau Oliva! + +https://launchpad.net/bugs/612529 +--- + Makefile.am | 1 + + extras/keymap/95-keymap.rules | 2 ++ + extras/keymap/keymaps/onkyo | 14 ++++++++++++++ + 3 files changed, 17 insertions(+), 0 deletions(-) + create mode 100644 extras/keymap/keymaps/onkyo + +diff --git a/Makefile.am b/Makefile.am +index 77df6ab..512de34 100644 +--- a/Makefile.am ++++ b/Makefile.am +@@ -555,6 +555,7 @@ dist_udevkeymap_DATA = \ + extras/keymap/keymaps/module-sony \ + extras/keymap/keymaps/module-sony-old \ + extras/keymap/keymaps/olpc-xo \ ++ extras/keymap/keymaps/onkyo \ + extras/keymap/keymaps/oqo-model2 \ + extras/keymap/keymaps/samsung-other \ + extras/keymap/keymaps/samsung-sq1us \ +diff --git a/extras/keymap/95-keymap.rules b/extras/keymap/95-keymap.rules +index 2241422..e9d5721 100644 +--- a/extras/keymap/95-keymap.rules ++++ b/extras/keymap/95-keymap.rules +@@ -127,6 +127,8 @@ ENV{DMI_VENDOR}=="TOSHIBA", ATTR{[dmi/id]product_name}=="Satellite M30X", RUN+=" + + ENV{DMI_VENDOR}=="OQO Inc.*", ATTR{[dmi/id]product_name}=="OQO Model 2*", RUN+="keymap $name oqo-model2" + ++ENV{DMI_VENDOR}=="ONKYO CORPORATION", ATTR{[dmi/id]product_name}=="ONKYOPC", RUN+="keymap $name onkyo" ++ + ENV{DMI_VENDOR}=="ASUS", RUN+="keymap $name asus" + + ENV{DMI_VENDOR}=="VIA", ATTR{[dmi/id]product_name}=="K8N800", ATTR{[dmi/id]product_version}=="VT8204B", RUN+="keymap $name 0x81 prog1" +diff --git a/extras/keymap/keymaps/onkyo b/extras/keymap/keymaps/onkyo +new file mode 100644 +index 0000000..7dd80a1 +--- /dev/null ++++ b/extras/keymap/keymaps/onkyo +@@ -0,0 +1,14 @@ ++0xA0 mute # Fn+D ++0xAE volumedown # Fn+F ++0xB0 volumeup # Fn+G ++0xDF sleep # Fn+W ++0xE0 bluetooth # Fn+H ++0xE2 cyclewindows # Fn+Esc ++0xEE battery # Fn+Q ++0xF0 media # Fn+R ++0xF5 switchvideomode # Fn+E ++0xF6 camera # Fn+T ++0xF7 f22 # Fn+Y (touchpad toggle) ++0xF8 brightnessup # Fn+S ++0xF9 brightnessdown # Fn+A ++0xFB wlan # Fn+J +-- +1.7.2.2 + diff --git a/0013-keymap-Add-HP-G60.patch b/0013-keymap-Add-HP-G60.patch new file mode 100644 index 0000000..cbeb33c --- /dev/null +++ b/0013-keymap-Add-HP-G60.patch @@ -0,0 +1,26 @@ +From 92cffb0bd18bd8fd245666a519ad0e54dc537031 Mon Sep 17 00:00:00 2001 +From: Martin Pitt +Date: Mon, 23 Aug 2010 10:47:28 +0200 +Subject: [PATCH 13/23] keymap: Add HP G60 + +https://launchpad.net/bugs/554944 +--- + extras/keymap/95-keymap.rules | 2 +- + 1 files changed, 1 insertions(+), 1 deletions(-) + +diff --git a/extras/keymap/95-keymap.rules b/extras/keymap/95-keymap.rules +index e9d5721..5656de9 100644 +--- a/extras/keymap/95-keymap.rules ++++ b/extras/keymap/95-keymap.rules +@@ -72,7 +72,7 @@ ENV{DMI_VENDOR}=="Hewlett-Packard*", RUN+="keymap $name hewlett-packard" + ENV{DMI_VENDOR}=="Hewlett-Packard*", ATTR{[dmi/id]product_name}=="*[tT][aA][bB][lL][eE][tT]*", RUN+="keymap $name hewlett-packard-tablet" + ENV{DMI_VENDOR}=="Hewlett-Packard*", ATTR{[dmi/id]product_name}=="*[pP][aA][vV][iI][lL][iI][oO][nN]*", RUN+="keymap $name hewlett-packard-pavilion" + ENV{DMI_VENDOR}=="Hewlett-Packard*", ATTR{[dmi/id]product_name}=="*Compaq*|*EliteBook*|*2230s*", RUN+="keymap $name hewlett-packard-compaq_elitebook" +-ENV{DMI_VENDOR}=="Hewlett-Packard*", ATTR{[dmi/id]product_name}=="*2510p*|*2530p*", RUN+="keymap $name hewlett-packard-2510p_2530p" ++ENV{DMI_VENDOR}=="Hewlett-Packard*", ATTR{[dmi/id]product_name}=="*2510p*|*2530p*|HP G60 Notebook PC", RUN+="keymap $name hewlett-packard-2510p_2530p" + ENV{DMI_VENDOR}=="Hewlett-Packard*", ATTR{[dmi/id]product_name}=="*[tT][xX]2*", RUN+="keymap $name hewlett-packard-tx2" + ENV{DMI_VENDOR}=="Hewlett-Packard", ATTR{[dmi/id]product_name}=="Presario 2100*", RUN+="keymap $name hewlett-packard-presario-2100" + # HP Pavillion dv6315ea has empty DMI_VENDOR +-- +1.7.2.2 + diff --git a/0014-udevd-remove-unneeded-credential-passing-from-init_n.patch b/0014-udevd-remove-unneeded-credential-passing-from-init_n.patch new file mode 100644 index 0000000..858371b --- /dev/null +++ b/0014-udevd-remove-unneeded-credential-passing-from-init_n.patch @@ -0,0 +1,58 @@ +From 13f90be7a33353fdbcd4a389630a05c608bdf2a4 Mon Sep 17 00:00:00 2001 +From: Kay Sievers +Date: Wed, 25 Aug 2010 16:26:54 +0200 +Subject: [PATCH 14/23] udevd: remove unneeded credential passing from init_notify() + +--- + udev/udevd.c | 17 ----------------- + 1 files changed, 0 insertions(+), 17 deletions(-) + +diff --git a/udev/udevd.c b/udev/udevd.c +index ad2ca3b..374a4e0 100644 +--- a/udev/udevd.c ++++ b/udev/udevd.c +@@ -964,15 +964,10 @@ static int init_notify(const char *state) + int fd = -1, r; + struct msghdr msghdr; + struct iovec iovec; +- struct ucred *ucred; + union { + struct sockaddr sa; + struct sockaddr_un un; + } sockaddr; +- union { +- struct cmsghdr cmsghdr; +- uint8_t buf[CMSG_SPACE(sizeof(struct ucred))]; +- } control; + const char *e; + + if (!(e = getenv("NOTIFY_SOCKET"))) { +@@ -1002,16 +997,6 @@ static int init_notify(const char *state) + iovec.iov_base = (char*) state; + iovec.iov_len = strlen(state); + +- memset(&control, 0, sizeof(control)); +- control.cmsghdr.cmsg_level = SOL_SOCKET; +- control.cmsghdr.cmsg_type = SCM_CREDENTIALS; +- control.cmsghdr.cmsg_len = CMSG_LEN(sizeof(struct ucred)); +- +- ucred = (struct ucred*) CMSG_DATA(&control.cmsghdr); +- ucred->pid = getpid(); +- ucred->uid = getuid(); +- ucred->gid = getgid(); +- + memset(&msghdr, 0, sizeof(msghdr)); + msghdr.msg_name = &sockaddr; + msghdr.msg_namelen = sizeof(sa_family_t) + strlen(e); +@@ -1019,8 +1004,6 @@ static int init_notify(const char *state) + msghdr.msg_namelen = sizeof(struct sockaddr_un); + msghdr.msg_iov = &iovec; + msghdr.msg_iovlen = 1; +- msghdr.msg_control = &control; +- msghdr.msg_controllen = control.cmsghdr.cmsg_len; + + if (sendmsg(fd, &msghdr, MSG_NOSIGNAL) < 0) { + r = -errno; +-- +1.7.2.2 + diff --git a/0015-Add-support-for-oom_score_adj.patch b/0015-Add-support-for-oom_score_adj.patch new file mode 100644 index 0000000..e00e50d --- /dev/null +++ b/0015-Add-support-for-oom_score_adj.patch @@ -0,0 +1,48 @@ +From c61eea9459045c2c9032a0c98234985a371fac58 Mon Sep 17 00:00:00 2001 +From: Luca Tettamanti +Date: Mon, 23 Aug 2010 14:35:37 +0200 +Subject: [PATCH 15/23] Add support for oom_score_adj + +/proc//oom_adj has been deprecated (kernel v2.6.36) due to the +rework of the badness heuristic; oom_score_adj is the replacement. +Keep a fallback to the old interface for compatibility with older +kernels. + +See http://git.kernel.org/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commitdiff;h=a63d83f427fbce97a6cea0db2e64b0eb8435cd10 + +Signed-off-by: Martin Pitt +--- + udev/udevd.c | 15 +++++++++++---- + 1 files changed, 11 insertions(+), 4 deletions(-) + +diff --git a/udev/udevd.c b/udev/udevd.c +index 374a4e0..0ec3c3d 100644 +--- a/udev/udevd.c ++++ b/udev/udevd.c +@@ -1285,12 +1285,19 @@ int main(int argc, char *argv[]) + fclose(f); + } + +- /* OOM_DISABLE == -17 */ +- fd = open("/proc/self/oom_adj", O_RDWR); ++ fd = open("/proc/self/oom_score_adj", O_RDWR); + if (fd < 0) { +- err(udev, "error disabling OOM: %m\n"); ++ /* Fallback to old interface */ ++ fd = open("/proc/self/oom_adj", O_RDWR); ++ if (fd < 0) { ++ err(udev, "error disabling OOM: %m\n"); ++ } else { ++ /* OOM_DISABLE == -17 */ ++ write(fd, "-17", 3); ++ close(fd); ++ } + } else { +- write(fd, "-17", 3); ++ write(fd, "-1000", 5); + close(fd); + } + +-- +1.7.2.2 + diff --git a/0016-keymap-Fix-Sony-VAIO-VGN-SZ2HP-B.patch b/0016-keymap-Fix-Sony-VAIO-VGN-SZ2HP-B.patch new file mode 100644 index 0000000..d5c7fff --- /dev/null +++ b/0016-keymap-Fix-Sony-VAIO-VGN-SZ2HP-B.patch @@ -0,0 +1,28 @@ +From 38b5ccbcf7f3643ea8180a8186cfe3e5fa9cb983 Mon Sep 17 00:00:00 2001 +From: Martin Pitt +Date: Wed, 25 Aug 2010 17:02:51 +0200 +Subject: [PATCH 16/23] keymap: Fix Sony VAIO VGN-SZ2HP/B + +Reportedly this needs the module-sony keymap, not the -old one. + +https://launchpad.net/bugs/613578 +--- + extras/keymap/95-keymap.rules | 2 +- + 1 files changed, 1 insertions(+), 1 deletions(-) + +diff --git a/extras/keymap/95-keymap.rules b/extras/keymap/95-keymap.rules +index 5656de9..cb066bd 100644 +--- a/extras/keymap/95-keymap.rules ++++ b/extras/keymap/95-keymap.rules +@@ -46,7 +46,7 @@ ENV{DMI_VENDOR}=="ASUS*", KERNELS=="input*", ATTRS{name}=="Asus Extra Buttons", + ENV{DMI_VENDOR}=="Sony*", KERNELS=="input*", ATTRS{name}=="Sony Vaio Keys", RUN+="keymap $name module-sony" + + # Older Vaios have some different keys +-ENV{DMI_VENDOR}=="Sony*", ATTR{[dmi/id]product_name}=="*PCG-C1*|*PCG-K25*|*PCG-F1*|*PCG-F2*|*PCG-F3*|*PCG-F4*|*PCG-F5*|*PCG-F6*|*PCG-FX*|*PCG-FRV*|*PCG-GR*|*PCG-TR*|*PCG-NV*|*PCG-Z*|*VGN-S360*|*VGN-SZ2HP_B*", ATTRS{name}=="Sony Vaio Keys", RUN+="keymap $name module-sony-old" ++ENV{DMI_VENDOR}=="Sony*", ATTR{[dmi/id]product_name}=="*PCG-C1*|*PCG-K25*|*PCG-F1*|*PCG-F2*|*PCG-F3*|*PCG-F4*|*PCG-F5*|*PCG-F6*|*PCG-FX*|*PCG-FRV*|*PCG-GR*|*PCG-TR*|*PCG-NV*|*PCG-Z*|*VGN-S360*", ATTRS{name}=="Sony Vaio Keys", RUN+="keymap $name module-sony-old" + + # + # The following rules belong to standard i8042 AT keyboard with high key codes. +-- +1.7.2.2 + diff --git a/0017-udev-7-manpage-Fix-description-of-attr.patch b/0017-udev-7-manpage-Fix-description-of-attr.patch new file mode 100644 index 0000000..6b41ecf --- /dev/null +++ b/0017-udev-7-manpage-Fix-description-of-attr.patch @@ -0,0 +1,32 @@ +From 83184d008ba23724fd30996440534c0633a0d0aa Mon Sep 17 00:00:00 2001 +From: Martin Pitt +Date: Fri, 27 Aug 2010 16:54:52 +0200 +Subject: [PATCH 17/23] udev(7) manpage: Fix description of $attr + +Fix the manpage to describe the real behaviour of $attr: It doesn't search all +parent devices any more, just the one selected by KERNELS etc. + +https://launchpad.net/bugs/348513 +--- + udev/udev.xml | 5 +++-- + 1 files changed, 3 insertions(+), 2 deletions(-) + +diff --git a/udev/udev.xml b/udev/udev.xml +index 336b203..6085dff 100644 +--- a/udev/udev.xml ++++ b/udev/udev.xml +@@ -578,8 +578,9 @@ + + The value of a sysfs attribute found at the device, where + all keys of the rule have matched. If the matching device does not have +- such an attribute, follow the chain of parent devices and use the value +- of the first attribute that matches. ++ such an attribute, and a previous KERNELS, SUBSYSTEMS, DRIVERS, or ++ ATTRS test selected a parent device, use the attribute from that ++ parent device. + If the attribute is a symlink, the last element of the symlink target is + returned as the value. + +-- +1.7.2.2 + diff --git a/0018-gudev-fix-crash-if-netlink-is-not-available.patch b/0018-gudev-fix-crash-if-netlink-is-not-available.patch new file mode 100644 index 0000000..2a5872e --- /dev/null +++ b/0018-gudev-fix-crash-if-netlink-is-not-available.patch @@ -0,0 +1,57 @@ +From e4dcdc4ab232bcbbe61a2026c16e647d9302cdd2 Mon Sep 17 00:00:00 2001 +From: Martin Pitt +Date: Fri, 27 Aug 2010 18:12:59 +0200 +Subject: [PATCH 18/23] gudev: fix crash if netlink is not available + +gudev_client_new() assumes that priv->monitor is never NULL, but this happens +on older kernels. Let's not crash client programs because of that. + +https://launchpad.net/bugs/581527 +--- + extras/gudev/gudevclient.c | 18 ++++++++++++------ + 1 files changed, 12 insertions(+), 6 deletions(-) + +diff --git a/extras/gudev/gudevclient.c b/extras/gudev/gudevclient.c +index fa31f70..f5f7a19 100644 +--- a/extras/gudev/gudevclient.c ++++ b/extras/gudev/gudevclient.c +@@ -93,6 +93,8 @@ monitor_event (GIOChannel *source, + GUdevDevice *device; + struct udev_device *udevice; + ++ if (client->priv->monitor == NULL) ++ goto out; + udevice = udev_monitor_receive_device (client->priv->monitor); + if (udevice == NULL) + goto out; +@@ -216,17 +218,21 @@ g_udev_client_constructed (GObject *object) + *s = '\0'; + } + +- udev_monitor_filter_add_match_subsystem_devtype (client->priv->monitor, subsystem, devtype); ++ if (client->priv->monitor != NULL) ++ udev_monitor_filter_add_match_subsystem_devtype (client->priv->monitor, subsystem, devtype); + + g_free (subsystem); + } + + /* listen to events, and buffer them */ +- udev_monitor_enable_receiving (client->priv->monitor); +- +- channel = g_io_channel_unix_new (udev_monitor_get_fd (client->priv->monitor)); +- client->priv->watch_id = g_io_add_watch (channel, G_IO_IN, monitor_event, client); +- g_io_channel_unref (channel); ++ if (client->priv->monitor != NULL) ++ { ++ udev_monitor_enable_receiving (client->priv->monitor); ++ channel = g_io_channel_unix_new (udev_monitor_get_fd (client->priv->monitor)); ++ client->priv->watch_id = g_io_add_watch (channel, G_IO_IN, monitor_event, client); ++ g_io_channel_unref (channel); ++ } else ++ client->priv->watch_id = NULL; + } + + if (G_OBJECT_CLASS (g_udev_client_parent_class)->constructed != NULL) +-- +1.7.2.2 + diff --git a/0019-keymap-Fix-Acer-TravelMate-4720.patch b/0019-keymap-Fix-Acer-TravelMate-4720.patch new file mode 100644 index 0000000..35a9922 --- /dev/null +++ b/0019-keymap-Fix-Acer-TravelMate-4720.patch @@ -0,0 +1,28 @@ +From d17c065e28fa4baac90b02b4913c7ef32d54f3c7 Mon Sep 17 00:00:00 2001 +From: Martin Pitt +Date: Fri, 27 Aug 2010 18:48:53 +0200 +Subject: [PATCH 19/23] keymap: Fix Acer TravelMate 4720 + +The previous change just fixed the Bluetooth key, but Screen Lock and Browser +also need to be changed. + +https://launchpad.net/bugs/569815 +--- + extras/keymap/95-keymap.rules | 1 + + 1 files changed, 1 insertions(+), 0 deletions(-) + +diff --git a/extras/keymap/95-keymap.rules b/extras/keymap/95-keymap.rules +index cb066bd..913b380 100644 +--- a/extras/keymap/95-keymap.rules ++++ b/extras/keymap/95-keymap.rules +@@ -85,6 +85,7 @@ ENV{DMI_VENDOR}=="Acer*", RUN+="keymap $name acer" + ENV{DMI_VENDOR}=="Acer*", ATTR{[dmi/id]product_name}=="Extensa*", ATTR{[dmi/id]product_name}=="*5210*|*5220*|*5610*|*5620*|*5720*", RUN+="keymap $name 0xEE screenlock" + ENV{DMI_VENDOR}=="Acer*", ATTR{[dmi/id]product_name}=="TravelMate*C300*", RUN+="keymap $name acer-travelmate_c300" + ENV{DMI_VENDOR}=="Acer*", ATTR{[dmi/id]product_name}=="TravelMate*6292*|TravelMate*8471*|TravelMate*4720*|Aspire 1810T*|AO751h|AO531h", RUN+="keymap $name 0xD9 bluetooth" ++ENV{DMI_VENDOR}=="Acer*", ATTR{[dmi/id]product_name}=="TravelMate*4720*", RUN+="keymap $name 0xB2 www 0xEE screenlock" + ENV{DMI_VENDOR}=="Acer*", ATTR{[dmi/id]product_name}=="TravelMate 6593|Aspire 1640", RUN+="keymap $name 0xB2 www 0xEE screenlock" + ENV{DMI_VENDOR}=="Acer*", ATTR{[dmi/id]product_name}=="Aspire 6920", RUN+="keymap $name acer-aspire_6920" + ENV{DMI_VENDOR}=="Acer*", ATTR{[dmi/id]product_name}=="Aspire 5920G", RUN+="keymap $name acer-aspire_5920g" +-- +1.7.2.2 + diff --git a/0020-cdrom_id-Fix-DVD-RW-media-detection.patch b/0020-cdrom_id-Fix-DVD-RW-media-detection.patch new file mode 100644 index 0000000..4a91a4e --- /dev/null +++ b/0020-cdrom_id-Fix-DVD-RW-media-detection.patch @@ -0,0 +1,53 @@ +From 2458db3edd8d66827b34978ff471dff8f879e9ab Mon Sep 17 00:00:00 2001 +From: Martin Pitt +Date: Mon, 30 Aug 2010 15:33:26 +0200 +Subject: [PATCH 20/23] cdrom_id: Fix DVD-RW media detection + +Commit cf2205a19 applied the "restricted overwrite" vs. "sequential" DVD-RW +test to feature_profiles() (which reads the drive capabilities), which caused +every DVD medium to be detected as ID_CDROM_MEDIA_DVD_RW. Now apply it to +cd_profiles() instead, to just check the current profile. +--- + extras/cdrom_id/cdrom_id.c | 13 +++++++------ + 1 files changed, 7 insertions(+), 6 deletions(-) + +diff --git a/extras/cdrom_id/cdrom_id.c b/extras/cdrom_id/cdrom_id.c +index f9d6e0b..8480d7b 100644 +--- a/extras/cdrom_id/cdrom_id.c ++++ b/extras/cdrom_id/cdrom_id.c +@@ -297,14 +297,9 @@ static int feature_profiles(struct udev *udev, const unsigned char *profiles, si + cd_dvd_ram = 1; + break; + case 0x13: +- info(udev, "profile 0x%02x media_dvd_rw\n", profile); +- cd_media_dvd_rw = 1; +- cd_media_dvd_rw_ro = 1; +- break; + case 0x14: + info(udev, "profile 0x%02x dvd_rw\n", profile); + cd_dvd_rw = 1; +- cd_media_dvd_rw_seq = 1; + break; + case 0x1B: + info(udev, "profile 0x%02x dvd_plus_r\n", profile); +@@ -486,10 +481,16 @@ static int cd_profiles(struct udev *udev, int fd) + cd_media_dvd_ram = 1; + break; + case 0x13: ++ info(udev, "profile 0x%02x media_dvd_rw_ro\n", cur_profile); ++ cd_media = 1; ++ cd_media_dvd_rw = 1; ++ cd_media_dvd_rw_ro = 1; ++ break; + case 0x14: +- info(udev, "profile 0x%02x media_dvd_rw\n", cur_profile); ++ info(udev, "profile 0x%02x media_dvd_rw_seq\n", cur_profile); + cd_media = 1; + cd_media_dvd_rw = 1; ++ cd_media_dvd_rw_seq = 1; + break; + case 0x1B: + info(udev, "profile 0x%02x media_dvd_plus_r\n", cur_profile); +-- +1.7.2.2 + diff --git a/0021-cdrom_id-Fix-DVD-blank-detection-for-sloppy-firmware.patch b/0021-cdrom_id-Fix-DVD-blank-detection-for-sloppy-firmware.patch new file mode 100644 index 0000000..d033307 --- /dev/null +++ b/0021-cdrom_id-Fix-DVD-blank-detection-for-sloppy-firmware.patch @@ -0,0 +1,42 @@ +From 5e267ea5a36de0b2a9a8965ca93dd45bbd6b1a8b Mon Sep 17 00:00:00 2001 +From: Jan Drzewiecki +Date: Tue, 31 Aug 2010 00:37:28 +0200 +Subject: [PATCH 21/23] cdrom_id: Fix DVD blank detection for sloppy firmware + +Reportedly, many CD drive firmwares will only consider the MSB in a READ +command, thus if we request 17 blocks to be read, we'll actually only get 16 in +many cases, and thus miss out the interesting sector #17. This would lead to +falsely considering nonempty DVDs as blank. + +Fetch 32 blocks now, which should work everywhere. + +Signed-off-by: Martin Pitt +--- + extras/cdrom_id/cdrom_id.c | 4 ++-- + 1 files changed, 2 insertions(+), 2 deletions(-) + +diff --git a/extras/cdrom_id/cdrom_id.c b/extras/cdrom_id/cdrom_id.c +index 8480d7b..0153af6 100644 +--- a/extras/cdrom_id/cdrom_id.c ++++ b/extras/cdrom_id/cdrom_id.c +@@ -590,7 +590,7 @@ static int cd_media_info(struct udev *udev, int fd) + * always "complete", DVD-RAM are "other" or "complete" if the disc is + * write protected; we need to check the contents if it is blank */ + if ((cd_media_dvd_rw_ro || cd_media_dvd_plus_rw || cd_media_dvd_plus_rw_dl || cd_media_dvd_ram) && (header[2] & 3) > 1) { +- unsigned char buffer[17 * 2048]; ++ unsigned char buffer[32 * 2048]; + unsigned char result, len; + int block, offset; + +@@ -661,7 +661,7 @@ static int cd_media_info(struct udev *udev, int fd) + scsi_cmd_init(udev, &sc, buffer, sizeof(buffer)); + scsi_cmd_set(udev, &sc, 0, 0x28); + scsi_cmd_set(udev, &sc, 5, 0); +- scsi_cmd_set(udev, &sc, 8, 17); ++ scsi_cmd_set(udev, &sc, 8, 32); + scsi_cmd_set(udev, &sc, 9, 0); + err = scsi_cmd_run(udev, &sc, fd, buffer, sizeof(buffer)); + if ((err != 0)) { +-- +1.7.2.2 + diff --git a/0022-set-SELinux-context-on-add-but-not-on-change-events.patch b/0022-set-SELinux-context-on-add-but-not-on-change-events.patch new file mode 100644 index 0000000..aa99300 --- /dev/null +++ b/0022-set-SELinux-context-on-add-but-not-on-change-events.patch @@ -0,0 +1,35 @@ +From 326c5fc3ea684825629eccaf33a548759162a539 Mon Sep 17 00:00:00 2001 +From: Kay Sievers +Date: Tue, 31 Aug 2010 21:29:21 +0200 +Subject: [PATCH 22/23] set SELinux context on 'add' but not on 'change' events + +--- + udev/udev-node.c | 9 ++++++++- + 1 files changed, 8 insertions(+), 1 deletions(-) + +diff --git a/udev/udev-node.c b/udev/udev-node.c +index 228b3eb..c8113f1 100644 +--- a/udev/udev-node.c ++++ b/udev/udev-node.c +@@ -56,10 +56,17 @@ int udev_node_mknod(struct udev_device *dev, const char *file, mode_t mode, uid_ + info(udev, "set permissions %s, %#o, uid=%u, gid=%u\n", file, mode, uid, gid); + chmod(file, mode); + chown(file, uid, gid); +- udev_selinux_lsetfilecon(udev, file, mode); + } else { + info(udev, "preserve permissions %s, %#o, uid=%u, gid=%u\n", file, mode, uid, gid); + } ++ /* ++ * Set initial selinux file context only on add events. ++ * We set the proper context on bootup (triger) or for newly ++ * added devices, but we don't change it later, in case ++ * something else has set a custom context in the meantime. ++ */ ++ if (strcmp(udev_device_get_action(dev), "add") == 0) ++ udev_selinux_lsetfilecon(udev, file, mode); + /* always update timestamp when we re-use the node, like on media change events */ + utimensat(AT_FDCWD, file, NULL, 0); + } else { +-- +1.7.2.2 + diff --git a/0023-do-not-create-persistent-name-rules-for-KVM-network-.patch b/0023-do-not-create-persistent-name-rules-for-KVM-network-.patch new file mode 100644 index 0000000..16b7dab --- /dev/null +++ b/0023-do-not-create-persistent-name-rules-for-KVM-network-.patch @@ -0,0 +1,28 @@ +From af29bf0966994bc233282148f519e12ea29e1c5a Mon Sep 17 00:00:00 2001 +From: Marco d'Itri +Date: Tue, 31 Aug 2010 21:44:34 +0200 +Subject: [PATCH 23/23] do not create persistent name rules for KVM network interfaces + +The virtual interfaces created by KVM are stable, 54:52:00 is the MAC-48 +range of KVM. +--- + .../75-persistent-net-generator.rules | 3 +++ + 1 files changed, 3 insertions(+), 0 deletions(-) + +diff --git a/extras/rule_generator/75-persistent-net-generator.rules b/extras/rule_generator/75-persistent-net-generator.rules +index a9dfdce..8119d0e 100644 +--- a/extras/rule_generator/75-persistent-net-generator.rules ++++ b/extras/rule_generator/75-persistent-net-generator.rules +@@ -29,6 +29,9 @@ ENV{MATCHADDR}="$attr{address}" + # match interface type + ENV{MATCHIFTYPE}="$attr{type}" + ++# ignore KVM virtual interfaces ++ENV{MATCHADDR}=="54:52:00:*", GOTO="persistent_net_generator_end" ++ + # These vendors are known to violate the local MAC address assignment scheme + # Interlan, DEC (UNIBUS or QBUS), Apollo, Cisco, Racal-Datacom + ENV{MATCHADDR}=="02:07:01:*", GOTO="globally_administered_whitelist" +-- +1.7.2.2 + diff --git a/udev.spec b/udev.spec index 8b8febb..6fc041f 100644 --- a/udev.spec +++ b/udev.spec @@ -7,7 +7,7 @@ Summary: A rule-based device node and kernel event manager Name: udev Version: 161 -Release: 1%{?dist} +Release: 2%{?dist} License: GPLv2+ Group: System Environment/Base Provides: udev-persistent = %{version}-%{release} @@ -17,6 +17,29 @@ Source: ftp://ftp.kernel.org/pub/linux/utils/kernel/hotplug/%{name}-%{version}.t Source1: start_udev Source2: udev-post.init +Patch1: 0001-cdrom_id-Add-media-status-debugging.patch +Patch2: 0002-Add-keymap-for-Lenovo-IdeaPad-S10-3.patch +Patch3: 0003-cdrom_id-Drop-MEDIA_SESSION_NEXT-for-DVD-RW-RO.patch +Patch4: 0004-init-update-systemd-service-files.patch +Patch5: 0005-init-update-systemd-service-files.patch +Patch6: 0006-udev-acl-do-not-mistake-all-SCSI-processor-devices-f.patch +Patch7: 0007-init-add-udev-to-description-in-systemd-service-file.patch +Patch8: 0008-udevd-add-pid-to-kmsg-logs.patch +Patch9: 0009-init-edit-systemd-service-descriptions.patch +Patch11: 0011-udev-7-Point-out-required-extension-and-remove-some-.patch +Patch12: 0012-keymap-Add-Onkyo-PC.patch +Patch13: 0013-keymap-Add-HP-G60.patch +Patch14: 0014-udevd-remove-unneeded-credential-passing-from-init_n.patch +Patch15: 0015-Add-support-for-oom_score_adj.patch +Patch16: 0016-keymap-Fix-Sony-VAIO-VGN-SZ2HP-B.patch +Patch17: 0017-udev-7-manpage-Fix-description-of-attr.patch +Patch18: 0018-gudev-fix-crash-if-netlink-is-not-available.patch +Patch19: 0019-keymap-Fix-Acer-TravelMate-4720.patch +Patch20: 0020-cdrom_id-Fix-DVD-RW-media-detection.patch +Patch21: 0021-cdrom_id-Fix-DVD-blank-detection-for-sloppy-firmware.patch +Patch22: 0022-set-SELinux-context-on-add-but-not-on-change-events.patch +Patch23: 0023-do-not-create-persistent-name-rules-for-KVM-network-.patch + ExclusiveOS: Linux URL: http://www.kernel.org/pub/linux/utils/kernel/hotplug/udev.html BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n) @@ -113,6 +136,28 @@ glib-based applications using libudev functionality. %prep %setup -q +%patch1 -p1 -b .git1 +%patch2 -p1 -b .git2 +%patch3 -p1 -b .git3 +%patch4 -p1 -b .git4 +%patch5 -p1 -b .git5 +%patch6 -p1 -b .git6 +%patch7 -p1 -b .git7 +%patch8 -p1 -b .git8 +%patch9 -p1 -b .git9 +%patch11 -p1 -b .git11 +%patch12 -p1 -b .git12 +%patch13 -p1 -b .git13 +%patch14 -p1 -b .git14 +%patch15 -p1 -b .git15 +%patch16 -p1 -b .git16 +%patch17 -p1 -b .git17 +%patch18 -p1 -b .git18 +%patch19 -p1 -b .git19 +%patch20 -p1 -b .git20 +%patch21 -p1 -b .git21 +%patch22 -p1 -b .git22 +%patch23 -p1 -b .git23 %build libtoolize -f -c @@ -349,6 +394,11 @@ rm -rf $RPM_BUILD_ROOT %attr(0644,root,root) %{_libdir}/pkgconfig/gudev-1.0* %changelog +* Wed Sep 01 2010 Harald Hoyer 161-2 +- bugfixes for systemd service files +- bugfix for selinux labeling +- bugfixes for cdrom_id + * Tue Aug 17 2010 Harald Hoyer 161-1 - udev-161 with an upstream quirk for the qemu cdrom and more cdrom handling bugfixes From d8bca2a5df480f6b3e69d57ef3a60029c300504d Mon Sep 17 00:00:00 2001 From: Matthias Clasen Date: Tue, 21 Sep 2010 20:18:19 -0400 Subject: [PATCH 079/142] Rebuild --- udev.spec | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/udev.spec b/udev.spec index 6fc041f..01b6f16 100644 --- a/udev.spec +++ b/udev.spec @@ -7,7 +7,7 @@ Summary: A rule-based device node and kernel event manager Name: udev Version: 161 -Release: 2%{?dist} +Release: 3%{?dist} License: GPLv2+ Group: System Environment/Base Provides: udev-persistent = %{version}-%{release} @@ -394,6 +394,9 @@ rm -rf $RPM_BUILD_ROOT %attr(0644,root,root) %{_libdir}/pkgconfig/gudev-1.0* %changelog +* Tue Sep 21 2010 Matthias Clasen 161-3 +- Rebuild against newer gobject-introspection + * Wed Sep 01 2010 Harald Hoyer 161-2 - bugfixes for systemd service files - bugfix for selinux labeling From 94c7d90643db70fb052ceb4c80b866e6099d86eb Mon Sep 17 00:00:00 2001 From: Jesse Keating Date: Wed, 29 Sep 2010 15:24:41 -0700 Subject: [PATCH 080/142] - Rebuilt for gcc bug 634757 --- udev.spec | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/udev.spec b/udev.spec index 01b6f16..d727903 100644 --- a/udev.spec +++ b/udev.spec @@ -7,7 +7,7 @@ Summary: A rule-based device node and kernel event manager Name: udev Version: 161 -Release: 3%{?dist} +Release: 4%{?dist} License: GPLv2+ Group: System Environment/Base Provides: udev-persistent = %{version}-%{release} @@ -394,6 +394,9 @@ rm -rf $RPM_BUILD_ROOT %attr(0644,root,root) %{_libdir}/pkgconfig/gudev-1.0* %changelog +* Wed Sep 29 2010 jkeating - 161-4 +- Rebuilt for gcc bug 634757 + * Tue Sep 21 2010 Matthias Clasen 161-3 - Rebuild against newer gobject-introspection From 8fcb6e53edbe03b884264d643e56562732df50e2 Mon Sep 17 00:00:00 2001 From: Harald Hoyer Date: Fri, 29 Oct 2010 10:55:52 +0200 Subject: [PATCH 081/142] - version 164 - skip start_udev with systemd --- .gitignore | 2 ++ sources | 4 ++-- start_udev | 4 ++++ udev.spec | 59 ++++++++++-------------------------------------------- 4 files changed, 19 insertions(+), 50 deletions(-) diff --git a/.gitignore b/.gitignore index 22be2f6..65d08f4 100644 --- a/.gitignore +++ b/.gitignore @@ -1 +1,3 @@ udev-160.tar.bz2 +/udev-164.tar.bz2 +/udev-164.tar.bz2.sign diff --git a/sources b/sources index f53200e..8dc2880 100644 --- a/sources +++ b/sources @@ -1,2 +1,2 @@ -2f42aff9f8c7258fecde71df321032b7 udev-161.tar.bz2.sign -95b6a0ffc9913f3e8021c65f51eb4f88 udev-161.tar.bz2 +cd285a85f969518a671834de2f4d6614 udev-164.tar.bz2 +43b3842a00854e712b1d58af3a03e4ed udev-164.tar.bz2.sign diff --git a/start_udev b/start_udev index 49fc286..ebb9cb6 100755 --- a/start_udev +++ b/start_udev @@ -22,6 +22,10 @@ # # don't use udev if sysfs is not mounted. +# if we run with systemctl, just wait for settle +if [ -x "$(type -P systemctl)" ]; then + systemctl start udev-settle.service &>/dev/null && exit 0 +fi export TZ=/etc/localtime diff --git a/udev.spec b/udev.spec index d727903..d38aa03 100644 --- a/udev.spec +++ b/udev.spec @@ -6,8 +6,8 @@ Summary: A rule-based device node and kernel event manager Name: udev -Version: 161 -Release: 4%{?dist} +Version: 164 +Release: 1%{?dist} License: GPLv2+ Group: System Environment/Base Provides: udev-persistent = %{version}-%{release} @@ -17,29 +17,6 @@ Source: ftp://ftp.kernel.org/pub/linux/utils/kernel/hotplug/%{name}-%{version}.t Source1: start_udev Source2: udev-post.init -Patch1: 0001-cdrom_id-Add-media-status-debugging.patch -Patch2: 0002-Add-keymap-for-Lenovo-IdeaPad-S10-3.patch -Patch3: 0003-cdrom_id-Drop-MEDIA_SESSION_NEXT-for-DVD-RW-RO.patch -Patch4: 0004-init-update-systemd-service-files.patch -Patch5: 0005-init-update-systemd-service-files.patch -Patch6: 0006-udev-acl-do-not-mistake-all-SCSI-processor-devices-f.patch -Patch7: 0007-init-add-udev-to-description-in-systemd-service-file.patch -Patch8: 0008-udevd-add-pid-to-kmsg-logs.patch -Patch9: 0009-init-edit-systemd-service-descriptions.patch -Patch11: 0011-udev-7-Point-out-required-extension-and-remove-some-.patch -Patch12: 0012-keymap-Add-Onkyo-PC.patch -Patch13: 0013-keymap-Add-HP-G60.patch -Patch14: 0014-udevd-remove-unneeded-credential-passing-from-init_n.patch -Patch15: 0015-Add-support-for-oom_score_adj.patch -Patch16: 0016-keymap-Fix-Sony-VAIO-VGN-SZ2HP-B.patch -Patch17: 0017-udev-7-manpage-Fix-description-of-attr.patch -Patch18: 0018-gudev-fix-crash-if-netlink-is-not-available.patch -Patch19: 0019-keymap-Fix-Acer-TravelMate-4720.patch -Patch20: 0020-cdrom_id-Fix-DVD-RW-media-detection.patch -Patch21: 0021-cdrom_id-Fix-DVD-blank-detection-for-sloppy-firmware.patch -Patch22: 0022-set-SELinux-context-on-add-but-not-on-change-events.patch -Patch23: 0023-do-not-create-persistent-name-rules-for-KVM-network-.patch - ExclusiveOS: Linux URL: http://www.kernel.org/pub/linux/utils/kernel/hotplug/udev.html BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n) @@ -136,28 +113,6 @@ glib-based applications using libudev functionality. %prep %setup -q -%patch1 -p1 -b .git1 -%patch2 -p1 -b .git2 -%patch3 -p1 -b .git3 -%patch4 -p1 -b .git4 -%patch5 -p1 -b .git5 -%patch6 -p1 -b .git6 -%patch7 -p1 -b .git7 -%patch8 -p1 -b .git8 -%patch9 -p1 -b .git9 -%patch11 -p1 -b .git11 -%patch12 -p1 -b .git12 -%patch13 -p1 -b .git13 -%patch14 -p1 -b .git14 -%patch15 -p1 -b .git15 -%patch16 -p1 -b .git16 -%patch17 -p1 -b .git17 -%patch18 -p1 -b .git18 -%patch19 -p1 -b .git19 -%patch20 -p1 -b .git20 -%patch21 -p1 -b .git21 -%patch22 -p1 -b .git22 -%patch23 -p1 -b .git23 %build libtoolize -f -c @@ -354,6 +309,10 @@ rm -rf $RPM_BUILD_ROOT %attr(0644,root,root) %{systemdsystemunitdir}/udev-retry.service %attr(0644,root,root) %{systemdsystemunitdir}/udev-settle.service %attr(0644,root,root) %{systemdsystemunitdir}/udev.service +%{systemdsystemunitdir}/basic.target.wants/udev-retry.service +%{systemdsystemunitdir}/basic.target.wants/udev-settle.service +%{systemdsystemunitdir}/basic.target.wants/udev.service + # Deprecated, but keep the ownership %ghost %dir /var/lib/udev @@ -378,7 +337,7 @@ rm -rf $RPM_BUILD_ROOT %files -n libgudev1 %defattr(0644, root, root, 0755) %doc extras/gudev/COPYING -%attr(0755,root,root) %{_libdir}/libgudev-1.0.so.* +%attr(0755,root,root) /%{_lib}/libgudev-1.0.so.* %attr(0644,root,root) %{_libdir}/girepository-1.0/GUdev-1.0.typelib %files -n libgudev1-devel @@ -394,6 +353,10 @@ rm -rf $RPM_BUILD_ROOT %attr(0644,root,root) %{_libdir}/pkgconfig/gudev-1.0* %changelog +* Fri Oct 29 2010 Harald Hoyer 164-1 +- version 164 +- skip start_udev with systemd + * Wed Sep 29 2010 jkeating - 161-4 - Rebuilt for gcc bug 634757 From 3ce9b8531482cea88827ccfa89ac371af06abdfc Mon Sep 17 00:00:00 2001 From: Harald Hoyer Date: Fri, 29 Oct 2010 10:56:18 +0200 Subject: [PATCH 082/142] - version 164 - skip start_udev with systemd --- ...-cdrom_id-Add-media-status-debugging.patch | 26 -------- ...-Add-keymap-for-Lenovo-IdeaPad-S10-3.patch | 56 ----------------- ...rop-MEDIA_SESSION_NEXT-for-DVD-RW-RO.patch | 34 ---------- 0004-init-update-systemd-service-files.patch | 42 ------------- 0005-init-update-systemd-service-files.patch | 38 ----------- ...mistake-all-SCSI-processor-devices-f.patch | 33 ---------- ...-description-in-systemd-service-file.patch | 47 -------------- 0008-udevd-add-pid-to-kmsg-logs.patch | 41 ------------ ...it-edit-systemd-service-descriptions.patch | 47 -------------- ...-required-extension-and-remove-some-.patch | 42 ------------- 0012-keymap-Add-Onkyo-PC.patch | 63 ------------------- 0013-keymap-Add-HP-G60.patch | 26 -------- ...eeded-credential-passing-from-init_n.patch | 58 ----------------- 0015-Add-support-for-oom_score_adj.patch | 48 -------------- 0016-keymap-Fix-Sony-VAIO-VGN-SZ2HP-B.patch | 28 --------- ...ev-7-manpage-Fix-description-of-attr.patch | 32 ---------- ...ix-crash-if-netlink-is-not-available.patch | 57 ----------------- 0019-keymap-Fix-Acer-TravelMate-4720.patch | 28 --------- ...-cdrom_id-Fix-DVD-RW-media-detection.patch | 53 ---------------- ...-blank-detection-for-sloppy-firmware.patch | 42 ------------- ...text-on-add-but-not-on-change-events.patch | 35 ----------- ...rsistent-name-rules-for-KVM-network-.patch | 28 --------- 22 files changed, 904 deletions(-) delete mode 100644 0001-cdrom_id-Add-media-status-debugging.patch delete mode 100644 0002-Add-keymap-for-Lenovo-IdeaPad-S10-3.patch delete mode 100644 0003-cdrom_id-Drop-MEDIA_SESSION_NEXT-for-DVD-RW-RO.patch delete mode 100644 0004-init-update-systemd-service-files.patch delete mode 100644 0005-init-update-systemd-service-files.patch delete mode 100644 0006-udev-acl-do-not-mistake-all-SCSI-processor-devices-f.patch delete mode 100644 0007-init-add-udev-to-description-in-systemd-service-file.patch delete mode 100644 0008-udevd-add-pid-to-kmsg-logs.patch delete mode 100644 0009-init-edit-systemd-service-descriptions.patch delete mode 100644 0011-udev-7-Point-out-required-extension-and-remove-some-.patch delete mode 100644 0012-keymap-Add-Onkyo-PC.patch delete mode 100644 0013-keymap-Add-HP-G60.patch delete mode 100644 0014-udevd-remove-unneeded-credential-passing-from-init_n.patch delete mode 100644 0015-Add-support-for-oom_score_adj.patch delete mode 100644 0016-keymap-Fix-Sony-VAIO-VGN-SZ2HP-B.patch delete mode 100644 0017-udev-7-manpage-Fix-description-of-attr.patch delete mode 100644 0018-gudev-fix-crash-if-netlink-is-not-available.patch delete mode 100644 0019-keymap-Fix-Acer-TravelMate-4720.patch delete mode 100644 0020-cdrom_id-Fix-DVD-RW-media-detection.patch delete mode 100644 0021-cdrom_id-Fix-DVD-blank-detection-for-sloppy-firmware.patch delete mode 100644 0022-set-SELinux-context-on-add-but-not-on-change-events.patch delete mode 100644 0023-do-not-create-persistent-name-rules-for-KVM-network-.patch diff --git a/0001-cdrom_id-Add-media-status-debugging.patch b/0001-cdrom_id-Add-media-status-debugging.patch deleted file mode 100644 index f282114..0000000 --- a/0001-cdrom_id-Add-media-status-debugging.patch +++ /dev/null @@ -1,26 +0,0 @@ -From 24af530a543c70ac59fdd244377d648ef77a0e21 Mon Sep 17 00:00:00 2001 -From: Martin Pitt -Date: Thu, 12 Aug 2010 07:10:12 +0200 -Subject: [PATCH 01/23] cdrom_id: Add media status debugging - -Show which media status the hardware originally reports, since we mangle it in -some cases. ---- - extras/cdrom_id/cdrom_id.c | 1 + - 1 files changed, 1 insertions(+), 0 deletions(-) - -diff --git a/extras/cdrom_id/cdrom_id.c b/extras/cdrom_id/cdrom_id.c -index 83e95d5..d59991c 100644 ---- a/extras/cdrom_id/cdrom_id.c -+++ b/extras/cdrom_id/cdrom_id.c -@@ -573,6 +573,7 @@ static int cd_media_info(struct udev *udev, int fd) - - cd_media = 1; - info(udev, "disk type %02x\n", header[8]); -+ info(udev, "hardware reported media status: %s\n", media_status[header[2] & 3]); - - /* exclude plain CDROM, some fake cdroms return 0 for "blank" media here */ - if (!cd_media_cd_rom) --- -1.7.2.2 - diff --git a/0002-Add-keymap-for-Lenovo-IdeaPad-S10-3.patch b/0002-Add-keymap-for-Lenovo-IdeaPad-S10-3.patch deleted file mode 100644 index 486c148..0000000 --- a/0002-Add-keymap-for-Lenovo-IdeaPad-S10-3.patch +++ /dev/null @@ -1,56 +0,0 @@ -From 9cd075e35b8f660c75b0d72d4bea496fd6459f29 Mon Sep 17 00:00:00 2001 -From: David Woodhouse -Date: Thu, 12 Aug 2010 17:04:55 +0100 -Subject: [PATCH 02/23] Add keymap for Lenovo IdeaPad S10-3 - -Tested on S10-3, but presumably applicable to all IdeaPads. - -Signed-off-by: Martin Pitt ---- - Makefile.am | 1 + - extras/keymap/95-keymap.rules | 2 ++ - extras/keymap/keymaps/lenovo-ideapad | 7 +++++++ - 3 files changed, 10 insertions(+), 0 deletions(-) - create mode 100644 extras/keymap/keymaps/lenovo-ideapad - -diff --git a/Makefile.am b/Makefile.am -index c16b259..77df6ab 100644 ---- a/Makefile.am -+++ b/Makefile.am -@@ -537,6 +537,7 @@ dist_udevkeymap_DATA = \ - extras/keymap/keymaps/ibm-thinkpad-usb-keyboard-trackpoint \ - extras/keymap/keymaps/inventec-symphony_6.0_7.0 \ - extras/keymap/keymaps/lenovo-3000 \ -+ extras/keymap/keymaps/lenovo-ideapad \ - extras/keymap/keymaps/lenovo-thinkpad-usb-keyboard-trackpoint \ - extras/keymap/keymaps/lenovo-thinkpad_x6_tablet \ - extras/keymap/keymaps/lenovo-thinkpad_x200_tablet \ -diff --git a/extras/keymap/95-keymap.rules b/extras/keymap/95-keymap.rules -index 13b5571..2241422 100644 ---- a/extras/keymap/95-keymap.rules -+++ b/extras/keymap/95-keymap.rules -@@ -65,6 +65,8 @@ ENV{DMI_VENDOR}=="Compaq*", ATTR{[dmi/id]product_name}=="*E500*|*Evo N*", RUN+=" - ENV{DMI_VENDOR}=="LENOVO*", ATTR{[dmi/id]product_version}=="*3000*", RUN+="keymap $name lenovo-3000" - ENV{DMI_VENDOR}=="LENOVO*", ATTR{[dmi/id]product_version}=="ThinkPad X6*", ATTR{[dmi/id]product_version}=="* Tablet" RUN+="keymap $name lenovo-thinkpad_x6_tablet" - ENV{DMI_VENDOR}=="LENOVO*", ATTR{[dmi/id]product_version}=="ThinkPad X200 Tablet*", ATTR{[dmi/id]product_version}=="* Tablet" RUN+="keymap $name lenovo-thinkpad_x200_tablet" -+ENV{DMI_VENDOR}=="LENOVO*", ATTR{[dmi/id]product_version}=="*IdeaPad*", RUN+="keymap $name lenovo-ideapad" -+ENV{DMI_VENDOR}=="LENOVO*", ATTR{[dmi/id]product_name}=="S10-*", RUN+="keymap $name lenovo-ideapad" - - ENV{DMI_VENDOR}=="Hewlett-Packard*", RUN+="keymap $name hewlett-packard" - ENV{DMI_VENDOR}=="Hewlett-Packard*", ATTR{[dmi/id]product_name}=="*[tT][aA][bB][lL][eE][tT]*", RUN+="keymap $name hewlett-packard-tablet" -diff --git a/extras/keymap/keymaps/lenovo-ideapad b/extras/keymap/keymaps/lenovo-ideapad -new file mode 100644 -index 0000000..d5f2567 ---- /dev/null -+++ b/extras/keymap/keymaps/lenovo-ideapad -@@ -0,0 +1,7 @@ -+# Key codes observed on S10-3, assumed valid on other IdeaPad models -+0x81 rfkill # does nothing in BIOS -+0x83 display_off # BIOS toggles screen state -+0xB9 brightnessup # does nothing in BIOS -+0xBA brightnessdown # does nothing in BIOS -+0xF1 camera # BIOS toggles camera power -+0xf2 unknown # trackpad enable/disable (does nothing in BIOS) --- -1.7.2.2 - diff --git a/0003-cdrom_id-Drop-MEDIA_SESSION_NEXT-for-DVD-RW-RO.patch b/0003-cdrom_id-Drop-MEDIA_SESSION_NEXT-for-DVD-RW-RO.patch deleted file mode 100644 index d476ee5..0000000 --- a/0003-cdrom_id-Drop-MEDIA_SESSION_NEXT-for-DVD-RW-RO.patch +++ /dev/null @@ -1,34 +0,0 @@ -From b367a1c9d8a0f565effcdb45f86a365be1c8b622 Mon Sep 17 00:00:00 2001 -From: Jan Drzewiecki -Date: Fri, 13 Aug 2010 07:24:29 +0200 -Subject: [PATCH 03/23] cdrom_id: Drop MEDIA_SESSION_NEXT for DVD-RW-RO - -Commit cf2205a fixed the media status for fresh DVD-RW in restricted overwrite -mode, but missed a detail: We should not report the ID_CDROM_MEDIA_SESSION_NEXT -property either, since in that mode you can never append tracks/sessions; this -just works in sequential mode. - -Signed-off-by: Martin Pitt ---- - extras/cdrom_id/cdrom_id.c | 5 +++-- - 1 files changed, 3 insertions(+), 2 deletions(-) - -diff --git a/extras/cdrom_id/cdrom_id.c b/extras/cdrom_id/cdrom_id.c -index d59991c..f9d6e0b 100644 ---- a/extras/cdrom_id/cdrom_id.c -+++ b/extras/cdrom_id/cdrom_id.c -@@ -690,8 +690,9 @@ static int cd_media_info(struct udev *udev, int fd) - } - - determined: -- /* "other" is e. g. DVD-RAM, can't append sessions there either */ -- if ((header[2] & 3) < 2) -+ /* "other" is e. g. DVD-RAM, can't append sessions there; DVDs in -+ * restricted overwrite mode can never append, only in sequential mode */ -+ if ((header[2] & 3) < 2 && !cd_media_dvd_rw_ro) - cd_media_session_next = header[10] << 8 | header[5]; - cd_media_session_count = header[9] << 8 | header[4]; - cd_media_track_count = header[11] << 8 | header[6]; --- -1.7.2.2 - diff --git a/0004-init-update-systemd-service-files.patch b/0004-init-update-systemd-service-files.patch deleted file mode 100644 index a68e467..0000000 --- a/0004-init-update-systemd-service-files.patch +++ /dev/null @@ -1,42 +0,0 @@ -From 68bc0d7963a22967cc00244c4fad96fb45870712 Mon Sep 17 00:00:00 2001 -From: Kay Sievers -Date: Tue, 17 Aug 2010 09:37:57 +0200 -Subject: [PATCH 04/23] init: update systemd service files - ---- - init/udev-retry.service.in | 4 ++-- - init/udev-settle.service.in | 2 +- - 2 files changed, 3 insertions(+), 3 deletions(-) - -diff --git a/init/udev-retry.service.in b/init/udev-retry.service.in -index 7667899..d8ed8a8 100644 ---- a/init/udev-retry.service.in -+++ b/init/udev-retry.service.in -@@ -4,9 +4,9 @@ DefaultDependencies=no - After=local-fs.target udev.service - - [Service] --Type=finish -+Type=oneshot - ValidNoProcess=yes --ExecStart=@sbindir@/udevadm trigger --type=failed -+ExecStart=@sbindir@/udevadm trigger --type=failed --action=add - - [Install] - WantedBy=sysinit.target -diff --git a/init/udev-settle.service.in b/init/udev-settle.service.in -index 0594d72..4db61f2 100644 ---- a/init/udev-settle.service.in -+++ b/init/udev-settle.service.in -@@ -4,7 +4,7 @@ DefaultDependencies=no - After=udev.service - - [Service] --Type=finish -+Type=oneshot - ValidNoProcess=yes - ExecStart=@sbindir@/udevadm settle - --- -1.7.2.2 - diff --git a/0005-init-update-systemd-service-files.patch b/0005-init-update-systemd-service-files.patch deleted file mode 100644 index e7865d7..0000000 --- a/0005-init-update-systemd-service-files.patch +++ /dev/null @@ -1,38 +0,0 @@ -From bd078c90b97c73ba5fe7475947e6ecd20e2eb048 Mon Sep 17 00:00:00 2001 -From: Kay Sievers -Date: Tue, 17 Aug 2010 18:53:57 +0200 -Subject: [PATCH 05/23] init: update systemd service files - ---- - init/udev-retry.service.in | 1 - - init/udev-settle.service.in | 2 +- - 2 files changed, 1 insertions(+), 2 deletions(-) - -diff --git a/init/udev-retry.service.in b/init/udev-retry.service.in -index d8ed8a8..7a0819c 100644 ---- a/init/udev-retry.service.in -+++ b/init/udev-retry.service.in -@@ -5,7 +5,6 @@ After=local-fs.target udev.service - - [Service] - Type=oneshot --ValidNoProcess=yes - ExecStart=@sbindir@/udevadm trigger --type=failed --action=add - - [Install] -diff --git a/init/udev-settle.service.in b/init/udev-settle.service.in -index 4db61f2..4cb33aa 100644 ---- a/init/udev-settle.service.in -+++ b/init/udev-settle.service.in -@@ -5,7 +5,7 @@ After=udev.service - - [Service] - Type=oneshot --ValidNoProcess=yes -+RemainAfterExit=yes - ExecStart=@sbindir@/udevadm settle - - [Install] --- -1.7.2.2 - diff --git a/0006-udev-acl-do-not-mistake-all-SCSI-processor-devices-f.patch b/0006-udev-acl-do-not-mistake-all-SCSI-processor-devices-f.patch deleted file mode 100644 index 0864ad4..0000000 --- a/0006-udev-acl-do-not-mistake-all-SCSI-processor-devices-f.patch +++ /dev/null @@ -1,33 +0,0 @@ -From 3bd7b89dc40c4a0440ee5fce2ea907971bfcfb10 Mon Sep 17 00:00:00 2001 -From: Marco d'Itri -Date: Wed, 18 Aug 2010 13:35:25 +0200 -Subject: [PATCH 06/23] udev-acl: do not mistake all SCSI "processor" devices for scanner - -Both rules can be removed since now libsane sets libsane_matched also -for SCSI scanners. - -http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=589751 ---- - extras/udev-acl/70-acl.rules | 6 +----- - 1 files changed, 1 insertions(+), 5 deletions(-) - -diff --git a/extras/udev-acl/70-acl.rules b/extras/udev-acl/70-acl.rules -index 6ec04ee..c7134bc 100644 ---- a/extras/udev-acl/70-acl.rules -+++ b/extras/udev-acl/70-acl.rules -@@ -13,11 +13,7 @@ SUBSYSTEM=="usb", ENV{ID_USB_INTERFACES}=="*:060101:*", TAG+="udev-acl" - # digicams with proprietary protocol - ENV{ID_GPHOTO2}=="*?", TAG+="udev-acl" - --# SCSI scanners --KERNEL=="sg[0-9]*", ATTRS{type}=="6", TAG+="udev-acl" --KERNEL=="sg[0-9]*", ATTRS{type}=="3", ATTRS{vendor}=="HP|EPSON|Epson", TAG+="udev-acl" -- --# USB scanners -+# SCSI and USB scanners - ENV{libsane_matched}=="yes", TAG+="udev-acl" - - # HPLIP devices (necessary for ink level check and HP tool maintenance) --- -1.7.2.2 - diff --git a/0007-init-add-udev-to-description-in-systemd-service-file.patch b/0007-init-add-udev-to-description-in-systemd-service-file.patch deleted file mode 100644 index bb13a7b..0000000 --- a/0007-init-add-udev-to-description-in-systemd-service-file.patch +++ /dev/null @@ -1,47 +0,0 @@ -From d15b727ef1375c665057c0fa278b2ea3778b8d3d Mon Sep 17 00:00:00 2001 -From: Kay Sievers -Date: Thu, 19 Aug 2010 08:48:44 +0200 -Subject: [PATCH 07/23] init: add 'udev -' to description in systemd service files - ---- - init/udev-retry.service.in | 2 +- - init/udev-settle.service.in | 2 +- - init/udev.service.in | 2 +- - 3 files changed, 3 insertions(+), 3 deletions(-) - -diff --git a/init/udev-retry.service.in b/init/udev-retry.service.in -index 7a0819c..a6612da 100644 ---- a/init/udev-retry.service.in -+++ b/init/udev-retry.service.in -@@ -1,5 +1,5 @@ - [Unit] --Description=re-trigger failed events after filesystems are available -+Description=udev - re-trigger failed events after filesystems are available - DefaultDependencies=no - After=local-fs.target udev.service - -diff --git a/init/udev-settle.service.in b/init/udev-settle.service.in -index 4cb33aa..578a24f 100644 ---- a/init/udev-settle.service.in -+++ b/init/udev-settle.service.in -@@ -1,5 +1,5 @@ - [Unit] --Description=wait until full initialization -+Description=udev - wait until full initialization - DefaultDependencies=no - After=udev.service - -diff --git a/init/udev.service.in b/init/udev.service.in -index e95cb47..5a63b77 100644 ---- a/init/udev.service.in -+++ b/init/udev.service.in -@@ -1,5 +1,5 @@ - [Unit] --Description=/dev and kernel device manager -+Description=udev - /dev and kernel device manager - DefaultDependencies=no - Before=sysinit.target - --- -1.7.2.2 - diff --git a/0008-udevd-add-pid-to-kmsg-logs.patch b/0008-udevd-add-pid-to-kmsg-logs.patch deleted file mode 100644 index 5b7a8df..0000000 --- a/0008-udevd-add-pid-to-kmsg-logs.patch +++ /dev/null @@ -1,41 +0,0 @@ -From c25bfbfb1b20781698ff3c8cbc884a9e190052ee Mon Sep 17 00:00:00 2001 -From: Kay Sievers -Date: Thu, 19 Aug 2010 08:49:43 +0200 -Subject: [PATCH 08/23] udevd: add pid to kmsg logs - ---- - udev/udev-event.c | 4 ++-- - udev/udevd.c | 2 +- - 2 files changed, 3 insertions(+), 3 deletions(-) - -diff --git a/udev/udev-event.c b/udev/udev-event.c -index 9b5326b..ae523f8 100644 ---- a/udev/udev-event.c -+++ b/udev/udev-event.c -@@ -454,8 +454,8 @@ static void rename_netif_kernel_log(struct ifreq ifr) - return; - } - -- fprintf(f, "<6>udev: renamed network interface %s to %s\n", -- ifr.ifr_name, ifr.ifr_newname); -+ fprintf(f, "<6>udev[%u]: renamed network interface %s to %s\n", -+ getpid(), ifr.ifr_name, ifr.ifr_newname); - fclose(f); - } - -diff --git a/udev/udevd.c b/udev/udevd.c -index 61b76f5..ad2ca3b 100644 ---- a/udev/udevd.c -+++ b/udev/udevd.c -@@ -1298,7 +1298,7 @@ int main(int argc, char *argv[]) - - f = fopen("/dev/kmsg", "w"); - if (f != NULL) { -- fprintf(f, "<6>udev: starting version " VERSION "\n"); -+ fprintf(f, "<6>udev[%u]: starting version " VERSION "\n", getpid()); - fclose(f); - } - --- -1.7.2.2 - diff --git a/0009-init-edit-systemd-service-descriptions.patch b/0009-init-edit-systemd-service-descriptions.patch deleted file mode 100644 index 45b8119..0000000 --- a/0009-init-edit-systemd-service-descriptions.patch +++ /dev/null @@ -1,47 +0,0 @@ -From 4c9b12a7aa57e43e568b78da9cbed4138b1292df Mon Sep 17 00:00:00 2001 -From: Kay Sievers -Date: Thu, 19 Aug 2010 18:02:20 +0200 -Subject: [PATCH 09/23] init: edit systemd service descriptions - ---- - init/udev-retry.service.in | 2 +- - init/udev-settle.service.in | 2 +- - init/udev.service.in | 2 +- - 3 files changed, 3 insertions(+), 3 deletions(-) - -diff --git a/init/udev-retry.service.in b/init/udev-retry.service.in -index a6612da..ab8241b 100644 ---- a/init/udev-retry.service.in -+++ b/init/udev-retry.service.in -@@ -1,5 +1,5 @@ - [Unit] --Description=udev - re-trigger failed events after filesystems are available -+Description=udev Retry Failed Events - DefaultDependencies=no - After=local-fs.target udev.service - -diff --git a/init/udev-settle.service.in b/init/udev-settle.service.in -index 578a24f..d58ea9c 100644 ---- a/init/udev-settle.service.in -+++ b/init/udev-settle.service.in -@@ -1,5 +1,5 @@ - [Unit] --Description=udev - wait until full initialization -+Description=udev Wait for Complete Device Initialization - DefaultDependencies=no - After=udev.service - -diff --git a/init/udev.service.in b/init/udev.service.in -index 5a63b77..b07f4db 100644 ---- a/init/udev.service.in -+++ b/init/udev.service.in -@@ -1,5 +1,5 @@ - [Unit] --Description=udev - /dev and kernel device manager -+Description=udev Kernel Device Manager - DefaultDependencies=no - Before=sysinit.target - --- -1.7.2.2 - diff --git a/0011-udev-7-Point-out-required-extension-and-remove-some-.patch b/0011-udev-7-Point-out-required-extension-and-remove-some-.patch deleted file mode 100644 index bd75f26..0000000 --- a/0011-udev-7-Point-out-required-extension-and-remove-some-.patch +++ /dev/null @@ -1,42 +0,0 @@ -From 6593e8961afbe0b74d5a67c545a991c7733e88df Mon Sep 17 00:00:00 2001 -From: Martin Pitt -Date: Fri, 20 Aug 2010 12:19:23 +0200 -Subject: [PATCH 11/23] udev(7): Point out required extension, and remove some confusion - -Rules files must end in .rules. - -Also drop the redundant and confusing sentence about "file names must be -unique". What is really meant is explained in a better way in the paragraph -above. - -https://launchpad.net/bugs/616108 ---- - udev/udev.xml | 11 ++++++----- - 1 files changed, 6 insertions(+), 5 deletions(-) - -diff --git a/udev/udev.xml b/udev/udev.xml -index 20c394c..336b203 100644 ---- a/udev/udev.xml -+++ b/udev/udev.xml -@@ -75,12 +75,13 @@ - the custom rules directory /etc/udev/rules.d/ - and the temporary rules directory /dev/.udev/rules.d/. - All rule files are sorted and processed in lexical order, regardless -- in which of these directories they live. -+ in which of these directories they live. Files in -+ /etc/udev/rules.d/ have precedence over files with -+ the same name in /lib/udev/rules.d/. This can be -+ used to ignore a default rules file if needed. - -- Rule files are required to have a unique name, duplicate file names -- are ignored. Files in /etc/udev/rules.d/ have precedence -- over files with the same name in /lib/udev/rules.d/. This -- can be used to ignore a default rules file if needed. -+ Rule files must end in .rules, other extensions -+ are ignored. - - Every line in the rules file contains at least one key value pair. - There are two kind of keys, match and assignment keys. --- -1.7.2.2 - diff --git a/0012-keymap-Add-Onkyo-PC.patch b/0012-keymap-Add-Onkyo-PC.patch deleted file mode 100644 index e7b283b..0000000 --- a/0012-keymap-Add-Onkyo-PC.patch +++ /dev/null @@ -1,63 +0,0 @@ -From acf865b68e1a5c78677537b373b6e082c287fc27 Mon Sep 17 00:00:00 2001 -From: Martin Pitt -Date: Sun, 22 Aug 2010 11:00:34 +0200 -Subject: [PATCH 12/23] keymap: Add Onkyo PC - -Thanks to Pau Oliva! - -https://launchpad.net/bugs/612529 ---- - Makefile.am | 1 + - extras/keymap/95-keymap.rules | 2 ++ - extras/keymap/keymaps/onkyo | 14 ++++++++++++++ - 3 files changed, 17 insertions(+), 0 deletions(-) - create mode 100644 extras/keymap/keymaps/onkyo - -diff --git a/Makefile.am b/Makefile.am -index 77df6ab..512de34 100644 ---- a/Makefile.am -+++ b/Makefile.am -@@ -555,6 +555,7 @@ dist_udevkeymap_DATA = \ - extras/keymap/keymaps/module-sony \ - extras/keymap/keymaps/module-sony-old \ - extras/keymap/keymaps/olpc-xo \ -+ extras/keymap/keymaps/onkyo \ - extras/keymap/keymaps/oqo-model2 \ - extras/keymap/keymaps/samsung-other \ - extras/keymap/keymaps/samsung-sq1us \ -diff --git a/extras/keymap/95-keymap.rules b/extras/keymap/95-keymap.rules -index 2241422..e9d5721 100644 ---- a/extras/keymap/95-keymap.rules -+++ b/extras/keymap/95-keymap.rules -@@ -127,6 +127,8 @@ ENV{DMI_VENDOR}=="TOSHIBA", ATTR{[dmi/id]product_name}=="Satellite M30X", RUN+=" - - ENV{DMI_VENDOR}=="OQO Inc.*", ATTR{[dmi/id]product_name}=="OQO Model 2*", RUN+="keymap $name oqo-model2" - -+ENV{DMI_VENDOR}=="ONKYO CORPORATION", ATTR{[dmi/id]product_name}=="ONKYOPC", RUN+="keymap $name onkyo" -+ - ENV{DMI_VENDOR}=="ASUS", RUN+="keymap $name asus" - - ENV{DMI_VENDOR}=="VIA", ATTR{[dmi/id]product_name}=="K8N800", ATTR{[dmi/id]product_version}=="VT8204B", RUN+="keymap $name 0x81 prog1" -diff --git a/extras/keymap/keymaps/onkyo b/extras/keymap/keymaps/onkyo -new file mode 100644 -index 0000000..7dd80a1 ---- /dev/null -+++ b/extras/keymap/keymaps/onkyo -@@ -0,0 +1,14 @@ -+0xA0 mute # Fn+D -+0xAE volumedown # Fn+F -+0xB0 volumeup # Fn+G -+0xDF sleep # Fn+W -+0xE0 bluetooth # Fn+H -+0xE2 cyclewindows # Fn+Esc -+0xEE battery # Fn+Q -+0xF0 media # Fn+R -+0xF5 switchvideomode # Fn+E -+0xF6 camera # Fn+T -+0xF7 f22 # Fn+Y (touchpad toggle) -+0xF8 brightnessup # Fn+S -+0xF9 brightnessdown # Fn+A -+0xFB wlan # Fn+J --- -1.7.2.2 - diff --git a/0013-keymap-Add-HP-G60.patch b/0013-keymap-Add-HP-G60.patch deleted file mode 100644 index cbeb33c..0000000 --- a/0013-keymap-Add-HP-G60.patch +++ /dev/null @@ -1,26 +0,0 @@ -From 92cffb0bd18bd8fd245666a519ad0e54dc537031 Mon Sep 17 00:00:00 2001 -From: Martin Pitt -Date: Mon, 23 Aug 2010 10:47:28 +0200 -Subject: [PATCH 13/23] keymap: Add HP G60 - -https://launchpad.net/bugs/554944 ---- - extras/keymap/95-keymap.rules | 2 +- - 1 files changed, 1 insertions(+), 1 deletions(-) - -diff --git a/extras/keymap/95-keymap.rules b/extras/keymap/95-keymap.rules -index e9d5721..5656de9 100644 ---- a/extras/keymap/95-keymap.rules -+++ b/extras/keymap/95-keymap.rules -@@ -72,7 +72,7 @@ ENV{DMI_VENDOR}=="Hewlett-Packard*", RUN+="keymap $name hewlett-packard" - ENV{DMI_VENDOR}=="Hewlett-Packard*", ATTR{[dmi/id]product_name}=="*[tT][aA][bB][lL][eE][tT]*", RUN+="keymap $name hewlett-packard-tablet" - ENV{DMI_VENDOR}=="Hewlett-Packard*", ATTR{[dmi/id]product_name}=="*[pP][aA][vV][iI][lL][iI][oO][nN]*", RUN+="keymap $name hewlett-packard-pavilion" - ENV{DMI_VENDOR}=="Hewlett-Packard*", ATTR{[dmi/id]product_name}=="*Compaq*|*EliteBook*|*2230s*", RUN+="keymap $name hewlett-packard-compaq_elitebook" --ENV{DMI_VENDOR}=="Hewlett-Packard*", ATTR{[dmi/id]product_name}=="*2510p*|*2530p*", RUN+="keymap $name hewlett-packard-2510p_2530p" -+ENV{DMI_VENDOR}=="Hewlett-Packard*", ATTR{[dmi/id]product_name}=="*2510p*|*2530p*|HP G60 Notebook PC", RUN+="keymap $name hewlett-packard-2510p_2530p" - ENV{DMI_VENDOR}=="Hewlett-Packard*", ATTR{[dmi/id]product_name}=="*[tT][xX]2*", RUN+="keymap $name hewlett-packard-tx2" - ENV{DMI_VENDOR}=="Hewlett-Packard", ATTR{[dmi/id]product_name}=="Presario 2100*", RUN+="keymap $name hewlett-packard-presario-2100" - # HP Pavillion dv6315ea has empty DMI_VENDOR --- -1.7.2.2 - diff --git a/0014-udevd-remove-unneeded-credential-passing-from-init_n.patch b/0014-udevd-remove-unneeded-credential-passing-from-init_n.patch deleted file mode 100644 index 858371b..0000000 --- a/0014-udevd-remove-unneeded-credential-passing-from-init_n.patch +++ /dev/null @@ -1,58 +0,0 @@ -From 13f90be7a33353fdbcd4a389630a05c608bdf2a4 Mon Sep 17 00:00:00 2001 -From: Kay Sievers -Date: Wed, 25 Aug 2010 16:26:54 +0200 -Subject: [PATCH 14/23] udevd: remove unneeded credential passing from init_notify() - ---- - udev/udevd.c | 17 ----------------- - 1 files changed, 0 insertions(+), 17 deletions(-) - -diff --git a/udev/udevd.c b/udev/udevd.c -index ad2ca3b..374a4e0 100644 ---- a/udev/udevd.c -+++ b/udev/udevd.c -@@ -964,15 +964,10 @@ static int init_notify(const char *state) - int fd = -1, r; - struct msghdr msghdr; - struct iovec iovec; -- struct ucred *ucred; - union { - struct sockaddr sa; - struct sockaddr_un un; - } sockaddr; -- union { -- struct cmsghdr cmsghdr; -- uint8_t buf[CMSG_SPACE(sizeof(struct ucred))]; -- } control; - const char *e; - - if (!(e = getenv("NOTIFY_SOCKET"))) { -@@ -1002,16 +997,6 @@ static int init_notify(const char *state) - iovec.iov_base = (char*) state; - iovec.iov_len = strlen(state); - -- memset(&control, 0, sizeof(control)); -- control.cmsghdr.cmsg_level = SOL_SOCKET; -- control.cmsghdr.cmsg_type = SCM_CREDENTIALS; -- control.cmsghdr.cmsg_len = CMSG_LEN(sizeof(struct ucred)); -- -- ucred = (struct ucred*) CMSG_DATA(&control.cmsghdr); -- ucred->pid = getpid(); -- ucred->uid = getuid(); -- ucred->gid = getgid(); -- - memset(&msghdr, 0, sizeof(msghdr)); - msghdr.msg_name = &sockaddr; - msghdr.msg_namelen = sizeof(sa_family_t) + strlen(e); -@@ -1019,8 +1004,6 @@ static int init_notify(const char *state) - msghdr.msg_namelen = sizeof(struct sockaddr_un); - msghdr.msg_iov = &iovec; - msghdr.msg_iovlen = 1; -- msghdr.msg_control = &control; -- msghdr.msg_controllen = control.cmsghdr.cmsg_len; - - if (sendmsg(fd, &msghdr, MSG_NOSIGNAL) < 0) { - r = -errno; --- -1.7.2.2 - diff --git a/0015-Add-support-for-oom_score_adj.patch b/0015-Add-support-for-oom_score_adj.patch deleted file mode 100644 index e00e50d..0000000 --- a/0015-Add-support-for-oom_score_adj.patch +++ /dev/null @@ -1,48 +0,0 @@ -From c61eea9459045c2c9032a0c98234985a371fac58 Mon Sep 17 00:00:00 2001 -From: Luca Tettamanti -Date: Mon, 23 Aug 2010 14:35:37 +0200 -Subject: [PATCH 15/23] Add support for oom_score_adj - -/proc//oom_adj has been deprecated (kernel v2.6.36) due to the -rework of the badness heuristic; oom_score_adj is the replacement. -Keep a fallback to the old interface for compatibility with older -kernels. - -See http://git.kernel.org/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commitdiff;h=a63d83f427fbce97a6cea0db2e64b0eb8435cd10 - -Signed-off-by: Martin Pitt ---- - udev/udevd.c | 15 +++++++++++---- - 1 files changed, 11 insertions(+), 4 deletions(-) - -diff --git a/udev/udevd.c b/udev/udevd.c -index 374a4e0..0ec3c3d 100644 ---- a/udev/udevd.c -+++ b/udev/udevd.c -@@ -1285,12 +1285,19 @@ int main(int argc, char *argv[]) - fclose(f); - } - -- /* OOM_DISABLE == -17 */ -- fd = open("/proc/self/oom_adj", O_RDWR); -+ fd = open("/proc/self/oom_score_adj", O_RDWR); - if (fd < 0) { -- err(udev, "error disabling OOM: %m\n"); -+ /* Fallback to old interface */ -+ fd = open("/proc/self/oom_adj", O_RDWR); -+ if (fd < 0) { -+ err(udev, "error disabling OOM: %m\n"); -+ } else { -+ /* OOM_DISABLE == -17 */ -+ write(fd, "-17", 3); -+ close(fd); -+ } - } else { -- write(fd, "-17", 3); -+ write(fd, "-1000", 5); - close(fd); - } - --- -1.7.2.2 - diff --git a/0016-keymap-Fix-Sony-VAIO-VGN-SZ2HP-B.patch b/0016-keymap-Fix-Sony-VAIO-VGN-SZ2HP-B.patch deleted file mode 100644 index d5c7fff..0000000 --- a/0016-keymap-Fix-Sony-VAIO-VGN-SZ2HP-B.patch +++ /dev/null @@ -1,28 +0,0 @@ -From 38b5ccbcf7f3643ea8180a8186cfe3e5fa9cb983 Mon Sep 17 00:00:00 2001 -From: Martin Pitt -Date: Wed, 25 Aug 2010 17:02:51 +0200 -Subject: [PATCH 16/23] keymap: Fix Sony VAIO VGN-SZ2HP/B - -Reportedly this needs the module-sony keymap, not the -old one. - -https://launchpad.net/bugs/613578 ---- - extras/keymap/95-keymap.rules | 2 +- - 1 files changed, 1 insertions(+), 1 deletions(-) - -diff --git a/extras/keymap/95-keymap.rules b/extras/keymap/95-keymap.rules -index 5656de9..cb066bd 100644 ---- a/extras/keymap/95-keymap.rules -+++ b/extras/keymap/95-keymap.rules -@@ -46,7 +46,7 @@ ENV{DMI_VENDOR}=="ASUS*", KERNELS=="input*", ATTRS{name}=="Asus Extra Buttons", - ENV{DMI_VENDOR}=="Sony*", KERNELS=="input*", ATTRS{name}=="Sony Vaio Keys", RUN+="keymap $name module-sony" - - # Older Vaios have some different keys --ENV{DMI_VENDOR}=="Sony*", ATTR{[dmi/id]product_name}=="*PCG-C1*|*PCG-K25*|*PCG-F1*|*PCG-F2*|*PCG-F3*|*PCG-F4*|*PCG-F5*|*PCG-F6*|*PCG-FX*|*PCG-FRV*|*PCG-GR*|*PCG-TR*|*PCG-NV*|*PCG-Z*|*VGN-S360*|*VGN-SZ2HP_B*", ATTRS{name}=="Sony Vaio Keys", RUN+="keymap $name module-sony-old" -+ENV{DMI_VENDOR}=="Sony*", ATTR{[dmi/id]product_name}=="*PCG-C1*|*PCG-K25*|*PCG-F1*|*PCG-F2*|*PCG-F3*|*PCG-F4*|*PCG-F5*|*PCG-F6*|*PCG-FX*|*PCG-FRV*|*PCG-GR*|*PCG-TR*|*PCG-NV*|*PCG-Z*|*VGN-S360*", ATTRS{name}=="Sony Vaio Keys", RUN+="keymap $name module-sony-old" - - # - # The following rules belong to standard i8042 AT keyboard with high key codes. --- -1.7.2.2 - diff --git a/0017-udev-7-manpage-Fix-description-of-attr.patch b/0017-udev-7-manpage-Fix-description-of-attr.patch deleted file mode 100644 index 6b41ecf..0000000 --- a/0017-udev-7-manpage-Fix-description-of-attr.patch +++ /dev/null @@ -1,32 +0,0 @@ -From 83184d008ba23724fd30996440534c0633a0d0aa Mon Sep 17 00:00:00 2001 -From: Martin Pitt -Date: Fri, 27 Aug 2010 16:54:52 +0200 -Subject: [PATCH 17/23] udev(7) manpage: Fix description of $attr - -Fix the manpage to describe the real behaviour of $attr: It doesn't search all -parent devices any more, just the one selected by KERNELS etc. - -https://launchpad.net/bugs/348513 ---- - udev/udev.xml | 5 +++-- - 1 files changed, 3 insertions(+), 2 deletions(-) - -diff --git a/udev/udev.xml b/udev/udev.xml -index 336b203..6085dff 100644 ---- a/udev/udev.xml -+++ b/udev/udev.xml -@@ -578,8 +578,9 @@ - - The value of a sysfs attribute found at the device, where - all keys of the rule have matched. If the matching device does not have -- such an attribute, follow the chain of parent devices and use the value -- of the first attribute that matches. -+ such an attribute, and a previous KERNELS, SUBSYSTEMS, DRIVERS, or -+ ATTRS test selected a parent device, use the attribute from that -+ parent device. - If the attribute is a symlink, the last element of the symlink target is - returned as the value. - --- -1.7.2.2 - diff --git a/0018-gudev-fix-crash-if-netlink-is-not-available.patch b/0018-gudev-fix-crash-if-netlink-is-not-available.patch deleted file mode 100644 index 2a5872e..0000000 --- a/0018-gudev-fix-crash-if-netlink-is-not-available.patch +++ /dev/null @@ -1,57 +0,0 @@ -From e4dcdc4ab232bcbbe61a2026c16e647d9302cdd2 Mon Sep 17 00:00:00 2001 -From: Martin Pitt -Date: Fri, 27 Aug 2010 18:12:59 +0200 -Subject: [PATCH 18/23] gudev: fix crash if netlink is not available - -gudev_client_new() assumes that priv->monitor is never NULL, but this happens -on older kernels. Let's not crash client programs because of that. - -https://launchpad.net/bugs/581527 ---- - extras/gudev/gudevclient.c | 18 ++++++++++++------ - 1 files changed, 12 insertions(+), 6 deletions(-) - -diff --git a/extras/gudev/gudevclient.c b/extras/gudev/gudevclient.c -index fa31f70..f5f7a19 100644 ---- a/extras/gudev/gudevclient.c -+++ b/extras/gudev/gudevclient.c -@@ -93,6 +93,8 @@ monitor_event (GIOChannel *source, - GUdevDevice *device; - struct udev_device *udevice; - -+ if (client->priv->monitor == NULL) -+ goto out; - udevice = udev_monitor_receive_device (client->priv->monitor); - if (udevice == NULL) - goto out; -@@ -216,17 +218,21 @@ g_udev_client_constructed (GObject *object) - *s = '\0'; - } - -- udev_monitor_filter_add_match_subsystem_devtype (client->priv->monitor, subsystem, devtype); -+ if (client->priv->monitor != NULL) -+ udev_monitor_filter_add_match_subsystem_devtype (client->priv->monitor, subsystem, devtype); - - g_free (subsystem); - } - - /* listen to events, and buffer them */ -- udev_monitor_enable_receiving (client->priv->monitor); -- -- channel = g_io_channel_unix_new (udev_monitor_get_fd (client->priv->monitor)); -- client->priv->watch_id = g_io_add_watch (channel, G_IO_IN, monitor_event, client); -- g_io_channel_unref (channel); -+ if (client->priv->monitor != NULL) -+ { -+ udev_monitor_enable_receiving (client->priv->monitor); -+ channel = g_io_channel_unix_new (udev_monitor_get_fd (client->priv->monitor)); -+ client->priv->watch_id = g_io_add_watch (channel, G_IO_IN, monitor_event, client); -+ g_io_channel_unref (channel); -+ } else -+ client->priv->watch_id = NULL; - } - - if (G_OBJECT_CLASS (g_udev_client_parent_class)->constructed != NULL) --- -1.7.2.2 - diff --git a/0019-keymap-Fix-Acer-TravelMate-4720.patch b/0019-keymap-Fix-Acer-TravelMate-4720.patch deleted file mode 100644 index 35a9922..0000000 --- a/0019-keymap-Fix-Acer-TravelMate-4720.patch +++ /dev/null @@ -1,28 +0,0 @@ -From d17c065e28fa4baac90b02b4913c7ef32d54f3c7 Mon Sep 17 00:00:00 2001 -From: Martin Pitt -Date: Fri, 27 Aug 2010 18:48:53 +0200 -Subject: [PATCH 19/23] keymap: Fix Acer TravelMate 4720 - -The previous change just fixed the Bluetooth key, but Screen Lock and Browser -also need to be changed. - -https://launchpad.net/bugs/569815 ---- - extras/keymap/95-keymap.rules | 1 + - 1 files changed, 1 insertions(+), 0 deletions(-) - -diff --git a/extras/keymap/95-keymap.rules b/extras/keymap/95-keymap.rules -index cb066bd..913b380 100644 ---- a/extras/keymap/95-keymap.rules -+++ b/extras/keymap/95-keymap.rules -@@ -85,6 +85,7 @@ ENV{DMI_VENDOR}=="Acer*", RUN+="keymap $name acer" - ENV{DMI_VENDOR}=="Acer*", ATTR{[dmi/id]product_name}=="Extensa*", ATTR{[dmi/id]product_name}=="*5210*|*5220*|*5610*|*5620*|*5720*", RUN+="keymap $name 0xEE screenlock" - ENV{DMI_VENDOR}=="Acer*", ATTR{[dmi/id]product_name}=="TravelMate*C300*", RUN+="keymap $name acer-travelmate_c300" - ENV{DMI_VENDOR}=="Acer*", ATTR{[dmi/id]product_name}=="TravelMate*6292*|TravelMate*8471*|TravelMate*4720*|Aspire 1810T*|AO751h|AO531h", RUN+="keymap $name 0xD9 bluetooth" -+ENV{DMI_VENDOR}=="Acer*", ATTR{[dmi/id]product_name}=="TravelMate*4720*", RUN+="keymap $name 0xB2 www 0xEE screenlock" - ENV{DMI_VENDOR}=="Acer*", ATTR{[dmi/id]product_name}=="TravelMate 6593|Aspire 1640", RUN+="keymap $name 0xB2 www 0xEE screenlock" - ENV{DMI_VENDOR}=="Acer*", ATTR{[dmi/id]product_name}=="Aspire 6920", RUN+="keymap $name acer-aspire_6920" - ENV{DMI_VENDOR}=="Acer*", ATTR{[dmi/id]product_name}=="Aspire 5920G", RUN+="keymap $name acer-aspire_5920g" --- -1.7.2.2 - diff --git a/0020-cdrom_id-Fix-DVD-RW-media-detection.patch b/0020-cdrom_id-Fix-DVD-RW-media-detection.patch deleted file mode 100644 index 4a91a4e..0000000 --- a/0020-cdrom_id-Fix-DVD-RW-media-detection.patch +++ /dev/null @@ -1,53 +0,0 @@ -From 2458db3edd8d66827b34978ff471dff8f879e9ab Mon Sep 17 00:00:00 2001 -From: Martin Pitt -Date: Mon, 30 Aug 2010 15:33:26 +0200 -Subject: [PATCH 20/23] cdrom_id: Fix DVD-RW media detection - -Commit cf2205a19 applied the "restricted overwrite" vs. "sequential" DVD-RW -test to feature_profiles() (which reads the drive capabilities), which caused -every DVD medium to be detected as ID_CDROM_MEDIA_DVD_RW. Now apply it to -cd_profiles() instead, to just check the current profile. ---- - extras/cdrom_id/cdrom_id.c | 13 +++++++------ - 1 files changed, 7 insertions(+), 6 deletions(-) - -diff --git a/extras/cdrom_id/cdrom_id.c b/extras/cdrom_id/cdrom_id.c -index f9d6e0b..8480d7b 100644 ---- a/extras/cdrom_id/cdrom_id.c -+++ b/extras/cdrom_id/cdrom_id.c -@@ -297,14 +297,9 @@ static int feature_profiles(struct udev *udev, const unsigned char *profiles, si - cd_dvd_ram = 1; - break; - case 0x13: -- info(udev, "profile 0x%02x media_dvd_rw\n", profile); -- cd_media_dvd_rw = 1; -- cd_media_dvd_rw_ro = 1; -- break; - case 0x14: - info(udev, "profile 0x%02x dvd_rw\n", profile); - cd_dvd_rw = 1; -- cd_media_dvd_rw_seq = 1; - break; - case 0x1B: - info(udev, "profile 0x%02x dvd_plus_r\n", profile); -@@ -486,10 +481,16 @@ static int cd_profiles(struct udev *udev, int fd) - cd_media_dvd_ram = 1; - break; - case 0x13: -+ info(udev, "profile 0x%02x media_dvd_rw_ro\n", cur_profile); -+ cd_media = 1; -+ cd_media_dvd_rw = 1; -+ cd_media_dvd_rw_ro = 1; -+ break; - case 0x14: -- info(udev, "profile 0x%02x media_dvd_rw\n", cur_profile); -+ info(udev, "profile 0x%02x media_dvd_rw_seq\n", cur_profile); - cd_media = 1; - cd_media_dvd_rw = 1; -+ cd_media_dvd_rw_seq = 1; - break; - case 0x1B: - info(udev, "profile 0x%02x media_dvd_plus_r\n", cur_profile); --- -1.7.2.2 - diff --git a/0021-cdrom_id-Fix-DVD-blank-detection-for-sloppy-firmware.patch b/0021-cdrom_id-Fix-DVD-blank-detection-for-sloppy-firmware.patch deleted file mode 100644 index d033307..0000000 --- a/0021-cdrom_id-Fix-DVD-blank-detection-for-sloppy-firmware.patch +++ /dev/null @@ -1,42 +0,0 @@ -From 5e267ea5a36de0b2a9a8965ca93dd45bbd6b1a8b Mon Sep 17 00:00:00 2001 -From: Jan Drzewiecki -Date: Tue, 31 Aug 2010 00:37:28 +0200 -Subject: [PATCH 21/23] cdrom_id: Fix DVD blank detection for sloppy firmware - -Reportedly, many CD drive firmwares will only consider the MSB in a READ -command, thus if we request 17 blocks to be read, we'll actually only get 16 in -many cases, and thus miss out the interesting sector #17. This would lead to -falsely considering nonempty DVDs as blank. - -Fetch 32 blocks now, which should work everywhere. - -Signed-off-by: Martin Pitt ---- - extras/cdrom_id/cdrom_id.c | 4 ++-- - 1 files changed, 2 insertions(+), 2 deletions(-) - -diff --git a/extras/cdrom_id/cdrom_id.c b/extras/cdrom_id/cdrom_id.c -index 8480d7b..0153af6 100644 ---- a/extras/cdrom_id/cdrom_id.c -+++ b/extras/cdrom_id/cdrom_id.c -@@ -590,7 +590,7 @@ static int cd_media_info(struct udev *udev, int fd) - * always "complete", DVD-RAM are "other" or "complete" if the disc is - * write protected; we need to check the contents if it is blank */ - if ((cd_media_dvd_rw_ro || cd_media_dvd_plus_rw || cd_media_dvd_plus_rw_dl || cd_media_dvd_ram) && (header[2] & 3) > 1) { -- unsigned char buffer[17 * 2048]; -+ unsigned char buffer[32 * 2048]; - unsigned char result, len; - int block, offset; - -@@ -661,7 +661,7 @@ static int cd_media_info(struct udev *udev, int fd) - scsi_cmd_init(udev, &sc, buffer, sizeof(buffer)); - scsi_cmd_set(udev, &sc, 0, 0x28); - scsi_cmd_set(udev, &sc, 5, 0); -- scsi_cmd_set(udev, &sc, 8, 17); -+ scsi_cmd_set(udev, &sc, 8, 32); - scsi_cmd_set(udev, &sc, 9, 0); - err = scsi_cmd_run(udev, &sc, fd, buffer, sizeof(buffer)); - if ((err != 0)) { --- -1.7.2.2 - diff --git a/0022-set-SELinux-context-on-add-but-not-on-change-events.patch b/0022-set-SELinux-context-on-add-but-not-on-change-events.patch deleted file mode 100644 index aa99300..0000000 --- a/0022-set-SELinux-context-on-add-but-not-on-change-events.patch +++ /dev/null @@ -1,35 +0,0 @@ -From 326c5fc3ea684825629eccaf33a548759162a539 Mon Sep 17 00:00:00 2001 -From: Kay Sievers -Date: Tue, 31 Aug 2010 21:29:21 +0200 -Subject: [PATCH 22/23] set SELinux context on 'add' but not on 'change' events - ---- - udev/udev-node.c | 9 ++++++++- - 1 files changed, 8 insertions(+), 1 deletions(-) - -diff --git a/udev/udev-node.c b/udev/udev-node.c -index 228b3eb..c8113f1 100644 ---- a/udev/udev-node.c -+++ b/udev/udev-node.c -@@ -56,10 +56,17 @@ int udev_node_mknod(struct udev_device *dev, const char *file, mode_t mode, uid_ - info(udev, "set permissions %s, %#o, uid=%u, gid=%u\n", file, mode, uid, gid); - chmod(file, mode); - chown(file, uid, gid); -- udev_selinux_lsetfilecon(udev, file, mode); - } else { - info(udev, "preserve permissions %s, %#o, uid=%u, gid=%u\n", file, mode, uid, gid); - } -+ /* -+ * Set initial selinux file context only on add events. -+ * We set the proper context on bootup (triger) or for newly -+ * added devices, but we don't change it later, in case -+ * something else has set a custom context in the meantime. -+ */ -+ if (strcmp(udev_device_get_action(dev), "add") == 0) -+ udev_selinux_lsetfilecon(udev, file, mode); - /* always update timestamp when we re-use the node, like on media change events */ - utimensat(AT_FDCWD, file, NULL, 0); - } else { --- -1.7.2.2 - diff --git a/0023-do-not-create-persistent-name-rules-for-KVM-network-.patch b/0023-do-not-create-persistent-name-rules-for-KVM-network-.patch deleted file mode 100644 index 16b7dab..0000000 --- a/0023-do-not-create-persistent-name-rules-for-KVM-network-.patch +++ /dev/null @@ -1,28 +0,0 @@ -From af29bf0966994bc233282148f519e12ea29e1c5a Mon Sep 17 00:00:00 2001 -From: Marco d'Itri -Date: Tue, 31 Aug 2010 21:44:34 +0200 -Subject: [PATCH 23/23] do not create persistent name rules for KVM network interfaces - -The virtual interfaces created by KVM are stable, 54:52:00 is the MAC-48 -range of KVM. ---- - .../75-persistent-net-generator.rules | 3 +++ - 1 files changed, 3 insertions(+), 0 deletions(-) - -diff --git a/extras/rule_generator/75-persistent-net-generator.rules b/extras/rule_generator/75-persistent-net-generator.rules -index a9dfdce..8119d0e 100644 ---- a/extras/rule_generator/75-persistent-net-generator.rules -+++ b/extras/rule_generator/75-persistent-net-generator.rules -@@ -29,6 +29,9 @@ ENV{MATCHADDR}="$attr{address}" - # match interface type - ENV{MATCHIFTYPE}="$attr{type}" - -+# ignore KVM virtual interfaces -+ENV{MATCHADDR}=="54:52:00:*", GOTO="persistent_net_generator_end" -+ - # These vendors are known to violate the local MAC address assignment scheme - # Interlan, DEC (UNIBUS or QBUS), Apollo, Cisco, Racal-Datacom - ENV{MATCHADDR}=="02:07:01:*", GOTO="globally_administered_whitelist" --- -1.7.2.2 - From dfa8b8fed24b48109bfa560c4fdc83a508174402 Mon Sep 17 00:00:00 2001 From: Harald Hoyer Date: Fri, 12 Nov 2010 14:20:37 +0100 Subject: [PATCH 083/142] - do not create mount point dirs in /dev --- udev.spec | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/udev.spec b/udev.spec index d38aa03..8f6eb58 100644 --- a/udev.spec +++ b/udev.spec @@ -7,7 +7,7 @@ Summary: A rule-based device node and kernel event manager Name: udev Version: 164 -Release: 1%{?dist} +Release: 2%{?dist} License: GPLv2+ Group: System Environment/Base Provides: udev-persistent = %{version}-%{release} @@ -263,9 +263,6 @@ rm -rf $RPM_BUILD_ROOT %attr(0755,root,root) %dir %{udev_scriptdir}/ %attr(0755,root,root) %dir %{udev_scriptdir}/devices/ %attr(0755,root,root) %dir %{udev_scriptdir}/devices/net -%attr(0755,root,root) %dir %{udev_scriptdir}/devices/hugepages -%attr(0755,root,root) %dir %{udev_scriptdir}/devices/pts -%attr(0755,root,root) %dir %{udev_scriptdir}/devices/shm %{udev_scriptdir}/devices/MAKEDEV %attr(666,root,root) %dev(c,10,200) %{udev_scriptdir}/devices/net/tun %attr(600,root,root) %dev(c,108,0) %{udev_scriptdir}/devices/ppp @@ -353,6 +350,9 @@ rm -rf $RPM_BUILD_ROOT %attr(0644,root,root) %{_libdir}/pkgconfig/gudev-1.0* %changelog +* Fri Nov 12 2010 Harald Hoyer 164-2 +- do not create mount point dirs in /dev + * Fri Oct 29 2010 Harald Hoyer 164-1 - version 164 - skip start_udev with systemd From 1efa3f58ceeab69ecf402bc1be624b73b17d454f Mon Sep 17 00:00:00 2001 From: Harald Hoyer Date: Fri, 12 Nov 2010 15:29:16 +0100 Subject: [PATCH 084/142] - enlarged the import buffer to fix the ressize bugs Resolves: rhbz#652318 --- udev-ressize.patch | 24 ++++++++++++++++++++++++ udev.spec | 9 ++++++++- 2 files changed, 32 insertions(+), 1 deletion(-) create mode 100644 udev-ressize.patch diff --git a/udev-ressize.patch b/udev-ressize.patch new file mode 100644 index 0000000..788b859 --- /dev/null +++ b/udev-ressize.patch @@ -0,0 +1,24 @@ +commit 851dd4ddc5aeb1ee517145d9e3334c2017595321 +Author: Harald Hoyer +Date: Fri Nov 12 14:39:14 2010 +0100 + + udev-rules.c: change import property buffer to 16384 bytes + + import_program_into_properties() should have the same line length as + import_file_into_properties() + + see also https://bugzilla.redhat.com/show_bug.cgi?id=652318 + +diff --git a/udev/udev-rules.c b/udev/udev-rules.c +index 52f121c..ab7b6ae 100644 +--- a/udev/udev-rules.c ++++ b/udev/udev-rules.c +@@ -751,7 +751,7 @@ static int import_program_into_properties(struct udev_device *dev, const char *p + { + struct udev *udev = udev_device_get_udev(dev); + char **envp; +- char result[4096]; ++ char result[UTIL_LINE_SIZE]; + size_t reslen; + char *line; + diff --git a/udev.spec b/udev.spec index 8f6eb58..15dda4c 100644 --- a/udev.spec +++ b/udev.spec @@ -7,7 +7,7 @@ Summary: A rule-based device node and kernel event manager Name: udev Version: 164 -Release: 2%{?dist} +Release: 3%{?dist} License: GPLv2+ Group: System Environment/Base Provides: udev-persistent = %{version}-%{release} @@ -17,6 +17,8 @@ Source: ftp://ftp.kernel.org/pub/linux/utils/kernel/hotplug/%{name}-%{version}.t Source1: start_udev Source2: udev-post.init +Patch1: udev-ressize.patch + ExclusiveOS: Linux URL: http://www.kernel.org/pub/linux/utils/kernel/hotplug/udev.html BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n) @@ -113,6 +115,7 @@ glib-based applications using libudev functionality. %prep %setup -q +%patch1 -p1 %build libtoolize -f -c @@ -350,6 +353,10 @@ rm -rf $RPM_BUILD_ROOT %attr(0644,root,root) %{_libdir}/pkgconfig/gudev-1.0* %changelog +* Fri Nov 12 2010 Harald Hoyer 164-3 +- enlarged the import buffer to fix the ressize bugs +Resolves: rhbz#652318 + * Fri Nov 12 2010 Harald Hoyer 164-2 - do not create mount point dirs in /dev From 9a010ac3e50b5c293aa0bb23d67a1b440b796867 Mon Sep 17 00:00:00 2001 From: Harald Hoyer Date: Fri, 12 Nov 2010 15:49:43 +0100 Subject: [PATCH 085/142] - add ACLs for PDA devices Resolves: rhbz#642435 --- udev-pda-acl.patch | 20 ++++++++++++++++++++ udev.spec | 8 +++++++- 2 files changed, 27 insertions(+), 1 deletion(-) create mode 100644 udev-pda-acl.patch diff --git a/udev-pda-acl.patch b/udev-pda-acl.patch new file mode 100644 index 0000000..b48103a --- /dev/null +++ b/udev-pda-acl.patch @@ -0,0 +1,20 @@ +commit d69207c3f20f0af2a5e510515ae5473f4fe54476 +Author: Harald Hoyer +Date: Fri Nov 12 15:44:34 2010 +0100 + + 70-acl.rules: add ACLs for ID_PDA devices + +diff --git a/extras/udev-acl/70-acl.rules b/extras/udev-acl/70-acl.rules +index c7134bc..66375de 100644 +--- a/extras/udev-acl/70-acl.rules ++++ b/extras/udev-acl/70-acl.rules +@@ -47,6 +47,9 @@ SUBSYSTEM=="misc", KERNEL=="kvm", TAG+="udev-acl" + # smart-card readers + ENV{ID_SMARTCARD_READER}=="*?", TAG+="udev-acl" + ++# PDA devices ++ENV{ID_PDA}=="*?", TAG+="udev-acl" ++ + # joysticks + SUBSYSTEM=="input", ENV{ID_INPUT_JOYSTICK}=="?*", TAG+="udev-acl" + diff --git a/udev.spec b/udev.spec index 15dda4c..0ae5b6b 100644 --- a/udev.spec +++ b/udev.spec @@ -7,7 +7,7 @@ Summary: A rule-based device node and kernel event manager Name: udev Version: 164 -Release: 3%{?dist} +Release: 4%{?dist} License: GPLv2+ Group: System Environment/Base Provides: udev-persistent = %{version}-%{release} @@ -18,6 +18,7 @@ Source1: start_udev Source2: udev-post.init Patch1: udev-ressize.patch +Patch2: udev-pda-acl.patch ExclusiveOS: Linux URL: http://www.kernel.org/pub/linux/utils/kernel/hotplug/udev.html @@ -116,6 +117,7 @@ glib-based applications using libudev functionality. %prep %setup -q %patch1 -p1 +%patch2 -p1 %build libtoolize -f -c @@ -353,6 +355,10 @@ rm -rf $RPM_BUILD_ROOT %attr(0644,root,root) %{_libdir}/pkgconfig/gudev-1.0* %changelog +* Fri Nov 12 2010 Harald Hoyer 164-4 +- add ACLs for PDA devices +Resolves: rhbz#642435 + * Fri Nov 12 2010 Harald Hoyer 164-3 - enlarged the import buffer to fix the ressize bugs Resolves: rhbz#652318 From 3f6713d0dfc903fd176e3e6731feb0905ce3400e Mon Sep 17 00:00:00 2001 From: Bastien Nocera Date: Thu, 25 Nov 2010 16:05:53 +0000 Subject: [PATCH 086/142] - Add patches to fix touchpad toggle key handling --- ...map-Make-touchpad-buttons-consistent.patch | 232 ++++++++++++++++++ ...dd-force-release-for-HP-touchpad-off.patch | 56 +++++ udev.spec | 9 +- 3 files changed, 296 insertions(+), 1 deletion(-) create mode 100644 0001-extras-keymap-Make-touchpad-buttons-consistent.patch create mode 100644 0001-keymap-Add-force-release-for-HP-touchpad-off.patch diff --git a/0001-extras-keymap-Make-touchpad-buttons-consistent.patch b/0001-extras-keymap-Make-touchpad-buttons-consistent.patch new file mode 100644 index 0000000..bd36b5f --- /dev/null +++ b/0001-extras-keymap-Make-touchpad-buttons-consistent.patch @@ -0,0 +1,232 @@ +From a1ca5f60e0770299c5c5f21bd371f5823802412b Mon Sep 17 00:00:00 2001 +From: Bastien Nocera +Date: Thu, 4 Nov 2010 23:58:56 +0000 +Subject: [PATCH] extras/keymap: Make touchpad buttons consistent + +We'll need to standardise on the Touchpad related keys in udev, kernel, and +X.org. I selected F21 for XF86TouchpadToggle, F22 for XF86TouchpadOn and F23 +for XF86TouchpadOff. + +See: +https://bugs.freedesktop.org/show_bug.cgi?id=31333 + +Signed-off-by: Martin Pitt +--- + extras/keymap/keymaps/acer | 2 +- + extras/keymap/keymaps/dell | 4 ++-- + extras/keymap/keymaps/everex-xt5000 | 2 +- + extras/keymap/keymaps/hewlett-packard-2510p_2530p | 4 ++-- + extras/keymap/keymaps/hewlett-packard-pavilion | 4 ++-- + extras/keymap/keymaps/hewlett-packard-tx2 | 2 +- + .../lenovo-thinkpad-usb-keyboard-trackpoint | 2 +- + extras/keymap/keymaps/lg-x110 | 4 ++-- + extras/keymap/keymaps/micro-star | 2 +- + extras/keymap/keymaps/module-lenovo | 2 +- + extras/keymap/keymaps/onkyo | 2 +- + extras/keymap/keymaps/samsung-other | 2 +- + extras/keymap/keymaps/samsung-sx20s | 4 ++-- + extras/keymap/keymaps/toshiba-satellite_a110 | 4 ++-- + extras/keymap/keymaps/toshiba-satellite_m30x | 4 ++-- + extras/keymap/keymaps/zepto-znote | 2 +- + 16 files changed, 23 insertions(+), 23 deletions(-) + +diff --git a/extras/keymap/keymaps/acer b/extras/keymap/keymaps/acer +index 6abe39c..4e7c297 100644 +--- a/extras/keymap/keymaps/acer ++++ b/extras/keymap/keymaps/acer +@@ -14,7 +14,7 @@ + 0xEE brightnessup # Fn+Right + 0xEF brightnessdown # Fn+Left + 0xF1 f22 # Fn+F7 Touchpad toggle (off-to-on) +-0xF2 f22 # Fn+F7 Touchpad toggle (on-to-off) ++0xF2 f23 # Fn+F7 Touchpad toggle (on-to-off) + 0xF3 prog2 # "P2" programmable button + 0xF4 prog1 # "P1" programmable button + 0xF5 presentation +diff --git a/extras/keymap/keymaps/dell b/extras/keymap/keymaps/dell +index 1a2e433..fbbb903 100644 +--- a/extras/keymap/keymaps/dell ++++ b/extras/keymap/keymaps/dell +@@ -21,9 +21,9 @@ + 0x99 nextsong # Front panel next song + 0x9A setup # Tablet tools button + 0x9B switchvideomode # Display Toggle button +-0x9E f22 #touchpad toggle ++0x9E f21 #touchpad toggle + 0xA2 playpause # Front panel play/pause + 0xA4 stopcd # Front panel stop + 0xED media # MediaDirect button + 0xD8 screenlock # FIXME: Tablet lock button +-0xD9 f22 # touchpad toggle ++0xD9 f21 # touchpad toggle +diff --git a/extras/keymap/keymaps/everex-xt5000 b/extras/keymap/keymaps/everex-xt5000 +index 53bdd7a..4823a83 100644 +--- a/extras/keymap/keymaps/everex-xt5000 ++++ b/extras/keymap/keymaps/everex-xt5000 +@@ -1,5 +1,5 @@ + 0x5C media +-0x65 f22 # Fn+F5 Touchpad toggle ++0x65 f21 # Fn+F5 Touchpad toggle + 0x67 prog3 # Fan Speed Control button + 0x6F brightnessup + 0x7F brightnessdown +diff --git a/extras/keymap/keymaps/hewlett-packard-2510p_2530p b/extras/keymap/keymaps/hewlett-packard-2510p_2530p +index 2bc70c2..41ad2e9 100644 +--- a/extras/keymap/keymaps/hewlett-packard-2510p_2530p ++++ b/extras/keymap/keymaps/hewlett-packard-2510p_2530p +@@ -1,2 +1,2 @@ +-0xD8 f22 # touchpad off +-0xD9 f23 # touchpad on ++0xD8 f23 # touchpad off ++0xD9 f22 # touchpad on +diff --git a/extras/keymap/keymaps/hewlett-packard-pavilion b/extras/keymap/keymaps/hewlett-packard-pavilion +index a55d2b7..3d3cefc 100644 +--- a/extras/keymap/keymaps/hewlett-packard-pavilion ++++ b/extras/keymap/keymaps/hewlett-packard-pavilion +@@ -1,3 +1,3 @@ + 0x88 media # FIXME: quick play +-0xD8 f22 # touchpad off +-0xD9 f23 # touchpad on ++0xD8 f23 # touchpad off ++0xD9 f22 # touchpad on +diff --git a/extras/keymap/keymaps/hewlett-packard-tx2 b/extras/keymap/keymaps/hewlett-packard-tx2 +index 206c004..36a690f 100644 +--- a/extras/keymap/keymaps/hewlett-packard-tx2 ++++ b/extras/keymap/keymaps/hewlett-packard-tx2 +@@ -1,3 +1,3 @@ + 0xC2 media +-0xD8 f22 # Toggle touchpad button on tx2 (OFF) ++0xD8 f23 # Toggle touchpad button on tx2 (OFF) + 0xD9 f22 # Toggle touchpad button on tx2 (ON) +diff --git a/extras/keymap/keymaps/lenovo-thinkpad-usb-keyboard-trackpoint b/extras/keymap/keymaps/lenovo-thinkpad-usb-keyboard-trackpoint +index 7612f79..bc91470 100644 +--- a/extras/keymap/keymaps/lenovo-thinkpad-usb-keyboard-trackpoint ++++ b/extras/keymap/keymaps/lenovo-thinkpad-usb-keyboard-trackpoint +@@ -2,7 +2,7 @@ + 0x90013 battery # Fn+F3 + 0x90014 wlan # Fn+F5 + 0x90016 switchvideomode # Fn+F7 +-0x90017 f22 # Fn+F8 touchpadtoggle ++0x90017 f21 # Fn+F8 touchpadtoggle + 0x90019 suspend # Fn+F12 + 0x9001A brightnessup # Fn+Home + 0x9001B brightnessdown # Fn+End +diff --git a/extras/keymap/keymaps/lg-x110 b/extras/keymap/keymaps/lg-x110 +index a61cf3d..ba08cba 100644 +--- a/extras/keymap/keymaps/lg-x110 ++++ b/extras/keymap/keymaps/lg-x110 +@@ -6,7 +6,7 @@ + 0xB3 suspend # Fn-F12 + 0xDF sleep # Fn-F4 + # 0xE2 bluetooth # satellite dish2 +-0xE4 f22 # Fn-F5 Touchpad disable ++0xE4 f21 # Fn-F5 Touchpad disable + 0xF6 wlan # Fn-F6 + 0xF7 reserved # brightnessdown # Fn-Down +-0xF8 reserved # brightnessup # Fn-Up +\ No newline at end of file ++0xF8 reserved # brightnessup # Fn-Up +diff --git a/extras/keymap/keymaps/micro-star b/extras/keymap/keymaps/micro-star +index 0de5ae6..4a43869 100644 +--- a/extras/keymap/keymaps/micro-star ++++ b/extras/keymap/keymaps/micro-star +@@ -4,7 +4,7 @@ + 0xB2 www # e button + 0xDF sleep # Fn-F12 + 0xE2 bluetooth # satellite dish2 +-0xE4 f22 # Fn-F3 Touchpad disable ++0xE4 f21 # Fn-F3 Touchpad disable + 0xEC email # envelope button + 0xEE camera # Fn-F6 camera disable + 0xF6 wlan # satellite dish1 +diff --git a/extras/keymap/keymaps/module-lenovo b/extras/keymap/keymaps/module-lenovo +index 7c597bd..9cb74b2 100644 +--- a/extras/keymap/keymaps/module-lenovo ++++ b/extras/keymap/keymaps/module-lenovo +@@ -3,7 +3,7 @@ + 0x3 sleep # Fn+F4 + 0x4 wlan # Fn+F5 + 0x6 switchvideomode # Fn+F7 +-0x7 f22 # Fn+F8 touchpadtoggle ++0x7 f21 # Fn+F8 touchpadtoggle + 0x8 f24 # Fn+F9 undock + 0xB suspend # Fn+F12 + 0xF brightnessup # Fn+Home +diff --git a/extras/keymap/keymaps/onkyo b/extras/keymap/keymaps/onkyo +index 7dd80a1..ee864ad 100644 +--- a/extras/keymap/keymaps/onkyo ++++ b/extras/keymap/keymaps/onkyo +@@ -8,7 +8,7 @@ + 0xF0 media # Fn+R + 0xF5 switchvideomode # Fn+E + 0xF6 camera # Fn+T +-0xF7 f22 # Fn+Y (touchpad toggle) ++0xF7 f21 # Fn+Y (touchpad toggle) + 0xF8 brightnessup # Fn+S + 0xF9 brightnessdown # Fn+A + 0xFB wlan # Fn+J +diff --git a/extras/keymap/keymaps/samsung-other b/extras/keymap/keymaps/samsung-other +index 6a0928c..3ac0c2f 100644 +--- a/extras/keymap/keymaps/samsung-other ++++ b/extras/keymap/keymaps/samsung-other +@@ -11,4 +11,4 @@ + 0xB3 prog3 # Fn+F8 switch power mode (battery/dynamic/performance) + 0xB4 wlan # Fn+F9 (X60P) + 0xF7 f22 # Fn+F10 Touchpad on +-0xF9 f22 # Fn+F10 Touchpad off ++0xF9 f23 # Fn+F10 Touchpad off +diff --git a/extras/keymap/keymaps/samsung-sx20s b/extras/keymap/keymaps/samsung-sx20s +index daf7d3e..9d954ee 100644 +--- a/extras/keymap/keymaps/samsung-sx20s ++++ b/extras/keymap/keymaps/samsung-sx20s +@@ -1,4 +1,4 @@ + 0x74 mute + 0x75 mute +-0x77 f21 # FIXME: Touchpad on +-0x79 f21 # FIXME: Touchpad off ++0x77 f22 # Touchpad on ++0x79 f23 # Touchpad off +diff --git a/extras/keymap/keymaps/toshiba-satellite_a110 b/extras/keymap/keymaps/toshiba-satellite_a110 +index 0f2aaec..1429409 100644 +--- a/extras/keymap/keymaps/toshiba-satellite_a110 ++++ b/extras/keymap/keymaps/toshiba-satellite_a110 +@@ -1,8 +1,8 @@ + 0x92 stop + 0x93 www + 0x94 media +-0x9E f21 # FIXME: Touchpad on +-0x9F f21 # FIXME: Touchpad off ++0x9E f22 # Touchpad on ++0x9F f23 # Touchpad off + 0xB9 nextsong + 0xD9 brightnessup + 0xEE screenlock +diff --git a/extras/keymap/keymaps/toshiba-satellite_m30x b/extras/keymap/keymaps/toshiba-satellite_m30x +index cf6d912..9280ae0 100644 +--- a/extras/keymap/keymaps/toshiba-satellite_m30x ++++ b/extras/keymap/keymaps/toshiba-satellite_m30x +@@ -2,6 +2,6 @@ + 0xd9 brightnessup + 0xee screenlock + 0x93 media +-0x9e prog1 #touchpad_enable +-0x9f prog2 #touchpad_disable ++0x9e f22 #touchpad_enable ++0x9f f23 #touchpad_disable + +diff --git a/extras/keymap/keymaps/zepto-znote b/extras/keymap/keymaps/zepto-znote +index e076516..cf72fda 100644 +--- a/extras/keymap/keymaps/zepto-znote ++++ b/extras/keymap/keymaps/zepto-znote +@@ -1,7 +1,7 @@ + 0x93 switchvideomode # Fn+F3 Toggle Video Output + 0x95 brightnessdown # Fn+F4 Brightness Down + 0x91 brightnessup # Fn+F5 Brightness Up +-0xA5 f22 # Fn+F6 Disable Touchpad ++0xA5 f23 # Fn+F6 Disable Touchpad + 0xA6 f22 # Fn+F6 Enable Touchpad + 0xA7 bluetooth # Fn+F10 Enable Bluetooth + 0XA9 bluetooth # Fn+F10 Disable Bluetooth +-- +1.7.3.2 + diff --git a/0001-keymap-Add-force-release-for-HP-touchpad-off.patch b/0001-keymap-Add-force-release-for-HP-touchpad-off.patch new file mode 100644 index 0000000..1ba3551 --- /dev/null +++ b/0001-keymap-Add-force-release-for-HP-touchpad-off.patch @@ -0,0 +1,56 @@ +From ecfad20871e855d9e54d3a528cf9219ce5c93626 Mon Sep 17 00:00:00 2001 +From: Bastien Nocera +Date: Mon, 1 Nov 2010 16:29:09 +0000 +Subject: [PATCH] keymap: Add force release for HP touchpad off + +Force the touchpad off/on keys getting released, as they usually +only send a "repeat". + +https://bugzilla.redhat.com/show_bug.cgi?id=623239 + +Signed-off-by: Martin Pitt +--- + Makefile.am | 1 + + extras/keymap/95-keyboard-force-release.rules | 5 +++++ + extras/keymap/force-release-maps/hp-other | 3 +++ + 3 files changed, 9 insertions(+), 0 deletions(-) + create mode 100644 extras/keymap/force-release-maps/hp-other + +diff --git a/Makefile.am b/Makefile.am +index 3a95046..032eb28 100644 +--- a/Makefile.am ++++ b/Makefile.am +@@ -601,6 +601,7 @@ dist_udevkeymap_DATA = \ + + udevkeymapforcereldir = $(libexecdir)/keymaps/force-release + dist_udevkeymapforcerel_DATA = \ ++ extras/keymap/force-release-maps/hp-other \ + extras/keymap/force-release-maps/samsung-other \ + extras/keymap/force-release-maps/common-volume-keys + +diff --git a/extras/keymap/95-keyboard-force-release.rules b/extras/keymap/95-keyboard-force-release.rules +index 562dc8d..6f7c0fd 100644 +--- a/extras/keymap/95-keyboard-force-release.rules ++++ b/extras/keymap/95-keyboard-force-release.rules +@@ -35,4 +35,9 @@ ENV{DMI_VENDOR}=="TOSHIBA", ATTR{[dmi/id]product_name}=="Satellite U300|Satellit + + ENV{DMI_VENDOR}=="Viooo Corporation", ATTR{[dmi/id]product_name}=="PT17", RUN+="keyboard-force-release.sh $devpath common-volume-keys" + ++# These are all the HP laptops that setup a touchpad toggle key ++ENV{DMI_VENDOR}=="Hewlett-Packard*", ATTR{[dmi/id]product_name}=="*[pP][aA][vV][iI][lL][iI][oO][nN]*", RUN+="keyboard-force-release.sh $devpath hp-other" ++ENV{DMI_VENDOR}=="Hewlett-Packard*", ATTR{[dmi/id]product_name}=="*[tT][xX]2*", RUN+="keyboard-force-release.sh $devpath hp-other" ++ENV{DMI_VENDOR}=="Hewlett-Packard*", ATTR{[dmi/id]product_name}=="*2510p*|*2530p*|HP G60 Notebook PC", RUN+="keyboard-force-release.sh $devpath hp-other" ++ + LABEL="force_release_end" +diff --git a/extras/keymap/force-release-maps/hp-other b/extras/keymap/force-release-maps/hp-other +new file mode 100644 +index 0000000..6621370 +--- /dev/null ++++ b/extras/keymap/force-release-maps/hp-other +@@ -0,0 +1,3 @@ ++# list of scancodes (hex or decimal), optional comment ++0xd8 # Touchpad off ++0xd9 # Touchpad on +-- +1.7.3.2 + diff --git a/udev.spec b/udev.spec index 0ae5b6b..5ca3750 100644 --- a/udev.spec +++ b/udev.spec @@ -7,7 +7,7 @@ Summary: A rule-based device node and kernel event manager Name: udev Version: 164 -Release: 4%{?dist} +Release: 5%{?dist} License: GPLv2+ Group: System Environment/Base Provides: udev-persistent = %{version}-%{release} @@ -19,6 +19,8 @@ Source2: udev-post.init Patch1: udev-ressize.patch Patch2: udev-pda-acl.patch +Patch3: 0001-keymap-Add-force-release-for-HP-touchpad-off.patch +Patch4: 0001-extras-keymap-Make-touchpad-buttons-consistent.patch ExclusiveOS: Linux URL: http://www.kernel.org/pub/linux/utils/kernel/hotplug/udev.html @@ -118,6 +120,8 @@ glib-based applications using libudev functionality. %setup -q %patch1 -p1 %patch2 -p1 +%patch3 -p1 +%patch4 -p1 %build libtoolize -f -c @@ -355,6 +359,9 @@ rm -rf $RPM_BUILD_ROOT %attr(0644,root,root) %{_libdir}/pkgconfig/gudev-1.0* %changelog +* Thu Nov 25 2010 Bastien Nocera 164-5 +- Add patches to fix touchpad toggle key handling + * Fri Nov 12 2010 Harald Hoyer 164-4 - add ACLs for PDA devices Resolves: rhbz#642435 From 15fa57fca0f4a9d31950a71f325f0638bdd329c1 Mon Sep 17 00:00:00 2001 From: Harald Hoyer Date: Mon, 6 Dec 2010 09:50:38 +0100 Subject: [PATCH 087/142] udev.spec: fixed pre/post udev kill loop --- udev.spec | 58 +++++++++++++++++++++++++++++++++---------------------- 1 file changed, 35 insertions(+), 23 deletions(-) diff --git a/udev.spec b/udev.spec index 5ca3750..823fa5d 100644 --- a/udev.spec +++ b/udev.spec @@ -7,7 +7,7 @@ Summary: A rule-based device node and kernel event manager Name: udev Version: 164 -Release: 5%{?dist} +Release: 6%{?dist} License: GPLv2+ Group: System Environment/Base Provides: udev-persistent = %{version}-%{release} @@ -181,17 +181,24 @@ install -m 0755 %{SOURCE2} $RPM_BUILD_ROOT%{_sysconfdir}/rc.d/init.d/udev-post %preun if [ "$1" -eq 0 -a -f %{_initrddir}/udev ]; then - if [ -x /sbin/pidof ]; then - pid=$(/sbin/pidof -c udevd) - if [ -n "$pid" ]; then - kill $pid - fi - fi - /sbin/chkconfig --del udev + if test -x /usr/bin/stat -a \ + "$(/usr/bin/stat -Lc '%%D-%%i' /)" = "$(/usr/bin/stat -Lc '%%D-%%i' /proc/1/root)"; then + if [ -x /sbin/pidof ]; then + pid=$(/sbin/pidof -c udevd) + while [ -n "$pid" ]; do + for p in $pid; do + kill $hard $p 2>/dev/null + done + sleep 0.2 + pid=$(/sbin/pidof -c udevd) + hard="-9" + done + fi + fi + /sbin/chkconfig --del udev fi if [ "$1" -eq 0 ]; then - /sbin/chkconfig --del udev-post -# /usr/bin/systemd-install --system --realize disable udev.service >/dev/null 2>&1 || : + /sbin/chkconfig --del udev-post fi exit 0 @@ -203,19 +210,21 @@ getent group floppy >/dev/null || /usr/sbin/groupadd -g 19 floppy || : # kill daemon if we are not in a chroot if test -f /proc/1/exe -a -d /proc/1/root; then - if test -x /usr/bin/stat -a "$(/usr/bin/stat -Lc '%%D-%%i' /)" = "$(/usr/bin/stat -Lc '%%D-%%i' /proc/1/root)"; then - if test -x /sbin/udevd -a -x /sbin/pidof ; then - /sbin/udevadm control --stop-exec-queue - pid=$(/sbin/pidof -c udevd) - while [ -n "$pid" ]; do - for p in $pid; do - kill $hard $p; - done - pid=$(/sbin/pidof -c udevd) - hard="-9" - done - fi - fi + if test -x /usr/bin/stat -a \ + "$(/usr/bin/stat -Lc '%%D-%%i' /)" = "$(/usr/bin/stat -Lc '%%D-%%i' /proc/1/root)"; then + if test -x /sbin/udevd -a -x /sbin/pidof ; then + /sbin/udevadm control --stop-exec-queue + pid=$(/sbin/pidof -c udevd) + while [ -n "$pid" ]; do + for p in $pid; do + kill $hard $p 2>/dev/null + done + sleep 0.2 + pid=$(/sbin/pidof -c udevd) + hard="-9" + done + fi + fi fi exit 0 @@ -359,6 +368,9 @@ rm -rf $RPM_BUILD_ROOT %attr(0644,root,root) %{_libdir}/pkgconfig/gudev-1.0* %changelog +* Mon Dec 06 2010 Harald Hoyer 164-6 +- fixed kill loop + * Thu Nov 25 2010 Bastien Nocera 164-5 - Add patches to fix touchpad toggle key handling From ad72e1d94476392befa54e773acf746b7f6eabc7 Mon Sep 17 00:00:00 2001 From: Harald Hoyer Date: Mon, 6 Dec 2010 10:20:50 +0100 Subject: [PATCH 088/142] udev.spec: removed MAKEDEV symlink --- udev.spec | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/udev.spec b/udev.spec index 823fa5d..95eaf57 100644 --- a/udev.spec +++ b/udev.spec @@ -169,8 +169,6 @@ done mkdir -p $RPM_BUILD_ROOT%{udev_scriptdir}/{,devices,devices/net,devices/pts,devices/shm,devices/hugepages} -ln -s /sbin/MAKEDEV $RPM_BUILD_ROOT%{udev_scriptdir}/devices/MAKEDEV - mkdir -p $RPM_BUILD_ROOT%{_datadir}/udev install -m 0755 %{SOURCE1} $RPM_BUILD_ROOT/sbin/start_udev @@ -281,7 +279,6 @@ rm -rf $RPM_BUILD_ROOT %attr(0755,root,root) %dir %{udev_scriptdir}/ %attr(0755,root,root) %dir %{udev_scriptdir}/devices/ %attr(0755,root,root) %dir %{udev_scriptdir}/devices/net -%{udev_scriptdir}/devices/MAKEDEV %attr(666,root,root) %dev(c,10,200) %{udev_scriptdir}/devices/net/tun %attr(600,root,root) %dev(c,108,0) %{udev_scriptdir}/devices/ppp %attr(666,root,root) %dev(c,10,229) %{udev_scriptdir}/devices/fuse @@ -369,7 +366,10 @@ rm -rf $RPM_BUILD_ROOT %changelog * Mon Dec 06 2010 Harald Hoyer 164-6 +- removed MAKEDEV symlink +Resolves: rhbz#660091 - fixed kill loop +Resolves: rhbz#657651 * Thu Nov 25 2010 Bastien Nocera 164-5 - Add patches to fix touchpad toggle key handling From 863c17e8e2af04abcb2b8c32f813072e72c79a24 Mon Sep 17 00:00:00 2001 From: Harald Hoyer Date: Wed, 2 Feb 2011 18:35:27 +0100 Subject: [PATCH 089/142] - fixed: network device renaming 2-step exceeds IFNAMSIZ Resolves: rhbz#673675 --- udev.spec | 19 ++++++++++--------- 1 file changed, 10 insertions(+), 9 deletions(-) diff --git a/udev.spec b/udev.spec index 95eaf57..d744c3a 100644 --- a/udev.spec +++ b/udev.spec @@ -7,7 +7,7 @@ Summary: A rule-based device node and kernel event manager Name: udev Version: 164 -Release: 6%{?dist} +Release: 8%{?dist} License: GPLv2+ Group: System Environment/Base Provides: udev-persistent = %{version}-%{release} @@ -21,6 +21,7 @@ Patch1: udev-ressize.patch Patch2: udev-pda-acl.patch Patch3: 0001-keymap-Add-force-release-for-HP-touchpad-off.patch Patch4: 0001-extras-keymap-Make-touchpad-buttons-consistent.patch +Patch5: udev-random_temporary_ifname.patch ExclusiveOS: Linux URL: http://www.kernel.org/pub/linux/utils/kernel/hotplug/udev.html @@ -122,6 +123,7 @@ glib-based applications using libudev functionality. %patch2 -p1 %patch3 -p1 %patch4 -p1 +%patch5 -p1 %build libtoolize -f -c @@ -278,14 +280,6 @@ rm -rf $RPM_BUILD_ROOT %attr(0755,root,root) %dir %{_sysconfdir}/udev/rules.d/ %attr(0755,root,root) %dir %{udev_scriptdir}/ %attr(0755,root,root) %dir %{udev_scriptdir}/devices/ -%attr(0755,root,root) %dir %{udev_scriptdir}/devices/net -%attr(666,root,root) %dev(c,10,200) %{udev_scriptdir}/devices/net/tun -%attr(600,root,root) %dev(c,108,0) %{udev_scriptdir}/devices/ppp -%attr(666,root,root) %dev(c,10,229) %{udev_scriptdir}/devices/fuse -%attr(660,root,lp) %dev(c,6,0) %{udev_scriptdir}/devices/lp0 -%attr(660,root,lp) %dev(c,6,1) %{udev_scriptdir}/devices/lp1 -%attr(660,root,lp) %dev(c,6,2) %{udev_scriptdir}/devices/lp2 -%attr(660,root,lp) %dev(c,6,3) %{udev_scriptdir}/devices/lp3 %attr(640,root,disk) %dev(b,7,0) %{udev_scriptdir}/devices/loop0 %attr(640,root,disk) %dev(b,7,1) %{udev_scriptdir}/devices/loop1 %attr(640,root,disk) %dev(b,7,2) %{udev_scriptdir}/devices/loop2 @@ -365,6 +359,13 @@ rm -rf $RPM_BUILD_ROOT %attr(0644,root,root) %{_libdir}/pkgconfig/gudev-1.0* %changelog +* Wed Feb 02 2011 Harald Hoyer 164-8 +- fixed: network device renaming 2-step exceeds IFNAMSIZ +Resolves: rhbz#673675 + +* Fri Jan 21 2011 Harald Hoyer 164-7 +- removed unnecessary devices from /lib/udev/devices + * Mon Dec 06 2010 Harald Hoyer 164-6 - removed MAKEDEV symlink Resolves: rhbz#660091 From c67280da85d933b01462fc718d8b421a1c22aa7e Mon Sep 17 00:00:00 2001 From: Harald Hoyer Date: Wed, 2 Feb 2011 18:35:54 +0100 Subject: [PATCH 090/142] - fixed: network device renaming 2-step exceeds IFNAMSIZ Resolves: rhbz#673675 --- udev-random_temporary_ifname.patch | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) create mode 100644 udev-random_temporary_ifname.patch diff --git a/udev-random_temporary_ifname.patch b/udev-random_temporary_ifname.patch new file mode 100644 index 0000000..ff5ad5c --- /dev/null +++ b/udev-random_temporary_ifname.patch @@ -0,0 +1,22 @@ +diff --git a/udev/udev-event.c b/udev/udev-event.c +index 0648735..5387c00 100644 +--- a/udev/udev-event.c ++++ b/udev/udev-event.c +@@ -462,6 +462,7 @@ static void rename_netif_kernel_log(struct ifreq ifr) + static int rename_netif(struct udev_event *event) + { + struct udev_device *dev = event->dev; ++ char iftmp[IFNAMSIZ]; + int sk; + struct ifreq ifr; + int loop; +@@ -492,7 +493,8 @@ static int rename_netif(struct udev_event *event) + goto out; + + /* free our own name, another process may wait for us */ +- util_strscpyl(ifr.ifr_newname, IFNAMSIZ, udev_device_get_sysname(dev), "-", event->name, NULL); ++ util_strscpyl(iftmp, IFNAMSIZ, udev_device_get_sysname(dev), "-", event->name, NULL); ++ sprintf(ifr.ifr_newname, "eth_%X",util_string_hash32(iftmp)); + err = ioctl(sk, SIOCSIFNAME, &ifr); + if (err < 0) { + err = -errno; From 243a0734e5ca5fe6e4170f552ee735a95501bdbf Mon Sep 17 00:00:00 2001 From: Harald Hoyer Date: Wed, 2 Feb 2011 18:59:23 +0100 Subject: [PATCH 091/142] - fixed: network device renaming 2-step exceeds IFNAMSIZ Resolves: rhbz#673675 --- udev-164-no-v4l1.patch | 42 ++++++++++++++++++++++++++++++++++++++++++ udev.spec | 3 +++ 2 files changed, 45 insertions(+) create mode 100644 udev-164-no-v4l1.patch diff --git a/udev-164-no-v4l1.patch b/udev-164-no-v4l1.patch new file mode 100644 index 0000000..9d9ef7c --- /dev/null +++ b/udev-164-no-v4l1.patch @@ -0,0 +1,42 @@ +diff --git a/extras/v4l_id/v4l_id.c b/extras/v4l_id/v4l_id.c +index d530a6d..e4b22bf 100644 +--- a/extras/v4l_id/v4l_id.c ++++ b/extras/v4l_id/v4l_id.c +@@ -28,7 +28,6 @@ + #include + #include + #include +-#include + #include + + int main (int argc, char *argv[]) +@@ -39,7 +38,6 @@ int main (int argc, char *argv[]) + }; + int fd; + char *device; +- struct video_capability v1cap; + struct v4l2_capability v2cap; + + while (1) { +@@ -82,20 +80,7 @@ int main (int argc, char *argv[]) + if ((v2cap.capabilities & V4L2_CAP_RADIO) > 0) + printf("radio:"); + printf("\n"); +- } else if (ioctl (fd, VIDIOCGCAP, &v1cap) == 0) { +- printf("ID_V4L_VERSION=1\n"); +- printf("ID_V4L_PRODUCT=%s\n", v1cap.name); +- printf("ID_V4L_CAPABILITIES=:"); +- if ((v1cap.type & VID_TYPE_CAPTURE) > 0) +- printf("capture:"); +- if ((v1cap.type & VID_TYPE_OVERLAY) > 0) +- printf("video_overlay:"); +- if (v1cap.audios > 0) +- printf("audio:"); +- if ((v1cap.type & VID_TYPE_TUNER) > 0) +- printf("tuner:"); +- printf("\n"); +- } ++ } + + close (fd); + return 0; diff --git a/udev.spec b/udev.spec index d744c3a..24ca8bd 100644 --- a/udev.spec +++ b/udev.spec @@ -22,6 +22,7 @@ Patch2: udev-pda-acl.patch Patch3: 0001-keymap-Add-force-release-for-HP-touchpad-off.patch Patch4: 0001-extras-keymap-Make-touchpad-buttons-consistent.patch Patch5: udev-random_temporary_ifname.patch +Patch6: udev-164-no-v4l1.patch ExclusiveOS: Linux URL: http://www.kernel.org/pub/linux/utils/kernel/hotplug/udev.html @@ -124,6 +125,7 @@ glib-based applications using libudev functionality. %patch3 -p1 %patch4 -p1 %patch5 -p1 +%patch6 -p1 %build libtoolize -f -c @@ -362,6 +364,7 @@ rm -rf $RPM_BUILD_ROOT * Wed Feb 02 2011 Harald Hoyer 164-8 - fixed: network device renaming 2-step exceeds IFNAMSIZ Resolves: rhbz#673675 +- removed v4l version 1 * Fri Jan 21 2011 Harald Hoyer 164-7 - removed unnecessary devices from /lib/udev/devices From 61095fb1d9852e736147097627a51714fff7754f Mon Sep 17 00:00:00 2001 From: Dennis Gilmore Date: Mon, 7 Feb 2011 17:57:39 -0600 Subject: [PATCH 092/142] - Rebuilt for https://fedoraproject.org/wiki/Fedora_15_Mass_Rebuild --- udev.spec | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/udev.spec b/udev.spec index 24ca8bd..49dfbb6 100644 --- a/udev.spec +++ b/udev.spec @@ -7,7 +7,7 @@ Summary: A rule-based device node and kernel event manager Name: udev Version: 164 -Release: 8%{?dist} +Release: 9%{?dist} License: GPLv2+ Group: System Environment/Base Provides: udev-persistent = %{version}-%{release} @@ -361,6 +361,9 @@ rm -rf $RPM_BUILD_ROOT %attr(0644,root,root) %{_libdir}/pkgconfig/gudev-1.0* %changelog +* Mon Feb 07 2011 Fedora Release Engineering - 164-9 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_15_Mass_Rebuild + * Wed Feb 02 2011 Harald Hoyer 164-8 - fixed: network device renaming 2-step exceeds IFNAMSIZ Resolves: rhbz#673675 From 57a491c1af046cbe4c2c8b7740cc855de4cc2224 Mon Sep 17 00:00:00 2001 From: Harald Hoyer Date: Wed, 16 Feb 2011 18:26:09 +0100 Subject: [PATCH 093/142] - renamed udev-post initscript to udev-retry to match upstream systemd service name - version 166 --- .gitignore | 2 + ...map-Make-touchpad-buttons-consistent.patch | 232 ------------------ ...dd-force-release-for-HP-touchpad-off.patch | 56 ----- sources | 4 +- udev-pda-acl.patch | 20 -- udev-random_temporary_ifname.patch | 22 -- udev-ressize.patch | 24 -- udev-post.init => udev-retry.init | 8 +- udev.spec | 42 ++-- 9 files changed, 31 insertions(+), 379 deletions(-) delete mode 100644 0001-extras-keymap-Make-touchpad-buttons-consistent.patch delete mode 100644 0001-keymap-Add-force-release-for-HP-touchpad-off.patch delete mode 100644 udev-pda-acl.patch delete mode 100644 udev-random_temporary_ifname.patch delete mode 100644 udev-ressize.patch rename udev-post.init => udev-retry.init (89%) diff --git a/.gitignore b/.gitignore index 65d08f4..ff4586d 100644 --- a/.gitignore +++ b/.gitignore @@ -1,3 +1,5 @@ udev-160.tar.bz2 /udev-164.tar.bz2 /udev-164.tar.bz2.sign +/udev-166.tar.bz2 +/udev-166.tar.bz2.sign diff --git a/0001-extras-keymap-Make-touchpad-buttons-consistent.patch b/0001-extras-keymap-Make-touchpad-buttons-consistent.patch deleted file mode 100644 index bd36b5f..0000000 --- a/0001-extras-keymap-Make-touchpad-buttons-consistent.patch +++ /dev/null @@ -1,232 +0,0 @@ -From a1ca5f60e0770299c5c5f21bd371f5823802412b Mon Sep 17 00:00:00 2001 -From: Bastien Nocera -Date: Thu, 4 Nov 2010 23:58:56 +0000 -Subject: [PATCH] extras/keymap: Make touchpad buttons consistent - -We'll need to standardise on the Touchpad related keys in udev, kernel, and -X.org. I selected F21 for XF86TouchpadToggle, F22 for XF86TouchpadOn and F23 -for XF86TouchpadOff. - -See: -https://bugs.freedesktop.org/show_bug.cgi?id=31333 - -Signed-off-by: Martin Pitt ---- - extras/keymap/keymaps/acer | 2 +- - extras/keymap/keymaps/dell | 4 ++-- - extras/keymap/keymaps/everex-xt5000 | 2 +- - extras/keymap/keymaps/hewlett-packard-2510p_2530p | 4 ++-- - extras/keymap/keymaps/hewlett-packard-pavilion | 4 ++-- - extras/keymap/keymaps/hewlett-packard-tx2 | 2 +- - .../lenovo-thinkpad-usb-keyboard-trackpoint | 2 +- - extras/keymap/keymaps/lg-x110 | 4 ++-- - extras/keymap/keymaps/micro-star | 2 +- - extras/keymap/keymaps/module-lenovo | 2 +- - extras/keymap/keymaps/onkyo | 2 +- - extras/keymap/keymaps/samsung-other | 2 +- - extras/keymap/keymaps/samsung-sx20s | 4 ++-- - extras/keymap/keymaps/toshiba-satellite_a110 | 4 ++-- - extras/keymap/keymaps/toshiba-satellite_m30x | 4 ++-- - extras/keymap/keymaps/zepto-znote | 2 +- - 16 files changed, 23 insertions(+), 23 deletions(-) - -diff --git a/extras/keymap/keymaps/acer b/extras/keymap/keymaps/acer -index 6abe39c..4e7c297 100644 ---- a/extras/keymap/keymaps/acer -+++ b/extras/keymap/keymaps/acer -@@ -14,7 +14,7 @@ - 0xEE brightnessup # Fn+Right - 0xEF brightnessdown # Fn+Left - 0xF1 f22 # Fn+F7 Touchpad toggle (off-to-on) --0xF2 f22 # Fn+F7 Touchpad toggle (on-to-off) -+0xF2 f23 # Fn+F7 Touchpad toggle (on-to-off) - 0xF3 prog2 # "P2" programmable button - 0xF4 prog1 # "P1" programmable button - 0xF5 presentation -diff --git a/extras/keymap/keymaps/dell b/extras/keymap/keymaps/dell -index 1a2e433..fbbb903 100644 ---- a/extras/keymap/keymaps/dell -+++ b/extras/keymap/keymaps/dell -@@ -21,9 +21,9 @@ - 0x99 nextsong # Front panel next song - 0x9A setup # Tablet tools button - 0x9B switchvideomode # Display Toggle button --0x9E f22 #touchpad toggle -+0x9E f21 #touchpad toggle - 0xA2 playpause # Front panel play/pause - 0xA4 stopcd # Front panel stop - 0xED media # MediaDirect button - 0xD8 screenlock # FIXME: Tablet lock button --0xD9 f22 # touchpad toggle -+0xD9 f21 # touchpad toggle -diff --git a/extras/keymap/keymaps/everex-xt5000 b/extras/keymap/keymaps/everex-xt5000 -index 53bdd7a..4823a83 100644 ---- a/extras/keymap/keymaps/everex-xt5000 -+++ b/extras/keymap/keymaps/everex-xt5000 -@@ -1,5 +1,5 @@ - 0x5C media --0x65 f22 # Fn+F5 Touchpad toggle -+0x65 f21 # Fn+F5 Touchpad toggle - 0x67 prog3 # Fan Speed Control button - 0x6F brightnessup - 0x7F brightnessdown -diff --git a/extras/keymap/keymaps/hewlett-packard-2510p_2530p b/extras/keymap/keymaps/hewlett-packard-2510p_2530p -index 2bc70c2..41ad2e9 100644 ---- a/extras/keymap/keymaps/hewlett-packard-2510p_2530p -+++ b/extras/keymap/keymaps/hewlett-packard-2510p_2530p -@@ -1,2 +1,2 @@ --0xD8 f22 # touchpad off --0xD9 f23 # touchpad on -+0xD8 f23 # touchpad off -+0xD9 f22 # touchpad on -diff --git a/extras/keymap/keymaps/hewlett-packard-pavilion b/extras/keymap/keymaps/hewlett-packard-pavilion -index a55d2b7..3d3cefc 100644 ---- a/extras/keymap/keymaps/hewlett-packard-pavilion -+++ b/extras/keymap/keymaps/hewlett-packard-pavilion -@@ -1,3 +1,3 @@ - 0x88 media # FIXME: quick play --0xD8 f22 # touchpad off --0xD9 f23 # touchpad on -+0xD8 f23 # touchpad off -+0xD9 f22 # touchpad on -diff --git a/extras/keymap/keymaps/hewlett-packard-tx2 b/extras/keymap/keymaps/hewlett-packard-tx2 -index 206c004..36a690f 100644 ---- a/extras/keymap/keymaps/hewlett-packard-tx2 -+++ b/extras/keymap/keymaps/hewlett-packard-tx2 -@@ -1,3 +1,3 @@ - 0xC2 media --0xD8 f22 # Toggle touchpad button on tx2 (OFF) -+0xD8 f23 # Toggle touchpad button on tx2 (OFF) - 0xD9 f22 # Toggle touchpad button on tx2 (ON) -diff --git a/extras/keymap/keymaps/lenovo-thinkpad-usb-keyboard-trackpoint b/extras/keymap/keymaps/lenovo-thinkpad-usb-keyboard-trackpoint -index 7612f79..bc91470 100644 ---- a/extras/keymap/keymaps/lenovo-thinkpad-usb-keyboard-trackpoint -+++ b/extras/keymap/keymaps/lenovo-thinkpad-usb-keyboard-trackpoint -@@ -2,7 +2,7 @@ - 0x90013 battery # Fn+F3 - 0x90014 wlan # Fn+F5 - 0x90016 switchvideomode # Fn+F7 --0x90017 f22 # Fn+F8 touchpadtoggle -+0x90017 f21 # Fn+F8 touchpadtoggle - 0x90019 suspend # Fn+F12 - 0x9001A brightnessup # Fn+Home - 0x9001B brightnessdown # Fn+End -diff --git a/extras/keymap/keymaps/lg-x110 b/extras/keymap/keymaps/lg-x110 -index a61cf3d..ba08cba 100644 ---- a/extras/keymap/keymaps/lg-x110 -+++ b/extras/keymap/keymaps/lg-x110 -@@ -6,7 +6,7 @@ - 0xB3 suspend # Fn-F12 - 0xDF sleep # Fn-F4 - # 0xE2 bluetooth # satellite dish2 --0xE4 f22 # Fn-F5 Touchpad disable -+0xE4 f21 # Fn-F5 Touchpad disable - 0xF6 wlan # Fn-F6 - 0xF7 reserved # brightnessdown # Fn-Down --0xF8 reserved # brightnessup # Fn-Up -\ No newline at end of file -+0xF8 reserved # brightnessup # Fn-Up -diff --git a/extras/keymap/keymaps/micro-star b/extras/keymap/keymaps/micro-star -index 0de5ae6..4a43869 100644 ---- a/extras/keymap/keymaps/micro-star -+++ b/extras/keymap/keymaps/micro-star -@@ -4,7 +4,7 @@ - 0xB2 www # e button - 0xDF sleep # Fn-F12 - 0xE2 bluetooth # satellite dish2 --0xE4 f22 # Fn-F3 Touchpad disable -+0xE4 f21 # Fn-F3 Touchpad disable - 0xEC email # envelope button - 0xEE camera # Fn-F6 camera disable - 0xF6 wlan # satellite dish1 -diff --git a/extras/keymap/keymaps/module-lenovo b/extras/keymap/keymaps/module-lenovo -index 7c597bd..9cb74b2 100644 ---- a/extras/keymap/keymaps/module-lenovo -+++ b/extras/keymap/keymaps/module-lenovo -@@ -3,7 +3,7 @@ - 0x3 sleep # Fn+F4 - 0x4 wlan # Fn+F5 - 0x6 switchvideomode # Fn+F7 --0x7 f22 # Fn+F8 touchpadtoggle -+0x7 f21 # Fn+F8 touchpadtoggle - 0x8 f24 # Fn+F9 undock - 0xB suspend # Fn+F12 - 0xF brightnessup # Fn+Home -diff --git a/extras/keymap/keymaps/onkyo b/extras/keymap/keymaps/onkyo -index 7dd80a1..ee864ad 100644 ---- a/extras/keymap/keymaps/onkyo -+++ b/extras/keymap/keymaps/onkyo -@@ -8,7 +8,7 @@ - 0xF0 media # Fn+R - 0xF5 switchvideomode # Fn+E - 0xF6 camera # Fn+T --0xF7 f22 # Fn+Y (touchpad toggle) -+0xF7 f21 # Fn+Y (touchpad toggle) - 0xF8 brightnessup # Fn+S - 0xF9 brightnessdown # Fn+A - 0xFB wlan # Fn+J -diff --git a/extras/keymap/keymaps/samsung-other b/extras/keymap/keymaps/samsung-other -index 6a0928c..3ac0c2f 100644 ---- a/extras/keymap/keymaps/samsung-other -+++ b/extras/keymap/keymaps/samsung-other -@@ -11,4 +11,4 @@ - 0xB3 prog3 # Fn+F8 switch power mode (battery/dynamic/performance) - 0xB4 wlan # Fn+F9 (X60P) - 0xF7 f22 # Fn+F10 Touchpad on --0xF9 f22 # Fn+F10 Touchpad off -+0xF9 f23 # Fn+F10 Touchpad off -diff --git a/extras/keymap/keymaps/samsung-sx20s b/extras/keymap/keymaps/samsung-sx20s -index daf7d3e..9d954ee 100644 ---- a/extras/keymap/keymaps/samsung-sx20s -+++ b/extras/keymap/keymaps/samsung-sx20s -@@ -1,4 +1,4 @@ - 0x74 mute - 0x75 mute --0x77 f21 # FIXME: Touchpad on --0x79 f21 # FIXME: Touchpad off -+0x77 f22 # Touchpad on -+0x79 f23 # Touchpad off -diff --git a/extras/keymap/keymaps/toshiba-satellite_a110 b/extras/keymap/keymaps/toshiba-satellite_a110 -index 0f2aaec..1429409 100644 ---- a/extras/keymap/keymaps/toshiba-satellite_a110 -+++ b/extras/keymap/keymaps/toshiba-satellite_a110 -@@ -1,8 +1,8 @@ - 0x92 stop - 0x93 www - 0x94 media --0x9E f21 # FIXME: Touchpad on --0x9F f21 # FIXME: Touchpad off -+0x9E f22 # Touchpad on -+0x9F f23 # Touchpad off - 0xB9 nextsong - 0xD9 brightnessup - 0xEE screenlock -diff --git a/extras/keymap/keymaps/toshiba-satellite_m30x b/extras/keymap/keymaps/toshiba-satellite_m30x -index cf6d912..9280ae0 100644 ---- a/extras/keymap/keymaps/toshiba-satellite_m30x -+++ b/extras/keymap/keymaps/toshiba-satellite_m30x -@@ -2,6 +2,6 @@ - 0xd9 brightnessup - 0xee screenlock - 0x93 media --0x9e prog1 #touchpad_enable --0x9f prog2 #touchpad_disable -+0x9e f22 #touchpad_enable -+0x9f f23 #touchpad_disable - -diff --git a/extras/keymap/keymaps/zepto-znote b/extras/keymap/keymaps/zepto-znote -index e076516..cf72fda 100644 ---- a/extras/keymap/keymaps/zepto-znote -+++ b/extras/keymap/keymaps/zepto-znote -@@ -1,7 +1,7 @@ - 0x93 switchvideomode # Fn+F3 Toggle Video Output - 0x95 brightnessdown # Fn+F4 Brightness Down - 0x91 brightnessup # Fn+F5 Brightness Up --0xA5 f22 # Fn+F6 Disable Touchpad -+0xA5 f23 # Fn+F6 Disable Touchpad - 0xA6 f22 # Fn+F6 Enable Touchpad - 0xA7 bluetooth # Fn+F10 Enable Bluetooth - 0XA9 bluetooth # Fn+F10 Disable Bluetooth --- -1.7.3.2 - diff --git a/0001-keymap-Add-force-release-for-HP-touchpad-off.patch b/0001-keymap-Add-force-release-for-HP-touchpad-off.patch deleted file mode 100644 index 1ba3551..0000000 --- a/0001-keymap-Add-force-release-for-HP-touchpad-off.patch +++ /dev/null @@ -1,56 +0,0 @@ -From ecfad20871e855d9e54d3a528cf9219ce5c93626 Mon Sep 17 00:00:00 2001 -From: Bastien Nocera -Date: Mon, 1 Nov 2010 16:29:09 +0000 -Subject: [PATCH] keymap: Add force release for HP touchpad off - -Force the touchpad off/on keys getting released, as they usually -only send a "repeat". - -https://bugzilla.redhat.com/show_bug.cgi?id=623239 - -Signed-off-by: Martin Pitt ---- - Makefile.am | 1 + - extras/keymap/95-keyboard-force-release.rules | 5 +++++ - extras/keymap/force-release-maps/hp-other | 3 +++ - 3 files changed, 9 insertions(+), 0 deletions(-) - create mode 100644 extras/keymap/force-release-maps/hp-other - -diff --git a/Makefile.am b/Makefile.am -index 3a95046..032eb28 100644 ---- a/Makefile.am -+++ b/Makefile.am -@@ -601,6 +601,7 @@ dist_udevkeymap_DATA = \ - - udevkeymapforcereldir = $(libexecdir)/keymaps/force-release - dist_udevkeymapforcerel_DATA = \ -+ extras/keymap/force-release-maps/hp-other \ - extras/keymap/force-release-maps/samsung-other \ - extras/keymap/force-release-maps/common-volume-keys - -diff --git a/extras/keymap/95-keyboard-force-release.rules b/extras/keymap/95-keyboard-force-release.rules -index 562dc8d..6f7c0fd 100644 ---- a/extras/keymap/95-keyboard-force-release.rules -+++ b/extras/keymap/95-keyboard-force-release.rules -@@ -35,4 +35,9 @@ ENV{DMI_VENDOR}=="TOSHIBA", ATTR{[dmi/id]product_name}=="Satellite U300|Satellit - - ENV{DMI_VENDOR}=="Viooo Corporation", ATTR{[dmi/id]product_name}=="PT17", RUN+="keyboard-force-release.sh $devpath common-volume-keys" - -+# These are all the HP laptops that setup a touchpad toggle key -+ENV{DMI_VENDOR}=="Hewlett-Packard*", ATTR{[dmi/id]product_name}=="*[pP][aA][vV][iI][lL][iI][oO][nN]*", RUN+="keyboard-force-release.sh $devpath hp-other" -+ENV{DMI_VENDOR}=="Hewlett-Packard*", ATTR{[dmi/id]product_name}=="*[tT][xX]2*", RUN+="keyboard-force-release.sh $devpath hp-other" -+ENV{DMI_VENDOR}=="Hewlett-Packard*", ATTR{[dmi/id]product_name}=="*2510p*|*2530p*|HP G60 Notebook PC", RUN+="keyboard-force-release.sh $devpath hp-other" -+ - LABEL="force_release_end" -diff --git a/extras/keymap/force-release-maps/hp-other b/extras/keymap/force-release-maps/hp-other -new file mode 100644 -index 0000000..6621370 ---- /dev/null -+++ b/extras/keymap/force-release-maps/hp-other -@@ -0,0 +1,3 @@ -+# list of scancodes (hex or decimal), optional comment -+0xd8 # Touchpad off -+0xd9 # Touchpad on --- -1.7.3.2 - diff --git a/sources b/sources index 8dc2880..871f305 100644 --- a/sources +++ b/sources @@ -1,2 +1,2 @@ -cd285a85f969518a671834de2f4d6614 udev-164.tar.bz2 -43b3842a00854e712b1d58af3a03e4ed udev-164.tar.bz2.sign +4db27d73fdbe94f47fd89fdd105c2dfb udev-166.tar.bz2 +3cb37564a589d4fedd6e7e3e178698d4 udev-166.tar.bz2.sign diff --git a/udev-pda-acl.patch b/udev-pda-acl.patch deleted file mode 100644 index b48103a..0000000 --- a/udev-pda-acl.patch +++ /dev/null @@ -1,20 +0,0 @@ -commit d69207c3f20f0af2a5e510515ae5473f4fe54476 -Author: Harald Hoyer -Date: Fri Nov 12 15:44:34 2010 +0100 - - 70-acl.rules: add ACLs for ID_PDA devices - -diff --git a/extras/udev-acl/70-acl.rules b/extras/udev-acl/70-acl.rules -index c7134bc..66375de 100644 ---- a/extras/udev-acl/70-acl.rules -+++ b/extras/udev-acl/70-acl.rules -@@ -47,6 +47,9 @@ SUBSYSTEM=="misc", KERNEL=="kvm", TAG+="udev-acl" - # smart-card readers - ENV{ID_SMARTCARD_READER}=="*?", TAG+="udev-acl" - -+# PDA devices -+ENV{ID_PDA}=="*?", TAG+="udev-acl" -+ - # joysticks - SUBSYSTEM=="input", ENV{ID_INPUT_JOYSTICK}=="?*", TAG+="udev-acl" - diff --git a/udev-random_temporary_ifname.patch b/udev-random_temporary_ifname.patch deleted file mode 100644 index ff5ad5c..0000000 --- a/udev-random_temporary_ifname.patch +++ /dev/null @@ -1,22 +0,0 @@ -diff --git a/udev/udev-event.c b/udev/udev-event.c -index 0648735..5387c00 100644 ---- a/udev/udev-event.c -+++ b/udev/udev-event.c -@@ -462,6 +462,7 @@ static void rename_netif_kernel_log(struct ifreq ifr) - static int rename_netif(struct udev_event *event) - { - struct udev_device *dev = event->dev; -+ char iftmp[IFNAMSIZ]; - int sk; - struct ifreq ifr; - int loop; -@@ -492,7 +493,8 @@ static int rename_netif(struct udev_event *event) - goto out; - - /* free our own name, another process may wait for us */ -- util_strscpyl(ifr.ifr_newname, IFNAMSIZ, udev_device_get_sysname(dev), "-", event->name, NULL); -+ util_strscpyl(iftmp, IFNAMSIZ, udev_device_get_sysname(dev), "-", event->name, NULL); -+ sprintf(ifr.ifr_newname, "eth_%X",util_string_hash32(iftmp)); - err = ioctl(sk, SIOCSIFNAME, &ifr); - if (err < 0) { - err = -errno; diff --git a/udev-ressize.patch b/udev-ressize.patch deleted file mode 100644 index 788b859..0000000 --- a/udev-ressize.patch +++ /dev/null @@ -1,24 +0,0 @@ -commit 851dd4ddc5aeb1ee517145d9e3334c2017595321 -Author: Harald Hoyer -Date: Fri Nov 12 14:39:14 2010 +0100 - - udev-rules.c: change import property buffer to 16384 bytes - - import_program_into_properties() should have the same line length as - import_file_into_properties() - - see also https://bugzilla.redhat.com/show_bug.cgi?id=652318 - -diff --git a/udev/udev-rules.c b/udev/udev-rules.c -index 52f121c..ab7b6ae 100644 ---- a/udev/udev-rules.c -+++ b/udev/udev-rules.c -@@ -751,7 +751,7 @@ static int import_program_into_properties(struct udev_device *dev, const char *p - { - struct udev *udev = udev_device_get_udev(dev); - char **envp; -- char result[4096]; -+ char result[UTIL_LINE_SIZE]; - size_t reslen; - char *line; - diff --git a/udev-post.init b/udev-retry.init similarity index 89% rename from udev-post.init rename to udev-retry.init index f882e0d..b4cb201 100644 --- a/udev-post.init +++ b/udev-retry.init @@ -1,6 +1,6 @@ #!/bin/bash # -# udev-post Post script for udev, after all filesystems are mounted +# udev-retry Post script for udev, after all filesystems are mounted # # Authors: Harald Hoyer # @@ -14,7 +14,7 @@ # Required-Stop: # Short-Description: Moves the generated persistent udev rules to /etc/udev/rules.d # Description: Moves the generated persistent udev rules to /etc/udev/rules.d -# Provides: udev-post +# Provides: udev-retry ### END INIT INFO . /etc/rc.d/init.d/functions @@ -49,12 +49,12 @@ case "$1" in fi done - touch /var/lock/subsys/udev-post + touch /var/lock/subsys/udev-retry exit 0 ;; stop) [ -w /var/lock/subsys ] || exit 4 - rm -f /var/lock/subsys/udev-post + rm -f /var/lock/subsys/udev-retry exit 0 ;; status) diff --git a/udev.spec b/udev.spec index 49dfbb6..be272ad 100644 --- a/udev.spec +++ b/udev.spec @@ -6,8 +6,8 @@ Summary: A rule-based device node and kernel event manager Name: udev -Version: 164 -Release: 9%{?dist} +Version: 166 +Release: 1%{?dist} License: GPLv2+ Group: System Environment/Base Provides: udev-persistent = %{version}-%{release} @@ -15,13 +15,8 @@ Obsoletes: udev-persistent < 0:030-5 Source: ftp://ftp.kernel.org/pub/linux/utils/kernel/hotplug/%{name}-%{version}.tar.bz2 Source1: start_udev -Source2: udev-post.init +Source2: udev-retry.init -Patch1: udev-ressize.patch -Patch2: udev-pda-acl.patch -Patch3: 0001-keymap-Add-force-release-for-HP-touchpad-off.patch -Patch4: 0001-extras-keymap-Make-touchpad-buttons-consistent.patch -Patch5: udev-random_temporary_ifname.patch Patch6: udev-164-no-v4l1.patch ExclusiveOS: Linux @@ -120,14 +115,15 @@ glib-based applications using libudev functionality. %prep %setup -q -%patch1 -p1 -%patch2 -p1 -%patch3 -p1 -%patch4 -p1 -%patch5 -p1 %patch6 -p1 %build +export CFLAGS="$CFLAGS $RPM_OPT_FLAGS -fPIE -DPIE -pie -Wl,-z,relro -Wl,-z,now" + +# prevent man pages from re-building (xmlto) +find . -name "*.[1-8]" -exec touch '{}' \; +export V=1 + libtoolize -f -c %configure --with-selinux --prefix=%{_prefix} --exec-prefix="" \ --sysconfdir=%{_sysconfdir} \ @@ -179,7 +175,7 @@ install -m 0755 %{SOURCE1} $RPM_BUILD_ROOT/sbin/start_udev mkdir -p -m 0755 $RPM_BUILD_ROOT%{firmwaredir} mkdir -p $RPM_BUILD_ROOT%{_sysconfdir}/rc.d/init.d -install -m 0755 %{SOURCE2} $RPM_BUILD_ROOT%{_sysconfdir}/rc.d/init.d/udev-post +install -m 0755 %{SOURCE2} $RPM_BUILD_ROOT%{_sysconfdir}/rc.d/init.d/udev-retry %preun if [ "$1" -eq 0 -a -f %{_initrddir}/udev ]; then @@ -200,8 +196,9 @@ if [ "$1" -eq 0 -a -f %{_initrddir}/udev ]; then /sbin/chkconfig --del udev fi if [ "$1" -eq 0 ]; then - /sbin/chkconfig --del udev-post + /sbin/chkconfig --del udev-retry fi +/sbin/chkconfig --del udev-post >/dev/null 2>&1 || : exit 0 %pre @@ -231,15 +228,17 @@ fi exit 0 %post +# convert old database files +/sbin/udevadm info --convert-db >/dev/null 2>&1 || : + # start daemon if we are not in a chroot if test -f /proc/1/exe -a -d /proc/1/root; then if test "$(/usr/bin/stat -Lc '%%D-%%i' /)" = "$(/usr/bin/stat -Lc '%%D-%%i' /proc/1/root)"; then /sbin/udevd -d - /sbin/udevadm control --start-exec-queue + /sbin/udevadm control --start-exec-queue || : fi fi -/sbin/chkconfig --add udev-post -#/usr/bin/systemd-install --system --realize=minimal enable udev.service >/dev/null 2>&1 || : +/sbin/chkconfig --add udev-retry exit 0 @@ -277,7 +276,7 @@ rm -rf $RPM_BUILD_ROOT %attr(0755,root,root) %{udev_scriptdir}/mtd_probe %attr(0755,root,root) %dir %{udev_scriptdir}/rules.d/ -%attr(0755,root,root) %{_sysconfdir}/rc.d/init.d/udev-post +%attr(0755,root,root) %{_sysconfdir}/rc.d/init.d/udev-retry %attr(0755,root,root) %dir %{_sysconfdir}/udev/ %attr(0755,root,root) %dir %{_sysconfdir}/udev/rules.d/ %attr(0755,root,root) %dir %{udev_scriptdir}/ @@ -361,6 +360,11 @@ rm -rf $RPM_BUILD_ROOT %attr(0644,root,root) %{_libdir}/pkgconfig/gudev-1.0* %changelog +* Wed Feb 16 2011 Harald Hoyer 166-1 +- renamed udev-post initscript to udev-retry to match + upstream systemd service name +- version 166 + * Mon Feb 07 2011 Fedora Release Engineering - 164-9 - Rebuilt for https://fedoraproject.org/wiki/Fedora_15_Mass_Rebuild From 400c0eaaaae00808c3a5a259ac14788289ab5aa0 Mon Sep 17 00:00:00 2001 From: Harald Hoyer Date: Wed, 16 Feb 2011 18:26:09 +0100 Subject: [PATCH 094/142] - renamed udev-post initscript to udev-retry to match upstream systemd service name - version 166 --- .gitignore | 2 + ...map-Make-touchpad-buttons-consistent.patch | 232 ------------------ ...dd-force-release-for-HP-touchpad-off.patch | 56 ----- sources | 4 +- udev-pda-acl.patch | 20 -- udev-random_temporary_ifname.patch | 22 -- udev-ressize.patch | 24 -- udev-post.init => udev-retry.init | 8 +- udev.spec | 42 ++-- 9 files changed, 31 insertions(+), 379 deletions(-) delete mode 100644 0001-extras-keymap-Make-touchpad-buttons-consistent.patch delete mode 100644 0001-keymap-Add-force-release-for-HP-touchpad-off.patch delete mode 100644 udev-pda-acl.patch delete mode 100644 udev-random_temporary_ifname.patch delete mode 100644 udev-ressize.patch rename udev-post.init => udev-retry.init (89%) diff --git a/.gitignore b/.gitignore index 65d08f4..ff4586d 100644 --- a/.gitignore +++ b/.gitignore @@ -1,3 +1,5 @@ udev-160.tar.bz2 /udev-164.tar.bz2 /udev-164.tar.bz2.sign +/udev-166.tar.bz2 +/udev-166.tar.bz2.sign diff --git a/0001-extras-keymap-Make-touchpad-buttons-consistent.patch b/0001-extras-keymap-Make-touchpad-buttons-consistent.patch deleted file mode 100644 index bd36b5f..0000000 --- a/0001-extras-keymap-Make-touchpad-buttons-consistent.patch +++ /dev/null @@ -1,232 +0,0 @@ -From a1ca5f60e0770299c5c5f21bd371f5823802412b Mon Sep 17 00:00:00 2001 -From: Bastien Nocera -Date: Thu, 4 Nov 2010 23:58:56 +0000 -Subject: [PATCH] extras/keymap: Make touchpad buttons consistent - -We'll need to standardise on the Touchpad related keys in udev, kernel, and -X.org. I selected F21 for XF86TouchpadToggle, F22 for XF86TouchpadOn and F23 -for XF86TouchpadOff. - -See: -https://bugs.freedesktop.org/show_bug.cgi?id=31333 - -Signed-off-by: Martin Pitt ---- - extras/keymap/keymaps/acer | 2 +- - extras/keymap/keymaps/dell | 4 ++-- - extras/keymap/keymaps/everex-xt5000 | 2 +- - extras/keymap/keymaps/hewlett-packard-2510p_2530p | 4 ++-- - extras/keymap/keymaps/hewlett-packard-pavilion | 4 ++-- - extras/keymap/keymaps/hewlett-packard-tx2 | 2 +- - .../lenovo-thinkpad-usb-keyboard-trackpoint | 2 +- - extras/keymap/keymaps/lg-x110 | 4 ++-- - extras/keymap/keymaps/micro-star | 2 +- - extras/keymap/keymaps/module-lenovo | 2 +- - extras/keymap/keymaps/onkyo | 2 +- - extras/keymap/keymaps/samsung-other | 2 +- - extras/keymap/keymaps/samsung-sx20s | 4 ++-- - extras/keymap/keymaps/toshiba-satellite_a110 | 4 ++-- - extras/keymap/keymaps/toshiba-satellite_m30x | 4 ++-- - extras/keymap/keymaps/zepto-znote | 2 +- - 16 files changed, 23 insertions(+), 23 deletions(-) - -diff --git a/extras/keymap/keymaps/acer b/extras/keymap/keymaps/acer -index 6abe39c..4e7c297 100644 ---- a/extras/keymap/keymaps/acer -+++ b/extras/keymap/keymaps/acer -@@ -14,7 +14,7 @@ - 0xEE brightnessup # Fn+Right - 0xEF brightnessdown # Fn+Left - 0xF1 f22 # Fn+F7 Touchpad toggle (off-to-on) --0xF2 f22 # Fn+F7 Touchpad toggle (on-to-off) -+0xF2 f23 # Fn+F7 Touchpad toggle (on-to-off) - 0xF3 prog2 # "P2" programmable button - 0xF4 prog1 # "P1" programmable button - 0xF5 presentation -diff --git a/extras/keymap/keymaps/dell b/extras/keymap/keymaps/dell -index 1a2e433..fbbb903 100644 ---- a/extras/keymap/keymaps/dell -+++ b/extras/keymap/keymaps/dell -@@ -21,9 +21,9 @@ - 0x99 nextsong # Front panel next song - 0x9A setup # Tablet tools button - 0x9B switchvideomode # Display Toggle button --0x9E f22 #touchpad toggle -+0x9E f21 #touchpad toggle - 0xA2 playpause # Front panel play/pause - 0xA4 stopcd # Front panel stop - 0xED media # MediaDirect button - 0xD8 screenlock # FIXME: Tablet lock button --0xD9 f22 # touchpad toggle -+0xD9 f21 # touchpad toggle -diff --git a/extras/keymap/keymaps/everex-xt5000 b/extras/keymap/keymaps/everex-xt5000 -index 53bdd7a..4823a83 100644 ---- a/extras/keymap/keymaps/everex-xt5000 -+++ b/extras/keymap/keymaps/everex-xt5000 -@@ -1,5 +1,5 @@ - 0x5C media --0x65 f22 # Fn+F5 Touchpad toggle -+0x65 f21 # Fn+F5 Touchpad toggle - 0x67 prog3 # Fan Speed Control button - 0x6F brightnessup - 0x7F brightnessdown -diff --git a/extras/keymap/keymaps/hewlett-packard-2510p_2530p b/extras/keymap/keymaps/hewlett-packard-2510p_2530p -index 2bc70c2..41ad2e9 100644 ---- a/extras/keymap/keymaps/hewlett-packard-2510p_2530p -+++ b/extras/keymap/keymaps/hewlett-packard-2510p_2530p -@@ -1,2 +1,2 @@ --0xD8 f22 # touchpad off --0xD9 f23 # touchpad on -+0xD8 f23 # touchpad off -+0xD9 f22 # touchpad on -diff --git a/extras/keymap/keymaps/hewlett-packard-pavilion b/extras/keymap/keymaps/hewlett-packard-pavilion -index a55d2b7..3d3cefc 100644 ---- a/extras/keymap/keymaps/hewlett-packard-pavilion -+++ b/extras/keymap/keymaps/hewlett-packard-pavilion -@@ -1,3 +1,3 @@ - 0x88 media # FIXME: quick play --0xD8 f22 # touchpad off --0xD9 f23 # touchpad on -+0xD8 f23 # touchpad off -+0xD9 f22 # touchpad on -diff --git a/extras/keymap/keymaps/hewlett-packard-tx2 b/extras/keymap/keymaps/hewlett-packard-tx2 -index 206c004..36a690f 100644 ---- a/extras/keymap/keymaps/hewlett-packard-tx2 -+++ b/extras/keymap/keymaps/hewlett-packard-tx2 -@@ -1,3 +1,3 @@ - 0xC2 media --0xD8 f22 # Toggle touchpad button on tx2 (OFF) -+0xD8 f23 # Toggle touchpad button on tx2 (OFF) - 0xD9 f22 # Toggle touchpad button on tx2 (ON) -diff --git a/extras/keymap/keymaps/lenovo-thinkpad-usb-keyboard-trackpoint b/extras/keymap/keymaps/lenovo-thinkpad-usb-keyboard-trackpoint -index 7612f79..bc91470 100644 ---- a/extras/keymap/keymaps/lenovo-thinkpad-usb-keyboard-trackpoint -+++ b/extras/keymap/keymaps/lenovo-thinkpad-usb-keyboard-trackpoint -@@ -2,7 +2,7 @@ - 0x90013 battery # Fn+F3 - 0x90014 wlan # Fn+F5 - 0x90016 switchvideomode # Fn+F7 --0x90017 f22 # Fn+F8 touchpadtoggle -+0x90017 f21 # Fn+F8 touchpadtoggle - 0x90019 suspend # Fn+F12 - 0x9001A brightnessup # Fn+Home - 0x9001B brightnessdown # Fn+End -diff --git a/extras/keymap/keymaps/lg-x110 b/extras/keymap/keymaps/lg-x110 -index a61cf3d..ba08cba 100644 ---- a/extras/keymap/keymaps/lg-x110 -+++ b/extras/keymap/keymaps/lg-x110 -@@ -6,7 +6,7 @@ - 0xB3 suspend # Fn-F12 - 0xDF sleep # Fn-F4 - # 0xE2 bluetooth # satellite dish2 --0xE4 f22 # Fn-F5 Touchpad disable -+0xE4 f21 # Fn-F5 Touchpad disable - 0xF6 wlan # Fn-F6 - 0xF7 reserved # brightnessdown # Fn-Down --0xF8 reserved # brightnessup # Fn-Up -\ No newline at end of file -+0xF8 reserved # brightnessup # Fn-Up -diff --git a/extras/keymap/keymaps/micro-star b/extras/keymap/keymaps/micro-star -index 0de5ae6..4a43869 100644 ---- a/extras/keymap/keymaps/micro-star -+++ b/extras/keymap/keymaps/micro-star -@@ -4,7 +4,7 @@ - 0xB2 www # e button - 0xDF sleep # Fn-F12 - 0xE2 bluetooth # satellite dish2 --0xE4 f22 # Fn-F3 Touchpad disable -+0xE4 f21 # Fn-F3 Touchpad disable - 0xEC email # envelope button - 0xEE camera # Fn-F6 camera disable - 0xF6 wlan # satellite dish1 -diff --git a/extras/keymap/keymaps/module-lenovo b/extras/keymap/keymaps/module-lenovo -index 7c597bd..9cb74b2 100644 ---- a/extras/keymap/keymaps/module-lenovo -+++ b/extras/keymap/keymaps/module-lenovo -@@ -3,7 +3,7 @@ - 0x3 sleep # Fn+F4 - 0x4 wlan # Fn+F5 - 0x6 switchvideomode # Fn+F7 --0x7 f22 # Fn+F8 touchpadtoggle -+0x7 f21 # Fn+F8 touchpadtoggle - 0x8 f24 # Fn+F9 undock - 0xB suspend # Fn+F12 - 0xF brightnessup # Fn+Home -diff --git a/extras/keymap/keymaps/onkyo b/extras/keymap/keymaps/onkyo -index 7dd80a1..ee864ad 100644 ---- a/extras/keymap/keymaps/onkyo -+++ b/extras/keymap/keymaps/onkyo -@@ -8,7 +8,7 @@ - 0xF0 media # Fn+R - 0xF5 switchvideomode # Fn+E - 0xF6 camera # Fn+T --0xF7 f22 # Fn+Y (touchpad toggle) -+0xF7 f21 # Fn+Y (touchpad toggle) - 0xF8 brightnessup # Fn+S - 0xF9 brightnessdown # Fn+A - 0xFB wlan # Fn+J -diff --git a/extras/keymap/keymaps/samsung-other b/extras/keymap/keymaps/samsung-other -index 6a0928c..3ac0c2f 100644 ---- a/extras/keymap/keymaps/samsung-other -+++ b/extras/keymap/keymaps/samsung-other -@@ -11,4 +11,4 @@ - 0xB3 prog3 # Fn+F8 switch power mode (battery/dynamic/performance) - 0xB4 wlan # Fn+F9 (X60P) - 0xF7 f22 # Fn+F10 Touchpad on --0xF9 f22 # Fn+F10 Touchpad off -+0xF9 f23 # Fn+F10 Touchpad off -diff --git a/extras/keymap/keymaps/samsung-sx20s b/extras/keymap/keymaps/samsung-sx20s -index daf7d3e..9d954ee 100644 ---- a/extras/keymap/keymaps/samsung-sx20s -+++ b/extras/keymap/keymaps/samsung-sx20s -@@ -1,4 +1,4 @@ - 0x74 mute - 0x75 mute --0x77 f21 # FIXME: Touchpad on --0x79 f21 # FIXME: Touchpad off -+0x77 f22 # Touchpad on -+0x79 f23 # Touchpad off -diff --git a/extras/keymap/keymaps/toshiba-satellite_a110 b/extras/keymap/keymaps/toshiba-satellite_a110 -index 0f2aaec..1429409 100644 ---- a/extras/keymap/keymaps/toshiba-satellite_a110 -+++ b/extras/keymap/keymaps/toshiba-satellite_a110 -@@ -1,8 +1,8 @@ - 0x92 stop - 0x93 www - 0x94 media --0x9E f21 # FIXME: Touchpad on --0x9F f21 # FIXME: Touchpad off -+0x9E f22 # Touchpad on -+0x9F f23 # Touchpad off - 0xB9 nextsong - 0xD9 brightnessup - 0xEE screenlock -diff --git a/extras/keymap/keymaps/toshiba-satellite_m30x b/extras/keymap/keymaps/toshiba-satellite_m30x -index cf6d912..9280ae0 100644 ---- a/extras/keymap/keymaps/toshiba-satellite_m30x -+++ b/extras/keymap/keymaps/toshiba-satellite_m30x -@@ -2,6 +2,6 @@ - 0xd9 brightnessup - 0xee screenlock - 0x93 media --0x9e prog1 #touchpad_enable --0x9f prog2 #touchpad_disable -+0x9e f22 #touchpad_enable -+0x9f f23 #touchpad_disable - -diff --git a/extras/keymap/keymaps/zepto-znote b/extras/keymap/keymaps/zepto-znote -index e076516..cf72fda 100644 ---- a/extras/keymap/keymaps/zepto-znote -+++ b/extras/keymap/keymaps/zepto-znote -@@ -1,7 +1,7 @@ - 0x93 switchvideomode # Fn+F3 Toggle Video Output - 0x95 brightnessdown # Fn+F4 Brightness Down - 0x91 brightnessup # Fn+F5 Brightness Up --0xA5 f22 # Fn+F6 Disable Touchpad -+0xA5 f23 # Fn+F6 Disable Touchpad - 0xA6 f22 # Fn+F6 Enable Touchpad - 0xA7 bluetooth # Fn+F10 Enable Bluetooth - 0XA9 bluetooth # Fn+F10 Disable Bluetooth --- -1.7.3.2 - diff --git a/0001-keymap-Add-force-release-for-HP-touchpad-off.patch b/0001-keymap-Add-force-release-for-HP-touchpad-off.patch deleted file mode 100644 index 1ba3551..0000000 --- a/0001-keymap-Add-force-release-for-HP-touchpad-off.patch +++ /dev/null @@ -1,56 +0,0 @@ -From ecfad20871e855d9e54d3a528cf9219ce5c93626 Mon Sep 17 00:00:00 2001 -From: Bastien Nocera -Date: Mon, 1 Nov 2010 16:29:09 +0000 -Subject: [PATCH] keymap: Add force release for HP touchpad off - -Force the touchpad off/on keys getting released, as they usually -only send a "repeat". - -https://bugzilla.redhat.com/show_bug.cgi?id=623239 - -Signed-off-by: Martin Pitt ---- - Makefile.am | 1 + - extras/keymap/95-keyboard-force-release.rules | 5 +++++ - extras/keymap/force-release-maps/hp-other | 3 +++ - 3 files changed, 9 insertions(+), 0 deletions(-) - create mode 100644 extras/keymap/force-release-maps/hp-other - -diff --git a/Makefile.am b/Makefile.am -index 3a95046..032eb28 100644 ---- a/Makefile.am -+++ b/Makefile.am -@@ -601,6 +601,7 @@ dist_udevkeymap_DATA = \ - - udevkeymapforcereldir = $(libexecdir)/keymaps/force-release - dist_udevkeymapforcerel_DATA = \ -+ extras/keymap/force-release-maps/hp-other \ - extras/keymap/force-release-maps/samsung-other \ - extras/keymap/force-release-maps/common-volume-keys - -diff --git a/extras/keymap/95-keyboard-force-release.rules b/extras/keymap/95-keyboard-force-release.rules -index 562dc8d..6f7c0fd 100644 ---- a/extras/keymap/95-keyboard-force-release.rules -+++ b/extras/keymap/95-keyboard-force-release.rules -@@ -35,4 +35,9 @@ ENV{DMI_VENDOR}=="TOSHIBA", ATTR{[dmi/id]product_name}=="Satellite U300|Satellit - - ENV{DMI_VENDOR}=="Viooo Corporation", ATTR{[dmi/id]product_name}=="PT17", RUN+="keyboard-force-release.sh $devpath common-volume-keys" - -+# These are all the HP laptops that setup a touchpad toggle key -+ENV{DMI_VENDOR}=="Hewlett-Packard*", ATTR{[dmi/id]product_name}=="*[pP][aA][vV][iI][lL][iI][oO][nN]*", RUN+="keyboard-force-release.sh $devpath hp-other" -+ENV{DMI_VENDOR}=="Hewlett-Packard*", ATTR{[dmi/id]product_name}=="*[tT][xX]2*", RUN+="keyboard-force-release.sh $devpath hp-other" -+ENV{DMI_VENDOR}=="Hewlett-Packard*", ATTR{[dmi/id]product_name}=="*2510p*|*2530p*|HP G60 Notebook PC", RUN+="keyboard-force-release.sh $devpath hp-other" -+ - LABEL="force_release_end" -diff --git a/extras/keymap/force-release-maps/hp-other b/extras/keymap/force-release-maps/hp-other -new file mode 100644 -index 0000000..6621370 ---- /dev/null -+++ b/extras/keymap/force-release-maps/hp-other -@@ -0,0 +1,3 @@ -+# list of scancodes (hex or decimal), optional comment -+0xd8 # Touchpad off -+0xd9 # Touchpad on --- -1.7.3.2 - diff --git a/sources b/sources index 8dc2880..871f305 100644 --- a/sources +++ b/sources @@ -1,2 +1,2 @@ -cd285a85f969518a671834de2f4d6614 udev-164.tar.bz2 -43b3842a00854e712b1d58af3a03e4ed udev-164.tar.bz2.sign +4db27d73fdbe94f47fd89fdd105c2dfb udev-166.tar.bz2 +3cb37564a589d4fedd6e7e3e178698d4 udev-166.tar.bz2.sign diff --git a/udev-pda-acl.patch b/udev-pda-acl.patch deleted file mode 100644 index b48103a..0000000 --- a/udev-pda-acl.patch +++ /dev/null @@ -1,20 +0,0 @@ -commit d69207c3f20f0af2a5e510515ae5473f4fe54476 -Author: Harald Hoyer -Date: Fri Nov 12 15:44:34 2010 +0100 - - 70-acl.rules: add ACLs for ID_PDA devices - -diff --git a/extras/udev-acl/70-acl.rules b/extras/udev-acl/70-acl.rules -index c7134bc..66375de 100644 ---- a/extras/udev-acl/70-acl.rules -+++ b/extras/udev-acl/70-acl.rules -@@ -47,6 +47,9 @@ SUBSYSTEM=="misc", KERNEL=="kvm", TAG+="udev-acl" - # smart-card readers - ENV{ID_SMARTCARD_READER}=="*?", TAG+="udev-acl" - -+# PDA devices -+ENV{ID_PDA}=="*?", TAG+="udev-acl" -+ - # joysticks - SUBSYSTEM=="input", ENV{ID_INPUT_JOYSTICK}=="?*", TAG+="udev-acl" - diff --git a/udev-random_temporary_ifname.patch b/udev-random_temporary_ifname.patch deleted file mode 100644 index ff5ad5c..0000000 --- a/udev-random_temporary_ifname.patch +++ /dev/null @@ -1,22 +0,0 @@ -diff --git a/udev/udev-event.c b/udev/udev-event.c -index 0648735..5387c00 100644 ---- a/udev/udev-event.c -+++ b/udev/udev-event.c -@@ -462,6 +462,7 @@ static void rename_netif_kernel_log(struct ifreq ifr) - static int rename_netif(struct udev_event *event) - { - struct udev_device *dev = event->dev; -+ char iftmp[IFNAMSIZ]; - int sk; - struct ifreq ifr; - int loop; -@@ -492,7 +493,8 @@ static int rename_netif(struct udev_event *event) - goto out; - - /* free our own name, another process may wait for us */ -- util_strscpyl(ifr.ifr_newname, IFNAMSIZ, udev_device_get_sysname(dev), "-", event->name, NULL); -+ util_strscpyl(iftmp, IFNAMSIZ, udev_device_get_sysname(dev), "-", event->name, NULL); -+ sprintf(ifr.ifr_newname, "eth_%X",util_string_hash32(iftmp)); - err = ioctl(sk, SIOCSIFNAME, &ifr); - if (err < 0) { - err = -errno; diff --git a/udev-ressize.patch b/udev-ressize.patch deleted file mode 100644 index 788b859..0000000 --- a/udev-ressize.patch +++ /dev/null @@ -1,24 +0,0 @@ -commit 851dd4ddc5aeb1ee517145d9e3334c2017595321 -Author: Harald Hoyer -Date: Fri Nov 12 14:39:14 2010 +0100 - - udev-rules.c: change import property buffer to 16384 bytes - - import_program_into_properties() should have the same line length as - import_file_into_properties() - - see also https://bugzilla.redhat.com/show_bug.cgi?id=652318 - -diff --git a/udev/udev-rules.c b/udev/udev-rules.c -index 52f121c..ab7b6ae 100644 ---- a/udev/udev-rules.c -+++ b/udev/udev-rules.c -@@ -751,7 +751,7 @@ static int import_program_into_properties(struct udev_device *dev, const char *p - { - struct udev *udev = udev_device_get_udev(dev); - char **envp; -- char result[4096]; -+ char result[UTIL_LINE_SIZE]; - size_t reslen; - char *line; - diff --git a/udev-post.init b/udev-retry.init similarity index 89% rename from udev-post.init rename to udev-retry.init index f882e0d..b4cb201 100644 --- a/udev-post.init +++ b/udev-retry.init @@ -1,6 +1,6 @@ #!/bin/bash # -# udev-post Post script for udev, after all filesystems are mounted +# udev-retry Post script for udev, after all filesystems are mounted # # Authors: Harald Hoyer # @@ -14,7 +14,7 @@ # Required-Stop: # Short-Description: Moves the generated persistent udev rules to /etc/udev/rules.d # Description: Moves the generated persistent udev rules to /etc/udev/rules.d -# Provides: udev-post +# Provides: udev-retry ### END INIT INFO . /etc/rc.d/init.d/functions @@ -49,12 +49,12 @@ case "$1" in fi done - touch /var/lock/subsys/udev-post + touch /var/lock/subsys/udev-retry exit 0 ;; stop) [ -w /var/lock/subsys ] || exit 4 - rm -f /var/lock/subsys/udev-post + rm -f /var/lock/subsys/udev-retry exit 0 ;; status) diff --git a/udev.spec b/udev.spec index 49dfbb6..be272ad 100644 --- a/udev.spec +++ b/udev.spec @@ -6,8 +6,8 @@ Summary: A rule-based device node and kernel event manager Name: udev -Version: 164 -Release: 9%{?dist} +Version: 166 +Release: 1%{?dist} License: GPLv2+ Group: System Environment/Base Provides: udev-persistent = %{version}-%{release} @@ -15,13 +15,8 @@ Obsoletes: udev-persistent < 0:030-5 Source: ftp://ftp.kernel.org/pub/linux/utils/kernel/hotplug/%{name}-%{version}.tar.bz2 Source1: start_udev -Source2: udev-post.init +Source2: udev-retry.init -Patch1: udev-ressize.patch -Patch2: udev-pda-acl.patch -Patch3: 0001-keymap-Add-force-release-for-HP-touchpad-off.patch -Patch4: 0001-extras-keymap-Make-touchpad-buttons-consistent.patch -Patch5: udev-random_temporary_ifname.patch Patch6: udev-164-no-v4l1.patch ExclusiveOS: Linux @@ -120,14 +115,15 @@ glib-based applications using libudev functionality. %prep %setup -q -%patch1 -p1 -%patch2 -p1 -%patch3 -p1 -%patch4 -p1 -%patch5 -p1 %patch6 -p1 %build +export CFLAGS="$CFLAGS $RPM_OPT_FLAGS -fPIE -DPIE -pie -Wl,-z,relro -Wl,-z,now" + +# prevent man pages from re-building (xmlto) +find . -name "*.[1-8]" -exec touch '{}' \; +export V=1 + libtoolize -f -c %configure --with-selinux --prefix=%{_prefix} --exec-prefix="" \ --sysconfdir=%{_sysconfdir} \ @@ -179,7 +175,7 @@ install -m 0755 %{SOURCE1} $RPM_BUILD_ROOT/sbin/start_udev mkdir -p -m 0755 $RPM_BUILD_ROOT%{firmwaredir} mkdir -p $RPM_BUILD_ROOT%{_sysconfdir}/rc.d/init.d -install -m 0755 %{SOURCE2} $RPM_BUILD_ROOT%{_sysconfdir}/rc.d/init.d/udev-post +install -m 0755 %{SOURCE2} $RPM_BUILD_ROOT%{_sysconfdir}/rc.d/init.d/udev-retry %preun if [ "$1" -eq 0 -a -f %{_initrddir}/udev ]; then @@ -200,8 +196,9 @@ if [ "$1" -eq 0 -a -f %{_initrddir}/udev ]; then /sbin/chkconfig --del udev fi if [ "$1" -eq 0 ]; then - /sbin/chkconfig --del udev-post + /sbin/chkconfig --del udev-retry fi +/sbin/chkconfig --del udev-post >/dev/null 2>&1 || : exit 0 %pre @@ -231,15 +228,17 @@ fi exit 0 %post +# convert old database files +/sbin/udevadm info --convert-db >/dev/null 2>&1 || : + # start daemon if we are not in a chroot if test -f /proc/1/exe -a -d /proc/1/root; then if test "$(/usr/bin/stat -Lc '%%D-%%i' /)" = "$(/usr/bin/stat -Lc '%%D-%%i' /proc/1/root)"; then /sbin/udevd -d - /sbin/udevadm control --start-exec-queue + /sbin/udevadm control --start-exec-queue || : fi fi -/sbin/chkconfig --add udev-post -#/usr/bin/systemd-install --system --realize=minimal enable udev.service >/dev/null 2>&1 || : +/sbin/chkconfig --add udev-retry exit 0 @@ -277,7 +276,7 @@ rm -rf $RPM_BUILD_ROOT %attr(0755,root,root) %{udev_scriptdir}/mtd_probe %attr(0755,root,root) %dir %{udev_scriptdir}/rules.d/ -%attr(0755,root,root) %{_sysconfdir}/rc.d/init.d/udev-post +%attr(0755,root,root) %{_sysconfdir}/rc.d/init.d/udev-retry %attr(0755,root,root) %dir %{_sysconfdir}/udev/ %attr(0755,root,root) %dir %{_sysconfdir}/udev/rules.d/ %attr(0755,root,root) %dir %{udev_scriptdir}/ @@ -361,6 +360,11 @@ rm -rf $RPM_BUILD_ROOT %attr(0644,root,root) %{_libdir}/pkgconfig/gudev-1.0* %changelog +* Wed Feb 16 2011 Harald Hoyer 166-1 +- renamed udev-post initscript to udev-retry to match + upstream systemd service name +- version 166 + * Mon Feb 07 2011 Fedora Release Engineering - 164-9 - Rebuilt for https://fedoraproject.org/wiki/Fedora_15_Mass_Rebuild From 99318e91b4c0852f5c359dda15e6e1c22a910fe7 Mon Sep 17 00:00:00 2001 From: Harald Hoyer Date: Wed, 23 Mar 2011 13:35:43 +0100 Subject: [PATCH 095/142] - add ACLs for harmony remote controls Resolves: rhbz#559412 - fixed CDROM profile handling --- ...9245f2d2fd03c2586a7f1140300b073a4abe.patch | 25 ++ ...6a377285d5943563cfa397e8b350e43878ec.patch | 345 ++++++++++++++++++ udev.spec | 12 +- 3 files changed, 381 insertions(+), 1 deletion(-) create mode 100644 udev-5e199245f2d2fd03c2586a7f1140300b073a4abe.patch create mode 100644 udev-98ab6a377285d5943563cfa397e8b350e43878ec.patch diff --git a/udev-5e199245f2d2fd03c2586a7f1140300b073a4abe.patch b/udev-5e199245f2d2fd03c2586a7f1140300b073a4abe.patch new file mode 100644 index 0000000..83d2c11 --- /dev/null +++ b/udev-5e199245f2d2fd03c2586a7f1140300b073a4abe.patch @@ -0,0 +1,25 @@ +commit 5e199245f2d2fd03c2586a7f1140300b073a4abe +Author: Harald Hoyer +Date: Thu Mar 17 20:36:20 2011 +0100 + + udev-acl/70-acl.rules: tag ID_REMOTE_CONTROL with acl + + Used by "concordance" to access Logitech Harmony programmable remote + controls. + + http://www.phildev.net/concordance/ + +diff --git a/extras/udev-acl/70-acl.rules b/extras/udev-acl/70-acl.rules +index dd5a7ab..037349d 100644 +--- a/extras/udev-acl/70-acl.rules ++++ b/extras/udev-acl/70-acl.rules +@@ -52,6 +52,9 @@ ENV{ID_SMARTCARD_READER}=="*?", TAG+="udev-acl" + # PDA devices + ENV{ID_PDA}=="*?", TAG+="udev-acl" + ++# Programmable remote control ++ENV{ID_REMOTE_CONTROL}=="1", TAG+="udev-acl" ++ + # joysticks + SUBSYSTEM=="input", ENV{ID_INPUT_JOYSTICK}=="?*", TAG+="udev-acl" + diff --git a/udev-98ab6a377285d5943563cfa397e8b350e43878ec.patch b/udev-98ab6a377285d5943563cfa397e8b350e43878ec.patch new file mode 100644 index 0000000..699add5 --- /dev/null +++ b/udev-98ab6a377285d5943563cfa397e8b350e43878ec.patch @@ -0,0 +1,345 @@ +commit 98ab6a377285d5943563cfa397e8b350e43878ec +Author: David Zeuthen +Date: Tue Mar 15 12:05:00 2011 -0400 + + cdrom_id: Don't ignore profiles when there is no media available + + Just because the GET CONFIGURATION MMC-2 command returns the current + profile as 0 does not mean that we can ignore the profiles describing + the capabilities of the drive - it only means that there currently is + no recognized media in the drive. Therefore, do process the returned + profiles even when cur_profile is 0. + + This fixes a bug where only + + ID_CDROM=1 + ID_CDROM_CD_R=1 + ID_CDROM_CD_RW=1 + ID_CDROM_DVD=1 + ID_CDROM_DVD_R=1 + ID_CDROM_DVD_RAM=1 + + was returned when there is no media in the drive instead of + + ID_CDROM=1 + ID_CDROM_CD=1 + ID_CDROM_CD_R=1 + ID_CDROM_CD_RW=1 + ID_CDROM_DVD=1 + ID_CDROM_DVD_R=1 + ID_CDROM_DVD_RW=1 + ID_CDROM_DVD_RAM=1 + ID_CDROM_DVD_PLUS_R=1 + ID_CDROM_DVD_PLUS_RW=1 + ID_CDROM_DVD_PLUS_R_DL=1 + ID_CDROM_BD=1 + ID_CDROM_BD_R=1 + ID_CDROM_BD_RE=1 + ID_CDROM_HDDVD=1 + + as is returned now. + + Signed-off-by: David Zeuthen + +diff --git a/extras/cdrom_id/cdrom_id.c b/extras/cdrom_id/cdrom_id.c +index 4a58a49..b2f897e 100644 +--- a/extras/cdrom_id/cdrom_id.c ++++ b/extras/cdrom_id/cdrom_id.c +@@ -261,6 +261,115 @@ static int cd_inquiry(struct udev *udev, int fd) { + return 0; + } + ++static void feature_profile_media(struct udev *udev, int cur_profile) ++{ ++ switch (cur_profile) { ++ case 0x03: ++ case 0x04: ++ case 0x05: ++ info(udev, "profile 0x%02x \n", cur_profile); ++ cd_media = 1; ++ cd_media_mo = 1; ++ break; ++ case 0x08: ++ info(udev, "profile 0x%02x media_cd_rom\n", cur_profile); ++ cd_media = 1; ++ cd_media_cd_rom = 1; ++ break; ++ case 0x09: ++ info(udev, "profile 0x%02x media_cd_r\n", cur_profile); ++ cd_media = 1; ++ cd_media_cd_r = 1; ++ break; ++ case 0x0a: ++ info(udev, "profile 0x%02x media_cd_rw\n", cur_profile); ++ cd_media = 1; ++ cd_media_cd_rw = 1; ++ break; ++ case 0x10: ++ info(udev, "profile 0x%02x media_dvd_ro\n", cur_profile); ++ cd_media = 1; ++ cd_media_dvd_rom = 1; ++ break; ++ case 0x11: ++ info(udev, "profile 0x%02x media_dvd_r\n", cur_profile); ++ cd_media = 1; ++ cd_media_dvd_r = 1; ++ break; ++ case 0x12: ++ info(udev, "profile 0x%02x media_dvd_ram\n", cur_profile); ++ cd_media = 1; ++ cd_media_dvd_ram = 1; ++ break; ++ case 0x13: ++ info(udev, "profile 0x%02x media_dvd_rw_ro\n", cur_profile); ++ cd_media = 1; ++ cd_media_dvd_rw = 1; ++ cd_media_dvd_rw_ro = 1; ++ break; ++ case 0x14: ++ info(udev, "profile 0x%02x media_dvd_rw_seq\n", cur_profile); ++ cd_media = 1; ++ cd_media_dvd_rw = 1; ++ cd_media_dvd_rw_seq = 1; ++ break; ++ case 0x1B: ++ info(udev, "profile 0x%02x media_dvd_plus_r\n", cur_profile); ++ cd_media = 1; ++ cd_media_dvd_plus_r = 1; ++ break; ++ case 0x1A: ++ info(udev, "profile 0x%02x media_dvd_plus_rw\n", cur_profile); ++ cd_media = 1; ++ cd_media_dvd_plus_rw = 1; ++ break; ++ case 0x2A: ++ info(udev, "profile 0x%02x media_dvd_plus_rw_dl\n", cur_profile); ++ cd_media = 1; ++ cd_media_dvd_plus_rw_dl = 1; ++ break; ++ case 0x2B: ++ info(udev, "profile 0x%02x media_dvd_plus_r_dl\n", cur_profile); ++ cd_media = 1; ++ cd_media_dvd_plus_r_dl = 1; ++ break; ++ case 0x40: ++ info(udev, "profile 0x%02x media_bd\n", cur_profile); ++ cd_media = 1; ++ cd_media_bd = 1; ++ break; ++ case 0x41: ++ case 0x42: ++ info(udev, "profile 0x%02x media_bd_r\n", cur_profile); ++ cd_media = 1; ++ cd_media_bd_r = 1; ++ break; ++ case 0x43: ++ info(udev, "profile 0x%02x media_bd_re\n", cur_profile); ++ cd_media = 1; ++ cd_media_bd_re = 1; ++ break; ++ case 0x50: ++ info(udev, "profile 0x%02x media_hddvd\n", cur_profile); ++ cd_media = 1; ++ cd_media_hddvd = 1; ++ break; ++ case 0x51: ++ info(udev, "profile 0x%02x media_hddvd_r\n", cur_profile); ++ cd_media = 1; ++ cd_media_hddvd_r = 1; ++ break; ++ case 0x52: ++ info(udev, "profile 0x%02x media_hddvd_rw\n", cur_profile); ++ cd_media = 1; ++ cd_media_hddvd_rw = 1; ++ break; ++ default: ++ info(udev, "profile 0x%02x \n", cur_profile); ++ break; ++ } ++} ++ + static int feature_profiles(struct udev *udev, const unsigned char *profiles, size_t size) + { + unsigned int i; +@@ -350,6 +459,7 @@ static int feature_profiles(struct udev *udev, const unsigned char *profiles, si + return 0; + } + ++/* returns 0 if media was detected */ + static int cd_profiles_old_mmc(struct udev *udev, int fd) + { + struct scsi_cmd sc; +@@ -389,6 +499,7 @@ static int cd_profiles_old_mmc(struct udev *udev, int fd) + return 0; + } + ++/* returns 0 if media was detected */ + static int cd_profiles(struct udev *udev, int fd) + { + struct scsi_cmd sc; +@@ -397,6 +508,9 @@ static int cd_profiles(struct udev *udev, int fd) + unsigned int len; + unsigned int i; + int err; ++ int ret; ++ ++ ret = -1; + + /* First query the current profile */ + scsi_cmd_init(udev, &sc, features, sizeof(features)); +@@ -410,126 +524,20 @@ static int cd_profiles(struct udev *udev, int fd) + if (SK(err) == 0x5 && ASC(err) == 0x20) { + info(udev, "drive is pre-MMC2 and does not support 46h get configuration command\n"); + info(udev, "trying to work around the problem\n"); +- return cd_profiles_old_mmc(udev, fd); ++ ret = cd_profiles_old_mmc(udev, fd); + } +- return -1; ++ goto out; + } + + cur_profile = features[6] << 8 | features[7]; + if (cur_profile > 0) { + info(udev, "current profile 0x%02x\n", cur_profile); ++ feature_profile_media (udev, cur_profile); ++ ret = 0; /* we have media */ + } else { + info(udev, "no current profile, assuming no media\n"); +- return -1; + } + +- switch (cur_profile) { +- case 0x03: +- case 0x04: +- case 0x05: +- info(udev, "profile 0x%02x \n", cur_profile); +- cd_media = 1; +- cd_media_mo = 1; +- break; +- case 0x08: +- info(udev, "profile 0x%02x media_cd_rom\n", cur_profile); +- cd_media = 1; +- cd_media_cd_rom = 1; +- break; +- case 0x09: +- info(udev, "profile 0x%02x media_cd_r\n", cur_profile); +- cd_media = 1; +- cd_media_cd_r = 1; +- break; +- case 0x0a: +- info(udev, "profile 0x%02x media_cd_rw\n", cur_profile); +- cd_media = 1; +- cd_media_cd_rw = 1; +- break; +- case 0x10: +- info(udev, "profile 0x%02x media_dvd_ro\n", cur_profile); +- cd_media = 1; +- cd_media_dvd_rom = 1; +- break; +- case 0x11: +- info(udev, "profile 0x%02x media_dvd_r\n", cur_profile); +- cd_media = 1; +- cd_media_dvd_r = 1; +- break; +- case 0x12: +- info(udev, "profile 0x%02x media_dvd_ram\n", cur_profile); +- cd_media = 1; +- cd_media_dvd_ram = 1; +- break; +- case 0x13: +- info(udev, "profile 0x%02x media_dvd_rw_ro\n", cur_profile); +- cd_media = 1; +- cd_media_dvd_rw = 1; +- cd_media_dvd_rw_ro = 1; +- break; +- case 0x14: +- info(udev, "profile 0x%02x media_dvd_rw_seq\n", cur_profile); +- cd_media = 1; +- cd_media_dvd_rw = 1; +- cd_media_dvd_rw_seq = 1; +- break; +- case 0x1B: +- info(udev, "profile 0x%02x media_dvd_plus_r\n", cur_profile); +- cd_media = 1; +- cd_media_dvd_plus_r = 1; +- break; +- case 0x1A: +- info(udev, "profile 0x%02x media_dvd_plus_rw\n", cur_profile); +- cd_media = 1; +- cd_media_dvd_plus_rw = 1; +- break; +- case 0x2A: +- info(udev, "profile 0x%02x media_dvd_plus_rw_dl\n", cur_profile); +- cd_media = 1; +- cd_media_dvd_plus_rw_dl = 1; +- break; +- case 0x2B: +- info(udev, "profile 0x%02x media_dvd_plus_r_dl\n", cur_profile); +- cd_media = 1; +- cd_media_dvd_plus_r_dl = 1; +- break; +- case 0x40: +- info(udev, "profile 0x%02x media_bd\n", cur_profile); +- cd_media = 1; +- cd_media_bd = 1; +- break; +- case 0x41: +- case 0x42: +- info(udev, "profile 0x%02x media_bd_r\n", cur_profile); +- cd_media = 1; +- cd_media_bd_r = 1; +- break; +- case 0x43: +- info(udev, "profile 0x%02x media_bd_re\n", cur_profile); +- cd_media = 1; +- cd_media_bd_re = 1; +- break; +- case 0x50: +- info(udev, "profile 0x%02x media_hddvd\n", cur_profile); +- cd_media = 1; +- cd_media_hddvd = 1; +- break; +- case 0x51: +- info(udev, "profile 0x%02x media_hddvd_r\n", cur_profile); +- cd_media = 1; +- cd_media_hddvd_r = 1; +- break; +- case 0x52: +- info(udev, "profile 0x%02x media_hddvd_rw\n", cur_profile); +- cd_media = 1; +- cd_media_hddvd_rw = 1; +- break; +- default: +- info(udev, "profile 0x%02x \n", cur_profile); +- break; +- } +- +- + len = features[0] << 24 | features[1] << 16 | features[2] << 8 | features[3]; + info(udev, "GET CONFIGURATION: size of features buffer 0x%04x\n", len); + +@@ -577,8 +585,8 @@ static int cd_profiles(struct udev *udev, int fd) + break; + } + } +- +- return 0; ++out: ++ return ret; + } + + static int cd_media_info(struct udev *udev, int fd) +@@ -905,9 +913,12 @@ int main(int argc, char *argv[]) + goto print; + + /* read drive and possibly current profile */ +- if (cd_profiles(udev, fd) < 0) ++ if (cd_profiles(udev, fd) != 0) + goto print; + ++ /* at this point we are guaranteed to have media in the ++ * drive - find out more about it */ ++ + /* get session/track info */ + cd_media_toc(udev, fd); + diff --git a/udev.spec b/udev.spec index be272ad..105de70 100644 --- a/udev.spec +++ b/udev.spec @@ -7,7 +7,7 @@ Summary: A rule-based device node and kernel event manager Name: udev Version: 166 -Release: 1%{?dist} +Release: 2%{?dist} License: GPLv2+ Group: System Environment/Base Provides: udev-persistent = %{version}-%{release} @@ -18,6 +18,9 @@ Source1: start_udev Source2: udev-retry.init Patch6: udev-164-no-v4l1.patch +Patch7: udev-5e199245f2d2fd03c2586a7f1140300b073a4abe.patch +Patch8: udev-98ab6a377285d5943563cfa397e8b350e43878ec.patch + ExclusiveOS: Linux URL: http://www.kernel.org/pub/linux/utils/kernel/hotplug/udev.html @@ -116,6 +119,8 @@ glib-based applications using libudev functionality. %prep %setup -q %patch6 -p1 +%patch7 -p1 +%patch8 -p1 %build export CFLAGS="$CFLAGS $RPM_OPT_FLAGS -fPIE -DPIE -pie -Wl,-z,relro -Wl,-z,now" @@ -360,6 +365,11 @@ rm -rf $RPM_BUILD_ROOT %attr(0644,root,root) %{_libdir}/pkgconfig/gudev-1.0* %changelog +* Wed Mar 23 2011 Harald Hoyer 166-2 +- add ACLs for harmony remote controls +Resolves: rhbz#559412 +- fixed CDROM profile handling + * Wed Feb 16 2011 Harald Hoyer 166-1 - renamed udev-post initscript to udev-retry to match upstream systemd service name From 545bd16ca5fdbd22a9e385941b04ca3ba2c93d87 Mon Sep 17 00:00:00 2001 From: Harald Hoyer Date: Wed, 23 Mar 2011 13:35:43 +0100 Subject: [PATCH 096/142] - add ACLs for harmony remote controls Resolves: rhbz#559412 - fixed CDROM profile handling --- ...9245f2d2fd03c2586a7f1140300b073a4abe.patch | 25 ++ ...6a377285d5943563cfa397e8b350e43878ec.patch | 345 ++++++++++++++++++ udev.spec | 12 +- 3 files changed, 381 insertions(+), 1 deletion(-) create mode 100644 udev-5e199245f2d2fd03c2586a7f1140300b073a4abe.patch create mode 100644 udev-98ab6a377285d5943563cfa397e8b350e43878ec.patch diff --git a/udev-5e199245f2d2fd03c2586a7f1140300b073a4abe.patch b/udev-5e199245f2d2fd03c2586a7f1140300b073a4abe.patch new file mode 100644 index 0000000..83d2c11 --- /dev/null +++ b/udev-5e199245f2d2fd03c2586a7f1140300b073a4abe.patch @@ -0,0 +1,25 @@ +commit 5e199245f2d2fd03c2586a7f1140300b073a4abe +Author: Harald Hoyer +Date: Thu Mar 17 20:36:20 2011 +0100 + + udev-acl/70-acl.rules: tag ID_REMOTE_CONTROL with acl + + Used by "concordance" to access Logitech Harmony programmable remote + controls. + + http://www.phildev.net/concordance/ + +diff --git a/extras/udev-acl/70-acl.rules b/extras/udev-acl/70-acl.rules +index dd5a7ab..037349d 100644 +--- a/extras/udev-acl/70-acl.rules ++++ b/extras/udev-acl/70-acl.rules +@@ -52,6 +52,9 @@ ENV{ID_SMARTCARD_READER}=="*?", TAG+="udev-acl" + # PDA devices + ENV{ID_PDA}=="*?", TAG+="udev-acl" + ++# Programmable remote control ++ENV{ID_REMOTE_CONTROL}=="1", TAG+="udev-acl" ++ + # joysticks + SUBSYSTEM=="input", ENV{ID_INPUT_JOYSTICK}=="?*", TAG+="udev-acl" + diff --git a/udev-98ab6a377285d5943563cfa397e8b350e43878ec.patch b/udev-98ab6a377285d5943563cfa397e8b350e43878ec.patch new file mode 100644 index 0000000..699add5 --- /dev/null +++ b/udev-98ab6a377285d5943563cfa397e8b350e43878ec.patch @@ -0,0 +1,345 @@ +commit 98ab6a377285d5943563cfa397e8b350e43878ec +Author: David Zeuthen +Date: Tue Mar 15 12:05:00 2011 -0400 + + cdrom_id: Don't ignore profiles when there is no media available + + Just because the GET CONFIGURATION MMC-2 command returns the current + profile as 0 does not mean that we can ignore the profiles describing + the capabilities of the drive - it only means that there currently is + no recognized media in the drive. Therefore, do process the returned + profiles even when cur_profile is 0. + + This fixes a bug where only + + ID_CDROM=1 + ID_CDROM_CD_R=1 + ID_CDROM_CD_RW=1 + ID_CDROM_DVD=1 + ID_CDROM_DVD_R=1 + ID_CDROM_DVD_RAM=1 + + was returned when there is no media in the drive instead of + + ID_CDROM=1 + ID_CDROM_CD=1 + ID_CDROM_CD_R=1 + ID_CDROM_CD_RW=1 + ID_CDROM_DVD=1 + ID_CDROM_DVD_R=1 + ID_CDROM_DVD_RW=1 + ID_CDROM_DVD_RAM=1 + ID_CDROM_DVD_PLUS_R=1 + ID_CDROM_DVD_PLUS_RW=1 + ID_CDROM_DVD_PLUS_R_DL=1 + ID_CDROM_BD=1 + ID_CDROM_BD_R=1 + ID_CDROM_BD_RE=1 + ID_CDROM_HDDVD=1 + + as is returned now. + + Signed-off-by: David Zeuthen + +diff --git a/extras/cdrom_id/cdrom_id.c b/extras/cdrom_id/cdrom_id.c +index 4a58a49..b2f897e 100644 +--- a/extras/cdrom_id/cdrom_id.c ++++ b/extras/cdrom_id/cdrom_id.c +@@ -261,6 +261,115 @@ static int cd_inquiry(struct udev *udev, int fd) { + return 0; + } + ++static void feature_profile_media(struct udev *udev, int cur_profile) ++{ ++ switch (cur_profile) { ++ case 0x03: ++ case 0x04: ++ case 0x05: ++ info(udev, "profile 0x%02x \n", cur_profile); ++ cd_media = 1; ++ cd_media_mo = 1; ++ break; ++ case 0x08: ++ info(udev, "profile 0x%02x media_cd_rom\n", cur_profile); ++ cd_media = 1; ++ cd_media_cd_rom = 1; ++ break; ++ case 0x09: ++ info(udev, "profile 0x%02x media_cd_r\n", cur_profile); ++ cd_media = 1; ++ cd_media_cd_r = 1; ++ break; ++ case 0x0a: ++ info(udev, "profile 0x%02x media_cd_rw\n", cur_profile); ++ cd_media = 1; ++ cd_media_cd_rw = 1; ++ break; ++ case 0x10: ++ info(udev, "profile 0x%02x media_dvd_ro\n", cur_profile); ++ cd_media = 1; ++ cd_media_dvd_rom = 1; ++ break; ++ case 0x11: ++ info(udev, "profile 0x%02x media_dvd_r\n", cur_profile); ++ cd_media = 1; ++ cd_media_dvd_r = 1; ++ break; ++ case 0x12: ++ info(udev, "profile 0x%02x media_dvd_ram\n", cur_profile); ++ cd_media = 1; ++ cd_media_dvd_ram = 1; ++ break; ++ case 0x13: ++ info(udev, "profile 0x%02x media_dvd_rw_ro\n", cur_profile); ++ cd_media = 1; ++ cd_media_dvd_rw = 1; ++ cd_media_dvd_rw_ro = 1; ++ break; ++ case 0x14: ++ info(udev, "profile 0x%02x media_dvd_rw_seq\n", cur_profile); ++ cd_media = 1; ++ cd_media_dvd_rw = 1; ++ cd_media_dvd_rw_seq = 1; ++ break; ++ case 0x1B: ++ info(udev, "profile 0x%02x media_dvd_plus_r\n", cur_profile); ++ cd_media = 1; ++ cd_media_dvd_plus_r = 1; ++ break; ++ case 0x1A: ++ info(udev, "profile 0x%02x media_dvd_plus_rw\n", cur_profile); ++ cd_media = 1; ++ cd_media_dvd_plus_rw = 1; ++ break; ++ case 0x2A: ++ info(udev, "profile 0x%02x media_dvd_plus_rw_dl\n", cur_profile); ++ cd_media = 1; ++ cd_media_dvd_plus_rw_dl = 1; ++ break; ++ case 0x2B: ++ info(udev, "profile 0x%02x media_dvd_plus_r_dl\n", cur_profile); ++ cd_media = 1; ++ cd_media_dvd_plus_r_dl = 1; ++ break; ++ case 0x40: ++ info(udev, "profile 0x%02x media_bd\n", cur_profile); ++ cd_media = 1; ++ cd_media_bd = 1; ++ break; ++ case 0x41: ++ case 0x42: ++ info(udev, "profile 0x%02x media_bd_r\n", cur_profile); ++ cd_media = 1; ++ cd_media_bd_r = 1; ++ break; ++ case 0x43: ++ info(udev, "profile 0x%02x media_bd_re\n", cur_profile); ++ cd_media = 1; ++ cd_media_bd_re = 1; ++ break; ++ case 0x50: ++ info(udev, "profile 0x%02x media_hddvd\n", cur_profile); ++ cd_media = 1; ++ cd_media_hddvd = 1; ++ break; ++ case 0x51: ++ info(udev, "profile 0x%02x media_hddvd_r\n", cur_profile); ++ cd_media = 1; ++ cd_media_hddvd_r = 1; ++ break; ++ case 0x52: ++ info(udev, "profile 0x%02x media_hddvd_rw\n", cur_profile); ++ cd_media = 1; ++ cd_media_hddvd_rw = 1; ++ break; ++ default: ++ info(udev, "profile 0x%02x \n", cur_profile); ++ break; ++ } ++} ++ + static int feature_profiles(struct udev *udev, const unsigned char *profiles, size_t size) + { + unsigned int i; +@@ -350,6 +459,7 @@ static int feature_profiles(struct udev *udev, const unsigned char *profiles, si + return 0; + } + ++/* returns 0 if media was detected */ + static int cd_profiles_old_mmc(struct udev *udev, int fd) + { + struct scsi_cmd sc; +@@ -389,6 +499,7 @@ static int cd_profiles_old_mmc(struct udev *udev, int fd) + return 0; + } + ++/* returns 0 if media was detected */ + static int cd_profiles(struct udev *udev, int fd) + { + struct scsi_cmd sc; +@@ -397,6 +508,9 @@ static int cd_profiles(struct udev *udev, int fd) + unsigned int len; + unsigned int i; + int err; ++ int ret; ++ ++ ret = -1; + + /* First query the current profile */ + scsi_cmd_init(udev, &sc, features, sizeof(features)); +@@ -410,126 +524,20 @@ static int cd_profiles(struct udev *udev, int fd) + if (SK(err) == 0x5 && ASC(err) == 0x20) { + info(udev, "drive is pre-MMC2 and does not support 46h get configuration command\n"); + info(udev, "trying to work around the problem\n"); +- return cd_profiles_old_mmc(udev, fd); ++ ret = cd_profiles_old_mmc(udev, fd); + } +- return -1; ++ goto out; + } + + cur_profile = features[6] << 8 | features[7]; + if (cur_profile > 0) { + info(udev, "current profile 0x%02x\n", cur_profile); ++ feature_profile_media (udev, cur_profile); ++ ret = 0; /* we have media */ + } else { + info(udev, "no current profile, assuming no media\n"); +- return -1; + } + +- switch (cur_profile) { +- case 0x03: +- case 0x04: +- case 0x05: +- info(udev, "profile 0x%02x \n", cur_profile); +- cd_media = 1; +- cd_media_mo = 1; +- break; +- case 0x08: +- info(udev, "profile 0x%02x media_cd_rom\n", cur_profile); +- cd_media = 1; +- cd_media_cd_rom = 1; +- break; +- case 0x09: +- info(udev, "profile 0x%02x media_cd_r\n", cur_profile); +- cd_media = 1; +- cd_media_cd_r = 1; +- break; +- case 0x0a: +- info(udev, "profile 0x%02x media_cd_rw\n", cur_profile); +- cd_media = 1; +- cd_media_cd_rw = 1; +- break; +- case 0x10: +- info(udev, "profile 0x%02x media_dvd_ro\n", cur_profile); +- cd_media = 1; +- cd_media_dvd_rom = 1; +- break; +- case 0x11: +- info(udev, "profile 0x%02x media_dvd_r\n", cur_profile); +- cd_media = 1; +- cd_media_dvd_r = 1; +- break; +- case 0x12: +- info(udev, "profile 0x%02x media_dvd_ram\n", cur_profile); +- cd_media = 1; +- cd_media_dvd_ram = 1; +- break; +- case 0x13: +- info(udev, "profile 0x%02x media_dvd_rw_ro\n", cur_profile); +- cd_media = 1; +- cd_media_dvd_rw = 1; +- cd_media_dvd_rw_ro = 1; +- break; +- case 0x14: +- info(udev, "profile 0x%02x media_dvd_rw_seq\n", cur_profile); +- cd_media = 1; +- cd_media_dvd_rw = 1; +- cd_media_dvd_rw_seq = 1; +- break; +- case 0x1B: +- info(udev, "profile 0x%02x media_dvd_plus_r\n", cur_profile); +- cd_media = 1; +- cd_media_dvd_plus_r = 1; +- break; +- case 0x1A: +- info(udev, "profile 0x%02x media_dvd_plus_rw\n", cur_profile); +- cd_media = 1; +- cd_media_dvd_plus_rw = 1; +- break; +- case 0x2A: +- info(udev, "profile 0x%02x media_dvd_plus_rw_dl\n", cur_profile); +- cd_media = 1; +- cd_media_dvd_plus_rw_dl = 1; +- break; +- case 0x2B: +- info(udev, "profile 0x%02x media_dvd_plus_r_dl\n", cur_profile); +- cd_media = 1; +- cd_media_dvd_plus_r_dl = 1; +- break; +- case 0x40: +- info(udev, "profile 0x%02x media_bd\n", cur_profile); +- cd_media = 1; +- cd_media_bd = 1; +- break; +- case 0x41: +- case 0x42: +- info(udev, "profile 0x%02x media_bd_r\n", cur_profile); +- cd_media = 1; +- cd_media_bd_r = 1; +- break; +- case 0x43: +- info(udev, "profile 0x%02x media_bd_re\n", cur_profile); +- cd_media = 1; +- cd_media_bd_re = 1; +- break; +- case 0x50: +- info(udev, "profile 0x%02x media_hddvd\n", cur_profile); +- cd_media = 1; +- cd_media_hddvd = 1; +- break; +- case 0x51: +- info(udev, "profile 0x%02x media_hddvd_r\n", cur_profile); +- cd_media = 1; +- cd_media_hddvd_r = 1; +- break; +- case 0x52: +- info(udev, "profile 0x%02x media_hddvd_rw\n", cur_profile); +- cd_media = 1; +- cd_media_hddvd_rw = 1; +- break; +- default: +- info(udev, "profile 0x%02x \n", cur_profile); +- break; +- } +- +- + len = features[0] << 24 | features[1] << 16 | features[2] << 8 | features[3]; + info(udev, "GET CONFIGURATION: size of features buffer 0x%04x\n", len); + +@@ -577,8 +585,8 @@ static int cd_profiles(struct udev *udev, int fd) + break; + } + } +- +- return 0; ++out: ++ return ret; + } + + static int cd_media_info(struct udev *udev, int fd) +@@ -905,9 +913,12 @@ int main(int argc, char *argv[]) + goto print; + + /* read drive and possibly current profile */ +- if (cd_profiles(udev, fd) < 0) ++ if (cd_profiles(udev, fd) != 0) + goto print; + ++ /* at this point we are guaranteed to have media in the ++ * drive - find out more about it */ ++ + /* get session/track info */ + cd_media_toc(udev, fd); + diff --git a/udev.spec b/udev.spec index be272ad..105de70 100644 --- a/udev.spec +++ b/udev.spec @@ -7,7 +7,7 @@ Summary: A rule-based device node and kernel event manager Name: udev Version: 166 -Release: 1%{?dist} +Release: 2%{?dist} License: GPLv2+ Group: System Environment/Base Provides: udev-persistent = %{version}-%{release} @@ -18,6 +18,9 @@ Source1: start_udev Source2: udev-retry.init Patch6: udev-164-no-v4l1.patch +Patch7: udev-5e199245f2d2fd03c2586a7f1140300b073a4abe.patch +Patch8: udev-98ab6a377285d5943563cfa397e8b350e43878ec.patch + ExclusiveOS: Linux URL: http://www.kernel.org/pub/linux/utils/kernel/hotplug/udev.html @@ -116,6 +119,8 @@ glib-based applications using libudev functionality. %prep %setup -q %patch6 -p1 +%patch7 -p1 +%patch8 -p1 %build export CFLAGS="$CFLAGS $RPM_OPT_FLAGS -fPIE -DPIE -pie -Wl,-z,relro -Wl,-z,now" @@ -360,6 +365,11 @@ rm -rf $RPM_BUILD_ROOT %attr(0644,root,root) %{_libdir}/pkgconfig/gudev-1.0* %changelog +* Wed Mar 23 2011 Harald Hoyer 166-2 +- add ACLs for harmony remote controls +Resolves: rhbz#559412 +- fixed CDROM profile handling + * Wed Feb 16 2011 Harald Hoyer 166-1 - renamed udev-post initscript to udev-retry to match upstream systemd service name From a8dfb502d8fa50964e6a4d38d8a755e2ad8f0f17 Mon Sep 17 00:00:00 2001 From: Harald Hoyer Date: Wed, 30 Mar 2011 16:50:28 +0200 Subject: [PATCH 097/142] - version 167 --- .gitignore | 1 + sources | 3 +- udev-160.tar.bz2.sign | 8 - udev-164-no-v4l1.patch | 42 --- ...9245f2d2fd03c2586a7f1140300b073a4abe.patch | 25 -- ...6a377285d5943563cfa397e8b350e43878ec.patch | 345 ------------------ udev-retry.init | 67 ---- udev.spec | 28 +- upstream | 1 - upstream-key.gpg | 54 --- 10 files changed, 11 insertions(+), 563 deletions(-) delete mode 100644 udev-160.tar.bz2.sign delete mode 100644 udev-164-no-v4l1.patch delete mode 100644 udev-5e199245f2d2fd03c2586a7f1140300b073a4abe.patch delete mode 100644 udev-98ab6a377285d5943563cfa397e8b350e43878ec.patch delete mode 100644 udev-retry.init delete mode 100644 upstream delete mode 100644 upstream-key.gpg diff --git a/.gitignore b/.gitignore index ff4586d..80bcd9e 100644 --- a/.gitignore +++ b/.gitignore @@ -3,3 +3,4 @@ udev-160.tar.bz2 /udev-164.tar.bz2.sign /udev-166.tar.bz2 /udev-166.tar.bz2.sign +/udev-167.tar.bz2 diff --git a/sources b/sources index 871f305..db4315b 100644 --- a/sources +++ b/sources @@ -1,2 +1 @@ -4db27d73fdbe94f47fd89fdd105c2dfb udev-166.tar.bz2 -3cb37564a589d4fedd6e7e3e178698d4 udev-166.tar.bz2.sign +4b37e1222f06c14c24147de346aa0bad udev-167.tar.bz2 diff --git a/udev-160.tar.bz2.sign b/udev-160.tar.bz2.sign deleted file mode 100644 index f5465a6..0000000 --- a/udev-160.tar.bz2.sign +++ /dev/null @@ -1,8 +0,0 @@ ------BEGIN PGP SIGNATURE----- -Version: GnuPG v1.4.9 (GNU/Linux) -Comment: See http://www.kernel.org/signature.html for info - -iD8DBQBMOkG1yGugalF9Dw4RAjB0AJ9ftRX/zmCiRcSyQWhcWJXsnXDn3gCeMFbR -KdR80Jxmitbil01dFfPzwEE= -=8B8M ------END PGP SIGNATURE----- diff --git a/udev-164-no-v4l1.patch b/udev-164-no-v4l1.patch deleted file mode 100644 index 9d9ef7c..0000000 --- a/udev-164-no-v4l1.patch +++ /dev/null @@ -1,42 +0,0 @@ -diff --git a/extras/v4l_id/v4l_id.c b/extras/v4l_id/v4l_id.c -index d530a6d..e4b22bf 100644 ---- a/extras/v4l_id/v4l_id.c -+++ b/extras/v4l_id/v4l_id.c -@@ -28,7 +28,6 @@ - #include - #include - #include --#include - #include - - int main (int argc, char *argv[]) -@@ -39,7 +38,6 @@ int main (int argc, char *argv[]) - }; - int fd; - char *device; -- struct video_capability v1cap; - struct v4l2_capability v2cap; - - while (1) { -@@ -82,20 +80,7 @@ int main (int argc, char *argv[]) - if ((v2cap.capabilities & V4L2_CAP_RADIO) > 0) - printf("radio:"); - printf("\n"); -- } else if (ioctl (fd, VIDIOCGCAP, &v1cap) == 0) { -- printf("ID_V4L_VERSION=1\n"); -- printf("ID_V4L_PRODUCT=%s\n", v1cap.name); -- printf("ID_V4L_CAPABILITIES=:"); -- if ((v1cap.type & VID_TYPE_CAPTURE) > 0) -- printf("capture:"); -- if ((v1cap.type & VID_TYPE_OVERLAY) > 0) -- printf("video_overlay:"); -- if (v1cap.audios > 0) -- printf("audio:"); -- if ((v1cap.type & VID_TYPE_TUNER) > 0) -- printf("tuner:"); -- printf("\n"); -- } -+ } - - close (fd); - return 0; diff --git a/udev-5e199245f2d2fd03c2586a7f1140300b073a4abe.patch b/udev-5e199245f2d2fd03c2586a7f1140300b073a4abe.patch deleted file mode 100644 index 83d2c11..0000000 --- a/udev-5e199245f2d2fd03c2586a7f1140300b073a4abe.patch +++ /dev/null @@ -1,25 +0,0 @@ -commit 5e199245f2d2fd03c2586a7f1140300b073a4abe -Author: Harald Hoyer -Date: Thu Mar 17 20:36:20 2011 +0100 - - udev-acl/70-acl.rules: tag ID_REMOTE_CONTROL with acl - - Used by "concordance" to access Logitech Harmony programmable remote - controls. - - http://www.phildev.net/concordance/ - -diff --git a/extras/udev-acl/70-acl.rules b/extras/udev-acl/70-acl.rules -index dd5a7ab..037349d 100644 ---- a/extras/udev-acl/70-acl.rules -+++ b/extras/udev-acl/70-acl.rules -@@ -52,6 +52,9 @@ ENV{ID_SMARTCARD_READER}=="*?", TAG+="udev-acl" - # PDA devices - ENV{ID_PDA}=="*?", TAG+="udev-acl" - -+# Programmable remote control -+ENV{ID_REMOTE_CONTROL}=="1", TAG+="udev-acl" -+ - # joysticks - SUBSYSTEM=="input", ENV{ID_INPUT_JOYSTICK}=="?*", TAG+="udev-acl" - diff --git a/udev-98ab6a377285d5943563cfa397e8b350e43878ec.patch b/udev-98ab6a377285d5943563cfa397e8b350e43878ec.patch deleted file mode 100644 index 699add5..0000000 --- a/udev-98ab6a377285d5943563cfa397e8b350e43878ec.patch +++ /dev/null @@ -1,345 +0,0 @@ -commit 98ab6a377285d5943563cfa397e8b350e43878ec -Author: David Zeuthen -Date: Tue Mar 15 12:05:00 2011 -0400 - - cdrom_id: Don't ignore profiles when there is no media available - - Just because the GET CONFIGURATION MMC-2 command returns the current - profile as 0 does not mean that we can ignore the profiles describing - the capabilities of the drive - it only means that there currently is - no recognized media in the drive. Therefore, do process the returned - profiles even when cur_profile is 0. - - This fixes a bug where only - - ID_CDROM=1 - ID_CDROM_CD_R=1 - ID_CDROM_CD_RW=1 - ID_CDROM_DVD=1 - ID_CDROM_DVD_R=1 - ID_CDROM_DVD_RAM=1 - - was returned when there is no media in the drive instead of - - ID_CDROM=1 - ID_CDROM_CD=1 - ID_CDROM_CD_R=1 - ID_CDROM_CD_RW=1 - ID_CDROM_DVD=1 - ID_CDROM_DVD_R=1 - ID_CDROM_DVD_RW=1 - ID_CDROM_DVD_RAM=1 - ID_CDROM_DVD_PLUS_R=1 - ID_CDROM_DVD_PLUS_RW=1 - ID_CDROM_DVD_PLUS_R_DL=1 - ID_CDROM_BD=1 - ID_CDROM_BD_R=1 - ID_CDROM_BD_RE=1 - ID_CDROM_HDDVD=1 - - as is returned now. - - Signed-off-by: David Zeuthen - -diff --git a/extras/cdrom_id/cdrom_id.c b/extras/cdrom_id/cdrom_id.c -index 4a58a49..b2f897e 100644 ---- a/extras/cdrom_id/cdrom_id.c -+++ b/extras/cdrom_id/cdrom_id.c -@@ -261,6 +261,115 @@ static int cd_inquiry(struct udev *udev, int fd) { - return 0; - } - -+static void feature_profile_media(struct udev *udev, int cur_profile) -+{ -+ switch (cur_profile) { -+ case 0x03: -+ case 0x04: -+ case 0x05: -+ info(udev, "profile 0x%02x \n", cur_profile); -+ cd_media = 1; -+ cd_media_mo = 1; -+ break; -+ case 0x08: -+ info(udev, "profile 0x%02x media_cd_rom\n", cur_profile); -+ cd_media = 1; -+ cd_media_cd_rom = 1; -+ break; -+ case 0x09: -+ info(udev, "profile 0x%02x media_cd_r\n", cur_profile); -+ cd_media = 1; -+ cd_media_cd_r = 1; -+ break; -+ case 0x0a: -+ info(udev, "profile 0x%02x media_cd_rw\n", cur_profile); -+ cd_media = 1; -+ cd_media_cd_rw = 1; -+ break; -+ case 0x10: -+ info(udev, "profile 0x%02x media_dvd_ro\n", cur_profile); -+ cd_media = 1; -+ cd_media_dvd_rom = 1; -+ break; -+ case 0x11: -+ info(udev, "profile 0x%02x media_dvd_r\n", cur_profile); -+ cd_media = 1; -+ cd_media_dvd_r = 1; -+ break; -+ case 0x12: -+ info(udev, "profile 0x%02x media_dvd_ram\n", cur_profile); -+ cd_media = 1; -+ cd_media_dvd_ram = 1; -+ break; -+ case 0x13: -+ info(udev, "profile 0x%02x media_dvd_rw_ro\n", cur_profile); -+ cd_media = 1; -+ cd_media_dvd_rw = 1; -+ cd_media_dvd_rw_ro = 1; -+ break; -+ case 0x14: -+ info(udev, "profile 0x%02x media_dvd_rw_seq\n", cur_profile); -+ cd_media = 1; -+ cd_media_dvd_rw = 1; -+ cd_media_dvd_rw_seq = 1; -+ break; -+ case 0x1B: -+ info(udev, "profile 0x%02x media_dvd_plus_r\n", cur_profile); -+ cd_media = 1; -+ cd_media_dvd_plus_r = 1; -+ break; -+ case 0x1A: -+ info(udev, "profile 0x%02x media_dvd_plus_rw\n", cur_profile); -+ cd_media = 1; -+ cd_media_dvd_plus_rw = 1; -+ break; -+ case 0x2A: -+ info(udev, "profile 0x%02x media_dvd_plus_rw_dl\n", cur_profile); -+ cd_media = 1; -+ cd_media_dvd_plus_rw_dl = 1; -+ break; -+ case 0x2B: -+ info(udev, "profile 0x%02x media_dvd_plus_r_dl\n", cur_profile); -+ cd_media = 1; -+ cd_media_dvd_plus_r_dl = 1; -+ break; -+ case 0x40: -+ info(udev, "profile 0x%02x media_bd\n", cur_profile); -+ cd_media = 1; -+ cd_media_bd = 1; -+ break; -+ case 0x41: -+ case 0x42: -+ info(udev, "profile 0x%02x media_bd_r\n", cur_profile); -+ cd_media = 1; -+ cd_media_bd_r = 1; -+ break; -+ case 0x43: -+ info(udev, "profile 0x%02x media_bd_re\n", cur_profile); -+ cd_media = 1; -+ cd_media_bd_re = 1; -+ break; -+ case 0x50: -+ info(udev, "profile 0x%02x media_hddvd\n", cur_profile); -+ cd_media = 1; -+ cd_media_hddvd = 1; -+ break; -+ case 0x51: -+ info(udev, "profile 0x%02x media_hddvd_r\n", cur_profile); -+ cd_media = 1; -+ cd_media_hddvd_r = 1; -+ break; -+ case 0x52: -+ info(udev, "profile 0x%02x media_hddvd_rw\n", cur_profile); -+ cd_media = 1; -+ cd_media_hddvd_rw = 1; -+ break; -+ default: -+ info(udev, "profile 0x%02x \n", cur_profile); -+ break; -+ } -+} -+ - static int feature_profiles(struct udev *udev, const unsigned char *profiles, size_t size) - { - unsigned int i; -@@ -350,6 +459,7 @@ static int feature_profiles(struct udev *udev, const unsigned char *profiles, si - return 0; - } - -+/* returns 0 if media was detected */ - static int cd_profiles_old_mmc(struct udev *udev, int fd) - { - struct scsi_cmd sc; -@@ -389,6 +499,7 @@ static int cd_profiles_old_mmc(struct udev *udev, int fd) - return 0; - } - -+/* returns 0 if media was detected */ - static int cd_profiles(struct udev *udev, int fd) - { - struct scsi_cmd sc; -@@ -397,6 +508,9 @@ static int cd_profiles(struct udev *udev, int fd) - unsigned int len; - unsigned int i; - int err; -+ int ret; -+ -+ ret = -1; - - /* First query the current profile */ - scsi_cmd_init(udev, &sc, features, sizeof(features)); -@@ -410,126 +524,20 @@ static int cd_profiles(struct udev *udev, int fd) - if (SK(err) == 0x5 && ASC(err) == 0x20) { - info(udev, "drive is pre-MMC2 and does not support 46h get configuration command\n"); - info(udev, "trying to work around the problem\n"); -- return cd_profiles_old_mmc(udev, fd); -+ ret = cd_profiles_old_mmc(udev, fd); - } -- return -1; -+ goto out; - } - - cur_profile = features[6] << 8 | features[7]; - if (cur_profile > 0) { - info(udev, "current profile 0x%02x\n", cur_profile); -+ feature_profile_media (udev, cur_profile); -+ ret = 0; /* we have media */ - } else { - info(udev, "no current profile, assuming no media\n"); -- return -1; - } - -- switch (cur_profile) { -- case 0x03: -- case 0x04: -- case 0x05: -- info(udev, "profile 0x%02x \n", cur_profile); -- cd_media = 1; -- cd_media_mo = 1; -- break; -- case 0x08: -- info(udev, "profile 0x%02x media_cd_rom\n", cur_profile); -- cd_media = 1; -- cd_media_cd_rom = 1; -- break; -- case 0x09: -- info(udev, "profile 0x%02x media_cd_r\n", cur_profile); -- cd_media = 1; -- cd_media_cd_r = 1; -- break; -- case 0x0a: -- info(udev, "profile 0x%02x media_cd_rw\n", cur_profile); -- cd_media = 1; -- cd_media_cd_rw = 1; -- break; -- case 0x10: -- info(udev, "profile 0x%02x media_dvd_ro\n", cur_profile); -- cd_media = 1; -- cd_media_dvd_rom = 1; -- break; -- case 0x11: -- info(udev, "profile 0x%02x media_dvd_r\n", cur_profile); -- cd_media = 1; -- cd_media_dvd_r = 1; -- break; -- case 0x12: -- info(udev, "profile 0x%02x media_dvd_ram\n", cur_profile); -- cd_media = 1; -- cd_media_dvd_ram = 1; -- break; -- case 0x13: -- info(udev, "profile 0x%02x media_dvd_rw_ro\n", cur_profile); -- cd_media = 1; -- cd_media_dvd_rw = 1; -- cd_media_dvd_rw_ro = 1; -- break; -- case 0x14: -- info(udev, "profile 0x%02x media_dvd_rw_seq\n", cur_profile); -- cd_media = 1; -- cd_media_dvd_rw = 1; -- cd_media_dvd_rw_seq = 1; -- break; -- case 0x1B: -- info(udev, "profile 0x%02x media_dvd_plus_r\n", cur_profile); -- cd_media = 1; -- cd_media_dvd_plus_r = 1; -- break; -- case 0x1A: -- info(udev, "profile 0x%02x media_dvd_plus_rw\n", cur_profile); -- cd_media = 1; -- cd_media_dvd_plus_rw = 1; -- break; -- case 0x2A: -- info(udev, "profile 0x%02x media_dvd_plus_rw_dl\n", cur_profile); -- cd_media = 1; -- cd_media_dvd_plus_rw_dl = 1; -- break; -- case 0x2B: -- info(udev, "profile 0x%02x media_dvd_plus_r_dl\n", cur_profile); -- cd_media = 1; -- cd_media_dvd_plus_r_dl = 1; -- break; -- case 0x40: -- info(udev, "profile 0x%02x media_bd\n", cur_profile); -- cd_media = 1; -- cd_media_bd = 1; -- break; -- case 0x41: -- case 0x42: -- info(udev, "profile 0x%02x media_bd_r\n", cur_profile); -- cd_media = 1; -- cd_media_bd_r = 1; -- break; -- case 0x43: -- info(udev, "profile 0x%02x media_bd_re\n", cur_profile); -- cd_media = 1; -- cd_media_bd_re = 1; -- break; -- case 0x50: -- info(udev, "profile 0x%02x media_hddvd\n", cur_profile); -- cd_media = 1; -- cd_media_hddvd = 1; -- break; -- case 0x51: -- info(udev, "profile 0x%02x media_hddvd_r\n", cur_profile); -- cd_media = 1; -- cd_media_hddvd_r = 1; -- break; -- case 0x52: -- info(udev, "profile 0x%02x media_hddvd_rw\n", cur_profile); -- cd_media = 1; -- cd_media_hddvd_rw = 1; -- break; -- default: -- info(udev, "profile 0x%02x \n", cur_profile); -- break; -- } -- -- - len = features[0] << 24 | features[1] << 16 | features[2] << 8 | features[3]; - info(udev, "GET CONFIGURATION: size of features buffer 0x%04x\n", len); - -@@ -577,8 +585,8 @@ static int cd_profiles(struct udev *udev, int fd) - break; - } - } -- -- return 0; -+out: -+ return ret; - } - - static int cd_media_info(struct udev *udev, int fd) -@@ -905,9 +913,12 @@ int main(int argc, char *argv[]) - goto print; - - /* read drive and possibly current profile */ -- if (cd_profiles(udev, fd) < 0) -+ if (cd_profiles(udev, fd) != 0) - goto print; - -+ /* at this point we are guaranteed to have media in the -+ * drive - find out more about it */ -+ - /* get session/track info */ - cd_media_toc(udev, fd); - diff --git a/udev-retry.init b/udev-retry.init deleted file mode 100644 index b4cb201..0000000 --- a/udev-retry.init +++ /dev/null @@ -1,67 +0,0 @@ -#!/bin/bash -# -# udev-retry Post script for udev, after all filesystems are mounted -# -# Authors: Harald Hoyer -# -# chkconfig: 12345 26 75 -# description: Moves the generated persistent udev rules to /etc/udev/rules.d -# -### BEGIN INIT INFO -# Default-Start: 12345 -# Default-Stop: 0 6 -# Required-Start: $local_fs -# Required-Stop: -# Short-Description: Moves the generated persistent udev rules to /etc/udev/rules.d -# Description: Moves the generated persistent udev rules to /etc/udev/rules.d -# Provides: udev-retry -### END INIT INFO - -. /etc/rc.d/init.d/functions - -# See how we were called. -case "$1" in - start|reload) - [ -w /var/lock/subsys ] || exit 4 - STRING=$"Retrigger failed udev events" - echo -n $STRING - /sbin/udevadm trigger --type=failed - success "$STRING" - echo - - STRING=$"Adding udev persistent rules" - - # copy the rules generated before / was mounted read-write - for file in /dev/.udev/tmp-rules--*; do - dest=${file##*tmp-rules--} - # check, if anything is todo - [ "$dest" = '*' ] && exit 0 - echo -n $STRING - cat $file >> /etc/udev/rules.d/$dest - rc=$? - rm -f $file - if [ "$rc" -eq "0" ]; then - success "$STRING" - echo - elif [ "$rc" -eq "1" ]; then - failure "$STRING" - echo - fi - done - - touch /var/lock/subsys/udev-retry - exit 0 - ;; - stop) - [ -w /var/lock/subsys ] || exit 4 - rm -f /var/lock/subsys/udev-retry - exit 0 - ;; - status) - exit 3 - ;; - *) - echo $"Usage: $0 {start|stop|reload}" - exit 2 -esac -exit 0 diff --git a/udev.spec b/udev.spec index 105de70..35c5349 100644 --- a/udev.spec +++ b/udev.spec @@ -6,8 +6,8 @@ Summary: A rule-based device node and kernel event manager Name: udev -Version: 166 -Release: 2%{?dist} +Version: 167 +Release: 1%{?dist} License: GPLv2+ Group: System Environment/Base Provides: udev-persistent = %{version}-%{release} @@ -15,12 +15,6 @@ Obsoletes: udev-persistent < 0:030-5 Source: ftp://ftp.kernel.org/pub/linux/utils/kernel/hotplug/%{name}-%{version}.tar.bz2 Source1: start_udev -Source2: udev-retry.init - -Patch6: udev-164-no-v4l1.patch -Patch7: udev-5e199245f2d2fd03c2586a7f1140300b073a4abe.patch -Patch8: udev-98ab6a377285d5943563cfa397e8b350e43878ec.patch - ExclusiveOS: Linux URL: http://www.kernel.org/pub/linux/utils/kernel/hotplug/udev.html @@ -118,9 +112,6 @@ glib-based applications using libudev functionality. %prep %setup -q -%patch6 -p1 -%patch7 -p1 -%patch8 -p1 %build export CFLAGS="$CFLAGS $RPM_OPT_FLAGS -fPIE -DPIE -pie -Wl,-z,relro -Wl,-z,now" @@ -180,7 +171,6 @@ install -m 0755 %{SOURCE1} $RPM_BUILD_ROOT/sbin/start_udev mkdir -p -m 0755 $RPM_BUILD_ROOT%{firmwaredir} mkdir -p $RPM_BUILD_ROOT%{_sysconfdir}/rc.d/init.d -install -m 0755 %{SOURCE2} $RPM_BUILD_ROOT%{_sysconfdir}/rc.d/init.d/udev-retry %preun if [ "$1" -eq 0 -a -f %{_initrddir}/udev ]; then @@ -243,7 +233,6 @@ if test -f /proc/1/exe -a -d /proc/1/root; then /sbin/udevadm control --start-exec-queue || : fi fi -/sbin/chkconfig --add udev-retry exit 0 @@ -275,13 +264,11 @@ rm -rf $RPM_BUILD_ROOT %attr(0755,root,root) %{udev_scriptdir}/write_cd_rules %attr(0755,root,root) %{udev_scriptdir}/write_net_rules %attr(0755,root,root) %{udev_scriptdir}/collect -%attr(0755,root,root) %{udev_scriptdir}/fstab_import %attr(0755,root,root) %{udev_scriptdir}/input_id %attr(0755,root,root) %{udev_scriptdir}/keyboard-force-release.sh %attr(0755,root,root) %{udev_scriptdir}/mtd_probe %attr(0755,root,root) %dir %{udev_scriptdir}/rules.d/ -%attr(0755,root,root) %{_sysconfdir}/rc.d/init.d/udev-retry %attr(0755,root,root) %dir %{_sysconfdir}/udev/ %attr(0755,root,root) %dir %{_sysconfdir}/udev/rules.d/ %attr(0755,root,root) %dir %{udev_scriptdir}/ @@ -318,13 +305,13 @@ rm -rf $RPM_BUILD_ROOT %{_datadir}/pkgconfig/udev.pc %attr(0755,root,root) /sbin/start_udev -%attr(0644,root,root) %{systemdsystemunitdir}/udev-retry.service %attr(0644,root,root) %{systemdsystemunitdir}/udev-settle.service +%attr(0644,root,root) %{systemdsystemunitdir}/udev-trigger.service %attr(0644,root,root) %{systemdsystemunitdir}/udev.service -%{systemdsystemunitdir}/basic.target.wants/udev-retry.service -%{systemdsystemunitdir}/basic.target.wants/udev-settle.service +%attr(0644,root,root) %{systemdsystemunitdir}/udev.socket %{systemdsystemunitdir}/basic.target.wants/udev.service - +%{systemdsystemunitdir}/basic.target.wants/udev-trigger.service +%{systemdsystemunitdir}/sockets.target.wants/udev.socket # Deprecated, but keep the ownership %ghost %dir /var/lib/udev @@ -365,6 +352,9 @@ rm -rf $RPM_BUILD_ROOT %attr(0644,root,root) %{_libdir}/pkgconfig/gudev-1.0* %changelog +* Wed Mar 30 2011 Harald Hoyer 167-1 +- version 167 + * Wed Mar 23 2011 Harald Hoyer 166-2 - add ACLs for harmony remote controls Resolves: rhbz#559412 diff --git a/upstream b/upstream deleted file mode 100644 index 287b708..0000000 --- a/upstream +++ /dev/null @@ -1 +0,0 @@ -udev-145.tar.bz2 diff --git a/upstream-key.gpg b/upstream-key.gpg deleted file mode 100644 index 81cd947..0000000 --- a/upstream-key.gpg +++ /dev/null @@ -1,54 +0,0 @@ -pub 1024D/517D0F0E 2000-10-10 Linux Kernel Archives Verification Key - Key fingerprint = C75D C40A 11D7 AF88 9981 ED5B C86B A06A 517D 0F0E -sub 4096g/E50A8F2A 2000-10-10 - ------BEGIN PGP PUBLIC KEY BLOCK----- -Version: GnuPG v1.0.3 (GNU/Linux) -Comment: For info see http://www.gnupg.org - -mQGiBDnirDkRBADCTL/iUTeZKb0tiAcKdZdsUP/KSnrGGjlinolUAsUC0D6/hUB1 -RdCpJOOERTIEr1yvehqDM7veRhNMoxJNQxa/sSrkywey5qc8uaskUNEqenimq/70 -bahWJeoWXjad68mQFh65lULnHQrrioeJnh9UpyGJppNb/yIjdnymH9aYEwCglgP7 -UegBzH22h8NVQEK2PWWbyUUD/jQA4lI0wRWcL9HpkYkHcH0LTKRB9zYpQYtyvzJi -yTGwJyFMfYNXy0RT11dICeLkf3HMR84hkPERKMhALobLxVUbfc7j2AygmzGphWGy -DH/xjptQP/zrsq87ylYRONK18w1J42cm+yZa4XThMDPJMrb9/l8qnxU1JnW7W1al -HKTpBACbs+91KLqrnIGcF44TMwxgUj5CUrayPoEnLU+ZMBqfSjmu8RqEYmTxJCKv -7erBFSuazBGj5X7twunrtrW3bxO63MbLbHjfXSRrMnKOb8dRULIg6eWAnoAx8VVZ -YjrOpwAntU3WxYOpbiCHt9kLbb+N5rvNtFcmOqRRQaCIUFOOaLQ8TGludXggS2Vy -bmVsIEFyY2hpdmVzIFZlcmlmaWNhdGlvbiBLZXkgPGZ0cGFkbWluQGtlcm5lbC5v -cmc+iFUEExECABUFAjnirDkDCwoDAxUDAgMWAgECF4AACgkQyGugalF9Dw4MNACe -JiQTyCmQzPGou2cl/RyOXj79kYYAnAsT6xt72hp/PFiywYM9vBsDVv9niQEVAwUQ -OeKwNWx5eAAqlgcFAQEdZgf/Vn2dMKrn8021NhavP0uA3pHGRmdKQ2WJBdLiN2tv -LkpAioZtho+op+xBz8j1zdIJQ/7XWko869KHge2BAFwA8rWDzjtaAWdE0Jo/NiAR -epUwV2FdRRwSxIcNG2CCPyJnfPokRqjdl2z9k2PkwidHSq+2k6JxCWnOcIXChSKf -kHnemtA65ixAlhuxvyN3MPuYs1jAHyDGcyMfomp1qH9tXFQhhyXRrG2eMAfslstC -XGXLcoLN3O2BMR/fG2GlV6kOqGOvoMIW3clVeQLQ9B1yyekKiVY6Vg+CgK5qhg8z -9tjH4f33zzNDwsx1WSCOU/1LIPzFBNbR9QtTF2XmOUfRs4hGBBARAgAGBQI54rBc -AAoJEH2d7s4ry8YhmjsAoMUW9RxfXBSos0A6LwGd+5pXv/MRAKCYFLG2T4GSV+qf -iRsXnrgDHQHD04hGBBARAgAGBQI54rOZAAoJEPKlddweGoeC/+sAoL5f7JF21mRe -Z8VV4nhh7prm+idSAKCMXDWW/tBOeJDYpiEhgyGSGgJJWrkEDQQ54q+cEBAAjRmb -txamcZ9EYsQTnQvVL2l6vY5Rnbc1JDdcyHEV1kH5OwZWqvckL4QgKKBbTQwyB9pC -o0nGK4PkBbrwL0outfHQ5jl9DUzTKIu+asWUyf3fxfUV6j2A6BMo59KNnJzUyJ2+ -B5na6NN8nEqEtmogROtjT8LkOvYwqD4A/5re2vwtie+h5yU6A+JbyGQF6lFxThZj -4WGctBgCcDBqRkPAG8DFFAdeN5SMAArktCYuUGXi2q88EDoOs3Ykw0kB8+ZFECz/ -4/b93so5Wt2hC15cxAJoXFfR3mXHm40EHzMdEublWV4blB2KvFocQC74/H74QPUk -cWlc6EhPodKvcuOfTimDxXaiGNFONUPgNAmCXeVoOapdWpb3x7iOHPwSaXeJSrO9 -fc4GtVjDv90DT2ekK7cvYk8s6B3t7p7W21Xi+hRgrw63B3HElr01gdMZY5XA5ey/ -WmnyBS6LOxXlnVBE+2uSQ+aZHqrLpXcRvq2ZonOziDSE0i940ZvIwlSzn0U5BQWl -9hBDQw78RacYqaFvlpcGiPj75bScB4eemxV6Wdo9mtK0Vrr+9bWScXHEv7did4X+ -7tBWKbA8M+g290OSzjeQBGLuPmbjxzEKH9jcUumzBzzC5x5GFh7On9TLXQ4K/oRT -6QQpS93YrTVbR60G4MKsePWLJmg7IgYUtNdLGjsAAwUP/0aAAq8CmWtourj1XxNY -pFmOAU45d65fPWVadKyF++B+uDyRNYN7HQCqrJ7ddn0sH7OBtlE8yaBYgR0TFly9 -9+LqQO4r4IGCw2TBgA5tKnOWoPGEzvrLeoxR3SnPrKBlDvx6Rr9h3OJ9UV5u/NLh -mCP9iN10gWCGzsWbONc6qD6PugbTur44D6s4CRK9xfliSrtG3GBHW914UKjJeB9s -e3oc1rkmNv39kKcu33w4XVETAj4qpXnwoJvy639dfvnQt1TWFjIt20iP7m+jkT3B -b526uJ5GuJl6r8sm5OYYRs5cLigvUzRZVgYnjjqlRRACx0WcinKK55Li2Pq4qcRV -vSE5Tr3kTUTGxdmy113FbscrhLhesGALv3Hb7jeeWC8jviGEaHppgUumR6v0hsI1 -rZ3K8kCjFRAYV8OKtcEeMqjouArGi5dn0ClmG4lwH4SEdqC/TRNWGG+iVpWf5yCj -9mvtvUhLtl6QjXHLrJdSGyafvqR1EQMJadFt4URvx0M7tqZIcwPUnb+7Oc+J96po -e/EQmnm6rFnTpWz0BbY4mbJC7vUH4JyLs0nlxiKrBjaO9C1DSAKBpjqaga8dQe1Z -kLOI2F7IWFeKV2LaMl+ZvvfWMECNcqNW2fkCuP9Fpz5K+xg21TwovVy93aWKgFL6 -06jK51oQp3fW86xXK9ZGKYqQiEYEGBECAAYFAjnir5wACgkQyGugalF9Dw5M9QCg -hhmHalzWf8B3AVrjPrtrRHA1vlgAn3YRlU5l0V5W1iXvHXQCUHIESpgm -=SZZb ------END PGP PUBLIC KEY BLOCK----- From 9ecfc0140b6e3248a8428d1fe42411439cd6a47e Mon Sep 17 00:00:00 2001 From: Harald Hoyer Date: Wed, 30 Mar 2011 17:18:01 +0200 Subject: [PATCH 098/142] - version 167 --- udev.spec | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/udev.spec b/udev.spec index 35c5349..b88a4da 100644 --- a/udev.spec +++ b/udev.spec @@ -206,6 +206,7 @@ getent group floppy >/dev/null || /usr/sbin/groupadd -g 19 floppy || : if test -f /proc/1/exe -a -d /proc/1/root; then if test -x /usr/bin/stat -a \ "$(/usr/bin/stat -Lc '%%D-%%i' /)" = "$(/usr/bin/stat -Lc '%%D-%%i' /proc/1/root)"; then + /bin/systemctl stop udev.service >/dev/null 2>&1 || : if test -x /sbin/udevd -a -x /sbin/pidof ; then /sbin/udevadm control --stop-exec-queue pid=$(/sbin/pidof -c udevd) @@ -223,19 +224,22 @@ fi exit 0 %post -# convert old database files -/sbin/udevadm info --convert-db >/dev/null 2>&1 || : +/bin/systemctl daemon-reload >/dev/null 2>&1 || : # start daemon if we are not in a chroot if test -f /proc/1/exe -a -d /proc/1/root; then if test "$(/usr/bin/stat -Lc '%%D-%%i' /)" = "$(/usr/bin/stat -Lc '%%D-%%i' /proc/1/root)"; then - /sbin/udevd -d + /bin/systemctl start udev.service >/dev/null 2>&1 || : + /sbin/udevd -d >/dev/null 2>&1 || : /sbin/udevadm control --start-exec-queue || : fi fi exit 0 +%postun +/bin/systemctl daemon-reload >/dev/null 2>&1 || : + %post -n libudev -p /sbin/ldconfig %postun -n libudev -p /sbin/ldconfig From 7d03ac0923bbc8941f0faad2f23cd66d36094150 Mon Sep 17 00:00:00 2001 From: Harald Hoyer Date: Wed, 30 Mar 2011 16:50:28 +0200 Subject: [PATCH 099/142] - version 167 --- .gitignore | 1 + sources | 3 +- udev-160.tar.bz2.sign | 8 - udev-164-no-v4l1.patch | 42 --- ...9245f2d2fd03c2586a7f1140300b073a4abe.patch | 25 -- ...6a377285d5943563cfa397e8b350e43878ec.patch | 345 ------------------ udev-retry.init | 67 ---- udev.spec | 28 +- upstream | 1 - upstream-key.gpg | 54 --- 10 files changed, 11 insertions(+), 563 deletions(-) delete mode 100644 udev-160.tar.bz2.sign delete mode 100644 udev-164-no-v4l1.patch delete mode 100644 udev-5e199245f2d2fd03c2586a7f1140300b073a4abe.patch delete mode 100644 udev-98ab6a377285d5943563cfa397e8b350e43878ec.patch delete mode 100644 udev-retry.init delete mode 100644 upstream delete mode 100644 upstream-key.gpg diff --git a/.gitignore b/.gitignore index ff4586d..80bcd9e 100644 --- a/.gitignore +++ b/.gitignore @@ -3,3 +3,4 @@ udev-160.tar.bz2 /udev-164.tar.bz2.sign /udev-166.tar.bz2 /udev-166.tar.bz2.sign +/udev-167.tar.bz2 diff --git a/sources b/sources index 871f305..db4315b 100644 --- a/sources +++ b/sources @@ -1,2 +1 @@ -4db27d73fdbe94f47fd89fdd105c2dfb udev-166.tar.bz2 -3cb37564a589d4fedd6e7e3e178698d4 udev-166.tar.bz2.sign +4b37e1222f06c14c24147de346aa0bad udev-167.tar.bz2 diff --git a/udev-160.tar.bz2.sign b/udev-160.tar.bz2.sign deleted file mode 100644 index f5465a6..0000000 --- a/udev-160.tar.bz2.sign +++ /dev/null @@ -1,8 +0,0 @@ ------BEGIN PGP SIGNATURE----- -Version: GnuPG v1.4.9 (GNU/Linux) -Comment: See http://www.kernel.org/signature.html for info - -iD8DBQBMOkG1yGugalF9Dw4RAjB0AJ9ftRX/zmCiRcSyQWhcWJXsnXDn3gCeMFbR -KdR80Jxmitbil01dFfPzwEE= -=8B8M ------END PGP SIGNATURE----- diff --git a/udev-164-no-v4l1.patch b/udev-164-no-v4l1.patch deleted file mode 100644 index 9d9ef7c..0000000 --- a/udev-164-no-v4l1.patch +++ /dev/null @@ -1,42 +0,0 @@ -diff --git a/extras/v4l_id/v4l_id.c b/extras/v4l_id/v4l_id.c -index d530a6d..e4b22bf 100644 ---- a/extras/v4l_id/v4l_id.c -+++ b/extras/v4l_id/v4l_id.c -@@ -28,7 +28,6 @@ - #include - #include - #include --#include - #include - - int main (int argc, char *argv[]) -@@ -39,7 +38,6 @@ int main (int argc, char *argv[]) - }; - int fd; - char *device; -- struct video_capability v1cap; - struct v4l2_capability v2cap; - - while (1) { -@@ -82,20 +80,7 @@ int main (int argc, char *argv[]) - if ((v2cap.capabilities & V4L2_CAP_RADIO) > 0) - printf("radio:"); - printf("\n"); -- } else if (ioctl (fd, VIDIOCGCAP, &v1cap) == 0) { -- printf("ID_V4L_VERSION=1\n"); -- printf("ID_V4L_PRODUCT=%s\n", v1cap.name); -- printf("ID_V4L_CAPABILITIES=:"); -- if ((v1cap.type & VID_TYPE_CAPTURE) > 0) -- printf("capture:"); -- if ((v1cap.type & VID_TYPE_OVERLAY) > 0) -- printf("video_overlay:"); -- if (v1cap.audios > 0) -- printf("audio:"); -- if ((v1cap.type & VID_TYPE_TUNER) > 0) -- printf("tuner:"); -- printf("\n"); -- } -+ } - - close (fd); - return 0; diff --git a/udev-5e199245f2d2fd03c2586a7f1140300b073a4abe.patch b/udev-5e199245f2d2fd03c2586a7f1140300b073a4abe.patch deleted file mode 100644 index 83d2c11..0000000 --- a/udev-5e199245f2d2fd03c2586a7f1140300b073a4abe.patch +++ /dev/null @@ -1,25 +0,0 @@ -commit 5e199245f2d2fd03c2586a7f1140300b073a4abe -Author: Harald Hoyer -Date: Thu Mar 17 20:36:20 2011 +0100 - - udev-acl/70-acl.rules: tag ID_REMOTE_CONTROL with acl - - Used by "concordance" to access Logitech Harmony programmable remote - controls. - - http://www.phildev.net/concordance/ - -diff --git a/extras/udev-acl/70-acl.rules b/extras/udev-acl/70-acl.rules -index dd5a7ab..037349d 100644 ---- a/extras/udev-acl/70-acl.rules -+++ b/extras/udev-acl/70-acl.rules -@@ -52,6 +52,9 @@ ENV{ID_SMARTCARD_READER}=="*?", TAG+="udev-acl" - # PDA devices - ENV{ID_PDA}=="*?", TAG+="udev-acl" - -+# Programmable remote control -+ENV{ID_REMOTE_CONTROL}=="1", TAG+="udev-acl" -+ - # joysticks - SUBSYSTEM=="input", ENV{ID_INPUT_JOYSTICK}=="?*", TAG+="udev-acl" - diff --git a/udev-98ab6a377285d5943563cfa397e8b350e43878ec.patch b/udev-98ab6a377285d5943563cfa397e8b350e43878ec.patch deleted file mode 100644 index 699add5..0000000 --- a/udev-98ab6a377285d5943563cfa397e8b350e43878ec.patch +++ /dev/null @@ -1,345 +0,0 @@ -commit 98ab6a377285d5943563cfa397e8b350e43878ec -Author: David Zeuthen -Date: Tue Mar 15 12:05:00 2011 -0400 - - cdrom_id: Don't ignore profiles when there is no media available - - Just because the GET CONFIGURATION MMC-2 command returns the current - profile as 0 does not mean that we can ignore the profiles describing - the capabilities of the drive - it only means that there currently is - no recognized media in the drive. Therefore, do process the returned - profiles even when cur_profile is 0. - - This fixes a bug where only - - ID_CDROM=1 - ID_CDROM_CD_R=1 - ID_CDROM_CD_RW=1 - ID_CDROM_DVD=1 - ID_CDROM_DVD_R=1 - ID_CDROM_DVD_RAM=1 - - was returned when there is no media in the drive instead of - - ID_CDROM=1 - ID_CDROM_CD=1 - ID_CDROM_CD_R=1 - ID_CDROM_CD_RW=1 - ID_CDROM_DVD=1 - ID_CDROM_DVD_R=1 - ID_CDROM_DVD_RW=1 - ID_CDROM_DVD_RAM=1 - ID_CDROM_DVD_PLUS_R=1 - ID_CDROM_DVD_PLUS_RW=1 - ID_CDROM_DVD_PLUS_R_DL=1 - ID_CDROM_BD=1 - ID_CDROM_BD_R=1 - ID_CDROM_BD_RE=1 - ID_CDROM_HDDVD=1 - - as is returned now. - - Signed-off-by: David Zeuthen - -diff --git a/extras/cdrom_id/cdrom_id.c b/extras/cdrom_id/cdrom_id.c -index 4a58a49..b2f897e 100644 ---- a/extras/cdrom_id/cdrom_id.c -+++ b/extras/cdrom_id/cdrom_id.c -@@ -261,6 +261,115 @@ static int cd_inquiry(struct udev *udev, int fd) { - return 0; - } - -+static void feature_profile_media(struct udev *udev, int cur_profile) -+{ -+ switch (cur_profile) { -+ case 0x03: -+ case 0x04: -+ case 0x05: -+ info(udev, "profile 0x%02x \n", cur_profile); -+ cd_media = 1; -+ cd_media_mo = 1; -+ break; -+ case 0x08: -+ info(udev, "profile 0x%02x media_cd_rom\n", cur_profile); -+ cd_media = 1; -+ cd_media_cd_rom = 1; -+ break; -+ case 0x09: -+ info(udev, "profile 0x%02x media_cd_r\n", cur_profile); -+ cd_media = 1; -+ cd_media_cd_r = 1; -+ break; -+ case 0x0a: -+ info(udev, "profile 0x%02x media_cd_rw\n", cur_profile); -+ cd_media = 1; -+ cd_media_cd_rw = 1; -+ break; -+ case 0x10: -+ info(udev, "profile 0x%02x media_dvd_ro\n", cur_profile); -+ cd_media = 1; -+ cd_media_dvd_rom = 1; -+ break; -+ case 0x11: -+ info(udev, "profile 0x%02x media_dvd_r\n", cur_profile); -+ cd_media = 1; -+ cd_media_dvd_r = 1; -+ break; -+ case 0x12: -+ info(udev, "profile 0x%02x media_dvd_ram\n", cur_profile); -+ cd_media = 1; -+ cd_media_dvd_ram = 1; -+ break; -+ case 0x13: -+ info(udev, "profile 0x%02x media_dvd_rw_ro\n", cur_profile); -+ cd_media = 1; -+ cd_media_dvd_rw = 1; -+ cd_media_dvd_rw_ro = 1; -+ break; -+ case 0x14: -+ info(udev, "profile 0x%02x media_dvd_rw_seq\n", cur_profile); -+ cd_media = 1; -+ cd_media_dvd_rw = 1; -+ cd_media_dvd_rw_seq = 1; -+ break; -+ case 0x1B: -+ info(udev, "profile 0x%02x media_dvd_plus_r\n", cur_profile); -+ cd_media = 1; -+ cd_media_dvd_plus_r = 1; -+ break; -+ case 0x1A: -+ info(udev, "profile 0x%02x media_dvd_plus_rw\n", cur_profile); -+ cd_media = 1; -+ cd_media_dvd_plus_rw = 1; -+ break; -+ case 0x2A: -+ info(udev, "profile 0x%02x media_dvd_plus_rw_dl\n", cur_profile); -+ cd_media = 1; -+ cd_media_dvd_plus_rw_dl = 1; -+ break; -+ case 0x2B: -+ info(udev, "profile 0x%02x media_dvd_plus_r_dl\n", cur_profile); -+ cd_media = 1; -+ cd_media_dvd_plus_r_dl = 1; -+ break; -+ case 0x40: -+ info(udev, "profile 0x%02x media_bd\n", cur_profile); -+ cd_media = 1; -+ cd_media_bd = 1; -+ break; -+ case 0x41: -+ case 0x42: -+ info(udev, "profile 0x%02x media_bd_r\n", cur_profile); -+ cd_media = 1; -+ cd_media_bd_r = 1; -+ break; -+ case 0x43: -+ info(udev, "profile 0x%02x media_bd_re\n", cur_profile); -+ cd_media = 1; -+ cd_media_bd_re = 1; -+ break; -+ case 0x50: -+ info(udev, "profile 0x%02x media_hddvd\n", cur_profile); -+ cd_media = 1; -+ cd_media_hddvd = 1; -+ break; -+ case 0x51: -+ info(udev, "profile 0x%02x media_hddvd_r\n", cur_profile); -+ cd_media = 1; -+ cd_media_hddvd_r = 1; -+ break; -+ case 0x52: -+ info(udev, "profile 0x%02x media_hddvd_rw\n", cur_profile); -+ cd_media = 1; -+ cd_media_hddvd_rw = 1; -+ break; -+ default: -+ info(udev, "profile 0x%02x \n", cur_profile); -+ break; -+ } -+} -+ - static int feature_profiles(struct udev *udev, const unsigned char *profiles, size_t size) - { - unsigned int i; -@@ -350,6 +459,7 @@ static int feature_profiles(struct udev *udev, const unsigned char *profiles, si - return 0; - } - -+/* returns 0 if media was detected */ - static int cd_profiles_old_mmc(struct udev *udev, int fd) - { - struct scsi_cmd sc; -@@ -389,6 +499,7 @@ static int cd_profiles_old_mmc(struct udev *udev, int fd) - return 0; - } - -+/* returns 0 if media was detected */ - static int cd_profiles(struct udev *udev, int fd) - { - struct scsi_cmd sc; -@@ -397,6 +508,9 @@ static int cd_profiles(struct udev *udev, int fd) - unsigned int len; - unsigned int i; - int err; -+ int ret; -+ -+ ret = -1; - - /* First query the current profile */ - scsi_cmd_init(udev, &sc, features, sizeof(features)); -@@ -410,126 +524,20 @@ static int cd_profiles(struct udev *udev, int fd) - if (SK(err) == 0x5 && ASC(err) == 0x20) { - info(udev, "drive is pre-MMC2 and does not support 46h get configuration command\n"); - info(udev, "trying to work around the problem\n"); -- return cd_profiles_old_mmc(udev, fd); -+ ret = cd_profiles_old_mmc(udev, fd); - } -- return -1; -+ goto out; - } - - cur_profile = features[6] << 8 | features[7]; - if (cur_profile > 0) { - info(udev, "current profile 0x%02x\n", cur_profile); -+ feature_profile_media (udev, cur_profile); -+ ret = 0; /* we have media */ - } else { - info(udev, "no current profile, assuming no media\n"); -- return -1; - } - -- switch (cur_profile) { -- case 0x03: -- case 0x04: -- case 0x05: -- info(udev, "profile 0x%02x \n", cur_profile); -- cd_media = 1; -- cd_media_mo = 1; -- break; -- case 0x08: -- info(udev, "profile 0x%02x media_cd_rom\n", cur_profile); -- cd_media = 1; -- cd_media_cd_rom = 1; -- break; -- case 0x09: -- info(udev, "profile 0x%02x media_cd_r\n", cur_profile); -- cd_media = 1; -- cd_media_cd_r = 1; -- break; -- case 0x0a: -- info(udev, "profile 0x%02x media_cd_rw\n", cur_profile); -- cd_media = 1; -- cd_media_cd_rw = 1; -- break; -- case 0x10: -- info(udev, "profile 0x%02x media_dvd_ro\n", cur_profile); -- cd_media = 1; -- cd_media_dvd_rom = 1; -- break; -- case 0x11: -- info(udev, "profile 0x%02x media_dvd_r\n", cur_profile); -- cd_media = 1; -- cd_media_dvd_r = 1; -- break; -- case 0x12: -- info(udev, "profile 0x%02x media_dvd_ram\n", cur_profile); -- cd_media = 1; -- cd_media_dvd_ram = 1; -- break; -- case 0x13: -- info(udev, "profile 0x%02x media_dvd_rw_ro\n", cur_profile); -- cd_media = 1; -- cd_media_dvd_rw = 1; -- cd_media_dvd_rw_ro = 1; -- break; -- case 0x14: -- info(udev, "profile 0x%02x media_dvd_rw_seq\n", cur_profile); -- cd_media = 1; -- cd_media_dvd_rw = 1; -- cd_media_dvd_rw_seq = 1; -- break; -- case 0x1B: -- info(udev, "profile 0x%02x media_dvd_plus_r\n", cur_profile); -- cd_media = 1; -- cd_media_dvd_plus_r = 1; -- break; -- case 0x1A: -- info(udev, "profile 0x%02x media_dvd_plus_rw\n", cur_profile); -- cd_media = 1; -- cd_media_dvd_plus_rw = 1; -- break; -- case 0x2A: -- info(udev, "profile 0x%02x media_dvd_plus_rw_dl\n", cur_profile); -- cd_media = 1; -- cd_media_dvd_plus_rw_dl = 1; -- break; -- case 0x2B: -- info(udev, "profile 0x%02x media_dvd_plus_r_dl\n", cur_profile); -- cd_media = 1; -- cd_media_dvd_plus_r_dl = 1; -- break; -- case 0x40: -- info(udev, "profile 0x%02x media_bd\n", cur_profile); -- cd_media = 1; -- cd_media_bd = 1; -- break; -- case 0x41: -- case 0x42: -- info(udev, "profile 0x%02x media_bd_r\n", cur_profile); -- cd_media = 1; -- cd_media_bd_r = 1; -- break; -- case 0x43: -- info(udev, "profile 0x%02x media_bd_re\n", cur_profile); -- cd_media = 1; -- cd_media_bd_re = 1; -- break; -- case 0x50: -- info(udev, "profile 0x%02x media_hddvd\n", cur_profile); -- cd_media = 1; -- cd_media_hddvd = 1; -- break; -- case 0x51: -- info(udev, "profile 0x%02x media_hddvd_r\n", cur_profile); -- cd_media = 1; -- cd_media_hddvd_r = 1; -- break; -- case 0x52: -- info(udev, "profile 0x%02x media_hddvd_rw\n", cur_profile); -- cd_media = 1; -- cd_media_hddvd_rw = 1; -- break; -- default: -- info(udev, "profile 0x%02x \n", cur_profile); -- break; -- } -- -- - len = features[0] << 24 | features[1] << 16 | features[2] << 8 | features[3]; - info(udev, "GET CONFIGURATION: size of features buffer 0x%04x\n", len); - -@@ -577,8 +585,8 @@ static int cd_profiles(struct udev *udev, int fd) - break; - } - } -- -- return 0; -+out: -+ return ret; - } - - static int cd_media_info(struct udev *udev, int fd) -@@ -905,9 +913,12 @@ int main(int argc, char *argv[]) - goto print; - - /* read drive and possibly current profile */ -- if (cd_profiles(udev, fd) < 0) -+ if (cd_profiles(udev, fd) != 0) - goto print; - -+ /* at this point we are guaranteed to have media in the -+ * drive - find out more about it */ -+ - /* get session/track info */ - cd_media_toc(udev, fd); - diff --git a/udev-retry.init b/udev-retry.init deleted file mode 100644 index b4cb201..0000000 --- a/udev-retry.init +++ /dev/null @@ -1,67 +0,0 @@ -#!/bin/bash -# -# udev-retry Post script for udev, after all filesystems are mounted -# -# Authors: Harald Hoyer -# -# chkconfig: 12345 26 75 -# description: Moves the generated persistent udev rules to /etc/udev/rules.d -# -### BEGIN INIT INFO -# Default-Start: 12345 -# Default-Stop: 0 6 -# Required-Start: $local_fs -# Required-Stop: -# Short-Description: Moves the generated persistent udev rules to /etc/udev/rules.d -# Description: Moves the generated persistent udev rules to /etc/udev/rules.d -# Provides: udev-retry -### END INIT INFO - -. /etc/rc.d/init.d/functions - -# See how we were called. -case "$1" in - start|reload) - [ -w /var/lock/subsys ] || exit 4 - STRING=$"Retrigger failed udev events" - echo -n $STRING - /sbin/udevadm trigger --type=failed - success "$STRING" - echo - - STRING=$"Adding udev persistent rules" - - # copy the rules generated before / was mounted read-write - for file in /dev/.udev/tmp-rules--*; do - dest=${file##*tmp-rules--} - # check, if anything is todo - [ "$dest" = '*' ] && exit 0 - echo -n $STRING - cat $file >> /etc/udev/rules.d/$dest - rc=$? - rm -f $file - if [ "$rc" -eq "0" ]; then - success "$STRING" - echo - elif [ "$rc" -eq "1" ]; then - failure "$STRING" - echo - fi - done - - touch /var/lock/subsys/udev-retry - exit 0 - ;; - stop) - [ -w /var/lock/subsys ] || exit 4 - rm -f /var/lock/subsys/udev-retry - exit 0 - ;; - status) - exit 3 - ;; - *) - echo $"Usage: $0 {start|stop|reload}" - exit 2 -esac -exit 0 diff --git a/udev.spec b/udev.spec index 105de70..35c5349 100644 --- a/udev.spec +++ b/udev.spec @@ -6,8 +6,8 @@ Summary: A rule-based device node and kernel event manager Name: udev -Version: 166 -Release: 2%{?dist} +Version: 167 +Release: 1%{?dist} License: GPLv2+ Group: System Environment/Base Provides: udev-persistent = %{version}-%{release} @@ -15,12 +15,6 @@ Obsoletes: udev-persistent < 0:030-5 Source: ftp://ftp.kernel.org/pub/linux/utils/kernel/hotplug/%{name}-%{version}.tar.bz2 Source1: start_udev -Source2: udev-retry.init - -Patch6: udev-164-no-v4l1.patch -Patch7: udev-5e199245f2d2fd03c2586a7f1140300b073a4abe.patch -Patch8: udev-98ab6a377285d5943563cfa397e8b350e43878ec.patch - ExclusiveOS: Linux URL: http://www.kernel.org/pub/linux/utils/kernel/hotplug/udev.html @@ -118,9 +112,6 @@ glib-based applications using libudev functionality. %prep %setup -q -%patch6 -p1 -%patch7 -p1 -%patch8 -p1 %build export CFLAGS="$CFLAGS $RPM_OPT_FLAGS -fPIE -DPIE -pie -Wl,-z,relro -Wl,-z,now" @@ -180,7 +171,6 @@ install -m 0755 %{SOURCE1} $RPM_BUILD_ROOT/sbin/start_udev mkdir -p -m 0755 $RPM_BUILD_ROOT%{firmwaredir} mkdir -p $RPM_BUILD_ROOT%{_sysconfdir}/rc.d/init.d -install -m 0755 %{SOURCE2} $RPM_BUILD_ROOT%{_sysconfdir}/rc.d/init.d/udev-retry %preun if [ "$1" -eq 0 -a -f %{_initrddir}/udev ]; then @@ -243,7 +233,6 @@ if test -f /proc/1/exe -a -d /proc/1/root; then /sbin/udevadm control --start-exec-queue || : fi fi -/sbin/chkconfig --add udev-retry exit 0 @@ -275,13 +264,11 @@ rm -rf $RPM_BUILD_ROOT %attr(0755,root,root) %{udev_scriptdir}/write_cd_rules %attr(0755,root,root) %{udev_scriptdir}/write_net_rules %attr(0755,root,root) %{udev_scriptdir}/collect -%attr(0755,root,root) %{udev_scriptdir}/fstab_import %attr(0755,root,root) %{udev_scriptdir}/input_id %attr(0755,root,root) %{udev_scriptdir}/keyboard-force-release.sh %attr(0755,root,root) %{udev_scriptdir}/mtd_probe %attr(0755,root,root) %dir %{udev_scriptdir}/rules.d/ -%attr(0755,root,root) %{_sysconfdir}/rc.d/init.d/udev-retry %attr(0755,root,root) %dir %{_sysconfdir}/udev/ %attr(0755,root,root) %dir %{_sysconfdir}/udev/rules.d/ %attr(0755,root,root) %dir %{udev_scriptdir}/ @@ -318,13 +305,13 @@ rm -rf $RPM_BUILD_ROOT %{_datadir}/pkgconfig/udev.pc %attr(0755,root,root) /sbin/start_udev -%attr(0644,root,root) %{systemdsystemunitdir}/udev-retry.service %attr(0644,root,root) %{systemdsystemunitdir}/udev-settle.service +%attr(0644,root,root) %{systemdsystemunitdir}/udev-trigger.service %attr(0644,root,root) %{systemdsystemunitdir}/udev.service -%{systemdsystemunitdir}/basic.target.wants/udev-retry.service -%{systemdsystemunitdir}/basic.target.wants/udev-settle.service +%attr(0644,root,root) %{systemdsystemunitdir}/udev.socket %{systemdsystemunitdir}/basic.target.wants/udev.service - +%{systemdsystemunitdir}/basic.target.wants/udev-trigger.service +%{systemdsystemunitdir}/sockets.target.wants/udev.socket # Deprecated, but keep the ownership %ghost %dir /var/lib/udev @@ -365,6 +352,9 @@ rm -rf $RPM_BUILD_ROOT %attr(0644,root,root) %{_libdir}/pkgconfig/gudev-1.0* %changelog +* Wed Mar 30 2011 Harald Hoyer 167-1 +- version 167 + * Wed Mar 23 2011 Harald Hoyer 166-2 - add ACLs for harmony remote controls Resolves: rhbz#559412 diff --git a/upstream b/upstream deleted file mode 100644 index 287b708..0000000 --- a/upstream +++ /dev/null @@ -1 +0,0 @@ -udev-145.tar.bz2 diff --git a/upstream-key.gpg b/upstream-key.gpg deleted file mode 100644 index 81cd947..0000000 --- a/upstream-key.gpg +++ /dev/null @@ -1,54 +0,0 @@ -pub 1024D/517D0F0E 2000-10-10 Linux Kernel Archives Verification Key - Key fingerprint = C75D C40A 11D7 AF88 9981 ED5B C86B A06A 517D 0F0E -sub 4096g/E50A8F2A 2000-10-10 - ------BEGIN PGP PUBLIC KEY BLOCK----- -Version: GnuPG v1.0.3 (GNU/Linux) -Comment: For info see http://www.gnupg.org - -mQGiBDnirDkRBADCTL/iUTeZKb0tiAcKdZdsUP/KSnrGGjlinolUAsUC0D6/hUB1 -RdCpJOOERTIEr1yvehqDM7veRhNMoxJNQxa/sSrkywey5qc8uaskUNEqenimq/70 -bahWJeoWXjad68mQFh65lULnHQrrioeJnh9UpyGJppNb/yIjdnymH9aYEwCglgP7 -UegBzH22h8NVQEK2PWWbyUUD/jQA4lI0wRWcL9HpkYkHcH0LTKRB9zYpQYtyvzJi -yTGwJyFMfYNXy0RT11dICeLkf3HMR84hkPERKMhALobLxVUbfc7j2AygmzGphWGy -DH/xjptQP/zrsq87ylYRONK18w1J42cm+yZa4XThMDPJMrb9/l8qnxU1JnW7W1al -HKTpBACbs+91KLqrnIGcF44TMwxgUj5CUrayPoEnLU+ZMBqfSjmu8RqEYmTxJCKv -7erBFSuazBGj5X7twunrtrW3bxO63MbLbHjfXSRrMnKOb8dRULIg6eWAnoAx8VVZ -YjrOpwAntU3WxYOpbiCHt9kLbb+N5rvNtFcmOqRRQaCIUFOOaLQ8TGludXggS2Vy -bmVsIEFyY2hpdmVzIFZlcmlmaWNhdGlvbiBLZXkgPGZ0cGFkbWluQGtlcm5lbC5v -cmc+iFUEExECABUFAjnirDkDCwoDAxUDAgMWAgECF4AACgkQyGugalF9Dw4MNACe -JiQTyCmQzPGou2cl/RyOXj79kYYAnAsT6xt72hp/PFiywYM9vBsDVv9niQEVAwUQ -OeKwNWx5eAAqlgcFAQEdZgf/Vn2dMKrn8021NhavP0uA3pHGRmdKQ2WJBdLiN2tv -LkpAioZtho+op+xBz8j1zdIJQ/7XWko869KHge2BAFwA8rWDzjtaAWdE0Jo/NiAR -epUwV2FdRRwSxIcNG2CCPyJnfPokRqjdl2z9k2PkwidHSq+2k6JxCWnOcIXChSKf -kHnemtA65ixAlhuxvyN3MPuYs1jAHyDGcyMfomp1qH9tXFQhhyXRrG2eMAfslstC -XGXLcoLN3O2BMR/fG2GlV6kOqGOvoMIW3clVeQLQ9B1yyekKiVY6Vg+CgK5qhg8z -9tjH4f33zzNDwsx1WSCOU/1LIPzFBNbR9QtTF2XmOUfRs4hGBBARAgAGBQI54rBc -AAoJEH2d7s4ry8YhmjsAoMUW9RxfXBSos0A6LwGd+5pXv/MRAKCYFLG2T4GSV+qf -iRsXnrgDHQHD04hGBBARAgAGBQI54rOZAAoJEPKlddweGoeC/+sAoL5f7JF21mRe -Z8VV4nhh7prm+idSAKCMXDWW/tBOeJDYpiEhgyGSGgJJWrkEDQQ54q+cEBAAjRmb -txamcZ9EYsQTnQvVL2l6vY5Rnbc1JDdcyHEV1kH5OwZWqvckL4QgKKBbTQwyB9pC -o0nGK4PkBbrwL0outfHQ5jl9DUzTKIu+asWUyf3fxfUV6j2A6BMo59KNnJzUyJ2+ -B5na6NN8nEqEtmogROtjT8LkOvYwqD4A/5re2vwtie+h5yU6A+JbyGQF6lFxThZj -4WGctBgCcDBqRkPAG8DFFAdeN5SMAArktCYuUGXi2q88EDoOs3Ykw0kB8+ZFECz/ -4/b93so5Wt2hC15cxAJoXFfR3mXHm40EHzMdEublWV4blB2KvFocQC74/H74QPUk -cWlc6EhPodKvcuOfTimDxXaiGNFONUPgNAmCXeVoOapdWpb3x7iOHPwSaXeJSrO9 -fc4GtVjDv90DT2ekK7cvYk8s6B3t7p7W21Xi+hRgrw63B3HElr01gdMZY5XA5ey/ -WmnyBS6LOxXlnVBE+2uSQ+aZHqrLpXcRvq2ZonOziDSE0i940ZvIwlSzn0U5BQWl -9hBDQw78RacYqaFvlpcGiPj75bScB4eemxV6Wdo9mtK0Vrr+9bWScXHEv7did4X+ -7tBWKbA8M+g290OSzjeQBGLuPmbjxzEKH9jcUumzBzzC5x5GFh7On9TLXQ4K/oRT -6QQpS93YrTVbR60G4MKsePWLJmg7IgYUtNdLGjsAAwUP/0aAAq8CmWtourj1XxNY -pFmOAU45d65fPWVadKyF++B+uDyRNYN7HQCqrJ7ddn0sH7OBtlE8yaBYgR0TFly9 -9+LqQO4r4IGCw2TBgA5tKnOWoPGEzvrLeoxR3SnPrKBlDvx6Rr9h3OJ9UV5u/NLh -mCP9iN10gWCGzsWbONc6qD6PugbTur44D6s4CRK9xfliSrtG3GBHW914UKjJeB9s -e3oc1rkmNv39kKcu33w4XVETAj4qpXnwoJvy639dfvnQt1TWFjIt20iP7m+jkT3B -b526uJ5GuJl6r8sm5OYYRs5cLigvUzRZVgYnjjqlRRACx0WcinKK55Li2Pq4qcRV -vSE5Tr3kTUTGxdmy113FbscrhLhesGALv3Hb7jeeWC8jviGEaHppgUumR6v0hsI1 -rZ3K8kCjFRAYV8OKtcEeMqjouArGi5dn0ClmG4lwH4SEdqC/TRNWGG+iVpWf5yCj -9mvtvUhLtl6QjXHLrJdSGyafvqR1EQMJadFt4URvx0M7tqZIcwPUnb+7Oc+J96po -e/EQmnm6rFnTpWz0BbY4mbJC7vUH4JyLs0nlxiKrBjaO9C1DSAKBpjqaga8dQe1Z -kLOI2F7IWFeKV2LaMl+ZvvfWMECNcqNW2fkCuP9Fpz5K+xg21TwovVy93aWKgFL6 -06jK51oQp3fW86xXK9ZGKYqQiEYEGBECAAYFAjnir5wACgkQyGugalF9Dw5M9QCg -hhmHalzWf8B3AVrjPrtrRHA1vlgAn3YRlU5l0V5W1iXvHXQCUHIESpgm -=SZZb ------END PGP PUBLIC KEY BLOCK----- From 90347b2001f3341d541e9cad71c5f557d67d8403 Mon Sep 17 00:00:00 2001 From: Harald Hoyer Date: Wed, 30 Mar 2011 17:18:01 +0200 Subject: [PATCH 100/142] - version 167 --- udev.spec | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/udev.spec b/udev.spec index 35c5349..b88a4da 100644 --- a/udev.spec +++ b/udev.spec @@ -206,6 +206,7 @@ getent group floppy >/dev/null || /usr/sbin/groupadd -g 19 floppy || : if test -f /proc/1/exe -a -d /proc/1/root; then if test -x /usr/bin/stat -a \ "$(/usr/bin/stat -Lc '%%D-%%i' /)" = "$(/usr/bin/stat -Lc '%%D-%%i' /proc/1/root)"; then + /bin/systemctl stop udev.service >/dev/null 2>&1 || : if test -x /sbin/udevd -a -x /sbin/pidof ; then /sbin/udevadm control --stop-exec-queue pid=$(/sbin/pidof -c udevd) @@ -223,19 +224,22 @@ fi exit 0 %post -# convert old database files -/sbin/udevadm info --convert-db >/dev/null 2>&1 || : +/bin/systemctl daemon-reload >/dev/null 2>&1 || : # start daemon if we are not in a chroot if test -f /proc/1/exe -a -d /proc/1/root; then if test "$(/usr/bin/stat -Lc '%%D-%%i' /)" = "$(/usr/bin/stat -Lc '%%D-%%i' /proc/1/root)"; then - /sbin/udevd -d + /bin/systemctl start udev.service >/dev/null 2>&1 || : + /sbin/udevd -d >/dev/null 2>&1 || : /sbin/udevadm control --start-exec-queue || : fi fi exit 0 +%postun +/bin/systemctl daemon-reload >/dev/null 2>&1 || : + %post -n libudev -p /sbin/ldconfig %postun -n libudev -p /sbin/ldconfig From 21ab8351360f598421e83c6ca1a5077b160b779f Mon Sep 17 00:00:00 2001 From: Harald Hoyer Date: Wed, 30 Mar 2011 17:36:11 +0200 Subject: [PATCH 101/142] removed libxslt buildreq and touch man pages, to prevent rebuild --- udev.spec | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/udev.spec b/udev.spec index b88a4da..55d4f63 100644 --- a/udev.spec +++ b/udev.spec @@ -36,7 +36,6 @@ BuildRequires: sed libselinux-devel >= 0:1.17.9-2 flex libsepol-devel BuildRequires: glib2-devel bison findutils BuildRequires: gperf libtool BuildRequires: libusb-devel libacl-devel -BuildRequires: libxslt BuildRequires: hwdata BuildRequires: gobject-introspection-devel >= 0.6.2 BuildRequires: gtk-doc @@ -114,6 +113,9 @@ glib-based applications using libudev functionality. %setup -q %build +# prevent man pages from re-building (xmlto) +find . -name "*.[1-8]" -exec touch '{}' \; + export CFLAGS="$CFLAGS $RPM_OPT_FLAGS -fPIE -DPIE -pie -Wl,-z,relro -Wl,-z,now" # prevent man pages from re-building (xmlto) From 0b0304cfe18782b99aaa0814f9610d7ec91fcc2b Mon Sep 17 00:00:00 2001 From: Harald Hoyer Date: Thu, 31 Mar 2011 17:58:51 +0200 Subject: [PATCH 102/142] - fixed udev-trigger.service --- ...le-depend-on-trigger-do-not-block-ba.patch | 51 +++++++++++++++++++ udev.spec | 8 ++- 2 files changed, 58 insertions(+), 1 deletion(-) create mode 100644 0003-systemd-let-settle-depend-on-trigger-do-not-block-ba.patch diff --git a/0003-systemd-let-settle-depend-on-trigger-do-not-block-ba.patch b/0003-systemd-let-settle-depend-on-trigger-do-not-block-ba.patch new file mode 100644 index 0000000..aa67cf1 --- /dev/null +++ b/0003-systemd-let-settle-depend-on-trigger-do-not-block-ba.patch @@ -0,0 +1,51 @@ +From daf32d32172e19e78754999b41c27b45e3629326 Mon Sep 17 00:00:00 2001 +From: Kay Sievers +Date: Thu, 31 Mar 2011 13:15:47 +0200 +Subject: [PATCH] systemd: let settle depend on trigger, do not block basic with trigger + +--- + init/udev-settle.service.in | 15 +++++++++------ + init/udev-trigger.service.in | 1 - + 2 files changed, 9 insertions(+), 7 deletions(-) + +diff --git a/init/udev-settle.service.in b/init/udev-settle.service.in +index be06a39..bda8626 100644 +--- a/init/udev-settle.service.in ++++ b/init/udev-settle.service.in +@@ -1,15 +1,18 @@ +-# This barrier service is usually not enabled by default. If enabled, +-# it acts as a barrier for basic.target -- so all later services will ++# This service is usually not enabled by default. If enabled, it ++# acts as a barrier for basic.target -- so all later services will + # wait for udev completely finishing its coldplug run. + # +-# It might be enabled just unconditionally, or pulled-in on-demand by +-# broken or non-hotplug-aware services that assume a fully populated +-# /dev at startup. ++# If needed, to work around broken or non-hotplug-aware services, ++# it might be enabled unconditionally, or pulled-in on-demand by ++# the services that assume a fully populated /dev at startup. It ++# should not be used or pulled-in ever on systems without such ++# legacy services running. + + [Unit] + Description=udev Wait for Complete Device Initialization + DefaultDependencies=no +-After=udev.service ++Requires=udev.service ++After=udev-trigger.service + Before=basic.target + + [Service] +diff --git a/init/udev-trigger.service.in b/init/udev-trigger.service.in +index 0ede317..745974a 100644 +--- a/init/udev-trigger.service.in ++++ b/init/udev-trigger.service.in +@@ -2,7 +2,6 @@ + Description=udev Coldplug all Devices + Requires=udev.service + After=udev.service +-Before=basic.target + DefaultDependencies=no + + [Service] diff --git a/udev.spec b/udev.spec index 55d4f63..223ac87 100644 --- a/udev.spec +++ b/udev.spec @@ -7,7 +7,7 @@ Summary: A rule-based device node and kernel event manager Name: udev Version: 167 -Release: 1%{?dist} +Release: 2%{?dist} License: GPLv2+ Group: System Environment/Base Provides: udev-persistent = %{version}-%{release} @@ -16,6 +16,8 @@ Source: ftp://ftp.kernel.org/pub/linux/utils/kernel/hotplug/%{name}-%{version}.t Source1: start_udev +Patch3: 0003-systemd-let-settle-depend-on-trigger-do-not-block-ba.patch + ExclusiveOS: Linux URL: http://www.kernel.org/pub/linux/utils/kernel/hotplug/udev.html BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n) @@ -111,6 +113,7 @@ glib-based applications using libudev functionality. %prep %setup -q +%patch3 -p1 -b .git3 %build # prevent man pages from re-building (xmlto) @@ -358,6 +361,9 @@ rm -rf $RPM_BUILD_ROOT %attr(0644,root,root) %{_libdir}/pkgconfig/gudev-1.0* %changelog +* Thu Mar 31 2011 Harald Hoyer 167-2 +- fixed udev-trigger.service + * Wed Mar 30 2011 Harald Hoyer 167-1 - version 167 From 8cf0c7defa5e033369d66ac319ed380c3fe73882 Mon Sep 17 00:00:00 2001 From: Harald Hoyer Date: Thu, 31 Mar 2011 17:58:51 +0200 Subject: [PATCH 103/142] - fixed udev-trigger.service --- ...le-depend-on-trigger-do-not-block-ba.patch | 51 +++++++++++++++++++ udev.spec | 8 ++- 2 files changed, 58 insertions(+), 1 deletion(-) create mode 100644 0003-systemd-let-settle-depend-on-trigger-do-not-block-ba.patch diff --git a/0003-systemd-let-settle-depend-on-trigger-do-not-block-ba.patch b/0003-systemd-let-settle-depend-on-trigger-do-not-block-ba.patch new file mode 100644 index 0000000..aa67cf1 --- /dev/null +++ b/0003-systemd-let-settle-depend-on-trigger-do-not-block-ba.patch @@ -0,0 +1,51 @@ +From daf32d32172e19e78754999b41c27b45e3629326 Mon Sep 17 00:00:00 2001 +From: Kay Sievers +Date: Thu, 31 Mar 2011 13:15:47 +0200 +Subject: [PATCH] systemd: let settle depend on trigger, do not block basic with trigger + +--- + init/udev-settle.service.in | 15 +++++++++------ + init/udev-trigger.service.in | 1 - + 2 files changed, 9 insertions(+), 7 deletions(-) + +diff --git a/init/udev-settle.service.in b/init/udev-settle.service.in +index be06a39..bda8626 100644 +--- a/init/udev-settle.service.in ++++ b/init/udev-settle.service.in +@@ -1,15 +1,18 @@ +-# This barrier service is usually not enabled by default. If enabled, +-# it acts as a barrier for basic.target -- so all later services will ++# This service is usually not enabled by default. If enabled, it ++# acts as a barrier for basic.target -- so all later services will + # wait for udev completely finishing its coldplug run. + # +-# It might be enabled just unconditionally, or pulled-in on-demand by +-# broken or non-hotplug-aware services that assume a fully populated +-# /dev at startup. ++# If needed, to work around broken or non-hotplug-aware services, ++# it might be enabled unconditionally, or pulled-in on-demand by ++# the services that assume a fully populated /dev at startup. It ++# should not be used or pulled-in ever on systems without such ++# legacy services running. + + [Unit] + Description=udev Wait for Complete Device Initialization + DefaultDependencies=no +-After=udev.service ++Requires=udev.service ++After=udev-trigger.service + Before=basic.target + + [Service] +diff --git a/init/udev-trigger.service.in b/init/udev-trigger.service.in +index 0ede317..745974a 100644 +--- a/init/udev-trigger.service.in ++++ b/init/udev-trigger.service.in +@@ -2,7 +2,6 @@ + Description=udev Coldplug all Devices + Requires=udev.service + After=udev.service +-Before=basic.target + DefaultDependencies=no + + [Service] diff --git a/udev.spec b/udev.spec index b88a4da..195364c 100644 --- a/udev.spec +++ b/udev.spec @@ -7,7 +7,7 @@ Summary: A rule-based device node and kernel event manager Name: udev Version: 167 -Release: 1%{?dist} +Release: 2%{?dist} License: GPLv2+ Group: System Environment/Base Provides: udev-persistent = %{version}-%{release} @@ -16,6 +16,8 @@ Source: ftp://ftp.kernel.org/pub/linux/utils/kernel/hotplug/%{name}-%{version}.t Source1: start_udev +Patch3: 0003-systemd-let-settle-depend-on-trigger-do-not-block-ba.patch + ExclusiveOS: Linux URL: http://www.kernel.org/pub/linux/utils/kernel/hotplug/udev.html BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n) @@ -112,6 +114,7 @@ glib-based applications using libudev functionality. %prep %setup -q +%patch3 -p1 -b .git3 %build export CFLAGS="$CFLAGS $RPM_OPT_FLAGS -fPIE -DPIE -pie -Wl,-z,relro -Wl,-z,now" @@ -356,6 +359,9 @@ rm -rf $RPM_BUILD_ROOT %attr(0644,root,root) %{_libdir}/pkgconfig/gudev-1.0* %changelog +* Thu Mar 31 2011 Harald Hoyer 167-2 +- fixed udev-trigger.service + * Wed Mar 30 2011 Harald Hoyer 167-1 - version 167 From cbf7ac132cb5c8c9c7169c763df6714c5ad45b17 Mon Sep 17 00:00:00 2001 From: Harald Hoyer Date: Wed, 30 Mar 2011 17:36:11 +0200 Subject: [PATCH 104/142] removed libxslt buildreq and touch man pages, to prevent rebuild --- udev.spec | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/udev.spec b/udev.spec index 195364c..223ac87 100644 --- a/udev.spec +++ b/udev.spec @@ -38,7 +38,6 @@ BuildRequires: sed libselinux-devel >= 0:1.17.9-2 flex libsepol-devel BuildRequires: glib2-devel bison findutils BuildRequires: gperf libtool BuildRequires: libusb-devel libacl-devel -BuildRequires: libxslt BuildRequires: hwdata BuildRequires: gobject-introspection-devel >= 0.6.2 BuildRequires: gtk-doc @@ -117,6 +116,9 @@ glib-based applications using libudev functionality. %patch3 -p1 -b .git3 %build +# prevent man pages from re-building (xmlto) +find . -name "*.[1-8]" -exec touch '{}' \; + export CFLAGS="$CFLAGS $RPM_OPT_FLAGS -fPIE -DPIE -pie -Wl,-z,relro -Wl,-z,now" # prevent man pages from re-building (xmlto) From 58624e426ed9b5d2b26f4a428cdc5cb8e4e6d4bf Mon Sep 17 00:00:00 2001 From: Harald Hoyer Date: Thu, 31 Mar 2011 18:30:08 +0200 Subject: [PATCH 105/142] udev.spec: removed gtk-doc --- udev.spec | 1 - 1 file changed, 1 deletion(-) diff --git a/udev.spec b/udev.spec index 223ac87..c557701 100644 --- a/udev.spec +++ b/udev.spec @@ -40,7 +40,6 @@ BuildRequires: gperf libtool BuildRequires: libusb-devel libacl-devel BuildRequires: hwdata BuildRequires: gobject-introspection-devel >= 0.6.2 -BuildRequires: gtk-doc BuildRequires: usbutils >= 0.82 BuildRequires: libtool >= 2.2.6 BuildRequires: pkgconfig From cef722535fe5217175547110e8d11e7dfdbbea2d Mon Sep 17 00:00:00 2001 From: Adam Williamson Date: Thu, 7 Apr 2011 17:19:42 -0700 Subject: [PATCH 106/142] selinux_label.patch: don't label files outside of /dev --- udev-167-selinux_label.patch | 208 +++++++++++++++++++++++++++++++++++ udev.spec | 9 +- 2 files changed, 216 insertions(+), 1 deletion(-) create mode 100644 udev-167-selinux_label.patch diff --git a/udev-167-selinux_label.patch b/udev-167-selinux_label.patch new file mode 100644 index 0000000..f583f0f --- /dev/null +++ b/udev-167-selinux_label.patch @@ -0,0 +1,208 @@ +From 51f43b53293c4cc64c2a55598491c6cbf27b6bd5 Mon Sep 17 00:00:00 2001 +From: Kay Sievers +Date: Fri, 8 Apr 2011 01:03:49 +0200 +Subject: [PATCH] selinux: do not label files in runtime dir + +Do not label any files in the udev runtime directory, but only nodes, +links and directories below /dev. + +In case the runtime directory falls back to /dev/.udev, label this +directory once at udevd startup, but never anything below it. +--- + libudev/libudev-private.h | 1 + + libudev/libudev-queue-private.c | 2 -- + libudev/libudev-util-private.c | 18 +++++++++++++++--- + udev/udev-node.c | 6 +++--- + udev/udevd.c | 18 ++++++++---------- + 5 files changed, 27 insertions(+), 18 deletions(-) + +diff --git a/libudev/libudev-private.h b/libudev/libudev-private.h +index 7078b0f..8495f9a 100644 +--- a/libudev/libudev-private.h ++++ b/libudev/libudev-private.h +@@ -220,6 +220,7 @@ uint64_t util_string_bloom64(const char *str); + + /* libudev-util-private.c */ + int util_create_path(struct udev *udev, const char *path); ++int util_create_path_selinux(struct udev *udev, const char *path); + int util_delete_path(struct udev *udev, const char *path); + int util_unlink_secure(struct udev *udev, const char *filename); + uid_t util_lookup_user(struct udev *udev, const char *user); +diff --git a/libudev/libudev-queue-private.c b/libudev/libudev-queue-private.c +index a714572..2f1afec 100644 +--- a/libudev/libudev-queue-private.c ++++ b/libudev/libudev-queue-private.c +@@ -409,9 +409,7 @@ static void update_failed(struct udev_queue_export *udev_queue_export, + /* record event in the failed directory */ + udev_queue_export->failed_count++; + util_create_path(udev, filename); +- udev_selinux_setfscreatecon(udev, filename, S_IFLNK); + symlink(udev_device_get_devpath(udev_device), filename); +- udev_selinux_resetfscreatecon(udev); + break; + + case DEVICE_QUEUED: +diff --git a/libudev/libudev-util-private.c b/libudev/libudev-util-private.c +index 6b68b6a..19f979e 100644 +--- a/libudev/libudev-util-private.c ++++ b/libudev/libudev-util-private.c +@@ -25,7 +25,7 @@ + #include "libudev.h" + #include "libudev-private.h" + +-int util_create_path(struct udev *udev, const char *path) ++static int create_path(struct udev *udev, const char *path, bool selinux) + { + char p[UTIL_PATH_SIZE]; + char *pos; +@@ -55,7 +55,8 @@ int util_create_path(struct udev *udev, const char *path) + return err; + + dbg(udev, "mkdir '%s'\n", p); +- udev_selinux_setfscreatecon(udev, p, S_IFDIR|0755); ++ if (selinux) ++ udev_selinux_setfscreatecon(udev, p, S_IFDIR|0755); + err = mkdir(p, 0755); + if (err != 0) { + err = -errno; +@@ -66,10 +67,21 @@ int util_create_path(struct udev *udev, const char *path) + err = -ENOTDIR; + } + } +- udev_selinux_resetfscreatecon(udev); ++ if (selinux) ++ udev_selinux_resetfscreatecon(udev); + return err; + } + ++int util_create_path(struct udev *udev, const char *path) ++{ ++ return create_path(udev, path, false); ++} ++ ++int util_create_path_selinux(struct udev *udev, const char *path) ++{ ++ return create_path(udev, path, true); ++} ++ + int util_delete_path(struct udev *udev, const char *path) + { + char p[UTIL_PATH_SIZE]; +diff --git a/udev/udev-node.c b/udev/udev-node.c +index ab4e932..5e791ff 100644 +--- a/udev/udev-node.c ++++ b/udev/udev-node.c +@@ -96,7 +96,7 @@ int udev_node_mknod(struct udev_device *dev, const char *file, mode_t mode, uid_ + } else { + info(udev, "mknod '%s' %u:%u %#o\n", file, major(devnum), minor(devnum), mode); + do { +- err = util_create_path(udev, file); ++ err = util_create_path_selinux(udev, file); + if (err != 0 && err != -ENOENT) + break; + udev_selinux_setfscreatecon(udev, file, mode); +@@ -184,7 +184,7 @@ static int node_symlink(struct udev *udev, const char *node, const char *slink) + } else { + info(udev, "creating symlink '%s' to '%s'\n", slink, target); + do { +- err = util_create_path(udev, slink); ++ err = util_create_path_selinux(udev, slink); + if (err != 0 && err != -ENOENT) + break; + udev_selinux_setfscreatecon(udev, slink, S_IFLNK); +@@ -201,7 +201,7 @@ static int node_symlink(struct udev *udev, const char *node, const char *slink) + util_strscpyl(slink_tmp, sizeof(slink_tmp), slink, TMP_FILE_EXT, NULL); + unlink(slink_tmp); + do { +- err = util_create_path(udev, slink_tmp); ++ err = util_create_path_selinux(udev, slink_tmp); + if (err != 0 && err != -ENOENT) + break; + udev_selinux_setfscreatecon(udev, slink_tmp, S_IFLNK); +diff --git a/udev/udevd.c b/udev/udevd.c +index a8b339f..df5c199 100644 +--- a/udev/udevd.c ++++ b/udev/udevd.c +@@ -822,7 +822,7 @@ static void static_dev_create_from_modules(struct udev *udev) + continue; + + util_strscpyl(filename, sizeof(filename), udev_get_dev_path(udev), "/", devname, NULL); +- util_create_path(udev, filename); ++ util_create_path_selinux(udev, filename); + udev_selinux_setfscreatecon(udev, filename, mode); + info(udev, "mknod '%s' %c%u:%u\n", filename, type, maj, min); + if (mknod(filename, mode, makedev(maj, min)) < 0 && errno == EEXIST) +@@ -833,7 +833,7 @@ static void static_dev_create_from_modules(struct udev *udev) + fclose(f); + } + +-static int copy_dir(struct udev *udev, DIR *dir_from, DIR *dir_to, int maxdepth) ++static int copy_dev_dir(struct udev *udev, DIR *dir_from, DIR *dir_to, int maxdepth) + { + struct dirent *dent; + +@@ -886,7 +886,7 @@ static int copy_dir(struct udev *udev, DIR *dir_from, DIR *dir_to, int maxdepth) + continue; + } + +- copy_dir(udev, dir2_from, dir2_to, maxdepth-1); ++ copy_dev_dir(udev, dir2_from, dir2_to, maxdepth-1); + + closedir(dir2_to); + closedir(dir2_from); +@@ -930,7 +930,7 @@ static void static_dev_create_from_devices(struct udev *udev, DIR *dir) + dir_from = opendir(LIBEXECDIR "/devices"); + if (dir_from == NULL) + return; +- copy_dir(udev, dir_from, dir, 8); ++ copy_dev_dir(udev, dir_from, dir, 8); + closedir(dir_from); + } + +@@ -985,9 +985,7 @@ static int convert_db(struct udev *udev) + + /* make sure we do not get here again */ + util_create_path(udev, filename); +- udev_selinux_setfscreatecon(udev, udev_get_run_path(udev), S_IFDIR|0755); + mkdir(filename, 0755); +- udev_selinux_resetfscreatecon(udev); + + /* old database */ + util_strscpyl(filename, sizeof(filename), udev_get_dev_path(udev), "/.udev/db", NULL); +@@ -1097,9 +1095,7 @@ int main(int argc, char *argv[]) + /* make sure, that our runtime dir exists and is writable */ + if (utimensat(AT_FDCWD, udev_get_run_config_path(udev), NULL, 0) < 0) { + /* try to create our own subdirectory, do not create parent directories */ +- udev_selinux_setfscreatecon(udev, udev_get_run_config_path(udev), S_IFDIR|0755); + mkdir(udev_get_run_config_path(udev), 0755); +- udev_selinux_resetfscreatecon(udev); + + if (utimensat(AT_FDCWD, udev_get_run_config_path(udev), NULL, 0) >= 0) { + /* directory seems writable now */ +@@ -1111,8 +1107,12 @@ int main(int argc, char *argv[]) + util_strscpyl(filename, sizeof(filename), udev_get_dev_path(udev), "/.udev", NULL); + if (udev_set_run_path(udev, filename) == NULL) + goto exit; ++ mkdir(udev_get_run_path(udev), 0755); + } + } ++ /* relabel runtime dir only if it resides below /dev */ ++ if (strncmp(udev_get_run_path(udev), udev_get_dev_path(udev), strlen(udev_get_dev_path(udev))) == 0) ++ udev_selinux_lsetfilecon(udev, udev_get_run_path(udev), 0755); + info(udev, "runtime dir '%s'\n", udev_get_run_path(udev)); + + for (;;) { +@@ -1281,9 +1281,7 @@ int main(int argc, char *argv[]) + util_strscpyl(filename, sizeof(filename), udev_get_run_path(udev), "/rules.d", NULL); + if (stat(filename, &statbuf) != 0) { + util_create_path(udev, filename); +- udev_selinux_setfscreatecon(udev, filename, S_IFDIR|0755); + mkdir(filename, 0755); +- udev_selinux_resetfscreatecon(udev); + } + inotify_add_watch(pfd[FD_INOTIFY].fd, filename, + IN_DELETE | IN_MOVE | IN_CLOSE_WRITE); +-- +1.7.4.4 + + diff --git a/udev.spec b/udev.spec index 195364c..f5117a2 100644 --- a/udev.spec +++ b/udev.spec @@ -7,7 +7,7 @@ Summary: A rule-based device node and kernel event manager Name: udev Version: 167 -Release: 2%{?dist} +Release: 3%{?dist} License: GPLv2+ Group: System Environment/Base Provides: udev-persistent = %{version}-%{release} @@ -17,6 +17,9 @@ Source: ftp://ftp.kernel.org/pub/linux/utils/kernel/hotplug/%{name}-%{version}.t Source1: start_udev Patch3: 0003-systemd-let-settle-depend-on-trigger-do-not-block-ba.patch +# Upstream 51f43b53293c4cc64c2a55598491c6cbf27b6bd5: don't SELinux label +# files outside of /dev. Fixes https://bugzilla.redhat.com/show_bug.cgi?id=693247 +Patch4: udev-167-selinux_label.patch ExclusiveOS: Linux URL: http://www.kernel.org/pub/linux/utils/kernel/hotplug/udev.html @@ -115,6 +118,7 @@ glib-based applications using libudev functionality. %prep %setup -q %patch3 -p1 -b .git3 +%patch4 -p1 -b .label %build export CFLAGS="$CFLAGS $RPM_OPT_FLAGS -fPIE -DPIE -pie -Wl,-z,relro -Wl,-z,now" @@ -359,6 +363,9 @@ rm -rf $RPM_BUILD_ROOT %attr(0644,root,root) %{_libdir}/pkgconfig/gudev-1.0* %changelog +* Thu Apr 7 2011 Adam Williamson - 167-3 +- selinux_label.patch: from upstream, don't label files outside of /dev + * Thu Mar 31 2011 Harald Hoyer 167-2 - fixed udev-trigger.service From b52809d0defa175a70ac097d5457cae865eea42b Mon Sep 17 00:00:00 2001 From: Harald Hoyer Date: Fri, 1 Apr 2011 09:40:44 +0200 Subject: [PATCH 107/142] udev.spec: untabify --- udev.spec | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/udev.spec b/udev.spec index c557701..f963cff 100644 --- a/udev.spec +++ b/udev.spec @@ -179,7 +179,7 @@ mkdir -p $RPM_BUILD_ROOT%{_sysconfdir}/rc.d/init.d %preun if [ "$1" -eq 0 -a -f %{_initrddir}/udev ]; then if test -x /usr/bin/stat -a \ - "$(/usr/bin/stat -Lc '%%D-%%i' /)" = "$(/usr/bin/stat -Lc '%%D-%%i' /proc/1/root)"; then + "$(/usr/bin/stat -Lc '%%D-%%i' /)" = "$(/usr/bin/stat -Lc '%%D-%%i' /proc/1/root)"; then if [ -x /sbin/pidof ]; then pid=$(/sbin/pidof -c udevd) while [ -n "$pid" ]; do @@ -189,7 +189,7 @@ if [ "$1" -eq 0 -a -f %{_initrddir}/udev ]; then sleep 0.2 pid=$(/sbin/pidof -c udevd) hard="-9" - done + done fi fi /sbin/chkconfig --del udev @@ -209,8 +209,8 @@ getent group floppy >/dev/null || /usr/sbin/groupadd -g 19 floppy || : # kill daemon if we are not in a chroot if test -f /proc/1/exe -a -d /proc/1/root; then if test -x /usr/bin/stat -a \ - "$(/usr/bin/stat -Lc '%%D-%%i' /)" = "$(/usr/bin/stat -Lc '%%D-%%i' /proc/1/root)"; then - /bin/systemctl stop udev.service >/dev/null 2>&1 || : + "$(/usr/bin/stat -Lc '%%D-%%i' /)" = "$(/usr/bin/stat -Lc '%%D-%%i' /proc/1/root)"; then + /bin/systemctl stop udev.service >/dev/null 2>&1 || : if test -x /sbin/udevd -a -x /sbin/pidof ; then /sbin/udevadm control --stop-exec-queue pid=$(/sbin/pidof -c udevd) @@ -233,7 +233,7 @@ exit 0 # start daemon if we are not in a chroot if test -f /proc/1/exe -a -d /proc/1/root; then if test "$(/usr/bin/stat -Lc '%%D-%%i' /)" = "$(/usr/bin/stat -Lc '%%D-%%i' /proc/1/root)"; then - /bin/systemctl start udev.service >/dev/null 2>&1 || : + /bin/systemctl start udev.service >/dev/null 2>&1 || : /sbin/udevd -d >/dev/null 2>&1 || : /sbin/udevadm control --start-exec-queue || : fi From 83891f63812610132f33ce33d91d53e097539216 Mon Sep 17 00:00:00 2001 From: Harald Hoyer Date: Mon, 11 Apr 2011 12:15:57 +0200 Subject: [PATCH 108/142] - more selinux fixes --- ...-ata_id-on-non-removable-USB-devices.patch | 56 +++++ ...r-Aspire-One-ZG8-to-use-acer-aspire_.patch | 29 +++ ...vd-add-N-to-optstring-in-getopt_long.patch | 22 ++ ...not-build-extras-with-disable-extras.patch | 34 +++ ...nning-up-CD-on-pressing-eject-button.patch | 45 ++++ ...ell-Latitude-XT2-tablet-mode-navigat.patch | 56 +++++ ...ux-do-not-label-files-in-runtime-dir.patch | 204 ++++++++++++++++++ ...re-do-not-label-files-in-runtime-dir.patch | 25 +++ udev.spec | 26 ++- 9 files changed, 492 insertions(+), 5 deletions(-) create mode 100644 0002-Run-ata_id-on-non-removable-USB-devices.patch create mode 100644 0004-Add-rule-for-Acer-Aspire-One-ZG8-to-use-acer-aspire_.patch create mode 100644 0005-udevd-add-N-to-optstring-in-getopt_long.patch create mode 100644 0006-Revert-Do-not-build-extras-with-disable-extras.patch create mode 100644 0007-Avoid-spinning-up-CD-on-pressing-eject-button.patch create mode 100644 0008-keymap-Support-Dell-Latitude-XT2-tablet-mode-navigat.patch create mode 100644 0009-selinux-do-not-label-files-in-runtime-dir.patch create mode 100644 0010-selinux-firmware-do-not-label-files-in-runtime-dir.patch diff --git a/0002-Run-ata_id-on-non-removable-USB-devices.patch b/0002-Run-ata_id-on-non-removable-USB-devices.patch new file mode 100644 index 0000000..e58c4aa --- /dev/null +++ b/0002-Run-ata_id-on-non-removable-USB-devices.patch @@ -0,0 +1,56 @@ +From 42b9482ab2da64b4c2f254c227c0efaf83988a84 Mon Sep 17 00:00:00 2001 +From: David Zeuthen +Date: Wed, 30 Mar 2011 08:11:03 -0400 +Subject: [PATCH] Run ata_id on non-removable USB devices + +If a USB device is marked as removable, it is often a SATA/PATA disk +in an enclosure (note that flash card readers and usb storage sticks +are always marked as removable). In this case, try running ata_id +(which sends ATA commands wrapped in SCSI ATA PASS THROUGH commands) +to get information about the disk. If this fails, just fall back to +running usb_id since it could be the device isn't an ATA device at +all or the device doesn't have a SAT layer. + +This extra information is nice to have as it indicates if it is +suitable to send e.g. SMART commands to the disk, whether the disk +supports power management and so on. Additionally, the VPD and serial +number returned by ata_id is usually more accurate as it stems from +the disk itself instead of the enclosure. + +Note that udisks has been doing this for a while + + KERNEL=="sd*[!0-9]", ATTR{removable}=="0", ENV{ID_BUS}=="usb", ENV{DEVTYPE}=="disk", IMPORT{program}="udisks-probe-ata-smart $tempnode" + +so this change shouldn't be too disruptive (udisks-probe-ata-smart +also sends ATA commands via the ATA PASS THROUGH command). + +Signed-off-by: David Zeuthen +--- + rules/rules.d/60-persistent-storage.rules | 8 ++++++-- + 1 files changed, 6 insertions(+), 2 deletions(-) + +diff --git a/rules/rules.d/60-persistent-storage.rules b/rules/rules.d/60-persistent-storage.rules +index 6a9abdd..12fabef 100644 +--- a/rules/rules.d/60-persistent-storage.rules ++++ b/rules/rules.d/60-persistent-storage.rules +@@ -22,14 +22,18 @@ ENV{DEVTYPE}=="partition", IMPORT{parent}="ID_*" + KERNEL=="vd*[!0-9]", ATTRS{serial}=="?*", ENV{ID_SERIAL}="$attr{serial}", SYMLINK+="disk/by-id/virtio-$env{ID_SERIAL}" + KERNEL=="vd*[0-9]", ATTRS{serial}=="?*", ENV{ID_SERIAL}="$attr{serial}", SYMLINK+="disk/by-id/virtio-$env{ID_SERIAL}-part%n" + +-# USB devices use their own serial number +-KERNEL=="sd*[!0-9]|sr*", ENV{ID_SERIAL}!="?*", SUBSYSTEMS=="usb", IMPORT{program}="usb_id --export %p" + # ATA devices with their own "ata" kernel subsystem + KERNEL=="sd*[!0-9]|sr*", ENV{ID_SERIAL}!="?*", SUBSYSTEMS=="ata", IMPORT{program}="ata_id --export $tempnode" + # ATA devices using the "scsi" subsystem + KERNEL=="sd*[!0-9]|sr*", ENV{ID_SERIAL}!="?*", SUBSYSTEMS=="scsi", ATTRS{vendor}=="ATA", IMPORT{program}="ata_id --export $tempnode" + # ATA/ATAPI devices (SPC-3 or later) using the "scsi" subsystem + KERNEL=="sd*[!0-9]|sr*", ENV{ID_SERIAL}!="?*", SUBSYSTEMS=="scsi", ATTRS{type}=="5", ATTRS{scsi_level}=="[6-9]*", IMPORT{program}="ata_id --export $tempnode" ++ ++# Run ata_id on non-removable USB Mass Storage (SATA/PATA disks in enclosures) ++KERNEL=="sd*[!0-9]|sr*", ENV{ID_SERIAL}!="?*", ATTR{removable}=="0", SUBSYSTEMS=="usb", IMPORT{program}="ata_id --export $tempnode" ++# Otherwise fall back to using usb_id for USB devices ++KERNEL=="sd*[!0-9]|sr*", ENV{ID_SERIAL}!="?*", SUBSYSTEMS=="usb", IMPORT{program}="usb_id --export %p" ++ + # scsi devices + KERNEL=="sd*[!0-9]|sr*", ENV{ID_SERIAL}!="?*", IMPORT{program}="scsi_id --export --whitelisted -d $tempnode", ENV{ID_BUS}="scsi" + KERNEL=="cciss*", ENV{DEVTYPE}=="disk", ENV{ID_SERIAL}!="?*", IMPORT{program}="scsi_id --export --whitelisted -d $tempnode", ENV{ID_BUS}="cciss" diff --git a/0004-Add-rule-for-Acer-Aspire-One-ZG8-to-use-acer-aspire_.patch b/0004-Add-rule-for-Acer-Aspire-One-ZG8-to-use-acer-aspire_.patch new file mode 100644 index 0000000..b343faf --- /dev/null +++ b/0004-Add-rule-for-Acer-Aspire-One-ZG8-to-use-acer-aspire_.patch @@ -0,0 +1,29 @@ +From ff4a035a8aaba6a7b5b85c4b348886d72c42e84c Mon Sep 17 00:00:00 2001 +From: Lee, Chun-Yi +Date: Thu, 31 Mar 2011 18:01:05 +0800 +Subject: [PATCH] Add rule for Acer Aspire One ZG8 to use acer-aspire_5720 keymap + +Acer Aspire One ZG8's bluetooth HW key emit 0xD9 scancode, it must map +to KEY_BLUETOOTH like Acer Aspire 5720. So, add rule for Acer Aspire One +ZG8 use acer-aspire_5720 keymap. + +Tested on Acer Aspire One ZG8 netbook. + +Signed-off-by: Lee, Chun-Yi +Signed-off-by: Martin Pitt +--- + extras/keymap/95-keymap.rules | 1 + + 1 files changed, 1 insertions(+), 0 deletions(-) + +diff --git a/extras/keymap/95-keymap.rules b/extras/keymap/95-keymap.rules +index 0c3ae38..44d5064 100644 +--- a/extras/keymap/95-keymap.rules ++++ b/extras/keymap/95-keymap.rules +@@ -100,6 +100,7 @@ ENV{DMI_VENDOR}=="Acer*", ATTR{[dmi/id]product_name}=="Aspire 6920", RUN+="keyma + ENV{DMI_VENDOR}=="Acer*", ATTR{[dmi/id]product_name}=="Aspire 5920G", RUN+="keymap $name acer-aspire_5920g" + ENV{DMI_VENDOR}=="Acer*", ATTR{[dmi/id]product_name}=="Aspire 5720*", RUN+="keymap $name acer-aspire_5720" + ENV{DMI_VENDOR}=="Acer*", ATTR{[dmi/id]product_name}=="Aspire 8930", RUN+="keymap $name acer-aspire_8930" ++ENV{DMI_VENDOR}=="Acer*", ATTR{[dmi/id]product_serial}=="ZG8*", RUN+="keymap $name acer-aspire_5720" + + ENV{DMI_VENDOR}=="*BenQ*", ATTR{[dmi/id]product_name}=="*Joybook R22*", RUN+="keymap $name 0x6E wlan" + diff --git a/0005-udevd-add-N-to-optstring-in-getopt_long.patch b/0005-udevd-add-N-to-optstring-in-getopt_long.patch new file mode 100644 index 0000000..c8ca5c6 --- /dev/null +++ b/0005-udevd-add-N-to-optstring-in-getopt_long.patch @@ -0,0 +1,22 @@ +From 6ee9b2cb8cf023253853f1c80e707598685b11f3 Mon Sep 17 00:00:00 2001 +From: Thomas Egerer +Date: Thu, 31 Mar 2011 17:25:31 +0200 +Subject: [PATCH] udevd: add 'N:' to optstring in getopt_long + +--- + udev/udevd.c | 2 +- + 1 files changed, 1 insertions(+), 1 deletions(-) + +diff --git a/udev/udevd.c b/udev/udevd.c +index 1871474..a8b339f 100644 +--- a/udev/udevd.c ++++ b/udev/udevd.c +@@ -1118,7 +1118,7 @@ int main(int argc, char *argv[]) + for (;;) { + int option; + +- option = getopt_long(argc, argv, "c:deDthV", options, NULL); ++ option = getopt_long(argc, argv, "c:deDtN:hV", options, NULL); + if (option == -1) + break; + diff --git a/0006-Revert-Do-not-build-extras-with-disable-extras.patch b/0006-Revert-Do-not-build-extras-with-disable-extras.patch new file mode 100644 index 0000000..a7f4f96 --- /dev/null +++ b/0006-Revert-Do-not-build-extras-with-disable-extras.patch @@ -0,0 +1,34 @@ +From 9bb54267a1483e8f3b2de352c7be433f625e5606 Mon Sep 17 00:00:00 2001 +From: Martin Pitt +Date: Thu, 31 Mar 2011 19:23:19 +0200 +Subject: [PATCH] Revert "Do not build extras with --disable-extras" + +This reverts commit 905818f5961446ac32d1b2d165185fffddc4915a. + +We do want to build some extras, just not the ones with extra dependencies. +Thanks to Juergen Daubert for pointing this out. +--- + Makefile.am | 3 --- + 1 files changed, 0 insertions(+), 3 deletions(-) + +diff --git a/Makefile.am b/Makefile.am +index df70bf7..2c20f46 100644 +--- a/Makefile.am ++++ b/Makefile.am +@@ -225,7 +225,6 @@ dist_udevrules_DATA += \ + extras/rule_generator/75-cd-aliases-generator.rules \ + extras/rule_generator/75-persistent-net-generator.rules + +-if ENABLE_EXTRAS + # ------------------------------------------------------------------------------ + # firmware - firmware loading + # ------------------------------------------------------------------------------ +@@ -314,8 +313,6 @@ extras_v4l_id_v4l_id_LDADD = libudev/libudev-private.la + libexec_PROGRAMS += extras/v4l_id/v4l_id + dist_udevrules_DATA += extras/v4l_id/60-persistent-v4l.rules + +-endif # ENABLE_EXTRAS +- + # ------------------------------------------------------------------------------ + # qemu -- qemu/kvm guest tweaks + # ------------------------------------------------------------------------------ diff --git a/0007-Avoid-spinning-up-CD-on-pressing-eject-button.patch b/0007-Avoid-spinning-up-CD-on-pressing-eject-button.patch new file mode 100644 index 0000000..efeecfe --- /dev/null +++ b/0007-Avoid-spinning-up-CD-on-pressing-eject-button.patch @@ -0,0 +1,45 @@ +From 55eb500cc5465babf1fd773dbcceeb90eeefd997 Mon Sep 17 00:00:00 2001 +From: Martin Pitt +Date: Mon, 4 Apr 2011 11:47:54 +0200 +Subject: [PATCH] Avoid spinning up CD on pressing eject button + +When the CD tray door is locked and the hardware eject button is pressed, newer +kernels (2.6.38+) will send out a change event with a DISK_EJECT_REQUEST==1 +property. Do not run cdrom_id and blkid in this case, as the media state and +contents does not change, and this only needlessly spins up the drive again +right before ejection. +--- + extras/cdrom_id/60-cdrom_id.rules | 3 +++ + rules/rules.d/60-persistent-storage.rules | 4 ++-- + 2 files changed, 5 insertions(+), 2 deletions(-) + +diff --git a/extras/cdrom_id/60-cdrom_id.rules b/extras/cdrom_id/60-cdrom_id.rules +index b3109f1..aedf6f0 100644 +--- a/extras/cdrom_id/60-cdrom_id.rules ++++ b/extras/cdrom_id/60-cdrom_id.rules +@@ -5,6 +5,9 @@ SUBSYSTEM!="block", GOTO="cdrom_end" + KERNEL!="sr[0-9]*|xvd*", GOTO="cdrom_end" + ENV{DEVTYPE}!="disk", GOTO="cdrom_end" + ++# this is only a button press event ++ENV{DISK_EJECT_REQUEST}=="?*", GOTO="cdrom_end" ++ + KERNEL=="sr[0-9]*", ENV{ID_CDROM}="1" + IMPORT{program}="cdrom_id --export $tempnode" + +diff --git a/rules/rules.d/60-persistent-storage.rules b/rules/rules.d/60-persistent-storage.rules +index 12fabef..05a405f 100644 +--- a/rules/rules.d/60-persistent-storage.rules ++++ b/rules/rules.d/60-persistent-storage.rules +@@ -62,9 +62,9 @@ ENV{DEVTYPE}=="partition", ENV{ID_PATH}=="?*", SYMLINK+="disk/by-path/$env{ID_PA + ENV{DEVTYPE}=="disk", KERNEL!="sd*|sr*", ATTR{removable}=="1", GOTO="persistent_storage_end" + + # probe filesystem metadata of optical drives which have a media inserted +-KERNEL=="sr*", ENV{ID_CDROM_MEDIA_TRACK_COUNT_DATA}=="?*", ENV{ID_CDROM_MEDIA_SESSION_LAST_OFFSET}=="?*", IMPORT{program}="/sbin/blkid -o udev -p -u noraid -O $env{ID_CDROM_MEDIA_SESSION_LAST_OFFSET} $tempnode" ++KERNEL=="sr*", ENV{DISK_EJECT_REQUEST}!="?*", ENV{ID_CDROM_MEDIA_TRACK_COUNT_DATA}=="?*", ENV{ID_CDROM_MEDIA_SESSION_LAST_OFFSET}=="?*", IMPORT{program}="/sbin/blkid -o udev -p -u noraid -O $env{ID_CDROM_MEDIA_SESSION_LAST_OFFSET} $tempnode" + # single-session CDs do not have ID_CDROM_MEDIA_SESSION_LAST_OFFSET +-KERNEL=="sr*", ENV{ID_CDROM_MEDIA_TRACK_COUNT_DATA}=="?*", ENV{ID_CDROM_MEDIA_SESSION_LAST_OFFSET}=="", IMPORT{program}="/sbin/blkid -o udev -p -u noraid $tempnode" ++KERNEL=="sr*", ENV{DISK_EJECT_REQUEST}!="?*", ENV{ID_CDROM_MEDIA_TRACK_COUNT_DATA}=="?*", ENV{ID_CDROM_MEDIA_SESSION_LAST_OFFSET}=="", IMPORT{program}="/sbin/blkid -o udev -p -u noraid $tempnode" + + # probe filesystem metadata of disks + KERNEL!="sr*", IMPORT{program}="/sbin/blkid -o udev -p $tempnode" diff --git a/0008-keymap-Support-Dell-Latitude-XT2-tablet-mode-navigat.patch b/0008-keymap-Support-Dell-Latitude-XT2-tablet-mode-navigat.patch new file mode 100644 index 0000000..f8e7404 --- /dev/null +++ b/0008-keymap-Support-Dell-Latitude-XT2-tablet-mode-navigat.patch @@ -0,0 +1,56 @@ +From 5e0ec43fc40e3e6dd0e44a7d617846879e1dac9e Mon Sep 17 00:00:00 2001 +From: Seth Forshee +Date: Tue, 5 Apr 2011 11:43:00 -0500 +Subject: [PATCH] keymap: Support Dell Latitude XT2 tablet-mode navigation keys + +The XT2 has a rocker (up/down/enter) and back button on the side +in tablet mode, none of which work currently. Add entries for +these keys. + +There is some overlap here with scan codes used in other Dell +models, so these buttons are put in a new file specific to this +model. + +Signed-off-by: Seth Forshee +Signed-off-by: Martin Pitt +--- + Makefile.am | 1 + + extras/keymap/95-keymap.rules | 1 + + extras/keymap/keymaps/dell-latitude-xt2 | 4 ++++ + 3 files changed, 6 insertions(+), 0 deletions(-) + create mode 100644 extras/keymap/keymaps/dell-latitude-xt2 + +diff --git a/Makefile.am b/Makefile.am +index 2c20f46..4244089 100644 +--- a/Makefile.am ++++ b/Makefile.am +@@ -568,6 +568,7 @@ dist_udevkeymap_DATA = \ + extras/keymap/keymaps/asus \ + extras/keymap/keymaps/compaq-e_evo \ + extras/keymap/keymaps/dell \ ++ extras/keymap/keymaps/dell-latitude-xt2 \ + extras/keymap/keymaps/everex-xt5000 \ + extras/keymap/keymaps/fujitsu-amilo_pa_2548 \ + extras/keymap/keymaps/fujitsu-amilo_pro_edition_v3505 \ +diff --git a/extras/keymap/95-keymap.rules b/extras/keymap/95-keymap.rules +index 44d5064..350f111 100644 +--- a/extras/keymap/95-keymap.rules ++++ b/extras/keymap/95-keymap.rules +@@ -67,6 +67,7 @@ LABEL="keyboard_vendorcheck" + + ENV{DMI_VENDOR}=="Dell*", RUN+="keymap $name dell" + ENV{DMI_VENDOR}=="Dell*", ATTR{[dmi/id]product_name}=="Inspiron 910|Inspiron 1010|Inspiron 1011|Inspiron 1012|Inspiron 1110|Inspiron 1210", RUN+="keymap $name 0x84 wlan" ++ENV{DMI_VENDOR}=="Dell*", ATTR{[dmi/id]product_name}=="Latitude XT2", RUN+="keymap $name dell-latitude-xt2" + + ENV{DMI_VENDOR}=="Compaq*", ATTR{[dmi/id]product_name}=="*E500*|*Evo N*", RUN+="keymap $name compaq-e_evo" + +diff --git a/extras/keymap/keymaps/dell-latitude-xt2 b/extras/keymap/keymaps/dell-latitude-xt2 +new file mode 100644 +index 0000000..39872f5 +--- /dev/null ++++ b/extras/keymap/keymaps/dell-latitude-xt2 +@@ -0,0 +1,4 @@ ++0x9B up # tablet rocker up ++0x9E enter # tablet rocker press ++0x9F back # tablet back ++0xA3 down # tablet rocker down diff --git a/0009-selinux-do-not-label-files-in-runtime-dir.patch b/0009-selinux-do-not-label-files-in-runtime-dir.patch new file mode 100644 index 0000000..56d16ac --- /dev/null +++ b/0009-selinux-do-not-label-files-in-runtime-dir.patch @@ -0,0 +1,204 @@ +From 51f43b53293c4cc64c2a55598491c6cbf27b6bd5 Mon Sep 17 00:00:00 2001 +From: Kay Sievers +Date: Fri, 8 Apr 2011 01:03:49 +0200 +Subject: [PATCH] selinux: do not label files in runtime dir + +Do not label any files in the udev runtime directory, but only nodes, +links and directories below /dev. + +In case the runtime directory falls back to /dev/.udev, label this +directory once at udevd startup, but never anything below it. +--- + libudev/libudev-private.h | 1 + + libudev/libudev-queue-private.c | 2 -- + libudev/libudev-util-private.c | 18 +++++++++++++++--- + udev/udev-node.c | 6 +++--- + udev/udevd.c | 18 ++++++++---------- + 5 files changed, 27 insertions(+), 18 deletions(-) + +diff --git a/libudev/libudev-private.h b/libudev/libudev-private.h +index 7078b0f..8495f9a 100644 +--- a/libudev/libudev-private.h ++++ b/libudev/libudev-private.h +@@ -220,6 +220,7 @@ uint64_t util_string_bloom64(const char *str); + + /* libudev-util-private.c */ + int util_create_path(struct udev *udev, const char *path); ++int util_create_path_selinux(struct udev *udev, const char *path); + int util_delete_path(struct udev *udev, const char *path); + int util_unlink_secure(struct udev *udev, const char *filename); + uid_t util_lookup_user(struct udev *udev, const char *user); +diff --git a/libudev/libudev-queue-private.c b/libudev/libudev-queue-private.c +index a714572..2f1afec 100644 +--- a/libudev/libudev-queue-private.c ++++ b/libudev/libudev-queue-private.c +@@ -409,9 +409,7 @@ static void update_failed(struct udev_queue_export *udev_queue_export, + /* record event in the failed directory */ + udev_queue_export->failed_count++; + util_create_path(udev, filename); +- udev_selinux_setfscreatecon(udev, filename, S_IFLNK); + symlink(udev_device_get_devpath(udev_device), filename); +- udev_selinux_resetfscreatecon(udev); + break; + + case DEVICE_QUEUED: +diff --git a/libudev/libudev-util-private.c b/libudev/libudev-util-private.c +index 6b68b6a..19f979e 100644 +--- a/libudev/libudev-util-private.c ++++ b/libudev/libudev-util-private.c +@@ -25,7 +25,7 @@ + #include "libudev.h" + #include "libudev-private.h" + +-int util_create_path(struct udev *udev, const char *path) ++static int create_path(struct udev *udev, const char *path, bool selinux) + { + char p[UTIL_PATH_SIZE]; + char *pos; +@@ -55,7 +55,8 @@ int util_create_path(struct udev *udev, const char *path) + return err; + + dbg(udev, "mkdir '%s'\n", p); +- udev_selinux_setfscreatecon(udev, p, S_IFDIR|0755); ++ if (selinux) ++ udev_selinux_setfscreatecon(udev, p, S_IFDIR|0755); + err = mkdir(p, 0755); + if (err != 0) { + err = -errno; +@@ -66,10 +67,21 @@ int util_create_path(struct udev *udev, const char *path) + err = -ENOTDIR; + } + } +- udev_selinux_resetfscreatecon(udev); ++ if (selinux) ++ udev_selinux_resetfscreatecon(udev); + return err; + } + ++int util_create_path(struct udev *udev, const char *path) ++{ ++ return create_path(udev, path, false); ++} ++ ++int util_create_path_selinux(struct udev *udev, const char *path) ++{ ++ return create_path(udev, path, true); ++} ++ + int util_delete_path(struct udev *udev, const char *path) + { + char p[UTIL_PATH_SIZE]; +diff --git a/udev/udev-node.c b/udev/udev-node.c +index ab4e932..5e791ff 100644 +--- a/udev/udev-node.c ++++ b/udev/udev-node.c +@@ -96,7 +96,7 @@ int udev_node_mknod(struct udev_device *dev, const char *file, mode_t mode, uid_ + } else { + info(udev, "mknod '%s' %u:%u %#o\n", file, major(devnum), minor(devnum), mode); + do { +- err = util_create_path(udev, file); ++ err = util_create_path_selinux(udev, file); + if (err != 0 && err != -ENOENT) + break; + udev_selinux_setfscreatecon(udev, file, mode); +@@ -184,7 +184,7 @@ static int node_symlink(struct udev *udev, const char *node, const char *slink) + } else { + info(udev, "creating symlink '%s' to '%s'\n", slink, target); + do { +- err = util_create_path(udev, slink); ++ err = util_create_path_selinux(udev, slink); + if (err != 0 && err != -ENOENT) + break; + udev_selinux_setfscreatecon(udev, slink, S_IFLNK); +@@ -201,7 +201,7 @@ static int node_symlink(struct udev *udev, const char *node, const char *slink) + util_strscpyl(slink_tmp, sizeof(slink_tmp), slink, TMP_FILE_EXT, NULL); + unlink(slink_tmp); + do { +- err = util_create_path(udev, slink_tmp); ++ err = util_create_path_selinux(udev, slink_tmp); + if (err != 0 && err != -ENOENT) + break; + udev_selinux_setfscreatecon(udev, slink_tmp, S_IFLNK); +diff --git a/udev/udevd.c b/udev/udevd.c +index a8b339f..df5c199 100644 +--- a/udev/udevd.c ++++ b/udev/udevd.c +@@ -822,7 +822,7 @@ static void static_dev_create_from_modules(struct udev *udev) + continue; + + util_strscpyl(filename, sizeof(filename), udev_get_dev_path(udev), "/", devname, NULL); +- util_create_path(udev, filename); ++ util_create_path_selinux(udev, filename); + udev_selinux_setfscreatecon(udev, filename, mode); + info(udev, "mknod '%s' %c%u:%u\n", filename, type, maj, min); + if (mknod(filename, mode, makedev(maj, min)) < 0 && errno == EEXIST) +@@ -833,7 +833,7 @@ static void static_dev_create_from_modules(struct udev *udev) + fclose(f); + } + +-static int copy_dir(struct udev *udev, DIR *dir_from, DIR *dir_to, int maxdepth) ++static int copy_dev_dir(struct udev *udev, DIR *dir_from, DIR *dir_to, int maxdepth) + { + struct dirent *dent; + +@@ -886,7 +886,7 @@ static int copy_dir(struct udev *udev, DIR *dir_from, DIR *dir_to, int maxdepth) + continue; + } + +- copy_dir(udev, dir2_from, dir2_to, maxdepth-1); ++ copy_dev_dir(udev, dir2_from, dir2_to, maxdepth-1); + + closedir(dir2_to); + closedir(dir2_from); +@@ -930,7 +930,7 @@ static void static_dev_create_from_devices(struct udev *udev, DIR *dir) + dir_from = opendir(LIBEXECDIR "/devices"); + if (dir_from == NULL) + return; +- copy_dir(udev, dir_from, dir, 8); ++ copy_dev_dir(udev, dir_from, dir, 8); + closedir(dir_from); + } + +@@ -985,9 +985,7 @@ static int convert_db(struct udev *udev) + + /* make sure we do not get here again */ + util_create_path(udev, filename); +- udev_selinux_setfscreatecon(udev, udev_get_run_path(udev), S_IFDIR|0755); + mkdir(filename, 0755); +- udev_selinux_resetfscreatecon(udev); + + /* old database */ + util_strscpyl(filename, sizeof(filename), udev_get_dev_path(udev), "/.udev/db", NULL); +@@ -1097,9 +1095,7 @@ int main(int argc, char *argv[]) + /* make sure, that our runtime dir exists and is writable */ + if (utimensat(AT_FDCWD, udev_get_run_config_path(udev), NULL, 0) < 0) { + /* try to create our own subdirectory, do not create parent directories */ +- udev_selinux_setfscreatecon(udev, udev_get_run_config_path(udev), S_IFDIR|0755); + mkdir(udev_get_run_config_path(udev), 0755); +- udev_selinux_resetfscreatecon(udev); + + if (utimensat(AT_FDCWD, udev_get_run_config_path(udev), NULL, 0) >= 0) { + /* directory seems writable now */ +@@ -1111,8 +1107,12 @@ int main(int argc, char *argv[]) + util_strscpyl(filename, sizeof(filename), udev_get_dev_path(udev), "/.udev", NULL); + if (udev_set_run_path(udev, filename) == NULL) + goto exit; ++ mkdir(udev_get_run_path(udev), 0755); + } + } ++ /* relabel runtime dir only if it resides below /dev */ ++ if (strncmp(udev_get_run_path(udev), udev_get_dev_path(udev), strlen(udev_get_dev_path(udev))) == 0) ++ udev_selinux_lsetfilecon(udev, udev_get_run_path(udev), 0755); + info(udev, "runtime dir '%s'\n", udev_get_run_path(udev)); + + for (;;) { +@@ -1281,9 +1281,7 @@ int main(int argc, char *argv[]) + util_strscpyl(filename, sizeof(filename), udev_get_run_path(udev), "/rules.d", NULL); + if (stat(filename, &statbuf) != 0) { + util_create_path(udev, filename); +- udev_selinux_setfscreatecon(udev, filename, S_IFDIR|0755); + mkdir(filename, 0755); +- udev_selinux_resetfscreatecon(udev); + } + inotify_add_watch(pfd[FD_INOTIFY].fd, filename, + IN_DELETE | IN_MOVE | IN_CLOSE_WRITE); diff --git a/0010-selinux-firmware-do-not-label-files-in-runtime-dir.patch b/0010-selinux-firmware-do-not-label-files-in-runtime-dir.patch new file mode 100644 index 0000000..a14e5d4 --- /dev/null +++ b/0010-selinux-firmware-do-not-label-files-in-runtime-dir.patch @@ -0,0 +1,25 @@ +From 960250952193db522b8ced336bf998bd7e8e4a31 Mon Sep 17 00:00:00 2001 +From: Kay Sievers +Date: Fri, 8 Apr 2011 03:08:16 +0200 +Subject: [PATCH] selinux: firmware - do not label files in runtime dir + +--- + extras/firmware/firmware.c | 2 -- + 1 files changed, 0 insertions(+), 2 deletions(-) + +diff --git a/extras/firmware/firmware.c b/extras/firmware/firmware.c +index 8199820..f2df76c 100644 +--- a/extras/firmware/firmware.c ++++ b/extras/firmware/firmware.c +@@ -159,11 +159,9 @@ int main(int argc, char **argv) + err = util_create_path(udev, misspath); + if (err != 0 && err != -ENOENT) + break; +- udev_selinux_setfscreatecon(udev, misspath, S_IFLNK); + err = symlink(devpath, misspath); + if (err != 0) + err = -errno; +- udev_selinux_resetfscreatecon(udev); + } while (err == -ENOENT); + rc = 2; + set_loading(udev, loadpath, "-1"); diff --git a/udev.spec b/udev.spec index a1bf568..6b402b4 100644 --- a/udev.spec +++ b/udev.spec @@ -7,7 +7,7 @@ Summary: A rule-based device node and kernel event manager Name: udev Version: 167 -Release: 3%{?dist} +Release: 4%{?dist} License: GPLv2+ Group: System Environment/Base Provides: udev-persistent = %{version}-%{release} @@ -16,10 +16,16 @@ Source: ftp://ftp.kernel.org/pub/linux/utils/kernel/hotplug/%{name}-%{version}.t Source1: start_udev +Patch2: 0002-Run-ata_id-on-non-removable-USB-devices.patch Patch3: 0003-systemd-let-settle-depend-on-trigger-do-not-block-ba.patch -# Upstream 51f43b53293c4cc64c2a55598491c6cbf27b6bd5: don't SELinux label -# files outside of /dev. Fixes https://bugzilla.redhat.com/show_bug.cgi?id=693247 -Patch4: udev-167-selinux_label.patch +Patch4: 0004-Add-rule-for-Acer-Aspire-One-ZG8-to-use-acer-aspire_.patch +Patch5: 0005-udevd-add-N-to-optstring-in-getopt_long.patch +Patch6: 0006-Revert-Do-not-build-extras-with-disable-extras.patch +Patch7: 0007-Avoid-spinning-up-CD-on-pressing-eject-button.patch +Patch8: 0008-keymap-Support-Dell-Latitude-XT2-tablet-mode-navigat.patch +Patch9: 0009-selinux-do-not-label-files-in-runtime-dir.patch +Patch10: 0010-selinux-firmware-do-not-label-files-in-runtime-dir.patch + ExclusiveOS: Linux URL: http://www.kernel.org/pub/linux/utils/kernel/hotplug/udev.html @@ -115,8 +121,15 @@ glib-based applications using libudev functionality. %prep %setup -q +%patch2 -p1 -b .git2 %patch3 -p1 -b .git3 -%patch4 -p1 -b .label +%patch4 -p1 -b .git4 +%patch5 -p1 -b .git5 +%patch6 -p1 -b .git6 +%patch7 -p1 -b .git7 +%patch8 -p1 -b .git8 +%patch9 -p1 -b .git9 +%patch10 -p1 -b .git10 %build # prevent man pages from re-building (xmlto) @@ -364,6 +377,9 @@ rm -rf $RPM_BUILD_ROOT %attr(0644,root,root) %{_libdir}/pkgconfig/gudev-1.0* %changelog +* Mon Apr 11 2011 Harald Hoyer 167-4 +- more selinux fixes + * Thu Apr 7 2011 Adam Williamson - 167-3 - selinux_label.patch: from upstream, don't label files outside of /dev From e70c43125b3db3ddd6c0678655428f33d40e6191 Mon Sep 17 00:00:00 2001 From: Harald Hoyer Date: Fri, 20 May 2011 14:40:12 +0200 Subject: [PATCH 109/142] version 170 removed /sbin/start_udev --- ...-ata_id-on-non-removable-USB-devices.patch | 56 ----- ...le-depend-on-trigger-do-not-block-ba.patch | 51 ----- ...r-Aspire-One-ZG8-to-use-acer-aspire_.patch | 29 --- ...vd-add-N-to-optstring-in-getopt_long.patch | 22 -- ...not-build-extras-with-disable-extras.patch | 34 --- ...nning-up-CD-on-pressing-eject-button.patch | 45 ---- ...ell-Latitude-XT2-tablet-mode-navigat.patch | 56 ----- ...ux-do-not-label-files-in-runtime-dir.patch | 204 ----------------- ...re-do-not-label-files-in-runtime-dir.patch | 25 --- start_udev | 82 ------- udev-167-selinux_label.patch | 208 ------------------ udev.spec | 91 +++----- 12 files changed, 27 insertions(+), 876 deletions(-) delete mode 100644 0002-Run-ata_id-on-non-removable-USB-devices.patch delete mode 100644 0003-systemd-let-settle-depend-on-trigger-do-not-block-ba.patch delete mode 100644 0004-Add-rule-for-Acer-Aspire-One-ZG8-to-use-acer-aspire_.patch delete mode 100644 0005-udevd-add-N-to-optstring-in-getopt_long.patch delete mode 100644 0006-Revert-Do-not-build-extras-with-disable-extras.patch delete mode 100644 0007-Avoid-spinning-up-CD-on-pressing-eject-button.patch delete mode 100644 0008-keymap-Support-Dell-Latitude-XT2-tablet-mode-navigat.patch delete mode 100644 0009-selinux-do-not-label-files-in-runtime-dir.patch delete mode 100644 0010-selinux-firmware-do-not-label-files-in-runtime-dir.patch delete mode 100755 start_udev delete mode 100644 udev-167-selinux_label.patch diff --git a/0002-Run-ata_id-on-non-removable-USB-devices.patch b/0002-Run-ata_id-on-non-removable-USB-devices.patch deleted file mode 100644 index e58c4aa..0000000 --- a/0002-Run-ata_id-on-non-removable-USB-devices.patch +++ /dev/null @@ -1,56 +0,0 @@ -From 42b9482ab2da64b4c2f254c227c0efaf83988a84 Mon Sep 17 00:00:00 2001 -From: David Zeuthen -Date: Wed, 30 Mar 2011 08:11:03 -0400 -Subject: [PATCH] Run ata_id on non-removable USB devices - -If a USB device is marked as removable, it is often a SATA/PATA disk -in an enclosure (note that flash card readers and usb storage sticks -are always marked as removable). In this case, try running ata_id -(which sends ATA commands wrapped in SCSI ATA PASS THROUGH commands) -to get information about the disk. If this fails, just fall back to -running usb_id since it could be the device isn't an ATA device at -all or the device doesn't have a SAT layer. - -This extra information is nice to have as it indicates if it is -suitable to send e.g. SMART commands to the disk, whether the disk -supports power management and so on. Additionally, the VPD and serial -number returned by ata_id is usually more accurate as it stems from -the disk itself instead of the enclosure. - -Note that udisks has been doing this for a while - - KERNEL=="sd*[!0-9]", ATTR{removable}=="0", ENV{ID_BUS}=="usb", ENV{DEVTYPE}=="disk", IMPORT{program}="udisks-probe-ata-smart $tempnode" - -so this change shouldn't be too disruptive (udisks-probe-ata-smart -also sends ATA commands via the ATA PASS THROUGH command). - -Signed-off-by: David Zeuthen ---- - rules/rules.d/60-persistent-storage.rules | 8 ++++++-- - 1 files changed, 6 insertions(+), 2 deletions(-) - -diff --git a/rules/rules.d/60-persistent-storage.rules b/rules/rules.d/60-persistent-storage.rules -index 6a9abdd..12fabef 100644 ---- a/rules/rules.d/60-persistent-storage.rules -+++ b/rules/rules.d/60-persistent-storage.rules -@@ -22,14 +22,18 @@ ENV{DEVTYPE}=="partition", IMPORT{parent}="ID_*" - KERNEL=="vd*[!0-9]", ATTRS{serial}=="?*", ENV{ID_SERIAL}="$attr{serial}", SYMLINK+="disk/by-id/virtio-$env{ID_SERIAL}" - KERNEL=="vd*[0-9]", ATTRS{serial}=="?*", ENV{ID_SERIAL}="$attr{serial}", SYMLINK+="disk/by-id/virtio-$env{ID_SERIAL}-part%n" - --# USB devices use their own serial number --KERNEL=="sd*[!0-9]|sr*", ENV{ID_SERIAL}!="?*", SUBSYSTEMS=="usb", IMPORT{program}="usb_id --export %p" - # ATA devices with their own "ata" kernel subsystem - KERNEL=="sd*[!0-9]|sr*", ENV{ID_SERIAL}!="?*", SUBSYSTEMS=="ata", IMPORT{program}="ata_id --export $tempnode" - # ATA devices using the "scsi" subsystem - KERNEL=="sd*[!0-9]|sr*", ENV{ID_SERIAL}!="?*", SUBSYSTEMS=="scsi", ATTRS{vendor}=="ATA", IMPORT{program}="ata_id --export $tempnode" - # ATA/ATAPI devices (SPC-3 or later) using the "scsi" subsystem - KERNEL=="sd*[!0-9]|sr*", ENV{ID_SERIAL}!="?*", SUBSYSTEMS=="scsi", ATTRS{type}=="5", ATTRS{scsi_level}=="[6-9]*", IMPORT{program}="ata_id --export $tempnode" -+ -+# Run ata_id on non-removable USB Mass Storage (SATA/PATA disks in enclosures) -+KERNEL=="sd*[!0-9]|sr*", ENV{ID_SERIAL}!="?*", ATTR{removable}=="0", SUBSYSTEMS=="usb", IMPORT{program}="ata_id --export $tempnode" -+# Otherwise fall back to using usb_id for USB devices -+KERNEL=="sd*[!0-9]|sr*", ENV{ID_SERIAL}!="?*", SUBSYSTEMS=="usb", IMPORT{program}="usb_id --export %p" -+ - # scsi devices - KERNEL=="sd*[!0-9]|sr*", ENV{ID_SERIAL}!="?*", IMPORT{program}="scsi_id --export --whitelisted -d $tempnode", ENV{ID_BUS}="scsi" - KERNEL=="cciss*", ENV{DEVTYPE}=="disk", ENV{ID_SERIAL}!="?*", IMPORT{program}="scsi_id --export --whitelisted -d $tempnode", ENV{ID_BUS}="cciss" diff --git a/0003-systemd-let-settle-depend-on-trigger-do-not-block-ba.patch b/0003-systemd-let-settle-depend-on-trigger-do-not-block-ba.patch deleted file mode 100644 index aa67cf1..0000000 --- a/0003-systemd-let-settle-depend-on-trigger-do-not-block-ba.patch +++ /dev/null @@ -1,51 +0,0 @@ -From daf32d32172e19e78754999b41c27b45e3629326 Mon Sep 17 00:00:00 2001 -From: Kay Sievers -Date: Thu, 31 Mar 2011 13:15:47 +0200 -Subject: [PATCH] systemd: let settle depend on trigger, do not block basic with trigger - ---- - init/udev-settle.service.in | 15 +++++++++------ - init/udev-trigger.service.in | 1 - - 2 files changed, 9 insertions(+), 7 deletions(-) - -diff --git a/init/udev-settle.service.in b/init/udev-settle.service.in -index be06a39..bda8626 100644 ---- a/init/udev-settle.service.in -+++ b/init/udev-settle.service.in -@@ -1,15 +1,18 @@ --# This barrier service is usually not enabled by default. If enabled, --# it acts as a barrier for basic.target -- so all later services will -+# This service is usually not enabled by default. If enabled, it -+# acts as a barrier for basic.target -- so all later services will - # wait for udev completely finishing its coldplug run. - # --# It might be enabled just unconditionally, or pulled-in on-demand by --# broken or non-hotplug-aware services that assume a fully populated --# /dev at startup. -+# If needed, to work around broken or non-hotplug-aware services, -+# it might be enabled unconditionally, or pulled-in on-demand by -+# the services that assume a fully populated /dev at startup. It -+# should not be used or pulled-in ever on systems without such -+# legacy services running. - - [Unit] - Description=udev Wait for Complete Device Initialization - DefaultDependencies=no --After=udev.service -+Requires=udev.service -+After=udev-trigger.service - Before=basic.target - - [Service] -diff --git a/init/udev-trigger.service.in b/init/udev-trigger.service.in -index 0ede317..745974a 100644 ---- a/init/udev-trigger.service.in -+++ b/init/udev-trigger.service.in -@@ -2,7 +2,6 @@ - Description=udev Coldplug all Devices - Requires=udev.service - After=udev.service --Before=basic.target - DefaultDependencies=no - - [Service] diff --git a/0004-Add-rule-for-Acer-Aspire-One-ZG8-to-use-acer-aspire_.patch b/0004-Add-rule-for-Acer-Aspire-One-ZG8-to-use-acer-aspire_.patch deleted file mode 100644 index b343faf..0000000 --- a/0004-Add-rule-for-Acer-Aspire-One-ZG8-to-use-acer-aspire_.patch +++ /dev/null @@ -1,29 +0,0 @@ -From ff4a035a8aaba6a7b5b85c4b348886d72c42e84c Mon Sep 17 00:00:00 2001 -From: Lee, Chun-Yi -Date: Thu, 31 Mar 2011 18:01:05 +0800 -Subject: [PATCH] Add rule for Acer Aspire One ZG8 to use acer-aspire_5720 keymap - -Acer Aspire One ZG8's bluetooth HW key emit 0xD9 scancode, it must map -to KEY_BLUETOOTH like Acer Aspire 5720. So, add rule for Acer Aspire One -ZG8 use acer-aspire_5720 keymap. - -Tested on Acer Aspire One ZG8 netbook. - -Signed-off-by: Lee, Chun-Yi -Signed-off-by: Martin Pitt ---- - extras/keymap/95-keymap.rules | 1 + - 1 files changed, 1 insertions(+), 0 deletions(-) - -diff --git a/extras/keymap/95-keymap.rules b/extras/keymap/95-keymap.rules -index 0c3ae38..44d5064 100644 ---- a/extras/keymap/95-keymap.rules -+++ b/extras/keymap/95-keymap.rules -@@ -100,6 +100,7 @@ ENV{DMI_VENDOR}=="Acer*", ATTR{[dmi/id]product_name}=="Aspire 6920", RUN+="keyma - ENV{DMI_VENDOR}=="Acer*", ATTR{[dmi/id]product_name}=="Aspire 5920G", RUN+="keymap $name acer-aspire_5920g" - ENV{DMI_VENDOR}=="Acer*", ATTR{[dmi/id]product_name}=="Aspire 5720*", RUN+="keymap $name acer-aspire_5720" - ENV{DMI_VENDOR}=="Acer*", ATTR{[dmi/id]product_name}=="Aspire 8930", RUN+="keymap $name acer-aspire_8930" -+ENV{DMI_VENDOR}=="Acer*", ATTR{[dmi/id]product_serial}=="ZG8*", RUN+="keymap $name acer-aspire_5720" - - ENV{DMI_VENDOR}=="*BenQ*", ATTR{[dmi/id]product_name}=="*Joybook R22*", RUN+="keymap $name 0x6E wlan" - diff --git a/0005-udevd-add-N-to-optstring-in-getopt_long.patch b/0005-udevd-add-N-to-optstring-in-getopt_long.patch deleted file mode 100644 index c8ca5c6..0000000 --- a/0005-udevd-add-N-to-optstring-in-getopt_long.patch +++ /dev/null @@ -1,22 +0,0 @@ -From 6ee9b2cb8cf023253853f1c80e707598685b11f3 Mon Sep 17 00:00:00 2001 -From: Thomas Egerer -Date: Thu, 31 Mar 2011 17:25:31 +0200 -Subject: [PATCH] udevd: add 'N:' to optstring in getopt_long - ---- - udev/udevd.c | 2 +- - 1 files changed, 1 insertions(+), 1 deletions(-) - -diff --git a/udev/udevd.c b/udev/udevd.c -index 1871474..a8b339f 100644 ---- a/udev/udevd.c -+++ b/udev/udevd.c -@@ -1118,7 +1118,7 @@ int main(int argc, char *argv[]) - for (;;) { - int option; - -- option = getopt_long(argc, argv, "c:deDthV", options, NULL); -+ option = getopt_long(argc, argv, "c:deDtN:hV", options, NULL); - if (option == -1) - break; - diff --git a/0006-Revert-Do-not-build-extras-with-disable-extras.patch b/0006-Revert-Do-not-build-extras-with-disable-extras.patch deleted file mode 100644 index a7f4f96..0000000 --- a/0006-Revert-Do-not-build-extras-with-disable-extras.patch +++ /dev/null @@ -1,34 +0,0 @@ -From 9bb54267a1483e8f3b2de352c7be433f625e5606 Mon Sep 17 00:00:00 2001 -From: Martin Pitt -Date: Thu, 31 Mar 2011 19:23:19 +0200 -Subject: [PATCH] Revert "Do not build extras with --disable-extras" - -This reverts commit 905818f5961446ac32d1b2d165185fffddc4915a. - -We do want to build some extras, just not the ones with extra dependencies. -Thanks to Juergen Daubert for pointing this out. ---- - Makefile.am | 3 --- - 1 files changed, 0 insertions(+), 3 deletions(-) - -diff --git a/Makefile.am b/Makefile.am -index df70bf7..2c20f46 100644 ---- a/Makefile.am -+++ b/Makefile.am -@@ -225,7 +225,6 @@ dist_udevrules_DATA += \ - extras/rule_generator/75-cd-aliases-generator.rules \ - extras/rule_generator/75-persistent-net-generator.rules - --if ENABLE_EXTRAS - # ------------------------------------------------------------------------------ - # firmware - firmware loading - # ------------------------------------------------------------------------------ -@@ -314,8 +313,6 @@ extras_v4l_id_v4l_id_LDADD = libudev/libudev-private.la - libexec_PROGRAMS += extras/v4l_id/v4l_id - dist_udevrules_DATA += extras/v4l_id/60-persistent-v4l.rules - --endif # ENABLE_EXTRAS -- - # ------------------------------------------------------------------------------ - # qemu -- qemu/kvm guest tweaks - # ------------------------------------------------------------------------------ diff --git a/0007-Avoid-spinning-up-CD-on-pressing-eject-button.patch b/0007-Avoid-spinning-up-CD-on-pressing-eject-button.patch deleted file mode 100644 index efeecfe..0000000 --- a/0007-Avoid-spinning-up-CD-on-pressing-eject-button.patch +++ /dev/null @@ -1,45 +0,0 @@ -From 55eb500cc5465babf1fd773dbcceeb90eeefd997 Mon Sep 17 00:00:00 2001 -From: Martin Pitt -Date: Mon, 4 Apr 2011 11:47:54 +0200 -Subject: [PATCH] Avoid spinning up CD on pressing eject button - -When the CD tray door is locked and the hardware eject button is pressed, newer -kernels (2.6.38+) will send out a change event with a DISK_EJECT_REQUEST==1 -property. Do not run cdrom_id and blkid in this case, as the media state and -contents does not change, and this only needlessly spins up the drive again -right before ejection. ---- - extras/cdrom_id/60-cdrom_id.rules | 3 +++ - rules/rules.d/60-persistent-storage.rules | 4 ++-- - 2 files changed, 5 insertions(+), 2 deletions(-) - -diff --git a/extras/cdrom_id/60-cdrom_id.rules b/extras/cdrom_id/60-cdrom_id.rules -index b3109f1..aedf6f0 100644 ---- a/extras/cdrom_id/60-cdrom_id.rules -+++ b/extras/cdrom_id/60-cdrom_id.rules -@@ -5,6 +5,9 @@ SUBSYSTEM!="block", GOTO="cdrom_end" - KERNEL!="sr[0-9]*|xvd*", GOTO="cdrom_end" - ENV{DEVTYPE}!="disk", GOTO="cdrom_end" - -+# this is only a button press event -+ENV{DISK_EJECT_REQUEST}=="?*", GOTO="cdrom_end" -+ - KERNEL=="sr[0-9]*", ENV{ID_CDROM}="1" - IMPORT{program}="cdrom_id --export $tempnode" - -diff --git a/rules/rules.d/60-persistent-storage.rules b/rules/rules.d/60-persistent-storage.rules -index 12fabef..05a405f 100644 ---- a/rules/rules.d/60-persistent-storage.rules -+++ b/rules/rules.d/60-persistent-storage.rules -@@ -62,9 +62,9 @@ ENV{DEVTYPE}=="partition", ENV{ID_PATH}=="?*", SYMLINK+="disk/by-path/$env{ID_PA - ENV{DEVTYPE}=="disk", KERNEL!="sd*|sr*", ATTR{removable}=="1", GOTO="persistent_storage_end" - - # probe filesystem metadata of optical drives which have a media inserted --KERNEL=="sr*", ENV{ID_CDROM_MEDIA_TRACK_COUNT_DATA}=="?*", ENV{ID_CDROM_MEDIA_SESSION_LAST_OFFSET}=="?*", IMPORT{program}="/sbin/blkid -o udev -p -u noraid -O $env{ID_CDROM_MEDIA_SESSION_LAST_OFFSET} $tempnode" -+KERNEL=="sr*", ENV{DISK_EJECT_REQUEST}!="?*", ENV{ID_CDROM_MEDIA_TRACK_COUNT_DATA}=="?*", ENV{ID_CDROM_MEDIA_SESSION_LAST_OFFSET}=="?*", IMPORT{program}="/sbin/blkid -o udev -p -u noraid -O $env{ID_CDROM_MEDIA_SESSION_LAST_OFFSET} $tempnode" - # single-session CDs do not have ID_CDROM_MEDIA_SESSION_LAST_OFFSET --KERNEL=="sr*", ENV{ID_CDROM_MEDIA_TRACK_COUNT_DATA}=="?*", ENV{ID_CDROM_MEDIA_SESSION_LAST_OFFSET}=="", IMPORT{program}="/sbin/blkid -o udev -p -u noraid $tempnode" -+KERNEL=="sr*", ENV{DISK_EJECT_REQUEST}!="?*", ENV{ID_CDROM_MEDIA_TRACK_COUNT_DATA}=="?*", ENV{ID_CDROM_MEDIA_SESSION_LAST_OFFSET}=="", IMPORT{program}="/sbin/blkid -o udev -p -u noraid $tempnode" - - # probe filesystem metadata of disks - KERNEL!="sr*", IMPORT{program}="/sbin/blkid -o udev -p $tempnode" diff --git a/0008-keymap-Support-Dell-Latitude-XT2-tablet-mode-navigat.patch b/0008-keymap-Support-Dell-Latitude-XT2-tablet-mode-navigat.patch deleted file mode 100644 index f8e7404..0000000 --- a/0008-keymap-Support-Dell-Latitude-XT2-tablet-mode-navigat.patch +++ /dev/null @@ -1,56 +0,0 @@ -From 5e0ec43fc40e3e6dd0e44a7d617846879e1dac9e Mon Sep 17 00:00:00 2001 -From: Seth Forshee -Date: Tue, 5 Apr 2011 11:43:00 -0500 -Subject: [PATCH] keymap: Support Dell Latitude XT2 tablet-mode navigation keys - -The XT2 has a rocker (up/down/enter) and back button on the side -in tablet mode, none of which work currently. Add entries for -these keys. - -There is some overlap here with scan codes used in other Dell -models, so these buttons are put in a new file specific to this -model. - -Signed-off-by: Seth Forshee -Signed-off-by: Martin Pitt ---- - Makefile.am | 1 + - extras/keymap/95-keymap.rules | 1 + - extras/keymap/keymaps/dell-latitude-xt2 | 4 ++++ - 3 files changed, 6 insertions(+), 0 deletions(-) - create mode 100644 extras/keymap/keymaps/dell-latitude-xt2 - -diff --git a/Makefile.am b/Makefile.am -index 2c20f46..4244089 100644 ---- a/Makefile.am -+++ b/Makefile.am -@@ -568,6 +568,7 @@ dist_udevkeymap_DATA = \ - extras/keymap/keymaps/asus \ - extras/keymap/keymaps/compaq-e_evo \ - extras/keymap/keymaps/dell \ -+ extras/keymap/keymaps/dell-latitude-xt2 \ - extras/keymap/keymaps/everex-xt5000 \ - extras/keymap/keymaps/fujitsu-amilo_pa_2548 \ - extras/keymap/keymaps/fujitsu-amilo_pro_edition_v3505 \ -diff --git a/extras/keymap/95-keymap.rules b/extras/keymap/95-keymap.rules -index 44d5064..350f111 100644 ---- a/extras/keymap/95-keymap.rules -+++ b/extras/keymap/95-keymap.rules -@@ -67,6 +67,7 @@ LABEL="keyboard_vendorcheck" - - ENV{DMI_VENDOR}=="Dell*", RUN+="keymap $name dell" - ENV{DMI_VENDOR}=="Dell*", ATTR{[dmi/id]product_name}=="Inspiron 910|Inspiron 1010|Inspiron 1011|Inspiron 1012|Inspiron 1110|Inspiron 1210", RUN+="keymap $name 0x84 wlan" -+ENV{DMI_VENDOR}=="Dell*", ATTR{[dmi/id]product_name}=="Latitude XT2", RUN+="keymap $name dell-latitude-xt2" - - ENV{DMI_VENDOR}=="Compaq*", ATTR{[dmi/id]product_name}=="*E500*|*Evo N*", RUN+="keymap $name compaq-e_evo" - -diff --git a/extras/keymap/keymaps/dell-latitude-xt2 b/extras/keymap/keymaps/dell-latitude-xt2 -new file mode 100644 -index 0000000..39872f5 ---- /dev/null -+++ b/extras/keymap/keymaps/dell-latitude-xt2 -@@ -0,0 +1,4 @@ -+0x9B up # tablet rocker up -+0x9E enter # tablet rocker press -+0x9F back # tablet back -+0xA3 down # tablet rocker down diff --git a/0009-selinux-do-not-label-files-in-runtime-dir.patch b/0009-selinux-do-not-label-files-in-runtime-dir.patch deleted file mode 100644 index 56d16ac..0000000 --- a/0009-selinux-do-not-label-files-in-runtime-dir.patch +++ /dev/null @@ -1,204 +0,0 @@ -From 51f43b53293c4cc64c2a55598491c6cbf27b6bd5 Mon Sep 17 00:00:00 2001 -From: Kay Sievers -Date: Fri, 8 Apr 2011 01:03:49 +0200 -Subject: [PATCH] selinux: do not label files in runtime dir - -Do not label any files in the udev runtime directory, but only nodes, -links and directories below /dev. - -In case the runtime directory falls back to /dev/.udev, label this -directory once at udevd startup, but never anything below it. ---- - libudev/libudev-private.h | 1 + - libudev/libudev-queue-private.c | 2 -- - libudev/libudev-util-private.c | 18 +++++++++++++++--- - udev/udev-node.c | 6 +++--- - udev/udevd.c | 18 ++++++++---------- - 5 files changed, 27 insertions(+), 18 deletions(-) - -diff --git a/libudev/libudev-private.h b/libudev/libudev-private.h -index 7078b0f..8495f9a 100644 ---- a/libudev/libudev-private.h -+++ b/libudev/libudev-private.h -@@ -220,6 +220,7 @@ uint64_t util_string_bloom64(const char *str); - - /* libudev-util-private.c */ - int util_create_path(struct udev *udev, const char *path); -+int util_create_path_selinux(struct udev *udev, const char *path); - int util_delete_path(struct udev *udev, const char *path); - int util_unlink_secure(struct udev *udev, const char *filename); - uid_t util_lookup_user(struct udev *udev, const char *user); -diff --git a/libudev/libudev-queue-private.c b/libudev/libudev-queue-private.c -index a714572..2f1afec 100644 ---- a/libudev/libudev-queue-private.c -+++ b/libudev/libudev-queue-private.c -@@ -409,9 +409,7 @@ static void update_failed(struct udev_queue_export *udev_queue_export, - /* record event in the failed directory */ - udev_queue_export->failed_count++; - util_create_path(udev, filename); -- udev_selinux_setfscreatecon(udev, filename, S_IFLNK); - symlink(udev_device_get_devpath(udev_device), filename); -- udev_selinux_resetfscreatecon(udev); - break; - - case DEVICE_QUEUED: -diff --git a/libudev/libudev-util-private.c b/libudev/libudev-util-private.c -index 6b68b6a..19f979e 100644 ---- a/libudev/libudev-util-private.c -+++ b/libudev/libudev-util-private.c -@@ -25,7 +25,7 @@ - #include "libudev.h" - #include "libudev-private.h" - --int util_create_path(struct udev *udev, const char *path) -+static int create_path(struct udev *udev, const char *path, bool selinux) - { - char p[UTIL_PATH_SIZE]; - char *pos; -@@ -55,7 +55,8 @@ int util_create_path(struct udev *udev, const char *path) - return err; - - dbg(udev, "mkdir '%s'\n", p); -- udev_selinux_setfscreatecon(udev, p, S_IFDIR|0755); -+ if (selinux) -+ udev_selinux_setfscreatecon(udev, p, S_IFDIR|0755); - err = mkdir(p, 0755); - if (err != 0) { - err = -errno; -@@ -66,10 +67,21 @@ int util_create_path(struct udev *udev, const char *path) - err = -ENOTDIR; - } - } -- udev_selinux_resetfscreatecon(udev); -+ if (selinux) -+ udev_selinux_resetfscreatecon(udev); - return err; - } - -+int util_create_path(struct udev *udev, const char *path) -+{ -+ return create_path(udev, path, false); -+} -+ -+int util_create_path_selinux(struct udev *udev, const char *path) -+{ -+ return create_path(udev, path, true); -+} -+ - int util_delete_path(struct udev *udev, const char *path) - { - char p[UTIL_PATH_SIZE]; -diff --git a/udev/udev-node.c b/udev/udev-node.c -index ab4e932..5e791ff 100644 ---- a/udev/udev-node.c -+++ b/udev/udev-node.c -@@ -96,7 +96,7 @@ int udev_node_mknod(struct udev_device *dev, const char *file, mode_t mode, uid_ - } else { - info(udev, "mknod '%s' %u:%u %#o\n", file, major(devnum), minor(devnum), mode); - do { -- err = util_create_path(udev, file); -+ err = util_create_path_selinux(udev, file); - if (err != 0 && err != -ENOENT) - break; - udev_selinux_setfscreatecon(udev, file, mode); -@@ -184,7 +184,7 @@ static int node_symlink(struct udev *udev, const char *node, const char *slink) - } else { - info(udev, "creating symlink '%s' to '%s'\n", slink, target); - do { -- err = util_create_path(udev, slink); -+ err = util_create_path_selinux(udev, slink); - if (err != 0 && err != -ENOENT) - break; - udev_selinux_setfscreatecon(udev, slink, S_IFLNK); -@@ -201,7 +201,7 @@ static int node_symlink(struct udev *udev, const char *node, const char *slink) - util_strscpyl(slink_tmp, sizeof(slink_tmp), slink, TMP_FILE_EXT, NULL); - unlink(slink_tmp); - do { -- err = util_create_path(udev, slink_tmp); -+ err = util_create_path_selinux(udev, slink_tmp); - if (err != 0 && err != -ENOENT) - break; - udev_selinux_setfscreatecon(udev, slink_tmp, S_IFLNK); -diff --git a/udev/udevd.c b/udev/udevd.c -index a8b339f..df5c199 100644 ---- a/udev/udevd.c -+++ b/udev/udevd.c -@@ -822,7 +822,7 @@ static void static_dev_create_from_modules(struct udev *udev) - continue; - - util_strscpyl(filename, sizeof(filename), udev_get_dev_path(udev), "/", devname, NULL); -- util_create_path(udev, filename); -+ util_create_path_selinux(udev, filename); - udev_selinux_setfscreatecon(udev, filename, mode); - info(udev, "mknod '%s' %c%u:%u\n", filename, type, maj, min); - if (mknod(filename, mode, makedev(maj, min)) < 0 && errno == EEXIST) -@@ -833,7 +833,7 @@ static void static_dev_create_from_modules(struct udev *udev) - fclose(f); - } - --static int copy_dir(struct udev *udev, DIR *dir_from, DIR *dir_to, int maxdepth) -+static int copy_dev_dir(struct udev *udev, DIR *dir_from, DIR *dir_to, int maxdepth) - { - struct dirent *dent; - -@@ -886,7 +886,7 @@ static int copy_dir(struct udev *udev, DIR *dir_from, DIR *dir_to, int maxdepth) - continue; - } - -- copy_dir(udev, dir2_from, dir2_to, maxdepth-1); -+ copy_dev_dir(udev, dir2_from, dir2_to, maxdepth-1); - - closedir(dir2_to); - closedir(dir2_from); -@@ -930,7 +930,7 @@ static void static_dev_create_from_devices(struct udev *udev, DIR *dir) - dir_from = opendir(LIBEXECDIR "/devices"); - if (dir_from == NULL) - return; -- copy_dir(udev, dir_from, dir, 8); -+ copy_dev_dir(udev, dir_from, dir, 8); - closedir(dir_from); - } - -@@ -985,9 +985,7 @@ static int convert_db(struct udev *udev) - - /* make sure we do not get here again */ - util_create_path(udev, filename); -- udev_selinux_setfscreatecon(udev, udev_get_run_path(udev), S_IFDIR|0755); - mkdir(filename, 0755); -- udev_selinux_resetfscreatecon(udev); - - /* old database */ - util_strscpyl(filename, sizeof(filename), udev_get_dev_path(udev), "/.udev/db", NULL); -@@ -1097,9 +1095,7 @@ int main(int argc, char *argv[]) - /* make sure, that our runtime dir exists and is writable */ - if (utimensat(AT_FDCWD, udev_get_run_config_path(udev), NULL, 0) < 0) { - /* try to create our own subdirectory, do not create parent directories */ -- udev_selinux_setfscreatecon(udev, udev_get_run_config_path(udev), S_IFDIR|0755); - mkdir(udev_get_run_config_path(udev), 0755); -- udev_selinux_resetfscreatecon(udev); - - if (utimensat(AT_FDCWD, udev_get_run_config_path(udev), NULL, 0) >= 0) { - /* directory seems writable now */ -@@ -1111,8 +1107,12 @@ int main(int argc, char *argv[]) - util_strscpyl(filename, sizeof(filename), udev_get_dev_path(udev), "/.udev", NULL); - if (udev_set_run_path(udev, filename) == NULL) - goto exit; -+ mkdir(udev_get_run_path(udev), 0755); - } - } -+ /* relabel runtime dir only if it resides below /dev */ -+ if (strncmp(udev_get_run_path(udev), udev_get_dev_path(udev), strlen(udev_get_dev_path(udev))) == 0) -+ udev_selinux_lsetfilecon(udev, udev_get_run_path(udev), 0755); - info(udev, "runtime dir '%s'\n", udev_get_run_path(udev)); - - for (;;) { -@@ -1281,9 +1281,7 @@ int main(int argc, char *argv[]) - util_strscpyl(filename, sizeof(filename), udev_get_run_path(udev), "/rules.d", NULL); - if (stat(filename, &statbuf) != 0) { - util_create_path(udev, filename); -- udev_selinux_setfscreatecon(udev, filename, S_IFDIR|0755); - mkdir(filename, 0755); -- udev_selinux_resetfscreatecon(udev); - } - inotify_add_watch(pfd[FD_INOTIFY].fd, filename, - IN_DELETE | IN_MOVE | IN_CLOSE_WRITE); diff --git a/0010-selinux-firmware-do-not-label-files-in-runtime-dir.patch b/0010-selinux-firmware-do-not-label-files-in-runtime-dir.patch deleted file mode 100644 index a14e5d4..0000000 --- a/0010-selinux-firmware-do-not-label-files-in-runtime-dir.patch +++ /dev/null @@ -1,25 +0,0 @@ -From 960250952193db522b8ced336bf998bd7e8e4a31 Mon Sep 17 00:00:00 2001 -From: Kay Sievers -Date: Fri, 8 Apr 2011 03:08:16 +0200 -Subject: [PATCH] selinux: firmware - do not label files in runtime dir - ---- - extras/firmware/firmware.c | 2 -- - 1 files changed, 0 insertions(+), 2 deletions(-) - -diff --git a/extras/firmware/firmware.c b/extras/firmware/firmware.c -index 8199820..f2df76c 100644 ---- a/extras/firmware/firmware.c -+++ b/extras/firmware/firmware.c -@@ -159,11 +159,9 @@ int main(int argc, char **argv) - err = util_create_path(udev, misspath); - if (err != 0 && err != -ENOENT) - break; -- udev_selinux_setfscreatecon(udev, misspath, S_IFLNK); - err = symlink(devpath, misspath); - if (err != 0) - err = -errno; -- udev_selinux_resetfscreatecon(udev); - } while (err == -ENOENT); - rc = 2; - set_loading(udev, loadpath, "-1"); diff --git a/start_udev b/start_udev deleted file mode 100755 index ebb9cb6..0000000 --- a/start_udev +++ /dev/null @@ -1,82 +0,0 @@ -#!/bin/bash -# -# start_udev -# -# script to initialize /dev by using udev. -# -# Copyright (C) 2004 Greg Kroah-Hartman -# -# Released under the GPL v2 only. -# -# This needs to be run at the earliest possible point in the boot -# process. -# -# Based on the udev init.d script -# -# Thanks go out to the Gentoo developers for proving -# that this is possible to do. -# -# Yes, it's very verbose, feel free to turn off all of the echo calls, -# they were there to make me feel better that everything was working -# properly during development... -# -# don't use udev if sysfs is not mounted. - -# if we run with systemctl, just wait for settle -if [ -x "$(type -P systemctl)" ]; then - systemctl start udev-settle.service &>/dev/null && exit 0 -fi - -export TZ=/etc/localtime - -[ -d /sys/class ] || exit 1 -[ -r /proc/mounts ] || exit 1 -[ -x /sbin/udevd ] || exit 1 - -. /etc/init.d/functions - -prog=udev - -touch_recursive() { - ( cd $1; - for i in *; do - [[ -c "$i" || -b "$i" ]] && touch --no-create "$i" - [ -d "$i" ] && touch_recursive "$i" - done ) - return 0 -} - -ret=0 -STRING=$"Starting $prog: " -# propagate /dev from /sys -echo -n "$STRING" - -# turn off hotplug binary calling -if ! [ -x /sbin/hotplug ]; then - if [ -e /sys/kernel/uevent_helper ]; then - echo -e '\000\000\000\000' > /sys/kernel/uevent_helper - elif [ -e /proc/sys/kernel/hotplug ]; then - echo -e '\000\000\000\000' > /proc/sys/kernel/hotplug - fi -fi - -/sbin/udevd -d - -ret=$[$ret + $?] - -/sbin/udevadm trigger --type=subsystems --action=add -/sbin/udevadm trigger --type=devices --action=add -/sbin/udevadm settle -ret=$[$ret + $?] - -# touch all device files for timezone glitches -# "find" is in /usr/bin and might not be available -if [ -f /etc/sysconfig/clock ]; then - . /etc/sysconfig/clock - [[ "$UTC" == "false" || "$UTC" == "no" ]] \ - && touch_recursive /dev > "/dev/null" 2>&1 -fi - -[ $ret -eq 0 ] && success $"$STRING" || failure $"$STRING" -echo -exit 0 diff --git a/udev-167-selinux_label.patch b/udev-167-selinux_label.patch deleted file mode 100644 index f583f0f..0000000 --- a/udev-167-selinux_label.patch +++ /dev/null @@ -1,208 +0,0 @@ -From 51f43b53293c4cc64c2a55598491c6cbf27b6bd5 Mon Sep 17 00:00:00 2001 -From: Kay Sievers -Date: Fri, 8 Apr 2011 01:03:49 +0200 -Subject: [PATCH] selinux: do not label files in runtime dir - -Do not label any files in the udev runtime directory, but only nodes, -links and directories below /dev. - -In case the runtime directory falls back to /dev/.udev, label this -directory once at udevd startup, but never anything below it. ---- - libudev/libudev-private.h | 1 + - libudev/libudev-queue-private.c | 2 -- - libudev/libudev-util-private.c | 18 +++++++++++++++--- - udev/udev-node.c | 6 +++--- - udev/udevd.c | 18 ++++++++---------- - 5 files changed, 27 insertions(+), 18 deletions(-) - -diff --git a/libudev/libudev-private.h b/libudev/libudev-private.h -index 7078b0f..8495f9a 100644 ---- a/libudev/libudev-private.h -+++ b/libudev/libudev-private.h -@@ -220,6 +220,7 @@ uint64_t util_string_bloom64(const char *str); - - /* libudev-util-private.c */ - int util_create_path(struct udev *udev, const char *path); -+int util_create_path_selinux(struct udev *udev, const char *path); - int util_delete_path(struct udev *udev, const char *path); - int util_unlink_secure(struct udev *udev, const char *filename); - uid_t util_lookup_user(struct udev *udev, const char *user); -diff --git a/libudev/libudev-queue-private.c b/libudev/libudev-queue-private.c -index a714572..2f1afec 100644 ---- a/libudev/libudev-queue-private.c -+++ b/libudev/libudev-queue-private.c -@@ -409,9 +409,7 @@ static void update_failed(struct udev_queue_export *udev_queue_export, - /* record event in the failed directory */ - udev_queue_export->failed_count++; - util_create_path(udev, filename); -- udev_selinux_setfscreatecon(udev, filename, S_IFLNK); - symlink(udev_device_get_devpath(udev_device), filename); -- udev_selinux_resetfscreatecon(udev); - break; - - case DEVICE_QUEUED: -diff --git a/libudev/libudev-util-private.c b/libudev/libudev-util-private.c -index 6b68b6a..19f979e 100644 ---- a/libudev/libudev-util-private.c -+++ b/libudev/libudev-util-private.c -@@ -25,7 +25,7 @@ - #include "libudev.h" - #include "libudev-private.h" - --int util_create_path(struct udev *udev, const char *path) -+static int create_path(struct udev *udev, const char *path, bool selinux) - { - char p[UTIL_PATH_SIZE]; - char *pos; -@@ -55,7 +55,8 @@ int util_create_path(struct udev *udev, const char *path) - return err; - - dbg(udev, "mkdir '%s'\n", p); -- udev_selinux_setfscreatecon(udev, p, S_IFDIR|0755); -+ if (selinux) -+ udev_selinux_setfscreatecon(udev, p, S_IFDIR|0755); - err = mkdir(p, 0755); - if (err != 0) { - err = -errno; -@@ -66,10 +67,21 @@ int util_create_path(struct udev *udev, const char *path) - err = -ENOTDIR; - } - } -- udev_selinux_resetfscreatecon(udev); -+ if (selinux) -+ udev_selinux_resetfscreatecon(udev); - return err; - } - -+int util_create_path(struct udev *udev, const char *path) -+{ -+ return create_path(udev, path, false); -+} -+ -+int util_create_path_selinux(struct udev *udev, const char *path) -+{ -+ return create_path(udev, path, true); -+} -+ - int util_delete_path(struct udev *udev, const char *path) - { - char p[UTIL_PATH_SIZE]; -diff --git a/udev/udev-node.c b/udev/udev-node.c -index ab4e932..5e791ff 100644 ---- a/udev/udev-node.c -+++ b/udev/udev-node.c -@@ -96,7 +96,7 @@ int udev_node_mknod(struct udev_device *dev, const char *file, mode_t mode, uid_ - } else { - info(udev, "mknod '%s' %u:%u %#o\n", file, major(devnum), minor(devnum), mode); - do { -- err = util_create_path(udev, file); -+ err = util_create_path_selinux(udev, file); - if (err != 0 && err != -ENOENT) - break; - udev_selinux_setfscreatecon(udev, file, mode); -@@ -184,7 +184,7 @@ static int node_symlink(struct udev *udev, const char *node, const char *slink) - } else { - info(udev, "creating symlink '%s' to '%s'\n", slink, target); - do { -- err = util_create_path(udev, slink); -+ err = util_create_path_selinux(udev, slink); - if (err != 0 && err != -ENOENT) - break; - udev_selinux_setfscreatecon(udev, slink, S_IFLNK); -@@ -201,7 +201,7 @@ static int node_symlink(struct udev *udev, const char *node, const char *slink) - util_strscpyl(slink_tmp, sizeof(slink_tmp), slink, TMP_FILE_EXT, NULL); - unlink(slink_tmp); - do { -- err = util_create_path(udev, slink_tmp); -+ err = util_create_path_selinux(udev, slink_tmp); - if (err != 0 && err != -ENOENT) - break; - udev_selinux_setfscreatecon(udev, slink_tmp, S_IFLNK); -diff --git a/udev/udevd.c b/udev/udevd.c -index a8b339f..df5c199 100644 ---- a/udev/udevd.c -+++ b/udev/udevd.c -@@ -822,7 +822,7 @@ static void static_dev_create_from_modules(struct udev *udev) - continue; - - util_strscpyl(filename, sizeof(filename), udev_get_dev_path(udev), "/", devname, NULL); -- util_create_path(udev, filename); -+ util_create_path_selinux(udev, filename); - udev_selinux_setfscreatecon(udev, filename, mode); - info(udev, "mknod '%s' %c%u:%u\n", filename, type, maj, min); - if (mknod(filename, mode, makedev(maj, min)) < 0 && errno == EEXIST) -@@ -833,7 +833,7 @@ static void static_dev_create_from_modules(struct udev *udev) - fclose(f); - } - --static int copy_dir(struct udev *udev, DIR *dir_from, DIR *dir_to, int maxdepth) -+static int copy_dev_dir(struct udev *udev, DIR *dir_from, DIR *dir_to, int maxdepth) - { - struct dirent *dent; - -@@ -886,7 +886,7 @@ static int copy_dir(struct udev *udev, DIR *dir_from, DIR *dir_to, int maxdepth) - continue; - } - -- copy_dir(udev, dir2_from, dir2_to, maxdepth-1); -+ copy_dev_dir(udev, dir2_from, dir2_to, maxdepth-1); - - closedir(dir2_to); - closedir(dir2_from); -@@ -930,7 +930,7 @@ static void static_dev_create_from_devices(struct udev *udev, DIR *dir) - dir_from = opendir(LIBEXECDIR "/devices"); - if (dir_from == NULL) - return; -- copy_dir(udev, dir_from, dir, 8); -+ copy_dev_dir(udev, dir_from, dir, 8); - closedir(dir_from); - } - -@@ -985,9 +985,7 @@ static int convert_db(struct udev *udev) - - /* make sure we do not get here again */ - util_create_path(udev, filename); -- udev_selinux_setfscreatecon(udev, udev_get_run_path(udev), S_IFDIR|0755); - mkdir(filename, 0755); -- udev_selinux_resetfscreatecon(udev); - - /* old database */ - util_strscpyl(filename, sizeof(filename), udev_get_dev_path(udev), "/.udev/db", NULL); -@@ -1097,9 +1095,7 @@ int main(int argc, char *argv[]) - /* make sure, that our runtime dir exists and is writable */ - if (utimensat(AT_FDCWD, udev_get_run_config_path(udev), NULL, 0) < 0) { - /* try to create our own subdirectory, do not create parent directories */ -- udev_selinux_setfscreatecon(udev, udev_get_run_config_path(udev), S_IFDIR|0755); - mkdir(udev_get_run_config_path(udev), 0755); -- udev_selinux_resetfscreatecon(udev); - - if (utimensat(AT_FDCWD, udev_get_run_config_path(udev), NULL, 0) >= 0) { - /* directory seems writable now */ -@@ -1111,8 +1107,12 @@ int main(int argc, char *argv[]) - util_strscpyl(filename, sizeof(filename), udev_get_dev_path(udev), "/.udev", NULL); - if (udev_set_run_path(udev, filename) == NULL) - goto exit; -+ mkdir(udev_get_run_path(udev), 0755); - } - } -+ /* relabel runtime dir only if it resides below /dev */ -+ if (strncmp(udev_get_run_path(udev), udev_get_dev_path(udev), strlen(udev_get_dev_path(udev))) == 0) -+ udev_selinux_lsetfilecon(udev, udev_get_run_path(udev), 0755); - info(udev, "runtime dir '%s'\n", udev_get_run_path(udev)); - - for (;;) { -@@ -1281,9 +1281,7 @@ int main(int argc, char *argv[]) - util_strscpyl(filename, sizeof(filename), udev_get_run_path(udev), "/rules.d", NULL); - if (stat(filename, &statbuf) != 0) { - util_create_path(udev, filename); -- udev_selinux_setfscreatecon(udev, filename, S_IFDIR|0755); - mkdir(filename, 0755); -- udev_selinux_resetfscreatecon(udev); - } - inotify_add_watch(pfd[FD_INOTIFY].fd, filename, - IN_DELETE | IN_MOVE | IN_CLOSE_WRITE); --- -1.7.4.4 - - diff --git a/udev.spec b/udev.spec index 6b402b4..afa762f 100644 --- a/udev.spec +++ b/udev.spec @@ -6,27 +6,14 @@ Summary: A rule-based device node and kernel event manager Name: udev -Version: 167 -Release: 4%{?dist} +Version: 170 +Release: 1%{?dist} License: GPLv2+ Group: System Environment/Base Provides: udev-persistent = %{version}-%{release} Obsoletes: udev-persistent < 0:030-5 Source: ftp://ftp.kernel.org/pub/linux/utils/kernel/hotplug/%{name}-%{version}.tar.bz2 -Source1: start_udev - -Patch2: 0002-Run-ata_id-on-non-removable-USB-devices.patch -Patch3: 0003-systemd-let-settle-depend-on-trigger-do-not-block-ba.patch -Patch4: 0004-Add-rule-for-Acer-Aspire-One-ZG8-to-use-acer-aspire_.patch -Patch5: 0005-udevd-add-N-to-optstring-in-getopt_long.patch -Patch6: 0006-Revert-Do-not-build-extras-with-disable-extras.patch -Patch7: 0007-Avoid-spinning-up-CD-on-pressing-eject-button.patch -Patch8: 0008-keymap-Support-Dell-Latitude-XT2-tablet-mode-navigat.patch -Patch9: 0009-selinux-do-not-label-files-in-runtime-dir.patch -Patch10: 0010-selinux-firmware-do-not-label-files-in-runtime-dir.patch - - ExclusiveOS: Linux URL: http://www.kernel.org/pub/linux/utils/kernel/hotplug/udev.html BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n) @@ -36,7 +23,7 @@ Requires(pre): /usr/bin/getent /usr/sbin/groupadd Requires: hwdata Requires: systemd-units Requires: pkgconfig -Conflicts: systemd < 3 +Conflicts: systemd < 25 %ifarch s390 s390x # Require s390utils-base, because it's essential on s390 @@ -121,15 +108,6 @@ glib-based applications using libudev functionality. %prep %setup -q -%patch2 -p1 -b .git2 -%patch3 -p1 -b .git3 -%patch4 -p1 -b .git4 -%patch5 -p1 -b .git5 -%patch6 -p1 -b .git6 -%patch7 -p1 -b .git7 -%patch8 -p1 -b .git8 -%patch9 -p1 -b .git9 -%patch10 -p1 -b .git10 %build # prevent man pages from re-building (xmlto) @@ -147,7 +125,10 @@ libtoolize -f -c --sbindir="/sbin" --libexecdir=%{udev_scriptdir} \ --with-rootlibdir=/%{_lib} \ --enable-introspection \ - --with-systemdsystemunitdir=%{systemdsystemunitdir} + --with-systemdsystemunitdir=%{systemdsystemunitdir} \ + --enable-floppy \ + --enable-edd \ + --enable-action_modeswitch make %{?_smp_mflags} @@ -183,7 +164,7 @@ for i in \ ; do install -m 0644 "$i" "$RPM_BUILD_ROOT%{udev_scriptdir}/rules.d/${i##*/}" done - + mkdir -p $RPM_BUILD_ROOT%{udev_scriptdir}/{,devices,devices/net,devices/pts,devices/shm,devices/hugepages} mkdir -p $RPM_BUILD_ROOT%{_datadir}/udev @@ -197,22 +178,12 @@ mkdir -p $RPM_BUILD_ROOT%{_sysconfdir}/rc.d/init.d if [ "$1" -eq 0 -a -f %{_initrddir}/udev ]; then if test -x /usr/bin/stat -a \ "$(/usr/bin/stat -Lc '%%D-%%i' /)" = "$(/usr/bin/stat -Lc '%%D-%%i' /proc/1/root)"; then - if [ -x /sbin/pidof ]; then - pid=$(/sbin/pidof -c udevd) - while [ -n "$pid" ]; do - for p in $pid; do - kill $hard $p 2>/dev/null - done - sleep 0.2 - pid=$(/sbin/pidof -c udevd) - hard="-9" - done - fi + /sbin/udevadm control --exit 2>&1 || : fi - /sbin/chkconfig --del udev + /sbin/chkconfig --del udev || : fi if [ "$1" -eq 0 ]; then - /sbin/chkconfig --del udev-retry + /sbin/chkconfig --del udev-retry || : fi /sbin/chkconfig --del udev-post >/dev/null 2>&1 || : exit 0 @@ -223,39 +194,28 @@ getent group tape >/dev/null || /usr/sbin/groupadd -g 33 tape || : getent group dialout >/dev/null || /usr/sbin/groupadd -g 18 dialout || : getent group floppy >/dev/null || /usr/sbin/groupadd -g 19 floppy || : -# kill daemon if we are not in a chroot -if test -f /proc/1/exe -a -d /proc/1/root; then - if test -x /usr/bin/stat -a \ - "$(/usr/bin/stat -Lc '%%D-%%i' /)" = "$(/usr/bin/stat -Lc '%%D-%%i' /proc/1/root)"; then - /bin/systemctl stop udev.service >/dev/null 2>&1 || : - if test -x /sbin/udevd -a -x /sbin/pidof ; then - /sbin/udevadm control --stop-exec-queue - pid=$(/sbin/pidof -c udevd) - while [ -n "$pid" ]; do - for p in $pid; do - kill $hard $p 2>/dev/null - done - sleep 0.2 - pid=$(/sbin/pidof -c udevd) - hard="-9" - done - fi - fi +if ! /bin/systemctl stop udev.service udev.socket >/dev/null 2>&1; then + # kill daemon if we are not in a chroot + if test -f /proc/1/exe -a -d /proc/1/root; then + if test -x /usr/bin/stat -a \ + "$(/usr/bin/stat -Lc '%%D-%%i' /)" = "$(/usr/bin/stat -Lc '%%D-%%i' /proc/1/root)"; then + /sbin/udevadm control --exit 2>&1 || : + fi + fi fi exit 0 %post /bin/systemctl daemon-reload >/dev/null 2>&1 || : -# start daemon if we are not in a chroot -if test -f /proc/1/exe -a -d /proc/1/root; then +if ! /bin/systemctl start udev.service >/dev/null 2>&1; then + # start daemon if we are not in a chroot + if test -f /proc/1/exe -a -d /proc/1/root; then if test "$(/usr/bin/stat -Lc '%%D-%%i' /)" = "$(/usr/bin/stat -Lc '%%D-%%i' /proc/1/root)"; then - /bin/systemctl start udev.service >/dev/null 2>&1 || : /sbin/udevd -d >/dev/null 2>&1 || : - /sbin/udevadm control --start-exec-queue || : fi + fi fi - exit 0 %postun @@ -282,7 +242,6 @@ rm -rf $RPM_BUILD_ROOT %attr(0755,root,root) %{udev_scriptdir}/usb_id %attr(0755,root,root) %{udev_scriptdir}/cdrom_id %attr(0755,root,root) %{udev_scriptdir}/path_id -%attr(0755,root,root) %{udev_scriptdir}/hid2hci %attr(0755,root,root) %{udev_scriptdir}/create_floppy_devices %attr(0755,root,root) %{udev_scriptdir}/firmware %attr(0644,root,root) %{udev_scriptdir}/rule_generator.functions @@ -377,6 +336,10 @@ rm -rf $RPM_BUILD_ROOT %attr(0644,root,root) %{_libdir}/pkgconfig/gudev-1.0* %changelog +* Fri May 20 2011 Harald Hoyer 170-1 +- version 170 +- removed /sbin/start_udev + * Mon Apr 11 2011 Harald Hoyer 167-4 - more selinux fixes From 60836322f1f7c80554b860e8e5b52101bdc52683 Mon Sep 17 00:00:00 2001 From: Harald Hoyer Date: Fri, 20 May 2011 14:45:08 +0200 Subject: [PATCH 110/142] version 170 removed /sbin/start_udev --- .gitignore | 1 + sources | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/.gitignore b/.gitignore index 80bcd9e..465b6ed 100644 --- a/.gitignore +++ b/.gitignore @@ -4,3 +4,4 @@ udev-160.tar.bz2 /udev-166.tar.bz2 /udev-166.tar.bz2.sign /udev-167.tar.bz2 +/udev-170.tar.bz2 diff --git a/sources b/sources index db4315b..5395054 100644 --- a/sources +++ b/sources @@ -1 +1 @@ -4b37e1222f06c14c24147de346aa0bad udev-167.tar.bz2 +6e132d1a3b4dae24dafd2726c5cdd982 udev-170.tar.bz2 From 3ad6199da322e160fd22408038488859f2445db5 Mon Sep 17 00:00:00 2001 From: Harald Hoyer Date: Fri, 20 May 2011 14:53:29 +0200 Subject: [PATCH 111/142] version 170 removed /sbin/start_udev --- udev.spec | 2 -- 1 file changed, 2 deletions(-) diff --git a/udev.spec b/udev.spec index afa762f..6180f87 100644 --- a/udev.spec +++ b/udev.spec @@ -168,7 +168,6 @@ done mkdir -p $RPM_BUILD_ROOT%{udev_scriptdir}/{,devices,devices/net,devices/pts,devices/shm,devices/hugepages} mkdir -p $RPM_BUILD_ROOT%{_datadir}/udev -install -m 0755 %{SOURCE1} $RPM_BUILD_ROOT/sbin/start_udev mkdir -p -m 0755 $RPM_BUILD_ROOT%{firmwaredir} @@ -288,7 +287,6 @@ rm -rf $RPM_BUILD_ROOT %attr(0644,root,root) %{_prefix}/lib/ConsoleKit/run-seat.d/udev-acl.ck %{_datadir}/pkgconfig/udev.pc -%attr(0755,root,root) /sbin/start_udev %attr(0644,root,root) %{systemdsystemunitdir}/udev-settle.service %attr(0644,root,root) %{systemdsystemunitdir}/udev-trigger.service %attr(0644,root,root) %{systemdsystemunitdir}/udev.service From f9e3401ad50172630d7d400f6026ecfa5ffe2d03 Mon Sep 17 00:00:00 2001 From: Harald Hoyer Date: Fri, 27 May 2011 11:18:48 +0200 Subject: [PATCH 112/142] version 171 --- .gitignore | 1 + sources | 2 +- udev.spec | 15 ++++++++++----- 3 files changed, 12 insertions(+), 6 deletions(-) diff --git a/.gitignore b/.gitignore index 465b6ed..c4bbefe 100644 --- a/.gitignore +++ b/.gitignore @@ -5,3 +5,4 @@ udev-160.tar.bz2 /udev-166.tar.bz2.sign /udev-167.tar.bz2 /udev-170.tar.bz2 +/udev-171.tar.bz2 diff --git a/sources b/sources index 5395054..e1aa70f 100644 --- a/sources +++ b/sources @@ -1 +1 @@ -6e132d1a3b4dae24dafd2726c5cdd982 udev-170.tar.bz2 +bdf4617284be2ecac11767437417e209 udev-171.tar.bz2 diff --git a/udev.spec b/udev.spec index 6180f87..4a14c08 100644 --- a/udev.spec +++ b/udev.spec @@ -6,7 +6,7 @@ Summary: A rule-based device node and kernel event manager Name: udev -Version: 170 +Version: 171 Release: 1%{?dist} License: GPLv2+ Group: System Environment/Base @@ -23,7 +23,7 @@ Requires(pre): /usr/bin/getent /usr/sbin/groupadd Requires: hwdata Requires: systemd-units Requires: pkgconfig -Conflicts: systemd < 25 +Conflicts: systemd < 28 %ifarch s390 s390x # Require s390utils-base, because it's essential on s390 @@ -193,7 +193,7 @@ getent group tape >/dev/null || /usr/sbin/groupadd -g 33 tape || : getent group dialout >/dev/null || /usr/sbin/groupadd -g 18 dialout || : getent group floppy >/dev/null || /usr/sbin/groupadd -g 19 floppy || : -if ! /bin/systemctl stop udev.service udev.socket >/dev/null 2>&1; then +if ! /bin/systemctl stop udev.service udev-control.socket udev-kernel.socket >/dev/null 2>&1; then # kill daemon if we are not in a chroot if test -f /proc/1/exe -a -d /proc/1/root; then if test -x /usr/bin/stat -a \ @@ -290,10 +290,12 @@ rm -rf $RPM_BUILD_ROOT %attr(0644,root,root) %{systemdsystemunitdir}/udev-settle.service %attr(0644,root,root) %{systemdsystemunitdir}/udev-trigger.service %attr(0644,root,root) %{systemdsystemunitdir}/udev.service -%attr(0644,root,root) %{systemdsystemunitdir}/udev.socket +%attr(0644,root,root) %{systemdsystemunitdir}/udev-kernel.socket +%attr(0644,root,root) %{systemdsystemunitdir}/udev-control.socket %{systemdsystemunitdir}/basic.target.wants/udev.service %{systemdsystemunitdir}/basic.target.wants/udev-trigger.service -%{systemdsystemunitdir}/sockets.target.wants/udev.socket +%{systemdsystemunitdir}/sockets.target.wants/udev-control.socket +%{systemdsystemunitdir}/sockets.target.wants/udev-kernel.socket # Deprecated, but keep the ownership %ghost %dir /var/lib/udev @@ -334,6 +336,9 @@ rm -rf $RPM_BUILD_ROOT %attr(0644,root,root) %{_libdir}/pkgconfig/gudev-1.0* %changelog +* Fri May 27 2011 Harald Hoyer 171-1 +- version 171 + * Fri May 20 2011 Harald Hoyer 170-1 - version 170 - removed /sbin/start_udev From 3643fbe9e58d2f561ad1350df0f9f2c540f96a0b Mon Sep 17 00:00:00 2001 From: Harald Hoyer Date: Mon, 20 Jun 2011 10:22:00 +0200 Subject: [PATCH 113/142] udev.spec: remove introspection and unneeded dirs --- udev.spec | 6 ------ 1 file changed, 6 deletions(-) diff --git a/udev.spec b/udev.spec index 4a14c08..f8434dd 100644 --- a/udev.spec +++ b/udev.spec @@ -124,7 +124,6 @@ libtoolize -f -c --sysconfdir=%{_sysconfdir} \ --sbindir="/sbin" --libexecdir=%{udev_scriptdir} \ --with-rootlibdir=/%{_lib} \ - --enable-introspection \ --with-systemdsystemunitdir=%{systemdsystemunitdir} \ --enable-floppy \ --enable-edd \ @@ -165,14 +164,9 @@ for i in \ install -m 0644 "$i" "$RPM_BUILD_ROOT%{udev_scriptdir}/rules.d/${i##*/}" done -mkdir -p $RPM_BUILD_ROOT%{udev_scriptdir}/{,devices,devices/net,devices/pts,devices/shm,devices/hugepages} - mkdir -p $RPM_BUILD_ROOT%{_datadir}/udev - mkdir -p -m 0755 $RPM_BUILD_ROOT%{firmwaredir} -mkdir -p $RPM_BUILD_ROOT%{_sysconfdir}/rc.d/init.d - %preun if [ "$1" -eq 0 -a -f %{_initrddir}/udev ]; then if test -x /usr/bin/stat -a \ From 2443122e5f429f84e19a679d7ad0ead3b51f982d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ville=20Skytt=C3=A4?= Date: Mon, 20 Jun 2011 10:23:17 +0200 Subject: [PATCH 114/142] udev.spec: own the ConsoleKit and ConsoleKit/run-seat.d dirs If udev does not actually require ConsoleKit, the dependency should not be added just for dir ownership, instead the dirs should be owned in udev which is what the patch does. http://fedoraproject.org/wiki/Packaging/Guidelines#File_and_Directory_Ownership https://bugzilla.redhat.com/show_bug.cgi?id=710781 --- udev.spec | 2 ++ 1 file changed, 2 insertions(+) diff --git a/udev.spec b/udev.spec index f8434dd..4c85464 100644 --- a/udev.spec +++ b/udev.spec @@ -278,6 +278,8 @@ rm -rf $RPM_BUILD_ROOT %attr(0755,root,root) %{udev_scriptdir}/findkeyboards %dir %{udev_scriptdir}/keymaps %{udev_scriptdir}/keymaps/* +%dir %{_prefix}/lib/ConsoleKit +%dir %{_prefix}/lib/ConsoleKit/run-seat.d %attr(0644,root,root) %{_prefix}/lib/ConsoleKit/run-seat.d/udev-acl.ck %{_datadir}/pkgconfig/udev.pc From 27c9ba33fe09b996c7c7fda3bba9282b9190a07c Mon Sep 17 00:00:00 2001 From: Harald Hoyer Date: Mon, 20 Jun 2011 10:27:09 +0200 Subject: [PATCH 115/142] build without introspection removed unused dirs added ConsoleKit dirs --- udev.spec | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/udev.spec b/udev.spec index 4c85464..90b58b7 100644 --- a/udev.spec +++ b/udev.spec @@ -7,7 +7,7 @@ Summary: A rule-based device node and kernel event manager Name: udev Version: 171 -Release: 1%{?dist} +Release: 2%{?dist} License: GPLv2+ Group: System Environment/Base Provides: udev-persistent = %{version}-%{release} @@ -332,6 +332,11 @@ rm -rf $RPM_BUILD_ROOT %attr(0644,root,root) %{_libdir}/pkgconfig/gudev-1.0* %changelog +* Mon Jun 20 2011 Harald Hoyer 171-2 +- build without introspection +- removed unused dirs +- added ConsoleKit dirs + * Fri May 27 2011 Harald Hoyer 171-1 - version 171 From 0c6edc1da227453b89d470ca5789565fd8b3e158 Mon Sep 17 00:00:00 2001 From: Harald Hoyer Date: Mon, 11 Jul 2011 15:12:16 +0200 Subject: [PATCH 116/142] version 172 --- .gitignore | 1 + sources | 2 +- udev.spec | 14 +++++++------- 3 files changed, 9 insertions(+), 8 deletions(-) diff --git a/.gitignore b/.gitignore index c4bbefe..9febfe1 100644 --- a/.gitignore +++ b/.gitignore @@ -6,3 +6,4 @@ udev-160.tar.bz2 /udev-167.tar.bz2 /udev-170.tar.bz2 /udev-171.tar.bz2 +/udev-172.tar.bz2 diff --git a/sources b/sources index e1aa70f..cee2704 100644 --- a/sources +++ b/sources @@ -1 +1 @@ -bdf4617284be2ecac11767437417e209 udev-171.tar.bz2 +bd122d04cf758441f498aad0169a454f udev-172.tar.bz2 diff --git a/udev.spec b/udev.spec index 90b58b7..84faac5 100644 --- a/udev.spec +++ b/udev.spec @@ -6,8 +6,8 @@ Summary: A rule-based device node and kernel event manager Name: udev -Version: 171 -Release: 2%{?dist} +Version: 172 +Release: 1%{?dist} License: GPLv2+ Group: System Environment/Base Provides: udev-persistent = %{version}-%{release} @@ -125,9 +125,7 @@ libtoolize -f -c --sbindir="/sbin" --libexecdir=%{udev_scriptdir} \ --with-rootlibdir=/%{_lib} \ --with-systemdsystemunitdir=%{systemdsystemunitdir} \ - --enable-floppy \ - --enable-edd \ - --enable-action_modeswitch + --enable-floppy make %{?_smp_mflags} @@ -231,7 +229,6 @@ rm -rf $RPM_BUILD_ROOT %attr(0755,root,root) /sbin/scsi_id %attr(0755,root,root) %{udev_scriptdir}/scsi_id %attr(0755,root,root) %{udev_scriptdir}/ata_id -%attr(0755,root,root) %{udev_scriptdir}/edd_id %attr(0755,root,root) %{udev_scriptdir}/usb_id %attr(0755,root,root) %{udev_scriptdir}/cdrom_id %attr(0755,root,root) %{udev_scriptdir}/path_id @@ -244,6 +241,7 @@ rm -rf $RPM_BUILD_ROOT %attr(0755,root,root) %{udev_scriptdir}/input_id %attr(0755,root,root) %{udev_scriptdir}/keyboard-force-release.sh %attr(0755,root,root) %{udev_scriptdir}/mtd_probe +%attr(0755,root,root) %{udev_scriptdir}/accelerometer %attr(0755,root,root) %dir %{udev_scriptdir}/rules.d/ %attr(0755,root,root) %dir %{_sysconfdir}/udev/ @@ -269,7 +267,6 @@ rm -rf $RPM_BUILD_ROOT %attr(0644,root,root) %{_mandir}/man7/udev*.7* %attr(0644,root,root) %{_mandir}/man8/scsi_id*.8* -%attr(0755,root,root) %{udev_scriptdir}/mobile-action-modeswitch %attr(0755,root,root) %{udev_scriptdir}/pci-db %attr(0755,root,root) %{udev_scriptdir}/usb-db %attr(0755,root,root) %{udev_scriptdir}/keymap @@ -332,6 +329,9 @@ rm -rf $RPM_BUILD_ROOT %attr(0644,root,root) %{_libdir}/pkgconfig/gudev-1.0* %changelog +* Mon Jul 11 2011 Harald Hoyer 172-1 +- version 172 + * Mon Jun 20 2011 Harald Hoyer 171-2 - build without introspection - removed unused dirs From c48bf88aeae0c89a23f1220dd3424c2082f4e7b1 Mon Sep 17 00:00:00 2001 From: Harald Hoyer Date: Wed, 20 Jul 2011 13:29:29 +0200 Subject: [PATCH 117/142] removed loop devices (should be compiled in the kernel) --- udev.spec | 13 ++++--------- 1 file changed, 4 insertions(+), 9 deletions(-) diff --git a/udev.spec b/udev.spec index 84faac5..bc31d9a 100644 --- a/udev.spec +++ b/udev.spec @@ -7,7 +7,7 @@ Summary: A rule-based device node and kernel event manager Name: udev Version: 172 -Release: 1%{?dist} +Release: 2%{?dist} License: GPLv2+ Group: System Environment/Base Provides: udev-persistent = %{version}-%{release} @@ -248,14 +248,6 @@ rm -rf $RPM_BUILD_ROOT %attr(0755,root,root) %dir %{_sysconfdir}/udev/rules.d/ %attr(0755,root,root) %dir %{udev_scriptdir}/ %attr(0755,root,root) %dir %{udev_scriptdir}/devices/ -%attr(640,root,disk) %dev(b,7,0) %{udev_scriptdir}/devices/loop0 -%attr(640,root,disk) %dev(b,7,1) %{udev_scriptdir}/devices/loop1 -%attr(640,root,disk) %dev(b,7,2) %{udev_scriptdir}/devices/loop2 -%attr(640,root,disk) %dev(b,7,3) %{udev_scriptdir}/devices/loop3 -%attr(640,root,disk) %dev(b,7,4) %{udev_scriptdir}/devices/loop4 -%attr(640,root,disk) %dev(b,7,5) %{udev_scriptdir}/devices/loop5 -%attr(640,root,disk) %dev(b,7,6) %{udev_scriptdir}/devices/loop6 -%attr(640,root,disk) %dev(b,7,7) %{udev_scriptdir}/devices/loop7 %config(noreplace) %attr(0644,root,root) %{_sysconfdir}/udev/udev.conf %attr(0644,root,root) %{udev_scriptdir}/rules.d/*.rules @@ -329,6 +321,9 @@ rm -rf $RPM_BUILD_ROOT %attr(0644,root,root) %{_libdir}/pkgconfig/gudev-1.0* %changelog +* Wed Jul 20 2011 Harald Hoyer 172-2 +- removed loop devices (should be compiled in the kernel) + * Mon Jul 11 2011 Harald Hoyer 172-1 - version 172 From 6ae88f0d846a67e8834570ac67e1baa47ac905f6 Mon Sep 17 00:00:00 2001 From: Harald Hoyer Date: Wed, 20 Jul 2011 13:50:03 +0200 Subject: [PATCH 118/142] removed loop devices (should be compiled in the kernel) removed deprecated directories --- udev.spec | 11 ++--------- 1 file changed, 2 insertions(+), 9 deletions(-) diff --git a/udev.spec b/udev.spec index bc31d9a..40ba7c7 100644 --- a/udev.spec +++ b/udev.spec @@ -1,7 +1,5 @@ -%define debug true %define udev_scriptdir /lib/udev %define firmwaredir /lib/firmware - %define systemdsystemunitdir /lib/systemd/system Summary: A rule-based device node and kernel event manager @@ -140,10 +138,8 @@ rm -fr $RPM_BUILD_ROOT%{_docdir}/udev rm -f $RPM_BUILD_ROOT/%{_libdir}/*.la # Deprecated, but keep the ownership -mkdir -p $RPM_BUILD_ROOT%{_sysconfdir}/udev/{rules.d,scripts,devices} -mkdir -p $RPM_BUILD_ROOT%{_sysconfdir}/dev.d +mkdir -p $RPM_BUILD_ROOT%{_sysconfdir}/udev/{rules.d,devices} mkdir -p $RPM_BUILD_ROOT%{_bindir} -touch $RPM_BUILD_ROOT%{_sysconfdir}/scsi_id.config # force relative symlinks ln -sf ..%{udev_scriptdir}/scsi_id $RPM_BUILD_ROOT/sbin/scsi_id @@ -283,11 +279,7 @@ rm -rf $RPM_BUILD_ROOT %{systemdsystemunitdir}/sockets.target.wants/udev-kernel.socket # Deprecated, but keep the ownership -%ghost %dir /var/lib/udev -%ghost %dir %{_sysconfdir}/udev/scripts/ %ghost %dir %{_sysconfdir}/udev/devices/ -%ghost %dir %{_sysconfdir}/dev.d/ -%ghost %dir %{_sysconfdir}/udev/makedev.d/ %files -n libudev %defattr(0644, root, root, 0755) @@ -323,6 +315,7 @@ rm -rf $RPM_BUILD_ROOT %changelog * Wed Jul 20 2011 Harald Hoyer 172-2 - removed loop devices (should be compiled in the kernel) +- removed deprecated directories * Mon Jul 11 2011 Harald Hoyer 172-1 - version 172 From c28cf5922cc6d9b2978e28d49509f3a1ba68cf61 Mon Sep 17 00:00:00 2001 From: Harald Hoyer Date: Wed, 20 Jul 2011 13:58:40 +0200 Subject: [PATCH 119/142] removed loop devices (should be compiled in the kernel) removed deprecated directories removed scsi_id symlink cleanup of requirements --- udev.spec | 24 ++++++++++-------------- 1 file changed, 10 insertions(+), 14 deletions(-) diff --git a/udev.spec b/udev.spec index 40ba7c7..1bf02ec 100644 --- a/udev.spec +++ b/udev.spec @@ -15,8 +15,8 @@ Source: ftp://ftp.kernel.org/pub/linux/utils/kernel/hotplug/%{name}-%{version}.t ExclusiveOS: Linux URL: http://www.kernel.org/pub/linux/utils/kernel/hotplug/udev.html BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n) -Requires(pre): /bin/sh fileutils /sbin/chkconfig /sbin/service -Requires(pre): /usr/bin/stat /sbin/pidof +Requires(pre): /bin/sh fileutils +Requires(pre): /usr/bin/stat Requires(pre): /usr/bin/getent /usr/sbin/groupadd Requires: hwdata Requires: systemd-units @@ -28,18 +28,18 @@ Conflicts: systemd < 28 Requires: s390utils-base %endif -BuildRequires: sed libselinux-devel >= 0:1.17.9-2 flex libsepol-devel -BuildRequires: glib2-devel bison findutils +BuildRequires: sed libselinux-devel >= 0:1.17.9-2 libsepol-devel +BuildRequires: glib2-devel findutils BuildRequires: gperf libtool -BuildRequires: libusb-devel libacl-devel +BuildRequires: libacl-devel BuildRequires: hwdata BuildRequires: gobject-introspection-devel >= 0.6.2 BuildRequires: usbutils >= 0.82 BuildRequires: libtool >= 2.2.6 BuildRequires: pkgconfig Requires: libselinux >= 0:1.17.9-2 sed -Conflicts: kernel < 0:2.6 mkinitrd <= 0:4.1.11-1 initscripts < 7.84 -Requires: util-linux-ng >= 2.15.1 +Conflicts: kernel < 0:2.6 +Requires: util-linux >= 2.15.1 Obsoletes: dev <= 0:3.12-1 Provides: dev = 0:3.12-2 # hid2hci moved to udev @@ -141,9 +141,6 @@ rm -f $RPM_BUILD_ROOT/%{_libdir}/*.la mkdir -p $RPM_BUILD_ROOT%{_sysconfdir}/udev/{rules.d,devices} mkdir -p $RPM_BUILD_ROOT%{_bindir} -# force relative symlinks -ln -sf ..%{udev_scriptdir}/scsi_id $RPM_BUILD_ROOT/sbin/scsi_id - for i in \ %ifarch ia64 rules/arch/40-ia64.rules \ @@ -222,8 +219,6 @@ rm -rf $RPM_BUILD_ROOT %doc NEWS COPYING README TODO ChangeLog extras/keymap/README.keymap.txt %attr(0755,root,root) /sbin/udevadm %attr(0755,root,root) /sbin/udevd -%attr(0755,root,root) /sbin/scsi_id -%attr(0755,root,root) %{udev_scriptdir}/scsi_id %attr(0755,root,root) %{udev_scriptdir}/ata_id %attr(0755,root,root) %{udev_scriptdir}/usb_id %attr(0755,root,root) %{udev_scriptdir}/cdrom_id @@ -248,13 +243,12 @@ rm -rf $RPM_BUILD_ROOT %config(noreplace) %attr(0644,root,root) %{_sysconfdir}/udev/udev.conf %attr(0644,root,root) %{udev_scriptdir}/rules.d/*.rules -%ghost %config(noreplace,missingok) %attr(0644,root,root) %{_sysconfdir}/scsi_id.config - %dir %attr(0755,root,root) %{firmwaredir} %attr(0644,root,root) %{_mandir}/man8/udev*.8* %attr(0644,root,root) %{_mandir}/man7/udev*.7* %attr(0644,root,root) %{_mandir}/man8/scsi_id*.8* +%attr(0755,root,root) %{udev_scriptdir}/scsi_id %attr(0755,root,root) %{udev_scriptdir}/pci-db %attr(0755,root,root) %{udev_scriptdir}/usb-db %attr(0755,root,root) %{udev_scriptdir}/keymap @@ -316,6 +310,8 @@ rm -rf $RPM_BUILD_ROOT * Wed Jul 20 2011 Harald Hoyer 172-2 - removed loop devices (should be compiled in the kernel) - removed deprecated directories +- removed scsi_id symlink +- cleanup of requirements * Mon Jul 11 2011 Harald Hoyer 172-1 - version 172 From 08ec76712b2cceddbbeecab60437a76f0b70d2f5 Mon Sep 17 00:00:00 2001 From: Harald Hoyer Date: Mon, 1 Aug 2011 13:21:13 +0200 Subject: [PATCH 120/142] version 173 udev-acl functionality is in systemd --- .gitignore | 1 + sources | 2 +- udev.spec | 15 +++++++-------- 3 files changed, 9 insertions(+), 9 deletions(-) diff --git a/.gitignore b/.gitignore index 9febfe1..26a7948 100644 --- a/.gitignore +++ b/.gitignore @@ -7,3 +7,4 @@ udev-160.tar.bz2 /udev-170.tar.bz2 /udev-171.tar.bz2 /udev-172.tar.bz2 +/udev-173.tar.bz2 diff --git a/sources b/sources index cee2704..cba6520 100644 --- a/sources +++ b/sources @@ -1 +1 @@ -bd122d04cf758441f498aad0169a454f udev-172.tar.bz2 +91a88a359b60bbd074b024883cc0dbde udev-173.tar.bz2 diff --git a/udev.spec b/udev.spec index 1bf02ec..e026339 100644 --- a/udev.spec +++ b/udev.spec @@ -4,8 +4,8 @@ Summary: A rule-based device node and kernel event manager Name: udev -Version: 172 -Release: 2%{?dist} +Version: 173 +Release: 1%{?dist} License: GPLv2+ Group: System Environment/Base Provides: udev-persistent = %{version}-%{release} @@ -21,7 +21,7 @@ Requires(pre): /usr/bin/getent /usr/sbin/groupadd Requires: hwdata Requires: systemd-units Requires: pkgconfig -Conflicts: systemd < 28 +Conflicts: systemd < 32 %ifarch s390 s390x # Require s390utils-base, because it's essential on s390 @@ -31,7 +31,6 @@ Requires: s390utils-base BuildRequires: sed libselinux-devel >= 0:1.17.9-2 libsepol-devel BuildRequires: glib2-devel findutils BuildRequires: gperf libtool -BuildRequires: libacl-devel BuildRequires: hwdata BuildRequires: gobject-introspection-devel >= 0.6.2 BuildRequires: usbutils >= 0.82 @@ -252,14 +251,10 @@ rm -rf $RPM_BUILD_ROOT %attr(0755,root,root) %{udev_scriptdir}/pci-db %attr(0755,root,root) %{udev_scriptdir}/usb-db %attr(0755,root,root) %{udev_scriptdir}/keymap -%attr(0755,root,root) %{udev_scriptdir}/udev-acl %attr(0755,root,root) %{udev_scriptdir}/v4l_id %attr(0755,root,root) %{udev_scriptdir}/findkeyboards %dir %{udev_scriptdir}/keymaps %{udev_scriptdir}/keymaps/* -%dir %{_prefix}/lib/ConsoleKit -%dir %{_prefix}/lib/ConsoleKit/run-seat.d -%attr(0644,root,root) %{_prefix}/lib/ConsoleKit/run-seat.d/udev-acl.ck %{_datadir}/pkgconfig/udev.pc %attr(0644,root,root) %{systemdsystemunitdir}/udev-settle.service @@ -307,6 +302,10 @@ rm -rf $RPM_BUILD_ROOT %attr(0644,root,root) %{_libdir}/pkgconfig/gudev-1.0* %changelog +* Mon Aug 01 2011 Harald Hoyer 173-1 +- version 173 +- udev-acl functionality is in systemd + * Wed Jul 20 2011 Harald Hoyer 172-2 - removed loop devices (should be compiled in the kernel) - removed deprecated directories From 5fd2aaff27c2c868222011a94f2019f4bb2648fa Mon Sep 17 00:00:00 2001 From: Daniel Drake Date: Mon, 29 Aug 2011 09:10:39 +0100 Subject: [PATCH 121/142] Update OLPC XO keymap --- udev-olpc-keymap-update.patch | 65 +++++++++++++++++++++++++++++++++++ udev.spec | 8 ++++- 2 files changed, 72 insertions(+), 1 deletion(-) create mode 100644 udev-olpc-keymap-update.patch diff --git a/udev-olpc-keymap-update.patch b/udev-olpc-keymap-update.patch new file mode 100644 index 0000000..f1bbecf --- /dev/null +++ b/udev-olpc-keymap-update.patch @@ -0,0 +1,65 @@ +From 00fc377e7a6b1997db346c8de51cbf05cad48376 Mon Sep 17 00:00:00 2001 +From: Paul Fox +Date: Mon, 22 Aug 2011 06:39:06 +0200 +Subject: [PATCH] keymap: update the OLPC keymap for correct function key + behavior + +New mappings were needed when the mechanical keyboard was +introduced, and GNOME was made a peer to the sugar desktop. +see http://lists.laptop.org/pipermail/devel/2010-July/029384.html +--- + extras/keymap/keymaps/olpc-xo | 38 ++++++++++++++++++++++++++------------ + 1 files changed, 26 insertions(+), 12 deletions(-) + +diff --git a/extras/keymap/keymaps/olpc-xo b/extras/keymap/keymaps/olpc-xo +index 7fe0662..34434a1 100644 +--- a/extras/keymap/keymaps/olpc-xo ++++ b/extras/keymap/keymaps/olpc-xo +@@ -2,18 +2,32 @@ + 0x81 fn_esc + 0xF9 camera + 0xF8 sound # Fn-CAMERA = Mic +-0xBB fn_f1 +-0xBC fn_f2 +-0xBD fn_f3 +-0xBE fn_f4 +-0xBF fn_f5 +-0xC0 fn_f6 +-0xC1 fn_f7 +-0xC2 fn_f8 +-0xC3 fn_f9 +-0xC4 fn_f10 +-0xD7 fn_f11 +-0xD8 fn_f12 ++ ++ ++# Function key mappings, as per ++# http://dev.laptop.org/ticket/10213#comment:20 ++# ++# Unmodified F1-F8 produce F1-F8, so no remap necessary. ++# Unmodified F9-F12 control brightness and volume. ++0x43 brightnessdown ++0x44 brightnessup ++0x57 volumedown ++0x58 volumeup ++ ++# fn-modified fkeys all produce the unmodified version of the key. ++0xBB f1 ++0xBC f2 ++0xBD f3 ++0xBE f4 ++0xBF f5 ++0xC0 f6 ++0xC1 f7 ++0xC2 f8 ++0xC3 f9 ++0xC4 f10 ++0xD7 f11 ++0xD8 f12 ++ + + # Using F13-F21 for the .5 F keys right now. + 0xF7 f13 +-- +1.7.4.4 + diff --git a/udev.spec b/udev.spec index e026339..598dcf2 100644 --- a/udev.spec +++ b/udev.spec @@ -5,13 +5,15 @@ Summary: A rule-based device node and kernel event manager Name: udev Version: 173 -Release: 1%{?dist} +Release: 2%{?dist} License: GPLv2+ Group: System Environment/Base Provides: udev-persistent = %{version}-%{release} Obsoletes: udev-persistent < 0:030-5 Source: ftp://ftp.kernel.org/pub/linux/utils/kernel/hotplug/%{name}-%{version}.tar.bz2 +Patch1: udev-olpc-keymap-update.patch + ExclusiveOS: Linux URL: http://www.kernel.org/pub/linux/utils/kernel/hotplug/udev.html BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n) @@ -105,6 +107,7 @@ glib-based applications using libudev functionality. %prep %setup -q +%patch1 -p1 %build # prevent man pages from re-building (xmlto) @@ -302,6 +305,9 @@ rm -rf $RPM_BUILD_ROOT %attr(0644,root,root) %{_libdir}/pkgconfig/gudev-1.0* %changelog +* Mon Aug 29 2011 Daniel Drake 173-2 +- Update OLPC XO keymap + * Mon Aug 01 2011 Harald Hoyer 173-1 - version 173 - udev-acl functionality is in systemd From 2618aa966eb7b47967048fc8e582a79bd7f3faa5 Mon Sep 17 00:00:00 2001 From: Kay Sievers Date: Wed, 19 Oct 2011 21:22:11 +0200 Subject: [PATCH 122/142] version 174 --- .gitignore | 11 +- sources | 2 +- udev-olpc-keymap-update.patch | 65 -------- udev.spec | 277 ++++++++++++---------------------- 4 files changed, 95 insertions(+), 260 deletions(-) delete mode 100644 udev-olpc-keymap-update.patch diff --git a/.gitignore b/.gitignore index 26a7948..aaa1534 100644 --- a/.gitignore +++ b/.gitignore @@ -1,10 +1 @@ -udev-160.tar.bz2 -/udev-164.tar.bz2 -/udev-164.tar.bz2.sign -/udev-166.tar.bz2 -/udev-166.tar.bz2.sign -/udev-167.tar.bz2 -/udev-170.tar.bz2 -/udev-171.tar.bz2 -/udev-172.tar.bz2 -/udev-173.tar.bz2 +/udev-174.tar.bz2 diff --git a/sources b/sources index cba6520..5e58980 100644 --- a/sources +++ b/sources @@ -1 +1 @@ -91a88a359b60bbd074b024883cc0dbde udev-173.tar.bz2 +3b84706046a33d7a7e00491a1136804d udev-174.tar.bz2 diff --git a/udev-olpc-keymap-update.patch b/udev-olpc-keymap-update.patch deleted file mode 100644 index f1bbecf..0000000 --- a/udev-olpc-keymap-update.patch +++ /dev/null @@ -1,65 +0,0 @@ -From 00fc377e7a6b1997db346c8de51cbf05cad48376 Mon Sep 17 00:00:00 2001 -From: Paul Fox -Date: Mon, 22 Aug 2011 06:39:06 +0200 -Subject: [PATCH] keymap: update the OLPC keymap for correct function key - behavior - -New mappings were needed when the mechanical keyboard was -introduced, and GNOME was made a peer to the sugar desktop. -see http://lists.laptop.org/pipermail/devel/2010-July/029384.html ---- - extras/keymap/keymaps/olpc-xo | 38 ++++++++++++++++++++++++++------------ - 1 files changed, 26 insertions(+), 12 deletions(-) - -diff --git a/extras/keymap/keymaps/olpc-xo b/extras/keymap/keymaps/olpc-xo -index 7fe0662..34434a1 100644 ---- a/extras/keymap/keymaps/olpc-xo -+++ b/extras/keymap/keymaps/olpc-xo -@@ -2,18 +2,32 @@ - 0x81 fn_esc - 0xF9 camera - 0xF8 sound # Fn-CAMERA = Mic --0xBB fn_f1 --0xBC fn_f2 --0xBD fn_f3 --0xBE fn_f4 --0xBF fn_f5 --0xC0 fn_f6 --0xC1 fn_f7 --0xC2 fn_f8 --0xC3 fn_f9 --0xC4 fn_f10 --0xD7 fn_f11 --0xD8 fn_f12 -+ -+ -+# Function key mappings, as per -+# http://dev.laptop.org/ticket/10213#comment:20 -+# -+# Unmodified F1-F8 produce F1-F8, so no remap necessary. -+# Unmodified F9-F12 control brightness and volume. -+0x43 brightnessdown -+0x44 brightnessup -+0x57 volumedown -+0x58 volumeup -+ -+# fn-modified fkeys all produce the unmodified version of the key. -+0xBB f1 -+0xBC f2 -+0xBD f3 -+0xBE f4 -+0xBF f5 -+0xC0 f6 -+0xC1 f7 -+0xC2 f8 -+0xC3 f9 -+0xC4 f10 -+0xD7 f11 -+0xD8 f12 -+ - - # Using F13-F21 for the .5 F keys right now. - 0xF7 f13 --- -1.7.4.4 - diff --git a/udev.spec b/udev.spec index 598dcf2..15e136a 100644 --- a/udev.spec +++ b/udev.spec @@ -1,52 +1,36 @@ -%define udev_scriptdir /lib/udev -%define firmwaredir /lib/firmware -%define systemdsystemunitdir /lib/systemd/system - -Summary: A rule-based device node and kernel event manager -Name: udev -Version: 173 -Release: 2%{?dist} -License: GPLv2+ -Group: System Environment/Base -Provides: udev-persistent = %{version}-%{release} -Obsoletes: udev-persistent < 0:030-5 -Source: ftp://ftp.kernel.org/pub/linux/utils/kernel/hotplug/%{name}-%{version}.tar.bz2 - -Patch1: udev-olpc-keymap-update.patch - -ExclusiveOS: Linux -URL: http://www.kernel.org/pub/linux/utils/kernel/hotplug/udev.html -BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n) -Requires(pre): /bin/sh fileutils -Requires(pre): /usr/bin/stat -Requires(pre): /usr/bin/getent /usr/sbin/groupadd -Requires: hwdata -Requires: systemd-units -Requires: pkgconfig -Conflicts: systemd < 32 +Summary: A rule-based device node and kernel event manager +Name: udev +Version: 174 +Release: 1%{?dist} +License: GPLv2+ +Group: System Environment/Base +Source: ftp://ftp.kernel.org/pub/linux/utils/kernel/hotplug/%{name}-%{version}.tar.bz2 +URL: http://www.kernel.org/pub/linux/utils/kernel/hotplug/udev.html +BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n) +BuildRequires: libtool +BuildRequires: pkgconfig +BuildRequires: gperf +BuildRequires: libselinux-devel libsepol-devel +BuildRequires: glib2-devel +BuildRequires: hwdata +BuildRequires: gobject-introspection-devel >= 0.6.2 +BuildRequires: usbutils >= 0.82 +Obsoletes: dev <= 0:3.12-1 +Provides: dev = 0:3.12-2 +Requires(pre): fileutils +Requires(pre): /usr/bin/getent /usr/sbin/groupadd +Requires: hwdata +Requires: systemd-units +Requires: pkgconfig +Requires: util-linux >= 2.15.1 +Conflicts: systemd < 37 +Conflicts: dracut < 013-85.git20111019 %ifarch s390 s390x # Require s390utils-base, because it's essential on s390 -Requires: s390utils-base +Requires: s390utils-base %endif -BuildRequires: sed libselinux-devel >= 0:1.17.9-2 libsepol-devel -BuildRequires: glib2-devel findutils -BuildRequires: gperf libtool -BuildRequires: hwdata -BuildRequires: gobject-introspection-devel >= 0.6.2 -BuildRequires: usbutils >= 0.82 -BuildRequires: libtool >= 2.2.6 -BuildRequires: pkgconfig -Requires: libselinux >= 0:1.17.9-2 sed -Conflicts: kernel < 0:2.6 -Requires: util-linux >= 2.15.1 -Obsoletes: dev <= 0:3.12-1 -Provides: dev = 0:3.12-2 -# hid2hci moved to udev -Conflicts: bluez < 4.47 -Requires: libudev = %{version}-%{release} - %description udev is a collection of tools and a daemon to manage events received from the kernel and deal with them in user-space. Primarily this @@ -55,94 +39,70 @@ symlinks to device nodes in /dev when hardware is discovered or removed from the system. %package -n libudev -Summary: Dynamic library to access udev device information -Group: System Environment/Libraries -Obsoletes: libudev0 <= 142 -Provides: libudev0 = 143 -License: LGPLv2+ +Summary: Dynamic library to access udev device information +Group: System Environment/Libraries +Requires: udev = %{version}-%{release} +License: LGPLv2+ %description -n libudev This package contains the dynamic library libudev, which provides access to udev device information, and an interface to search devices in sysfs. %package -n libudev-devel -Summary: Development files for libudev -Group: Development/Libraries -Requires: udev = %{version}-%{release} -Requires: libudev = %{version}-%{release} -Requires: pkgconfig -License: LGPLv2+ +Summary: Development files for libudev +Group: Development/Libraries +Requires: libudev = %{version}-%{release} +Requires: pkgconfig +License: LGPLv2+ %description -n libudev-devel This package contains the development files for the library libudev, a dynamic library, which provides access to udev device information. %package -n libgudev1 -Summary: Libraries for adding libudev support to applications that use glib -Group: Development/Libraries -Requires: libudev >= 142 -# remove the following lines for libgudev so major 1 -Provides: libgudev = 20090518 -Obsoletes: libgudev <= 20090517 -License: LGPLv2+ +Summary: Libraries for adding libudev support to applications that use glib +Group: Development/Libraries +Requires: libudev = %{version}-%{release} +License: LGPLv2+ %description -n libgudev1 This package contains the libraries that make it easier to use libudev functionality from applications that use glib. %package -n libgudev1-devel -Summary: Header files for adding libudev support to applications that use glib -Group: Development/Libraries -Requires: libudev-devel >= 142 -Provides: libgudev-devel = 20090518 -Obsoletes: libgudev-devel <= 20090517 -Requires: pkgconfig -License: LGPLv2+ - -Requires: libgudev1 = %{version}-%{release} +Summary: Header files for adding libudev support to applications that use glib +Group: Development/Libraries +Requires: libgudev1 = %{version}-%{release} +License: LGPLv2+ %description -n libgudev1-devel This package contains the header and pkg-config files for developing glib-based applications using libudev functionality. -%prep -%setup -q -%patch1 -p1 +%prep +%setup -q %build # prevent man pages from re-building (xmlto) find . -name "*.[1-8]" -exec touch '{}' \; - export CFLAGS="$CFLAGS $RPM_OPT_FLAGS -fPIE -DPIE -pie -Wl,-z,relro -Wl,-z,now" - -# prevent man pages from re-building (xmlto) -find . -name "*.[1-8]" -exec touch '{}' \; export V=1 - -libtoolize -f -c -%configure --with-selinux --prefix=%{_prefix} --exec-prefix="" \ - --sysconfdir=%{_sysconfdir} \ - --sbindir="/sbin" --libexecdir=%{udev_scriptdir} \ - --with-rootlibdir=/%{_lib} \ - --with-systemdsystemunitdir=%{systemdsystemunitdir} \ - --enable-floppy - +%configure \ + --prefix=%{_prefix} \ + --sysconfdir=%{_sysconfdir} \ + --sbindir=/sbin \ + --libexecdir=/lib/udev \ + --with-rootlibdir=/%{_lib} \ + --with-selinux \ + --with-systemdsystemunitdir=/lib/systemd/system \ + --enable-floppy make %{?_smp_mflags} %install rm -rf $RPM_BUILD_ROOT - -mkdir -p $RPM_BUILD_ROOT%{_sbindir} - make install DESTDIR=$RPM_BUILD_ROOT - rm -fr $RPM_BUILD_ROOT%{_docdir}/udev rm -f $RPM_BUILD_ROOT/%{_libdir}/*.la - -# Deprecated, but keep the ownership -mkdir -p $RPM_BUILD_ROOT%{_sysconfdir}/udev/{rules.d,devices} -mkdir -p $RPM_BUILD_ROOT%{_bindir} - for i in \ %ifarch ia64 rules/arch/40-ia64.rules \ @@ -154,55 +114,21 @@ for i in \ rules/arch/40-s390.rules \ %endif ; do - install -m 0644 "$i" "$RPM_BUILD_ROOT%{udev_scriptdir}/rules.d/${i##*/}" + install -m 0644 "$i" "$RPM_BUILD_ROOT/lib/udev/rules.d/${i##*/}" done - -mkdir -p $RPM_BUILD_ROOT%{_datadir}/udev -mkdir -p -m 0755 $RPM_BUILD_ROOT%{firmwaredir} - -%preun -if [ "$1" -eq 0 -a -f %{_initrddir}/udev ]; then - if test -x /usr/bin/stat -a \ - "$(/usr/bin/stat -Lc '%%D-%%i' /)" = "$(/usr/bin/stat -Lc '%%D-%%i' /proc/1/root)"; then - /sbin/udevadm control --exit 2>&1 || : - fi - /sbin/chkconfig --del udev || : -fi -if [ "$1" -eq 0 ]; then - /sbin/chkconfig --del udev-retry || : -fi -/sbin/chkconfig --del udev-post >/dev/null 2>&1 || : -exit 0 +mkdir -p -m 0755 $RPM_BUILD_ROOT/lib/firmware +mkdir -p -m 0755 $RPM_BUILD_ROOT/lib/firmware/updates %pre getent group cdrom >/dev/null || /usr/sbin/groupadd -g 11 cdrom || : getent group tape >/dev/null || /usr/sbin/groupadd -g 33 tape || : getent group dialout >/dev/null || /usr/sbin/groupadd -g 18 dialout || : getent group floppy >/dev/null || /usr/sbin/groupadd -g 19 floppy || : - -if ! /bin/systemctl stop udev.service udev-control.socket udev-kernel.socket >/dev/null 2>&1; then - # kill daemon if we are not in a chroot - if test -f /proc/1/exe -a -d /proc/1/root; then - if test -x /usr/bin/stat -a \ - "$(/usr/bin/stat -Lc '%%D-%%i' /)" = "$(/usr/bin/stat -Lc '%%D-%%i' /proc/1/root)"; then - /sbin/udevadm control --exit 2>&1 || : - fi - fi -fi -exit 0 +/bin/systemctl stop udev.service udev-control.socket udev-kernel.socket >/dev/null 2>&1 || : %post /bin/systemctl daemon-reload >/dev/null 2>&1 || : - -if ! /bin/systemctl start udev.service >/dev/null 2>&1; then - # start daemon if we are not in a chroot - if test -f /proc/1/exe -a -d /proc/1/root; then - if test "$(/usr/bin/stat -Lc '%%D-%%i' /)" = "$(/usr/bin/stat -Lc '%%D-%%i' /proc/1/root)"; then - /sbin/udevd -d >/dev/null 2>&1 || : - fi - fi -fi -exit 0 +/bin/systemctl start udev.service >/dev/null 2>&1 || : %postun /bin/systemctl daemon-reload >/dev/null 2>&1 || : @@ -217,61 +143,30 @@ exit 0 rm -rf $RPM_BUILD_ROOT %files -%defattr(0644, root, root, 0755) +%defattr(-, root, root, 0755) %doc NEWS COPYING README TODO ChangeLog extras/keymap/README.keymap.txt %attr(0755,root,root) /sbin/udevadm -%attr(0755,root,root) /sbin/udevd -%attr(0755,root,root) %{udev_scriptdir}/ata_id -%attr(0755,root,root) %{udev_scriptdir}/usb_id -%attr(0755,root,root) %{udev_scriptdir}/cdrom_id -%attr(0755,root,root) %{udev_scriptdir}/path_id -%attr(0755,root,root) %{udev_scriptdir}/create_floppy_devices -%attr(0755,root,root) %{udev_scriptdir}/firmware -%attr(0644,root,root) %{udev_scriptdir}/rule_generator.functions -%attr(0755,root,root) %{udev_scriptdir}/write_cd_rules -%attr(0755,root,root) %{udev_scriptdir}/write_net_rules -%attr(0755,root,root) %{udev_scriptdir}/collect -%attr(0755,root,root) %{udev_scriptdir}/input_id -%attr(0755,root,root) %{udev_scriptdir}/keyboard-force-release.sh -%attr(0755,root,root) %{udev_scriptdir}/mtd_probe -%attr(0755,root,root) %{udev_scriptdir}/accelerometer - -%attr(0755,root,root) %dir %{udev_scriptdir}/rules.d/ +%attr(0755,root,root) /lib/udev/udevd +%config(noreplace) %attr(0644,root,root) %{_sysconfdir}/udev/udev.conf %attr(0755,root,root) %dir %{_sysconfdir}/udev/ %attr(0755,root,root) %dir %{_sysconfdir}/udev/rules.d/ -%attr(0755,root,root) %dir %{udev_scriptdir}/ -%attr(0755,root,root) %dir %{udev_scriptdir}/devices/ - -%config(noreplace) %attr(0644,root,root) %{_sysconfdir}/udev/udev.conf -%attr(0644,root,root) %{udev_scriptdir}/rules.d/*.rules - -%dir %attr(0755,root,root) %{firmwaredir} -%attr(0644,root,root) %{_mandir}/man8/udev*.8* -%attr(0644,root,root) %{_mandir}/man7/udev*.7* -%attr(0644,root,root) %{_mandir}/man8/scsi_id*.8* - -%attr(0755,root,root) %{udev_scriptdir}/scsi_id -%attr(0755,root,root) %{udev_scriptdir}/pci-db -%attr(0755,root,root) %{udev_scriptdir}/usb-db -%attr(0755,root,root) %{udev_scriptdir}/keymap -%attr(0755,root,root) %{udev_scriptdir}/v4l_id -%attr(0755,root,root) %{udev_scriptdir}/findkeyboards -%dir %{udev_scriptdir}/keymaps -%{udev_scriptdir}/keymaps/* +%attr(0755,root,root) %dir /lib/udev +%attr(0755,root,root) %dir /lib/udev/rules.d/ +%attr(0755,root,root) %dir /lib/udev/devices/ +%attr(0755,root,root) %dir /lib/udev/keymaps +/lib/udev/* +/lib/udev/keymaps/* +%attr(0644,root,root) /lib/udev/rules.d/*.rules +%attr(0644,root,root) %{_mandir}/man7/*.7* +%attr(0644,root,root) %{_mandir}/man8/*.8* %{_datadir}/pkgconfig/udev.pc +%dir %attr(0755,root,root) /lib/firmware +%dir %attr(0755,root,root) /lib/firmware/updates -%attr(0644,root,root) %{systemdsystemunitdir}/udev-settle.service -%attr(0644,root,root) %{systemdsystemunitdir}/udev-trigger.service -%attr(0644,root,root) %{systemdsystemunitdir}/udev.service -%attr(0644,root,root) %{systemdsystemunitdir}/udev-kernel.socket -%attr(0644,root,root) %{systemdsystemunitdir}/udev-control.socket -%{systemdsystemunitdir}/basic.target.wants/udev.service -%{systemdsystemunitdir}/basic.target.wants/udev-trigger.service -%{systemdsystemunitdir}/sockets.target.wants/udev-control.socket -%{systemdsystemunitdir}/sockets.target.wants/udev-kernel.socket - -# Deprecated, but keep the ownership -%ghost %dir %{_sysconfdir}/udev/devices/ +%attr(0644,root,root) /lib/systemd/system/*.service +%attr(0644,root,root) /lib/systemd/system/*.socket +/lib/systemd/system/basic.target.wants/*.service +/lib/systemd/system/sockets.target.wants/*.socket %files -n libudev %defattr(0644, root, root, 0755) @@ -305,6 +200,20 @@ rm -rf $RPM_BUILD_ROOT %attr(0644,root,root) %{_libdir}/pkgconfig/gudev-1.0* %changelog +* Mon Oct 10 2011 Kay Sievers 173-4 +- version 174 + - path_id, usb_id, input_id tools are built-in commands + - fusectl is mounted by systemd + - SYSFS=, ID=, BUS= are removed + - udevadm trigger --type=failed is removed + - udev control socket is now in /run/udev/control + - disable persistent net and cdrom rule generator +- remove obsolete rpm dependencies +- remove SYSV init script controls + +* Mon Aug 29 2011 Kay Sievers 173-3 +- fix bluetooth input device handling (brc#733862) + * Mon Aug 29 2011 Daniel Drake 173-2 - Update OLPC XO keymap From 2d66943d2fe4aa0610be58f866264708aacf017e Mon Sep 17 00:00:00 2001 From: Kay Sievers Date: Thu, 20 Oct 2011 00:24:46 +0200 Subject: [PATCH 123/142] fix version in changelog --- udev.spec | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/udev.spec b/udev.spec index 15e136a..25c72e2 100644 --- a/udev.spec +++ b/udev.spec @@ -200,7 +200,7 @@ rm -rf $RPM_BUILD_ROOT %attr(0644,root,root) %{_libdir}/pkgconfig/gudev-1.0* %changelog -* Mon Oct 10 2011 Kay Sievers 173-4 +* Mon Oct 10 2011 Kay Sievers 174-1 - version 174 - path_id, usb_id, input_id tools are built-in commands - fusectl is mounted by systemd From 9653945ff2fc121267e714150575a12c4ff88358 Mon Sep 17 00:00:00 2001 From: Kay Sievers Date: Thu, 20 Oct 2011 13:55:54 +0200 Subject: [PATCH 124/142] update dracut requirement, include entire /lib/udev directory --- udev.spec | 14 +++----------- 1 file changed, 3 insertions(+), 11 deletions(-) diff --git a/udev.spec b/udev.spec index 25c72e2..a083a95 100644 --- a/udev.spec +++ b/udev.spec @@ -24,7 +24,7 @@ Requires: systemd-units Requires: pkgconfig Requires: util-linux >= 2.15.1 Conflicts: systemd < 37 -Conflicts: dracut < 013-85.git20111019 +Conflicts: dracut < 013-93 %ifarch s390 s390x # Require s390utils-base, because it's essential on s390 @@ -146,23 +146,15 @@ rm -rf $RPM_BUILD_ROOT %defattr(-, root, root, 0755) %doc NEWS COPYING README TODO ChangeLog extras/keymap/README.keymap.txt %attr(0755,root,root) /sbin/udevadm -%attr(0755,root,root) /lib/udev/udevd %config(noreplace) %attr(0644,root,root) %{_sysconfdir}/udev/udev.conf %attr(0755,root,root) %dir %{_sysconfdir}/udev/ %attr(0755,root,root) %dir %{_sysconfdir}/udev/rules.d/ -%attr(0755,root,root) %dir /lib/udev -%attr(0755,root,root) %dir /lib/udev/rules.d/ -%attr(0755,root,root) %dir /lib/udev/devices/ -%attr(0755,root,root) %dir /lib/udev/keymaps -/lib/udev/* -/lib/udev/keymaps/* -%attr(0644,root,root) /lib/udev/rules.d/*.rules +%attr(0755,root,root) /lib/udev %attr(0644,root,root) %{_mandir}/man7/*.7* %attr(0644,root,root) %{_mandir}/man8/*.8* %{_datadir}/pkgconfig/udev.pc %dir %attr(0755,root,root) /lib/firmware %dir %attr(0755,root,root) /lib/firmware/updates - %attr(0644,root,root) /lib/systemd/system/*.service %attr(0644,root,root) /lib/systemd/system/*.socket /lib/systemd/system/basic.target.wants/*.service @@ -200,7 +192,7 @@ rm -rf $RPM_BUILD_ROOT %attr(0644,root,root) %{_libdir}/pkgconfig/gudev-1.0* %changelog -* Mon Oct 10 2011 Kay Sievers 174-1 +* Thu Oct 20 2011 Kay Sievers 174-1 - version 174 - path_id, usb_id, input_id tools are built-in commands - fusectl is mounted by systemd From 4dfe0853b64444e1c5c8f0c7564909ce7b9ed81a Mon Sep 17 00:00:00 2001 From: Kay Sievers Date: Sat, 22 Oct 2011 22:06:39 +0200 Subject: [PATCH 125/142] ignore entire rule when a key is unknown --- ...-rules-line-if-unknown-keys-are-used.patch | 26 +++++++++++++++++++ udev.spec | 7 ++++- 2 files changed, 32 insertions(+), 1 deletion(-) create mode 100644 0001-ignore-entire-rules-line-if-unknown-keys-are-used.patch diff --git a/0001-ignore-entire-rules-line-if-unknown-keys-are-used.patch b/0001-ignore-entire-rules-line-if-unknown-keys-are-used.patch new file mode 100644 index 0000000..4d9f1c6 --- /dev/null +++ b/0001-ignore-entire-rules-line-if-unknown-keys-are-used.patch @@ -0,0 +1,26 @@ +From 95691487363ef213fec6975219c87d29415a2479 Mon Sep 17 00:00:00 2001 +From: Kay Sievers +Date: Sat, 22 Oct 2011 20:50:23 +0200 +Subject: [PATCH] ignore entire rules line if unknown keys are used + +--- + udev/udev-rules.c | 2 ++ + 1 files changed, 2 insertions(+), 0 deletions(-) + +diff --git a/udev/udev-rules.c b/udev/udev-rules.c +index 75636d9..f540a5a 100644 +--- a/udev/udev-rules.c ++++ b/udev/udev-rules.c +@@ -1612,7 +1612,9 @@ static int add_rule(struct udev_rules *rules, char *line, + + continue; + } ++ + err(rules->udev, "unknown key '%s' in %s:%u\n", key, filename, lineno); ++ goto invalid; + } + + /* add rule token */ +-- +1.7.6.4 + diff --git a/udev.spec b/udev.spec index a083a95..f2e24ff 100644 --- a/udev.spec +++ b/udev.spec @@ -1,7 +1,7 @@ Summary: A rule-based device node and kernel event manager Name: udev Version: 174 -Release: 1%{?dist} +Release: 2%{?dist} License: GPLv2+ Group: System Environment/Base Source: ftp://ftp.kernel.org/pub/linux/utils/kernel/hotplug/%{name}-%{version}.tar.bz2 @@ -25,6 +25,7 @@ Requires: pkgconfig Requires: util-linux >= 2.15.1 Conflicts: systemd < 37 Conflicts: dracut < 013-93 +Patch10: 0001-ignore-entire-rules-line-if-unknown-keys-are-used.patch %ifarch s390 s390x # Require s390utils-base, because it's essential on s390 @@ -81,6 +82,7 @@ glib-based applications using libudev functionality. %prep %setup -q +%patch10 -p1 %build # prevent man pages from re-building (xmlto) @@ -192,6 +194,9 @@ rm -rf $RPM_BUILD_ROOT %attr(0644,root,root) %{_libdir}/pkgconfig/gudev-1.0* %changelog +* Sat Oct 22 2011 Kay Sievers 174-2 +- ignore entire rule when a key is unknown (brc#748082) + * Thu Oct 20 2011 Kay Sievers 174-1 - version 174 - path_id, usb_id, input_id tools are built-in commands From f9c13ce3bfd1f58042484f7eb631fc64ac121767 Mon Sep 17 00:00:00 2001 From: Kay Sievers Date: Tue, 8 Nov 2011 01:46:54 +0100 Subject: [PATCH 126/142] version 175 --- .gitignore | 2 +- ...-rules-line-if-unknown-keys-are-used.patch | 26 ------------------- sources | 2 +- udev.spec | 10 ++++--- 4 files changed, 8 insertions(+), 32 deletions(-) delete mode 100644 0001-ignore-entire-rules-line-if-unknown-keys-are-used.patch diff --git a/.gitignore b/.gitignore index aaa1534..9e36943 100644 --- a/.gitignore +++ b/.gitignore @@ -1 +1 @@ -/udev-174.tar.bz2 +/udev-175.tar.bz2 diff --git a/0001-ignore-entire-rules-line-if-unknown-keys-are-used.patch b/0001-ignore-entire-rules-line-if-unknown-keys-are-used.patch deleted file mode 100644 index 4d9f1c6..0000000 --- a/0001-ignore-entire-rules-line-if-unknown-keys-are-used.patch +++ /dev/null @@ -1,26 +0,0 @@ -From 95691487363ef213fec6975219c87d29415a2479 Mon Sep 17 00:00:00 2001 -From: Kay Sievers -Date: Sat, 22 Oct 2011 20:50:23 +0200 -Subject: [PATCH] ignore entire rules line if unknown keys are used - ---- - udev/udev-rules.c | 2 ++ - 1 files changed, 2 insertions(+), 0 deletions(-) - -diff --git a/udev/udev-rules.c b/udev/udev-rules.c -index 75636d9..f540a5a 100644 ---- a/udev/udev-rules.c -+++ b/udev/udev-rules.c -@@ -1612,7 +1612,9 @@ static int add_rule(struct udev_rules *rules, char *line, - - continue; - } -+ - err(rules->udev, "unknown key '%s' in %s:%u\n", key, filename, lineno); -+ goto invalid; - } - - /* add rule token */ --- -1.7.6.4 - diff --git a/sources b/sources index 5e58980..f573b89 100644 --- a/sources +++ b/sources @@ -1 +1 @@ -3b84706046a33d7a7e00491a1136804d udev-174.tar.bz2 +2fc9c1efcbde98e3d73ffee7a77aea47 udev-175.tar.bz2 diff --git a/udev.spec b/udev.spec index f2e24ff..09ee959 100644 --- a/udev.spec +++ b/udev.spec @@ -1,7 +1,7 @@ Summary: A rule-based device node and kernel event manager Name: udev -Version: 174 -Release: 2%{?dist} +Version: 175 +Release: 1%{?dist} License: GPLv2+ Group: System Environment/Base Source: ftp://ftp.kernel.org/pub/linux/utils/kernel/hotplug/%{name}-%{version}.tar.bz2 @@ -25,7 +25,6 @@ Requires: pkgconfig Requires: util-linux >= 2.15.1 Conflicts: systemd < 37 Conflicts: dracut < 013-93 -Patch10: 0001-ignore-entire-rules-line-if-unknown-keys-are-used.patch %ifarch s390 s390x # Require s390utils-base, because it's essential on s390 @@ -82,7 +81,6 @@ glib-based applications using libudev functionality. %prep %setup -q -%patch10 -p1 %build # prevent man pages from re-building (xmlto) @@ -194,6 +192,10 @@ rm -rf $RPM_BUILD_ROOT %attr(0644,root,root) %{_libdir}/pkgconfig/gudev-1.0* %changelog +* Mon Nov 7 2011 Kay Sievers 175-1 +- version 175 + - bug fix release + * Sat Oct 22 2011 Kay Sievers 174-2 - ignore entire rule when a key is unknown (brc#748082) From 27412d3df258a617bfc05f4b1d820b23e3ebe866 Mon Sep 17 00:00:00 2001 From: Dennis Gilmore Date: Sat, 14 Jan 2012 01:25:45 -0600 Subject: [PATCH 127/142] - Rebuilt for https://fedoraproject.org/wiki/Fedora_17_Mass_Rebuild --- udev.spec | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/udev.spec b/udev.spec index 09ee959..a52b63b 100644 --- a/udev.spec +++ b/udev.spec @@ -1,7 +1,7 @@ Summary: A rule-based device node and kernel event manager Name: udev Version: 175 -Release: 1%{?dist} +Release: 2%{?dist} License: GPLv2+ Group: System Environment/Base Source: ftp://ftp.kernel.org/pub/linux/utils/kernel/hotplug/%{name}-%{version}.tar.bz2 @@ -192,6 +192,9 @@ rm -rf $RPM_BUILD_ROOT %attr(0644,root,root) %{_libdir}/pkgconfig/gudev-1.0* %changelog +* Sat Jan 14 2012 Fedora Release Engineering - 175-2 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_17_Mass_Rebuild + * Mon Nov 7 2011 Kay Sievers 175-1 - version 175 - bug fix release From faded2be30b587c563f6aceba52826ef1ea8f7fe Mon Sep 17 00:00:00 2001 From: Kay Sievers Date: Wed, 25 Jan 2012 14:04:35 +0100 Subject: [PATCH 128/142] version 179 --- .gitignore | 2 +- sources | 2 +- udev.spec | 62 ++++++++++++++++++++++-------------------------------- 3 files changed, 27 insertions(+), 39 deletions(-) diff --git a/.gitignore b/.gitignore index 9e36943..9e7171b 100644 --- a/.gitignore +++ b/.gitignore @@ -1 +1 @@ -/udev-175.tar.bz2 +/udev-179.tar.xz diff --git a/sources b/sources index f573b89..85ba111 100644 --- a/sources +++ b/sources @@ -1 +1 @@ -2fc9c1efcbde98e3d73ffee7a77aea47 udev-175.tar.bz2 +c966a07dd75fd8d3f1a7e3d210a96c6b udev-179.tar.xz diff --git a/udev.spec b/udev.spec index a52b63b..6c26f64 100644 --- a/udev.spec +++ b/udev.spec @@ -1,12 +1,11 @@ Summary: A rule-based device node and kernel event manager Name: udev -Version: 175 -Release: 2%{?dist} +Version: 179 +Release: 1%{?dist} License: GPLv2+ Group: System Environment/Base -Source: ftp://ftp.kernel.org/pub/linux/utils/kernel/hotplug/%{name}-%{version}.tar.bz2 +Source: ftp://ftp.kernel.org/pub/linux/utils/kernel/hotplug/%{name}-%{version}.tar.xz URL: http://www.kernel.org/pub/linux/utils/kernel/hotplug/udev.html -BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n) BuildRequires: libtool BuildRequires: pkgconfig BuildRequires: gperf @@ -15,13 +14,14 @@ BuildRequires: glib2-devel BuildRequires: hwdata BuildRequires: gobject-introspection-devel >= 0.6.2 BuildRequires: usbutils >= 0.82 +BuildRequires: kmod-libs >= 4 +BuildRequires: libblkid-devel >= 2.20 Obsoletes: dev <= 0:3.12-1 Provides: dev = 0:3.12-2 Requires(pre): fileutils Requires(pre): /usr/bin/getent /usr/sbin/groupadd Requires: hwdata Requires: systemd-units -Requires: pkgconfig Requires: util-linux >= 2.15.1 Conflicts: systemd < 37 Conflicts: dracut < 013-93 @@ -89,35 +89,24 @@ export CFLAGS="$CFLAGS $RPM_OPT_FLAGS -fPIE -DPIE -pie -Wl,-z,relro -Wl,-z,now" export V=1 %configure \ --prefix=%{_prefix} \ + --with-rootprefix= \ --sysconfdir=%{_sysconfdir} \ - --sbindir=/sbin \ - --libexecdir=/lib/udev \ + --bindir=/sbin \ + --libexecdir=/lib \ --with-rootlibdir=/%{_lib} \ --with-selinux \ - --with-systemdsystemunitdir=/lib/systemd/system \ - --enable-floppy + --with-systemdsystemunitdir=/lib/systemd/system make %{?_smp_mflags} %install -rm -rf $RPM_BUILD_ROOT make install DESTDIR=$RPM_BUILD_ROOT rm -fr $RPM_BUILD_ROOT%{_docdir}/udev rm -f $RPM_BUILD_ROOT/%{_libdir}/*.la -for i in \ -%ifarch ia64 - rules/arch/40-ia64.rules \ -%endif -%ifarch ppc ppc64 - rules/arch/40-ppc.rules \ -%endif -%ifarch s390 s390x - rules/arch/40-s390.rules \ -%endif - ; do - install -m 0644 "$i" "$RPM_BUILD_ROOT/lib/udev/rules.d/${i##*/}" -done mkdir -p -m 0755 $RPM_BUILD_ROOT/lib/firmware mkdir -p -m 0755 $RPM_BUILD_ROOT/lib/firmware/updates +%ifarch s390 s390x +install -m 0644 rules/arch/40-s390.rules $RPM_BUILD_ROOT/lib/udev/rules.d +%endif %pre getent group cdrom >/dev/null || /usr/sbin/groupadd -g 11 cdrom || : @@ -139,17 +128,13 @@ getent group floppy >/dev/null || /usr/sbin/groupadd -g 19 floppy || : %post -n libgudev1 -p /sbin/ldconfig %postun -n libgudev1 -p /sbin/ldconfig -%clean -rm -rf $RPM_BUILD_ROOT - %files -%defattr(-, root, root, 0755) -%doc NEWS COPYING README TODO ChangeLog extras/keymap/README.keymap.txt +%doc NEWS COPYING README TODO ChangeLog src/extras/keymap/README.keymap.txt +/lib/udev %attr(0755,root,root) /sbin/udevadm %config(noreplace) %attr(0644,root,root) %{_sysconfdir}/udev/udev.conf %attr(0755,root,root) %dir %{_sysconfdir}/udev/ %attr(0755,root,root) %dir %{_sysconfdir}/udev/rules.d/ -%attr(0755,root,root) /lib/udev %attr(0644,root,root) %{_mandir}/man7/*.7* %attr(0644,root,root) %{_mandir}/man8/*.8* %{_datadir}/pkgconfig/udev.pc @@ -161,27 +146,23 @@ rm -rf $RPM_BUILD_ROOT /lib/systemd/system/sockets.target.wants/*.socket %files -n libudev -%defattr(0644, root, root, 0755) -%doc libudev/COPYING +%doc src/COPYING %attr(0755,root,root) /%{_lib}/libudev.so.* %files -n libudev-devel -%defattr(0644, root, root, 0755) -%doc libudev/docs/html/* +%doc src/docs/html/* %{_includedir}/libudev.h %{_libdir}/libudev.so %{_libdir}/pkgconfig/libudev.pc %{_datadir}/gtk-doc/html/libudev/* %files -n libgudev1 -%defattr(0644, root, root, 0755) -%doc extras/gudev/COPYING +%doc src/extras/gudev/COPYING %attr(0755,root,root) /%{_lib}/libgudev-1.0.so.* %attr(0644,root,root) %{_libdir}/girepository-1.0/GUdev-1.0.typelib %files -n libgudev1-devel -%defattr(0644, root, root, 0755) -%doc extras/gudev/docs/html/* +%doc src/extras/gudev/docs/html/* %attr(0755,root,root) %{_libdir}/libgudev-1.0.so %dir %attr(0755,root,root) %{_includedir}/gudev-1.0 %dir %attr(0755,root,root) %{_includedir}/gudev-1.0/gudev @@ -192,6 +173,13 @@ rm -rf $RPM_BUILD_ROOT %attr(0644,root,root) %{_libdir}/pkgconfig/gudev-1.0* %changelog +* Wed Jan 25 2012 Kay Sievers 179-1 +- version 179 + - devtmpfs is mandatory now + - /run is mandatory now + - modules are loaded with 'libkmod' + - blkid is built-in now + * Sat Jan 14 2012 Fedora Release Engineering - 175-2 - Rebuilt for https://fedoraproject.org/wiki/Fedora_17_Mass_Rebuild From e0eeb8a6eb14a00a01f3a1d8f384cc1309db4e06 Mon Sep 17 00:00:00 2001 From: Kay Sievers Date: Wed, 25 Jan 2012 14:47:02 +0100 Subject: [PATCH 129/142] require 'kmod-devel' instead of 'kmod-libs' --- udev.spec | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/udev.spec b/udev.spec index 6c26f64..290d0e4 100644 --- a/udev.spec +++ b/udev.spec @@ -14,7 +14,7 @@ BuildRequires: glib2-devel BuildRequires: hwdata BuildRequires: gobject-introspection-devel >= 0.6.2 BuildRequires: usbutils >= 0.82 -BuildRequires: kmod-libs >= 4 +BuildRequires: kmod-devel >= 4 BuildRequires: libblkid-devel >= 2.20 Obsoletes: dev <= 0:3.12-1 Provides: dev = 0:3.12-2 From f110253ee56616d3d843e7cfd14a6788d63ec9c6 Mon Sep 17 00:00:00 2001 From: Kay Sievers Date: Wed, 25 Jan 2012 15:02:58 +0100 Subject: [PATCH 130/142] work around broken upstream tarball's 'xslt' ifdef --- udev.spec | 1 + 1 file changed, 1 insertion(+) diff --git a/udev.spec b/udev.spec index 290d0e4..2aeb9b3 100644 --- a/udev.spec +++ b/udev.spec @@ -16,6 +16,7 @@ BuildRequires: gobject-introspection-devel >= 0.6.2 BuildRequires: usbutils >= 0.82 BuildRequires: kmod-devel >= 4 BuildRequires: libblkid-devel >= 2.20 +BuildRequires: libxslt Obsoletes: dev <= 0:3.12-1 Provides: dev = 0:3.12-2 Requires(pre): fileutils From dc3e663505775fa2e4d743d6a6033565ebdaf096 Mon Sep 17 00:00:00 2001 From: Kay Sievers Date: Wed, 25 Jan 2012 15:26:48 +0100 Subject: [PATCH 131/142] install everything in /usr This patch is needed for the /usr-move feature https://fedoraproject.org/wiki/Features/UsrMove This package requires now 'filesystem' >= 3, which is only installable on a system which has /bin, /sbin, /lib, /lib64 as symlinks to /usr and not regular directories. The 'filesystem' package acts as a guard, to prevent *this* package to be installed on old unconverted systems. New installations will have the 'filesystem' >=3 layout right away, old installations need to be converted with anaconda or dracut first; only after that, the 'filesystem' package, and also *this* package can be installed. Packages *should* not install files in /bin, /sbin, /lib, /lib64, but only in the corresponding directories in /usr. Packages *must* not install conflicting files with the same names in the corresponding directories in / and /usr. Especially compatibilty symlinks must not be installed. Feel free to modify any of the changes to the spec file, but keep the above in mind. --- udev.spec | 45 ++++++++++++++++++++++++++------------------- 1 file changed, 26 insertions(+), 19 deletions(-) diff --git a/udev.spec b/udev.spec index 2aeb9b3..0ac9dcf 100644 --- a/udev.spec +++ b/udev.spec @@ -24,8 +24,9 @@ Requires(pre): /usr/bin/getent /usr/sbin/groupadd Requires: hwdata Requires: systemd-units Requires: util-linux >= 2.15.1 -Conflicts: systemd < 37 +Conflicts: systemd < 39 Conflicts: dracut < 013-93 +Conflicts: filesystem < 3 %ifarch s390 s390x # Require s390utils-base, because it's essential on s390 @@ -43,6 +44,7 @@ removed from the system. Summary: Dynamic library to access udev device information Group: System Environment/Libraries Requires: udev = %{version}-%{release} +Conflicts: filesystem < 3 License: LGPLv2+ %description -n libudev @@ -64,6 +66,7 @@ dynamic library, which provides access to udev device information. Summary: Libraries for adding libudev support to applications that use glib Group: Development/Libraries Requires: libudev = %{version}-%{release} +Conflicts: filesystem < 3 License: LGPLv2+ %description -n libgudev1 @@ -90,23 +93,22 @@ export CFLAGS="$CFLAGS $RPM_OPT_FLAGS -fPIE -DPIE -pie -Wl,-z,relro -Wl,-z,now" export V=1 %configure \ --prefix=%{_prefix} \ - --with-rootprefix= \ --sysconfdir=%{_sysconfdir} \ - --bindir=/sbin \ - --libexecdir=/lib \ - --with-rootlibdir=/%{_lib} \ + --libexecdir=%{_prefix}/lib \ --with-selinux \ - --with-systemdsystemunitdir=/lib/systemd/system + --with-systemdsystemunitdir=%{_prefix}/lib/systemd/system make %{?_smp_mflags} %install make install DESTDIR=$RPM_BUILD_ROOT rm -fr $RPM_BUILD_ROOT%{_docdir}/udev rm -f $RPM_BUILD_ROOT/%{_libdir}/*.la -mkdir -p -m 0755 $RPM_BUILD_ROOT/lib/firmware -mkdir -p -m 0755 $RPM_BUILD_ROOT/lib/firmware/updates +mkdir -p -m 0755 $RPM_BUILD_ROOT%{_prefix}/lib/firmware +mkdir -p -m 0755 $RPM_BUILD_ROOT%{_prefix}/lib/firmware/updates +mkdir -p -m 0755 $RPM_BUILD_ROOT%{_prefix}/sbin +ln -sf ../bin/udevadm $RPM_BUILD_ROOT%{_prefix}/sbin/udevadm %ifarch s390 s390x -install -m 0644 rules/arch/40-s390.rules $RPM_BUILD_ROOT/lib/udev/rules.d +install -m 0644 rules/arch/40-s390.rules $RPM_BUILD_ROOT%{_prefix}/lib/udev/rules.d %endif %pre @@ -131,24 +133,25 @@ getent group floppy >/dev/null || /usr/sbin/groupadd -g 19 floppy || : %files %doc NEWS COPYING README TODO ChangeLog src/extras/keymap/README.keymap.txt -/lib/udev -%attr(0755,root,root) /sbin/udevadm +%{_bindir}/udevadm +%{_prefix}/sbin/udevadm +%{_prefix}/lib/udev %config(noreplace) %attr(0644,root,root) %{_sysconfdir}/udev/udev.conf %attr(0755,root,root) %dir %{_sysconfdir}/udev/ %attr(0755,root,root) %dir %{_sysconfdir}/udev/rules.d/ %attr(0644,root,root) %{_mandir}/man7/*.7* %attr(0644,root,root) %{_mandir}/man8/*.8* %{_datadir}/pkgconfig/udev.pc -%dir %attr(0755,root,root) /lib/firmware -%dir %attr(0755,root,root) /lib/firmware/updates -%attr(0644,root,root) /lib/systemd/system/*.service -%attr(0644,root,root) /lib/systemd/system/*.socket -/lib/systemd/system/basic.target.wants/*.service -/lib/systemd/system/sockets.target.wants/*.socket +%dir %attr(0755,root,root) %{_prefix}/lib/firmware +%dir %attr(0755,root,root) %{_prefix}/lib/firmware/updates +%attr(0644,root,root) %{_prefix}/lib/systemd/system/*.service +%attr(0644,root,root) %{_prefix}/lib/systemd/system/*.socket +%{_prefix}/lib/systemd/system/basic.target.wants/*.service +%{_prefix}/lib/systemd/system/sockets.target.wants/*.socket %files -n libudev %doc src/COPYING -%attr(0755,root,root) /%{_lib}/libudev.so.* +%attr(0755,root,root) %{_libdir}/libudev.so.* %files -n libudev-devel %doc src/docs/html/* @@ -159,7 +162,7 @@ getent group floppy >/dev/null || /usr/sbin/groupadd -g 19 floppy || : %files -n libgudev1 %doc src/extras/gudev/COPYING -%attr(0755,root,root) /%{_lib}/libgudev-1.0.so.* +%attr(0755,root,root) %{_libdir}/libgudev-1.0.so.* %attr(0644,root,root) %{_libdir}/girepository-1.0/GUdev-1.0.typelib %files -n libgudev1-devel @@ -174,6 +177,10 @@ getent group floppy >/dev/null || /usr/sbin/groupadd -g 19 floppy || : %attr(0644,root,root) %{_libdir}/pkgconfig/gudev-1.0* %changelog +* Wed Jan 25 2012 Kay Sievers 179-1 +- install everything in /usr + https://fedoraproject.org/wiki/Features/UsrMove + * Wed Jan 25 2012 Kay Sievers 179-1 - version 179 - devtmpfs is mandatory now From 36b9856624b9245a937a7c89b692cbcb709d0a8b Mon Sep 17 00:00:00 2001 From: Harald Hoyer Date: Wed, 25 Jan 2012 15:42:00 +0100 Subject: [PATCH 132/142] increment release --- udev.spec | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/udev.spec b/udev.spec index 0ac9dcf..826ea6c 100644 --- a/udev.spec +++ b/udev.spec @@ -1,7 +1,7 @@ Summary: A rule-based device node and kernel event manager Name: udev Version: 179 -Release: 1%{?dist} +Release: 2%{?dist} License: GPLv2+ Group: System Environment/Base Source: ftp://ftp.kernel.org/pub/linux/utils/kernel/hotplug/%{name}-%{version}.tar.xz @@ -177,7 +177,7 @@ getent group floppy >/dev/null || /usr/sbin/groupadd -g 19 floppy || : %attr(0644,root,root) %{_libdir}/pkgconfig/gudev-1.0* %changelog -* Wed Jan 25 2012 Kay Sievers 179-1 +* Wed Jan 25 2012 Kay Sievers 179-2 - install everything in /usr https://fedoraproject.org/wiki/Features/UsrMove From e0bc75be11e9b7ab64d883c517d8906d15cb5a74 Mon Sep 17 00:00:00 2001 From: Kay Sievers Date: Wed, 25 Jan 2012 19:36:33 +0100 Subject: [PATCH 133/142] use %{_sbindir} now that everything is in /usr --- udev.spec | 31 +++++++++++++++++-------------- 1 file changed, 17 insertions(+), 14 deletions(-) diff --git a/udev.spec b/udev.spec index 826ea6c..382ee15 100644 --- a/udev.spec +++ b/udev.spec @@ -1,7 +1,7 @@ Summary: A rule-based device node and kernel event manager Name: udev Version: 179 -Release: 2%{?dist} +Release: 3%{?dist} License: GPLv2+ Group: System Environment/Base Source: ftp://ftp.kernel.org/pub/linux/utils/kernel/hotplug/%{name}-%{version}.tar.xz @@ -87,16 +87,16 @@ glib-based applications using libudev functionality. %setup -q %build -# prevent man pages from re-building (xmlto) +# prevent man pages from re-building (xsltproc) find . -name "*.[1-8]" -exec touch '{}' \; export CFLAGS="$CFLAGS $RPM_OPT_FLAGS -fPIE -DPIE -pie -Wl,-z,relro -Wl,-z,now" export V=1 %configure \ - --prefix=%{_prefix} \ - --sysconfdir=%{_sysconfdir} \ - --libexecdir=%{_prefix}/lib \ - --with-selinux \ - --with-systemdsystemunitdir=%{_prefix}/lib/systemd/system + --prefix=%{_prefix} \ + --sysconfdir=%{_sysconfdir} \ + --libexecdir=%{_prefix}/lib \ + --with-selinux \ + --with-systemdsystemunitdir=%{_prefix}/lib/systemd/system make %{?_smp_mflags} %install @@ -105,8 +105,8 @@ rm -fr $RPM_BUILD_ROOT%{_docdir}/udev rm -f $RPM_BUILD_ROOT/%{_libdir}/*.la mkdir -p -m 0755 $RPM_BUILD_ROOT%{_prefix}/lib/firmware mkdir -p -m 0755 $RPM_BUILD_ROOT%{_prefix}/lib/firmware/updates -mkdir -p -m 0755 $RPM_BUILD_ROOT%{_prefix}/sbin -ln -sf ../bin/udevadm $RPM_BUILD_ROOT%{_prefix}/sbin/udevadm +mkdir -p -m 0755 $RPM_BUILD_ROOT%{_sbindir} +ln -sf ../bin/udevadm $RPM_BUILD_ROOT%{_sbindir}/udevadm %ifarch s390 s390x install -m 0644 rules/arch/40-s390.rules $RPM_BUILD_ROOT%{_prefix}/lib/udev/rules.d %endif @@ -116,14 +116,14 @@ getent group cdrom >/dev/null || /usr/sbin/groupadd -g 11 cdrom || : getent group tape >/dev/null || /usr/sbin/groupadd -g 33 tape || : getent group dialout >/dev/null || /usr/sbin/groupadd -g 18 dialout || : getent group floppy >/dev/null || /usr/sbin/groupadd -g 19 floppy || : -/bin/systemctl stop udev.service udev-control.socket udev-kernel.socket >/dev/null 2>&1 || : +systemctl stop udev.service udev-control.socket udev-kernel.socket >/dev/null 2>&1 || : %post -/bin/systemctl daemon-reload >/dev/null 2>&1 || : -/bin/systemctl start udev.service >/dev/null 2>&1 || : +systemctl daemon-reload >/dev/null 2>&1 || : +systemctl start udev.service >/dev/null 2>&1 || : %postun -/bin/systemctl daemon-reload >/dev/null 2>&1 || : +systemctl daemon-reload >/dev/null 2>&1 || : %post -n libudev -p /sbin/ldconfig %postun -n libudev -p /sbin/ldconfig @@ -134,7 +134,7 @@ getent group floppy >/dev/null || /usr/sbin/groupadd -g 19 floppy || : %files %doc NEWS COPYING README TODO ChangeLog src/extras/keymap/README.keymap.txt %{_bindir}/udevadm -%{_prefix}/sbin/udevadm +%{_sbindir}/udevadm %{_prefix}/lib/udev %config(noreplace) %attr(0644,root,root) %{_sysconfdir}/udev/udev.conf %attr(0755,root,root) %dir %{_sysconfdir}/udev/ @@ -177,6 +177,9 @@ getent group floppy >/dev/null || /usr/sbin/groupadd -g 19 floppy || : %attr(0644,root,root) %{_libdir}/pkgconfig/gudev-1.0* %changelog +* Wed Jan 25 2012 Kay Sievers 179-3 +- use %{_sbindir} + * Wed Jan 25 2012 Kay Sievers 179-2 - install everything in /usr https://fedoraproject.org/wiki/Features/UsrMove From 17aa1fb443765c6d357ea2d00cc0feff87842c0b Mon Sep 17 00:00:00 2001 From: Kay Sievers Date: Sun, 29 Jan 2012 06:10:55 +0100 Subject: [PATCH 134/142] version 180 --- .gitignore | 2 +- sources | 2 +- udev.spec | 52 ++++++++++++++++++++++++++++------------------------ 3 files changed, 30 insertions(+), 26 deletions(-) diff --git a/.gitignore b/.gitignore index 9e7171b..fc16718 100644 --- a/.gitignore +++ b/.gitignore @@ -1 +1 @@ -/udev-179.tar.xz +/udev-180.tar.xz diff --git a/sources b/sources index 85ba111..c1d8327 100644 --- a/sources +++ b/sources @@ -1 +1 @@ -c966a07dd75fd8d3f1a7e3d210a96c6b udev-179.tar.xz +b8fb801e7d8371d1bc5c80535008d608 udev-180.tar.xz diff --git a/udev.spec b/udev.spec index 382ee15..06d97fa 100644 --- a/udev.spec +++ b/udev.spec @@ -1,7 +1,7 @@ Summary: A rule-based device node and kernel event manager Name: udev -Version: 179 -Release: 3%{?dist} +Version: 180 +Release: 1%{?dist} License: GPLv2+ Group: System Environment/Base Source: ftp://ftp.kernel.org/pub/linux/utils/kernel/hotplug/%{name}-%{version}.tar.xz @@ -16,7 +16,6 @@ BuildRequires: gobject-introspection-devel >= 0.6.2 BuildRequires: usbutils >= 0.82 BuildRequires: kmod-devel >= 4 BuildRequires: libblkid-devel >= 2.20 -BuildRequires: libxslt Obsoletes: dev <= 0:3.12-1 Provides: dev = 0:3.12-2 Requires(pre): fileutils @@ -26,7 +25,6 @@ Requires: systemd-units Requires: util-linux >= 2.15.1 Conflicts: systemd < 39 Conflicts: dracut < 013-93 -Conflicts: filesystem < 3 %ifarch s390 s390x # Require s390utils-base, because it's essential on s390 @@ -44,7 +42,6 @@ removed from the system. Summary: Dynamic library to access udev device information Group: System Environment/Libraries Requires: udev = %{version}-%{release} -Conflicts: filesystem < 3 License: LGPLv2+ %description -n libudev @@ -66,7 +63,6 @@ dynamic library, which provides access to udev device information. Summary: Libraries for adding libudev support to applications that use glib Group: Development/Libraries Requires: libudev = %{version}-%{release} -Conflicts: filesystem < 3 License: LGPLv2+ %description -n libgudev1 @@ -93,22 +89,23 @@ export CFLAGS="$CFLAGS $RPM_OPT_FLAGS -fPIE -DPIE -pie -Wl,-z,relro -Wl,-z,now" export V=1 %configure \ --prefix=%{_prefix} \ + --with-rootprefix= \ --sysconfdir=%{_sysconfdir} \ - --libexecdir=%{_prefix}/lib \ + --libexecdir=/lib \ + --bindir=/sbin \ + --with-rootlibdir=/%{_lib} \ --with-selinux \ - --with-systemdsystemunitdir=%{_prefix}/lib/systemd/system + --with-systemdsystemunitdir=/lib/systemd/system make %{?_smp_mflags} %install make install DESTDIR=$RPM_BUILD_ROOT rm -fr $RPM_BUILD_ROOT%{_docdir}/udev rm -f $RPM_BUILD_ROOT/%{_libdir}/*.la -mkdir -p -m 0755 $RPM_BUILD_ROOT%{_prefix}/lib/firmware -mkdir -p -m 0755 $RPM_BUILD_ROOT%{_prefix}/lib/firmware/updates -mkdir -p -m 0755 $RPM_BUILD_ROOT%{_sbindir} -ln -sf ../bin/udevadm $RPM_BUILD_ROOT%{_sbindir}/udevadm +mkdir -p -m 0755 $RPM_BUILD_ROOT/lib/firmware +mkdir -p -m 0755 $RPM_BUILD_ROOT/lib/firmware/updates %ifarch s390 s390x -install -m 0644 rules/arch/40-s390.rules $RPM_BUILD_ROOT%{_prefix}/lib/udev/rules.d +install -m 0644 rules/arch/40-s390.rules $RPM_BUILD_ROOT/lib/udev/rules.d %endif %pre @@ -133,25 +130,24 @@ systemctl daemon-reload >/dev/null 2>&1 || : %files %doc NEWS COPYING README TODO ChangeLog src/extras/keymap/README.keymap.txt -%{_bindir}/udevadm -%{_sbindir}/udevadm -%{_prefix}/lib/udev +/lib/udev +/sbin/udevadm %config(noreplace) %attr(0644,root,root) %{_sysconfdir}/udev/udev.conf %attr(0755,root,root) %dir %{_sysconfdir}/udev/ %attr(0755,root,root) %dir %{_sysconfdir}/udev/rules.d/ %attr(0644,root,root) %{_mandir}/man7/*.7* %attr(0644,root,root) %{_mandir}/man8/*.8* %{_datadir}/pkgconfig/udev.pc -%dir %attr(0755,root,root) %{_prefix}/lib/firmware -%dir %attr(0755,root,root) %{_prefix}/lib/firmware/updates -%attr(0644,root,root) %{_prefix}/lib/systemd/system/*.service -%attr(0644,root,root) %{_prefix}/lib/systemd/system/*.socket -%{_prefix}/lib/systemd/system/basic.target.wants/*.service -%{_prefix}/lib/systemd/system/sockets.target.wants/*.socket +%dir %attr(0755,root,root) /lib/firmware +%dir %attr(0755,root,root) /lib/firmware/updates +%attr(0644,root,root) /lib/systemd/system/*.service +%attr(0644,root,root) /lib/systemd/system/*.socket +/lib/systemd/system/basic.target.wants/*.service +/lib/systemd/system/sockets.target.wants/*.socket %files -n libudev %doc src/COPYING -%attr(0755,root,root) %{_libdir}/libudev.so.* +%attr(0755,root,root) /%{_lib}/libudev.so.* %files -n libudev-devel %doc src/docs/html/* @@ -162,7 +158,7 @@ systemctl daemon-reload >/dev/null 2>&1 || : %files -n libgudev1 %doc src/extras/gudev/COPYING -%attr(0755,root,root) %{_libdir}/libgudev-1.0.so.* +%attr(0755,root,root) /%{_lib}/libgudev-1.0.so.* %attr(0644,root,root) %{_libdir}/girepository-1.0/GUdev-1.0.typelib %files -n libgudev1-devel @@ -177,6 +173,14 @@ systemctl daemon-reload >/dev/null 2>&1 || : %attr(0644,root,root) %{_libdir}/pkgconfig/gudev-1.0* %changelog +* Wed Jan 25 2012 Kay Sievers 180-1 +- version 180 + - fix rule execution (brc#785148) + - ID_PART_* export for udisks2 +- temporarily revert 'install everything in /usr' to be + able to update teh current rawhide package without the + dependency on the /usr-move converted filessytem + * Wed Jan 25 2012 Kay Sievers 179-3 - use %{_sbindir} From 90bdfa8bcd577423f731f8a96ce3c334a7a0610f Mon Sep 17 00:00:00 2001 From: Kay Sievers Date: Sun, 29 Jan 2012 18:36:10 +0100 Subject: [PATCH 135/142] install everything in /usr --- udev.spec | 47 +++++++++++++++++++++++++++-------------------- 1 file changed, 27 insertions(+), 20 deletions(-) diff --git a/udev.spec b/udev.spec index 06d97fa..82c072b 100644 --- a/udev.spec +++ b/udev.spec @@ -1,7 +1,7 @@ Summary: A rule-based device node and kernel event manager Name: udev Version: 180 -Release: 1%{?dist} +Release: 2%{?dist} License: GPLv2+ Group: System Environment/Base Source: ftp://ftp.kernel.org/pub/linux/utils/kernel/hotplug/%{name}-%{version}.tar.xz @@ -25,6 +25,7 @@ Requires: systemd-units Requires: util-linux >= 2.15.1 Conflicts: systemd < 39 Conflicts: dracut < 013-93 +Conflicts: filesystem < 3 %ifarch s390 s390x # Require s390utils-base, because it's essential on s390 @@ -42,6 +43,7 @@ removed from the system. Summary: Dynamic library to access udev device information Group: System Environment/Libraries Requires: udev = %{version}-%{release} +Conflicts: filesystem < 3 License: LGPLv2+ %description -n libudev @@ -63,6 +65,7 @@ dynamic library, which provides access to udev device information. Summary: Libraries for adding libudev support to applications that use glib Group: Development/Libraries Requires: libudev = %{version}-%{release} +Conflicts: filesystem < 3 License: LGPLv2+ %description -n libgudev1 @@ -89,23 +92,22 @@ export CFLAGS="$CFLAGS $RPM_OPT_FLAGS -fPIE -DPIE -pie -Wl,-z,relro -Wl,-z,now" export V=1 %configure \ --prefix=%{_prefix} \ - --with-rootprefix= \ --sysconfdir=%{_sysconfdir} \ - --libexecdir=/lib \ - --bindir=/sbin \ - --with-rootlibdir=/%{_lib} \ + --libexecdir=%{_prefix}/lib \ --with-selinux \ - --with-systemdsystemunitdir=/lib/systemd/system + --with-systemdsystemunitdir=%{_prefix}/lib/systemd/system make %{?_smp_mflags} %install make install DESTDIR=$RPM_BUILD_ROOT rm -fr $RPM_BUILD_ROOT%{_docdir}/udev rm -f $RPM_BUILD_ROOT/%{_libdir}/*.la -mkdir -p -m 0755 $RPM_BUILD_ROOT/lib/firmware -mkdir -p -m 0755 $RPM_BUILD_ROOT/lib/firmware/updates +mkdir -p -m 0755 $RPM_BUILD_ROOT%{_prefix}/lib/firmware +mkdir -p -m 0755 $RPM_BUILD_ROOT%{_prefix}/lib/firmware/updates +mkdir -p -m 0755 $RPM_BUILD_ROOT%{_sbindir} +ln -sf ../bin/udevadm $RPM_BUILD_ROOT%{_sbindir}/udevadm %ifarch s390 s390x -install -m 0644 rules/arch/40-s390.rules $RPM_BUILD_ROOT/lib/udev/rules.d +install -m 0644 rules/arch/40-s390.rules $RPM_BUILD_ROOT%{_prefix}/lib/udev/rules.d %endif %pre @@ -130,24 +132,25 @@ systemctl daemon-reload >/dev/null 2>&1 || : %files %doc NEWS COPYING README TODO ChangeLog src/extras/keymap/README.keymap.txt -/lib/udev -/sbin/udevadm +%{_bindir}/udevadm +%{_sbindir}/udevadm +%{_prefix}/lib/udev %config(noreplace) %attr(0644,root,root) %{_sysconfdir}/udev/udev.conf %attr(0755,root,root) %dir %{_sysconfdir}/udev/ %attr(0755,root,root) %dir %{_sysconfdir}/udev/rules.d/ %attr(0644,root,root) %{_mandir}/man7/*.7* %attr(0644,root,root) %{_mandir}/man8/*.8* %{_datadir}/pkgconfig/udev.pc -%dir %attr(0755,root,root) /lib/firmware -%dir %attr(0755,root,root) /lib/firmware/updates -%attr(0644,root,root) /lib/systemd/system/*.service -%attr(0644,root,root) /lib/systemd/system/*.socket -/lib/systemd/system/basic.target.wants/*.service -/lib/systemd/system/sockets.target.wants/*.socket +%dir %attr(0755,root,root) %{_prefix}/lib/firmware +%dir %attr(0755,root,root) %{_prefix}/lib/firmware/updates +%attr(0644,root,root) %{_prefix}/lib/systemd/system/*.service +%attr(0644,root,root) %{_prefix}/lib/systemd/system/*.socket +%{_prefix}/lib/systemd/system/basic.target.wants/*.service +%{_prefix}/lib/systemd/system/sockets.target.wants/*.socket %files -n libudev %doc src/COPYING -%attr(0755,root,root) /%{_lib}/libudev.so.* +%attr(0755,root,root) %{_libdir}/libudev.so.* %files -n libudev-devel %doc src/docs/html/* @@ -158,7 +161,7 @@ systemctl daemon-reload >/dev/null 2>&1 || : %files -n libgudev1 %doc src/extras/gudev/COPYING -%attr(0755,root,root) /%{_lib}/libgudev-1.0.so.* +%attr(0755,root,root) %{_libdir}/libgudev-1.0.so.* %attr(0644,root,root) %{_libdir}/girepository-1.0/GUdev-1.0.typelib %files -n libgudev1-devel @@ -173,7 +176,11 @@ systemctl daemon-reload >/dev/null 2>&1 || : %attr(0644,root,root) %{_libdir}/pkgconfig/gudev-1.0* %changelog -* Wed Jan 25 2012 Kay Sievers 180-1 +* Sun Jan 29 2012 Kay Sievers 180-2 + - install everything in /usr + https://fedoraproject.org/wiki/Features/UsrMove + +* Sun Jan 29 2012 Kay Sievers 180-1 - version 180 - fix rule execution (brc#785148) - ID_PART_* export for udisks2 From 9646fdce3ab5383710aefaaac5a944347b8e9dec Mon Sep 17 00:00:00 2001 From: Kay Sievers Date: Fri, 3 Feb 2012 11:36:31 +0100 Subject: [PATCH 136/142] test building with filesystem guard --- udev.spec | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/udev.spec b/udev.spec index 82c072b..1b2c087 100644 --- a/udev.spec +++ b/udev.spec @@ -1,7 +1,7 @@ Summary: A rule-based device node and kernel event manager Name: udev Version: 180 -Release: 2%{?dist} +Release: 3%{?dist} License: GPLv2+ Group: System Environment/Base Source: ftp://ftp.kernel.org/pub/linux/utils/kernel/hotplug/%{name}-%{version}.tar.xz @@ -25,7 +25,7 @@ Requires: systemd-units Requires: util-linux >= 2.15.1 Conflicts: systemd < 39 Conflicts: dracut < 013-93 -Conflicts: filesystem < 3 +Conflicts: filesystem < 3-2 %ifarch s390 s390x # Require s390utils-base, because it's essential on s390 @@ -176,6 +176,9 @@ systemctl daemon-reload >/dev/null 2>&1 || : %attr(0644,root,root) %{_libdir}/pkgconfig/gudev-1.0* %changelog +* Fri Feb 3 2012 Kay Sievers 180-3 + - require an newer filesystem (repo test rebuild) + * Sun Jan 29 2012 Kay Sievers 180-2 - install everything in /usr https://fedoraproject.org/wiki/Features/UsrMove From d138c6fc556b77a1c7cb6764a2389af39a3f0d18 Mon Sep 17 00:00:00 2001 From: Kay Sievers Date: Tue, 7 Feb 2012 02:10:33 +0100 Subject: [PATCH 137/142] version 181 --- .gitignore | 2 +- sources | 2 +- udev.spec | 15 ++++++++++----- 3 files changed, 12 insertions(+), 7 deletions(-) diff --git a/.gitignore b/.gitignore index fc16718..74b8c82 100644 --- a/.gitignore +++ b/.gitignore @@ -1 +1 @@ -/udev-180.tar.xz +/udev-181.tar.xz diff --git a/sources b/sources index c1d8327..e40f349 100644 --- a/sources +++ b/sources @@ -1 +1 @@ -b8fb801e7d8371d1bc5c80535008d608 udev-180.tar.xz +ef86e3e1b4f3eaa9d8c72ac76b9466a7 udev-181.tar.xz diff --git a/udev.spec b/udev.spec index 1b2c087..7d30523 100644 --- a/udev.spec +++ b/udev.spec @@ -1,7 +1,7 @@ Summary: A rule-based device node and kernel event manager Name: udev -Version: 180 -Release: 3%{?dist} +Version: 181 +Release: 1%{?dist} License: GPLv2+ Group: System Environment/Base Source: ftp://ftp.kernel.org/pub/linux/utils/kernel/hotplug/%{name}-%{version}.tar.xz @@ -14,7 +14,7 @@ BuildRequires: glib2-devel BuildRequires: hwdata BuildRequires: gobject-introspection-devel >= 0.6.2 BuildRequires: usbutils >= 0.82 -BuildRequires: kmod-devel >= 4 +BuildRequires: kmod-devel >= 5 BuildRequires: libblkid-devel >= 2.20 Obsoletes: dev <= 0:3.12-1 Provides: dev = 0:3.12-2 @@ -176,11 +176,16 @@ systemctl daemon-reload >/dev/null 2>&1 || : %attr(0644,root,root) %{_libdir}/pkgconfig/gudev-1.0* %changelog +* Tue Feb 7 2012 Kay Sievers 181-1 +- version 181 + - require kmod 5 + - provide /dev/cdrom for /dev/sr0 + * Fri Feb 3 2012 Kay Sievers 180-3 - - require an newer filesystem (repo test rebuild) +- require an newer filesystem (repo test rebuild) * Sun Jan 29 2012 Kay Sievers 180-2 - - install everything in /usr +- install everything in /usr https://fedoraproject.org/wiki/Features/UsrMove * Sun Jan 29 2012 Kay Sievers 180-1 From 1fcd4845c9b26c2226bf4e20f75394e46142a7a6 Mon Sep 17 00:00:00 2001 From: Kay Sievers Date: Thu, 9 Feb 2012 13:08:07 +0100 Subject: [PATCH 138/142] rebuild with fixed binutils --- udev.spec | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/udev.spec b/udev.spec index 7d30523..660f4fa 100644 --- a/udev.spec +++ b/udev.spec @@ -1,7 +1,7 @@ Summary: A rule-based device node and kernel event manager Name: udev Version: 181 -Release: 1%{?dist} +Release: 2%{?dist} License: GPLv2+ Group: System Environment/Base Source: ftp://ftp.kernel.org/pub/linux/utils/kernel/hotplug/%{name}-%{version}.tar.xz @@ -16,8 +16,6 @@ BuildRequires: gobject-introspection-devel >= 0.6.2 BuildRequires: usbutils >= 0.82 BuildRequires: kmod-devel >= 5 BuildRequires: libblkid-devel >= 2.20 -Obsoletes: dev <= 0:3.12-1 -Provides: dev = 0:3.12-2 Requires(pre): fileutils Requires(pre): /usr/bin/getent /usr/sbin/groupadd Requires: hwdata @@ -176,6 +174,10 @@ systemctl daemon-reload >/dev/null 2>&1 || : %attr(0644,root,root) %{_libdir}/pkgconfig/gudev-1.0* %changelog +* Thu Feb 09 2012 Kay Sievers - 181-2 +- rebuild with fixed binutils +- remove 'dev' package dependency handling + * Tue Feb 7 2012 Kay Sievers 181-1 - version 181 - require kmod 5 From b59133e5f90761a437061d6c1c74a7765afe4894 Mon Sep 17 00:00:00 2001 From: Kay Sievers Date: Sun, 18 Mar 2012 20:24:36 +0100 Subject: [PATCH 139/142] version 182 --- .gitignore | 2 +- sources | 2 +- udev.spec | 17 ++++++++++++----- 3 files changed, 14 insertions(+), 7 deletions(-) diff --git a/.gitignore b/.gitignore index 74b8c82..fbb633d 100644 --- a/.gitignore +++ b/.gitignore @@ -1 +1 @@ -/udev-181.tar.xz +/udev-182.tar.xz diff --git a/sources b/sources index e40f349..9690345 100644 --- a/sources +++ b/sources @@ -1 +1 @@ -ef86e3e1b4f3eaa9d8c72ac76b9466a7 udev-181.tar.xz +d0a1ac9501d7c4ae68839d1b601592b8 udev-182.tar.xz diff --git a/udev.spec b/udev.spec index 660f4fa..dc7af54 100644 --- a/udev.spec +++ b/udev.spec @@ -1,7 +1,7 @@ Summary: A rule-based device node and kernel event manager Name: udev -Version: 181 -Release: 2%{?dist} +Version: 182 +Release: 1%{?dist} License: GPLv2+ Group: System Environment/Base Source: ftp://ftp.kernel.org/pub/linux/utils/kernel/hotplug/%{name}-%{version}.tar.xz @@ -129,7 +129,7 @@ systemctl daemon-reload >/dev/null 2>&1 || : %postun -n libgudev1 -p /sbin/ldconfig %files -%doc NEWS COPYING README TODO ChangeLog src/extras/keymap/README.keymap.txt +%doc NEWS COPYING README TODO ChangeLog src/keymap/README.keymap.txt %{_bindir}/udevadm %{_sbindir}/udevadm %{_prefix}/lib/udev @@ -158,12 +158,12 @@ systemctl daemon-reload >/dev/null 2>&1 || : %{_datadir}/gtk-doc/html/libudev/* %files -n libgudev1 -%doc src/extras/gudev/COPYING +%doc src/gudev/COPYING %attr(0755,root,root) %{_libdir}/libgudev-1.0.so.* %attr(0644,root,root) %{_libdir}/girepository-1.0/GUdev-1.0.typelib %files -n libgudev1-devel -%doc src/extras/gudev/docs/html/* +%doc src/gudev/docs/html/* %attr(0755,root,root) %{_libdir}/libgudev-1.0.so %dir %attr(0755,root,root) %{_includedir}/gudev-1.0 %dir %attr(0755,root,root) %{_includedir}/gudev-1.0/gudev @@ -174,6 +174,13 @@ systemctl daemon-reload >/dev/null 2>&1 || : %attr(0644,root,root) %{_libdir}/pkgconfig/gudev-1.0* %changelog +* Sun Mar 18 2012 Kay Sievers - 182-1 +- version 182 + - enable USB sutosuspend for some built-in HID devices + - do not create /dev/disk/by-path/ for 'ATA transport class' devices + - do not create /dev/disk/by-id/scsi-* for pure ATA devices + - let rules file in /etc override rules with the same name in /run + * Thu Feb 09 2012 Kay Sievers - 181-2 - rebuild with fixed binutils - remove 'dev' package dependency handling From 38609fdb7ff28c251c81e709afc21a001612dd8c Mon Sep 17 00:00:00 2001 From: Harald Hoyer Date: Tue, 27 Mar 2012 16:54:27 +0200 Subject: [PATCH 140/142] udev-182-2 - removed s390 rules --- udev.spec | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/udev.spec b/udev.spec index dc7af54..93ff898 100644 --- a/udev.spec +++ b/udev.spec @@ -1,7 +1,7 @@ Summary: A rule-based device node and kernel event manager Name: udev Version: 182 -Release: 1%{?dist} +Release: 2%{?dist} License: GPLv2+ Group: System Environment/Base Source: ftp://ftp.kernel.org/pub/linux/utils/kernel/hotplug/%{name}-%{version}.tar.xz @@ -104,9 +104,6 @@ mkdir -p -m 0755 $RPM_BUILD_ROOT%{_prefix}/lib/firmware mkdir -p -m 0755 $RPM_BUILD_ROOT%{_prefix}/lib/firmware/updates mkdir -p -m 0755 $RPM_BUILD_ROOT%{_sbindir} ln -sf ../bin/udevadm $RPM_BUILD_ROOT%{_sbindir}/udevadm -%ifarch s390 s390x -install -m 0644 rules/arch/40-s390.rules $RPM_BUILD_ROOT%{_prefix}/lib/udev/rules.d -%endif %pre getent group cdrom >/dev/null || /usr/sbin/groupadd -g 11 cdrom || : @@ -174,6 +171,9 @@ systemctl daemon-reload >/dev/null 2>&1 || : %attr(0644,root,root) %{_libdir}/pkgconfig/gudev-1.0* %changelog +* Tue Mar 27 2012 Harald Hoyer 182-2 +- removed s390 rules + * Sun Mar 18 2012 Kay Sievers - 182-1 - version 182 - enable USB sutosuspend for some built-in HID devices From a07cb8f5f4171b869e6644fd507e84a34eadff2f Mon Sep 17 00:00:00 2001 From: Kay Sievers Date: Thu, 24 May 2012 22:51:05 +0200 Subject: [PATCH 141/142] drop dependency on specific udev daemon verison --- udev.spec | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/udev.spec b/udev.spec index 93ff898..437d229 100644 --- a/udev.spec +++ b/udev.spec @@ -1,7 +1,7 @@ Summary: A rule-based device node and kernel event manager Name: udev Version: 182 -Release: 2%{?dist} +Release: 3%{?dist} License: GPLv2+ Group: System Environment/Base Source: ftp://ftp.kernel.org/pub/linux/utils/kernel/hotplug/%{name}-%{version}.tar.xz @@ -40,7 +40,6 @@ removed from the system. %package -n libudev Summary: Dynamic library to access udev device information Group: System Environment/Libraries -Requires: udev = %{version}-%{release} Conflicts: filesystem < 3 License: LGPLv2+ @@ -171,6 +170,9 @@ systemctl daemon-reload >/dev/null 2>&1 || : %attr(0644,root,root) %{_libdir}/pkgconfig/gudev-1.0* %changelog +* Thu May 24 2012 Kay Sievers - 182-3 +- libudev: drop dependency on specific udev daemon version + * Tue Mar 27 2012 Harald Hoyer 182-2 - removed s390 rules From ce9320b04bb17d68672063a8a8308ad8721c14a1 Mon Sep 17 00:00:00 2001 From: Kay Sievers Date: Wed, 11 Jul 2012 14:28:30 +0200 Subject: [PATCH 142/142] obsolete udev, it is replaced by systemd --- .gitignore | 1 - Makefile.git | 6 - dead.package | 1 + mirrors | 1 - sources | 1 - udev.spec | 1536 -------------------------------------------------- 6 files changed, 1 insertion(+), 1545 deletions(-) delete mode 100644 .gitignore delete mode 100644 Makefile.git create mode 100644 dead.package delete mode 100644 mirrors delete mode 100644 sources delete mode 100644 udev.spec diff --git a/.gitignore b/.gitignore deleted file mode 100644 index fbb633d..0000000 --- a/.gitignore +++ /dev/null @@ -1 +0,0 @@ -/udev-182.tar.xz diff --git a/Makefile.git b/Makefile.git deleted file mode 100644 index ea5486a..0000000 --- a/Makefile.git +++ /dev/null @@ -1,6 +0,0 @@ -Patch: - @for i in 00*.patch; do n=$$[$$(echo $$i|cut -f 1 -d '-'|sed -e 's#^0*##')]; echo "Patch$$n: $$i";done - -patch: - @for i in 00*.patch; do n=$$[$$(echo $$i|cut -f 1 -d '-'|sed -e 's#^0*##')]; echo "%patch$$n -p1 -b .git$$n";done - diff --git a/dead.package b/dead.package new file mode 100644 index 0000000..401b5da --- /dev/null +++ b/dead.package @@ -0,0 +1 @@ +obsolete udev, it is replaced by systemd diff --git a/mirrors b/mirrors deleted file mode 100644 index 74b0af6..0000000 --- a/mirrors +++ /dev/null @@ -1 +0,0 @@ -ftp://ftp.kernel.org/pub/linux/utils/kernel/hotplug/ diff --git a/sources b/sources deleted file mode 100644 index 9690345..0000000 --- a/sources +++ /dev/null @@ -1 +0,0 @@ -d0a1ac9501d7c4ae68839d1b601592b8 udev-182.tar.xz diff --git a/udev.spec b/udev.spec deleted file mode 100644 index 437d229..0000000 --- a/udev.spec +++ /dev/null @@ -1,1536 +0,0 @@ -Summary: A rule-based device node and kernel event manager -Name: udev -Version: 182 -Release: 3%{?dist} -License: GPLv2+ -Group: System Environment/Base -Source: ftp://ftp.kernel.org/pub/linux/utils/kernel/hotplug/%{name}-%{version}.tar.xz -URL: http://www.kernel.org/pub/linux/utils/kernel/hotplug/udev.html -BuildRequires: libtool -BuildRequires: pkgconfig -BuildRequires: gperf -BuildRequires: libselinux-devel libsepol-devel -BuildRequires: glib2-devel -BuildRequires: hwdata -BuildRequires: gobject-introspection-devel >= 0.6.2 -BuildRequires: usbutils >= 0.82 -BuildRequires: kmod-devel >= 5 -BuildRequires: libblkid-devel >= 2.20 -Requires(pre): fileutils -Requires(pre): /usr/bin/getent /usr/sbin/groupadd -Requires: hwdata -Requires: systemd-units -Requires: util-linux >= 2.15.1 -Conflicts: systemd < 39 -Conflicts: dracut < 013-93 -Conflicts: filesystem < 3-2 - -%ifarch s390 s390x -# Require s390utils-base, because it's essential on s390 -Requires: s390utils-base -%endif - -%description -udev is a collection of tools and a daemon to manage events received -from the kernel and deal with them in user-space. Primarily this -involves managing permissions, and creating and removing meaningful -symlinks to device nodes in /dev when hardware is discovered or -removed from the system. - -%package -n libudev -Summary: Dynamic library to access udev device information -Group: System Environment/Libraries -Conflicts: filesystem < 3 -License: LGPLv2+ - -%description -n libudev -This package contains the dynamic library libudev, which provides access -to udev device information, and an interface to search devices in sysfs. - -%package -n libudev-devel -Summary: Development files for libudev -Group: Development/Libraries -Requires: libudev = %{version}-%{release} -Requires: pkgconfig -License: LGPLv2+ - -%description -n libudev-devel -This package contains the development files for the library libudev, a -dynamic library, which provides access to udev device information. - -%package -n libgudev1 -Summary: Libraries for adding libudev support to applications that use glib -Group: Development/Libraries -Requires: libudev = %{version}-%{release} -Conflicts: filesystem < 3 -License: LGPLv2+ - -%description -n libgudev1 -This package contains the libraries that make it easier to use libudev -functionality from applications that use glib. - -%package -n libgudev1-devel -Summary: Header files for adding libudev support to applications that use glib -Group: Development/Libraries -Requires: libgudev1 = %{version}-%{release} -License: LGPLv2+ - -%description -n libgudev1-devel -This package contains the header and pkg-config files for developing -glib-based applications using libudev functionality. - -%prep -%setup -q - -%build -# prevent man pages from re-building (xsltproc) -find . -name "*.[1-8]" -exec touch '{}' \; -export CFLAGS="$CFLAGS $RPM_OPT_FLAGS -fPIE -DPIE -pie -Wl,-z,relro -Wl,-z,now" -export V=1 -%configure \ - --prefix=%{_prefix} \ - --sysconfdir=%{_sysconfdir} \ - --libexecdir=%{_prefix}/lib \ - --with-selinux \ - --with-systemdsystemunitdir=%{_prefix}/lib/systemd/system -make %{?_smp_mflags} - -%install -make install DESTDIR=$RPM_BUILD_ROOT -rm -fr $RPM_BUILD_ROOT%{_docdir}/udev -rm -f $RPM_BUILD_ROOT/%{_libdir}/*.la -mkdir -p -m 0755 $RPM_BUILD_ROOT%{_prefix}/lib/firmware -mkdir -p -m 0755 $RPM_BUILD_ROOT%{_prefix}/lib/firmware/updates -mkdir -p -m 0755 $RPM_BUILD_ROOT%{_sbindir} -ln -sf ../bin/udevadm $RPM_BUILD_ROOT%{_sbindir}/udevadm - -%pre -getent group cdrom >/dev/null || /usr/sbin/groupadd -g 11 cdrom || : -getent group tape >/dev/null || /usr/sbin/groupadd -g 33 tape || : -getent group dialout >/dev/null || /usr/sbin/groupadd -g 18 dialout || : -getent group floppy >/dev/null || /usr/sbin/groupadd -g 19 floppy || : -systemctl stop udev.service udev-control.socket udev-kernel.socket >/dev/null 2>&1 || : - -%post -systemctl daemon-reload >/dev/null 2>&1 || : -systemctl start udev.service >/dev/null 2>&1 || : - -%postun -systemctl daemon-reload >/dev/null 2>&1 || : - -%post -n libudev -p /sbin/ldconfig -%postun -n libudev -p /sbin/ldconfig - -%post -n libgudev1 -p /sbin/ldconfig -%postun -n libgudev1 -p /sbin/ldconfig - -%files -%doc NEWS COPYING README TODO ChangeLog src/keymap/README.keymap.txt -%{_bindir}/udevadm -%{_sbindir}/udevadm -%{_prefix}/lib/udev -%config(noreplace) %attr(0644,root,root) %{_sysconfdir}/udev/udev.conf -%attr(0755,root,root) %dir %{_sysconfdir}/udev/ -%attr(0755,root,root) %dir %{_sysconfdir}/udev/rules.d/ -%attr(0644,root,root) %{_mandir}/man7/*.7* -%attr(0644,root,root) %{_mandir}/man8/*.8* -%{_datadir}/pkgconfig/udev.pc -%dir %attr(0755,root,root) %{_prefix}/lib/firmware -%dir %attr(0755,root,root) %{_prefix}/lib/firmware/updates -%attr(0644,root,root) %{_prefix}/lib/systemd/system/*.service -%attr(0644,root,root) %{_prefix}/lib/systemd/system/*.socket -%{_prefix}/lib/systemd/system/basic.target.wants/*.service -%{_prefix}/lib/systemd/system/sockets.target.wants/*.socket - -%files -n libudev -%doc src/COPYING -%attr(0755,root,root) %{_libdir}/libudev.so.* - -%files -n libudev-devel -%doc src/docs/html/* -%{_includedir}/libudev.h -%{_libdir}/libudev.so -%{_libdir}/pkgconfig/libudev.pc -%{_datadir}/gtk-doc/html/libudev/* - -%files -n libgudev1 -%doc src/gudev/COPYING -%attr(0755,root,root) %{_libdir}/libgudev-1.0.so.* -%attr(0644,root,root) %{_libdir}/girepository-1.0/GUdev-1.0.typelib - -%files -n libgudev1-devel -%doc src/gudev/docs/html/* -%attr(0755,root,root) %{_libdir}/libgudev-1.0.so -%dir %attr(0755,root,root) %{_includedir}/gudev-1.0 -%dir %attr(0755,root,root) %{_includedir}/gudev-1.0/gudev -%attr(0644,root,root) %{_includedir}/gudev-1.0/gudev/*.h -%attr(0644,root,root) %{_datadir}/gir-1.0/GUdev-1.0.gir -%dir %{_datadir}/gtk-doc/html/gudev -%attr(0644,root,root) %{_datadir}/gtk-doc/html/gudev/* -%attr(0644,root,root) %{_libdir}/pkgconfig/gudev-1.0* - -%changelog -* Thu May 24 2012 Kay Sievers - 182-3 -- libudev: drop dependency on specific udev daemon version - -* Tue Mar 27 2012 Harald Hoyer 182-2 -- removed s390 rules - -* Sun Mar 18 2012 Kay Sievers - 182-1 -- version 182 - - enable USB sutosuspend for some built-in HID devices - - do not create /dev/disk/by-path/ for 'ATA transport class' devices - - do not create /dev/disk/by-id/scsi-* for pure ATA devices - - let rules file in /etc override rules with the same name in /run - -* Thu Feb 09 2012 Kay Sievers - 181-2 -- rebuild with fixed binutils -- remove 'dev' package dependency handling - -* Tue Feb 7 2012 Kay Sievers 181-1 -- version 181 - - require kmod 5 - - provide /dev/cdrom for /dev/sr0 - -* Fri Feb 3 2012 Kay Sievers 180-3 -- require an newer filesystem (repo test rebuild) - -* Sun Jan 29 2012 Kay Sievers 180-2 -- install everything in /usr - https://fedoraproject.org/wiki/Features/UsrMove - -* Sun Jan 29 2012 Kay Sievers 180-1 -- version 180 - - fix rule execution (brc#785148) - - ID_PART_* export for udisks2 -- temporarily revert 'install everything in /usr' to be - able to update teh current rawhide package without the - dependency on the /usr-move converted filessytem - -* Wed Jan 25 2012 Kay Sievers 179-3 -- use %{_sbindir} - -* Wed Jan 25 2012 Kay Sievers 179-2 -- install everything in /usr - https://fedoraproject.org/wiki/Features/UsrMove - -* Wed Jan 25 2012 Kay Sievers 179-1 -- version 179 - - devtmpfs is mandatory now - - /run is mandatory now - - modules are loaded with 'libkmod' - - blkid is built-in now - -* Sat Jan 14 2012 Fedora Release Engineering - 175-2 -- Rebuilt for https://fedoraproject.org/wiki/Fedora_17_Mass_Rebuild - -* Mon Nov 7 2011 Kay Sievers 175-1 -- version 175 - - bug fix release - -* Sat Oct 22 2011 Kay Sievers 174-2 -- ignore entire rule when a key is unknown (brc#748082) - -* Thu Oct 20 2011 Kay Sievers 174-1 -- version 174 - - path_id, usb_id, input_id tools are built-in commands - - fusectl is mounted by systemd - - SYSFS=, ID=, BUS= are removed - - udevadm trigger --type=failed is removed - - udev control socket is now in /run/udev/control - - disable persistent net and cdrom rule generator -- remove obsolete rpm dependencies -- remove SYSV init script controls - -* Mon Aug 29 2011 Kay Sievers 173-3 -- fix bluetooth input device handling (brc#733862) - -* Mon Aug 29 2011 Daniel Drake 173-2 -- Update OLPC XO keymap - -* Mon Aug 01 2011 Harald Hoyer 173-1 -- version 173 -- udev-acl functionality is in systemd - -* Wed Jul 20 2011 Harald Hoyer 172-2 -- removed loop devices (should be compiled in the kernel) -- removed deprecated directories -- removed scsi_id symlink -- cleanup of requirements - -* Mon Jul 11 2011 Harald Hoyer 172-1 -- version 172 - -* Mon Jun 20 2011 Harald Hoyer 171-2 -- build without introspection -- removed unused dirs -- added ConsoleKit dirs - -* Fri May 27 2011 Harald Hoyer 171-1 -- version 171 - -* Fri May 20 2011 Harald Hoyer 170-1 -- version 170 -- removed /sbin/start_udev - -* Mon Apr 11 2011 Harald Hoyer 167-4 -- more selinux fixes - -* Thu Apr 7 2011 Adam Williamson - 167-3 -- selinux_label.patch: from upstream, don't label files outside of /dev - -* Thu Mar 31 2011 Harald Hoyer 167-2 -- fixed udev-trigger.service - -* Wed Mar 30 2011 Harald Hoyer 167-1 -- version 167 - -* Wed Mar 23 2011 Harald Hoyer 166-2 -- add ACLs for harmony remote controls -Resolves: rhbz#559412 -- fixed CDROM profile handling - -* Wed Feb 16 2011 Harald Hoyer 166-1 -- renamed udev-post initscript to udev-retry to match - upstream systemd service name -- version 166 - -* Mon Feb 07 2011 Fedora Release Engineering - 164-9 -- Rebuilt for https://fedoraproject.org/wiki/Fedora_15_Mass_Rebuild - -* Wed Feb 02 2011 Harald Hoyer 164-8 -- fixed: network device renaming 2-step exceeds IFNAMSIZ -Resolves: rhbz#673675 -- removed v4l version 1 - -* Fri Jan 21 2011 Harald Hoyer 164-7 -- removed unnecessary devices from /lib/udev/devices - -* Mon Dec 06 2010 Harald Hoyer 164-6 -- removed MAKEDEV symlink -Resolves: rhbz#660091 -- fixed kill loop -Resolves: rhbz#657651 - -* Thu Nov 25 2010 Bastien Nocera 164-5 -- Add patches to fix touchpad toggle key handling - -* Fri Nov 12 2010 Harald Hoyer 164-4 -- add ACLs for PDA devices -Resolves: rhbz#642435 - -* Fri Nov 12 2010 Harald Hoyer 164-3 -- enlarged the import buffer to fix the ressize bugs -Resolves: rhbz#652318 - -* Fri Nov 12 2010 Harald Hoyer 164-2 -- do not create mount point dirs in /dev - -* Fri Oct 29 2010 Harald Hoyer 164-1 -- version 164 -- skip start_udev with systemd - -* Wed Sep 29 2010 jkeating - 161-4 -- Rebuilt for gcc bug 634757 - -* Tue Sep 21 2010 Matthias Clasen 161-3 -- Rebuild against newer gobject-introspection - -* Wed Sep 01 2010 Harald Hoyer 161-2 -- bugfixes for systemd service files -- bugfix for selinux labeling -- bugfixes for cdrom_id - -* Tue Aug 17 2010 Harald Hoyer 161-1 -- udev-161 with an upstream quirk for the qemu cdrom and - more cdrom handling bugfixes -Resolves: rhbz#609049 rhbz#624286 -- added floppy group -Resolves: rhbz#620814 - -* Fri Aug 06 2010 Harald Hoyer 160-9 -- added quirk to cdrom_id, to boot from qemu -Resolves: rhbz#609049 -- fix console switching and ACLs -Resolves: rhbz#608712 -- minor bugfixes - -* Tue Jul 20 2010 Harald Hoyer 160-8 -- make loop block device again - -* Tue Jul 20 2010 Harald Hoyer 160-7 -- turn off hotplug in /sys/kernel/uevent_helper or /proc/sys/kernel/hotplug - -* Thu Jul 15 2010 Harald Hoyer 160-6 -- add versioned requires for libudev to udev - -* Wed Jul 14 2010 Dan Horák 160-5 -- update paths to arch-specific rules - -* Tue Jul 13 2010 Lennart Poettering - 160-4 -- Comment systemd-install for now as long as sysinit is not split into pieces - -* Tue Jul 13 2010 Lennart Poettering - 160-3 -- Update systemd-install lines to use --realize instead of --start (which got renamed in systemd) - -* Tue Jul 13 2010 Lennart Poettering - 160-2 -- Don't require systemd .pc file, to break build dependency cycle - -* Tue Jul 13 2010 Harald Hoyer 160-1 -- version 160 -- add systemd service files -- fixed COPYRIGHT files - -* Fri Jun 25 2010 Harald Hoyer 158-2 -- moved udev pkgconfig to base file on authors request -- specfile cleanups - -* Thu Jun 24 2010 Harald Hoyer 158-1 -- version 158 - -* Thu May 27 2010 Harald Hoyer 156-2 -- cleaned up start_udev and udev-post initscript -- removed redhat specific rules -- removed all the makedev.d stuff, udevd now natively supports - /lib/udev/devices -- added basic devices in /lib/udev/devices - -* Tue May 25 2010 Harald Hoyer 156-1 -- version 156 - -* Tue May 25 2010 Harald Hoyer 155-1 -- version 155 - -* Wed May 12 2010 Harald Hoyer 154-1 -- version 154 - -* Tue Apr 27 2010 Harald Hoyer 153-1.20100427git -- version 153 - -* Tue Apr 13 2010 Harald Hoyer 152-0.1.20100413git -- pre release of version 152 - -* Mon Mar 22 2010 Harald Hoyer 151-8 -- only correct the timestamp, if UTC=="no" - -* Mon Mar 22 2010 Harald Hoyer 151-7 -- touch with "--no-create", will not use open() - and trigger devs/watchdogs (bug #575417) - -* Mon Mar 22 2010 Harald Hoyer 151-6 -- fixed return code of touching the device nodes [FAIL] -> [OK] - -* Fri Mar 19 2010 Harald Hoyer 151-5 -- add "-D" to gperf call - -* Fri Mar 19 2010 Harald Hoyer 151-4 -- add patch for virtio-ports (#569700) -- own libgudev dirs (#561319) -- minor udev startup script improvements (#549518) -- create /dev/hugepages subdir in start_udev (#541998) -- remove GPL COPYING file from LGPL subpackages (#536843) -- removed symlinks to udevadm -- touch all device nodes after udev settled for the timezone - timestamp (#569335) -- add some upstream bugfixes - -* Sun Feb 07 2010 Kyle McMartin 151-3 -- udev-86a7a2f-fix-missing-firmware.patch: fix hang when loading - microcode (since microcode_intel tries to probe firmware which does - not exist. *sigh*) - -* Fri Jan 29 2010 Harald Hoyer 151-2 -- fixed rules and startup script (#559844) - -* Wed Jan 27 2010 Harald Hoyer 151-1 -- version 151 -- fixed udev-post initscript -- only require s390utils-base, rather than s390utils (#553156) - -* Tue Nov 24 2009 Harald Hoyer 147-2 -- require s390utils, because it's essential on s390 - -* Thu Nov 12 2009 Harald Hoyer 147-1 -- version 147 -- Fix upgrade from Fedora 11 with bluez installed (#533925) -- obsolete DeviceKit and DeviceKit-devel (#532961) -- fixed udev-post exit codes (#523976) -- own directory /lib/udev/keymaps (#521801) -- no more floppy modaliases (#514329) -- added one more modems to modem-modeswitch.rules (#515349) -- add NEWS file to the doc section -- automatically turn on hotplugged CPUs (rhbz#523127) -- recognize a devtmpfs on /dev (bug #528488) - -* Fri Oct 09 2009 Harald Hoyer 147-0.1.gitdf3e07d -- pre 147 -- database format changed -- lots of potential buffer overflow fixes - -* Tue Sep 29 2009 Harald Hoyer 145-10 -- add ConsoleKit patch for ConsoleKit 0.4.1 - -* Fri Sep 25 2009 harald@redhat.com 145-9 -- add patches to fix cdrom_id -- add patch to fix the inotify bug (bug #524752) - -* Wed Sep 23 2009 harald@redhat.com 145-8 -- obsolete libgudev and libgudev-devel (bug #523569) - -* Mon Aug 24 2009 Karsten Hopp 145-7 -- drop ifnarch s390x for usbutils, as we now have usbutils for s390x - -* Mon Aug 24 2009 Harald Hoyer 145-6 -- ifnarch s390 for usbutils - -* Tue Aug 04 2009 Harald Hoyer 145-5 -- do not make extra nodes in parallel -- restorecon on /dev - -* Tue Aug 04 2009 Harald Hoyer 145-4 -- --enable-debug -- add patch for timestamps in debugging output - -* Wed Jul 29 2009 Harald Hoyer 145-3 -- add patch from upstream git to fix bug #514086 -- add version to usbutils build requirement - -* Fri Jul 24 2009 Harald Hoyer 145-2 -- fix file permissions -- remove rpath -- chkconfig --add for udev-post -- fix summaries -- add "Required-Stop" to udev-post - -* Tue Jul 14 2009 Harald Hoyer 145-1 -- version 145 -- add "udevlog" kernel command line option to redirect the - output of udevd to /dev/.udev/udev.log - -* Fri Jul 03 2009 Harald Hoyer 143-2 -- add acpi floppy modalias -- add retrigger of failed events in udev-post.init -- killall pids of udev in %%pre - -* Fri Jun 19 2009 Harald Hoyer 143-1 -- version 143 - -* Thu Jun 08 2009 Harald Hoyer 142-4 -- git fix: udevadm: settle - fix timeout -- git fix: OWNER/GROUP: fix if logic -- git fix: rule-generator: cd - skip by-path links if we create by-id links -- git fix: fix possible endless loop for GOTO to non-existent LABEL -- git fix: cdrom_id: suppress ID_CDROM_MEDIA_STATE=blank for plain non-writable - CDROM media - -* Thu Jun 08 2009 Harald Hoyer 142-3 -- delay device-mapper changes - -* Fri Jun 05 2009 Bastien Nocera 142-2 -- Rebuild in dist-f12 - -* Fri May 15 2009 Harald Hoyer 142-1 -- version 142 -- no more libvolume_id and vol_id - -* Fri Apr 17 2009 Harald Hoyer 141-3 -- added /dev/fuse creation to start_udev - -* Thu Apr 16 2009 Harald Hoyer 141-2 -- fixed post and pre - -* Tue Apr 14 2009 Harald Hoyer 141-1 -- version 141 - -* Wed Apr 01 2009 Harald Hoyer 139-4 -- double the IMPORT buffer (bug #488554) -- Resolves: rhbz#488554 - -* Wed Apr 01 2009 Harald Hoyer 139-3 -- renamed modprobe /etc/modprobe.d/floppy-pnp to - /etc/modprobe.d/floppy-pnp.conf (bug #492732 #488768) -- Resolves: rhbz#492732 - -* Tue Mar 03 2009 Harald Hoyer 139-2 -- speedup of start_udev by doing make_extra_nodes in parallel to - the daemon start - -* Fri Feb 27 2009 Harald Hoyer 139-1 -- version 139 - -* Wed Feb 25 2009 Fedora Release Engineering - 137-5 -- Rebuilt for https://fedoraproject.org/wiki/Fedora_11_Mass_Rebuild - -* Thu Feb 05 2009 Harald Hoyer 137-4 -- fixed md change/remove event handling - -* Thu Feb 05 2009 Harald Hoyer 137-3 -- added 5 second sleep for "modprobedebug" to catch bad modules - -* Fri Jan 30 2009 Harald Hoyer 137-2 -- moved groupadd to pre section (bug #483089) - -* Thu Jan 29 2009 Harald Hoyer 137-1 -- version 137 -- add vol_id patches from kzak -- dialout group has gid 18 now - -* Tue Jan 20 2009 Harald Hoyer 136-2 -- added some rule fixes, which will be in udev-137 - -* Tue Jan 20 2009 Harald Hoyer 136-1 -- test for restorecon in start_udev before it is used (bug #480608) -- added groups video audio cdrom tape dialout in post - (might be moved to MAKEDEV) -- version 136 - -* Tue Dec 16 2008 Harald Hoyer 135-3 -- added sepol patch - -* Tue Dec 16 2008 Harald Hoyer 135-2 -- changed udevsettle -> udevadm settle -- added doc to libudev-devel -- added more attr and defattr -- various rpmlint fixes - -* Tue Dec 02 2008 Harald Hoyer 135-1 -- version 135 - -* Wed Nov 19 2008 Harald Hoyer 133-1 -- version 133 - -* Mon Nov 10 2008 Harald Hoyer 132-1 -- version 132 -- added memory stick rules (bug #470096) - -* Thu Oct 16 2008 Harald Hoyer 127-2 -- added 2 patches for md raid vol_id - -* Mon Sep 01 2008 Harald Hoyer 127-1 -- version 127 - -* Fri Aug 08 2008 Harald Hoyer 126-1 -- version 126 -- fixed udevadm syntax in start_udev (credits B.J.W. Polman) -- removed some manually created devices from makedev (bug #457125) - -* Tue Jun 17 2008 Harald Hoyer 124-1.1 -- readded udevcontrol, udevtrigger symlinks for Fedora 9, - which are needed by live-cd-tools - -* Thu Jun 12 2008 Harald Hoyer 124-1 -- version 124 -- removed udevcontrol, udevtrigger symlinks (use udevadm now) - -* Tue Jun 3 2008 Jeremy Katz - 121-2.20080516git -- Add lost F9 change to remove /dev/.udev in start_udev (#442827) - -* Fri May 16 2008 Harald Hoyer 121-1.20080516git -- version 121 + latest git fixes - -* Thu May 07 2008 Harald Hoyer 120-6.20080421git -- added input/hp_ilo_mouse symlink - -* Tue May 06 2008 Harald Hoyer 120-5.20080421git -- remove /dev/.udev in start_udev (bug #442827) - -* Mon Apr 21 2008 Harald Hoyer 120-4.20080421git -- added patches from git: -- persistent device naming: also read unpartitioned media -- scsi_id: initialize serial strings -- logging: add trailing newline to all strings -- path_id: remove subsystem whitelist -- allow setting of MODE="0000" -- selinux: more context settings -- rules_generator: net rules - always add KERNEL== match to generated rules -- cdrom_id: replace with version which also exports media properties -- vol_id: add --offset option -- udevinfo: do not replace chars when printing ATTR== matches -- Resolves: rhbz#440568 - -* Fri Apr 11 2008 Harald Hoyer 120-3 -- fixed pre/preun scriptlets (bug #441941) -- removed fedora specific patch for selinux symlink handling - -* Sat Apr 05 2008 Harald Hoyer 120-2 -- removed warning about deprecated /lib/udev/devices (rhbz#440961) -- replaced /usr/bin/find with shell find function (rhbz#440961) - -* Fri Apr 04 2008 Harald Hoyer 120-1 -- version 120 - -* Mon Mar 17 2008 Harald Hoyer 118-11 -- removed /var/lib/udev/rules.d again - -* Fri Mar 14 2008 Harald Hoyer 118-10 -- turned off MAKEDEV cache, until the generated shell scripts - create new directories - -* Thu Mar 13 2008 Harald Hoyer 118-9 -- added more support for the "modprobedebug" kernel command - line option, to debug hanging kernel modules - -* Thu Mar 13 2008 Harald Hoyer 118-8 -- added /etc/sysconfig/udev to configure some speedups -- added "udevnopersist" as a kernel command line, to disable - persistent storage symlink generation - -* Thu Mar 13 2008 Harald Hoyer 118-7 -- files from /var/lib/udev/rules.d are copied to /dev/.udev/rules.d - at startup and back at shutdown -- persistent cd and net rules generate the files in - /dev/.udev/rules.d now -- added post section to symlink 70-persistent-cd.rules 70-persistent-net.rules - from /etc/udev/rules.d to /dev/.udev/rules.d - -* Thu Mar 13 2008 Harald Hoyer 118-6 -- moved all generated files to /var/lib/udev - (also 70-persistent-cd.rules 70-persistent-net.rules) -- added a caching mechanism for MAKEDEV (saves some seconds on startup) -- added trigger for selinux-policy and MAKEDEV to remove the udev cache files - -* Wed Feb 20 2008 Harald Hoyer 118-4 -- made symlinks relative (rhbz#432878) -- removed the backgrounding of node creation (rhbz#381461) -- do not change sg group ownership to disk for scanners (rhbz#432602) -- attempt to fix selinux symlink bug (rhbz#345071) -- fixed URL -- made rpmlint mostly happy -- disabled static version (no static selinux lib) - -* Mon Feb 18 2008 Fedora Release Engineering - 118-3 -- Autorebuild for GCC 4.3 - -* Wed Jan 09 2008 Harald Hoyer 118-2 -- reenabled static version - -* Tue Jan 08 2008 Harald Hoyer 118-1 -- version 118 -- removed old USB compat rule (rhbz#424331) -- disabled static version - -* Thu Oct 18 2007 Harald Hoyer 116-3 -- fixed preun chkconfig -- added /sbin path to chkconfig in post section -- patch: do not generate net rules for type > 256 -- fixes glitches appearing in bz#323991 - -* Tue Oct 16 2007 Dennis Gilmore 116-2 -- sparc64 requires -fPIE not -fpie - -* Mon Oct 15 2007 Harald Hoyer 116-1 -- version 116 - -* Fri Oct 12 2007 Harald Hoyer 115-5.20071012git -- added upstream patch for rhbz#328691 -- moved floppy module loading to pnp-alias in /etc/modprobe.d/floppy-pnp - -* Wed Oct 10 2007 Harald Hoyer 115-5.20070921git -- better modprobe options for the kernel command line 'modprobedebug' option - -* Fri Sep 21 2007 Harald Hoyer - 115-4 -- more upstream fixes from git - -* Thu Sep 20 2007 Harald Hoyer - 115-3 -- some upstream fixes from git -- removed last_rule for loop rules -- added "udevinfo udevtrace" kernel command line options for better debugging - -* Fri Sep 07 2007 Harald Hoyer - 115-2 -- some upstream fixes from git -- last_rule for loop rules (speedup for live-cds/qemu with 128 loop devices) - -* Thu Aug 24 2007 Harald Hoyer - 115-1 -- version 115 - -* Fri Aug 24 2007 Harald Hoyer - 113-12 -- removed /dev/tape symlink, because it's now a directory - (bug #251755) - -* Thu Aug 23 2007 Harald Hoyer - 114-4 -- added patch to prevent persistent net rules for virtual network interfaces, - like vmware and vlans - -* Thu Aug 23 2007 Harald Hoyer - 114-3 -- changed license tag -- changed to latest upstream rule ordering - -* Thu Aug 16 2007 Harald Hoyer - 113-11 -- readded firmware rule (#252983) - -* Wed Aug 15 2007 Harald Hoyer - 113-10 -- do not run vol_id on non-partition block devices (bug #251401) -- read all multiline pnp modaliases again - -* Mon Aug 13 2007 Harald Hoyer - 114-2 -- fixed isapnp rule (bug #251815) -- fix for nikon cameras (bug #251401) - -* Fri Aug 10 2007 Harald Hoyer - 114-1 -- version 114 -- big rule unification and cleanup -- added persistent names for network and cdrom devices over reboot - -* Wed Aug 08 2007 Harald Hoyer - 113-9 -- added lp* to 50-udev.nodes (#251272) - -* Mon Jul 30 2007 Harald Hoyer - 113-8 -- removed "noreplace" config tag from rules (#250043) - -* Fri Jul 27 2007 Harald Hoyer - 113-7 -- major rule cleanup -- removed persistent rules from 50 and included upstream rules -- removed skip_wait from modprobe - -* Fri Jul 20 2007 Harald Hoyer - 113-6 -- kernel does not provide usb_device anymore, - corrected the rules (#248916) - -* Thu Jul 19 2007 Harald Hoyer - 113-5 -- corrected the rule for usb devices (#248916) - -* Sat Jul 14 2007 Harald Hoyer - 113-4 -- do not collect modprobes (bug #222542), because firmware - loading seems to depend on it. - -* Mon Jul 9 2007 Harald Hoyer - 113-3 -- speedup things a little bit - -* Wed Jun 27 2007 Harald Hoyer - 113-2 -- added more firewire symlinks (#240770) -- minor rule patches - -* Tue Jun 26 2007 Harald Hoyer - 113-1 -- version 113 -- added rule for SD cards in a TI FlashMedia slot (#217070) - -* Tue Jun 26 2007 Harald Hoyer - 106-4.1 -- fixed modprobedebug option -- removed snd-powermac from the default modules (#200585) - -* Wed May 02 2007 Harald Hoyer - 106-4 -- do not skip all events on modprobe (#238385) -- Resolves: rhbz#238385 - -* Fri Apr 27 2007 Harald Hoyer - 106-3 -- modprobe only on modalias (bug #238140) -- make startup messages visible again -- speedup boot process by not executing pam_console_apply while booting -- Resolves: rhbz#238140 - -* Wed Apr 11 2007 Harald Hoyer - 106-2 -- create floppy device nodes with the correct selinux context (bug #235953) -- Resolves: rhbz#235953 - -* Wed Mar 7 2007 Harald Hoyer - 106-1 -- version 106 -- specfile cleanup -- removed pilot rule -- removed dasd_id and dasd_id rule -- provide static versions in a subpackage - -* Wed Feb 21 2007 Harald Hoyer - 105-1 -- version 105 - -* Tue Feb 6 2007 Harald Hoyer - 104-2 -- moved uinput to input subdirectory (rhbz#213854) -- added USB floppy symlinks (rhbz#185171) -- fixed ZIP drive handling (rhbz#223016) -- Resolves: rhbz#213854,rhbz#185171,rhbz#223016 - -* Tue Jan 23 2007 Harald Hoyer - 104-1 -- version 104 -- merged changes from RHEL - -* Wed Dec 6 2006 Harald Hoyer - 103-3 -- changed DRIVER to DRIVERS -- Resolves: rhbz#218160 - -* Fri Nov 10 2006 Harald Hoyer - 103-2 -- changed SYSFS to new ATTR rules -- Resolves: rhbz#214898 - -* Fri Nov 10 2006 Harald Hoyer - 103-1 -- Removed 51-hotplug.rules -- Resolves: rhbz#214277 - -* Wed Oct 11 2006 Harald Hoyer - 095-14 -- skip persistent block for gnbd devices (bug #210227) - -* Wed Oct 4 2006 Harald Hoyer - 095-13 -- fixed path_id script (bug #207139) - -* Tue Oct 3 2006 Jeremy Katz - 095-12 -- autoload mmc_block (#171687) - -* Wed Sep 27 2006 Harald Hoyer - 095-10 -- typo in xpram/slram rule (bug #205563) - -* Mon Sep 25 2006 Harald Hoyer - 095-9 -- improved error msg for firmware_helper (bug #206944) -- added xpram symlink to slram device nodes (bug #205563) -- removed infiniband rules (bug #206224) -- use newest path_id script (bug #207139) - -* Tue Aug 29 2006 Harald Hoyer - 095-8 -- fixed bug #204157 - -* Wed Aug 16 2006 Harald Hoyer - 095-7 -- added udevtimeout= - kernel command line parameters for start_udev - (default is to wait forever) - -* Wed Aug 16 2006 Harald Hoyer - 095-6 -- new speedup patch for selinux (bug #202673) - -* Thu Aug 10 2006 Harald Hoyer - 095-5 -- allow long comments (bug #200244) - -* Mon Aug 7 2006 Harald Hoyer - 095-4 -- fixed CAPI device nodes (bug #139321) -- fixed bug #201422 - -* Wed Jul 12 2006 Harald Hoyer - 095-3 -- more infiniband rules (bug #198501) - -* Wed Jul 12 2006 Jesse Keating - 095-2.1 -- rebuild - -* Thu Jul 6 2006 Harald Hoyer - 095-2 -- added option to debug udev with kernel cmdline option "udevdebug" - -* Wed Jul 5 2006 Harald Hoyer - 095-1 -- version 095 - -* Wed Jun 14 2006 Harald Hoyer - 094-1 -- version 094 - -* Sun May 21 2006 Peter Jones - 092-2 -- Fix typo in pam-console rule - -* Wed May 18 2006 Harald Hoyer - 092-1 -- version 092 -- corrected some rules (bug #192210 #190927) - -* Tue May 09 2006 Harald Hoyer - 091-3 -- corrected some rules (bug #190927) - -* Wed May 03 2006 Harald Hoyer - 091-2 -- added subpackages libvolume_id and libvolume_id-devel - -* Wed May 03 2006 Harald Hoyer - 091-1 -- version 091 - -* Wed Apr 19 2006 Harald Hoyer - 090-1 -- version 090 - -* Thu Apr 13 2006 Harald Hoyer - 089-1 -- version 089 -- do not force loading of parport_pc (bug #186850) -- manually load snd-powermac (bug #176761) -- added usb floppy symlink (bug #185171) -- start_udev uses udevtrigger now instead of udevstart - -* Wed Mar 08 2006 Harald Hoyer - 084-13 -- fixed pam_console rules (#182600) - -* Mon Mar 06 2006 Harald Hoyer - 084-12 -- fixed DRI permissions - -* Sun Mar 05 2006 Bill Nottingham - 084-11 -- use $ENV{MODALIAS}, not $modalias (#181494) - -* Thu Mar 02 2006 Harald Hoyer - 084-10 -- fixed cdrom rule - -* Wed Mar 01 2006 Harald Hoyer - 084-9 -- create non-enum device (cdrom, floppy, scanner, changer) - for compatibility (random device wins) - e.g. /dev/cdrom -> hdd /dev/cdrom-hdc -> hdc /dev/cdrom-hdd -> hdd - -* Wed Mar 01 2006 Harald Hoyer - 084-8 -- fixed ZIP drive thrashing (bz #181041 #182601) -- fixed enumeration (%%e does not work anymore) (bz #183288) - -* Fri Feb 24 2006 Peter Jones - 084-7 -- Don't start udevd in %%post unless it's already running -- Stop udevd before chkconfig --del in %%preun - -* Fri Feb 24 2006 Harald Hoyer - 084-6 -- put back original WAIT_FOR_SYSFS rule - -* Fri Feb 24 2006 Harald Hoyer - 084-5 -- removed WAIT_FOR_SYSFS rule - -* Wed Feb 22 2006 Harald Hoyer - 084-4 -- fixed group issue with vol_id (bz #181432) -- fixed dvb permissions (bz #179993) -- added support for scsi media changer (bz #181911) -- fixed pktcdvd device creation (bz #161268) - -* Tue Feb 21 2006 Florian La Roche - 084-3 -- also output the additional space char as part of the startup message - -* Fri Feb 10 2006 Jesse Keating - 084-1.1 -- bump again for double-long bug on ppc(64) - -* Tue Feb 07 2006 Harald Hoyer - 084-1 -- version 084 - -* Mon Feb 06 2006 Harald Hoyer - 078-9 -- closed fd leak (bug #179980) - -* Thu Jan 26 2006 Harald Hoyer - 078-8 -- changed usb device naming - -* Tue Jan 24 2006 Harald Hoyer - 078-7 -- put WAIT_FOR_SYSFS rules in 05-udev-early.rules - -* Mon Jan 23 2006 Harald Hoyer - 078-6 -- added some WAIT_FOR_SYSFS rules -- removed warning message, if udev_db is not available - -* Sun Jan 22 2006 Kristian Høgsberg 078-5 -- Drop udev dependency (#178621). - -* Tue Jan 11 2006 Harald Hoyer - 078-4 -- removed group "video" from the rules -- fixed specfile -- load nvram, floppy, parport and lp modules in - /etc/sysconfig/modules/udev-stw.modules until there - is a better solution -- fixed more floppy module loading - -* Fri Dec 23 2005 Harald Hoyer - 078-3 -- fixed floppy module loading -- added monitor socket -- fixed typo in dvb rule - -* Wed Dec 21 2005 Bill Nottingham - 078-2 -- udevstart change: allow greylisting of certain modaliases (usb, firewire) - -* Wed Dec 21 2005 Harald Hoyer - 078-1 -- version 078 -- fixed symlink to pam_console.dev - -* Thu Dec 15 2005 Harald Hoyer - 077-2 -- switched back to udevstart and use active /dev/.udev/queue waiting - in start_udev -- removed support for old kernels -- refined some udev.rules - -* Mon Dec 13 2005 Harald Hoyer - 077-1 -- version 077 -- patch to include udevstart2 in udevd and delay daemonize until queue is empty - -* Fri Dec 09 2005 Jesse Keating -- rebuilt - -* Tue Dec 06 2005 Harald Hoyer - 076-1 -- speedup udevd with selinux by calling matchpathcon_init_prefix() -- version 076 - -* Mon Nov 21 2005 Harald Hoyer - 075-4 -- speedup udev event replay with udevstart2 - -* Fri Nov 18 2005 Harald Hoyer - 075-3 -- refined start_udev for old kernels - -* Fri Nov 11 2005 Harald Hoyer - 075-2 -- moved /etc/udev/scripts to /lib/udev -- moved /etc/udev/devices to /lib/udev/devices -- added new event replay for kernel >= 2.6.15 -- added usb devices -- renamed cpu device to cpuid (bug #161538) -- changed vendor string "Onstream" to "On[sS]tream" (bug #173043) -- compiled all *_id programs statically - -* Fri Nov 11 2005 Harald Hoyer - 075-1 -- version 075 - -* Tue Oct 25 2005 Harald Hoyer - 071-1 -- version 071 - -* Mon Oct 10 2005 Harald Hoyer - 069-10 -- removed group usb - -* Mon Oct 10 2005 Harald Hoyer - 069-9 -- added libsepol-devel BuildReq -- refined persistent rules - -* Mon Oct 10 2005 Harald Hoyer - 069-8 -- corrected c&p edd_id rule, symlink for js devices -- added -lsepol - -* Thu Oct 06 2005 Harald Hoyer - 069-7 -- added edd_id - -* Fri Sep 30 2005 Harald Hoyer - 069-6 -- special handling of IEEE1394 firewire devices (bug #168093) - -* Fri Sep 23 2005 Harald Hoyer - 069-5 -- added missing path_id - -* Wed Sep 21 2005 Harald Hoyer - 069-4 -- readded volume_id now known as vol_id, bug #168883 - -* Thu Sep 15 2005 Bill Nottingham - 069-3 -- fix firmware loading - -* Wed Sep 14 2005 Bill Nottingham - 069-2 -- own /lib/firmware (#167016) - -* Wed Sep 14 2005 Harald Hoyer - 069-1 -- version 069 - -* Thu Aug 04 2005 Harald Hoyer - 063-6 -- compile with pie .. again... (#158935) -- fixed typo in echo (#138509) - -* Tue Aug 02 2005 Harald Hoyer - 063-5 -- fixed scsi hotplug replay - -* Tue Aug 02 2005 Bill Nottingham - 063-5 -- add rule to allow function id matching for pcmcia after loading - modules (#164665) - -* Tue Aug 02 2005 Harald Hoyer - 063-4 -- fixed typo for tape devices and changed mode to 0660 - -* Thu Jul 28 2005 Harald Hoyer - 063-3 -- changed "SYMLINK=" to "SYMLINK+=" - -* Sun Jul 24 2005 Bill Nottingham - 063-2 -- don't set SEQNUM for scsi replay events (#163729) - -* Tue Jul 19 2005 Bill Nottingham - 063-1 -- update to 063 -- handle the hotplug events for ieee1394, scsi, firmware - -* Fri Jul 08 2005 Bill Nottingham - 062-2 -- update to 062 -- use included ata_id, build usb_id -- load modules for pci, usb, pcmcia -- ship RELEASE-NOTES in %%doc - -* Thu Jul 07 2005 Harald Hoyer - 058-2 -- compile with pie - -* Fri May 20 2005 Bill Nottingham - 058-1 -- update to 058, fixes conflict with newer kernels (#158371) - -* Thu May 12 2005 Harald Hoyer - 057-6 -- polished persistent scripts - -* Thu May 5 2005 Bill Nottingham - 057-5 -- rebuild - -* Thu May 5 2005 Bill Nottingham - 057-4 -- better check for mounted tmpfs on /dev (#156862) - -* Wed Apr 27 2005 Peter Jones - 057-3 -- use udevstart rather than udev for udevstart.static - -* Thu Apr 21 2005 Harald Hoyer - 057-2 -- added Inifiniband devices (bug #147035) -- fixed pam_console.dev (bug #153250) - -* Mon Apr 18 2005 Harald Hoyer - 057-1 -- version 057 - -* Fri Apr 15 2005 Dan Walsh - 056-2 -- Fix SELinux during creation of Symlinks - -* Mon Apr 11 2005 Harald Hoyer - 056-1 -- updated to version 056 -- merged permissions in the rules file -- added udevpermconv.sh to convert old permission files - -* Mon Mar 28 2005 Warren Togami - 050-10 -- own default and net dirs (#151368 Hans de Goede) - -* Mon Mar 07 2005 Warren Togami - 050-9 -- fixed rh#150462 (udev DRI permissions) - -* Wed Mar 02 2005 Harald Hoyer - 050-8 -- fixed rh#144598 - -* Fri Feb 18 2005 Harald Hoyer - 050-6 -- introducing /etc/udev/makedev.d/50-udev.nodes -- glibcstatic patch modified to let gcc4 compile udev - -* Thu Feb 10 2005 Harald Hoyer - 050-5 -- doh, reverted the start_udev devel version, which slipped in - -* Thu Feb 10 2005 Harald Hoyer - 050-3 -- fixed forgotten " in udev.rules - -* Tue Jan 11 2005 Harald Hoyer - 050-2 -- removed /dev/microcode, /dev/cpu/microcode is now the real node -- cleaned up start_udev - -* Tue Jan 11 2005 Harald Hoyer - 050-1 -- version 050 -- /dev/cpu/0/microcode -> /dev/cpu/microcode - -* Tue Dec 21 2004 Dan Walsh - 048-4 -- Call selinux_restore to fix labeling problem in selinux -- Fixes rh#142817 - -* Tue Dec 21 2004 Harald Hoyer - 048-3 -- maybe fixed bug rh#143367 - -* Thu Dec 16 2004 Harald Hoyer - 048-2 -- fixed a case where reading /proc/ide/hd?/media returns EIO - (bug rh#142713) -- changed all device node permissions of group "disk" to 0640 - (bug rh#110197) -- remove $udev_db with -fr in case of a directory (bug rh#142962) - -* Mon Dec 13 2004 Harald Hoyer - 048-1 -- version 048 -- major specfile cleanup - -* Thu Nov 04 2004 Harald Hoyer - 042-1 -- version 042 - -* Thu Nov 04 2004 Harald Hoyer - 039-10 -- speed improvement, scripts in rules are now executed only once, - instead of four times - -* Thu Nov 04 2004 Harald Hoyer - 039-9 -- removed wrong SIG_IGN for SIGCHLD -- moved ide media check to script to wait for the procfs - -* Wed Nov 3 2004 Jeremy Katz - 039-8.FC3 -- recreate lvm device nodes if needed in the trigger (#137807) - -* Wed Nov 03 2004 Harald Hoyer - 039-6.FC3.2 -- replace udev.conf by default -- LANG=C for fgrep in start_udev; turn grep into fgrep - -* Tue Nov 02 2004 Harald Hoyer - 039-6.FC3.1 -- speed up pam_console.dev -- mount pts and shm, in case of the dev trigger -- increased timeout for udevstart -- removed syslog() from signal handler (caused vmware locks) -- turned off logging, which speeds up the boot process - -* Thu Oct 21 2004 Harald Hoyer - 039-6 -- fixed typo - -* Thu Oct 21 2004 Harald Hoyer - 039-5 -- added udev-039-norm.patch, which prevents removal of hd* devices, - because the kernel sends remove/add events, if an IDE removable device - is close(2)ed. mke2fs, e.g. would fail in this case. - -* Wed Oct 20 2004 Harald Hoyer - 039-4 -- do not call dev.d scripts, if network interface hasn't changed - the name -- correct wait for dummy network devices -- removed NONBLOCK from volume-id -- do not log in udev.static, which should fix bug 136005 - -* Mon Oct 18 2004 Harald Hoyer - 039-3 -- refined wait_for_sysfs for udev.static - -* Mon Oct 18 2004 Harald Hoyer - 039-2 -- improved wait_for_sysfs for virtual consoles with Kay Siever's patch -- wait for ppp class -- wait for LVM dm- devices -- integrate wait_for_sys in udev.static for the initrd - -* Mon Oct 18 2004 Harald Hoyer - 039-1 -- version 039, fixes also manpage bug 135996 -- fixed glibc issue for static version (getgrnam, getpwnam) (bug 136005) -- close the syslog in every app - -* Fri Oct 15 2004 Harald Hoyer - 038-2 -- par[0-9] is now a symlink to lp -- MAKEDEV the parport devices -- now conflicts with older initscripts - -* Thu Oct 14 2004 Harald Hoyer - 038-1 -- raw device nodes are now created in directory raw -- version 038 - -* Wed Oct 13 2004 Harald Hoyer - 036-1 -- better wait_for_sysfs warning messages - -* Wed Oct 13 2004 Harald Hoyer - 035-2 -- fixed double bug in start_udev (bug 135405) - -* Tue Oct 12 2004 Harald Hoyer - 035-1 -- version 035, which only improves wait_for_sysfs -- load ide modules in start_udev, until a hotplug script is available - (bug 135260) - -* Mon Oct 11 2004 Harald Hoyer - 034-3 -- removed scary error messages from wait_for_sysfs -- symlink from nst? -> tape? -- kill udevd on update - -* Fri Oct 8 2004 Harald Hoyer - 034-2 -- check for /proc/sys/dev/cdrom/info existence in check-cdrom.sh - -* Fri Oct 8 2004 Harald Hoyer - 034-1 -- new version udev-034 -- removed patches, which went upstream -- pam_console.dev link renamed to 05-pam_console.dev -- MAKEDEV.dev links renamed to 10-MAKEDEV.dev - -* Thu Oct 07 2004 Harald Hoyer - 032-10 -- added floppy madness (bug 134830) -- replay scsi events in start_udev for the devices on the adapter (bug 130746) - -* Wed Oct 06 2004 Harald Hoyer - 032-9 -- obsoleted $UDEV_LOG, use udev_log -- correct SYMLINK handling in pam_console.dev -- specfile cleanup -- added check-cdrom.sh for nice cdrom symlinks - -* Mon Oct 04 2004 Harald Hoyer - 032-8 -- added patches from Féliciano Matias for multiple symlinks (bug 134477 and 134478) -- corrected some permissions with a missing leading 0 -- added z90crypt to the permissions file (bug 134448) -- corrected requires and conflicts tags -- removed /dev/log from MAKEDEV creation - -* Fri Oct 01 2004 Harald Hoyer - 032-7 -- more device nodes for those without initrd - -* Thu Sep 30 2004 Harald Hoyer - 032-6 -- prevent error message from device copying -- use already translated starting strings - -* Wed Sep 29 2004 Harald Hoyer - 032-5 -- add "fi" to start_udev -- do not create floppy devices manually (bug 133838) - -* Tue Sep 28 2004 Harald Hoyer - 032-4 -- made /etc/udev/devices/ for manual device nodes -- refined SELINUX check, if /dev is not yet mounted in start_dev - -* Mon Sep 27 2004 Harald Hoyer - 032-3 -- corrected permissions for /dev/rtc (bug 133636) -- renamed device-mapper to mapper/control (bug 133688) - -* Wed Sep 22 2004 Harald Hoyer - 032-2 -- removed option to turn off udev -- udevstart.static now symling to udev.static - -* Tue Sep 21 2004 Harald Hoyer - 032-1 -- version 032 - -* Mon Sep 20 2004 Harald Hoyer - 030-27 -- simplified udev.conf -- refined close_on_exec patch -- added pam_console supply for symlinks, now gives correct permissions, - for e.g. later plugged in cdroms -- renamed sr? to scd? (see devices.txt; k3b likes that :) - -* Mon Sep 13 2004 Jeremy Katz - 030-26 -- require a 2.6 kernel -- prereq instead of requires MAKEDEV -- obsolete and provide dev -- add a trigger for the removal of /dev so that we set things up - -* Fri Sep 10 2004 Dan Walsh - 030-25 -- Use matchmediacon - -* Fri Sep 10 2004 Harald Hoyer - 030-24 -- check if SELINUX is not disabled before executing setfiles (bug 132099) - -* Wed Sep 8 2004 Harald Hoyer - 030-23 -- mount tmpfs with mode 0755 in start_udev - -* Tue Sep 7 2004 Harald Hoyer - 030-22 -- applied rules from David Zeuthen which read /proc directly without - shellscript - -* Tue Sep 7 2004 Harald Hoyer - 030-21 -- applied enumeration patch from David Zeuthen for cdrom symlinks (bug 131532) -- create /dev/ppp in start_udev (bug 131114) -- removed nvidia devices from start_udev -- check for restorecon presence in start_udev (bug 131904) - -* Fri Sep 3 2004 Harald Hoyer - 030-20 -- due to -x added to MAKEDEV specify the par and lp numbers - -* Fri Sep 3 2004 Harald Hoyer - 030-19 -- added udev-030-rhsec.patch (bug 130351) - -* Thu Sep 2 2004 Jeremy Katz - 030-18 -- make the exact device in start_udev (and thus, require new MAKEDEV) - -* Thu Sep 2 2004 Jeremy Katz - 030-17 -- make sure file contexts of everything in the tmpfs /dev are set right - when start_udev runs - -* Thu Sep 02 2004 Harald Hoyer - 030-16 -- moved %%{_sysconfdir}/hotplug.d/default/udev.hotplug to %%{_sysconfdir}/hotplug.d/default/10-udev.hotplug - -* Thu Sep 02 2004 Harald Hoyer - 030-15 -- added nvidia devices to start_udev -- added UDEV_RAMFS for backwards compat to udev.conf -- changed Group (bug 131488) -- added libselinux-devel to build requirements - -* Wed Sep 1 2004 Jeremy Katz - 030-14 -- require MAKEDEV - -* Wed Sep 1 2004 Dan Walsh - 030-13 -- Change to setfilecon if directory exists. - -* Wed Sep 01 2004 Harald Hoyer - 030-12 -- fixed start_udev - -* Tue Aug 31 2004 Jeremy Katz - 030-11 -- use tmpfs instead of ramfs (it has xattr support now) -- change variables appropriately to TMPFS intead of RAMFS in udev.conf -- create loopN, not just loop in start_udev - -* Fri Aug 27 2004 Dan Walsh - 030-10 -- Fix Patch - -* Thu Aug 26 2004 Dan Walsh - 030-9 -- Cleaned up selinux patch - -* Tue Aug 24 2004 Harald Hoyer - 030-8 -- changed defaults not to remove device nodes -- added rule for net/tun -- extended start_udev to create devices, which can trigger module autoloading -- refined cloexec patch, to redirect stdin,out,err of /dev.d execed apps to /dev/null - -* Mon Aug 23 2004 Harald Hoyer - 030-7 -- removed usage of /usr/bin/seq in start_udev -- set correct permissions in start_udev -- extended the cloexec patch -- removed udev-persistent package (define with_persistent==0) -- check for /var/run/console/console.lock before calling /sbin/pam_console_setowner -- linked pam_console_setowner statically against libglib-2.0.a - -* Fri Aug 20 2004 Harald Hoyer - 030-5 -- use correct console.lock file now in pam_console_setowner - -* Wed Aug 18 2004 Harald Hoyer - 030-4 -- added the selinux patch - -* Fri Jul 23 2004 Harald Hoyer - 030-3 -- extended the cloexec patch - -* Wed Jul 21 2004 Dan Walsh - 030-2 -- Close Database fd in exec processes using FD_CLOSEXEC - -* Wed Jul 14 2004 Harald Hoyer - 030-1 -- version 030 - -* Wed Jul 14 2004 Harald Hoyer - 029-4 -- added udevstart.static - -* Wed Jul 14 2004 Harald Hoyer - 029-3 -- put /etc/sysconfig/udev in /etc/udev/udev.conf and removed it -- made only udev.static static -- make our defaults the default values -- removed /udev - -* Tue Jul 6 2004 Harald Hoyer - 029-1 -- version 029, added udev_remove and udev_owner to udev.conf - -* Tue Jun 15 2004 Elliot Lee -- rebuilt - -* Tue Jun 8 2004 Harald Hoyer - 026-3 -- fixed UDEV_REMOVE=no - -* Tue Jun 8 2004 Harald Hoyer - 026-2 -- udev-026 -- preserve ownership of device nodes, which already exist -- do not remove device nodes if UDEV_REMOVE="no" -- added volume_id -- build with klibc - -* Wed May 26 2004 Harald Hoyer - 025-1 -- udev-025 -- added ata_identify -- build nearly all with dietlibc - -* Mon May 10 2004 Elliot Lee 024-6 -- Turn off udevd by default for FC2 - -* Tue Apr 20 2004 Harald Hoyer - 024-5 -- fixed permission for /dev/tty (FC2) - -* Thu Apr 15 2004 Harald Hoyer - 024-4 -- moved the 00- files to 50-, to let the use place his files in front - -* Thu Apr 15 2004 Harald Hoyer - 024-3 -- set UDEV_SELINUX to yes -- added UDEV_LOG - -* Thu Apr 15 2004 Harald Hoyer - 024-2 -- added /udev to filelist - -* Wed Apr 14 2004 Harald Hoyer - 024-1 -- update to 024 -- added /etc/sysconfig/udev -- added selinux, pam_console, dbus support - -* Fri Mar 26 2004 Harald Hoyer - 023-1 -- update to 023 - -* Wed Mar 24 2004 Bill Nottingham 022-1 -- update to 022 - -* Sun Mar 21 2004 Florian La Roche -- really move initscript - -* Sun Feb 29 2004 Florian La Roche -- move chkconv to preun -- nicer url - -* Wed Feb 25 2004 Harald Hoyer - 018-1 -- changes permissions and rules - -* Mon Feb 23 2004 Dan Walsh -- Add selinux support - -* Thu Feb 19 2004 Greg Kroah-Hartman -- add some more files to the documentation directory -- add ability to build scsi_id and make it the default - -* Mon Feb 16 2004 Greg Kroah-Hartman -- fix up udevd build, as it's no longer needed to be build seperatly -- add udevtest to list of files -- more Red Hat sync ups. - -* Thu Feb 12 2004 Greg Kroah-Hartman -- add some changes from the latest Fedora udev release. - -* Mon Feb 2 2004 Greg Kroah-Hartman -- add udevsend, and udevd to the files -- add ability to build udevd with glibc after the rest is build with klibc - -* Mon Jan 26 2004 Greg Kroah-Hartman -- added udevinfo to rpm -- added URL to spec file -- added udevinfo's man page - -* Mon Jan 05 2004 Rolf Eike Beer -- add defines to choose the init script (Redhat or LSB) - -* Tue Dec 16 2003 Robert Love -- install the initscript and run chkconfig on it - -* Tue Nov 2 2003 Greg Kroah-Hartman -- changes due to config file name changes - -* Fri Oct 17 2003 Robert Love -- Make work without a build root -- Correctly install the right files -- Pass the RPM_OPT_FLAGS to gcc so we can build per the build policy -- Put some prereqs in -- Install the hotplug symlink to udev - -* Mon Jul 28 2003 Paul Mundt -- Initial spec file for udev-0.2.