diff options
author | Erik Andersen <andersen@codepoet.org> | 2000-03-08 09:42:34 +0300 |
---|---|---|
committer | Erik Andersen <andersen@codepoet.org> | 2000-03-08 09:42:34 +0300 |
commit | 54969a1f6443b98c6874bd611de89b9ce30ca116 (patch) | |
tree | b8803e07d5242f60a9668658c39d3ef33bf21b4b | |
parent | 692a4502b0205f083855a102f906e206733b5b93 (diff) |
Fixed up lsmod so it works with my devmodules kernel driver,
and with /proc.
-Erik
-rw-r--r-- | busybox.def.h | 2 | ||||
-rw-r--r-- | lsmod.c | 11 | ||||
-rw-r--r-- | modutils/lsmod.c | 11 |
3 files changed, 15 insertions, 9 deletions
diff --git a/busybox.def.h b/busybox.def.h index afdc46971..561c2ed4b 100644 --- a/busybox.def.h +++ b/busybox.def.h @@ -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 @@ -25,13 +25,16 @@ #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)); } diff --git a/modutils/lsmod.c b/modutils/lsmod.c index b0b37bdd7..b8834d304 100644 --- a/modutils/lsmod.c +++ b/modutils/lsmod.c @@ -25,13 +25,16 @@ #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)); } |