From patchwork Tue Dec 3 16:36:01 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sughosh Ganu X-Patchwork-Id: 846963 Delivered-To: patch@linaro.org Received: by 2002:a5d:44cd:0:b0:385:e875:8a9e with SMTP id z13csp595582wrr; Tue, 3 Dec 2024 08:36:28 -0800 (PST) X-Forwarded-Encrypted: i=2; AJvYcCW9SQLGcakLHQBMVyPja25bhzxqOpSDkFh6ycz7WqBfy5GWa1bZy3u+1827DVis3PVXv8ojaw==@linaro.org X-Google-Smtp-Source: AGHT+IHZh2Vvs7sWSER42GF1vobYtiC1wXmmIbDDCmzIHZzdQXPWifCImsVwJxBMQbotw4mbmT4J X-Received: by 2002:a17:906:cc9:b0:a99:e939:d69e with SMTP id a640c23a62f3a-aa5f7f35a67mr230644366b.51.1733243787990; Tue, 03 Dec 2024 08:36:27 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1733243787; cv=none; d=google.com; s=arc-20240605; b=JUtRLSXNa61GabhkyDH0W7MxbQjBZgfTzo8VjQrx43ZcMw5Lfn1Fwg1eJb2D/Q+xZe Q5MoI+UIKfNq8Y0yoKRnFSmurSdEMee8ddyPwOCI4t14RdTi8j56+9tDb2+g1HJNznNJ qv0Uj58gkNAwMaNR4YYMHqId87FweB1Wm/Xk/v6QAeQavdpCgc9we3+kFHEDSdaAYPJt 9sPquSPU2dPlDK+Buig2DMTIMNZRtsr/it2uObiGvDBlqBnEO8iQOPeO0xyoeD6SUcOi mP9OCUsiSzAQYQLlMCVfCXzCjRYi8/PKyM/GKwRWmoR5YjjH+HZ5dlLOo926My5a7UME ai6A== 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=GW9g2IRf/wOlB01Q8cAp90jebE6vImFsf8oNBQEjm1g=; fh=9YWzY1ytMJs77fdwT/f5mf8dh/rsyjrJINQh3jGWmiY=; b=gBtLtDYdII4ACq22Xxmr+6sEQu+9xJ9UuxHk9uJu9OQ7llTBuI+PwnDMyXt18dDLoG 3GGo87PSvdSPh6fU21KENe1OfyuQn9vN2jcxNGY+Uuo8yzhWbXXED5wuE332f+pxBQcz WnNJOc9LAWQ/H5B70Nob7mbP2yMUdulR2GEWp+U+PoUXDsyHiwIA4oVxPoyRfRiGLFpH l+Qt6Qr3ta5XNJR+OkcDvG+mX5XDWbSIw7N469xwMc3DYqh8NCbNU/5KncpGktnUhouo L4xqKz0Ke7DUNLbr9v8wvASxlfMXX+zmIsPfq/Xw5UrakyCOjIZ8gDnCbOVVGhpbDnGU az+Q==; 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 a640c23a62f3a-aa59997379esi875256466b.838.2024.12.03.08.36.20 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 03 Dec 2024 08:36:27 -0800 (PST) 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 45B4D893E6; Tue, 3 Dec 2024 17:36:20 +0100 (CET) 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 5795B893E6; Tue, 3 Dec 2024 17:36:19 +0100 (CET) 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_CERTIFIED_BLOCKED, RCVD_IN_VALIDITY_RPBL_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 34BBF893A9 for ; Tue, 3 Dec 2024 17:36:17 +0100 (CET) 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 8A549FEC; Tue, 3 Dec 2024 08:36:44 -0800 (PST) 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 7C62D3F71E; Tue, 3 Dec 2024 08:36:14 -0800 (PST) From: Sughosh Ganu To: u-boot@lists.denx.de Cc: Heinrich Schuchardt , Ilias Apalodimas , Masahisa Kojima , Anton Antonov , Tom Rini Subject: [PATCH v2 0/4] Add pmem node for preserving distro ISO's Date: Tue, 3 Dec 2024 22:06:01 +0530 Message-Id: <20241203163605.1482152-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. Changes since V1: * s/ommit/remove in the commit message * s/rfom/from in the commit message * Add a period at the end of the sentence in the commit message * Use log_err() to print the error message in image_setup_libfdt() * Remove "ERROR:" from the error print in image_setup_libfdt() 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(-)