Account Options

  1. Sign in
The old Google Groups will be going away soon, but your browser is incompatible with the new version.
Google Groups Home
« Groups Home
Android init process modification
There are currently too many topics in this group that display first. To make this topic appear first, remove this option from another topic.
There was an error processing your request. Please try again.
flag
  6 messages - Collapse all  -  Translate all to Translated (View all originals)
The group you are posting to is a Usenet group. Messages posted to this group will make your email address visible to anyone on the Internet.
Your reply message has not been sent.
Your post was successful
 
From:
To:
Cc:
Followup To:
Add Cc | Add Followup-to | Edit Subject
Subject:
Validation:
For verification purposes please type the characters you see in the picture below or the numbers you hear by clicking the accessibility icon. Listen and type the numbers you hear
 
Terence Yeong  
View profile  
 More options Aug 3 2012, 8:04 am
From: Terence Yeong <terenceye...@gmail.com>
Date: Fri, 3 Aug 2012 05:04:21 -0700 (PDT)
Local: Fri, Aug 3 2012 8:04 am
Subject: Android init process modification

Hi guys,

I'm a student doing a project where I have to interrupt the init process of Android. As we all know, init is the program that is run after the kernel boots up.

In the source code of init.c, I made the following changes to main():

int main(int argc, char **argv)
{
    int fd_count = 0;
    struct pollfd ufds[4];
    char *tmpdev;
    ...

    // 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

    // rest of init.c
    ...

}

Upon first boot up, I adb push test_tool (which is a properly compiled ARM executable for Linux) to system/bin/ and chmod it to 777, then do a reboot.

As far as I know, execve should never return if executed successfully. However, I'm still seeing the rest of the init process being executed, which should mean that execve is not working?


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Luke O'Malley  
View profile  
 More options Aug 7 2012, 2:28 am
From: Luke O'Malley <d.lukeomal...@gmail.com>
Date: Mon, 6 Aug 2012 23:28:58 -0700 (PDT)
Local: Tues, Aug 7 2012 2:28 am
Subject: Re: Android init process modification

Terence,
Is your print statement working or does that not show up either?


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Naresh Mehta  
View profile  
 More options Aug 9 2012, 5:03 am
From: Naresh Mehta <nareshte...@gmail.com>
Date: Thu, 9 Aug 2012 11:03:15 +0200
Local: Thurs, Aug 9 2012 5:03 am
Subject: Re: [android-kernel] Android init process modification

On Fri, Aug 3, 2012 at 2:04 PM, Terence Yeong <terenceye...@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/


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Terence Yeong  
View profile  
 More options Aug 13 2012, 1:49 am
From: Terence Yeong <terenceye...@gmail.com>
Date: Sun, 12 Aug 2012 22:49:32 -0700 (PDT)
Local: Mon, Aug 13 2012 1:49 am
Subject: Re: [android-kernel] Android init process modification

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.


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Earlence  
View profile  
 More options Aug 13 2012, 10:48 am
From: Earlence <earlencefe...@gmail.com>
Date: Mon, 13 Aug 2012 07:48:35 -0700 (PDT)
Local: Mon, Aug 13 2012 10:48 am
Subject: Re: [android-kernel] Android init process modification

I think you can include the execution of your test tool in the init script
instead of modifying init.c
http://www.kandroid.org/online-pdk/guide/bring_up.html

-Earlence


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Terence Yeong  
View profile  
 More options Aug 16 2012, 1:44 am
From: Terence Yeong <terenceye...@gmail.com>
Date: Wed, 15 Aug 2012 22:44:58 -0700 (PDT)
Local: Thurs, Aug 16 2012 1:44 am
Subject: Re: [android-kernel] Android init process modification

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:
http://stackoverflow.com/questions/11763411/android-init-replacement

Thanks guys!


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
End of messages
« Back to Discussions « Newer topic     Older topic »