Download debian ISO, see http://cdimage.debian.org/cdimage/release/current/mips64el/iso-cd
curl -OL 'http://cdimage.debian.org/cdimage/release/current/mips64el/iso-cd/debian-9.4.0-mips64el-netinst.iso'
Download initrd & vmlinux, see http://ftp.debian.org/debian/dists/stretch/main/installer-mips64el/current/images/malta/netboot
curl -OL 'http://ftp.debian.org/debian/dists/stretch/main/installer-mips64el/current/images/malta/netboot/initrd.gz'
curl -OL 'http://ftp.debian.org/debian/dists/stretch/main/installer-mips64el/current/images/malta/netboot/vmlinux-4.9.0-6-5kc-malta'
Create a new hard disk
qemu-img create -f qcow2 hda.qcow 10G
Install debian
qemu-system-mips64el -cdrom debian-9.4.0-mips64el-netinst.iso \
-hda hda.qcow \
-M malta \
-kernel vmlinux-4.9.0-6-5kc-malta \
-boot d \
-initrd initrd.gz \
-m 512 \
-cpu 5KEc \
-nographic \
-append "root=/dev/sda1 nokaslr"
Allow for the installation to complete.
sudo modprobe nbd max_part=8
sudo qemu-nbd --connect=/dev/nbd0 hda.qcow
mkdir hda
sudo mount /dev/nbd0p1 hda
cp hda/boot/initrd.img-4.9.0-6-5kc-malta .
sudo umount hda
sudo qemu-nbd -d /dev/nbd0
Boot from hda
qemu-system-mips64el -hda hda.qcow \
-M malta \
-kernel vmlinux-4.9.0-6-5kc-malta \
-initrd initrd.img-4.9.0-6-5kc-malta \
-m 512 \
-cpu 5KEc \
-nographic \
-append "root=/dev/sda1 nokaslr"