18af11c1cSSaul Wold#!/usr/bin/awk -f 2*b2441318SGreg 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 169b9e7d36SAlexander Kapshuk printversion("GNU C", version("gcc -dumpversion 2>&1")) 179b9e7d36SAlexander Kapshuk printversion("GNU Make", version("make --version 2>&1")) 189b9e7d36SAlexander Kapshuk printversion("Binutils", version("ld -v 2>&1")) 199b9e7d36SAlexander Kapshuk printversion("Util-linux", version("mount --version 2>&1")) 209b9e7d36SAlexander Kapshuk printversion("Mount", version("mount --version 2>&1")) 219b9e7d36SAlexander Kapshuk printversion("Module-init-tools", version("depmod -V 2>&1")) 229b9e7d36SAlexander Kapshuk printversion("E2fsprogs", version("tune2fs 2>&1")) 239b9e7d36SAlexander Kapshuk printversion("Jfsutils", version("fsck.jfs -V 2>&1")) 249b9e7d36SAlexander Kapshuk printversion("Reiserfsprogs", version("reiserfsck -V 2>&1")) 259b9e7d36SAlexander Kapshuk printversion("Reiser4fsprogs", version("fsck.reiser4 -V 2>&1")) 269b9e7d36SAlexander Kapshuk printversion("Xfsprogs", version("xfs_db -V 2>&1")) 279b9e7d36SAlexander Kapshuk printversion("Pcmciautils", version("pccardctl -V 2>&1")) 289b9e7d36SAlexander Kapshuk printversion("Pcmcia-cs", version("cardmgr -V 2>&1")) 299b9e7d36SAlexander Kapshuk printversion("Quota-tools", version("quota -V 2>&1")) 309b9e7d36SAlexander Kapshuk printversion("PPP", version("pppd --version 2>&1")) 319b9e7d36SAlexander Kapshuk printversion("Isdn4k-utils", version("isdnctrl 2>&1")) 329b9e7d36SAlexander Kapshuk printversion("Nfs-utils", version("showmount --version 2>&1")) 339b9e7d36SAlexander Kapshuk 349b9e7d36SAlexander Kapshuk if (system("test -r /proc/self/maps") == 0) { 359b9e7d36SAlexander Kapshuk while (getline <"/proc/self/maps" > 0) { 369b9e7d36SAlexander Kapshuk n = split($0, procmaps, "/") 379b9e7d36SAlexander Kapshuk if (/libc.*so$/ && match(procmaps[n], /[0-9]+([.]?[0-9]+)+/)) { 389b9e7d36SAlexander Kapshuk ver = substr(procmaps[n], RSTART, RLENGTH) 399b9e7d36SAlexander Kapshuk printversion("Linux C Library", ver) 409b9e7d36SAlexander Kapshuk break 419b9e7d36SAlexander Kapshuk } 429b9e7d36SAlexander Kapshuk } 439b9e7d36SAlexander Kapshuk } 449b9e7d36SAlexander Kapshuk 459b9e7d36SAlexander Kapshuk printversion("Dynamic linker (ldd)", version("ldd --version 2>&1")) 469b9e7d36SAlexander Kapshuk 479b9e7d36SAlexander Kapshuk while ("ldconfig -p 2>/dev/null" | getline > 0) { 489b9e7d36SAlexander Kapshuk if (/(libg|stdc)[+]+\.so/) { 499b9e7d36SAlexander Kapshuk libcpp = $NF 509b9e7d36SAlexander Kapshuk break 519b9e7d36SAlexander Kapshuk } 529b9e7d36SAlexander Kapshuk } 539b9e7d36SAlexander Kapshuk if (system("test -r " libcpp) == 0) 549b9e7d36SAlexander Kapshuk printversion("Linux C++ Library", version("readlink " libcpp)) 559b9e7d36SAlexander Kapshuk 569b9e7d36SAlexander Kapshuk printversion("Procps", version("ps --version 2>&1")) 579b9e7d36SAlexander Kapshuk printversion("Net-tools", version("ifconfig --version 2>&1")) 589b9e7d36SAlexander Kapshuk printversion("Kbd", version("loadkeys -V 2>&1")) 599b9e7d36SAlexander Kapshuk printversion("Console-tools", version("loadkeys -V 2>&1")) 609b9e7d36SAlexander Kapshuk printversion("Oprofile", version("oprofiled --version 2>&1")) 619b9e7d36SAlexander Kapshuk printversion("Sh-utils", version("expr --v 2>&1")) 629b9e7d36SAlexander Kapshuk printversion("Udev", version("udevadm --version 2>&1")) 639b9e7d36SAlexander Kapshuk printversion("Wireless-tools", version("iwconfig --version 2>&1")) 649b9e7d36SAlexander Kapshuk 659b9e7d36SAlexander Kapshuk if (system("test -r /proc/modules") == 0) { 669b9e7d36SAlexander Kapshuk while ("sort /proc/modules" | getline > 0) { 679b9e7d36SAlexander Kapshuk mods = mods sep $1 689b9e7d36SAlexander Kapshuk sep = " " 699b9e7d36SAlexander Kapshuk } 709b9e7d36SAlexander Kapshuk printversion("Modules Loaded", mods) 719b9e7d36SAlexander Kapshuk } 729b9e7d36SAlexander Kapshuk} 739b9e7d36SAlexander Kapshuk 749b9e7d36SAlexander Kapshukfunction version(cmd, ver) { 759b9e7d36SAlexander Kapshuk while (cmd | getline > 0) { 769b9e7d36SAlexander Kapshuk if (!/ver_linux/ && match($0, /[0-9]+([.]?[0-9]+)+/)) { 779b9e7d36SAlexander Kapshuk ver = substr($0, RSTART, RLENGTH) 789b9e7d36SAlexander Kapshuk break 799b9e7d36SAlexander Kapshuk } 809b9e7d36SAlexander Kapshuk } 819b9e7d36SAlexander Kapshuk close(cmd) 829b9e7d36SAlexander Kapshuk return ver 839b9e7d36SAlexander Kapshuk} 849b9e7d36SAlexander Kapshuk 859b9e7d36SAlexander Kapshukfunction printversion(name, value, ofmt) { 869b9e7d36SAlexander Kapshuk if (value != "") { 879b9e7d36SAlexander Kapshuk ofmt = "%-20s\t%s\n" 889b9e7d36SAlexander Kapshuk printf(ofmt, name, value) 899b9e7d36SAlexander Kapshuk } 909b9e7d36SAlexander Kapshuk} 91