I want to trace the raspberry pi booting process . I want to see in which file , in which function we are at a particular time and what that function is doing . Can anybody tell me the best way through which i can do this ?

Thank you !


You may

Use qemu to emulate raspbian.The process is documented in this link

$ mkdir ~/rpi_emu
$ cd ~/rpi_emu
$ wget http://downloads.raspberrypi.org/raspbian_latest -0 -O 2014-01-07-wheezy-raspbian.zip
$ unzip 2014-01-07-wheezy-raspbian.zip -d .
$ rm 2014-01-07-wheezy-raspbian.zip
$ wget http://xecdesign.com/downloads/linux-qemu/kernel-qemu
$ qemu-system-arm -kernel kernel-qemu -cpu arm1176 -m 256 -M versatilepb -no-reboot -serial stdio -append "root=/dev/sda2 panic=1 rootfstype=ext4 rw init=/bin/bash" -hda 2014-01-07-wheezy-raspbian.img

This does not work under some windows managers. I have tried i3wm, awesome and GNOME Shell. Only GNOME Shell worked and the other two halted when I tried to focus my mouse to the guest OS.

If you successfully login to Raspbian, change the file /etc/ld.so.preload but not /usr/lib/arm-linux-gnueabihf/libcofi_rpi.so. As far as I know, this file contains only one line, put a # in front of it. Save and shutdown the Raspbian.

The second time boot it with

$ qemu-system-arm -s -S -kernel kernel-qemu -cpu arm1176 -m 256 -M versatilepb -no-reboot -serial stdio -append "root=/dev/sda2 panic=1 rootfstype=ext4 rw" -hda 2014-01-07-wheezy-raspbian.img

Then open another terminal, run

$ gdb-multiarch

qemu will wait for a gdb connection to start, so

$ gdb-multiarch
(gdb) set architecture arm
(gdb) target remote localhost:1234
(gdb) si            # to debug step by step
(gdb) x/i <address> # to disassemble code

Install the bootlogd package using :

apt-get install bootlogd

It logs the boot process in /var/log/boot

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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