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