Skip to content

omamobile-shell 0.2.143 and omamobile-device-husky 0.1.22: a shared hotspot on ap0 for #539's Hotspot page, used by the Pixel 8 Pro - #1001

Draft
Somnius wants to merge 13 commits into
derekross:mainfrom
Somnius:hotspot-backend-husky-1122
Draft

Somnius wants to merge 13 commits into
derekross:mainfrom
Somnius:hotspot-backend-husky-1122

Conversation

@Somnius

@Somnius Somnius commented Nov 22, 2026 •

Copy link
Copy Markdown
Contributor

This builds on @den-kloot's #539 (the Hotspot page and its backend hook), so it should go in after it. The branch is #539's head (which has main merged in), plus two commits of mine on top, one for omamobile-shell and one for omamobile-device-husky. Only those two are new here. I'm opening it as a draft because the package itself hasn't run on the phone yet (more on that below).

On the 8 Pro the NetworkManager hotspot can't work as it is. wlp1s0 refuses AP mode (-52, same as the 9a). On a second interface ap0 the AP beacons, but with the profile's pmf 1 my phone never even got to auth. With a patched driver on wlp1s0 clients got further and then left the 4-way handshake with reason 17: the AP's RSN IE (from a desktop scan, probe response) only offers PSK-SHA256, while NetworkManager with pmf 1 or 2 gives wpa_supplicant PSK and PSK-SHA256. With pmf 3 it passes PSK-SHA256 only, and then my phone joined on ap0. Details in #523: #523 (comment)

So instead of a second Hotspot UI, this adds one shared hotspot for #539's page, which phones like this opt in to (den-kloot asked for one place for the 8 Pro and the 9a):

  • omamobile-shell: hotspot/hotspot-ap runs as root under omamobile-hotspot.service. It adds ap0 beside the client Wi-Fi and binds the Hotspot profile to it with pmf 3, 2.4 GHz and shared mode. It opens DHCP, DNS and forwarding on ap0 in UFW, and turns IPv4 forwarding on per link for ap0 and the uplinks that had it off, then sets it back after. That's in case an uplink NetworkManager doesn't manage, like the 9a's rmnet0, has it off; not confirmed on the 9a yet. It keeps a client list and removes all of it again on stop, so ap0 only exists while the hotspot is on. hotspot/hotspot-backend answers the page and the tile (state, active, set, on, off). The unit has ConditionPathExists=/usr/share/omamobile/hotspot.conf, so it does nothing on phones that didn't opt in. polkit lets the active local user start and stop that one unit, nothing else. This adds a root helper for networking and a second polkit rule to omamobile-shell; if that should be its own package, I'll split it. No VPN sharing yet, so the boxes stay hidden.
  • The tile: omamobile-shell 0.2.107: a Hotspot page behind the tile's chevron #539's page hands everything to the backend except on/off, which still went through the tile to nmcli device wifi hotspot. Now tile-action.sh goes through hotspot-panel.sh for on/off too, which uses the backend when there is one and NetworkManager's hotspot otherwise, so other phones behave as before. For the tile's state there's a cheap active verb (on or off, no secrets, no QR). A backend without it should still work: the script falls back to its state line (tested with a stub). on waits until the unit is up, so a start that fails shows as off again (other tile taps wait behind it meanwhile).
  • omamobile-device-husky: /usr/share/omamobile/hotspot.conf (interface=ap0), the /etc/omamobile/hotspot-backend link, a test, and the tools the helper runs as dependencies. The 9a can do the same.
  • The branch is now on den-kloot's latest omamobile-shell 0.2.107: a Hotspot page behind the tile's chevron #539 head (38c6c86), so the OMAMOBILE_HOTSPOT_SYSTEM_BACKEND variable is his; my copy is gone.

The root helper used to stop the hotspot at 60 C on the die in my local builds. After your review of #946 that's off by default now; stop_temp_mc= in /etc/omamobile/hotspot.conf turns it on.

Why pmf 3: the AKM mismatch on the 8 Pro

Tested on my desktop in the CI container as uid 1000: tools/pr-check, tests/all, and test/all for omamobile-device-husky and omamobile-shell. New in the shell: test/hotspot-ap.sh (including forwarding set and restored per link, with an uplink appearing mid-run) and test/hotspot-backend.sh, plus cases in test/hotspot-panel.sh, and in test/tile-scripts.sh that run the tile scripts against a stub backend. Everything uses stub nmcli, iw, ufw and systemctl, so nothing on the machine is touched.

What has run on the phone, but not as this package: my OnePlus 13 joined an AP on ap0 with pmf 3 twice, once on the stock brcmfmac. It got a lease and had internet; I checked the internet part on the OnePlus, it isn't in a log. Those runs brought the profile up from a test script, not from this service. Separately, an earlier version of hotspot-ap (from my local omamobile-settings builds, before pmf 3 and the other changes here) started and stopped from my session through polkit, and ap0 and the UFW rules came and went cleanly. No client was joined in those service runs.

Known limit: a hotspot client can also reach the phone's home LAN (forwarding isn't limited to one uplink). Limiting that, with a routing table of its own, goes in a follow-up together with VPN sharing.

Not tested yet: this branch installed on a phone, so a client joining through the service, the backend script, and the tile and page going through it. den-kloot offered a run on the 9a with a client and mobile data; I'll do the 8 Pro one with phone-smoke and screenshots before this leaves draft. Also not tested: scanning while ap0 is up (den-kloot's point 4 on #523), devices without 802.11w (pmf required locks them out), a 5 GHz-only home network. With my home network on 2.4 GHz the client Wi-Fi moved to the hotspot's channel, with a short drop when it started; on 5 GHz (dual-band) it stayed put. Also the NetworkManager path on another phone after the tile change, which only has the stubbed tests. Like #539's NetworkManager path, the password goes to nmcli as an argument when it's set.

cbm and others added 7 commits November 8, 2026 23:01
The Hotspot tile only switched the hotspot on and off; its long-press
opened the Wi-Fi picker, which says nothing about the hotspot itself. The
tile now has a chevron, like Wi-Fi and Bluetooth, and behind it a page
(HotspotPanel.qml): the switch with the number of connected devices, the
network name and the password (hidden, an eye shows it), a QR code that
joins another phone (the usual WIFI: string, drawn with qrencode, now a
dependency), and a pencil that makes name and password editable; a running
hotspot restarts with the new values.

Data and actions go through hotspot-panel.sh next to the page, as the
tiles' tile-state.sh and tile-action.sh. It reads NetworkManager's
"Hotspot" connection (the one tile-action.sh makes) and changes it with
`nmcli connection modify`. Two more boxes, "Share VPN" (devices on the
hotspot reach what the phone's VPN reaches) and "Route all traffic
through the VPN", are drawn only when the backend reports them:
NetworkManager's shared mode has no such switch, so they stay hidden
there. A device that brings its own hotspot (hostapd, its own firewall)
can answer the page's verbs from an executable at
/etc/omamobile/hotspot-backend (or ~/.config/omamobile/hotspot-backend)
and gets the boxes; the script still adds the QR code for it. This is
what the Pixel 9a runs today (its hotspot is hostapd on ap0, derekross#523), so
the whole page, boxes included, was used there; the NetworkManager path
is covered by the test.

The page is a layer-shell window of its own, like the Wi-Fi picker, with
the same back glyph, and `omarchy-shell shell summon
omamobile.quicksettings '{"page":"hotspot"}'` opens it.

Tests: test/hotspot-panel.sh (the NetworkManager state line, the QR code
drawn once and dropped after a change, name and password checks, a change
on a running and on a stopped hotspot, the VPN boxes refused there, no
qrencode, a device's own backend), and test/all checks that the tile's
chevron opens the page, that the page runs the script next to it and that
the password field is masked.

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01176vSgL9PRmxFqbaB3D9vk
- shareAvailable starts false and only a backend's share_available: true
  shows the VPN boxes, so they no longer flash on open or stay when the
  state line can't be parsed.
- "Shares mobile data only." is no longer shown for every backend: a
  backend that knows says where its devices' traffic goes in a new
  optional uplink_note; NetworkManager's gives none (its devices follow
  the phone's default route, a full-tunnel VPN included), and the
  stopped hotspot reads "Shares the phone's internet connection over
  Wi-Fi."
- qrencode gets the WIFI: string on stdin, keeping the password out of
  /proc/*/cmdline; the unused qr_escape() is gone.
- README: a Hotspot page section on hotspot-panel.sh and where a
  device's hotspot-backend comes from.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The owner asked that the full-screen pages behind quick settings' tiles
close the same way. The Wi-Fi and Bluetooth pages get a swipe-up strip
at their bottom edge in derekross#553; the Hotspot page now has the same one:
max(28, Style.space(36)) high, a swipe up past 24 px closes it, and the
page's body ends above the strip, so nothing on the page lies under it.

test/all on a PC: 304 ok.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…de fake tells arguments from stdin

Review of derekross#539. tests/grep-q-pipes (derekross#587) refuses a pipe into grep -q in a
script that sets pipefail: grep -q exits at the first match, the writer can
get SIGPIPE, and pipefail then fails the pipeline at random.
test/hotspot-panel.sh had eleven; they now use grep -c ... >/dev/null,
which reads all its input.

The fake qrencode logged its arguments and its stdin on one line, so the
check that the WIFI: string goes to qrencode on stdin passed either way. It
now writes "qrencode args:" and "qrencode stdin:" lines, and the test checks
that the string arrives on stdin, that the arguments are only the options,
and that the string is never an argument (it would show in
/proc/*/cmdline). With the script changed to pass the string as an
argument, the old test still passed and the new one fails.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
main is at omamobile-shell 0.2.115; this branch takes 0.2.116 so the
version file no longer conflicts and CI runs again. The final number is
set at merge.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…spot-page-wt

# Conflicts:
#	packages/omamobile-shell/version
- Escape on the Hotspot page ends the name and password edit, else goes
  back to quick settings (`root.backRequested()`), as the Wi-Fi, Bluetooth
  and Record pages do. The scrim tap and the swipe strip still close.
- `test/all` checks it with the Wi-Fi and Bluetooth pages, and
  `plugins/README.md` names the Hotspot page among the ones that go back.
- Opening the quick settings sheet closes the Hotspot page too, so pulling
  the sheet down over an open one leaves nothing behind it.
- `OMAMOBILE_HOTSPOT_SYSTEM_BACKEND` names the system backend's path
  (default /etc/omamobile/hotspot-backend); the test points it into its
  scratch directory, so it no longer depends on the machine it runs on,
  and checks the owner's backend goes before the system one.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@Somnius
Somnius force-pushed the hotspot-backend-husky-1122 branch from 896a1f1 to 2b3869c Compare November 22, 2026 17:53
@den-kloot

Copy link
Copy Markdown
Contributor

@Somnius, thanks for building this on #539, and for taking the system-path variable along. My push for #539 (Escape goes back to quick settings, the page closes when the sheet opens, and the variable, with the same line as yours) is ready; once it is up you can drop your copy when you rebase.

The 9a needs exactly this: the same -52 on wlp1s0, and pmf 3 on ap0 worked here today with an iPhone (details in #523: #523 (comment)). Rather than a second copy of hotspot-ap and hotspot-backend in omamobile-device-tegu, could they live in one place that both device packages use, for example omamobile-shell next to the page, with the device package shipping only its hotspot.conf (interface=ap0)? Then tegu is a config file and a test, and cheetah can follow after a run on Derek's 7 Pro. I'm happy to do the tegu side and to test your branch on the 9a with a client.

Three things from the 9a run that touch this PR:

  1. Mobile data as the uplink. On the 9a the hotspot usually goes out through rmnet0, which NetworkManager doesn't manage. In my test I turned IPv4 forwarding on myself, and NetworkManager had left ip_forward at 0 after activating the shared profile, so I can't say yet whether the replies coming in on rmnet0 are forwarded with this PR as it is. I'll check with your branch and a client. If they aren't, the root helper would need forwarding on for the uplink while it runs (per link, and set back after).
  2. Which networks the clients reach. route allow in on ap0 forwards to any uplink, so with the phone on a home Wi-Fi, a device on the hotspot reaches that LAN too. My hostapd setup sends the hotspot's subnet to a routing table of its own that holds only mobile data's default route (unreachable default without mobile data). Would you want that here, or as a follow-up? It is also where VPN sharing for the page's two boxes would go, which I'd like to bring on top.
  3. The phone's own Wi-Fi. On the 9a it dropped for about 12 s at the start and left 5 GHz for the AP's 2.4 GHz channel while the hotspot ran (details in Pixel 9a: the Wi-Fi hotspot (AP mode on wlp1s0 refused; on ap0 stations never authorized) #523), unlike your 8 Pro. Nothing to change here, but if the helper becomes shared, "the client Wi-Fi stays connected" in its header is an 8 Pro fact, not a 9a one.

Measured on my phone with Claude.

@Somnius
Somnius force-pushed the hotspot-backend-husky-1122 branch from 2b3869c to 7dee3ab Compare November 22, 2026 18:49
@Somnius Somnius changed the title omamobile-device-husky 0.1.22 and omamobile-shell 0.2.142: a Pixel 8 Pro hotspot backend for #539's Hotspot page omamobile-shell 0.2.143 and omamobile-device-husky 0.1.22: a shared hotspot on ap0 for #539's Hotspot page, used by the Pixel 8 Pro Nov 22, 2026
…he tile through a device's backend

brcmfmac on the Pixel 8 Pro and the 9a refuses AP mode on wlp1s0 (-52).
On a second interface ap0 an access point works, and clients join once
the profile has pmf 3: the AP's RSN IE from the firmware offers
PSK-SHA256 only, while NetworkManager with pmf 1 or 2 gives
wpa_supplicant PSK and PSK-SHA256 (derekross#523).

So the shell carries one hotspot for such phones: hotspot/hotspot-ap
(as root, omamobile-hotspot.service) adds ap0 beside the client Wi-Fi,
binds the Hotspot profile to it with pmf 3 on 2.4 GHz, opens DHCP, DNS
and forwarding on ap0 in UFW, turns IPv4 forwarding on per link for ap0
and the uplinks that had it off (NetworkManager doesn't for an uplink it
doesn't manage, such as the 9a's rmnet0) and sets it back after, keeps a
client list, and removes ap0 on stop. hotspot/hotspot-backend answers
device package ships /usr/share/omamobile/hotspot.conf, and the device
package links /etc/omamobile/hotspot-backend; polkit lets the active
local user start and stop that one unit. No VPN sharing or client
isolation yet. The heat stop is off by default (stop_temp_mc=).

The page handed state, set, share and alltraffic to a device backend,
but on and off still went through the tile to nmcli device wifi
hotspot. Now tile-action.sh goes through hotspot-panel.sh for those too,
which uses the backend when there is one and NetworkManager otherwise,
and tile-state.sh reads the tile's state from the backend's "active".

Signed-off-by: Lef <me@lefteros.com>
The 8 Pro can't start an access point on wlp1s0 (derekross#523), so it opts in
to omamobile-shell's shared hotspot: /usr/share/omamobile/hotspot.conf
with interface=ap0, and the /etc/omamobile/hotspot-backend link the
Hotspot tile and page look for. Depends on omamobile-shell 0.2.143 and
the tools the helper runs (iw, iproute2, NetworkManager, dnsmasq,
polkit).

Signed-off-by: Lef <me@lefteros.com>
@Somnius
Somnius force-pushed the hotspot-backend-husky-1122 branch from 7dee3ab to badef05 Compare November 22, 2026 18:57
@Somnius

Somnius commented Nov 22, 2026

Copy link
Copy Markdown
Contributor Author

@den-kloot thanks, and great to see it work on the 9a with an iPhone.

One place for both phones: done. hotspot-ap, hotspot-backend, the unit and the polkit rule now live in omamobile-shell (the two scripts under /usr/lib/omamobile-shell/hotspot/). The unit has ConditionPathExists=/usr/share/omamobile/hotspot.conf, so it does nothing on a phone that didn't opt in, and the backend's on says so instead of pretending. omamobile-device-husky now only ships that hotspot.conf (interface=ap0), the /etc/omamobile/hotspot-backend link and a test, plus the tools the helper runs as dependencies (iw, iproute2, NetworkManager, dnsmasq, polkit, with ufw optional). tegu would need the same. Yes please to doing that side. /etc/omamobile/hotspot.conf still overrides the values but doesn't opt a phone in by itself. @derekross, this puts a root helper for networking and a second polkit rule into omamobile-shell; if you'd rather have them in a small package of their own, I'll split it.

On your 1 (mobile data): I added it before your check. While the hotspot runs, the helper turns IPv4 forwarding on per link for ap0 and every link with a default route in the main table that had it off. It never touches conf/all, and it looks again every 5 s so mobile data coming up later is caught. On stop it writes the old values back. They're saved once, so a run after a crash doesn't save its own 1. The kernel forwards by the flag of the link a packet comes in on, and NetworkManager's ipv4.forwarding "auto" only turns it on, while a shared connection is up, for links it manages. So ip_forward (which the helper leaves alone) isn't what decides it here, the per-link flag is. Whether rmnet0's is 0 on the 9a I can't say, that's for your run to show. If your mobile data default route lives in a table of its own, this won't see it yet. The 8 Pro has no mobile data, so this is only tested in the container with a stub sysctl tree.

On your 2 (which networks the clients reach): I'd keep that for a follow-up, with VPN sharing on top as you suggest. I don't want to grow this one more before it has run on a phone. For now the PR and the husky README say a hotspot client can reach the home LAN. Your note in #523 about re-activation dropping the table's routes and rp_filter fits there.

On your 3: fixed. The shared header now says the client Wi-Fi can drop for a few seconds and move to the hotspot's channel depending on the phone, and the 8 Pro specifics are in its README.

I rebased on your #539 push (38c6c86) and dropped my copy of the system-path variable, so the branch now uses yours, and your two tests for it replace mine. The shell is 0.2.143 here (#539 and #977 both use 0.2.142), Derek sets the real numbers at merge anyway.

Not tested yet: this branch installed on any phone. tools/pr-check and tests/all pass in the CI container, and the client runs in #523 used a test script, not this service. A run on your 9a with a client and mobile data would help a lot. I'll do the 8 Pro one with phone-smoke and screenshots.

@den-kloot

Copy link
Copy Markdown
Contributor

@Somnius, the 9a run I promised, on your head badef05f. In short: with one fix to the profile your backend makes, it works on the 9a over mobile data, and the per-link forwarding is what carries the replies. As it is, the first start on a phone without a Hotspot profile fails.

Setup. Pixel 9a, 7.3.0-rc6-omamobile-push1-gb54730e55758, NetworkManager 1.58.1, wpa_supplicant 2.12, away from home: mobile data up (rmnet0), Wi-Fi on but not associated. Not a built package: your four files copied where the package puts them (hotspot-ap, hotspot-backend, the unit, the polkit rule), plus /usr/share/omamobile/hotspot.conf with interface=ap0 as the tegu opt-in. The tile and page side ran as your scripts from the checkout (hotspot-panel.sh, tile-action.sh, tile-state.sh) as the session user, with OMAMOBILE_HOTSPOT_SYSTEM_BACKEND pointing at your backend, because this phone's /etc/omamobile/hotspot-backend is my own hostapd one. I took my three hand-made ufw rules for ap0 out for the run and put them back after, so the firewall had no ap0 rule when your helper started, and ip_forward and every link's forwarding were 0. One client, an iPhone.

1. The start fails with the profile make_profile creates (2 of 2). There was no Hotspot profile, so hotspot-panel.sh set NAME PASS made one ("ok: saved; applies when the hotspot is turned on"). on then failed after 35 s both times: "error: the hotspot did not start", last-stop "failed: the access point did not start". wpa_supplicant says why:

Could not generate WPA IE.
WPA initialization failed.
ap0: Could not connect to kernel driver
Interface initialization failed
ap0: AP-DISABLED

and NetworkManager gives up 25 s later ("Hotspot network creation took too long, failing activation"). The profile has key-mgmt wpa-psk and pmf 3, but proto, pairwise and group are empty. My reading: with pmf 3 NetworkManager passes PSK-SHA256 only (your finding), and with no proto wpa_supplicant also builds a WPA (v1) element, which has no such AKM. After

nmcli connection modify Hotspot 802-11-wireless-security.proto rsn \
  802-11-wireless-security.pairwise ccmp 802-11-wireless-security.group ccmp

the same code started the access point in 7.2 s, and in 6.6 s on a restart. So make_profile needs those three (and hotspot-ap's connection modify could set them too, for a profile that lacks them). Your own profile probably has them from NetworkManager's hotspot; nmcli -g 802-11-wireless-security.proto,802-11-wireless-security.pairwise,802-11-wireless-security.group connection show Hotspot would tell. I first suspected the scan NetworkManager runs on the new interface and its scan MAC randomization; both are ruled out (it fails the same with randomization off, and works with it on once proto is set).

2. With that, a client gets out through mobile data. The iPhone joined by itself 15 s after the start, was authorized, got 10.42.0.176 from NetworkManager's dnsmasq and sent 52 DNS packets to the phone. Forwarded: 487 packets ap0 → rmnet0, 515 back (492 kB), nothing to any other link. While the hotspot was on: forwarding 1 on ap0, rmnet0 and usb0, ip_forward still 0; after the stop all 0 again. rmnet0 was 0 before your helper set it, so on the 9a the per-link flag is needed, and it is enough. Mobile data's default route is in the main table here (default dev rmnet0 metric 700), so uplinks found it. ufw held exactly your eight rules (DHCP, DNS udp and tcp, the route rule, each for v4 and v6) and none after.

3. The verbs. As the session user, no prompt from polkit for start or stop.

step result
backend, state, active before found; hotspot: off, off
state while on hotspot: on, clients: 1, the password readable; clients file: MAC, address, "iPhone"
tile-state.sh hotspot=on while on, hotspot=off after
set while on (same name and password) "ok: hotspot restarted with the new name and password" after 11 s (stop 4.2 s, start 6.6 s); the iPhone was back by itself 3 s after the access point
tile-action.sh hotspot off returned after 0.1 s; unit inactive after 4.4 s, ap0 gone, rules gone, forwarding back, last-stop "ended"

4. Smaller things.

  • From reading, not from the run (I had taken my rules out): ufw_del deletes by spec, so an owner's own allow in on ap0 to any port 67 proto udp goes with it, at the start and for good at the stop; ufw can't hold your rule beside an equal one. Deleting only what carries the omamobile-hotspot comment (your sweep by number) would leave such a rule alone.
  • uplinks takes every link with a default route, so usb0 got forwarding too here (its route says linkdown); it was set back.
  • With no channel in the profile the access point came up on channel 6 both times.
  • Each start spends about 2.7 s on wpa_supplicant's P2P device for ap0, which the firmware refuses (brcmf_p2p_create_p2pdev: timeout occurred, add iface p2p-dev-ap0 type 10 failed: err=-5). Not yours, but it is 2.7 s of the 7.
  • One brcmf_escan_timeout: timer expired per run, 35 and 22 s after the access point came up; no SCAN-FAILED.

Not covered: the phone's own Wi-Fi connected beside ap0 (I was not at home, so nothing was saved or brought back, and no channel move; #523 has that from my earlier test), the page itself (QML; this phone runs a hand copy of the plugin), a client without 802.11w, more than one client, a built package. The two good starts ran a copy of hotspot-ap with test switches I had added while looking for the cause, all off; it passes your test/hotspot-ap.sh.

I can send the tegu side (the hotspot.conf, the link and a test in omamobile-device-tegu) on top of this once the profile fix is in, and the routing table for the clients with VPN sharing after that.

Measured on my phone with Claude.

…FW rules left alone, no forwarding on linkdown links

From den-kloot's run on the Pixel 9a (derekross#1001):
- A profile the backend makes had key-mgmt wpa-psk and pmf 3 but no
  proto, pairwise or group, and wpa_supplicant failed with "Could not
  generate WPA IE": NetworkManager passes PSK-SHA256 only with pmf 3,
  and without proto rsn it also builds a WPA v1 element. The backend
  now makes the profile with proto rsn, pairwise ccmp and group ccmp,
  and hotspot-ap sets the same when it binds a profile to ap0.
- ufw_del deleted the hotspot's rules by spec, which also takes an
  owner's own equal rule. It now only deletes rules tagged
  omamobile-hotspot, by number. And ufw_add doesn't add a rule the
  owner already has untagged on the interface, since ufw would put our
  comment on theirs and the stop would then delete it.
- uplinks took every link with a default route, including one marked
  linkdown (usb0 with no cable). Those are skipped now.

Signed-off-by: Lef <me@lefteros.com>
@Somnius

Somnius commented Nov 22, 2026

Copy link
Copy Markdown
Contributor Author

@den-kloot thanks a lot for this run, it's exactly what I couldn't do here: mobile data, a clean firewall and an iPhone. Good to see the per-link forwarding is what carries the replies on the 9a.

  1. The profile from make_profile: fixed. The backend now makes it with proto rsn, pairwise ccmp and group ccmp, and hotspot-ap sets the same three when it binds a profile to ap0, so an older profile without them gets them too. You were right about mine: on my 8 Pro the Hotspot profile already has rsn, ccmp, ccmp (and pmf 3), which is why I never hit it. The backend test now checks the three are in the connection add, and fails against the old backend.
  2. ufw_del taking the owner's own rule: fixed in two parts. The stop no longer deletes by spec, only rules tagged omamobile-hotspot, by number. And since ufw can't hold our rule beside an equal one (it would put our comment on yours), the start now skips any of our rules that ufw status already shows untagged on the interface. That match uses ufw's usual status form (67/udp on ap0 ALLOW IN), and I've only tested it against a stub, not a real owner rule.
  3. Forwarding on usb0: fixed. uplinks skips a default route marked linkdown. The test has a linkdown link that must stay at 0.
  4. Channel 6 and the P2P device: noted in the helper's header, the 2.7 s p2p-dev-ap0 timeout as the firmware's and harmless.

The new checks for 1, 3 and the owner-rule skip fail with the old code swapped back in, and so does the no-delete-by-spec check. tools/pr-check and test/all pass in the CI container. I also put in the helper's header that on the 9a the per-link flag was what carried the replies, from your run. None of this is run on a phone yet, mine is busy with other tests.

And yes please to the tegu side on top, and the routing table and VPN sharing after that.

@derekross derekross left a comment

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you, Lef, and thank you @den-kloot for the 9a run with an iPhone over mobile data, which answered the questions I would have asked about forwarding. The shape is right: one helper for both phones, opted into by a file only the device package ships, a polkit rule for one unit and two verbs, cleanup in ExecStopPost, and forwarding turned on per link and put back. I checked that on a phone with no backend the tile now runs the same nmcli commands as before, so the other phones should see no difference; I'll confirm that on my 7 Pro.

Before this leaves draft:

  1. It goes in after #539. Once #539 is squashed, this branch needs git rebase --onto origin/main 38c6c86ae925, so only your three commits are left.
  2. Your 8 Pro run from the built packages, through the unit and the page with a client, with a tools/phone-smoke report and screenshots, as you said.
  3. Two things that are mine to decide, and I'll answer here: whether the root helper and the polkit rule live in omamobile-shell or in a small package of their own (thank you for offering to split it), and whether a hotspot that lets its clients reach the home network can ship before den-kloot's routing-table follow-up. I lean towards a separate package, and I'll confirm.

Small: omamobile-device-husky 0.1.22 is also taken by #997, and the husky package's omamobile-shell>=0.2.143 names a number another open PR claims; I'll set both numbers at merge and keep the dependency equal to the shell this PR lands with.

@derekross

Copy link
Copy Markdown
Owner

Decisions: (1) the root networking helper and its polkit rule go in a small opt-in package of their own, not omamobile-shell, so the root surface is only on phones that ask for it. Thank you for offering the split. (2) A hotspot whose clients can reach the owner's home network doesn't ship. It waits for den-kloot's routing follow-up that isolates the clients.

… an opt-in package of their own

The helper, its backend, omamobile-hotspot.service, the polkit rule and their
tests move out of omamobile-shell into packages/omamobile-hotspot (installed
under /usr/lib/omamobile-hotspot/), so omamobile-shell ships no root helper and
only phones whose device package asks for it get that surface. The tools the
helper runs (iw, iproute2, networkmanager, dnsmasq, polkit, ufw optional) move
from omamobile-device-husky to it; husky depends on omamobile-hotspot and its
link points at the new path. The README says plainly that clients can reach
the networks the phone is on until client isolation lands.

Signed-off-by: Lef <me@lefteros.com>
The package would be built and pulled in by husky once merged, so the gate
for client isolation is the pull request itself, not publishing.

Signed-off-by: Lef <me@lefteros.com>
@Somnius

Somnius commented Nov 24, 2026

Copy link
Copy Markdown
Contributor Author

Thanks @derekross. (1) is done in 2d0ff66 and fc00643: hotspot-ap, hotspot-backend, the unit and the polkit rule moved into a new package, omamobile-hotspot 0.1.0, installed under /usr/lib/omamobile-hotspot/. omamobile-shell ships no root helper or hotspot rule anymore; it keeps the page and tile, which still fall back to plain nmcli when no backend is there. The husky package now depends on omamobile-hotspot and keeps only its hotspot.conf, the link and its test, and the tools moved with the helper. The new package isn't in rootfs/packages.omamobile, it only comes in through a device package that asks for it.

One question: the hotspot rule is still the YES rule for start/stop of this one unit. After your #1009 (#1009) decision, should it ask for the PIN too (auth_admin_keep)? I'll do that if you want it.

On (2): understood, it doesn't ship while clients can reach the home network. I'll leave this as a draft until the isolation is in. @den-kloot, how do you want to go about the routing follow-up? I have a VPN sharing branch here that touches the same place, so I'd rather we agree who does what before either of us writes more.

Tested in the Arch CI container as uid 1000: tools/pr-check, the pipe lints, and test/all of the new package, husky and the shell, all pass. Not built with makepkg and not run on the phone yet.

@derekross derekross left a comment

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you, Lef. The split is what I asked for, and I checked it file by file: the helper and the backend moved into omamobile-hotspot unchanged, the unit and the polkit rule with them, the shell no longer ships any of it, and the Pixel 8 Pro's package now brings it in by depending on it. Both packages' tests pass here on this head. Keeping it a draft until the clients are isolated is right, and thank you for saying so in the README as well.

On your question about the PIN: by the same reasoning as #1009, starting the hotspot opens DHCP, DNS and forwarding through the firewall on a new interface, and today any process in the session can do that without asking. I lean towards auth_admin_keep for start (stop can stay as it is, since it only closes things), and I'll confirm here before you change it.

Otherwise the list from last time stands: the isolation follow-up (I'll leave the who-does-what to you and @den-kloot), #539 first and then git rebase --onto origin/main 38c6c86ae925, and your 8 Pro run from built packages with a client. Small things: the new pkgdesc says "Omarchy Mobile" (the project is Omamobile now) and the url= still has the old repository name. I'll set the version numbers at merge; the shell's 0.2.143 is already taken on main.

@derekross

Copy link
Copy Markdown
Owner

Decision: starting the hotspot asks for the PIN (auth_admin_keep), as the firewall switch now does. The rest stands: its own opt-in package, and no hotspot whose clients can reach the home network before the isolation follow-up.

Starting the hotspot opens DHCP, DNS and forwarding on ap0, so the polkit
rule now returns auth_admin_keep for start, as the firewall switch does.
Stop stays YES since it only closes things. pkgdesc says Omamobile and
url= uses the new repo name.

Signed-off-by: Lef <me@lefteros.com>
@Somnius

Somnius commented Nov 24, 2026

Copy link
Copy Markdown
Contributor Author

Done in e57f38f, following your decision: starting the hotspot now asks for the PIN (auth_admin_keep), stop stays as it was. The rule's comment and the README say why, and test/all checks that start asks, stop doesn't, and YES is left only for stop. pkgdesc says Omamobile and url= has the new repo name.

Not run on the phone yet. In the run (from the built packages, with a client connected) I'll check that the shell's PIN pad comes up from the hotspot toggle, and what a cancelled PIN does when you rename the hotspot while it's on (stop goes through, start needs the PIN, so a cancel should leave it off and the page should say so). The #539 rebase and the isolation follow-up are still open, I'll sort out the who-does-what with @den-kloot.

@Somnius

Somnius commented Nov 24, 2026

Copy link
Copy Markdown
Contributor Author

@den-kloot thanks a lot for offering to do the routing follow-up. If you're ok with it, we'll write it: I already have a VPN sharing branch that changes the same part of hotspot-ap, so it's easier to do the client isolation in the same follow-up than to have both of us in there at once. Your 9a run with a client and mobile data would still help a lot once it's up, and the tegu side stays yours as you offered.

The plan is one PR on top of this one:

  • Client isolation, the part that blocks this PR: a hotspot client gets out through the uplink but can't reach the owner's home LAN or the phone's other links. That part isn't written yet.
  • Share VPN with a kill switch, for the page's box: with it on, the clients' traffic goes only through the VPN link, and if the VPN drops, their forwarding and DNS are dropped too, so nothing goes around the tunnel.

The VPN part exists as two local commits on this PR's older head, from before the omamobile-hotspot split, so it has to move into the new package first. So far it has only run in the CI container: stub tests plus a real-kernel network-namespace test. No real WireGuard tunnel and no phone yet.

I'll open it once this one is in.

@derekross derekross left a comment

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you, Lef, the rule is exactly the decision: start asks for the PIN, stop stays quiet, and your test fails if either changes. The pkgdesc and url are right now too.

On the follow-up plan: the hotspot can't go in while its clients can reach the home network, so the isolation has to come first or together, not after. Could you put the client isolation into this PR, or open it as its own PR that we merge with this one? And please keep VPN sharing with the kill switch as a separate PR after both: it's new routing and firewall code that runs as root, and it deserves its own review and a run with a real tunnel.

When you do the phone run, a cancelled PIN currently reads as "the hotspot did not start"; a message that says the PIN wasn't entered, as the firewall page does, would help. I'll set the versions at merge.

@derekross

Copy link
Copy Markdown
Owner

Decision on the order: client isolation has to land in this PR, or in one merged together with it. The rule from before stands: no hotspot ships while its clients can reach the owner's home network, even for one release. VPN sharing and its kill switch are welcome as their own PR afterwards.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants