Skip to content

Commit 38dd863

Browse files
authored
Merge pull request #1768 from JonathonHall-Purism/seed-mirror-script
bin/seed_package_mirror.sh: Script to seed a package mirror
2 parents 51ade5b + 9c898a7 commit 38dd863

1 file changed

Lines changed: 64 additions & 0 deletions

File tree

bin/seed_package_mirror.sh

Lines changed: 64 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,64 @@
1+
#! /usr/bin/env bash
2+
3+
set -eo pipefail
4+
5+
usage() {
6+
cat >&2 <<USAGE_END
7+
$0 <mirror-directory>
8+
9+
Downloads all current package artifacts needed to build Heads and copies them
10+
to a mirror directory, for seeding a package mirror.
11+
12+
Parameters:
13+
<mirror-directory>: Path to a directory where the packages are placed.
14+
Created if it does not already exist.
15+
USAGE_END
16+
}
17+
18+
ARGS_DONE=
19+
while [[ $# -ge 1 ]] && [ -z "$ARGS_DONE" ]; do
20+
case "$1" in
21+
--)
22+
ARGS_DONE=y
23+
shift
24+
;;
25+
--help)
26+
usage
27+
exit 0
28+
;;
29+
--*)
30+
echo "unknown parameter: $1" >&2
31+
usage
32+
exit 1
33+
;;
34+
*)
35+
ARGS_DONE=y
36+
;;
37+
esac
38+
done
39+
40+
if [[ $# -ne 1 ]]; then
41+
usage
42+
exit 1
43+
fi
44+
45+
ARG_MIRROR_DIR="$(realpath "$1")"
46+
47+
cd "$(dirname "${BASH_SOURCE[0]}")/.."
48+
49+
echo
50+
echo "Cleaning build to download all packages..."
51+
# fetch packages for representative boards
52+
rm -rf build/x86 build/ppc64
53+
rm -rf packages/x86 packages/ppc64
54+
echo
55+
echo "Downloading packages..."
56+
make packages BOARD=qemu-coreboot-fbwhiptail-tpm1-hotp
57+
make packages BOARD=talos-2 # newt, PPC
58+
make packages BOARD=librem_l1um_v2 # TPM2
59+
make packages BOARD=librem_l1um # coreboot 4.11
60+
make packages BOARD=x230-maximized # io386
61+
echo
62+
echo "Copying to mirror directory..."
63+
mkdir -p "$ARG_MIRROR_DIR"
64+
cp packages/x86/* packages/ppc64/* "$ARG_MIRROR_DIR/"

0 commit comments

Comments
 (0)