[PATCH v2 0/4] Add pmem node for preserving distro ISO's

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(-)

From: Masahisa Kojima kojima.masahisa@socionext.com
One of the problems OS installers face, when running in EFI, is that the mounted ISO after calling ExitBootServices goes away. For some distros this is a problem since they rely on finding some core packages before continuing the installation. Distros have works around this -- e.g Fedora has a special kernel command line parameter called inst.stage2 [0].
ACPI has NFIT and NVDIMM support to provide ramdisks to the OS, but we don't have anything in place for DTs. Linux and device trees have support for persistent memory devices. So add a function that can inject a pmem node in a DT, so we can use it when launhing OS installers with EFI.
[0] https://docs.redhat.com/en/documentation/red_hat_enterprise_linux/7/html/ins...
Signed-off-by: Masahisa Kojima kojima.masahisa@socionext.com Signed-off-by: Sughosh Ganu sughosh.ganu@linaro.org --- Changes since V1: None
boot/fdt_support.c | 41 +++++++++++++++++++++++++++++++++++++++-- include/fdt_support.h | 13 +++++++++++++ 2 files changed, 52 insertions(+), 2 deletions(-)
diff --git a/boot/fdt_support.c b/boot/fdt_support.c index 2392027d40b..61f725389b7 100644 --- a/boot/fdt_support.c +++ b/boot/fdt_support.c @@ -18,6 +18,7 @@ #include <dm/ofnode.h> #include <linux/ctype.h> #include <linux/types.h> +#include <linux/sizes.h> #include <asm/global_data.h> #include <asm/unaligned.h> #include <linux/libfdt.h> @@ -463,7 +464,6 @@ void do_fixup_by_compat_u32(void *fdt, const char *compat, do_fixup_by_compat(fdt, compat, prop, &tmp, 4, create); }
-#ifdef CONFIG_ARCH_FIXUP_FDT_MEMORY /* * fdt_pack_reg - pack address and size array into the "reg"-suitable stream */ @@ -491,7 +491,7 @@ static int fdt_pack_reg(const void *fdt, void *buf, u64 *address, u64 *size,
return p - (char *)buf; } - +#ifdef CONFIG_ARCH_FIXUP_FDT_MEMORY #if CONFIG_NR_DRAM_BANKS > 4 #define MEMORY_BANKS_MAX CONFIG_NR_DRAM_BANKS #else @@ -2221,3 +2221,40 @@ int fdt_valid(struct fdt_header **blobp) } return 1; } + +int fdt_fixup_pmem_region(void *blob, ulong addr, u32 size) +{ + u64 pmem_start[2] = { 0 }; + u64 pmem_size[2] = { 0 }; + char pmem_node[32] = {0}; + int nodeoffset, len; + int err; + u8 tmp[4 * 16]; /* Up to 64-bit address + 64-bit size */ + + if (!IS_ALIGNED(addr, SZ_2M) || !IS_ALIGNED(addr + size, SZ_2M)) { + printf("Start and end address needs at 2MB alignment\n"); + return -1; + } + snprintf(pmem_node, sizeof(pmem_node), "pmem@%lx", addr); + nodeoffset = fdt_find_or_add_subnode(blob, 0, pmem_node); + if (nodeoffset < 0) + return nodeoffset; + + err = fdt_setprop_string(blob, nodeoffset, "compatible", "pmem-region"); + if (err) + return err; + err = fdt_setprop_empty(blob, nodeoffset, "volatile"); + if (err) + return err; + pmem_start[0] = addr; + pmem_size[0] = size; + len = fdt_pack_reg(blob, tmp, pmem_start, pmem_size, 1); + err = fdt_setprop(blob, nodeoffset, "reg", tmp, len); + if (err < 0) { + printf("WARNING: could not set pmem %s %s.\n", "reg", + fdt_strerror(err)); + return err; + } + + return 0; +} diff --git a/include/fdt_support.h b/include/fdt_support.h index 9447a64e060..980feb27d27 100644 --- a/include/fdt_support.h +++ b/include/fdt_support.h @@ -474,4 +474,17 @@ void fdt_fixup_pstore(void *blob); */ int fdt_kaslrseed(void *blob, bool overwrite);
+/** + * fdt_fixup_pmem_region() - add a pmem node on the device tree + * + * This functions injects a pmem node to the device tree. Usually + * used with EFI installers to preserve installer images + * + * @blob: device tree provided by caller + * @addr: start address of the pmem node + * @size: size of the memory of the pmem node + * Return: 0 on success or < 0 on failure + */ +int fdt_fixup_pmem_region(void *blob, ulong addr, u32 size); + #endif /* ifndef __FDT_SUPPORT_H */

Hi Sughosh,
On Tue, 3 Dec 2024 at 09:36, Sughosh Ganu sughosh.ganu@linaro.org wrote:
From: Masahisa Kojima kojima.masahisa@socionext.com
One of the problems OS installers face, when running in EFI, is that the mounted ISO after calling ExitBootServices goes away. For some distros this is a problem since they rely on finding some core packages before continuing the installation. Distros have works around this -- e.g Fedora has a special kernel command line parameter called inst.stage2 [0].
ACPI has NFIT and NVDIMM support to provide ramdisks to the OS, but we don't have anything in place for DTs. Linux and device trees have support for persistent memory devices. So add a function that can inject a pmem node in a DT, so we can use it when launhing OS installers with EFI.
[0] https://docs.redhat.com/en/documentation/red_hat_enterprise_linux/7/html/ins...
Signed-off-by: Masahisa Kojima kojima.masahisa@socionext.com Signed-off-by: Sughosh Ganu sughosh.ganu@linaro.org
Changes since V1: None
boot/fdt_support.c | 41 +++++++++++++++++++++++++++++++++++++++-- include/fdt_support.h | 13 +++++++++++++ 2 files changed, 52 insertions(+), 2 deletions(-)
diff --git a/boot/fdt_support.c b/boot/fdt_support.c index 2392027d40b..61f725389b7 100644 --- a/boot/fdt_support.c +++ b/boot/fdt_support.c @@ -18,6 +18,7 @@ #include <dm/ofnode.h> #include <linux/ctype.h> #include <linux/types.h> +#include <linux/sizes.h> #include <asm/global_data.h> #include <asm/unaligned.h> #include <linux/libfdt.h> @@ -463,7 +464,6 @@ void do_fixup_by_compat_u32(void *fdt, const char *compat, do_fixup_by_compat(fdt, compat, prop, &tmp, 4, create); }
-#ifdef CONFIG_ARCH_FIXUP_FDT_MEMORY /*
- fdt_pack_reg - pack address and size array into the "reg"-suitable stream
*/ @@ -491,7 +491,7 @@ static int fdt_pack_reg(const void *fdt, void *buf, u64 *address, u64 *size,
return p - (char *)buf;
}
+#ifdef CONFIG_ARCH_FIXUP_FDT_MEMORY #if CONFIG_NR_DRAM_BANKS > 4 #define MEMORY_BANKS_MAX CONFIG_NR_DRAM_BANKS #else @@ -2221,3 +2221,40 @@ int fdt_valid(struct fdt_header **blobp) } return 1; }
+int fdt_fixup_pmem_region(void *blob, ulong addr, u32 size) +{
u64 pmem_start[2] = { 0 };
u64 pmem_size[2] = { 0 };
char pmem_node[32] = {0};
int nodeoffset, len;
int err;
u8 tmp[4 * 16]; /* Up to 64-bit address + 64-bit size */
if (!IS_ALIGNED(addr, SZ_2M) || !IS_ALIGNED(addr + size, SZ_2M)) {
printf("Start and end address needs at 2MB alignment\n");
return -1;
}
snprintf(pmem_node, sizeof(pmem_node), "pmem@%lx", addr);
nodeoffset = fdt_find_or_add_subnode(blob, 0, pmem_node);
if (nodeoffset < 0)
return nodeoffset;
err = fdt_setprop_string(blob, nodeoffset, "compatible", "pmem-region");
if (err)
return err;
err = fdt_setprop_empty(blob, nodeoffset, "volatile");
if (err)
return err;
I believe I asked this already, but is it possible to use the ofnode interface, instead of adding more and more code which we need to migrate later?
pmem_start[0] = addr;
pmem_size[0] = size;
len = fdt_pack_reg(blob, tmp, pmem_start, pmem_size, 1);
err = fdt_setprop(blob, nodeoffset, "reg", tmp, len);
if (err < 0) {
printf("WARNING: could not set pmem %s %s.\n", "reg",
fdt_strerror(err));
return err;
}
return 0;
+} diff --git a/include/fdt_support.h b/include/fdt_support.h index 9447a64e060..980feb27d27 100644 --- a/include/fdt_support.h +++ b/include/fdt_support.h @@ -474,4 +474,17 @@ void fdt_fixup_pstore(void *blob); */ int fdt_kaslrseed(void *blob, bool overwrite);
+/**
- fdt_fixup_pmem_region() - add a pmem node on the device tree
- This functions injects a pmem node to the device tree. Usually
- used with EFI installers to preserve installer images
- @blob: device tree provided by caller
- @addr: start address of the pmem node
- @size: size of the memory of the pmem node
- Return: 0 on success or < 0 on failure
- */
+int fdt_fixup_pmem_region(void *blob, ulong addr, u32 size);
#endif /* ifndef __FDT_SUPPORT_H */
2.34.1
Regards, Simon

On Wed, 4 Dec 2024 at 01:15, Simon Glass sjg@chromium.org wrote:
Hi Sughosh,
On Tue, 3 Dec 2024 at 09:36, Sughosh Ganu sughosh.ganu@linaro.org wrote:
From: Masahisa Kojima kojima.masahisa@socionext.com
One of the problems OS installers face, when running in EFI, is that the mounted ISO after calling ExitBootServices goes away. For some distros this is a problem since they rely on finding some core packages before continuing the installation. Distros have works around this -- e.g Fedora has a special kernel command line parameter called inst.stage2 [0].
ACPI has NFIT and NVDIMM support to provide ramdisks to the OS, but we don't have anything in place for DTs. Linux and device trees have support for persistent memory devices. So add a function that can inject a pmem node in a DT, so we can use it when launhing OS installers with EFI.
[0] https://docs.redhat.com/en/documentation/red_hat_enterprise_linux/7/html/ins...
Signed-off-by: Masahisa Kojima kojima.masahisa@socionext.com Signed-off-by: Sughosh Ganu sughosh.ganu@linaro.org
Changes since V1: None
boot/fdt_support.c | 41 +++++++++++++++++++++++++++++++++++++++-- include/fdt_support.h | 13 +++++++++++++ 2 files changed, 52 insertions(+), 2 deletions(-)
diff --git a/boot/fdt_support.c b/boot/fdt_support.c index 2392027d40b..61f725389b7 100644 --- a/boot/fdt_support.c +++ b/boot/fdt_support.c @@ -18,6 +18,7 @@ #include <dm/ofnode.h> #include <linux/ctype.h> #include <linux/types.h> +#include <linux/sizes.h> #include <asm/global_data.h> #include <asm/unaligned.h> #include <linux/libfdt.h> @@ -463,7 +464,6 @@ void do_fixup_by_compat_u32(void *fdt, const char *compat, do_fixup_by_compat(fdt, compat, prop, &tmp, 4, create); }
-#ifdef CONFIG_ARCH_FIXUP_FDT_MEMORY /*
- fdt_pack_reg - pack address and size array into the "reg"-suitable stream
*/ @@ -491,7 +491,7 @@ static int fdt_pack_reg(const void *fdt, void *buf, u64 *address, u64 *size,
return p - (char *)buf;
}
+#ifdef CONFIG_ARCH_FIXUP_FDT_MEMORY #if CONFIG_NR_DRAM_BANKS > 4 #define MEMORY_BANKS_MAX CONFIG_NR_DRAM_BANKS #else @@ -2221,3 +2221,40 @@ int fdt_valid(struct fdt_header **blobp) } return 1; }
+int fdt_fixup_pmem_region(void *blob, ulong addr, u32 size) +{
u64 pmem_start[2] = { 0 };
u64 pmem_size[2] = { 0 };
char pmem_node[32] = {0};
int nodeoffset, len;
int err;
u8 tmp[4 * 16]; /* Up to 64-bit address + 64-bit size */
if (!IS_ALIGNED(addr, SZ_2M) || !IS_ALIGNED(addr + size, SZ_2M)) {
printf("Start and end address needs at 2MB alignment\n");
return -1;
}
snprintf(pmem_node, sizeof(pmem_node), "pmem@%lx", addr);
nodeoffset = fdt_find_or_add_subnode(blob, 0, pmem_node);
if (nodeoffset < 0)
return nodeoffset;
err = fdt_setprop_string(blob, nodeoffset, "compatible", "pmem-region");
if (err)
return err;
err = fdt_setprop_empty(blob, nodeoffset, "volatile");
if (err)
return err;
I believe I asked this already, but is it possible to use the ofnode interface, instead of adding more and more code which we need to migrate later?
I had spent some time understanding what exactly is happening with the livetree code. I had responded to you earlier [1] as to why I don't think using livetree would be a good fit for this use case.
-sughosh
[1] - https://lists.denx.de/pipermail/u-boot/2024-December/573556.html
pmem_start[0] = addr;
pmem_size[0] = size;
len = fdt_pack_reg(blob, tmp, pmem_start, pmem_size, 1);
err = fdt_setprop(blob, nodeoffset, "reg", tmp, len);
if (err < 0) {
printf("WARNING: could not set pmem %s %s.\n", "reg",
fdt_strerror(err));
return err;
}
return 0;
+} diff --git a/include/fdt_support.h b/include/fdt_support.h index 9447a64e060..980feb27d27 100644 --- a/include/fdt_support.h +++ b/include/fdt_support.h @@ -474,4 +474,17 @@ void fdt_fixup_pstore(void *blob); */ int fdt_kaslrseed(void *blob, bool overwrite);
+/**
- fdt_fixup_pmem_region() - add a pmem node on the device tree
- This functions injects a pmem node to the device tree. Usually
- used with EFI installers to preserve installer images
- @blob: device tree provided by caller
- @addr: start address of the pmem node
- @size: size of the memory of the pmem node
- Return: 0 on success or < 0 on failure
- */
+int fdt_fixup_pmem_region(void *blob, ulong addr, u32 size);
#endif /* ifndef __FDT_SUPPORT_H */
2.34.1
Regards, Simon

From: Ilias Apalodimas ilias.apalodimas@linaro.org
With upcoming changes supporting pmem nodes, we need to remove the pmem area from the EFI memory map. Add a function to do that.
Signed-off-by: Ilias Apalodimas ilias.apalodimas@linaro.org Signed-off-by: Sughosh Ganu sughosh.ganu@linaro.org --- 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
include/efi_loader.h | 11 +++++--- lib/efi_loader/efi_memory.c | 51 +++++++++++++++++++++++++++---------- lib/lmb.c | 4 +-- 3 files changed, 47 insertions(+), 19 deletions(-)
diff --git a/include/efi_loader.h b/include/efi_loader.h index 39809eac1bc..24e40799eee 100644 --- a/include/efi_loader.h +++ b/include/efi_loader.h @@ -786,7 +786,7 @@ efi_status_t efi_get_memory_map(efi_uintn_t *memory_map_size, efi_status_t efi_add_memory_map(u64 start, u64 size, int memory_type);
/** - * efi_add_memory_map_pg() - add pages to the memory map + * efi_update_memory_map() - update the memory map by adding/removing pages * * @start: start address, must be a multiple of * EFI_PAGE_SIZE @@ -794,11 +794,14 @@ efi_status_t efi_add_memory_map(u64 start, u64 size, int memory_type); * @memory_type: type of memory added * @overlap_conventional: region may only overlap free(conventional) * memory + * @remove: remove memory map * Return: status code */ -efi_status_t efi_add_memory_map_pg(u64 start, u64 pages, - int memory_type, - bool overlap_conventional); +efi_status_t efi_update_memory_map(u64 start, u64 pages, int memory_type, + bool overlap_conventional, bool remove); + +/* Remove memory from the EFI memory map */ +efi_status_t efi_remove_memory_map(u64 start, u64 size, int memory_type);
/* Called by board init to initialize the EFI drivers */ efi_status_t efi_driver_init(void); diff --git a/lib/efi_loader/efi_memory.c b/lib/efi_loader/efi_memory.c index edd7da7d8c6..fe0e570059d 100644 --- a/lib/efi_loader/efi_memory.c +++ b/lib/efi_loader/efi_memory.c @@ -258,7 +258,7 @@ static s64 efi_mem_carve_out(struct efi_mem_list *map, }
/** - * efi_add_memory_map_pg() - add pages to the memory map + * efi_update_memory_map() - update the memory map by adding/removing pages * * @start: start address, must be a multiple of * EFI_PAGE_SIZE @@ -266,11 +266,11 @@ static s64 efi_mem_carve_out(struct efi_mem_list *map, * @memory_type: type of memory added * @overlap_conventional: region may only overlap free(conventional) * memory + * @remove: remove memory map * Return: status code */ -efi_status_t efi_add_memory_map_pg(u64 start, u64 pages, - int memory_type, - bool overlap_conventional) +efi_status_t efi_update_memory_map(u64 start, u64 pages, int memory_type, + bool overlap_conventional, bool remove) { struct efi_mem_list *lmem; struct efi_mem_list *newlist; @@ -278,9 +278,9 @@ efi_status_t efi_add_memory_map_pg(u64 start, u64 pages, uint64_t carved_pages = 0; struct efi_event *evt;
- EFI_PRINT("%s: 0x%llx 0x%llx %d %s\n", __func__, + EFI_PRINT("%s: 0x%llx 0x%llx %d %s %s\n", __func__, start, pages, memory_type, overlap_conventional ? - "yes" : "no"); + "yes" : "no", remove ? "remove" : "add");
if (memory_type >= EFI_MAX_MEMORY_TYPE) return EFI_INVALID_PARAMETER; @@ -363,7 +363,10 @@ efi_status_t efi_add_memory_map_pg(u64 start, u64 pages, }
/* Add our new map */ - list_add_tail(&newlist->link, &efi_mem); + if (!remove) + list_add_tail(&newlist->link, &efi_mem); + else + free(newlist);
/* And make sure memory is listed in descending order */ efi_mem_sort(); @@ -400,7 +403,29 @@ efi_status_t efi_add_memory_map(u64 start, u64 size, int memory_type) pages = efi_size_in_pages(size + (start & EFI_PAGE_MASK)); start &= ~EFI_PAGE_MASK;
- return efi_add_memory_map_pg(start, pages, memory_type, false); + return efi_update_memory_map(start, pages, memory_type, false, false); +} + +/** + * efi_remove_memory_map() - remove memory area to the memory map + * + * @start: start address of the memory area + * @size: length in bytes of the memory area + * @memory_type: type of memory removed + * + * Return: status code + * + * This function automatically aligns the start and size of the memory area + * to EFI_PAGE_SIZE. + */ +efi_status_t efi_remove_memory_map(u64 start, u64 size, int memory_type) +{ + u64 pages; + + pages = efi_size_in_pages(size + (start & EFI_PAGE_MASK)); + start &= ~EFI_PAGE_MASK; + + return efi_update_memory_map(start, pages, memory_type, false, true); }
/** @@ -501,7 +526,7 @@ efi_status_t efi_allocate_pages(enum efi_allocate_type type,
efi_addr = (u64)(uintptr_t)map_sysmem(addr, 0); /* Reserve that map in our memory maps */ - ret = efi_add_memory_map_pg(efi_addr, pages, memory_type, true); + ret = efi_update_memory_map(efi_addr, pages, memory_type, true, false); if (ret != EFI_SUCCESS) { /* Map would overlap, bail out */ lmb_free_flags(addr, (u64)pages << EFI_PAGE_SHIFT, flags); @@ -822,8 +847,8 @@ static void add_u_boot_and_runtime(void) uboot_stack_size) & ~EFI_PAGE_MASK; uboot_pages = ((uintptr_t)map_sysmem(gd->ram_top - 1, 0) - uboot_start + EFI_PAGE_MASK) >> EFI_PAGE_SHIFT; - efi_add_memory_map_pg(uboot_start, uboot_pages, EFI_BOOT_SERVICES_CODE, - false); + efi_update_memory_map(uboot_start, uboot_pages, EFI_BOOT_SERVICES_CODE, + false, false); #if defined(__aarch64__) /* * Runtime Services must be 64KiB aligned according to the @@ -841,8 +866,8 @@ static void add_u_boot_and_runtime(void) runtime_end = (uintptr_t)__efi_runtime_stop; runtime_end = (runtime_end + runtime_mask) & ~runtime_mask; runtime_pages = (runtime_end - runtime_start) >> EFI_PAGE_SHIFT; - efi_add_memory_map_pg(runtime_start, runtime_pages, - EFI_RUNTIME_SERVICES_CODE, false); + efi_update_memory_map(runtime_start, runtime_pages, + EFI_RUNTIME_SERVICES_CODE, false, false); }
int efi_memory_init(void) diff --git a/lib/lmb.c b/lib/lmb.c index 14b9b8466ff..d1d7e64b339 100644 --- a/lib/lmb.c +++ b/lib/lmb.c @@ -464,11 +464,11 @@ static int lmb_map_update_notify(phys_addr_t addr, phys_size_t size, u8 op, pages = efi_size_in_pages(size + (efi_addr & EFI_PAGE_MASK)); efi_addr &= ~EFI_PAGE_MASK;
- status = efi_add_memory_map_pg(efi_addr, pages, + status = efi_update_memory_map(efi_addr, pages, op == MAP_OP_RESERVE ? EFI_BOOT_SERVICES_DATA : EFI_CONVENTIONAL_MEMORY, - false); + false, false); if (status != EFI_SUCCESS) { log_err("%s: LMB Map notify failure %lu\n", __func__, status & ~EFI_ERROR_MASK);

From: Ilias Apalodimas ilias.apalodimas@linaro.org
One of the problems OS installers face, when running in EFI, is that the mounted ISO after calling ExitBootServices goes away. For some distros this is a problem since they rely on finding some core packages before continuing the installation. Distros have works around this -- e.g Fedora has a special kernel command line parameter called inst.stage2 [0].
ACPI has NFIT and NVDIMM support to provide ramdisks to the OS, but we don't have anything in place for DTs. Linux and device trees have support for persistent memory devices.
It's worth noting that for linux to instantiate the /dev/pmemX device, the memory described in the pmem node has to be omitted from the EFI memory map we hand over to the OS if ZONE_DEVICES and SPARSEMEM is enabled. With those enabled the pmem driver ends up calling devm_memremap_pages() instead of devm_memremap(). The latter works whether the memory is omitted or marked as reserved, but mapping pages only works if the memory is omitted.
On top of that, depending on how the kernel is configured, that memory area must be page aligned or 2MB aligned. PowerPC is an exception here and requires 16MB alignment, but since we don't have EFI support for it, limit the alignment to 2MB.
Ensure that the ISO image is 2MB aligned and remove the region occupied by the image from the EFI memory map.
Signed-off-by: Ilias Apalodimas ilias.apalodimas@linaro.org Signed-off-by: Sughosh Ganu sughosh.ganu@linaro.org Reviewed-by: Heinrich Schuchardt xypron.glpk@gmx.de --- Changes since V1: None
lib/efi_loader/efi_bootmgr.c | 22 +++++++++++++++++----- 1 file changed, 17 insertions(+), 5 deletions(-)
diff --git a/lib/efi_loader/efi_bootmgr.c b/lib/efi_loader/efi_bootmgr.c index 8c51a6ef2ed..b906e53e26e 100644 --- a/lib/efi_loader/efi_bootmgr.c +++ b/lib/efi_loader/efi_bootmgr.c @@ -18,6 +18,8 @@ #include <efi_loader.h> #include <efi_variable.h> #include <asm/unaligned.h> +#include <linux/kernel.h> +#include <linux/sizes.h>
static const struct efi_boot_services *bs; static const struct efi_runtime_services *rs; @@ -362,13 +364,16 @@ static efi_status_t prepare_loaded_image(u16 *label, ulong addr, ulong size, }
/* - * TODO: expose the ramdisk to OS. - * Need to pass the ramdisk information by the architecture-specific - * methods such as 'pmem' device-tree node. + * Linux supports 'pmem' which allows OS installers to find, reclaim + * the mounted images and continue the installation since the contents + * of the pmem region are treated as local media. + * + * The memory regions used for it needs to be carved out of the EFI + * memory map. */ - ret = efi_add_memory_map(addr, size, EFI_RESERVED_MEMORY_TYPE); + ret = efi_remove_memory_map(addr, size, EFI_CONVENTIONAL_MEMORY); if (ret != EFI_SUCCESS) { - log_err("Memory reservation failed\n"); + log_err("Failed to reserve memory\n"); goto err; }
@@ -490,6 +495,13 @@ static efi_status_t try_load_from_uri_path(struct efi_device_path_uri *uridp, ret = EFI_INVALID_PARAMETER; goto err; } + /* + * Depending on the kernel configuration, pmem memory area must be page + * aligned or 2MB aligned. PowerPC is an exception here and requires + * 16MB alignment, but since we don't have EFI support for it, limit + * the alignment to 2MB. + */ + image_size = ALIGN(image_size, SZ_2M);
/* * If the file extension is ".iso" or ".img", mount it and try to load

The EFI HTTP boot puts the iso installer image at some location in memory which needs to be reserved in the devicetree as persistent memory (pmem). Add helper functions which add this pmem node when the EFI_DT_FIXUP protocol's fixup callback is invoked.
Signed-off-by: Sughosh Ganu sughosh.ganu@linaro.org --- Changes since V1: * Use log_err() to print the error message in image_setup_libfdt() * Remove "ERROR:" from the error print in image_setup_libfdt()
boot/image-fdt.c | 9 +++++++++ include/efi_loader.h | 17 +++++++++++++++++ lib/efi_loader/efi_bootmgr.c | 21 +++++++++++++++++++++ lib/efi_loader/efi_helper.c | 12 ++++++++++++ 4 files changed, 59 insertions(+)
diff --git a/boot/image-fdt.c b/boot/image-fdt.c index 3d5b6f9e2dc..de479d3ffa0 100644 --- a/boot/image-fdt.c +++ b/boot/image-fdt.c @@ -11,6 +11,7 @@ #include <command.h> #include <fdt_support.h> #include <fdtdec.h> +#include <efi_loader.h> #include <env.h> #include <errno.h> #include <image.h> @@ -648,6 +649,14 @@ int image_setup_libfdt(struct bootm_headers *images, void *blob, bool lmb) if (!ft_verify_fdt(blob)) goto err;
+ if (CONFIG_IS_ENABLED(EFI_HTTP_BOOT)) { + fdt_ret = fdt_efi_pmem_setup(blob); + if (fdt_ret) { + log_err("HTTP boot pmem fixup failed\n"); + goto err; + } + } + /* after here we are using a livetree */ if (!of_live_active() && CONFIG_IS_ENABLED(EVENT)) { struct event_ft_fixup fixup; diff --git a/include/efi_loader.h b/include/efi_loader.h index 24e40799eee..87b9a6e4da0 100644 --- a/include/efi_loader.h +++ b/include/efi_loader.h @@ -748,6 +748,15 @@ bool efi_varname_is_load_option(u16 *var_name16, int *index); efi_status_t efi_next_variable_name(efi_uintn_t *size, u16 **buf, efi_guid_t *guid);
+/** + * fdt_efi_pmem_setup() - Setup the pmem node in the devicetree + * + * @fdt: Pointer to the devicetree + * + * Return: 0 on success, negative on failure + */ +int fdt_efi_pmem_setup(void *fdt); + /** * efi_size_in_pages() - convert size in bytes to size in pages * @@ -964,6 +973,14 @@ efi_status_t efi_set_load_options(efi_handle_t handle, void *load_options); efi_status_t efi_bootmgr_load(efi_handle_t *handle, void **load_options);
+/** + * efi_bootmgr_pmem_setup() - Put a pmem node for UEFI HTTP installers + * + * @fdt: Pointer to the DT blob + * Return: status code + */ +efi_status_t efi_bootmgr_pmem_setup(void *fdt); + /** * struct efi_image_regions - A list of memory regions * diff --git a/lib/efi_loader/efi_bootmgr.c b/lib/efi_loader/efi_bootmgr.c index b906e53e26e..db4eb6a7376 100644 --- a/lib/efi_loader/efi_bootmgr.c +++ b/lib/efi_loader/efi_bootmgr.c @@ -41,6 +41,8 @@ struct uridp_context { efi_handle_t mem_handle; };
+static struct uridp_context *uctx; + const efi_guid_t efi_guid_bootmenu_auto_generated = EFICONFIG_AUTO_GENERATED_ENTRY_GUID;
@@ -427,6 +429,7 @@ static efi_status_t efi_bootmgr_release_uridp(struct uridp_context *ctx)
efi_free_pool(ctx->loaded_dp); free(ctx); + uctx = NULL;
return ret == EFI_SUCCESS ? ret2 : ret; } @@ -447,6 +450,23 @@ static void EFIAPI efi_bootmgr_http_return(struct efi_event *event, EFI_EXIT(ret); }
+/** + * efi_bootmgr_pmem_setup() - Put a pmem node for UEFI HTTP installers + * + * @fdt: Pointer to the DT blob + * Return: status code + */ +efi_status_t efi_bootmgr_pmem_setup(void *fdt) +{ + if (!uctx) { + log_warning("No EFI HTTP boot context found\n"); + return EFI_SUCCESS; + } + + return !fdt_fixup_pmem_region(fdt, uctx->image_addr, uctx->image_size) ? + EFI_SUCCESS : EFI_INVALID_PARAMETER; +} + /** * try_load_from_uri_path() - Handle the URI device path * @@ -476,6 +496,7 @@ static efi_status_t try_load_from_uri_path(struct efi_device_path_uri *uridp, if (!ctx) return EFI_OUT_OF_RESOURCES;
+ uctx = ctx; s = env_get("loadaddr"); if (!s) { log_err("Error: loadaddr is not set\n"); diff --git a/lib/efi_loader/efi_helper.c b/lib/efi_loader/efi_helper.c index bf96f61d3d0..6fae37ad617 100644 --- a/lib/efi_loader/efi_helper.c +++ b/lib/efi_loader/efi_helper.c @@ -313,6 +313,18 @@ int efi_unlink_dev(efi_handle_t handle) return 0; }
+/** + * fdt_efi_pmem_setup() - Setup the pmem node in the devicetree + * + * @fdt: Pointer to the devicetree + * + * Return: 0 on success, negative on failure + */ +int fdt_efi_pmem_setup(void *fdt) +{ + return efi_bootmgr_pmem_setup(fdt) == EFI_SUCCESS ? 0 : -1; +} + static int u16_tohex(u16 c) { if (c >= '0' && c <= '9')

On 03.12.24 17:36, Sughosh Ganu wrote:
The EFI HTTP boot puts the iso installer image at some location in memory which needs to be reserved in the devicetree as persistent memory (pmem). Add helper functions which add this pmem node when the EFI_DT_FIXUP protocol's fixup callback is invoked.
Signed-off-by: Sughosh Ganu sughosh.ganu@linaro.org
Changes since V1:
Use log_err() to print the error message in image_setup_libfdt()
Remove "ERROR:" from the error print in image_setup_libfdt()
boot/image-fdt.c | 9 +++++++++ include/efi_loader.h | 17 +++++++++++++++++ lib/efi_loader/efi_bootmgr.c | 21 +++++++++++++++++++++ lib/efi_loader/efi_helper.c | 12 ++++++++++++ 4 files changed, 59 insertions(+)
diff --git a/boot/image-fdt.c b/boot/image-fdt.c index 3d5b6f9e2dc..de479d3ffa0 100644 --- a/boot/image-fdt.c +++ b/boot/image-fdt.c @@ -11,6 +11,7 @@ #include <command.h> #include <fdt_support.h> #include <fdtdec.h> +#include <efi_loader.h> #include <env.h> #include <errno.h> #include <image.h> @@ -648,6 +649,14 @@ int image_setup_libfdt(struct bootm_headers *images, void *blob, bool lmb) if (!ft_verify_fdt(blob)) goto err;
- if (CONFIG_IS_ENABLED(EFI_HTTP_BOOT)) {
fdt_ret = fdt_efi_pmem_setup(blob);
if (fdt_ret) {
log_err("HTTP boot pmem fixup failed\n");
goto err;
}
- }
- /* after here we are using a livetree */ if (!of_live_active() && CONFIG_IS_ENABLED(EVENT)) { struct event_ft_fixup fixup;
diff --git a/include/efi_loader.h b/include/efi_loader.h index 24e40799eee..87b9a6e4da0 100644 --- a/include/efi_loader.h +++ b/include/efi_loader.h @@ -748,6 +748,15 @@ bool efi_varname_is_load_option(u16 *var_name16, int *index); efi_status_t efi_next_variable_name(efi_uintn_t *size, u16 **buf, efi_guid_t *guid);
+/**
- fdt_efi_pmem_setup() - Setup the pmem node in the devicetree
- @fdt: Pointer to the devicetree
- Return: 0 on success, negative on failure
- */
+int fdt_efi_pmem_setup(void *fdt);
- /**
- efi_size_in_pages() - convert size in bytes to size in pages
@@ -964,6 +973,14 @@ efi_status_t efi_set_load_options(efi_handle_t handle, void *load_options); efi_status_t efi_bootmgr_load(efi_handle_t *handle, void **load_options);
+/**
- efi_bootmgr_pmem_setup() - Put a pmem node for UEFI HTTP installers
- @fdt: Pointer to the DT blob
- Return: status code
- */
+efi_status_t efi_bootmgr_pmem_setup(void *fdt);
- /**
- struct efi_image_regions - A list of memory regions
diff --git a/lib/efi_loader/efi_bootmgr.c b/lib/efi_loader/efi_bootmgr.c index b906e53e26e..db4eb6a7376 100644 --- a/lib/efi_loader/efi_bootmgr.c +++ b/lib/efi_loader/efi_bootmgr.c @@ -41,6 +41,8 @@ struct uridp_context { efi_handle_t mem_handle; };
+static struct uridp_context *uctx;
- const efi_guid_t efi_guid_bootmenu_auto_generated = EFICONFIG_AUTO_GENERATED_ENTRY_GUID;
@@ -427,6 +429,7 @@ static efi_status_t efi_bootmgr_release_uridp(struct uridp_context *ctx)
efi_free_pool(ctx->loaded_dp); free(ctx);
uctx = NULL;
return ret == EFI_SUCCESS ? ret2 : ret; }
@@ -447,6 +450,23 @@ static void EFIAPI efi_bootmgr_http_return(struct efi_event *event, EFI_EXIT(ret); }
+/**
- efi_bootmgr_pmem_setup() - Put a pmem node for UEFI HTTP installers
- @fdt: Pointer to the DT blob
- Return: status code
- */
+efi_status_t efi_bootmgr_pmem_setup(void *fdt) +{
- if (!uctx) {
log_warning("No EFI HTTP boot context found\n");
This function is called if CONFIG_EFI_HTTP_BOOT=y. This configuration setting allows booting via HTTP but does not require it. The warning makes no sense when booting from a block device.
The image type is orthogonal to the way you load it. Pmem support in Linux is not related to UEFI. Please, remove the dependency of pmem support on UEFI HTTP boot.
If the object to be booted is a disk image, we can create a block device in memory for it and then should be able to apply all standard boot methods on it.
Best regards
Heinrich
return EFI_SUCCESS;
- }
- return !fdt_fixup_pmem_region(fdt, uctx->image_addr, uctx->image_size) ?
EFI_SUCCESS : EFI_INVALID_PARAMETER;
+}
- /**
- try_load_from_uri_path() - Handle the URI device path
@@ -476,6 +496,7 @@ static efi_status_t try_load_from_uri_path(struct efi_device_path_uri *uridp, if (!ctx) return EFI_OUT_OF_RESOURCES;
- uctx = ctx; s = env_get("loadaddr"); if (!s) { log_err("Error: loadaddr is not set\n");
diff --git a/lib/efi_loader/efi_helper.c b/lib/efi_loader/efi_helper.c index bf96f61d3d0..6fae37ad617 100644 --- a/lib/efi_loader/efi_helper.c +++ b/lib/efi_loader/efi_helper.c @@ -313,6 +313,18 @@ int efi_unlink_dev(efi_handle_t handle) return 0; }
+/**
- fdt_efi_pmem_setup() - Setup the pmem node in the devicetree
- @fdt: Pointer to the devicetree
- Return: 0 on success, negative on failure
- */
+int fdt_efi_pmem_setup(void *fdt) +{
- return efi_bootmgr_pmem_setup(fdt) == EFI_SUCCESS ? 0 : -1;
+}
- static int u16_tohex(u16 c) { if (c >= '0' && c <= '9')

On Fri, 3 Jan 2025 at 22:31, Heinrich Schuchardt xypron.glpk@gmx.de wrote:
On 03.12.24 17:36, Sughosh Ganu wrote:
The EFI HTTP boot puts the iso installer image at some location in memory which needs to be reserved in the devicetree as persistent memory (pmem). Add helper functions which add this pmem node when the EFI_DT_FIXUP protocol's fixup callback is invoked.
Signed-off-by: Sughosh Ganu sughosh.ganu@linaro.org
Changes since V1:
Use log_err() to print the error message in image_setup_libfdt()
Remove "ERROR:" from the error print in image_setup_libfdt()
boot/image-fdt.c | 9 +++++++++ include/efi_loader.h | 17 +++++++++++++++++ lib/efi_loader/efi_bootmgr.c | 21 +++++++++++++++++++++ lib/efi_loader/efi_helper.c | 12 ++++++++++++ 4 files changed, 59 insertions(+)
diff --git a/boot/image-fdt.c b/boot/image-fdt.c index 3d5b6f9e2dc..de479d3ffa0 100644 --- a/boot/image-fdt.c +++ b/boot/image-fdt.c @@ -11,6 +11,7 @@ #include <command.h> #include <fdt_support.h> #include <fdtdec.h> +#include <efi_loader.h> #include <env.h> #include <errno.h> #include <image.h> @@ -648,6 +649,14 @@ int image_setup_libfdt(struct bootm_headers *images, void *blob, bool lmb) if (!ft_verify_fdt(blob)) goto err;
if (CONFIG_IS_ENABLED(EFI_HTTP_BOOT)) {
fdt_ret = fdt_efi_pmem_setup(blob);
if (fdt_ret) {
log_err("HTTP boot pmem fixup failed\n");
goto err;
}
}
/* after here we are using a livetree */ if (!of_live_active() && CONFIG_IS_ENABLED(EVENT)) { struct event_ft_fixup fixup;
diff --git a/include/efi_loader.h b/include/efi_loader.h index 24e40799eee..87b9a6e4da0 100644 --- a/include/efi_loader.h +++ b/include/efi_loader.h @@ -748,6 +748,15 @@ bool efi_varname_is_load_option(u16 *var_name16, int *index); efi_status_t efi_next_variable_name(efi_uintn_t *size, u16 **buf, efi_guid_t *guid);
+/**
- fdt_efi_pmem_setup() - Setup the pmem node in the devicetree
- @fdt: Pointer to the devicetree
- Return: 0 on success, negative on failure
- */
+int fdt_efi_pmem_setup(void *fdt);
- /**
- efi_size_in_pages() - convert size in bytes to size in pages
@@ -964,6 +973,14 @@ efi_status_t efi_set_load_options(efi_handle_t handle, void *load_options); efi_status_t efi_bootmgr_load(efi_handle_t *handle, void **load_options);
+/**
- efi_bootmgr_pmem_setup() - Put a pmem node for UEFI HTTP installers
- @fdt: Pointer to the DT blob
- Return: status code
- */
+efi_status_t efi_bootmgr_pmem_setup(void *fdt);
- /**
- struct efi_image_regions - A list of memory regions
diff --git a/lib/efi_loader/efi_bootmgr.c b/lib/efi_loader/efi_bootmgr.c index b906e53e26e..db4eb6a7376 100644 --- a/lib/efi_loader/efi_bootmgr.c +++ b/lib/efi_loader/efi_bootmgr.c @@ -41,6 +41,8 @@ struct uridp_context { efi_handle_t mem_handle; };
+static struct uridp_context *uctx;
- const efi_guid_t efi_guid_bootmenu_auto_generated = EFICONFIG_AUTO_GENERATED_ENTRY_GUID;
@@ -427,6 +429,7 @@ static efi_status_t efi_bootmgr_release_uridp(struct uridp_context *ctx)
efi_free_pool(ctx->loaded_dp); free(ctx);
uctx = NULL; return ret == EFI_SUCCESS ? ret2 : ret;
}
@@ -447,6 +450,23 @@ static void EFIAPI efi_bootmgr_http_return(struct efi_event *event, EFI_EXIT(ret); }
+/**
- efi_bootmgr_pmem_setup() - Put a pmem node for UEFI HTTP installers
- @fdt: Pointer to the DT blob
- Return: status code
- */
+efi_status_t efi_bootmgr_pmem_setup(void *fdt) +{
if (!uctx) {
log_warning("No EFI HTTP boot context found\n");
This function is called if CONFIG_EFI_HTTP_BOOT=y. This configuration setting allows booting via HTTP but does not require it. The warning makes no sense when booting from a block device.
Okay. I can remove the warning.
The image type is orthogonal to the way you load it. Pmem support in Linux is not related to UEFI. Please, remove the dependency of pmem support on UEFI HTTP boot.
If the object to be booted is a disk image, we can create a block device in memory for it and then should be able to apply all standard boot methods on it.
I think this was discussed earlier [1]. As things stand today, the only context in which an installer ISO image is loaded to memory is through the EFI HTTP boot path.
-sughosh
[1] - https://lists.denx.de/pipermail/u-boot/2024-November/571335.html
Best regards
Heinrich
return EFI_SUCCESS;
}
return !fdt_fixup_pmem_region(fdt, uctx->image_addr, uctx->image_size) ?
EFI_SUCCESS : EFI_INVALID_PARAMETER;
+}
- /**
- try_load_from_uri_path() - Handle the URI device path
@@ -476,6 +496,7 @@ static efi_status_t try_load_from_uri_path(struct efi_device_path_uri *uridp, if (!ctx) return EFI_OUT_OF_RESOURCES;
uctx = ctx; s = env_get("loadaddr"); if (!s) { log_err("Error: loadaddr is not set\n");
diff --git a/lib/efi_loader/efi_helper.c b/lib/efi_loader/efi_helper.c index bf96f61d3d0..6fae37ad617 100644 --- a/lib/efi_loader/efi_helper.c +++ b/lib/efi_loader/efi_helper.c @@ -313,6 +313,18 @@ int efi_unlink_dev(efi_handle_t handle) return 0; }
+/**
- fdt_efi_pmem_setup() - Setup the pmem node in the devicetree
- @fdt: Pointer to the devicetree
- Return: 0 on success, negative on failure
- */
+int fdt_efi_pmem_setup(void *fdt) +{
return efi_bootmgr_pmem_setup(fdt) == EFI_SUCCESS ? 0 : -1;
+}
- static int u16_tohex(u16 c) { if (c >= '0' && c <= '9')

Just a ping in case we can move this forward.
Heinrich we've tested with various distros including the generic arm64 poky image and this works fine. The poky image[0] is missing OF_MEM support, but someone is working to add it already. With a modified kernel this boots fine including the missing modules this boots to the login screen [1]
[0] https://www.yoctoproject.org/development/releases/ [1] https://paste.debian.net/1340517/
Thanks /Ilias
On Tue, 3 Dec 2024 at 18:36, Sughosh Ganu sughosh.ganu@linaro.org wrote:
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(-)
-- 2.34.1

Hi all,
I’ve tested the PMEM patches with quite a few Linux distros. These are the results:
Installation images:
1. These images include all required drivers and can be used for successful installations: * RHEL 9.4 * Ubuntu 22.04 and Ubuntu 24.04 * OpenSUSE Tumbleweed * Rocky 9.4 * RHEL for Edge (Full installer) 2. These images are missing some kernel drivers: * Fedora 40, Fedora 41 - nd_pmem driver is missing (CONFIG_BLK_DEV_PMEM) * Fedora 40 IOT, Fedora 41 IOT - nvdimm/nd_pmem/of_pmem drivers are missing * Debian 12.6.0, Debian 12.7.0 - nvdimm/nd_pmem/of_pmem drivers are missing. debian installer requires a small fix to mount /dev/pmem * RHEL for Edge with FIDO Device onboarding - of_pmem driver is missing (CONFIG_OF_PMEM)
Live images:
1. Rocky-9-Workstation-aarch64-latest.iso and Rocky-9-Workstation-Lite-aarch64-latest.iso include all the required drivers and boot successfully. 2. Yocto genericarm64 image is missing nvdimm/nd_pmem/of_pmem drivers, but with a manually applied kernel config can be booted successfully.
Cheers, Anton
From: Ilias Apalodimas ilias.apalodimas@linaro.org
Just a ping in case we can move this forward.
Heinrich we've tested with various distros including the generic arm64 poky image and this works fine. The poky image[0] is missing OF_MEM support, but someone is working to add it already. With a modified kernel this boots fine including the missing modules this boots to the login screen [1]
[0] https://www.yoctoproject.org/development/releases/ [1] https://paste.debian.net/1340517/
Thanks /Ilias
On Tue, 3 Dec 2024 at 18:36, Sughosh Ganu sughosh.ganu@linaro.org wrote:
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(-)
-- 2.34.1
IMPORTANT NOTICE: The contents of this email and any attachments are confidential and may also be privileged. If you are not the intended recipient, please notify the sender immediately and do not disclose the contents to any other person, use it for any purpose, or store or copy the information in any medium. Thank you.
participants (5)
-
Anton Antonov
-
Heinrich Schuchardt
-
Ilias Apalodimas
-
Simon Glass
-
Sughosh Ganu