+ cdrom = node && !!udev_device_get_property_value(dev, "ID_CDROM");
+ if (cdrom) {
+ /* CDROMs require a little initialisation, to get
+ * petitboot-compatible tray behaviour */
+ cdrom_init(node);
+ if (!cdrom_media_present(node)) {
+ pb_log("SKIP: %s: no media present\n", name);
+ return 0;
+ }
+ }
+
+ type = udev_device_get_property_value(dev, "ID_FS_TYPE");
+ if (!type) {
+ pb_log("SKIP: %s: no ID_FS_TYPE property\n", name);
+ return 0;
+ }
+
+ /* We may see multipath devices; they'll have the same uuid as an
+ * existing device, so only parse the first. */
+ uuid = udev_device_get_property_value(dev, "ID_FS_UUID");
+ if (uuid) {
+ ddev = device_lookup_by_uuid(udev->handler, uuid);
+ if (ddev) {
+ pb_log("SKIP: %s UUID [%s] already present (as %s)\n",
+ name, uuid, ddev->device->id);
+ return 0;
+ }