8fa23fa9aa42ef99321f677073e4029aec0d5cf1 — Anjandev Momi 2 months ago 9ea4f01
no device profile: add warning to ssh and startup

People installing sxmo on new devices often send bug reports with it not
working. Lets improve the error they get when ssh and add a popup on
start referring them to the documentation on how they can fix it.

I also uploaded a commit to sxmo.org with this fix:


Feel free to change that page's content so it's clearer what the user
should do.

Signed-off-by: Peter John Hartman <peterjohnhartman@gmail.com>
2 files changed, 6 insertions(+), 1 deletions(-)

M configs/default_hooks/sxmo_hook_start.sh
M configs/profile.d/sxmo_init.sh
M configs/default_hooks/sxmo_hook_start.sh => configs/default_hooks/sxmo_hook_start.sh +5 -0
@@ 88,5 88,10 @@ superctl start wireplumber
	sxmo_daemons.sh start modem_monitor sxmo_modemmonitor.sh
) &

deviceprofile="$(command -v "sxmo_deviceprofile_$SXMO_DEVICE_NAME.sh")"

[ -f "$deviceprofile" ] || sxmo_notify_user.sh --urgency=critical \
	"No deviceprofile found $SXMO_DEVICE_NAME. See: https://sxmo.org/deviceprofile"

sxmo_migrate.sh state || sxmo_notify_user.sh --urgency=critical \
	"Config needs migration" "$? file(s) in your sxmo configuration are out of date and disabled - using defaults until you migrate (run sxmo_migrate.sh)"

M configs/profile.d/sxmo_init.sh => configs/profile.d/sxmo_init.sh +1 -1
@@ 75,7 75,7 @@ _sxmo_load_environments() {
			. "$deviceprofile"
			printf "deviceprofile file %s loaded.\n" "$deviceprofile"
			printf "WARNING: deviceprofile file not found for %s.\n" "$SXMO_DEVICE_NAME"
			printf "WARNING: deviceprofile file not found for %s. Most device functions will not work. Please read: https://sxmo.org/deviceprofile \n" "$SXMO_DEVICE_NAME"
		unset deviceprofile