mirror of
https://github.com/shenmintao/aic8800d80.git
synced 2026-09-26 17:44:16 +00:00
fix: install all firmware variants and usb_modeswitch config
Follow-up to d66e5cb which shipped fw/aic8800{,D80N,D80X2,DLN} but
forgot to update install.sh — so users still got only aic8800D80
firmware installed and the "Pandora" mode-switch config was missing.
install_firmware:
- Loop over all fw/aic8800* variants instead of hard-coding aic8800D80
- Install usb_modeswitch/1111_1111 to /etc/usb_modeswitch.d/1111:1111
verify_installation: count installed firmware variants instead of
checking for the single aic8800D80 directory.
Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
This commit is contained in:
co-authored by
Claude Opus 4.7
parent
d66e5cb859
commit
a5db07c4d4
+37
-12
@@ -242,26 +242,30 @@ install_dependencies() {
|
||||
install_firmware() {
|
||||
print_step "Installing firmware..."
|
||||
|
||||
local fw_source="${SCRIPT_DIR}/fw/aic8800D80"
|
||||
local fw_dest="/lib/firmware/aic8800D80"
|
||||
local fw_base="${SCRIPT_DIR}/fw"
|
||||
|
||||
if [ ! -d "$fw_source" ]; then
|
||||
print_error "Firmware directory not found: $fw_source"
|
||||
if [ ! -d "$fw_base" ]; then
|
||||
print_error "Firmware directory not found: $fw_base"
|
||||
echo "Please ensure you're running the script from the repository root."
|
||||
exit 1
|
||||
fi
|
||||
|
||||
# Remove old firmware versions
|
||||
if [ -d "$fw_dest" ]; then
|
||||
print_info "Removing existing firmware..."
|
||||
if [ -d "/lib/firmware" ] && [ -n "$(find /lib/firmware -maxdepth 1 -name 'aic8800*' -type d 2>/dev/null)" ]; then
|
||||
print_info "Removing existing firmware..."
|
||||
rm -rf /lib/firmware/aic8800* >> "$LOG_FILE" 2>&1
|
||||
fi
|
||||
fi
|
||||
|
||||
# Copy new firmware
|
||||
print_info "Copying firmware to $fw_dest..."
|
||||
cp -r "$fw_source" "$fw_dest" >> "$LOG_FILE" 2>&1
|
||||
# Copy all firmware variants
|
||||
print_info "Installing firmware for all chip variants..."
|
||||
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
|
||||
|
||||
# Install udev rules
|
||||
local rules_source="${SCRIPT_DIR}/aic.rules"
|
||||
@@ -278,6 +282,19 @@ install_firmware() {
|
||||
print_warning "Udev rules file not found: $rules_source"
|
||||
fi
|
||||
|
||||
# Install usb_modeswitch configuration for AIC8800D80 "Pandora" clone
|
||||
local modeswitch_source="${SCRIPT_DIR}/usb_modeswitch/1111_1111"
|
||||
local modeswitch_dest="/etc/usb_modeswitch.d/1111:1111"
|
||||
|
||||
if [ -f "$modeswitch_source" ]; then
|
||||
print_info "Installing usb_modeswitch configuration to $modeswitch_dest..."
|
||||
mkdir -p /etc/usb_modeswitch.d >> "$LOG_FILE" 2>&1 || true
|
||||
cp "$modeswitch_source" "$modeswitch_dest" >> "$LOG_FILE" 2>&1
|
||||
print_success "USB modeswitch configuration installed successfully."
|
||||
else
|
||||
print_warning "USB modeswitch configuration file not found: $modeswitch_source"
|
||||
fi
|
||||
|
||||
print_success "Firmware installed successfully."
|
||||
}
|
||||
|
||||
@@ -444,8 +461,16 @@ verify_installation() {
|
||||
fi
|
||||
|
||||
# Check firmware
|
||||
if [ -d "/lib/firmware/aic8800D80" ]; then
|
||||
print_success "Firmware installed in /lib/firmware/aic8800D80"
|
||||
local fw_count=0
|
||||
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
|
||||
|
||||
# Check for wireless interfaces
|
||||
|
||||
Reference in New Issue
Block a user