2 # SPDX-License-Identifier: GPL-2.0
3 # Before running this script please ensure that your PATH is
4 # typical as you use for compilation/installation. I use
5 # /bin /sbin /usr/bin /usr/sbin /usr/local/bin, but it may
6 # differ on your system.
9 usage = "If some fields are empty or look unusual you may have an old version.\n"
10 usage = usage "Compare to the current minimal requirements in Documentation/Changes.\n"
16 vernum = "[0-9]+([.]?[0-9]+)+"
18 printversion("GNU C", version("gcc -dumpversion"))
19 printversion("GNU Make", version("make --version"))
20 printversion("Binutils", version("ld -v"))
21 printversion("Util-linux", version("mount --version"))
22 printversion("Mount", version("mount --version"))
23 printversion("Module-init-tools", version("depmod -V"))
24 printversion("E2fsprogs", version("tune2fs"))
25 printversion("Jfsutils", version("fsck.jfs -V"))
26 printversion("Reiserfsprogs", version("reiserfsck -V"))
27 printversion("Reiser4fsprogs", version("fsck.reiser4 -V"))
28 printversion("Xfsprogs", version("xfs_db -V"))
29 printversion("Pcmciautils", version("pccardctl -V"))
30 printversion("Pcmcia-cs", version("cardmgr -V"))
31 printversion("Quota-tools", version("quota -V"))
32 printversion("PPP", version("pppd --version"))
33 printversion("Isdn4k-utils", version("isdnctrl"))
34 printversion("Nfs-utils", version("showmount --version"))
36 while (getline <"/proc/self/maps" > 0) {
38 n = split($0, procmaps, "/")
39 if (match(procmaps[n], vernum)) {
40 ver = substr(procmaps[n], RSTART, RLENGTH)
41 printversion("Linux C Library", ver)
47 printversion("Dynamic linker (ldd)", version("ldd --version"))
49 while ("ldconfig -p 2>/dev/null" | getline > 0) {
50 if (/(libg|stdc)[+]+\.so/) {
55 printversion("Linux C++ Library", version("readlink " libcpp))
56 printversion("Procps", version("ps --version"))
57 printversion("Net-tools", version("ifconfig --version"))
58 printversion("Kbd", version("loadkeys -V"))
59 printversion("Console-tools", version("loadkeys -V"))
60 printversion("Oprofile", version("oprofiled --version"))
61 printversion("Sh-utils", version("expr --v"))
62 printversion("Udev", version("udevadm --version"))
63 printversion("Wireless-tools", version("iwconfig --version"))
65 while ("sort /proc/modules" | getline > 0) {
69 printversion("Modules Loaded", mods)
72 function version(cmd, ver) {
74 while (cmd | getline > 0) {
75 if (match($0, vernum)) {
76 ver = substr($0, RSTART, RLENGTH)
84 function printversion(name, value, ofmt) {
87 printf(ofmt, name, value)