----- Original Message ----- 
From: "Denys Vlasenko" <[EMAIL PROTECTED]>
To: "Harald Kuethe" <[EMAIL PROTECTED]>
Cc: <[email protected]>
Sent: Saturday, April 05, 2008 6:23 AM
Subject: Re: [PATCH] init.c, halt command not working


> On Friday 04 April 2008 22:40, Harald Kuethe wrote:
>> The first part is with a vfork() call in static pid_t run(const struct 
>> init_action *a) 
>> the second part uses fork()
>> 
>> Freeing unused kernel memory: 68k init
>> *Start init_main
>> init: waiting for 10
>> *console_init
>> init started
>> init started: BusyBox v1.10.0 (2008-04-01 22:01:03 CEST)
>> *single?
>> *run_actions
>> init: before waitfor(run(a))
>> init: run vfork returned 0
>> init: run vfork returned 11
>> *call bb_signals
>> init: waiting for 11
>> 
>> ...
>> 
>> init: after waitfor(run(a))
>> *signals
>> *RESPAWN
>> *ASKFIRST
>> init: before a->pid = run(a)
>> init: run vfork returned 0
>> 
>> Please press Enter to activate this console.
>> init: run vfork returned 80
> 
> 
> 
>        if (BB_MMU && (a->action_type & ASKFIRST)) {
>                static const char press_enter[] ALIGN1 =
> #ifdef CUSTOMIZED_BANNER
> #include CUSTOMIZED_BANNER
> #endif
>                        "\nPlease press Enter to activate this console. ";
>                char c;
>                /*
>                 * Save memory by not exec-ing anything large (like a shell)
>                 * before the user wants it. This is critical if swap is not
>                 * enabled and the system has low memory. Generally this will
>                 * be run on the second virtual console, and the first will
>                 * be allowed to start a shell or whatever an init script
>                 * specifies.
>                 */
>                messageD(L_LOG, "waiting for enter to start '%s'"
>                                        "(pid %d, tty '%s')\n",
>                                a->command, getpid(), a->terminal);
>                full_write(1, press_enter, sizeof(press_enter) - 1);
>                while (safe_read(0, &c, 1) == 1 && c != '\n')
>                        continue;
>        }
> 
> 
> DOH!
> 
> Try this patch.
> --
> vda
>

This patch works! (as expected since it is using a fork instead of vfork in our 
case)
Do I use a weird inittab or what is special here?

Thanks for your help
Harald
_______________________________________________
busybox mailing list
[email protected]
http://busybox.net/cgi-bin/mailman/listinfo/busybox

Reply via email to