I once made a little script to make a bootable ISO9660 live file system,
given the distribution tarballs. It has to be able to live on a
read-only medium, hence it uses a tmpfs for /var. For initializing it,
it installs a script in /etc/rc.d. I basically used trial and error;
everything that produced an error message while booting was reason for
adding an extra directory or empty file.
https://www.falu.nl/~rhialto/mkiso
I just gave it a quick try, and qemu seemed a looot slower than
previously (when I last tried was under 7.0.2 I think)...