Commit graph

14 commits

Author SHA1 Message Date
Clayton Craft
31b57d33e6
main/postmarketos-usb-moded: install usb-signaller default config
Signed-off-by: Clayton Craft <craftyguy@postmarketos.org>
Part-of: <https://gitlab.postmarketos.org/postmarketOS/pmaports/-/merge_requests/9026>
2026-07-28 22:57:03 +00:00
Clayton Craft
4328119876
main/postmarketos-usb-moded: drop config/units that are shipped upstream
usb-signaller provides these scripts and init services/units

Signed-off-by: Clayton Craft <craftyguy@postmarketos.org>
Part-of: <https://gitlab.postmarketos.org/postmarketOS/pmaports/-/merge_requests/9026>
2026-07-28 22:57:03 +00:00
Dylan Van Assche
ccd3a554a6
main/postmarketos-usb-moded: use service manager for unudhcpd
Also start set -e after config parameters are read. Fallbacks would trigger exit otherwise.

Part-of: <https://gitlab.postmarketos.org/postmarketOS/pmaports/-/merge_requests/8553>
2026-06-18 06:27:13 +00:00
Dylan Van Assche
7a917eee3c
main/postmarketos-usb-moded: handle initramfs situation
initramfs starts USB NCM gadget and unudhcpd for SSH login.
This requires special handling since unudhpcd is unmanaged by the
service manager until the userspace is started. Once entered in userspace,
the usb-moded-developer-mode needs to be activated which configures
NetworkManager and starts unudhcpd under the service manager.
This way, a full handover is possible and the gadgets can be properly
switched without any leftovers from the initramfs due to the unmanaged
situation.

Part-of: <https://gitlab.postmarketos.org/postmarketOS/pmaports/-/merge_requests/8553>
2026-06-18 06:27:13 +00:00
Dylan Van Assche
b877e7943b
main/postmarketos-usb-moded: support dynamic iface
Read iface name from gadget, including config name. Also check for errors

Part-of: <https://gitlab.postmarketos.org/postmarketOS/pmaports/-/merge_requests/8553>
2026-06-18 06:27:10 +00:00
Dylan Van Assche
ba1fd6bf14
main/postmarketos-usb-moded: add OpenRC MTP mode
OpenRC also needs MTP mode for usb-signaller.

Part-of: <https://gitlab.postmarketos.org/postmarketOS/pmaports/-/merge_requests/8553>
2026-06-18 06:27:07 +00:00
Dylan Van Assche
9dcb48a08f
main/postmarketos-usb-moded: switch to usb-signaller as default
Part-of: <https://gitlab.postmarketos.org/postmarketOS/pmaports/-/merge_requests/8553>
2026-06-18 06:27:00 +00:00
Dylan Van Assche
f82661f261
main/postmarketos-usb-moded: add usb-moded-mtp-mode
MTP mode requires some time for the userspace daemon
to configure the FunctionFS gadget, wait until it is completed.

Part-of: <https://gitlab.postmarketos.org/postmarketOS/pmaports/-/merge_requests/8553>
2026-06-18 06:26:56 +00:00
Dylan Van Assche
7c4ebfcc91
main/postmarketos-usb-moded: clean up IP forwarding
NetworkManager doesn't clean up IP forwarding, do it in the tethering script.

Part-of: <https://gitlab.postmarketos.org/postmarketOS/pmaports/-/merge_requests/8553>
2026-06-18 06:26:53 +00:00
Clayton Craft
0a1cf811db
main/postmarketos-usb-moded: improve systemd unit override
This changes the override to:

1) use /sys/kernel/config for the configfs location
2) depend on the sys-kernel-config.mount unit, which will automatically
mount configfs
3) depend on modprobing libcomposite
4) create the g1/configs/c.1 path automatically in case it's not created
yet

The configfs.ini file is also updated with the path

Signed-off-by: Clayton Craft <craftyguy@postmarketos.org>
Part-of: <https://gitlab.postmarketos.org/postmarketOS/pmaports/-/merge_requests/8175>
2026-03-20 17:05:42 -07:00
Joshua Murphy
f1ad7eabad
main/postmarketos-usb-moded: add support for openrc
Part-of: <https://gitlab.postmarketos.org/postmarketOS/pmaports/-/merge_requests/7673>
2026-01-15 16:52:13 +01:00
Achill Gilgenast
ecd710af96
*/*: move to maintainer= variables
* Also move right above pkgname=
* Move Co-Maintainer lines above maintainer=
* Remove empty lines in the header

pmbootstrap 3.7+ & abuild supports maintainer= variables.

See also https://gitlab.alpinelinux.org/alpine/tsc/-/issues/88

[ci:skip-build]: no pkgver/pkgrel changes
[ci:ignore-count]: intended
[ci:skip-vercheck]: no functional changes
[skip ci]: false positives

Part-of: <https://gitlab.postmarketos.org/postmarketOS/pmaports/-/merge_requests/7723>
2026-01-12 17:01:35 +01:00
Clayton Craft
5971d0f226
main/postmarketos-usb-moded: use a generator to configure UID/GID for umtprd
MTP transfers write files to the home folder of the user.
If no GID and UID are specified, uMTP-responder will use the GID/UID
under which it is running at the time of the file transfer.
This causes users to not be able to access the files on the device after transfering.

This patch adds a systemd generator that:

1) reads /etc/default_user, and appends config to
   /etc/umtprd/umtprd.conf to set the MTP default user/group. If this
   file doesn't exist, 10000:10000 is the fallback uid:gid.
2) installs this config to /run/umtprd/umptrd.conf
3) adds a unit override to /run for umtprd.service that runs the daemon
   with this modified config

The generator is used instead of hardcoding a uid and gid in umtprd.conf
so that this can support immutable installs or situations where the
default UID/GID is not 10000.

Co-authored-by: Dylan Van Assche <dylan@postmarketos.org>
Signed-off-by: Clayton Craft <craftyguy@postmarketos.org>
Part-of: <https://gitlab.postmarketos.org/postmarketOS/pmaports/-/merge_requests/7658>
2026-01-05 10:15:18 +00:00
Clayton Craft
c957fa0c83
main/postmarketos-usb-moded: new aport
This pkg contains usb-moded profile config and config for setting
default profile based on pmb_select.

Signed-off-by: Clayton Craft <craftyguy@postmarketos.org>

Signed-off-by: Clayton Craft <craftyguy@postmarketos.org>
Part-of: <https://gitlab.postmarketos.org/postmarketOS/pmaports/-/merge_requests/6531>
2025-12-27 22:46:16 -08:00