Saul Wold | 8af11c1 | 2017-03-28 15:06:08 -0700 | [diff] [blame] | 1 | #!/usr/bin/awk -f |
Greg Kroah-Hartman | b244131 | 2017-11-01 15:07:57 +0100 | [diff] [blame] | 2 | # SPDX-License-Identifier: GPL-2.0 |
Alexander Kapshuk | 2d187d5 | 2016-08-22 21:19:17 +0300 | [diff] [blame] | 3 | # Before running this script please ensure that your PATH is |
| 4 | # typical as you use for compilation/installation. I use |
| 5 | # /bin /sbin /usr/bin /usr/sbin /usr/local/bin, but it may |
| 6 | # differ on your system. |
| 7 | |
| 8 | BEGIN { |
| 9 | usage = "If some fields are empty or look unusual you may have an old version.\n" |
| 10 | usage = usage "Compare to the current minimal requirements in Documentation/Changes.\n" |
| 11 | print usage |
| 12 | |
| 13 | system("uname -a") |
| 14 | printf("\n") |
| 15 | |
Alexander Kapshuk | 2ca46ed | 2019-01-05 19:09:23 +0200 | [diff] [blame] | 16 | vernum = "[0-9]+([.]?[0-9]+)+" |
Alexander Kapshuk | ff5cd9a | 2020-02-09 16:00:57 +0200 | [diff] [blame] | 17 | libc = "libc[.]so[.][0-9]+$" |
Alexander Kapshuk | afe9017 | 2021-01-08 13:26:26 +0200 | [diff] [blame] | 18 | libcpp = "(libg|stdc)[+]+[.]so([.][0-9]+)+$" |
Alexander Kapshuk | 2ca46ed | 2019-01-05 19:09:23 +0200 | [diff] [blame] | 19 | |
Alexander Kapshuk | 4169bc4 | 2018-05-12 12:02:30 +0300 | [diff] [blame] | 20 | printversion("GNU C", version("gcc -dumpversion")) |
| 21 | printversion("GNU Make", version("make --version")) |
| 22 | printversion("Binutils", version("ld -v")) |
| 23 | printversion("Util-linux", version("mount --version")) |
| 24 | printversion("Mount", version("mount --version")) |
| 25 | printversion("Module-init-tools", version("depmod -V")) |
| 26 | printversion("E2fsprogs", version("tune2fs")) |
| 27 | printversion("Jfsutils", version("fsck.jfs -V")) |
| 28 | printversion("Reiserfsprogs", version("reiserfsck -V")) |
| 29 | printversion("Reiser4fsprogs", version("fsck.reiser4 -V")) |
| 30 | printversion("Xfsprogs", version("xfs_db -V")) |
| 31 | printversion("Pcmciautils", version("pccardctl -V")) |
| 32 | printversion("Pcmcia-cs", version("cardmgr -V")) |
| 33 | printversion("Quota-tools", version("quota -V")) |
| 34 | printversion("PPP", version("pppd --version")) |
| 35 | printversion("Isdn4k-utils", version("isdnctrl")) |
| 36 | printversion("Nfs-utils", version("showmount --version")) |
Bhaskar Chowdhury | faade96 | 2019-11-06 09:06:10 +0530 | [diff] [blame] | 37 | printversion("Bison", version("bison --version")) |
| 38 | printversion("Flex", version("flex --version")) |
Alexander Kapshuk | 2d187d5 | 2016-08-22 21:19:17 +0300 | [diff] [blame] | 39 | |
Alexander Kapshuk | afe9017 | 2021-01-08 13:26:26 +0200 | [diff] [blame] | 40 | while ("ldconfig -p 2>/dev/null" | getline > 0) |
| 41 | if ($NF ~ libc || $NF ~ libcpp) |
| 42 | if (!seen[ver = version("readlink " $NF)]++) |
| 43 | printversion("Linux C" ($NF ~ libcpp? "++" : "") " Library", ver) |
Alexander Kapshuk | 2d187d5 | 2016-08-22 21:19:17 +0300 | [diff] [blame] | 44 | |
Alexander Kapshuk | 4169bc4 | 2018-05-12 12:02:30 +0300 | [diff] [blame] | 45 | printversion("Dynamic linker (ldd)", version("ldd --version")) |
Alexander Kapshuk | 4169bc4 | 2018-05-12 12:02:30 +0300 | [diff] [blame] | 46 | printversion("Procps", version("ps --version")) |
| 47 | printversion("Net-tools", version("ifconfig --version")) |
| 48 | printversion("Kbd", version("loadkeys -V")) |
| 49 | printversion("Console-tools", version("loadkeys -V")) |
Alexander Kapshuk | 4169bc4 | 2018-05-12 12:02:30 +0300 | [diff] [blame] | 50 | printversion("Sh-utils", version("expr --v")) |
| 51 | printversion("Udev", version("udevadm --version")) |
| 52 | printversion("Wireless-tools", version("iwconfig --version")) |
Alexander Kapshuk | 2d187d5 | 2016-08-22 21:19:17 +0300 | [diff] [blame] | 53 | |
Alexander Kapshuk | 1c9a4be5 | 2018-05-12 12:02:31 +0300 | [diff] [blame] | 54 | while ("sort /proc/modules" | getline > 0) { |
| 55 | mods = mods sep $1 |
| 56 | sep = " " |
Alexander Kapshuk | 2d187d5 | 2016-08-22 21:19:17 +0300 | [diff] [blame] | 57 | } |
Alexander Kapshuk | 1c9a4be5 | 2018-05-12 12:02:31 +0300 | [diff] [blame] | 58 | printversion("Modules Loaded", mods) |
Alexander Kapshuk | 2d187d5 | 2016-08-22 21:19:17 +0300 | [diff] [blame] | 59 | } |
| 60 | |
| 61 | function version(cmd, ver) { |
Alexander Kapshuk | 4169bc4 | 2018-05-12 12:02:30 +0300 | [diff] [blame] | 62 | cmd = cmd " 2>&1" |
Alexander Kapshuk | 2d187d5 | 2016-08-22 21:19:17 +0300 | [diff] [blame] | 63 | while (cmd | getline > 0) { |
Alexander Kapshuk | 2ca46ed | 2019-01-05 19:09:23 +0200 | [diff] [blame] | 64 | if (match($0, vernum)) { |
Alexander Kapshuk | 2d187d5 | 2016-08-22 21:19:17 +0300 | [diff] [blame] | 65 | ver = substr($0, RSTART, RLENGTH) |
| 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 | } |