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
+46
-21
@@ -241,32 +241,36 @@ 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_base" ]; then
|
||||||
if [ ! -d "$fw_source" ]; then
|
print_error "Firmware directory not found: $fw_base"
|
||||||
print_error "Firmware directory not found: $fw_source"
|
|
||||||
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
|
||||||
|
|
||||||
# Install udev rules
|
# Install udev rules
|
||||||
local rules_source="${SCRIPT_DIR}/aic.rules"
|
local rules_source="${SCRIPT_DIR}/aic.rules"
|
||||||
local rules_dest="/usr/lib/udev/rules.d/aic.rules"
|
local rules_dest="/usr/lib/udev/rules.d/aic.rules"
|
||||||
|
|
||||||
if [ -f "$rules_source" ]; then
|
if [ -f "$rules_source" ]; then
|
||||||
print_info "Installing udev rules to $rules_dest..."
|
print_info "Installing udev rules to $rules_dest..."
|
||||||
cp "$rules_source" "$rules_dest" >> "$LOG_FILE" 2>&1
|
cp "$rules_source" "$rules_dest" >> "$LOG_FILE" 2>&1
|
||||||
@@ -277,7 +281,20 @@ install_firmware() {
|
|||||||
else
|
else
|
||||||
print_warning "Udev rules file not found: $rules_source"
|
print_warning "Udev rules file not found: $rules_source"
|
||||||
fi
|
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."
|
print_success "Firmware installed successfully."
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -444,10 +461,18 @@ verify_installation() {
|
|||||||
fi
|
fi
|
||||||
|
|
||||||
# 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
|
||||||
print_info "Checking for wireless interfaces..."
|
print_info "Checking for wireless interfaces..."
|
||||||
if command -v iwconfig &> /dev/null; then
|
if command -v iwconfig &> /dev/null; then
|
||||||
|
|||||||
Reference in New Issue
Block a user