chiark / gitweb /
gpt-auto-generator: skip nonexistent devices
authorŁukasz Stelmach <l.stelmach@samsung.com>
Tue, 7 Jan 2014 14:00:22 +0000 (15:00 +0100)
committerZbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl>
Sat, 11 Jan 2014 21:50:09 +0000 (16:50 -0500)
The devices we work with have eMMC chips for storage. The chips
provide four "hardware" partitions.  The first is /dev/mmcblk0, it
takes almost whole space and holds a GPT with several real partitions
(/dev/mmcblk0p?). Then there are three block devices (mmcblk0boot0,
mmcblk0boot1, rpmb) that are part of the same hardware as mmcblk0 that
are presented by the kernel as children of the latter. That relationship
makes gpt-auto-generator try to peek them but since they are not GPT
partitions blkid_do_safeprobe() returns -2 making verify_gpt_parition()
function return -ENODEV.

src/gpt-auto-generator/gpt-auto-generator.c

index 017c35dcd6414014745169e708296ee32946527f..e21ede94da819de3be25848145bed7887c350da7 100644 (file)
@@ -297,6 +297,9 @@ static int enumerate_partitions(struct udev *udev, dev_t dev) {
 
                 r = verify_gpt_partition(node, &type_id, &nr, &fstype);
                 if (r < 0) {
 
                 r = verify_gpt_partition(node, &type_id, &nr, &fstype);
                 if (r < 0) {
+                        /* skip child devices which are not detected properly */
+                        if (r == -ENODEV)
+                                continue;
                         log_error("Failed to verify GPT partition %s: %s",
                                   node, strerror(-r));
                         return r;
                         log_error("Failed to verify GPT partition %s: %s",
                                   node, strerror(-r));
                         return r;