From patchwork Fri Oct 25 11:14:07 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sughosh Ganu X-Patchwork-Id: 838334 Delivered-To: patch@linaro.org Received: by 2002:adf:e287:0:b0:37d:45d0:187 with SMTP id v7csp210528wri; Fri, 25 Oct 2024 04:15:01 -0700 (PDT) X-Forwarded-Encrypted: i=2; AJvYcCW8mD1MpJm9ebGM1opwZbrLm1UhbbkwQdKgLsQyy+t2pXrCMwwCQ7IntGDdnX33TM+evV0Yuw==@linaro.org X-Google-Smtp-Source: AGHT+IHs8Kz4JCpyKjG+pgmwyRvupcgWyd1D+3rtHhjXbejFp1aEh2fiTtMD2XaSwGd3+fNyBi/h X-Received: by 2002:a05:6512:224f:b0:539:f496:aa88 with SMTP id 2adb3069b0e04-53b1a3a18cfmr4776920e87.53.1729854900825; Fri, 25 Oct 2024 04:15:00 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1729854900; cv=none; d=google.com; s=arc-20240605; b=GKwrQdKsXdsPxlUM3oIzPnvlj+3VmnpAwrd5Id/2P4rV6bgiVqbDgVCt1sdaFa9Mpl lBZNmvc5MureR5LOOQgqM4nbUQGSbspFq/DoctsRzZa4qY+qWyWTRo8/vVg9MqaB4oJq KJDOrdOch7n7k0yJ8nQEZr8RElI+l9aUMxtyMV1+O6R3DGUC59LTPJBYbZB3k1P1rvR3 1VR+2ndqUVR1oGUL1GhAxQizvIXp9PYIxMB+f7w9tbkyPpfL69LpY8NXy4Jl+T182xJI 6YQVv5bF1kcK3h/Ow7DAsGXRHiAuLrRe+gg5Ez4ntW6Hb5PgKpcnnWn8p4NAZMhJ2Cve 4p5g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20240605; h=sender:errors-to:list-subscribe:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:content-transfer-encoding :mime-version:message-id:date:subject:cc:to:from; bh=gEWbp7HvCXoY1+sbHCYf8C/dg0ChuDXvW8g0SrHBB9Q=; fh=m+bK4t1Qbr6XpaKIBzD8XLBDMcrHW9Sduj+azVvRzFg=; b=BbcxA4FkUqN7Ze6GdVQBDlU/zW+QYbKTD3/4FPL1JwpLOaApe67G7TYQ0q7QZHgQI2 ZXoLnB8g7qOmyliKSeNwBFfLAAZFQvhp+0VoP8MQbsyJJYs400QPCJRL6Ngalk+NVIaC FzmtdKhjy0VrGar8nIsCsi/EDEWObkga+t2jXUiuBeNBfxmH2AWKswjLmZNZQ8ftI97I ain3j191xuTszeiO2CZKzuT90980HSyy4sW+/QH3oGiE4/B2zoaPyDdP86US7Umx2QNd HoXQJ29LoHjl5odXccO+sV0PcR+0BTPplPcFWfwbbPHqbD9duxgQWqmEcdMMGd+fTLRx r40g==; dara=google.com ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of u-boot-bounces@lists.denx.de designates 2a01:238:438b:c500:173d:9f52:ddab:ee01 as permitted sender) smtp.mailfrom=u-boot-bounces@lists.denx.de; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from phobos.denx.de (phobos.denx.de. [2a01:238:438b:c500:173d:9f52:ddab:ee01]) by mx.google.com with ESMTPS id 2adb3069b0e04-53b2e20738dsi328020e87.597.2024.10.25.04.15.00 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 25 Oct 2024 04:15:00 -0700 (PDT) Received-SPF: pass (google.com: domain of u-boot-bounces@lists.denx.de designates 2a01:238:438b:c500:173d:9f52:ddab:ee01 as permitted sender) client-ip=2a01:238:438b:c500:173d:9f52:ddab:ee01; Authentication-Results: mx.google.com; spf=pass (google.com: domain of u-boot-bounces@lists.denx.de designates 2a01:238:438b:c500:173d:9f52:ddab:ee01 as permitted sender) smtp.mailfrom=u-boot-bounces@lists.denx.de; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id 3138188DFE; Fri, 25 Oct 2024 13:14:54 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=fail (p=none dis=none) header.from=linaro.org Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=u-boot-bounces@lists.denx.de Received: by phobos.denx.de (Postfix, from userid 109) id 8F9D988F95; Fri, 25 Oct 2024 13:14:53 +0200 (CEST) X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on phobos.denx.de X-Spam-Level: X-Spam-Status: No, score=-1.2 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_BLOCKED,RCVD_IN_VALIDITY_RPBL_BLOCKED, RCVD_IN_VALIDITY_SAFE_BLOCKED,SPF_HELO_NONE,SPF_SOFTFAIL autolearn=no autolearn_force=no version=3.4.2 Received: from foss.arm.com (foss.arm.com [217.140.110.172]) by phobos.denx.de (Postfix) with ESMTP id AAC3988BEF for ; Fri, 25 Oct 2024 13:14:47 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=fail (p=none dis=none) header.from=linaro.org Authentication-Results: phobos.denx.de; spf=fail smtp.mailfrom=sughosh.ganu@linaro.org Received: from usa-sjc-imap-foss1.foss.arm.com (unknown [10.121.207.14]) by usa-sjc-mx-foss1.foss.arm.com (Postfix) with ESMTP id 9EF8B339; Fri, 25 Oct 2024 04:15:16 -0700 (PDT) Received: from a079122.blr.arm.com (a079122.arm.com [10.162.17.48]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id 50CA33F73B; Fri, 25 Oct 2024 04:14:45 -0700 (PDT) From: Sughosh Ganu To: u-boot@lists.denx.de Cc: Ilias Apalodimas , Heinrich Schuchardt , Tom Rini Subject: [PATCH 0/4] Add pmem node for preserving distro ISO's Date: Fri, 25 Oct 2024 16:44:07 +0530 Message-Id: <20241025111411.165904-1-sughosh.ganu@linaro.org> X-Mailer: git-send-email 2.34.1 MIME-Version: 1.0 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 When installing a distro via EFI HTTP boot some OS installers expect the .iso image to be preserved and treat it as a "CDROM" to install packages. This is problematic in EFI, since U-Boot mounts the image, starts the installer, and eventually calls ExitBootServices. At that point the image U-Boot mounted disappears. Some distros don't care and download the missing packages from a web archive, while others halt the installation complaining they can't find certain packages. If the firmware uses ACPI, this is supported by using NFIT which provides NVDIMM ramdisks to the OS and preserves the image. We don't have anything in place for Device Trees though. Since DT supports persistent memory nodes (pmem) use those and preserve the .iso for installers. The issue can be reproduced by attempting an EFI HTTP boot with Ubuntu live server ISO, or a Rocky Linux ISO. The installation would fail with the failure to locate certain packages. Ilias Apalodimas (2): efi_loader: add a function to remove memory from the EFI map efi_loader: preserve installer images in pmem Masahisa Kojima (1): fdt: add support for adding pmem nodes Sughosh Ganu (1): efi: add helper functions to insert pmem node for DT fixup boot/fdt_support.c | 41 +++++++++++++++++++++++++++-- boot/image-fdt.c | 9 +++++++ include/efi_loader.h | 28 +++++++++++++++++--- include/fdt_support.h | 13 +++++++++ lib/efi_loader/efi_bootmgr.c | 43 ++++++++++++++++++++++++++---- lib/efi_loader/efi_helper.c | 12 +++++++++ lib/efi_loader/efi_memory.c | 51 +++++++++++++++++++++++++++--------- lib/lmb.c | 4 +-- 8 files changed, 175 insertions(+), 26 deletions(-)