--- scripts/ver_linux.orig 2015-08-30 21:34:09.000000000 +0300 +++ scripts/ver_linux 2015-09-27 21:32:38.652765768 +0300 @@ -4,54 +4,112 @@ # /bin /sbin /usr/bin /usr/sbin /usr/local/bin, but it may # differ on your system. # + echo 'If some fields are empty or look unusual you may have an old version.' echo 'Compare to the current minimal requirements in Documentation/Changes.' -echo ' ' +echo uname -a -echo ' ' - -gcc -dumpversion 2>&1| awk \ -'NR==1{print "Gnu C ", $1}' - -make --version 2>&1 | awk -F, '{print $1}' | awk \ - '/GNU Make/{print "Gnu make ",$NF}' - -echo "binutils $(ld -v | egrep -o '[0-9]+\.[0-9\.]+')" - -echo -n "util-linux " -fdformat --version | awk '{print $NF}' | sed -e s/^util-linux-// -e s/\)$// +echo -echo -n "mount " -mount --version | awk '{print $NF}' | sed -e s/^mount-// -e s/\)$// - -depmod -V 2>&1 | awk 'NR==1 {print "module-init-tools ",$NF}' - -tune2fs 2>&1 | grep "^tune2fs" | sed 's/,//' | awk \ -'NR==1 {print "e2fsprogs ", $2}' - -fsck.jfs -V 2>&1 | grep version | sed 's/,//' | awk \ -'NR==1 {print "jfsutils ", $3}' - -reiserfsck -V 2>&1 | grep ^reiserfsck | awk \ -'NR==1{print "reiserfsprogs ", $2}' +gcc -dumpversion 2>&1 | +sed ' + /^[0-9\.]*$/!d + s/^/GNU C\t\t\t/ +' + +make --version 2>&1 | +sed ' + /^GNU Make/!d + s//&\t\t/ +' + +ld -v 2>&1 | +sed ' + /[0-9]$/!d + s/-.*// + s/.*[ \t]// + s/^/binutils\t\t/ +' + +mount --version 2>&1 | +sed ' + /^mount/!d + s/.*util-linux// + s/lib.*// + s/[^0-9\.]//g + s/^/util-linux\t\t/ + h + s/util-linux/mount\t/ + H + g +' + +/sbin/depmod -V 2>&1 | +sed ' + /[0-9]$/!d + s/[^0-9\.]//g + s/^/module-init-tools\t/ +' + +/sbin/tune2fs 2>&1 | +sed ' + /^tune2fs/!d + s/-.*// + s/[^0-9\.]*// + s/.*[ \t]\(.*\)[ \t].*/e2fsprogs\t\t\1/ +' + +fsck.jfs -V 2>&1 | +sed ' + /version/!d + s/.*version[ \t]// + s/[ \t].*// + s/[^0-9]$// + s/^/jfsutils\t/ +' + +reiserfsck -V 2>&1 | +sed ' + /^reiserfsck/!d + s/[^0-9\.]//g + /^$/d + s/^/reiserfsprogs\t/ +' fsck.reiser4 -V 2>&1 | grep ^fsck.reiser4 | awk \ 'NR==1{print "reiser4progs ", $2}' -xfs_db -V 2>&1 | grep version | awk \ -'NR==1{print "xfsprogs ", $3}' - -pccardctl -V 2>&1| grep pcmciautils | awk '{print "pcmciautils ", $2}' +xfs_db -V 2>&1 | +sed ' + /version/!d + s/[^0-9\.]//g + s/^/xfsprogs\t\t\t/ +' + +pccardctl -V 2>&1 | +sed ' + /^pcmciautils/!d + s/[ \t]/\t/ +' cardmgr -V 2>&1| grep version | awk \ 'NR==1{print "pcmcia-cs ", $3}' -quota -V 2>&1 | grep version | awk \ -'NR==1{print "quota-tools ", $NF}' - -pppd --version 2>&1| grep version | awk \ -'NR==1{print "PPP ", $3}' +quota -V 2>&1 | +sed ' + /version/!d + s/[^0-9\.]//g + s/\.$// + s/^/quota-tools\t\t/ +' + +pppd --version 2>&1 | +sed ' + /version/!d + s/[^0-9\.]//g + s/^/PPP\t\t\t\t/ +' isdnctrl 2>&1 | grep version | awk \ 'NR==1{print "isdn4k-utils ", $NF}' @@ -59,40 +117,97 @@ isdnctrl 2>&1 | grep version | awk \ showmount --version 2>&1 | grep nfs-utils | awk \ 'NR==1{print "nfs-utils ", $NF}' -echo -n "Linux C Library " -sed -n -e '/^.*\/libc-\([^/]*\)\.so$/{s//\1/;p;q}' < /proc/self/maps - -ldd -v > /dev/null 2>&1 && ldd -v || ldd --version |head -n 1 | awk \ -'NR==1{print "Dynamic linker (ldd) ", $NF}' - -ls -l /usr/lib/libg++.so /usr/lib/libstdc++.so 2>/dev/null | awk -F. \ - '{print "Linux C++ Library " $4"."$5"."$6}' - -ps --version 2>&1 | grep version | awk \ -'NR==1{print "Procps ", $NF}' - -ifconfig --version 2>&1 | grep tools | awk \ -'NR==1{print "Net-tools ", $NF}' +test -r /proc/self/maps && +sed ' + /.*libc-\(.*\)\.so$/!d + s//Linux C Library\t\t\1/ + q +' /proc/self/maps + +lddsed=' + /^ldd/!d + s/.*[ \t]\([0-9\.]*$\)/\1/ + s/^/Dynamic linker (ldd)\t/ +' +if ldd -v >/dev/null 2>&1 +then + ldd -v 2>&1 | sed "$lddsed" +else + ldd --version 2>&1 | sed "$lddsed" +fi -# Kbd needs 'loadkeys -h', -loadkeys -h 2>&1 | awk \ -'(NR==1 && ($3 !~ /option/)) {print "Kbd ", $3}' +libcpp=`/sbin/ldconfig -p | + awk '/(libg|stdc)[+]+\.so/ { + print $NF + exit + } +'` +ls -l $libcpp | +sed ' + s!.*so\.!! + s!^!Linux C++ Library\t! +' + +ps --version 2>&1 | +sed ' + /version/!d + s/[^0-9.]//g + s/^/Procps\t\t\t/ +' + +ifconfig=`whereis ifconfig | awk '{print $2}'` +if test -n "$ifconfig" +then + $ifconfig --version 2>&1 | + sed ' + /net-tools/!d + s/\([0-9]\)-.*/\1/ + s/[ \t]/\t\t/ + s/_.*// + ' +else + : +fi -# while console-tools needs 'loadkeys -V'. -loadkeys -V 2>&1 | awk \ -'(NR==1 && ($2 ~ /console-tools/)) {print "Console-tools ", $3}' +loadkeys -V 2>&1 | +sed ' + /^loadkeys/!d + s/.*[ \t]\([0-9\.]*$\)/\1/ + s/^/Kbd\t\t\t/ + h + s/Kbd\t/Console-tools/ + H + g +' oprofiled --version 2>&1 | awk \ '(NR==1 && ($2 == "oprofile")) {print "oprofile ", $3}' -expr --v 2>&1 | awk 'NR==1{print "Sh-utils ", $NF}' - +expr --v 2>&1 | +sed ' + /^expr/!d + s/[^0-9.]//g + s/^/Sh-utils\t\t/ +' udevinfo -V 2>&1 | grep version | awk '{print "udev ", $3}' -iwconfig --version 2>&1 | awk \ -'(NR==1 && ($3 == "version")) {print "wireless-tools ",$4}' - -if [ -e /proc/modules ]; then - X=`cat /proc/modules | sed -e "s/ .*$//"` - echo "Modules Loaded "$X -fi +iwconfig --version 2>&1 | +sed ' + /version/!d + s/[^0-9\.]//g + s/^/wireless-tools\t\t/ +' + +test -e /proc/modules && +sort /proc/modules | +sed ' + s/ .*// + H +${ + g + s/^/Modules Loaded\t\t/ + y/\n/ / + q +} + d +'