help with debugging init.rc

5,400 views
Skip to first unread message

Radu Iscu

unread,
Aug 24, 2011, 5:17:14 PM8/24/11
to android-porting
Hello guys,

Here's the skinny: I'm trying to port the honeycomb to the ziio 7 and I have to say that I can't even get the bare bones init.rc to boot.
I left the kernel partition intact as there's no point in messing with that (there's no recovery partition so the kernel doubles as a rescue). It holds a 2.6.29 kernel, which is the same as the default one in 3.0.

I never managed to get to a point where I have the new init/ueventd working. The device gets stuck in a boot loop, never getting passed the kernel logo.

I've tried putting exec logcat -d -f here and there in the init process, hoping for some clues, but that doesn't seem to be working.
Also there is nothing in /data/dontpanic/

Any ideas about what I should do to get a clue about what's going on?

--
Radu Iscu
Tel: 0742082607

Yan Weichuan

unread,
Aug 25, 2011, 4:30:59 AM8/25/11
to android-porting

I don't know what you can do in the device. Just some common
suggestion.

1. Build a ramdisk with busybox into kernel, and boot this ramdisk to
shell
2. mount the android partition, and switch to android by switch_root
command, I think you can get some info by this way.

Radu Iscu

unread,
Aug 25, 2011, 2:22:18 PM8/25/11
to yan.we...@gmail.com, android-porting
Busybox is already built in by the nice guys at zii labs.

My problem is init fails during init.rc loading before any service manages to start, including adbd.

By best guess is that it's a problem with ueventd crashing and causing the system to reboot since it's marked as critical.
I've been guessing that ueventd.rc is not required and I haven't been using it.
Also, all of the drivers are loaded as kernel modules in the init.rc, not in the init.goldfish.rc which I think would be normal.

If these files are missing, would this cause ueventd startup to crash?

Amit Pundir

unread,
Aug 26, 2011, 2:49:01 AM8/26/11
to link...@gmail.com, android-porting

Hi, I have been to this stage before where my system got stuck in boot loop because my Android services was crashing. Try following modifications in your init.rc

1) Set your "loglevel to 8". That way you will get more logs.

2) Disable all the service except "ueventd" and "console". See if you are able to get up to Android prompt (Console). If you manage to get Console, then start the services manually (e.g. start debuggred) and find out the service which failed first.

Regards,
Amit Pundir
http://arowboat.org
 
--
Radu Iscu
Tel: 0742082607

Radu Iscu

unread,
Aug 26, 2011, 8:25:20 AM8/26/11
to Amit Pundir, android-porting
I've tried that but I couldn't access adb.
Is there any other way to debug a device that doesn't have adbd running (in the context of a bare bones boot)?

lakehousetech

unread,
Sep 11, 2011, 10:24:31 PM9/11/11
to android-porting
Amit,
I've stumbled across the same problems while porting GB to a tablet
based on ARM MSM7227. I have set my loglevel to 8 in the init.rc, but
the last_kmsg from the boot failure doesn't give me enough information
to determine why my servicemanager is being killed 4 times in 4
minutes. I read your recommendation about commenting out all services
and starting each manually to determine where the problem is, however
I don't understand what you mean when you refer to 'getting up to the
android console'. How are you able to monitor what is happening on the
device (and manually start services) without abd running and access
via terminal? I'm obviously missing something important when it comes
to debugging the startup process, so if you have any suggestions I
would be grateful.

Chris

On Aug 26, 2:49 am, Amit Pundir <pundira...@gmail.com> wrote:
> On Thu, Aug 25, 2011 at 2:47 AM, Radu Iscu <linke...@gmail.com> wrote:
> > Hello guys,
>
> > Here's the skinny: I'm trying to port the honeycomb to the ziio 7 and I
> > have to say that I can't even get the bare bones init.rc to boot.
> > I left the kernel partition intact as there's no point in messing with that
> > (there's no recovery partition so the kernel doubles as a rescue). It holds
> > a 2.6.29 kernel, which is the same as the default one in 3.0.
>
> > I never managed to get to a point where I have the new init/ueventd
> > working. The device gets stuck in a boot loop, never getting passed the
> > kernel logo.
>
> > I've tried putting exec logcat -d -f here and there in the init process,
> > hoping for some clues, but that doesn't seem to be working.
> > Also there is nothing in /data/dontpanic/
>
> > Any ideas about what I should do to get a clue about what's going on?
>
> Hi, I have been to this stage before where my system got stuck in boot loop
> because my Android services was crashing. Try following modifications in
> your init.rc
>
> 1) Set your "loglevel to 8". That way you will get more logs.
>
> 2) Disable all the service except "ueventd" and "console". See if you are
> able to get up to Android prompt (Console). If you manage to get Console,
> then start the services manually (e.g. start debuggred) and find out the
> service which failed first.
>
> Regards,
> Amit Pundirhttp://arowboat.org

Amit Pundir

unread,
Sep 14, 2011, 6:38:51 AM9/14/11
to chris...@gmail.com, android-porting
Chris,

I'm usually connected to my development targets via UART/Serial port. When I said disable all Android services (except ueventd and console) and reach to a console prompt, I meant reach to the point where your minimal Android (linux+ueventd+console) boots up and give you a prompt on your serial terminal. From there you can start Android services manually one by one and find out which one failed.

Hope I didn't confuse you much. Let me know if you have any more concerns.

Regards,
Amit Pundir

James Coggan

unread,
Sep 14, 2011, 9:28:04 AM9/14/11
to pundi...@gmail.com, chris...@gmail.com, android-porting

Vi. I have ported succesfully gingerbread to 2 msm7227 devices .
Add me to gtalk. Maybe i can help

lakehousetech

unread,
Sep 14, 2011, 10:52:00 AM9/14/11
to android...@googlegroups.com, pundi...@gmail.com, chris...@gmail.com
Not at all...but what I did take from your recommendation was to comment out services in init.rc and see how far the boot gets before servicemanager starts to crash (since I don't have a development board with UART/serial port access). Unfortunately this is really time consuming, and I figured there might be a better way to attack the problem.

Arun Mench

unread,
Jun 27, 2016, 11:24:41 AM6/27/16
to android-porting, chris...@gmail.com, pundi...@gmail.com
Hi Amit Pundir,

Need one help, I want to boot Android (linux+ueventd+console) , what all things needs to be there in init.rc to do this?

please send me details or if u have init.rc i can use it...barunmench@gmail.com

Arvind Yadav

unread,
Sep 6, 2016, 10:16:21 AM9/6/16
to android-porting, link...@gmail.com
Hello Guys,

I am trying to enable logcat in init.rc file using the following service declaration.


service logcatd /system/bin/logcat -b all -v threadtime -v usec -v printable -D -f /data/misc/logd/logcat -r 64 -n 256
    class late_start
    disabled
    # logd for write to /data/misc/logd, log group for read from log daemon
    user logd
    group log
    writepid /dev/cpuset/system-background/tasks


 I had started the service inside "on property:persist.logd.logpersistd=logcatd" like

    on property:persist.logd.logpersistd=logcatd
    mkdir /data/misc/logd 0700 logd log
    exec - logd log -- /system/bin/logcat -L -b all -v threadtime -v usec -v printable -D -f /data/misc/logd/logcat -r 64 -n 256
    start logcatd


Now for getting the log every time i need to set this property using terminal shell command.

Can you please help me how to set this property ""persist.logd.logpersistd=logcat" using code.

Thanks.
Reply all
Reply to author
Forward
0 new messages