From 950a1ded1b859c1644e781d0c5cfb55cb4f9b301 Mon Sep 17 00:00:00 2001 From: Nicolas Chauvet Date: Nov 05 2018 13:45:31 +0000 Subject: Avoid using /usr/lib/modules for el6 compat --- diff --git a/akmods b/akmods index 3c3b8b5..cc57497 100644 --- a/akmods +++ b/akmods @@ -321,17 +321,17 @@ check_kmod_up2date() local this_kmodname=${2} # kmod present? - if [[ ! -d /usr/lib/modules/${this_kernelver}/extra/${this_kmodname}/ ]] ; then + if [[ ! -d /lib/modules/${this_kernelver}/extra/${this_kmodname}/ ]] ; then # build it return 1 fi # kmod up2date? - local kmodpackage="$(rpm -qf /usr/lib/modules/${this_kernelver}/extra/${this_kmodname}/ 2> /dev/null)" + local kmodpackage="$(rpm -qf /lib/modules/${this_kernelver}/extra/${this_kmodname}/ 2> /dev/null)" if [[ ! "${kmodpackage}" ]]; then # seems we didn't get what we wanted # well, better to do nothing in this case - akmods_echo 1 2 -n "Warning: Could not determine what package owns /usr/lib/modules/${this_kernelver}/extra/${this_kmodname}/" + akmods_echo 1 2 -n "Warning: Could not determine what package owns /lib/modules/${this_kernelver}/extra/${this_kmodname}/" return 0 fi local kmodver=$(rpm -q --qf '%{EPOCH}:%{VERSION}-%{RELEASE}\n' "${kmodpackage}" | sed 's|(none)|0|; s!\.\(fc\|lvn\)[0-9]*!!g') @@ -381,12 +381,12 @@ check_kmods() akmods_echo 1 2 --success # if the files for building modules are not available don't even try to build modules if [[ ! -r /usr/src/kernels/"${this_kernelver}"/Makefile ]] && \ - [[ ! -r /usr/lib/modules/${this_kernelver}/build/Makefile ]]; then + [[ ! -r /lib/modules/${this_kernelver}/build/Makefile ]]; then akmods_echo 1 2 "Files needed for building modules against kernel" akmods_echo 1 2 "${this_kernelver} could not be found as the following" akmods_echo 1 2 "directories are missing:" akmods_echo 1 2 "/usr/src/kernels/${this_kernelver}/" - akmods_echo 1 2 -n "/usr/lib/modules/${this_kernelver}/build/" + akmods_echo 1 2 -n "/lib/modules/${this_kernelver}/build/" akmods_echo 1 2 -n "Is the correct kernel-devel package installed?" akmods_echo 1 2 --failure return 1 @@ -456,7 +456,7 @@ while [ "${1}" ] ; do echo "ERROR: Please provide the kernel-version to build for together with --kernel" >&2 exit 1 elif [[ ! -r /usr/src/kernels/"${1}"/Makefile ]] && \ - [[ ! -r /usr/lib/modules/${1}/build/Makefile ]]; then + [[ ! -r /lib/modules/${1}/build/Makefile ]]; then echo "Could not find files needed to compile modules for ${1}" echo "Are the development files for kernel ${1} or the appropriate kernel-devel package installed?" exit 1