For the project I am doing now, I need to run all the test in the virtual machine (Qemu). After a few month of work, I think that it's a time to do the test in a totally new img (kernel) and verify our guessing before. So I created a new img file and install the Ubuntu 10.04 (32bit) on it.
Then the problem came. After compiling a new kernel (with defconfig) and installing it to the system, the kernel went into panic once reboot. What's worse, I could not even go to the part when I can choose which kernel to use. :(
The suggestion I got from others is to mount the img file in the host OS and modify the /boot/grub/grub.cfg file to change the default kernel. Here is how to mount the img file:
mkdir ~/img # the folder that stores the fs
fdisk -u -l ***.img # get the info for the img
sudo mount -o loop, offset=1048576 ***.img ~/img # the offset is the start address of the linux fs in the img, we can get this offset from the result of previous step.
Now, we can check all the files in the img
sudo umount ~/img
Done!!!
Reference:
http://my.oschina.net/toyandong/blog/65002