fix(iso): accept corrected colibri rc source (Sam & Codex) #50

Merged
clawdie merged 1 commit from fix/colibri-rc-source-compat into main 2026-06-14 22:12:23 +02:00

View file

@ -71,7 +71,7 @@ install -m 0555 "${RC_SOURCE}" "${RC_DIR}/colibri_daemon"
install -m 0644 "${NEWSYSLOG_SOURCE}" "${NEWSYSLOG_DIR}/colibri.conf"
if ! grep -q '^command="/usr/sbin/daemon"' "${RC_DIR}/colibri_daemon" || \
! grep -q -- '-o .*colibri_daemon_program' "${RC_DIR}/colibri_daemon"; then
! grep -Eq -- '-o .*colibri_daemon_(program|binary)' "${RC_DIR}/colibri_daemon"; then
echo "ERROR: staged colibri_daemon rc.d script does not supervise colibri-daemon with daemon(8)" >&2
echo " Update COLIBRI_REPO (${COLIBRI_REPO}) before building; the live USB must not block boot in rc.d." >&2
exit 66
@ -87,7 +87,9 @@ sed -i '' 's/^procname="\/usr\/sbin\/daemon"$/procname="daemon:"/' \
# Fix ${name}_program override: rc.subr line 1120 silently replaces
# command= with ${name}_program if set, so colibri_daemon_program=
# overrode command="/usr/sbin/daemon" — daemon(8) was never invoked.
# Rename the variable so rc.subr leaves command= alone.
# Rename the variable so rc.subr leaves command= alone. Newer Colibri sources
# may already use colibri_daemon_binary; this replacement is intentionally
# harmless when there is no old variable left.
sed -i '' 's/colibri_daemon_program/colibri_daemon_binary/g' \
"${RC_DIR}/colibri_daemon"
@ -102,16 +104,19 @@ sed -i '' 's/ -u \${colibri_daemon_user} //' \
# running 'service colibri_daemon status'. Chmod in poststart.
# Use awk instead of sed append syntax: BSD sed's multi-line append form is
# easy to get wrong and can corrupt the rc.d script by appending to every line.
_rc_tmp="${RC_DIR}/colibri_daemon.tmp"
awk '
{ print }
/socket ready/ {
print " chmod 644 \"${pidfile}\" 2>/dev/null || true"
print " chmod 660 \"${colibri_daemon_socket}\" 2>/dev/null || true"
}
' "${RC_DIR}/colibri_daemon" > "${_rc_tmp}"
mv "${_rc_tmp}" "${RC_DIR}/colibri_daemon"
chmod 0555 "${RC_DIR}/colibri_daemon"
# Newer Colibri sources may already carry these chmods; do not duplicate them.
if ! grep -q 'chmod 644 "${pidfile}"' "${RC_DIR}/colibri_daemon"; then
_rc_tmp="${RC_DIR}/colibri_daemon.tmp"
awk '
{ print }
/socket ready/ {
print " chmod 644 \"${pidfile}\" 2>/dev/null || true"
print " chmod 660 \"${colibri_daemon_socket}\" 2>/dev/null || true"
}
' "${RC_DIR}/colibri_daemon" > "${_rc_tmp}"
mv "${_rc_tmp}" "${RC_DIR}/colibri_daemon"
chmod 0555 "${RC_DIR}/colibri_daemon"
fi
# Add DeepSeek API key and cache warming to daemon environment.
# These are injected into the rc.d prestart so the daemon picks them up