Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #!/bin/bash
- #################################################################
- # USBIP (sdileni USB po siti) na Ubuntu 12.04 s jadrem 3.2.0
- #
- # http://usbip.sourceforge.net/
- # skript je upravena verze https://bugs.launchpad.net/ubuntu/+source/linux/+bug/900384/comments/10
- #################################################################
- sudo -s
- # Requires a linux kernel higher than 3.2.0-22.25
- # Determine the current kernel version and relevant directories
- kernelver=`uname -r | cut -d '-' -f 1`
- builddir=~/build/
- kernelloc=drivers/staging/usbip/userspace/
- # Setting up the build directory
- if [ -d ${builddir} ]
- then
- echo "E: Directory ${buiddir} would be used for building but already exists."
- echo " Please remove this directory in order to build cleanly."
- exit 1
- fi
- mkdir -p ${builddir}
- # Getting the source code into the build directory
- sudo apt-get install linux-source-${kernelver}
- tar -x -f /usr/src/linux-source-${kernelver}.tar.bz2 -C ${builddir}
- cd ${builddir}/linux-source-${kernelver}
- # Install required packages for building
- sudo apt-get install sysfsutils libwrap0-dev gcc libglib2.0-dev libtool automake autoconf pkg-config libsysfs-dev
- # Do the actual build
- cd ${kernelloc}
- ./autogen.sh
- ./configure --with-usbids-dir=/usr/share/misc/
- sudo make install
- # Create a soft-link so the client space tools find the libraries
- sudo ln -s /usr/local/lib/libusbip.so.0 /usr/lib/libusbip.so.0.0.1
- sudo ln -s /usr/local/lib/libusbip.so.0 /usr/lib/libusbip.so.0
- sudo echo "usbip-core" >> /etc/modules
- sudo echo "usbip-host" >> /etc/modules
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement