mirror of the now-defunct rocklinux.org
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

23 lines
628 B

  1. # Older function from pcmcia-cs.conf
  2. #
  3. # get_kernel_modules_version() {
  4. # ls -d $root/lib/modules/[0-9]*.[0-9]*.[0-9]*/ | cut -f4 -d/ |
  5. # while read x ; do
  6. # x=${x//./)*1000+} ; y=${x//[^)]/}
  7. # echo $(( ${y//)/(}$x )) $x
  8. # done | sort -n | while read y x ; do
  9. # echo ${x//)\\*1000+/.}
  10. # done | tail -n 1
  11. # }
  12. getkernelversion() {
  13. if [ -f $root/usr/src/linux/Makefile ]; then
  14. make -s -C $root/usr/src/linux -f <( echo -e 'include Makefile\nprintversion:\n\t@echo $(KERNELRELEASE)' ) printversion
  15. else
  16. uname -r
  17. fi
  18. }
  19. kernelversion="$( getkernelversion )"