18 lines
1.1 KiB
Bash
18 lines
1.1 KiB
Bash
#!/bin/bash
|
|
# Ensure the Arch bootstrap used to compile the GNOME Software adapter exists.
|
|
# D-098: Flatpak seeds are refreshed only on ISO cycles, so an OSTree-only cycle
|
|
# must be able to reuse the tools root left by the previous monthly run.
|
|
set -euo pipefail
|
|
cache=$1
|
|
bootstrap=$2
|
|
if [[ -d $cache/tools/root.x86_64 ]]; then exit 0; fi
|
|
printf '%s %s\n' 655bc99849b80859173fa39338a6c910185e952173f6a1a61526cfa34ab8339c "$bootstrap" | sha256sum -c -
|
|
mkdir -p "$cache/extractor" "$cache/tools"
|
|
tar --zstd -xpf "$bootstrap" -C "$cache/extractor"
|
|
systemd-nspawn --quiet --register=no --settings=no --private-network \
|
|
-D "$cache/extractor/root.x86_64" --bind-ro="$bootstrap:/bootstrap.tar.zst" \
|
|
--bind="$cache/tools:/output" bsdtar --xattrs --acls -xpf /bootstrap.tar.zst -C /output
|
|
rm -rf "$cache/extractor"
|
|
printf 'Server = https://mirror.nw-sys.ru/archlinux/$repo/os/$arch\n' > "$cache/tools/root.x86_64/etc/pacman.d/mirrorlist"
|
|
grep -q '^DisableSandbox' "$cache/tools/root.x86_64/etc/pacman.conf" || \
|
|
sed -i '/\[options\]/a DisableSandbox' "$cache/tools/root.x86_64/etc/pacman.conf"
|