Hello community, here is the log from the commit of package udev checked in at Fri May 25 00:44:17 CEST 2007. -------- --- udev/udev.changes 2007-05-10 12:52:42.000000000 +0200 +++ /mounts/work_src_done/STABLE/udev/udev.changes 2007-05-24 16:16:51.339076000 +0200 @@ -1,0 +2,5 @@ +Thu May 24 18:06:14 CEST 2007 - hare@suse.de + +- Add support for cciss devices. + +------------------------------------------------------------------- New: ---- udev-cciss-support ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Other differences: ------------------ ++++++ udev.spec ++++++ --- /var/tmp/diff_new_pack.vD1335/_old 2007-05-25 00:43:58.000000000 +0200 +++ /var/tmp/diff_new_pack.vD1335/_new 2007-05-25 00:43:58.000000000 +0200 @@ -13,7 +13,7 @@ Name: udev URL: ftp://ftp.kernel.org/pub/linux/utils/kernel/hotplug/ Version: 111 -Release: 1 +Release: 5 License: GNU General Public License (GPL) Group: System/Kernel Summary: A Rule-Based Device Node and Kernel Event Manager @@ -32,6 +32,7 @@ Source70: show_event_log Source71: README.debug #Patch0: udev-git.patch +Patch1: udev-cciss-support %description udev's main task is to create and remove device nodes in /dev when a @@ -81,6 +82,7 @@ %prep %setup #%patch0 -p1 +%patch1 -p1 %build make V=1 libdir=/%{_lib} usrlibdir=%{_libdir} OPTFLAGS="${RPM_OPT_FLAGS}" EXTRAS=%{extras} all @@ -145,6 +147,12 @@ fi fi +%post -n libvolume_id +/sbin/ldconfig + +%postun -n libvolume_id +/sbin/ldconfig + %clean rm -rf $RPM_BUILD_ROOT @@ -240,6 +248,8 @@ /%{_lib}/libvolume_id.so.* %changelog +* Thu May 24 2007 - hare@suse.de +- Add support for cciss devices. * Thu May 10 2007 - kay.sievers@suse.de - new upstream release 111 use fgets() to read /proc/stat, should fix errors on very big boxes ++++++ show_event_log ++++++ --- udev/show_event_log 2006-02-12 12:22:13.000000000 +0100 +++ /mounts/work_src_done/STABLE/udev/show_event_log 2007-05-24 16:20:27.668613000 +0200 @@ -1,4 +1,4 @@ -#! /bin/bash +#!/bin/bash # # extract udev log messages from a syslog file # show_event_log <first> [<last> [<list of event types>] ] ++++++ udev-cciss-support ++++++ diff --git a/etc/udev/rules.d/60-persistent-storage.rules b/etc/udev/rules.d/60-persistent-storage.rules index 04c7e77..429b09c 100644 --- a/etc/udev/rules.d/60-persistent-storage.rules +++ b/etc/udev/rules.d/60-persistent-storage.rules @@ -39,6 +39,10 @@ KERNEL=="sd*[!0-9]|sr*|st*", ENV{ID_SERI KERNEL=="sd*[!0-9]|sr*", ENV{ID_SERIAL}=="?*", SYMLINK+="disk/by-id/$env{ID_BUS}-$env{ID_SERIAL}" KERNEL=="sd*[0-9]", ENV{ID_SERIAL}=="?*", SYMLINK+="disk/by-id/$env{ID_BUS}-$env{ID_SERIAL}-part%n" +KERNEL=="cciss?c[0-9]d[0-9]", ENV{ID_SERIAL}=="", IMPORT{program}="scsi_id -g -x -s %p -d $tempnode" +KERNEL=="cciss?c[0-9]d[0-9]", ENV{ID_SERIAL}=="?*", SYMLINK+="$env{ID_TYPE}/by-id/$env{ID_BUS}-$env{ID_SERIAL}" +KERNEL=="cciss*p[0-9]", ENV{ID_SERIAL}=="?*", SYMLINK+="$env{ID_TYPE}/by-id/$env{ID_BUS}-$env{ID_SERIAL}-part%n" + # libata compat (links like hd*) KERNEL=="sd*[!0-9]|sr*", ENV{ID_VENDOR}=="ATA", PROGRAM="ata_id $tempnode", ENV{ID_ATA_COMPAT}="$result" KERNEL=="sd*[!0-9]|sr*", ENV{ID_ATA_COMPAT}=="?*", SYMLINK+="disk/by-id/ata-$env{ID_ATA_COMPAT}" @@ -48,10 +52,14 @@ KERNEL=="mmcblk[0-9]", ATTR{name}=="?*", KERNEL=="mmcblk[0-9]p[0-9]", ATTR{name}=="?*", ATTR{serial}=="?*", ENV{ID_NAME}="$attr{name}", ENV{ID_SERIAL}="$attr{serial}", SYMLINK+="disk/by-id/mmc-$env{ID_NAME}_$env{ID_SERIAL}-part%n" # by-path (shortest physical path) +KERNEL=="cciss?c[0-9]d[0-9]", IMPORT{program}="path_id %p", SYMLINK+="$env{ID_TYPE}/by-path/$env{ID_PATH}" +KERNEL=="cciss*p[0-9]", ENV{ID_PATH}=="?*", SYMLINK+="$env{ID_TYPE}/by-path/$env{ID_PATH}-part%n" +KERNEL=="cciss*", GOTO="persistent_path_end" KERNEL=="*[!0-9]|sr*", IMPORT{program}="path_id %p", SYMLINK+="disk/by-path/$env{ID_PATH}" KERNEL=="st*", IMPORT{program}="path_id %p", SYMLINK+="tape/by-path/$env{ID_PATH}" KERNEL=="sr*|st*", GOTO="persistent_storage_end" KERNEL=="*[0-9]", ENV{ID_PATH}=="?*", SYMLINK+="disk/by-path/$env{ID_PATH}-part%n" +LABEL="persistent_path_end" # by-label/by-uuid (filesystem properties) KERNEL=="*[!0-9]", ATTR{removable}=="1", GOTO="persistent_storage_end" diff --git a/extras/path_id/path_id b/extras/path_id/path_id index a7d650b..ee26dc1 100644 --- a/extras/path_id/path_id +++ b/extras/path_id/path_id @@ -74,6 +74,17 @@ handle_pci () { DEV=${PWD} pci_id=${DEV##*/} host_dev_path=$DEV + + # cciss devices don't have a separate sysfs node + for blk_link in block*; do + if [ -L "$blk_link" ]; then + case "$blk_link" in + *cciss*) + d=cciss-${blk_link#*cciss\!} + ;; + esac + fi + done while [ ! -z "$host_dev_path" ] ; do case "$host_dev_path" in */pci[0-9]*) diff --git a/extras/scsi_id/scsi_id.c b/extras/scsi_id/scsi_id.c index c00145f..da169b5 100644 --- a/extras/scsi_id/scsi_id.c +++ b/extras/scsi_id/scsi_id.c @@ -578,6 +578,23 @@ static int per_dev_options(struct sysfs_ return retval; } +static int set_dev_values(struct sysfs_device *dev_scsi, const char *path) +{ + int retval; + char vendor[8], model[16], type[4], rev[4]; + + retval = scsi_std_inquiry(dev_scsi, path, vendor, model, rev, type); + if (retval) + return retval; + + set_str(vendor_str, vendor, 8); + set_str(model_str, model, 16); + set_type(type_str, type, sizeof(type_str) - 1); + set_str(revision_str, rev, sizeof(revision_str) -1); + + return 0; +} + /* * format_serial: replace to whitespaces by underscores for calling * programs that use the serial for device naming (multipath, Suse @@ -620,6 +637,7 @@ static int scsi_id(const char *devpath, int page_code; char serial[MAX_SERIAL_LEN]; char serial_short[MAX_SERIAL_LEN]; + char bus_str[8]; dbg("devpath %s\n", devpath); @@ -637,8 +655,14 @@ static int scsi_id(const char *devpath, /* get scsi parent device */ dev_scsi = sysfs_device_get_parent_with_subsystem(dev, "scsi"); if (dev_scsi == NULL) { - err("unable to access parent device of '%s'", devpath); - return 1; + if (strncmp(dev->kernel,"cciss",5)) { + err("unable to access parent device of '%s'", devpath); + return 1; + } else { + strcpy(bus_str,"cciss"); + dev_scsi = dev; + page_code = PAGE_83; + } } /* mknod a temp dev to communicate with the device */ @@ -647,10 +671,15 @@ static int scsi_id(const char *devpath, return 1; } - /* get per device (vendor + model) options from the config file */ - retval = per_dev_options(dev_scsi, &good_dev, &page_code); - dbg("per dev options: good %d; page code 0x%x", good_dev, page_code); - + if (dev_scsi != dev) { + /* get per device (vendor + model) options from the config file */ + retval = per_dev_options(dev_scsi, &good_dev, &page_code); + dbg("per dev options: good %d; page code 0x%x", good_dev, page_code); + strcpy(bus_str,"scsi"); + } else { + retval = set_dev_values(dev_scsi, maj_min_dev); + good_dev = retval?0:1; + } if (!good_dev) { retval = 1; } else if (scsi_get_serial(dev_scsi, maj_min_dev, page_code, @@ -671,7 +700,7 @@ static int scsi_id(const char *devpath, set_str(serial_str, serial_short, sizeof(serial_str)); printf("ID_SERIAL_SHORT=%s\n", serial_str); printf("ID_TYPE=%s\n", type_str); - printf("ID_BUS=scsi\n"); + printf("ID_BUS=%s\n", bus_str); } else { if (reformat_serial) format_serial(serial); diff --git a/extras/scsi_id/scsi_id.h b/extras/scsi_id/scsi_id.h index d7f675f..0e2b297 100644 --- a/extras/scsi_id/scsi_id.h +++ b/extras/scsi_id/scsi_id.h @@ -30,6 +30,8 @@ */ #define MAX_BUFFER_LEN 256 +extern int scsi_std_inquiry(struct sysfs_device *dev_scsi, const char *devname, + char *vendor, char *model, char *rev, char *type); extern int scsi_get_serial (struct sysfs_device *dev_scsi, const char *devname, int page_code, char *serial, char *serial_short, int len); diff --git a/extras/scsi_id/scsi_serial.c b/extras/scsi_id/scsi_serial.c index e1726bb..c84f41e 100644 --- a/extras/scsi_id/scsi_serial.c +++ b/extras/scsi_id/scsi_serial.c @@ -736,6 +736,37 @@ static int do_scsi_page80_inquiry(struct return 0; } +int scsi_std_inquiry(struct sysfs_device *dev_scsi, const char *devname, + char *vendor, char *model, char *rev, char *type) +{ + int retval; + int fd; + unsigned char buf[SCSI_INQ_BUFF_LEN]; + + dbg("opening %s\n", devname); + fd = open(devname, O_RDONLY | O_NONBLOCK); + if (fd < 0) { + info("%s: cannot open %s: %s", + dev_scsi->kernel, devname, strerror(errno)); + return 1; + } + + memset(buf, 0, SCSI_INQ_BUFF_LEN); + retval = scsi_inquiry(dev_scsi, fd, 0, 0, buf, SCSI_INQ_BUFF_LEN); + if (retval < 0) + return retval; + + memcpy(vendor, buf + 8, 8); + memcpy(model, buf + 16, 16); + memcpy(rev, buf + 32, 4); + sprintf(type,"%x", buf[0] & 0x1f); + + if (close(fd) < 0) + info("%s: close failed: %s", dev_scsi->kernel, strerror(errno)); + + return 0; +} + int scsi_get_serial (struct sysfs_device *dev_scsi, const char *devname, int page_code, char *serial, char *serial_short, int len) { ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Remember to have fun... --------------------------------------------------------------------- To unsubscribe, e-mail: opensuse-commit+unsubscribe@opensuse.org For additional commands, e-mail: opensuse-commit+help@opensuse.org
participants (1)
-
root@Hilbert.suse.de