diff options
-rw-r--r-- | extras/ata_id/ata_id.c | 5 | ||||
-rw-r--r-- | rules/rules.d/60-persistent-storage.rules | 4 |
2 files changed, 5 insertions, 4 deletions
diff --git a/extras/ata_id/ata_id.c b/extras/ata_id/ata_id.c index d976467817..9644a45b19 100644 --- a/extras/ata_id/ata_id.c +++ b/extras/ata_id/ata_id.c @@ -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); diff --git a/rules/rules.d/60-persistent-storage.rules b/rules/rules.d/60-persistent-storage.rules index 6688a3958e..7a9d078ec8 100644 --- a/rules/rules.d/60-persistent-storage.rules +++ b/rules/rules.d/60-persistent-storage.rules @@ -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" |