aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorlandley <landley@69ca8d6d-28ef-0310-b511-8ec308f3f277>2005-05-04 23:55:06 +0000
committerlandley <landley@69ca8d6d-28ef-0310-b511-8ec308f3f277>2005-05-04 23:55:06 +0000
commite6d6f9ae25e0fae2cdefbd3e1e7903b69cdced08 (patch)
treeff4252a2dc6d31f7a8d1785043967757bd26dd58
parentcc06ace9b4d16089d3a7fd53a56a667690da7d4e (diff)
downloadbusybox-w32-e6d6f9ae25e0fae2cdefbd3e1e7903b69cdced08.tar.gz
busybox-w32-e6d6f9ae25e0fae2cdefbd3e1e7903b69cdced08.tar.bz2
busybox-w32-e6d6f9ae25e0fae2cdefbd3e1e7903b69cdced08.zip
Tweak the "pretty lsmod for 2.6" patch to be seperately selectable.
Patch from Takeharu Kato. git-svn-id: svn://busybox.net/trunk/busybox@10248 69ca8d6d-28ef-0310-b511-8ec308f3f277
-rw-r--r--modutils/Config.in16
-rw-r--r--modutils/lsmod.c3
2 files changed, 14 insertions, 5 deletions
diff --git a/modutils/Config.in b/modutils/Config.in
index 81214f73a..986b65c6a 100644
--- a/modutils/Config.in
+++ b/modutils/Config.in
@@ -18,6 +18,13 @@ config CONFIG_FEATURE_2_4_MODULES
18 help 18 help
19 Support module loading for 2.2.x and 2.4.x Linux kernels. 19 Support module loading for 2.2.x and 2.4.x Linux kernels.
20 20
21config CONFIG_FEATURE_2_6_MODULES
22 bool " Support version 2.6.x Linux kernels"
23 default n
24 depends on CONFIG_INSMOD
25 help
26 Support module loading for newer 2.6.x Linux kernels.
27
21config CONFIG_FEATURE_INSMOD_VERSION_CHECKING 28config CONFIG_FEATURE_INSMOD_VERSION_CHECKING
22 bool " Module version checking" 29 bool " Module version checking"
23 default n 30 default n
@@ -73,12 +80,13 @@ config CONFIG_LSMOD
73 help 80 help
74 lsmod is used to display a list of loaded modules. 81 lsmod is used to display a list of loaded modules.
75 82
76config CONFIG_FEATURE_2_6_MODULES 83config CONFIG_FEATURE_LSMOD_PRETTY_2_6_OUTPUT
77 bool " Support version 2.6.x Linux kernels" 84 bool " lsmod pretty output for 2.6.x Linux kernels "
78 default n 85 default n
79 depends on CONFIG_INSMOD || CONFIG_LSMOD 86 depends on CONFIG_LSMOD
80 help 87 help
81 Support module loading for newer 2.6.x Linux kernels. 88 This option makes output format of lsmod adjusted to
89 the format of module-init-tools for Linux kernel 2.6.
82 90
83config CONFIG_FEATURE_QUERY_MODULE_INTERFACE 91config CONFIG_FEATURE_QUERY_MODULE_INTERFACE
84 bool 92 bool
diff --git a/modutils/lsmod.c b/modutils/lsmod.c
index 525fc2dc2..f2ee19f8f 100644
--- a/modutils/lsmod.c
+++ b/modutils/lsmod.c
@@ -164,7 +164,7 @@ extern int lsmod_main(int argc, char **argv)
164{ 164{
165 printf("Module Size Used by"); 165 printf("Module Size Used by");
166 check_tainted(); 166 check_tainted();
167#if defined(CONFIG_FEATURE_2_6_MODULES) 167#if defined(CONFIG_FEATURE_LSMOD_PRETTY_2_6_OUTPUT)
168 { 168 {
169 FILE *file; 169 FILE *file;
170 char line[4096]; 170 char line[4096];
@@ -204,6 +204,7 @@ extern int lsmod_main(int argc, char **argv)
204 } 204 }
205 fclose(file); 205 fclose(file);
206 } 206 }
207 return 0; /* Success */
207#else 208#else
208 if (bb_xprint_file_by_name("/proc/modules") < 0) { 209 if (bb_xprint_file_by_name("/proc/modules") < 0) {
209 return 0; 210 return 0;