summaryrefslogtreecommitdiff
path: root/payloads/external/GRUB2
diff options
context:
space:
mode:
authorBill XIE <persmule@hardenedlinux.org>2022-01-01 11:56:00 +0800
committerFelix Held <felix-coreboot@felixheld.de>2022-05-24 12:58:52 +0000
commit3dda4dad1d3add373e2cc7d0c47badecf851eaa2 (patch)
treebda254df3eed484d088f2e9d3288add18b784ea1 /payloads/external/GRUB2
parent26e0b9461405a26eda786eeffd617253f76692a3 (diff)
payloads/external: Add more option related to SeaBIOS and GRUB2
Also known as "SeaGRUB", running GRUB2 atop SeaBIOS proves to be a useful configuration, since SeaBIOS has improved its hardware compatibility. For example, some USB drive can work under SeaBIOS but do not work under native GRUB2, and GRUB2 can use BIOS call (provided by SeaBIOS) as a fallback method to access hardware if it is present. But more option is added addition to "SeaGRUB": now GRUB2 and SeaBIOS can be built as secondary payloads, and "SeaGRUB" is now implemented as "Primary SeaBIOS + Secondary GRUB2 (selected) + config files". Signed-off-by: Bill XIE <persmule@hardenedlinux.org> Change-Id: Ie681fa231abfe4a8f1e4510b3c17957550a9d2f8 Reviewed-on: https://review.coreboot.org/c/coreboot/+/60640 Tested-by: build bot (Jenkins) <no-reply@coreboot.org> Reviewed-by: Martin L Roth <gaumless@tutanota.com> Reviewed-by: Paul Menzel <paulepanter@mailbox.org>
Diffstat (limited to 'payloads/external/GRUB2')
-rw-r--r--payloads/external/GRUB2/Kconfig32
-rw-r--r--payloads/external/GRUB2/Kconfig.name13
-rw-r--r--payloads/external/GRUB2/bootorder-seagrub1
3 files changed, 42 insertions, 4 deletions
diff --git a/payloads/external/GRUB2/Kconfig b/payloads/external/GRUB2/Kconfig
index 552f06a523..9ad82eee67 100644
--- a/payloads/external/GRUB2/Kconfig
+++ b/payloads/external/GRUB2/Kconfig
@@ -1,5 +1,15 @@
+config PAYLOAD_BUILD_GRUB2
+ bool
+
if PAYLOAD_GRUB2
+config PAYLOAD_FILE
+ default "payloads/external/GRUB2/grub2/build/default_payload.elf"
+
+endif
+
+if PAYLOAD_BUILD_GRUB2
+
choice
prompt "GRUB2 version"
default GRUB2_STABLE
@@ -42,12 +52,9 @@ config GRUB2_EXTRA_MODULES
* gfxmenu for graphical menus (you'll need a theme as well)
* gfxterm_background for setting background
-config PAYLOAD_FILE
- default "payloads/external/GRUB2/grub2/build/default_payload.elf"
-
config GRUB2_INCLUDE_RUNTIME_CONFIG_FILE
bool "Include GRUB2 runtime config file into ROM image"
- depends on PAYLOAD_GRUB2
+ depends on PAYLOAD_BUILD_GRUB2
default n
help
The GRUB2 payload reads its runtime configuration file from etc/grub.cfg
@@ -72,3 +79,20 @@ config GRUB2_RUNTIME_CONFIG_FILE
The path of the GRUB2 runtime configuration file to be added to CBFS.
endif
+
+if PAYLOAD_SEAGRUB
+
+config PAYLOAD_FILE
+ default "payloads/external/SeaBIOS/seabios/out/bios.bin.elf"
+
+config SEABIOS_BOOTORDER_FILE
+ default "payloads/external/GRUB2/bootorder-seagrub"
+
+config SEAGRUB_ALLOW_SEABIOS_BOOTMENU
+ bool "Allow to access SeaBIOS boot menu before launching GRUB"
+ help
+ Enable this to allow the access to the boot menu of SeaBIOS. It
+ increases the flexibility but allows to bypass the secure mechanism
+ implemented in the GRUB runtime config. Please use this with caution.
+
+endif
diff --git a/payloads/external/GRUB2/Kconfig.name b/payloads/external/GRUB2/Kconfig.name
index fe60d76dc3..91e68886e3 100644
--- a/payloads/external/GRUB2/Kconfig.name
+++ b/payloads/external/GRUB2/Kconfig.name
@@ -1,9 +1,22 @@
config PAYLOAD_GRUB2
bool "GRUB2"
depends on ARCH_X86 || ARCH_ARM
+ select PAYLOAD_BUILD_GRUB2
help
Select this option if you want to build a coreboot image
with a GRUB2 payload. If you don't know what this is
about, just leave it enabled.
See https://coreboot.org/Payloads for more information.
+
+config PAYLOAD_SEAGRUB
+ bool "GRUB2 atop SeaBIOS"
+ depends on ARCH_X86
+ select PAYLOAD_BUILD_SEABIOS
+ select GRUB2_SECONDARY_PAYLOAD
+ help
+ Select this option if you want to build a coreboot image
+ with a GRUB2 payload running atop SeaBIOS to improve its
+ hardware compatibility.
+
+ See https://coreboot.org/Payloads for more information.
diff --git a/payloads/external/GRUB2/bootorder-seagrub b/payloads/external/GRUB2/bootorder-seagrub
new file mode 100644
index 0000000000..b33e1295c7
--- /dev/null
+++ b/payloads/external/GRUB2/bootorder-seagrub
@@ -0,0 +1 @@
+/rom@img/grub2