Debugging hooks & initramfs - guidance needed

Ask questions about Arch Linux ARM. Please search before making a new topic.

Debugging hooks & initramfs - guidance needed

Postby mikex » Fri Apr 12, 2013 12:48 pm

Hello,

I have been trying to write a hook for mkinitcpio (btw: using the raspberry with kernel 3.6.11-9). With the help of the mkinitcpio wiki and many usefull posts in this forum I have been able to write some very simple hook scripts, create an image with mkinitcpio and have it loaded by the kernel etc. So far things are working fine. Now I'd like to move ahead and do something a little more complicated. This brings up the question on a good debugging strategy for hook scripts and initramfs? How would I go about this? Is there a way to open a initramfs debug shell during boot?

A second question is regarding the msg":: xxxxx" command used in many existing hooks I've looked at. Where is the output supposed to show up? I can't find it in dmesg.

Thanks!
mikex
 
Posts: 5
Joined: Fri Apr 12, 2013 11:39 am

Re: Debugging hooks & initramfs - guidance needed

Postby mikex » Sat Apr 13, 2013 5:17 pm

looks like I figured a few things out. For those who also might be interested:

first, right in the mkinitpio wiki is a hint on how to open an interactive shell while still in the initramfs (don't know why I haven't seen this earlier): just use e.g. break=postmount as a kernel command line parameter. That works fine. Adding temporarily a few more binaries for debugging purposes to the ramdisk image file one can do a pretty decent hook script debugging right in that shell.

second, if - like in my case - your only access to the Raspberry during this boot sequence is through the serial port make sure that the console kernel command line parameter is set to ttyAMA0. In my case it was set to tty1 and all output from the hooks as well as the interactive shell were not available through the serial port. It is not sufficient to have only kgdboc set to ttyAMA0.
mikex
 
Posts: 5
Joined: Fri Apr 12, 2013 11:39 am


Return to User Questions

Who is online

Users browsing this forum: No registered users and 11 guests