added installers for soundcard

This commit is contained in:
Chris Frankland-Wright 2025-06-24 19:53:41 +01:00
parent e36a4bfd87
commit a25cf2582e

137
setup.sh
View file

@ -1,117 +1,72 @@
#!/bin/bash #!/bin/bash
set -e
echo "" echo "✨ Welcome to the NTP Timeturner Installer"
echo "─────────────────────────────────────────────" echo "Preparing the Time Room... Stand by."
echo " Welcome to the NTP Timeturner Installer"
echo "─────────────────────────────────────────────"
echo ""
echo "\"It's a very complicated piece of magic...\" Hermione Granger"
echo "Initialising temporal calibration sequence..."
echo "Requesting clearance from the Ministry of Time Standards..."
echo ""
# --------------------------------------------------------- # ─────────────────────────────────────────────
# Step 1: Update and upgrade packages # Step 1: Update System
# --------------------------------------------------------- # ─────────────────────────────────────────────
echo "" echo "Step 1: Updating system packages..."
echo "Step 1: Updating package lists..." sudo apt update && sudo apt upgrade -y
sudo apt update
echo "Upgrading installed packages..." # ─────────────────────────────────────────────
sudo apt upgrade -y # Step 2: Install Core Dependencies
# ─────────────────────────────────────────────
echo "Step 2: Installing core dependencies..."
sudo apt install -y \
git cmake build-essential \
libjack-jackd2-dev libsamplerate0-dev \
libasound2-dev libsndfile1-dev \
python3 python3-pip python3-numpy python3-matplotlib
# --------------------------------------------------------- # ─────────────────────────────────────────────
# Step 2: Install essential development tools # Step 3: Install Python Audio Libraries
# --------------------------------------------------------- # ─────────────────────────────────────────────
echo "" echo "Step 3: Installing Python audio libraries..."
echo "Step 2: Installing development tools..." pip3 install sounddevice
sudo apt install -y git curl python3 python3-pip build-essential autoconf automake libtool cmake
# --------------------------------------------------------- # ─────────────────────────────────────────────
# Step 3: Install audio and media dependencies # Step 4: Install Splash Screen
# --------------------------------------------------------- # ─────────────────────────────────────────────
echo "" echo "Step 4: Installing custom splash screen..."
echo "Step 3: Installing audio libraries and tools..." sudo cp splash.png /usr/share/plymouth/themes/pix/splash.png
sudo apt install -y alsa-utils ffmpeg \
portaudio19-dev python3-pyaudio \
libasound2-dev libjack-jackd2-dev \
libsndfile-dev \
|| echo "Warning: Some audio dependencies may have failed to install — continuing anyway."
# --------------------------------------------------------- # ─────────────────────────────────────────────
# Step 4: Install Python packages # Step 5: Build libltc
# --------------------------------------------------------- # ─────────────────────────────────────────────
echo ""
echo "Step 4: Installing Python packages..."
pip3 install numpy --break-system-packages
# ---------------------------------------------------------
# Step 5: Build and install libltc (needed by ltc-tools)
# ---------------------------------------------------------
echo ""
echo "Step 5: Building libltc (the heart of our time-magic)..." echo "Step 5: Building libltc (the heart of our time-magic)..."
cd ~ cd ~
if [ ! -d "libltc" ]; then if [ ! -d "libltc" ]; then
echo "Cloning libltc from GitHub..."
git clone https://github.com/x42/libltc.git git clone https://github.com/x42/libltc.git
fi fi
cd libltc cd libltc
cmake .
echo "Preparing libltc build..."
./autogen.sh
./configure
echo "Compiling libltc..."
make make
echo "Installing libltc..."
sudo make install sudo make install
sudo ldconfig sudo ldconfig
# --------------------------------------------------------- # ─────────────────────────────────────────────
# Step 6: Build and install ltc-tools # Step 6: Build ltc-tools
# --------------------------------------------------------- # ─────────────────────────────────────────────
echo "" echo "Step 6: Building ltc-tools..."
echo "Step 6: Building ltc-tools (with a gentle nudge)..."
cd ~ cd ~
if [ ! -d "ltc-tools" ]; then if [ ! -d "ltc-tools" ]; then
echo "Cloning ltc-tools from GitHub..."
git clone https://github.com/x42/ltc-tools.git git clone https://github.com/x42/ltc-tools.git
fi fi
cd ltc-tools cd ltc-tools
make
echo "Compiling ltc-tools (bypassing package check)..."
make HAVE_LIBLTC=true
echo "Installing ltc-tools..."
sudo make install sudo make install
sudo ldconfig
# --------------------------------------------------------- # ─────────────────────────────────────────────
# Step 7: Apply Custom Splash Screen # Step 7: Set Hostname
# --------------------------------------------------------- # ─────────────────────────────────────────────
echo "" echo "Step 7: Configuring hostname..."
echo "Step 7: Applying splash screen..." sudo hostnamectl set-hostname ntp-timeturner
sudo curl -L -o /usr/share/plymouth/themes/pix/splash.png https://raw.githubusercontent.com/cjfranko/NTP-Timeturner/master/splash.png # ─────────────────────────────────────────────
sudo chmod 644 /usr/share/plymouth/themes/pix/splash.png # Complete
# ─────────────────────────────────────────────
# --------------------------------------------------------- echo "✨ Installation complete."
# Final Message & Reboot Option echo "System will reboot in 30 seconds unless you press [Enter] to reboot now."
# --------------------------------------------------------- read -t 30 -p "Press [Enter] to reboot now or wait..." input
echo ""
echo "─────────────────────────────────────────────"
echo " Setup Complete"
echo "─────────────────────────────────────────────"
echo ""
echo "The TimeTurner is ready. But remember:"
echo "\"You must not be seen.\" Hermione Granger"
echo "Visual enhancements are in place. Terminal timeline is stable."
echo ""
echo "The system will reboot in 30 seconds to complete setup..."
echo "Press [Enter] to reboot immediately, or Ctrl+C to cancel."
read -t 30 -p "" || true
sleep 1
sudo reboot sudo reboot