Busybox won't init
Denys Vlasenko
vda.linux at googlemail.com
Thu Nov 4 06:44:04 UTC 2010
On Thursday 04 November 2010 06:34, Matt Johnson wrote:
>
> Hi. I need some assistance with getting busybox working on an ARM920t based board (custom s3c2410, similar to QT2410 or SMDK2410). I have a good working toolchain (built by crosstool-ng), u-boot and kernel (2.6.36). I am using buildroot to make busybox 1.17.3 with the defconfig.
>
> When booting my kernel, the last step is to call /linuxrc - which is a link to busybox. Busybox outputs absolutly nothing, but just exits. The kernel then panics because init was killed. It looks like this:
>
> ... (normal kernel startup messages)
> Freeing init memory: 128K
> ... (init is here, calling busybox, which just quits with no output)
> Kernel panic - not syncing: Attempted to kill init!
> ... (then the kernel stack unwinds and the box halts) ...
>
> I've already read the FAQ, and yes - "hello world" works fine. More than that, if I set init=/bin/busybox I get the busybox help page, so I know that it is compiled correctly for my platform. I get the same results compiling outside of buildroot directly from the toolchain. I've also verified that the kernel is built with EABI.
>
> What are next steps to debug this?
You came pretty far in the debugging already,
and your mail is an excellent example how to report
problems properly.
I guess at this point you need to resort to adding
debug printouts to init's main, a-la:
int init_main(int argc UNUSED_PARAM, char **argv)
{
bb_error_msg("%s:%u", __func__, __LINE__);
die_sleep = 30 * 24*60*60; /* if xmalloc would ever die... */
if (argv[1] && strcmp(argv[1], "-q") == 0) {
bb_error_msg("%s:%u", __func__, __LINE__);
return kill(1, SIGHUP);
}
bb_error_msg("%s:%u", __func__, __LINE__);
...
/* Figure out where the default console should be */
console_init();
bb_error_msg("%s:%u", __func__, __LINE__);
set_sane_term();
xchdir("/");
bb_error_msg("%s:%u", __func__, __LINE__);
setsid();
bb_error_msg("%s:%u", __func__, __LINE__);
...
> Are there any arguments I can pass or set in the config that would output something useful for debugging?
Try disabling FEATURE_EXTRA_QUIET, with it off
you should see this message emitted pretty early
in init's lifetime:
#if !ENABLE_FEATURE_EXTRA_QUIET
/* Hello world */
message(L_CONSOLE | L_LOG, "init started: %s", bb_banner);
#endif
--
vda
More information about the busybox
mailing list