grblhal-glowforge: recipe with boot autostart

gitsm-pinned build of the controller with a sysvinit script (defaults 92, after forgectrl), installed in both images. Reboot-verified on the bench: controller and forgectrl come up unattended and Grbl answers on TCP:23.
This commit is contained in:
ScottW514
2026-08-03 17:22:07 -04:00
parent 7b320c34ac
commit 061def2343
5 changed files with 81 additions and 9 deletions
@@ -0,0 +1,30 @@
DESCRIPTION = "grblHAL motion controller for the Glowforge factory board"
HOMEPAGE = "https://github.com/ScottW514/grblHAL-glowforge"
LICENSE = "GPL-3.0-or-later"
LIC_FILES_CHKSUM = "file://COPYING;md5=3237e48bcef3455c7bea5c0ce16206f6"
PV = "0.1.0"
# gitsm: the grblHAL core rides as a submodule (ScottW514/core, branch
# forgefirm, carrying the settings-write crash fix PR'd upstream).
SRC_URI = "gitsm://github.com/ScottW514/grblHAL-glowforge.git;protocol=https;branch=main"
# Pinned; bump deliberately after pushing grblHAL-glowforge changes.
SRCREV = "c421f20281bb399bdbb65a45e355b3d4ca912d1d"
SRC_URI += "file://grblhal.init"
S = "${WORKDIR}/git"
inherit cmake update-rc.d
INITSCRIPT_NAME = "grblhal"
INITSCRIPT_PARAMS = "defaults 92"
do_install:append() {
install -d ${D}${sysconfdir}/init.d
install -m 0755 ${WORKDIR}/grblhal.init ${D}${sysconfdir}/init.d/grblhal
}
# The controller streams into /dev/glowforge (glowforge.ko) at runtime.
RRECOMMENDS:${PN} = "kernel-module-glowforge"
@@ -0,0 +1,36 @@
#!/bin/sh
### BEGIN INIT INFO
# Provides: grblhal
# Required-Start: $local_fs
# Required-Stop:
# Default-Start: 2 3 4 5
# Default-Stop: 0 1 6
# Short-Description: grblHAL motion controller (Grbl over TCP:23)
### END INIT INFO
DAEMON=/usr/bin/grblHAL_glowforge
PIDFILE=/var/run/grblhal.pid
LOG=/data/glowforge.log
case "$1" in
start)
echo "Starting grblHAL"
start-stop-daemon -S -q -p $PIDFILE -m -b -x /bin/sh -- \
-c "cd /data && GFSINK=/dev/glowforge exec $DAEMON -p 23 -e /data/EEPROM-glowforge.DAT >> $LOG 2>&1"
;;
stop)
echo "Stopping grblHAL"
start-stop-daemon -K -q -p $PIDFILE
rm -f $PIDFILE
;;
restart)
$0 stop
sleep 1
$0 start
;;
*)
echo "Usage: $0 {start|stop|restart}"
exit 1
;;
esac
exit 0
@@ -10,7 +10,8 @@ DESCRIPTION = "OpenGlow/ForgeFIRM image for Glowforge"
# backlog #5).
IMAGE_INSTALL:remove = "gfui-client"
# grblhal-glowforge: the grblHAL motion controller (Grbl over TCP:23).
# forgectrl: the ForgeFIRM control daemon (camera MJPEG service on :8080).
# v4l-utils provides media-ctl / v4l2-ctl for the imx-media pipeline (also a
# forgectrl runtime dependency, kept explicit here for bring-up use).
IMAGE_INSTALL:append = " forgectrl v4l-utils"
IMAGE_INSTALL:append = " grblhal-glowforge forgectrl v4l-utils"