diff options
| -rw-r--r-- | Changelog | 10 | ||||
| -rw-r--r-- | busybox.def.h | 2 | ||||
| -rw-r--r-- | lsmod.c | 2 | ||||
| -rw-r--r-- | modutils/lsmod.c | 2 | ||||
| -rw-r--r-- | mount.c | 6 | ||||
| -rw-r--r-- | procps/ps.c | 6 | ||||
| -rw-r--r-- | ps.c | 6 | ||||
| -rw-r--r-- | util-linux/mount.c | 6 | ||||
| -rw-r--r-- | utility.c | 14 |
9 files changed, 28 insertions, 26 deletions
| @@ -1,9 +1,11 @@ | |||
| 1 | 0.43 | 1 | 0.43 |
| 2 | * Busybox can now work perfectly when /proc is disabled, thereby | 2 | * Busybox can now work perfectly when /proc is disabled, thereby |
| 3 | saving a bunch of memory (kernel /proc support is not thin). | 3 | saving a bunch of memory (kernel /proc support is not thin). This |
| 4 | This is done by making use of some nice kernel patches I | 4 | is done by making use of some nice kernel patches I wrote up to |
| 5 | wrote up to support the features that busybox requires and | 5 | support the features that busybox requires and that /proc usually |
| 6 | that /proc usually provides. | 6 | provides. To enable this, turn on BB_FEATURE_USE_DEVPS_PATCH and |
| 7 | patch your kernel with the devps patch in the kernel-patches/ | ||
| 8 | directory. | ||
| 7 | * Wrote basename, killall, and uptime. | 9 | * Wrote basename, killall, and uptime. |
| 8 | * Added freeramdisk, which will free up all memory associated | 10 | * Added freeramdisk, which will free up all memory associated |
| 9 | with a ram disk. Contributed by Emanuele Caratti <wiz@iol.it> | 11 | with a ram disk. Contributed by Emanuele Caratti <wiz@iol.it> |
diff --git a/busybox.def.h b/busybox.def.h index 561c2ed4b..fdbb6fed6 100644 --- a/busybox.def.h +++ b/busybox.def.h | |||
| @@ -114,7 +114,7 @@ | |||
| 114 | // the /proc filesystem and thereby saving lots and lots | 114 | // the /proc filesystem and thereby saving lots and lots |
| 115 | // memory for more important things. | 115 | // memory for more important things. |
| 116 | // You can't use this and USE_PROCFS at the same time... | 116 | // You can't use this and USE_PROCFS at the same time... |
| 117 | //#define BB_FEATURE_USE_DEVPS_N_DEVMTAB | 117 | //#define BB_FEATURE_USE_DEVPS_PATCH |
| 118 | // | 118 | // |
| 119 | // | 119 | // |
| 120 | // enable features that use the /proc filesystem (apps that | 120 | // enable features that use the /proc filesystem (apps that |
| @@ -27,7 +27,7 @@ | |||
| 27 | 27 | ||
| 28 | extern int lsmod_main(int argc, char **argv) | 28 | extern int lsmod_main(int argc, char **argv) |
| 29 | { | 29 | { |
| 30 | #if defined BB_FEATURE_USE_DEVPS_N_DEVMTAB | 30 | #if defined BB_FEATURE_USE_DEVPS_PATCH |
| 31 | char *cmd[] = { "cat", "/dev/modules", "\0" }; | 31 | char *cmd[] = { "cat", "/dev/modules", "\0" }; |
| 32 | #else | 32 | #else |
| 33 | #if ! defined BB_FEATURE_USE_PROCFS | 33 | #if ! defined BB_FEATURE_USE_PROCFS |
diff --git a/modutils/lsmod.c b/modutils/lsmod.c index b8834d304..27fabc1fe 100644 --- a/modutils/lsmod.c +++ b/modutils/lsmod.c | |||
| @@ -27,7 +27,7 @@ | |||
| 27 | 27 | ||
| 28 | extern int lsmod_main(int argc, char **argv) | 28 | extern int lsmod_main(int argc, char **argv) |
| 29 | { | 29 | { |
| 30 | #if defined BB_FEATURE_USE_DEVPS_N_DEVMTAB | 30 | #if defined BB_FEATURE_USE_DEVPS_PATCH |
| 31 | char *cmd[] = { "cat", "/dev/modules", "\0" }; | 31 | char *cmd[] = { "cat", "/dev/modules", "\0" }; |
| 32 | #else | 32 | #else |
| 33 | #if ! defined BB_FEATURE_USE_PROCFS | 33 | #if ! defined BB_FEATURE_USE_PROCFS |
| @@ -46,7 +46,7 @@ | |||
| 46 | #include <sys/mount.h> | 46 | #include <sys/mount.h> |
| 47 | #include <ctype.h> | 47 | #include <ctype.h> |
| 48 | #include <fstab.h> | 48 | #include <fstab.h> |
| 49 | #if defined BB_FEATURE_USE_DEVPS_N_DEVMTAB | 49 | #if defined BB_FEATURE_USE_DEVPS_PATCH |
| 50 | #include <linux/devmtab.h> | 50 | #include <linux/devmtab.h> |
| 51 | #endif | 51 | #endif |
| 52 | 52 | ||
| @@ -255,7 +255,7 @@ mount_one(char *blockDevice, char *directory, char *filesystemType, | |||
| 255 | fclose(f); | 255 | fclose(f); |
| 256 | } else | 256 | } else |
| 257 | #endif | 257 | #endif |
| 258 | #if defined BB_FEATURE_USE_DEVPS_N_DEVMTAB | 258 | #if defined BB_FEATURE_USE_DEVPS_PATCH |
| 259 | if (strcmp(filesystemType, "auto") == 0) { | 259 | if (strcmp(filesystemType, "auto") == 0) { |
| 260 | int fd, i, numfilesystems; | 260 | int fd, i, numfilesystems; |
| 261 | char device[] = "/dev/mtab"; | 261 | char device[] = "/dev/mtab"; |
| @@ -325,7 +325,7 @@ extern int mount_main(int argc, char **argv) | |||
| 325 | /* Only compiled in if BB_MTAB is not defined */ | 325 | /* Only compiled in if BB_MTAB is not defined */ |
| 326 | whine_if_fstab_is_missing(); | 326 | whine_if_fstab_is_missing(); |
| 327 | 327 | ||
| 328 | #if defined BB_FEATURE_USE_DEVPS_N_DEVMTAB | 328 | #if defined BB_FEATURE_USE_DEVPS_PATCH |
| 329 | if (argc == 1) { | 329 | if (argc == 1) { |
| 330 | int fd, i, numfilesystems; | 330 | int fd, i, numfilesystems; |
| 331 | char device[] = "/dev/mtab"; | 331 | char device[] = "/dev/mtab"; |
diff --git a/procps/ps.c b/procps/ps.c index b9ff5bd0b..f01cf99e4 100644 --- a/procps/ps.c +++ b/procps/ps.c | |||
| @@ -38,7 +38,7 @@ | |||
| 38 | #include <sys/ioctl.h> | 38 | #include <sys/ioctl.h> |
| 39 | 39 | ||
| 40 | 40 | ||
| 41 | #if ! defined BB_FEATURE_USE_DEVPS_N_DEVMTAB | 41 | #if ! defined BB_FEATURE_USE_DEVPS_PATCH |
| 42 | 42 | ||
| 43 | /* The following is the first ps implementation -- | 43 | /* The following is the first ps implementation -- |
| 44 | * the one using the /proc virtual filesystem. | 44 | * the one using the /proc virtual filesystem. |
| @@ -184,7 +184,7 @@ extern int ps_main(int argc, char **argv) | |||
| 184 | } | 184 | } |
| 185 | 185 | ||
| 186 | 186 | ||
| 187 | #else /* BB_FEATURE_USE_DEVPS_N_DEVMTAB */ | 187 | #else /* BB_FEATURE_USE_DEVPS_PATCH */ |
| 188 | 188 | ||
| 189 | 189 | ||
| 190 | /* The following is the second ps implementation -- | 190 | /* The following is the second ps implementation -- |
| @@ -284,5 +284,5 @@ extern int ps_main(int argc, char **argv) | |||
| 284 | exit (0); | 284 | exit (0); |
| 285 | } | 285 | } |
| 286 | 286 | ||
| 287 | #endif /* BB_FEATURE_USE_DEVPS_N_DEVMTAB */ | 287 | #endif /* BB_FEATURE_USE_DEVPS_PATCH */ |
| 288 | 288 | ||
| @@ -38,7 +38,7 @@ | |||
| 38 | #include <sys/ioctl.h> | 38 | #include <sys/ioctl.h> |
| 39 | 39 | ||
| 40 | 40 | ||
| 41 | #if ! defined BB_FEATURE_USE_DEVPS_N_DEVMTAB | 41 | #if ! defined BB_FEATURE_USE_DEVPS_PATCH |
| 42 | 42 | ||
| 43 | /* The following is the first ps implementation -- | 43 | /* The following is the first ps implementation -- |
| 44 | * the one using the /proc virtual filesystem. | 44 | * the one using the /proc virtual filesystem. |
| @@ -184,7 +184,7 @@ extern int ps_main(int argc, char **argv) | |||
| 184 | } | 184 | } |
| 185 | 185 | ||
| 186 | 186 | ||
| 187 | #else /* BB_FEATURE_USE_DEVPS_N_DEVMTAB */ | 187 | #else /* BB_FEATURE_USE_DEVPS_PATCH */ |
| 188 | 188 | ||
| 189 | 189 | ||
| 190 | /* The following is the second ps implementation -- | 190 | /* The following is the second ps implementation -- |
| @@ -284,5 +284,5 @@ extern int ps_main(int argc, char **argv) | |||
| 284 | exit (0); | 284 | exit (0); |
| 285 | } | 285 | } |
| 286 | 286 | ||
| 287 | #endif /* BB_FEATURE_USE_DEVPS_N_DEVMTAB */ | 287 | #endif /* BB_FEATURE_USE_DEVPS_PATCH */ |
| 288 | 288 | ||
diff --git a/util-linux/mount.c b/util-linux/mount.c index f46664bf4..c29be5106 100644 --- a/util-linux/mount.c +++ b/util-linux/mount.c | |||
| @@ -46,7 +46,7 @@ | |||
| 46 | #include <sys/mount.h> | 46 | #include <sys/mount.h> |
| 47 | #include <ctype.h> | 47 | #include <ctype.h> |
| 48 | #include <fstab.h> | 48 | #include <fstab.h> |
| 49 | #if defined BB_FEATURE_USE_DEVPS_N_DEVMTAB | 49 | #if defined BB_FEATURE_USE_DEVPS_PATCH |
| 50 | #include <linux/devmtab.h> | 50 | #include <linux/devmtab.h> |
| 51 | #endif | 51 | #endif |
| 52 | 52 | ||
| @@ -255,7 +255,7 @@ mount_one(char *blockDevice, char *directory, char *filesystemType, | |||
| 255 | fclose(f); | 255 | fclose(f); |
| 256 | } else | 256 | } else |
| 257 | #endif | 257 | #endif |
| 258 | #if defined BB_FEATURE_USE_DEVPS_N_DEVMTAB | 258 | #if defined BB_FEATURE_USE_DEVPS_PATCH |
| 259 | if (strcmp(filesystemType, "auto") == 0) { | 259 | if (strcmp(filesystemType, "auto") == 0) { |
| 260 | int fd, i, numfilesystems; | 260 | int fd, i, numfilesystems; |
| 261 | char device[] = "/dev/mtab"; | 261 | char device[] = "/dev/mtab"; |
| @@ -325,7 +325,7 @@ extern int mount_main(int argc, char **argv) | |||
| 325 | /* Only compiled in if BB_MTAB is not defined */ | 325 | /* Only compiled in if BB_MTAB is not defined */ |
| 326 | whine_if_fstab_is_missing(); | 326 | whine_if_fstab_is_missing(); |
| 327 | 327 | ||
| 328 | #if defined BB_FEATURE_USE_DEVPS_N_DEVMTAB | 328 | #if defined BB_FEATURE_USE_DEVPS_PATCH |
| 329 | if (argc == 1) { | 329 | if (argc == 1) { |
| 330 | int fd, i, numfilesystems; | 330 | int fd, i, numfilesystems; |
| 331 | char device[] = "/dev/mtab"; | 331 | char device[] = "/dev/mtab"; |
| @@ -58,7 +58,7 @@ | |||
| 58 | 58 | ||
| 59 | /* Busybox mount uses either /proc/filesystems or /dev/mtab to get the | 59 | /* Busybox mount uses either /proc/filesystems or /dev/mtab to get the |
| 60 | * list of available filesystems used for the -t auto option */ | 60 | * list of available filesystems used for the -t auto option */ |
| 61 | #if defined BB_FEATURE_USE_PROCFS && defined BB_FEATURE_USE_DEVPS_N_DEVMTAB | 61 | #if defined BB_FEATURE_USE_PROCFS && defined BB_FEATURE_USE_DEVPS_PATCH |
| 62 | //#error Sorry, but busybox can't use both /proc and /dev/ps at the same time -- Pick one and try again. | 62 | //#error Sorry, but busybox can't use both /proc and /dev/ps at the same time -- Pick one and try again. |
| 63 | #error "Sorry, but busybox can't use both /proc and /dev/ps at the same time -- Pick one and try again." | 63 | #error "Sorry, but busybox can't use both /proc and /dev/ps at the same time -- Pick one and try again." |
| 64 | #endif | 64 | #endif |
| @@ -71,10 +71,10 @@ const char mtab_file[] = "/proc/mounts"; | |||
| 71 | # if defined BB_MTAB | 71 | # if defined BB_MTAB |
| 72 | const char mtab_file[] = "/etc/mtab"; | 72 | const char mtab_file[] = "/etc/mtab"; |
| 73 | # else | 73 | # else |
| 74 | # if defined BB_FEATURE_USE_DEVPS_N_DEVMTAB | 74 | # if defined BB_FEATURE_USE_DEVPS_PATCH |
| 75 | const char mtab_file[] = "/dev/mtab"; | 75 | const char mtab_file[] = "/dev/mtab"; |
| 76 | # else | 76 | # else |
| 77 | # error With (BB_MOUNT||BB_UMOUNT||BB_DF) defined, you must define either BB_MTAB or ( BB_FEATURE_USE_PROCFS | BB_FEATURE_USE_DEVPS_N_DEVMTAB) | 77 | # error With (BB_MOUNT||BB_UMOUNT||BB_DF) defined, you must define either BB_MTAB or ( BB_FEATURE_USE_PROCFS | BB_FEATURE_USE_DEVPS_PATCH) |
| 78 | # endif | 78 | # endif |
| 79 | # endif | 79 | # endif |
| 80 | # endif | 80 | # endif |
| @@ -1249,11 +1249,11 @@ extern int device_open(char *device, int mode) | |||
| 1249 | 1249 | ||
| 1250 | #if defined BB_KILLALL || defined BB_FEATURE_LINUXRC && ( defined BB_HALT || defined BB_REBOOT || defined BB_POWEROFF ) | 1250 | #if defined BB_KILLALL || defined BB_FEATURE_LINUXRC && ( defined BB_HALT || defined BB_REBOOT || defined BB_POWEROFF ) |
| 1251 | 1251 | ||
| 1252 | #ifdef BB_FEATURE_USE_DEVPS_N_DEVMTAB | 1252 | #ifdef BB_FEATURE_USE_DEVPS_PATCH |
| 1253 | #include <linux/devps.h> | 1253 | #include <linux/devps.h> |
| 1254 | #endif | 1254 | #endif |
| 1255 | 1255 | ||
| 1256 | #if defined BB_FEATURE_USE_DEVPS_N_DEVMTAB | 1256 | #if defined BB_FEATURE_USE_DEVPS_PATCH |
| 1257 | /* findPidByName() | 1257 | /* findPidByName() |
| 1258 | * | 1258 | * |
| 1259 | * This finds the pid of the specified process, | 1259 | * This finds the pid of the specified process, |
| @@ -1314,7 +1314,7 @@ extern pid_t findPidByName( char* pidName) | |||
| 1314 | 1314 | ||
| 1315 | return thePid; | 1315 | return thePid; |
| 1316 | } | 1316 | } |
| 1317 | #else /* BB_FEATURE_USE_DEVPS_N_DEVMTAB */ | 1317 | #else /* BB_FEATURE_USE_DEVPS_PATCH */ |
| 1318 | #if ! defined BB_FEATURE_USE_PROCFS | 1318 | #if ! defined BB_FEATURE_USE_PROCFS |
| 1319 | #error Sorry, I depend on the /proc filesystem right now. | 1319 | #error Sorry, I depend on the /proc filesystem right now. |
| 1320 | #endif | 1320 | #endif |
| @@ -1362,7 +1362,7 @@ extern pid_t findPidByName( char* pidName) | |||
| 1362 | } | 1362 | } |
| 1363 | return 0; | 1363 | return 0; |
| 1364 | } | 1364 | } |
| 1365 | #endif /* BB_FEATURE_USE_DEVPS_N_DEVMTAB */ | 1365 | #endif /* BB_FEATURE_USE_DEVPS_PATCH */ |
| 1366 | #endif /* BB_INIT || BB_HALT || BB_REBOOT || BB_KILLALL || BB_POWEROFF */ | 1366 | #endif /* BB_INIT || BB_HALT || BB_REBOOT || BB_KILLALL || BB_POWEROFF */ |
| 1367 | 1367 | ||
| 1368 | #if defined BB_GUNZIP \ | 1368 | #if defined BB_GUNZIP \ |
