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_MEMORY=1024 # MB
|
||||||
MIN_CPU_CORES=2
|
MIN_CPU_CORES=2
|
||||||
|
|
||||||
# Required packages
|
# Required packages (will be installed by setup.sh if missing)
|
||||||
REQUIRED_PACKAGES=("curl" "wget" "git" "jq")
|
REQUIRED_PACKAGES=("curl" "wget" "git" "jq")
|
||||||
|
|
||||||
# Optional packages (recommended)
|
# Optional packages (recommended but not required)
|
||||||
OPTIONAL_PACKAGES=("htop" "ncdu" "tmux" "unzip")
|
OPTIONAL_PACKAGES=("htop" "ncdu" "tmux" "unzip")
|
||||||
|
|
||||||
# =============================================================================
|
# =============================================================================
|
||||||
@@ -102,7 +102,7 @@ check_network_connectivity() {
|
|||||||
return 0
|
return 0
|
||||||
}
|
}
|
||||||
|
|
||||||
# Check required packages
|
# Check required packages (will be installed by setup.sh if missing)
|
||||||
check_required_packages() {
|
check_required_packages() {
|
||||||
print_info "Checking required packages..."
|
print_info "Checking required packages..."
|
||||||
|
|
||||||
@@ -114,9 +114,9 @@ check_required_packages() {
|
|||||||
done
|
done
|
||||||
|
|
||||||
if [[ ${#missing[@]} -gt 0 ]]; then
|
if [[ ${#missing[@]} -gt 0 ]]; then
|
||||||
print_error "Missing required packages: ${missing[*]}"
|
print_warning "Required packages missing: ${missing[*]}"
|
||||||
print_info "Install with: sudo apt update && sudo apt install -y ${missing[*]}"
|
print_info "These will be installed automatically by setup.sh"
|
||||||
return 1
|
return 2 # Warning, not error
|
||||||
fi
|
fi
|
||||||
|
|
||||||
print_success "All required packages installed"
|
print_success "All required packages installed"
|
||||||
|
|||||||
@@ -258,6 +258,11 @@ check_nvidia_setup_needed() {
|
|||||||
|
|
||||||
# Install NVIDIA drivers (if requested)
|
# Install NVIDIA drivers (if requested)
|
||||||
install_nvidia_drivers() {
|
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
|
if ! ui_yesno "NVIDIA GPU detected. Install NVIDIA drivers and Docker GPU support?"; then
|
||||||
print_info "Skipping NVIDIA setup"
|
print_info "Skipping NVIDIA setup"
|
||||||
return 0
|
return 0
|
||||||
@@ -329,10 +334,14 @@ main() {
|
|||||||
print_info "Starting EZ-Homelab system setup..."
|
print_info "Starting EZ-Homelab system setup..."
|
||||||
print_info "This will install Docker and configure your system for EZ-Homelab."
|
print_info "This will install Docker and configure your system for EZ-Homelab."
|
||||||
|
|
||||||
# Run pre-flight checks first
|
# Run pre-flight checks first (allow warnings)
|
||||||
if ! "$(dirname "${BASH_SOURCE[0]}")/preflight.sh" --no-ui; then
|
local preflight_exit=0
|
||||||
print_error "Pre-flight checks failed. Please resolve issues before proceeding."
|
"$(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
|
exit 1
|
||||||
|
elif [[ $preflight_exit -eq 2 ]]; then
|
||||||
|
print_warning "Pre-flight checks completed with warnings. Setup will proceed and install missing dependencies."
|
||||||
fi
|
fi
|
||||||
|
|
||||||
# Install system packages
|
# Install system packages
|
||||||
|
|||||||
Reference in New Issue
Block a user