partname: Ignore root=PARTUUID...
[project/fstools.git] / libfstools / partname.c
index f59c52eb8f3c6da0e8ee6c4080abd7cdac3db715..9c27015643ad683620aa9c44ad167616a5f56fb3 100644 (file)
@@ -128,12 +128,12 @@ static struct volume *partname_volume_find(char *name)
                        return NULL;
        }
 
-       if (get_var_from_file("/proc/cmdline", "root", rootparam, sizeof(rootparam))) {
+       if (get_var_from_file("/proc/cmdline", "root", rootparam, sizeof(rootparam)) && rootparam[0] == '/') {
                rootdev = rootdevname(rootparam);
                /* find partition on same device as rootfs */
                snprintf(ueventgstr, sizeof(ueventgstr), "%s/%s/*/uevent", block_dir_name, rootdev);
        } else {
-               /* no 'root=' kernel cmdline parameter, find on any block device */
+               /* no useful 'root=' kernel cmdline parameter, find on any block device */
                snprintf(ueventgstr, sizeof(ueventgstr), "%s/*/uevent", block_dir_name);
        }