download/coreboot: minor cleanup

This commit is contained in:
Leah Rowe
2023-05-18 12:37:55 +01:00
parent 8d9570b6f7
commit 08ad9eb15f
+8 -12
View File
@@ -2,8 +2,7 @@
# helper script: download coreboot # helper script: download coreboot
# #
# Copyright (C) 2014,2015,2016,2020,2021,2023 Leah Rowe # Copyright (C) 2014-2016,2020,2021,2023 Leah Rowe <info@minifree.org>
# <info@minifree.org>
# Copyright (C) 2022 Alper Nebi Yasak <alpernebiyasak@gmail.com> # Copyright (C) 2022 Alper Nebi Yasak <alpernebiyasak@gmail.com>
# Copyright (C) 2022 Ferass El Hafidi <vitali64pmemail@protonmail.com> # Copyright (C) 2022 Ferass El Hafidi <vitali64pmemail@protonmail.com>
# #
@@ -38,9 +37,9 @@ main()
elif [ $# -eq 1 ] && [ "$1" = "--list-boards" ] ; then elif [ $# -eq 1 ] && [ "$1" = "--list-boards" ] ; then
list_supported_boards list_supported_boards
exit 0 exit 0
else
fetch_coreboot_trees $@
fi fi
fetch_coreboot_trees $@
} }
fetch_coreboot_trees() fetch_coreboot_trees()
@@ -53,13 +52,13 @@ fetch_coreboot_trees()
if [ $# -gt 0 ]; then if [ $# -gt 0 ]; then
boards=$@ boards=$@
else else
for board in ${cbcfgsdir}/*; do for board in "${cbcfgsdir}/"*; do
[ ! -d "${board}" ] && continue [ ! -d "${board}" ] && continue
boards="${boards} ${board##*/}" boards="${boards} ${board##*/}"
done done
fi fi
for board in ${boards}; do for board in ${boards}; do
rm -f ${cbcfgsdir}/*/seen rm -f "${cbcfgsdir}"/*/seen
download_coreboot_for_board "${board}" download_coreboot_for_board "${board}"
done done
@@ -74,7 +73,7 @@ download_coreboot_for_board()
fetch_coreboot_config "${_board}" || exit 1 fetch_coreboot_config "${_board}" || exit 1
rm -f ${cbcfgsdir}/*/seen rm -f "${cbcfgsdir}"/*/seen
if [ -d "coreboot/${cbtree}" ]; then if [ -d "coreboot/${cbtree}" ]; then
printf "REMARK: download/coreboot %s: exists. Skipping.\n" \ printf "REMARK: download/coreboot %s: exists. Skipping.\n" \
@@ -120,7 +119,6 @@ fetch_coreboot_config()
break break
fi fi
done done
return 0
} }
check_config_for_board() check_config_for_board()
@@ -138,7 +136,6 @@ check_config_for_board()
return 1 return 1
fi fi
touch "${cbcfgsdir}/${_board}/seen" touch "${cbcfgsdir}/${_board}/seen"
return 0
} }
gitclone_coreboot_from_upstream() gitclone_coreboot_from_upstream()
@@ -153,7 +150,6 @@ gitclone_coreboot_from_upstream()
return 1 return 1
./gitclone coreboot || \ ./gitclone coreboot || \
return 1 return 1
return 0
} }
prepare_new_coreboot_tree() prepare_new_coreboot_tree()
@@ -172,7 +168,7 @@ prepare_new_coreboot_tree()
git reset --hard ${cbrevision} || exit 1 git reset --hard ${cbrevision} || exit 1
git submodule update --init --checkout || exit 1 git submodule update --init --checkout || exit 1
for patch in ../../${cbcfgsdir}/${cbtree}/patches/*.patch; do for patch in ../../"${cbcfgsdir}"/"${cbtree}"/patches/*.patch; do
[ ! -f "${patch}" ] && \ [ ! -f "${patch}" ] && \
continue continue
if ! git am "${patch}"; then if ! git am "${patch}"; then
@@ -204,7 +200,7 @@ usage()
list_supported_boards() list_supported_boards()
{ {
for _board in ${cbcfgsdir}/*; do for _board in "${cbcfgsdir}/"*; do
echo ${_board} | sed 's#${cbcfgsdir}/##' echo ${_board} | sed 's#${cbcfgsdir}/##'
done done
} }