Hello,
I've been struggling with running OpenWrt ARM images on qemu for awhile now and I think I should really ask some questions at this point to clear up my misunderstandings. I'm on Ubuntu, by the way.
I clone the buildroot repository for OpenWrt, enter ~/openwrt/, select the ARMv8 Multiplatform target, makedefconfig, update and install feeds, run menuconfig and add a few packages/utils (tcpdump, some disk/file system operations in busybox, and my own project I'm trying to port), and start the build. It builds fine.
The output in ~/openwrt/bin/arm64 includes the following files:
openwrt-arm64-qemu-virt.Image
openwrt-arm64-qemu-virt-initramfs.Image
openwrt-arm64-vexpress-foundation.axf
The page on virtualizing openwrt with Qemu gives this instruction:
qemu-system-aarch64 -machine virt -cpu cortex-a57 -machine type=virt -nographic \
-smp 1 -m 2048 \
-kernel bin/arm64/openwrt-arm64-qemu-virt-initramfs.Image \
--append "console=ttyAMA0"
I really only tried using the .Image files, but that extension is unfamiliar to me.
I'm trying to get it to a place where I can have a virtual system that has a mountable, writable file system that I can manipulate outside of Qemu (this is for research, but it's probably boring so I won't go into it).
So, I've noticed that it doesn't seem to matter whether I pass openwrt-arm64-qemu-virt.Image or openwrt-arm64-qemu-virt-initramfs.Image as the kernel argument. That means that I can't have any settings or configuration files other than the default ones from when the image is built because there's no persistent file system.
I've fiddled around with block mount, fstab configurations, and passing -device and -drive options with a disk image file to use as the file system, but since any changes I make to the configuration files or init scripts revert back to the default on shutting down or rebooting. As such, I can't change the scripts at boot to call switch_root/pivot_root to follow the extroot instructions. I'm at a loss, here.
So, what I'm asking is...
What's the difference between the openwrt-arm64-qemu-virt.Image and openwrt-arm64-qemu-virt-initramfs.Image files?
How can I get a persistent root file system for this target?
Is what I'm trying to do possible, and does what I'm describing make sense?
Is there any further reading than what's on the "OpenWrt in Qemu" page that gives more explanation and detail?
Is there a better way to run an ARM-based OpenWrt image on a VM? (realview has some serious issues, namely that I can only have 1 network port)
Thanks for your time, and anyone who can help me out here would be my savior.