download/coreboot: minor cleanup

fsdg20230625
Leah Rowe 2023-05-18 12:37:55 +01:00
parent 8d9570b6f7
commit 08ad9eb15f
1 changed files with 8 additions and 12 deletions

View File

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