yum install makebootfat dosfstools
dd if=/dev/zero of=rpi_installer.img bs=1M count=2048
losetup /dev/loop0 rpi_installer.img
kpartx -av /dev/loop0
fdisk /dev/loop0
Command (m for help): n
Command action
e extended
p primary partition (1-4)
p
Partition number (1-4): 1
First cylinder (1-261, default 1):
Using default value 1
Last cylinder, +cylinders or +size{K,M,G} (1-261, default 261):
Using default value 261
Command (m for help): a
Partition number (1-4): 1
Command (m for help): w
The partition table has been altered!
Calling ioctl() to re-read partition table.
WARNING: Re-reading the partition table failed with error 22: Invalid argument.
The kernel still uses the old table. The new table will be used at
the next reboot or after you run partprobe(8) or kpartx(8)
Syncing disks.
kpartx -av /dev/loop0
mkfs.vfat /dev/mapper/loop0p1
mkdir /tmp/x
mount -o loop rpi_installer.img /tmp/x
cd /tmp/x
unzip /root/rpi_installer_08-19-12.zip
cd && umount /tmp/x
losetup -d /dev/loop0
qemu-system-arm -kernel kernel-qemu -cpu arm1176 -m 256 -M versatilepb -no-reboot -serial stdio -append "root=/dev/sda1 panic=1" -hda rpi_installer.img -net nic -net user -vnc :1 -net tap,ifname=vnet1,script=no,downscript=no
VM doesn't boot for lack of init script.