summaryrefslogtreecommitdiffstats
path: root/resources/scripts/helpers/build
diff options
context:
space:
mode:
authorFrancis Rowe <info@gluglug.org.uk>2015-03-01 16:43:42 (EST)
committer Francis Rowe <info@gluglug.org.uk>2015-03-01 16:43:42 (EST)
commitd84518dae9a0eb3f642017aac862595173e8935e (patch)
tree70fa60ade95665330abe0142ef6586cfeebcaf20 /resources/scripts/helpers/build
parent41d9151df72bf086894960809778402c4d1eae74 (diff)
downloadlibreboot-d84518dae9a0eb3f642017aac862595173e8935e.zip
libreboot-d84518dae9a0eb3f642017aac862595173e8935e.tar.gz
libreboot-d84518dae9a0eb3f642017aac862595173e8935e.tar.bz2
build/roms/withgrub: Allow building for a custom range of boards
Diffstat (limited to 'resources/scripts/helpers/build')
-rwxr-xr-xresources/scripts/helpers/build/roms/withgrub66
1 files changed, 42 insertions, 24 deletions
diff --git a/resources/scripts/helpers/build/roms/withgrub b/resources/scripts/helpers/build/roms/withgrub
index 9e1ff42..23e6d76 100755
--- a/resources/scripts/helpers/build/roms/withgrub
+++ b/resources/scripts/helpers/build/roms/withgrub
@@ -32,6 +32,16 @@ then
mkdir bin/
fi
+boards="unknown"
+if [ $# -gt 0 ]; then
+ # build only the ROM images that were requested
+ boards="$@"
+else
+ # build all ROM images
+ boards="$(ls resources/libreboot/config/)"
+fi
+
+
# Put GRUB payloads and config files
# in the coreboot directory, ready for next step
cd coreboot/
@@ -58,44 +68,52 @@ done
cd ../
# Build ROM images for supported boards
-for board in $(ls resources/libreboot/config/)
+for board in $boards
do
- ./build roms helper $board
+ if [ -f resources/libreboot/config/"$board"/config ]; then
+ ./build roms helper $board
+ fi
done
# Needed on i945 systems for the bucts/dd trick (documented)
# This enables the ROM to be flashed over the lenovo bios firmware
for i945board in x60 t60
do
- cd bin/"$i945board"/
- for i945rom in $(ls)
- do
- dd if="$i945rom" of=top64k.bin bs=1 skip=$[$(stat -c %s "$i945rom") - 0x10000] count=64k
- dd if=top64k.bin of="$i945rom" bs=1 seek=$[$(stat -c %s "$i945rom") - 0x20000] count=64k conv=notrunc
- rm -f top64k.bin
- done
- cd ../../
+ if [ -d bin/"$i945board"/ ]; then
+ cd bin/"$i945board"/
+ for i945rom in $(ls)
+ do
+ dd if="$i945rom" of=top64k.bin bs=1 skip=$[$(stat -c %s "$i945rom") - 0x10000] count=64k
+ dd if=top64k.bin of="$i945rom" bs=1 seek=$[$(stat -c %s "$i945rom") - 0x20000] count=64k conv=notrunc
+ rm -f top64k.bin
+ done
+ cd ../../
+ fi
done
# Build the deblobbed descriptor+gbe regions for GM45/ICH9M targets.
# Then put them in the ROM images.
-cd bin/
-../resources/utilities/ich9deblob/ich9gen
-for board in "x200" "r400"
-do
- for romsize in "4m" "8m"
+if [ -d bin/ ]; then
+ cd bin/
+ ../resources/utilities/ich9deblob/ich9gen
+ for board in "x200" "r400"
do
- cd "$board"_"$romsize"b/
- for rom in $(ls)
- do
- dd if=../ich9fdgbe_"$romsize".bin of="$rom" bs=1 count=12k conv=notrunc
+ for romsize in "4m" "8m"
+ do
+ if [ -d "$board"_"$romsize"b/ ]; then
+ cd "$board"_"$romsize"b/
+ for rom in $(ls)
+ do
+ dd if=../ich9fdgbe_"$romsize".bin of="$rom" bs=1 count=12k conv=notrunc
+ done
+ cd ../
+ fi
done
- cd ../
done
-done
-rm -f ich9fdgbe_4m.bin
-rm -f ich9fdgbe_8m.bin
-cd ../
+ rm -f ich9fdgbe_4m.bin
+ rm -f ich9fdgbe_8m.bin
+ cd ../
+fi
# The GRUB payloads are no longer needed
rm -f coreboot/grub_vesafb.elf