#!/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'."