summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rwxr-xr-xbuild20
-rwxr-xr-xbuildrom-withgrub16
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 <info@gluglug.org.uk>
#
@@ -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"