Advertisement
tuxmartin

USBIP (sdileni USB po siti) na Ubuntu 12.04 s jadrem 3.2.0

Apr 19th, 2013
113
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Bash 1.59 KB | None | 0 0
  1. #!/bin/bash
  2.  
  3. #################################################################
  4. # USBIP (sdileni USB po siti) na Ubuntu 12.04 s jadrem 3.2.0
  5. #
  6. # http://usbip.sourceforge.net/
  7. # skript je upravena verze https://bugs.launchpad.net/ubuntu/+source/linux/+bug/900384/comments/10
  8. #################################################################
  9.  
  10. sudo -s
  11.  
  12. # Requires a linux kernel higher than 3.2.0-22.25
  13.  
  14. # Determine the current kernel version and relevant directories
  15. kernelver=`uname -r | cut -d '-' -f 1`
  16. builddir=~/build/
  17. kernelloc=drivers/staging/usbip/userspace/
  18.  
  19. # Setting up the build directory
  20. if [ -d ${builddir} ]
  21. then
  22.         echo "E: Directory ${buiddir} would be used for building but already exists."
  23.         echo "   Please remove this directory in order to build cleanly."
  24.         exit 1
  25. fi
  26.  
  27. mkdir -p ${builddir}
  28.  
  29. # Getting the source code into the build directory
  30. sudo apt-get install linux-source-${kernelver}
  31. tar -x -f /usr/src/linux-source-${kernelver}.tar.bz2 -C ${builddir}
  32. cd ${builddir}/linux-source-${kernelver}
  33.  
  34. # Install required packages for building
  35. sudo apt-get install sysfsutils libwrap0-dev gcc libglib2.0-dev libtool automake autoconf pkg-config libsysfs-dev
  36.  
  37. # Do the actual build
  38. cd ${kernelloc}
  39. ./autogen.sh
  40. ./configure --with-usbids-dir=/usr/share/misc/
  41. sudo make install
  42.  
  43. # Create a soft-link so the client space tools find the libraries
  44. sudo ln -s /usr/local/lib/libusbip.so.0 /usr/lib/libusbip.so.0.0.1
  45. sudo ln -s /usr/local/lib/libusbip.so.0 /usr/lib/libusbip.so.0
  46.  
  47. sudo echo "usbip-core" >> /etc/modules
  48. sudo echo "usbip-host" >> /etc/modules
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement