libreboot

Unnamed repository; edit this file 'description' to name the repository.
Log | Files | Refs | README

commit d3b1dbf0013988b18f35645996ca37d3f4357cef
parent 58caf14937c73246b1b2aca31b5c92c49332fb01
Author: Klemens Nanni <contact@autoboot.org>
Date:   Thu,  5 Nov 2015 18:37:16 +0100

roms/withgrub: Keep it simple

Diffstat:
resources/scripts/helpers/build/roms/withgrub | 46++++++++++++++++++++--------------------------
1 file changed, 20 insertions(+), 26 deletions(-)

diff --git a/resources/scripts/helpers/build/roms/withgrub b/resources/scripts/helpers/build/roms/withgrub @@ -4,6 +4,7 @@ # helper script: build ROM images with GRUB and put them in ./bin/ # # Copyright (C) 2014, 2015 Francis Rowe <info@gluglug.org.uk> +# Copyright (C) 2015 Klemens Nanni <contact@autoboot.org> # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by @@ -20,43 +21,36 @@ # # This script assumes that the working directory is the root -# of libreboot_src or git +# of git or release archive [ "x${DEBUG+set}" = 'xset' ] && set -v set -u -e printf "Building ROM images with the GRUB payload\n" -if [ ! -d "bin/" ] -then - mkdir "bin/" -fi +[ -d bin ] || mkdir bin # Put GRUB payloads and config files # in the coreboot directory, ready for next step -cd "coreboot/" -for romtype in txtmode vesafb -do - cd "../resources/utilities/grub-assemble" +cd coreboot +for romtype in txtmode vesafb; do + cd ../resources/utilities/grub-assemble ./gen.sh ${romtype} - rm -f "../../../coreboot/grub_${romtype}.elf" - mv "grub_${romtype}.elf" "../../../coreboot/" - cd "../../../coreboot" + rm -f ../../../coreboot/grub_${romtype}.elf + mv grub_${romtype}.elf ../../../coreboot/ + cd ../../../coreboot # GRUB configuration files - for keylayout in ../resources/utilities/grub-assemble/keymap/original/* - do - keymap="${keylayout##*/}" - cat "../resources/grub/config/extra/common.cfg" > "grub_${keymap}_${romtype}.cfg" - cat "../resources/grub/config/extra/${romtype}.cfg" >> "grub_${keymap}_${romtype}.cfg" - printf "keymap %s\n" "${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" + for keylayout in ../resources/utilities/grub-assemble/keymap/original/*; do + keymap=${keylayout##*/} + cat ../resources/grub/config/extra/{common,${romtype}}.cfg > grub_${keymap}_${romtype}.cfg + printf "keymap %s\n" ${keymap} >> grub_${keymap}_${romtype}.cfg + cat ../resources/grub/config/menuentries/{common,$(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" + sed 's/grubtest.cfg/grub.cfg/' grub_${keymap}_${romtype}.cfg > grub_${keymap}_${romtype}_test.cfg done done -cd ../ +cd .. # Build ROM images for supported boards buildrom() { @@ -67,12 +61,12 @@ buildrom() { } if [ $# -gt 0 ]; then - for board in "${@}"; do - buildrom "$board" + for board in ${@}; do + buildrom ${board} done else for board in resources/libreboot/config/grub/*; do - buildrom "${board##*/}" + buildrom ${board##*/} done fi @@ -136,6 +130,6 @@ if [ -d "bin/grub/" ]; then fi # The GRUB files are no longer needed -rm -f "coreboot/grub"*.{elf,cfg} +rm -f coreboot/grub*.{elf,cfg} printf "\n\n"