Feature #879
closed
Investigate ability to auto-generate compressed SD card image for each system build.
Added by Hammel almost 3 years ago.
Updated almost 3 years ago.
Description
This could use what I've learned from Pine64 and at work in how the image can be generated locally without having an SD card.
This is already partly done (generate to file) but probably needs improvement.
- Severity changed from 05 - Very Low to 02 - High
- Status changed from New to In Progress
- % Done changed from 0 to 10
Basic process is:
- Do 3 times: dd if=/dev/zero of=file1.img bs=512 count=<partition size>
- mkfs.ext4/vfat image file
- e2cp <files> fileX.img
- See man page
- export MTOOLS_SKIP_CHECK=1 && mcopy -i fileX.img files(s) ::/<location>
- cat fileX.img fileY.img fileZ.img > fileAll.img
- sgdisk fileAll.img (to create partition table)
Then the whole thing can be gzip'd. This whole process should replace mkinstall -f option and remove the -f option in mksd. Or I could just split these up so the process is still the same, just to a file instead of a real SD card.
- Status changed from In Progress to Closed
- % Done changed from 10 to 100
While this method is good and doesn't require mounting a filesystem (which requires sudo and kpartx), I already have this working in the mksd and mkinstall scripts. It required a little cleanup, but not much. Also, e2cp doesn't quite work as I'd like so it really isn't that much better that what I already implemented.
I also added image compression, though the final image is still over 1G.
Tested, committed and pushed.
Also available in: Atom
PDF