summaryrefslogtreecommitdiff
path: root/extras/scsi_id
AgeCommit message (Collapse)Author
2010-06-25switch a few left-over from GPLv2 to GPLv2 or laterKay Sievers
2010-06-21remove a few comments in file headersKay Sievers
2010-04-07scsi_id: add rand() in retry loopKay Sievers
2009-12-04Export ID_WWN_VENDOR_EXTENSION and ID_WWN_WITH_EXTENSIONDavid Zeuthen
Some SCSI devices use the same WWN and have a WWN extension that we need to take into account when creating the /dev/disk/by-id/wwn symlinks. Thus, introduce ID_WWN_WITH_EXTENSION. This property will contain either the WWN (if no extension is present) or the WWN with the vendor extension appended. Example: # /lib/udev/ata_id/ata_id --export /dev/sda |grep WWN ID_WWN=0x5001517387d61905 ID_WWN_WITH_EXTENSION=0x5001517387d61905 # /lib/udev/scsi_id --whitelisted --export -d /dev/sdb |grep WWN ID_WWN=0x600508b400105df7 ID_WWN_VENDOR_EXTENSION=0x0000e00000d80000 ID_WWN_WITH_EXTENSION=0x600508b400105df70000e00000d80000 # /lib/udev/scsi_id --whitelisted --export -d /dev/sdc |grep WWN ID_WWN=0x600508b400105df7 ID_WWN_VENDOR_EXTENSION=0x0000e00000db0000 ID_WWN_WITH_EXTENSION=0x600508b400105df70000e00000db0000 Signed-off-by: David Zeuthen <davidz@redhat.com>
2009-11-23scsi_id: Export WWN and Unit Serial NumberDavid Zeuthen
Since the Unit Serial Number and the WWN are useful bits of information export them as properties in the udev database. These bits of information are often printed on the physical disk, see http://people.freedesktop.org/~david/FUJITSU-MAY2036RC-sas-disk-picture.jpg and displaying them separately in the UI (or in /dev/disk) might help users identify the physical disk. This patch exports these bits of information as ID_WWN and ID_SCSI_SERIAL. Note that ata_id also use the ID_WWN property since commit 66094a4a7fc1d303e80785d586800eae9841502b (2009-11-04). Also print out ID_SCSI=1 so users of the udev database knows the disk speaks SCSI. Here's the scsi_id output from one of my SAS disks with these changes: ID_SCSI=1 ID_VENDOR=FUJITSU ID_VENDOR_ENC=FUJITSU\x20 ID_MODEL=MAY2036RC ID_MODEL_ENC=MAY2036RC\x20\x20\x20\x20\x20\x20\x20 ID_REVISION=0103 ID_TYPE=disk ID_SERIAL=3500000e01b83f520 ID_SERIAL_SHORT=500000e01b83f520 ID_WWN=0x500000e01b83f520 ID_SCSI_SERIAL=B3G1P8500RWT Unfortunately we can't overload ID_SERIAL for two reasons 1. ID_SERIAL (and ID_SERIAL_SHORT) exported by scsi_id isn't really the unit serial number (as defined by SCSI) - it is sometimes the WWN (since it is more unique than the Unit Serial Number) and complex rules (to make the serial unique) govern what value to use. 2. It would break existing setups if the value of ID_SERIAL changed Signed-off-by: David Zeuthen <davidz@redhat.com>
2009-09-17scsi_id: prevent buffer overflow in check_fill_0x83_prespc3()Harald Hoyer
see https://bugzilla.redhat.com/show_bug.cgi?id=516920
2009-09-14scsi_id: delete copy of bsg.hKay Sievers
It's provided by the kernel since 2.6.23.
2009-09-08fix randonm findings from llvm-clang-analyzerKay Sievers
Thanks to Lennart for the log file!
2009-08-30use nanosleep() instead of usleep()Daniel Mierswa
POSIX.1-2001 declares usleep() function obsolete and POSIX.1-2008 removes it. [Kay Sievers] - include time.h - use const for timespec - scsi_id: drop rand() in retry loop - modem-probe: rename msuspend() to msleep()
2009-08-08fix spellingAlan Jenkins
Fix spelling in docbook comments, code comments, and a local variable name. Thanks to "ispell -h" for docbook HTML and "scspell" for source code. Signed-off-by: Alan Jenkins <alan-jenkins@tuffmail.co.uk>
2009-08-07Merge libudev, udev, and the unconditional extras in a single Makefile.am.Diego Elio 'Flameeyes' Pettenò
Instead of using multiple recursive Makefile.am files, use a single Makefile.am that sets and builds all the basic suite of libraries and binaries for udev. This reduces the number of files in the source tree, and also reduces drastically the build time when using parallel-make. With this setup, all the compile steps will be executed in parallel, and just the linking stage will be (partially) serialised on the libraries creation.
2009-07-25make: build internal tools against libudev-private.laKay Sievers
2009-07-06scsi_id: correct error handling in prepend_vendor_modelIan Campbell
The callers of prepend_vendor_model both expect < 0 to be returned on error and the index to be returned otherwise. However prepend_vendor_model actually returns 1 on error. Fix this by correctly returning -1. Older kernels (before e5b3cd42: "SCSI: sanitize INQUIRY strings") truncated the model field in sysfs (or propagated bad results from the target) to less than the expected/required 16 characters which meant that the SCSI id was mangled into: # /sbin/scsi_id -g -s /block/sdg S146cee20VIRTUAL-DISK when it should have been: # /sbin/scsi_id -g -s /block/sdg SIET VIRTUAL-DISK 146cee20 Notice how the serial number has been pasted over the vendor+model at index 1 instead of being added at the end. In the former case: # cat /sys/devices/platform/host5/session1/target5:0:0/5:0:0:1/model | od -t c -t x1 0000000 V I R T U A L - D I S K \n 56 49 52 54 55 41 4c 2d 44 49 53 4b 0a But it should have been: # cat /sys/devices/platform/host5/session1/target5:0:0/5:0:0:1/model | od -t c -t x1 0000000 V I R T U A L - D I S K 56 49 52 54 55 41 4c 2d 44 49 53 4b 20 20 20 20 0000020 \n 0a Signed-off-by: Ian Campbell <ijc@hellion.org.uk>
2009-06-28scsi_id: delete no longer needed config fileKay Sievers
2009-06-28scsi_id: --reformat_serial - use udev_util_replace_whitespace()Kay Sievers
2009-06-17cleanup ./configure installation directory optionsKay Sievers
2009-06-09move syslog wrapper to libudevKay Sievers
2009-06-08libudev: move to top-level directoryKay Sievers
2009-05-20use more efficient string copyingKay Sievers
2009-02-17*_id: add model/vendor enc stringsDavid Zeuthen
So ID_MODEL and ID_VENDOR are pretty useful keys. However since we fix them up (removing leading/trailing whitespace, converts spaces to underscores) for use in device naming etc. we also force these fixups on the desktop shell. And this looks pretty ugly. The attached patch introduces the ID_MODEL_ENC and ID_VENDOR_ENC keys that contains the encoded version of the raw strings obtained. It's pretty similar in spirit to ID_FS_LABEL and its cousin ID_FS_LABEL_ENC. With this patch a desktop shell can fix up these strings as it sees fit. Note that some fixup is still needed though, for example # /lib/udev/ata_id --export /dev/sda |grep ID_MODEL ID_MODEL=INTEL_SSDSA2MH080G1GC ID_MODEL_ENC=INTEL\x20SSDSA2MH080G1GC\x20\x20\x20\x20\x20\x20\x20\x20 \x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20 Note the trailing and leading whitespace. Anyway with the attached patch the desktop shell should be able to display "INTEL SSDSA2MH080G1GC" rather than "INTEL_SSDSA2MH080G1GC" to the user.
2008-12-06make: do not delete autotools generated file with distcleanKay Sievers
[...] running the command `make maintainer-clean' should not delete `configure' even if `configure' can be remade using a rule in the Makefile. More generally, `make maintainer-clean' should not delete anything that needs to exist in order to run `configure' and then begin to build the program. This is the only exception; `maintainer-clean' should delete everything else that can be rebuilt.
2008-12-02scsi_id: do not fail if no serial is found like for optical drivesKay Sievers
2008-11-21man: fix typosPeter Breitenlohner
2008-11-20scsi_id: make sure, we do not have slashes in valuesKay Sievers
2008-11-13scsi_id: we don't use DEVPATH env var anymore, update man pageAlan Jenkins
Signed-off-by: Alan Jenkins <alan-jenkins@tuffmail.co.uk>
2008-11-05unify string replacementKay Sievers
2008-10-26do not init string arrays, just clear first byteKay Sievers
2008-10-21replace strncpy() with strlcpy()Alan Jenkins
The problem was strncpy() doesn't stop after writing the terminating NUL; by definition it goes on to zero the entire buffer. I spy another use of strncpy in udev_device_add_property_from_string(), which is responsible for another ~1% user cpu time... Signed-off-by: Alan Jenkins <alan-jenkins@tuffmail.co.uk>
2008-10-16libudev: add global property listKay Sievers
2008-10-02libudev: get rid of selinuxKay Sievers
"Hello world!" linked against libselinux parses /proc/mounts and whatever else on startup, even when the lib is not needed at all. Not funny! Get rid of that thing where it's not absolutely needed.
2008-10-02use no_argument, required_argument, optional_argument in longoptsKay Sievers
2008-09-29fix dbg() callersKay Sievers
2008-09-19always include config.h from MakefileKay Sievers
2008-09-19scsi_id: compiler warning on 32-bitAlan Jenkins
The sg_io_v4 interface passes pointers as u64s. It turns out GCC disapproves of us casting a u64 straight to a 32 bit pointer. cc1: warnings being treated as errors scsi_serial.c: In function ‘sg_err_category4’: scsi_serial.c:159: warning: cast to pointer from integer of different size scsi_serial.c: In function ‘scsi_dump_v4’: scsi_serial.c:303: warning: cast to pointer from integer of different size
2008-09-10extras: use libudev codeKay Sievers
2008-09-10libudev: rename libudev-utils.c libudev-util.cKay Sievers
2008-09-10libudev: get rid of udev_utils.cKay Sievers
2008-09-10libudev: get rid of udev_sysfs.cKay Sievers
2008-09-10libudev: add selinuxKay Sievers
2008-09-06use libudev code, unify logging, pass udev context around everywhereKay Sievers
2008-07-30use autotoolsKay Sievers
2008-07-30delete all Makefiles and move udev source to udev/Kay Sievers
2008-07-10scsi_id: the fallback fix broke error handlingKay Sievers
2008-07-10scsi_id: man page fixMarco d'Itri
minus signs need to be escaped and the program is not in the $PATH anymore
2008-07-10scsi_id: include sys/stat.hThomas Koeller
I could not build scsi_id because of a missing #include for sys/stat.h, so I had to add that. Signed-off-by: Thomas Koeller <thomas@koeller.dyndns.org>
2008-07-07scsi_id: fix fallback to sg v3 for sg nodesKay Sievers
2008-06-11scsi_id: retry open() on -EBUSYHarald Hoyer
2008-05-16scsi_id: add bsg.hKay Sievers
2008-05-14scsi_id: add --sg-version= optionKay Sievers
2008-05-14scsi_id: remove bus_id optionKay Sievers