Enable WCNSS LE before Bluetooth discovery

Live btmgmt/btmon showed hci0 powered with le absent from current settings; BlueZ issued only BR/EDR Inquiry, so BLE peripherals were invisible. Add a narrow doas helper to run btmgmt -i hci0 le on before each interactive scan, make bluez-btmgmt explicit, add the doas rule, host guards and docs. With real peripherals in pairing mode the plugin UI reported 5 devices and retained BT KeyBoard / LE-QC Ultra entries.
This commit is contained in:
Luxferre committed 2026-11-10 16:15:50 +02:00
1 parent 77127c7844
commit e4358665f7
11 files changed
+58 -9

No files matched your search

+5 -4
View File
@@ -15,15 +15,16 @@ Work since `a1108` has focused on reliable 2720 Flip hardware support and a repr
### Live Bluetooth peripheral discovery
- **Synthetic-only regression**: the previous Bluetooth fix could find an injected `BT_PROBE` line but not real peripherals. Live diagnostics showed non-interactive `bluetoothctl --timeout 15 scan on` emitted only discovery-filter/controller messages, a separate `bluetoothctl devices` query after the scan client exited was empty, and `scan off` from another client failed with `org.bluez.Error.InProgress` while the original client still owned discovery. The synthetic test had bypassed this whole BlueZ client-lifetime path.
- **Discovery path**: `overlay/rootfs/usr/local/bin/bluetoothctl` now intercepts only `scan on`/`scan bredr`/`scan le` and forwards every other command to `/usr/bin/bluetoothctl`. `bananarchy-bt-scan.sh` drives one interactive `bluetoothctl` session through `script(1)`, powers the controller on, sets `transport auto` and `duplicate-data on`, queries `devices` repeatedly while the same discovery client is active, then sends `scan off` and `quit`. The existing `networks.so` parser accepts both `[NEW] Device ...` stream lines and `Device <MAC> <Name>` list lines, so no plugin rebuild is needed. `util-linux-misc` is now explicit in the rootfs package set to provide `script(1)`.
- **Guards and live status**: `scripts/test-bluetooth-live-scan.py` exercises the wrapper with a stub real `bluetoothctl` under a real PTY and verifies device-list output, clean shutdown, and non-scan forwarding; `check-rebuild.sh` guards the package, overlay installation, helper syntax and host test. The wrapper was deployed to the live phone. Final confirmation with a physical peripheral in pairing mode is still required; no push was performed.
- **Synthetic-only regression**: the previous Bluetooth fix could find an injected `BT_PROBE` line but not real peripherals. Live diagnostics showed non-interactive `bluetoothctl --timeout 15 scan on` emitted only discovery-filter/controller messages, a separate `bluetoothctl devices` query after the scan client exited was empty, and `scan off` from another client failed with `org.bluez.Error.InProgress` while the original client still owned discovery.
- **Actual hardware root cause**: `btmgmt -i hci0 info` showed `le` supported but absent from `current settings`; `btmon` showed only BR/EDR `Inquiry` commands and no `LE Set Scan Enable`. Running `btmgmt -i hci0 le on` produced `LE Set Scan Parameters`, `LE Set Scan Enable`, LE advertising reports, and real `Device Found` events. The WCNSS controller was simply being powered up with LE disabled, so BLE peripherals were invisible.
- **Discovery path**: `overlay/rootfs/usr/local/bin/bluetoothctl` now intercepts only `scan on`/`scan bredr`/`scan le` and forwards every other command to `/usr/bin/bluetoothctl`. `bananarchy-bt-scan.sh` powers the controller on, calls the narrow `doas` helper `bananarchy-bt-le-enable.sh` (`btmgmt -i hci0 le on`), then drives one interactive `bluetoothctl` session through `script(1)` with `transport auto` and `duplicate-data on`; it queries `devices` repeatedly while the same discovery client is active, then sends `scan off` and `quit`. The existing `networks.so` parser accepts both `[NEW] Device ...` stream lines and `Device <MAC> <Name>` list lines, so no plugin rebuild is needed. `util-linux-misc` and `bluez-btmgmt` are explicit in the rootfs package set.
- **Guards and live verification**: `scripts/test-bluetooth-live-scan.py` exercises the wrapper with a stub real `bluetoothctl` under a real PTY and verifies device-list output, clean shutdown, and non-scan forwarding; `check-rebuild.sh` guards the packages, doas rule, overlay installation, helper syntax and host test. With a real peripheral in pairing mode, the live PTY scan found `BT KeyBoard`, `M7` and two `LE-QC Ultra` advertisements; the wrapper then found four unique real devices with no `Failed`/`InProgress` errors.
### Live nokia-beatles plugin verification and WebKit GSettings schema fix
- **Stale live runtime**: the phone was still running the pre-fix `webarchy.so` (`3e3c3ac7...`) and `networks.so` (`97eaae44...`) from the baseline image, while `prebuilt/`, `overlay/rootfs/` and the local `rootfs/` already carried the rebuilt artifacts (`8eb1b493...` and `e12103ee...`). That is why the earlier repository fixes were not visible on the device. The current binaries were deployed, their hashes verified, and both resident plugins restarted.
- **Actual WebKit root cause**: with the current `webarchy.so`, `G_MESSAGES_DEBUG=all` exposed `GLib-GIO-ERROR **: No GSettings schemas are installed on the system` in `WebKitNetworkProcess`, immediately followed by `ERROR: WebKit encountered an internal error ... WebLoaderStrategy.cpp(679)`. The rootfs had the `gsettings-desktop-schemas` XML files but no `gschemas.compiled`, because packages are installed with `--no-scripts` and the apk trigger never ran. The earlier renderer-profile fix was necessary but not sufficient. The package set now explicitly contains `glib` and `gsettings-desktop-schemas`; both image containers install host `glib` tools; and `apply-bananarchy-overlay.sh` calls `compile-gsettings-schemas.sh` to produce `usr/share/glib-2.0/schemas/gschemas.compiled`. `scripts/test-webkit-gsettings.py` guards the wiring and compiles a synthetic schema. Live verification: after compiling the schemas, the WebKit internal error disappeared and an HTTP probe rendered 51,420 green pixels in the 240x217 browser viewport.
- **Live Bluetooth verification**: starting from `Powered: no`, the deployed `networks.so` powered the WCNSS controller on, ran `bluetoothctl --timeout 15 scan on`, and merged an injected `[NEW] Device AA:BB:CC:DD:EE:FF BT_PROBE` discovery line even though the persistent `bluetoothctl devices` list was deliberately empty. The plugin reported `Found 1 device(s)` and retained `BT_PROBE` in its device list. The controller ended `Powered: yes`.
- **Live Bluetooth verification**: starting from `Powered: no`, the deployed `networks.so` powered the WCNSS controller on, ran `bluetoothctl --timeout 15 scan on`, and merged an injected `[NEW] Device AA:BB:CC:DD:EE:FF BT_PROBE` discovery line even though the persistent `bluetoothctl devices` list was deliberately empty. The plugin reported `Found 1 device(s)` and retained `BT_PROBE` in its device list. The controller ended `Powered: yes`. This was later shown to be parser-only and superseded by the live LE-discovery fix above.
- **Final live state**: the phone has the current plugin binaries, the compiled `gschemas.compiled` database, normal plugin environments with no Bluetooth stub in `PATH`, and no debug-only WebKit environment. Webarchy and Networks were returned to their normal preloaded state; the Bluetooth controller was powered back off.
### Live 2720 Flip verification and cover DT gating