IF YOU WOULD LIKE TO GET AN ACCOUNT, please write an
email to Administrator. User accounts are meant only to access repo
and report issues and/or generate pull requests.
This is a purpose-specific Git hosting for
BaseALT
projects. Thank you for your understanding!
Только зарегистрированные пользователи имеют доступ к сервису!
Для получения аккаунта, обратитесь к администратору.
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>
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
66094a4a7f (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>
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()
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>
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>
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
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>
This scheme is more consistent and makes it obvious if a match happens
against the event device only, or the full chain of parent devices.
The old key names are now:
BUS -> SUBSYSTEMS
ID -> KERNELS
SYSFS -> ATTRS
DRIVER -> DRIVERS
Match keys for the event device:
KERNEL
SUBSYSTEM
ATTR
DRIVER (in a future release, for now the same as DRIVERS)
Match keys for all devices along the parent device chain:
KERNELS
SUBSYSTEMS
ATTRS
DRIVERS
ID, BUS, SYSFS are no longer mentioned in the man page but still work.
DRIVER must be converted to DRIVERS to match the new scheme. For now,
an error is logged, if DRIVER is used. In a future release, the DRIVER
key behaviour will change.
We never used any of the libsysfs convenience features. Here we replace
it completely with 300 lines of code, which are much simpler and a bit
faster cause udev(d) does not open any syfs file for a simple event which
does not need any parent device information.
Signed-off-by: Kay Sievers <kay.sievers@suse.de>
This patch is to enable the use of scsi_id to derive a UID for a SCSI-2
device which is not compliant with the page 83 inquiry reply format for
either SPC-2 or SPC-3. In this case, the page 83 reply does not
contain a list of Identification descriptors but a single binary encoded
hexa-decimal Vendor Specified Identifier.
The update is being driven by the need for scsi_id to support older
model EMC Symmetrix hardware, that is, models 4, 5, and 6.
Solaris uses volume_id now and they fiddled around with configure scripts
to map the linux kernel int types. Adding the types locally to volume_id
breaks the klibc build, so just switch to these ugly types and forget it. :)
Signed-off-by: Kay Sievers <kay.sievers@suse.de>
Update scsi_id to work with the libsysfs changes in udev: use
sysfs_get_classdev_attr and sysfs_get_device_attr in place of
sysfs_read_attribute_value.