0

I am editing the Android phone file "init.tuna.rc" so that it prints to me some basic debugging checkpoint messages so I can analyze how far the phone gets in the boot process.

Does anyone know if you can simply insert the shell scripting syntax for console printing into a "run command" file (.rc)?

(I need to know this if someone can help me before I rebuild all of my code for the Android tree to test this debugging code, given the process can a while)

Will the following work? I want to insert in the following code snippet into the "init.tuna.rc" file:

# Boot debugging Checkpoint #2
echo "Check #2:  Successfully wrote the file system data, including the wifi directories!"

If this does not work, what can I do to get the "rc" file to print messages to the actual terminal as it executes?

  • The rc at the end of a file is related to the phrase "run commands"; its use derives from the /etc/rc.* files used to start most Unix systems. The rc suffix is commonly used for any file that contains startup information for a program. Common rc files include .newsrc, .pinerc, and .cshrc. – Diego Torres Milano Jul 24 '12 at 14:35
  • So then, do you know if you can edit these kinds of start-up info files to also print to the console? They seem to remind me of something like a script, which I know you can use "echo" in. I imagine whatever is parsing this information file, reads from top to bottom and executes commands accordingly in order, right? – 9exceptionThrower9 Jul 24 '12 at 14:42
  • No, just about to, but I wanted to find out if anyone knew before I went through rebuilding my code to try this. Even with the optimization I set up for rebuilds, it can still a while to rebuild. – 9exceptionThrower9 Jul 24 '12 at 15:08
  • Note: This does not work. So much for any useful debugging to figure out why a phone doesn't boot! – 9exceptionThrower9 Jul 25 '12 at 17:58

1 Answers1

1

Android Boot Language is documented in a readme.txt file in the source tree under <android>/system/core/init. No echo is mentioned, but you can try. Also remember that you should write to a file because stderr and stdout are redirected to /dev/null.

See https://github.com/aosp-mirror/platform_system_core/blob/master/init/README.md

S Raghav
  • 1,386
  • 1
  • 16
  • 26
Diego Torres Milano
  • 65,697
  • 9
  • 111
  • 134
  • Note: "echo" does not work. And cannot, after I failed in trying, b/c I realized that echo would only send something to the phone's file system not the external computer. – 9exceptionThrower9 Jul 25 '12 at 17:59