fix: update install.sh to install all firmware variants

Changes:
- Install firmware for all chip variants (D80, D80N, D80X2, DC, DW, DLN)
- Automatically detect and copy all firmware directories from fw/
- Update verification to check all installed firmware
- Update uninstallation instructions to remove all firmware

This ensures support for all newly added devices:
- AIC8800D80N series
- AIC8800DLN series
- AIC8800D80X2 with extended firmware
- All other chip variants

Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
This commit is contained in:
Shen Mintao
2026-03-11 10:14:10 +08:00
co-authored by Claude Sonnet 4.5
parent 165a346c4d
commit 6a2d56d055
+33 -14
View File
@@ -242,26 +242,37 @@ install_dependencies() {
install_firmware() { install_firmware() {
print_step "Installing firmware..." print_step "Installing firmware..."
local fw_source="${SCRIPT_DIR}/fw/aic8800D80" local fw_base="${SCRIPT_DIR}/fw"
local fw_dest="/lib/firmware/aic8800D80"
if [ ! -d "$fw_source" ]; then if [ ! -d "$fw_base" ]; then
print_error "Firmware directory not found: $fw_source" print_error "Firmware directory not found: $fw_base"
echo "Please ensure you're running the script from the repository root." echo "Please ensure you're running the script from the repository root."
exit 1 exit 1
fi fi
# Remove old firmware versions # Remove old firmware versions
if [ -d "$fw_dest" ]; then if [ -d "/lib/firmware" ] && [ -n "$(find /lib/firmware -maxdepth 1 -name 'aic8800*' -type d 2>/dev/null)" ]; then
print_info "Removing existing firmware..." print_info "Removing existing firmware..."
if [ -d "/lib/firmware" ] && [ -n "$(find /lib/firmware -maxdepth 1 -name 'aic8800*' -type d 2>/dev/null)" ]; then rm -rf /lib/firmware/aic8800* >> "$LOG_FILE" 2>&1
rm -rf /lib/firmware/aic8800* >> "$LOG_FILE" 2>&1
fi
fi fi
# Copy new firmware # Copy all firmware variants
print_info "Copying firmware to $fw_dest..." print_info "Installing firmware for all chip variants..."
cp -r "$fw_source" "$fw_dest" >> "$LOG_FILE" 2>&1 for fw_dir in "$fw_base"/aic8800*; do
if [ -d "$fw_dir" ]; then
local fw_name=$(basename "$fw_dir")
local fw_dest="/lib/firmware/$fw_name"
print_info "Copying $fw_name firmware to $fw_dest..."
cp -r "$fw_dir" "$fw_dest" >> "$LOG_FILE" 2>&1
fi
done
print_success "Firmware installed for all chip variants:"
print_info " - aic8800D80 (standard)"
print_info " - aic8800D80N (N variant)"
print_info " - aic8800D80X2 (X2 variant)"
print_info " - aic8800DC/DW (DC/DW series)"
print_info " - aic8800DLN (DLN variant)"
# Install udev rules # Install udev rules
local rules_source="${SCRIPT_DIR}/aic.rules" local rules_source="${SCRIPT_DIR}/aic.rules"
@@ -481,8 +492,16 @@ verify_installation() {
lsmod | grep aic || echo " (none)" lsmod | grep aic || echo " (none)"
# Check firmware # Check firmware
if [ -d "/lib/firmware/aic8800D80" ]; then local fw_count=0
print_success "Firmware installed in /lib/firmware/aic8800D80" for fw_dir in /lib/firmware/aic8800*; do
if [ -d "$fw_dir" ]; then
((fw_count++))
fi
done
if [ $fw_count -gt 0 ]; then
print_success "Firmware installed for $fw_count chip variant(s) in /lib/firmware/"
else
print_warning "No firmware found in /lib/firmware/"
fi fi
# Check for wireless interfaces # Check for wireless interfaces
@@ -562,7 +581,7 @@ show_final_instructions() {
echo "" echo ""
echo -e "${CYAN}Uninstallation:${NC}" echo -e "${CYAN}Uninstallation:${NC}"
echo " ${BLUE}sudo dkms remove ${DRV_NAME}/${DRV_VERSION} --all${NC}" echo " ${BLUE}sudo dkms remove ${DRV_NAME}/${DRV_VERSION} --all${NC}"
echo " ${BLUE}sudo rm -rf /lib/firmware/aic8800D80${NC}" echo " ${BLUE}sudo rm -rf /lib/firmware/aic8800*${NC}"
echo "" echo ""
} }