-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathINSTALL
executable file
·76 lines (58 loc) · 2.43 KB
/
INSTALL
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
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
#!/bin/bash
# Some parts of this script should run with sudo, others not
if [[ $(id -u) -ne 0 ]] ; then echo "Please run as root" ; exit 1 ; fi
if [ -n "$SUDO_USER" ]; then
true_user=$SUDO_USER
nonroot_cmd="sudo -u $true_user "
else
true_user=$(whoami)
nonroot_cmd=""
fi
# unload the driver if it's already loaded
modprobe -r men_pldz002_cham
cd "$(dirname "$0")"
# keep things up to date
yum -y check-update
yum -y upgrade
yum -y groupinstall "Development Tools"
yum -y install kernel-devel
# check the kernel version
running_kernel=`uname -r`
last_installed_kernel=`rpm -q --qf '%{INSTALLTIME}\t%{Version}-%{Release}.%{Arch}\n' kernel | sort -n | tail -1 | cut -f 2`
echo "Running kernel $running_kernel"
echo "Last installed kernel $last_installed_kernel"
if [ $running_kernel != $last_installed_kernel ]; then
echo "Newer kernel installed, please uninstall or reboot"
exit 1
fi
# check for symlink in /usr/src to kernel headers -- not sure what would make this
# This link seems to be bad practice, but the drivers require it.
if [ "/usr/src/kernels/$running_kernel" != "`readlink /usr/src/linux`" ]; then
echo "Need symblic link from /usr/src/linux to /usr/src/kernels/$running_kernel"
if [ -e /usr/src/linux ]; then
echo "Deleting the existing link to `readlink /usr/src/linux`"
rm /usr/src/linux
fi
ln -s "/usr/src/kernels/$running_kernel" /usr/src/linux
echo "Made the link"
fi
echo "Update git submodules"
$nonroot_cmd git submodule update --init --recursive
echo "Done Updating git submodules"
echo "Install MEN MDIS for Linux System Package"
(cd 13MD05-90 && ./INSTALL -f)
echo "Done Installing MEN MDIS for Linux System Package"
echo "Install A25 drivers"
# it seems make needs to be run as root, for some reason.
(cd A25_files && make && make install && /opt/menlinux/DRIVERS/VME_16Z002/nodes.sh && echo "/usr/local/lib" > /etc/ld.so.conf.d/menlinux.conf && ldconfig)
(cd A25_files && make clean)
echo "Done Installing A25 drivers"
echo "Load VME Kernel Module at boot up"
echo "men_pldz002_cham" > /etc/modules-load.d/men_pldz002_cham.conf
echo 'ACTION=="add",SUBSYSTEM=="module",KERNEL=="men_pldz002_cham",RUN+="/opt/menlinux/DRIVERS/VME_16Z002/nodes.sh && chmod a+w /dev/vme4l_a* /dev/vme4l_cr_csr"' > /etc/udev/rules.d/99-vme4l_nodes.rules
echo "modules-load file written"
echo "Load VME Kernel driver now"
modprobe men_pldz002_cham
/opt/menlinux/DRIVERS/VME_16Z002/nodes.sh
echo "VME Kernel driver loaded"
echo "Install complete!"