summaryrefslogtreecommitdiffstats
path: root/resources/scripts
diff options
context:
space:
mode:
authorFrancis Rowe <info@gluglug.org.uk>2015-08-30 10:37:55 (EDT)
committer Francis Rowe <info@gluglug.org.uk>2015-08-30 10:37:55 (EDT)
commita5c7dbe4943d761ad17376a754257ae4237ecfed (patch)
tree014a8ea6362c2acd5483cc0f4886fe471cba7b25 /resources/scripts
parent618e41670702af8dc51909700c99b0c601a7547e (diff)
downloadlibreboot-a5c7dbe4943d761ad17376a754257ae4237ecfed.zip
libreboot-a5c7dbe4943d761ad17376a754257ae4237ecfed.tar.gz
libreboot-a5c7dbe4943d761ad17376a754257ae4237ecfed.tar.bz2
build/config/corebootmodify: use function instead of for loop
Diffstat (limited to 'resources/scripts')
-rwxr-xr-xresources/scripts/helpers/build/config/corebootmodify31
1 files changed, 15 insertions, 16 deletions
diff --git a/resources/scripts/helpers/build/config/corebootmodify b/resources/scripts/helpers/build/config/corebootmodify
index 6261d0b..38ab34b 100755
--- a/resources/scripts/helpers/build/config/corebootmodify
+++ b/resources/scripts/helpers/build/config/corebootmodify
@@ -25,27 +25,26 @@
[ "x${DEBUG+set}" = 'xset' ] && set -v
set -u -e
-cd "resources/libreboot/config/grub/"
+hackconfig () {
+ cd "coreboot/"
-if [ $# -lt 1 ]; then
- configs="$(for config in *; do printf "%s\n" "${config}"; done)"
-else
- configs="${*}"
-fi
-
-cd "../../../../coreboot/"
-for config in ${configs}; do
- printf "Modifying config for %s\n" "${config}"
+ printf "Modifying config for %s\n" "${1}"
sleep 2
- if [ ! -d "../resources/libreboot/config/grub/${config}/" ]; then
- printf "build/config/corebootmodify WARNING: config '%s' does not exist. Skipping.\n" "${config}"
+ if [ ! -d "../resources/libreboot/config/grub/${1}/" ]; then
+ printf "build/config/corebootmodify WARNING: config '%s' does not exist. Skipping.\n" "${1}"
continue
fi
- mv "../resources/libreboot/config/grub/${config}/config" ".config"
+ mv "../resources/libreboot/config/grub/${1}/config" ".config"
make menuconfig
- mv ".config" "../resources/libreboot/config/grub/${config}/config"
-done
+ mv ".config" "../resources/libreboot/config/grub/${1}/config"
-cd "../"
+ cd "../"
+}
+
+if [ $# -lt 1 ]; then
+ for config in resources/libreboot/config/grub/*; do hackconfig "${config##*/}"; done
+else
+ for config in "${@}"; do hackconfig "${config}"; done
+fi