Skip to content

Instantly share code, notes, and snippets.

@kvaps
Last active March 14, 2017 23:23
Show Gist options
  • Select an option

  • Save kvaps/40eae7531aa014f688fd2806eb934c2c to your computer and use it in GitHub Desktop.

Select an option

Save kvaps/40eae7531aa014f688fd2806eb934c2c to your computer and use it in GitHub Desktop.
Script for build beegfs-client module for specified kernel
#!/bin/bash
LAST_KERNEL="$(ls -1h /lib/modules | tail -n1)"
KERNEL="${1:-$LAST_KERNEL}"
function finish {
mv /opt/beegfs/src/client/beegfs_client_module_6/build/Makefile{.bak,}
mv /etc/beegfs/beegfs-client-autobuild.conf{.bak,}
}
trap finish EXIT
echo "Using: ${KERNEL}"
cp /etc/beegfs/beegfs-client-autobuild.conf{,.bak}
cp /opt/beegfs/src/client/beegfs_client_module_6/build/Makefile{,.bak}
sed -i \
-e '/^buildArgs=.*$/ s|$| KDIR="/lib/modules/'${KERNEL}'/build /usr/src/linux-headers-'${KERNEL}'"|g' \
-e 's|buildEnabled=.*|buildEnabled=true|g' \
/etc/beegfs/beegfs-client-autobuild.conf
sed -i '/depmod/ s|^|#|g' /opt/beegfs/src/client/beegfs_client_module_6/build/Makefile
/etc/init.d/beegfs-client rebuild
depmod ${KERNEL}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment