Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

how to debug kernel loading and intrd load in virtualbox

I have cloned the linux kernel repo on my arch hosted machine (host is ubuntu 16.04). Two weeks ago I was able to boot into the new kernel (it was 4.11.rc06 back then), then I did git pull and recompiled everything and it just hangs after "loading initial ramdisk image...".

So I tried git clean -xfd then make localmoduleconfig answering defaults for everything, then make then make modules_install then mkinitcpio -p linux.4.11.custom and of course sudo cp -v arch/x86_64/boot/bzImage /boot/vmlinuz-linux.4.11.custom.

After I verified it does indeed hang I tried more git pulls, more cleans, but nothing changed.

Running the same kernel from the same source on a real machine boots. I could not find recorded bug in virtualbox or find an update for ubuntu.

Next I tried debugging it myself by adding to the grub's linux command: debug earlyprintk=vga,keep and even removing the initrd line adding noinitrd to the kernel, but I get no error. Just a screen with the grub's "echo" messages that stays like that forever.

  1. How can I debug it?
  2. Has anyone got any idea what can be done?
like image 214
codeScriber Avatar asked May 12 '17 21:05

codeScriber


1 Answers

To check whether the kernel even starts I would use KDB (kernel's built-in debugger), and see if you get a prompt at startup.

For better debugging I would try to get KGDB (GDB for kernel) working.

You can actually activate both to have all options available. See following link for more information about this:

https://www.kernel.org/doc/htmldocs/kgdb/index.html

like image 181
Mats Avatar answered Nov 03 '22 13:11

Mats