Bug 3444

Summary: Use sparse files for images
Product: [Build System, Metadata & Runtime] OE-Core Reporter: Darren Hart <dvhart>
Component: deploymentAssignee: Ross Burton <ross.burton>
Status: RESOLVED NOTABUG QA Contact:
Severity: enhancement    
Priority: Medium CC: bluelightning, ross.burton
Version: unspecified   
Target Milestone: 2.1 M3   
Hardware: x86   
OS: Multiple   
Whiteboard:
OS type for building Yocto: --- Type of Regression: ---
Verified: Documentation change: Yes (doc changes required)

Description Darren Hart 2012-11-15 18:21:01 UTC
Many of our images have a lot of empty space in them. There are projects around that take advantage of sparse files and filemaps to create a better image writer which only writes the necessary data to the target device. This should result in smaller images and faster device write times (and longer flash life as well).
Comment 1 Darren Hart 2013-07-19 01:09:56 UTC
Tom is going to try and find the MeeGo solution reference...
Comment 2 Ross Burton 2014-09-25 15:25:54 UTC
So the bare filesystem images are sparse already:

$ du -h core-image-sato-nuc-20140916184231.rootfs.ext3
444M	core-image-sato-nuc-20140916184231.rootfs.ext3
$ du -h --apparent-size core-image-sato-nuc-20140916184231.rootfs.ext3
984M	core-image-sato-nuc-20140916184231.rootfs.ext3

But when that gets wrapped up into a hddimg most of the sparseness disappears:

$ du -h core-image-sato-nuc-20140916184231.hddimg
1000M	core-image-sato-nuc-20140916184231.hddimg
$ du -h --apparent-size core-image-sato-nuc-20140916184231.hddimg
1014M	core-image-sato-nuc-20140916184231.hddimg
Comment 3 Ross Burton 2016-02-11 11:45:47 UTC
*Most*, this is due to wrapping an ext in a fat in a...  and it's filesystems all the way down.

There's a problem with wic in that it *doesn't* do sparse, but there's a patch for that already.