# Check dependencies for Ubuntu uBlue ComposeFS Alternative check_dependencies() { local deps=( "mount" # Filesystem mounting "umount" # Filesystem unmounting "findmnt" # Mount point detection "losetup" # Loop device management "sha256sum" # Hash generation "jq" # JSON processing "tar" # Archive operations "mksquashfs" # SquashFS creation "unsquashfs" # SquashFS extraction "nproc" # CPU core detection "du" # Disk usage "stat" # File status "modprobe" # Kernel module loading "mountpoint" # Mount point checking ) local missing=() for dep in "${deps[@]}"; do if ! command -v "$dep" &> /dev/null; then missing+=("$dep") fi done if [[ ${#missing[@]} -gt 0 ]]; then log_error "Missing required dependencies: ${missing[*]}" "composefs-alternative" log_error "Please install the missing packages (squashfs-tools, jq, coreutils, util-linux)" "composefs-alternative" exit 1 fi log_info "All dependencies are available" "composefs-alternative" } # Check kernel modules check_kernel_modules() { local modules=("squashfs" "overlay") local missing_modules=() for module in "${modules[@]}"; do if ! modprobe -n "$module" >/dev/null 2>&1; then missing_modules+=("$module") fi done if [[ ${#missing_modules[@]} -gt 0 ]]; then log_warning "Missing kernel modules: ${missing_modules[*]}" "composefs-alternative" log_warning "Some features may not work correctly" "composefs-alternative" return 1 fi log_info "All required kernel modules are available" "composefs-alternative" return 0 }