#!/bin/bash
echo "remove other libdrm/libva"
find /usr -name "libdrm*" | xargs rm -rf
find /usr -name "libva*" | xargs rm -rf
echo "Remove old MSS install files ..."
rm -rf /opt/intel/mediasdk
rm -rf /opt/intel/common
rm -rf /opt/intel/opencl
echo "install user mode components"
#unpack the generic package
tar -xvzf intel-linux*.tar.gz
#put the generic components in standard locations
/bin/cp -r etc/* /etc
/bin/cp -r opt/* /opt
/bin/cp -r usr/* /usr
#ensure that new libraries can be found
echo '/usr/lib64' > /etc/ld.so.conf.d/libdrm_intel.conf
echo '/usr/local/lib' » /etc/ld.so.conf.d/libdrm_intel.conf
ldconfig
echo "install kernel build dependencies"
apt-get -y install git fakeroot build-essential ncurses-dev xz-utils libssl-dev bc g++
echo "download 3.14.5 kernel"
if [ ! -f ./linux-3.14.5.tar.xz ]; then
wget
https://www.kernel.org/pub/linux/kernel/v3.x/linux-3.14.5.tar.xz
fi
tar -xJf linux-3.14.5.tar.xz
echo "apply kernel patches"
cp /opt/intel/mediasdk/opensource/patches/kmd/3.14.5/intel-kernel-patches.tar.bz2 .
tar -xvjf intel-kernel-patches.tar.bz2
cd linux-3.14.5
for i in ../intel-kernel-patches/*.patch; do patch -p1 < $i; done
echo "build patched 3.14.5 kernel"
make olddefconfig
make -j 8
make modules_install
make install
echo "Install finished, please "
echo "1. update LD_LIBRARY_PATH to include /usr/lib64;/usr/local/lib"
echo "2. add user to video group: usermod -a -G video user"
echo "3. reboot"