Instructions for botting a Raspberry PI image in PANDA:
These steps mostly mirror those from the great guide at https://azeria-labs.com/emulate-raspberry-pi-with-qemu/ except for how to modify the guest's fstab file.
Download and extract filesystem
$ wget http://downloads.raspberrypi.org/raspbian/images/raspbian-2017-04-10/2017-04-10-raspbian-jessie.zip
$ unzip 2017-04-10-raspbian-jessie.zip
Get pre-built linux kernel for RPi
$ git clone git@github.com:dhruvvyas90/qemu-rpi-kernel.git
Update fstab so the filesystem mounts correctly. Note the offset argument is 512 * the start offset of the 2nd partition from fdisk -l. Should be 47185920 unless the image changes.
$ OFFSET=$(fdisk -l 2017-04-10-raspbian-jessie.img | grep img2 | awk '{print $2*512}')
$ sudo mkdir /mnt/rpi
$ sudo mount -v -o offset=$OFFSET -t ext4 ./2017-04-10-raspbian-jessie.img /mnt/rpi/
Edit fstab to change PARTUUID-based identification to /dev/sdaX
$ sudo vim /mnt/rpi/etc/fstab
Replace PARTUUID-...01 with /dev/sda1 and PARTUUID-...02 with /dev/sda2
Unmount the filesystem
$ sudo umount /mnt/rpi
Run PANDA
$ panda-system-arm \
-M versatilepb \
-cpu arm1176 \
-m 256 \
-kernel ./qemu-rpi-kernel/kernel-qemu-4.14.79-stretch \
-append "root=/dev/sda2 rootfstype=ext4 rw" \
-dtb ./qemu-rpi-kernel/versatile-pb.dtb \
-hda ./2017-04-10-raspbian-jessie.img \
-nographic \
-no-reboot