Running RaspberryPi using Qemu (Fedora 24)
Mostly taken from here: https://wiki.debian.org/RaspberryPi/qemu-user-static
Adopted to run using Fedora 24
enabled
interpreter /usr/bin/qemu-arm
flags:
offset 0
magic 7f454c4601010100000000000000000002002800
mask ffffffffffffff00fffffffffffffffffeffffff
Make symbolic link to match the interpreter path:
ln -s /usr/bin/qemu-arm-static /usr/bin/qemu-arm
unzip 2016-05-27-raspbian-jessie.zip
Setup loopback:
losetup -f -P --show 2016-05-27-raspbian-jessie.img
mkdir ~/mnt
mount /dev/loop0p2 ~/mnt
mount /dev/loop0p1 ~/mnt/boot
# or for sdcard
mount /dev/mmcblk0p2 ~/mnt
mount /dev/mmcblk0p1 ~/mnt/boot
Press ^] three times within 1s to kill container.
root@raspi:/#
root@raspi:/# apt-get install kodi
umount ~/mnt/boot
umount ~/mnt
losetup -D
dd bs=4M if=2016-05-27-raspbian-jessie.img of=/dev/mmcblk0
Adopted to run using Fedora 24
Install qemu-user-static:
dnf install qemu-user-staticRegister binfmt:
systemctl restart systemd-binfmtCheck binfmt interpreter:
cat /proc/sys/fs/binfmt_misc/qemu-arm-static will show you:enabled
interpreter /usr/bin/qemu-arm
flags:
offset 0
magic 7f454c4601010100000000000000000002002800
mask ffffffffffffff00fffffffffffffffffeffffff
Make symbolic link to match the interpreter path:
ln -s /usr/bin/qemu-arm-static /usr/bin/qemu-arm
Download raspbian image, and extract it
(Skip this if you already have sdcard with raspbian)
wget ......unzip 2016-05-27-raspbian-jessie.zip
Setup loopback:
losetup -f -P --show 2016-05-27-raspbian-jessie.img
Mount image or sdcard:
cd ~mkdir ~/mnt
mount /dev/loop0p2 ~/mnt
mount /dev/loop0p1 ~/mnt/boot
# or for sdcard
mount /dev/mmcblk0p2 ~/mnt
mount /dev/mmcblk0p1 ~/mnt/boot
Copy qemu-arm-static:
cp /usr/bin/qemu-arm-static ~/mnt/usr/bin/qemu-armNow, spawn your raspi:
systemd-nspawn -D ~/mnt -M raspi bin/bashPress ^] three times within 1s to kill container.
root@raspi:/#
Modify your image:
Do something like:root@raspi:/# apt-get install kodi
Write image to sdcard:
(Skip this if you already have sdcard with raspbian)
exit from systemd-nspawnumount ~/mnt/boot
umount ~/mnt
losetup -D
dd bs=4M if=2016-05-27-raspbian-jessie.img of=/dev/mmcblk0
Comments