build/boot/roms: only do 1 custom kbd/payload/mode

-k, -p and -d let you set keymap, payload and displaymode
respectively, but the handling for this is buggy when
passing multiple arguments.

Support only one argument, for simplicity. This is how
people use them anyway, and it makes lbmk less buggy.

Signed-off-by: Leah Rowe <leah@libreboot.org>
This commit is contained in:
Leah Rowe
2023-09-30 16:14:27 +01:00
parent d268f5eb28
commit 49b266eb42
3 changed files with 24 additions and 31 deletions
+7 -7
View File
@@ -13,18 +13,16 @@ set -u -e
. "include/boot.sh"
read projectname < projectname
opts=""
first=""
targets=""
# main() is in include/boot.sh
handle_targets()
{
[ -z "${displaymodes}" ] || opts="-d \"${displaymodes}\" ${opts}"
[ -z "${payloads}" ] || opts="-p \"${payloads}\" ${opts}"
[ -z "${keyboard_layouts}" ] || \
opts="-k \"${keyboard_layouts}\" ${opts}"
[ -z "${_displaymode}" ] || _displaymode="-d ${_displaymode}"
[ -z "${_payload}" ] || _payload="-p ${_payload}"
[ -z "${_keyboard_layout}" ] || \
_keyboard_layout="-k ${_keyboard_layout}"
printf "Building %s ROM images\n" "${projectname}"
@@ -46,8 +44,10 @@ check_targets()
build_bootroms()
{
opts="${_displaymode} ${_payload} ${_keyboard_layout}"
for x in ${boards}; do
./build boot roms_helper ${opts} ${x} || \
./build boot roms_helper ${_displaymode} ${_payload} \
${_keyboard_layout} ${x} || \
err "handle_targets ${opts} ${x}: build error"
[ -d "bin/${x}" ] && targets="${x} ${targets}"
done