blob: 810e608baa2409f7e4dd6c78f52b48b0bb101885 [file] [log] [blame]
Saul Wold8af11c12017-03-28 15:06:08 -07001#!/usr/bin/awk -f
Greg Kroah-Hartmanb2441312017-11-01 15:07:57 +01002# SPDX-License-Identifier: GPL-2.0
Alexander Kapshuk2d187d52016-08-22 21:19:17 +03003# 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
8BEGIN {
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
Alexander Kapshuk2ca46ed2019-01-05 19:09:23 +020016 vernum = "[0-9]+([.]?[0-9]+)+"
17
Alexander Kapshuk4169bc42018-05-12 12:02:30 +030018 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"))
Alexander Kapshuk2d187d52016-08-22 21:19:17 +030035
Alexander Kapshuk1c9a4be52018-05-12 12:02:31 +030036 while (getline <"/proc/self/maps" > 0) {
Alexander Kapshuk34fe3cf2018-05-31 22:22:46 +030037 if (/libc.*\.so$/) {
38 n = split($0, procmaps, "/")
Alexander Kapshuk2ca46ed2019-01-05 19:09:23 +020039 if (match(procmaps[n], vernum)) {
Alexander Kapshuk34fe3cf2018-05-31 22:22:46 +030040 ver = substr(procmaps[n], RSTART, RLENGTH)
41 printversion("Linux C Library", ver)
42 break
43 }
Alexander Kapshuk2d187d52016-08-22 21:19:17 +030044 }
45 }
46
Alexander Kapshuk4169bc42018-05-12 12:02:30 +030047 printversion("Dynamic linker (ldd)", version("ldd --version"))
Alexander Kapshuk2d187d52016-08-22 21:19:17 +030048
49 while ("ldconfig -p 2>/dev/null" | getline > 0) {
50 if (/(libg|stdc)[+]+\.so/) {
51 libcpp = $NF
52 break
53 }
54 }
Alexander Kapshuk1c9a4be52018-05-12 12:02:31 +030055 printversion("Linux C++ Library", version("readlink " libcpp))
Alexander Kapshuk4169bc42018-05-12 12:02:30 +030056 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"))
Alexander Kapshuk2d187d52016-08-22 21:19:17 +030064
Alexander Kapshuk1c9a4be52018-05-12 12:02:31 +030065 while ("sort /proc/modules" | getline > 0) {
66 mods = mods sep $1
67 sep = " "
Alexander Kapshuk2d187d52016-08-22 21:19:17 +030068 }
Alexander Kapshuk1c9a4be52018-05-12 12:02:31 +030069 printversion("Modules Loaded", mods)
Alexander Kapshuk2d187d52016-08-22 21:19:17 +030070}
71
72function version(cmd, ver) {
Alexander Kapshuk4169bc42018-05-12 12:02:30 +030073 cmd = cmd " 2>&1"
Alexander Kapshuk2d187d52016-08-22 21:19:17 +030074 while (cmd | getline > 0) {
Alexander Kapshuk2ca46ed2019-01-05 19:09:23 +020075 if (match($0, vernum)) {
Alexander Kapshuk2d187d52016-08-22 21:19:17 +030076 ver = substr($0, RSTART, RLENGTH)
77 break
78 }
79 }
80 close(cmd)
81 return ver
82}
83
84function printversion(name, value, ofmt) {
85 if (value != "") {
86 ofmt = "%-20s\t%s\n"
87 printf(ofmt, name, value)
88 }
89}