SHA256
1
0
forked from pool/systemd

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
This commit is contained in:
Robert Milasan 2013-02-13 12:01:15 +00:00 committed by Git OBS Bridge
parent bd48810a23
commit 2f2eb23bbf
8 changed files with 155 additions and 14 deletions

View File

@ -2,7 +2,7 @@ Index: systemd-195/Makefile.am
=================================================================== ===================================================================
--- systemd-195.orig/Makefile.am --- systemd-195.orig/Makefile.am
+++ systemd-195/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-presario-2100 \
keymaps/hewlett-packard-tablet \ keymaps/hewlett-packard-tablet \
keymaps/hewlett-packard-tx2 \ keymaps/hewlett-packard-tx2 \

View File

@ -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 +++++++++++++++++++++++ src/udev/udev-builtin-usb_id.c | 23 +++++++++++++++++++++++
1 file changed, 23 insertions(+) 1 file changed, 23 insertions(+)
diff --git 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
index 7ce401d..9e407c5 100644 ===================================================================
--- a/src/udev/udev-builtin-usb_id.c --- systemd-195.orig/src/udev/udev-builtin-usb_id.c
+++ b/src/udev/udev-builtin-usb_id.c +++ systemd-195/src/udev/udev-builtin-usb_id.c
@@ -23,6 +23,7 @@ @@ -23,6 +23,7 @@
#include <stdio.h> #include <stdio.h>
#include <stdlib.h> #include <stdlib.h>
@ -25,7 +25,7 @@ index 7ce401d..9e407c5 100644
#include "udev.h" #include "udev.h"
+static bool validate_string(const char *str) +static bool valid_string(const char *str)
+{ +{
+ const char *s; + 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) static void set_usb_iftype(char *to, int if_class_num, size_t len)
{ {
const char *type = "generic"; const char *type = "generic";
@@ -431,6 +452,8 @@ fallback: @@ -428,10 +449,10 @@ fallback:
const char *usb_serial; }
if (serial_str[0] == '\0') {
- const char *usb_serial;
+ const char *usb_serial = NULL;
usb_serial = udev_device_get_sysattr_value(dev_usb, "serial"); usb_serial = udev_device_get_sysattr_value(dev_usb, "serial");
+ if (!validate_string(usb_serial)) - if (usb_serial) {
+ usb_serial = NULL; + if (valid_string(usb_serial)) {
if (usb_serial) {
util_replace_whitespace(usb_serial, serial_str, sizeof(serial_str)-1); util_replace_whitespace(usb_serial, serial_str, sizeof(serial_str)-1);
util_replace_chars(serial_str, NULL); util_replace_chars(serial_str, NULL);
-- }
1.7.10.4

View File

@ -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))

View File

@ -0,0 +1,51 @@
From a0ec302b9309bc56f6bed6162e47ad6c27165747 Mon Sep 17 00:00:00 2001
From: Harald Hoyer <harald@redhat.com>
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 <rmilasan@suse.com>
---
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

View File

@ -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 Tue Feb 12 09:16:23 UTC 2013 - rmilasan@suse.com

View File

@ -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 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 # PATCH-FIX-OPENSUSE 1021-create-default-links-for-primary-cd_dvd-drive.patch
Patch1021: 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 %description
Systemd is a system and service manager, compatible with SysV and LSB Systemd is a system and service manager, compatible with SysV and LSB
@ -489,6 +493,8 @@ cp %{SOURCE7} m4/
%patch1019 -p1 %patch1019 -p1
%patch1020 -p1 %patch1020 -p1
%patch1021 -p1 %patch1021 -p1
%patch1022 -p1
%patch1023 -p1
#systemd #systemd
%patch1 -p1 %patch1 -p1

View File

@ -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 Tue Feb 12 09:16:23 UTC 2013 - rmilasan@suse.com

View File

@ -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 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 # PATCH-FIX-OPENSUSE 1021-create-default-links-for-primary-cd_dvd-drive.patch
Patch1021: 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 %description
Systemd is a system and service manager, compatible with SysV and LSB Systemd is a system and service manager, compatible with SysV and LSB
@ -484,6 +488,8 @@ cp %{SOURCE7} m4/
%patch1019 -p1 %patch1019 -p1
%patch1020 -p1 %patch1020 -p1
%patch1021 -p1 %patch1021 -p1
%patch1022 -p1
%patch1023 -p1
#systemd #systemd
%patch1 -p1 %patch1 -p1