diff --git a/install.sh b/install.sh index 948e309..b6ff246 100644 --- a/install.sh +++ b/install.sh @@ -158,6 +158,22 @@ chmod +x "$INSTALL_DIR/bin/clawd.js" info "clawd symlinked to /usr/local/bin/clawd" +# Install RK3588S LVGL demo +DEVICE_MODEL="$(tr -d '\0' /dev/null || true)" +if echo "$DEVICE_MODEL" | grep -qi 'RK3588S'; then + DEMO_SRC="$INSTALL_DIR/lib/resource/3588s/demo" + DEMO_DST="/usr/bin/demo" + if [ -f "$DEMO_SRC" ]; then + info "RK3588S detected, installing LVGL demo to $DEMO_DST" + if [ -f "$DEMO_DST" ] && [ ! -f "${DEMO_DST}.clawd-bak" ]; then + cp "$DEMO_DST" "${DEMO_DST}.clawd-bak" + info "Backup created: ${DEMO_DST}.clawd-bak" + fi + install -m 0755 "$DEMO_SRC" "$DEMO_DST" + else + warn "RK3588S demo binary not found: $DEMO_SRC" + fi +fi # Write default config files mkdir -p "$CONFIG_DIR" diff --git a/lib/resource/3588s/README.md b/lib/resource/3588s/README.md new file mode 100644 index 0000000..6fef7f7 --- /dev/null +++ b/lib/resource/3588s/README.md @@ -0,0 +1,39 @@ +# RK3588S demo resource + +This directory contains the LVGL demo binary deployed on RK3588S devices by `install.sh`. + +## Files + +- `demo` — prebuilt LVGL UI binary installed to `/usr/bin/demo` on RK3588S boards + +## Source + +Current binary source on the build machine: + +- `/home/sts/share/小屏demo开发指南/lvgl源码/lv_port_linux_v2/lv_port_linux/build/bin/demo` + +## Purpose + +This demo provides the small-screen UI used on RK3588S devices, including FIFO-based control through: + +- `/tmp/lvgl_cmd` + +Supported commands expected by the current clawd RK3588 LVGL backend include: + +- `show_text:AP` +- `show_text:Conn` +- `show_text:Err0` +- `show_text:` +- `show_time` + +## Install behavior + +During `install.sh`, if `/proc/device-tree/model` matches `RK3588S`, clawd will: + +1. Back up existing `/usr/bin/demo` to `/usr/bin/demo.clawd-bak` if not already backed up +2. Install this `demo` binary to `/usr/bin/demo` + +## Notes + +- The binary is hardware-specific and intended for RK3588S boards. +- Replacing the binary should be done together with verification of `/tmp/lvgl_cmd` behavior and screen rendering. diff --git a/lib/resource/3588s/demo b/lib/resource/3588s/demo new file mode 100755 index 0000000..0369a19 Binary files /dev/null and b/lib/resource/3588s/demo differ