Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #!/bin/bash
- # Script to build the ISL29018 module
- # Modified for Arch Linux from ChrUbuntu's cros-haswell-modules.sh
- # Pedro Nariyoshi
- set -e
- # Create a temp directory for our work
- tempbuild=`mktemp -d`
- cd $tempbuild
- # Determine kernel version
- archkernver=$(uname -r)
- kernver=$(uname -r | cut -d'-' -f 1)
- # Install necessary deps to build a kernel
- echo "Installing linux-headers..."
- sudo pacman -S --needed linux-headers
- # Grab kernel source
- echo "Fetching kernel sources..."
- wget https://www.kernel.org/pub/linux/kernel/v4.x/linux-${kernver}.tar.gz
- echo "Extracting kernel sources..."
- tar xfvz linux-${kernver}.tar.gz
- cd linux-${kernver}
- # Need this
- cp /usr/lib/modules/${archkernver}/build/Module.symvers .
- # Prep tree
- zcat /proc/config.gz > ./.config
- make oldconfig
- echo CONFIG_SENSORS_ISL29018=m >> .config
- make prepare
- make modules_prepare
- echo "Building modules..."
- make SUBDIRS=drivers/staging/iio/light/ modules
- echo "Installing modules..."
- sudo mkdir -p /lib/modules/$archkernver/kernel/drivers/staging/iio/light/
- sudo cp drivers/staging/iio/light/isl29018.ko /lib/modules/$archkernver/kernel/drivers/staging/iio/light/
- sudo gzip /lib/modules/$archkernver/kernel/drivers/staging/iio/light/isl29018.ko
- sudo depmod -a $archkernver
- sudo modprobe isl29018
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement