115 lines
2.9 KiB
Bash
Executable File
115 lines
2.9 KiB
Bash
Executable File
#!/bin/bash
|
|
# Development Environment Setup Script
|
|
|
|
set -euo pipefail
|
|
|
|
echo "Setting up beOS development environment..."
|
|
|
|
# Detect distribution
|
|
if [ -f /etc/os-release ]; then
|
|
. /etc/os-release
|
|
DISTRO="${ID}"
|
|
else
|
|
echo "Error: Cannot detect Linux distribution"
|
|
exit 1
|
|
fi
|
|
|
|
# Install dependencies based on distribution
|
|
case "${DISTRO}" in
|
|
ubuntu|debian)
|
|
echo "Installing dependencies for Ubuntu/Debian..."
|
|
sudo apt-get update
|
|
sudo apt-get install -y \
|
|
build-essential \
|
|
git \
|
|
curl \
|
|
wget \
|
|
bison \
|
|
flex \
|
|
libncurses-dev \
|
|
libssl-dev \
|
|
bc \
|
|
rsync \
|
|
cpio \
|
|
unzip \
|
|
python3 \
|
|
python3-pip \
|
|
docker.io \
|
|
qemu-system-x86 \
|
|
qemu-utils
|
|
;;
|
|
fedora|rhel|centos)
|
|
echo "Installing dependencies for Fedora/RHEL/CentOS..."
|
|
sudo dnf install -y \
|
|
gcc \
|
|
gcc-c++ \
|
|
make \
|
|
git \
|
|
curl \
|
|
wget \
|
|
bison \
|
|
flex \
|
|
ncurses-devel \
|
|
openssl-devel \
|
|
bc \
|
|
rsync \
|
|
cpio \
|
|
unzip \
|
|
python3 \
|
|
python3-pip \
|
|
docker \
|
|
qemu-system-x86 \
|
|
qemu-img
|
|
;;
|
|
arch|manjaro)
|
|
echo "Installing dependencies for Arch/Manjaro..."
|
|
sudo pacman -S --needed \
|
|
base-devel \
|
|
git \
|
|
curl \
|
|
wget \
|
|
bison \
|
|
flex \
|
|
ncurses \
|
|
openssl \
|
|
bc \
|
|
rsync \
|
|
cpio \
|
|
unzip \
|
|
python \
|
|
python-pip \
|
|
docker \
|
|
qemu-system-x86 \
|
|
qemu-img
|
|
;;
|
|
*)
|
|
echo "Warning: Unknown distribution. Please install dependencies manually."
|
|
echo "Required packages:"
|
|
echo " - Build tools (gcc, make, etc.)"
|
|
echo " - Git"
|
|
echo " - Kernel build tools (bison, flex, ncurses, etc.)"
|
|
echo " - Python 3"
|
|
echo " - Docker or Podman"
|
|
echo " - QEMU (for testing)"
|
|
exit 1
|
|
;;
|
|
esac
|
|
|
|
# Check Docker/Podman
|
|
if command -v docker >/dev/null 2>&1; then
|
|
echo "Docker found. Adding user to docker group..."
|
|
sudo usermod -aG docker "$USER" || true
|
|
echo "Note: You may need to log out and back in for docker group changes to take effect."
|
|
elif command -v podman >/dev/null 2>&1; then
|
|
echo "Podman found."
|
|
else
|
|
echo "Warning: Neither Docker nor Podman found. Reproducible builds may not work."
|
|
fi
|
|
|
|
echo "Development environment setup complete!"
|
|
echo ""
|
|
echo "Next steps:"
|
|
echo " 1. Log out and back in if Docker group was added"
|
|
echo " 2. Run: ./tools/build-system/init.sh"
|
|
echo " 3. Review: configs/build.config"
|