Finalize verified 2720 Flip release source and untrack image outputs
This commit is contained in:
1 parent
2a3078e42c
commit
1c011b360a
121 files changed
+8467
-686
No files matched your search
@@ -17,8 +17,8 @@ This manual covers flashing, operating, and customizing **Bananarchy Linux** (`2
|
||||
- Additional device images (`bananarchy-nokia-beatles.img`, `bananarchy-nokia-tough.img`, `bananarchy-nokia-sparkler.img`) can be generated at any time via `./rebuild-image.sh <device> --mkinitfs`.
|
||||
|
||||
### 1.2 Bootloader and EDL programmer (`bootloader/`)
|
||||
- `bootloader/lk2nd-msm8909.img`: secondary bootloader (`lk2nd`) providing Fastboot and `extlinux` boot discovery for MSM8905 and MSM8909 devices.
|
||||
- `bootloader/loaders/8110.mbn`: signed Qualcomm Sahara/Firehose programmer (`05c6:9008`).
|
||||
- `bootloader/lk2nd-msm8909.img`: secondary bootloader (`lk2nd`) providing Fastboot and `extlinux` boot discovery for MSM8905 and MSM8909 devices. `images/boot-lk2nd-nokia-beatles-display.img` is the source-built 2720 Flip port (see `bootloader/lk2nd/README.md`).
|
||||
- `bootloader/loaders/`: signed Qualcomm Sahara/Firehose programmers (`05c6:9008`), one per target. The flasher picks the right one from `--device` / the positional target; run `./flash-edl.sh --list-loaders` to see each file's embedded attestation identity and mapping. Pass `--variant us` for a 2720 Flip US variant or `--loader PATH` to override the programmer entirely.
|
||||
|
||||
### 1.3 Core architecture highlights
|
||||
1. **Pure X11 (`Xlibre` + `sxmo-de-dwm`) for `240x320` QVGA displays**:
|
||||
@@ -46,18 +46,24 @@ Run the automated EDL flasher from the repository root on your host machine:
|
||||
```bash
|
||||
sudo ./flash-edl.sh
|
||||
```
|
||||
*(To flash another target device image, pass its codename, e.g. `sudo ./flash-edl.sh nokia-sparkler`.)*
|
||||
*(To flash another target device image, pass its codename, e.g. `sudo ./flash-edl.sh nokia-sparkler`.)* The programmer is selected automatically: `8110.mbn` (8110 4G), `2720.mbn` (2720 Flip), `800t.mbn` (800 Tough), and `8k.mbn` for **both** 8000 4G and 6300 4G. The 2720 Flip US variant (`Nokia_bts_us`) uses `2720v.mbn`: pass `--variant us` (or `--loader ./bootloader/loaders/2720v.mbn`). Verify with `./flash-edl.sh --list-loaders`.
|
||||
|
||||
The script performs the following steps automatically:
|
||||
1. Temporarily pauses host `ModemManager` so it does not interfere with `05c6:9008`.
|
||||
2. Waits for the phone to appear in Qualcomm EDL mode (`05c6:9008`):
|
||||
- **From Bananarchy Linux**: open the **Power** menu (`End / Power` key or `System menu -> Power`), select **Reboot to loader** (`sxmo_power.sh loader`) to enter the `lk2nd` Fastboot menu, and select **EDL** (or let `flash-edl.sh` automatically send `fastboot oem reboot-edl`).
|
||||
2. Waits for the phone in Qualcomm EDL/Sahara mode. The flasher auto-detects
|
||||
`05c6:9008` (QDLoader), `05c6:900e` (QHSUSB_BULK, common after a failed
|
||||
boot) and `05c6:9006` (DLOAD); pass `--pid` to force one:
|
||||
- **From Bananarchy Linux**: open the **Power** menu (`End / Power` key or `System menu -> Power`), select **Reboot to loader** (`sxmo_power.sh loader`) to enter the visible `lk2nd` Fastboot menu, then select **EDL** (or let `flash-edl.sh` automatically send `fastboot oem reboot-edl`). The low-bit reboot cookie now survives the stock boot chain and keeps the menu available.
|
||||
- **Button combo**: power off the phone, hold **D-Pad up + D-Pad down**, and plug in the USB cable.
|
||||
- **EDL cable**: hold the EDL cable button while plugging in USB.
|
||||
- **From ADB or Fastboot**: the script automatically sends `adb reboot edl` or `fastboot oem reboot-edl` if detected.
|
||||
3. Uploads `bootloader/loaders/8110.mbn` via Sahara and connects to eMMC via Firehose.
|
||||
- If the phone is stuck in Sahara with no fresh HELLO packet (e.g. a host
|
||||
tool already consumed it), power-cycle it: hold **End/Power** for 15-20 s
|
||||
(or disconnect/reconnect the battery), then retry. The flasher cannot
|
||||
resume a half-open Sahara handshake.
|
||||
3. Uploads the device-specific Firehose programmer from `bootloader/loaders/` via Sahara and connects to eMMC via Firehose.
|
||||
4. Backs up `gpt.bin`, `fsc`, `fsg`, `modemst1`, `modemst2`, `persist`, and `boot` into `./backup/` if not already backed up.
|
||||
5. Flashes `lk2nd-msm8909.img` to `boot`, flashes `images/bananarchy-<device>.img` to `userdata`, clears the stock `system` superblock, and reboots into Bananarchy Linux.
|
||||
5. Flashes `images/bananarchy-<device>.img` to `userdata`, clears the stock `system` superblock (first 64 sectors / 32 KiB), and reboots. This wipe is the default for every method; pass `--no-wipe-system` only if you deliberately want a dual-boot phone with KaiOS intact. **The default `--method lk2nd` writes the source-built `images/boot-lk2nd-nokia-beatles-display.img` into `boot`, and the standalone `images/boot-bananarchy-nokia-beatles.img` into `recovery` on the 2720 Flip (Argon-shaped hybrid).** That lk2nd image is built from upstream lk2nd plus `bootloader/lk2nd/nokia-beatles.patch`: it carries cmdline `lk2nd lk2nd.compatible=nokia,beatles`, keeps the upstream QCDT layout (both `0x14b` entries sharing one DTB), injects a compact `/lk2nd/nokia-beatles` node with the downstream GC9305 v2 panel init stream, and adds `/cpus` with `cpu@0`..`cpu@3` to every QCDT DTB. The 2720's MSM8905 is a partial-goods 2-core part; aboot `ASSERT FAILED at (platform/msm_shared/partial_goods.c:80)` and rebooted into Sahara memory-debug EDL because upstream lk2nd DTBs had no `/cpus` — that was the black-screen/no-fastboot crash. aboot hands off to lk2nd, which keeps aboot's 240x320 RGB565 panel init (or replays the downstream stream when cont-splash is off), then scans `userdata` for `extlinux.conf` and boots `vmlinuz` + `initramfs` with the explicit `fdt /qcom-msm8905-nokia-beatles.dtb`. Rebuild it with `scripts/build-lk2nd-beatles.sh`; see `bootloader/lk2nd/README.md`. The port paints the Bananarchy RGB565 boot splash instead of the near-black upstream splash; the branded screen confirms lk2nd owns the framebuffer. Live `oem display-init` proved the GC9305 v2 stream and frame flush, chain-loaded diagnostics now fall back to the QCDT panel stream, and `oem scan-dtb` captures the final post-update kernel DTB. The release image is display-enabled (`lk2nd.display=on`) so the branded splash and Fastboot menu are visible; the normal no-display image remains available for diagnostics. All QUP/clock polls are bounded, so a dead SPI bus reports a failure instead of hanging. If the phone never shows anything, run `lsusb`: `05c6:900e` means aboot crashed into EDL (Sahara MEMORY_DEBUG), not that lk2nd failed to display; the `/cpus` fix above addresses the confirmed ASSERT. Flash `images/boot-lk2nd-nokia-beatles-diagnostic.img` with `--lk2nd-image --verify --dump-diagnostics` (forced fastboot + runtime `oem display-init` probe), then `fastboot oem log && fastboot get_staged lk2nd.log`; if it returns to `900e`, re-read aboot's RLOG crash buffer (the untouched `bootloader/lk2nd-msm8909.img` lacks `/cpus` as well and crashes identically). See `bootloader/lk2nd/README.md`. If the KaiOS splash persists on a normal power-on, **hold Volume Up** to boot the mainline boot.img in `recovery`. `--method both` is the fallback that writes the standalone `images/boot-bananarchy-nokia-beatles.img` (appended beatles DTB, exact qcom IDs and 512 MiB `/memory` fallback) into both slots; `--method recovery` writes it only to `recovery`. Use `--boot-image PATH` to override the standalone image. Add `--verify` to read back every flashed `boot`/`recovery` partition and confirm the write really committed; a mismatch aborts before `userdata` is touched. Add `--dump-diagnostics` to save small `devinfo`/`aboot`/`tz`/`config` partitions into `backup/diag-*.img` for offline secure-boot analysis. The captured `diag-devinfo.img` proved this 2720 is locked (`is_unlocked=0`, `is_tampered=0`) while `diag-aboot.img` contains `Nokia_beatles ROOT CA0` and `Device is unlocked! Skipping verification...`; aboot therefore rejects every unsigned boot.img. The flasher defaults to unlocking `devinfo` on `nokia-beatles` before writing lk2nd, saves the original as `backup/devinfo-locked-<device>.img`, and accepts `--unlock-bootloader` / `--no-unlock-bootloader`. `scripts/make-unlocked-devinfo.py` can produce the patched image offline. Correction: `target_get_vb_version()` returns `VB_L` on this GPT (no `keymaster`), so aboot reads eMMC `devinfo`, not RPMB. The captured `diag-devinfo.img` after flashing shows `is_unlocked=1`; the eMMC unlock works and **no `fastboot oem unlock-go` step is needed**. `--only-unlock`, `enable_oem_unlock()` and `scripts/make-oem-unlock-config.py` are optional EDL-only prerequisites kept for completeness. EDL is the only required interface. After any DTB change run `python3 scripts/repack-beatles-bootimg.py` and `python3 scripts/sync-beatles-bootfs.py --debug-cmdline`; after any lk2nd change run `./scripts/build-lk2nd-beatles.sh`; never write an Android boot.img directly at raw offset 1 MiB. To diagnose a persistent `05c6:900e` without stock fastboot, power-cycle into EDL and run `python3 scripts/dump-edl-crash.py --out backup/crash-run`; it reads the Sahara memory-debug table and dumps aboot/TZ crash regions. The partition being overwritten is always backed up as `<partition>-<device>.img` (e.g. `boot-nokia-beatles.img`), so stale backups from anotheLine truncated
|
||||
|
||||
---
|
||||
|
||||
@@ -130,7 +136,7 @@ All twenty-five phone applications are compiled as shared-object plugins (`/usr/
|
||||
|
||||
1. **System and context menus (`dmenu.so` / `dmenu` / `xdmenu`)**:
|
||||
- **Open / close**: press **Left softkey (`Menu`)** for the **System menu** or **Right softkey (`Back`)** inside an application for its **Context menu**; press the same softkey or `Escape` to close.
|
||||
- **Built-in submenus and instant toggles**: renders `sys`, `applications`, `scripts`, `modem`, `config`, `sdcard`, `power` (including **Lock**, **Lock (Screen off)**, **Logout**, **Reboot**, **Reboot to loader**, **Reboot to EDL**, and **Poweroff**), `audio` (with linear volume steps and **Output: Speaker**, **Output: Earpiece**, and **Output: Headphones** routing), `notifications`, `wm`, `timezone`, `games`, `st`, and `nano` menus in place in `< 0.5 ms` without spawning external processes.
|
||||
- **Built-in submenus and instant toggles**: renders `sys`, `applications`, `scripts`, `modem`, `config`, `sdcard`, `power` (including **Lock**, **Lock (Screen off)**, **Logout**, **Reboot**, **Reboot to loader**, and **Poweroff**; use the lk2nd Fastboot menu for **EDL**), `audio` (with linear volume steps and **Output: Speaker**, **Output: Earpiece**, and **Output: Headphones** routing), `notifications`, `wm`, `timezone`, `games`, `st`, and `nano` menus in place in `< 0.5 ms` without spawning external processes.
|
||||
- **Script compatibility**: any script piping items into `/usr/bin/dmenu` or `sxmo_dmenu.sh` communicates with the resident daemon over `/tmp/dwm_plugin_dmenu.sock`.
|
||||
|
||||
2. **Global phone controls (`xdrawer.so` / `xdrawer`)**:
|
||||
@@ -443,6 +449,25 @@ Three native X11 games (`/usr/bin/snake`, `/usr/bin/tetris`, and `/usr/bin/scoun
|
||||
|
||||
---
|
||||
|
||||
### 4.1 First-boot troubleshooting on the 2720 Flip
|
||||
|
||||
- **X startup and keypad**: OpenRC starts independent services in parallel; `etc/init.d/local` replaces its stock `after *` dependency, which deadlocked with parallel startup on this image. `udev_settle_timeout=2` stops missing modem firmware from holding the display manager behind a long `udevadm settle`, and `bananarchy-sshd-debug` starts independently of `local.d`. A boot-open flip reads `/run/bananarchy/lid-state` and starts in `state=unlock` with no passcode screen, so the keypad is live as soon as `dwm` starts. If the keypad is dead, check `rc-service bananarchy-lid status`, `cat /run/bananarchy/lid-state`, `sxmo_state.sh get`, `/tmp/bananarchy_screen_locked`, `DISPLAY=:0 xwininfo -id 0xa00001` and `DISPLAY=:0 xinput list`.
|
||||
- **Closing the flip**: `bananarchy-lid` reads the current `EV_SW` switch mask from `/dev/input/event2`, follows hall edge events with an 80 ms stability window and only polls raw gpio36/gpio92 debugfs levels when no switch evdev is available. On close it blanks the main panel and keypad LED immediately, runs `sxmo_state.sh set screenoff` and tells the cover daemon `LID CLOSED`; on open it clears the lock flag, restores both backlights, sends a trusted `CLOSE` to `locker.so` and runs `sxmo_state.sh set unlock`. Check `rc-service bananarchy-lid status`, `sxmo_state.sh get` and `grep -E " gpio(36|92) " /sys/kernel/debug/gpio`. If the hall polarity is inverted on your unit, set `BANANARCHY_LID_GPIO_FILE` to a different debugfs GPIO file for the fallback path.
|
||||
- **Cover display status**: `bananarchy-cover-idle` is the compiled 0%-CPU default daemon and answers `bananarchy-coverctl`; the native `bananarchy-coverd` is retained only for diagnostics. The shipping DTS keeps the known-good single internal panel; `cover-panel.dtsi` is compile-tested but not applied. The expected live state is no `/dev/fb1` and `bananarchy-coverctl STATUS` reporting `backend=none`. The renderer uses the 32-bpp fbdev `write()` path for future hardware (not `mmap()`, which raises `SIGBUS` on the DRM fbdev). gpio13 selection and external reset polarity still require physical sign-off before the overlay is re-enabled.
|
||||
- **Camera app frozen / UI unresponsive**: check `top` for `bananarchy-volume-keys`. The daemon must be a single instance at 0% CPU; stale evdev fds are pruned by `prune_devices()`/`drop_device()` and guarded by `flock`. `rc-service bananarchy-volume-keys status` and `bananarchy-keypad-diagnose.sh` report its state. `xcamera` should return immediately and `bananarchy-photo <file>` should write a 600x800 JPEG.
|
||||
- **Camera**: `/dev/video0` is provided by the out-of-tree `msm8905-cam` module, loaded at boot by `/etc/modules-load.d/bananarchy-hardware.conf` and `etc/local.d/10-bananarchy-hardware.start`. Check with `v4l2-ctl --list-devices`; a missing node means the module did not load (previously caused by a missing `/bin/sed` breaking the `modules` service).
|
||||
- **Side volume keys**: the compiled evdev daemon `bananarchy-volume-keys` reads `KEY_VOLUMEUP`/`KEY_VOLUMEDOWN` directly and calls `sxmo_audio.sh vol up/down 5`; `sxmo_audio.sh` mirrors that percentage into the live PipeWire sink (the MSM8905 mainline kernel has no ALSA card yet). Press a side button and check `wpctl get-volume <sink-id>`; `bananarchy-keypad-diagnose.sh` reports the XKB mapping and both volume values.
|
||||
- **First-boot checklist**: the rootfs must contain the full BusyBox applet set (`scripts/busybox-applets.txt`). `/bin/ash` is the `user` login shell and `/bin/grep` is used by OpenRC; if either is missing, sshd rejects `user/147147` and `udev` cannot start. Check `rc-service udev status` and `DISPLAY=:0 xinput list`: the keypad only appears in X when udev is running, `/dev/input/event*` are `0660 root:input` and elogind lists the keyboards under `seat0`. Run `rc-service tinydm restart` after fixing udev.
|
||||
- **SSH rejects `147147`**: the PAM-enabled `/usr/sbin/sshd.pam` is pinned through `/etc/conf.d/sshd`, `/etc/pam.d/sshd` supplies an explicit `pam_unix` stack, and both `PasswordAuthentication` and `KbdInteractiveAuthentication` are enabled in `/etc/ssh/sshd_config.d/90-bananarchy-access.conf`. If PAM is ever broken again, a USB-only diagnostic listener is available on port 2222 (bound to `172.16.42.1`, never to Wi-Fi):
|
||||
```bash
|
||||
ssh -p 2222 user@172.16.42.1
|
||||
```
|
||||
The phone key in `keys/phone_id_ed25519` is pre-authorized for both `user` and `root`; add `touch /etc/bananarchy-no-debug-sshd` to turn the fallback listener off.
|
||||
- **No boot splash**: the `extlinux.conf` `append` line must contain `quiet splash`. The pmOS initramfs defaults to `nosplash=y` and only starts `plymouthd` for the literal `splash` parameter; `scripts/sync-beatles-bootfs.py` restores the release cmdline and `--check` rejects a debug cmdline. Use `--debug-cmdline --allow-debug` only for a diagnostic build.
|
||||
- **Keypad does not respond**: run `bananarchy-keypad-diagnose.sh` over SSH. It reports `/proc/bus/input/devices`, udev `ID_INPUT_*` tags (forced by `99-bananarchy-keypad.rules`), `SW_LID` / `SW_KEYPAD_SLIDE` state, kernel messages, Xorg/libinput devices and a short raw `evtest` probe. The Xorg rule `60-bananarchy-keypad.conf` binds the matrix keypad by product name so a missing `ID_INPUT_KEYBOARD` tag cannot make X ignore it. If the kernel emits no `EV_KEY` events at all, check the row/column GPIOs and `SW_LID` polarity on hardware.
|
||||
|
||||
---
|
||||
|
||||
## 5. Command-line hardware reference
|
||||
|
||||
### 5.1 Taking photos and screenshots (`bananarchy-photo`, `bananarchy-screenshot`, and `/dev/video0`)
|
||||
@@ -626,3 +651,7 @@ sudo ./flash-edl.sh nokia-argon # uses vendor/edl/ and auto-instal
|
||||
```
|
||||
|
||||
The bootstrap is idempotent: an up-to-date rootfs is left untouched. `prebuilt/` is the single source of truth for compiled artifacts, and `scripts/rootfs-packages.txt` is the single source of truth for the package set. The patched EDL client library is vendored under `vendor/edl/` (MIT), so flashing works from a clean clone without a manual download; `flash-edl.sh` installs `pyusb` and `pyserial` into the gitignored `.flash-deps/` directory when needed.
|
||||
|
||||
## Verified 2720 Flip image set
|
||||
|
||||
For the `a1108` / `dejavu` release, use the verified known-good `nokia-beatles` raw image, standalone boot image, and display-enabled lk2nd image generated in `images/`. These files are local build outputs and are not tracked in git; `scripts/check-rebuild.sh` pins their hashes when present. The X session performs a one-shot startup cleanup of stale `dmenu` and xlocker keyboard grabs, while `dwm` keeps the known-good 350 ms wake guard. `prepare-release.sh` rebuilds missing images from source and packages them; use `BA_REBUILD=1` for a forced source rebuild.
|
||||
Reference in new issue
Block a user