Skip to contentSkip to conversation

boot: vbe: Make BOOTMETH_VBE_xxx a choice

PATCH In review Tom Rini 2 participants 5 messages Oct 1, 2025 – Oct 6, 2025

lore
Share & tools
lore

Tom Rini

author
#0 lore raw

PATCH 1/1 boot: vbe: Make BOOTMETH_VBE_xxx a choice

It is not valid to enable multiple BOOTMETH_VBE_xxx methods, so make it a choice as to which will be enabled, and make the default choice be the current default.

---
 boot/Kconfig | 7 ++++++-
 1 file changed, 6 insertions(+), 1 deletion(-)
boot/Kconfig +6 -1
index eff05948b3a1..f21a67b2d3ee 100644
@@ -712,9 +712,12 @@ config SPL_BOOTMETH_VBE_REQUEST
 
 	  This is only useful if you are booting an OS direct from SPL.
 
+choice
+	prompt "Method for VBE to find the correct bootdev"
+	default BOOTMETH_VBE_SIMPLE
+
 config BOOTMETH_VBE_SIMPLE
 	bool "Bootdev support for VBE 'simple' method"
-	default y
 	imply SPL_CRC8 if SPL
 	imply VPL_CRC8 if VPL
 	help
@@ -734,6 +737,8 @@ config BOOTMETH_VBE_ABREC
 	  verification step, a recovery image is booted. This method will
 	  eventually provide rollback protection as well.
 
+endchoice
+
 if BOOTMETH_VBE_SIMPLE
 
 config BOOTMETH_VBE_SIMPLE_OS
Signature · 1 line
2.43.0
#1 lore raw

Hi Tom,

Quoted 2 lines · Tom Rini

It is not valid to enable multiple BOOTMETH_VBE_xxx methods

Why is it not valid? That wasn't my intention.

Quoted 37 lines

, so make it
a choice as to which will be enabled, and make the default choice be the current default.

---
 boot/Kconfig | 7 ++++++-
 1 file changed, 6 insertions(+), 1 deletion(-)
boot/Kconfig +6 -2
index eff05948b3a1..f21a67b2d3ee 100644
@@ -712,9 +712,12 @@ config SPL_BOOTMETH_VBE_REQUEST
 
          This is only useful if you are booting an OS direct from SPL.
 
+choice
+       prompt "Method for VBE to find the correct bootdev"
+       default BOOTMETH_VBE_SIMPLE
+
 config BOOTMETH_VBE_SIMPLE
        bool "Bootdev support for VBE 'simple' method"
-       default y
        imply SPL_CRC8 if SPL
        imply VPL_CRC8 if VPL
        help
@@ -734,6 +737,8 @@ config BOOTMETH_VBE_ABREC
          verification step, a recovery image is booted. This method will
          eventually provide rollback protection as well.
 
+endchoice
+
 if BOOTMETH_VBE_SIMPLE
 
 config BOOTMETH_VBE_SIMPLE_OS
--
Quoted 2 lines

2.43.0

Regards,
Simon

author
#2 lore raw
Quoted 7 lines · Simon Glass

Hi Tom,

Quoted 2 lines · Tom Rini

It is not valid to enable multiple BOOTMETH_VBE_xxx methods

Why is it not valid? That wasn't my intention.

They fail to build because they both declare some of the same binman syms:

$ grep 'binman_sym_declare(ulong, vpl, size)' boot/vbe*.c
boot/vbe_abrec_fw.c:binman_sym_declare(ulong, vpl, size);
boot/vbe_simple_fw.c:binman_sym_declare(ulong, vpl, size);
$ grep 'binman_sym_declare(ulong, vpl, image_pos)' boot/vbe*.c
boot/vbe_abrec_fw.c:binman_sym_declare(ulong, vpl, image_pos);
boot/vbe_simple_fw.c:binman_sym_declare(ulong, vpl, image_pos);

Enabling both leads to link failures.

Signature · 1 line
Tom
#3 lore raw

Hi Tom,

Quoted 12 lines · Tom Rini
Quoted 7 lines · Simon Glass

Hi Tom,

Quoted 2 lines · Tom Rini

It is not valid to enable multiple BOOTMETH_VBE_xxx methods

Why is it not valid? That wasn't my intention.

They fail to build because they both declare some of the same binman syms:

Quoted 8 lines
$ grep 'binman_sym_declare(ulong, vpl, size)' boot/vbe*.c
boot/vbe_abrec_fw.c:binman_sym_declare(ulong, vpl, size);
boot/vbe_simple_fw.c:binman_sym_declare(ulong, vpl, size);
$ grep 'binman_sym_declare(ulong, vpl, image_pos)' boot/vbe*.c
boot/vbe_abrec_fw.c:binman_sym_declare(ulong, vpl, image_pos);
boot/vbe_simple_fw.c:binman_sym_declare(ulong, vpl, image_pos);

Enabling both leads to link failures.

OK, thanks. I'll need to fix it at some point...

Regards,
Simon

author
#4 lore raw
Quoted 22 lines · Simon Glass

Hi Tom,

Quoted 19 lines · Tom Rini
Quoted 7 lines · Simon Glass

Hi Tom,

Quoted 2 lines · Tom Rini

It is not valid to enable multiple BOOTMETH_VBE_xxx methods

Why is it not valid? That wasn't my intention.

They fail to build because they both declare some of the same binman syms:

$ grep 'binman_sym_declare(ulong, vpl, size)' boot/vbe*.c
boot/vbe_abrec_fw.c:binman_sym_declare(ulong, vpl, size);
boot/vbe_simple_fw.c:binman_sym_declare(ulong, vpl, size);
$ grep 'binman_sym_declare(ulong, vpl, image_pos)' boot/vbe*.c
boot/vbe_abrec_fw.c:binman_sym_declare(ulong, vpl, image_pos);
boot/vbe_simple_fw.c:binman_sym_declare(ulong, vpl, image_pos);
Quoted 3 lines
Quoted 1 line

Enabling both leads to link failures.

OK, thanks. I'll need to fix it at some point...

At some point is fine, thanks.

Signature · 1 line
Tom