Bug 8844

Summary: wic generated fstab requires --ondisk or --ondrive be specified
Product: [Build System, Metadata & Runtime] OE-Core Reporter: Joshua Lock <joshuagloe>
Component: Scripts and ToolsAssignee: Joshua Lock <joshuagloe>
Status: RESOLVED FIXED QA Contact: Daniel Istrate <daniel.alexandrux.istrate>
Severity: normal    
Priority: Medium CC: bogdanx.a.voiculescu, eduard.bartosh, ross.burton, srifenbark
Version: 2.0   
Target Milestone: 2.1   
Hardware: x86   
OS: Multiple   
Whiteboard: 27 Jan 2016: RESOLVED/FIXED
OS type for building Yocto: --- Type of Regression: ---
Verified: Documentation change: Done (doc changes complete)

Description Joshua Lock 2015-12-21 13:12:05 UTC
wic updates fstab for mountpoints other than / and /boot but to do so requires that the device the partition is on be specified in the wks via either the --ondisk or --ondrive option.

This is unfortunate for my current use case as I'm trying to use wic to generate images that can be booted from either a USB stick, an SD card or internal eMMC flash — all of which have different device paths.

For my specific problem the obvious solution is to write my own fstab using /dev/disk/by-label/* to identify the partitions and *not* include a mountpoint in my wks file.

Ideally wic would be more flexible, either i.e. by taking an option that forces the fstab generation code to use labels for mounting.

Furthermore, regardless of whether any changes are made to how wic generates fstab, I believe the documentation should be updated to reflect the need for --ondisk or --ondrive to be specified when the partition command specifies a mountpoint.
Comment 1 Ed Bartosh 2015-12-23 14:34:06 UTC
A bit unrelated question. Did you think about using partition UUIDS instead of device names? That would make it possible to use one wks for all your devices. wic has support for partition UUIDs.

Would you be willing to change the documentation regarding --ondisk and --ondrive options?
Comment 2 Joshua Lock 2015-12-24 10:14:56 UTC
(In reply to comment #1)
> A bit unrelated question. Did you think about using partition UUIDS instead
> of device names? That would make it possible to use one wks for all your
> devices. wic has support for partition UUIDs.

I didn't consider that, no - it wasn't obvious to me from the documentation.
Can you share an example wks snippet of how that works?

> Would you be willing to change the documentation regarding --ondisk and
> --ondrive options?

Sure, I can look at this in the new year.
Comment 3 Joshua Lock 2016-01-11 13:37:34 UTC
Initial patch submitted:

http://lists.openembedded.org/pipermail/openembedded-core/2016-January/115219.html
Comment 4 Ed Bartosh 2016-01-18 10:02:57 UTC
Thank you for the patch!

Can you also update kickstart reference in dev manual https://www.yoctoproject.org/docs/latest/dev-manual/dev-manual.html#openembedded-kickstart-wks-reference ?
Comment 5 Scott Rifenbark 2016-01-18 15:05:11 UTC
Hi, 

I have modified the wic reference section in the dev-manual.  See http://www.yoctoproject.org/docs/2.1/dev-manual/dev-manual.html#command-part-or-partition for the changes and let me know if this is okay.  

Thanks, 
Scott
Comment 6 Joshua Lock 2016-01-26 09:49:02 UTC
(In reply to comment #5)
> Hi, 
> 
> I have modified the wic reference section in the dev-manual.  See
> http://www.yoctoproject.org/docs/2.1/dev-manual/dev-manual.html#command-part-
> or-partition for the changes and let me know if this is okay.  

That looks good to me. I wonder if --ondisk is the option we want to include in the example, and therefore implicitly recommend — Ed do you have any thoughts on that?
Comment 7 Ed Bartosh 2016-01-26 10:56:12 UTC
I think it's ok as --ondisk presents also in almost all example .wks files in scripts/lib/wic/canned-wks/ directory.
Comment 8 Scott Rifenbark 2016-01-27 23:47:10 UTC
Hi, 

I am setting this to RESOLVED and clearing the doc flag to "Done."

Thanks,
Scott