I have a system that generates embedded Linux systems. The system outputs three files:
- a tarball containing rootfs excluding the kernel modules
- a tarball containing the kernel modules
- uImage
The system is deployed on a 1 GB SD card, of which 10 MB is given to a FAT boot partition and the rest to an ext4 root partition.
The most optimal output format for the system would be an image file that could be written on the SD card using dd. Right now, that image file is created by partitioning and formatting the SD card manually, extracting/copying the files on it and then reading the contents of the card using dd. It works, but the process could be a lot easier.
I know it's possible to create a loop file system representing the card, create the file systems on that and then extract/copy the files on them. I have tried that, and it works to some extent, but not well enough. The problem seems to be related to partitioning and the "geometry" (as in the geometry of a hard-disk, which, as far as I know, shouldn't matter in the case of a memory card) of the SD card, as if the partitioning should be specific to the model of the card, but I am not enough an expert on that area to say more than that.
What would be the proper way to get from the two tarballs and uImage to an image that could be copied on the SD card with dd?