gnuboot-patches
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[PATCH v2 3/3] packages: seabios: fix payload not being added to the GNU


From: Adrien 'neox' Bourmault
Subject: [PATCH v2 3/3] packages: seabios: fix payload not being added to the GNU Boot image
Date: Thu, 28 Nov 2024 23:40:16 +0100

A bug has been introduced in

        a202dce646307f7b0da71da4715f63981a79e9c8
        ("images: remove 'libgfxinit' from the image names.")

where we simplified images names without taking care of renaming the filename
used as the SeaBIOS build target.

This error was visible during the generation of the images:

        payload/seabios/seabios.elf: No such file or directory
        E: Could not load file 'payload/seabios/seabios.elf'.
        E: Failed while operating on 'COREBOOT' region!
        E: The image will be left unmodified.

The resulting image was then missing a payload entry and was then
non-functional (people would then just get a black screen without any OS loaded
from the disk).

GNUtoo confirmed by bisecting that the commit cited above was indeed responsible
of the bug and also that the error message above was specific to this issue.

This commit fixes this bug by setting variables to hold the actual payload
location (making future changes easier), in the relevant files. Also, this
commit removes the generation of the unused seabios_vgarom.elf image.

Tested-by: Adrien 'neox' Bourmault <neox@gnu.org>
Signed-off-by: Adrien 'neox' Bourmault <neox@gnu.org>
---
 resources/packages/roms_helper/boot |  9 ++++++---
 resources/packages/seabios/payload  | 10 ++++++++--
 2 files changed, 14 insertions(+), 5 deletions(-)

diff --git a/resources/packages/roms_helper/boot 
b/resources/packages/roms_helper/boot
index ea30d34..1975688 100755
--- a/resources/packages/roms_helper/boot
+++ b/resources/packages/roms_helper/boot
@@ -134,7 +134,10 @@ if [ "${board}" != "${cbtree}" ]; then
 fi
 cbfstool="${cbdir}/util/cbfstool/cbfstool"
 corebootrom="${cbdir}/build/coreboot.rom"
+# These variables define where the SeaBIOS binaries are put by 
../seabios/payload.
+# For consistency, we use the same logic.
 seavgabiosrom="payload/seabios/seavgabios.bin"
+seabiosrom="payload/seabios/seabios.elf"
 
 if [ ! -d "${cbdir}" ]; then
        ./download coreboot ${cbtree}
@@ -164,7 +167,7 @@ if [ ! -f "${cbfstool}" ]; then
 fi
 
 if [ ! -f "${seavgabiosrom}" ] \
-               || [ ! -f payload/seabios/seabios_libgfxinit.elf ]; then
+               || [ ! -f ${seabiosrom} ]; then
        if [ "${payload_seabios}" = "y" ]; then
                ./build payload seabios
        elif [ "${payload_grub}" = "y" ] \
@@ -284,8 +287,8 @@ make_seabios_rom() {
 
        # etc/pci-optionrom-exec will be set to 2
        # etc/pci-optionrom-exec will be set to 0
-       target_seabioself="payload/seabios/seabios.elf"
-       target_seavgabios_rom="payload/seabios/seavgabios.bin"
+       target_seabioself="${seabiosrom}"
+       target_seavgabios_rom="${seavgabiosrom}"
 
        tmprom=$(mktemp -t coreboot_rom.XXXXXXXXXX)
 
diff --git a/resources/packages/seabios/payload 
b/resources/packages/seabios/payload
index b514da6..020f344 100755
--- a/resources/packages/seabios/payload
+++ b/resources/packages/seabios/payload
@@ -24,6 +24,12 @@ set -u -e
 # Build SeaBIOS
 # ---------------------------------------------------------------------
 
+# These variables define where this script is expected to put SeaBIOS
+# binaries. For consistency, we use the same logic in ../roms_helper/boot,
+# where the SeaBIOS binaries are added to the boot software image.
+seabiosrom="../payload/seabios/seabios.elf"
+seavgabiosrom="../payload/seabios/seavgabios.bin"
+
 printf "Building SeaBIOS payloads and SeaVGABIOS\n"
 
 [ ! -d "payload/" ] && mkdir -p payload/
@@ -42,8 +48,8 @@ cd seabios/
 cp ../resources/seabios/config/libgfxinit .config
 make silentoldconfig -j$(nproc)
 make -j$(nproc)
-mv out/bios.bin.elf ../payload/seabios/seabios_libgfxinit.elf
-mv out/vgabios.bin ../payload/seabios/seavgabios.bin
+mv out/bios.bin.elf ${seabiosrom}
+mv out/vgabios.bin ${seavgabiosrom}
 rm .config
 
 # clean it again. gotta keep it clean!
-- 
2.46.0




reply via email to

[Prev in Thread] Current Thread [Next in Thread]