res-sh: rescue shell — Lua-extensible applets, static binary #28

Open
opened 2026-10-12 22:17:11 +00:00 by muse-lantern · 0 comments
Member

Goal

Turn res-sh into the standalone "oh shit" fallback shell: one static binary that opens a shell with all rescue commands available inside it. (Can support multicall argv[0] dispatch, but that is not the primary interface.)

The internal Lua runtime is the extension mechanism: place a Lua script in a special folder and it should just work for the majority of what busybox can do.

Scope

  1. Parser: add &&, ||, ! operators (tier-1). Rescue scripts are written as [ ... ] && ...; without these, test is half-useful.
  2. Applet registry: in-shell dispatch so all commands are available inside the shell with no PATH. Multicall argv[0] dispatch as a bonus.
  3. Lua runtime wiring: wire core/lib/script into res-sh so Lua scripts in a special folder work as commands.
  4. Rescue applets: incremental set — ls, cat, cp, mv, rm, mkdir, rmdir, ln, chmod, touch, head, tail, wc, test/[, mount, umount, df, du, dmesg, ps, ip, clear, uname, echo.
  5. Static build: verify CGO_ENABLED=0 go build produces a working static binary.

Stays out

  • modprobe/insmod/depmod/mdev — kernel module loading stays on busybox-static (per 2026-10-12 loader decision).
## Goal Turn res-sh into the standalone "oh shit" fallback shell: one static binary that opens a shell with all rescue commands available inside it. (Can support multicall argv[0] dispatch, but that is not the primary interface.) The internal Lua runtime is the extension mechanism: place a Lua script in a special folder and it should just work for the majority of what busybox can do. ## Scope 1. **Parser**: add `&&`, `||`, `!` operators (tier-1). Rescue scripts are written as `[ ... ] && ...`; without these, `test` is half-useful. 2. **Applet registry**: in-shell dispatch so all commands are available inside the shell with no PATH. Multicall argv[0] dispatch as a bonus. 3. **Lua runtime wiring**: wire `core/lib/script` into res-sh so Lua scripts in a special folder work as commands. 4. **Rescue applets**: incremental set — ls, cat, cp, mv, rm, mkdir, rmdir, ln, chmod, touch, head, tail, wc, test/[, mount, umount, df, du, dmesg, ps, ip, clear, uname, echo. 5. **Static build**: verify `CGO_ENABLED=0 go build` produces a working static binary. ## Stays out - modprobe/insmod/depmod/mdev — kernel module loading stays on busybox-static (per 2026-10-12 loader decision).
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set

Reference
residual/.agent#28
No description provided.