Add offline installation support with repo folder and updated dependencies
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
This commit is contained in:
@@ -0,0 +1,158 @@
|
||||
# Offline Installation Guide
|
||||
|
||||
This guide explains how to set up and use offline installation for the Kiwy Signage Player.
|
||||
|
||||
## Overview
|
||||
|
||||
The offline installation system allows you to install the signage player on devices without internet access by pre-downloading all necessary packages.
|
||||
|
||||
## Directory Structure
|
||||
|
||||
```
|
||||
Kiwy-Signage/
|
||||
├── repo/ # Offline packages repository
|
||||
│ ├── python-wheels/ # Python packages (.whl files)
|
||||
│ ├── system-packages/ # System package information
|
||||
│ │ ├── apt-packages.txt # List of required apt packages
|
||||
│ │ └── debs/ # Downloaded .deb files (optional)
|
||||
│ └── README.md
|
||||
├── download_offline_packages.sh # Download Python packages
|
||||
├── download_deb_packages.sh # Download system .deb packages
|
||||
└── install.sh # Smart installer (online/offline)
|
||||
```
|
||||
|
||||
## Setup for Offline Installation
|
||||
|
||||
### Step 1: Prepare on a Connected System
|
||||
|
||||
On a system with internet access (preferably Raspberry Pi OS):
|
||||
|
||||
```bash
|
||||
# Clone the repository
|
||||
git clone <repository-url>
|
||||
cd Kiwy-Signage
|
||||
|
||||
# Download Python packages
|
||||
bash download_offline_packages.sh
|
||||
|
||||
# (Optional) Download system .deb packages
|
||||
bash download_deb_packages.sh
|
||||
```
|
||||
|
||||
This will populate the `repo/` folder with all necessary packages.
|
||||
|
||||
### Step 2: Transfer to Offline System
|
||||
|
||||
Copy the entire `Kiwy-Signage` directory to your offline system:
|
||||
|
||||
```bash
|
||||
# Using USB drive
|
||||
cp -r Kiwy-Signage /media/usb/
|
||||
|
||||
# Or create a tarball
|
||||
tar -czf kiwy-signage-offline.tar.gz Kiwy-Signage/
|
||||
|
||||
# On target system, extract:
|
||||
tar -xzf kiwy-signage-offline.tar.gz
|
||||
cd Kiwy-Signage
|
||||
```
|
||||
|
||||
### Step 3: Install on Offline System
|
||||
|
||||
The installer automatically detects offline packages:
|
||||
|
||||
```bash
|
||||
# Automatic detection
|
||||
bash install.sh
|
||||
|
||||
# Or explicitly specify offline mode
|
||||
bash install.sh --offline
|
||||
```
|
||||
|
||||
## Package Information
|
||||
|
||||
### Python Packages (requirements.txt)
|
||||
|
||||
- **kivy==2.1.0** - UI framework
|
||||
- **requests==2.32.4** - HTTP library
|
||||
- **bcrypt==4.2.1** - Password hashing
|
||||
- **aiohttp==3.9.1** - Async HTTP client
|
||||
- **asyncio==3.4.3** - Async I/O framework
|
||||
|
||||
### System Packages (APT)
|
||||
|
||||
See `repo/system-packages/apt-packages.txt` for complete list:
|
||||
- Python development tools
|
||||
- SDL2 libraries (video/audio)
|
||||
- FFmpeg and codecs
|
||||
- GStreamer plugins
|
||||
- Build dependencies
|
||||
|
||||
## Online Installation
|
||||
|
||||
If you have internet access, simply run:
|
||||
|
||||
```bash
|
||||
bash install.sh
|
||||
```
|
||||
|
||||
The installer will automatically download and install all packages from the internet.
|
||||
|
||||
## Updating Offline Packages
|
||||
|
||||
To update the offline package cache:
|
||||
|
||||
```bash
|
||||
# On a connected system
|
||||
bash download_offline_packages.sh
|
||||
```
|
||||
|
||||
This will download the latest versions of all packages.
|
||||
|
||||
## Troubleshooting
|
||||
|
||||
### Problem: Missing Dependencies
|
||||
|
||||
If installation fails due to missing dependencies:
|
||||
|
||||
```bash
|
||||
# Download .deb packages with dependencies
|
||||
bash download_deb_packages.sh
|
||||
|
||||
# Install with dependency resolution
|
||||
sudo apt install -f
|
||||
```
|
||||
|
||||
### Problem: Wheel Not Found
|
||||
|
||||
If a specific Python package wheel is not found:
|
||||
|
||||
```bash
|
||||
# Download specific package
|
||||
pip3 download <package-name> -d repo/python-wheels/
|
||||
```
|
||||
|
||||
### Problem: Architecture Mismatch
|
||||
|
||||
Ensure packages are downloaded on the same architecture (ARM for Raspberry Pi):
|
||||
|
||||
```bash
|
||||
# Verify architecture
|
||||
uname -m # Should show: armv7l or aarch64
|
||||
|
||||
# Force ARM downloads
|
||||
pip3 download -r requirements.txt -d repo/python-wheels/ --platform linux_armv7l
|
||||
```
|
||||
|
||||
## Storage Requirements
|
||||
|
||||
- **Python wheels**: ~50-100 MB
|
||||
- **System .deb packages**: ~200-500 MB (if downloaded)
|
||||
- **Total**: ~250-600 MB
|
||||
|
||||
## Notes
|
||||
|
||||
- The `repo/` folder is designed to be portable
|
||||
- Downloaded packages are excluded from git (see `.gitignore`)
|
||||
- The installer supports both online and offline modes seamlessly
|
||||
- System packages list is maintained in `repo/system-packages/apt-packages.txt`
|
||||
Executable
+125
@@ -0,0 +1,125 @@
|
||||
#!/bin/bash
|
||||
|
||||
# Download DEB Packages Script for Offline Installation
|
||||
# This script downloads all system .deb packages required for offline installation
|
||||
|
||||
set -e
|
||||
|
||||
SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
|
||||
SYSTEM_DIR="$SCRIPT_DIR/repo/system-packages"
|
||||
DEB_DIR="$SYSTEM_DIR/debs"
|
||||
|
||||
echo "=========================================="
|
||||
echo "Downloading DEB Packages for Offline Install"
|
||||
echo "=========================================="
|
||||
echo ""
|
||||
|
||||
# Create debs directory
|
||||
mkdir -p "$DEB_DIR"
|
||||
|
||||
# Check if running on Debian/Ubuntu/Raspberry Pi OS
|
||||
if ! command -v apt-get &> /dev/null; then
|
||||
echo "Error: This script requires apt-get (Debian/Ubuntu/Raspberry Pi OS)"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
echo "Reading package list from: $SYSTEM_DIR/apt-packages.txt"
|
||||
echo ""
|
||||
|
||||
# Update package cache
|
||||
echo "Updating package cache..."
|
||||
sudo apt update
|
||||
|
||||
# Read packages from file
|
||||
PACKAGES=$(grep -v '^#' "$SYSTEM_DIR/apt-packages.txt" | grep -v '^$' | tr '\n' ' ')
|
||||
|
||||
echo "Packages to download:"
|
||||
echo "$PACKAGES"
|
||||
echo ""
|
||||
|
||||
# Download packages and dependencies
|
||||
echo "Downloading packages with dependencies..."
|
||||
cd "$DEB_DIR"
|
||||
|
||||
# Use apt-get download to get .deb files
|
||||
for pkg in $PACKAGES; do
|
||||
echo "Downloading: $pkg"
|
||||
apt-get download "$pkg" 2>/dev/null || echo " Warning: Could not download $pkg"
|
||||
done
|
||||
|
||||
# Download dependencies
|
||||
echo ""
|
||||
echo "Downloading dependencies..."
|
||||
sudo apt-get install --download-only --reinstall -y $PACKAGES
|
||||
|
||||
# Copy downloaded debs from apt cache
|
||||
echo ""
|
||||
echo "Copying packages from apt cache..."
|
||||
sudo cp /var/cache/apt/archives/*.deb "$DEB_DIR/" 2>/dev/null || true
|
||||
|
||||
# Remove duplicate packages
|
||||
echo ""
|
||||
echo "Removing duplicates..."
|
||||
cd "$DEB_DIR"
|
||||
for file in *.deb; do
|
||||
[ -f "$file" ] || continue
|
||||
basename="${file%%_*}"
|
||||
count=$(ls -1 "${basename}"_*.deb 2>/dev/null | wc -l)
|
||||
if [ "$count" -gt 1 ]; then
|
||||
# Keep only the latest version
|
||||
ls -t "${basename}"_*.deb | tail -n +2 | xargs rm -f
|
||||
fi
|
||||
done
|
||||
|
||||
# Create installation order file
|
||||
echo ""
|
||||
echo "Creating installation order..."
|
||||
cat > "$DEB_DIR/install-order.txt" << 'EOF'
|
||||
# Install packages in this order to resolve dependencies
|
||||
|
||||
# 1. Base tools and libraries
|
||||
python3-pip_*.deb
|
||||
python3-setuptools_*.deb
|
||||
python3-dev_*.deb
|
||||
zlib1g-dev_*.deb
|
||||
|
||||
# 2. SDL2 libraries
|
||||
libsdl2-dev_*.deb
|
||||
libsdl2-image-dev_*.deb
|
||||
libsdl2-mixer-dev_*.deb
|
||||
libsdl2-ttf-dev_*.deb
|
||||
|
||||
# 3. Multimedia libraries
|
||||
libportmidi-dev_*.deb
|
||||
libswscale-dev_*.deb
|
||||
libavformat-dev_*.deb
|
||||
libavcodec-dev_*.deb
|
||||
libavcodec-extra_*.deb
|
||||
|
||||
# 4. FFmpeg and codecs
|
||||
ffmpeg_*.deb
|
||||
libx264-dev_*.deb
|
||||
|
||||
# 5. GStreamer
|
||||
gstreamer1.0-plugins-base_*.deb
|
||||
gstreamer1.0-plugins-good_*.deb
|
||||
gstreamer1.0-plugins-bad_*.deb
|
||||
gstreamer1.0-alsa_*.deb
|
||||
|
||||
# 6. Network tools
|
||||
wget_*.deb
|
||||
curl_*.deb
|
||||
EOF
|
||||
|
||||
# Summary
|
||||
echo ""
|
||||
echo "=========================================="
|
||||
echo "DEB Download Complete!"
|
||||
echo "=========================================="
|
||||
echo ""
|
||||
echo "Downloaded .deb files: $(ls -1 *.deb 2>/dev/null | wc -l)"
|
||||
echo "Location: $DEB_DIR"
|
||||
echo ""
|
||||
echo "To install offline, copy the repo folder and run:"
|
||||
echo " bash install.sh --offline"
|
||||
echo ""
|
||||
Executable
+72
@@ -0,0 +1,72 @@
|
||||
#!/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 ""
|
||||
+106
-12
@@ -1,22 +1,116 @@
|
||||
#!/bin/bash
|
||||
|
||||
# Kivy Signage Player Installation Script
|
||||
# Supports both online and offline installation
|
||||
|
||||
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"
|
||||
DEB_DIR="$SYSTEM_DIR/debs"
|
||||
|
||||
# Check for offline mode
|
||||
OFFLINE_MODE=false
|
||||
if [ "$1" == "--offline" ] || [ "$1" == "-o" ]; then
|
||||
OFFLINE_MODE=true
|
||||
echo "=========================================="
|
||||
echo "Offline Installation Mode"
|
||||
echo "=========================================="
|
||||
elif [ -d "$WHEELS_DIR" ] && [ "$(ls -A $WHEELS_DIR 2>/dev/null)" ]; then
|
||||
echo "=========================================="
|
||||
echo "Offline packages detected - Using repo folder"
|
||||
echo "=========================================="
|
||||
OFFLINE_MODE=true
|
||||
else
|
||||
echo "=========================================="
|
||||
echo "Online Installation Mode"
|
||||
echo "=========================================="
|
||||
fi
|
||||
|
||||
echo ""
|
||||
echo "Installing Kivy Signage Player dependencies..."
|
||||
echo ""
|
||||
|
||||
# Update system
|
||||
sudo apt update
|
||||
# Install system dependencies
|
||||
echo "Step 1: Installing system dependencies..."
|
||||
echo "--------------------"
|
||||
|
||||
# Install system dependencies for Kivy
|
||||
sudo apt install -y python3-pip python3-setuptools
|
||||
sudo apt install -y python3-dev
|
||||
sudo apt install -y libsdl2-dev libsdl2-image-dev libsdl2-mixer-dev libsdl2-ttf-dev
|
||||
sudo apt install -y libportmidi-dev libswscale-dev libavformat-dev libavcodec-dev
|
||||
sudo apt install -y zlib1g-dev
|
||||
if [ "$OFFLINE_MODE" = true ] && [ -d "$DEB_DIR" ] && [ "$(ls -A $DEB_DIR/*.deb 2>/dev/null)" ]; then
|
||||
# Offline: Install from local .deb files
|
||||
echo "Installing from offline .deb packages..."
|
||||
cd "$DEB_DIR"
|
||||
|
||||
# Install all .deb files with dependencies
|
||||
sudo dpkg -i *.deb 2>/dev/null || true
|
||||
|
||||
# Fix any broken dependencies
|
||||
sudo apt-get install -f -y || true
|
||||
|
||||
echo "System packages installed from offline repository"
|
||||
else
|
||||
# Online: Use apt-get
|
||||
echo "Updating package lists..."
|
||||
sudo apt update
|
||||
|
||||
echo "Installing system packages..."
|
||||
|
||||
# Read packages from file if available, otherwise use default list
|
||||
if [ -f "$SYSTEM_DIR/apt-packages.txt" ]; then
|
||||
PACKAGES=$(grep -v '^#' "$SYSTEM_DIR/apt-packages.txt" | grep -v '^$' | tr '\n' ' ')
|
||||
sudo apt install -y $PACKAGES
|
||||
else
|
||||
# Default package list
|
||||
sudo apt install -y python3-pip python3-setuptools python3-dev
|
||||
sudo apt install -y libsdl2-dev libsdl2-image-dev libsdl2-mixer-dev libsdl2-ttf-dev
|
||||
sudo apt install -y libportmidi-dev libswscale-dev libavformat-dev libavcodec-dev
|
||||
sudo apt install -y zlib1g-dev ffmpeg libavcodec-extra
|
||||
sudo apt install -y gstreamer1.0-plugins-base gstreamer1.0-plugins-good
|
||||
fi
|
||||
|
||||
echo "System packages installed successfully"
|
||||
fi
|
||||
|
||||
echo ""
|
||||
|
||||
# Install Python dependencies
|
||||
pip3 install -r requirements.txt
|
||||
echo "Step 2: Installing Python dependencies..."
|
||||
echo "--------------------"
|
||||
|
||||
echo "Installation completed!"
|
||||
echo "To run the player:"
|
||||
echo "cd src && python3 main.py"
|
||||
if [ "$OFFLINE_MODE" = true ] && [ -d "$WHEELS_DIR" ] && [ "$(ls -A $WHEELS_DIR/*.whl 2>/dev/null)" ]; then
|
||||
# Offline: Install from local wheels
|
||||
echo "Installing from offline Python wheels..."
|
||||
echo "Wheel files found: $(ls -1 $WHEELS_DIR/*.whl 2>/dev/null | wc -l)"
|
||||
|
||||
pip3 install --no-index --find-links="$WHEELS_DIR" -r requirements.txt
|
||||
|
||||
echo "Python packages installed from offline repository"
|
||||
else
|
||||
# Online: Use pip from PyPI
|
||||
echo "Installing from PyPI..."
|
||||
pip3 install -r requirements.txt
|
||||
|
||||
echo "Python packages installed successfully"
|
||||
fi
|
||||
|
||||
echo ""
|
||||
echo "=========================================="
|
||||
echo "Installation completed successfully!"
|
||||
echo "=========================================="
|
||||
echo ""
|
||||
echo "To run the signage player:"
|
||||
echo " cd src && python3 main.py"
|
||||
echo ""
|
||||
echo "Or use the run script:"
|
||||
echo " bash run_player.sh"
|
||||
echo ""
|
||||
|
||||
# Check if config exists
|
||||
if [ ! -d "$SCRIPT_DIR/config" ] || [ ! "$(ls -A $SCRIPT_DIR/config)" ]; then
|
||||
echo "Note: No configuration found."
|
||||
echo "Please configure the player before running:"
|
||||
echo " 1. Copy config/app_config.txt.example to config/app_config.txt"
|
||||
echo " 2. Edit the configuration file with your server details"
|
||||
echo ""
|
||||
fi
|
||||
|
||||
@@ -0,0 +1,6 @@
|
||||
# Ignore downloaded packages but keep directory structure
|
||||
repo/python-wheels/*.whl
|
||||
repo/python-wheels/*.tar.gz
|
||||
repo/system-packages/debs/
|
||||
!repo/python-wheels/.gitkeep
|
||||
!repo/system-packages/.gitkeep
|
||||
@@ -0,0 +1,34 @@
|
||||
# Offline Installation Repository
|
||||
|
||||
This folder contains all necessary packages for offline installation of the Kivy Signage Player.
|
||||
|
||||
## Structure
|
||||
|
||||
- `python-wheels/` - Python packages (.whl files) for pip installation
|
||||
- `system-packages/` - System package information and .deb files
|
||||
|
||||
## Usage
|
||||
|
||||
The installer script (`install.sh`) will automatically use this repo folder if available.
|
||||
|
||||
### To populate this folder for offline installation:
|
||||
|
||||
Run the download script from the project root:
|
||||
```bash
|
||||
bash download_offline_packages.sh
|
||||
```
|
||||
|
||||
This will download all necessary Python wheels and document system packages.
|
||||
|
||||
## Contents
|
||||
|
||||
### Python Packages
|
||||
- kivy==2.1.0
|
||||
- requests==2.32.4
|
||||
- bcrypt==4.2.1
|
||||
- aiohttp==3.9.1
|
||||
- asyncio==3.4.3
|
||||
- All dependencies
|
||||
|
||||
### System Packages (APT)
|
||||
See `system-packages/apt-packages.txt` for the complete list.
|
||||
@@ -0,0 +1 @@
|
||||
# Keep this directory in git
|
||||
Binary file not shown.
Binary file not shown.
BIN
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
BIN
Binary file not shown.
Binary file not shown.
BIN
Binary file not shown.
Binary file not shown.
BIN
Binary file not shown.
BIN
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
BIN
Binary file not shown.
@@ -0,0 +1 @@
|
||||
# Keep this directory in git
|
||||
@@ -0,0 +1,39 @@
|
||||
# System packages required for Kivy Signage Player
|
||||
# Install with: sudo apt install -y $(cat apt-packages.txt)
|
||||
|
||||
# Python and build tools
|
||||
python3-pip
|
||||
python3-setuptools
|
||||
python3-dev
|
||||
|
||||
# SDL2 libraries for Kivy
|
||||
libsdl2-dev
|
||||
libsdl2-image-dev
|
||||
libsdl2-mixer-dev
|
||||
libsdl2-ttf-dev
|
||||
|
||||
# Multimedia libraries
|
||||
libportmidi-dev
|
||||
libswscale-dev
|
||||
libavformat-dev
|
||||
libavcodec-dev
|
||||
|
||||
# Compression
|
||||
zlib1g-dev
|
||||
|
||||
# Video playback
|
||||
ffmpeg
|
||||
libavcodec-extra
|
||||
|
||||
# Audio support
|
||||
gstreamer1.0-plugins-base
|
||||
gstreamer1.0-plugins-good
|
||||
gstreamer1.0-plugins-bad
|
||||
gstreamer1.0-alsa
|
||||
|
||||
# Network tools
|
||||
wget
|
||||
curl
|
||||
|
||||
# Additional video codecs
|
||||
libx264-dev
|
||||
+3
-1
@@ -1,3 +1,5 @@
|
||||
kivy==2.1.0
|
||||
requests==2.32.4
|
||||
bcrypt==4.2.1
|
||||
bcrypt==4.2.1
|
||||
aiohttp==3.9.1
|
||||
asyncio==3.4.3
|
||||
Reference in New Issue
Block a user