diff --git a/image/make-a113d-afw.sh b/image/make-a113d-afw.sh index 4516afa..60c8692 100755 --- a/image/make-a113d-afw.sh +++ b/image/make-a113d-afw.sh @@ -70,6 +70,13 @@ mkdir -p "$RFS" install -D -m 0755 "$WORK/alkane-os" "$RFS/usr/bin/alkane-os" # The .afw version, reported by GET /api/identity (fleet discovery). printf '%s\n' "$VERSION" > "$RFS/etc/alkane-os-version" +# This board boots a custom /init (not BusyBox rcS, so the init.d overlay is not +# run). That /init launches the console binary with no args -- which only prints +# usage and exits. The real binary needs `--serve` to bring up the web console + +# HTTP API, so patch the launch line. Idempotent. +if [ -f "$RFS/init" ] && ! grep -q 'alkane-os --serve' "$RFS/init"; then + sed -i 's#\(/usr/bin/alkane-os\)\( >/dev/null\)#\1 --serve\2#' "$RFS/init" +fi if [ -d "$OVERLAY" ]; then ( cd "$OVERLAY" && find . -type f ) | while IFS= read -r f; do install -D -m 0755 "$OVERLAY/${f#./}" "$RFS/${f#./}"