[PATCH 00/16] bootstd: Improve ChromiumOS support

Simon Glass sjg at chromium.org
Fri Aug 4 05:02:21 CEST 2023


Hi Alper,

On Thu, 3 Aug 2023 at 15:31, Alper Nebi Yasak <alpernebiyasak at gmail.com> wrote:
>
> Hi Simon,
>
> On 2023-07-30 20:16 +03:00, Simon Glass wrote:
> > The ChromiumOS bootmeth is fairly basic at present. It is able to boot
> > only x86 kernels and contains quite a few hard-coded offsets.
> >
> > This series tidies it up by bringing in some vboot structures and adding
> > support for ARM.
> >
> > It adds a few more features to bootstd, including display of x86 setup
> > information.
>
> Can't do a detailed review or test for a while, but had a cursory look
> now and wanted to reply. I'm not sure if you heard of it, but I maintain
> an alternate implementation of ChromiumOS verified boot userspace called
> depthcharge-tools [1]. Its main purpose is booting ordinary distros on
> Chromebooks, but it would be nice if your U-Boot implementation was also
> compatible with images produced from that.
>
> I guess it boils down to:
>
> - Enable booting from any chromeos_kernel partition (not just 2 & 4)

How do you know which ones hold kernels, and which root disks
correspond to each kernel?

> - Fixup the ramdisk addr/size in x86 setup info after reading the kernel

But ChromeOS doesn't use ramdisk, right?

> - Replace %U with chromeos_kernel PARTUUID (you probably already do?)

Yes.

> - Prepend cros_secure to kernel cmdline

Does it have to be at the start of the cmdline? Also, the cmdline
comes from cros at present, so does include that normally.  I think
the best way is for you to give it a try and see what is needed.

>
> There's a ready made debian-installer image if you want to test [2]. Has
> a partitioning bug defaulting to MBR, but otherwise can install for CrOS
> verified boot as well. (It's what took my last year away from U-Boot).
>
> [1] depthcharge-tools -- Tools to manage the Chrome OS bootloader
> https://github.com/alpernebbi/depthcharge-tools
>
> [2] Debian Installer netboot image for amd64 Chromebooks
> https://d-i.debian.org/daily-images/amd64/daily/netboot/depthcharge/

I see the installer, but how do I actually run it on bob, say?

>
> > So far this does not actually boot correctly on any ARM Chromebook:
> >
> >    jerry - hangs when booting kernel
> >    bob - Bad Linux ARM64 Image magic! with lz4-compressed kernel
> >
> > Further work can address these issues.
>
> I haven't been able to boot recent kernels with extlinux.conf on my
> pre-bootstd kevin U-Boot builds which I remember were working with older
> kernels. And I've heard people not being boot with extlinux.conf on
> veyrons as well. Might be the same, maybe try an older kernel for jerry?

Ah OK I haven't tried that.

>
> Again, there's a debian-installer arm64 image if you want to test [3],
> which could work fine on bob (not with depthcharge's size limit though),
> but kernel support is missing for anything else.
>
> Oh, and postmarketOS also supports CrOS verified boot [4] via
> depthcharge-tools, but they don't have pre-built images and it's a bit
> of a hassle.
>
> [3] Debian Installer netboot image for arm64 Chromebooks
> https://d-i.debian.org/daily-images/arm64/daily/netboot/depthcharge/
>
> [4] postmarketOS Wiki - Chrome OS devices
> https://wiki.postmarketos.org/wiki/Chrome_OS_devices
>
> Anyway, I'm glad you're working on this, looking forward to testing it
> myself when I get the chance!

Great! I hope that the bootmeth can expand to be more useful over time.

Regards,
Simon



>
> > Simon Glass (16):
> >   bootstd: cros: Correct reporting of I/O errors
> >   bootstd: cros: Move partition reading into a function
> >   bootstd: cros: Bring in some ChromiumOS structures
> >   bootstd: cros: Support a kernel on either partition
> >   bootstd: cros: Decode some kernel preamble fields
> >   bootstd: cros: Simplify setup and cmdline expressions
> >   bootstd: Move common zimage functions to bootm.h
> >   bootstd: cros: Add docs for the kernel layout
> >   bootstd: cros: Add private info for ChromiumOS
> >   bootstd: Add private bootmeth data to the bootflow
> >   bootstd: cros: Add a function to read info from partition
> >   bootstd: cros: Add a function to read a kernel
> >   bootstd: cros: Split up reading info and kernel
> >   bootstd: Allow display of the x86 setup information
> >   bootstd: Add a command to read all files for a bootflow
> >   bootstd: cros: Add ARM support
> >
> >  arch/x86/include/asm/zimage.h |  37 ----
> >  arch/x86/lib/zimage.c         |   8 +-
> >  boot/Kconfig                  |   4 +-
> >  boot/bootflow.c               |  15 ++
> >  boot/bootm.c                  |  37 ++++
> >  boot/bootmeth-uclass.c        |  10 +
> >  boot/bootmeth_cros.c          | 363 ++++++++++++++++++++++++++++------
> >  boot/bootmeth_cros.h          | 197 ++++++++++++++++++
> >  cmd/bootflow.c                |  47 ++++-
> >  doc/usage/cmd/bootflow.rst    | 139 ++++++++++++-
> >  include/bootflow.h            |  15 +-
> >  include/bootm.h               |  47 +++++
> >  include/bootmeth.h            |  23 +++
> >  13 files changed, 836 insertions(+), 106 deletions(-)
> >  create mode 100644 boot/bootmeth_cros.h
> >


More information about the U-Boot mailing list