From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-5.8 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI, SPF_HELO_NONE,SPF_PASS autolearn=no autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 8931DC4338F for ; Mon, 23 Aug 2021 12:35:19 +0000 (UTC) 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 mail.kernel.org (Postfix) with ESMTPS id E563360FD9 for ; Mon, 23 Aug 2021 12:35:18 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.1 mail.kernel.org E563360FD9 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=linaro.org Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=lists.denx.de Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id 13D6183205; Mon, 23 Aug 2021 14:35:17 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=linaro.org 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=linaro.org header.i=@linaro.org header.b="vNnpklpK"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id 033C98320D; Mon, 23 Aug 2021 14:35:16 +0200 (CEST) Received: from mail-wm1-x32c.google.com (mail-wm1-x32c.google.com [IPv6:2a00:1450:4864:20::32c]) (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 78BBB81BCA for ; Mon, 23 Aug 2021 14:35:05 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=linaro.org Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=ilias.apalodimas@linaro.org Received: by mail-wm1-x32c.google.com with SMTP id m25-20020a7bcb99000000b002e751bcb5dbso1076702wmi.5 for ; Mon, 23 Aug 2021 05:35:05 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to; bh=ELQAiU6fV0De2TZhbMoe0tX4IzbfEBQBCdUZPKEDReU=; b=vNnpklpKhga6vjnjASA+HoJIcQe219M1AeNYm40ae8kyHwOE7It3JGDzV+9j0YYcZF CDIVg5Lp9sb68C1Fzx9Kq9SvRCO3C29GtVkmD8y5YyyvRL3GOvX8JOa7bx1GQwQUZ+ol pu39UKhMx2vxVNSQco4q93lOVGwHpjP7jyFvDPhibjgKyoLUL/xkBF9KgWK7K/A2d/HS cG4+t3FA+B3p85G3x1jFSHw5K0S4/c7oFfoith88yHCdujk2HaVZ2DGhDMgThgVqS8VU BziSuDiSGjQR7L1Mfuvw11fvb4fRg12o4cg/+Ao+RWM/ItMTPyXJ0+ruNOPG8l6MGQfr g+DA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to; bh=ELQAiU6fV0De2TZhbMoe0tX4IzbfEBQBCdUZPKEDReU=; b=e7KbEsLT/xKm9BBJtAenaN0Y0h58JpHRaivQXRzCmhw000PPGAweDX+Gf5vPGd9cG5 pX/J5s4bjPhBoPUqn8JR5nWYIl1TvovQJR/qjmr5+mlUgwvJK83n+vy96iXx55ZrZvOh CXPkQ0KwaZUrVbotpYi9IjvPGI3HmOW43zkHp8P24OKMkEjUyIU3L7hQ5lIAixuMWKJN +u9NpQttqSExlTzV3C0iq0TTPXpZh3BS6WffbxMsv2ySxtzVvxK7Zs4NixHiaFYvTAZY dwBsI9hUosokp9DH2A5pIPICsCAw3aWDzmpuofUhvh9kK3/IJQ26go7TP62dqrpdfFG3 PjBw== X-Gm-Message-State: AOAM530rcKsVQinpiuv6kiaKlTWkdj5V7AEGIkwOXh6GjWXB5xeK+s/C 4xUJbHHN3b68fiBgxjGNFwGflg== X-Google-Smtp-Source: ABdhPJxRfF40y0TaiHCZJehkAzkFP15H2T5a2q/k7SGtJEUopBiol+Sr/I2+5K2EOD3bDH+jF7IlWQ== X-Received: by 2002:a7b:c8ca:: with SMTP id f10mr15920197wml.140.1629722104213; Mon, 23 Aug 2021 05:35:04 -0700 (PDT) Received: from enceladus (ppp-94-66-247-68.home.otenet.gr. [94.66.247.68]) by smtp.gmail.com with ESMTPSA id l9sm14772154wrt.95.2021.08.23.05.35.02 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 23 Aug 2021 05:35:03 -0700 (PDT) Date: Mon, 23 Aug 2021 15:35:01 +0300 From: Ilias Apalodimas To: Tom Rini Cc: Simon Glass , U-Boot Mailing List , Steffen Jaeckel , Michal Simek , Dennis Gilmore , Daniel Schwierzeck , Lukas Auer , Jaehoon Chung , Matthias Brugger , Peng Fan , Stephen Warren , Stephen Warren Subject: Re: [PATCH 00/28] Initial implementation of bootmethod/bootflow Message-ID: References: <20210819034601.1618773-1-sjg@chromium.org> <20210819135944.GX858@bill-the-cat> <20210819172750.GB858@bill-the-cat> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20210819172750.GB858@bill-the-cat> X-BeenThere: u-boot@lists.denx.de X-Mailman-Version: 2.1.34 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.2 at phobos.denx.de X-Virus-Status: Clean On Thu, Aug 19, 2021 at 01:27:50PM -0400, Tom Rini wrote: > On Thu, Aug 19, 2021 at 08:25:33AM -0600, Simon Glass wrote: > > Hi Tom, > > > > On Thu, 19 Aug 2021 at 07:59, Tom Rini wrote: > > > > > > On Wed, Aug 18, 2021 at 09:45:33PM -0600, Simon Glass wrote: > > > > > > > Bootmethod and bootflow provide a built-in way for U-Boot to automatically boot > > > > an Operating System without custom scripting and other customisation: > > > > > > > > - bootmethod - a method to scan a device to find bootflows (owned by U-Boot) > > > > - bootflow - a description of how to boot (owned by the distro) > > > > > > > > This series provides an initial implementation of these, enable to scan > > > > for bootflows from MMC and Ethernet. The only bootflow supported is > > > > distro boot, i.e. an extlinux.conf file included on a filesystem or > > > > tftp server. It works similiarly to the existing script-based approach, > > > > but is native to U-Boot. > > > > > > > > With this we can boot on a Raspberry Pi 3 with just one command: > > > > > > > > bootflow scan -lb > > > > > > > > which means to scan, listing (-l) each bootflow and trying to boot each > > > > one (-b). The final patch shows this. > > > > > > > > It is intended that this approach be expanded to support mechanisms other > > > > than distro boot, including EFI-related ones. With a standard way to > > > > identify boot devices, these features become easier. It also should > > > > support U-Boot scripts, for backwards compatibility only. > > > > > > > > The first patch of this series moves boot-related code out of common/ and > > > > into a new boot/ directory. This helps to collect these related files > > > > in one place, as common/ is quite large. > > > > > > > > Like sysboot, this feature makes use of the existing PXE implementation. > > > > Much of this series consists of cleaning up that code and refactoring it > > > > into something closer to a module that can be called, teasing apart its > > > > reliance on the command-line interpreter to access filesystems and the > > > > like. Also it now uses function arguments and its own context struct > > > > internally rather than environment variables, which is very hard to > > > > follow. No core functional change is included in the included PXE patches. > > > > > > > > For documentation, see the 'doc' patch. > > > > > > > > There is quite a long list of future work included in the documentation. > > > > One question is the choice of naming. Since this is a bootloader, should > > > > we just call this a 'method' and a 'flow' ? The 'boot' prefix is already > > > > shared by other commands like bootm, booti, etc. > > > > > > > > The design is described here: > > > > > > > > https://drive.google.com/file/d/1ggW0KJpUOR__vBkj3l61L2dav4ZkNC12/view?usp=sharing > > > > > > > > The series is available at u-boot-dm/bmea-working > > > > > > My question / concern is this. Would the next step here be to > > > implement the generic UEFI boot path? Today, I can write Fedora 34 for > > > AArch64 to a USB stick, boot U-Boot off of uSD card and the installer > > > automatically boots. I'm sure I could do the same with the BSDs. > > > Reading the documentation left me with the impression that every OSV > > > would be expected to write something, so that their installer / OS boot. > > > But there's already standards for that, which they do, and we should be > > > implementing (and do, via the current distro_boot) or making easier to > > > enable. Thanks! > > > > Here you are talking about scanning for a bootflow. It is not actually > > OS-specific. If it were, there would be no point to this :-) > > > > If you look in the distro scripts you will see 'scan_dev_for_efi' (and > > also scan_dev_for_scrips). At least the first needs to be implemented > > a bit like the distro boot is at present. So far I have only > > implemented scan_dev_for_extlinux (plus pxe) as it is enough to show > > the concept. > > > > Adding EFI it's likely to be about the same amount of code as distro.c > > at present, perhaps a little less since we don't have the network > > case. It is used by Fedora 34, I believe, so is easy enough for me to > > do. But I wanted to get something out as the concept is visible in > > this series. > > OK, good. I'd certainly like to see how this looks with EFI added. > What would be the order preference after scanning? Keep in mind that our efibootmgr is pretty complete wrt to booting. It can even support booting multiple OS'es without GRUB2 (even loading different initrds is supported). Ideally (and assuming we want to support EFI booting for more devices), I would map existing extlinux configs into efibootmgr entries. Regards /Ilias > -- > Tom