3 # Script to detect AGL Reference Hardware and switch gpsd
4 # configuration as necessary.
7 # For the most part errors are ignored and the script returns
8 # 0/success so gpsd still be started if the script is somehow
9 # run on a board without the expected hardware.
11 COMPAT=/sys/firmware/devicetree/base/compatible
14 #if [ ! \( -f "$COMPAT" -a -c "$GPSTTY" -a -f /etc/default/gpsd.refhw \) ]; then
15 if [ ! \( -f "$COMPAT" -a -f /etc/default/gpsd.refhw \) ]; then
20 for c in `cat $COMPAT | tr '\0' ' '`; do
21 if echo $c | grep -q '^agl,refhw-h3$'; then
28 if [ ! -c "$GPSTTY" ]; then
31 update-alternatives --install /etc/default/gpsd gpsd-defaults /etc/default/gpsd.refhw 20
33 update-alternatives --install /etc/default/gpsd gpsd-defaults /etc/default/gpsd.refhw 5