-
Notifications
You must be signed in to change notification settings - Fork 6
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
chore: script and readme improvements
- Add Caution and Uninstall sections to readme - Add uninstall scripts
- Loading branch information
Showing
4 changed files
with
85 additions
and
34 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,39 @@ | ||
#!/bin/bash | ||
|
||
|
||
# Clean up gadget directory if it exists | ||
|
||
cleanup_gadget() { | ||
echo "Cleaning up existing USB configurations..." | ||
|
||
# Only unload modules if they exist | ||
if [ $MODULES_LOADED -eq 1 ]; then | ||
echo "Unloading existing USB modules..." | ||
modprobe -r g_ether usb_f_rndis usb_f_ecm u_ether || true | ||
fi | ||
|
||
# Clean up gadget directory if it exists | ||
if [ $GADGET_EXISTS -eq 1 ]; then | ||
echo "Removing existing HID gadget configuration..." | ||
cd /sys/kernel/config/usb_gadget/hid_gadget | ||
if [ -f UDC ]; then | ||
echo "" > UDC | ||
fi | ||
|
||
# Remove symbolic links | ||
rm -f configs/c.1/hid.usb0 | ||
rm -f configs/c.1/hid.usb1 | ||
|
||
# Remove directories | ||
rm -rf functions/hid.usb0 | ||
rm -rf functions/hid.usb1 | ||
rm -rf configs/c.1/strings/0x409 | ||
rm -rf configs/c.1 | ||
rm -rf strings/0x409 | ||
|
||
cd .. | ||
rmdir hid_gadget 2>/dev/null || true | ||
fi | ||
} | ||
|
||
cleanup_gadget |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
#!/bin/bash | ||
|
||
# Restore config.txt | ||
sudo cp /boot/config.txt.bak /boot/config.txt | ||
|
||
# Remove dwc2 driver | ||
sudo sed -i '/dtoverlay=dwc2/d' /boot/config.txt |