[U-Boot] [RFC] bootm: Add sub commands

Wolfgang Denk wd at denx.de
Thu Sep 18 08:54:28 CEST 2008


Dear Kumar Gala,

In message <1221688841-3197-1-git-send-email-galak at kernel.crashing.org> you wrote:
> 
> Having bootm sub-commands allows both of these as we can break up
> the sequeunce of steps that are part of the bootm process.

OK.

> +int do_bootm_subcommand (cmd_tbl_t *cmdtp, int flag, int argc, char *argv[])
> +{
> +	int ret = 0;
> +
> +	/* start */
> +	if (argv[1][0] == 's') {

I think just matching on the first letter is to restrictive; we'll end
up with artificical command "names" that nobody can remember.

> +	if (!images.valid) {
> +		printf("Need to call %s start first\n", argv[0]);
> +		return 1;
> +	}

We should probably set up a small state machine.

> +	else if (argv[1][0] == 'i') {

And we need comments what all this means. WTF is 'i' ?

> +#if 0
> +are these really common ??? or is there any harm??
> +	/* bd_t setup */
> +	else if (argv[1][0] == 'p') {
> +	}

Yes, we still have plenty of systems running in the field with
arch/ppc and even with 2.4 kernels.

> +	/* prep os */
> +	else if (argv[1][0] == 'p') {
> +		return do_bootm_linux(BOOT_OS_PREP, argc, argv, &images);
> +	}

We already had 'p' above.


Best regards,

Wolfgang Denk

-- 
DENX Software Engineering GmbH,     MD: Wolfgang Denk & Detlev Zundel
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: (+49)-8142-66989-10 Fax: (+49)-8142-66989-80 Email: wd at denx.de
"There was no difference between  the  behavior  of  a  god  and  the
operations of pure chance..."   - Thomas Pynchon, _Gravity's Rainbow_


More information about the U-Boot mailing list