/usr/lib/freedombox/machine-detect is in freedombox-setup 0.8ubuntu1.
This file is owned by root:root, with mode 0o755.
The actual contents of the file can be viewed below.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 | #!/bin/sh
#
# Exports the currently-detected hardware to MACHINE.
#
# Return true if the MACHINE was detected, and false otherwise.
#
# Currently look in /sys/devices for indicators.
#
# Other possibilities:
#
# echo $(cat /proc/device-tree/model)
# Globalscale Technologies Dreamplug
MACHINE=""
case $(dpkg --print-architecture) in
armel)
# Matches these:
# /sys/devices/gpio-leds.1/leds/dreamplug:blue:bluetooth
# /sys/devices/gpio-leds.1/leds/dreamplug:green:wifi_ap
# /sys/devices/gpio-leds.1/leds/dreamplug:green:wifi
if find /sys/devices -name 'dreamplug:*' | grep -q dreamplug: ; then
MACHINE=dreamplug
fi
# Matches these:
# /sys/devices/leds.7/leds/beaglebone:green:heartbeat
# /sys/devices/leds.7/leds/beaglebone:green:mmc0
# /sys/devices/leds.7/leds/beaglebone:green:usr2
# /sys/devices/leds.7/leds/beaglebone:green:usr3
if find /sys/devices -name 'beaglebone:*' | grep -q beaglebone: ; then
MACHINE=beaglebone
fi
;;
armhf)
# Matches these:
# /sys/devices/leds.7/leds/beaglebone:green:heartbeat
# /sys/devices/leds.7/leds/beaglebone:green:mmc0
# /sys/devices/leds.7/leds/beaglebone:green:usr2
# /sys/devices/leds.7/leds/beaglebone:green:usr3
if find /sys/devices -name 'beaglebone:*' | grep -q beaglebone: ; then
MACHINE=beaglebone
fi
;;
esac
export MACHINE
if [ -n "$MACHINE" ]
then
return 0
fi
return 1
|