mbox series

[v4,0/5] Add pmem node for preserving distro ISO's

Message ID 20250203105912.196654-1-sughosh.ganu@linaro.org
Headers show
Series Add pmem node for preserving distro ISO's | expand

Message

Sughosh Ganu Feb. 3, 2025, 10:59 a.m. UTC
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 V3:
* Rephrased the 2MiB alignment error message as suggested by Heinrich
* Rephrased the description of fdt_fixup_pmem_region() function as
  suggested by Heinrich
* Add the map type to the blkmap slice instead of the entire blkmap
  device
* Move the definition of the helper function to the efi_helper.c
* Remove the region of the blkmap mem map device from the EFI memory
  map along with adding the pmem node



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 slice in corresponding structure
  blkmap: add pmem nodes for blkmap memory mapped slices

 boot/fdt_support.c           | 41 ++++++++++++++++-
 boot/image-fdt.c             |  9 ++++
 drivers/block/blkmap.c       | 82 +--------------------------------
 include/blkmap.h             | 87 ++++++++++++++++++++++++++++++++++++
 include/efi.h                | 13 ++++++
 include/efi_loader.h         | 11 +++--
 include/fdt_support.h        | 14 ++++++
 lib/efi_loader/efi_bootmgr.c | 22 ++++++---
 lib/efi_loader/efi_helper.c  | 52 +++++++++++++++++++++
 lib/efi_loader/efi_memory.c  | 51 +++++++++++++++------
 lib/lmb.c                    |  4 +-
 11 files changed, 281 insertions(+), 105 deletions(-)