2026-08-13 18:48:56 +03:00

48 lines
1.6 KiB
Markdown

# sam-cli — deploy
`sam-cli.sh` is a pure POSIX sh (busybox-compatible) wrapper around `luna-send`
for the webOS SAM daemon. It runs **on the target board** (no bash there — only
busybox ash), and can also drive the board remotely via `--host`/`$SAM_HOST`.
## Target
- Board: `root@172.26.123.126` (LG webOS TV, aarch64)
- Destination: `/home/root/sam-cli`
- `scp` does **not** work (the TV has no `sftp-server`) — use the base64 pipe below.
## Deploy
```sh
# from this directory
base64 -w0 sam-cli.sh | ssh -o BatchMode=yes root@172.26.123.126 \
'base64 -d > /home/root/sam-cli && chmod +x /home/root/sam-cli && md5sum /home/root/sam-cli'
# verify checksum matches the local file
md5sum sam-cli.sh
```
Do **not** use `ssh -tt` for the transfer — the pty echoes the piped input and
corrupts the file. `-tt` is only for running commands afterwards.
## Why `/home/root`?
- `/usr/local/bin` does not exist on this build.
- `/usr` overlay is 100% full (30.8M/30.8M) — nothing can be written there.
- `/home/root` is persistent with ~197M free.
## Post-deploy notes
- `/home/root` is **not** in `PATH` (`/usr/bin:/bin:/usr/sbin:/sbin`). Call by
full path, or `export PATH=/usr/bin:/bin:/usr/sbin:/sbin:/home/root`.
- The board has **no jq** — the script's `--ids` and JSON-merge fallbacks are
built in; `--pretty` degrades to raw JSON.
- `luna-send` replies can take several seconds — keep the default
`--timeout 30` or raise it.
## Smoke test (read-only)
```sh
ssh -tt root@172.26.123.126 "/home/root/sam-cli running --ids"
ssh -tt root@172.26.123.126 "/home/root/sam-cli list --ids | wc -l"
```