Re: [android-kernel] Android init process modification

334 views
Skip to first unread message

Naresh Mehta

unread,
Aug 9, 2012, 5:03:15 AM8/9/12
to android...@googlegroups.com
On Fri, Aug 3, 2012 at 2:04 PM, Terence Yeong <terenc...@gmail.com> wrote:
> // START OF MY EDIT IN PSEUDOCODE
> fputs("Press enter to start test tool\n", stdout);
> if (user input received)
> {
> execve("./system/bin/test_tool", NULL, NULL);
> }
> // END OF MY EDIT

Where is your gets()? Also when you do a fputs(), you need to call
fflush(). But in general, your gets() should help you with that.


--

BR; Naresh

visit me at:
http://www.naresh.se/

Terence Yeong

unread,
Aug 13, 2012, 1:49:32 AM8/13/12
to android...@googlegroups.com
Hi guys,

Sorry for the late reply.

@Luke: Yeap, my fputs is showing up. I have already solved the problem of execve-ing to my program. However, another problem has popped up. If user input is not received, my intention is for the rest of the init process to continue as normal so the phone can boot up. However I'm getting stuff like 
this: http://pastebin.com/XxCZeECs. I've tried to integrate my custom program code into init.c only to run into the same problem!  Can anyone explain what's going on?

@Naresh: My apologies. The if (user input received) is in psuedocode. My fgets() stuff is all there, I just didn't type it out.

Earlence

unread,
Aug 13, 2012, 10:48:35 AM8/13/12
to android...@googlegroups.com
I think you can include the execution of your test tool in the init script instead of modifying init.c

-Earlence

Terence Yeong

unread,
Aug 16, 2012, 1:44:58 AM8/16/12
to android...@googlegroups.com
But I need to run my test tool before Android boots up. I did explore running via the init.rc script, but I didn't know how to have the test tool take control of the console.

However, I managed to solve my problem as described in this link:

Thanks guys!
Reply all
Reply to author
Forward
0 new messages