* After the initrd→host transition: look at the current block device mounted at / and set the same
* properties to its whole block device. */
- if (!device_is_devtype(dev, "disk")) {
- log_device_debug(dev, "Skipping GPT root logic on partition block device.");
+ const char *devnode;
+ r = sd_device_get_devname(dev, &devnode);
+ if (r < 0)
+ return log_device_debug_errno(dev, r, "Failed to get device node: %m");
+
+ r = block_device_is_whole_disk(dev);
+ if (r < 0)
+ return log_device_debug_errno(dev, r, "Unable to determine if device '%s' is a whole-block device: %m", devnode);
+ if (r == 0) {
+ log_device_debug(dev, "Invoked on device '%s' which is not a whole-disk block device, ignoring.", devnode);
+ return 0;
+ }
+
+ r = blockdev_partscan_enabled(dev);
+ if (r < 0)
+ return log_device_debug_errno(dev, r, "Failed to determine if block device '%s' supports partitions: %m", devnode);
+ if (r == 0) {
+ log_device_debug(dev, "Invoked on block device '%s' that lacks partition scanning, ignoring.", devnode);
return 0;
}