Features: - Create repo/ folder structure for offline packages - python-wheels/ for Python packages (.whl files) - system-packages/ for APT packages and .deb files - Add download_offline_packages.sh to populate Python wheels - Add download_deb_packages.sh to download system .deb packages - Update install.sh with smart online/offline detection - Auto-detects repo folder and uses offline packages - Falls back to online installation if repo is empty - Supports --offline flag for explicit offline mode - Update requirements.txt with async dependencies: - aiohttp==3.9.1 for async HTTP client - asyncio==3.4.3 for async I/O framework - Add OFFLINE_INSTALLATION.md with complete guide - Add .gitignore to exclude downloaded packages from repo - Document all system dependencies in apt-packages.txt Downloaded packages: - 18 Python wheels with all dependencies - Total size: ~50 MB for Python packages - Ready for offline deployment
73 lines
2.2 KiB
Bash
Executable File
73 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)"
|
|
REPO_DIR="$SCRIPT_DIR/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 "$SCRIPT_DIR"
|
|
|
|
# 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 ""
|