diff mbox series

[16/16] cros: Add information about booting Chrome OS on x86

Message ID 20200801160824.17486-17-sjg@chromium.org
State Superseded
Delegated to: Bin Meng
Headers show
Series x86: zboot: Enhance the 'zboot' command | expand

Commit Message

Simon Glass Aug. 1, 2020, 4:08 p.m. UTC
Recent versions of Chrome OS do not have a kernel in the root disk, to
save space.

With the improvements to the 'zboot' command it is fairly easy to load
the kernel from the raw partition. Add instructions on how to do this.

Signed-off-by: Simon Glass <sjg@chromium.org>
---

 doc/README.chromium | 32 ++++++++++++++++++++++++++++++++
 1 file changed, 32 insertions(+)

Comments

Wolfgang Wallner Aug. 13, 2020, 11:23 a.m. UTC | #1
Hi Simon,

-----"Simon Glass" <sjg@chromium.org> schrieb: -----
> Betreff: [PATCH 16/16] cros: Add information about booting Chrome OS on x86
> 
> Recent versions of Chrome OS do not have a kernel in the root disk, to
> save space.
> 
> With the improvements to the 'zboot' command it is fairly easy to load
> the kernel from the raw partition. Add instructions on how to do this.
> 
> Signed-off-by: Simon Glass <sjg@chromium.org>
> ---
> 
>  doc/README.chromium | 32 ++++++++++++++++++++++++++++++++
>  1 file changed, 32 insertions(+)

Reviewed-by: Wolfgang Wallner <wolfgang.wallner@br-automation.com>
diff mbox series

Patch

diff --git a/doc/README.chromium b/doc/README.chromium
index c56545cb7ff..75f2f24042c 100644
--- a/doc/README.chromium
+++ b/doc/README.chromium
@@ -27,6 +27,9 @@  available:
         since many of them only support coreboot as the bootloader and have
         no bare-metal support in U-Boot. For this, use the 'coreboot' target.
 
+   - Running U-Boot and booting into a Chrome OS image, but without verified
+        boot. This can be useful for testing.
+
 
 U-Boot with Chromium OS verified boot
 -------------------------------------
@@ -175,6 +178,35 @@  course the above sandbox feature provides a sort of functional test and can
 detect problems that affect the flow or particular vboot features.
 
 
+U-Boot without Chromium OS verified boot
+----------------------------------------
+
+The following script can be used to boot a Chrome OS image on coral:
+
+   # Read the image header and obtain the address of the kernel
+   # The offset 4f0 is defined by verified boot and may change for other
+   # Chromebooks
+   read mmc 2:2 100000 0 80; setexpr loader *001004f0;
+
+   # Get the kernel size and calculate the number of blocks (0x200 bytes each)
+   setexpr size *00100518; setexpr blocks $size / 200;
+
+   # Read the full kernel and calculate the address of the setup block
+   read mmc 2:2 100000 80 $blocks; setexpr setup $loader - 1000;
+
+   # Locate the command line
+   setexpr cmdline $loader - 2000;
+
+   # Start the zboot process with the loaded kernel, setup block and cmdline
+   zboot start 100000 0 0 0 $setup $cmdline;
+
+   # Load the kernel, fix up the 'setup' block, dump information
+   zboot load; zboot setup; zboot dump
+
+   # Boot into Chrome OS
+   zboot go
+
+
 TO DO
 -----