0

I want create and run a shell script each time i boot up the kernel along with android on my mobile

1
  • Hi, welcome to StackOverflow. You should show and explain what you have tried so far, to make the answers more relevant to you. Thanks.
    – Cthulhu
    Jul 8, 2015 at 13:23

1 Answer 1

1

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

2
  • 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

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.