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