Advertisement
Guest User

debian-peppy-touchpad.sh

a guest
Apr 19th, 2014
25
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Bash 1.60 KB | None | 0 0
  1. # Create a temporary directory
  2. tempbuild=`mktemp -d`
  3. cd $tempbuild
  4.  
  5. # Determine kernel version
  6. mykern=${1:-$(uname -r)}
  7.  
  8. # Install necessary packages
  9. sudo apt-get build-dep -y --no-install-recommends linux
  10.  
  11. # Download the kernel source
  12. sudo apt-get source linux
  13. cd linux*
  14.  
  15. if [ -f drivers/platform/x86/chromeos_laptop.c ]; then
  16.   platform_folder=x86
  17. elif [ -f drivers/platform/chrome/chromeos_laptop.c ]; then
  18.   platform_folder=chrome
  19. fi
  20.  
  21. # Use Benson Leung's patches:
  22. # https://patchwork.kernel.org/bundle/bleung/chromeos-laptop-deferring-and-haswell/
  23. for patch in 3078491 3078481 3074391 3074441 3074421 3074401 3074431 3074411; do
  24.   wget -O - https://patchwork.kernel.org/patch/$patch/raw/ \
  25.   | sed "s/drivers\/platform\/x86\/chromeos_laptop.c/drivers\/platform\/$platform_folder\/chromeos_laptop.c/g" \
  26.   | sudo patch -p1
  27. done
  28.  
  29. # Need this
  30. sudo cp /usr/src/linux-headers-$mykern/Module.symvers .
  31.  
  32. # Prepare tree
  33. sudo cp /boot/config-$mykern ./.config
  34. sudo make oldconfig
  35. sudo make prepare
  36. sudo make modules_prepare
  37.  
  38. # Build only the needed directories
  39. sudo make SUBDIRS=drivers/platform/$platform_folder modules
  40. sudo make SUBDIRS=drivers/i2c/busses modules
  41.  
  42. # Switch to using our new chromeos_laptop.ko module
  43. sudo cp drivers/platform/$platform_folder/chromeos_laptop.ko /lib/modules/$mykern/kernel/drivers/platform/$platform_folder/
  44.  
  45. # Switch to using our new designware i2c modules
  46. sudo cp drivers/i2c/busses/i2c-designware-*.ko /lib/modules/$mykern/kernel/drivers/i2c/busses/
  47. sudo depmod -a $mykern
  48.  
  49. echo "Finished building Chromebook modules in $tempbuild. Reboot to use them."
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement