summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBrian Norris <computersforpeace@gmail.com>2023-01-06 18:04:22 -0800
committerChristian Marangi <ansuelsmth@gmail.com>2023-01-20 15:02:30 +0100
commite9b59f063bb333df6d58bf434554753d123a713f (patch)
tree5985bd18a1f1ac97e241a5cb8e4ee620a1e6a71d
parent3affe9ea5098c8bb90111ce97d50ad976ef0c034 (diff)
downloadfstools-e9b59f063bb333df6d58bf434554753d123a713f.tar.gz
partname: Ignore root=PARTUUID...
We're assuming all root= arguments are /dev/ paths, but many targets utilize root=PARTUUID=<xxx> strategies. At least allow them to fall back to scanning all block devices. Signed-off-by: Brian Norris <computersforpeace@gmail.com>
-rw-r--r--libfstools/partname.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/libfstools/partname.c b/libfstools/partname.c
index f59c52e..9c27015 100644
--- a/libfstools/partname.c
+++ b/libfstools/partname.c
@@ -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);
}