Skip to content

About

No description, website, or topics provided.

Resources

Stars

0 stars

Watchers

0 watching

Forks

Repository files navigation

webos-android-minimal

Minimal Android USB sidecar bootstrap for rooted LG webOS TVs.

This repository is the cleaned-up continuation of the earlier webos-dirty-binder experiments. The old repository was intentionally noisy: it kept staged Binder FD probes, smoke tests, debug tags, multiple intermediate scripts, and a long trail of kernel-patch milestones. This repository keeps only the pieces needed to reproduce the currently validated result:

binder
hwbinder
vndbinder

vndservicemanager: alive
servicemanager: alive
hwservicemanager: alive
zygote64: alive
system_server: alive
installd: alive
surfaceflinger: alive
android.hardware.graphics.composer@2.1-service: alive
Android Binder services: 160
Launcher3: top resumed

FINAL_USB_3DOMAIN_BINDER_OK
FINAL_USB_INSTALL_OK
FRAMEWORK_SERVICES_MINIMAL_DEPLOY_OK

Android 13 now reaches the framework and Launcher3 on the physical TV display. The validated path includes live composition and direct Magic Remote input:

The experimental GPU path is also validated on the Mali-G51: Android Mesa 26.0.1 uses virpipe, an ARM32 virglrenderer server executes GLES 3.2 through webOS's proprietary Mali EGL stack, and the native presenter submits a shared GL texture to the webOS Wayland compositor without a CPU copy on the final presentation step. Build it with scripts/build-gpu-stack.sh, deploy it with scripts/deploy-gpu-stack.sh, or run the complete two-stage boot with scripts/restart-gpu.sh. Rendering is GPU accelerated, but Android Gallium commands still pass through virpipe/vtest; it is not a native arm64 Android Mali userspace stack.

The memfd import protocol shares Android gralloc allocations across app and SurfaceFlinger clients. Newly imported CPU-populated buffers receive one initial memory-to-GPU upload, which is required for Launcher3 icon bitmaps; cross-client reuse does not repeat that upload and therefore preserves newer GPU-rendered pixels. High-frequency import/transfer tracing is disabled by default because even tmpfs logging measurably hurts this TV.

  • compile a compatible Binder kernel module for the LG webOS 4.4 kernel;
  • load Binder without replacing the TV kernel, rootfs, TV service partitions, or boot chain;
  • create the three Android Binder domains: /dev/binder, /dev/hwbinder, /dev/vndbinder;
  • assemble an Android rootfs from Waydroid arm64 system/vendor images on USB storage;
  • expose the system_ext and product dynamic partitions embedded in system.img;
  • provide a 1920x1080 fallback mode until webOS reports surface geometry to the Waydroid composer;
  • fix Android dynamic linker/APEX visibility inside the chroot;
  • generate linkerconfig and property-area state far enough for the service managers;
  • start the real Android servicemanager, hwservicemanager, and vndservicemanager;
  • start logd, installd, idmap2d, SystemSuspend, the Waydroid health/vibrator/graphics HALs, and SurfaceFlinger;
  • patch the known webOS/Android runtime blockers and launch zygote64 with system_server;
  • start the Android framework, package manager, activity manager, and Launcher3;
  • expose Android's SurfaceFlinger output through Waydroid's compositor as a Wayland client of webOS;
  • associate the HWC surface with org.webosbrew.android through LG's wl_webos_shell protocol;
  • keep WindowManager and SurfaceFlinger task visibility synchronized after SystemUI/task-organizer transitions;
  • translate the 32-bit webOS Magic Remote event ABI into Android's 64-bit keyboard and pointer FIFOs.

The 2026-07-25 on-device checkpoint validates 160 registered Android services, Launcher3 as the top resumed fullscreen activity, continuous 1920x1080 client composition, and Magic Remote interaction. The TV visibly advanced from Phone is starting... to Launcher3, its clock kept updating, and Magic Remote motion plus OK/click reached Android. The physical Back key is still intercepted by Luna Surface Manager on this firmware, so holding OK provides Android Back; Home remains the explicit escape to webOS. A full TV reboot was exercised as well; the installer now restores the persisted patched framework jars before zygote so that recovery cannot fall back to the pristine netd-dependent framework.

The 2026-08-06 GPU checkpoint validates visible Launcher3 icons, application launch/close, Mali-G51 GLES 3.2 presentation, a silent Binder FD path, and a renderer configuration with import tracing disabled. The remaining major performance limit is storage: the tested /dev/sda identifies as a generic USB flash disk with queue depth 1. Cold application starts can spend 50% or more CPU time in I/O wait and memory pressure can consume several hundred MiB of zram. The installer consequently uses noatime,nodiratime,commit=15, the noop scheduler, and a conservative 128 KiB read-ahead window. These settings reduce write and over-read amplification but cannot make slow flash behave like an SSD.

Safety warning

This project is for rooted LG webOS development devices only.

Do not overwrite system partitions such as kernel, rootfs, TV service, boot, recovery, or webOS application partitions. The installer is designed to work from USB storage and runtime mounts only.

The default USB mountpoint used by this repo is:

/media/internal/android-usb

That path is used only as a persistent mountpoint. The script verifies that the actual filesystem mounted there is the selected USB block device, normally /dev/sda1. The Android images, rootfs, data, cache, logs, sidecar binaries, and Binder module all live on the USB filesystem.

Tested setup

Validated target:

LG webOS TV
Linux 4.4.84-229.1.kavir.2
aarch64

Latest full install validation:

2026-07-25
TV_IP=192.168.2.121
USB=/media/internal/android-usb
ANDROID_USB_PART=/dev/sda1
FORMAT_USB=0

Validated control host:

NanoPi R3S
Debian/Ubuntu-like userspace
SSH access to root@TV_IP

Validated Android userspace image family:

Waydroid Android 13 arm64-only system image
Waydroid Android 13 arm64-only vendor image

Repository layout

kernel/
  binder.c
  binder_webos_exports.h
  config-lg-c1-o20-4.4.84

gpu/
  android-aarch64-cross.ini
  webos-arm-cross.ini
  virgl_webos_egl.c
  virgl_webos_egl.h
  kbase_aarch64_probe.c

src/
  property_service_ack_shim.c
  tombstoned_socket_wrap.c
  webos_hwc_bridge.c
  webos_input_bridge.c
  zygote_socket_wrap.c

patches/
  framework-no-audio-session.patch
  services-systemserver-*.patch
  virglrenderer-webos.patch

scripts/
  build-binder.sh
  build-gpu-stack.sh
  build-kbase-aarch64-probe.sh
  build-framework-minimal.sh
  build-property-shim.sh
  build-services-minimal.sh
  build-tombstoned-socket-wrap.sh
  build-webos-host.sh
  build-webos-hwc-bridge.sh
  build-webos-input-bridge.sh
  build-zygote-socket-wrap.sh
  binder-registry-smoke.sh
  check.sh
  clean-mounts.sh
  collect-logs.sh
  deploy-services-minimal.sh
  deploy-gpu-stack.sh
  install-webos-host.sh
  launch-webos-host.sh
  probe-services.sh
  runtime-state.sh
  smoke-hal-services.sh
  start-hal-services.sh
  status.sh
  stop.sh
  restart.sh
  restart-gpu.sh

tests/
  runtime-state-test.sh
  ui-compat-test.sh
  webos-host-test.sh
  webos-hwc-bridge-test.sh
  webos-input-bridge-test.sh

webos-host/
  native_main.c

install.sh
.gitignore
README.md

kernel/binder.c

A vendored Binder source file based on the working final state from the earlier experimental repository. The production FD-transfer path is silent; staged fd_path diagnostics are deliberately excluded because Binder transactions are frequent enough for kernel logging to affect UI latency.

The old project generated this file through many staged patches and injectors. This minimal repo does not replay those patch stages. It keeps the final known-good source directly, so a clean clone can build the module without pulling the old project.

kernel/binder_webos_exports.h

Small compatibility header used by the Binder module to call non-exported kernel functions via symbol addresses passed at insmod time.

The installer resolves the required addresses from /proc/kallsyms on the TV and passes them into the module as parameters.

scripts/build-binder.sh

Downloads Linux 4.4.84, applies the saved LG/webOS kernel config, installs the vendored Binder source, and builds only drivers/android/binder.ko.

It also patches the old kernel dtc build issue seen with modern GCC toolchains by removing the duplicate yylloc definition and using HOSTCFLAGS=-fcommon.

The output module is:

dist/binder.ko

GPU path

The reproducible accelerated path is:

Android arm64 app / SurfaceFlinger
  -> Mesa 26.0.1 virpipe
  -> vtest protocol 3 + shared memfd resources
  -> ARM32 virglrenderer on webOS
  -> proprietary webOS Mali EGL/GLES (Mali-G51, r9p0)
  -> shared GL texture presenter
  -> webOS Wayland compositor

Build and deploy it from the control host:

./scripts/build-gpu-stack.sh
./scripts/deploy-gpu-stack.sh
BUILD_GPU=0 SKIP_BUILD=1 ./scripts/restart-gpu.sh

Set BUILD_GPU=1 on the last command to rebuild before deployment. The normal runtime enables WEBOS_VIRGL_UPLOAD_IMPORTED_MEMFD=1; this performs the single initial upload needed for CPU-rendered Android buffers. Debug variables such as WEBOS_VIRGL_TRACE_IMPORTS and WEBOS_VIRGL_TRACE_TRANSFERS should only be enabled for bounded diagnosis.

gpu/kbase_aarch64_probe.c demonstrates that an arm64 Bionic process can issue the basic kbase ioctls directly to /dev/mali0. That does not make the available HiKey Mali userspace blobs usable on this TV: the r9p0 blob targets Mali-G71 and hard-resets the G51 on its first job after bypassing product detection, while the r10p0 blob expects a newer kernel/userspace ABI than the TV's kbase 11.0. The small Arm RenderScript integration archives are glue source, not a GLES/EGL userspace driver.

On the validated TV, Android storage is a queue-depth-1 USB flash device. Cold starts remain substantially slower than rendering, and a SIGBUS in an app while ART read a memory-mapped framework JAR was observed under heavy I/O. An SSD connected to the control host does not accelerate /dev/sda on the TV.

src/property_service_ack_shim.c

Minimal static aarch64 helper that creates /dev/socket/property_service inside the Android rootfs.

It understands the Android PROP_MSG_SETPROP and PROP_MSG_SETPROP2 socket protocols, returns Android property-service status codes, and can be attached to a selected serialized Android property area, including the areas used by hwservicemanager, logd, and RenderEngine.

That is enough for the current service-manager and graphics bring-up path, including hwservicemanager.ready, logd.ready, and debug.renderengine.backend=gles.

src/zygote_socket_wrap.c

Small static aarch64 helper that creates the host-side zygote and usap_pool_primary sockets, passes them to Android as ANDROID_SOCKET_* file descriptors, then chroots and execs /system/bin/app_process64.

This avoids depending on webOS init socket activation for zygote.

src/webos_input_bridge.c

Small ARM32 webOS process that reads the active LGE M-RCU event node and forwards only Android-relevant controls. By default, webOS keeps drawing its native Magic Remote cursor; a short OK press becomes a touch at the cursor coordinates through wl_touch_events, while navigation and Back go to wl_keyboard_events.

The bridge explicitly converts webOS's 16-byte 32-bit input_event records to Android AArch64's 24-byte records. Power, volume, and Home are not forwarded; Home remains available as the escape path back to webOS.

Holding OK sends Android Back, providing a reliable alternative on TVs whose physical Back key is intercepted by Luna Surface Manager. A short OK press keeps normal Enter semantics after D-pad navigation. Set WEBOS_NATIVE_CURSOR=0 to restore the Android-cursor fallback; that mode uses BTN_LEFT and a monotonic one-pixel REL_X keepalive without cursor drift.

patch-libandroid-runtime-zssystemserver.sh

Runtime compatibility patcher for the Android userspace libraries used by zygote and system_server.

The installer copies this script to the USB sidecar and runs it against the mounted Android rootfs. The current validated flow needs bounded overrides for libandroid_runtime.so, libprocessgroup.so, and libandroid_servers.so; these compatibility paths are enabled by default and validate their source bytes before patching.

PATCH_ANDROID_RUNTIME=0 and PATCH_LIBPROCESSGROUP=0 are diagnostic switches only. On the current image, disabling either one causes zygote64 to abort before system_server stays alive.

try-zygote-start-system-server-v2.sh

Launch script copied to the USB sidecar. It prepares the zygote/system_server environment, starts the property-service ACK shim, filters VNDK paths out of the zygote/system_server LD_LIBRARY_PATH, uses zygote_socket_wrap, and verifies that both zygote64 and system_server stay alive. While Android is active it also enables kernel memory overcommit so zygote can fork applications with large sparse virtual address spaces; stop.sh restores the previous webOS setting.

install.sh

Single entry point. It builds the module and helper binaries, optionally formats the USB partition, downloads/extracts Android images, mounts the Android rootfs, loads Binder, creates the three device nodes, fixes APEX/linker visibility, prepares linkerconfig/property state, starts Android's managers/core daemons and native graphics stack, applies validated compatibility overrides, and starts zygote64 plus system_server.

Quick start

Install local build dependencies on the control host:

sudo apt-get update
sudo apt-get install -y \
  curl xz-utils bc bison flex libssl-dev libelf-dev \
  make gcc gcc-aarch64-linux-gnu git python3 unzip openssh-client

The ARM32 Magic Remote bridge and lifecycle host also require an LG webOS cross-SDK. Set WEBOS_SDK if it is not installed at the validated default path shown below.

Clone and run:

git clone git@github.com:cfernande1470/webos-android-minimal.git
cd webos-android-minimal

TV_IP=192.168.2.121 \
USB=/media/internal/android-usb \
ANDROID_USB_PART=/dev/sda1 \
FORMAT_USB=1 \
CONFIRM_FORMAT_USB=YES \
./install.sh

This path is destructive for the selected USB partition. The validated run formatted /dev/sda1 as ext4, mounted it at /media/internal/android-usb, downloaded the Waydroid Android 13 arm64-only system/vendor images, and completed with zygote64 plus system_server alive.

Expected final result:

FINAL_USB_3DOMAIN_BINDER_OK
FINAL_USB_INSTALL_OK
FRAMEWORK_SERVICES_MINIMAL_DEPLOY_OK

To restart the complete validated stack without reformatting the USB:

TV_IP=192.168.2.121 \
USB=/media/internal/android-usb \
ANDROID_USB_PART=/dev/sda1 \
FORMAT_USB=0 \
./scripts/restart.sh

The installer also reapplies any validated framework/services overrides found on the USB, so a recovery run after a physical TV reboot cannot accidentally start the pristine services.jar that waits for unavailable Android-init network services.

During iterative debugging, already validated local build artifacts can be reused with SKIP_BUILD=1; the installer still checks that every required artifact exists before contacting the TV.

The native webOS lifecycle host is built and installed separately because it uses the LG webOS SDK:

./scripts/install-webos-host.sh
./scripts/launch-webos-host.sh

The default SDK path is /home/pi/disk/webos-sdk/arm-webos-linux-gnueabi_sdk-buildroot; override it with WEBOS_SDK=... when required. The host and HWC surface are now validated end to end for live display, cursor, and click. The native lifecycle host remains marker-free so it cannot cover or steal input from Android's compositor surface.

USB formatting guard

Formatting is disabled unless both variables are present:

FORMAT_USB=1
CONFIRM_FORMAT_USB=YES

The script refuses to format arbitrary paths. It only accepts USB-like block devices such as:

/dev/sda
/dev/sda1
/dev/sdb
/dev/sdb1

It also checks that the selected mountpoint is actually backed by the selected USB device before writing Android files.

Current boot flow

High-level flow:

control host
  ├── build Linux 4.4.84 Binder module
  ├── build static property_service_ack_shim
  ├── build the bionic-compatible webOS HWC preload bridge
  ├── build the ARM32 Magic Remote input bridge
  └── SSH to TV
        ├── optionally format USB ext4
        ├── mount USB at /media/internal/android-usb
        ├── copy binder.ko, property shim, zygote wrapper, and launch/patch scripts
        ├── download Android system/vendor images to USB
        ├── extract system.img and vendor.img
        ├── mount system/vendor/rootfs/data/cache/proc/sys/dev
        ├── resolve non-exported kernel symbols from /proc/kallsyms
        ├── insmod binder.ko with symbol parameters
        ├── create /dev/binder, /dev/hwbinder, /dev/vndbinder
        ├── mount Android APEX/linker paths correctly
        ├── generate linkerconfig
        ├── seed Android property area enough for bring-up
        ├── start property socket ACK shim
        ├── start vndservicemanager
        ├── start servicemanager
        ├── start hwservicemanager
        ├── bind-mount patched Android runtime/server/processgroup libraries
        ├── preload the LG shell bridge into Waydroid's composer
        ├── start the Magic Remote keyboard/pointer bridge
        ├── start zygote64 with system_server
        └── activate patched framework/services jars and Launcher3

Binder module notes

The TV kernel already contains enough Binder-era infrastructure to make this possible, but not in a directly reusable Android form. The module therefore uses a small set of runtime symbol parameters for non-exported kernel helpers:

sym_get_vm_area
sym_map_kernel_range_noflush
sym_zap_page_range
sym___alloc_fd
sym___fd_install
sym___close_fd
sym_get_files_struct
sym_put_files_struct
sym___lock_task_sighand
sym___task_pid_nr_ns

The installer resolves these on the TV with /proc/kallsyms and passes them to insmod. PID/TGID lookup is deliberately performed by the running LG kernel instead of dereferencing vendor-specific task_struct fields from the external module.

The module exposes:

/dev/binder
/dev/hwbinder
/dev/vndbinder

These correspond to the three Android Binder domains used by:

/system/bin/servicemanager
/system/bin/hwservicemanager
/vendor/bin/vndservicemanager

Binder FD transfer fix

A major milestone from the earlier repository was real BINDER_TYPE_FD support.

The important rule discovered during the FD work was that Binder FD installation must target Binder's target process file table directly. The successful path uses the Binder target process state rather than current->files or a task-derived file table.

Conceptually:

file = fget(fp->handle);
target_fd = __alloc_fd(target_proc->files, 0, 1024, O_CLOEXEC);
__fd_install(target_proc->files, target_fd, file);
fp->handle = target_fd;

This is why the module still has an internal fd_path_mode module parameter. It is no longer a public staged-debug workflow; it is simply the selected file-descriptor transfer path used by the working module.

The old repository carried this history as staged FD probes, smoke tests, and debug labels. This repository keeps the working implementation and removes those development harnesses from the normal install path.

APEX/linker issue and fix

Android 13 binaries use:

/system/bin/linker64 -> /apex/com.android.runtime/bin/linker64

If /apex is missing, empty, or accidentally covered by tmpfs, chroot execution fails with a misleading error:

chroot: can't execute '/system/bin/toybox': No such file or directory

The file exists, but its interpreter does not.

The installer now ensures that /apex/com.android.runtime/bin/linker64 is visible before starting Android binaries. It validates this with a minimal toybox true check and rechecks APEX again immediately before starting the service managers.

Property service bridge

property_service_ack_shim creates:

/dev/socket/property_service

inside the Android rootfs, accepts Android 13 property-set socket messages, validates the basic property name/value shape, returns the same numeric success/error codes used by Android init's property service, and writes the accepted values into Android's shared property area so getprop sees them directly.

This is enough for the current service-manager baseline, and it is the property bridge used by the current bring-up path.

What is working now

The current clean installer validates:

USB ext4 storage
optional USB formatting with explicit confirmation
Android system.img/vendor.img download and extraction
Android rootfs assembly on USB
/system mount
/vendor mount
/apex visibility for Android linker
/data on USB
/cache on USB
/proc mount
/sys mount
/dev bind/device preparation
binder.ko build and load
/dev/binder
/dev/hwbinder
/dev/vndbinder
/system/bin/servicemanager alive
/system/bin/hwservicemanager alive
/vendor/bin/vndservicemanager alive
zygote64 alive
system_server alive
160 Android Binder services
Launcher3 top resumed in fullscreen
57 SurfaceFlinger layers
Waydroid HWC connected to webOS Wayland
wl_webos_shell bound by the HWC bridge
org.webosbrew.android registered in SAM
Android visible and updating at 1920x1080 on the physical TV
Magic Remote pointer and click delivered to Android
Magic Remote keyboard FIFO connected
Mesa virpipe connected to the ARM32 vtest server
Mali-G51 GLES 3.2 native presenter active
CPU-populated Launcher3 icon buffers visible

The latest validated run also confirmed the generated Android classpaths from the mounted image metadata:

BOOTCLASSPATH generated length: 1624
SYSTEMSERVERCLASSPATH generated length: 792

A successful run ends with:

--- android services ---
vndservicemanager: <pid>
servicemanager: <pid>
hwservicemanager: <pid>
FINAL_USB_3DOMAIN_BINDER_OK

ZYGOTE_SYSTEM_SERVER_OK
FINAL_ANDROID_ZYGOTE_SYSTEM_SERVER_OK

FINAL_USB_INSTALL_OK

FRAMEWORK_SERVICES_MINIMAL_DEPLOY_OK
SERVICES_MINIMAL_DEPLOY_OK

What this repository intentionally removed

The old experimental repository was useful for discovery, but it had accumulated many intermediate artifacts. This minimal repo removes the normal dependency on:

  • staged Binder FD debug scripts;
  • smoke-test harnesses;
  • repeated patch injectors;
  • legacy dirty naming;
  • intermediate milestone tags in output;
  • artifact fallback logic;
  • /tmp/android-usb as the default persistent path.

The default persistent mountpoint is now:

/media/internal/android-usb

Relationship to other repositories

Previous Binder research repository

https://github.com/cfernande1470/webos-dirty-binder

That repository documents the discovery path: Binder mmap, FD passing, three Binder domains, linkerconfig, property-area probing, and early HAL experiments.

This repository is the cleaned installer-first result extracted from that research.

Wayland/webOS app repository

https://github.com/cfernande1470/webos-wayland

The Wayland project proves the native webOS app/display side: SAM-launched native app, Wayland surface creation, input, and EGL/GLES rendering on the TV compositor.

Long term, the Android sidecar work here and the native Wayland work there can converge into a controlled Android-on-webOS app experiment: Android services and framework components running as a sidecar, with rendering/input integrated through the already working webOS/Wayland path.

Milestones reached

1. Binder module builds outside the TV

The control host can build binder.ko for the LG webOS kernel version:

4.4.84-229.1.kavir.2

The build is isolated to drivers/android/binder.ko.

2. Non-exported kernel symbols are resolved at load time

The module no longer requires kernel partition changes. The installer reads /proc/kallsyms and passes the required addresses into insmod.

3. Binder mmap works

The Binder memory mapping path works far enough for real Android service-manager processes to start.

4. Real Binder FD transfer works

The FD path was fixed by installing received FDs into target_proc->files.

5. Binder multi-device works

The module exposes:

/dev/binder
/dev/hwbinder
/dev/vndbinder

6. Android rootfs on USB works

Android system and vendor images are downloaded and mounted from USB. /data and /cache also live on USB.

7. Android APEX/linker visibility works

The installer keeps /apex/com.android.runtime/bin/linker64 visible and validates it before launching Android binaries.

8. Three Android service managers are alive

The final validated service baseline is:

vndservicemanager
servicemanager
hwservicemanager

Completed milestones

M1: Replace property ACK shim

The property-service bridge is now in place for the current runtime.

Current state:

Android property socket protocol shim
mirrored shared property area for valid property names
validated restart behavior

Validation:

setprop/getprop works for valid property names
accepted writes are visible through Android's shared /dev/__properties__ area
restart keeps the property bridge working

M2: Make Android init lifecycle explicit

Implemented:

  • runtime phase markers and pid files for start, stop, and restart;
  • status.sh, stop.sh, and restart.sh as the controlled lifecycle path;
  • updated_at_utc in runtime.state and a phase timeline in runtime.timeline.

M3: HAL bring-up beyond service managers

Implemented:

  • bounded launcher and smoke for non-graphics HALs;
  • logd, installd, idmap2d, SystemSuspend, Waydroid health/vibrator, memtrack, power, both graphics allocators, configstore, Waydroid task/composer, light, and SurfaceFlinger in the resident baseline;
  • an explicit empty-sensor compatibility path, because this Android 13 framework requires AIDL/HIDL 2.x while the image only includes a 1.0 stub and the TV has no sensors;
  • Waydroid's composer connected to /tmp/xdg/wayland-0, the webOS compositor socket.

M4: Binder service registration checks

Implemented:

  • service list / service check SERVICE diagnostics;
  • service call manager 1 s16 activity_task as a working getService smoke;
  • binder-registry-smoke.sh as the dedicated probe;
  • vndservice list and lshal remain optional diagnostics on this image.

Future milestones

The remaining cleanup milestone is M5. M6 is working on the target TV and now needs cold-boot regression testing and UX refinement.

M5: Replace runtime binary patches with source-level fixes

The installer currently uses bounded bind-mount patches for the TV-specific blockers found during zygote/system_server bring-up:

libandroid_runtime.so
libprocessgroup.so
libandroid_servers.so
configstore/composer/SurfaceFlinger native UI paths
task profile/runtime abort paths
file-descriptor allowlist/reopen paths
seccomp filter helpers
power stats / stats / memtrack startup blockers

libandroid_servers.so is part of the default compatibility path again because later framework startup reaches power, stats, and memtrack code that depends on it.

This is acceptable for reproducing the current milestone, but it should eventually become a cleaner compatibility layer or documented source-level Android userspace patch set.

Completed M6: Android UI and Magic Remote through webOS

Validated on the physical TV on 2026-07-25:

launch org.webosbrew.android from SAM
LSM foreground process is the Android composer surface
SurfaceFlinger output is visible and updates continuously
Phone is starting... transitions to Launcher3
Android clock advances instead of retaining an old frame
webOS keeps drawing the native Magic Remote cursor
short OK becomes a touch at the cursor position in Android
long OK becomes Android Back
remote navigation opens Android's keyboard FIFO

The task-visibility services patch repairs a stale hidden-root-task state after SystemUI/task-organizer transitions. The ARM32 input bridge bypasses unreliable cross-client Wayland focus assignment and writes correctly sized AArch64 events into Waydroid's existing input FIFOs. The reboot recovery run validated automatic bridge startup, Magic Remote OK/click, and live cursor input. Native webOS cursor mode uses Waydroid's touch FIFO, while the HWC preload bridge suppresses Waydroid's wl_pointer.set_cursor override so the compositor keeps the Magic Remote arrow. Holding OK supplies Back when the firmware consumes the physical key.

Completed M7: Packaging and recovery

status.sh, stop.sh, restart.sh, clean-mounts.sh, and collect-logs.sh provide the operational lifecycle and recovery layer. Transitions, including an explicit stop, are appended to runtime.timeline with their metadata.

Troubleshooting

chroot: can't execute ... No such file or directory

Check the Android linker:

ssh root@192.168.2.121 '
ROOT=/media/internal/android-usb/android-rootfs
ls -l "$ROOT/system/bin/linker64"
ls -l "$ROOT/apex/com.android.runtime/bin/linker64"
chroot "$ROOT" /system/bin/toybox true && echo TOYBOX_OK || echo TOYBOX_FAIL
'

If /apex/com.android.runtime/bin/linker64 is missing, APEX is not mounted correctly.

Service managers exit quickly

Check logs:

ssh root@192.168.2.121 '
LOGDIR=/media/internal/android-usb/android-sidecar/logs
for f in vndservicemanager servicemanager hwservicemanager property_service_ack_shim; do
  echo "### $f"
  cat "$LOGDIR/$f.log" 2>/dev/null || true
done
'

USB mountpoint is wrong

Check that /media/internal/android-usb is backed by the USB device:

ssh root@192.168.2.121 'grep android-usb /proc/mounts && df -h /media/internal/android-usb'

Expected:

/dev/sda1 /media/internal/android-usb ext4 ...

Reboot to clear stale mounts

During development, stale loop mounts can make debugging confusing. A reboot clears them:

ssh root@192.168.2.121 'sync; reboot'

Then rerun the installer.

Development notes

The repository is intentionally minimal, but not yet production-polished.

Run the local shell checks and lifecycle-state regression test before pushing:

./scripts/check.sh

Keep generated files out of Git:

build/
dist/
*.img
*.zip

Use:

git status

before pushing.

GitHub

Repository:

git@github.com:cfernande1470/webos-android-minimal.git

Push to main:

git branch -M main
git remote remove origin 2>/dev/null || true
git remote add origin git@github.com:cfernande1470/webos-android-minimal.git
git push -u origin main

License

No license has been selected yet.

Add a LICENSE file before treating this as a reusable open-source project. MIT is a reasonable default for the shell/C userspace helper portions, but the vendored Linux Binder-derived source follows the kernel licensing constraints indicated by the source/module metadata.

About

No description, website, or topics provided.

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages