Test custom MIPS image in Qemu

I would like to test my custom mipsel_24kc image created by ImageBuilder in Qemu. I have read the qemu OpenWrt page and I can run qemu-system-mipsel with the Malta ELF file.

But I would like to use my custom image to test it. I have seen the comment of ext4 support in Qemu MIPS.

Should I try to add an ext4 file of my image in the Image Builder process (unsuccessful on this so far) and pass -hda image.ext4 to qemu?

Or is there a way to load the squashfs in qemu-system-mipsel? Should I conver the kernel bin to the ELF format?

Any help would be appreciated.

malta is a specific/ special mips target, (nowadays) exclusively suitable for virtualization (qemu). qemu cannot boot an, e.g., archer c7-v2 image, limiting its usefulness considerably; pre-checking/ confirming that a self-built image will boot up/ work is not possible that way.

Thank you very much for the quick answer. Is there a recommendation how to test a custom image before flashing it to the real hardware or testing it on the real hardware but without "altering" the booting image?

In the end, you can only test it on the real hardware. Keeping (and testing on-) a spare and having reliable recovery methods (like push-button tftp recovery and/ or serial console access) would be the alternatives. For many tests, a similar, but lower end, device of the same target might suffice, but there can (will) still be cases where an image would work on the low-end device, but not the high-end one (and vice versa), due to different bootloader details, different addon (non-SOC internal-) hardware, variances in DTS setup, etc. pp.

Thank you very much for the follow-up!