summaryrefslogtreecommitdiffstats
path: root/resources/scripts/helpers
diff options
context:
space:
mode:
authorFrancis Rowe <info@gluglug.org.uk>2015-08-30 09:39:16 (EDT)
committer Francis Rowe <info@gluglug.org.uk>2015-08-30 09:39:16 (EDT)
commita7ae3b69f0abdd08689e9d6992e488cde473c59d (patch)
tree526a75bd6e2d3cb7fc9bde47f9faec93f2036fa1 /resources/scripts/helpers
parent61a8051b71ca4d494b43966154da00b9f3d7b367 (diff)
downloadlibreboot-a7ae3b69f0abdd08689e9d6992e488cde473c59d.zip
libreboot-a7ae3b69f0abdd08689e9d6992e488cde473c59d.tar.gz
libreboot-a7ae3b69f0abdd08689e9d6992e488cde473c59d.tar.bz2
build/roms/withgrub: use function instead of array
Diffstat (limited to 'resources/scripts/helpers')
-rwxr-xr-xresources/scripts/helpers/build/roms/withgrub28
1 files changed, 14 insertions, 14 deletions
diff --git a/resources/scripts/helpers/build/roms/withgrub b/resources/scripts/helpers/build/roms/withgrub
index de70b24..3032ab4 100755
--- a/resources/scripts/helpers/build/roms/withgrub
+++ b/resources/scripts/helpers/build/roms/withgrub
@@ -32,16 +32,6 @@ 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="$(for board in resources/libreboot/config/grub/*; do printf "%s\n" "${board##*/}"; done)"
-fi
-
-
# Put GRUB payloads and config files
# in the coreboot directory, ready for next step
cd "coreboot/"
@@ -68,12 +58,22 @@ done
cd ../
# Build ROM images for supported boards
-for board in ${boards}
-do
- if [ -f "resources/libreboot/config/grub/${board}/config" ]; then
+buildrom() {
+ board="$1"
+ if [[ -f "resources/libreboot/config/grub/${board}/config" ]]; then
./build roms withgrub_helper "${board}"
fi
-done
+}
+
+if [[ $# -gt 0 ]]; then
+ for board in "${@}"; do
+ buildrom "$board"
+ done
+else
+ for board in resources/libreboot/config/grub/*; do
+ buildrom "${board##*/}"
+ done
+fi
# Needed on i945 systems for the bucts/dd trick (documented)
# This enables the ROM to be flashed over the lenovo bios firmware