Debugging boot, save log to sd

311 views
Skip to first unread message

Rancid Frog

unread,
Mar 10, 2015, 10:21:22 AM3/10/15
to android...@googlegroups.com
I need to figure out why my port is not booting to bootanimation, it gets stuck before reaching it.
What is the best way to go about it?

I tried to check with adb, but device is not detected.
I also tried saving logs to sd, as device is not detected by adb and does not boot.
But, I get the following errors.

Using an init.d script does not work as "can't create /storage/sdcard1/log.txt: Read-only file system"
The script that I tried:
#!/system/bin/sh
sleep 2

echo My Log Script
mkdir /storage/sdcard1/log 0775 system log
/system/bin/logcat -r 1024 -n 9 -v threadTime -f /storage/sdcard1/log/log

I also tried from init.*device*.rc as mentioned in stackoverflow: http://stackoverflow.com/a/25533212/3082310
However, I still get an error: "<3>[ 27.230662] init: Warning! Service log_debug needs a SELinux domain defined; please fix! "

Is there a better way to approach the issue?
If not how can I force the init.d to mount sd card and create the log?
And, is there a clear and thorough of creating definition for SELinux domain?

Thank you for your time

Abdul Haseeb

unread,
Mar 10, 2015, 11:00:02 AM3/10/15
to ranci...@gmail.com, android-porting

Collect serial logs or if possible connect it to any debug port

--
--
unsubscribe: android-porti...@googlegroups.com
website: http://groups.google.com/group/android-porting

---
You received this message because you are subscribed to the Google Groups "android-porting" group.
To unsubscribe from this group and stop receiving emails from it, send an email to android-porti...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Rancid Frog

unread,
Mar 10, 2015, 5:40:51 PM3/10/15
to android...@googlegroups.com
Thank you for your suggestions
For me it is easier to deal with init.*.rc
Is there no way to mount and copy files that way?

I do not have UART serial cable.
How can I use USB as serial?
My device has "console=ttyHSL0"

As for debug port, can you clarify what you meant, more specific.

Thank you

Ivan Savygin

unread,
Mar 11, 2015, 10:20:51 AM3/11/15
to android-porting, ranci...@gmail.com
Try to add in script "mount -o rw,remount /storage/sdcard1" before mkdir
also you can use command dmesg to read kernel logs, so you can add in script something like "dmesg > kernel.log"

To use usb as debug console, you can try to enable gadget serial device in kernel and connect to pc through usbserial module
But I strongly advice you to get serial cable for debug, there will be all debug output and easy to use logcat

--

Rancid Frog

unread,
Mar 13, 2015, 2:52:51 PM3/13/15
to android...@googlegroups.com, ranci...@gmail.com
Thank you

I tried adding to my init.d script the command you suggested but it still did not work.

As for usb debug console, if you can point me to a guide with more information I would be very grateful.

For the serial cable I would need to order one, do you suggest any in particular?
Until then, I will try to figure some other way of debugging boot up issues

Thank you once again

Ivan Savygin

unread,
Mar 18, 2015, 9:54:11 AM3/18/15
to Rancid Frog, android-porting
There is documentation about g_serial https://www.kernel.org/doc/Documentation/usb/gadget_serial.txt, seems like you need to use mknod at startup to create ttyGS device if you like to link module statically in kernel

I looked throught your messages in thread and discovered that kernel uses ttyHSL0 console though I never saw that type of serial device before, seems like your device is based on Nexus platform. And what i found (here is the link http://blog.ruecker.fi/2013/04/29/there-is-an-uart-on-the-nexus-4/) in the internet tells me that probably your device uses headphones output for serial console. So you will need to do something like this http://www.accuvant.com/blog/building-a-nexus-4-uart-debug-cable which requires some time to do it. So if I were in your place i would obtain more information about serial ports in your device.

Rancid Frog

unread,
Mar 20, 2015, 2:43:15 PM3/20/15
to android...@googlegroups.com, ranci...@gmail.com
Thank you,

Will look more into this when I have the time
Reply all
Reply to author
Forward
0 new messages