[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <1467109146-20331-30-git-send-email-alexander.kapshuk@gmail.com>
Date: Tue, 28 Jun 2016 13:19:04 +0300
From: Alexander Kapshuk <alexander.kapshuk@...il.com>
To: linux-kernel@...r.kernel.org
Cc: gregkh@...uxfoundation.org,
Alexander Kapshuk <alexander.kapshuk@...il.com>
Subject: [PATCH 30/32] ver_linux: build a list of kernel modules as a string and print it
Reimplement the code that generates an alphabetically sorted list of
kernel modules in awk and print the name of this entry and the list of
modules via a function call.
Signed-off-by: Alexander Kapshuk <alexander.kapshuk@...il.com>
---
scripts/ver_linux | 19 +++++++------------
1 file changed, 7 insertions(+), 12 deletions(-)
diff --git a/scripts/ver_linux b/scripts/ver_linux
index 6bba20c..3bf72ad 100755
--- a/scripts/ver_linux
+++ b/scripts/ver_linux
@@ -61,16 +61,11 @@ BEGIN {
printversion("Udev", version("udevadm --version 2>&1"))
printversion("Wireless-tools", version("iwconfig --version 2>&1"))
-test -e /proc/modules &&
-sort /proc/modules |
-sed '
- s/ .*//
- H
-${
- g
- s/^\n/Modules Loaded\t\t/
- y/\n/ /
- q
+ if (system("test -r /proc/modules") == 0) {
+ while ("sort /proc/modules" | getline > 0) {
+ mods = mods sep $1
+ sep = " "
+ }
+ printversion("Modules Loaded", mods)
+ }
}
- d
-'
--
2.7.3
Powered by blists - more mailing lists