Draft: postmarketos-base-ui: enable NetworkManager USB tethering
Configure NetworkManager to manage our USB gadget as an Ethernet device to allow USB tethering through NetworkManager. Only tested with nmcli since UIs such as GNOME Control Center do not properly resize yet.
This commit adds the following:
- Add a NetworkManager configuration to manage usb0 because
NetworkManager marks USB gadgets by default unmanaged through one of
its provided udev rules in
/lib/udev/rules/85-nm-unmanaged.rules
- Forbid NetworkManager to create connection profiles for usb0 on boot since we provide our own profile. If we do not set this option, we get 2 profiles on boot for the same usb0 interface with the same name but different UUID.
- Enable dnsmasq as a service to provide DNS lookups to connected devices over USB tethering. Normally, NetworkManager does that automatically, but it cannot start dnsmasq as it enables DHCP in dnsmasq as well which conflicts with unudphcd. Therefore, add dnsmasq as a service in DNS-only mode (its default).
This only takes effect when the UI depends on NetworkManager.
Depends on https://gitlab.com/postmarketOS/unudhcpd/-/merge_requests/9
Edited by Administrator