@@ -128,12 +128,13 @@ 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)) &&
+ strncmp(rootparam, "PARTLABEL=", 10)) {
rootdev = rootdevname(rootparam);
- /* find partition on same device as rootfs */
+ /* root= is not PARTLABEL, 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 */
+ /* PARTLABEL or no 'root=' kernel cmdline parameter, find on any block device */
snprintf(ueventgstr, sizeof(ueventgstr), "%s/*/uevent", block_dir_name);
}
This patch adds "PARTLABEL=" checking of root= parameter to partname_volume_find function. The Linux Kernel supports "root=PARTLABEL=<label>" syntax, but fstools doesn't and fail to parse the path to the root device. So check the parameter and skip parsing, find partition from all block devices if this syntax is used. Note: This change is required for I-O DATA HDL-A/HDL2-A. On they, kernel and rootfs are stored in the storage device connected to SATA, port1 or port2 and the path to the partition will be assigned dynamically. So "root=PARTLABEL=<label>" syntax is required instead of "/dev/sdXN". Signed-off-by: INAGAKI Hiroshi <musashino.open@gmail.com> --- libfstools/partname.c | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-)