#!/bin/bash -e # install_linuxwacom ver 1.1 # # This script installs the linuxwacom driver for wacom tablets # # Last updated: Sep 21, 2008 # Kristi Tsukida # check ubuntu version ubuntu_ver=$(lsb_release -a 2>/dev/null| grep "^Release" | awk '{print $2}') if [ $ubuntu_ver != "8.10" ] ; then echo "Your Ubuntu version: $ubuntu_ver" echo "Warning: This script was written for Ubuntu 8.10 Intrepid." echo " Driver installation may not work on other Ubuntu releases." echo " Continue installation anyway? [y/N]" read input if [ "$input" == "y" ] || [ "$input" == "Y" ] ; then echo "Continuing linuxwacom installation." echo "" else exit fi fi # check for previous tarball download if [ -e linuxwacom-0.8.1-4.tar.bz2 ] ; then echo "Found existing linuxwacom-0.8.1-4.tar.bz2" echo "Delete this and re-download the file? (Else existing tarball will be used) [y/N]" read input if [ "$input" == "y" ] || [ "$input" == "Y" ] ; then # delete previous tarball rm linuxwacom-0.8.1-4.tar.bz2 # download the tarball wget -nd http://prdownloads.sourceforge.net/linuxwacom/linuxwacom-0.8.1-4.tar.bz2 fi else # download the tarball wget -nd http://prdownloads.sourceforge.net/linuxwacom/linuxwacom-0.8.1-4.tar.bz2 fi # install dependencies echo "Installing dependencies. (You may be prompted for your password)" sudo apt-get update sudo apt-get install linux-headers-$(uname -r) build-essential x11proto-core-dev libxau-dev libxdmcp-dev x11proto-input-dev x11proto-kb-dev xtrans-dev libx11-dev x11proto-xext-dev libxext-dev libxi-dev linux-libc-dev libc6-dev libncurses5-dev xserver-xorg-dev tk-dev tcl-dev -y echo "Finished installing dependencies." echo "" # extract tar xjvf linuxwacom-0.8.1-4.tar.bz2 cd linuxwacom-0.8.1-4 # X crashing fix sed -i -e '381s/WCM_UNINIT_CALLED/WCM_XORG_XSERVER_1_4/' src/xdrv/wcmConfig.c # compile ./configure --enable-wacom make echo "Finished compiling linuxwacom driver." echo "" # install driver echo "Installing driver files. (You may be prompted for your password)" sudo make install echo "Finished installing linuxwacom driver." echo "" # install kernel module echo "Installing linuxwacom kernel module. (You may be prompted for your password)" if [ -f src/2.6.26/wacom.ko ] ; then # backup old kernel module cp --backup=numbered /lib/modules/$(uname -r)/kernel/drivers/input/tablet/wacom.ko wacom.ko.$(uname -r) sudo cp src/2.6.26/wacom.ko /lib/modules/$(uname -r)/kernel/drivers/input/tablet/wacom.ko else # if the kernel was compatible, the make would have compiled the 2.6.26 driver echo "Warning: Your kernel version $(uname -r) is not compatible with" echo " the 2.6.26 linuxwacom kernel module." # see if a differrent version was compiled module=$(find src -name wacom.ko) if [ -f "$module" ] ; then echo "Attempt to install $module? [y/N]" read input if [ "$input" == "y" ] || [ "$input" == "Y" ] ; then cp --backup=numbered /lib/modules/$(uname -r)/kernel/drivers/input/tablet/wacom.ko wacom.ko.$(uname -r) sudo cp "$module" /lib/modules/$(uname -r)/kernel/drivers/input/tablet/wacom.ko fi else echo "Incomplete linuxwacom installation. Exiting." exit 1 fi fi # reload the wacom kernel module sudo rmmod wacom sudo modprobe wacom echo "Finished installing linuxwacom kernel module." echo "" echo "linuxwacom driver (0.8.1-4) installation complete."