forked from atar-axis/xpadneo
-
Notifications
You must be signed in to change notification settings - Fork 2
/
install.sh
executable file
·32 lines (20 loc) · 866 Bytes
/
install.sh
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
#!/bin/bash -e
cd "$(dirname "$0")" || exit 1
source "lib/verbose.sh"
source "lib/installer.sh"
if [[ ! -d /sys/devices/virtual/misc/uhid ]]; then
>&2 echo "WARNING: kernel uhid module not found, controller firmware 5.x will not be supported"
fi
if [[ -z "${INSTALLED[*]}" ]]; then
set -e
echo "* creating dkms.conf"
sed 's/"@DO_NOT_CHANGE@"/"'"${VERSION}"'"/g' <hid-xpadneo/dkms.conf.in >hid-xpadneo/dkms.conf
# TODO: Works around https://github.com/dell/dkms/issues/177 for DKMS 3
echo "* adding hid-xpadneo-${VERSION} folder to /usr/src"
mkdir -p "/usr/src/hid-xpadneo-${VERSION}"
cp --recursive "${V[@]}" hid-xpadneo/. "/usr/src/hid-xpadneo-${VERSION}/."
echo "* installing module (using DKMS)"
dkms install "${V[*]}" "hid-xpadneo/${VERSION}" --force || cat_dkms_make_log
else
echo "already installed!"
fi