:: Re: [DNG] Custom OS initiator. In n…
Página Inicial
Delete this message
Reply to this message
Autor: Irrwahn
Data:  
Para: dng
Assunto: Re: [DNG] Custom OS initiator. In need of some hints...
On Mon, 13 Jun 2016 23:49:45 +0200, Didier Kryn wrote:
> Le 13/06/2016 22:49, Irrwahn a écrit :

[...]
>> I'm probably missing something important here, so I have
>> to ask: What would be the point in replacing an easily
>> comprehensible, self-contained and statically linked piece
>> of code[1] by some script, howsoever simple, that relies
>> on an (in comparison) gigantic and potentially buggy blob
>> like a shell[2]?

[...]
>      Sure. But a shell-script init is a nice toy to explore the early 
> OS, specially if it can run an interactive shell. It would become a big 
> tangle if the intent was to wait() the zombies or "supervise" more than 
> one other process :-)


I acknowledge the toy character. And I intentionally didn't
mention the obvious problems of child process handling from
within a shell script, but you are of course right here.

>      As long as this script does not make overly complex things (for a 
> script) like supervision and trapping signals, it remains pretty small. 
> When comparing to the executable produced by a compiled program, I'm not 
> sure the small difference matters. You don't have to count the size of 
> the interpreter and the dynamic library, since they are part of the 
> system anyway. If your system is so tiny that it only runs Busybox, then 
> you still have an interpreter.


I was not so much concerned about the actual size in bytes, but
more with the unnecessary complexity and potential lack of
robustness, which I would not expect to see in the PID1 process.
For one thing, dynamic linking IMO is already a big boo-boo in
PID1, for it makes it far to easy to hose the whole system.
Personally, I'd really love to have at least the PID1 executable,
[a]getty and one emergency shell statically linked. But maybe
lately I'm just becoming overly paranoid and extreme in my views
on such matters.

Sidenote: Even busybox, which in its static incarnation is what
drives an Debian initrd IIRC and therefore in principle fulfills
my requirement above, is IMVHO not the be-all and end-all in early
userspace handling. Too bad Rob Landley's Toybox is not yet quite
complete enough to be ready for primetime WRT system initialization,
at least in my book.

Anyways, thanks for your input, Didier! :)

Regards
Urban