18af11c1cSSaul Wold#!/usr/bin/awk -f 2b2441318SGreg Kroah-Hartman# SPDX-License-Identifier: GPL-2.0 39b9e7d36SAlexander Kapshuk# Before running this script please ensure that your PATH is 49b9e7d36SAlexander Kapshuk# typical as you use for compilation/installation. I use 59b9e7d36SAlexander Kapshuk# /bin /sbin /usr/bin /usr/sbin /usr/local/bin, but it may 69b9e7d36SAlexander Kapshuk# differ on your system. 79b9e7d36SAlexander Kapshuk 89b9e7d36SAlexander KapshukBEGIN { 99b9e7d36SAlexander Kapshuk usage = "If some fields are empty or look unusual you may have an old version.\n" 109b9e7d36SAlexander Kapshuk usage = usage "Compare to the current minimal requirements in Documentation/Changes.\n" 119b9e7d36SAlexander Kapshuk print usage 129b9e7d36SAlexander Kapshuk 139b9e7d36SAlexander Kapshuk system("uname -a") 149b9e7d36SAlexander Kapshuk printf("\n") 159b9e7d36SAlexander Kapshuk 162ca46ed2SAlexander Kapshuk vernum = "[0-9]+([.]?[0-9]+)+" 17ff5cd9acSAlexander Kapshuk libc = "libc[.]so[.][0-9]+$" 18*afe90179SAlexander Kapshuk libcpp = "(libg|stdc)[+]+[.]so([.][0-9]+)+$" 192ca46ed2SAlexander Kapshuk 204169bc43SAlexander Kapshuk printversion("GNU C", version("gcc -dumpversion")) 214169bc43SAlexander Kapshuk printversion("GNU Make", version("make --version")) 224169bc43SAlexander Kapshuk printversion("Binutils", version("ld -v")) 234169bc43SAlexander Kapshuk printversion("Util-linux", version("mount --version")) 244169bc43SAlexander Kapshuk printversion("Mount", version("mount --version")) 254169bc43SAlexander Kapshuk printversion("Module-init-tools", version("depmod -V")) 264169bc43SAlexander Kapshuk printversion("E2fsprogs", version("tune2fs")) 274169bc43SAlexander Kapshuk printversion("Jfsutils", version("fsck.jfs -V")) 284169bc43SAlexander Kapshuk printversion("Reiserfsprogs", version("reiserfsck -V")) 294169bc43SAlexander Kapshuk printversion("Reiser4fsprogs", version("fsck.reiser4 -V")) 304169bc43SAlexander Kapshuk printversion("Xfsprogs", version("xfs_db -V")) 314169bc43SAlexander Kapshuk printversion("Pcmciautils", version("pccardctl -V")) 324169bc43SAlexander Kapshuk printversion("Pcmcia-cs", version("cardmgr -V")) 334169bc43SAlexander Kapshuk printversion("Quota-tools", version("quota -V")) 344169bc43SAlexander Kapshuk printversion("PPP", version("pppd --version")) 354169bc43SAlexander Kapshuk printversion("Isdn4k-utils", version("isdnctrl")) 364169bc43SAlexander Kapshuk printversion("Nfs-utils", version("showmount --version")) 37faade961SBhaskar Chowdhury printversion("Bison", version("bison --version")) 38faade961SBhaskar Chowdhury printversion("Flex", version("flex --version")) 399b9e7d36SAlexander Kapshuk 40*afe90179SAlexander Kapshuk while ("ldconfig -p 2>/dev/null" | getline > 0) 41*afe90179SAlexander Kapshuk if ($NF ~ libc || $NF ~ libcpp) 42*afe90179SAlexander Kapshuk if (!seen[ver = version("readlink " $NF)]++) 43*afe90179SAlexander Kapshuk printversion("Linux C" ($NF ~ libcpp? "++" : "") " Library", ver) 449b9e7d36SAlexander Kapshuk 454169bc43SAlexander Kapshuk printversion("Dynamic linker (ldd)", version("ldd --version")) 464169bc43SAlexander Kapshuk printversion("Procps", version("ps --version")) 474169bc43SAlexander Kapshuk printversion("Net-tools", version("ifconfig --version")) 484169bc43SAlexander Kapshuk printversion("Kbd", version("loadkeys -V")) 494169bc43SAlexander Kapshuk printversion("Console-tools", version("loadkeys -V")) 504169bc43SAlexander Kapshuk printversion("Oprofile", version("oprofiled --version")) 514169bc43SAlexander Kapshuk printversion("Sh-utils", version("expr --v")) 524169bc43SAlexander Kapshuk printversion("Udev", version("udevadm --version")) 534169bc43SAlexander Kapshuk printversion("Wireless-tools", version("iwconfig --version")) 549b9e7d36SAlexander Kapshuk 559b9e7d36SAlexander Kapshuk while ("sort /proc/modules" | getline > 0) { 569b9e7d36SAlexander Kapshuk mods = mods sep $1 579b9e7d36SAlexander Kapshuk sep = " " 589b9e7d36SAlexander Kapshuk } 599b9e7d36SAlexander Kapshuk printversion("Modules Loaded", mods) 609b9e7d36SAlexander Kapshuk} 619b9e7d36SAlexander Kapshuk 629b9e7d36SAlexander Kapshukfunction version(cmd, ver) { 634169bc43SAlexander Kapshuk cmd = cmd " 2>&1" 649b9e7d36SAlexander Kapshuk while (cmd | getline > 0) { 652ca46ed2SAlexander Kapshuk if (match($0, vernum)) { 669b9e7d36SAlexander Kapshuk ver = substr($0, RSTART, RLENGTH) 679b9e7d36SAlexander Kapshuk break 689b9e7d36SAlexander Kapshuk } 699b9e7d36SAlexander Kapshuk } 709b9e7d36SAlexander Kapshuk close(cmd) 719b9e7d36SAlexander Kapshuk return ver 729b9e7d36SAlexander Kapshuk} 739b9e7d36SAlexander Kapshuk 749b9e7d36SAlexander Kapshukfunction printversion(name, value, ofmt) { 759b9e7d36SAlexander Kapshuk if (value != "") { 769b9e7d36SAlexander Kapshuk ofmt = "%-20s\t%s\n" 779b9e7d36SAlexander Kapshuk printf(ofmt, name, value) 789b9e7d36SAlexander Kapshuk } 799b9e7d36SAlexander Kapshuk} 80