From 7d486ecc5fd0cabfa4679353b67290c5c984bc79 Mon Sep 17 00:00:00 2001 From: zhiqin xu <72284220+zhiqin14@users.noreply.github.com> Date: Fri, 12 Sep 2025 22:41:19 +0800 Subject: [PATCH] =?UTF-8?q?feat:=20=E6=B7=BB=E5=8A=A0=E5=AF=B9=20FreeBSD?= =?UTF-8?q?=20=E5=92=8C=20Windows=20=E5=8F=8A=20x86=20=E7=9A=84=E6=94=AF?= =?UTF-8?q?=E6=8C=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- install.ps1 | 1 + install.sh | 39 ++++++++++++++++++++++++++++++++++----- 2 files changed, 35 insertions(+), 5 deletions(-) diff --git a/install.ps1 b/install.ps1 index a5869ba..2579296 100644 --- a/install.ps1 +++ b/install.ps1 @@ -40,6 +40,7 @@ if ($GitHubProxy -ne '') { $ProxyDisplay = $GitHubProxy } else { $ProxyDisplay = switch ($env:PROCESSOR_ARCHITECTURE) { 'AMD64' { $arch = 'amd64' } 'ARM64' { $arch = 'arm64' } + 'x86' { $arch = '386' } Default { Log-Error "Unsupported architecture: $env:PROCESSOR_ARCHITECTURE"; exit 1 } } diff --git a/install.sh b/install.sh index 4d68bd7..8d24b33 100755 --- a/install.sh +++ b/install.sh @@ -57,6 +57,13 @@ case $os_type in Linux) os_name="linux" ;; + FreeBSD) + os_name="freebsd" + ;; + MINGW*|MSYS*|CYGWIN*) + os_name="windows" + target_dir="/c/komari" # Use C:\komari on Windows + ;; *) log_error "Unsupported operating system: $os_type" exit 1 @@ -295,23 +302,45 @@ install_dependencies # Install vnstat if needed for month-rotate install_vnstat +# Architecture detection with platform-specific support arch=$(uname -m) case $arch in x86_64) arch="amd64" ;; - aarch64) + aarch64|arm64) arch="arm64" ;; - arm64) - arch="arm64" + i386|i686) + # x86 (32-bit) support + case $os_name in + freebsd|linux|windows) + arch="386" + ;; + *) + log_error "32-bit x86 architecture not supported on $os_name" + exit 1 + ;; + esac + ;; + armv7*|armv6*) + # ARM 32-bit support + case $os_name in + freebsd|linux) + arch="arm" + ;; + *) + log_error "32-bit ARM architecture not supported on $os_name" + exit 1 + ;; + esac ;; *) - log_error "Unsupported architecture: $arch" + log_error "Unsupported architecture: $arch on $os_name" exit 1 ;; esac -log_info "Detected architecture: ${GREEN}$arch${NC}" +log_info "Detected OS: ${GREEN}$os_name${NC}, Architecture: ${GREEN}$arch${NC}" version_to_install="latest" if [ -n "$install_version" ]; then