From 0036d6e15f9f8935507c0c30391254b4a46d35b6 Mon Sep 17 00:00:00 2001 From: Francis Rowe Date: Sat, 22 Nov 2014 06:02:41 +0000 Subject: build: Only generate the GRUB configurations once Should speed up the build process a little bit. --- build | 20 +++++++++++++++++--- buildrom-withgrub | 16 ---------------- 2 files changed, 17 insertions(+), 19 deletions(-) diff --git a/build b/build index 3bd92d9..00e6c37 100755 --- a/build +++ b/build @@ -1,7 +1,7 @@ #!/bin/bash # -# build script: builds the ROM images and puts them in ./bin/ +# build script: builds the ROM images with GRUB payloads and puts them in ./bin/ # # Copyright (C) 2014 Francis Rowe # @@ -26,8 +26,8 @@ set -u -e -v # MAKE SURE THAT YOU RAN "buildall" OR "builddeps" *AT LEAST ONCE* # BEFORE RUNNING THIS! -# Build the GRUB payloads (ELF executable) -# and add them to the coreboot directory: +# Put GRUB payloads and config files +# in the coreboot directory, ready for next step cd coreboot/ for romtype in txtmode vesafb do @@ -36,6 +36,18 @@ do rm -rf ../../../coreboot/grub_"$romtype".elf mv grub_"$romtype".elf ../../../coreboot/ cd ../../../coreboot + + # GRUB configuration files + for keymap in $(ls ../resources/utilities/grub-assemble/keymap/original) + do + cat ../resources/grub/config/extra/common.cfg > grub_"$keymap"_"$romtype".cfg + cat ../resources/grub/config/extra/"$romtype".cfg >> grub_"$keymap"_"$romtype".cfg + echo "keymap $keymap" >> grub_"$keymap"_"$romtype".cfg + cat ../resources/grub/config/menuentries/common.cfg >> grub_"$keymap"_"$romtype".cfg + cat ../resources/grub/config/menuentries/"$romtype".cfg >> grub_"$keymap"_"$romtype".cfg + # grubtest.cfg should be able to switch back to grub.cfg + sed 's/grubtest.cfg/grub.cfg/' < grub_"$keymap"_"$romtype".cfg > grub_"$keymap"_"$romtype"_test.cfg + done done cd ../ @@ -48,6 +60,8 @@ done # The GRUB payloads are no longer needed rm -rf coreboot/grub_vesafb.elf rm -rf coreboot/grub_txtmode.elf +# The GRUB configs are no longer needed +rm -rf coreboot/grub*cfg # ------------------- DONE ---------------------- diff --git a/buildrom-withgrub b/buildrom-withgrub index 99af39f..20f28f0 100755 --- a/buildrom-withgrub +++ b/buildrom-withgrub @@ -66,21 +66,8 @@ do # copy the images based on the keymap cp "$1"_"$romtype".rom "$1"_"$keymap"_"$romtype".rom - # generate the correct grub config - touch grub_"$keymap"_"$romtype".cfg - # generate contents: - cat ../resources/grub/config/extra/common.cfg >> grub_"$keymap"_"$romtype".cfg - cat ../resources/grub/config/extra/"$romtype".cfg >> grub_"$keymap"_"$romtype".cfg - echo "keymap $keymap" >> grub_"$keymap"_"$romtype".cfg - cat ../resources/grub/config/menuentries/common.cfg >> grub_"$keymap"_"$romtype".cfg - cat ../resources/grub/config/menuentries/"$romtype".cfg >> grub_"$keymap"_"$romtype".cfg - # Insert grub config into the image ./util/cbfstool/cbfstool "$1"_"$keymap"_"$romtype".rom add -f grub_"$keymap"_"$romtype".cfg -n grub.cfg -t raw - - # grubtest.cfg should be able to switch back to grub.cfg - sed 's/grubtest.cfg/grub.cfg/' < grub_"$keymap"_"$romtype".cfg > grub_"$keymap"_"$romtype"_test.cfg - # Insert grub test config into the image (for the user to test modifications to before modifying the main one) ./util/cbfstool/cbfstool "$1"_"$keymap"_"$romtype".rom add -f grub_"$keymap"_"$romtype"_test.cfg -n grubtest.cfg -t raw done @@ -91,9 +78,6 @@ done # Now we clean up and prepare the bin directory containing all the images # ---------------------------------------------------------------------------------------------------------------------------- -# we don't need the grub configs anymore -rm -rf grub*cfg - # prepare directory for new ROM images rm -rf "$1" mkdir "$1" -- cgit v1.2.3-54-g00ecf