chiark / gitweb /
ata_id: sync ID_SERIAL(_SHORT) with other *_id tools
authorKay Sievers <kay.sievers@vrfy.org>
Sun, 28 Jun 2009 00:58:12 +0000 (02:58 +0200)
committerKay Sievers <kay.sievers@vrfy.org>
Sun, 28 Jun 2009 00:58:12 +0000 (02:58 +0200)
ID_SERIAL is the full serial number used for the links, ID_SERIAL_SHORT
is the device serial number.

extras/ata_id/ata_id.c
rules/rules.d/60-persistent-storage.rules

index d976467817d1ce7bf274c264101b64067a12df80..9644a45b19482422404bc0091ac92b4d5f5a8501 100644 (file)
@@ -149,11 +149,12 @@ int main(int argc, char *argv[])
                } else {
                        printf("ID_TYPE=disk\n");
                }
+               printf("ID_BUS=ata\n");
                printf("ID_MODEL=%s\n", model);
                printf("ID_MODEL_ENC=%s\n", model_enc);
-               printf("ID_SERIAL=%s\n", serial);
                printf("ID_REVISION=%s\n", revision);
-               printf("ID_BUS=ata\n");
+               printf("ID_SERIAL=%s_%s\n", model, serial);
+               printf("ID_SERIAL_SHORT=%s\n", serial);
        } else {
                if (serial[0] != '\0')
                        printf("%s_%s\n", model, serial);
index 6688a3958e55345fb381fc62a017e54f68ae4095..7a9d078ec8c5e1c4a468be94c4c0acaa3b124e3c 100644 (file)
@@ -24,8 +24,8 @@ ENV{DEVTYPE}=="partition", IMPORT{parent}="ID_*"
 
 # by-id (hardware serial number)
 KERNEL=="hd*[!0-9]", IMPORT{program}="ata_id --export $tempnode"
-KERNEL=="hd*[!0-9]", ENV{ID_SERIAL}=="?*", SYMLINK+="disk/by-id/ata-$env{ID_MODEL}_$env{ID_SERIAL}"
-KERNEL=="hd*[0-9]", ENV{ID_SERIAL}=="?*", SYMLINK+="disk/by-id/ata-$env{ID_MODEL}_$env{ID_SERIAL}-part%n"
+KERNEL=="hd*[!0-9]", ENV{ID_SERIAL}=="?*", SYMLINK+="disk/by-id/ata-$env{ID_SERIAL}"
+KERNEL=="hd*[0-9]", ENV{ID_SERIAL}=="?*", SYMLINK+="disk/by-id/ata-$env{ID_SERIAL}-part%n"
 
 KERNEL=="sd*[!0-9]|sr*", ENV{ID_SERIAL}!="?*", SUBSYSTEMS=="usb", IMPORT{program}="usb_id --export %p"
 KERNEL=="sd*[!0-9]|sr*", ENV{ID_SERIAL}!="?*", IMPORT{program}="scsi_id --export --whitelisted -d $tempnode", ENV{ID_BUS}="scsi"