Commit b1c62384 authored by Ryan Jackson's avatar Ryan Jackson

Lots of changes.

- New versions of linux, busybox, buildroot, hdparm, etc.
- Moved target_template to source tree
- Cleaned up makefiles
parent 0a686447
SOURCE_PATH = $(PWD)/source
SCRIPTS_PATH = $(PWD)/scripts
TOOLCHAIN_BUILD_PATH = $(PWD)/toolchain_build
SOURCE_PATH = $(PWD)/source
TARGET_PATH = $(PWD)/target
TARGET_BUILD_PATH = $(PWD)/build
TARGET_PATH = $(PWD)/target
TEMPLATE_PATH = $(PWD)/target_template
TARGET_INITRAMFS = $(PWD)/target.cpio.gz
FAKEROOT_ENVIRONMENT = $(PWD)/$(BUILD)_fs_fakeroot.env
TARGET_CC = i386-linux-uclibc-gcc
TARGET_CFLAGS = -Os -mtune=i386 -march=i386
TARGET_MODULES = uclibc-install-target zlib-install-target busybox-install dropbear-install linux-modules-install openssl-install-target kexec-install tmcc-install imagezip-install frisbee-install e2fsprogs-install
TARGET_FS_SIZE = 13568
BUILDROOT_PATH = $(PWD)/buildroot
BUILDROOT_VERSION = 20080705
BINUTILS_VERSION = 2.18
GCC_VERSION = 4.2.4
UCLIBC_VERSION = 0.9.29
OPENSSL_VERSION = 0.9.7m
OPENSSL_PATH = $(TARGET_BUILD_PATH)/openssl-$(OPENSSL_VERSION)
DROPBEAR_VERSION = 0.51
DROPBEAR_PATH = $(TARGET_BUILD_PATH)/dropbear-$(DROPBEAR_VERSION)
E2FSPROGS_VERSION = 1.41.1
E2FSPROGS_PATH = $(TARGET_BUILD_PATH)/e2fsprogs-$(E2FSPROGS_VERSION)
BUSYBOX_VERSION = 1.11.0
BUSYBOX_PATH = $(TARGET_BUILD_PATH)/busybox-$(BUSYBOX_VERSION)
ZLIB_VERSION = 1.2.3
ZLIB_PATH = $(TARGET_BUILD_PATH)/zlib-$(ZLIB_VERSION)
FAKEROOT_VERSION = 1.8.1
FAKEROOT_PATH = $(TOOLCHAIN_BUILD_PATH)/fakeroot-$(FAKEROOT_VERSION)
GENEXT2FS_VERSION = 1.4.1
GENEXT2FS_PATH = $(TOOLCHAIN_BUILD_PATH)/genext2fs-$(GENEXT2FS_VERSION)
LINUX_VERSION = 2.6.25.9
LINUX_PATH = $(BUILDROOT_PATH)/toolchain_build_i386/linux-$(LINUX_VERSION)
KEXEC_VERSION = 20080324
KEXEC_PATH = $(TARGET_BUILD_PATH)/kexec-tools-$(KEXEC_VERSION)
STAGING_DIR = $(BUILDROOT_PATH)/build_i386/staging_dir/
#HOSTMAKE=make
#HOSTAR=ar
#HOSTAS=as
#HOSTCC=gcc
#HOSTCXX=g++
#HOSTLD=ld
#HOST_CFLAGS=-g -O2
SCRIPTS_PATH = $(PWD)/scripts
INITRAMFS_PATH = $(PWD)/initramfs.tmp
BUILDROOT_PATH = $(PWD)/buildroot
FAKEROOT_ENVIRONMENT = $(PWD)/fs_fakeroot.env
STAGING_DIR = $(PWD)/buildroot/build_i386/staging_dir
INITRAMFS = $(PWD)/initramfs.gz
BOOT_PATH = $(PWD)/boot
#TOOLCHAIN_PATH="$(STAGING_DIR)/bin:$(STAGING_DIR)/usr/bin:$(PATH)"
MODULES := busybox zlib linux testbed hdparm target_template
INSTALL_MODULES := $(addsuffix -install,$(MODULES))
CLEAN_MODULES := $(addsuffix -clean,$(MODULES))
CROSS_COMPILER_PREFIX=i386-linux-uclibc-
STRIPCMD=$(STAGING_DIR)/usr/bin/$(CROSS_COMPILER_PREFIX)strip
#CC=$(STAGING_DIR)/usr/bin/i386-linux-uclibc-gcc -Os -I$(STAGING_DIR)/usr/include -I$(STAGING_DIR)/include --sysroot=$(STAGING_DIR)/ -isysroot $(STAGING_DIR) -mtune=i386 -march=i386
.PHONY: all clean install root-template-install devices \
root-base root-install $(MODULES) $(INSTALL_MODULES) \
$(CLEAN_MODULES) initramfs
# Hack for building uClibc -- it can't handle parallel make processes.
#MAKE1:=$(HOSTMAKE) MAKE="$(firstword $(HOSTMAKE)) -j1"
all: $(MODULES)
HOSTCC=gcc
install: uclibc-install $(INSTALL_MODULES)
HOST_CONFIGURE_OPTS=PATH=$(STAGING_DIR)/usr/bin:$(PATH) \
AR_FOR_BUILD="$(HOSTAR)" \
AS_FOR_BUILD="$(HOSTAS)" \
CC_FOR_BUILD="$(HOSTCC)" \
GCC_FOR_BUILD="$(HOSTCC)" \
CXX_FOR_BUILD="$(HOSTCXX)" \
LD_FOR_BUILD="$(HOSTLD)" \
CFLAGS_FOR_BUILD="$(HOST_CFLAGS)" \
CXXFLAGS_FOR_BUILD="$(HOST_CXXFLAGS)" \
LDFLAGS_FOR_BUILD="$(HOST_LDFLAGS)" \
AR_FOR_TARGET=$(CROSS_COMPILER_PREFIX)ar \
AS_FOR_TARGET=$(CROSS_COMPILER_PREFIX)as \
LD_FOR_TARGET=$(CROSS_COMPILER_PREFIX)ld \
NM_FOR_TARGET=$(CROSS_COMPILER_PREFIX)nm \
RANLIB_FOR_TARGET=$(CROSS_COMPILER_PREFIX)ranlib \
STRIP_FOR_TARGET=$(CROSS_COMPILER_PREFIX)strip \
OBJCOPY_FOR_TARGET=$(CROSS_COMPILER_PREFIX)objcopy
modules := $(addprefix $(SOURCE_PATH)/, buildroot busybox zlib dropbear linux fakeroot openssl kexec-tools testbed e2fsprogs)
build-env: toolchain build-env-libraries build-tools
build-env-libraries: zlib-install-sysroot openssl-install-sysroot
include $(addsuffix /Rules.mk,$(modules))
clean:
rm -rf $(TARGET_PATH)
rm -f $(FAKEROOT_ENVIRONMENT)
rm -rf $(INITRAMFS_PATH)
rm -f $(INITRAMFS)
rm -rf $(TARGET_BUILD_PATH)
rm -rf $(BOOT_PATH)
.PHONY: all root clean root-template-install toolchain build-tools build-env devices \
root-base root-install
$(MODULES):
$(MAKE) -C $(SOURCE_PATH)/$@ all
all: toolchain
$(CLEAN_MODULES):
$(MAKE) -C $(SOURCE_PATH)/$(subst -clean,,$@) clean
toolchain: buildroot-build
$(INSTALL_MODULES):
$(MAKE) -C $(SOURCE_PATH)/$(subst -install,,$@) install
$(TARGET_PATH)/lib/libc.so.0: toolchain
$(TARGET_PATH)/lib/libc.so.0:
mkdir -p $(TARGET_PATH)/lib
cp -dpR $(BUILDROOT_PATH)/project_build_i386/uclibc/root/lib/* $(TARGET_PATH)/lib
uclibc-install-target: $(TARGET_PATH)/lib/libc.so.0
build-tools: fakeroot-install
uclibc-install: $(TARGET_PATH)/lib/libc.so.0
$(FAKEROOT_ENVIRONMENT):
touch $@
#target-base:
# $(SCRIPTS_PATH)/mk_basic_fs.sh $(TARGET_PATH)
# #rm -f $(FAKEROOT_ENVIRONMENT)
target-install: target-template-install $(TARGET_MODULES)
devices: $(FAKEROOT_ENVIRONMENT)
rm -rf $(TARGET_PATH)/dev
$(STAGING_DIR)/usr/bin/fakeroot -s $(FAKEROOT_ENVIRONMENT) \
......@@ -122,19 +59,19 @@ permissions: $(FAKEROOT_ENVIRONMENT) devices target-install
-i $(FAKEROOT_ENVIRONMENT) \
$(SCRIPTS_PATH)/fixperms.sh $(TARGET_PATH)
target-initramfs:
initramfs: install
rm -rf $(INITRAMFS_PATH)
cp -dpR $(TARGET_PATH) $(INITRAMFS_PATH)
cat /dev/null > $(FAKEROOT_ENVIRONMENT)
rm -rf $(INITRAMFS_PATH)/dev
$(STAGING_DIR)/usr/bin/fakeroot -s $(FAKEROOT_ENVIRONMENT) \
-i $(FAKEROOT_ENVIRONMENT) \
$(SCRIPTS_PATH)/makedevs.sh \
$(SCRIPTS_PATH)/devices $(INITRAMFS_PATH)
$(STAGING_DIR)/usr/bin/fakeroot -s $(FAKEROOT_ENVIRONMENT) \
-i $(FAKEROOT_ENVIRONMENT) \
$(SCRIPTS_PATH)/fixperms.sh $(INITRAMFS_PATH)
$(STAGING_DIR)/usr/bin/fakeroot -i $(FAKEROOT_ENVIRONMENT) \
$(SCRIPTS_PATH)/gen_initramfs.sh $(TARGET_PATH) $(TARGET_INITRAMFS)
target-template-install:
mkdir -p $(TARGET_PATH)
cp -dpR $(TEMPLATE_PATH)/* $(TARGET_PATH)
target: target-install devices permissions
build-env-clean:
rm -rf $(BUILDROOT_PATH) $(BUILD_TOOLS)
clean:
rm -rf $(TARGET_BUILD_PATH) $(TARGET_PATH) \
$(FAKEROOT_ENVIRONMENT) $(TARGET_FS)
$(SCRIPTS_PATH)/gen_initramfs.sh $(INITRAMFS_PATH) $(INITRAMFS)
rm -f $(FAKEROOT_ENVIRONMENT)
rm -rf $(INITRAMFS_PATH)
.PHONY: buildroot-extract buildroot-patch buildroot-config buildroot-sources buildroot-build \
buildroot buildroot-install buildroot-clean
buildroot-extract: $(BUILDROOT_PATH)/.extract-stamp
buildroot-patch: $(BUILDROOT_PATH)/.patch-stamp
buildroot-config: $(BUILDROOT_PATH)/.config-stamp
buildroot-sources: $(BUILDROOT_PATH)/.sources-stamp
buildroot-build: $(BUILDROOT_PATH)/.build-stamp
buildroot-install: $(BUILDROOT_PATH)/.install-stamp
buildroot-clean:
$(MAKE) -C $(BUILDROOT_PATH) clean
rm -f $(BUILDROOT_PATH)/.build-stamp
buildroot: buildroot-build
$(BUILDROOT_PATH)/.extract-stamp:
tar xjf $(SOURCE_PATH)/buildroot/buildroot-$(BUILDROOT_VERSION).tar.bz2
touch $@
$(BUILDROOT_PATH)/.patch-stamp: $(BUILDROOT_PATH)/.extract-stamp
#$(SCRIPTS_PATH)/patch-kernel.sh $(BUILDROOT_PATH) $(SOURCE_PATH)/buildroot/ '*.patch'
touch $@
$(BUILDROOT_PATH)/.config-stamp: $(BUILDROOT_PATH)/.patch-stamp
cp $(SOURCE_PATH)/buildroot/buildroot.config $(BUILDROOT_PATH)/.config
cd $(BUILDROOT_PATH); unset CC; make oldconfig
touch $@
$(BUILDROOT_PATH)/.sources-stamp: $(BUILDROOT_PATH)/.config-stamp
mkdir -p $(BUILDROOT_PATH)/dl
cp $(SOURCE_PATH)/toolchain/* $(BUILDROOT_PATH)/dl
cp $(SOURCE_PATH)/uClibc/uClibc-$(UCLIBC_VERSION).tar.bz2 $(BUILDROOT_PATH)/dl
cp $(SOURCE_PATH)/linux/linux-$(LINUX_VERSION).tar.bz2 $(BUILDROOT_PATH)/dl
touch $@
$(BUILDROOT_PATH)/.build-stamp: $(BUILDROOT_PATH)/.sources-stamp
unset CC; $(MAKE) -C $(BUILDROOT_PATH) all
touch $@
$(BUILDROOT_PATH)/.install-stamp: $(BUILDROOT_PATH)/.build-stamp
#mkdir -p $(STAGING_DIR)/
#$(MAKE) -C $(BUILDROOT_PATH) install
touch $@
This diff is collapsed.
include ../../variables.mk
BUSYBOX_CONFIG = $(SOURCE_PATH)/busybox/busybox.config
BUSYBOX_VERSION = 1.13.1
BUSYBOX_PATH = $(TARGET_BUILD_PATH)/busybox-$(BUSYBOX_VERSION)
.PHONY: extract patch config busybox
.PHONY: all install clean
all: busybox
install: $(TARGET_PATH)/bin/busybox
clean:
PATH=$(STAGING_DIR)/usr/bin:$(PATH) $(MAKE) -C $(BUSYBOX_PATH) clean
rm -f $(BUSYBOX_PATH)/.build-stamp $(BUSYBOX_PATH)/.config-stamp
extract: $(BUSYBOX_PATH)/.extract-stamp
patch: $(BUSYBOX_PATH)/.patch-stamp
config: $(BUSYBOX_PATH)/.config-stamp
busybox: $(BUSYBOX_PATH)/busybox
menuconfig:
$(MAKE) -C $(BUSYBOX_PATH) menuconfig
$(BUSYBOX_PATH)/.extract-stamp:
mkdir -p $(TARGET_BUILD_PATH)
cd $(TARGET_BUILD_PATH); tar xjf $(SOURCE_PATH)/busybox/busybox-$(BUSYBOX_VERSION).tar.bz2
touch $@
$(BUSYBOX_PATH)/.patch-stamp: $(BUSYBOX_PATH)/.extract-stamp
$(SCRIPTS_PATH)/patch-kernel.sh $(BUSYBOX_PATH) $(SOURCE_PATH)/busybox/ '*.patch'
touch $@
$(BUSYBOX_PATH)/.config-stamp: $(BUSYBOX_PATH)/.patch-stamp
sed "s,^CONFIG_PREFIX.*$$,CONFIG_PREFIX=\"$(TARGET_PATH)/\"," $(BUSYBOX_CONFIG) > \
$(BUSYBOX_PATH)/.config
PATH=$(STAGING_DIR)/usr/bin:$(PATH) $(MAKE) -C $(BUSYBOX_PATH) oldconfig
touch $@
$(BUSYBOX_PATH)/busybox: $(BUSYBOX_PATH)/.config-stamp
PATH=$(STAGING_DIR)/usr/bin:$(PATH) $(MAKE) -C $(BUSYBOX_PATH) CROSS_COMPILE=$(CROSS_COMPILER_PREFIX)
touch $@
$(TARGET_PATH)/bin/busybox: $(BUSYBOX_PATH)/busybox
mkdir -p $(TARGET_PATH)
PATH=$(STAGING_DIR)/usr/bin:$(PATH) $(MAKE) -C $(BUSYBOX_PATH) CROSS_COMPILE=$(CROSS_COMPILER_PREFIX) install
.PHONY: busybox-extract busybox-patch busybox-config busybox-build \
busybox busybox-install busybox-clean
busybox-extract: $(BUSYBOX_PATH)/.extract-stamp
busybox-patch: $(BUSYBOX_PATH)/.patch-stamp
busybox-config: $(BUSYBOX_PATH)/.config-stamp
busybox-build: $(BUSYBOX_PATH)/busybox
busybox-install: $(TARGET_PATH)/bin/busybox
busybox-menuconfig:
$(MAKE) -C $(BUSYBOX_PATH) menuconfig
BUSYBOX_CONFIG = $(SOURCE_PATH)/busybox/busybox.config
$(BUSYBOX_PATH)/.extract-stamp:
mkdir -p $(TARGET_BUILD_PATH)
cd $(TARGET_BUILD_PATH); tar xjf $(SOURCE_PATH)/busybox/busybox-$(BUSYBOX_VERSION).tar.bz2
touch $@
$(BUSYBOX_PATH)/.patch-stamp: $(BUSYBOX_PATH)/.extract-stamp
$(SCRIPTS_PATH)/patch-kernel.sh $(BUSYBOX_PATH) $(SOURCE_PATH)/busybox/ '*.patch'
touch $@
$(BUSYBOX_PATH)/.config-stamp: $(BUSYBOX_PATH)/.patch-stamp
sed "s,^CONFIG_PREFIX.*$$,CONFIG_PREFIX=\"$(TARGET_PATH)/\"," $(BUSYBOX_CONFIG) > \
$(BUSYBOX_PATH)/.config
PATH=$(STAGING_DIR)/usr/bin:$(PATH) $(MAKE) -C $(BUSYBOX_PATH) oldconfig
touch $@
$(BUSYBOX_PATH)/busybox: $(BUSYBOX_PATH)/.config-stamp
PATH=$(STAGING_DIR)/usr/bin:$(PATH) $(MAKE) -C $(BUSYBOX_PATH) CROSS_COMPILE=$(CROSS_COMPILER_PREFIX)
touch $@
$(TARGET_PATH)/bin/busybox: $(BUSYBOX_PATH)/busybox
mkdir -p $(TARGET_PATH)
PATH=$(STAGING_DIR)/usr/bin:$(PATH) $(MAKE) -C $(BUSYBOX_PATH) CROSS_COMPILE=$(CROSS_COMPILER_PREFIX) install
busybox-clean:
PATH=$(STAGING_DIR)/usr/bin:$(PATH) $(MAKE) -C $(BUSYBOX_PATH) clean
rm -f $(BUSYBOX_PATH)/.build-stamp $(BUSYBOX_PATH)/.config-stamp
busybox: busybox-build
--- busybox-1.11.0/editors/awk.c Wed Jun 25 14:51:37 2008
+++ busybox-1.11.0-awk/editors/awk.c Tue Jul 1 14:03:37 2008
@@ -681,11 +681,6 @@
return (isalnum(c) || c == '_');
}
-static FILE *afopen(const char *path, const char *mode)
-{
- return (*path == '-' && *(path+1) == '\0') ? stdin : xfopen(path, mode);
-}
-
/* -------- working with variables (set/get/copy/etc) -------- */
static xhash *iamarray(var *v)
@@ -2740,7 +2735,7 @@
ind = getvar_s(incvar(intvar[ARGIND]));
fname = getvar_s(findvar(iamarray(intvar[ARGV]), ind));
if (fname && *fname && !is_assignment(fname))
- F = afopen(fname, "r");
+ F = xfopen_stdin(fname);
}
} while (!F);
@@ -2757,8 +2752,9 @@
{
unsigned opt;
char *opt_F, *opt_W;
- llist_t *opt_v = NULL;
- int i, j, flen;
+ llist_t *list_v = NULL;
+ llist_t *list_f = NULL;
+ int i, j;
var *v;
var tv;
char **envp;
@@ -2816,35 +2812,33 @@
*s1 = '=';
}
}
- opt_complementary = "v::";
- opt = getopt32(argv, "F:v:f:W:", &opt_F, &opt_v, &g_progname, &opt_W);
+ opt_complementary = "v::f::"; /* -v and -f can occur multiple times */
+ opt = getopt32(argv, "F:v:f:W:", &opt_F, &list_v, &list_f, &opt_W);
argv += optind;
argc -= optind;
if (opt & 0x1)
setvar_s(intvar[FS], opt_F); // -F
- while (opt_v) { /* -v */
- if (!is_assignment(llist_pop(&opt_v)))
+ while (list_v) { /* -v */
+ if (!is_assignment(llist_pop(&list_v)))
bb_show_usage();
}
- if (opt & 0x4) { // -f
- char *s = s; /* die, gcc, die */
- FILE *from_file = afopen(g_progname, "r");
- /* one byte is reserved for some trick in next_token */
- if (fseek(from_file, 0, SEEK_END) == 0) {
- flen = ftell(from_file);
- s = xmalloc(flen + 4);
- fseek(from_file, 0, SEEK_SET);
- i = 1 + fread(s + 1, 1, flen, from_file);
- } else {
+ if (list_f) { /* -f */
+ do {
+ char *s = NULL;
+ FILE *from_file;
+
+ g_progname = llist_pop(&list_f);
+ from_file = xfopen_stdin(g_progname);
+ /* one byte is reserved for some trick in next_token */
for (i = j = 1; j > 0; i += j) {
s = xrealloc(s, i + 4096);
j = fread(s + i, 1, 4094, from_file);
}
- }
- s[i] = '\0';
- fclose(from_file);
- parse_program(s + 1);
- free(s);
+ s[i] = '\0';
+ fclose(from_file);
+ parse_program(s + 1);
+ free(s);
+ } while (list_f);
} else { // no -f: take program from 1st parameter
if (!argc)
bb_show_usage();
--- busybox-1.11.0/libbb/print_flags.c Wed Jun 25 14:51:32 2008
+++ busybox-1.11.0-ip/libbb/print_flags.c Fri Jun 27 00:39:16 2008
@@ -19,8 +19,8 @@
labels);
need_separator = separator;
flags &= ~ *masks;
- masks++;
}
+ masks++;
labels += strlen(labels) + 1;
}
return flags;
--- busybox-1.11.0/debianutils/start_stop_daemon.c Wed Jun 25 14:51:26 2008
+++ busybox-1.11.0-ssd/debianutils/start_stop_daemon.c Tue Jul 1 14:05:05 2008
@@ -326,7 +326,9 @@
char *signame;
char *startas;
char *chuid;
+#ifdef OLDER_VERSION_OF_X
struct stat execstat;
+#endif
#if ENABLE_FEATURE_START_STOP_DAEMON_FANCY
// char *retry_arg = NULL;
// int retries = -1;
@@ -361,6 +363,8 @@
if (!(opt & OPT_a))
startas = execname;
+ if (!execname) /* in case -a is given and -x is not */
+ execname = startas;
// USE_FEATURE_START_STOP_DAEMON_FANCY(
// if (retry_arg)
@@ -374,7 +378,8 @@
if (errno)
user_id = xuname2uid(userspec);
}
- do_procinit(); /* Both start and stop needs to know current processes */
+ /* Both start and stop need to know current processes */
+ do_procinit();
if (opt & CTX_STOP) {
int i = do_stop();
@@ -383,17 +388,21 @@
if (found) {
if (!QUIET)
- printf("%s already running\n%d\n", execname, found->pid);
+ printf("%s is already running\n%u\n", execname, (unsigned)found->pid);
return !(opt & OPT_OKNODO);
}
+#ifdef OLDER_VERSION_OF_X
if (execname)
xstat(execname, &execstat);
+#endif
*--argv = startas;
if (opt & OPT_BACKGROUND) {
#if BB_MMU
- bb_daemonize(0);
+ bb_daemonize(DAEMON_DEVNULL_STDIO + DAEMON_CLOSE_EXTRA_FDS);
+ /* DAEMON_DEVNULL_STDIO is superfluous -
+ * it's always done by bb_daemonize() */
#else
pid_t pid = vfork();
if (pid < 0) /* error */
@@ -404,19 +413,18 @@
* so "return 0" may do bad things */
_exit(EXIT_SUCCESS);
}
- /* child */
+ /* Child */
setsid(); /* detach from controlling tty */
/* Redirect stdio to /dev/null, close extra FDs.
* We do not actually daemonize because of DAEMON_ONLY_SANITIZE */
- bb_daemonize_or_rexec(
- DAEMON_DEVNULL_STDIO
+ bb_daemonize_or_rexec(DAEMON_DEVNULL_STDIO
+ DAEMON_CLOSE_EXTRA_FDS
+ DAEMON_ONLY_SANITIZE,
NULL /* argv, unused */ );
#endif
}
if (opt & OPT_MAKEPID) {
- /* user wants _us_ to make the pidfile */
+ /* User wants _us_ to make the pidfile */
write_pidfile(pidfile);
}
if (opt & OPT_c) {
@@ -434,6 +442,6 @@
}
}
#endif
- execv(startas, argv);
+ execvp(startas, argv);
bb_perror_msg_and_die("cannot start %s", startas);
}
--- busybox-1.11.0/include/usage.h Wed Jun 25 14:51:35 2008
+++ busybox-1.11.0-ssd/include/usage.h Tue Jul 1 14:03:48 2008
@@ -3637,9 +3637,7 @@
"$ cat TODO | split -a 2 -l 2 TODO_\n"
#define start_stop_daemon_trivial_usage \
- "[OPTIONS] [" \
- USE_GETOPT_LONG("--start|--stop") SKIP_GETOPT_LONG("-S|-K") \
- "] ... [-- arguments...]"
+ "[OPTIONS] [-S|-K] ... [-- arguments...]"
#define start_stop_daemon_full_usage "\n\n" \
"Search for matching processes, and then\n" \
"-S: stop all matching processes.\n" \
--- busybox-1.11.0/editors/vi.c Wed Jun 25 14:51:37 2008
+++ busybox-1.11.0-vi/editors/vi.c Fri Jun 27 06:06:54 2008
@@ -1894,7 +1894,7 @@
p = new_text + (p - text);
text = new_text;
}
- memmove(p + size, p, end - p);
+ memmove(p + size, p, end - size - p);
memset(p, ' ', size); // clear new hole
file_modified++;
return p;
--- busybox-1.13.1/miscutils/crond.c Sun Nov 9 18:28:17 2008
+++ busybox-1.13.1-crond/miscutils/crond.c Thu Dec 4 14:56:10 2008
@@ -779,6 +779,8 @@
xmove_fd(mailFd, mail_filename ? 1 : 0);
dup2(1, 2);
}
+ /* crond 3.0pl1-100 puts tasks in separate process groups */
+ bb_setpgrp();
execlp(prog, prog, cmd, arg, NULL);
crondlog(ERR20 "can't exec, user %s cmd %s %s %s", user, prog, cmd, arg);
if (mail_filename) {
@@ -914,6 +916,8 @@
if (DebugOpt) {
crondlog(LVL5 "child running %s", DEFAULT_SHELL);
}
+ /* crond 3.0pl1-100 puts tasks in separate process groups */
+ bb_setpgrp();
execl(DEFAULT_SHELL, DEFAULT_SHELL, "-c", line->cl_Shell, NULL);
crondlog(ERR20 "can't exec, user %s cmd %s %s %s", user,
DEFAULT_SHELL, "-c", line->cl_Shell);
--- busybox-1.13.1/init/init.c Sat Nov 29 07:48:56 2008
+++ busybox-1.13.1-init/init/init.c Tue Dec 9 22:17:43 2008
@@ -118,18 +118,18 @@
msg[0] = '\r';
va_start(arguments, fmt);
- l = vsnprintf(msg + 1, sizeof(msg) - 2, fmt, arguments);
- if (l > sizeof(msg) - 2)
- l = sizeof(msg) - 2;
+ l = 1 + vsnprintf(msg + 1, sizeof(msg) - 2, fmt, arguments);
+ if (l > sizeof(msg) - 1)
+ l = sizeof(msg) - 1;
msg[l] = '\0';
va_end(arguments);
if (ENABLE_FEATURE_INIT_SYSLOG) {
- /* Log the message to syslogd */
if (where & L_LOG) {
- /* don't print out "\r" */
- openlog(applet_name, 0, LOG_DAEMON);
- syslog(LOG_INFO, "init: %s", msg + 1);
+ /* Log the message to syslogd */
+ openlog("init", 0, LOG_DAEMON);
+ /* don't print "\r" */
+ syslog(LOG_INFO, "%s", msg + 1);
closelog();
}
msg[l++] = '\n';
--- busybox-1.13.1/networking/ip.c Sun Nov 9 18:27:59 2008
+++ busybox-1.13.1-ip/networking/ip.c Thu Dec 4 13:16:29 2008
@@ -31,7 +31,7 @@
static int ip_do(int (*ip_func)(char **argv), char **argv)
{
- argv = ip_parse_common_args(argv);
+ argv = ip_parse_common_args(argv + 1);
return ip_func(argv);
}
--- busybox-1.13.1/coreutils/printf.c Sun Nov 9 18:28:07 2008
+++ busybox-1.13.1-printf/coreutils/printf.c Wed Dec 10 12:50:55 2008
@@ -359,8 +359,15 @@
* We will mimic coreutils. */
if (argv[1] && argv[1][0] == '-' && argv[1][1] == '-' && !argv[1][2])
argv++;
- if (!argv[1])
+ if (!argv[1]) {
+ if (ENABLE_ASH_BUILTIN_PRINTF
+ && applet_name[0] != 'p'
+ ) {
+ bb_error_msg("usage: printf FORMAT [ARGUMENT...]");
+ return 2; /* bash compat */
+ }
bb_show_usage();
+ }
format = argv[1];
argv2 = argv + 2;
This diff is collapsed.
include ../../variables.mk
HDPARM_VERSION = 8.9
HDPARM_PATH = $(TARGET_BUILD_PATH)/hdparm-$(HDPARM_VERSION)
.PHONY: extract patch config \
hdparm install clean all
all: hdparm
extract: $(HDPARM_PATH)/.extract-stamp
patch: $(HDPARM_PATH)/.patch-stamp
config: $(HDPARM_PATH)/.config-stamp
hdparm: $(HDPARM_PATH)/hdparm
install: $(TARGET_PATH)/sbin/hdparm
clean:
PATH=$(STAGING_DIR)/usr/bin:$(PATH) $(MAKE) -C $(HDPARM_PATH) clean
rm -f $(HDPARM_PATH)/.build-stamp $(HDPARM_PATH)/.config-stamp
$(HDPARM_PATH)/.extract-stamp:
mkdir -p $(TARGET_BUILD_PATH)
cd $(TARGET_BUILD_PATH); tar xzf $(SOURCE_PATH)/hdparm/hdparm-$(HDPARM_VERSION).tar.gz
touch $@
$(HDPARM_PATH)/.patch-stamp: $(HDPARM_PATH)/.extract-stamp
$(SCRIPTS_PATH)/patch-kernel.sh $(HDPARM_PATH) $(SOURCE_PATH)/hdparm/ '*.patch'
touch $@
$(HDPARM_PATH)/.config-stamp: $(HDPARM_PATH)/.patch-stamp
touch $@
#--enable-elf-shlibs --enable-dynamic-e2fsck --disable-swapfs \
#--enable-elf-shlibs \
$(HDPARM_PATH)/hdparm: $(HDPARM_PATH)/.config-stamp
PATH=$(STAGING_DIR)/usr/bin:$(PATH) \
CC=$(TARGET_CC) \
$(MAKE) -C $(HDPARM_PATH) \
$(TARGET_CONFIGURE_OPTS) LD=i386-linux-uclibc-gcc
touch $@
$(TARGET_PATH)/sbin/hdparm: $(HDPARM_PATH)/hdparm
install -d -m 755 $(TARGET_PATH)/sbin
install -m 755 $(HDPARM_PATH)/hdparm \
$(TARGET_PATH)/sbin/hdparm
$(STRIPCMD) --strip-unneeded $(TARGET_PATH)/sbin/hdparm
touch -c $@
include ../../variables.mk
LINUX_VERSION = 2.6.27.8
LINUX_PATH = $(TARGET_BUILD_PATH)/linux-$(LINUX_VERSION)
KERNEL_CONFIG = $(SOURCE_PATH)/linux/linux.config
LINUX_HEADERS_PATH = $(TOOLCHAIN_BUILD_PATH)/linux
TARGET_MODULE_PATH = $(TARGET_PATH)/lib/modules/$(LINUX_VERSION)
export ARCH=i386
export INSTALL_MOD_PATH=$(TARGET_PATH)
.PHONY: linux linux-extract linux-patch linux-config linux-bzImage \
linux-modules linux-clean linux-menuconfig linux-bzImage-install \
linux-modules-install linux-install linux-headers
.PHONY: extract patch config bzImage \
modules clean menuconfig bzImage-install \
modules-install all
linux-extract: $(LINUX_PATH)/.extract-stamp
all: bzImage modules
linux-patch: $(LINUX_PATH)/.patch-stamp
extract: $(LINUX_PATH)/.extract-stamp
linux-config: $(LINUX_PATH)/.config-stamp
patch: $(LINUX_PATH)/.patch-stamp
linux-headers: $(LINUX_PATH)/.headers-stamp
config: $(LINUX_PATH)/.config-stamp
linux-menuconfig:
headers: $(LINUX_PATH)/.headers-stamp
menuconfig:
$(MAKE) -C $(LINUX_PATH) CROSS_COMPILE=$(CROSS_COMPILER_PREFIX) menuconfig