I want create and run a shell script each time i boot up the kernel along with android on my mobile
1 Answer
A script can't be run when you boot up the kernel because the interpreter (your shell) isn't ready at that point. At best you can run your script when the kernel is done loading, and even then it will be quite hackey to do from within the kernel.
Best use init.rc for that purpose, this is what it was designed for
-
Oh, But i want to create a script which loads up automatically whenever the Kernel OS is loaded up. Like: A script that shows today's date and time automatically on booting up the OS Jul 8, 2015 at 13:48
-
Then you should patch the kernel at the place you want that to happen instead of writing a script. Keep in mind that the kernel initializes everything including SW and HW components, so the place you want will have to be after the RTC driver is ready. But this will definitely not be a script (; Jul 8, 2015 at 13:51