Files
s6-lua/tools/install.sh
T
JMR-dev cb48a676e9 Add Lua-ported s6/s6-rc service definitions
Ports the community s6/s6-rc service catalog (early-boot mounts, udev,
dbus, session/power, networking, display managers, peripheral daemons)
to Lua-based service definitions.

- src/lua/s6lua.lua: shared helper library (exec, logging, fstab
  parsing, oneshot shell runner, readiness notification)
- src/native/s6exec.c: minimal execvp() binding so longrun `run`
  scripts can replace their own process image with the real daemon,
  since stock Lua has no exec() and os.execute("exec ...") does not
  solve it (the interpreter stays alive as an unsupervised parent)
- tools/catalog.lua + gen-services.lua: table-driven generator for
  the structurally identical -srv/-log daemon pairs and agetty ttys
- tools/lint.lua, check-syntax.ps1, set-exec-bits.ps1: local
  verification (no live s6/Linux target available this session)
- services/: 50 service directories (14 early-boot oneshots, 12
  daemon srv/log pairs, 6 agetty ttys, boot/mount/setup/ttys/
  graphical/default bundles)

Authored and syntax/structurally validated only. Native module is
unbuilt and daemon flags are unverified against Artix's real catalog
(gitea was unreachable during research) -- see docs/CONVENTIONS.md.
2026-07-19 19:06:43 -05:00

36 lines
1.2 KiB
Bash

#!/bin/sh
# Linux-only. Deploys the shared Lua library, builds+installs the native
# exec module, copies service definitions into place, and compiles the
# s6-rc database.
#
# NOT run this session -- no s6/s6-rc install available to test against.
# Reviewed by inspection only; exercise for real on the target (the Arch
# WSL distro is the recommended first target, see docs/CONVENTIONS.md)
# before trusting it.
set -e
PREFIX=${PREFIX:-/usr/local}
LUA_VERSION=${LUA_VERSION:-5.4}
SERVICE_SRC=${SERVICE_SRC:-/etc/s6/sv}
SERVICE_COMPILED=${SERVICE_COMPILED:-/etc/s6-rc/compiled}
repo_root=$(cd "$(dirname "$0")/.." && pwd)
echo "==> installing shared Lua library"
install -Dm644 "$repo_root/src/lua/s6lua.lua" \
"$PREFIX/share/lua/$LUA_VERSION/s6lua.lua"
echo "==> building + installing native exec module"
make -C "$repo_root/src/native" LUA_VERSION="$LUA_VERSION" PREFIX="$PREFIX" install
echo "==> installing service definitions to $SERVICE_SRC"
mkdir -p "$SERVICE_SRC"
cp -a "$repo_root"/services/. "$SERVICE_SRC"/
echo "==> compiling s6-rc database"
rm -rf "$SERVICE_COMPILED.new"
s6-rc-compile "$SERVICE_COMPILED.new" "$SERVICE_SRC"
mv "$SERVICE_COMPILED.new" "$SERVICE_COMPILED"
echo "done. Boot-test the 'boot' bundle before enabling 'graphical'."