Bug 9099

Summary: Create sparse images with wic
Product: [Build System, Metadata & Runtime] OE-Core Reporter: Joshua Lock <joshuagloe>
Component: Scripts and ToolsAssignee: Ed Bartosh <eduard.bartosh>
Status: RESOLVED FIXED QA Contact:
Severity: enhancement    
Priority: Medium CC: alexander.kanevskiy, eduard.bartosh, kergoth, randy.macleod, ross.burton
Version: 2.2   
Target Milestone: 2.2   
Hardware: x86   
OS: Multiple   
Whiteboard:
OS type for building Yocto: --- Type of Regression: ---
Verified: Documentation change: Yes (doc changes required)
Bug Depends on:    
Bug Blocks: 9413    
Attachments:
Description Flags
bmap-tools recipe
none
bmap image conversion type none

Description Joshua Lock 2016-02-11 11:51:04 UTC
Sparse images use less disk space and can be written more efficiently with a utility like bmap-tools.

I wrote a patch for wic[1] and a testcase[2] but the option the sparse conversion symbol isn't available in the version of dd shipped in Debian 7.

These changes can't be merged until we no longer support Debian 7, so this bug is to ensure the changes don't get lost.

1. http://lists.openembedded.org/pipermail/openembedded-core/2015-December/114228.html
2. http://lists.openembedded.org/pipermail/openembedded-core/2015-December/114309.html
Comment 1 Ed Bartosh 2016-02-11 13:03:31 UTC
Can we use native dd?

Generally I'd suggest to use native tools in wic as much as possible.
This should make it less dependent of the host system.

There was some work done already and adding dd to the list of already used native tools would be good.
Comment 2 Ross Burton 2016-02-11 13:52:52 UTC
Dropping Debian 7 is something we want to do for master anyway, as it's very old now.
Comment 4 Ed Bartosh 2016-03-31 15:15:21 UTC
There is interesting piece of work done in ostroproject that may be related to this: https://github.com/ostroproject/meta-ostro/pull/70/files

This commit contains the code which we can use instead of dd: https://github.com/ostroproject/meta-ostro/pull/70/commits/ccb4f0ca6b36f365bddaa9367ac1e95e0b8c3b5b
Comment 5 Joshua Lock 2016-04-08 09:17:25 UTC
After discussion in the triage meeting on 7th April we want to try and get my simple patches that use dd into 2.1 and Ed will work on improving the sparseness support in the 2.2 cycle.

To that end I resubmitted the patches to the list:
http://lists.openembedded.org/pipermail/openembedded-core/2016-April/120034.html
http://lists.openembedded.org/pipermail/openembedded-core/2016-April/120035.html
Comment 6 Alexander Kanevskiy 2016-04-09 10:39:17 UTC
Replied to list. Proposed patch might be dangerous, as dd would not handle sparse blocks correctly.
Comment 7 Alexander Kanevskiy 2016-04-11 11:43:37 UTC
Created attachment 3111 [details]
bmap-tools recipe

bmap-tools recipe adopted from Ostro Project to OE
Comment 8 Alexander Kanevskiy 2016-04-11 11:44:33 UTC
Created attachment 3112 [details]
bmap image conversion type

bmap image coversion type.
Comment 9 Ed Bartosh 2016-04-13 08:39:05 UTC
I'll take care of this bug as I'll be working on bmap-tools support for wic in 2.2 time frame.
Comment 10 Ed Bartosh 2016-04-28 09:48:51 UTC
Used APIs from bmap-tools and ostro projects to make wic images sparse.
Agreed with Alexander to add required functionality to the bmaptool that wic can use it.

The patchset has been sent for review: http://lists.openembedded.org/pipermail/openembedded-core/2016-April/120735.html
Comment 12 Ed Bartosh 2016-05-06 10:22:54 UTC
The patchset has been merged to master: https://git.yoctoproject.org/cgit/cgit.cgi/poky/commit/?id=7669219652bcc10fe957114952861d450f825274