From patchwork Mon Jan 20 10:50:40 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sughosh Ganu X-Patchwork-Id: 858757 Delivered-To: patch@linaro.org Received: by 2002:a05:6000:cc8:b0:385:e875:8a9e with SMTP id dq8csp1859429wrb; Mon, 20 Jan 2025 02:51:11 -0800 (PST) X-Forwarded-Encrypted: i=2; AJvYcCV5DqFO3hJdZhvaNtaZydAYzpNqn9Zz479HFPVwAzP5s3tUV0D2o/ZN6/D1RX7SktYPwOy9kQ==@linaro.org X-Google-Smtp-Source: AGHT+IHLSqM5Ezsavg7aocAShfVzqYP2eH8alJlVf9MUqDzf9cbwcOCENz53vkI92dVw4wxXltv8 X-Received: by 2002:a5d:6c61:0:b0:386:3bde:9849 with SMTP id ffacd0b85a97d-38bec4fb909mr14778872f8f.12.1737370271361; Mon, 20 Jan 2025 02:51:11 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1737370271; cv=none; d=google.com; s=arc-20240605; b=kFpd8HQ/Nk+7zbM5uZaOVnpcB4Kz726yampAO8vmddK1/qTLGoBG6ue/5mYrhXD7rN k06e0cqYHMJHy66zJNImKXxSGCOMDTYT/wql11GNRK7FVC159V/j6wcTJqYaGbcl3QzL kdmOyae9yadHb5EBfWCOC4qp5rj4iJLgRWzlqn3O+q8+krHkAPfW13TqiziqBW7ama+s zl4FEAgMatsVM3fqiCI1lR7EjTRwAbYIzbzGeNrX388lwatgsPCVvQlkEUbsT11/DVCd KcasXUJ67ZTGndXN9ufGnUFY0TvvzgV5+QFJ/Z7BabvRDTZiQwp2533EuZObP6kYaSnc hJOA== 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=OqEYi/34cdVHC2JZ/jIEkuaOI5t4uXnl2TGN0n+Wn80=; fh=wsCyNOKiPi2cbAnd4C0ATc+aVai2WcbB+Mi/b3s2974=; b=VfWF45992urkKfOu2AUPgolVtYS2JZWW6GN3RjF+TL6TE62kRY0v3W8YtB2/wOVaOE E27Cc5hGTD26Gb8gnOsFbONlAocYZC/hsxtnfakSFpxII34e1o74VgUWUmuNMNbU91MM CayzlRQ3cFi66+MfR+0iMERhgJCTia9KPBP1l0ZqHBzrHcHwdHjc3/FX6pRoU9utGJkG bHQRoJey2xtBx99X9GDOIFQ82L9dDS5E+JsPSvix0G+F/As/4O1G5nseXakdrL2PlWew DYXj9ifxS8cN+TbpF7eEDVPdewhptNZdolreEuv2ameJUCy0zh9AUlCfz7SdoVwWvUNE dvSQ==; dara=google.com ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of u-boot-bounces@lists.denx.de designates 85.214.62.61 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. [85.214.62.61]) by mx.google.com with ESMTPS id ffacd0b85a97d-38bf329207csi5962171f8f.763.2025.01.20.02.51.10 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 20 Jan 2025 02:51:11 -0800 (PST) Received-SPF: pass (google.com: domain of u-boot-bounces@lists.denx.de designates 85.214.62.61 as permitted sender) client-ip=85.214.62.61; Authentication-Results: mx.google.com; spf=pass (google.com: domain of u-boot-bounces@lists.denx.de designates 85.214.62.61 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 EE9EE805C5; Mon, 20 Jan 2025 11:51:09 +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 665BC801CF; Mon, 20 Jan 2025 11:51:08 +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_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 45A0C80077 for ; Mon, 20 Jan 2025 11:51:06 +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 07D4E106F; Mon, 20 Jan 2025 02:51:34 -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 DC8B63F740; Mon, 20 Jan 2025 02:51:02 -0800 (PST) From: Sughosh Ganu To: u-boot@lists.denx.de Cc: Heinrich Schuchardt , Ilias Apalodimas , Simon Glass , Tom Rini , Anton Antonov , Tobias Waldekranz , Bin Meng Subject: [PATCH v3 0/5] Add pmem node for preserving distro ISO's Date: Mon, 20 Jan 2025 16:20:40 +0530 Message-Id: <20250120105045.1281262-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. The earlier version had aligned the addition of pmem nodes with the EFI HTTP boot feature. This has been changed, based on a review comment from Heinrich to instead be done by looping through the memory based blkmamp devices. Changes since V2: * Fix a checkpatch error for putting a blank line after a function * Use blkmap device based scanning for adding the pmem nodes 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 (2): blkmap: store type of blkmap device in corresponding structure blkmap: add pmem nodes for blkmap mem mapping devices boot/fdt_support.c | 40 ++++++++++++- boot/image-fdt.c | 9 +++ cmd/blkmap.c | 16 ++++-- drivers/block/blkmap.c | 90 +++-------------------------- drivers/block/blkmap_helper.c | 47 +++++++++++++++- include/blkmap.h | 103 +++++++++++++++++++++++++++++++++- include/efi_loader.h | 11 ++-- include/fdt_support.h | 13 +++++ lib/efi_loader/efi_bootmgr.c | 22 ++++++-- lib/efi_loader/efi_memory.c | 51 ++++++++++++----- lib/lmb.c | 4 +- test/dm/blkmap.c | 16 +++--- 12 files changed, 302 insertions(+), 120 deletions(-)