From 99abd60d59e277f1b0853dfd6d4fdf6e8014ab30 Mon Sep 17 00:00:00 2001 From: Simon Glass Date: Fri, 15 Dec 2023 16:54:16 -0700 Subject: boot: Support decompressing non-kernel OS images Sometimes the kernel is built as an EFI application rather than a binary. We still want to support compression for this case. For arm64 the entry point is set later in the bootm_load_os() function, since these images are typically relocated due to the 2MB-alignment requirement of arm64 images. But since the EFI image is not in the same format, we need to update the entry point earlier. Set the entry point always, for kernel_noload to resolve this problem. It should be harmless to do this always. Signed-off-by: Simon Glass --- boot/bootm.c | 1 + 1 file changed, 1 insertion(+) (limited to 'boot') diff --git a/boot/bootm.c b/boot/bootm.c index 7a050ed41a7..d071537d692 100644 --- a/boot/bootm.c +++ b/boot/bootm.c @@ -644,6 +644,7 @@ static int bootm_load_os(struct bootm_headers *images, int boot_progress) if (!load) return 1; os.load = load; + images->ep = load; debug("Allocated %lx bytes at %lx for kernel (size %lx) decompression\n", req_size, load, image_len); } -- cgit v1.2.3 From 64c67b68d1f0a9238cb0c4939ceb7afd124af9f9 Mon Sep 17 00:00:00 2001 From: Heinrich Schuchardt Date: Sat, 16 Dec 2023 16:38:36 +0100 Subject: boot: CONFIG_CEDIT must depend on CONFIG_EXPO Building sandbox_defconfig with CONFIG_CMD_CEDIT=y CONFIG_EXPO=n fails with cmd/cedit.c:258:(.text.do_cedit_run+0x4c): undefined reference to `expo_apply_theme Fix the dependencies. Fixes: a0874dc4ac71 ("expo: Add a configuration editor") Signed-off-by: Heinrich Schuchardt Reviewed-by: Simon Glass --- boot/Kconfig | 2 +- boot/Makefile | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) (limited to 'boot') diff --git a/boot/Kconfig b/boot/Kconfig index 9f5b8a0cb2c..0894ecf4df1 100644 --- a/boot/Kconfig +++ b/boot/Kconfig @@ -1687,7 +1687,7 @@ menu "Configuration editor" config CEDIT bool "Configuration editor" - depends on BOOTSTD + depends on EXPO help Provides a way to deal with board configuration and present it to the user for adjustment. diff --git a/boot/Makefile b/boot/Makefile index a90ebea5a86..a47e0027462 100644 --- a/boot/Makefile +++ b/boot/Makefile @@ -33,11 +33,11 @@ obj-$(CONFIG_$(SPL_TPL_)BOOTMETH_EFILOADER) += bootmeth_efi.o obj-$(CONFIG_$(SPL_TPL_)BOOTMETH_CROS) += bootm.o bootm_os.o bootmeth_cros.o obj-$(CONFIG_$(SPL_TPL_)BOOTMETH_SANDBOX) += bootmeth_sandbox.o obj-$(CONFIG_$(SPL_TPL_)BOOTMETH_SCRIPT) += bootmeth_script.o +obj-$(CONFIG_$(SPL_TPL_)CEDIT) += cedit.o ifdef CONFIG_$(SPL_TPL_)BOOTSTD_FULL obj-$(CONFIG_BOOTEFI_BOOTMGR) += bootmeth_efi_mgr.o obj-$(CONFIG_$(SPL_TPL_)EXPO) += bootflow_menu.o obj-$(CONFIG_$(SPL_TPL_)BOOTSTD) += bootflow_menu.o -obj-$(CONFIG_$(SPL_TPL_)CEDIT) += cedit.o endif obj-$(CONFIG_$(SPL_TPL_)OF_LIBFDT) += fdt_support.o -- cgit v1.2.3 From bf2df680286956b3187b1820ae54c5a0fb594857 Mon Sep 17 00:00:00 2001 From: Alexey Romanov Date: Mon, 25 Dec 2023 13:22:45 +0300 Subject: android_ab: don't ignore ab_control_store return code ab_control_store() can return an error if writing to disk fails. In this case, we have to pass the error code to the caller. Signed-off-by: Alexey Romanov Reviewed-by: Mattijs Korpershoek --- boot/android_ab.c | 18 +++++++++++++++--- 1 file changed, 15 insertions(+), 3 deletions(-) (limited to 'boot') diff --git a/boot/android_ab.c b/boot/android_ab.c index 0f20a34e511..c9df6d2b4b1 100644 --- a/boot/android_ab.c +++ b/boot/android_ab.c @@ -336,7 +336,14 @@ int ab_select_slot(struct blk_desc *dev_desc, struct disk_partition *part_info, if (store_needed) { abc->crc32_le = ab_control_compute_crc(abc); - ab_control_store(dev_desc, part_info, abc, 0); + ret = ab_control_store(dev_desc, part_info, abc, 0); + if (ret < 0) { +#if ANDROID_AB_BACKUP_OFFSET + free(backup_abc); +#endif + free(abc); + return ret; + } } #if ANDROID_AB_BACKUP_OFFSET @@ -345,8 +352,13 @@ int ab_select_slot(struct blk_desc *dev_desc, struct disk_partition *part_info, * to the backup offset */ if (memcmp(backup_abc, abc, sizeof(*abc)) != 0) { - ab_control_store(dev_desc, part_info, abc, - ANDROID_AB_BACKUP_OFFSET); + ret = ab_control_store(dev_desc, part_info, abc, + ANDROID_AB_BACKUP_OFFSET); + if (ret < 0) { + free(backup_abc); + free(abc); + return ret; + } } free(backup_abc); #endif -- cgit v1.2.3