Files
Kiwy-Signage/scripts/download_offline_packages.sh
T
SKE087 31807f37bf Cleanup repo + harden offline install and watchdog
Repo hygiene:
- Remove dead scripts (.wait-for-display, .display-keepalive, .keep-screen-alive)
- Remove stale backup/scratch (install.sh.bak, New.txt, stale .pyc)
- Stop tracking machine-specific/generated state (config/app_config.json,
  playlists/server_playlist.json, src/player_auth.json, generated launchers)
- Prune duplicate wheel versions (one per package)
- Reorganize working_files -> dev/, dev/tests/, documentation/dev-notes/, scripts/
- Extend .gitignore; fix no-op rules in repo/.gitignore

Offline install (install.sh):
- Non-fatal system-dep step; per-package apt retry; .deb bundle install
- Skip pip self-upgrade offline; guard online fallbacks behind connectivity probe
- Dependency-free fetch_url (curl/wget/urllib); --no-reboot flag
- Fix corrupted literal backslash-bang escapes (shebangs, test -f, banner)
- Idempotent cron install (no more stacked @reboot lines)

Autostart / watchdog:
- start.sh: single-instance flock lock (.player_watchdog.lock) acquired only
  after a display is confirmed, preventing parallel watchdogs
- Set XDG_RUNTIME_DIR when missing; exit early if headless
- run_player.sh: activate .venv; stop_player.sh: clear lock file
2026-10-14 23:29:14 +03:00

74 lines
2.2 KiB
Bash
Executable File

#!/bin/bash
# Download Offline Packages Script for Kivy Signage Player
# This script downloads all necessary Python packages and documents system packages
set -e
SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
PROJECT_ROOT="$(cd "$SCRIPT_DIR/.." && pwd)"
REPO_DIR="$PROJECT_ROOT/repo"
WHEELS_DIR="$REPO_DIR/python-wheels"
SYSTEM_DIR="$REPO_DIR/system-packages"
echo "=========================================="
echo "Downloading Offline Packages"
echo "=========================================="
echo ""
# Check if repo directory exists
if [ ! -d "$REPO_DIR" ]; then
echo "Error: repo directory not found!"
echo "Creating directories..."
mkdir -p "$WHEELS_DIR"
mkdir -p "$SYSTEM_DIR"
fi
# Download Python packages
echo "Step 1: Downloading Python wheels..."
echo "--------------------"
cd "$PROJECT_ROOT"
# Check if pip is installed
if ! command -v pip3 &> /dev/null; then
echo "Error: pip3 is not installed. Please install it first:"
echo " sudo apt install python3-pip"
exit 1
fi
# Download all Python packages and their dependencies
echo "Downloading packages from requirements.txt..."
pip3 download -r requirements.txt -d "$WHEELS_DIR" --platform linux_armv7l --only-binary=:all: || \
pip3 download -r requirements.txt -d "$WHEELS_DIR" || true
# Also download for general Linux platforms as fallback
echo "Downloading cross-platform packages..."
pip3 download -r requirements.txt -d "$WHEELS_DIR" || true
echo ""
echo "Python wheels downloaded to: $WHEELS_DIR"
echo "Total wheel files: $(ls -1 "$WHEELS_DIR"/*.whl 2>/dev/null | wc -l)"
# List system packages
echo ""
echo "Step 2: System packages information"
echo "--------------------"
echo "System packages are listed in: $SYSTEM_DIR/apt-packages.txt"
echo ""
echo "To download .deb files for offline installation, run:"
echo " bash download_deb_packages.sh"
echo ""
# Summary
echo "=========================================="
echo "Download Complete!"
echo "=========================================="
echo ""
echo "Offline packages ready in: $REPO_DIR"
echo ""
echo "Next steps:"
echo "1. Copy the entire 'repo' folder to your offline system"
echo "2. Run: bash install.sh"
echo " (The installer will automatically detect and use offline packages)"
echo ""