mail archive of the barebox mailing list
 help / color / mirror / Atom feed
* [PATCH RFT] blspec: support boot /dev/disk0.rootfs to mean boot disk0.rootfs
@ 2023-06-19 14:37 Ahmad Fatoum
  2023-06-19 15:08 ` Marco Felsch
  2023-06-26 10:01 ` Sascha Hauer
  0 siblings, 2 replies; 4+ messages in thread
From: Ahmad Fatoum @ 2023-06-19 14:37 UTC (permalink / raw)
  To: barebox; +Cc: Ahmad Fatoum

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@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




^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH RFT] blspec: support boot /dev/disk0.rootfs to mean boot disk0.rootfs
  2023-06-19 14:37 [PATCH RFT] blspec: support boot /dev/disk0.rootfs to mean boot disk0.rootfs Ahmad Fatoum
@ 2023-06-19 15:08 ` Marco Felsch
  2023-06-19 15:14   ` Ahmad Fatoum
  2023-06-26 10:01 ` Sascha Hauer
  1 sibling, 1 reply; 4+ messages in thread
From: Marco Felsch @ 2023-06-19 15:08 UTC (permalink / raw)
  To: Ahmad Fatoum; +Cc: barebox

Hi Ahmad,

On 23-06-19, Ahmad Fatoum wrote:
> 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@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.

According commands/boot.c help message:

| "BOOTSRC can be:"
| "- a filename under /env/boot/"
| "- a full path to a boot script"
| "- a full path to a bootspec entry"
| "- a device name"
| "- a partition name under /dev/"
| "- a full path to a directory which"
| "   - contains boot scripts, or"
| "   - contains a loader/entries/ directory containing bootspec entries"

the 'full path' to a device is not suported yet. Should that be fixed
within the boot-cmd?

Regards,
  Marco



^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH RFT] blspec: support boot /dev/disk0.rootfs to mean boot disk0.rootfs
  2023-06-19 15:08 ` Marco Felsch
@ 2023-06-19 15:14   ` Ahmad Fatoum
  0 siblings, 0 replies; 4+ messages in thread
From: Ahmad Fatoum @ 2023-06-19 15:14 UTC (permalink / raw)
  To: Marco Felsch; +Cc: barebox

On 19.06.23 17:08, Marco Felsch wrote:
> Hi Ahmad,
> 
> On 23-06-19, Ahmad Fatoum wrote:
>> 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@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.
> 
> According commands/boot.c help message:
> 
> | "BOOTSRC can be:"
> | "- a filename under /env/boot/"
> | "- a full path to a boot script"
> | "- a full path to a bootspec entry"
> | "- a device name"
> | "- a partition name under /dev/"
> | "- a full path to a directory which"
> | "   - contains boot scripts, or"
> | "   - contains a loader/entries/ directory containing bootspec entries"
> 
> the 'full path' to a device is not suported yet. Should that be fixed
> within the boot-cmd?

You can interpret "a partition name under /dev/" as meaning both
partition name without /dev/ or with /dev/ IMO.

> 
> Regards,
>   Marco
> 

-- 
Pengutronix e.K.                           |                             |
Steuerwalder Str. 21                       | http://www.pengutronix.de/  |
31137 Hildesheim, Germany                  | Phone: +49-5121-206917-0    |
Amtsgericht Hildesheim, HRA 2686           | Fax:   +49-5121-206917-5555 |




^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH RFT] blspec: support boot /dev/disk0.rootfs to mean boot disk0.rootfs
  2023-06-19 14:37 [PATCH RFT] blspec: support boot /dev/disk0.rootfs to mean boot disk0.rootfs Ahmad Fatoum
  2023-06-19 15:08 ` Marco Felsch
@ 2023-06-26 10:01 ` Sascha Hauer
  1 sibling, 0 replies; 4+ messages in thread
From: Sascha Hauer @ 2023-06-26 10:01 UTC (permalink / raw)
  To: Ahmad Fatoum; +Cc: barebox

On Mon, Jun 19, 2023 at 04:37:42PM +0200, Ahmad Fatoum wrote:
> 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@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(+)

Applied, thanks

Sascha

> 
> 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
> 
> 
> 

-- 
Pengutronix e.K.                           |                             |
Steuerwalder Str. 21                       | http://www.pengutronix.de/  |
31137 Hildesheim, Germany                  | Phone: +49-5121-206917-0    |
Amtsgericht Hildesheim, HRA 2686           | Fax:   +49-5121-206917-5555 |



^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2023-06-26 10:02 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-06-19 14:37 [PATCH RFT] blspec: support boot /dev/disk0.rootfs to mean boot disk0.rootfs Ahmad Fatoum
2023-06-19 15:08 ` Marco Felsch
2023-06-19 15:14   ` Ahmad Fatoum
2023-06-26 10:01 ` Sascha Hauer

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox