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
|
#! /bin/sh
set -e
if [ ! -e /etc/qcontrol.conf ]; then
if [ -e /proc/device-tree/model ]; then
device=$(cat /proc/device-tree/model)
else
device=$(grep "Hardware[[:space:]]*:" /proc/cpuinfo 2>/dev/null | \
head -n1 | sed "s/^[^:]*: //")
fi
case $device in
"QNAP TS-109/TS-209")
ln -s qcontrol/ts209.lua /etc/qcontrol.conf ;;
"QNAP TS-119/TS-219" | "QNAP TS219 family")
ln -s qcontrol/ts219.lua /etc/qcontrol.conf ;;
"QNAP TS-409")
ln -s qcontrol/ts409.lua /etc/qcontrol.conf ;;
"QNAP TS-41x" | "QNAP TS419 family")
ln -s qcontrol/ts41x.lua /etc/qcontrol.conf ;;
esac
fi
case "$1" in
configure)
# Ensures that a newly installed qcontrol.rules actually tags the
# device such that systemd sees it.
if which udevadm >/dev/null 2>&1; then
udevadm trigger --subsystem-match input --property-match ID_PATH=platform-gpio_keys
fi
if which update-initramfs >/dev/null 2>&1; then
update-initramfs -u
fi
;;
esac
#DEBHELPER#
|