usb-moded-ng features and functionality
# usb-moded-ng
`usb-moded` was rolled out into edge a while ago from MR ! This provided several features which are long desired such as USB tethering, netboot fixes, or MTP.
However, even with all the testing that happened, it seems that `usb-moded` has some issues and requires features such as no-charger-driver to be supported which goes against the design of `usb-moded`:
- IP forward issue (but relates to not be able to activate a mode in usb-moded): https://gitlab.postmarketos.org/postmarketOS/pmaports/-/issues/4237
- Incomplete devices with a broken charger driver are affected: https://gitlab.postmarketos.org/postmarketOS/pmaports/-/issues/4306
Moreover, some features are desired which are out of scope of `usb-moded`:
- Role switching: https://gitlab.postmarketos.org/postmarketOS/pmaports/-/issues/4071
- Handle netboot even better so no conflicts are even existing, so we don't need https://gitlab.postmarketos.org/postmarketOS/pmaports/-/merge_requests/7945
## Features
- Initialize gadget as well, do not rely on initramfs or scripts to configure the gadget before running the daemon.
- Transactional switching between active gadget and the created daemon gadget. Only switch if all conditions are fulfilled such as 'netboot not running', 'cable detection possible', etc.
- Configure possible modes via config files
- Only allow executing services instead of regular commands which is in theory possible now by editing the config files of the possible modes.
- Better logging
- Only mainline backend, usb-moded has Android kernel quirks
- No rescue mode as usb-moded has
- Role switching
- DBus interface for interaction with CLI to configure it.
- Chargers should not prompt for a notification.
- Should not depend on a specific node like usb-moded does (`/sys/class/power_supply/usb`)
## Idea
Write a new daemon in Rust which is lightweight, handles our use cases better, and is maintained by multiple pmOS developers.
CC: @Aelin @craftyguy
issue