I came across turnkey while trying to find a solution for this issue, and ended up posting on the blog.
But the forum is the better place for this, so I will repost what I am trying to do.
I'm trying to convert a virtual machine with MikroTik Router OS into a bootable configured ISO of the configured OS. ISO --> Virtual Machine --> ISO of the VM
I've managed to properly follow the instructions here: http://www.turnkeylinux.org/blog/convert-vm-iso
I had my own gotcha when trying to mount the raw image. There is some offseting that needs to be accounted for.
I found that information gleaned from here: http://felinemenace.org/~andrewg/MikroTik_Router_Security_Analysis_Part1/
Basically have to mount the RAW image with and offset of 512 to id the filesystem (ext2) properly.
/sbin/fdisk -l -u mikrotik.raw
This will actually mount an image properly, so just modify it as the Gotcha above for partitions.
mount -o loop,offset=512 mikrotik.raw /mnt/mikro/
The two partitions are /boot and /
The first is /boot the second is /
I've copied files from the / partition, and ran the script tklpatch-prepare-cdroot but the script bombs out about at:
# preparing cdroot
basename: missing operand
Try `basename --help' for more information.
cp: omitting directory `Mikrotik//boot/'
I'm just stuck now, I don't know how to (or if I need to) properly add both partitions to the image nor will the script run on the rootfs gleaned from one of the partitions.
If anyone can help I would appreciate this. If someone wants to try it themselves, the specifications for the Virtual Machine are
Type - Other Linux 2.6 32 bit,
Storage - Needs less than 100 megabytes.
Memory - 128 or more.