[PATCH 2/2] tools: add kmod info

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



From: Caio Marcelo de Oliveira Filho <cmarcelo@xxxxxxxxx>

---
 man/kmod.xml    |  6 ++++++
 tools/kmod.c    |  1 +
 tools/kmod.h    |  1 +
 tools/modinfo.c | 11 +++++++++--
 4 files changed, 17 insertions(+), 2 deletions(-)

diff --git a/man/kmod.xml b/man/kmod.xml
index 0706ad5..caa07a4 100644
--- a/man/kmod.xml
+++ b/man/kmod.xml
@@ -72,6 +72,12 @@
         </listitem>
       </varlistentry>
       <varlistentry>
+        <term><command>info</command></term>
+        <listitem>
+          <para>Show information about a module.</para>
+        </listitem>
+      </varlistentry>
+      <varlistentry>
         <term><command>list</command></term>
         <listitem>
           <para>List the currently loaded modules.</para>
diff --git a/tools/kmod.c b/tools/kmod.c
index 521c2b9..1b5c346 100644
--- a/tools/kmod.c
+++ b/tools/kmod.c
@@ -40,6 +40,7 @@ static const struct kmod_cmd kmod_cmd_help;
 
 static const struct kmod_cmd *kmod_cmds[] = {
 	&kmod_cmd_help,
+	&kmod_cmd_info,
 	&kmod_cmd_list,
 	&kmod_cmd_static_nodes,
 };
diff --git a/tools/kmod.h b/tools/kmod.h
index 71bc0c1..f57a92e 100644
--- a/tools/kmod.h
+++ b/tools/kmod.h
@@ -36,6 +36,7 @@ extern const struct kmod_cmd kmod_cmd_compat_modinfo;
 extern const struct kmod_cmd kmod_cmd_compat_modprobe;
 extern const struct kmod_cmd kmod_cmd_compat_depmod;
 
+extern const struct kmod_cmd kmod_cmd_info;
 extern const struct kmod_cmd kmod_cmd_list;
 extern const struct kmod_cmd kmod_cmd_static_nodes;
 
diff --git a/tools/modinfo.c b/tools/modinfo.c
index 94d55c9..9a32143 100644
--- a/tools/modinfo.c
+++ b/tools/modinfo.c
@@ -330,7 +330,7 @@ static const struct option cmdopts[] = {
 static void help(void)
 {
 	printf("Usage:\n"
-		"\t%s [options] filename [args]\n"
+		"\t%s%s [options] filename [args]\n"
 		"Options:\n"
 		"\t-a, --author                Print only 'author'\n"
 		"\t-d, --description           Print only 'description'\n"
@@ -343,7 +343,8 @@ static void help(void)
 		"\t-b, --basedir=DIR           Use DIR as filesystem root for /lib/modules\n"
 		"\t-V, --version               Show version\n"
 		"\t-h, --help                  Show this help\n",
-		program_invocation_short_name);
+		program_invocation_short_name,
+		is_kmod_cmd() ? " info" : "");
 }
 
 static bool is_module_filename(const char *name)
@@ -464,3 +465,9 @@ const struct kmod_cmd kmod_cmd_compat_modinfo = {
 	.cmd = do_modinfo,
 	.help = "compat modinfo command",
 };
+
+const struct kmod_cmd kmod_cmd_info = {
+	.name = "info",
+	.cmd = do_modinfo,
+	.help = "show information about a module",
+};
-- 
2.2.2

--
To unsubscribe from this list: send the line "unsubscribe linux-modules" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html




[Index of Archives]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]     [Big List of Linux Books]

  Powered by Linux