1 #!/usr/bin/awk -f !! 1 #!/bin/sh 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/istallation. 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. >> 6 # >> 7 PATH=/sbin:/usr/sbin:/bin:/usr/bin:/usr/local/sbin:$PATH >> 8 echo 'If some fields are empty or look unusual you may have an old version.' >> 9 echo 'Compare to the current minimal requirements in Documentation/Changes.' >> 10 echo ' ' 7 11 8 BEGIN { !! 12 uname -a 9 usage = "If some fields are empty or l !! 13 echo ' ' 10 usage = usage "Compare to the current !! 14 11 print usage !! 15 gcc --version 2>&1| head -n 1 | grep -v gcc | awk \ 12 !! 16 'NR==1{print "Gnu C ", $1}' 13 system("uname -a") !! 17 14 printf("\n") !! 18 gcc --version 2>&1| grep gcc | awk \ 15 !! 19 'NR==1{print "Gnu C ", $3}' 16 vernum = "[0-9]+([.]?[0-9]+)+" !! 20 17 libc = "libc[.]so[.][0-9]+$" !! 21 make --version 2>&1 | awk -F, '{print $1}' | awk \ 18 libcpp = "(libg|stdc)[+]+[.]so([.][0-9 !! 22 '/GNU Make/{print "Gnu make ",$NF}' 19 !! 23 20 printversion("GNU C", version("gcc -du !! 24 ld -v 2>&1 | awk -F\) '{print $1}' | awk \ 21 printversion("GNU Make", version("make !! 25 '/BFD/{print "binutils ",$NF} \ 22 printversion("Binutils", version("ld - !! 26 /^GNU/{print "binutils ",$4}' 23 printversion("Util-linux", version("mo !! 27 24 printversion("Mount", version("mount - !! 28 fdformat --version | awk -F\- '{print "util-linux ", $NF}' 25 printversion("Module-init-tools", vers !! 29 26 printversion("E2fsprogs", version("tun !! 30 mount --version | awk -F\- '{print "mount ", $NF}' 27 printversion("Jfsutils", version("fsck !! 31 28 printversion("Reiserfsprogs", version( !! 32 insmod -V 2>&1 | awk 'NR==1 {print "modutils ",$NF}' 29 printversion("Reiser4fsprogs", version !! 33 30 printversion("Xfsprogs", version("xfs_ !! 34 tune2fs 2>&1 | grep "^tune2fs" | sed 's/,//' | awk \ 31 printversion("Pcmciautils", version("p !! 35 'NR==1 {print "e2fsprogs ", $2}' 32 printversion("Pcmcia-cs", version("car !! 36 33 printversion("Quota-tools", version("q !! 37 fsck.jfs -V 2>&1 | grep version | sed 's/,//' | awk \ 34 printversion("PPP", version("pppd --ve !! 38 'NR==1 {print "jfsutils ", $3}' 35 printversion("Isdn4k-utils", version(" !! 39 36 printversion("Nfs-utils", version("sho !! 40 reiserfsck -V 2>&1 | grep reiserfsprogs | awk \ 37 printversion("Bison", version("bison - !! 41 'NR==1{print "reiserfsprogs ", $NF}' 38 printversion("Flex", version("flex --v !! 42 39 !! 43 xfs_db -V 2>&1 | grep version | awk \ 40 while ("ldconfig -p 2>/dev/null" | get !! 44 'NR==1{print "xfsprogs ", $3}' 41 if ($NF ~ libc || $NF ~ libcpp !! 45 42 if (!seen[ver = versio !! 46 cardmgr -V 2>&1| grep version | awk \ 43 printversion(" !! 47 'NR==1{print "pcmcia-cs ", $3}' 44 !! 48 45 printversion("Dynamic linker (ldd)", v !! 49 quota -V 2>&1 | grep version | awk \ 46 printversion("Procps", version("ps --v !! 50 'NR==1{print "quota-tools ", $NF}' 47 printversion("Net-tools", version("ifc !! 51 48 printversion("Kbd", version("loadkeys !! 52 pppd --version 2>&1| grep version | awk \ 49 printversion("Console-tools", version( !! 53 'NR==1{print "PPP ", $3}' 50 printversion("Sh-utils", version("expr !! 54 51 printversion("Udev", version("udevadm !! 55 isdnctrl 2>&1 | grep version | awk \ 52 printversion("Wireless-tools", version !! 56 'NR==1{print "isdn4k-utils ", $NF}' 53 !! 57 54 while ("sort /proc/modules" | getline !! 58 ls -l `ldd /bin/sh | awk '/libc/{print $3}'` | sed \ 55 mods = mods sep $1 !! 59 -e 's/\.so$//' | awk -F'[.-]' '{print "Linux C Library " \ 56 sep = " " !! 60 $(NF-2)"."$(NF-1)"."$NF}' 57 } !! 61 58 printversion("Modules Loaded", mods) !! 62 ldd -v > /dev/null 2>&1 && ldd -v || ldd --version |head -1 | awk \ 59 } !! 63 'NR==1{print "Dynamic linker (ldd) ", $NF}' 60 !! 64 61 function version(cmd, ver) { !! 65 ls -l /usr/lib/lib{g,stdc}++.so 2>/dev/null | awk -F. \ 62 cmd = cmd " 2>&1" !! 66 '{print "Linux C++ Library " $4"."$5"."$6}' 63 while (cmd | getline > 0) { !! 67 64 if (match($0, vernum)) { !! 68 ps --version 2>&1 | awk 'NR==1{print "Procps ", $NF}' 65 ver = substr($0, RSTAR !! 69 66 break !! 70 ifconfig --version 2>&1 | grep tools | awk \ 67 } !! 71 'NR==1{print "Net-tools ", $NF}' 68 } !! 72 69 close(cmd) !! 73 # Kbd needs 'loadkeys -h', 70 return ver !! 74 loadkeys -h 2>&1 | awk \ 71 } !! 75 '(NR==1 && ($3 !~ /option/)) {print "Kbd ", $3}' 72 !! 76 73 function printversion(name, value, ofmt) { !! 77 # while console-tools needs 'loadkeys -V'. 74 if (value != "") { !! 78 loadkeys -V 2>&1 | awk \ 75 ofmt = "%-20s\t%s\n" !! 79 '(NR==1 && ($2 ~ /console-tools/)) {print "Console-tools ", $3}' 76 printf(ofmt, name, value) !! 80 77 } !! 81 expr --v 2>&1 | awk 'NR==1{print "Sh-utils ", $NF}' 78 } !! 82 >> 83 if [ -e /proc/modules ]; then >> 84 X=`cat /proc/modules | sed -e "s/ .*$//"` >> 85 echo "Modules Loaded "$X >> 86 fi
Linux® is a registered trademark of Linus Torvalds in the United States and other countries.
TOMOYO® is a registered trademark of NTT DATA CORPORATION.