1

Steps performed on setting up the emulation -

  1. Got Qemu

    qemu-arm -cpu ?

  2. Got the raspberry pi image

    So I downloaded the NOOBS, which provided the recovery.img

  3. G0t the kernel

  4. Resized the image to have more space

  5. **Booted to root shell

     qemu-system-arm -kernel kernel-qemu -cpu arm1176 -m 256 -M versatilepb -append "root=/dev/sda2 panic=1 init=/bin/sh rw" -hda recovery.img.
    

While executing the following command in the terminal, the terminal displays audio:

Could not init `oss' audio driver**

However, the command fires up the qemu, but its rebooting after every 1 sec in a non-stop manner.

I'm attaching the screenshot QEMU screenshot

How to fix this issue such that I can boot the qemu to the root shell?

Madhumitha
  • 80
  • 2
  • 8

1 Answers1

2

How did you resize your image?

I resized as follows, it works fine for me. (I'm on Ubuntu 12.04 and trying with raspbian):

root@unknown:~# qemu-img info 2014-09-09-wheezy-raspbian.img 
image: 2014-09-09-wheezy-raspbian.img
file format: raw
virtual size: 3.1G (3276800000 bytes)
disk size: 3.1G

root@unknown:~# qemu-img resize 2014-09-09-wheezy-raspbian.img +1G
Image resized.

root@unknown:~# qemu-img info 2014-09-09-wheezy-raspbian.img 
image: 2014-09-09-wheezy-raspbian_1.img
file format: raw
virtual size: 4.1G (4350541824 bytes)
disk size: 3.1G

root@unknown:~# 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/sh" -hda 2014-09-09-wheezy-raspbian.img

In your case, /dev/sda2 is not available. try with /dev/sda/,

qemu-system-arm -kernel kernel-qemu -cpu arm1176 -m 256 -M versatilepb -append "root=/dev/sda panic=1 init=/bin/sh rw" -hda recovery.img -no-reboot

If it doesn't work, you have to verify your img, and make sure proper partitions are present.

Verify the available partition in your img:

root@unknown:~# fdisk -l 2014-09-09-wheezy-raspbian.img 

Disk 2014-09-09-wheezy-raspbian.img: 4350 MB, 4350541824 bytes
255 heads, 63 sectors/track, 528 cylinders, total 8497152 sectors
Units = sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disk identifier: 0x00090806

                         Device Boot      Start         End      Blocks   Id  System
2014-09-09-wheezy-raspbian.img1            8192      122879       57344    c  W95 FAT32 (LBA)
2014-09-09-wheezy-raspbian.img2          122880     6399999     3138560   83  Linux

Also use -no-reboot flag to avoid continuous reboot, in case any kernel panic.

jjlogu
  • 91
  • 4