Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from phobos.denx.de (phobos.denx.de [85.214.62.61]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 0932DC001DF for ; Thu, 3 Aug 2023 21:32:03 +0000 (UTC) Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id BC0CB86792; Thu, 3 Aug 2023 23:32:01 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=u-boot-bounces@lists.denx.de Authentication-Results: phobos.denx.de; dkim=pass (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.b="Bw0Pzvqx"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id 95E1486A8C; Thu, 3 Aug 2023 23:32:00 +0200 (CEST) Received: from mail-wm1-x330.google.com (mail-wm1-x330.google.com [IPv6:2a00:1450:4864:20::330]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits)) (No client certificate requested) by phobos.denx.de (Postfix) with ESMTPS id 0E965866E1 for ; Thu, 3 Aug 2023 23:31:58 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=alpernebiyasak@gmail.com Received: by mail-wm1-x330.google.com with SMTP id 5b1f17b1804b1-3fbf1b82d9cso13647395e9.2 for ; Thu, 03 Aug 2023 14:31:58 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20221208; t=1691098317; x=1691703117; h=content-transfer-encoding:in-reply-to:from:references:cc:to :content-language:subject:user-agent:mime-version:date:message-id :from:to:cc:subject:date:message-id:reply-to; bh=beJvLTCTuci/n+iHklY6poi8hS3/ACXdUS3wwoPqTFc=; b=Bw0PzvqxwxD1Dg84I0RhEb0WQJwnfcAMFPvvcm/9fvgRkcDAiAj/ak4SnLwgu40lMT gqViIXaihQh61jP8mn3HbNHCEPZu7C9kf3EWhl0GQyUPvY6wUBa7ZdiV9ECUQRhZCgFH j5o85Deq2ay8DyfE3c2IKV8xbfPT7uZPSNlh9AmDTabubQZ3MpyVkLlkIDgZJa2Y2rUS 5DEkCnsn+8wgHzuhSArYRZDJxEju4LrdySqYdPo/b2eyKO0hIn7ZrFn1O6PYSd6odPJS jXYT0nwRC1x6wgdua74D0z+K+KSw9Y245Jv7+Hou45t6ijCT1A/I1YGvd3RbNhHZDdaS 3YZQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1691098317; x=1691703117; h=content-transfer-encoding:in-reply-to:from:references:cc:to :content-language:subject:user-agent:mime-version:date:message-id :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=beJvLTCTuci/n+iHklY6poi8hS3/ACXdUS3wwoPqTFc=; b=P/UliEg8DxbyOGH6D8QRZpraeTQr9JmBcFuzgadY+8joTzaL6uFo8zhy4XX93ktUdb N4aYOcpWlUOwpQHq1YKVUM+pQdwCJ3FeXVV+2amgPhoHsc9p8IVE0C6wADA8/VlZ1cpI KLY3jhZan3dxXjf4JyfYZMhnwh+3GOSyYR4M2BvkniggJXr58dWn1Y1tJmXIqDylyvs5 6uELMkmbia/cuYDty28rbeDxASAnmWMdUzDajW1lomNpSYYjk9EbWm+SiOG3v7WX9/E8 ZRM3z4n/ZBIONEpGmuijevUyKliG2h/2tRgDNXHKzamBza1NERdeIQDvvnG/hcG8mBdG Hf5A== X-Gm-Message-State: AOJu0YzZS8nntjUkdBlv9ZwATPMFkUy+MzJ7QKFDxlpCz1P7XjBqlg9C N3eyy/lgEsMEWA9mwFcqmwA= X-Google-Smtp-Source: AGHT+IEwjxEQXw7ojc2NYZmndomLPQz0ogGYN9DqlloHbuoCcSgf7oGL1rnxynmV9Dk476eORLcx3A== X-Received: by 2002:a05:600c:3795:b0:3fe:159d:422b with SMTP id o21-20020a05600c379500b003fe159d422bmr2061wmr.32.1691098317174; Thu, 03 Aug 2023 14:31:57 -0700 (PDT) Received: from [192.168.0.79] ([178.233.24.1]) by smtp.gmail.com with ESMTPSA id n12-20020adff08c000000b00317b5c8a4f1sm807449wro.60.2023.08.03.14.31.55 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Thu, 03 Aug 2023 14:31:56 -0700 (PDT) Message-ID: <0b60edb3-df58-1ff4-9087-2ed19dbbc11d@gmail.com> Date: Fri, 4 Aug 2023 00:31:54 +0300 MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: [PATCH 00/16] bootstd: Improve ChromiumOS support Content-Language: en-US, tr, en-GB To: Simon Glass , U-Boot Mailing List Cc: Bin Meng , Daniel Golle , Heinrich Schuchardt , Mattijs Korpershoek , =?UTF-8?Q?Pali_Roh=C3=A1r?= , Safae Ouajih References: <20230730171709.917352-1-sjg@chromium.org> From: Alper Nebi Yasak In-Reply-To: <20230730171709.917352-1-sjg@chromium.org> Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit X-BeenThere: u-boot@lists.denx.de X-Mailman-Version: 2.1.39 Precedence: list List-Id: U-Boot discussion List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: u-boot-bounces@lists.denx.de Sender: "U-Boot" X-Virus-Scanned: clamav-milter 0.103.8 at phobos.denx.de X-Virus-Status: Clean 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) - Fixup the ramdisk addr/size in x86 setup info after reading the kernel - Replace %U with chromeos_kernel PARTUUID (you probably already do?) - Prepend cros_secure to kernel cmdline 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/ > 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? 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! > 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 >