3

There's an Ubuntu image for the Raspberry Pi 2 here: https://wiki.ubuntu.com/ARM/RaspberryPi

I'd like to boot this image under qemu. I'd like to do it so that I can have some virtual build systems as I'm trying to port some software to it (I'm aware it's slow but the CI system gets to wait for the builds, not me).

So I start from this on an Ubuntu 14.04 amd64 box:

wget http://www.finnie.org/software/raspberrypi/2015-04-06-ubuntu-trusty.zip
unzip 2015-04-06-ubuntu-trusty.zip
apt-get install qemu-system
# Somehow I copy the kernel / initrd image out of the .img file
CPU="a qemu cpu that matches the raspberry pi 2 cpu"
MACHINE="a qemu machine that matches the raspberry pi 2"
qemu-system-arm -kernel kernel -cpu $CPU -m 2048 -M $MACHINE \
    -no-reboot -serial stdio -append "root=/dev/sda2 panic=1" \
    -hda ~/2015-04-06-ubuntu-trusty.img -redir tcp:2222::22

I'm not sure where the kernel and initrd image live in the image. I see with file -k there are two partitions so I think I'll be able to find them. Though I'm not clear on where to put the initrd (or if the arm arch even uses one).

But I really don't know the values of CPU and MACHINE above. Does anyone know them? I'd like to have a full virtual booting script to contribute to that Ubuntu wiki page.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.