[PATCH RFT] blspec: support boot /dev/disk0.rootfs to mean boot disk0.rootfs

Ahmad Fatoum a.fatoum at pengutronix.de
Mon Jun 19 07:37:42 PDT 2023


boot /dev/disk0.rootfs would always fail:

  Nothing bootable found on '/dev/disk0.rootfs'
  Nothing bootable found

boot /mnt/disk0.rootfs and boot disk0.rootfs would however work.
This can be surprising to users, so just skip over /dev if supplied.

Signed-off-by: Ahmad Fatoum <a.fatoum at pengutronix.de>
---
I am not sure why this wasn't the case before. Any ambiguity in doing it
this way? Change still needs to be tested.
---
 common/blspec.c | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/common/blspec.c b/common/blspec.c
index 8c7970da8915..b70332a54c28 100644
--- a/common/blspec.c
+++ b/common/blspec.c
@@ -782,6 +782,9 @@ int blspec_scan_devicename(struct bootentries *bootentries, const char *devname)
 
 	pr_debug("%s: %s\n", __func__, devname);
 
+	/* Support both boot /dev/disk0.rootfs and boot disk0.rootfs */
+	devname += str_has_prefix(devname, "/dev/");
+
 	device_detect_by_name(devname);
 
 	cdev = cdev_by_name(devname);
-- 
2.39.2




More information about the barebox mailing list