download: Add --help in the individual download scripts

This doesn't change the existing usage of the scripts:
- For the Coreboot script, before this change, all arguments that were
  passed were considered as board to download the Coreboot source code
  for.

  Here we added the '--help' and '--list-boards' arguments, so it
  should not be an issue as it is extremely unlikely that a board
  would be called '--help' or '--list-boards'.

- All the other scripts don't use any arguments so passing --help
  should not conflict with the existing usage.

Signed-off-by: Denis 'GNUtoo' Carikli <GNUtoo@cyberdimension.org>
This commit is contained in:
Denis 'GNUtoo' Carikli 2022-02-16 14:04:16 +01:00
parent 4b2d426a20
commit 2bb805e2e0
Signed by: GNUtoo
GPG Key ID: 5F5DFCC14177E263
7 changed files with 124 additions and 0 deletions

View File

@ -60,6 +60,9 @@ help() {
coreboot trees by default, but './download coreboot x60' will only download coreboot trees by default, but './download coreboot x60' will only download
the coreboot tree required for the target: x60 the coreboot tree required for the target: x60
Each program download script should also accept the --help paramater to
display the usage of the script.
Refer to the documentation for more information. Refer to the documentation for more information.
EOF EOF
} }

View File

@ -21,6 +21,42 @@
[ "x${DEBUG+set}" = 'xset' ] && set -v [ "x${DEBUG+set}" = 'xset' ] && set -v
set -u -e set -u -e
list_supported_boards()
{
for board in resources/coreboot/*; do
echo $board | sed 's#resources/coreboot/##'
done
}
usage()
{
progname="./download coreboot"
printf "Usage:\n"
printf "\t%s # %s\n" \
"${progname}" \
"Download and deblob Coreboot for all the boards"
printf "\t%s [board [board] ...] # %s\n" \
"${progname}" \
"Download and deblob Coreboot for the given boards"
printf "\t%s --list-boards # %s\n" \
"${progname}" \
"Prints this help"
printf "\t%s --help # %s\n" \
"${progname}" \
"List supported boards"
printf "\t%s --help # %s\n" \
"${progname}" \
"Prints this help"
}
if [ $# -eq 1 -a "$1" == "--help" ] ; then
usage
exit 0
elif [ $# -eq 1 -a "$1" == "--list-boards" ] ; then
list_supported_boards
exit 0
fi
# set this when you want to modify each coreboot tree # set this when you want to modify each coreboot tree
# for example, you want to test custom patches # for example, you want to test custom patches
# NODELETE= ./download coreboot # NODELETE= ./download coreboot

View File

@ -21,6 +21,23 @@
[ "x${DEBUG+set}" = 'xset' ] && set -v [ "x${DEBUG+set}" = 'xset' ] && set -v
set -u -e set -u -e
usage()
{
progname="./download flashrom"
printf "Usage:\n"
printf "\t%s # %s\n" \
"${progname}" \
"Download flashrom"
printf "\t%s --help # %s\n" \
"${progname}" \
"Prints this help"
}
if [ $# -ne 0 ] ; then
usage
exit 0
fi
# Get flashrom at the last previously tested revision # Get flashrom at the last previously tested revision
# Remove the old version that may still exist: # Remove the old version that may still exist:

View File

@ -21,6 +21,23 @@
[ "x${DEBUG+set}" = 'xset' ] && set -v [ "x${DEBUG+set}" = 'xset' ] && set -v
set -u -e set -u -e
usage()
{
progname="./download grub"
printf "Usage:\n"
printf "\t%s # %s\n" \
"${progname}" \
"Download GRUB"
printf "\t%s --help # %s\n" \
"${progname}" \
"Prints this help"
}
if [ $# -ne 0 ] ; then
usage
exit 0
fi
# Remove the old version that may still exist # Remove the old version that may still exist
# ------------------------------------------------------------------------------ # ------------------------------------------------------------------------------

View File

@ -21,6 +21,23 @@
[ "x${DEBUG+set}" = 'xset' ] && set -v [ "x${DEBUG+set}" = 'xset' ] && set -v
set -u -e set -u -e
usage()
{
progname="./download ich9utils"
printf "Usage:\n"
printf "\t%s # %s\n" \
"${progname}" \
"Download ich9utils"
printf "\t%s --help # %s\n" \
"${progname}" \
"Prints this help"
}
if [ $# -ne 0 ] ; then
usage
exit 0
fi
printf "Downloading ich9utils\n" printf "Downloading ich9utils\n"
if [ -d ich9utils ]; then if [ -d ich9utils ]; then

View File

@ -23,6 +23,23 @@
[ "x${DEBUG+set}" = 'xset' ] && set -v [ "x${DEBUG+set}" = 'xset' ] && set -v
set -u -e set -u -e
usage()
{
progname="./download memtest86plus"
printf "Usage:\n"
printf "\t%s # %s\n" \
"${progname}" \
"Download MemTest86+"
printf "\t%s --help # %s\n" \
"${progname}" \
"Prints this help"
}
if [ $# -ne 0 ] ; then
usage
exit 0
fi
# Get the last version of MemTest86+ used, apply patches, build it. # Get the last version of MemTest86+ used, apply patches, build it.
# Remove the old version that may exist # Remove the old version that may exist

View File

@ -19,6 +19,23 @@
[ "x${DEBUG+set}" = 'xset' ] && set -v [ "x${DEBUG+set}" = 'xset' ] && set -v
set -u -e set -u -e
usage()
{
progname="./download seabios"
printf "Usage:\n"
printf "\t%s # %s\n" \
"${progname}" \
"Download SeaBIOS"
printf "\t%s --help # %s\n" \
"${progname}" \
"Prints this help"
}
if [ $# -ne 0 ] ; then
usage
exit 0
fi
# Get SeaBIOS, revert to commit last used and apply patches. # Get SeaBIOS, revert to commit last used and apply patches.
# Remove the old version that may still exist # Remove the old version that may still exist