summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLeah Rowe <leah@libreboot.org>2023-05-27 11:44:54 +0100
committerLeah Rowe <leah@libreboot.org>2023-05-27 11:44:54 +0100
commitff954c5b73c4010f9984e0c543779f3692767c0c (patch)
tree06ea78331b0ffd849c5334f33514de4c311b9f36
parent092600d163e771d31da07d88a03fe669aa4708f1 (diff)
unify download/build scripts
move resources/scripts/download/ to: resources/scripts/update/module/ This: ./download coreboot Is now: ./update module coreboot However, running "./download coreboot" still works, via backwards compatibility. Signed-off-by: Leah Rowe <leah@libreboot.org>
l---------[-rwxr-xr-x]download107
-rwxr-xr-xlbmk2
-rwxr-xr-xresources/scripts/update/module/bios_extract (renamed from resources/scripts/download/bios_extract)0
-rwxr-xr-xresources/scripts/update/module/coreboot (renamed from resources/scripts/download/coreboot)0
-rwxr-xr-xresources/scripts/update/module/flashrom (renamed from resources/scripts/download/flashrom)0
-rwxr-xr-xresources/scripts/update/module/grub (renamed from resources/scripts/download/grub)0
-rwxr-xr-xresources/scripts/update/module/me_cleaner (renamed from resources/scripts/download/me_cleaner)0
-rwxr-xr-xresources/scripts/update/module/memtest86plus (renamed from resources/scripts/download/memtest86plus)0
-rwxr-xr-xresources/scripts/update/module/mrc (renamed from resources/scripts/download/mrc)0
-rwxr-xr-xresources/scripts/update/module/seabios (renamed from resources/scripts/download/seabios)0
-rwxr-xr-xresources/scripts/update/module/u-boot (renamed from resources/scripts/download/u-boot)0
11 files changed, 3 insertions, 106 deletions
diff --git a/download b/download
index e2dbfc9b..012b4ec0 100755..120000
--- a/download
+++ b/download
@@ -1,106 +1 @@
-#!/usr/bin/env bash
-
-# Generic script for downloading programs used by the build system
-#
-# Copyright (C) 2014,2015,2020,2021,2023 Leah Rowe <info@minifree.org>
-# Copyright (C) 2015 Patrick "P. J." McDermott <pj@pehjota.net>
-# Copyright (C) 2015, 2016 Klemens Nanni <contact@autoboot.org>
-# Copyright (C) 2022 Caleb La Grange <thonkpeasant@protonmail.com>
-# Copyright (C) 2022 Alper Nebi Yasak <alpernebiyasak@gmail.com>
-#
-# This program is free software: you can redistribute it and/or modify
-# it under the terms of the GNU General Public License as published by
-# the Free Software Foundation, either version 3 of the License, or
-# (at your option) any later version.
-#
-# This program is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-# GNU General Public License for more details.
-#
-# You should have received a copy of the GNU General Public License
-# along with this program. If not, see <http://www.gnu.org/licenses/>.
-#
-
-[ "x${DEBUG+set}" = 'xset' ] && set -v
-set -u -e
-
-download=resources/scripts/download
-program=""
-
-main()
-{
- ./.gitcheck
- ./resources/scripts/misc/versioncheck
-
- rm -f "build_error"
-
- if [ $# -lt 1 ]; then
- help
- die "Please specify arguments."
- fi
-
- program="${1}"
- shift 1
-
- if [ "${program}" = help ]; then
- help
- exit 0
- elif [ "${program}" = "all" ]; then
- for downloadProgram in ${download}/*; do
- if [ ! -f "${downloadProgram}" ]; then
- continue
- fi
- "${downloadProgram}"
- done
- exit 0
- elif [ ! -f "${download}/${program}" ]; then
- help
- die "Invalid argument '${program}'. See: './download help'."
- elif [ $# -lt 1 ]; then
- "${download}/${program}"
- else
- "${download}/${program}" $@
- fi
-
- ./.gitcheck clean
-}
-
-help() {
- cat <<- EOF
- USAGE: ./download <PROGRAM> <OPTIONS>
-
- possible values for 'program':
- $(listprograms)
-
- Example: ./download flashrom
- Example: ./download coreboot
-
- Some program options allow for additional parameters:
- Example: ./download coreboot default
- Example: ./download coreboot x60
-
- Each program download script should work without extra paramaters, but
- they can be used. For example, './download coreboot' will download all
- coreboot trees by default, but './download coreboot x60' will only
- download the coreboot tree required for the target: x60
-
- Each program download script should also accept the --help parameter to
- display the usage of the script.
-
- Refer to the documentation for more information.
- EOF
-}
-
-listprograms() {
- for program in "${download}"/*; do
- printf '%s\n' "${program##*/}"
- done
-}
-
-die() {
- printf 'Error: %s\n' "${@}" 1>&2
- exit 1
-}
-
-main $@
+lbmk \ No newline at end of file
diff --git a/lbmk b/lbmk
index ca65d420..16f479c4 100755
--- a/lbmk
+++ b/lbmk
@@ -33,6 +33,8 @@ main()
{
if [ "${0##*/}" = "lbmk" ]; then
die "Do not run the lbmk script directly!"
+ elif [ "${0##*/}" = "download" ]; then
+ ./update module $@
elif [ $# -lt 2 ]; then
die "Too few arguments. Try: ${0} help"
fi
diff --git a/resources/scripts/download/bios_extract b/resources/scripts/update/module/bios_extract
index 1688aabe..1688aabe 100755
--- a/resources/scripts/download/bios_extract
+++ b/resources/scripts/update/module/bios_extract
diff --git a/resources/scripts/download/coreboot b/resources/scripts/update/module/coreboot
index 75b61a6f..75b61a6f 100755
--- a/resources/scripts/download/coreboot
+++ b/resources/scripts/update/module/coreboot
diff --git a/resources/scripts/download/flashrom b/resources/scripts/update/module/flashrom
index 6aa3cab4..6aa3cab4 100755
--- a/resources/scripts/download/flashrom
+++ b/resources/scripts/update/module/flashrom
diff --git a/resources/scripts/download/grub b/resources/scripts/update/module/grub
index 0620a775..0620a775 100755
--- a/resources/scripts/download/grub
+++ b/resources/scripts/update/module/grub
diff --git a/resources/scripts/download/me_cleaner b/resources/scripts/update/module/me_cleaner
index 7dd52be7..7dd52be7 100755
--- a/resources/scripts/download/me_cleaner
+++ b/resources/scripts/update/module/me_cleaner
diff --git a/resources/scripts/download/memtest86plus b/resources/scripts/update/module/memtest86plus
index bceadbd9..bceadbd9 100755
--- a/resources/scripts/download/memtest86plus
+++ b/resources/scripts/update/module/memtest86plus
diff --git a/resources/scripts/download/mrc b/resources/scripts/update/module/mrc
index ed0b38f3..ed0b38f3 100755
--- a/resources/scripts/download/mrc
+++ b/resources/scripts/update/module/mrc
diff --git a/resources/scripts/download/seabios b/resources/scripts/update/module/seabios
index fd72de65..fd72de65 100755
--- a/resources/scripts/download/seabios
+++ b/resources/scripts/update/module/seabios
diff --git a/resources/scripts/download/u-boot b/resources/scripts/update/module/u-boot
index 1af513a4..1af513a4 100755
--- a/resources/scripts/download/u-boot
+++ b/resources/scripts/update/module/u-boot