I have been running a DirectFB based program almost direct from init, this is what I've done:
I have a small program I call Boot which does some system setup stuff such as mounting drives, setting up TCP networking etc. This then forks to run two separate apps, one is my DirectFB app and the other is a background app to handle network stuff.
It all works fine. I have simply put my Boot executable in /bin and created a symlink
ln -s /bin/sh /bin/Boot
Because if the kernel cannot find init, it will try to run /bin/sh - so I have deleted /sbin/init and my program comes up instead. No shell required.
The only issues I found while doing this is that by default, the root filesystem comes up as read-only, you need to remount it read-write unless you don't intend to write to the disk.
Also, if you want to use the /proc filesystem (which I do), you'll need to mount that too.
Denis Oliver Kropp wrote:
Quoting Henric Andersson ([EMAIL PROTECTED]):
>Quoting Henric Andersson ([EMAIL PROTECTED]): >> Has anyone executed a DirectFB program from init? That is, via the >> kerneloption init= ?
>> The reason I'm asking is that I'm trying to, and for some odd reason it just >> won't work. I get a blank screen and nothing more. When I run the same app >> from /bin/sh (actually busybox) which in turn is running as a init >> replacement, everything is working.
>> I just thought I would ask before I spend the next week on a problem that >> already was solved ;)
>> Any tips, hints and advice when running as process 1 is also welcomed (but >> then I guess the reply should be private since it's a bit off-topic)
> Once I tried that I came to the conclusion that the init process > cannot create threads. It blocks in pthread_create() IIRC.
Hmm... odd, since init is the one process which spawns everything else (or am I wrong) .. Also, before I initialize and use DirectFB, I call system() to do some things, and if I remember correctly, system() does fork() to perform it duties.
Maybe it's pthreads that is at fault here?
fork() calls clone() with different arguments than pthread_create() does, maybe it's forbidden or a kernel bug.
--
__ __
_______ __/ \____________________________/ \__ _______
\_____ | \ o \ Adam Pierce / o / | _____/
\___ | \ o \________________________/ o / | ___/
\__|____\ o www.doctort.org/adam o /____|__/
\__\____________________________/__/
~~~~~~~\____________/~~~~~~~
\______/
\/--
Info: To unsubscribe send a mail to [EMAIL PROTECTED] with "unsubscribe directfb-dev" as subject.
