Fixed up lsmod so it works with my devmodules kernel driver,
authorErik Andersen <andersen@codepoet.org>
Wed, 8 Mar 2000 06:42:34 +0000 (06:42 -0000)
committerErik Andersen <andersen@codepoet.org>
Wed, 8 Mar 2000 06:42:34 +0000 (06:42 -0000)
and with /proc.
 -Erik

busybox.def.h
lsmod.c
modutils/lsmod.c

index afdc46971f24dd444208de827ce82ed0f6217b1f..561c2ed4b3cf16a41a11fd2135e5dd512974b89f 100644 (file)
@@ -51,7 +51,7 @@
 //#define BB_LOGGER
 #define BB_LOGNAME
 #define BB_LS
-#define BB_LSMOD
+//#define BB_LSMOD
 //#define BB_MAKEDEVS
 #define BB_MKFS_MINIX
 //#define BB_MATH
diff --git a/lsmod.c b/lsmod.c
index b0b37bdd78745e3297215f26bbbe6d1a541720ff..b8834d3046cfea116f33ba02e572e622a17c2028 100644 (file)
--- a/lsmod.c
+++ b/lsmod.c
 #include <stdio.h>
 
 
-//#if ! defined BB_FEATURE_USE_PROCFS
-//#error Sorry, I depend on the /proc filesystem right now.
-//#endif
-
 extern int lsmod_main(int argc, char **argv)
 {
+#if defined BB_FEATURE_USE_DEVPS_N_DEVMTAB
+       char *cmd[] = { "cat", "/dev/modules", "\0" };
+#else
+#if ! defined BB_FEATURE_USE_PROCFS
+#error Sorry, I depend on the /proc filesystem right now.
+#endif
        char *cmd[] = { "cat", "/proc/modules", "\0" };
+#endif
 
        exit(cat_main(3, cmd));
 }
index b0b37bdd78745e3297215f26bbbe6d1a541720ff..b8834d3046cfea116f33ba02e572e622a17c2028 100644 (file)
 #include <stdio.h>
 
 
-//#if ! defined BB_FEATURE_USE_PROCFS
-//#error Sorry, I depend on the /proc filesystem right now.
-//#endif
-
 extern int lsmod_main(int argc, char **argv)
 {
+#if defined BB_FEATURE_USE_DEVPS_N_DEVMTAB
+       char *cmd[] = { "cat", "/dev/modules", "\0" };
+#else
+#if ! defined BB_FEATURE_USE_PROCFS
+#error Sorry, I depend on the /proc filesystem right now.
+#endif
        char *cmd[] = { "cat", "/proc/modules", "\0" };
+#endif
 
        exit(cat_main(3, cmd));
 }