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