+0.43
+ * Wrote basename
+ * tar wouldn't create directory entries that don't end in '/',
+ now it does (fix thanks to Avery Pennarun <apenwarr@worldvisions.ca>)
+ * Several fixes from Pavel Roskin <pavel_roskin@geocities.com>:
+ - When `tail' fails to open a file it now exits.
+ - When `syslogd' is given the `-n' option it should still use
+ fork() for running klogd.
+ * nslookup types are now changed to u_int32_t (instead of uint32_t)
+ changed per a patch from Pascal Bellard <pascal.bellard@ascend.com>
+
+ -Erik Andersen
+
+
0.42
* Fairly massive restructuring of umount.c to deal with remounting
#
# PROG := busybox
-VERSION := 0.42
+VERSION := 0.43
BUILDTIME := $(shell TZ=GMT date "+%Y%m%d-%H%M")
# Set the following to `true' to make a debuggable build.
endif
LIBRARIES =
-OBJECTS = $(shell ./busybox.sh) messages.o utility.o
+OBJECTS = $(shell ./busybox.sh) busybox.o messages.o utility.o
CFLAGS += -DBB_VER='"$(VERSION)"'
CFLAGS += -DBB_BT='"$(BUILDTIME)"'
ifdef BB_INIT_SCRIPT
* killall
* stty
* tr
+* cut
* expr (maybe?) (ash builtin?)
+-----------------------
+
+
+busybox.defs.h is too big and hard to follow.
+
+I either need to add a better build system (like the Linux kernel?)
+or I need to split up busybox.defs.h into coherent chunks (i.e.
+busybox.defs.h just has a bunch of:
+
+#include "fileutils.h"
+#include "shellutils.h"
+
+which would then have smaller sets of #defines...
+Hmm. Needs to be carefully thought out.
+
+-----------------------
+
+
Some known bugs, todo items, etc...
There is no exclude file(s) option to tar. LRP's packaging system can not
function without this. Will you have the time to add this soon?
+
+-----------------------
+
+
+/bin/busybox --install -s which makes all links to commands that it
+ can support (an optionnal -s should be used for symbolic links instead
+ of hard links).
+
+-----------------------
+
+cd /mnt
+mkdir BACKUP
+mv * BACKUP
+
+Today, "mv" behaved as a cp -a and my disk becomed full. It does not
+work properly either when renaming a directory into something else
+(it produces a lot of disk activity when doing this).
+
+
static const struct Applet applets[] = {
+#ifdef BB_BASENAME //usr/bin/basename
+ {"basename", basename_main},
+#endif
#ifdef BB_BUSYBOX //bin
{"busybox", busybox_main},
#endif
*/
if (S_ISDIR(mode)) {
if (createPath(outName, mode) == TRUE) {
+ /* make the final component, just in case it was
+ * omitted by createPath() (which will skip the
+ * directory if it doesn't have a terminating '/')
+ */
+ mkdir(outName, mode);
+
/* Set the file time */
utb.actime = mtime;
utb.modtime = mtime;
static const struct Applet applets[] = {
+#ifdef BB_BASENAME //usr/bin/basename
+ {"basename", basename_main},
+#endif
#ifdef BB_BUSYBOX //bin
{"busybox", busybox_main},
#endif
//
//
// BusyBox Applications
-#define BB_BUSYBOX
+//#define BB_BASENAME
#define BB_CAT
#define BB_CHMOD_CHOWN_CHGRP
#define BB_CHROOT
Name: busybox
-Version: 0.42
+Version: 0.43
Release: 1
Group: System/Utilities
Summary: BusyBox is a tiny suite of Unix utilities in a multi-call binary.
/* Not standard input. */
fd = open(filename, O_RDONLY);
if (fd == -1)
- errorMsg("open error");
+ fatalError("open error");
errors = tail_lines(filename, fd, (long) n_units);
close(fd);
Name: busybox
-Version: 0.42
+Version: 0.43
Release: 1
Group: System/Utilities
Summary: BusyBox is a tiny suite of Unix utilities in a multi-call binary.
static char *secondConsole = VT_SECONDARY;
static char *log = VT_LOG;
static int kernelVersion = 0;
-static char termType[32] = "TERM=ansi";
+static char termType[32] = "TERM=linux";
static char console[32] = _PATH_CONSOLE;
static void delete_initAction(initAction * action);
if (ioctl(0, TIOCGSERIAL, &sr) == 0) {
log = NULL;
secondConsole = NULL;
+ /* Force the TERM setting to vt102 for serial console */
+ snprintf(termType, sizeof(termType) - 1, "TERM=vt102");
message(LOG | CONSOLE,
"serial console detected. Disabling virtual terminals.\r\n");
}
/* Hello world */
#ifndef DEBUG_INIT
- message(LOG | CONSOLE,
+ message(LOG,
"init started: BusyBox v%s (%s) multi-call binary\r\n",
BB_VER, BB_BT);
#else
- message(LOG | CONSOLE,
+ message(LOG,
"init(%d) started: BusyBox v%s (%s) multi-call binary\r\n",
getpid(), BB_VER, BB_BT);
#endif
/* Mount /proc */
if (mount("proc", "/proc", "proc", 0, 0) == 0) {
- message(LOG | CONSOLE, "Mounting /proc: done.\n");
+ message(LOG, "Mounting /proc: done.\n");
kernelVersion = get_kernel_revision();
} else
message(LOG | CONSOLE, "Mounting /proc: failed!\n");
static char *secondConsole = VT_SECONDARY;
static char *log = VT_LOG;
static int kernelVersion = 0;
-static char termType[32] = "TERM=ansi";
+static char termType[32] = "TERM=linux";
static char console[32] = _PATH_CONSOLE;
static void delete_initAction(initAction * action);
if (ioctl(0, TIOCGSERIAL, &sr) == 0) {
log = NULL;
secondConsole = NULL;
+ /* Force the TERM setting to vt102 for serial console */
+ snprintf(termType, sizeof(termType) - 1, "TERM=vt102");
message(LOG | CONSOLE,
"serial console detected. Disabling virtual terminals.\r\n");
}
/* Hello world */
#ifndef DEBUG_INIT
- message(LOG | CONSOLE,
+ message(LOG,
"init started: BusyBox v%s (%s) multi-call binary\r\n",
BB_VER, BB_BT);
#else
- message(LOG | CONSOLE,
+ message(LOG,
"init(%d) started: BusyBox v%s (%s) multi-call binary\r\n",
getpid(), BB_VER, BB_BT);
#endif
/* Mount /proc */
if (mount("proc", "/proc", "proc", 0, 0) == 0) {
- message(LOG | CONSOLE, "Mounting /proc: done.\n");
+ message(LOG, "Mounting /proc: done.\n");
kernelVersion = get_kernel_revision();
} else
message(LOG | CONSOLE, "Mounting /proc: failed!\n");
int (*main)(int argc, char** argv);
};
+extern int basename_main(int argc, char **argv);
extern int busybox_main(int argc, char** argv);
extern int block_device_main(int argc, char** argv);
extern int cat_main(int argc, char** argv);
/* only works for IPv4 */
static int addr_fprint(char *addr, FILE * dst)
{
- uint8_t split[4];
- uint32_t ip;
- uint32_t *x = (uint32_t *) addr;
+ u_int8_t split[4];
+ u_int32_t ip;
+ u_int32_t *x = (u_int32_t *) addr;
ip = ntohl(*x);
split[0] = (ip & 0xff000000) >> 24;
}
/* changes a c-string matching the perl regex \d+\.\d+\.\d+\.\d+
- * into a uint32_t
+ * into a u_int32_t
*/
-static uint32_t str_to_addr(const char *addr)
+static u_int32_t str_to_addr(const char *addr)
{
- uint32_t split[4];
- uint32_t ip;
+ u_int32_t split[4];
+ u_int32_t ip;
sscanf(addr, "%d.%d.%d.%d",
&split[0], &split[1], &split[2], &split[3]);
return 0;
}
-/* $Id: nslookup.c,v 1.4 2000/02/08 19:58:47 erik Exp $ */
+/* $Id: nslookup.c,v 1.5 2000/02/18 21:34:17 erik Exp $ */
/* only works for IPv4 */
static int addr_fprint(char *addr, FILE * dst)
{
- uint8_t split[4];
- uint32_t ip;
- uint32_t *x = (uint32_t *) addr;
+ u_int8_t split[4];
+ u_int32_t ip;
+ u_int32_t *x = (u_int32_t *) addr;
ip = ntohl(*x);
split[0] = (ip & 0xff000000) >> 24;
}
/* changes a c-string matching the perl regex \d+\.\d+\.\d+\.\d+
- * into a uint32_t
+ * into a u_int32_t
*/
-static uint32_t str_to_addr(const char *addr)
+static u_int32_t str_to_addr(const char *addr)
{
- uint32_t split[4];
- uint32_t ip;
+ u_int32_t split[4];
+ u_int32_t ip;
sscanf(addr, "%d.%d.%d.%d",
&split[0], &split[1], &split[2], &split[3]);
return 0;
}
-/* $Id: nslookup.c,v 1.4 2000/02/08 19:58:47 erik Exp $ */
+/* $Id: nslookup.c,v 1.5 2000/02/18 21:34:17 erik Exp $ */
*p++ = '\0';
}
+#ifdef BB_KLOGD
+ /* Start up the klogd process */
+ if (startKlogd == TRUE) {
+ klogd_pid = fork();
+ if (klogd_pid == 0) {
+ strncpy(argv[0], "klogd", strlen(argv[0]));
+ doKlogd();
+ }
+ }
+#endif
+
if (doFork == TRUE) {
pid = fork();
if (pid < 0)
doSyslogd();
}
-#ifdef BB_KLOGD
- /* Start up the klogd process */
- if (startKlogd == TRUE) {
- klogd_pid = fork();
- if (klogd_pid == 0) {
- strncpy(argv[0], "klogd", strlen(argv[0]));
- doKlogd();
- }
- }
-#endif
-
exit(TRUE);
}
*p++ = '\0';
}
+#ifdef BB_KLOGD
+ /* Start up the klogd process */
+ if (startKlogd == TRUE) {
+ klogd_pid = fork();
+ if (klogd_pid == 0) {
+ strncpy(argv[0], "klogd", strlen(argv[0]));
+ doKlogd();
+ }
+ }
+#endif
+
if (doFork == TRUE) {
pid = fork();
if (pid < 0)
doSyslogd();
}
-#ifdef BB_KLOGD
- /* Start up the klogd process */
- if (startKlogd == TRUE) {
- klogd_pid = fork();
- if (klogd_pid == 0) {
- strncpy(argv[0], "klogd", strlen(argv[0]));
- doKlogd();
- }
- }
-#endif
-
exit(TRUE);
}
/* Not standard input. */
fd = open(filename, O_RDONLY);
if (fd == -1)
- errorMsg("open error");
+ fatalError("open error");
errors = tail_lines(filename, fd, (long) n_units);
close(fd);
*/
if (S_ISDIR(mode)) {
if (createPath(outName, mode) == TRUE) {
+ /* make the final component, just in case it was
+ * omitted by createPath() (which will skip the
+ * directory if it doesn't have a terminating '/')
+ */
+ mkdir(outName, mode);
+
/* Set the file time */
utb.actime = mtime;
utb.modtime = mtime;