]>
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 | ||
4169bc43 AK |
16 | printversion("GNU C", version("gcc -dumpversion")) |
17 | printversion("GNU Make", version("make --version")) | |
18 | printversion("Binutils", version("ld -v")) | |
19 | printversion("Util-linux", version("mount --version")) | |
20 | printversion("Mount", version("mount --version")) | |
21 | printversion("Module-init-tools", version("depmod -V")) | |
22 | printversion("E2fsprogs", version("tune2fs")) | |
23 | printversion("Jfsutils", version("fsck.jfs -V")) | |
24 | printversion("Reiserfsprogs", version("reiserfsck -V")) | |
25 | printversion("Reiser4fsprogs", version("fsck.reiser4 -V")) | |
26 | printversion("Xfsprogs", version("xfs_db -V")) | |
27 | printversion("Pcmciautils", version("pccardctl -V")) | |
28 | printversion("Pcmcia-cs", version("cardmgr -V")) | |
29 | printversion("Quota-tools", version("quota -V")) | |
30 | printversion("PPP", version("pppd --version")) | |
31 | printversion("Isdn4k-utils", version("isdnctrl")) | |
32 | printversion("Nfs-utils", version("showmount --version")) | |
2d187d58 | 33 | |
1c9a4be5 AK |
34 | while (getline <"/proc/self/maps" > 0) { |
35 | n = split($0, procmaps, "/") | |
36 | if (/libc.*so$/ && match(procmaps[n], /[0-9]+([.]?[0-9]+)+/)) { | |
37 | ver = substr(procmaps[n], RSTART, RLENGTH) | |
38 | printversion("Linux C Library", ver) | |
39 | break | |
2d187d58 AK |
40 | } |
41 | } | |
42 | ||
4169bc43 | 43 | printversion("Dynamic linker (ldd)", version("ldd --version")) |
2d187d58 AK |
44 | |
45 | while ("ldconfig -p 2>/dev/null" | getline > 0) { | |
46 | if (/(libg|stdc)[+]+\.so/) { | |
47 | libcpp = $NF | |
48 | break | |
49 | } | |
50 | } | |
1c9a4be5 | 51 | printversion("Linux C++ Library", version("readlink " libcpp)) |
4169bc43 AK |
52 | printversion("Procps", version("ps --version")) |
53 | printversion("Net-tools", version("ifconfig --version")) | |
54 | printversion("Kbd", version("loadkeys -V")) | |
55 | printversion("Console-tools", version("loadkeys -V")) | |
56 | printversion("Oprofile", version("oprofiled --version")) | |
57 | printversion("Sh-utils", version("expr --v")) | |
58 | printversion("Udev", version("udevadm --version")) | |
59 | printversion("Wireless-tools", version("iwconfig --version")) | |
2d187d58 | 60 | |
1c9a4be5 AK |
61 | while ("sort /proc/modules" | getline > 0) { |
62 | mods = mods sep $1 | |
63 | sep = " " | |
2d187d58 | 64 | } |
1c9a4be5 | 65 | printversion("Modules Loaded", mods) |
2d187d58 AK |
66 | } |
67 | ||
68 | function version(cmd, ver) { | |
4169bc43 | 69 | cmd = cmd " 2>&1" |
2d187d58 AK |
70 | while (cmd | getline > 0) { |
71 | if (!/ver_linux/ && match($0, /[0-9]+([.]?[0-9]+)+/)) { | |
72 | ver = substr($0, RSTART, RLENGTH) | |
73 | break | |
74 | } | |
75 | } | |
76 | close(cmd) | |
77 | return ver | |
78 | } | |
79 | ||
80 | function printversion(name, value, ofmt) { | |
81 | if (value != "") { | |
82 | ofmt = "%-20s\t%s\n" | |
83 | printf(ofmt, name, value) | |
84 | } | |
85 | } |