Fix dependency handling in preflight and setup scripts
- Changed required packages to warnings in preflight.sh (setup.sh installs them) - Modified setup.sh to proceed with warnings from preflight checks - Ensures Docker installation installs all dependencies automatically - Preflight no longer fails on missing jq, tmux, etc.
This commit is contained in:
@@ -18,10 +18,10 @@ MIN_DISK_SPACE=20 # GB
|
||||
MIN_MEMORY=1024 # MB
|
||||
MIN_CPU_CORES=2
|
||||
|
||||
# Required packages
|
||||
# Required packages (will be installed by setup.sh if missing)
|
||||
REQUIRED_PACKAGES=("curl" "wget" "git" "jq")
|
||||
|
||||
# Optional packages (recommended)
|
||||
# Optional packages (recommended but not required)
|
||||
OPTIONAL_PACKAGES=("htop" "ncdu" "tmux" "unzip")
|
||||
|
||||
# =============================================================================
|
||||
@@ -102,7 +102,7 @@ check_network_connectivity() {
|
||||
return 0
|
||||
}
|
||||
|
||||
# Check required packages
|
||||
# Check required packages (will be installed by setup.sh if missing)
|
||||
check_required_packages() {
|
||||
print_info "Checking required packages..."
|
||||
|
||||
@@ -114,9 +114,9 @@ check_required_packages() {
|
||||
done
|
||||
|
||||
if [[ ${#missing[@]} -gt 0 ]]; then
|
||||
print_error "Missing required packages: ${missing[*]}"
|
||||
print_info "Install with: sudo apt update && sudo apt install -y ${missing[*]}"
|
||||
return 1
|
||||
print_warning "Required packages missing: ${missing[*]}"
|
||||
print_info "These will be installed automatically by setup.sh"
|
||||
return 2 # Warning, not error
|
||||
fi
|
||||
|
||||
print_success "All required packages installed"
|
||||
|
||||
@@ -258,6 +258,11 @@ check_nvidia_setup_needed() {
|
||||
|
||||
# Install NVIDIA drivers (if requested)
|
||||
install_nvidia_drivers() {
|
||||
if $non_interactive; then
|
||||
print_info "Skipping NVIDIA setup (non-interactive mode)"
|
||||
return 0
|
||||
fi
|
||||
|
||||
if ! ui_yesno "NVIDIA GPU detected. Install NVIDIA drivers and Docker GPU support?"; then
|
||||
print_info "Skipping NVIDIA setup"
|
||||
return 0
|
||||
@@ -329,10 +334,14 @@ main() {
|
||||
print_info "Starting EZ-Homelab system setup..."
|
||||
print_info "This will install Docker and configure your system for EZ-Homelab."
|
||||
|
||||
# Run pre-flight checks first
|
||||
if ! "$(dirname "${BASH_SOURCE[0]}")/preflight.sh" --no-ui; then
|
||||
print_error "Pre-flight checks failed. Please resolve issues before proceeding."
|
||||
# Run pre-flight checks first (allow warnings)
|
||||
local preflight_exit=0
|
||||
"$(dirname "${BASH_SOURCE[0]}")/preflight.sh" --no-ui || preflight_exit=$?
|
||||
if [[ $preflight_exit -eq 1 ]]; then
|
||||
print_error "Pre-flight checks failed with critical errors. Please resolve issues before proceeding."
|
||||
exit 1
|
||||
elif [[ $preflight_exit -eq 2 ]]; then
|
||||
print_warning "Pre-flight checks completed with warnings. Setup will proceed and install missing dependencies."
|
||||
fi
|
||||
|
||||
# Install system packages
|
||||
|
||||
Reference in New Issue
Block a user