summaryrefslogtreecommitdiff
path: root/resources
diff options
context:
space:
mode:
Diffstat (limited to 'resources')
-rwxr-xr-xresources/scripts/build/payload/seabios64
1 files changed, 25 insertions, 39 deletions
diff --git a/resources/scripts/build/payload/seabios b/resources/scripts/build/payload/seabios
index 4a7ba626..7cff55c7 100755
--- a/resources/scripts/build/payload/seabios
+++ b/resources/scripts/build/payload/seabios
@@ -22,53 +22,39 @@
[ "x${DEBUG+set}" = 'xset' ] && set -v
set -u -e
-# Build SeaBIOS
-# ---------------------------------------------------------------------
-
printf "Building SeaBIOS payloads and SeaVGABIOS\n"
-[ ! -d "payload/" ] && mkdir -p payload/
-[ ! -d "payload/seabios" ] && mkdir -p payload/seabios/
+if [ ! -d "payload/seabios" ]; then
+ mkdir -p payload/seabios/ || exit 1
+fi
-rm -f payload/seabios/*
+rm -f payload/seabios/* || exit 1
if [ ! -d "seabios/" ]; then
- ./download seabios
+ ./download seabios || exit 1
fi
-cd seabios/
-
-# for libgfxinit setup:
-[ -f Makefile ] && make distclean
-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
-rm .config
-
-# for vgarom setup:
-[ -f Makefile ] && make distclean
-cp ../resources/seabios/config/vgarom .config
-make silentoldconfig -j$(nproc)
-make -j$(nproc)
-mv out/bios.bin.elf ../payload/seabios/seabios_vgarom.elf
-rm .config
-
-# for normal setup:
-[ -f Makefile ] && make distclean
-cp ../resources/seabios/config/normal .config
-make silentoldconfig -j$(nproc)
-make -j$(nproc)
-mv out/bios.bin.elf ../payload/seabios/seabios_normal.elf
-rm .config
+for x in normal vgarom libgfxinit; do
+ if [ ! -f seabios/Makefile ]; then
+ printf "SeaBIOS not properly downloaded.\n"
+ exit 1
+ fi
+ make distclean -BC seabios || exit 1
+ cp "resources/seabios/config/${x}" seabios/.config
+ make silentoldconfig -j$(nproc) -BC seabios || exit 1
+ make -j$(nproc) -BC seabios || exit 1
+ cp seabios/out/bios.bin.elf "payload/seabios/seabios_${x}.elf" \
+ || exit 1
+ if [ "${x}" = "libgfxinit" ]; then
+ cp seabios/out/vgabios.bin payload/seabios/seavgabios.bin \
+ || exit 1
+ fi
+ rm -f seabios/.config || exit 1
+done
# clean it again. gotta keep it clean!
-[ -f Makefile ] && make distclean
+if [ -f seabios/Makefile ]; then
+ make distclean -BC seabios || exit 1
+fi
printf "Done! SeaBIOS files are in payload/seabios/\n\n"
-
-# done. go back to main directory
-cd ../
-
-# ------------------- DONE ----------------------