1 #!/usr/bin/awk -f !! 1 #!/bin/awk -f 2 # SPDX-License-Identifier: GPL-2.0 << 3 # Before running this script please ensure tha 2 # Before running this script please ensure that your PATH is 4 # typical as you use for compilation/installat 3 # typical as you use for compilation/installation. I use 5 # /bin /sbin /usr/bin /usr/sbin /usr/local/bin 4 # /bin /sbin /usr/bin /usr/sbin /usr/local/bin, but it may 6 # differ on your system. 5 # differ on your system. 7 6 8 BEGIN { 7 BEGIN { 9 usage = "If some fields are empty or l 8 usage = "If some fields are empty or look unusual you may have an old version.\n" 10 usage = usage "Compare to the current 9 usage = usage "Compare to the current minimal requirements in Documentation/Changes.\n" 11 print usage 10 print usage 12 11 13 system("uname -a") 12 system("uname -a") 14 printf("\n") 13 printf("\n") 15 14 16 vernum = "[0-9]+([.]?[0-9]+)+" !! 15 printversion("GNU C", version("gcc -dumpversion 2>&1")) 17 libc = "libc[.]so[.][0-9]+$" !! 16 printversion("GNU Make", version("make --version 2>&1")) 18 libcpp = "(libg|stdc)[+]+[.]so([.][0-9 !! 17 printversion("Binutils", version("ld -v 2>&1")) 19 !! 18 printversion("Util-linux", version("mount --version 2>&1")) 20 printversion("GNU C", version("gcc -du !! 19 printversion("Mount", version("mount --version 2>&1")) 21 printversion("GNU Make", version("make !! 20 printversion("Module-init-tools", version("depmod -V 2>&1")) 22 printversion("Binutils", version("ld - !! 21 printversion("E2fsprogs", version("tune2fs 2>&1")) 23 printversion("Util-linux", version("mo !! 22 printversion("Jfsutils", version("fsck.jfs -V 2>&1")) 24 printversion("Mount", version("mount - !! 23 printversion("Reiserfsprogs", version("reiserfsck -V 2>&1")) 25 printversion("Module-init-tools", vers !! 24 printversion("Reiser4fsprogs", version("fsck.reiser4 -V 2>&1")) 26 printversion("E2fsprogs", version("tun !! 25 printversion("Xfsprogs", version("xfs_db -V 2>&1")) 27 printversion("Jfsutils", version("fsck !! 26 printversion("Pcmciautils", version("pccardctl -V 2>&1")) 28 printversion("Reiserfsprogs", version( !! 27 printversion("Pcmcia-cs", version("cardmgr -V 2>&1")) 29 printversion("Reiser4fsprogs", version !! 28 printversion("Quota-tools", version("quota -V 2>&1")) 30 printversion("Xfsprogs", version("xfs_ !! 29 printversion("PPP", version("pppd --version 2>&1")) 31 printversion("Pcmciautils", version("p !! 30 printversion("Isdn4k-utils", version("isdnctrl 2>&1")) 32 printversion("Pcmcia-cs", version("car !! 31 printversion("Nfs-utils", version("showmount --version 2>&1")) 33 printversion("Quota-tools", version("q !! 32 34 printversion("PPP", version("pppd --ve !! 33 if (system("test -r /proc/self/maps") == 0) { 35 printversion("Isdn4k-utils", version(" !! 34 while (getline <"/proc/self/maps" > 0) { 36 printversion("Nfs-utils", version("sho !! 35 n = split($0, procmaps, "/") 37 printversion("Bison", version("bison - !! 36 if (/libc.*so$/ && match(procmaps[n], /[0-9]+([.]?[0-9]+)+/)) { 38 printversion("Flex", version("flex --v !! 37 ver = substr(procmaps[n], RSTART, RLENGTH) 39 !! 38 printversion("Linux C Library", ver) 40 while ("ldconfig -p 2>/dev/null" | get !! 39 break 41 if ($NF ~ libc || $NF ~ libcpp !! 40 } 42 if (!seen[ver = versio !! 41 } 43 printversion(" !! 42 } 44 !! 43 45 printversion("Dynamic linker (ldd)", v !! 44 printversion("Dynamic linker (ldd)", version("ldd --version 2>&1")) 46 printversion("Procps", version("ps --v !! 45 47 printversion("Net-tools", version("ifc !! 46 while ("ldconfig -p 2>/dev/null" | getline > 0) { 48 printversion("Kbd", version("loadkeys !! 47 if (/(libg|stdc)[+]+\.so/) { 49 printversion("Console-tools", version( !! 48 libcpp = $NF 50 printversion("Sh-utils", version("expr !! 49 break 51 printversion("Udev", version("udevadm !! 50 } 52 printversion("Wireless-tools", version !! 51 } 53 !! 52 if (system("test -r " libcpp) == 0) 54 while ("sort /proc/modules" | getline !! 53 printversion("Linux C++ Library", version("readlink " libcpp)) 55 mods = mods sep $1 !! 54 56 sep = " " !! 55 printversion("Procps", version("ps --version 2>&1")) >> 56 printversion("Net-tools", version("ifconfig --version 2>&1")) >> 57 printversion("Kbd", version("loadkeys -V 2>&1")) >> 58 printversion("Console-tools", version("loadkeys -V 2>&1")) >> 59 printversion("Oprofile", version("oprofiled --version 2>&1")) >> 60 printversion("Sh-utils", version("expr --v 2>&1")) >> 61 printversion("Udev", version("udevadm --version 2>&1")) >> 62 printversion("Wireless-tools", version("iwconfig --version 2>&1")) >> 63 >> 64 if (system("test -r /proc/modules") == 0) { >> 65 while ("sort /proc/modules" | getline > 0) { >> 66 mods = mods sep $1 >> 67 sep = " " >> 68 } >> 69 printversion("Modules Loaded", mods) 57 } 70 } 58 printversion("Modules Loaded", mods) << 59 } 71 } 60 72 61 function version(cmd, ver) { 73 function version(cmd, ver) { 62 cmd = cmd " 2>&1" << 63 while (cmd | getline > 0) { 74 while (cmd | getline > 0) { 64 if (match($0, vernum)) { !! 75 if (!/ver_linux/ && match($0, /[0-9]+([.]?[0-9]+)+/)) { 65 ver = substr($0, RSTAR 76 ver = substr($0, RSTART, RLENGTH) 66 break 77 break 67 } 78 } 68 } 79 } 69 close(cmd) 80 close(cmd) 70 return ver 81 return ver 71 } 82 } 72 83 73 function printversion(name, value, ofmt) { 84 function printversion(name, value, ofmt) { 74 if (value != "") { 85 if (value != "") { 75 ofmt = "%-20s\t%s\n" 86 ofmt = "%-20s\t%s\n" 76 printf(ofmt, name, value) 87 printf(ofmt, name, value) 77 } 88 } 78 } 89 }
Linux® is a registered trademark of Linus Torvalds in the United States and other countries.
TOMOYO® is a registered trademark of NTT DATA CORPORATION.