gnuboot-patches
[Top][All Lists]
Advanced

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

[PATCH 16/20] cache cbfstool and ifdtool builds


From: Leah Rowe
Subject: [PATCH 16/20] cache cbfstool and ifdtool builds
Date: Sun, 14 Jan 2024 15:55:33 +0000

From: Leah Rowe <leah@libreboot.org>

coreboot's build system regularly purges these, when
executed, and parts of gnuboot expect the builds to
be there, where it currently uses them directly from
the coreboot build system.

this patch copies them to a dedicated directory within
the gnuboot build system, instead of coreboot's, and
that version is called.

this causes the roms build script to be more robust in
general, preventing build errors under certain edge cases.

Signed-off-by: Leah Rowe <leah@libreboot.org>
---
 .gitignore                          | 1 +
 resources/packages/cbutils/clean    | 2 ++
 resources/packages/cbutils/module   | 8 ++++----
 resources/packages/roms_helper/boot | 2 +-
 4 files changed, 8 insertions(+), 5 deletions(-)

diff --git a/.gitignore b/.gitignore
index bfc3cf2..c852b91 100644
--- a/.gitignore
+++ b/.gitignore
@@ -3,6 +3,7 @@
 /bin/
 /bucts/
 /build_error
+/cbutils/
 /coreboot/
 /crossgcc/
 *.date
diff --git a/resources/packages/cbutils/clean b/resources/packages/cbutils/clean
index 98095ea..3edfbd4 100755
--- a/resources/packages/cbutils/clean
+++ b/resources/packages/cbutils/clean
@@ -28,6 +28,8 @@ set -u -e
 
 printf "Cleaning the previous build of coreboot and its utilities\n"
 
+[ ! -d "cbutils" ] || rm -Rf "cbutils" || exit 1
+
 [ ! -d "coreboot/" ] && exit 0
 
 for board in coreboot/*; do
diff --git a/resources/packages/cbutils/module 
b/resources/packages/cbutils/module
index 15d9721..5e59878 100755
--- a/resources/packages/cbutils/module
+++ b/resources/packages/cbutils/module
@@ -35,10 +35,10 @@ buildutils() {
         return 1
     fi
     for util in {cbfs,ifd}tool; do
-    (
-        cd "coreboot/${cbtree}/util/${util}/"
-        make -j$(nproc) || return 1
-    )
+        [ -f "cbutils/$cbtree/$util" ] && continue
+        make -C coreboot/${cbtree}/util/${util}/ || return 1
+        mkdir -p cbutils/$cbtree || return 1
+        cp coreboot/${cbtree}/util/${util}/${util} cbutils/$cbtree || return 1
     done
     return 0
 }
diff --git a/resources/packages/roms_helper/boot 
b/resources/packages/roms_helper/boot
index 84f0555..b9d24f4 100755
--- a/resources/packages/roms_helper/boot
+++ b/resources/packages/roms_helper/boot
@@ -136,7 +136,7 @@ cbdir="coreboot/${board}"
 if [ "${board}" != "${cbtree}" ]; then
        cbdir="coreboot/${cbtree}"
 fi
-cbfstool="${cbdir}/util/cbfstool/cbfstool"
+cbfstool="cbutils/$cbtree/cbfstool"
 corebootrom="${cbdir}/build/coreboot.rom"
 seavgabiosrom="payload/seabios/seavgabios.bin"
 
-- 
2.39.2




reply via email to

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