mirror of
https://github.com/fosslinux/live-bootstrap.git
synced 2026-03-19 17:53:00 +01:00
Merge pull request #215 from eduardosm/dl-distfiles-script
Add script to automatically download all sysa and sysc distfiles without Python
This commit is contained in:
commit
9634b6d059
4 changed files with 49 additions and 2 deletions
|
|
@ -24,7 +24,7 @@ shell_lint_task:
|
||||||
- apt-get -y install shellcheck
|
- apt-get -y install shellcheck
|
||||||
- apt-get -y clean
|
- apt-get -y clean
|
||||||
check_script:
|
check_script:
|
||||||
- shellcheck sysa/run.sh sysb/init sysb/run.sh sysc/init sysc/run.sh sysc/run2.sh sysa/helpers.sh
|
- shellcheck sysa/run.sh sysb/init sysb/run.sh sysc/init sysc/run.sh sysc/run2.sh sysa/helpers.sh download-distfiles.sh
|
||||||
|
|
||||||
reuse_lint_task:
|
reuse_lint_task:
|
||||||
container:
|
container:
|
||||||
|
|
|
||||||
|
|
@ -167,6 +167,7 @@ repository is almost completely in a form where it can be used as the
|
||||||
source of a build.
|
source of a build.
|
||||||
|
|
||||||
1. Download required tarballs into ``sysa/distfiles`` and ``sysc/distfiles``.
|
1. Download required tarballs into ``sysa/distfiles`` and ``sysc/distfiles``.
|
||||||
|
You can use the ``download-distfiles.sh`` script.
|
||||||
2. Copy sysa/stage0-posix/src/* to the root of the repository.
|
2. Copy sysa/stage0-posix/src/* to the root of the repository.
|
||||||
3. Copy sysa/stage0-posix/src/bootstrap-seeds/POSIX/x86/kaem-optional-seed
|
3. Copy sysa/stage0-posix/src/bootstrap-seeds/POSIX/x86/kaem-optional-seed
|
||||||
to init in the root of the repository.
|
to init in the root of the repository.
|
||||||
|
|
|
||||||
46
download-distfiles.sh
Executable file
46
download-distfiles.sh
Executable file
|
|
@ -0,0 +1,46 @@
|
||||||
|
#!/bin/bash
|
||||||
|
|
||||||
|
# SPDX-FileCopyrightText: 2022 fosslinux <fosslinux@aussies.space>
|
||||||
|
#
|
||||||
|
# SPDX-License-Identifier: GPL-3.0-or-later
|
||||||
|
|
||||||
|
download_source() {
|
||||||
|
local distfiles="${1}"
|
||||||
|
local url="${2}"
|
||||||
|
local checksum="${3}"
|
||||||
|
local fname="${4}"
|
||||||
|
# Default to basename of url if not given
|
||||||
|
fname="${fname:-$(basename "${url}")}"
|
||||||
|
|
||||||
|
local dest_path="${distfiles}/${fname}"
|
||||||
|
if ! [ -e "${dest_path}" ]; then
|
||||||
|
echo "Downloading ${fname}"
|
||||||
|
curl -L "${url}" --output "${dest_path}"
|
||||||
|
fi
|
||||||
|
echo "${checksum} ${dest_path}" | sha256sum -c
|
||||||
|
}
|
||||||
|
|
||||||
|
download_for_sys() {
|
||||||
|
local sysdir="${1}"
|
||||||
|
local distfiles="${sysdir}/distfiles"
|
||||||
|
|
||||||
|
mkdir -p "${distfiles}"
|
||||||
|
|
||||||
|
local entry
|
||||||
|
for entry in "${sysdir}"/*; do
|
||||||
|
[ -e "${entry}/sources" ] || continue
|
||||||
|
|
||||||
|
local line
|
||||||
|
# shellcheck disable=SC2162
|
||||||
|
while read line; do
|
||||||
|
# This is intentional - we want to split out ${line} into separate arguments.
|
||||||
|
# shellcheck disable=SC2086
|
||||||
|
download_source "${distfiles}" ${line}
|
||||||
|
done < "${entry}/sources"
|
||||||
|
done
|
||||||
|
}
|
||||||
|
|
||||||
|
set -e
|
||||||
|
cd "$(dirname "$(readlink -f "$0")")"
|
||||||
|
download_for_sys sysa
|
||||||
|
download_for_sys sysc
|
||||||
|
|
@ -131,7 +131,7 @@ build() {
|
||||||
script_name=${2:-${pkg}.sh}
|
script_name=${2:-${pkg}.sh}
|
||||||
dirname=${4:-${pkg}}
|
dirname=${4:-${pkg}}
|
||||||
|
|
||||||
# shellcheck ignore=SC2015
|
# shellcheck disable=SC2015
|
||||||
bin_preseed && return || true # Normal build if preseed fails
|
bin_preseed && return || true # Normal build if preseed fails
|
||||||
|
|
||||||
cd "${SOURCES}/${pkg}" || (echo "Cannot cd into ${pkg}!"; kill $$)
|
cd "${SOURCES}/${pkg}" || (echo "Cannot cd into ${pkg}!"; kill $$)
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue