[PATCH] config_distro_bootcmd: do not scan boot partitions if distro_bootpart is defined

Hugo Villeneuve hugo at hugovil.com
Fri Mar 27 16:16:07 CET 2026


From: Hugo Villeneuve <hvilleneuve at dimonoff.com>

For some projects, designing the active bootable partition is done by
setting distro_bootpart in the environment instead of changing the bootable
flag on the active partition.

This patch makes it possible to support both models by scanning boot
partitions only if distro_bootpart is not defined in the environment.

Signed-off-by: Hugo Villeneuve <hvilleneuve at dimonoff.com>
---
 include/config_distro_bootcmd.h | 8 ++++++--
 1 file changed, 6 insertions(+), 2 deletions(-)

diff --git a/include/config_distro_bootcmd.h b/include/config_distro_bootcmd.h
index 7b6ac6eed9d..8d6f80a0ce5 100644
--- a/include/config_distro_bootcmd.h
+++ b/include/config_distro_bootcmd.h
@@ -543,8 +543,12 @@
 		"\0"                                                      \
 	\
 	"scan_dev_for_boot_part="                                         \
-		SCAN_DEV_FOR_BOOT_PARTS                                   \
-		"env exists devplist || setenv devplist 1; "              \
+		"if env exists distro_bootpart; then "                    \
+			"setenv devplist ${distro_bootpart}; "            \
+		"else "                                                   \
+			SCAN_DEV_FOR_BOOT_PARTS                           \
+			"env exists devplist || setenv devplist 1; "      \
+		"fi; "                                                    \
 		"for distro_bootpart in ${devplist}; do "                 \
 			"if fstype ${devtype} "                           \
 					"${devnum}:${distro_bootpart} "   \

base-commit: c24a72c35abe9cbbeb72e2effc6b6c73cd828a32
-- 
2.47.3



More information about the U-Boot mailing list