Portal:KIWI/FAQ/21

Jump to: navigation, search

Q: How may I debug problems during Kiwi startup

Debugging problems that show up when Kiwi is starting a system require some special tricks. The first is to command Kiwi to create a debugging console by adding the string "kiwidebug=1" to the boot options line. When Kiwi fails, use CTRL-ALT-F2 to switch to that console, which will make a limited shell available. Use CTRL-ALT-F1 to return to the main console.

The Kiwi debug shell does not have a pager such as less, thus it is difficult to use it alone to examine the Kiwi boot log found at /var/log/boot.kiwi. For this reason, it is usually better to start the Kiwi boot process in a virtual machine (VM) created by qemu (32-bit only) or qemu-kvm (32- or 64-bit systems) where the -serial option may be used to transfer the content of the log file back to the host where a full set of tools is available.

In most cases, the image being booted will be a CD such as a KDE or Gnome Live CD. To start the VM use one of the two following commands:

qemu-kvm -serial stdio -cdrom <path to image to be booted>
qemu-kvm -serial file:<path to saved file> -cdrom <path to image to be booted>

The first form of the command will log any data output from debugging to the terminal used to start qemu-kvm, while the second will write it to a file on the host.

When debugging in a qemu VM, the CTRL-ALT-FX keystrokes are captured by the host, and a few extra steps are required. First, switch to the qemu command console by using CTRL-ALT-2. From there you can switch to the Kiwi debugging console using the command

sendkey ctrl-alt-f2

Pressing CTRL-ALT-1 returns you to the VM.

For serial output in the VM to reach the host, debugfs must be mounted - a step not well documented in other tutorials. To do this, use the command

mount -t debugfs /dev /dev

At this point, you can capture the log file using

cat /var/log/boot.kiwi > /dev/ttyS0