Skip to content
Snippets Groups Projects

postmarketos-base-ui: enable USB tethering v2

Merged Dylan Van Assche requested to merge dylanvanassche/pmaports:usb-tethering-v2 into master
3 files
+ 100
4
Compare changes
  • Side-by-side
  • Inline
Files
3
  • USB tethering allows users to use their phone's WiFi or WWAN interface
    as an access point for the device they connect the phone with over USB.
    This way, they can use their data plan with a laptop or desktop when
    regular Internet access is absent.
    
    Configure NetworkManager to manage the usb0 iface from initfs so users
    can configure it in GNOME Settings or KDE. Include a NetworkManager
    dispatcher script as well to handle postmarketOS' setup with unudhcpd as
    we want to provide an SSH login over USB when tethering is disabled. If
    tethering is enabled, unudhpcd is stopped and its functionality is taken
    over by NetworkManager through an instance of dnsmasq. NetworkManager
    will also configure the necessary settings to allow IP forwarding and
    firewall rules during tethering. Once disabled, NetworkManager cleans up
    these settings and our dispatcher script starts unudhcpd again.
    
    Due to upstream changes, NetworkManager requires networkmanager-dnsmasq
    subpackage as dependency as dnsmasq needs DBus support for
    NetworkManager. Without it, NetworkManager will silently fail spawning
    dnsmasq instances.
# Maintainer: Clayton Craft <clayton@craftyguy.net>
pkgname=postmarketos-base-ui
pkgver=6
pkgrel=2
pkgver=7
pkgrel=0
pkgdesc="Meta package for minimal postmarketOS UI base"
url="https://postmarketos.org"
arch="noarch"
@@ -37,6 +37,7 @@ replaces_priority=100 # leave plenty for alpine
_source644="
etc/NetworkManager/conf.d/hostname-mode.conf
etc/NetworkManager/conf.d/tethering.conf
etc/chrony/chrony.conf
etc/conf.d/tinydm
etc/conf.d/wpa_supplicant
@@ -58,7 +59,7 @@ flatpath() {
echo "rootfs-$i" | sed s./.-.g
done
}
source="$(flatpath $_source644 $_source755)"
source="$(flatpath $_source644 $_source755) tethering.sh"
package() {
local i
@@ -124,12 +125,16 @@ networkmanager() {
networkmanager-openrc
networkmanager-tui
networkmanager-wifi
networkmanager-wwan"
networkmanager-wwan
networkmanager-dnsmasq"
amove etc/NetworkManager/conf.d/hostname-mode.conf
install -Dm755 "$srcdir"/tethering.sh \
"$subpkgdir"/etc/NetworkManager/dispatcher.d/85-tethering
}
sha512sums="
3c9ae7415f4891bee8595166ed6a42cb577a837f741c6b5409d193558626348b41516888a01d0c4895282c5f4e9a1ff838c19712888750b2ef68429bb4b42ee3 rootfs-etc-NetworkManager-conf.d-hostname-mode.conf
2b4e5f4f0753d468a642bb223fd5f65dd41871aff8f9042b3a78e67fd82937c64a5c0e89c0c38ec105cce08d8f3a11638bd54c61dd66d96d2b9e0bce1954a6a0 rootfs-etc-NetworkManager-conf.d-tethering.conf
e5d049db1d82c510bab9246208b51b8ec2711d008d67792fc10d4c0b65ed4dece7b5ae3c3dd28a8539d177b6849c1f921cb9fef3d2c7bee0355451f7b4757ec6 rootfs-etc-chrony-chrony.conf
44e4283c6f77de83915977dd3bc2d8e2d96b3ed6cc68d3cc156304359ae649b5a8b0bac843e517ec6faa2066dd43ba85e313899b1eda04862f864fb9eb508aa0 rootfs-etc-conf.d-tinydm
fe0651904c1f40ffa67d83daca190af199f63247e53642a59a1e1147cd06776fcf20b7b2fcc5373783d50b8bd6ce8d1354c8e5f4d582d319727b9ceefd1e8e16 rootfs-etc-conf.d-wpa_supplicant
@@ -140,4 +145,5 @@ fe0651904c1f40ffa67d83daca190af199f63247e53642a59a1e1147cd06776fcf20b7b2fcc53737
cac604e25c46e695dd30bd5a10cfd2d69595fcc3bc290096ac94b76b10834d591ea6576afb79c46b5da492a1dbf8660cf87b6110cd39937e15237bc74fa7a5c6 rootfs-etc-X11-Xwrapper.config
d1ddd43489e6016e3ffd716027ed2bae4a2ab5f213118bdbcb96750e267ab7c0367cd0e0e386300aa5550352653144f5caeddd790621fe0879f83ca1995bb65c rootfs-etc-tinydm.d-env-wayland.d-50-firefox-wayland.sh
ecaa57d033a119a53a6574c27636b7c89d659d75ea48a973a6a4ff6f90e5d07202529fd489bfc9dfc7430f5b60f40612f6d5c06f7fab47e681b0a3112a874058 rootfs-etc-tinydm.d-env-wayland.d-50-sdl-wayland.sh
f333ce548f8a96240eb2420d005e1bf61ee3bd2ab51ce1f14e44c4d3a1cd277589cd937cdc3cc48d2251a9f502c591c8aa09dff9cee2d4fed52b6938b22ce456 tethering.sh
"
Loading