USB Mode Switching
When switched to host mode, the device can use USB peripherals (including Wi-Fi adapters).
When switched to gadget mode, it can expose USB networking/ADB to a PC.
Switch to host mode
|
|
Switch back to gadget mode
|
|
Auto-switch at boot
Add to /etc/rc.local before exit 0:
|
|
This checks whether a PC connection is present; if not, it switches to host mode for external USB devices.
Compression Optimization for Limited Internal Storage
Some Wi-Fi sticks have very limited storage (for example 4GB). Enabling stronger compression can significantly reduce usage.
Use Btrfs (supports transparent compression)
Convert root image to Btrfs (ensure kernel has Btrfs support):
|
|
Tune mount options
Higher zstd levels reduce size further but use more CPU. For performance balance, adjust to your device.
Example remount test:
|
|
Recompress existing files
|
|
In the original test, stronger compression reduced used space notably.