42 lines
1.2 KiB
Bash
Executable File
42 lines
1.2 KiB
Bash
Executable File
#!/usr/bin/env bash
|
|
set -euo pipefail
|
|
|
|
DISTRO="$(lsb_release -is 2>/dev/null || echo unknown)"
|
|
RELEASE="$(lsb_release -rs 2>/dev/null || echo unknown)"
|
|
|
|
if [[ "$DISTRO" != "Debian" || "$RELEASE" != "12" ]] && \
|
|
[[ "$DISTRO" != "Ubuntu" || "$RELEASE" != "22.04" ]]; then
|
|
echo "MontanaOS build environment requires Debian 12 or Ubuntu 22.04 LTS"
|
|
echo "Detected: $DISTRO $RELEASE"
|
|
exit 1
|
|
fi
|
|
|
|
sudo apt-get update
|
|
sudo apt-get install -y --no-install-recommends \
|
|
openjdk-21-jdk-headless \
|
|
git gnupg flex bison \
|
|
build-essential zip unzip curl rsync \
|
|
zlib1g-dev libncurses-dev libssl-dev \
|
|
xsltproc fontconfig \
|
|
python3 python-is-python3
|
|
|
|
mkdir -p "$HOME/.local/bin"
|
|
if [[ ! -x "$HOME/.local/bin/repo" ]]; then
|
|
curl -fsSL https://storage.googleapis.com/git-repo-downloads/repo > "$HOME/.local/bin/repo"
|
|
chmod +x "$HOME/.local/bin/repo"
|
|
fi
|
|
|
|
cat <<MSG
|
|
|
|
MontanaOS build environment ready (Debian/Ubuntu detected).
|
|
|
|
Add ~/.local/bin to PATH if not already:
|
|
export PATH="\$HOME/.local/bin:\$PATH"
|
|
|
|
Note on ccache: not installed by default. Use ccache only in dev mode,
|
|
release builds run without it (see Spec section 7.2 reproducibility).
|
|
To install for dev: sudo apt-get install ccache
|
|
|
|
Next step: ./scripts/sync-grapheneos.sh
|
|
MSG
|