-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathdkms_install.sh
More file actions
executable file
·34 lines (29 loc) · 1.3 KB
/
dkms_install.sh
File metadata and controls
executable file
·34 lines (29 loc) · 1.3 KB
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
# -----------------------------------------------------------------------------
# Batch script to install cronologic linux PCI driver for DKMS
# -----------------------------------------------------------------------------
#
# PLEASE DO NOT RUN "DIRECTLY" FROM COMMAND LINE
# ONLY USE `dkms install .`
#
# Prerequisites:
# - If called from DKMS, e.g. in the POST_INSTALL, someone (mainly Makefile)
# should save DKMS KERNELRELEASE value to file `crono_dkms_kver`, so the
# script reads it and passes it to `install.sh`.
#
printf "Crono: installing cronologic PCI kernel module...\n"
# Get pwd, supposed to be /var/lib/dkms/crono_pci_drvmod/<version>/source
CRONO_PWD=$(pwd)
# `crono_dkms_kver` should have been created using our Makefile,
# on /var/lib/dkms/crono_pci_drvmod/<version>/ with the DKMS kernel version.
cd ..
if [ ! -f crono_dkms_kver ]; then
printf "Crono: Error, file 'crono_dkms_kver' is not found on $(pwd). Module can't be installed.\n"
exit 1
fi
# export `CRONO_DKMS_KERNELRELEASE` to inform `install.sh` with the DKMS target
# kernel version
export CRONO_DKMS_KERNELRELEASE="`cat crono_dkms_kver`"
printf "Crono: installing kernel module for DKMS kernel version [$CRONO_DKMS_KERNELRELEASE]\n"
# `install.sh` is on `source`
cd source
bash ./install.sh