#!/bin/sh

set -eu

echo "Yoga Book GNSS OpenRC services installed."

if command -v udevadm >/dev/null 2>&1; then
    udevadm control --reload-rules || :
    udevadm trigger --subsystem-match=tty || :
fi

cat <<'EOF'

Import the proprietary GNSS runtime if you have not already done so:

    yogabook-gnss-import

Then enable and start the GNSS services:

    rc-update add yogabook-gnss default
    rc-update add gpsd-yogabook default

    rc-service yogabook-gnss start
    rc-service gpsd-yogabook start

Do not enable the standard gpsd service at the same time.

EOF

exit 0