Bug 11525 - wic: /etc/fstab to mount partitions with UUID instead of kernel name descriptors
Summary: wic: /etc/fstab to mount partitions with UUID instead of kernel name descriptors
Status: RESOLVED FIXED
Alias: None
Product: OE-Core
Classification: Build System, Metadata & Runtime
Component: Scripts and Tools (show other bugs)
Version: 2.2
Hardware: x86 Multiple
: Medium enhancement
Target Milestone: 2.5 M4
Assignee: Kristi
QA Contact:
URL:
Whiteboard: 23 February 2018: RESOLVED
: 11678 (view as bug list)
Depends on:
Blocks:
 
Reported: 2017-05-18 09:01 UTC by SJ
Modified: 2018-02-23 21:13 UTC (History)
9 users (show)

See Also:
OS type for building Yocto: ---
Type of Regression: ---
Verified:
Documentation change: Done (doc changes complete)


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description SJ 2017-05-18 09:01:00 UTC
This request is to change /etc/fstab to mount partitions with UUID instead of kernel name descriptors. 

The current image format relies on the wic parameter "--ondisk" to generate the fstab entries. When different decide such as eMMC or SD where block devices are mmcblkNpM causing systems to fail to boot the system. Also, potentially there could be multiple disks that can appear in a random order depending on the boot race conditions.
Comment 1 Ed Bartosh 2017-06-16 08:04:16 UTC
*** Bug 11678 has been marked as a duplicate of this bug. ***
Comment 2 Ed Bartosh 2017-06-16 14:26:15 UTC
Couple of notes before development started: 

wic supports 2 types of partition UUIDS - for MBR and GPT partition tables. It would be great if both types can be used in FSTAB

Please, cover the implementation with tests and add them to wic test suite at meta/lib/oeqa/selftest/cases/wic.py
Comment 3 SJ 2017-06-17 09:16:46 UTC
Noted. Looking into it and will keep you updated, Ed.
Comment 4 Ed Bartosh 2017-11-08 12:41:25 UTC
Here is a patchset that at least partly fixes this issue:
http://lists.openembedded.org/pipermail/openembedded-core/2017-September/142638.html

It triggered discussion, which started in Sep when patchset was first sent for review and continued in November:
http://lists.openembedded.org/pipermail/openembedded-core/2017-November/143923.html
Comment 5 Tom Rini 2017-11-08 14:59:54 UTC
Given that I've been discussing this with Ed on the list, I'll just take this entry.
Comment 6 Rebecca Chang 2017-11-08 15:06:54 UTC
(In reply to comment #5)
> Given that I've been discussing this with Ed on the list, I'll just take
> this entry.

No problem. Thank you!
Comment 7 Ed Bartosh 2017-11-08 15:41:37 UTC
Added Scott as we'll need his help in documenting this.
Comment 8 Tom Rini 2017-11-27 14:17:30 UTC
At this point I've submitted a follow-up series but then Ross found some problems on the auto-builder and I can't replicate them.
Comment 9 Tom Rini 2017-12-14 18:53:39 UTC
At this point now, I've submitted a v4 that fixes the problem Ross found, after he determined what steps were required to reproduce the problem.
Comment 10 Tom Rini 2017-12-19 02:13:25 UTC
I see that Richard has merged this in master now today, moving to resolved.
Comment 11 Kristi 2017-12-22 21:39:56 UTC
Hello Ed - referencing your Comment 7 - what changes need to be applied to the docs? 

Thanks! 
Kristi
Comment 12 Ed Bartosh 2017-12-27 11:18:39 UTC
Kristi, this would be better answered by Tom I believe.

From my point of view Tom's work added new functionality: ability to use filesystem UUIDs. This should be reflected in the documentation.

Tom, can you give us more details on this?

PS: Most of the wic related content is now in http://www.yoctoproject.org/docs/current/dev-manual/dev-manual.html#creating-partitioned-images-using-wic
Comment 13 Tom Rini 2017-12-27 12:54:31 UTC
At a minimum the help output needs to be updated as that's been updated to have a new --fsuuid option, to allow a specific (rather than random) UUID to be used.  Other than that, we don't really document why we pass --use-uuid today, so nothing more is strictly required.

But we could talk about that using --use-uuid is a good idea for all partitions as it makes the wks file more adaptable to work in the cases where an image could be used via USB or an SD card.
Comment 14 Kristi 2018-01-03 00:41:41 UTC
Ed/Tom - Thank you! Tom, since this is marked as RESOLVED, but there are still doc changes needed, do you want to re-open and assign to me or keep as is and let me work on the doc part? 

Kristi
Comment 15 Tom Rini 2018-01-03 14:31:11 UTC
Re-opening for doc changes and related tracking, thanks!
Comment 16 Kristi 2018-02-02 01:06:59 UTC
Tom, 

I'm using the master branch of poky and tried wic help fsuuid and wic help use-uuid. There is no help on either. Where do I find the help information for this?

Thank you!  

Also, when you type in wic -h you still get a lot of unformatted information. The following is the way the help should look (cut and pasted this from bug 12205) https://bugzilla.yoctoproject.org/show_bug.cgi?id=12205 : 

The Wic help returned to the user is unreadable.  Formatting is non-existent and the amount of information is unnecessary.  

Here are the commands that return help:

  $ wic help
  $ wic --help
  $ wic -h

Wic has 6 commands and 3 topics on which it can return help using the following form:

  $ wic help [COMMAND or TOPIC]

The only command you cannot get help on is the help command.  Thus, the following command returns an error:

  $ wic help help

All other help returned for any COMMAND or TOPIC is formatted very well, is readable, and is informative.  So commands like the following are all good:

  $ wic help create
  $ wic help ls
  $ wic help list

When a user enters general help (wic help), they get a huge listing of unformatted help that spans every facet of the wic command.  All the user really needs is help and usage on the wic command itself.  It is redundant to provide help on individual COMMANDs or TOPICs.  

I propose the following help output for general help:

$ wic help

wic version 0.2.0
       Creates a customized OpenEmbedded image.

       Usage: wic [--version]
              wic help [COMMAND or TOPIC]
              wic COMMAND [ARGS]

          usage 1: Returns the current version of Wic
          usage 2: Returns detailed help for a COMMAND or TOPIC
          usage 3: Executes COMMAND


       COMMAND:

          list   -   List available canned images and source plugins
          ls     -   List contents of partitioned image or partition
          rm     -   Remove files or directories from the vfat or ext*
                     partitions
          help   -   Show help for a wic COMMAND or TOPIC
          write  -   Write an image to a device
          cp     -   Copy files and directories to the vfat or ext*
                     partitions
          create -   Create a new OpenEmbedded image


        TOPIC:

          overview  - Presents an overall overview of Wic
          plugins   - Presents an overview and API for Wic plugins
          kickstart - Presents a Wic kicstart file reference


        Examples:

          $ wic --version

            Returns the current version of Wic


          $ wic help cp

            Returns the SYNOPSIS and DESCRIPTION for the Wic "cp" command.


          $ wic list images

            Returns the list of canned images (i.e. *.wks files located in
            the /scripts/lib/wic/canned-wks directory.


          $ wic create mkefidisk -e core-image-minimal

            Creates an EFI disk image from artifacts used in a previous
            core-image-minimal build in standard BitBake locations
            (e.g. Cooked Mode).
Comment 17 Tom Rini 2018-02-16 18:52:38 UTC
All of the content I added is under "wic help kickstart".  In specific:
        This is achieved by wic adding entries to the fstab during image
        generation. In order for a valid fstab to be generated one of the
        --ondrive, --ondisk or --use-uuid partition options must be used for
-       each partition that specifies a mountpoint.
+       each partition that specifies a mountpoint.  Note that with --use-uuid
+       and non-root <mountpoint>, including swap, the mount program must
+       understand the PARTUUID syntax.  This currently excludes the busybox
+       versions of these applications.

And:
+         --fsuuid: This option is specific to wic. It specifies filesystem UUID.  
+                   It's useful if preconfigured filesystem UUID is added to kernel command line
+                   in bootloader configuration before running wic. In this case .wks file can
+                   be generated or modified to set preconfigured filesystem UUID using this op
Comment 18 Kristi 2018-02-22 23:59:03 UTC
Hi Tom, 

I have updated the following section with the new information you provided in Comment 17. In addition to those you listed, I've updated the list of other supported options that were missing from the documentation. Please review the section and let me know if additional changes are needed. Thanks!

http://www.yoctoproject.org/docs/2.5/ref-manual/ref-manual.html#command-part-or-partition

-Kristi
Comment 19 Tom Rini 2018-02-23 00:39:07 UTC
LGTM, but I only know the UUID stuff well, thanks!
Comment 20 Kristi 2018-02-23 21:13:33 UTC
Thanks Tom, 

Marking this one RESOLVED and setting the Doc flag to "Done". 

Kristi