Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1432734

[PATCH 30/32] ver_linux: build a list of kernel modules as a string and print it

From Alexander Kapshuk <alexander.kapshuk@gmail.com>
Newsgroups linux.kernel
Subject [PATCH 30/32] ver_linux: build a list of kernel modules as a string and print it
Date 2016-06-28 12:30 +0200
Message-ID <rOYrh-5Ep-73@gated-at.bofh.it> (permalink)
References <rOYrf-5Ep-13@gated-at.bofh.it>
Organization linux.* mail to news gateway

Show all headers | View raw


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@gmail.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

Back to linux.kernel | Previous | NextPrevious in thread | Next in thread | Find similar | Unroll thread


Thread

[PATCH 01/32] ver_linux: complete awk implementation Alexander Kapshuk <alexander.kapshuk@gmail.com> - 2016-06-28 12:30 +0200
  [PATCH 09/32] ver_linux: wrap up call to 'tune2fs' in awk function Alexander Kapshuk <alexander.kapshuk@gmail.com> - 2016-06-28 12:30 +0200
  [PATCH 17/32] ver_linux: wrap up call to 'pppd --version' in awk function Alexander Kapshuk <alexander.kapshuk@gmail.com> - 2016-06-28 12:30 +0200
  [PATCH 32/32] ver_linux: 'printversion()' function definition Alexander Kapshuk <alexander.kapshuk@gmail.com> - 2016-06-28 12:30 +0200
    Re: [PATCH 32/32] ver_linux: 'printversion()' function definition Valdis.Kletnieks@vt.edu - 2016-06-28 14:50 +0200
      Re: [PATCH 32/32] ver_linux: 'printversion()' function definition Alexander Kapshuk <alexander.kapshuk@gmail.com> - 2016-06-28 16:50 +0200
        Re: [PATCH 32/32] ver_linux: 'printversion()' function definition Valdis.Kletnieks@vt.edu - 2016-06-28 16:50 +0200
          Re: [PATCH 32/32] ver_linux: 'printversion()' function definition Alexander Kapshuk <alexander.kapshuk@gmail.com> - 2016-07-02 09:40 +0200
  [PATCH 27/32] ver_linux: wrap up call to 'expr --v' in awk function Alexander Kapshuk <alexander.kapshuk@gmail.com> - 2016-06-28 12:30 +0200
  [PATCH 02/32] ver_linux: assign the usage message to a variable and print it Alexander Kapshuk <alexander.kapshuk@gmail.com> - 2016-06-28 12:30 +0200
  [PATCH 11/32] ver_linux: wrap up call to 'reiserfsck -V' in awk function Alexander Kapshuk <alexander.kapshuk@gmail.com> - 2016-06-28 12:30 +0200
  [PATCH 08/32] ver_linux: wrap up call to 'depmod -V' in awk function Alexander Kapshuk <alexander.kapshuk@gmail.com> - 2016-06-28 12:30 +0200
  [PATCH 25/32] ver_linux: wrap up call to 'loadkeys -V' in awk function Alexander Kapshuk <alexander.kapshuk@gmail.com> - 2016-06-28 12:30 +0200
  [PATCH 14/32] ver_linux: wrap up call to 'pccardctl -V' in awk function Alexander Kapshuk <alexander.kapshuk@gmail.com> - 2016-06-28 12:30 +0200
  [PATCH 18/32] ver_linux: wrap up call to 'isdnctrl' in awk function Alexander Kapshuk <alexander.kapshuk@gmail.com> - 2016-06-28 12:30 +0200
  [PATCH 12/32] ver_linux: wrap up call to 'fsck.reiser4 -V' in awk function Alexander Kapshuk <alexander.kapshuk@gmail.com> - 2016-06-28 12:30 +0200
  [PATCH 10/32] ver_linux: wrap up call to 'fsck.jfs -V' in awk function Alexander Kapshuk <alexander.kapshuk@gmail.com> - 2016-06-28 12:30 +0200
  [PATCH 06/32] ver_linux: wrap up call to 'ld -v' in awk function Alexander Kapshuk <alexander.kapshuk@gmail.com> - 2016-06-28 12:30 +0200
  [PATCH 21/32] ver_linux: wrap up call to 'ldd --version' in awk function Alexander Kapshuk <alexander.kapshuk@gmail.com> - 2016-06-28 12:30 +0200
  [PATCH 07/32] ver_linux: wrap up call to 'mount --version' in awk function Alexander Kapshuk <alexander.kapshuk@gmail.com> - 2016-06-28 12:30 +0200
  [PATCH 30/32] ver_linux: build a list of kernel modules as a string and print it Alexander Kapshuk <alexander.kapshuk@gmail.com> - 2016-06-28 12:30 +0200
  [PATCH 28/32] ver_linux: wrap up call to 'udevadm --version' in awk function Alexander Kapshuk <alexander.kapshuk@gmail.com> - 2016-06-28 12:30 +0200
  [PATCH 15/32] ver_linux: wrap up call to 'cardmgr -V' in awk function Alexander Kapshuk <alexander.kapshuk@gmail.com> - 2016-06-28 12:30 +0200
  [PATCH 23/32] ver_linux: wrap up call to 'ps --version' in awk function Alexander Kapshuk <alexander.kapshuk@gmail.com> - 2016-06-28 12:30 +0200
  [PATCH 31/32] ver_linux: 'version()' function definition Alexander Kapshuk <alexander.kapshuk@gmail.com> - 2016-06-28 12:30 +0200
  [PATCH 26/32] ver_linux: wrap up call to 'oprofiled --version' in awk function Alexander Kapshuk <alexander.kapshuk@gmail.com> - 2016-06-28 12:30 +0200
  [PATCH 19/32] ver_linux: wrap up call to 'showmount --version' in awk function Alexander Kapshuk <alexander.kapshuk@gmail.com> - 2016-06-28 12:30 +0200
  [PATCH 13/32] ver_linux: wrap up call to 'xfs_db -V' in awk function Alexander Kapshuk <alexander.kapshuk@gmail.com> - 2016-06-28 12:30 +0200
  [PATCH 05/32] ver_linux: wrap up call to 'make --version' in awk function Alexander Kapshuk <alexander.kapshuk@gmail.com> - 2016-06-28 12:30 +0200
  [PATCH 03/32] ver_linux: execute 'uname -a' from awk Alexander Kapshuk <alexander.kapshuk@gmail.com> - 2016-06-28 12:30 +0200
  [PATCH 20/32] ver_linux: wrap up querying for version of 'Linux C Library' in awk function Alexander Kapshuk <alexander.kapshuk@gmail.com> - 2016-06-28 12:30 +0200

csiph-web