]> git.ipfire.org Git - thirdparty/systemd.git/commitdiff
udev-builtin-blkid: fix GPT_FLAG_NO_AUTO check for ESP (#3450)
authorLennart Poettering <lennart@poettering.net>
Thu, 9 Jun 2016 08:51:20 +0000 (10:51 +0200)
committerMartin Pitt <martin.pitt@ubuntu.com>
Thu, 9 Jun 2016 08:51:20 +0000 (10:51 +0200)
The flags check was accidentally placed in the ESP if block, but should be in
the root if block.

This corrects: 0238d4c660e732dd03ba0cdb54a29ec5870ee849

Fixes: #3440
Also see: #3441

src/udev/udev-builtin-blkid.c

index ed0ea5ce5f10bd1bb920c334e526aaac7894590b..3c58445836d08dab618d40904e0586858c1330fd 100644 (file)
@@ -147,11 +147,6 @@ static int find_gpt_root(struct udev_device *dev, blkid_probe pr, bool test) {
 
                 if (sd_id128_equal(type, GPT_ESP)) {
                         sd_id128_t id, esp;
-                        unsigned long long flags;
-
-                        flags = blkid_partition_get_flags(pp);
-                        if (flags & GPT_FLAG_NO_AUTO)
-                                continue;
 
                         /* We found an ESP, let's see if it matches
                          * the ESP we booted from. */
@@ -167,6 +162,11 @@ static int find_gpt_root(struct udev_device *dev, blkid_probe pr, bool test) {
                                 found_esp = true;
 
                 } else if (sd_id128_equal(type, GPT_ROOT_NATIVE)) {
+                        unsigned long long flags;
+
+                        flags = blkid_partition_get_flags(pp);
+                        if (flags & GPT_FLAG_NO_AUTO)
+                                continue;
 
                         /* We found a suitable root partition, let's
                          * remember the first one. */