Bug 11278

Summary: wic: create an option to use entire disk
Product: [Build System, Metadata & Runtime] OE-Core Reporter: Stephano Cetola <stephano>
Component: Scripts and ToolsAssignee: Ed Bartosh <eduard.bartosh>
Status: RESOLVED FIXED QA Contact:
Severity: enhancement    
Priority: Medium+ CC: brian.avery, california.l.sullivan, ross.burton, sgw, stephano
Version: 2.2   
Target Milestone: 2.4 M3   
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: 11291    

Description Stephano Cetola 2017-03-31 17:52:22 UTC
We would like to have wic provide functionality similar to mkefidisk. 

Essentially, use as much of the disk space as is available:
ROOTFS_SIZE = (DEVICE_SIZE - BOOT_SIZE - POSSIBLE_OTHER_THINGS)

Ideally there would be 2 options:
 1. pass in --disk-size 
 2. pass in --usb-dev=/dev/sde
Comment 1 Ross Burton 2017-06-14 13:27:09 UTC
So I'm wondering if a useful and workable way to do this would be to have wic handle the writing of the image to the target device.  This way it could read the partition table in the image, manipulate it to fill the target device, write that new partition table and the file systems, and finally expand each of the file systems to fill the space.

Ideally, as simple as:

$ wic write --expand my-image.wic /dev/sdc
Comment 2 Ross Burton 2017-06-14 15:04:02 UTC
One of our users would like the ability to say eg "give me a 100MB /boot, and expand / to fill the disk", so we'd ideally like quite some flexibility when expanding.
Comment 3 Ed Bartosh 2017-06-14 15:08:35 UTC
would it be enough to keep first partition as is and split remaining media space between the rest of partitions?

if someone wants to have 100Mb /boot may be better option would be to use --size 100M in .wks?
Comment 4 Ross Burton 2017-06-14 15:38:48 UTC
I expect so yes.
Comment 5 Ed Bartosh 2017-07-10 09:21:09 UTC
Agreed on implementing wic write --expand my-image.wic /dev/sdX in such a way that it will keep first partition unmodified and expand the rest of partitions to fill the media.
Comment 6 Ed Bartosh 2017-07-24 07:36:01 UTC
Shifted to M3
Comment 7 Saul Wold 2017-08-11 21:53:02 UTC
Staying with Ed to finish up for M3
Comment 8 Ed Bartosh 2017-08-25 13:53:28 UTC
Sent patchset for review: http://lists.openembedded.org/pipermail/openembedded-core/2017-August/141419.html
Comment 10 Ed Bartosh 2017-08-28 09:58:52 UTC
merged into poky master. commit id: 390dcbf2e14f212d81a8fe252cf3ae801b82ffa9