ver_linux: util-linux, 'fdformat' not ubiquitous any longer
[cascardo/linux.git] / scripts / ver_linux
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
11 uname -a
12 echo ' '
13
14 gcc -dumpversion 2>&1 |
15 awk '/[0-9]+([.]?[0-9]+)+/ && !/not found$/{
16         match($0, /[0-9]+([.]?[0-9]+)+/)
17         printf("GNU C\t\t\t%s\n",
18         substr($0,RSTART,RLENGTH))
19 }'
20
21 make --version 2>&1 |
22 awk '/GNU Make/{
23         match($0, /[0-9]+([.]?[0-9]+)+/)
24         printf("GNU Make\t\t%s\n",
25         substr($0,RSTART,RLENGTH))
26 }'
27
28 ld -v 2>&1 |
29 awk '/[0-9]+([.]?[0-9]+)+/ && !/not found$/{
30         match($0, /[0-9]+([.]?[0-9]+)+/)
31         printf("Binutils\t\t%s\n",
32         substr($0,RSTART,RLENGTH))
33 }'
34
35 mount --version 2>&1 |
36 awk '/[0-9]+([.]?[0-9]+)+/ && !/not found$/{
37         match($0, /[0-9]+([.]?[0-9]+)+/)
38         $0 = substr($0,RSTART,RLENGTH)
39         printf("Util-linux\t\t%s\nMount\t\t\t%s\n",$0,$0)
40 }'
41
42 depmod -V  2>&1 | awk 'NR==1 {print "module-init-tools     ",$NF}'
43
44 tune2fs 2>&1 | grep "^tune2fs" | sed 's/,//' |  awk \
45 'NR==1 {print "e2fsprogs             ", $2}'
46
47 fsck.jfs -V 2>&1 | grep version | sed 's/,//' |  awk \
48 'NR==1 {print "jfsutils              ", $3}'
49
50 reiserfsck -V 2>&1 | grep ^reiserfsck | awk \
51 'NR==1{print "reiserfsprogs         ", $2}'
52
53 fsck.reiser4 -V 2>&1 | grep ^fsck.reiser4 | awk \
54 'NR==1{print "reiser4progs          ", $2}'
55
56 xfs_db -V 2>&1 | grep version | awk \
57 'NR==1{print "xfsprogs              ", $3}'
58
59 pccardctl -V 2>&1| grep pcmciautils | awk '{print "pcmciautils           ", $2}'
60
61 cardmgr -V 2>&1| grep version | awk \
62 'NR==1{print "pcmcia-cs             ", $3}'
63
64 quota -V 2>&1 | grep version | awk \
65 'NR==1{print "quota-tools           ", $NF}'
66
67 pppd --version 2>&1| grep version | awk \
68 'NR==1{print "PPP                   ", $3}'
69
70 isdnctrl 2>&1 | grep version | awk \
71 'NR==1{print "isdn4k-utils          ", $NF}'
72
73 showmount --version 2>&1 | grep nfs-utils | awk \
74 'NR==1{print "nfs-utils             ", $NF}'
75
76 echo -n "Linux C Library        "
77 sed -n -e '/^.*\/libc-\([^/]*\)\.so$/{s//\1/;p;q}' < /proc/self/maps
78
79 ldd -v > /dev/null 2>&1 && ldd -v || ldd --version |head -n 1 | awk \
80 'NR==1{print "Dynamic linker (ldd)  ", $NF}'
81
82 ls -l /usr/lib/libg++.so /usr/lib/libstdc++.so  2>/dev/null | awk -F. \
83        '{print "Linux C++ Library      " $4"."$5"."$6}'
84
85 ps --version 2>&1 | grep version | awk \
86 'NR==1{print "Procps                ", $NF}'
87
88 ifconfig --version 2>&1 | grep tools | awk \
89 'NR==1{print "Net-tools             ", $NF}'
90
91 # Kbd needs 'loadkeys -h',
92 loadkeys -h 2>&1 | awk \
93 '(NR==1 && ($3 !~ /option/)) {print "Kbd                   ", $3}'
94
95 # while console-tools needs 'loadkeys -V'.
96 loadkeys -V 2>&1 | awk \
97 '(NR==1 && ($2 ~ /console-tools/)) {print "Console-tools         ", $3}'
98
99 oprofiled --version 2>&1 | awk \
100 '(NR==1 && ($2 == "oprofile")) {print "oprofile              ", $3}'
101
102 expr --v 2>&1 | awk 'NR==1{print "Sh-utils              ", $NF}'
103
104 udevinfo -V 2>&1 | grep version | awk '{print "udev                  ", $3}'
105
106 iwconfig --version 2>&1 | awk \
107 '(NR==1 && ($3 == "version")) {print "wireless-tools        ",$4}'
108
109 if [ -e /proc/modules ]; then
110     X=`cat /proc/modules | sed -e "s/ .*$//"`
111     echo "Modules Loaded         "$X
112 fi