mirror of
https://github.com/cjfranko/NTP-Timeturner.git
synced 2025-11-08 18:32:02 +00:00
Update setup.sh
This commit is contained in:
parent
fdaad719b0
commit
61283b27fb
1 changed files with 119 additions and 28 deletions
147
setup.sh
147
setup.sh
|
|
@ -1,43 +1,134 @@
|
||||||
#!/bin/bash
|
#!/bin/bash
|
||||||
|
set -e
|
||||||
|
|
||||||
# NTP Timeturner Setup Script
|
echo ""
|
||||||
# Tested on Debian Bookworm - Raspberry Pi 3
|
echo "─────────────────────────────────────────────"
|
||||||
# Author: cjfranko
|
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 ""
|
||||||
|
|
||||||
echo "Step 1: Updating system packages..."
|
# ---------------------------------------------------------
|
||||||
sudo apt-get update && sudo apt-get upgrade -y
|
# Step 1: Update and upgrade packages
|
||||||
|
# ---------------------------------------------------------
|
||||||
|
echo ""
|
||||||
|
echo "Step 1: Updating package lists..."
|
||||||
|
sudo apt update
|
||||||
|
|
||||||
echo "Step 2: Installing required system packages..."
|
echo "Upgrading installed packages..."
|
||||||
sudo apt-get install -y git cmake build-essential libjack-jackd2-dev \
|
sudo apt upgrade -y
|
||||||
libsndfile1-dev libtool autoconf automake \
|
|
||||||
pkg-config libasound2-dev libfftw3-dev \
|
|
||||||
python3-full python3-venv python3-pip \
|
|
||||||
libltc-dev python3-numpy python3-matplotlib python3-sounddevice
|
|
||||||
|
|
||||||
echo "Step 3: Cloning libltc and ltc-tools..."
|
# ---------------------------------------------------------
|
||||||
cd /home/hermione
|
# Step 2: Install essential development tools
|
||||||
git clone https://github.com/x42/libltc.git
|
# ---------------------------------------------------------
|
||||||
git clone https://github.com/x42/ltc-tools.git
|
echo ""
|
||||||
|
echo "Step 2: Installing development tools..."
|
||||||
|
sudo apt install -y git curl python3 python3-pip build-essential autoconf automake libtool cmake
|
||||||
|
|
||||||
|
# ---------------------------------------------------------
|
||||||
|
# Step 3: Install audio and media dependencies
|
||||||
|
# ---------------------------------------------------------
|
||||||
|
echo ""
|
||||||
|
echo "Step 3: Installing audio libraries and tools..."
|
||||||
|
sudo apt install -y alsa-utils ffmpeg \
|
||||||
|
portaudio19-dev python3-pyaudio \
|
||||||
|
libasound2-dev libjack-jackd2-dev \
|
||||||
|
libsndfile-dev \
|
||||||
|
python3-numpy python3-matplotlib python3-sounddevice \
|
||||||
|
|| echo "Warning: Some audio dependencies may have failed to install — continuing anyway."
|
||||||
|
|
||||||
|
# ---------------------------------------------------------
|
||||||
|
# Step 4: Build and install libltc (needed by ltc-tools)
|
||||||
|
# ---------------------------------------------------------
|
||||||
|
echo ""
|
||||||
echo "Step 4: Building libltc (the heart of our time-magic)..."
|
echo "Step 4: Building libltc (the heart of our time-magic)..."
|
||||||
|
cd ~
|
||||||
|
if [ ! -d "libltc" ]; then
|
||||||
|
echo "Cloning libltc from GitHub..."
|
||||||
|
git clone https://github.com/x42/libltc.git
|
||||||
|
fi
|
||||||
cd libltc
|
cd libltc
|
||||||
mkdir -p build && cd build
|
|
||||||
cmake ..
|
if [ ! -f "./configure" ]; then
|
||||||
make -j$(nproc)
|
echo "Running autogen.sh to prepare build..."
|
||||||
|
./autogen.sh
|
||||||
|
fi
|
||||||
|
|
||||||
|
echo "Configuring libltc..."
|
||||||
|
./configure
|
||||||
|
|
||||||
|
echo "Compiling libltc..."
|
||||||
|
make
|
||||||
|
|
||||||
|
echo "Installing libltc..."
|
||||||
sudo make install
|
sudo make install
|
||||||
sudo ldconfig
|
sudo ldconfig
|
||||||
|
|
||||||
echo "Step 5: Building ltc-tools..."
|
# ---------------------------------------------------------
|
||||||
cd /home/hermione/ltc-tools
|
# Step 5: Build and install ltc-tools
|
||||||
make -j$(nproc)
|
# ---------------------------------------------------------
|
||||||
|
echo ""
|
||||||
|
echo "Step 5: Building ltc-tools (with a gentle nudge)..."
|
||||||
|
cd ~
|
||||||
|
if [ ! -d "ltc-tools" ]; then
|
||||||
|
echo "Cloning ltc-tools from GitHub..."
|
||||||
|
git clone https://github.com/x42/ltc-tools.git
|
||||||
|
fi
|
||||||
|
cd ltc-tools
|
||||||
|
|
||||||
|
echo "Compiling ltc-tools (bypassing package check)..."
|
||||||
|
make HAVE_LIBLTC=true
|
||||||
|
|
||||||
|
echo "Installing ltc-tools..."
|
||||||
sudo make install
|
sudo make install
|
||||||
|
sudo ldconfig
|
||||||
|
|
||||||
echo "Step 6: Setting splash screen..."
|
# ---------------------------------------------------------
|
||||||
sudo cp /home/hermione/splash.png /usr/share/plymouth/themes/pix/splash.png
|
# Step 6: Apply Custom Splash Screen
|
||||||
|
# ---------------------------------------------------------
|
||||||
|
echo ""
|
||||||
|
echo "Step 6: Applying splash screen..."
|
||||||
|
if [ -f "/home/hermione/splash.png" ]; then
|
||||||
|
sudo cp /home/hermione/splash.png /usr/share/plymouth/themes/pix/splash.png
|
||||||
|
sudo chmod 644 /usr/share/plymouth/themes/pix/splash.png
|
||||||
|
echo "✅ Splash screen updated."
|
||||||
|
else
|
||||||
|
echo "⚠️ splash.png not found — skipping splash screen update."
|
||||||
|
fi
|
||||||
|
|
||||||
echo "Step 7: Making timeturner scripts executable..."
|
# ---------------------------------------------------------
|
||||||
chmod +x /home/hermione/*.py
|
# Step 7: Make Python scripts executable
|
||||||
|
# ---------------------------------------------------------
|
||||||
|
echo ""
|
||||||
|
echo "Step 7: Making *.py scripts executable (if any)..."
|
||||||
|
shopt -s nullglob
|
||||||
|
PYFILES=(/home/hermione/*.py)
|
||||||
|
if [ ${#PYFILES[@]} -gt 0 ]; then
|
||||||
|
chmod +x /home/hermione/*.py
|
||||||
|
echo "✅ Python scripts marked executable."
|
||||||
|
else
|
||||||
|
echo "⚠️ No Python scripts found."
|
||||||
|
fi
|
||||||
|
shopt -u nullglob
|
||||||
|
|
||||||
echo "Step 8: Setup complete. System will reboot in 30 seconds unless you press Enter..."
|
# ---------------------------------------------------------
|
||||||
echo "Press Ctrl+C or Enter now to cancel automatic reboot."
|
# Final Message & Reboot Option
|
||||||
read -t 30 -p ">> " input && sudo reboot || sudo reboot
|
# ---------------------------------------------------------
|
||||||
|
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
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue