udev - Add unit serial number to the udev
authorAntonio Huete Jimenez <tuxillo@quantumachine.net>
Thu, 12 Aug 2010 12:19:34 +0000 (14:19 +0200)
committerAntonio Huete Jimenez <tuxillo@quantumachine.net>
Fri, 20 Aug 2010 13:30:37 +0000 (15:30 +0200)
       dictionary when available.

sys/kern/subr_disk.c

index 18edfe0..0bd0636 100644 (file)
@@ -619,6 +619,10 @@ _setdiskinfo(struct disk *disk, struct disk_info *info)
                disk->d_cdev->si_bsize_phys = disk->d_rawdev->si_bsize_phys;
                disk->d_cdev->si_bsize_best = disk->d_rawdev->si_bsize_best;
        }
+
+       /* Add the serial number to the udev_dictionary */
+       if (info->d_serialno)
+               udev_dict_set_cstr(disk->d_cdev, "serno", info->d_serialno);
 }
 
 /*