summaryrefslogtreecommitdiff
path: root/script/build
diff options
context:
space:
mode:
authorLeah Rowe <leah@libreboot.org>2023-12-16 07:56:26 +0000
committerLeah Rowe <leah@libreboot.org>2023-12-16 07:56:26 +0000
commit1eb4df6748f94a08d44c623a56417199b99b371d (patch)
treee45f8b519cfe1e22dda8ef18763f8ae3546c477f /script/build
parent54ca5f24d20531ac728a9475a94912f0a08f29f7 (diff)
fix several shellcheck warnings
lbmk didn't quote certain arguments in commands, or used ! -z instead of -n, things like that. simple fixes. Signed-off-by: Leah Rowe <leah@libreboot.org>
Diffstat (limited to 'script/build')
-rwxr-xr-xscript/build/grub2
-rwxr-xr-xscript/build/roms8
-rwxr-xr-xscript/build/serprog10
3 files changed, 10 insertions, 10 deletions
diff --git a/script/build/grub b/script/build/grub
index 5fa47c00..dc489838 100755
--- a/script/build/grub
+++ b/script/build/grub
@@ -45,7 +45,7 @@ build_keymap_configs()
{
for keylayoutfile in "${grubcfgsdir}/keymap/"*.gkb; do
[ -f "${keylayoutfile}" ] || continue
- keymap="${keylayoutfile##${grubcfgsdir}/keymap/}"
+ keymap="${keylayoutfile##"${grubcfgsdir}/keymap/"}"
keymap="${keymap%.gkb}"
printf "keymap %s\n" "${keymap}" > \
"${elfdir}/keymap_${keymap}.cfg" || err "!insert keymap"
diff --git a/script/build/roms b/script/build/roms
index a96ad89b..c1bca851 100755
--- a/script/build/roms
+++ b/script/build/roms
@@ -64,7 +64,7 @@ main()
[ -z "${targets}" ] && err "No ROM images were compiled"
printf "\nROM images available in these directories:\n"
- printf "${targets}^^ ROM images available in these directories.\n\n"
+ printf "%s^^ ROM images available in these directories.\n\n" "${targets}"
printf "DO NOT flash ROM images from elf/ - please use bin/ instead.\n"
}
@@ -230,7 +230,7 @@ build_roms()
_cbrom="elf/coreboot_nopayload_DO_NOT_FLASH/${board}/${initmode}_${displaymode}"
[ "${initmode}" = "normal" ] && \
- _cbrom="${_cbrom%_${displaymode}}"
+ _cbrom="${_cbrom%"_${displaymode}"}"
_cbrom="${_cbrom}/coreboot.rom"
cbrom="$(mktemp -t coreboot_rom.XXXXXXXXXX)"
x_ cp "${_cbrom}" "${cbrom}"
@@ -349,7 +349,7 @@ mkSeabiosRom() {
x_ cp "${_cbrom}" "${tmprom}"
x_ "${cbfstool}" "${tmprom}" add-payload -f "${_seabioself}" \
- -n ${_seabios_cbfs_path} -c lzma
+ -n "${_seabios_cbfs_path}" -c lzma
x_ "${cbfstool}" "${tmprom}" add-int -i 3000 -n etc/ps2-keyboard-spinup
z="2"; [ "${initmode}" = "vgarom" ] && z="0"
@@ -405,7 +405,7 @@ mkUbootRom() {
x_ cp "${_cbrom}" "${tmprom}"
x_ "${cbfstool}" "${tmprom}" add-payload -f "${_ubootelf}" \
- -n ${_uboot_cbfs_path} -c lzma
+ -n "${_uboot_cbfs_path}" -c lzma
printf "%s\n" "${tmprom}"
}
diff --git a/script/build/serprog b/script/build/serprog
index 7f8664a9..33319de6 100755
--- a/script/build/serprog
+++ b/script/build/serprog
@@ -50,24 +50,24 @@ main()
build_rp2040_rom()
{
board=${1}
- printf "Building pico-serprog for ${board}\n"
+ printf "Building pico-serprog for %s\n" "${board}"
x_ cmake -DPICO_BOARD="${board}" -DPICO_SDK_PATH="${pico_sdk_dir}" \
-B "${pico_src_dir}/build" "${pico_src_dir}"
x_ cmake --build "${pico_src_dir}/build"
x_ mv ${pico_src_dir}/build/pico_serprog.uf2 \
bin/serprog_rp2040/serprog_${board}.uf2
- printf "output to bin/serprog_rp2040/serprog_${board}.uf2\n"
+ printf "output to bin/serprog_rp2040/serprog_%s.uf2\n" "${board}"
}
build_stm32_rom()
{
board=${1}
- printf "Building stm32-vserprog for ${board}\n"
+ printf "Building stm32-vserprog for %s\n" "${board}"
x_ make -C ${stm32_src_dir} libopencm3-just-make BOARD=${board}
x_ make -C ${stm32_src_dir} BOARD=${board}
x_ mv ${stm32_src_dir}/stm32-vserprog.hex \
bin/serprog_stm32/serprog_${board}.hex
- printf "output to bin/serprog_stm32/serprog_${board}.hex\n"
+ printf "output to bin/serprog_stm32/serprog_%s.hex\n" "${board}"
}
print_boards()
@@ -78,7 +78,7 @@ print_boards()
list_boards()
{
- basename -a -s .h ${1}/*.h
+ basename -a -s .h "${1}/"*.h
}
main $@