[U-Boot] [PATCH] Handle environment variables like commands

stefano babic stefano.babic at babic.homelinux.org
Mon Oct 20 09:50:55 CEST 2008


Wolfgang Denk wrote:
> 
> The idea of the extension is that something like
> 
> 	=> bootm ${kernel} ${fdt} ${ramdisk}
> 
> will still work.
> 
> Unfortunately, it doesn't, as we have no way to pass the arguments to
> the (substituted) command to the commands run in the executed script.

yes, that is true ;(. Arguments are not passed to the underlying script.

> One idea to solve this  problem  would  be  to  introduce  positional
> parameters,  similar  to  how  it's  being  done in the shell. In the
> script, we could then refer to the original command args using  "$1",
> "$2", ... so the example above would look like that:
> 
> 	=> setenv bootm 'echo Run bootm command; builtin bootm $1 $2 $3"

Ok, I understand. We need the same behavior as in the real shell to
perform this.

> I have to admit that I didn't spend much thought on this yet, so all
> feedback or sugggestions of alternative / better ideas is
> welcome.

I admit I have no better ideas...with positional parameters we can start
even some complex scripts. I take a look how to implement them, if there
are no other suggestions.

Best regards,
Stefano Babic


-- 
stefano <stefano.babic at babic.homelinux.org>
GPG Key: 0x55814DDE
Fingerprint 4E85 2A66 4CBA 497A 2A7B D3BF 5973 F216 5581 4DDE


More information about the U-Boot mailing list