diff options
| author | Takashi Iwai <tiwai@suse.de> | 2020-04-24 08:22:16 +0200 |
|---|---|---|
| committer | Takashi Iwai <tiwai@suse.de> | 2020-04-24 08:22:55 +0200 |
| commit | 36dbae9945322e660795e73ffc8ed8ae4f25d13d (patch) | |
| tree | 9e444e68380061dccfaa453d1f02cf21c5c986ef /scripts/ver_linux | |
| parent | 14ff6c5546e7d98f8326d9ee7a75b79de9874efb (diff) | |
| parent | 0d283287a42027e8a618bcdf17b79578041ebabd (diff) | |
| download | cachepc-linux-36dbae9945322e660795e73ffc8ed8ae4f25d13d.tar.gz cachepc-linux-36dbae9945322e660795e73ffc8ed8ae4f25d13d.zip | |
Merge branch 'topic/nhlt' into for-next
Merge NHLT init cleanup.
Signed-off-by: Takashi Iwai <tiwai@suse.de>
Diffstat (limited to 'scripts/ver_linux')
| -rwxr-xr-x | scripts/ver_linux | 24 |
1 files changed, 7 insertions, 17 deletions
diff --git a/scripts/ver_linux b/scripts/ver_linux index 85005d6b7f10..0968a3070eff 100755 --- a/scripts/ver_linux +++ b/scripts/ver_linux @@ -14,6 +14,8 @@ BEGIN { printf("\n") vernum = "[0-9]+([.]?[0-9]+)+" + libc = "libc[.]so[.][0-9]+$" + libcpp = "(libg|stdc)[+]+[.]so[.][0-9]+$" printversion("GNU C", version("gcc -dumpversion")) printversion("GNU Make", version("make --version")) @@ -35,26 +37,14 @@ BEGIN { printversion("Bison", version("bison --version")) printversion("Flex", version("flex --version")) - while (getline <"/proc/self/maps" > 0) { - if (/libc.*\.so$/) { - n = split($0, procmaps, "/") - if (match(procmaps[n], vernum)) { - ver = substr(procmaps[n], RSTART, RLENGTH) - printversion("Linux C Library", ver) - break - } - } + while ("ldconfig -p 2>/dev/null" | getline > 0) { + if ($NF ~ libc && !seen[ver = version("readlink " $NF)]++) + printversion("Linux C Library", ver) + else if ($NF ~ libcpp && !seen[ver = version("readlink " $NF)]++) + printversion("Linux C++ Library", ver) } printversion("Dynamic linker (ldd)", version("ldd --version")) - - while ("ldconfig -p 2>/dev/null" | getline > 0) { - if (/(libg|stdc)[+]+\.so/) { - libcpp = $NF - break - } - } - printversion("Linux C++ Library", version("readlink " libcpp)) printversion("Procps", version("ps --version")) printversion("Net-tools", version("ifconfig --version")) printversion("Kbd", version("loadkeys -V")) |
