brektrou / rtl8821CU

Realtek RTL8811CU/RTL8821CU USB Wi-Fi adapter driver for Linux
GNU General Public License v2.0
1.59k stars 460 forks source link

Suggestion: add startup service to change USB mode #49

Open dasaki opened 4 years ago

dasaki commented 4 years ago

Just in case it helps, my system ( hp prodesk G2, ubuntu 18.04, kernel 5.13 ) got stuck at boot time until I unplugged the rtl8821cu USB dongle . UDEV rule with usb_modeswitch didn't help with that. This was the log:

[ 7.343567] ata2: SATA link down (SStatus 4 SControl 300) [ 7.660504] ata3: SATA link down (SStatus 4 SControl 300) [ 7.976400] ata4: SATA link down (SStatus 4 SControl 300) [ 8.292375] ata5: SATA link down (SStatus 4 SControl 300) [ 8.608524] ata6: SATA link down (SStatus 4 SControl 300)

I solved this by adding a system service: /etc/systemd/system/rtl8821cu_usbmodeswitch.service

[Unit] Description=switch rtl8812cu from disk to wifi mode [Service] ExecStart=/usr/src/rtl8821cu/switch_mode.sh [Install] WantedBy=multi-user.targetç

that calls the script: switch_mode.sh

!/bin/sh

( usb_modeswitch -KW -v 0bda -p 1a2b ) &