From 6a1d711f33214af8b4a2c2044ed38a5053a63ff068d8ed8162d70af3ddf7b32a Mon Sep 17 00:00:00 2001 From: Robert Milasan Date: Wed, 13 Feb 2013 12:01:15 +0000 Subject: [PATCH] Accepting request 155319 from home:rmilasan:branches:Base:System - rework patch: 1020-usb_id-some-strange-devices-have-a-very-bogus-or-strage-serial.patch - udev: use unique names for temporary files created in /dev. add: 1022-udev-use-unique-names-for-temporary-files-created-in.patch - cdrom_id: add data track count for bad virtual drive. add: 1023-cdrom_id-add-data-track-count-for-bad-virtual-drive.patch - rework patch: 1020-usb_id-some-strange-devices-have-a-very-bogus-or-strage-serial.patch - udev: use unique names for temporary files created in /dev. add: 1022-udev-use-unique-names-for-temporary-files-created-in.patch - cdrom_id: add data track count for bad virtual drive. add: 1023-cdrom_id-add-data-track-count-for-bad-virtual-drive.patch OBS-URL: https://build.opensuse.org/request/show/155319 OBS-URL: https://build.opensuse.org/package/show/Base:System/systemd?expand=0&rev=344 --- 1018-keymap-add-aditional-support.patch | 2 +- ...s-have-a-very-bogus-or-strage-serial.patch | 27 ++++----- ...names-for-temporary-files-created-in.patch | 57 +++++++++++++++++++ ...ta-track-count-for-bad-virtual-drive.patch | 51 +++++++++++++++++ systemd-mini.changes | 10 ++++ systemd-mini.spec | 6 ++ systemd.changes | 10 ++++ systemd.spec | 6 ++ 8 files changed, 155 insertions(+), 14 deletions(-) create mode 100644 1022-udev-use-unique-names-for-temporary-files-created-in.patch create mode 100644 1023-cdrom_id-add-data-track-count-for-bad-virtual-drive.patch diff --git a/1018-keymap-add-aditional-support.patch b/1018-keymap-add-aditional-support.patch index b9e39f5f..f277245b 100644 --- a/1018-keymap-add-aditional-support.patch +++ b/1018-keymap-add-aditional-support.patch @@ -2,7 +2,7 @@ Index: systemd-195/Makefile.am =================================================================== --- systemd-195.orig/Makefile.am +++ systemd-195/Makefile.am -@@ -2265,6 +2265,8 @@ dist_udevkeymap_DATA = \ +@@ -2246,6 +2246,8 @@ dist_udevkeymap_DATA = \ keymaps/hewlett-packard-presario-2100 \ keymaps/hewlett-packard-tablet \ keymaps/hewlett-packard-tx2 \ diff --git a/1020-usb_id-some-strange-devices-have-a-very-bogus-or-strage-serial.patch b/1020-usb_id-some-strange-devices-have-a-very-bogus-or-strage-serial.patch index 4832bbb5..ad6d27b2 100644 --- a/1020-usb_id-some-strange-devices-have-a-very-bogus-or-strage-serial.patch +++ b/1020-usb_id-some-strange-devices-have-a-very-bogus-or-strage-serial.patch @@ -9,10 +9,10 @@ Subject: [PATCH] usb_id: some strange devices have a very bogus or strange seria src/udev/udev-builtin-usb_id.c | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+) -diff --git a/src/udev/udev-builtin-usb_id.c b/src/udev/udev-builtin-usb_id.c -index 7ce401d..9e407c5 100644 ---- a/src/udev/udev-builtin-usb_id.c -+++ b/src/udev/udev-builtin-usb_id.c +Index: systemd-195/src/udev/udev-builtin-usb_id.c +=================================================================== +--- systemd-195.orig/src/udev/udev-builtin-usb_id.c ++++ systemd-195/src/udev/udev-builtin-usb_id.c @@ -23,6 +23,7 @@ #include #include @@ -25,7 +25,7 @@ index 7ce401d..9e407c5 100644 #include "udev.h" -+static bool validate_string(const char *str) ++static bool valid_string(const char *str) +{ + const char *s; + @@ -48,15 +48,16 @@ index 7ce401d..9e407c5 100644 static void set_usb_iftype(char *to, int if_class_num, size_t len) { const char *type = "generic"; -@@ -431,6 +452,8 @@ fallback: - const char *usb_serial; +@@ -428,10 +449,10 @@ fallback: + } + + if (serial_str[0] == '\0') { +- const char *usb_serial; ++ const char *usb_serial = NULL; usb_serial = udev_device_get_sysattr_value(dev_usb, "serial"); -+ if (!validate_string(usb_serial)) -+ usb_serial = NULL; - if (usb_serial) { +- if (usb_serial) { ++ if (valid_string(usb_serial)) { util_replace_whitespace(usb_serial, serial_str, sizeof(serial_str)-1); util_replace_chars(serial_str, NULL); --- -1.7.10.4 - + } diff --git a/1022-udev-use-unique-names-for-temporary-files-created-in.patch b/1022-udev-use-unique-names-for-temporary-files-created-in.patch new file mode 100644 index 00000000..a3516edb --- /dev/null +++ b/1022-udev-use-unique-names-for-temporary-files-created-in.patch @@ -0,0 +1,57 @@ +Index: systemd-195/src/udev/udev-node.c +=================================================================== +--- systemd-195.orig/src/udev/udev-node.c ++++ systemd-195/src/udev/udev-node.c +@@ -31,15 +31,13 @@ + + #include "udev.h" + +-#define TMP_FILE_EXT ".udev-tmp" +- +-static int node_symlink(struct udev *udev, const char *node, const char *slink) ++static int node_symlink(struct udev_device *dev, const char *node, const char *slink) + { + struct stat stats; + char target[UTIL_PATH_SIZE]; + char *s; + size_t l; +- char slink_tmp[UTIL_PATH_SIZE + sizeof(TMP_FILE_EXT)]; ++ char slink_tmp[UTIL_PATH_SIZE + 32]; + int i = 0; + int tail = 0; + int err = 0; +@@ -101,7 +99,7 @@ static int node_symlink(struct udev *ude + } + + log_debug("atomically replace '%s'\n", slink); +- util_strscpyl(slink_tmp, sizeof(slink_tmp), slink, TMP_FILE_EXT, NULL); ++ util_strscpyl(slink_tmp, sizeof(slink_tmp), slink, ".tmp-", udev_device_get_id_filename(dev), NULL); + unlink(slink_tmp); + do { + err = mkdir_parents_label(slink_tmp, 0755); +@@ -204,7 +202,7 @@ static void link_update(struct udev_devi + util_delete_path(udev, slink); + } else { + log_debug("creating link '%s' to '%s'\n", slink, target); +- node_symlink(udev, target, slink); ++ node_symlink(dev, target, slink); + } + + if (add) { +@@ -304,7 +302,6 @@ out: + + void udev_node_add(struct udev_device *dev, mode_t mode, uid_t uid, gid_t gid) + { +- struct udev *udev = udev_device_get_udev(dev); + char filename[UTIL_PATH_SIZE]; + struct udev_list_entry *list_entry; + +@@ -318,7 +315,7 @@ void udev_node_add(struct udev_device *d + snprintf(filename, sizeof(filename), "/dev/%s/%u:%u", + strcmp(udev_device_get_subsystem(dev), "block") == 0 ? "block" : "char", + major(udev_device_get_devnum(dev)), minor(udev_device_get_devnum(dev))); +- node_symlink(udev, udev_device_get_devnode(dev), filename); ++ node_symlink(dev, udev_device_get_devnode(dev), filename); + + /* create/update symlinks, add symlinks to name index */ + udev_list_entry_foreach(list_entry, udev_device_get_devlinks_list_entry(dev)) diff --git a/1023-cdrom_id-add-data-track-count-for-bad-virtual-drive.patch b/1023-cdrom_id-add-data-track-count-for-bad-virtual-drive.patch new file mode 100644 index 00000000..54036570 --- /dev/null +++ b/1023-cdrom_id-add-data-track-count-for-bad-virtual-drive.patch @@ -0,0 +1,51 @@ +From a0ec302b9309bc56f6bed6162e47ad6c27165747 Mon Sep 17 00:00:00 2001 +From: Harald Hoyer +Date: Tue, 12 Feb 2013 15:19:38 +0100 +Subject: [PATCH] cdrom_id: add data track count for bad virtual drive + implementations +Organization: SUSE Linux + +/# /lib/udev/cdrom_id --debug /dev/sr0 +probing: '/dev/sr0' +INQUIRY: [AMI ][Virtual CDROM ][1.00] +GET CONFIGURATION failed with SK=5h/ASC=20h/ACQ=00h +drive is pre-MMC2 and does not support 46h get configuration command +trying to work around the problem +READ DISC INFORMATION failed with SK=5h/ASC=20h/ACQ=00h +no current profile, but disc is present; assuming CD-ROM +READ TOC: len: 12, start track: 1, end track: 1 +last track 1 starts at block 0 +READ DISC INFORMATION failed with SK=5h/ASC=20h/ACQ=00h +ID_CDROM=1 +ID_CDROM_MEDIA=1 +ID_CDROM_MEDIA_CD=1 + +What is missing here is ID_CDROM_MEDIA_TRACK_COUNT_DATA to trigger +blkid in /lib/udev/rules.d/60-persistent-storage.rules + +KERNEL=="sr*", ENV{DISK_EJECT_REQUEST}!="?*", + ENV{ID_CDROM_MEDIA_TRACK_COUNT_DATA}=="?*", + ENV{ID_CDROM_MEDIA_SESSION_LAST_OFFSET}=="", \ + IMPORT{builtin}="blkid --noraid" + +Signed-off-by: Robert Milasan +--- + src/udev/cdrom_id/cdrom_id.c | 2 ++ + 1 files changed, 2 insertions(+), 0 deletions(-) + +diff --git a/src/udev/cdrom_id/cdrom_id.c b/src/udev/cdrom_id/cdrom_id.c +index 1056536..b659cc3 100644 +--- a/src/udev/cdrom_id/cdrom_id.c ++++ b/src/udev/cdrom_id/cdrom_id.c +@@ -513,6 +513,8 @@ static int cd_profiles_old_mmc(struct udev *udev, int fd) + if (cd_media == 1) { + log_debug("no current profile, but disc is present; assuming CD-ROM\n"); + cd_media_cd_rom = 1; ++ cd_media_track_count = 1; ++ cd_media_track_count_data = 1; + return 0; + } else { + log_debug("no current profile, assuming no media\n"); +-- +1.7.7 + diff --git a/systemd-mini.changes b/systemd-mini.changes index 748aea63..bb106d87 100644 --- a/systemd-mini.changes +++ b/systemd-mini.changes @@ -1,3 +1,13 @@ +------------------------------------------------------------------- +Wed Feb 13 11:34:06 UTC 2013 - rmilasan@suse.com + +- rework patch: + 1020-usb_id-some-strange-devices-have-a-very-bogus-or-strage-serial.patch +- udev: use unique names for temporary files created in /dev. + add: 1022-udev-use-unique-names-for-temporary-files-created-in.patch +- cdrom_id: add data track count for bad virtual drive. + add: 1023-cdrom_id-add-data-track-count-for-bad-virtual-drive.patch + ------------------------------------------------------------------- Tue Feb 12 09:16:23 UTC 2013 - rmilasan@suse.com diff --git a/systemd-mini.spec b/systemd-mini.spec index 701b42db..3370583a 100644 --- a/systemd-mini.spec +++ b/systemd-mini.spec @@ -308,6 +308,10 @@ Patch1019: 1019-udev-Fix-device-matching-in-the-accelerometer.patch Patch1020: 1020-usb_id-some-strange-devices-have-a-very-bogus-or-strage-serial.patch # PATCH-FIX-OPENSUSE 1021-create-default-links-for-primary-cd_dvd-drive.patch Patch1021: 1021-create-default-links-for-primary-cd_dvd-drive.patch +# PATCH-FIX-UPSTREAM 1022-udev-use-unique-names-for-temporary-files-created-in.patch +Patch1022: 1022-udev-use-unique-names-for-temporary-files-created-in.patch +# PATCH-FIX-UPSTREAM 1023-cdrom_id-add-data-track-count-for-bad-virtual-drive.patch +Patch1023: 1023-cdrom_id-add-data-track-count-for-bad-virtual-drive.patch %description Systemd is a system and service manager, compatible with SysV and LSB @@ -489,6 +493,8 @@ cp %{SOURCE7} m4/ %patch1019 -p1 %patch1020 -p1 %patch1021 -p1 +%patch1022 -p1 +%patch1023 -p1 #systemd %patch1 -p1 diff --git a/systemd.changes b/systemd.changes index 748aea63..bb106d87 100644 --- a/systemd.changes +++ b/systemd.changes @@ -1,3 +1,13 @@ +------------------------------------------------------------------- +Wed Feb 13 11:34:06 UTC 2013 - rmilasan@suse.com + +- rework patch: + 1020-usb_id-some-strange-devices-have-a-very-bogus-or-strage-serial.patch +- udev: use unique names for temporary files created in /dev. + add: 1022-udev-use-unique-names-for-temporary-files-created-in.patch +- cdrom_id: add data track count for bad virtual drive. + add: 1023-cdrom_id-add-data-track-count-for-bad-virtual-drive.patch + ------------------------------------------------------------------- Tue Feb 12 09:16:23 UTC 2013 - rmilasan@suse.com diff --git a/systemd.spec b/systemd.spec index 54acc848..34bf7b73 100644 --- a/systemd.spec +++ b/systemd.spec @@ -303,6 +303,10 @@ Patch1019: 1019-udev-Fix-device-matching-in-the-accelerometer.patch Patch1020: 1020-usb_id-some-strange-devices-have-a-very-bogus-or-strage-serial.patch # PATCH-FIX-OPENSUSE 1021-create-default-links-for-primary-cd_dvd-drive.patch Patch1021: 1021-create-default-links-for-primary-cd_dvd-drive.patch +# PATCH-FIX-UPSTREAM 1022-udev-use-unique-names-for-temporary-files-created-in.patch +Patch1022: 1022-udev-use-unique-names-for-temporary-files-created-in.patch +# PATCH-FIX-UPSTREAM 1023-cdrom_id-add-data-track-count-for-bad-virtual-drive.patch +Patch1023: 1023-cdrom_id-add-data-track-count-for-bad-virtual-drive.patch %description Systemd is a system and service manager, compatible with SysV and LSB @@ -484,6 +488,8 @@ cp %{SOURCE7} m4/ %patch1019 -p1 %patch1020 -p1 %patch1021 -p1 +%patch1022 -p1 +%patch1023 -p1 #systemd %patch1 -p1