Hi Sam !

On 23-05-2013 08:54 Sam Liddicott <[email protected]> wrote:
>I meant that rather than make a special case of "H" "R" "P",
>make a special case of not beginning with "/" - it seems a
>cleaner way of separating the meanings of the data passed
>through the pipe.

I do not fully understand your question. Neither does init depend
on any data passed nor define any structure of data.

What shall not begin with a slash?

"H", "R" and "P" where only examples for the three cases "halt",
"reboot" and "poweroff". You may pass the full words instead of
just single characters, it will use only more space. For other
cases you may chose to use any other data, like "kexec PROG ARGS".

The simple idea behind using this pipe structure is to have an
easy way to pass some information to the system shutdown script.
As the simplest way for shell scripts is to read a line of data,
the data structure is just anything ending in a newline
character. The shell script than may determine the remaining
structure by a simple case with patterns. You may pass anything
you like. Only the script matters about the structure, not the
init process.

>I really like the idea that init can be made to exec itself with
>something else! It could be another linuxrc that execs another
>init!

This is the idea behind the scene. When init is shutdown on a
clean way, passing some information the final script may do
everything without need to modify binary code of Busybox. No
matter how many cases you add to this or which information is
passed.

--
Harald
_______________________________________________
busybox mailing list
[email protected]
http://lists.busybox.net/mailman/listinfo/busybox

Reply via email to