From a866928386d15f8cec398c3c28282b7d8ba6fa39 Mon Sep 17 00:00:00 2001 From: Harald Hoyer Date: Fri, 6 Aug 2010 18:41:59 +0200 Subject: [PATCH 01/12] * Fri Aug 06 2010 Harald Hoyer 160-9 - added quirk to cdrom_id, to boot from qemu Resolves: rhbz#609049 --- ...ireWire-IDs-Point-Grey-IIDC-AV-C-ven.patch | 68 ++++++++++ ...irewire-rules-for-deprecated-drivers.patch | 27 ++++ ...firewire-matches-to-recent-rule-chan.patch | 31 +++++ ...ume-keys-not-releasing-on-Mivvy-G310.patch | 29 ++++ ...tech-diNovo-MX5500-and-other-keyboar.patch | 28 ++++ ...n-a-message-from-the-wrong-version-o.patch | 29 ++++ ...inor-so-version-after-adding-symbols.patch | 29 ++++ ...ix-for-Logitech-diNovo-Edge-keyboard.patch | 30 +++++ ...-udevadm-fix-short-options-in-getopt.patch | 53 ++++++++ 0011-keymap-Generalize-Samsung-keymaps.patch | 30 +++++ ...-release-quirks-for-a-lot-more-Samsu.patch | 26 ++++ ...-fix-some-memory-leaks-in-error-path.patch | 69 ++++++++++ 0014-malloc-memset-calloc.patch | 28 ++++ 0015-udevd-fix-short-options-in-getopt.patch | 25 ++++ ..._path-only-when-we-actually-deleted-.patch | 85 ++++++++++++ ...y-handle-CK-change-events-for-root-u.patch | 52 ++++++++ ...ally-fix-ACL-assignment-in-CK-events.patch | 125 ++++++++++++++++++ udev-qemu-cdrom.patch | 17 +++ udev.spec | 49 ++++++- 19 files changed, 829 insertions(+), 1 deletion(-) create mode 100644 0002-rules-add-more-FireWire-IDs-Point-Grey-IIDC-AV-C-ven.patch create mode 100644 0003-rules-remove-firewire-rules-for-deprecated-drivers.patch create mode 100644 0004-udev-acl-update-firewire-matches-to-recent-rule-chan.patch create mode 100644 0005-Fix-volume-keys-not-releasing-on-Mivvy-G310.patch create mode 100644 0006-hid2hci-fix-Logitech-diNovo-MX5500-and-other-keyboar.patch create mode 100644 0007-log-an-error-when-a-message-from-the-wrong-version-o.patch create mode 100644 0008-libudev-bump-minor-so-version-after-adding-symbols.patch create mode 100644 0009-hid2hci-fix-for-Logitech-diNovo-Edge-keyboard.patch create mode 100644 0010-udevadm-fix-short-options-in-getopt.patch create mode 100644 0011-keymap-Generalize-Samsung-keymaps.patch create mode 100644 0012-keymap-Add-force-release-quirks-for-a-lot-more-Samsu.patch create mode 100644 0013-udevd-fix-some-memory-leaks-in-error-path.patch create mode 100644 0014-malloc-memset-calloc.patch create mode 100644 0015-udevd-fix-short-options-in-getopt.patch create mode 100644 0016-call-util_delete_path-only-when-we-actually-deleted-.patch create mode 100644 0017-udev-acl-properly-handle-CK-change-events-for-root-u.patch create mode 100644 0018-udev-acl-really-fix-ACL-assignment-in-CK-events.patch create mode 100644 udev-qemu-cdrom.patch diff --git a/0002-rules-add-more-FireWire-IDs-Point-Grey-IIDC-AV-C-ven.patch b/0002-rules-add-more-FireWire-IDs-Point-Grey-IIDC-AV-C-ven.patch new file mode 100644 index 0000000..602e824 --- /dev/null +++ b/0002-rules-add-more-FireWire-IDs-Point-Grey-IIDC-AV-C-ven.patch @@ -0,0 +1,68 @@ +From 1bbc1a9cb0d65c1326e18170f3b445047cb1ea80 Mon Sep 17 00:00:00 2001 +From: Stefan Richter +Date: Sun, 11 Jul 2010 12:32:12 +0200 +Subject: [PATCH 02/18] rules: add more FireWire IDs: Point Grey IIDC; AV/C + vendor unique + +1. IIDC cameras from Point Grey use the vendor OUI as Specifier_ID +instead of the 1394 TA's OUI but are otherwise fully compliant to the +IIDC spec. Their device files should be accessible like those of any +other IIDC cameras. + +2. Originally, the Software_Version of devices that implement FCP +(IEC 61883-1 Function Control Protocol) was meant to be a bitmap of all +command sets that an FCP capable unit supports. Bitmap flags are +defined for AV/C, CAL, EHS, HAVi, and vendor unique command sets. +Software_Version was revised to be a simple identifier instead, and +devices that support several command sets were meant to instantiate one +unit directory for each command set. Still, some devices with the flags +for AV/C and vendor unique command sets combined were released (but +apparently no devices with any other flag combinations). These rare but +existing AV/C + vendor unique devices need to be accessible just like +plain AV/C devices. + +Side notes: + - Many AV/C devices make use of the Vendor Dependent AV/C command, but +this is unrelated to vendor unique FCP command sets. + - Here are all standardized FireWire protocol identifiers that I know +of, listed as Specifier_ID:Software_Version | specifier | protocol. +0x00005e:0x000001 | IANA | IPv4 over 1394 (RFC 2734) +0x00005e:0x000002 | IANA | IPv6 over 1394 (RFC 3146) +0x00609e:0x010483 | INCITS | SBP-2 (or SCSI command sets over SBP-3) +0x00609e:0x0105bb | INCITS | AV/C over SBP-3 +0x00a02d:0x010001 | 1394 TA | AV/C (over FCP) +0x00a02d:0x010002 | 1394 TA | CAL +0x00a02d:0x010004 | 1394 TA | EHS +0x00a02d:0x010008 | 1394 TA | HAVi +0x00a02d:0x014000 | 1394 TA | Vendor Unique +0x00a02d:0x014001 | 1394 TA | Vendor Unique and AV/C (over FCP) +0x00a02d:0x000100 | 1394 TA | IIDC 1.04 +0x00a02d:0x000101 | 1394 TA | IIDC 1.20 +0x00a02d:0x000102 | 1394 TA | IIDC 1.30 +0x00a02d:0x0A6BE2 | 1394 TA | DPP 1.0 +0x00a02d:0x4B661F | 1394 TA | IICP 1.0 +For now we are only interested in udev rules for AV/C and IIDC. + +Reported-by: Damien Douxchamps (Point Grey IIDC ID) +Reported-by: Clemens Ladisch (AV/C + vendor unique ID) +Signed-off-by: Stefan Richter +--- + rules/rules.d/50-udev-default.rules | 2 ++ + 1 files changed, 2 insertions(+), 0 deletions(-) + +diff --git a/rules/rules.d/50-udev-default.rules b/rules/rules.d/50-udev-default.rules +index 10cfbd6..3c0f747 100644 +--- a/rules/rules.d/50-udev-default.rules ++++ b/rules/rules.d/50-udev-default.rules +@@ -49,7 +49,9 @@ SUBSYSTEM=="dvb", GROUP="video" + + # FireWire (firewire-core driver: IIDC devices, AV/C devices) + SUBSYSTEM=="firewire", ATTR{units}=="*0x00a02d:0x00010*", GROUP="video" ++SUBSYSTEM=="firewire", ATTR{units}=="*0x00b09d:0x00010*", GROUP="video" + SUBSYSTEM=="firewire", ATTR{units}=="*0x00a02d:0x010001*", GROUP="video" ++SUBSYSTEM=="firewire", ATTR{units}=="*0x00a02d:0x014001*", GROUP="video" + + # FireWire (deprecated dv1394 and video1394 drivers) + KERNEL=="dv1394-[0-9]*", NAME="dv1394/%n", GROUP="video" +-- +1.7.2 + diff --git a/0003-rules-remove-firewire-rules-for-deprecated-drivers.patch b/0003-rules-remove-firewire-rules-for-deprecated-drivers.patch new file mode 100644 index 0000000..31531af --- /dev/null +++ b/0003-rules-remove-firewire-rules-for-deprecated-drivers.patch @@ -0,0 +1,27 @@ +From 9de4a43a899dd03dd10ebc156be85ecdd33ce62a Mon Sep 17 00:00:00 2001 +From: Kay Sievers +Date: Mon, 12 Jul 2010 11:04:17 +0200 +Subject: [PATCH 03/18] rules: remove firewire rules for deprecated drivers + +--- + rules/rules.d/50-udev-default.rules | 4 ---- + 1 files changed, 0 insertions(+), 4 deletions(-) + +diff --git a/rules/rules.d/50-udev-default.rules b/rules/rules.d/50-udev-default.rules +index 3c0f747..9f98809 100644 +--- a/rules/rules.d/50-udev-default.rules ++++ b/rules/rules.d/50-udev-default.rules +@@ -53,10 +53,6 @@ SUBSYSTEM=="firewire", ATTR{units}=="*0x00b09d:0x00010*", GROUP="video" + SUBSYSTEM=="firewire", ATTR{units}=="*0x00a02d:0x010001*", GROUP="video" + SUBSYSTEM=="firewire", ATTR{units}=="*0x00a02d:0x014001*", GROUP="video" + +-# FireWire (deprecated dv1394 and video1394 drivers) +-KERNEL=="dv1394-[0-9]*", NAME="dv1394/%n", GROUP="video" +-KERNEL=="video1394-[0-9]*", NAME="video1394/%n", GROUP="video" +- + # libusb device nodes + SUBSYSTEM=="usb", ENV{DEVTYPE}=="usb_device", MODE="0664" + +-- +1.7.2 + diff --git a/0004-udev-acl-update-firewire-matches-to-recent-rule-chan.patch b/0004-udev-acl-update-firewire-matches-to-recent-rule-chan.patch new file mode 100644 index 0000000..b59c4c4 --- /dev/null +++ b/0004-udev-acl-update-firewire-matches-to-recent-rule-chan.patch @@ -0,0 +1,31 @@ +From 2ffb33bdece1ef75886dc8d50490050c8a4b53bd Mon Sep 17 00:00:00 2001 +From: Kay Sievers +Date: Thu, 15 Jul 2010 11:38:14 +0200 +Subject: [PATCH 04/18] udev-acl: update firewire matches to recent rule changes + +--- + extras/udev-acl/70-acl.rules | 6 ++---- + 1 files changed, 2 insertions(+), 4 deletions(-) + +diff --git a/extras/udev-acl/70-acl.rules b/extras/udev-acl/70-acl.rules +index 8300ec2..493a43a 100644 +--- a/extras/udev-acl/70-acl.rules ++++ b/extras/udev-acl/70-acl.rules +@@ -37,12 +37,10 @@ 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}=="*0x00b09d: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" +- +-# old style firewire devices +-KERNEL=="dv1394-[0-9]*", TAG+="udev-acl" +-KERNEL=="video1394-[0-9]*", TAG+="udev-acl" ++SUBSYSTEM=="firewire", ATTR{units}=="*0x00a02d:0x014001*", TAG+="udev-acl" + + # fingerprint readers + SUBSYSTEM=="usb", ATTR{idVendor}=="0483", ATTR{idProduct}=="2016", TAG+="udev-acl" +-- +1.7.2 + diff --git a/0005-Fix-volume-keys-not-releasing-on-Mivvy-G310.patch b/0005-Fix-volume-keys-not-releasing-on-Mivvy-G310.patch new file mode 100644 index 0000000..f38a783 --- /dev/null +++ b/0005-Fix-volume-keys-not-releasing-on-Mivvy-G310.patch @@ -0,0 +1,29 @@ +From 85c3d3b032b4c9a743a9c46eeede469eb999fb54 Mon Sep 17 00:00:00 2001 +From: Jerone Young +Date: Thu, 15 Jul 2010 22:01:24 -0500 +Subject: [PATCH 05/18] Fix volume keys not releasing on Mivvy G310 + +keymap: add My Mivvy G310 + +Fixes volume keys not sending key release on My Mivvy G310 laptop. + +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 db8a3b3..cb1fe78 100644 +--- a/extras/keymap/95-keyboard-force-release.rules ++++ b/extras/keymap/95-keyboard-force-release.rules +@@ -33,4 +33,6 @@ ENV{DMI_VENDOR}=="PEGATRON CORP.", ATTR{[dmi/id]product_name}=="Spring Peak", RU + + ENV{DMI_VENDOR}=="TOSHIBA", ATTR{[dmi/id]product_name}=="Satellite U300|Satellite Pro U300|Satellite U305", RUN+="keyboard-force-release.sh $devpath common-volume-keys" + ++ENV{DMI_VENDOR}=="Viooo Corporation", ATTR{[dmi/id]product_name}=="PT17", RUN+="keyboard-force-release.sh $devpath common-volume-keys" ++ + LABEL="force_release_end" +-- +1.7.2 + diff --git a/0006-hid2hci-fix-Logitech-diNovo-MX5500-and-other-keyboar.patch b/0006-hid2hci-fix-Logitech-diNovo-MX5500-and-other-keyboar.patch new file mode 100644 index 0000000..fe59883 --- /dev/null +++ b/0006-hid2hci-fix-Logitech-diNovo-MX5500-and-other-keyboar.patch @@ -0,0 +1,28 @@ +From a466c239a98045767c3aa7dfbf95306f36b9bf48 Mon Sep 17 00:00:00 2001 +From: Marco d'Itri +Date: Mon, 19 Jul 2010 10:37:41 +0200 +Subject: [PATCH 06/18] hid2hci: fix Logitech diNovo, MX5500 and other keyboards + +--- + 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 c5528f0..4351551 100644 +--- a/extras/hid2hci/70-hid2hci.rules ++++ b/extras/hid2hci/70-hid2hci.rules +@@ -11,9 +11,9 @@ ATTR{bInterfaceClass}=="03", ATTR{bInterfaceSubClass}=="01", ATTR{bInterfaceProt + RUN+="hid2hci --method=dell --devpath=%p", ENV{HID2HCI_SWITCH}="1" + + # Logitech devices (hidraw) +-KERNEL=="hiddev*", ATTRS{idVendor}=="046d", ATTRS{idProduct}=="c70[345bce]|c71[34bc]", \ ++KERNEL=="hiddev*", ATTRS{idVendor}=="046d", ATTRS{idProduct}=="c70[35e]|c71[34]", \ + RUN+="hid2hci --method=logitech-hid --devpath=%p" +-KERNEL=="hidraw*", ATTRS{idVendor}=="046d", ATTRS{idProduct}=="c70a", \ ++KERNEL=="hidraw*", ATTRS{idVendor}=="046d", ATTRS{idProduct}=="c70[4abc]|c71[bc]", \ + RUN+="hid2hci --method=logitech-hid --devpath=%p" + + ENV{DEVTYPE}!="usb_device", GOTO="hid2hci_end" +-- +1.7.2 + diff --git a/0007-log-an-error-when-a-message-from-the-wrong-version-o.patch b/0007-log-an-error-when-a-message-from-the-wrong-version-o.patch new file mode 100644 index 0000000..952c9bc --- /dev/null +++ b/0007-log-an-error-when-a-message-from-the-wrong-version-o.patch @@ -0,0 +1,29 @@ +From 9b6c6b56123670050b1dc5eb69ea1a9638bedd39 Mon Sep 17 00:00:00 2001 +From: Marco d'Itri +Date: Mon, 19 Jul 2010 10:56:37 +0200 +Subject: [PATCH 07/18] log an error when a message from the wrong version of udevadm is ignored + +--- + libudev/libudev-monitor.c | 5 ++++- + 1 files changed, 4 insertions(+), 1 deletions(-) + +diff --git a/libudev/libudev-monitor.c b/libudev/libudev-monitor.c +index b3e5d5f..a3789c4 100644 +--- a/libudev/libudev-monitor.c ++++ b/libudev/libudev-monitor.c +@@ -625,8 +625,11 @@ retry: + 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)) ++ if (nlh->magic != htonl(UDEV_MONITOR_MAGIC)) { ++ err(udev_monitor->udev, "ignored a message from an invalid release of udevadm (%x != %x)\n", ++ nlh->magic, htonl(UDEV_MONITOR_MAGIC)); + return NULL; ++ } + if (nlh->properties_off+32 > buflen) + return NULL; + bufpos = nlh->properties_off; +-- +1.7.2 + diff --git a/0008-libudev-bump-minor-so-version-after-adding-symbols.patch b/0008-libudev-bump-minor-so-version-after-adding-symbols.patch new file mode 100644 index 0000000..59fbee5 --- /dev/null +++ b/0008-libudev-bump-minor-so-version-after-adding-symbols.patch @@ -0,0 +1,29 @@ +From 2ec30504d628a445b892c697745b9886b42227e1 Mon Sep 17 00:00:00 2001 +From: Kay Sievers +Date: Mon, 19 Jul 2010 14:08:21 +0200 +Subject: [PATCH 08/18] libudev: bump minor so version after adding symbols + +--- + Makefile.am | 6 +++--- + 1 files changed, 3 insertions(+), 3 deletions(-) + +diff --git a/Makefile.am b/Makefile.am +index 3406c3a..e80d43a 100644 +--- a/Makefile.am ++++ b/Makefile.am +@@ -29,9 +29,9 @@ CLEANFILES = + # ------------------------------------------------------------------------------ + # libudev + # ------------------------------------------------------------------------------ +-LIBUDEV_CURRENT=8 +-LIBUDEV_REVISION=3 +-LIBUDEV_AGE=8 ++LIBUDEV_CURRENT=9 ++LIBUDEV_REVISION=0 ++LIBUDEV_AGE=9 + + SUBDIRS += libudev/docs + +-- +1.7.2 + diff --git a/0009-hid2hci-fix-for-Logitech-diNovo-Edge-keyboard.patch b/0009-hid2hci-fix-for-Logitech-diNovo-Edge-keyboard.patch new file mode 100644 index 0000000..574ecf4 --- /dev/null +++ b/0009-hid2hci-fix-for-Logitech-diNovo-Edge-keyboard.patch @@ -0,0 +1,30 @@ +From efb27d646590660c766796fc314a291bdcd2b3e1 Mon Sep 17 00:00:00 2001 +From: Marco d'Itri +Date: Fri, 23 Jul 2010 12:08:31 +0200 +Subject: [PATCH 09/18] hid2hci: fix for Logitech diNovo Edge keyboard + +--- + extras/hid2hci/70-hid2hci.rules | 6 +++--- + 1 files changed, 3 insertions(+), 3 deletions(-) + +diff --git a/extras/hid2hci/70-hid2hci.rules b/extras/hid2hci/70-hid2hci.rules +index 4351551..3b36629 100644 +--- a/extras/hid2hci/70-hid2hci.rules ++++ b/extras/hid2hci/70-hid2hci.rules +@@ -10,10 +10,10 @@ 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=="hiddev*", ATTRS{idVendor}=="046d", ATTRS{idProduct}=="c70[35e]|c71[34]", \ ++# Logitech devices ++KERNEL=="hiddev*", ATTRS{idVendor}=="046d", ATTRS{idProduct}=="c70[35e]", \ + RUN+="hid2hci --method=logitech-hid --devpath=%p" +-KERNEL=="hidraw*", ATTRS{idVendor}=="046d", ATTRS{idProduct}=="c70[4abc]|c71[bc]", \ ++KERNEL=="hidraw*", ATTRS{idVendor}=="046d", ATTRS{idProduct}=="c70[4abc]|c71[34bc]", \ + RUN+="hid2hci --method=logitech-hid --devpath=%p" + + ENV{DEVTYPE}!="usb_device", GOTO="hid2hci_end" +-- +1.7.2 + diff --git a/0010-udevadm-fix-short-options-in-getopt.patch b/0010-udevadm-fix-short-options-in-getopt.patch new file mode 100644 index 0000000..101f710 --- /dev/null +++ b/0010-udevadm-fix-short-options-in-getopt.patch @@ -0,0 +1,53 @@ +From 163c0365ffbd9321d686e8c301c36ea50c98df2f Mon Sep 17 00:00:00 2001 +From: Yin Kangkai +Date: Wed, 28 Jul 2010 06:56:13 +0200 +Subject: [PATCH 10/18] udevadm: fix short options in getopt() + +--- + udev/udevadm-control.c | 2 +- + udev/udevadm-info.c | 2 +- + udev/udevadm-trigger.c | 2 +- + 3 files changed, 3 insertions(+), 3 deletions(-) + +diff --git a/udev/udevadm-control.c b/udev/udevadm-control.c +index 1f8008a..8b90829 100644 +--- a/udev/udevadm-control.c ++++ b/udev/udevadm-control.c +@@ -71,7 +71,7 @@ int udevadm_control(struct udev *udev, int argc, char *argv[]) + int i; + char *endp; + +- option = getopt_long(argc, argv, "l:sSRp:m:M:h", options, NULL); ++ option = getopt_long(argc, argv, "l:sSRp:m:h", options, NULL); + if (option == -1) + break; + +diff --git a/udev/udevadm-info.c b/udev/udevadm-info.c +index 14baa6a..9bd60c7 100644 +--- a/udev/udevadm-info.c ++++ b/udev/udevadm-info.c +@@ -242,7 +242,7 @@ int udevadm_info(struct udev *udev, int argc, char *argv[]) + int option; + struct stat statbuf; + +- option = getopt_long(argc, argv, "aed:n:p:q:rxPVh", options, NULL); ++ option = getopt_long(argc, argv, "aed:n:p:q:rxP:Vh", options, NULL); + if (option == -1) + break; + +diff --git a/udev/udevadm-trigger.c b/udev/udevadm-trigger.c +index 481e9cf..c32e0b4 100644 +--- a/udev/udevadm-trigger.c ++++ b/udev/udevadm-trigger.c +@@ -128,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, "vng:o:t:hcp:s:S:a:A:y:", options, NULL); ++ option = getopt_long(argc, argv, "vng:o:t:hc:p:s:S:a:A:y:", options, NULL); + if (option == -1) + break; + +-- +1.7.2 + diff --git a/0011-keymap-Generalize-Samsung-keymaps.patch b/0011-keymap-Generalize-Samsung-keymaps.patch new file mode 100644 index 0000000..5ba9edf --- /dev/null +++ b/0011-keymap-Generalize-Samsung-keymaps.patch @@ -0,0 +1,30 @@ +From c9fbbd6ea2f92e037cdaba6b7116d3b3e904696a Mon Sep 17 00:00:00 2001 +From: Martin Pitt +Date: Sun, 1 Aug 2010 21:59:58 +0200 +Subject: [PATCH 11/18] keymap: Generalize Samsung keymaps + +Fortunato Ventre (voRia) reports a lot more Samsung models +which need the "samsung-other" keymap. Instead of eternally playing catchup, +apply it to all Samsung models for now, and keep the two known special cases. + +https://launchpad.net/bugs/554066 +--- + 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 6e37067..13b5571 100644 +--- a/extras/keymap/95-keymap.rules ++++ b/extras/keymap/95-keymap.rules +@@ -115,7 +115,7 @@ ENV{DMI_VENDOR}=="INVENTEC", ATTR{[dmi/id]product_name}=="SYMPHONY 6.0/7.0", RUN + + ENV{DMI_VENDOR}=="MAXDATA", ATTR{[dmi/id]product_name}=="Pro 7000*", RUN+="keymap $name maxdata-pro_7000" + +-ENV{DMI_VENDOR}=="[sS][aA][mM][sS][uU][nN][gG]*", ATTR{[dmi/id]product_name}=="*NC10*|*NC20*|*N128*|*N130*|*N210*|*SP55S*|*SQ45S70S*|*SX60P*|*SX22S*|*SX30S*|*R59P/R60P/R61P*|*SR70S/SR71S*|*Q210*|*Q310*|*X05*|*P560*|*R560*", RUN+="keymap $name samsung-other" ++ENV{DMI_VENDOR}=="[sS][aA][mM][sS][uU][nN][gG]*", RUN+="keymap $name samsung-other" + ENV{DMI_VENDOR}=="[sS][aA][mM][sS][uU][nN][gG]*", ATTR{[dmi/id]product_name}=="*SX20S*", RUN+="keymap $name samsung-sx20s" + ENV{DMI_VENDOR}=="[sS][aA][mM][sS][uU][nN][gG]*", ATTR{[dmi/id]product_name}=="SQ1US", RUN+="keymap $name samsung-sq1us" + +-- +1.7.2 + diff --git a/0012-keymap-Add-force-release-quirks-for-a-lot-more-Samsu.patch b/0012-keymap-Add-force-release-quirks-for-a-lot-more-Samsu.patch new file mode 100644 index 0000000..5b89fed --- /dev/null +++ b/0012-keymap-Add-force-release-quirks-for-a-lot-more-Samsu.patch @@ -0,0 +1,26 @@ +From 5047f82de4d3b973281993516441a35cebcf1294 Mon Sep 17 00:00:00 2001 +From: Fortunato Ventre +Date: Sun, 1 Aug 2010 22:03:30 +0200 +Subject: [PATCH 12/18] keymap: Add force-release quirks for a lot more Samsung models + +https://launchpad.net/bugs/554066 +--- + 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 cb1fe78..bd6b75f 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}=="*N128*|*N130*|*N140*|*N210*|*SR70S/SR71S*|*Q210/P210*", RUN+="keyboard-force-release.sh $devpath samsung-other" ++ENV{DMI_VENDOR}=="[sS][aA][mM][sS][uU][nN][gG]*", ATTR{[dmi/id]product_name}=="*E252*|*N120*|*N128*|*N130*|*N140*|*N148/N208*|*N150*|*N150/N210/N220*|*N220*|*N308*|*N310*|*N510*|*NB30*|*NC10/N110*|*ND10*|*Q210/P210*|*R410P*|*R425/R525*|*R428/P428*|*R460*|*R463*|*R468/R418*|*R480/R431/R481*|*R509*|*R518*|*R519/R719*|*R520/R522/R620*|*R528/R728*|*R530/R730*|*R530/R730/P590*|*R560*|*R580*|*R580/R590*|*R59/R60/R61*|*R59P/R60P/R61P*|*R710*|*R720*|*R780/R778*|*SR58P*|*SR700*|*SR70S/SR71S*|*SX22S*|*X118*|*X120*|*X460*", RUN+="keyboard-force-release.sh $devpath samsung-other" + + ENV{DMI_VENDOR}=="Dell Inc.", ATTR{[dmi/id]product_name}=="Studio 1557|Studio 1558", RUN+="keyboard-force-release.sh $devpath common-volume-keys" + +-- +1.7.2 + diff --git a/0013-udevd-fix-some-memory-leaks-in-error-path.patch b/0013-udevd-fix-some-memory-leaks-in-error-path.patch new file mode 100644 index 0000000..ed97c3a --- /dev/null +++ b/0013-udevd-fix-some-memory-leaks-in-error-path.patch @@ -0,0 +1,69 @@ +From 1851332c08e3f70ee172bbe5b153789da5df2df5 Mon Sep 17 00:00:00 2001 +From: Yin Kangkai +Date: Mon, 2 Aug 2010 18:31:18 +0800 +Subject: [PATCH 13/18] udevd: fix some memory leaks in error path + +Signed-off-by: Yin Kangkai +--- + udev/udev-rules.c | 15 ++++++++++++--- + udev/udevd.c | 4 +++- + 2 files changed, 15 insertions(+), 4 deletions(-) + +diff --git a/udev/udev-rules.c b/udev/udev-rules.c +index 6d32e73..4b81a50 100644 +--- a/udev/udev-rules.c ++++ b/udev/udev-rules.c +@@ -1761,13 +1761,18 @@ struct udev_rules *udev_rules_new(struct udev *udev, int resolve_names) + + /* init token array and string buffer */ + rules->tokens = malloc(PREALLOC_TOKEN * sizeof(struct token)); +- if (rules->tokens == NULL) ++ if (rules->tokens == NULL) { ++ free(rules); + return NULL; ++ } + rules->token_max = PREALLOC_TOKEN; + + rules->buf = malloc(PREALLOC_STRBUF); +- if (rules->buf == NULL) ++ if (rules->buf == NULL) { ++ free(rules->tokens); ++ free(rules); + return NULL; ++ } + rules->buf_max = PREALLOC_STRBUF; + /* offset 0 is always '\0' */ + rules->buf[0] = '\0'; +@@ -1776,8 +1781,12 @@ struct udev_rules *udev_rules_new(struct udev *udev, int resolve_names) + rules->token_max * sizeof(struct token), rules->token_max, sizeof(struct token), rules->buf_max); + + rules->trie_nodes = malloc(PREALLOC_TRIE * sizeof(struct trie_node)); +- if (rules->trie_nodes == NULL) ++ if (rules->trie_nodes == NULL) { ++ free(rules->buf); ++ free(rules->tokens); ++ free(rules); + return NULL; ++ } + rules->trie_nodes_max = PREALLOC_TRIE; + /* offset 0 is the trie root, with an empty string */ + memset(rules->trie_nodes, 0x00, sizeof(struct trie_node)); +diff --git a/udev/udevd.c b/udev/udevd.c +index 873634f..fbc2371 100644 +--- a/udev/udevd.c ++++ b/udev/udevd.c +@@ -227,8 +227,10 @@ static void worker_new(struct event *event) + udev_monitor_enable_receiving(worker_monitor); + + worker = calloc(1, sizeof(struct worker)); +- if (worker == NULL) ++ if (worker == NULL) { ++ udev_monitor_unref(worker_monitor); + return; ++ } + /* worker + event reference */ + worker->refcount = 2; + worker->udev = event->udev; +-- +1.7.2 + diff --git a/0014-malloc-memset-calloc.patch b/0014-malloc-memset-calloc.patch new file mode 100644 index 0000000..61a1245 --- /dev/null +++ b/0014-malloc-memset-calloc.patch @@ -0,0 +1,28 @@ +From 27f4528b9a6587cab2d916fad735dd93eb7563b0 Mon Sep 17 00:00:00 2001 +From: Yin Kangkai +Date: Tue, 3 Aug 2010 08:10:26 +0200 +Subject: [PATCH 14/18] malloc()+memset() -> calloc() + +--- + udev/udev-rules.c | 3 +-- + 1 files changed, 1 insertions(+), 2 deletions(-) + +diff --git a/udev/udev-rules.c b/udev/udev-rules.c +index 4b81a50..52f121c 100644 +--- a/udev/udev-rules.c ++++ b/udev/udev-rules.c +@@ -1751,10 +1751,9 @@ struct udev_rules *udev_rules_new(struct udev *udev, int resolve_names) + struct udev_list_entry *file_loop, *file_tmp; + struct token end_token; + +- rules = malloc(sizeof(struct udev_rules)); ++ rules = calloc(1, sizeof(struct udev_rules)); + if (rules == NULL) + return NULL; +- memset(rules, 0x00, sizeof(struct udev_rules)); + rules->udev = udev; + rules->resolve_names = resolve_names; + udev_list_init(&file_list); +-- +1.7.2 + diff --git a/0015-udevd-fix-short-options-in-getopt.patch b/0015-udevd-fix-short-options-in-getopt.patch new file mode 100644 index 0000000..05e0d66 --- /dev/null +++ b/0015-udevd-fix-short-options-in-getopt.patch @@ -0,0 +1,25 @@ +From 4ab3c463d418c74275eb8170a87c8cf75e47d973 Mon Sep 17 00:00:00 2001 +From: Yin Kangkai +Date: Tue, 3 Aug 2010 08:11:43 +0200 +Subject: [PATCH 15/18] udevd: fix short options in getopt() + +--- + udev/udevd.c | 2 +- + 1 files changed, 1 insertions(+), 1 deletions(-) + +diff --git a/udev/udevd.c b/udev/udevd.c +index fbc2371..2808117 100644 +--- a/udev/udevd.c ++++ b/udev/udevd.c +@@ -1062,7 +1062,7 @@ int main(int argc, char *argv[]) + for (;;) { + int option; + +- option = getopt_long(argc, argv, "cdeDthV", options, NULL); ++ option = getopt_long(argc, argv, "c:deDthV", options, NULL); + if (option == -1) + break; + +-- +1.7.2 + diff --git a/0016-call-util_delete_path-only-when-we-actually-deleted-.patch b/0016-call-util_delete_path-only-when-we-actually-deleted-.patch new file mode 100644 index 0000000..e3e54b9 --- /dev/null +++ b/0016-call-util_delete_path-only-when-we-actually-deleted-.patch @@ -0,0 +1,85 @@ +From 8e5a620b17c08b0b6277236203ee559b7dadd1d4 Mon Sep 17 00:00:00 2001 +From: Kay Sievers +Date: Tue, 3 Aug 2010 12:13:53 +0200 +Subject: [PATCH 16/18] call util_delete_path() only when we actually deleted stuff + +--- + libudev/libudev-util-private.c | 17 ++++++----------- + udev/udev-node.c | 11 ++++++----- + 2 files changed, 12 insertions(+), 16 deletions(-) + +diff --git a/libudev/libudev-util-private.c b/libudev/libudev-util-private.c +index 2f9f4a7..6b68b6a 100644 +--- a/libudev/libudev-util-private.c ++++ b/libudev/libudev-util-private.c +@@ -74,7 +74,7 @@ int util_delete_path(struct udev *udev, const char *path) + { + char p[UTIL_PATH_SIZE]; + char *pos; +- int retval; ++ int err = 0; + + if (path[0] == '/') + while(path[1] == '/') +@@ -92,19 +92,14 @@ int util_delete_path(struct udev *udev, const char *path) + if ((pos == p) || (pos == NULL)) + break; + +- /* remove if empty */ +- retval = rmdir(p); +- if (errno == ENOENT) +- retval = 0; +- if (retval) { +- if (errno == ENOTEMPTY) +- return 0; +- err(udev, "rmdir(%s) failed: %m\n", p); ++ err = rmdir(p); ++ if (err < 0) { ++ if (errno == ENOENT) ++ err = 0; + break; + } +- dbg(udev, "removed '%s'\n", p); + } +- return 0; ++ return err; + } + + /* Reset permissions on the device node, before unlinking it to make sure, +diff --git a/udev/udev-node.c b/udev/udev-node.c +index 8339eb7..228b3eb 100644 +--- a/udev/udev-node.c ++++ b/udev/udev-node.c +@@ -298,15 +298,15 @@ static void link_update(struct udev_device *dev, const char *slink, bool add) + + if (!add) { + dbg(udev, "removing index: '%s'\n", filename); +- unlink(filename); +- util_delete_path(udev, filename); ++ if (unlink(filename) == 0) ++ rmdir(dirname); + } + + target = link_find_prioritized(dev, add, dirname, buf, sizeof(buf)); + if (target == NULL) { + info(udev, "no reference left, remove '%s'\n", slink); +- unlink(slink); +- util_delete_path(udev, slink); ++ if (unlink(slink) == 0) ++ util_delete_path(udev, slink); + } else { + info(udev, "creating link '%s' to '%s'\n", slink, target); + node_symlink(udev, target, slink); +@@ -427,7 +427,8 @@ int udev_node_remove(struct udev_device *dev) + + info(udev, "removing device node '%s'\n", devnode); + err = util_unlink_secure(udev, devnode); +- util_delete_path(udev, devnode); ++ if (err == 0) ++ util_delete_path(udev, devnode); + out: + return err; + } +-- +1.7.2 + diff --git a/0017-udev-acl-properly-handle-CK-change-events-for-root-u.patch b/0017-udev-acl-properly-handle-CK-change-events-for-root-u.patch new file mode 100644 index 0000000..fc32c06 --- /dev/null +++ b/0017-udev-acl-properly-handle-CK-change-events-for-root-u.patch @@ -0,0 +1,52 @@ +From 939cc18afc49ee8479572c14c7fa777646fd4add Mon Sep 17 00:00:00 2001 +From: Kay Sievers +Date: Tue, 3 Aug 2010 15:09:46 +0200 +Subject: [PATCH 17/18] udev-acl: properly handle CK change events for root user + +mschmidt@redhat.com writes: +> since root is treated specially, it does not do anything! +> udev-acl may want to prevent removing ACLs from root, but +> it must not stop the ACLs being granted to the user of the +> new session. + +https://bugzilla.redhat.com/show_bug.cgi?id=608712 +--- + extras/udev-acl/udev-acl.c | 7 +------ + 1 files changed, 1 insertions(+), 6 deletions(-) + +diff --git a/extras/udev-acl/udev-acl.c b/extras/udev-acl/udev-acl.c +index ff04ec6..f2b5005 100644 +--- a/extras/udev-acl/udev-acl.c ++++ b/extras/udev-acl/udev-acl.c +@@ -224,14 +224,10 @@ static int consolekit_called(const char *ck_action, uid_t *uid, uid_t *uid2, con + 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"); +@@ -263,12 +259,11 @@ static int consolekit_called(const char *ck_action, uid_t *uid, uid_t *uid2, con + a = ACTION_ADD; + u = u2; + } +- + break; + case ACTION_NONE: + break; + default: +- g_assert_not_reached (); ++ g_assert_not_reached(); + break; + } + +-- +1.7.2 + diff --git a/0018-udev-acl-really-fix-ACL-assignment-in-CK-events.patch b/0018-udev-acl-really-fix-ACL-assignment-in-CK-events.patch new file mode 100644 index 0000000..9187554 --- /dev/null +++ b/0018-udev-acl-really-fix-ACL-assignment-in-CK-events.patch @@ -0,0 +1,125 @@ +From 9ac90ae153accdfcb56c24c5748690933ad219b2 Mon Sep 17 00:00:00 2001 +From: Michal Schmidt +Date: Wed, 4 Aug 2010 11:53:25 +0200 +Subject: [PATCH 18/18] udev-acl: really fix ACL assignment in CK events + +The previous fix for udev-acl was incomplete. The ACL were not properly +assigned to the new user when switching from root's session because of +the test for 'uid != 0'. + +Centralize the special handling of root to a single place (in set_facl). + +https://bugzilla.redhat.com/show_bug.cgi?id=608712 +--- + extras/udev-acl/udev-acl.c | 37 +++++++++++++++++++------------------ + 1 files changed, 19 insertions(+), 18 deletions(-) + +diff --git a/extras/udev-acl/udev-acl.c b/extras/udev-acl/udev-acl.c +index f2b5005..31e9991 100644 +--- a/extras/udev-acl/udev-acl.c ++++ b/extras/udev-acl/udev-acl.c +@@ -12,20 +12,18 @@ + * General Public License for more details: + */ + +-#include +-#include +-#include +-#include +-#include +-#include +-#include +-#include ++#include ++#include + #include + #include +-#include + #include +-#include ++#include + #include ++#include ++#include ++#include ++#include ++#include + + static int debug; + +@@ -45,6 +43,10 @@ static int set_facl(const char* filename, uid_t uid, int add) + acl_permset_t permset; + int ret; + ++ /* don't touch ACLs for root */ ++ if (uid == 0) ++ return 0; ++ + /* read current record */ + acl = acl_get_file(filename, ACL_TYPE_ACCESS); + if (!acl) +@@ -190,8 +192,6 @@ static int consolekit_called(const char *ck_action, uid_t *uid, uid_t *uid2, con + 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) +@@ -205,8 +205,6 @@ static int consolekit_called(const char *ck_action, uid_t *uid, uid_t *uid2, con + 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) +@@ -331,6 +329,7 @@ int main (int argc, char* argv[]) + }; + int action = -1; + const char *device = NULL; ++ bool uid_given = false; + uid_t uid = 0; + uid_t uid2 = 0; + const char* remove_session_id = NULL; +@@ -357,6 +356,7 @@ int main (int argc, char* argv[]) + device = optarg; + break; + case 'u': ++ uid_given = true; + uid = strtoul(optarg, NULL, 10); + break; + case 'd': +@@ -369,8 +369,9 @@ int main (int argc, char* argv[]) + } + } + +- if (action < 0 && device == NULL && uid == 0) +- consolekit_called(argv[optind], &uid, &uid2, &remove_session_id, &action); ++ if (action < 0 && device == NULL && !uid_given) ++ if (!consolekit_called(argv[optind], &uid, &uid2, &remove_session_id, &action)) ++ uid_given = true; + + if (action < 0) { + fprintf(stderr, "missing action\n\n"); +@@ -378,13 +379,13 @@ int main (int argc, char* argv[]) + goto out; + } + +- if (device != NULL && uid != 0) { ++ if (device != NULL && uid_given) { + fprintf(stderr, "only one option, --device=DEVICEFILE or --user=UID expected\n\n"); + rc = 3; + goto out; + } + +- if (uid != 0) { ++ if (uid_given) { + switch (action) { + case ACTION_ADD: + /* Add ACL for given uid to all matching devices. */ +-- +1.7.2 + diff --git a/udev-qemu-cdrom.patch b/udev-qemu-cdrom.patch new file mode 100644 index 0000000..b09b8eb --- /dev/null +++ b/udev-qemu-cdrom.patch @@ -0,0 +1,17 @@ +diff --git a/extras/cdrom_id/cdrom_id.c b/extras/cdrom_id/cdrom_id.c +index 2bea2e4..7fe6e4c 100644 +--- a/extras/cdrom_id/cdrom_id.c ++++ b/extras/cdrom_id/cdrom_id.c +@@ -522,7 +522,11 @@ static int cd_media_info(struct udev *udev, int fd) + err = scsi_cmd_run(udev, &sc, fd, header, sizeof(header)); + if ((err != 0)) { + info_scsi_cmd_err(udev, "READ DISC INFORMATION", err); +- return -1; ++ if (ASC(err)==0x20 && ASCQ(err) == 0) { ++ cd_media = 1; ++ return 0; ++ } ++ return -1; + }; + + cd_media = 1; diff --git a/udev.spec b/udev.spec index 37d0082..4749942 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: 8%{?dist} +Release: 9%{?dist} License: GPLv2+ Group: System Environment/Base Provides: udev-persistent = %{version}-%{release} @@ -17,6 +17,26 @@ Source: ftp://ftp.kernel.org/pub/linux/utils/kernel/hotplug/%{name}-%{version}.t Source1: start_udev Source2: udev-post.init +Patch2: 0002-rules-add-more-FireWire-IDs-Point-Grey-IIDC-AV-C-ven.patch +Patch3: 0003-rules-remove-firewire-rules-for-deprecated-drivers.patch +Patch4: 0004-udev-acl-update-firewire-matches-to-recent-rule-chan.patch +Patch5: 0005-Fix-volume-keys-not-releasing-on-Mivvy-G310.patch +Patch6: 0006-hid2hci-fix-Logitech-diNovo-MX5500-and-other-keyboar.patch +Patch7: 0007-log-an-error-when-a-message-from-the-wrong-version-o.patch +Patch8: 0008-libudev-bump-minor-so-version-after-adding-symbols.patch +Patch9: 0009-hid2hci-fix-for-Logitech-diNovo-Edge-keyboard.patch +Patch10: 0010-udevadm-fix-short-options-in-getopt.patch +Patch11: 0011-keymap-Generalize-Samsung-keymaps.patch +Patch12: 0012-keymap-Add-force-release-quirks-for-a-lot-more-Samsu.patch +Patch13: 0013-udevd-fix-some-memory-leaks-in-error-path.patch +Patch14: 0014-malloc-memset-calloc.patch +Patch15: 0015-udevd-fix-short-options-in-getopt.patch +Patch16: 0016-call-util_delete_path-only-when-we-actually-deleted-.patch +Patch17: 0017-udev-acl-properly-handle-CK-change-events-for-root-u.patch +Patch18: 0018-udev-acl-really-fix-ACL-assignment-in-CK-events.patch + +Patch100: udev-qemu-cdrom.patch + ExclusiveOS: Linux URL: http://www.kernel.org/pub/linux/utils/kernel/hotplug/udev.html BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n) @@ -114,6 +134,26 @@ 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 +%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 +%patch100 -p1 -b .qemu + + %build libtoolize -f -c %configure --with-selinux --prefix=%{_prefix} --exec-prefix="" \ @@ -348,6 +388,13 @@ rm -rf $RPM_BUILD_ROOT %attr(0644,root,root) %{_libdir}/pkgconfig/gudev-1.0* %changelog +* 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 c20f18b85c07c5a54c8b41b3c1034d68f799f579 Mon Sep 17 00:00:00 2001 From: Harald Hoyer Date: Fri, 13 Aug 2010 10:33:49 +0200 Subject: [PATCH 02/12] udev-post.init: change trigger event to "add" --- udev-post.init | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/udev-post.init b/udev-post.init index f882e0d..c9c0d71 100644 --- a/udev-post.init +++ b/udev-post.init @@ -25,7 +25,7 @@ case "$1" in [ -w /var/lock/subsys ] || exit 4 STRING=$"Retrigger failed udev events" echo -n $STRING - /sbin/udevadm trigger --type=failed + /sbin/udevadm trigger --type=failed --action=add success "$STRING" echo From b1f83ec4d248257699e54387b80dd5c22f6e0306 Mon Sep 17 00:00:00 2001 From: Harald Hoyer Date: Tue, 17 Aug 2010 11:37:36 +0200 Subject: [PATCH 03/12] - 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 --- .gitignore | 2 + ...ireWire-IDs-Point-Grey-IIDC-AV-C-ven.patch | 68 ---------- ...irewire-rules-for-deprecated-drivers.patch | 27 ---- ...firewire-matches-to-recent-rule-chan.patch | 31 ----- ...ume-keys-not-releasing-on-Mivvy-G310.patch | 29 ---- ...tech-diNovo-MX5500-and-other-keyboar.patch | 28 ---- ...n-a-message-from-the-wrong-version-o.patch | 29 ---- ...inor-so-version-after-adding-symbols.patch | 29 ---- ...ix-for-Logitech-diNovo-Edge-keyboard.patch | 30 ----- ...-udevadm-fix-short-options-in-getopt.patch | 53 -------- 0011-keymap-Generalize-Samsung-keymaps.patch | 30 ----- ...-release-quirks-for-a-lot-more-Samsu.patch | 26 ---- ...-fix-some-memory-leaks-in-error-path.patch | 69 ---------- 0014-malloc-memset-calloc.patch | 28 ---- 0015-udevd-fix-short-options-in-getopt.patch | 25 ---- ..._path-only-when-we-actually-deleted-.patch | 85 ------------ ...y-handle-CK-change-events-for-root-u.patch | 52 -------- ...ally-fix-ACL-assignment-in-CK-events.patch | 125 ------------------ sources | 3 +- udev.spec | 52 ++------ 20 files changed, 14 insertions(+), 807 deletions(-) delete mode 100644 0002-rules-add-more-FireWire-IDs-Point-Grey-IIDC-AV-C-ven.patch delete mode 100644 0003-rules-remove-firewire-rules-for-deprecated-drivers.patch delete mode 100644 0004-udev-acl-update-firewire-matches-to-recent-rule-chan.patch delete mode 100644 0005-Fix-volume-keys-not-releasing-on-Mivvy-G310.patch delete mode 100644 0006-hid2hci-fix-Logitech-diNovo-MX5500-and-other-keyboar.patch delete mode 100644 0007-log-an-error-when-a-message-from-the-wrong-version-o.patch delete mode 100644 0008-libudev-bump-minor-so-version-after-adding-symbols.patch delete mode 100644 0009-hid2hci-fix-for-Logitech-diNovo-Edge-keyboard.patch delete mode 100644 0010-udevadm-fix-short-options-in-getopt.patch delete mode 100644 0011-keymap-Generalize-Samsung-keymaps.patch delete mode 100644 0012-keymap-Add-force-release-quirks-for-a-lot-more-Samsu.patch delete mode 100644 0013-udevd-fix-some-memory-leaks-in-error-path.patch delete mode 100644 0014-malloc-memset-calloc.patch delete mode 100644 0015-udevd-fix-short-options-in-getopt.patch delete mode 100644 0016-call-util_delete_path-only-when-we-actually-deleted-.patch delete mode 100644 0017-udev-acl-properly-handle-CK-change-events-for-root-u.patch delete mode 100644 0018-udev-acl-really-fix-ACL-assignment-in-CK-events.patch diff --git a/.gitignore b/.gitignore index 22be2f6..ed0e88c 100644 --- a/.gitignore +++ b/.gitignore @@ -1 +1,3 @@ udev-160.tar.bz2 +udev-161.tar.bz2.sign +udev-161.tar.bz2 diff --git a/0002-rules-add-more-FireWire-IDs-Point-Grey-IIDC-AV-C-ven.patch b/0002-rules-add-more-FireWire-IDs-Point-Grey-IIDC-AV-C-ven.patch deleted file mode 100644 index 602e824..0000000 --- a/0002-rules-add-more-FireWire-IDs-Point-Grey-IIDC-AV-C-ven.patch +++ /dev/null @@ -1,68 +0,0 @@ -From 1bbc1a9cb0d65c1326e18170f3b445047cb1ea80 Mon Sep 17 00:00:00 2001 -From: Stefan Richter -Date: Sun, 11 Jul 2010 12:32:12 +0200 -Subject: [PATCH 02/18] rules: add more FireWire IDs: Point Grey IIDC; AV/C + vendor unique - -1. IIDC cameras from Point Grey use the vendor OUI as Specifier_ID -instead of the 1394 TA's OUI but are otherwise fully compliant to the -IIDC spec. Their device files should be accessible like those of any -other IIDC cameras. - -2. Originally, the Software_Version of devices that implement FCP -(IEC 61883-1 Function Control Protocol) was meant to be a bitmap of all -command sets that an FCP capable unit supports. Bitmap flags are -defined for AV/C, CAL, EHS, HAVi, and vendor unique command sets. -Software_Version was revised to be a simple identifier instead, and -devices that support several command sets were meant to instantiate one -unit directory for each command set. Still, some devices with the flags -for AV/C and vendor unique command sets combined were released (but -apparently no devices with any other flag combinations). These rare but -existing AV/C + vendor unique devices need to be accessible just like -plain AV/C devices. - -Side notes: - - Many AV/C devices make use of the Vendor Dependent AV/C command, but -this is unrelated to vendor unique FCP command sets. - - Here are all standardized FireWire protocol identifiers that I know -of, listed as Specifier_ID:Software_Version | specifier | protocol. -0x00005e:0x000001 | IANA | IPv4 over 1394 (RFC 2734) -0x00005e:0x000002 | IANA | IPv6 over 1394 (RFC 3146) -0x00609e:0x010483 | INCITS | SBP-2 (or SCSI command sets over SBP-3) -0x00609e:0x0105bb | INCITS | AV/C over SBP-3 -0x00a02d:0x010001 | 1394 TA | AV/C (over FCP) -0x00a02d:0x010002 | 1394 TA | CAL -0x00a02d:0x010004 | 1394 TA | EHS -0x00a02d:0x010008 | 1394 TA | HAVi -0x00a02d:0x014000 | 1394 TA | Vendor Unique -0x00a02d:0x014001 | 1394 TA | Vendor Unique and AV/C (over FCP) -0x00a02d:0x000100 | 1394 TA | IIDC 1.04 -0x00a02d:0x000101 | 1394 TA | IIDC 1.20 -0x00a02d:0x000102 | 1394 TA | IIDC 1.30 -0x00a02d:0x0A6BE2 | 1394 TA | DPP 1.0 -0x00a02d:0x4B661F | 1394 TA | IICP 1.0 -For now we are only interested in udev rules for AV/C and IIDC. - -Reported-by: Damien Douxchamps (Point Grey IIDC ID) -Reported-by: Clemens Ladisch (AV/C + vendor unique ID) -Signed-off-by: Stefan Richter ---- - rules/rules.d/50-udev-default.rules | 2 ++ - 1 files changed, 2 insertions(+), 0 deletions(-) - -diff --git a/rules/rules.d/50-udev-default.rules b/rules/rules.d/50-udev-default.rules -index 10cfbd6..3c0f747 100644 ---- a/rules/rules.d/50-udev-default.rules -+++ b/rules/rules.d/50-udev-default.rules -@@ -49,7 +49,9 @@ SUBSYSTEM=="dvb", GROUP="video" - - # FireWire (firewire-core driver: IIDC devices, AV/C devices) - SUBSYSTEM=="firewire", ATTR{units}=="*0x00a02d:0x00010*", GROUP="video" -+SUBSYSTEM=="firewire", ATTR{units}=="*0x00b09d:0x00010*", GROUP="video" - SUBSYSTEM=="firewire", ATTR{units}=="*0x00a02d:0x010001*", GROUP="video" -+SUBSYSTEM=="firewire", ATTR{units}=="*0x00a02d:0x014001*", GROUP="video" - - # FireWire (deprecated dv1394 and video1394 drivers) - KERNEL=="dv1394-[0-9]*", NAME="dv1394/%n", GROUP="video" --- -1.7.2 - diff --git a/0003-rules-remove-firewire-rules-for-deprecated-drivers.patch b/0003-rules-remove-firewire-rules-for-deprecated-drivers.patch deleted file mode 100644 index 31531af..0000000 --- a/0003-rules-remove-firewire-rules-for-deprecated-drivers.patch +++ /dev/null @@ -1,27 +0,0 @@ -From 9de4a43a899dd03dd10ebc156be85ecdd33ce62a Mon Sep 17 00:00:00 2001 -From: Kay Sievers -Date: Mon, 12 Jul 2010 11:04:17 +0200 -Subject: [PATCH 03/18] rules: remove firewire rules for deprecated drivers - ---- - rules/rules.d/50-udev-default.rules | 4 ---- - 1 files changed, 0 insertions(+), 4 deletions(-) - -diff --git a/rules/rules.d/50-udev-default.rules b/rules/rules.d/50-udev-default.rules -index 3c0f747..9f98809 100644 ---- a/rules/rules.d/50-udev-default.rules -+++ b/rules/rules.d/50-udev-default.rules -@@ -53,10 +53,6 @@ SUBSYSTEM=="firewire", ATTR{units}=="*0x00b09d:0x00010*", GROUP="video" - SUBSYSTEM=="firewire", ATTR{units}=="*0x00a02d:0x010001*", GROUP="video" - SUBSYSTEM=="firewire", ATTR{units}=="*0x00a02d:0x014001*", GROUP="video" - --# FireWire (deprecated dv1394 and video1394 drivers) --KERNEL=="dv1394-[0-9]*", NAME="dv1394/%n", GROUP="video" --KERNEL=="video1394-[0-9]*", NAME="video1394/%n", GROUP="video" -- - # libusb device nodes - SUBSYSTEM=="usb", ENV{DEVTYPE}=="usb_device", MODE="0664" - --- -1.7.2 - diff --git a/0004-udev-acl-update-firewire-matches-to-recent-rule-chan.patch b/0004-udev-acl-update-firewire-matches-to-recent-rule-chan.patch deleted file mode 100644 index b59c4c4..0000000 --- a/0004-udev-acl-update-firewire-matches-to-recent-rule-chan.patch +++ /dev/null @@ -1,31 +0,0 @@ -From 2ffb33bdece1ef75886dc8d50490050c8a4b53bd Mon Sep 17 00:00:00 2001 -From: Kay Sievers -Date: Thu, 15 Jul 2010 11:38:14 +0200 -Subject: [PATCH 04/18] udev-acl: update firewire matches to recent rule changes - ---- - extras/udev-acl/70-acl.rules | 6 ++---- - 1 files changed, 2 insertions(+), 4 deletions(-) - -diff --git a/extras/udev-acl/70-acl.rules b/extras/udev-acl/70-acl.rules -index 8300ec2..493a43a 100644 ---- a/extras/udev-acl/70-acl.rules -+++ b/extras/udev-acl/70-acl.rules -@@ -37,12 +37,10 @@ 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}=="*0x00b09d: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" -- --# old style firewire devices --KERNEL=="dv1394-[0-9]*", TAG+="udev-acl" --KERNEL=="video1394-[0-9]*", TAG+="udev-acl" -+SUBSYSTEM=="firewire", ATTR{units}=="*0x00a02d:0x014001*", TAG+="udev-acl" - - # fingerprint readers - SUBSYSTEM=="usb", ATTR{idVendor}=="0483", ATTR{idProduct}=="2016", TAG+="udev-acl" --- -1.7.2 - diff --git a/0005-Fix-volume-keys-not-releasing-on-Mivvy-G310.patch b/0005-Fix-volume-keys-not-releasing-on-Mivvy-G310.patch deleted file mode 100644 index f38a783..0000000 --- a/0005-Fix-volume-keys-not-releasing-on-Mivvy-G310.patch +++ /dev/null @@ -1,29 +0,0 @@ -From 85c3d3b032b4c9a743a9c46eeede469eb999fb54 Mon Sep 17 00:00:00 2001 -From: Jerone Young -Date: Thu, 15 Jul 2010 22:01:24 -0500 -Subject: [PATCH 05/18] Fix volume keys not releasing on Mivvy G310 - -keymap: add My Mivvy G310 - -Fixes volume keys not sending key release on My Mivvy G310 laptop. - -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 db8a3b3..cb1fe78 100644 ---- a/extras/keymap/95-keyboard-force-release.rules -+++ b/extras/keymap/95-keyboard-force-release.rules -@@ -33,4 +33,6 @@ ENV{DMI_VENDOR}=="PEGATRON CORP.", ATTR{[dmi/id]product_name}=="Spring Peak", RU - - ENV{DMI_VENDOR}=="TOSHIBA", ATTR{[dmi/id]product_name}=="Satellite U300|Satellite Pro U300|Satellite U305", RUN+="keyboard-force-release.sh $devpath common-volume-keys" - -+ENV{DMI_VENDOR}=="Viooo Corporation", ATTR{[dmi/id]product_name}=="PT17", RUN+="keyboard-force-release.sh $devpath common-volume-keys" -+ - LABEL="force_release_end" --- -1.7.2 - diff --git a/0006-hid2hci-fix-Logitech-diNovo-MX5500-and-other-keyboar.patch b/0006-hid2hci-fix-Logitech-diNovo-MX5500-and-other-keyboar.patch deleted file mode 100644 index fe59883..0000000 --- a/0006-hid2hci-fix-Logitech-diNovo-MX5500-and-other-keyboar.patch +++ /dev/null @@ -1,28 +0,0 @@ -From a466c239a98045767c3aa7dfbf95306f36b9bf48 Mon Sep 17 00:00:00 2001 -From: Marco d'Itri -Date: Mon, 19 Jul 2010 10:37:41 +0200 -Subject: [PATCH 06/18] hid2hci: fix Logitech diNovo, MX5500 and other keyboards - ---- - 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 c5528f0..4351551 100644 ---- a/extras/hid2hci/70-hid2hci.rules -+++ b/extras/hid2hci/70-hid2hci.rules -@@ -11,9 +11,9 @@ ATTR{bInterfaceClass}=="03", ATTR{bInterfaceSubClass}=="01", ATTR{bInterfaceProt - RUN+="hid2hci --method=dell --devpath=%p", ENV{HID2HCI_SWITCH}="1" - - # Logitech devices (hidraw) --KERNEL=="hiddev*", ATTRS{idVendor}=="046d", ATTRS{idProduct}=="c70[345bce]|c71[34bc]", \ -+KERNEL=="hiddev*", ATTRS{idVendor}=="046d", ATTRS{idProduct}=="c70[35e]|c71[34]", \ - RUN+="hid2hci --method=logitech-hid --devpath=%p" --KERNEL=="hidraw*", ATTRS{idVendor}=="046d", ATTRS{idProduct}=="c70a", \ -+KERNEL=="hidraw*", ATTRS{idVendor}=="046d", ATTRS{idProduct}=="c70[4abc]|c71[bc]", \ - RUN+="hid2hci --method=logitech-hid --devpath=%p" - - ENV{DEVTYPE}!="usb_device", GOTO="hid2hci_end" --- -1.7.2 - diff --git a/0007-log-an-error-when-a-message-from-the-wrong-version-o.patch b/0007-log-an-error-when-a-message-from-the-wrong-version-o.patch deleted file mode 100644 index 952c9bc..0000000 --- a/0007-log-an-error-when-a-message-from-the-wrong-version-o.patch +++ /dev/null @@ -1,29 +0,0 @@ -From 9b6c6b56123670050b1dc5eb69ea1a9638bedd39 Mon Sep 17 00:00:00 2001 -From: Marco d'Itri -Date: Mon, 19 Jul 2010 10:56:37 +0200 -Subject: [PATCH 07/18] log an error when a message from the wrong version of udevadm is ignored - ---- - libudev/libudev-monitor.c | 5 ++++- - 1 files changed, 4 insertions(+), 1 deletions(-) - -diff --git a/libudev/libudev-monitor.c b/libudev/libudev-monitor.c -index b3e5d5f..a3789c4 100644 ---- a/libudev/libudev-monitor.c -+++ b/libudev/libudev-monitor.c -@@ -625,8 +625,11 @@ retry: - 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)) -+ if (nlh->magic != htonl(UDEV_MONITOR_MAGIC)) { -+ err(udev_monitor->udev, "ignored a message from an invalid release of udevadm (%x != %x)\n", -+ nlh->magic, htonl(UDEV_MONITOR_MAGIC)); - return NULL; -+ } - if (nlh->properties_off+32 > buflen) - return NULL; - bufpos = nlh->properties_off; --- -1.7.2 - diff --git a/0008-libudev-bump-minor-so-version-after-adding-symbols.patch b/0008-libudev-bump-minor-so-version-after-adding-symbols.patch deleted file mode 100644 index 59fbee5..0000000 --- a/0008-libudev-bump-minor-so-version-after-adding-symbols.patch +++ /dev/null @@ -1,29 +0,0 @@ -From 2ec30504d628a445b892c697745b9886b42227e1 Mon Sep 17 00:00:00 2001 -From: Kay Sievers -Date: Mon, 19 Jul 2010 14:08:21 +0200 -Subject: [PATCH 08/18] libudev: bump minor so version after adding symbols - ---- - Makefile.am | 6 +++--- - 1 files changed, 3 insertions(+), 3 deletions(-) - -diff --git a/Makefile.am b/Makefile.am -index 3406c3a..e80d43a 100644 ---- a/Makefile.am -+++ b/Makefile.am -@@ -29,9 +29,9 @@ CLEANFILES = - # ------------------------------------------------------------------------------ - # libudev - # ------------------------------------------------------------------------------ --LIBUDEV_CURRENT=8 --LIBUDEV_REVISION=3 --LIBUDEV_AGE=8 -+LIBUDEV_CURRENT=9 -+LIBUDEV_REVISION=0 -+LIBUDEV_AGE=9 - - SUBDIRS += libudev/docs - --- -1.7.2 - diff --git a/0009-hid2hci-fix-for-Logitech-diNovo-Edge-keyboard.patch b/0009-hid2hci-fix-for-Logitech-diNovo-Edge-keyboard.patch deleted file mode 100644 index 574ecf4..0000000 --- a/0009-hid2hci-fix-for-Logitech-diNovo-Edge-keyboard.patch +++ /dev/null @@ -1,30 +0,0 @@ -From efb27d646590660c766796fc314a291bdcd2b3e1 Mon Sep 17 00:00:00 2001 -From: Marco d'Itri -Date: Fri, 23 Jul 2010 12:08:31 +0200 -Subject: [PATCH 09/18] hid2hci: fix for Logitech diNovo Edge keyboard - ---- - extras/hid2hci/70-hid2hci.rules | 6 +++--- - 1 files changed, 3 insertions(+), 3 deletions(-) - -diff --git a/extras/hid2hci/70-hid2hci.rules b/extras/hid2hci/70-hid2hci.rules -index 4351551..3b36629 100644 ---- a/extras/hid2hci/70-hid2hci.rules -+++ b/extras/hid2hci/70-hid2hci.rules -@@ -10,10 +10,10 @@ 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=="hiddev*", ATTRS{idVendor}=="046d", ATTRS{idProduct}=="c70[35e]|c71[34]", \ -+# Logitech devices -+KERNEL=="hiddev*", ATTRS{idVendor}=="046d", ATTRS{idProduct}=="c70[35e]", \ - RUN+="hid2hci --method=logitech-hid --devpath=%p" --KERNEL=="hidraw*", ATTRS{idVendor}=="046d", ATTRS{idProduct}=="c70[4abc]|c71[bc]", \ -+KERNEL=="hidraw*", ATTRS{idVendor}=="046d", ATTRS{idProduct}=="c70[4abc]|c71[34bc]", \ - RUN+="hid2hci --method=logitech-hid --devpath=%p" - - ENV{DEVTYPE}!="usb_device", GOTO="hid2hci_end" --- -1.7.2 - diff --git a/0010-udevadm-fix-short-options-in-getopt.patch b/0010-udevadm-fix-short-options-in-getopt.patch deleted file mode 100644 index 101f710..0000000 --- a/0010-udevadm-fix-short-options-in-getopt.patch +++ /dev/null @@ -1,53 +0,0 @@ -From 163c0365ffbd9321d686e8c301c36ea50c98df2f Mon Sep 17 00:00:00 2001 -From: Yin Kangkai -Date: Wed, 28 Jul 2010 06:56:13 +0200 -Subject: [PATCH 10/18] udevadm: fix short options in getopt() - ---- - udev/udevadm-control.c | 2 +- - udev/udevadm-info.c | 2 +- - udev/udevadm-trigger.c | 2 +- - 3 files changed, 3 insertions(+), 3 deletions(-) - -diff --git a/udev/udevadm-control.c b/udev/udevadm-control.c -index 1f8008a..8b90829 100644 ---- a/udev/udevadm-control.c -+++ b/udev/udevadm-control.c -@@ -71,7 +71,7 @@ int udevadm_control(struct udev *udev, int argc, char *argv[]) - int i; - char *endp; - -- option = getopt_long(argc, argv, "l:sSRp:m:M:h", options, NULL); -+ option = getopt_long(argc, argv, "l:sSRp:m:h", options, NULL); - if (option == -1) - break; - -diff --git a/udev/udevadm-info.c b/udev/udevadm-info.c -index 14baa6a..9bd60c7 100644 ---- a/udev/udevadm-info.c -+++ b/udev/udevadm-info.c -@@ -242,7 +242,7 @@ int udevadm_info(struct udev *udev, int argc, char *argv[]) - int option; - struct stat statbuf; - -- option = getopt_long(argc, argv, "aed:n:p:q:rxPVh", options, NULL); -+ option = getopt_long(argc, argv, "aed:n:p:q:rxP:Vh", options, NULL); - if (option == -1) - break; - -diff --git a/udev/udevadm-trigger.c b/udev/udevadm-trigger.c -index 481e9cf..c32e0b4 100644 ---- a/udev/udevadm-trigger.c -+++ b/udev/udevadm-trigger.c -@@ -128,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, "vng:o:t:hcp:s:S:a:A:y:", options, NULL); -+ option = getopt_long(argc, argv, "vng:o:t:hc:p:s:S:a:A:y:", options, NULL); - if (option == -1) - break; - --- -1.7.2 - diff --git a/0011-keymap-Generalize-Samsung-keymaps.patch b/0011-keymap-Generalize-Samsung-keymaps.patch deleted file mode 100644 index 5ba9edf..0000000 --- a/0011-keymap-Generalize-Samsung-keymaps.patch +++ /dev/null @@ -1,30 +0,0 @@ -From c9fbbd6ea2f92e037cdaba6b7116d3b3e904696a Mon Sep 17 00:00:00 2001 -From: Martin Pitt -Date: Sun, 1 Aug 2010 21:59:58 +0200 -Subject: [PATCH 11/18] keymap: Generalize Samsung keymaps - -Fortunato Ventre (voRia) reports a lot more Samsung models -which need the "samsung-other" keymap. Instead of eternally playing catchup, -apply it to all Samsung models for now, and keep the two known special cases. - -https://launchpad.net/bugs/554066 ---- - 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 6e37067..13b5571 100644 ---- a/extras/keymap/95-keymap.rules -+++ b/extras/keymap/95-keymap.rules -@@ -115,7 +115,7 @@ ENV{DMI_VENDOR}=="INVENTEC", ATTR{[dmi/id]product_name}=="SYMPHONY 6.0/7.0", RUN - - ENV{DMI_VENDOR}=="MAXDATA", ATTR{[dmi/id]product_name}=="Pro 7000*", RUN+="keymap $name maxdata-pro_7000" - --ENV{DMI_VENDOR}=="[sS][aA][mM][sS][uU][nN][gG]*", ATTR{[dmi/id]product_name}=="*NC10*|*NC20*|*N128*|*N130*|*N210*|*SP55S*|*SQ45S70S*|*SX60P*|*SX22S*|*SX30S*|*R59P/R60P/R61P*|*SR70S/SR71S*|*Q210*|*Q310*|*X05*|*P560*|*R560*", RUN+="keymap $name samsung-other" -+ENV{DMI_VENDOR}=="[sS][aA][mM][sS][uU][nN][gG]*", RUN+="keymap $name samsung-other" - ENV{DMI_VENDOR}=="[sS][aA][mM][sS][uU][nN][gG]*", ATTR{[dmi/id]product_name}=="*SX20S*", RUN+="keymap $name samsung-sx20s" - ENV{DMI_VENDOR}=="[sS][aA][mM][sS][uU][nN][gG]*", ATTR{[dmi/id]product_name}=="SQ1US", RUN+="keymap $name samsung-sq1us" - --- -1.7.2 - diff --git a/0012-keymap-Add-force-release-quirks-for-a-lot-more-Samsu.patch b/0012-keymap-Add-force-release-quirks-for-a-lot-more-Samsu.patch deleted file mode 100644 index 5b89fed..0000000 --- a/0012-keymap-Add-force-release-quirks-for-a-lot-more-Samsu.patch +++ /dev/null @@ -1,26 +0,0 @@ -From 5047f82de4d3b973281993516441a35cebcf1294 Mon Sep 17 00:00:00 2001 -From: Fortunato Ventre -Date: Sun, 1 Aug 2010 22:03:30 +0200 -Subject: [PATCH 12/18] keymap: Add force-release quirks for a lot more Samsung models - -https://launchpad.net/bugs/554066 ---- - 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 cb1fe78..bd6b75f 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}=="*N128*|*N130*|*N140*|*N210*|*SR70S/SR71S*|*Q210/P210*", RUN+="keyboard-force-release.sh $devpath samsung-other" -+ENV{DMI_VENDOR}=="[sS][aA][mM][sS][uU][nN][gG]*", ATTR{[dmi/id]product_name}=="*E252*|*N120*|*N128*|*N130*|*N140*|*N148/N208*|*N150*|*N150/N210/N220*|*N220*|*N308*|*N310*|*N510*|*NB30*|*NC10/N110*|*ND10*|*Q210/P210*|*R410P*|*R425/R525*|*R428/P428*|*R460*|*R463*|*R468/R418*|*R480/R431/R481*|*R509*|*R518*|*R519/R719*|*R520/R522/R620*|*R528/R728*|*R530/R730*|*R530/R730/P590*|*R560*|*R580*|*R580/R590*|*R59/R60/R61*|*R59P/R60P/R61P*|*R710*|*R720*|*R780/R778*|*SR58P*|*SR700*|*SR70S/SR71S*|*SX22S*|*X118*|*X120*|*X460*", RUN+="keyboard-force-release.sh $devpath samsung-other" - - ENV{DMI_VENDOR}=="Dell Inc.", ATTR{[dmi/id]product_name}=="Studio 1557|Studio 1558", RUN+="keyboard-force-release.sh $devpath common-volume-keys" - --- -1.7.2 - diff --git a/0013-udevd-fix-some-memory-leaks-in-error-path.patch b/0013-udevd-fix-some-memory-leaks-in-error-path.patch deleted file mode 100644 index ed97c3a..0000000 --- a/0013-udevd-fix-some-memory-leaks-in-error-path.patch +++ /dev/null @@ -1,69 +0,0 @@ -From 1851332c08e3f70ee172bbe5b153789da5df2df5 Mon Sep 17 00:00:00 2001 -From: Yin Kangkai -Date: Mon, 2 Aug 2010 18:31:18 +0800 -Subject: [PATCH 13/18] udevd: fix some memory leaks in error path - -Signed-off-by: Yin Kangkai ---- - udev/udev-rules.c | 15 ++++++++++++--- - udev/udevd.c | 4 +++- - 2 files changed, 15 insertions(+), 4 deletions(-) - -diff --git a/udev/udev-rules.c b/udev/udev-rules.c -index 6d32e73..4b81a50 100644 ---- a/udev/udev-rules.c -+++ b/udev/udev-rules.c -@@ -1761,13 +1761,18 @@ struct udev_rules *udev_rules_new(struct udev *udev, int resolve_names) - - /* init token array and string buffer */ - rules->tokens = malloc(PREALLOC_TOKEN * sizeof(struct token)); -- if (rules->tokens == NULL) -+ if (rules->tokens == NULL) { -+ free(rules); - return NULL; -+ } - rules->token_max = PREALLOC_TOKEN; - - rules->buf = malloc(PREALLOC_STRBUF); -- if (rules->buf == NULL) -+ if (rules->buf == NULL) { -+ free(rules->tokens); -+ free(rules); - return NULL; -+ } - rules->buf_max = PREALLOC_STRBUF; - /* offset 0 is always '\0' */ - rules->buf[0] = '\0'; -@@ -1776,8 +1781,12 @@ struct udev_rules *udev_rules_new(struct udev *udev, int resolve_names) - rules->token_max * sizeof(struct token), rules->token_max, sizeof(struct token), rules->buf_max); - - rules->trie_nodes = malloc(PREALLOC_TRIE * sizeof(struct trie_node)); -- if (rules->trie_nodes == NULL) -+ if (rules->trie_nodes == NULL) { -+ free(rules->buf); -+ free(rules->tokens); -+ free(rules); - return NULL; -+ } - rules->trie_nodes_max = PREALLOC_TRIE; - /* offset 0 is the trie root, with an empty string */ - memset(rules->trie_nodes, 0x00, sizeof(struct trie_node)); -diff --git a/udev/udevd.c b/udev/udevd.c -index 873634f..fbc2371 100644 ---- a/udev/udevd.c -+++ b/udev/udevd.c -@@ -227,8 +227,10 @@ static void worker_new(struct event *event) - udev_monitor_enable_receiving(worker_monitor); - - worker = calloc(1, sizeof(struct worker)); -- if (worker == NULL) -+ if (worker == NULL) { -+ udev_monitor_unref(worker_monitor); - return; -+ } - /* worker + event reference */ - worker->refcount = 2; - worker->udev = event->udev; --- -1.7.2 - diff --git a/0014-malloc-memset-calloc.patch b/0014-malloc-memset-calloc.patch deleted file mode 100644 index 61a1245..0000000 --- a/0014-malloc-memset-calloc.patch +++ /dev/null @@ -1,28 +0,0 @@ -From 27f4528b9a6587cab2d916fad735dd93eb7563b0 Mon Sep 17 00:00:00 2001 -From: Yin Kangkai -Date: Tue, 3 Aug 2010 08:10:26 +0200 -Subject: [PATCH 14/18] malloc()+memset() -> calloc() - ---- - udev/udev-rules.c | 3 +-- - 1 files changed, 1 insertions(+), 2 deletions(-) - -diff --git a/udev/udev-rules.c b/udev/udev-rules.c -index 4b81a50..52f121c 100644 ---- a/udev/udev-rules.c -+++ b/udev/udev-rules.c -@@ -1751,10 +1751,9 @@ struct udev_rules *udev_rules_new(struct udev *udev, int resolve_names) - struct udev_list_entry *file_loop, *file_tmp; - struct token end_token; - -- rules = malloc(sizeof(struct udev_rules)); -+ rules = calloc(1, sizeof(struct udev_rules)); - if (rules == NULL) - return NULL; -- memset(rules, 0x00, sizeof(struct udev_rules)); - rules->udev = udev; - rules->resolve_names = resolve_names; - udev_list_init(&file_list); --- -1.7.2 - diff --git a/0015-udevd-fix-short-options-in-getopt.patch b/0015-udevd-fix-short-options-in-getopt.patch deleted file mode 100644 index 05e0d66..0000000 --- a/0015-udevd-fix-short-options-in-getopt.patch +++ /dev/null @@ -1,25 +0,0 @@ -From 4ab3c463d418c74275eb8170a87c8cf75e47d973 Mon Sep 17 00:00:00 2001 -From: Yin Kangkai -Date: Tue, 3 Aug 2010 08:11:43 +0200 -Subject: [PATCH 15/18] udevd: fix short options in getopt() - ---- - udev/udevd.c | 2 +- - 1 files changed, 1 insertions(+), 1 deletions(-) - -diff --git a/udev/udevd.c b/udev/udevd.c -index fbc2371..2808117 100644 ---- a/udev/udevd.c -+++ b/udev/udevd.c -@@ -1062,7 +1062,7 @@ int main(int argc, char *argv[]) - for (;;) { - int option; - -- option = getopt_long(argc, argv, "cdeDthV", options, NULL); -+ option = getopt_long(argc, argv, "c:deDthV", options, NULL); - if (option == -1) - break; - --- -1.7.2 - diff --git a/0016-call-util_delete_path-only-when-we-actually-deleted-.patch b/0016-call-util_delete_path-only-when-we-actually-deleted-.patch deleted file mode 100644 index e3e54b9..0000000 --- a/0016-call-util_delete_path-only-when-we-actually-deleted-.patch +++ /dev/null @@ -1,85 +0,0 @@ -From 8e5a620b17c08b0b6277236203ee559b7dadd1d4 Mon Sep 17 00:00:00 2001 -From: Kay Sievers -Date: Tue, 3 Aug 2010 12:13:53 +0200 -Subject: [PATCH 16/18] call util_delete_path() only when we actually deleted stuff - ---- - libudev/libudev-util-private.c | 17 ++++++----------- - udev/udev-node.c | 11 ++++++----- - 2 files changed, 12 insertions(+), 16 deletions(-) - -diff --git a/libudev/libudev-util-private.c b/libudev/libudev-util-private.c -index 2f9f4a7..6b68b6a 100644 ---- a/libudev/libudev-util-private.c -+++ b/libudev/libudev-util-private.c -@@ -74,7 +74,7 @@ int util_delete_path(struct udev *udev, const char *path) - { - char p[UTIL_PATH_SIZE]; - char *pos; -- int retval; -+ int err = 0; - - if (path[0] == '/') - while(path[1] == '/') -@@ -92,19 +92,14 @@ int util_delete_path(struct udev *udev, const char *path) - if ((pos == p) || (pos == NULL)) - break; - -- /* remove if empty */ -- retval = rmdir(p); -- if (errno == ENOENT) -- retval = 0; -- if (retval) { -- if (errno == ENOTEMPTY) -- return 0; -- err(udev, "rmdir(%s) failed: %m\n", p); -+ err = rmdir(p); -+ if (err < 0) { -+ if (errno == ENOENT) -+ err = 0; - break; - } -- dbg(udev, "removed '%s'\n", p); - } -- return 0; -+ return err; - } - - /* Reset permissions on the device node, before unlinking it to make sure, -diff --git a/udev/udev-node.c b/udev/udev-node.c -index 8339eb7..228b3eb 100644 ---- a/udev/udev-node.c -+++ b/udev/udev-node.c -@@ -298,15 +298,15 @@ static void link_update(struct udev_device *dev, const char *slink, bool add) - - if (!add) { - dbg(udev, "removing index: '%s'\n", filename); -- unlink(filename); -- util_delete_path(udev, filename); -+ if (unlink(filename) == 0) -+ rmdir(dirname); - } - - target = link_find_prioritized(dev, add, dirname, buf, sizeof(buf)); - if (target == NULL) { - info(udev, "no reference left, remove '%s'\n", slink); -- unlink(slink); -- util_delete_path(udev, slink); -+ if (unlink(slink) == 0) -+ util_delete_path(udev, slink); - } else { - info(udev, "creating link '%s' to '%s'\n", slink, target); - node_symlink(udev, target, slink); -@@ -427,7 +427,8 @@ int udev_node_remove(struct udev_device *dev) - - info(udev, "removing device node '%s'\n", devnode); - err = util_unlink_secure(udev, devnode); -- util_delete_path(udev, devnode); -+ if (err == 0) -+ util_delete_path(udev, devnode); - out: - return err; - } --- -1.7.2 - diff --git a/0017-udev-acl-properly-handle-CK-change-events-for-root-u.patch b/0017-udev-acl-properly-handle-CK-change-events-for-root-u.patch deleted file mode 100644 index fc32c06..0000000 --- a/0017-udev-acl-properly-handle-CK-change-events-for-root-u.patch +++ /dev/null @@ -1,52 +0,0 @@ -From 939cc18afc49ee8479572c14c7fa777646fd4add Mon Sep 17 00:00:00 2001 -From: Kay Sievers -Date: Tue, 3 Aug 2010 15:09:46 +0200 -Subject: [PATCH 17/18] udev-acl: properly handle CK change events for root user - -mschmidt@redhat.com writes: -> since root is treated specially, it does not do anything! -> udev-acl may want to prevent removing ACLs from root, but -> it must not stop the ACLs being granted to the user of the -> new session. - -https://bugzilla.redhat.com/show_bug.cgi?id=608712 ---- - extras/udev-acl/udev-acl.c | 7 +------ - 1 files changed, 1 insertions(+), 6 deletions(-) - -diff --git a/extras/udev-acl/udev-acl.c b/extras/udev-acl/udev-acl.c -index ff04ec6..f2b5005 100644 ---- a/extras/udev-acl/udev-acl.c -+++ b/extras/udev-acl/udev-acl.c -@@ -224,14 +224,10 @@ static int consolekit_called(const char *ck_action, uid_t *uid, uid_t *uid2, con - 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"); -@@ -263,12 +259,11 @@ static int consolekit_called(const char *ck_action, uid_t *uid, uid_t *uid2, con - a = ACTION_ADD; - u = u2; - } -- - break; - case ACTION_NONE: - break; - default: -- g_assert_not_reached (); -+ g_assert_not_reached(); - break; - } - --- -1.7.2 - diff --git a/0018-udev-acl-really-fix-ACL-assignment-in-CK-events.patch b/0018-udev-acl-really-fix-ACL-assignment-in-CK-events.patch deleted file mode 100644 index 9187554..0000000 --- a/0018-udev-acl-really-fix-ACL-assignment-in-CK-events.patch +++ /dev/null @@ -1,125 +0,0 @@ -From 9ac90ae153accdfcb56c24c5748690933ad219b2 Mon Sep 17 00:00:00 2001 -From: Michal Schmidt -Date: Wed, 4 Aug 2010 11:53:25 +0200 -Subject: [PATCH 18/18] udev-acl: really fix ACL assignment in CK events - -The previous fix for udev-acl was incomplete. The ACL were not properly -assigned to the new user when switching from root's session because of -the test for 'uid != 0'. - -Centralize the special handling of root to a single place (in set_facl). - -https://bugzilla.redhat.com/show_bug.cgi?id=608712 ---- - extras/udev-acl/udev-acl.c | 37 +++++++++++++++++++------------------ - 1 files changed, 19 insertions(+), 18 deletions(-) - -diff --git a/extras/udev-acl/udev-acl.c b/extras/udev-acl/udev-acl.c -index f2b5005..31e9991 100644 ---- a/extras/udev-acl/udev-acl.c -+++ b/extras/udev-acl/udev-acl.c -@@ -12,20 +12,18 @@ - * General Public License for more details: - */ - --#include --#include --#include --#include --#include --#include --#include --#include -+#include -+#include - #include - #include --#include - #include --#include -+#include - #include -+#include -+#include -+#include -+#include -+#include - - static int debug; - -@@ -45,6 +43,10 @@ static int set_facl(const char* filename, uid_t uid, int add) - acl_permset_t permset; - int ret; - -+ /* don't touch ACLs for root */ -+ if (uid == 0) -+ return 0; -+ - /* read current record */ - acl = acl_get_file(filename, ACL_TYPE_ACCESS); - if (!acl) -@@ -190,8 +192,6 @@ static int consolekit_called(const char *ck_action, uid_t *uid, uid_t *uid2, con - 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) -@@ -205,8 +205,6 @@ static int consolekit_called(const char *ck_action, uid_t *uid, uid_t *uid2, con - 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) -@@ -331,6 +329,7 @@ int main (int argc, char* argv[]) - }; - int action = -1; - const char *device = NULL; -+ bool uid_given = false; - uid_t uid = 0; - uid_t uid2 = 0; - const char* remove_session_id = NULL; -@@ -357,6 +356,7 @@ int main (int argc, char* argv[]) - device = optarg; - break; - case 'u': -+ uid_given = true; - uid = strtoul(optarg, NULL, 10); - break; - case 'd': -@@ -369,8 +369,9 @@ int main (int argc, char* argv[]) - } - } - -- if (action < 0 && device == NULL && uid == 0) -- consolekit_called(argv[optind], &uid, &uid2, &remove_session_id, &action); -+ if (action < 0 && device == NULL && !uid_given) -+ if (!consolekit_called(argv[optind], &uid, &uid2, &remove_session_id, &action)) -+ uid_given = true; - - if (action < 0) { - fprintf(stderr, "missing action\n\n"); -@@ -378,13 +379,13 @@ int main (int argc, char* argv[]) - goto out; - } - -- if (device != NULL && uid != 0) { -+ if (device != NULL && uid_given) { - fprintf(stderr, "only one option, --device=DEVICEFILE or --user=UID expected\n\n"); - rc = 3; - goto out; - } - -- if (uid != 0) { -+ if (uid_given) { - switch (action) { - case ACTION_ADD: - /* Add ACL for given uid to all matching devices. */ --- -1.7.2 - 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 4749942..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: 9%{?dist} +Version: 161 +Release: 1%{?dist} License: GPLv2+ Group: System Environment/Base Provides: udev-persistent = %{version}-%{release} @@ -17,26 +17,6 @@ Source: ftp://ftp.kernel.org/pub/linux/utils/kernel/hotplug/%{name}-%{version}.t Source1: start_udev Source2: udev-post.init -Patch2: 0002-rules-add-more-FireWire-IDs-Point-Grey-IIDC-AV-C-ven.patch -Patch3: 0003-rules-remove-firewire-rules-for-deprecated-drivers.patch -Patch4: 0004-udev-acl-update-firewire-matches-to-recent-rule-chan.patch -Patch5: 0005-Fix-volume-keys-not-releasing-on-Mivvy-G310.patch -Patch6: 0006-hid2hci-fix-Logitech-diNovo-MX5500-and-other-keyboar.patch -Patch7: 0007-log-an-error-when-a-message-from-the-wrong-version-o.patch -Patch8: 0008-libudev-bump-minor-so-version-after-adding-symbols.patch -Patch9: 0009-hid2hci-fix-for-Logitech-diNovo-Edge-keyboard.patch -Patch10: 0010-udevadm-fix-short-options-in-getopt.patch -Patch11: 0011-keymap-Generalize-Samsung-keymaps.patch -Patch12: 0012-keymap-Add-force-release-quirks-for-a-lot-more-Samsu.patch -Patch13: 0013-udevd-fix-some-memory-leaks-in-error-path.patch -Patch14: 0014-malloc-memset-calloc.patch -Patch15: 0015-udevd-fix-short-options-in-getopt.patch -Patch16: 0016-call-util_delete_path-only-when-we-actually-deleted-.patch -Patch17: 0017-udev-acl-properly-handle-CK-change-events-for-root-u.patch -Patch18: 0018-udev-acl-really-fix-ACL-assignment-in-CK-events.patch - -Patch100: udev-qemu-cdrom.patch - ExclusiveOS: Linux URL: http://www.kernel.org/pub/linux/utils/kernel/hotplug/udev.html BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n) @@ -134,26 +114,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 -%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 -%patch100 -p1 -b .qemu - - %build libtoolize -f -c %configure --with-selinux --prefix=%{_prefix} --exec-prefix="" \ @@ -230,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 @@ -388,6 +349,13 @@ 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 From b50b37d1d1ed852bca6ab97da3d3c515bd716b19 Mon Sep 17 00:00:00 2001 From: Harald Hoyer Date: Wed, 1 Sep 2010 11:24:28 +0200 Subject: [PATCH 04/12] - 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 e61860db45eea7822f57aede87a80fa20e0e1ff5 Mon Sep 17 00:00:00 2001 From: Harald Hoyer Date: Tue, 5 Oct 2010 17:11:39 +0200 Subject: [PATCH 05/12] - add cdrom_id patch for pre-MMC2 drives, which do not report profiles Resolves: rhbz#637495 --- udev-161-cdrom-fallback.patch | 20 ++++++++++++++++++++ udev.spec | 11 ++++++++++- 2 files changed, 30 insertions(+), 1 deletion(-) create mode 100644 udev-161-cdrom-fallback.patch diff --git a/udev-161-cdrom-fallback.patch b/udev-161-cdrom-fallback.patch new file mode 100644 index 0000000..bedb39b --- /dev/null +++ b/udev-161-cdrom-fallback.patch @@ -0,0 +1,20 @@ +diff -urN udev-161/extras/cdrom_id/cdrom_id.c udev-161.new/extras/cdrom_id/cdrom_id.c +--- udev-161/extras/cdrom_id/cdrom_id.c 2010-10-05 16:59:22.000000000 +0200 ++++ udev-161.new/extras/cdrom_id/cdrom_id.c 2010-10-05 16:59:06.000000000 +0200 +@@ -364,8 +364,14 @@ + err = scsi_cmd_run(udev, &sc, fd, header, sizeof(header)); + if ((err != 0)) { + info_scsi_cmd_err(udev, "READ DISC INFORMATION", err); +- info(udev, "no current profile, assuming no media\n"); +- return -1; ++ if (cd_media == 1) { ++ info(udev, "no current profile, but disc is present; assuming CD-ROM\n"); ++ cd_media_cd_rom = 1; ++ return 0; ++ } else { ++ info(udev, "no current profile, assuming no media\n"); ++ return -1; ++ } + }; + + cd_media = 1; diff --git a/udev.spec b/udev.spec index 6fc041f..ade4df7 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} @@ -40,6 +40,8 @@ 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 +Patch100: udev-161-cdrom-fallback.patch + ExclusiveOS: Linux URL: http://www.kernel.org/pub/linux/utils/kernel/hotplug/udev.html BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n) @@ -159,6 +161,8 @@ glib-based applications using libudev functionality. %patch22 -p1 -b .git22 %patch23 -p1 -b .git23 +%patch100 -p1 + %build libtoolize -f -c %configure --with-selinux --prefix=%{_prefix} --exec-prefix="" \ @@ -394,6 +398,11 @@ rm -rf $RPM_BUILD_ROOT %attr(0644,root,root) %{_libdir}/pkgconfig/gudev-1.0* %changelog +* Tue Oct 05 2010 Harald Hoyer 161-2 +- add cdrom_id patch for pre-MMC2 drives, which do not report + profiles +Resolves: rhbz#637495 + * Wed Sep 01 2010 Harald Hoyer 161-2 - bugfixes for systemd service files - bugfix for selinux labeling From e31ef1c26455d4e0a8231b2e12c4fea2edf0ff84 Mon Sep 17 00:00:00 2001 From: Harald Hoyer Date: Thu, 7 Oct 2010 18:02:10 +0200 Subject: [PATCH 06/12] - more cdrom_id patches Resolves: rhbz#637495 --- ...-cdrom_id-Add-media-status-debugging.patch | 4 +- ...rop-MEDIA_SESSION_NEXT-for-DVD-RW-RO.patch | 4 +- ...-cdrom_id-Fix-DVD-RW-media-detection.patch | 4 +- ...-blank-detection-for-sloppy-firmware.patch | 4 +- ...ding-the-medium-if-all-MMC-commands-.patch | 66 ++++++++++ ...Try-reading-the-medium-if-all-MMC-co.patch | 66 ++++++++++ ...ck-to-CDROM_DRIVE_STATUS-if-all-MMC-.patch | 38 ++++++ ...-Don-t-read-beyond-last-track-in-TOC.patch | 56 ++++++++ ...-the-drive-profile-features-with-a-d.patch | 124 ++++++++++++++++++ Makefile.git | 4 +- udev.spec | 39 ++++-- 11 files changed, 385 insertions(+), 24 deletions(-) rename 0001-cdrom_id-Add-media-status-debugging.patch => 0101-cdrom_id-Add-media-status-debugging.patch (92%) rename 0003-cdrom_id-Drop-MEDIA_SESSION_NEXT-for-DVD-RW-RO.patch => 0102-cdrom_id-Drop-MEDIA_SESSION_NEXT-for-DVD-RW-RO.patch (94%) rename 0020-cdrom_id-Fix-DVD-RW-media-detection.patch => 0103-cdrom_id-Fix-DVD-RW-media-detection.patch (96%) rename 0021-cdrom_id-Fix-DVD-blank-detection-for-sloppy-firmware.patch => 0104-cdrom_id-Fix-DVD-blank-detection-for-sloppy-firmware.patch (95%) create mode 100644 0105-cdrom_id-Try-reading-the-medium-if-all-MMC-commands-.patch create mode 100644 0106-Revert-cdrom_id-Try-reading-the-medium-if-all-MMC-co.patch create mode 100644 0107-cdrom_id-Fall-back-to-CDROM_DRIVE_STATUS-if-all-MMC-.patch create mode 100644 0108-cdrom_id-Don-t-read-beyond-last-track-in-TOC.patch create mode 100644 0109-cdrom_id-request-the-drive-profile-features-with-a-d.patch diff --git a/0001-cdrom_id-Add-media-status-debugging.patch b/0101-cdrom_id-Add-media-status-debugging.patch similarity index 92% rename from 0001-cdrom_id-Add-media-status-debugging.patch rename to 0101-cdrom_id-Add-media-status-debugging.patch index f282114..a97a186 100644 --- a/0001-cdrom_id-Add-media-status-debugging.patch +++ b/0101-cdrom_id-Add-media-status-debugging.patch @@ -1,7 +1,7 @@ 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 +Subject: [PATCH 1/9] cdrom_id: Add media status debugging Show which media status the hardware originally reports, since we mangle it in some cases. @@ -22,5 +22,5 @@ index 83e95d5..d59991c 100644 /* exclude plain CDROM, some fake cdroms return 0 for "blank" media here */ if (!cd_media_cd_rom) -- -1.7.2.2 +1.7.2.3 diff --git a/0003-cdrom_id-Drop-MEDIA_SESSION_NEXT-for-DVD-RW-RO.patch b/0102-cdrom_id-Drop-MEDIA_SESSION_NEXT-for-DVD-RW-RO.patch similarity index 94% rename from 0003-cdrom_id-Drop-MEDIA_SESSION_NEXT-for-DVD-RW-RO.patch rename to 0102-cdrom_id-Drop-MEDIA_SESSION_NEXT-for-DVD-RW-RO.patch index d476ee5..d742dd6 100644 --- a/0003-cdrom_id-Drop-MEDIA_SESSION_NEXT-for-DVD-RW-RO.patch +++ b/0102-cdrom_id-Drop-MEDIA_SESSION_NEXT-for-DVD-RW-RO.patch @@ -1,7 +1,7 @@ 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 +Subject: [PATCH 2/9] 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 @@ -30,5 +30,5 @@ index d59991c..f9d6e0b 100644 cd_media_session_count = header[9] << 8 | header[4]; cd_media_track_count = header[11] << 8 | header[6]; -- -1.7.2.2 +1.7.2.3 diff --git a/0020-cdrom_id-Fix-DVD-RW-media-detection.patch b/0103-cdrom_id-Fix-DVD-RW-media-detection.patch similarity index 96% rename from 0020-cdrom_id-Fix-DVD-RW-media-detection.patch rename to 0103-cdrom_id-Fix-DVD-RW-media-detection.patch index 4a91a4e..28882a6 100644 --- a/0020-cdrom_id-Fix-DVD-RW-media-detection.patch +++ b/0103-cdrom_id-Fix-DVD-RW-media-detection.patch @@ -1,7 +1,7 @@ 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 +Subject: [PATCH 3/9] 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 @@ -49,5 +49,5 @@ index f9d6e0b..8480d7b 100644 case 0x1B: info(udev, "profile 0x%02x media_dvd_plus_r\n", cur_profile); -- -1.7.2.2 +1.7.2.3 diff --git a/0021-cdrom_id-Fix-DVD-blank-detection-for-sloppy-firmware.patch b/0104-cdrom_id-Fix-DVD-blank-detection-for-sloppy-firmware.patch similarity index 95% rename from 0021-cdrom_id-Fix-DVD-blank-detection-for-sloppy-firmware.patch rename to 0104-cdrom_id-Fix-DVD-blank-detection-for-sloppy-firmware.patch index d033307..81e3d09 100644 --- a/0021-cdrom_id-Fix-DVD-blank-detection-for-sloppy-firmware.patch +++ b/0104-cdrom_id-Fix-DVD-blank-detection-for-sloppy-firmware.patch @@ -1,7 +1,7 @@ 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 +Subject: [PATCH 4/9] 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 @@ -38,5 +38,5 @@ index 8480d7b..0153af6 100644 err = scsi_cmd_run(udev, &sc, fd, buffer, sizeof(buffer)); if ((err != 0)) { -- -1.7.2.2 +1.7.2.3 diff --git a/0105-cdrom_id-Try-reading-the-medium-if-all-MMC-commands-.patch b/0105-cdrom_id-Try-reading-the-medium-if-all-MMC-commands-.patch new file mode 100644 index 0000000..1af41ec --- /dev/null +++ b/0105-cdrom_id-Try-reading-the-medium-if-all-MMC-commands-.patch @@ -0,0 +1,66 @@ +From ea88774a922c734afd751a59d8102bfa4806a1a6 Mon Sep 17 00:00:00 2001 +From: Martin Pitt +Date: Tue, 5 Oct 2010 14:34:55 +0200 +Subject: [PATCH 5/9] cdrom_id: Try reading the medium if all MMC commands fail + +Reportedly, some "when I'm grown up I want to be a CD drive" fake USB CD sticks +like the IronKey neither support the SCSI "GET CONFIGURATION" nor the older +(pre-MMC2) "READ DISC INFORMATION" command. In that case, check if we can read +data from the drive, and assume that we have a CD-ROM medium if it succeeds. +--- + extras/cdrom_id/cdrom_id.c | 32 ++++++++++++++++++++++++++++++-- + 1 files changed, 30 insertions(+), 2 deletions(-) + +diff --git a/extras/cdrom_id/cdrom_id.c b/extras/cdrom_id/cdrom_id.c +index 0153af6..f65f04f 100644 +--- a/extras/cdrom_id/cdrom_id.c ++++ b/extras/cdrom_id/cdrom_id.c +@@ -350,6 +350,34 @@ static int feature_profiles(struct udev *udev, const unsigned char *profiles, si + return 0; + } + ++static int cd_profiles_broken_mmc(struct udev *udev, int fd) ++{ ++ struct scsi_cmd sc; ++ unsigned char buffer[16 * 2048]; ++ int err; ++ ++ /* we land here if both the standard and the old MMC commands failed; ++ * this might happen on broken wanna-be-CD USB drives like the IronKey. ++ * As a last resort, try to read data to see whether it has a medium. ++ */ ++ 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, 16); ++ scsi_cmd_set(udev, &sc, 9, 0); ++ err = scsi_cmd_run(udev, &sc, fd, buffer, sizeof(buffer)); ++ if ((err != 0)) { ++ info(udev, "READ DATA failed, assuming no medium\n"); ++ return -1; ++ } ++ ++ /* that's all we can claim if we can read data */ ++ info(udev, "READ DATA succeeded, assuming CD-ROM medium\n"); ++ cd_media = 1; ++ cd_media_cd_rom = 1; ++ return 0; ++} ++ + static int cd_profiles_old_mmc(struct udev *udev, int fd) + { + struct scsi_cmd sc; +@@ -364,8 +392,8 @@ static int cd_profiles_old_mmc(struct udev *udev, int fd) + err = scsi_cmd_run(udev, &sc, fd, header, sizeof(header)); + if ((err != 0)) { + info_scsi_cmd_err(udev, "READ DISC INFORMATION", err); +- info(udev, "no current profile, assuming no media\n"); +- return -1; ++ info(udev, "no current profile, probing readability of medium\n"); ++ return cd_profiles_broken_mmc(udev, fd); + }; + + cd_media = 1; +-- +1.7.2.3 + diff --git a/0106-Revert-cdrom_id-Try-reading-the-medium-if-all-MMC-co.patch b/0106-Revert-cdrom_id-Try-reading-the-medium-if-all-MMC-co.patch new file mode 100644 index 0000000..dfc052d --- /dev/null +++ b/0106-Revert-cdrom_id-Try-reading-the-medium-if-all-MMC-co.patch @@ -0,0 +1,66 @@ +From 13e0fca5dff286921a8df0cd737e6e1224e53275 Mon Sep 17 00:00:00 2001 +From: Martin Pitt +Date: Tue, 5 Oct 2010 14:57:04 +0200 +Subject: [PATCH 6/9] Revert "cdrom_id: Try reading the medium if all MMC commands fail" + +Turns out we can do this much simpler by assuming that cd_media_compat() works, +which seems to be the case for the IronKey. + +This reverts commit ea88774a922c734afd751a59d8102bfa4806a1a6. +--- + extras/cdrom_id/cdrom_id.c | 32 ++------------------------------ + 1 files changed, 2 insertions(+), 30 deletions(-) + +diff --git a/extras/cdrom_id/cdrom_id.c b/extras/cdrom_id/cdrom_id.c +index f65f04f..0153af6 100644 +--- a/extras/cdrom_id/cdrom_id.c ++++ b/extras/cdrom_id/cdrom_id.c +@@ -350,34 +350,6 @@ static int feature_profiles(struct udev *udev, const unsigned char *profiles, si + return 0; + } + +-static int cd_profiles_broken_mmc(struct udev *udev, int fd) +-{ +- struct scsi_cmd sc; +- unsigned char buffer[16 * 2048]; +- int err; +- +- /* we land here if both the standard and the old MMC commands failed; +- * this might happen on broken wanna-be-CD USB drives like the IronKey. +- * As a last resort, try to read data to see whether it has a medium. +- */ +- 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, 16); +- scsi_cmd_set(udev, &sc, 9, 0); +- err = scsi_cmd_run(udev, &sc, fd, buffer, sizeof(buffer)); +- if ((err != 0)) { +- info(udev, "READ DATA failed, assuming no medium\n"); +- return -1; +- } +- +- /* that's all we can claim if we can read data */ +- info(udev, "READ DATA succeeded, assuming CD-ROM medium\n"); +- cd_media = 1; +- cd_media_cd_rom = 1; +- return 0; +-} +- + static int cd_profiles_old_mmc(struct udev *udev, int fd) + { + struct scsi_cmd sc; +@@ -392,8 +364,8 @@ static int cd_profiles_old_mmc(struct udev *udev, int fd) + err = scsi_cmd_run(udev, &sc, fd, header, sizeof(header)); + if ((err != 0)) { + info_scsi_cmd_err(udev, "READ DISC INFORMATION", err); +- info(udev, "no current profile, probing readability of medium\n"); +- return cd_profiles_broken_mmc(udev, fd); ++ info(udev, "no current profile, assuming no media\n"); ++ return -1; + }; + + cd_media = 1; +-- +1.7.2.3 + diff --git a/0107-cdrom_id-Fall-back-to-CDROM_DRIVE_STATUS-if-all-MMC-.patch b/0107-cdrom_id-Fall-back-to-CDROM_DRIVE_STATUS-if-all-MMC-.patch new file mode 100644 index 0000000..a587b51 --- /dev/null +++ b/0107-cdrom_id-Fall-back-to-CDROM_DRIVE_STATUS-if-all-MMC-.patch @@ -0,0 +1,38 @@ +From 678df8a461c7573bf423a39be383bc7b70d943df Mon Sep 17 00:00:00 2001 +From: Martin Pitt +Date: Tue, 5 Oct 2010 14:59:51 +0200 +Subject: [PATCH 7/9] cdrom_id: Fall back to CDROM_DRIVE_STATUS if all MMC commands fail + +Reportedly, some "when I'm grown up I want to be a CD drive" fake USB CD sticks +like the IronKey neither support the SCSI "GET CONFIGURATION" nor the older +(pre-MMC2) "READ DISC INFORMATION" command. In that case, check if +cd_media_compat() detected that there is a disc present, and assume that we +have a CD-ROM medium. +--- + extras/cdrom_id/cdrom_id.c | 10 ++++++++-- + 1 files changed, 8 insertions(+), 2 deletions(-) + +diff --git a/extras/cdrom_id/cdrom_id.c b/extras/cdrom_id/cdrom_id.c +index 0153af6..e7a3e40 100644 +--- a/extras/cdrom_id/cdrom_id.c ++++ b/extras/cdrom_id/cdrom_id.c +@@ -364,8 +364,14 @@ static int cd_profiles_old_mmc(struct udev *udev, int fd) + err = scsi_cmd_run(udev, &sc, fd, header, sizeof(header)); + if ((err != 0)) { + info_scsi_cmd_err(udev, "READ DISC INFORMATION", err); +- info(udev, "no current profile, assuming no media\n"); +- return -1; ++ if (cd_media == 1) { ++ info(udev, "no current profile, but disc is present; assuming CD-ROM\n"); ++ cd_media_cd_rom = 1; ++ return 0; ++ } else { ++ info(udev, "no current profile, assuming no media\n"); ++ return -1; ++ } + }; + + cd_media = 1; +-- +1.7.2.3 + diff --git a/0108-cdrom_id-Don-t-read-beyond-last-track-in-TOC.patch b/0108-cdrom_id-Don-t-read-beyond-last-track-in-TOC.patch new file mode 100644 index 0000000..b7a2443 --- /dev/null +++ b/0108-cdrom_id-Don-t-read-beyond-last-track-in-TOC.patch @@ -0,0 +1,56 @@ +From 1ebd2a5620c93ef4698485d392c19ded675412d2 Mon Sep 17 00:00:00 2001 +From: Martin Pitt +Date: Tue, 5 Oct 2010 17:56:19 +0200 +Subject: [PATCH 8/9] cdrom_id: Don't read beyond "last track" in TOC + +Read the first and last track from the TOC header, and do not go beyond that +stated number of tracks when reading the TOC. Otherwise we interpret random +data which leads to bogus tracks. (Reported on an IronKey, which reported 1 +data track, and 4 audio tracks which weren't actually present.) +--- + extras/cdrom_id/cdrom_id.c | 11 ++++++++--- + 1 files changed, 8 insertions(+), 3 deletions(-) + +diff --git a/extras/cdrom_id/cdrom_id.c b/extras/cdrom_id/cdrom_id.c +index e7a3e40..1b43fe4 100644 +--- a/extras/cdrom_id/cdrom_id.c ++++ b/extras/cdrom_id/cdrom_id.c +@@ -712,7 +712,7 @@ static int cd_media_toc(struct udev *udev, int fd) + struct scsi_cmd sc; + unsigned char header[12]; + unsigned char toc[2048]; +- unsigned int len, i; ++ unsigned int len, i, num_tracks; + unsigned char *p; + int err; + +@@ -728,11 +728,13 @@ static int cd_media_toc(struct udev *udev, int fd) + } + + len = (header[0] << 8 | header[1]) + 2; +- info(udev, "READ TOC: len: %d\n", len); ++ info(udev, "READ TOC: len: %d, start track: %d, end track: %d\n", len, header[2], header[3]); + if (len > sizeof(toc)) + return -1; + if (len < 2) + return -1; ++ /* 2: first track, 3: last track */ ++ num_tracks = header[3] - header[2] + 1; + + /* empty media has no tracks */ + if (len < 8) +@@ -750,7 +752,10 @@ static int cd_media_toc(struct udev *udev, int fd) + return -1; + } + +- for (p = toc+4, i = 4; i < len-8; i += 8, p += 8) { ++ /* Take care to not iterate beyond the last valid track as specified in ++ * the TOC, but also avoid going beyond the TOC length, just in case ++ * the last track number is invalidly large */ ++ for (p = toc+4, i = 4; i < len-8 && num_tracks > 0; i += 8, p += 8, --num_tracks) { + unsigned int block; + unsigned int is_data_track; + +-- +1.7.2.3 + diff --git a/0109-cdrom_id-request-the-drive-profile-features-with-a-d.patch b/0109-cdrom_id-request-the-drive-profile-features-with-a-d.patch new file mode 100644 index 0000000..65da170 --- /dev/null +++ b/0109-cdrom_id-request-the-drive-profile-features-with-a-d.patch @@ -0,0 +1,124 @@ +From d7cd2b16110c806128747ee245aaa883dd52039d Mon Sep 17 00:00:00 2001 +From: Harald Hoyer +Date: Thu, 7 Oct 2010 17:02:21 +0200 +Subject: [PATCH 9/9] cdrom_id: request the drive profile features with a dynamic length + +Some drives don't like huge feature buffers, so we query twice. First +run for the current profile and to get the length. +Second time we query the whole profile feature set. +--- + extras/cdrom_id/cdrom_id.c | 81 ++++++++++++++++++++++++++++--------------- + 1 files changed, 53 insertions(+), 28 deletions(-) + +diff --git a/extras/cdrom_id/cdrom_id.c b/extras/cdrom_id/cdrom_id.c +index 1b43fe4..ec001cd 100644 +--- a/extras/cdrom_id/cdrom_id.c ++++ b/extras/cdrom_id/cdrom_id.c +@@ -398,12 +398,12 @@ static int cd_profiles(struct udev *udev, int fd) + unsigned int i; + int err; + ++ /* First query the current profile */ + scsi_cmd_init(udev, &sc, features, sizeof(features)); + scsi_cmd_set(udev, &sc, 0, 0x46); +- scsi_cmd_set(udev, &sc, 7, (sizeof(features) >> 8) & 0xff); +- scsi_cmd_set(udev, &sc, 8, sizeof(features) & 0xff); ++ scsi_cmd_set(udev, &sc, 8, 8); + scsi_cmd_set(udev, &sc, 9, 0); +- err = scsi_cmd_run(udev, &sc, fd, features, sizeof(features)); ++ err = scsi_cmd_run(udev, &sc, fd, features, 8); + if ((err != 0)) { + info_scsi_cmd_err(udev, "GET CONFIGURATION", err); + /* handle pre-MMC2 drives which do not support GET CONFIGURATION */ +@@ -415,31 +415,6 @@ static int cd_profiles(struct udev *udev, int fd) + return -1; + } + +- len = features[0] << 24 | features[1] << 16 | features[2] << 8 | features[3]; +- info(udev, "GET CONFIGURATION: size of features buffer 0x%04x\n", len); +- +- if (len > sizeof(features)) { +- info(udev, "can not get features in a single query, truncating\n"); +- len = sizeof(features); +- } +- +- /* device features */ +- for (i = 8; i+4 < len; i += (4 + features[i+3])) { +- unsigned int feature; +- +- feature = features[i] << 8 | features[i+1]; +- +- switch (feature) { +- case 0x00: +- info(udev, "GET CONFIGURATION: feature 'profiles', with %i entries\n", features[i+3] / 4); +- feature_profiles(udev, &features[i]+4, features[i+3]); +- break; +- default: +- info(udev, "GET CONFIGURATION: feature 0x%04x , with 0x%02x bytes\n", feature, features[i+3]); +- break; +- } +- } +- + cur_profile = features[6] << 8 | features[7]; + if (cur_profile > 0) { + info(udev, "current profile 0x%02x\n", cur_profile); +@@ -553,6 +528,56 @@ static int cd_profiles(struct udev *udev, int fd) + 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); ++ ++ if (len > sizeof(features)) { ++ info(udev, "can not get features in a single query, truncating\n"); ++ len = sizeof(features); ++ } else if (len <= 8) { ++ len = sizeof(features); ++ } ++ ++ /* Now get the full feature buffer */ ++ scsi_cmd_init(udev, &sc, features, len); ++ scsi_cmd_set(udev, &sc, 0, 0x46); ++ scsi_cmd_set(udev, &sc, 7, ( len >> 8 ) & 0xff); ++ scsi_cmd_set(udev, &sc, 8, len & 0xff); ++ scsi_cmd_set(udev, &sc, 9, 0); ++ err = scsi_cmd_run(udev, &sc, fd, features, len); ++ if ((err != 0)) { ++ info_scsi_cmd_err(udev, "GET CONFIGURATION", err); ++ return -1; ++ } ++ ++ /* parse the length once more, in case the drive decided to have other features suddenly :) */ ++ len = features[0] << 24 | features[1] << 16 | features[2] << 8 | features[3]; ++ info(udev, "GET CONFIGURATION: size of features buffer 0x%04x\n", len); ++ ++ if (len > sizeof(features)) { ++ info(udev, "can not get features in a single query, truncating\n"); ++ len = sizeof(features); ++ } ++ ++ /* device features */ ++ for (i = 8; i+4 < len; i += (4 + features[i+3])) { ++ unsigned int feature; ++ ++ feature = features[i] << 8 | features[i+1]; ++ ++ switch (feature) { ++ case 0x00: ++ info(udev, "GET CONFIGURATION: feature 'profiles', with %i entries\n", features[i+3] / 4); ++ feature_profiles(udev, &features[i]+4, features[i+3]); ++ break; ++ default: ++ info(udev, "GET CONFIGURATION: feature 0x%04x , with 0x%02x bytes\n", feature, features[i+3]); ++ break; ++ } ++ } ++ + return 0; + } + +-- +1.7.2.3 + diff --git a/Makefile.git b/Makefile.git index ea5486a..d14c2d2 100644 --- a/Makefile.git +++ b/Makefile.git @@ -1,6 +1,6 @@ Patch: - @for i in 00*.patch; do n=$$[$$(echo $$i|cut -f 1 -d '-'|sed -e 's#^0*##')]; echo "Patch$$n: $$i";done + @for i in 0*.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 + @for i in 0*.patch; do n=$$[$$(echo $$i|cut -f 1 -d '-'|sed -e 's#^0*##')]; echo "%patch$$n -p1 -b .git$$n";done diff --git a/udev.spec b/udev.spec index ade4df7..f51e786 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} @@ -17,9 +17,7 @@ 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 @@ -35,12 +33,17 @@ 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 - -Patch100: udev-161-cdrom-fallback.patch +Patch101: 0101-cdrom_id-Add-media-status-debugging.patch +Patch102: 0102-cdrom_id-Drop-MEDIA_SESSION_NEXT-for-DVD-RW-RO.patch +Patch103: 0103-cdrom_id-Fix-DVD-RW-media-detection.patch +Patch104: 0104-cdrom_id-Fix-DVD-blank-detection-for-sloppy-firmware.patch +Patch105: 0105-cdrom_id-Try-reading-the-medium-if-all-MMC-commands-.patch +Patch106: 0106-Revert-cdrom_id-Try-reading-the-medium-if-all-MMC-co.patch +Patch107: 0107-cdrom_id-Fall-back-to-CDROM_DRIVE_STATUS-if-all-MMC-.patch +Patch108: 0108-cdrom_id-Don-t-read-beyond-last-track-in-TOC.patch +Patch109: 0109-cdrom_id-request-the-drive-profile-features-with-a-d.patch ExclusiveOS: Linux URL: http://www.kernel.org/pub/linux/utils/kernel/hotplug/udev.html @@ -138,9 +141,8 @@ 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 @@ -156,12 +158,17 @@ 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 - -%patch100 -p1 +%patch101 -p1 -b .git101 +%patch102 -p1 -b .git102 +%patch103 -p1 -b .git103 +%patch104 -p1 -b .git104 +%patch105 -p1 -b .git105 +%patch106 -p1 -b .git106 +%patch107 -p1 -b .git107 +%patch108 -p1 -b .git108 +%patch109 -p1 -b .git109 %build libtoolize -f -c @@ -398,7 +405,11 @@ rm -rf $RPM_BUILD_ROOT %attr(0644,root,root) %{_libdir}/pkgconfig/gudev-1.0* %changelog -* Tue Oct 05 2010 Harald Hoyer 161-2 +* Thu Oct 07 2010 Harald Hoyer 161-4 +- more cdrom_id patches +Resolves: rhbz#637495 + +* Tue Oct 05 2010 Harald Hoyer 161-3 - add cdrom_id patch for pre-MMC2 drives, which do not report profiles Resolves: rhbz#637495 From b50bf3157e0e5c436ee47f1ee8854291e6c2e2b2 Mon Sep 17 00:00:00 2001 From: Harald Hoyer Date: Fri, 12 Nov 2010 15:27:34 +0100 Subject: [PATCH 07/12] - enlarged the import buffer to fix the ressize bugs Resolves: rhbz#652318 --- udev-ressize.patch | 24 ++++++++++++++++++++++++ udev.spec | 10 +++++++++- 2 files changed, 33 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 f51e786..e889c70 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: 4%{?dist} +Release: 5%{?dist} License: GPLv2+ Group: System Environment/Base Provides: udev-persistent = %{version}-%{release} @@ -45,6 +45,8 @@ Patch107: 0107-cdrom_id-Fall-back-to-CDROM_DRIVE_STATUS-if-all-MMC-.patch Patch108: 0108-cdrom_id-Don-t-read-beyond-last-track-in-TOC.patch Patch109: 0109-cdrom_id-request-the-drive-profile-features-with-a-d.patch +Patch1000: 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) @@ -170,6 +172,8 @@ glib-based applications using libudev functionality. %patch108 -p1 -b .git108 %patch109 -p1 -b .git109 +%patch1000 -p1 -b .ressize + %build libtoolize -f -c %configure --with-selinux --prefix=%{_prefix} --exec-prefix="" \ @@ -405,6 +409,10 @@ rm -rf $RPM_BUILD_ROOT %attr(0644,root,root) %{_libdir}/pkgconfig/gudev-1.0* %changelog +* Fri Nov 12 2010 Harald Hoyer 161-5 +- enlarged the import buffer to fix the ressize bugs +Resolves: rhbz#652318 + * Thu Oct 07 2010 Harald Hoyer 161-4 - more cdrom_id patches Resolves: rhbz#637495 From 635a57578d56ed5c20229c0f20d51644a38f3285 Mon Sep 17 00:00:00 2001 From: Harald Hoyer Date: Fri, 12 Nov 2010 15:48:26 +0100 Subject: [PATCH 08/12] - 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 e889c70..b83b368 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: 5%{?dist} +Release: 6%{?dist} License: GPLv2+ Group: System Environment/Base Provides: udev-persistent = %{version}-%{release} @@ -46,6 +46,7 @@ Patch108: 0108-cdrom_id-Don-t-read-beyond-last-track-in-TOC.patch Patch109: 0109-cdrom_id-request-the-drive-profile-features-with-a-d.patch Patch1000: udev-ressize.patch +Patch1001: udev-pda-acl.patch ExclusiveOS: Linux URL: http://www.kernel.org/pub/linux/utils/kernel/hotplug/udev.html @@ -173,6 +174,7 @@ glib-based applications using libudev functionality. %patch109 -p1 -b .git109 %patch1000 -p1 -b .ressize +%patch1001 -p1 -b .pda %build libtoolize -f -c @@ -409,6 +411,10 @@ rm -rf $RPM_BUILD_ROOT %attr(0644,root,root) %{_libdir}/pkgconfig/gudev-1.0* %changelog +* Fri Nov 12 2010 Harald Hoyer 161-6 +- add ACLs for PDA devices +Resolves: rhbz#642435 + * Fri Nov 12 2010 Harald Hoyer 161-5 - enlarged the import buffer to fix the ressize bugs Resolves: rhbz#652318 From fbdc9f8abf81b19299d8ff44b9c8f61069669c94 Mon Sep 17 00:00:00 2001 From: Harald Hoyer Date: Fri, 19 Nov 2010 09:11:48 +0100 Subject: [PATCH 09/12] - fix /dev/systty Resolves: rhbz#654935 --- start_udev | 1 + udev.spec | 10 +++++++++- 2 files changed, 10 insertions(+), 1 deletion(-) diff --git a/start_udev b/start_udev index 49fc286..3596b4c 100755 --- a/start_udev +++ b/start_udev @@ -55,6 +55,7 @@ if ! [ -x /sbin/hotplug ]; then echo -e '\000\000\000\000' > /proc/sys/kernel/hotplug fi fi +[ -c /dev/systty ] && ln -fs tty0 /dev/systty /sbin/udevd -d diff --git a/udev.spec b/udev.spec index b83b368..e7003a0 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: 6%{?dist} +Release: 7%{?dist} License: GPLv2+ Group: System Environment/Base Provides: udev-persistent = %{version}-%{release} @@ -272,6 +272,10 @@ if test -f /proc/1/exe -a -d /proc/1/root; then fi exit 0 +%triggerpostun -- udev < 161-7 +[ -c /dev/systty ] && ln -fs tty0 /dev/systty +: + %post # start daemon if we are not in a chroot if test -f /proc/1/exe -a -d /proc/1/root; then @@ -411,6 +415,10 @@ rm -rf $RPM_BUILD_ROOT %attr(0644,root,root) %{_libdir}/pkgconfig/gudev-1.0* %changelog +* Thu Nov 18 2010 Harald Hoyer 161-7 +- fix /dev/systty +Resolves: rhbz#654935 + * Fri Nov 12 2010 Harald Hoyer 161-6 - add ACLs for PDA devices Resolves: rhbz#642435 From 6fb95235620db80ffc4e260ccc67604a320d69e5 Mon Sep 17 00:00:00 2001 From: Bastien Nocera Date: Thu, 25 Nov 2010 16:05:55 +0000 Subject: [PATCH 10/12] - 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 e7003a0..636448c 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: 7%{?dist} +Release: 8%{?dist} License: GPLv2+ Group: System Environment/Base Provides: udev-persistent = %{version}-%{release} @@ -44,6 +44,8 @@ Patch106: 0106-Revert-cdrom_id-Try-reading-the-medium-if-all-MMC-co.patch Patch107: 0107-cdrom_id-Fall-back-to-CDROM_DRIVE_STATUS-if-all-MMC-.patch Patch108: 0108-cdrom_id-Don-t-read-beyond-last-track-in-TOC.patch Patch109: 0109-cdrom_id-request-the-drive-profile-features-with-a-d.patch +Patch110: 0001-keymap-Add-force-release-for-HP-touchpad-off.patch +Patch111: 0001-extras-keymap-Make-touchpad-buttons-consistent.patch Patch1000: udev-ressize.patch Patch1001: udev-pda-acl.patch @@ -172,6 +174,8 @@ glib-based applications using libudev functionality. %patch107 -p1 -b .git107 %patch108 -p1 -b .git108 %patch109 -p1 -b .git109 +%patch110 -p1 -b .git110 +%patch111 -p1 -b .git111 %patch1000 -p1 -b .ressize %patch1001 -p1 -b .pda @@ -415,6 +419,9 @@ rm -rf $RPM_BUILD_ROOT %attr(0644,root,root) %{_libdir}/pkgconfig/gudev-1.0* %changelog +* Thu Nov 25 2010 Bastien Nocera 161-8 +- Add patches to fix touchpad toggle key handling + * Thu Nov 18 2010 Harald Hoyer 161-7 - fix /dev/systty Resolves: rhbz#654935 From fb822cc7916c54ead8be05c260564d05582f443e Mon Sep 17 00:00:00 2001 From: Harald Hoyer Date: Wed, 23 Mar 2011 13:42:47 +0100 Subject: [PATCH 11/12] - add ACLs for harmony remote controls Resolves: rhbz#559412 - fixed CDROM profile handling --- ...9245f2d2fd03c2586a7f1140300b073a4abe.patch | 25 ++ ...6a377285d5943563cfa397e8b350e43878ec.patch | 345 ++++++++++++++++++ udev.spec | 13 +- 3 files changed, 381 insertions(+), 2 deletions(-) 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 636448c..3ad3b72 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: 8%{?dist} +Release: 9%{?dist} License: GPLv2+ Group: System Environment/Base Provides: udev-persistent = %{version}-%{release} @@ -50,6 +50,9 @@ Patch111: 0001-extras-keymap-Make-touchpad-buttons-consistent.patch Patch1000: udev-ressize.patch Patch1001: udev-pda-acl.patch +Patch1002: udev-5e199245f2d2fd03c2586a7f1140300b073a4abe.patch +Patch1003: udev-98ab6a377285d5943563cfa397e8b350e43878ec.patch + ExclusiveOS: Linux URL: http://www.kernel.org/pub/linux/utils/kernel/hotplug/udev.html BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n) @@ -146,7 +149,6 @@ glib-based applications using libudev functionality. %prep %setup -q - %patch2 -p1 -b .git2 %patch4 -p1 -b .git4 %patch5 -p1 -b .git5 @@ -179,6 +181,8 @@ glib-based applications using libudev functionality. %patch1000 -p1 -b .ressize %patch1001 -p1 -b .pda +%patch1002 -p1 +%patch1003 -p1 %build libtoolize -f -c @@ -419,6 +423,11 @@ rm -rf $RPM_BUILD_ROOT %attr(0644,root,root) %{_libdir}/pkgconfig/gudev-1.0* %changelog +* Wed Mar 23 2011 Harald Hoyer 161-9 +- add ACLs for harmony remote controls +Resolves: rhbz#559412 +- fixed CDROM profile handling + * Thu Nov 25 2010 Bastien Nocera 161-8 - Add patches to fix touchpad toggle key handling From ec910abb26fb7cf77518cbb6d0731086d6806047 Mon Sep 17 00:00:00 2001 From: Daniel Drake Date: Mon, 29 Aug 2011 09:10:39 +0100 Subject: [PATCH 12/12] Update OLPC XO keymap and fix compile with new headers --- udev-olpc-keymap-update.patch | 65 +++++++++++++++++++++++++++++++++++ udev-v4l-compile-fix.patch | 45 ++++++++++++++++++++++++ udev-v4l-compile-fix2.patch | 24 +++++++++++++ udev.spec | 13 ++++++- 4 files changed, 146 insertions(+), 1 deletion(-) create mode 100644 udev-olpc-keymap-update.patch create mode 100644 udev-v4l-compile-fix.patch create mode 100644 udev-v4l-compile-fix2.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-v4l-compile-fix.patch b/udev-v4l-compile-fix.patch new file mode 100644 index 0000000..17b9876 --- /dev/null +++ b/udev-v4l-compile-fix.patch @@ -0,0 +1,45 @@ +From 4ace8a43ac2cbbd4d6f5c29fc461c3caa8f8545b Mon Sep 17 00:00:00 2001 +From: Kay Sievers +Date: Tue, 15 Feb 2011 17:24:32 +0100 +Subject: [PATCH] v4l_id: kill the v4l1 ioctl + +Recent kernels do not have v4l1 anymore. +--- + extras/v4l_id/v4l_id.c | 14 -------------- + 1 files changed, 0 insertions(+), 14 deletions(-) + +diff --git a/extras/v4l_id/v4l_id.c b/extras/v4l_id/v4l_id.c +index d530a6d..f3fc648 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[]) +@@ -82,19 +81,6 @@ 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); +-- +1.7.4.4 + diff --git a/udev-v4l-compile-fix2.patch b/udev-v4l-compile-fix2.patch new file mode 100644 index 0000000..57769bb --- /dev/null +++ b/udev-v4l-compile-fix2.patch @@ -0,0 +1,24 @@ +From 89284ddac413d376fc3b56f742daaf1b9bc85bba Mon Sep 17 00:00:00 2001 +From: Kay Sievers +Date: Tue, 15 Feb 2011 17:27:29 +0100 +Subject: [PATCH] v4l_id: remove left-over variable + +--- + extras/v4l_id/v4l_id.c | 1 - + 1 files changed, 0 insertions(+), 1 deletions(-) + +diff --git a/extras/v4l_id/v4l_id.c b/extras/v4l_id/v4l_id.c +index f3fc648..21cb328 100644 +--- a/extras/v4l_id/v4l_id.c ++++ b/extras/v4l_id/v4l_id.c +@@ -38,7 +38,6 @@ int main (int argc, char *argv[]) + }; + int fd; + char *device; +- struct video_capability v1cap; + struct v4l2_capability v2cap; + + while (1) { +-- +1.7.4.4 + diff --git a/udev.spec b/udev.spec index 3ad3b72..f239c80 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: 9%{?dist} +Release: 10%{?dist} License: GPLv2+ Group: System Environment/Base Provides: udev-persistent = %{version}-%{release} @@ -53,6 +53,10 @@ Patch1001: udev-pda-acl.patch Patch1002: udev-5e199245f2d2fd03c2586a7f1140300b073a4abe.patch Patch1003: udev-98ab6a377285d5943563cfa397e8b350e43878ec.patch +Patch1004: udev-olpc-keymap-update.patch +Patch1005: udev-v4l-compile-fix.patch +Patch1006: udev-v4l-compile-fix2.patch + ExclusiveOS: Linux URL: http://www.kernel.org/pub/linux/utils/kernel/hotplug/udev.html BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n) @@ -183,6 +187,9 @@ glib-based applications using libudev functionality. %patch1001 -p1 -b .pda %patch1002 -p1 %patch1003 -p1 +%patch1004 -p1 +%patch1005 -p1 +%patch1006 -p1 %build libtoolize -f -c @@ -423,6 +430,10 @@ rm -rf $RPM_BUILD_ROOT %attr(0644,root,root) %{_libdir}/pkgconfig/gudev-1.0* %changelog +* Mon Aug 29 2011 Daniel Drake 161-10 +- Update OLPC XO keymap +- Fix compilation on new linux-headers + * Wed Mar 23 2011 Harald Hoyer 161-9 - add ACLs for harmony remote controls Resolves: rhbz#559412