After finish building a LFS system, installed on a IMG file (system.img) and being able to run the system with qemu with the command:
qemu-system-x86_64 -hda system.img -vga std -m 4G
I want now generate a ISO file based on this image disk file, with the follow conditions:
- with the generated ISO file, I want use a tool like Rufus or similar (is there something equivalent for linux?) to create a boot disk on an usd stick or sd card, to allow me boot with this system in another machines.
- the image disk have a total size of 5Gb, but have 1.9GB of free space. I want the ISO file be created with only the used space (if could be compressed without be incompatible with qemu or creation of the boot disk, would be great).
- when create the boot disk, I want to be able to have a mount point in the system to some of the free space available in the boot device.
- I want have some shell script that make possible install the system in the machine I boot on.
Anyone can give some hints of how to do that?