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?

-- 
unsubscribe: android-kernel+unsubscr...@googlegroups.com
website: http://groups.google.com/group/android-kernel

Reply via email to