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

+1 -1
View File
@@ -30,7 +30,7 @@ It uses a pure **X11 (`Xlibre` + `sxmo-de-dwm`)** stack (no Wayland) with **Adre
- `nokia-beatles` boot chain: `images/boot-lk2nd-nokia-beatles.img` is built from upstream `msm8916-mainline/lk2nd` at pinned commit `cf45aefd22d744b2bf9b39455afae697ce430063` plus `bootloader/lk2nd/nokia-beatles.patch` (see `bootloader/lk2nd/README.md`; rebuild with `scripts/build-lk2nd-beatles.sh`). It keeps the upstream QCDT layout (both `0x14b` entries `0xb/0x100` and `0x1000b/0x100` sharing one `msm8905-qrd-skub` DTB, stock `qcom,board-id` order) with a compact `/lk2nd/nokia-beatles` node injected, and **adds `/cpus` with `cpu@0`..`cpu@3` and 4-byte `device_type` to the common `lk2nd.dtsi` so every QCDT DTB has it**. The 2720's MSM8905 is a partial-goods 2-core part and its aboot `ASSERT`s at `platform/msm_shared/partial_goods.c:80` when `/cpus`, `cpu@2` or `cpu@3` is missing — that was the actual "black screen / no fastboot" crash (Sahara MEMORY_DEBUG RLOG log, see `bootloader/lk2nd/README.md` and `backup/nokia-beatles-2720/crash-20261109/aboot-log.txt`). cmdline `lk2nd lk2nd.compatible=nokia,beatles`, `lk2nd,match-panel` for all three GC9305 panel names the aboot reports, and the single `qcom,mdss_spi_gc9305_v2_qvga_cmd` (the panel the live aboot reports) `lk2nd,panel-init` stream replayed on BLSP1 QUP5 (DC GPIO 110) only when aboot did not leave continuous splash enabled (or when `lk2nd.force-panel-init` is in the cmdline), so the 240x320 RGB565 main panel is initialized even without cont-splash. `spi-display.c` also paints the branded RGB565 boot splash into the framebuffer (without flushing during init): `DISABLE_SPLASH_PARTITION=1` plus `menu.c`'s bottom-only text means upstream lk2nd otherwise pushes a nearly black frame, which is what the "KaiOS logo then blank screen" is. `lk2nd/include/lk2nd/spi-panel-init.h` is shared with the host unit test; the repo copy is `bootloader/lk2nd/spi-panel-init.h` and `check-lk2nd-beatles.py` keeps them in sync and enforces that QCDT shape. Both the normal and diagnostic images carry `lk2nd.no-display` (RAM-only framebuffer, no QUP SPI before USB) because unbounded QUP/clock register polls used to wedge lk2nd with the boot vibrator stuck on. The port now bounds those polls (`QUP_FIFO_TIMEOUT`, `CLK_POLL_TIMEOUT`) and adds `oem display-init` / `oem display-test` / `oem scan-dtb` fastboot probes that run after USB is up, plus `oem screenshot` to verify the framebuffer. Live `oem display-init` confirmed the GC9305 v2 stream and the 240x320 RGB565 frame; a chain-loaded diagnostic falls back to the QCDT panel stream when aboot tags are absent, `oem scan-dtb` stages the final DTB after lk2nd DT updates, `oem ramoops console` validates and bounds pstore data, and the QUP per-word `SPEW` log is removed. The r3 port also makes `oem read-partition` block-safe: it rounds MMC reads up to the eMMC block size, rejects unaligned offsets and stages only the requested byte count. `images/boot-lk2nd-nokia-beatles-display.img` uses `lk2nd.display=on` for boot-time panel init via the downstream GC9305 v2 `lk2nd,panel-init` stream; flash it with `--lk2nd-image`. The diagnostic image additionally has `DEBUG=2 LK2ND_FORCE_FASTBOOT=1`. `check-lk2nd-beatles.py --expect-display` guards the display variant; `scripts/test-lk2nd-beatles-port.py` runs all three. lk2nd is confirmed working over live fastboot (`lk2nd:compatible=nokia,beatles`, `model=Nokia 2720 Flip`, panel `qcom,mdss_spi_gc9305_v2_qvga_cmd`, `unlocked=yes`). `flash-edl.py` defaults to `--method lk2nd` for every target; stock aboot accepts the port and lk2nd boots Bananarchy from `userdata` via `extlinux.conf` (`fdt /qcom-msm8905-nokia-beatles.dtb`). On `nokia-beatles` the default is now the Argon shape: lk2nd in `boot`, the standalone mainline `boot.img` in `recovery` (Volume Up fallback). `--method both` remains as a fallback that writes the standalone mainline `boot.img` to both slots. `--verify` reads back every slot and `--dump-diagnostics` saves small bootloader/config partitions for secure-boot analysis. `scripts/check-lk2nd-beatles.py` validates the boot header, both 2720 QCDT entries, `/cpus` in every QCDT DTB, the device node and the GC9305 v2 panel init stream; `scripts/test-lk2nd-beatles-port.py` adds the host C parser test. The stock 2720 aboot is locked (`devinfo.is_unlocked=0`) and verifies boot images against `Nokia_beatles ROOT CA0`; `flash-edl.py` therefore defaults to setting `devinfo.is_unlocked=1` on `nokia-beatles` via `unlock_devinfo()` before writing any boot image, saves `backup/devinfo-locked-<device>.img`, and supports `--no-unlock-bootloader` to skip. `scripts/make-unlocked-devinfo.py` produces the same patched image offline. Correction: the GPT has `keystore` but no `keymaster`, so `target_get_vb_version()` returns `VB_L=1` while `VB_M=2`; aboot therefore reads `devinfo` from eMMC, not RPMB. The 21:25 dump confirms eMMC `is_unlocked=1`, so the unlock is effective and no stock fastboot / `oem unlock-go` step is required. `--only-unlock`, `enable_oem_unlock()` and `scripts/make-oem-unlock-config.Line truncated
- `bootloader/loaders/`: device-specific signed Firehose programmers; `DEVICE_LOADERS` in `flash-edl.py` maps each target codename to one (`8k.mbn` serves both `nokia-sparkler` and `nokia-leo`), and `DEVICE_LOADER_VARIANTS` maps `--variant us` on `nokia-beatles` to `2720v.mbn` (`Nokia_bts_us`). Never flash a different device's programmer: Sahara rejects the signature and `--list-loaders` shows the embedded attestation identity.
- `vendor/edl/`: vendored, patched EDL client library (MIT) used by `flash-edl.py`; a local `edl/` checkout or `BANANARCHY_EDL_DIR` overrides it.
- `scripts/rootfs-packages.txt`: single source of truth for the `armv7` rootfs package set, read by both `bootstrap-rootfs.sh` and `rebuild-image.sh`. It intentionally contains no `device-*` package; `scripts/apply-bananarchy-overlay.sh` installs the per-device `devices/<device>/modules-initfs` list as `/usr/share/mkinitfs/modules/00-device-<device>.modules` (plus its `initramfs.load` mapping) so a clean-clone bootstrap still builds the correct initramfs. `scripts/check-rebuild.sh` guards this. The package set also includes `msm-firmware-loader`, its OpenRC companion and `msm-firmware-loader-wcnss`; explicit sysinit/boot links are required because packages are installed with `--no-scripts`. This mounts the stock `modem` and `persist` partitions before udev and supplies WCNSS/modem firmware plus factory Wi-Fi NV data, allowing both `wlan0` and `hci0` to enumerate. The package set explicitly contains `glib` and `gsettings-desktop-schemas`; because apk is invoked with `--no-scripts`, `apply-bananarchy-overlay.sh` must run `compile-gsettings-schemas.sh` to generate `gschemas.compiled`, otherwise WebKitGTK's network process aborts with an internal error. The package set also includes `util-linux-misc` for `script(1)`, which the live Bluetooth scan wrapper uses to keep a single interactive BlueZ client alive.
- `scripts/rootfs-packages.txt`: single source of truth for the `armv7` rootfs package set, read by both `bootstrap-rootfs.sh` and `rebuild-image.sh`. It intentionally contains no `device-*` package; `scripts/apply-bananarchy-overlay.sh` installs the per-device `devices/<device>/modules-initfs` list as `/usr/share/mkinitfs/modules/00-device-<device>.modules` (plus its `initramfs.load` mapping) so a clean-clone bootstrap still builds the correct initramfs. `scripts/check-rebuild.sh` guards this. The package set also includes `msm-firmware-loader`, its OpenRC companion and `msm-firmware-loader-wcnss`; explicit sysinit/boot links are required because packages are installed with `--no-scripts`. This mounts the stock `modem` and `persist` partitions before udev and supplies WCNSS/modem firmware plus factory Wi-Fi NV data, allowing both `wlan0` and `hci0` to enumerate. The package set explicitly contains `glib` and `gsettings-desktop-schemas`; because apk is invoked with `--no-scripts`, `apply-bananarchy-overlay.sh` must run `compile-gsettings-schemas.sh` to generate `gschemas.compiled`, otherwise WebKitGTK's network process aborts with an internal error. The package set also includes `util-linux-misc` for `script(1)` and `bluez-btmgmt` for `btmgmt`, which the live Bluetooth scan wrapper uses to keep a single interactive BlueZ client alive and enable LE discovery on the WCNSS controller.
- `scripts/rootfs-prune-packages.txt`: denylist of Wayland-only, Rust-based, and retired packages purged from existing rootfs trees by `bootstrap-rootfs-container.sh` and `rebuild-image.sh`.
- `scripts/prune-rootfs-packages.sh`: two-phase rootfs pruner (`world` before `apk add`, `purge` after) that reads the denylist and pins `install_if` packages with negative `!pkg` world constraints plus `apk fix`; the `world` phase is required so apk can atomically replace Rust `sudo-rs` with C `sudo`.