From 84bcc4209a4a72e7dd46825b9cf9bfe1e7bbd173 Mon Sep 17 00:00:00 2001 From: cx3301J Date: Thu, 5 Nov 2026 11:52:30 -0500 Subject: [PATCH 1/8] device-lynx 0.2.3: persist the DSIM transmit enable Install gs-dsim-cmd allow_tx=1 so brightness and DSI writes survive a reinstall; the panel needs it once the display stack owns the connector. --- packages/omamobile-device-lynx/install | 2 ++ .../vendor/etc/modprobe.d/gs-dsim-cmd.conf | 2 ++ 2 files changed, 4 insertions(+) create mode 100644 packages/omamobile-device-lynx/vendor/etc/modprobe.d/gs-dsim-cmd.conf diff --git a/packages/omamobile-device-lynx/install b/packages/omamobile-device-lynx/install index 1f63549dc..87a9b67cd 100755 --- a/packages/omamobile-device-lynx/install +++ b/packages/omamobile-device-lynx/install @@ -26,6 +26,8 @@ install -Dm644 vendor/systemd/sleep.conf.d/10-omamobile.conf \ "$destination/usr/lib/systemd/sleep.conf.d/10-omamobile.conf" install -Dm644 vendor/NetworkManager/conf.d/10-omamobile-usb.conf \ "$destination/usr/lib/NetworkManager/conf.d/10-omamobile-usb.conf" +install -Dm644 vendor/etc/modprobe.d/gs-dsim-cmd.conf \ + "$destination/usr/lib/modprobe.d/gs-dsim-cmd.conf" install -Dm644 device.conf \ "$destination/usr/share/omamobile/device.conf" install -Dm644 etc/omamobile-mirrorlist \ diff --git a/packages/omamobile-device-lynx/vendor/etc/modprobe.d/gs-dsim-cmd.conf b/packages/omamobile-device-lynx/vendor/etc/modprobe.d/gs-dsim-cmd.conf new file mode 100644 index 000000000..82b0f1b4c --- /dev/null +++ b/packages/omamobile-device-lynx/vendor/etc/modprobe.d/gs-dsim-cmd.conf @@ -0,0 +1,2 @@ +options gs-dsim-cmd allow_tx=1 + From 74cd2e7e0eac434f78012621d3a447547ea8b571 Mon Sep 17 00:00:00 2001 From: cx3301J Date: Fri, 6 Nov 2026 06:46:52 -0500 Subject: [PATCH 2/8] device-lynx 0.2.3: enable DSI commands only for the S6E3FC5 panel Move the stale /etc/modprobe.d option into vendor/modprobe.d with the package SPDX header, and stop enabling gs-dsim-cmd globally. A boot-time unit reads exynos_drm.panel_name= from /proc/cmdline and allows the panel's DSI commands only for sdc-s6e3fc5, so an S6E3FC3 unit stays read-only. Tested on the unit: the service logs "panel sdc-s6e3fc5, DSI commands allowed", allow_tx reads Y, and brightness writes. Signed-off-by: cx3301J Assisted-by: DeepSeek --- .../bin/omamobile-lynx-display-start | 34 +++++++++++++++++++ packages/omamobile-device-lynx/install | 10 ++++-- packages/omamobile-device-lynx/test/all | 8 +++++ .../vendor/etc/modprobe.d/gs-dsim-cmd.conf | 2 -- .../vendor/modprobe.d/omamobile-display.conf | 4 +++ .../system/omamobile-lynx-display.service | 11 ++++++ 6 files changed, 65 insertions(+), 4 deletions(-) create mode 100755 packages/omamobile-device-lynx/bin/omamobile-lynx-display-start delete mode 100644 packages/omamobile-device-lynx/vendor/etc/modprobe.d/gs-dsim-cmd.conf create mode 100644 packages/omamobile-device-lynx/vendor/modprobe.d/omamobile-display.conf create mode 100755 packages/omamobile-device-lynx/vendor/systemd/system/omamobile-lynx-display.service diff --git a/packages/omamobile-device-lynx/bin/omamobile-lynx-display-start b/packages/omamobile-device-lynx/bin/omamobile-lynx-display-start new file mode 100755 index 000000000..7e05b663b --- /dev/null +++ b/packages/omamobile-device-lynx/bin/omamobile-lynx-display-start @@ -0,0 +1,34 @@ +#!/bin/bash +# SPDX-License-Identifier: MIT +# Allow the panel's DSI commands only when the bootloader names the +# S6E3FC5 panel on the kernel command line. Lynx also ships S6E3FC3 +# panels, and S6E3FC5 brightness/refresh commands must never reach one. +# OMAMOBILE_LYNX_ROOT: a scratch root for the package tests. +set -uo pipefail + +root=${OMAMOBILE_LYNX_ROOT:-} +[[ -z $root || ( $root == /* && $root != / && -d $root ) ]] || exit 2 + +cmdline=$root/proc/cmdline +allow=$root/sys/module/gs_dsim_cmd/parameters/allow_tx +panel="" + +for word in $(cat "$cmdline" 2>/dev/null); do + case $word in + exynos_drm.panel_name=*) panel=${word#*=} ;; + esac +done + +case $panel in + sdc-s6e3fc5|sdc-s6e3fc5.*|s6e3fc5|s6e3fc5.*) + if echo 1 > "$allow" 2>/dev/null; then + echo "omamobile-lynx-display: panel $panel, DSI commands allowed" + else + echo "omamobile-lynx-display: panel $panel, cannot write $allow; leaving it read-only" + exit 1 + fi + ;; + *) + echo "omamobile-lynx-display: panel ${panel:-unnamed}, DSI commands stay off" + ;; +esac diff --git a/packages/omamobile-device-lynx/install b/packages/omamobile-device-lynx/install index 87a9b67cd..65c2b5a1e 100755 --- a/packages/omamobile-device-lynx/install +++ b/packages/omamobile-device-lynx/install @@ -26,8 +26,14 @@ install -Dm644 vendor/systemd/sleep.conf.d/10-omamobile.conf \ "$destination/usr/lib/systemd/sleep.conf.d/10-omamobile.conf" install -Dm644 vendor/NetworkManager/conf.d/10-omamobile-usb.conf \ "$destination/usr/lib/NetworkManager/conf.d/10-omamobile-usb.conf" -install -Dm644 vendor/etc/modprobe.d/gs-dsim-cmd.conf \ - "$destination/usr/lib/modprobe.d/gs-dsim-cmd.conf" +install -Dm644 vendor/modprobe.d/omamobile-display.conf \ + "$destination/usr/lib/modprobe.d/omamobile-display.conf" +install -Dm755 bin/omamobile-lynx-display-start \ + "$destination/usr/bin/omamobile-lynx-display-start" +install -Dm644 vendor/systemd/system/omamobile-lynx-display.service \ + "$destination/usr/lib/systemd/system/omamobile-lynx-display.service" +ln -sfn ../omamobile-lynx-display.service \ + "$destination/usr/lib/systemd/system/multi-user.target.wants/omamobile-lynx-display.service" install -Dm644 device.conf \ "$destination/usr/share/omamobile/device.conf" install -Dm644 etc/omamobile-mirrorlist \ diff --git a/packages/omamobile-device-lynx/test/all b/packages/omamobile-device-lynx/test/all index 667efa8e4..084692e05 100755 --- a/packages/omamobile-device-lynx/test/all +++ b/packages/omamobile-device-lynx/test/all @@ -164,6 +164,14 @@ for absent in usr/bin/omamobile-wifi-start usr/bin/omamobile-charge-guard \ usr/bin/omamobile-camera-start; do [[ ! -e $tmp/root/$absent ]] || fail "install includes $absent" done +[[ -f $tmp/root/usr/lib/modprobe.d/omamobile-display.conf ]] \ + || fail "install stages the display modprobe file" +[[ -x $tmp/root/usr/bin/omamobile-lynx-display-start ]] \ + || fail "install stages the display start script" +[[ -f $tmp/root/usr/lib/systemd/system/omamobile-lynx-display.service ]] \ + || fail "install stages the display service" +[[ $(readlink "$tmp/root/usr/lib/systemd/system/multi-user.target.wants/omamobile-lynx-display.service") == ../omamobile-lynx-display.service ]] \ + || fail "the display service is enabled" pass "install stages the udev rule, the USB link, the mirrorlist, and the boot-success marker, and nothing that starts hardware" # USB is the last gateway: its route outlives an unplug, so ahead of Wi-Fi diff --git a/packages/omamobile-device-lynx/vendor/etc/modprobe.d/gs-dsim-cmd.conf b/packages/omamobile-device-lynx/vendor/etc/modprobe.d/gs-dsim-cmd.conf deleted file mode 100644 index 82b0f1b4c..000000000 --- a/packages/omamobile-device-lynx/vendor/etc/modprobe.d/gs-dsim-cmd.conf +++ /dev/null @@ -1,2 +0,0 @@ -options gs-dsim-cmd allow_tx=1 - diff --git a/packages/omamobile-device-lynx/vendor/modprobe.d/omamobile-display.conf b/packages/omamobile-device-lynx/vendor/modprobe.d/omamobile-display.conf new file mode 100644 index 000000000..7d80da44b --- /dev/null +++ b/packages/omamobile-device-lynx/vendor/modprobe.d/omamobile-display.conf @@ -0,0 +1,4 @@ +# SPDX-License-Identifier: MIT +# gs-dsim-cmd starts read-only. omamobile-lynx-display-start enables DSI +# commands only when the bootloader names the S6E3FC5 panel on the command +# line, so an S6E3FC3 unit never receives S6E3FC5 commands. diff --git a/packages/omamobile-device-lynx/vendor/systemd/system/omamobile-lynx-display.service b/packages/omamobile-device-lynx/vendor/systemd/system/omamobile-lynx-display.service new file mode 100755 index 000000000..8076f05fe --- /dev/null +++ b/packages/omamobile-device-lynx/vendor/systemd/system/omamobile-lynx-display.service @@ -0,0 +1,11 @@ +[Unit] +Description=Enable lynx S6E3FC5 DSI commands +Documentation=file:///usr/share/omamobile/device-lynx/NOTES.md +Before=display-manager.service + +[Service] +Type=oneshot +ExecStart=/usr/bin/omamobile-lynx-display-start + +[Install] +WantedBy=multi-user.target From dedb2709c7ae6c7e7be4d9c615c890e5c54b3cf8 Mon Sep 17 00:00:00 2001 From: cx3301J Date: Mon, 9 Nov 2026 03:00:53 -0500 Subject: [PATCH 3/8] device-lynx: order the display gate after modules-load Load gs_dsim_cmd from the script before touching allow_tx, and order the unit after systemd-modules-load with RemainAfterExit and a DECON ConditionPathExists, as the Pixel 8 Pro package does. Give the unit its SPDX header and mode 644, and cover the gate with a fake-root test for the S6E3FC5 name, an S6E3FC3 name and no panel name. Signed-off-by: cx3301J Assisted-by: DeepSeek --- .../bin/omamobile-lynx-display-start | 3 +++ packages/omamobile-device-lynx/test/all | 22 +++++++++++++++++++ .../system/omamobile-lynx-display.service | 4 ++++ 3 files changed, 29 insertions(+) mode change 100755 => 100644 packages/omamobile-device-lynx/vendor/systemd/system/omamobile-lynx-display.service diff --git a/packages/omamobile-device-lynx/bin/omamobile-lynx-display-start b/packages/omamobile-device-lynx/bin/omamobile-lynx-display-start index 7e05b663b..4286cb9ce 100755 --- a/packages/omamobile-device-lynx/bin/omamobile-lynx-display-start +++ b/packages/omamobile-device-lynx/bin/omamobile-lynx-display-start @@ -19,6 +19,9 @@ for word in $(cat "$cmdline" 2>/dev/null); do esac done +# The parameter appears when the driver loads; do not depend on autoload. +modprobe gs_dsim_cmd 2>/dev/null || true + case $panel in sdc-s6e3fc5|sdc-s6e3fc5.*|s6e3fc5|s6e3fc5.*) if echo 1 > "$allow" 2>/dev/null; then diff --git a/packages/omamobile-device-lynx/test/all b/packages/omamobile-device-lynx/test/all index 084692e05..6dc5e349b 100755 --- a/packages/omamobile-device-lynx/test/all +++ b/packages/omamobile-device-lynx/test/all @@ -172,6 +172,28 @@ done || fail "install stages the display service" [[ $(readlink "$tmp/root/usr/lib/systemd/system/multi-user.target.wants/omamobile-lynx-display.service") == ../omamobile-lynx-display.service ]] \ || fail "the display service is enabled" +# The panel gate: allow only the S6E3FC5 names, and create the parameter +# through modprobe before the write. +gate=$tmp/panel-gate +mkdir -p "$gate/proc" "$gate/bin" +cat > "$gate/bin/modprobe" <<'FAKE' +#!/bin/bash +p=$OMAMOBILE_LYNX_ROOT/sys/module/gs_dsim_cmd/parameters +mkdir -p "$p" +[[ -e $p/allow_tx ]] || echo 0 > "$p/allow_tx" +FAKE +chmod +x "$gate/bin/modprobe" +for pair in "sdc-s6e3fc5.20800a:1" "sdc-s6e3fc3-l10:0" ":0"; do + panel=${pair%:*}; want=${pair##*:} + echo "console=null ${panel:+exynos_drm.panel_name=$panel} bootconfig" > "$gate/proc/cmdline" + rm -rf "$gate/sys" + PATH="$gate/bin:$PATH" OMAMOBILE_LYNX_ROOT=$gate \ + bin/omamobile-lynx-display-start >/dev/null + got=$(cat "$gate/sys/module/gs_dsim_cmd/parameters/allow_tx" 2>/dev/null || echo missing) + [[ $got == "$want" ]] || fail "panel '${panel:-none}' wrote allow_tx=$got, want $want" +done +pass "the panel gate allows only S6E3FC5" + pass "install stages the udev rule, the USB link, the mirrorlist, and the boot-success marker, and nothing that starts hardware" # USB is the last gateway: its route outlives an unplug, so ahead of Wi-Fi diff --git a/packages/omamobile-device-lynx/vendor/systemd/system/omamobile-lynx-display.service b/packages/omamobile-device-lynx/vendor/systemd/system/omamobile-lynx-display.service old mode 100755 new mode 100644 index 8076f05fe..45748e4b0 --- a/packages/omamobile-device-lynx/vendor/systemd/system/omamobile-lynx-display.service +++ b/packages/omamobile-device-lynx/vendor/systemd/system/omamobile-lynx-display.service @@ -1,10 +1,14 @@ +# SPDX-License-Identifier: MIT [Unit] Description=Enable lynx S6E3FC5 DSI commands Documentation=file:///usr/share/omamobile/device-lynx/NOTES.md +After=local-fs.target systemd-modules-load.service Before=display-manager.service +ConditionPathExists=/sys/bus/platform/devices/1c240000.display-controlle [Service] Type=oneshot +RemainAfterExit=yes ExecStart=/usr/bin/omamobile-lynx-display-start [Install] From 98c1bebf129c9cf4e643cd0be207f6941b26d0fa Mon Sep 17 00:00:00 2001 From: cx3301J Date: Tue, 10 Nov 2026 08:43:06 -0500 Subject: [PATCH 4/8] device-lynx: name the full DECON node in the display unit The ConditionPathExists value lost its last character, so systemd would skip the gate on every boot. Restore the full 1c240000.display-controller path and check it from the package test. Signed-off-by: cx3301J Assisted-by: DeepSeek --- packages/omamobile-device-lynx/test/all | 3 +++ .../vendor/systemd/system/omamobile-lynx-display.service | 2 +- 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/packages/omamobile-device-lynx/test/all b/packages/omamobile-device-lynx/test/all index 6dc5e349b..95c9b48fb 100755 --- a/packages/omamobile-device-lynx/test/all +++ b/packages/omamobile-device-lynx/test/all @@ -170,6 +170,9 @@ done || fail "install stages the display start script" [[ -f $tmp/root/usr/lib/systemd/system/omamobile-lynx-display.service ]] \ || fail "install stages the display service" +grep -qx 'ConditionPathExists=/sys/bus/platform/devices/1c240000.display-controller' \ + "$tmp/root/usr/lib/systemd/system/omamobile-lynx-display.service" \ + || fail "the display unit names the DECON node" [[ $(readlink "$tmp/root/usr/lib/systemd/system/multi-user.target.wants/omamobile-lynx-display.service") == ../omamobile-lynx-display.service ]] \ || fail "the display service is enabled" # The panel gate: allow only the S6E3FC5 names, and create the parameter diff --git a/packages/omamobile-device-lynx/vendor/systemd/system/omamobile-lynx-display.service b/packages/omamobile-device-lynx/vendor/systemd/system/omamobile-lynx-display.service index 45748e4b0..235ade757 100644 --- a/packages/omamobile-device-lynx/vendor/systemd/system/omamobile-lynx-display.service +++ b/packages/omamobile-device-lynx/vendor/systemd/system/omamobile-lynx-display.service @@ -4,7 +4,7 @@ Description=Enable lynx S6E3FC5 DSI commands Documentation=file:///usr/share/omamobile/device-lynx/NOTES.md After=local-fs.target systemd-modules-load.service Before=display-manager.service -ConditionPathExists=/sys/bus/platform/devices/1c240000.display-controlle +ConditionPathExists=/sys/bus/platform/devices/1c240000.display-controller [Service] Type=oneshot From 9feab50d1e83ee6ce9840c709b2fc201cf8fbf14 Mon Sep 17 00:00:00 2001 From: cx3301J Date: Sat, 14 Nov 2026 08:12:33 -0500 Subject: [PATCH 5/8] device-lynx: load the display controller after the gate Blacklist gs_decon so it cannot probe before allow_tx is set, restore the saved brightness after enabling the panel's commands, then load gs_decon from the start. Drop the unit's Documentation line, add the three display files to the README, and test the brightness write as well as the gate. Signed-off-by: cx3301J Assisted-by: DeepSeek --- packages/omamobile-device-lynx/README.md | 3 ++ .../bin/omamobile-lynx-display-start | 29 ++++++++++++++++--- packages/omamobile-device-lynx/test/all | 12 ++++++-- .../vendor/modprobe.d/omamobile-display.conf | 3 ++ .../system/omamobile-lynx-display.service | 1 - 5 files changed, 41 insertions(+), 7 deletions(-) diff --git a/packages/omamobile-device-lynx/README.md b/packages/omamobile-device-lynx/README.md index 61370d388..44e8ef0ca 100644 --- a/packages/omamobile-device-lynx/README.md +++ b/packages/omamobile-device-lynx/README.md @@ -14,6 +14,9 @@ Omarchy Mobile's first userspace package for the Google Pixel 7a (codename lynx, | `bin/omamobile-boot-success` + `vendor/systemd/system/omamobile-boot-success.service` | `/usr/bin`, `/usr/lib/systemd/system` (enabled by a vendor wants link) | Marks the booted A/B slot successful after each boot, as Android's boot-control service does. Without it, the bootloader burns one of slot B's three retries per boot and then falls back to slot A. Same files as the Pixel 7 Pro package | | `src/omamobile-bootctl.c` | `/usr/bin/omamobile-bootctl` | Reads and updates the slot flags in `devinfo` (`sdd1`, layout 3.15 on lynx as on the Pixel 7 Pro). Only ever changes bytes 0x30-0x37, verified. Same source as the Pixel 7 Pro package | | `src/reboot-to.c` | `/usr/bin/reboot-to` | Reboot with a reason the bootloader understands. Same bytes as the Pixel 7 Pro package; the test checks | +| `bin/omamobile-lynx-display-start` | `/usr/bin` | Allows the S6E3FC5 panel's DSI commands only when the bootloader names it, restores the saved brightness and then loads `gs_decon` | +| `vendor/systemd/system/omamobile-lynx-display.service` | `/usr/lib/systemd/system` | Runs the display start once per boot, before `display-manager.service` | +| `vendor/modprobe.d/omamobile-display.conf` | `/usr/lib/modprobe.d` | Keeps `gs_decon` out of autoload so it probes after the gate | | `device.conf` | `/usr/share/omamobile/device.conf` | The descriptor, the same bytes as `device/lynx/device.conf` | `./build [DIR]` compiles `omamobile-bootctl` and `reboot-to` from this directory, `./install DESTDIR [DIR]` stages the files, and `test/all` checks the two copies when it is run from the repository. diff --git a/packages/omamobile-device-lynx/bin/omamobile-lynx-display-start b/packages/omamobile-device-lynx/bin/omamobile-lynx-display-start index 4286cb9ce..e2f2ea5a7 100755 --- a/packages/omamobile-device-lynx/bin/omamobile-lynx-display-start +++ b/packages/omamobile-device-lynx/bin/omamobile-lynx-display-start @@ -3,6 +3,7 @@ # Allow the panel's DSI commands only when the bootloader names the # S6E3FC5 panel on the kernel command line. Lynx also ships S6E3FC3 # panels, and S6E3FC5 brightness/refresh commands must never reach one. +# gs_decon is blacklisted for autoload so it probes after this gate. # OMAMOBILE_LYNX_ROOT: a scratch root for the package tests. set -uo pipefail @@ -19,19 +20,39 @@ for word in $(cat "$cmdline" 2>/dev/null); do esac done +log() { echo "omamobile-lynx-display: $*"; } + +# systemd-backlight restores the saved level before this start allows the +# panel's commands; send it again now that the panel takes them. +restore_brightness() { + local bl level + for bl in "$root"/sys/class/backlight/*; do + [[ -e $bl/brightness ]] || continue + level=$(cat "$bl/brightness" 2>/dev/null) || continue + echo "$level" > "$bl/brightness" 2>/dev/null \ + && log "brightness of ${bl##*/}: level $level sent" + done +} + # The parameter appears when the driver loads; do not depend on autoload. modprobe gs_dsim_cmd 2>/dev/null || true case $panel in sdc-s6e3fc5|sdc-s6e3fc5.*|s6e3fc5|s6e3fc5.*) if echo 1 > "$allow" 2>/dev/null; then - echo "omamobile-lynx-display: panel $panel, DSI commands allowed" + log "panel $panel, DSI commands allowed" + restore_brightness else - echo "omamobile-lynx-display: panel $panel, cannot write $allow; leaving it read-only" - exit 1 + log "panel $panel, cannot write $allow; leaving it read-only" fi ;; *) - echo "omamobile-lynx-display: panel ${panel:-unnamed}, DSI commands stay off" + log "panel ${panel:-unnamed}, DSI commands stay off" ;; esac + +# Blacklisted above: the display controller probes only now, after allow_tx. +if ! modprobe gs_decon 2>/dev/null; then + log "gs_decon did not load; the display stays on simple-framebuffer" + exit 1 +fi diff --git a/packages/omamobile-device-lynx/test/all b/packages/omamobile-device-lynx/test/all index 95c9b48fb..cf57aa793 100755 --- a/packages/omamobile-device-lynx/test/all +++ b/packages/omamobile-device-lynx/test/all @@ -190,10 +190,18 @@ for pair in "sdc-s6e3fc5.20800a:1" "sdc-s6e3fc3-l10:0" ":0"; do panel=${pair%:*}; want=${pair##*:} echo "console=null ${panel:+exynos_drm.panel_name=$panel} bootconfig" > "$gate/proc/cmdline" rm -rf "$gate/sys" - PATH="$gate/bin:$PATH" OMAMOBILE_LYNX_ROOT=$gate \ - bin/omamobile-lynx-display-start >/dev/null + mkdir -p "$gate/sys/class/backlight/panel" + echo 900 > "$gate/sys/class/backlight/panel/brightness" + out=$(PATH="$gate/bin:$PATH" OMAMOBILE_LYNX_ROOT=$gate \ + bin/omamobile-lynx-display-start 2>&1) got=$(cat "$gate/sys/module/gs_dsim_cmd/parameters/allow_tx" 2>/dev/null || echo missing) [[ $got == "$want" ]] || fail "panel '${panel:-none}' wrote allow_tx=$got, want $want" + if [[ $want == 1 ]]; then + [[ $out == *"brightness of panel: level 900 sent"* ]] \ + || fail "the saved brightness is not sent for '${panel:-none}': $out" + else + [[ $out != *brightness* ]] || fail "brightness sent with DSI commands off for '${panel:-none}': $out" + fi done pass "the panel gate allows only S6E3FC5" diff --git a/packages/omamobile-device-lynx/vendor/modprobe.d/omamobile-display.conf b/packages/omamobile-device-lynx/vendor/modprobe.d/omamobile-display.conf index 7d80da44b..cef3f3391 100644 --- a/packages/omamobile-device-lynx/vendor/modprobe.d/omamobile-display.conf +++ b/packages/omamobile-device-lynx/vendor/modprobe.d/omamobile-display.conf @@ -2,3 +2,6 @@ # gs-dsim-cmd starts read-only. omamobile-lynx-display-start enables DSI # commands only when the bootloader names the S6E3FC5 panel on the command # line, so an S6E3FC3 unit never receives S6E3FC5 commands. +# gs-decon decides the link rate at probe, so keep it out of autoload: +# the start loads it after allow_tx is set. +blacklist gs_decon diff --git a/packages/omamobile-device-lynx/vendor/systemd/system/omamobile-lynx-display.service b/packages/omamobile-device-lynx/vendor/systemd/system/omamobile-lynx-display.service index 235ade757..58ad6e66f 100644 --- a/packages/omamobile-device-lynx/vendor/systemd/system/omamobile-lynx-display.service +++ b/packages/omamobile-device-lynx/vendor/systemd/system/omamobile-lynx-display.service @@ -1,7 +1,6 @@ # SPDX-License-Identifier: MIT [Unit] Description=Enable lynx S6E3FC5 DSI commands -Documentation=file:///usr/share/omamobile/device-lynx/NOTES.md After=local-fs.target systemd-modules-load.service Before=display-manager.service ConditionPathExists=/sys/bus/platform/devices/1c240000.display-controller From cba0e70274650ad366f49fc1cb0389f0f771a658 Mon Sep 17 00:00:00 2001 From: cx3301J Date: Sun, 15 Nov 2026 08:01:25 -0500 Subject: [PATCH 6/8] device-lynx: make the display start hang-safe Write and sync a marker before loading gs_decon, stop the next boot when the marker is still there, exit early when gs_decon is already loaded, check that the DECON device binds, and add TimeoutStartSec=60. The test now records what modprobe loads, checks that gs_decon comes after the allow_tx write, and covers the marker and --retry. Signed-off-by: cx3301J Assisted-by: DeepSeek --- .../bin/omamobile-lynx-display-start | 61 ++++++++++++++++--- packages/omamobile-device-lynx/test/all | 41 +++++++++++-- .../system/omamobile-lynx-display.service | 1 + 3 files changed, 89 insertions(+), 14 deletions(-) diff --git a/packages/omamobile-device-lynx/bin/omamobile-lynx-display-start b/packages/omamobile-device-lynx/bin/omamobile-lynx-display-start index e2f2ea5a7..a0a391634 100755 --- a/packages/omamobile-device-lynx/bin/omamobile-lynx-display-start +++ b/packages/omamobile-device-lynx/bin/omamobile-lynx-display-start @@ -1,27 +1,41 @@ #!/bin/bash # SPDX-License-Identifier: MIT # Allow the panel's DSI commands only when the bootloader names the -# S6E3FC5 panel on the kernel command line. Lynx also ships S6E3FC3 -# panels, and S6E3FC5 brightness/refresh commands must never reach one. -# gs_decon is blacklisted for autoload so it probes after this gate. +# S6E3FC5 panel on the kernel command line, then load gs_decon (blacklisted +# for autoload) so it probes after the gate. Hang-safe: a marker written and +# synced before modprobe stops the next boot from trying a load that never +# returned; --retry clears it. Lynx also ships S6E3FC3 panels. +# omamobile-lynx-display-start [--retry] # OMAMOBILE_LYNX_ROOT: a scratch root for the package tests. set -uo pipefail root=${OMAMOBILE_LYNX_ROOT:-} [[ -z $root || ( $root == /* && $root != / && -d $root ) ]] || exit 2 +state=$root/var/lib/omamobile +marker=$state/lynx-display-started cmdline=$root/proc/cmdline +decon=$root/sys/bus/platform/devices/1c240000.display-controller allow=$root/sys/module/gs_dsim_cmd/parameters/allow_tx panel="" +log() { echo "omamobile-lynx-display: $*"; } +loaded() { [[ -d $root/sys/module/$1 ]]; } +bound() { + local i + for ((i = 0; i < $3; i++)); do + [[ $(readlink -f "$1/driver" 2>/dev/null) == */$2 ]] && return 0 + sleep 0.25 + done + return 1 +} + for word in $(cat "$cmdline" 2>/dev/null); do case $word in exynos_drm.panel_name=*) panel=${word#*=} ;; esac done -log() { echo "omamobile-lynx-display: $*"; } - # systemd-backlight restores the saved level before this start allows the # panel's commands; send it again now that the panel takes them. restore_brightness() { @@ -34,6 +48,26 @@ restore_brightness() { done } +case ${1:-} in + '') ;; + --retry) rm -f "$marker" ;; + *) log "usage: omamobile-lynx-display-start [--retry]"; exit 2 ;; +esac + +if [[ -e $marker ]]; then + log "the last start ($(cat "$marker" 2>/dev/null)) never finished; the display stays on simple-framebuffer this boot." + log "after checking the previous boot's log, retry with: omamobile-lynx-display-start --retry" + exit 0 +fi +if [[ ${1:-} != --retry ]] && loaded gs_decon; then + log "already started this boot" + exit 0 +fi + +mkdir -p "$state" +printf '%s display\n' "$(date -Is)" > "$marker" +sync -f "$marker" 2>/dev/null || sync + # The parameter appears when the driver loads; do not depend on autoload. modprobe gs_dsim_cmd 2>/dev/null || true @@ -51,8 +85,17 @@ case $panel in ;; esac -# Blacklisted above: the display controller probes only now, after allow_tx. -if ! modprobe gs_decon 2>/dev/null; then - log "gs_decon did not load; the display stays on simple-framebuffer" - exit 1 +status=0 +if ! modprobe gs_decon; then + log "gs_decon failed (see dmesg); the display stays on simple-framebuffer" + status=1 +elif ! bound "$decon" gs-decon 60; then + log "the display controller did not bind to gs-decon (see dmesg)" + status=1 +else + log "up: display" fi + +rm -f "$marker" +sync -f "$state" 2>/dev/null || sync +exit $status diff --git a/packages/omamobile-device-lynx/test/all b/packages/omamobile-device-lynx/test/all index cf57aa793..30263fcac 100755 --- a/packages/omamobile-device-lynx/test/all +++ b/packages/omamobile-device-lynx/test/all @@ -175,27 +175,36 @@ grep -qx 'ConditionPathExists=/sys/bus/platform/devices/1c240000.display-control || fail "the display unit names the DECON node" [[ $(readlink "$tmp/root/usr/lib/systemd/system/multi-user.target.wants/omamobile-lynx-display.service") == ../omamobile-lynx-display.service ]] \ || fail "the display service is enabled" -# The panel gate: allow only the S6E3FC5 names, and create the parameter -# through modprobe before the write. +# The panel gate: allow only the S6E3FC5 names, create the parameter +# through modprobe first, and load gs_decon after the write. gate=$tmp/panel-gate mkdir -p "$gate/proc" "$gate/bin" cat > "$gate/bin/modprobe" <<'FAKE' #!/bin/bash +echo "$1 allow=$(cat "$OMAMOBILE_LYNX_ROOT/sys/module/gs_dsim_cmd/parameters/allow_tx" 2>/dev/null || echo none)" >> "$TEST_LOG" p=$OMAMOBILE_LYNX_ROOT/sys/module/gs_dsim_cmd/parameters mkdir -p "$p" [[ -e $p/allow_tx ]] || echo 0 > "$p/allow_tx" +if [[ $1 == gs_decon ]]; then + d=$OMAMOBILE_LYNX_ROOT/sys/bus/platform/devices/1c240000.display-controller + mkdir -p "$d" "$OMAMOBILE_LYNX_ROOT/sys/bus/platform/drivers/gs-decon" + ln -sfn "$OMAMOBILE_LYNX_ROOT/sys/bus/platform/drivers/gs-decon" "$d/driver" +fi FAKE chmod +x "$gate/bin/modprobe" for pair in "sdc-s6e3fc5.20800a:1" "sdc-s6e3fc3-l10:0" ":0"; do panel=${pair%:*}; want=${pair##*:} echo "console=null ${panel:+exynos_drm.panel_name=$panel} bootconfig" > "$gate/proc/cmdline" - rm -rf "$gate/sys" + rm -rf "$gate/sys" "$gate/var" mkdir -p "$gate/sys/class/backlight/panel" echo 900 > "$gate/sys/class/backlight/panel/brightness" - out=$(PATH="$gate/bin:$PATH" OMAMOBILE_LYNX_ROOT=$gate \ + : > "$gate/calls" + out=$(TEST_LOG=$gate/calls PATH="$gate/bin:$PATH" OMAMOBILE_LYNX_ROOT=$gate \ bin/omamobile-lynx-display-start 2>&1) got=$(cat "$gate/sys/module/gs_dsim_cmd/parameters/allow_tx" 2>/dev/null || echo missing) [[ $got == "$want" ]] || fail "panel '${panel:-none}' wrote allow_tx=$got, want $want" + grep -qx "gs_decon allow=$want" "$gate/calls" \ + || fail "gs_decon was not loaded after allow_tx=$want for '${panel:-none}': $(cat "$gate/calls")" if [[ $want == 1 ]]; then [[ $out == *"brightness of panel: level 900 sent"* ]] \ || fail "the saved brightness is not sent for '${panel:-none}': $out" @@ -203,9 +212,31 @@ for pair in "sdc-s6e3fc5.20800a:1" "sdc-s6e3fc3-l10:0" ":0"; do [[ $out != *brightness* ]] || fail "brightness sent with DSI commands off for '${panel:-none}': $out" fi done +grep -qx 'blacklist gs_decon' vendor/modprobe.d/omamobile-display.conf \ + || fail "gs_decon is not blacklisted for autoload" +# Already loaded this boot: no second load. +mkdir -p "$gate/sys/module/gs_decon" +out=$(TEST_LOG=$gate/calls PATH="$gate/bin:$PATH" OMAMOBILE_LYNX_ROOT=$gate \ + bin/omamobile-lynx-display-start 2>&1) +[[ $out == *"already started this boot"* ]] || fail "a loaded gs_decon is loaded again: $out" +rm -rf "$gate/sys/module/gs_decon" + +# A marker from a load that never returned: nothing is loaded until --retry. +mkdir -p "$gate/var/lib/omamobile" +echo "2026-11-15T00:00:00+00:00 display" > "$gate/var/lib/omamobile/lynx-display-started" +: > "$gate/calls" +out=$(TEST_LOG=$gate/calls PATH="$gate/bin:$PATH" OMAMOBILE_LYNX_ROOT=$gate \ + bin/omamobile-lynx-display-start 2>&1) +[[ $out == *"never finished"* && ! -s "$gate/calls" ]] \ + || fail "a stale marker did not stop the load: $out / $(cat "$gate/calls")" +out=$(TEST_LOG=$gate/calls PATH="$gate/bin:$PATH" OMAMOBILE_LYNX_ROOT=$gate \ + bin/omamobile-lynx-display-start --retry 2>&1) +[[ $out == *"up: display"* && ! -e "$gate/var/lib/omamobile/lynx-display-started" ]] \ + || fail "--retry did not clear the marker and load: $out" + pass "the panel gate allows only S6E3FC5" -pass "install stages the udev rule, the USB link, the mirrorlist, and the boot-success marker, and nothing that starts hardware" +pass "install stages the udev rule, the USB link, the mirrorlist, the boot-success marker and the display gate, and no radio" # USB is the last gateway: its route outlives an unplug, so ahead of Wi-Fi # it sent IPv4 into a dead cable (seen on raven, 2026-10-28). diff --git a/packages/omamobile-device-lynx/vendor/systemd/system/omamobile-lynx-display.service b/packages/omamobile-device-lynx/vendor/systemd/system/omamobile-lynx-display.service index 58ad6e66f..a5f04b6ea 100644 --- a/packages/omamobile-device-lynx/vendor/systemd/system/omamobile-lynx-display.service +++ b/packages/omamobile-device-lynx/vendor/systemd/system/omamobile-lynx-display.service @@ -7,6 +7,7 @@ ConditionPathExists=/sys/bus/platform/devices/1c240000.display-controller [Service] Type=oneshot +TimeoutStartSec=60 RemainAfterExit=yes ExecStart=/usr/bin/omamobile-lynx-display-start From 03cba69ce53028c8f5eadb3d0eb5ab304b6fb032 Mon Sep 17 00:00:00 2001 From: cx3301J Date: Mon, 16 Nov 2026 10:53:27 -0500 Subject: [PATCH 7/8] device-lynx: name the display start in the unit The unit starts the display, it does not only enable DSI commands. Signed-off-by: cx3301J Assisted-by: DeepSeek --- .../vendor/systemd/system/omamobile-lynx-display.service | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/omamobile-device-lynx/vendor/systemd/system/omamobile-lynx-display.service b/packages/omamobile-device-lynx/vendor/systemd/system/omamobile-lynx-display.service index a5f04b6ea..06f56ba7e 100644 --- a/packages/omamobile-device-lynx/vendor/systemd/system/omamobile-lynx-display.service +++ b/packages/omamobile-device-lynx/vendor/systemd/system/omamobile-lynx-display.service @@ -1,6 +1,6 @@ # SPDX-License-Identifier: MIT [Unit] -Description=Enable lynx S6E3FC5 DSI commands +Description=Lynx S6E3FC5 display start After=local-fs.target systemd-modules-load.service Before=display-manager.service ConditionPathExists=/sys/bus/platform/devices/1c240000.display-controller From 3316dd90722c99edc153d41cd638c55a0a6d723f Mon Sep 17 00:00:00 2001 From: Derek Ross Date: Tue, 17 Nov 2026 21:09:11 -0500 Subject: [PATCH 8/8] omamobile-device-lynx 0.2.5: the version for the display start Set by the maintainer at merge: the branch carried main's 0.2.4. Co-Authored-By: Claude Fable 5.2 --- packages/omamobile-device-lynx/version | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/omamobile-device-lynx/version b/packages/omamobile-device-lynx/version index abd410582..3a4036fb4 100644 --- a/packages/omamobile-device-lynx/version +++ b/packages/omamobile-device-lynx/version @@ -1 +1 @@ -0.2.4 +0.2.5