[PATCH 4/5] boot: implement devboot in C

Sascha Hauer s.hauer at pengutronix.de
Fri Nov 13 01:48:54 PST 2026


On 2026-11-13 08:51, Ahmad Fatoum wrote:
> Hi,
> 
> On 10/30/26 3:13 PM, Sascha Hauer wrote:
> > devboot is a shell script that brings up the network, sources a per-user,
> > per-board script from global.net.fetchdir and translates the variables it
> > sets into boot -o options. Being a script on top of the boot command, it
> > has a hard time integrating with it: The kernel command line fragments
> > the devboot script sets have to be put into the linux.bootargs.devboot.
> > namespace to be removed afterwards,
> 
> That's resolved by your scoped/stashed/banked globalvar series now,
> isn't it?

Yes, resolved already, this doesn't count for the motivation of this
patch anymore.

> 
> > and the devboot boot target needed
> > to boot with devboot by default takes only a single boot target and boot
> > options.
> 
> So instead of:
> 
> boot -D mmc1 mmc2
> 
> one had to do
> 
> boot devboot at mmc1 devboot at mmc2
> 
> I don't consider that so bad.

It's not so much about the "boot -D mmc1 mmc2" vs. "boot devboot at mmc1
devboot at mmc2", but more that there are too many ways to archieve the
same thing:

- plain "boot" with global.boot.default="devboot at mmc1"
- plain "devboot" with global.boot.default="mmc1"
- plain "devboot" with global.boot.default="devboot at mmc1"

The last line works, but sources the devboot script twice. There was no
way to do a devboot by default for the existing global.boot.default="mmc1"
entry. A plain "devboot" without arguments work, but making it the
default required us to use the "boot" command along with altering
global.boot.default

I think using a flag (-D, global.boot.devboot) makes usage more
consistent.

> > @@ -163,6 +173,16 @@ static int do_boot(int argc, char *argv[])
> >  		next = next_word;
> >  	}
> >  
> > +	/* like -o, devboot doesn't apply to entries booted from the menu */
> > +	if (do_devboot && !do_list && !do_menu) {
> > +		devboot = devboot_start(&overrides);
> > +		if (IS_ERR(devboot)) {
> > +			ret = PTR_ERR(devboot);
> > +			free(freep);
> > +			goto out_overrides;
> > +		}
> > +	}
> 
> That sounds like a bug with the devboot implementation. If you don't
> want to fix it, I think this should have the command fail instead of
> silently ignoring -D.

Right. This should be fixed rather than copying the behaviour to the new
implementation.

Sascha

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




More information about the barebox mailing list