Advertisement
nariox

ISL29018 build script

Sep 23rd, 2015
237
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Bash 1.29 KB | None | 0 0
  1. #!/bin/bash
  2. # Script to build the ISL29018 module
  3. # Modified for Arch Linux from ChrUbuntu's cros-haswell-modules.sh
  4. # Pedro Nariyoshi
  5.  
  6. set -e
  7.  
  8. # Create a temp directory for our work
  9. tempbuild=`mktemp -d`
  10. cd $tempbuild
  11.  
  12. # Determine kernel version
  13. archkernver=$(uname -r)
  14. kernver=$(uname -r | cut -d'-' -f 1)
  15.  
  16. # Install necessary deps to build a kernel
  17. echo "Installing linux-headers..."
  18. sudo pacman -S --needed linux-headers
  19.  
  20. # Grab kernel source
  21. echo "Fetching kernel sources..."
  22. wget https://www.kernel.org/pub/linux/kernel/v4.x/linux-${kernver}.tar.gz
  23. echo "Extracting kernel sources..."
  24. tar xfvz linux-${kernver}.tar.gz
  25. cd linux-${kernver}
  26.  
  27. # Need this
  28. cp /usr/lib/modules/${archkernver}/build/Module.symvers .
  29.  
  30. # Prep tree
  31. zcat /proc/config.gz > ./.config
  32. make oldconfig
  33. echo CONFIG_SENSORS_ISL29018=m >> .config
  34. make prepare
  35. make modules_prepare
  36.  
  37. echo "Building modules..."
  38. make SUBDIRS=drivers/staging/iio/light/ modules
  39.  
  40. echo "Installing modules..."
  41. sudo mkdir -p /lib/modules/$archkernver/kernel/drivers/staging/iio/light/
  42. sudo cp drivers/staging/iio/light/isl29018.ko /lib/modules/$archkernver/kernel/drivers/staging/iio/light/
  43. sudo gzip /lib/modules/$archkernver/kernel/drivers/staging/iio/light/isl29018.ko
  44.  
  45. sudo depmod -a $archkernver
  46. sudo modprobe isl29018
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement