Back to home page

LXR

 
 

    


0001 #!/bin/awk -f
0002 # Before running this script please ensure that your PATH is
0003 # typical as you use for compilation/installation. I use
0004 # /bin /sbin /usr/bin /usr/sbin /usr/local/bin, but it may
0005 # differ on your system.
0006 
0007 BEGIN {
0008         usage = "If some fields are empty or look unusual you may have an old version.\n"
0009         usage = usage "Compare to the current minimal requirements in Documentation/Changes.\n"
0010         print usage
0011 
0012         system("uname -a")
0013         printf("\n")
0014 
0015         printversion("GNU C", version("gcc -dumpversion 2>&1"))
0016         printversion("GNU Make", version("make --version 2>&1"))
0017         printversion("Binutils", version("ld -v 2>&1"))
0018         printversion("Util-linux", version("mount --version 2>&1"))
0019         printversion("Mount", version("mount --version 2>&1"))
0020         printversion("Module-init-tools", version("depmod -V  2>&1"))
0021         printversion("E2fsprogs", version("tune2fs 2>&1"))
0022         printversion("Jfsutils", version("fsck.jfs -V 2>&1"))
0023         printversion("Reiserfsprogs", version("reiserfsck -V 2>&1"))
0024         printversion("Reiser4fsprogs", version("fsck.reiser4 -V 2>&1"))
0025         printversion("Xfsprogs", version("xfs_db -V 2>&1"))
0026         printversion("Pcmciautils", version("pccardctl -V 2>&1"))
0027         printversion("Pcmcia-cs", version("cardmgr -V 2>&1"))
0028         printversion("Quota-tools", version("quota -V 2>&1"))
0029         printversion("PPP", version("pppd --version 2>&1"))
0030         printversion("Isdn4k-utils", version("isdnctrl 2>&1"))
0031         printversion("Nfs-utils", version("showmount --version 2>&1"))
0032 
0033         if (system("test -r /proc/self/maps") == 0) {
0034                 while (getline <"/proc/self/maps" > 0) {
0035                         n = split($0, procmaps, "/")
0036                         if (/libc.*so$/ && match(procmaps[n], /[0-9]+([.]?[0-9]+)+/)) {
0037                                 ver = substr(procmaps[n], RSTART, RLENGTH)
0038                                 printversion("Linux C Library", ver)
0039                                 break
0040                         }
0041                 }
0042         }
0043 
0044         printversion("Dynamic linker (ldd)", version("ldd --version 2>&1"))
0045 
0046         while ("ldconfig -p 2>/dev/null" | getline > 0) {
0047                 if (/(libg|stdc)[+]+\.so/) {
0048                         libcpp = $NF
0049                         break
0050                 }
0051         }
0052         if (system("test -r " libcpp) == 0)
0053                 printversion("Linux C++ Library", version("readlink " libcpp))
0054 
0055         printversion("Procps", version("ps --version 2>&1"))
0056         printversion("Net-tools", version("ifconfig --version 2>&1"))
0057         printversion("Kbd", version("loadkeys -V 2>&1"))
0058         printversion("Console-tools", version("loadkeys -V 2>&1"))
0059         printversion("Oprofile", version("oprofiled --version 2>&1"))
0060         printversion("Sh-utils", version("expr --v 2>&1"))
0061         printversion("Udev", version("udevadm --version 2>&1"))
0062         printversion("Wireless-tools", version("iwconfig --version 2>&1"))
0063 
0064         if (system("test -r /proc/modules") == 0) {
0065                 while ("sort /proc/modules" | getline > 0) {
0066                         mods = mods sep $1
0067                         sep = " "
0068                 }
0069                 printversion("Modules Loaded", mods)
0070         }
0071 }
0072 
0073 function version(cmd,    ver) {
0074         while (cmd | getline > 0) {
0075                 if (!/ver_linux/ && match($0, /[0-9]+([.]?[0-9]+)+/)) {
0076                         ver = substr($0, RSTART, RLENGTH)
0077                         break
0078                 }
0079         }
0080         close(cmd)
0081         return ver
0082 }
0083 
0084 function printversion(name, value,  ofmt) {
0085         if (value != "") {
0086                 ofmt = "%-20s\t%s\n"
0087                 printf(ofmt, name, value)
0088         }
0089 }