ver_linux 3.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125
  1. #!/bin/sh
  2. # Before running this script please ensure that your PATH is
  3. # typical as you use for compilation/istallation. I use
  4. # /bin /sbin /usr/bin /usr/sbin /usr/local/bin, but it may
  5. # differ on your system.
  6. #
  7. echo 'If some fields are empty or look unusual you may have an old version.'
  8. echo 'Compare to the current minimal requirements in Documentation/Changes.'
  9. echo ' '
  10. uname -a
  11. echo ' '
  12. gcc -dumpversion 2>&1 |
  13. awk '/[0-9]+([.]?[0-9]+)+/ && !/not found$/{
  14. match($0, /[0-9]+([.]?[0-9]+)+/)
  15. printf("GNU C\t\t\t%s\n",
  16. substr($0,RSTART,RLENGTH))
  17. }'
  18. make --version 2>&1 |
  19. awk '/GNU Make/{
  20. match($0, /[0-9]+([.]?[0-9]+)+/)
  21. printf("GNU Make\t\t%s\n",
  22. substr($0,RSTART,RLENGTH))
  23. }'
  24. ld -v 2>&1 |
  25. awk '/[0-9]+([.]?[0-9]+)+/ && !/not found$/{
  26. match($0, /[0-9]+([.]?[0-9]+)+/)
  27. printf("Binutils\t\t%s\n",
  28. substr($0,RSTART,RLENGTH))
  29. }'
  30. mount --version 2>&1 |
  31. awk '/[0-9]+([.]?[0-9]+)+/ && !/not found$/{
  32. match($0, /[0-9]+([.]?[0-9]+)+/)
  33. $0 = substr($0,RSTART,RLENGTH)
  34. printf("Util-linux\t\t%s\nMount\t\t\t%s\n",$0,$0)
  35. }'
  36. depmod -V 2>&1 |
  37. awk '/[0-9]+([.]?[0-9]+)+/ && !/not found$/{
  38. match($0, /[0-9]+([.]?[0-9]+)+/)
  39. printf("Module-init-tools\t%s\n",
  40. substr($0,RSTART,RLENGTH))
  41. }'
  42. tune2fs 2>&1 |
  43. awk '/^tune2fs/{
  44. match($0, /[0-9]+([.]?[0-9]+)+/)
  45. printf("E2fsprogs\t\t%s\n",
  46. substr($0,RSTART,RLENGTH))
  47. }'
  48. fsck.jfs -V 2>&1 |
  49. awk '/version/{
  50. match($0, /[0-9]+([.]?[0-9]+)+/)
  51. printf("Jfsutils\t\t%s\n",
  52. substr($0,RSTART,RLENGTH))
  53. }'
  54. reiserfsck -V 2>&1 | grep ^reiserfsck | awk \
  55. 'NR==1{print "reiserfsprogs ", $2}'
  56. fsck.reiser4 -V 2>&1 | grep ^fsck.reiser4 | awk \
  57. 'NR==1{print "reiser4progs ", $2}'
  58. xfs_db -V 2>&1 | grep version | awk \
  59. 'NR==1{print "xfsprogs ", $3}'
  60. pccardctl -V 2>&1| grep pcmciautils | awk '{print "pcmciautils ", $2}'
  61. cardmgr -V 2>&1| grep version | awk \
  62. 'NR==1{print "pcmcia-cs ", $3}'
  63. quota -V 2>&1 | grep version | awk \
  64. 'NR==1{print "quota-tools ", $NF}'
  65. pppd --version 2>&1| grep version | awk \
  66. 'NR==1{print "PPP ", $3}'
  67. isdnctrl 2>&1 | grep version | awk \
  68. 'NR==1{print "isdn4k-utils ", $NF}'
  69. showmount --version 2>&1 | grep nfs-utils | awk \
  70. 'NR==1{print "nfs-utils ", $NF}'
  71. echo -n "Linux C Library "
  72. sed -n -e '/^.*\/libc-\([^/]*\)\.so$/{s//\1/;p;q}' < /proc/self/maps
  73. ldd -v > /dev/null 2>&1 && ldd -v || ldd --version |head -n 1 | awk \
  74. 'NR==1{print "Dynamic linker (ldd) ", $NF}'
  75. ls -l /usr/lib/libg++.so /usr/lib/libstdc++.so 2>/dev/null | awk -F. \
  76. '{print "Linux C++ Library " $4"."$5"."$6}'
  77. ps --version 2>&1 | grep version | awk \
  78. 'NR==1{print "Procps ", $NF}'
  79. ifconfig --version 2>&1 | grep tools | awk \
  80. 'NR==1{print "Net-tools ", $NF}'
  81. # Kbd needs 'loadkeys -h',
  82. loadkeys -h 2>&1 | awk \
  83. '(NR==1 && ($3 !~ /option/)) {print "Kbd ", $3}'
  84. # while console-tools needs 'loadkeys -V'.
  85. loadkeys -V 2>&1 | awk \
  86. '(NR==1 && ($2 ~ /console-tools/)) {print "Console-tools ", $3}'
  87. oprofiled --version 2>&1 | awk \
  88. '(NR==1 && ($2 == "oprofile")) {print "oprofile ", $3}'
  89. expr --v 2>&1 | awk 'NR==1{print "Sh-utils ", $NF}'
  90. udevinfo -V 2>&1 | grep version | awk '{print "udev ", $3}'
  91. iwconfig --version 2>&1 | awk \
  92. '(NR==1 && ($3 == "version")) {print "wireless-tools ",$4}'
  93. if [ -e /proc/modules ]; then
  94. X=`cat /proc/modules | sed -e "s/ .*$//"`
  95. echo "Modules Loaded "$X
  96. fi