]> git.ipfire.org Git - thirdparty/u-boot.git/commitdiff
config_distro_bootcmd: do not scan boot partitions if distro_bootpart is defined master
authorHugo Villeneuve <hvilleneuve@dimonoff.com>
Fri, 27 Mar 2026 15:16:07 +0000 (11:16 -0400)
committerTom Rini <trini@konsulko.com>
Mon, 13 Apr 2026 23:34:48 +0000 (17:34 -0600)
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@dimonoff.com>
include/config_distro_bootcmd.h

index 7b6ac6eed9dd43fa658310b88993a5cbe0d91004..8d6f80a0ce5c8f9f56a1952e2b09c4e949931270 100644 (file)
                "\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} "   \