public inbox for u-boot@lists.denx.de
 help / color / mirror / Atom feed
From: Graeme Russ <graeme.russ@gmail.com>
To: u-boot@lists.denx.de
Subject: [U-Boot] [PATCH 4/4] x86: Add support for specifying an initrd with the zboot command
Date: Sat, 03 Dec 2011 08:40:05 +1100	[thread overview]
Message-ID: <4ED945B5.7080600@gmail.com> (raw)
In-Reply-To: <1322644664-4520-5-git-send-email-gabeblack@chromium.org>

Hi Gabe,

On 30/11/11 20:17, Gabe Black wrote:
> This change finishes plumbing the initrd support built into the zboot
> mechanism out to the command interface.
> 
> It also fixes a bug in the command declaration where the kernel size could
> be passed as an optional second parameter but not enough arguments were
> allowed.
> 
> Signed-off-by: Gabe Black <gabeblack@chromium.org>
> ---
>  arch/x86/lib/zimage.c |   14 +++++++++++---
>  1 files changed, 11 insertions(+), 3 deletions(-)
> 
> diff --git a/arch/x86/lib/zimage.c b/arch/x86/lib/zimage.c
> index 0cbb571..ef34c23 100644
> --- a/arch/x86/lib/zimage.c
> +++ b/arch/x86/lib/zimage.c
> @@ -321,6 +321,8 @@ int do_zboot(cmd_tbl_t *cmdtp, int flag, int argc, char *const argv[])
>  	void *load_address;
>  	char *s;
>  	ulong bzImage_size = 0;
> +	ulong initrd_addr = 0;
> +	ulong initrd_size = 0;
>  
>  	disable_interrupts();
>  
> @@ -337,9 +339,15 @@ int do_zboot(cmd_tbl_t *cmdtp, int flag, int argc, char *const argv[])
>  	if (s)
>  		bzImage_addr = (void *)simple_strtoul(s, NULL, 16);
>  
> -	if (argc >= 3)
> +	if (argc >= 3) {
>  		/* argv[2] holds the size of the bzImage */
>  		bzImage_size = simple_strtoul(argv[2], NULL, 16);
> +	}

No braces for single-line statements - the comment is unnecessary as the
code is obvious

> +
> +	if (argc >= 4)
> +		initrd_addr = simple_strtoul(argv[3], NULL, 16);
> +	if (argc >= 5)
> +		initrd_size = simple_strtoul(argv[4], NULL, 16);
>  
>  	/* Lets look for */
>  	base_ptr = load_zimage(bzImage_addr, bzImage_size, &load_address);
> @@ -349,7 +357,7 @@ int do_zboot(cmd_tbl_t *cmdtp, int flag, int argc, char *const argv[])
>  		return -1;
>  	}
>  	if (setup_zimage(base_ptr, (char *)base_ptr + COMMAND_LINE_OFFSET,
> -			0, 0, 0)) {
> +			0, initrd_addr, initrd_size)) {
>  		printf("Setting up boot parameters failed ...\n");
>  		return -1;
>  	}
> @@ -366,7 +374,7 @@ int do_zboot(cmd_tbl_t *cmdtp, int flag, int argc, char *const argv[])
>  }
>  
>  U_BOOT_CMD(
> -	zboot, 2, 0,	do_zboot,
> +	zboot, 5, 0,	do_zboot,
>  	"Boot bzImage",
>  	""

I think it is about time it got a help message :)

>  );

Regards,

Graeme

  reply	other threads:[~2011-12-02 21:40 UTC|newest]

Thread overview: 37+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-11-30  9:17 [U-Boot] [PATCH 0/4] Add support for the 32 bit boot protocol to the x86 zboot command Gabe Black
2011-11-30  9:17 ` [U-Boot] [PATCH 1/4] x86: Clean up the x86 zimage code in preparation to extend it Gabe Black
2011-11-30  9:17 ` [U-Boot] [PATCH 2/4] x86: Add support for booting Linux using the 32 bit boot protocol Gabe Black
2011-11-30  9:17 ` [U-Boot] [PATCH 3/4] x86: Refactor the zboot innards so they can be reused with a vboot image Gabe Black
2011-12-02 21:43   ` Graeme Russ
2011-12-02 21:47     ` Gabe Black
2011-11-30  9:17 ` [U-Boot] [PATCH 4/4] x86: Add support for specifying an initrd with the zboot command Gabe Black
2011-12-02 21:40   ` Graeme Russ [this message]
2011-11-30  9:28 ` [U-Boot] [PATCH 0/4] Add support for the 32 bit boot protocol to the x86 " Graeme Russ
2011-11-30 22:04   ` Graeme Russ
2011-11-30 12:13 ` Graeme Russ
2011-11-30 17:46   ` Gabe Black
2011-11-30 20:19     ` Graeme Russ
2011-12-03 11:18 ` [U-Boot] [PATCH v2 0/6] Add support for the 32 bit boot protocol and coreboot table parsing Gabe Black
2011-12-05 22:09   ` [U-Boot] [PATCH v3 " Gabe Black
2011-12-05 22:12     ` Graeme Russ
2011-12-05 22:09   ` [U-Boot] [PATCH v3 1/6] x86: Import code from coreboot's libpayload to parse the coreboot table Gabe Black
2011-12-06 10:35     ` Graeme Russ
2011-12-05 22:09   ` [U-Boot] [PATCH v3 2/6] x86: Clean up the x86 zimage code in preparation to extend it Gabe Black
2011-12-06 10:36     ` Graeme Russ
2011-12-05 22:09   ` [U-Boot] [PATCH v3 3/6] x86: Add support for booting Linux using the 32 bit boot protocol Gabe Black
2011-12-06 10:36     ` Graeme Russ
2011-12-05 22:09   ` [U-Boot] [PATCH v3 4/6] x86: Add infrastructure to extract an e820 table from the coreboot tables Gabe Black
2011-12-06 10:37     ` Graeme Russ
2011-12-05 22:09   ` [U-Boot] [PATCH v3 5/6] x86: Refactor the zboot innards so they can be reused with a vboot image Gabe Black
2011-12-06 10:37     ` Graeme Russ
2011-12-05 22:09   ` [U-Boot] [PATCH v3 6/6] x86: Add support for specifying an initrd with the zboot command Gabe Black
2011-12-06 10:38     ` Graeme Russ
2011-12-03 11:18 ` [U-Boot] [PATCH v2 1/6] x86: Import code from coreboot's libpayload to parse the coreboot table Gabe Black
2011-12-03 11:18 ` [U-Boot] [PATCH v2 2/6] x86: Clean up the x86 zimage code in preparation to extend it Gabe Black
2011-12-03 11:18 ` [U-Boot] [PATCH v2 3/6] x86: Add support for booting Linux using the 32 bit boot protocol Gabe Black
2011-12-03 11:18 ` [U-Boot] [PATCH v2 4/6] x86: Add infrastructure to extract an e820 table from the coreboot tables Gabe Black
2011-12-04  0:52   ` Graeme Russ
2011-12-05 22:06     ` Gabe Black
2011-12-05 22:09       ` Graeme Russ
2011-12-03 11:18 ` [U-Boot] [PATCH v2 5/6] x86: Refactor the zboot innards so they can be reused with a vboot image Gabe Black
2011-12-03 11:18 ` [U-Boot] [PATCH v2 6/6] x86: Add support for specifying an initrd with the zboot command Gabe Black

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=4ED945B5.7080600@gmail.com \
    --to=graeme.russ@gmail.com \
    --cc=u-boot@lists.denx.de \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox