]>
Commit | Line | Data |
---|---|---|
8af11c1c | 1 | #!/usr/bin/awk -f |
b2441318 | 2 | # SPDX-License-Identifier: GPL-2.0 |
2d187d58 AK |
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. | |
7 | ||
8 | BEGIN { | |
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" | |
11 | print usage | |
12 | ||
13 | system("uname -a") | |
14 | printf("\n") | |
15 | ||
2ca46ed2 AK |
16 | vernum = "[0-9]+([.]?[0-9]+)+" |
17 | ||
4169bc43 AK |
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")) | |
faade961 BC |
35 | printversion("Bison", version("bison --version")) |
36 | printversion("Flex", version("flex --version")) | |
2d187d58 | 37 | |
1c9a4be5 | 38 | while (getline <"/proc/self/maps" > 0) { |
34fe3cfd AK |
39 | if (/libc.*\.so$/) { |
40 | n = split($0, procmaps, "/") | |
2ca46ed2 | 41 | if (match(procmaps[n], vernum)) { |
34fe3cfd AK |
42 | ver = substr(procmaps[n], RSTART, RLENGTH) |
43 | printversion("Linux C Library", ver) | |
44 | break | |
45 | } | |
2d187d58 AK |
46 | } |
47 | } | |
48 | ||
4169bc43 | 49 | printversion("Dynamic linker (ldd)", version("ldd --version")) |
2d187d58 AK |
50 | |
51 | while ("ldconfig -p 2>/dev/null" | getline > 0) { | |
52 | if (/(libg|stdc)[+]+\.so/) { | |
53 | libcpp = $NF | |
54 | break | |
55 | } | |
56 | } | |
1c9a4be5 | 57 | printversion("Linux C++ Library", version("readlink " libcpp)) |
4169bc43 AK |
58 | printversion("Procps", version("ps --version")) |
59 | printversion("Net-tools", version("ifconfig --version")) | |
60 | printversion("Kbd", version("loadkeys -V")) | |
61 | printversion("Console-tools", version("loadkeys -V")) | |
62 | printversion("Oprofile", version("oprofiled --version")) | |
63 | printversion("Sh-utils", version("expr --v")) | |
64 | printversion("Udev", version("udevadm --version")) | |
65 | printversion("Wireless-tools", version("iwconfig --version")) | |
2d187d58 | 66 | |
1c9a4be5 AK |
67 | while ("sort /proc/modules" | getline > 0) { |
68 | mods = mods sep $1 | |
69 | sep = " " | |
2d187d58 | 70 | } |
1c9a4be5 | 71 | printversion("Modules Loaded", mods) |
2d187d58 AK |
72 | } |
73 | ||
74 | function version(cmd, ver) { | |
4169bc43 | 75 | cmd = cmd " 2>&1" |
2d187d58 | 76 | while (cmd | getline > 0) { |
2ca46ed2 | 77 | if (match($0, vernum)) { |
2d187d58 AK |
78 | ver = substr($0, RSTART, RLENGTH) |
79 | break | |
80 | } | |
81 | } | |
82 | close(cmd) | |
83 | return ver | |
84 | } | |
85 | ||
86 | function printversion(name, value, ofmt) { | |
87 | if (value != "") { | |
88 | ofmt = "%-20s\t%s\n" | |
89 | printf(ofmt, name, value) | |
90 | } | |
91 | } |