Building dkms modules for3.10.33-1-lts kernel... Error! echo Your kernel headers for kernel 3.10.33-1-lts cannot be found at /usr/lib/modules/3.10.33-1-lts/buildor /usr/lib/modules/3.10.33-1-lts/source. Error! echo Your kernel headers for kernel 3.10.33-1-lts cannot be found at /usr/lib/modules/3.10.33-1-lts/buildor /usr/lib/modules/3.10.33-1-lts/source. Build complete.
但是一般升级的时候都是先装内核再装 headers 所以脚本可以完善下:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16
build () { if [ ! -d "/usr/lib/modules/${KERNELVERSION}/build" ]; then echo"You need to install or update ${KERNELVERSION} headers before build kernel image." exit 1 fi echo"Building dkms modules for ${KERNELVERSION} kernel..." dkms autoinstall -k ${KERNELVERSION} echo"Build complete." }
help () { cat<<HELPEOF This hook rebuilds all dkms modules for new kernel. HELPEOF