feat: add aic_btusb bluetooth module support to install.sh

This commit is contained in:
Shen Mintao
2026-02-28 14:27:02 +08:00
parent 4f288d90b2
commit 85a412e5b8
3 changed files with 92 additions and 18 deletions
+5
View File
@@ -13,4 +13,9 @@ BUILT_MODULE_NAME[1]="aic_load_fw"
BUILT_MODULE_LOCATION[1]="drivers/aic8800/aic_load_fw" BUILT_MODULE_LOCATION[1]="drivers/aic8800/aic_load_fw"
DEST_MODULE_LOCATION[1]="/updates/dkms" DEST_MODULE_LOCATION[1]="/updates/dkms"
# Bluetooth USB module (aic_btusb)
BUILT_MODULE_NAME[2]="aic_btusb"
BUILT_MODULE_LOCATION[2]="drivers/aic8800/aic_btusb"
DEST_MODULE_LOCATION[2]="/updates/dkms"
AUTOINSTALL="yes" AUTOINSTALL="yes"
+5
View File
@@ -1,8 +1,10 @@
CONFIG_AIC_LOADFW_SUPPORT := m CONFIG_AIC_LOADFW_SUPPORT := m
CONFIG_AIC8800_WLAN_SUPPORT := m CONFIG_AIC8800_WLAN_SUPPORT := m
CONFIG_AIC8800_BTUSB_SUPPORT := m
obj-$(CONFIG_AIC_LOADFW_SUPPORT) += aic_load_fw/ obj-$(CONFIG_AIC_LOADFW_SUPPORT) += aic_load_fw/
obj-$(CONFIG_AIC8800_WLAN_SUPPORT) += aic8800_fdrv/ obj-$(CONFIG_AIC8800_WLAN_SUPPORT) += aic8800_fdrv/
obj-$(CONFIG_AIC8800_BTUSB_SUPPORT) += aic_btusb/
########## config option ########## ########## config option ##########
export CONFIG_USE_FW_REQUEST = n export CONFIG_USE_FW_REQUEST = n
@@ -67,14 +69,17 @@ install:
mkdir -p $(MODDESTDIR) mkdir -p $(MODDESTDIR)
install -p -m 644 aic_load_fw/aic_load_fw.ko $(MODDESTDIR)/ install -p -m 644 aic_load_fw/aic_load_fw.ko $(MODDESTDIR)/
install -p -m 644 aic8800_fdrv/aic8800_fdrv.ko $(MODDESTDIR)/ install -p -m 644 aic8800_fdrv/aic8800_fdrv.ko $(MODDESTDIR)/
install -p -m 644 aic_btusb/aic_btusb.ko $(MODDESTDIR)/
/sbin/depmod -a ${KVER} /sbin/depmod -a ${KVER}
uninstall: uninstall:
rm -rfv $(MODDESTDIR)/aic_load_fw.ko rm -rfv $(MODDESTDIR)/aic_load_fw.ko
rm -rfv $(MODDESTDIR)/aic8800_fdrv.ko rm -rfv $(MODDESTDIR)/aic8800_fdrv.ko
rm -rfv $(MODDESTDIR)/aic_btusb.ko
/sbin/depmod -a ${KVER} /sbin/depmod -a ${KVER}
clean: clean:
cd aic_load_fw/;make clean;cd .. cd aic_load_fw/;make clean;cd ..
cd aic8800_fdrv/;make clean;cd .. cd aic8800_fdrv/;make clean;cd ..
cd aic_btusb/;make clean;cd ..
rm -rf modules.order Module.symvers .modules.order.cmd .Module.symvers.cmd .tmp_versions/ rm -rf modules.order Module.symvers .modules.order.cmd .Module.symvers.cmd .tmp_versions/
+82 -18
View File
@@ -340,6 +340,11 @@ BUILT_MODULE_NAME[1]="aic_load_fw"
BUILT_MODULE_LOCATION[1]="drivers/aic8800/aic_load_fw" BUILT_MODULE_LOCATION[1]="drivers/aic8800/aic_load_fw"
DEST_MODULE_LOCATION[1]="/updates/dkms" DEST_MODULE_LOCATION[1]="/updates/dkms"
# Módulo Bluetooth USB (aic_btusb)
BUILT_MODULE_NAME[2]="aic_btusb"
BUILT_MODULE_LOCATION[2]="drivers/aic8800/aic_btusb"
DEST_MODULE_LOCATION[2]="/updates/dkms"
AUTOINSTALL="yes" AUTOINSTALL="yes"
EOF EOF
@@ -402,22 +407,27 @@ install_via_dkms() {
############################################################################# #############################################################################
load_module() { load_module() {
print_step "Loading kernel module..." print_step "Loading kernel modules..."
# Update module dependencies # Update module dependencies
print_info "Updating module dependencies..." print_info "Updating module dependencies..."
depmod -a >> "$LOG_FILE" 2>&1 depmod -a >> "$LOG_FILE" 2>&1
# Unload module if already loaded # Unload modules if already loaded
if lsmod | grep -q "aic_btusb"; then
print_info "Bluetooth module already loaded. Reloading..."
modprobe -r aic_btusb >> "$LOG_FILE" 2>&1 || true
fi
if lsmod | grep -q "$MODULE_NAME"; then if lsmod | grep -q "$MODULE_NAME"; then
print_info "Module already loaded. Reloading..." print_info "WiFi module already loaded. Reloading..."
modprobe -r "$MODULE_NAME" >> "$LOG_FILE" 2>&1 || true modprobe -r "$MODULE_NAME" >> "$LOG_FILE" 2>&1 || true
fi fi
# Load the module # Load the WiFi module
print_info "Loading $MODULE_NAME..." print_info "Loading $MODULE_NAME..."
if modprobe "$MODULE_NAME" >> "$LOG_FILE" 2>&1; then if modprobe "$MODULE_NAME" >> "$LOG_FILE" 2>&1; then
print_success "Module loaded successfully." print_success "WiFi module loaded successfully."
# Verify module is loaded # Verify module is loaded
print_info "Waiting for module to initialize..." print_info "Waiting for module to initialize..."
@@ -431,15 +441,41 @@ load_module() {
done done
if [ "$module_loaded" = true ]; then if [ "$module_loaded" = true ]; then
print_success "Module is active in kernel." print_success "WiFi module is active in kernel."
else else
print_warning "Module may not be fully initialized yet." print_warning "WiFi module may not be fully initialized yet."
fi fi
else else
print_warning "Module installed but could not be loaded immediately." print_warning "WiFi module installed but could not be loaded immediately."
print_info "This may be due to Secure Boot or missing hardware." print_info "This may be due to Secure Boot or missing hardware."
print_info "Try rebooting or check: sudo dmesg | grep aic8800" print_info "Try rebooting or check: sudo dmesg | grep aic8800"
fi fi
# Load the Bluetooth module
print_info "Loading aic_btusb..."
if modprobe aic_btusb >> "$LOG_FILE" 2>&1; then
print_success "Bluetooth module loaded successfully."
# Verify module is loaded
local bt_module_loaded=false
for i in {1..10}; do
if lsmod | grep -q "aic_btusb"; then
bt_module_loaded=true
break
fi
sleep 0.5
done
if [ "$bt_module_loaded" = true ]; then
print_success "Bluetooth module is active in kernel."
else
print_warning "Bluetooth module may not be fully initialized yet."
fi
else
print_warning "Bluetooth module installed but could not be loaded immediately."
print_info "This may be due to Secure Boot or missing hardware."
print_info "Try rebooting or check: sudo dmesg | grep aic_btusb"
fi
} }
############################################################################# #############################################################################
@@ -459,15 +495,25 @@ verify_installation() {
print_warning "DKMS status unclear: $dkms_status" print_warning "DKMS status unclear: $dkms_status"
fi fi
# Check if module is loaded # Check if WiFi module is loaded
if lsmod | grep -q "$MODULE_NAME"; then if lsmod | grep -q "$MODULE_NAME"; then
print_success "Kernel module is loaded." print_success "WiFi kernel module is loaded."
echo ""
lsmod | grep aic
else else
print_info "Module not currently loaded (this is OK if no hardware is connected)." print_info "WiFi module not currently loaded (this is OK if no hardware is connected)."
fi fi
# Check if Bluetooth module is loaded
if lsmod | grep -q "aic_btusb"; then
print_success "Bluetooth kernel module is loaded."
else
print_info "Bluetooth module not currently loaded (this is OK if no hardware is connected)."
fi
# Show all loaded AIC modules
echo ""
print_info "Loaded AIC modules:"
lsmod | grep aic || echo " (none)"
# Check firmware # Check firmware
if [ -d "/lib/firmware/aic8800D80" ]; then if [ -d "/lib/firmware/aic8800D80" ]; then
print_success "Firmware installed in /lib/firmware/aic8800D80" print_success "Firmware installed in /lib/firmware/aic8800D80"
@@ -478,6 +524,16 @@ verify_installation() {
if command -v iwconfig &> /dev/null; then if command -v iwconfig &> /dev/null; then
iwconfig 2>/dev/null | grep -E "wlan|IEEE" || echo "No wireless interfaces detected (hardware may not be connected)" iwconfig 2>/dev/null | grep -E "wlan|IEEE" || echo "No wireless interfaces detected (hardware may not be connected)"
fi fi
# Check for Bluetooth interfaces
print_info "Checking for Bluetooth interfaces..."
if command -v hciconfig &> /dev/null; then
hciconfig 2>/dev/null || echo "No Bluetooth interfaces detected (hardware may not be connected)"
elif command -v bluetoothctl &> /dev/null; then
bluetoothctl list 2>/dev/null || echo "No Bluetooth interfaces detected (hardware may not be connected)"
else
echo "Bluetooth tools not installed (install bluez package for Bluetooth support)"
fi
} }
############################################################################# #############################################################################
@@ -492,13 +548,14 @@ show_final_instructions() {
echo "" echo ""
echo -e "${CYAN}Important Information:${NC}" echo -e "${CYAN}Important Information:${NC}"
echo "" echo ""
echo "✓ Driver installed via DKMS" echo "✓ WiFi driver installed via DKMS"
echo "✓ Bluetooth driver (aic_btusb) installed via DKMS"
echo "✓ Automatic rebuild enabled for kernel updates" echo "✓ Automatic rebuild enabled for kernel updates"
echo "✓ Firmware installed in /lib/firmware/" echo "✓ Firmware installed in /lib/firmware/"
echo "" echo ""
echo -e "${CYAN}Next Steps:${NC}" echo -e "${CYAN}Next Steps:${NC}"
echo "" echo ""
echo "1. Connect your AIC8800D80 USB WiFi adapter" echo "1. Connect your AIC8800D80 USB WiFi/Bluetooth adapter"
echo "" echo ""
echo "2. Check if the adapter is detected:" echo "2. Check if the adapter is detected:"
echo " ${BLUE}lsusb | grep -i aic${NC}" echo " ${BLUE}lsusb | grep -i aic${NC}"
@@ -507,27 +564,34 @@ show_final_instructions() {
echo "" echo ""
echo "3. View kernel messages about the driver:" echo "3. View kernel messages about the driver:"
echo " ${BLUE}sudo dmesg | grep aic8800${NC}" echo " ${BLUE}sudo dmesg | grep aic8800${NC}"
echo " ${BLUE}sudo dmesg | grep aic_btusb${NC}"
echo "" echo ""
echo "4. Connect to a WiFi network:" echo "4. Connect to a WiFi network:"
echo " ${BLUE}nmcli device wifi list${NC}" echo " ${BLUE}nmcli device wifi list${NC}"
echo " ${BLUE}nmcli device wifi connect \"SSID\" password \"PASSWORD\"${NC}" echo " ${BLUE}nmcli device wifi connect \"SSID\" password \"PASSWORD\"${NC}"
echo "" echo ""
echo "5. Check Bluetooth status:"
echo " ${BLUE}bluetoothctl show${NC}"
echo " ${BLUE}bluetoothctl scan on${NC}"
echo ""
echo -e "${CYAN}Troubleshooting:${NC}" echo -e "${CYAN}Troubleshooting:${NC}"
echo "" echo ""
echo "• Check DKMS status:" echo "• Check DKMS status:"
echo " ${BLUE}dkms status${NC}" echo " ${BLUE}dkms status${NC}"
echo "" echo ""
echo "• Check loaded modules:" echo "• Check loaded modules:"
echo " ${BLUE}lsmod | grep aic8800${NC}" echo " ${BLUE}lsmod | grep aic${NC}"
echo "" echo ""
echo "• Manually load the module:" echo "• Manually load the WiFi module:"
echo " ${BLUE}sudo modprobe aic8800_fdrv${NC}" echo " ${BLUE}sudo modprobe aic8800_fdrv${NC}"
echo "" echo ""
echo "• Manually load the Bluetooth module:"
echo " ${BLUE}sudo modprobe aic_btusb${NC}"
echo ""
echo "• View detailed logs:" echo "• View detailed logs:"
echo " ${BLUE}cat $LOG_FILE${NC}" echo " ${BLUE}cat $LOG_FILE${NC}"
echo "" echo ""
echo -e "${YELLOW}Known Limitations:${NC}" echo -e "${YELLOW}Known Limitations:${NC}"
echo "• Bluetooth functionality is not supported"
echo "• Secure Boot may prevent module loading (disable in BIOS if needed)" echo "• Secure Boot may prevent module loading (disable in BIOS if needed)"
echo "" echo ""
echo -e "${CYAN}Uninstallation:${NC}" echo -e "${CYAN}Uninstallation:${NC}"