remove download scripts, consolidate into script

most of them were just calling the gitclone script,
so remove them.

the grub script was treating gnulib as a dependency.
i've now added the ability to grab 1 dependency, in
the gitclone script (it should be expanded later to
support multiple dependencies)

the gitclone script has been renamed to "fetch".
the "fetch_trees" script does more or less the same
thing, but calls "fetch" and handles multiple revisions
if a project needs that

this is more efficient, and slightly reduces the code
size of lbmk!

Signed-off-by: Leah Rowe <leah@libreboot.org>
This commit is contained in:
Leah Rowe
2023-08-17 11:41:58 +01:00
parent 8459e33bbc
commit 0848622799
27 changed files with 44 additions and 247 deletions
+1 -1
View File
@@ -25,7 +25,7 @@ set -u -e
# --------------------------------------------------------------------
if [ ! -d "bios_extract/" ]; then
./download bios_extract
./fetch bios_extract
fi
printf "Building bios_extract\n"
+1 -1
View File
@@ -29,7 +29,7 @@ set -u -e
# --------------------------------------------------------------------
if [ ! -d "flashrom/" ]; then
./download flashrom
./fetch flashrom
fi
printf "Building flashrom\n"
+1 -1
View File
@@ -27,7 +27,7 @@ main()
printf "Building GRUB\n"
if [ ! -d "grub/" ]; then
./download grub || exit 1
./fetch grub || exit 1
fi
build_grub
+1 -1
View File
@@ -31,7 +31,7 @@ set -u -e
printf "Building MemTest86+\n"
if [ ! -d "memtest86plus/" ]; then
./download memtest86plus
./fetch memtest86plus
fi
make -j$(nproc) -BC memtest86plus
+1 -1
View File
@@ -24,7 +24,7 @@ set -u -e
main()
{
if [ ! -d "uefitool" ]; then
./download uefitool || fail "cannot download uefitool"
./fetch uefitool || fail "cannot download uefitool"
fi
printf "Building uefitool (UEFIExtract)\n"
+1 -1
View File
@@ -31,7 +31,7 @@ main()
printf "Creating GRUB payloads and configuration files\n"
[ ! -d "grub/" ] && \
./download grub
./fetch grub
[ ! -f "grub/grub-mkstandalone" ] && \
./build module grub
[ ! -d "payload/" ] && \
+1 -1
View File
@@ -53,7 +53,7 @@ check_dependencies()
rm -f ${payloaddir}/* || exit 1
if [ ! -d "seabios/" ]; then
./download seabios || exit 1
./fetch seabios || exit 1
fi
}
+9 -9
View File
@@ -23,14 +23,14 @@ set -u -e
projectname="$(cat projectname)"
trees_gitclone_list="coreboot u-boot"
simple_gitclone_list="flashrom grub memtest86plus seabios me_cleaner uefitool"
simple_gitclone_list="${simple_gitclone_list} bios_extract biosutilities"
trees_fetch_list="coreboot u-boot"
simple_fetch_list="flashrom grub memtest86plus seabios me_cleaner uefitool"
simple_fetch_list="${simple_fetch_list} bios_extract biosutilities"
dirlist="resources util" # do not add blobs directory here. it's handled below
filelist="lbmk blobutil modify download build README.md COPYING Makefile update"
filelist="${filelist} version versiondate projectname .gitcheck gitclone"
filelist="lbmk blobutil modify build README.md COPYING Makefile update"
filelist="${filelist} version versiondate projectname .gitcheck fetch"
filelist="${filelist} fetch_trees"
version="version-unknown"
@@ -77,19 +77,19 @@ create_release_directory()
download_modules()
{
for modname in ${trees_gitclone_list}; do
for modname in ${trees_fetch_list}; do
[ ! -d "${modname}" ] && \
./fetch_trees ${modname}
done
for modname in ${simple_gitclone_list}; do
for modname in ${simple_fetch_list}; do
[ ! -d "${modname}/" ] && \
./download ${modname}
./fetch ${modname}
done
}
copy_files()
{
for dir in ${simple_gitclone_list} ${dirlist}; do
for dir in ${simple_fetch_list} ${dirlist}; do
cp -R "${dir}/" "${srcdir}/"
done
+1 -1
View File
@@ -30,7 +30,7 @@ main()
download_seabios()
{
if [ ! -d "seabios" ]; then
./download seabios
./fetch seabios
fi
if [ ! -d "seabios" ]; then
printf "error: Failed to download SeaBIOS. "
+5 -5
View File
@@ -184,7 +184,7 @@ build_dependencies()
{
if [ ! -d me_cleaner ]; then
printf "downloading me_cleaner\n"
./download me_cleaner || fail "could not download me_cleaner"
./fetch me_cleaner || fail "could not download me_cleaner"
fi
if [ ! -d ${cbdir} ]; then
printf "downloading coreboot\n"
@@ -193,17 +193,17 @@ build_dependencies()
fi
if [ ! -d bios_extract ]; then
printf "downloading bios_extract\n"
./download bios_extract \
./fetch bios_extract \
|| fail "could not download bios_extract"
fi
if [ ! -d biosutilities ]; then
printf "downloading biosutilities\n"
./download biosutilities \
./fetch biosutilities \
|| fail "could not download biosutilities"
fi
if [ ! -d uefitool ]; then
printf "download uefitool (for UEFIExtract)\n"
./download uefitool \
./fetch uefitool \
|| fail "could not download uefitool"
fi
if [ ! -f uefitool/uefiextract ]; then
@@ -239,7 +239,7 @@ download_blobs()
download_e6400vga || _failed="${_failed} e6400vga"
;;
*MRC*)
./download mrc || _failed="${_failed} mrc"
./update blobs mrc || _failed="${_failed} mrc"
;;
esac
done
+3 -3
View File
@@ -58,10 +58,10 @@ build_dependencies()
{
if [ ! -d me_cleaner ]; then
printf "downloading me_cleaner\n"
./download me_cleaner || fail 'could not download me_cleaner'
./fetch me_cleaner || fail 'could not download me_cleaner'
else
printf "me_cleaner already downloaded. Skipping.\n"
printf "run ./download me_cleaner to manually overwrite\n"
printf "run ./fetch me_cleaner to manually overwrite\n"
fi
if [ ! -d ${cbdir} ]; then
@@ -90,7 +90,7 @@ extract_blobs()
if [ "$CONFIG_HAVE_MRC" = "y" ]; then
printf 'haswell board detected, downloading mrc\n'
./download mrc || fail "could not download mrc"
./update blobs mrc || fail "could not download mrc"
fi
_me_destination=${CONFIG_ME_BIN_PATH#../../}
@@ -1,22 +0,0 @@
#!/usr/bin/env sh
#
# Copyright (C) 2023 Leah Rowe <info@minifree.org>
#
# 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
./gitclone bios_extract
@@ -1,22 +0,0 @@
#!/usr/bin/env sh
#
# Copyright (C) 2023 Leah Rowe <info@minifree.org>
#
# 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
./gitclone biosutilities
-24
View File
@@ -1,24 +0,0 @@
#!/usr/bin/env sh
# helper script: downloads flashrom and patches it
#
# Copyright (C) 2014, 2015, 2020, 2021 Leah Rowe <info@minifree.org>
#
# 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
./gitclone flashrom
-32
View File
@@ -1,32 +0,0 @@
#!/usr/bin/env sh
# helper script: Downloads GRUB and patches it.
#
# Copyright (C) 2014,2015,2016,2020,2021,2023 Leah Rowe
# <info@minifree.org>
#
# 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
./gitclone grub
./gitclone gnulib || rm -Rf grub/
if [ ! -d grub ]; then
printf "%s: Could not download grub and gnulib\n" ${0}
exit 1
else
exit 0
fi
@@ -1,25 +0,0 @@
#!/usr/bin/env sh
#
# Copyright (C) 2020 Leah Rowe <info@minifree.org>
#
# 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/>.
#
# This script assumes that the working directory is the
# root of retroboot_src or retroboot git.
[ "x${DEBUG+set}" = 'xset' ] && set -v
set -u -e
./gitclone me_cleaner
@@ -1,32 +0,0 @@
#!/usr/bin/env sh
# helper script: Downloads MemTest86+ and patches it
#
# Copyright (C) 2014, 2015, 2020, 2021 Leah Rowe <info@minifree.org>
# Copyright (C) 2015 Joseph Michael Thompson <jmt@josepht.me>
# Copyright (C) 2015 Klemens Nanni <contact@autoboot.org>
#
# 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
# Get the last version of MemTest86+ used, apply patches, build it.
# Remove the old version that may exist
# ------------------------------------------------------------------------------
printf "Downloading MemTest86+\n"
./gitclone memtest86plus
-29
View File
@@ -1,29 +0,0 @@
#!/usr/bin/env sh
#
# Copyright (C) 2015, 2016, 2021 Leah Rowe <info@minifree.org>
#
# 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
# Get SeaBIOS, revert to commit last used and apply patches.
# Remove the old version that may still exist
# ------------------------------------------------------------------------------
printf "Downloading SeaBIOS\n"
./gitclone seabios
-22
View File
@@ -1,22 +0,0 @@
#!/usr/bin/env sh
#
# Copyright (C) 2023 Leah Rowe <info@minifree.org>
#
# 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
./gitclone uefitool
+1 -1
View File
@@ -28,7 +28,7 @@ set -u -e
printf "Updating seabios configs\n"
if [ ! -d "seabios" ]; then
./download seabios
./fetch seabios
fi
if [ ! -d "seabios" ]; then