3 # Script to detect AGL Reference Hardware and switch gpdf configuration
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
19 for c in `cat $COMPAT | tr '\0' ' '`; do
21 if echo $c | grep -q '^agl,refhw-h3$'; then
28 update-alternatives --install /etc/default/gpsd gpsd-defaults /etc/default/gpsd.refhw 20
30 update-alternatives --remove gpsd-defaults /etc/default/gpsd.refhw