particle-os-tools/dev-install.sh
robojerk 74c7bede5f Initial commit: Particle-OS tools repository
- Complete Particle-OS rebranding from uBlue-OS
- Professional installation system with standardized paths
- Self-initialization system with --init and --reset commands
- Enhanced error messages and dependency checking
- Comprehensive testing infrastructure
- All source scriptlets updated with runtime improvements
- Clean codebase with redundant files moved to archive
- Complete documentation suite
2025-07-11 21:14:33 -07:00

91 lines
No EOL
2.3 KiB
Bash

#!/bin/bash
# Particle-OS Development Installation Helper
# Quick reinstall for development - no backups, minimal verification
set -euo pipefail
# Colors for output
GREEN='\033[0;32m'
BLUE='\033[0;34m'
NC='\033[0m' # No Color
# Installation paths
INSTALL_DIR="/usr/local/bin"
# Script mappings (source -> destination)
declare -A SCRIPTS=(
["apt-layer.sh"]="apt-layer"
["composefs-alternative.sh"]="composefs"
["bootc-alternative.sh"]="bootc"
["bootupd-alternative.sh"]="bootupd"
["orchestrator.sh"]="particle-orchestrator"
["oci-integration.sh"]="particle-oci"
["particle-logrotate.sh"]="particle-logrotate"
)
# Function to print colored output
log_info() {
echo -e "${BLUE}[DEV]${NC} $1"
}
log_success() {
echo -e "${GREEN}[DEV]${NC} $1"
}
# Function to check if running as root
check_root() {
if [[ $EUID -ne 0 ]]; then
echo "This script must be run as root (use sudo)"
exit 1
fi
}
# Function to install scripts
install_scripts() {
log_info "Quick installing Particle-OS tools to $INSTALL_DIR..."
for source_script in "${!SCRIPTS[@]}"; do
local dest_name="${SCRIPTS[$source_script]}"
local dest_path="$INSTALL_DIR/$dest_name"
if [[ -f "$source_script" ]]; then
log_info "Installing $source_script as $dest_name..."
cp "$source_script" "$dest_path"
chmod +x "$dest_path"
chown root:root "$dest_path"
log_success "Installed $dest_name"
else
log_info "Skipping $source_script (not found)"
fi
done
}
# Function to install configuration
install_config() {
if [[ -f "particle-config.sh" ]]; then
log_info "Installing configuration file..."
cp "particle-config.sh" "/usr/local/etc/"
chmod 644 "/usr/local/etc/particle-config.sh"
chown root:root "/usr/local/etc/particle-config.sh"
log_success "Configuration installed"
fi
}
# Main function
main() {
echo "Particle-OS Development Install"
echo "==============================="
echo
check_root
install_scripts
install_config
echo
log_success "Development installation completed!"
echo "Run 'apt-layer --help' to test installation"
}
# Run main function
main "$@"