Skip to content

Draft: postmarketos-base-ui: enable NetworkManager USB tethering

Dylan Van Assche requested to merge usb-tethering into master

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:

  1. 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
  2. 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.
  3. 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 unudhcpd!9 (closed)

Edited by Dylan Van Assche

Merge request reports