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.

39 lines
841 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. add_uname_wrapper() {
  20. add_wrapper uname <<- EOT
  21. if [ "\$*" = "-r" ]; then
  22. echo "$kernelversion"
  23. exit 0
  24. fi
  25. exec \$orig "\$@"
  26. EOT
  27. }
  28. add_depmod_wrapper() {
  29. add_wrapper depmod <<- EOT
  30. exit 0
  31. EOT
  32. }
  33. kernelversion="$( getkernelversion )"