ver_linux (3eb66e91a25497065c5322b1268cbc3953642227) ver_linux (2ca46ed207d5d4e3c7a183fe11e8a2d02f86e7c6)
1#!/usr/bin/awk -f
2# SPDX-License-Identifier: GPL-2.0
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
8BEGIN {
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
1#!/usr/bin/awk -f
2# SPDX-License-Identifier: GPL-2.0
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
8BEGIN {
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
16 vernum = "[0-9]+([.]?[0-9]+)+"
17
16 printversion("GNU C", version("gcc -dumpversion"))
17 printversion("GNU Make", version("make --version"))
18 printversion("Binutils", version("ld -v"))
19 printversion("Util-linux", version("mount --version"))
20 printversion("Mount", version("mount --version"))
21 printversion("Module-init-tools", version("depmod -V"))
22 printversion("E2fsprogs", version("tune2fs"))
23 printversion("Jfsutils", version("fsck.jfs -V"))

--- 5 unchanged lines hidden (view full) ---

29 printversion("Quota-tools", version("quota -V"))
30 printversion("PPP", version("pppd --version"))
31 printversion("Isdn4k-utils", version("isdnctrl"))
32 printversion("Nfs-utils", version("showmount --version"))
33
34 while (getline <"/proc/self/maps" > 0) {
35 if (/libc.*\.so$/) {
36 n = split($0, procmaps, "/")
18 printversion("GNU C", version("gcc -dumpversion"))
19 printversion("GNU Make", version("make --version"))
20 printversion("Binutils", version("ld -v"))
21 printversion("Util-linux", version("mount --version"))
22 printversion("Mount", version("mount --version"))
23 printversion("Module-init-tools", version("depmod -V"))
24 printversion("E2fsprogs", version("tune2fs"))
25 printversion("Jfsutils", version("fsck.jfs -V"))

--- 5 unchanged lines hidden (view full) ---

31 printversion("Quota-tools", version("quota -V"))
32 printversion("PPP", version("pppd --version"))
33 printversion("Isdn4k-utils", version("isdnctrl"))
34 printversion("Nfs-utils", version("showmount --version"))
35
36 while (getline <"/proc/self/maps" > 0) {
37 if (/libc.*\.so$/) {
38 n = split($0, procmaps, "/")
37 if (match(procmaps[n], /[0-9]+([.]?[0-9]+)+/)) {
39 if (match(procmaps[n], vernum)) {
38 ver = substr(procmaps[n], RSTART, RLENGTH)
39 printversion("Linux C Library", ver)
40 break
41 }
42 }
43 }
44
45 printversion("Dynamic linker (ldd)", version("ldd --version"))

--- 19 unchanged lines hidden (view full) ---

65 sep = " "
66 }
67 printversion("Modules Loaded", mods)
68}
69
70function version(cmd, ver) {
71 cmd = cmd " 2>&1"
72 while (cmd | getline > 0) {
40 ver = substr(procmaps[n], RSTART, RLENGTH)
41 printversion("Linux C Library", ver)
42 break
43 }
44 }
45 }
46
47 printversion("Dynamic linker (ldd)", version("ldd --version"))

--- 19 unchanged lines hidden (view full) ---

67 sep = " "
68 }
69 printversion("Modules Loaded", mods)
70}
71
72function version(cmd, ver) {
73 cmd = cmd " 2>&1"
74 while (cmd | getline > 0) {
73 if (match($0, /[0-9]+([.]?[0-9]+)+/)) {
75 if (match($0, vernum)) {
74 ver = substr($0, RSTART, RLENGTH)
75 break
76 }
77 }
78 close(cmd)
79 return ver
80}
81
82function printversion(name, value, ofmt) {
83 if (value != "") {
84 ofmt = "%-20s\t%s\n"
85 printf(ofmt, name, value)
86 }
87}
76 ver = substr($0, RSTART, RLENGTH)
77 break
78 }
79 }
80 close(cmd)
81 return ver
82}
83
84function printversion(name, value, ofmt) {
85 if (value != "") {
86 ofmt = "%-20s\t%s\n"
87 printf(ofmt, name, value)
88 }
89}