From 24d2f28fb6b39fa9a079f92075ec3357fdd19e4b Mon Sep 17 00:00:00 2001 From: Joachim Wiberg Date: Thu, 16 Mar 2023 12:58:50 +0100 Subject: [PATCH] board/common: allow default auth:none restconf via nginx to clixon - Only disable default services we don't need, prevents touching services mid-air in runlevel S. Allow nginx now as well - Enable fcgi based RESTCONF interface via nginx by default - Enable auth:none for customer demo Signed-off-by: Joachim Wiberg --- board/common/rootfs/lib/infix/clean-etc | 15 ++++++++++++--- board/common/rootfs/lib/infix/prep-db | 20 +++++++++++++++----- 2 files changed, 27 insertions(+), 8 deletions(-) diff --git a/board/common/rootfs/lib/infix/clean-etc b/board/common/rootfs/lib/infix/clean-etc index fb38939d..596bd51b 100755 --- a/board/common/rootfs/lib/infix/clean-etc +++ b/board/common/rootfs/lib/infix/clean-etc @@ -5,10 +5,19 @@ # This is a managed node, ignore all default configuration... rm -f /etc/rc.local -rm -rf /etc/finit.d/enabled/*.conf rm -rf /etc/network/interfaces* #...except for some core services -for svc in clixon getty sysklogd; do - ln -s ../available/$svc.conf /etc/finit.d/enabled/$svc.conf +reserved() +{ + for svc in clixon getty nginx sysklogd; do + [ "$1" = "${svc}.conf" ] && return 0 + done + + return 1 +} + +for file in /etc/finit.d/enabled/*.conf; do + reserved "$(basename "$file")" && continue + rm "$file" done diff --git a/board/common/rootfs/lib/infix/prep-db b/board/common/rootfs/lib/infix/prep-db index 8d868018..bcebf3a5 100755 --- a/board/common/rootfs/lib/infix/prep-db +++ b/board/common/rootfs/lib/infix/prep-db @@ -1,9 +1,19 @@ #!/bin/sh - set -e -# TODO: Copy in a proper factory config from -# /usr/share/vendor/_db or similar. -touch /mnt/tmp/infix/db/factory_db +FACTORY=/mnt/tmp/infix/db/factory_db -[ -f /cfg/startup_db ] || cp /mnt/tmp/infix/db/factory_db /cfg/startup_db +# TODO: Maybe copy in a proper factory config from +# /usr/share/vendor/_db or similar. +# Right now we generate one from probed data. +cat <$FACTORY + + + true + none + /run/clixon/restconf.sock + + +EOF + +[ -f /cfg/startup_db ] || cp "$FACTORY" /cfg/startup_db