Bug 12091

Summary: wic support more mounting option
Product: [Build System, Metadata & Runtime] OE-Core Reporter: Diego <diego.ml>
Component: Scripts and ToolsAssignee: Kevin Hao <kexin.hao>
Status: RESOLVED FIXED QA Contact:
Severity: enhancement    
Priority: Medium CC: kexin.hao, ross.burton
Version: unspecified   
Target Milestone: 4.99   
Hardware: x86   
OS: Multiple   
Whiteboard:
OS type for building Yocto: --- Type of Regression: ---
Verified: Documentation change: Yes (doc changes required)

Description Diego 2017-09-15 08:09:45 UTC
Currently wic supports the "--ondisk" parameter to have fstab entries automatically generated.
This though is quite problematic when the there are multiple disks on the same subsystem, think of a board with multiple SD card readers and / or eMMC: the same image could be put in mmcblk0, mmcblk1 or mmcblk2. Same goes for USB / Sata disk on sda, sdb, etc.

Alternative mounting ways are now supported (by label, by gpt-label, by UUID):
https://wiki.archlinux.org/index.php/Fstab#Identifying_filesystems

It would be easier if wic could give more freedom to the developer, maybe allowing him to just freely enter the string for the <device> field for the fstab.

Think of:
wic ... --device="LABEL=/recovery" ...

Afterall --ondisk is not currently used that much, it's just ignored for boot and root partitions.
Comment 1 Kevin Hao 2018-08-15 02:45:03 UTC
Hi Diego,

Have you tried "--use-uuid" parameter?
Comment 2 Diego 2018-08-31 13:53:54 UTC
(In reply to comment #1)
> Hi Diego,
> 
> Have you tried "--use-uuid" parameter?

IIRC I tried but it didn't work, and I haven't investigated exactly why.

Nonetheless label or gpt-label support would be nice anyway.
Comment 3 Kevin Hao 2018-09-02 09:01:32 UTC
(In reply to comment #2)
> (In reply to comment #1)
> > Hi Diego,
> > 
> > Have you tried "--use-uuid" parameter?
> 
> IIRC I tried but it didn't work, and I haven't investigated exactly why.

As I know several boards supported by meta-yocto-bsp use the "--use-uuid" parameter, all of them work pretty well. Could you provide more details about  the scenario you use this parameter?

> 
> Nonetheless label or gpt-label support would be nice anyway.

There already has the support for the label. Please see the "--label" parameter.
Comment 4 Diego 2018-09-03 12:01:19 UTC
(In reply to comment #3)
> (In reply to comment #2)
> > (In reply to comment #1)
> > > Hi Diego,
> > > 
> > > Have you tried "--use-uuid" parameter?
> > 
> > IIRC I tried but it didn't work, and I haven't investigated exactly why.
> 
> As I know several boards supported by meta-yocto-bsp use the "--use-uuid"
> parameter, all of them work pretty well. Could you provide more details
> about  the scenario you use this parameter?

I think I last tested when I originally reported this issue, so ~1 year ago, if I remember correctly no fstab entry was created.
Glad it works for some boards, I'll give it another shot and open a proper bug issue if it still doesn't work for me.

> 
> > 
> > Nonetheless label or gpt-label support would be nice anyway.
> 
> There already has the support for the label. Please see the "--label"
> parameter.

The '--label' parameter doesn't create an fstab entry as far as I know, so it is  not related to what this feature request issue is about.
Comment 5 Diego 2018-09-03 12:13:46 UTC
(In reply to comment #4)
> (In reply to comment #3)
> > (In reply to comment #2)
> > > (In reply to comment #1)
> > > > Hi Diego,
> > > > 
> > > > Have you tried "--use-uuid" parameter?
> > > 
> > > IIRC I tried but it didn't work, and I haven't investigated exactly why.
> > 
> > As I know several boards supported by meta-yocto-bsp use the "--use-uuid"
> > parameter, all of them work pretty well. Could you provide more details
> > about  the scenario you use this parameter?
> 
> I think I last tested when I originally reported this issue, so ~1 year ago,
> if I remember correctly no fstab entry was created.
> Glad it works for some boards, I'll give it another shot and open a proper
> bug issue if it still doesn't work for me.
> 

I think this is the fix that was not available at the time:
https://git.yoctoproject.org/cgit/cgit.cgi/poky/commit/?id=7707961e9f95429044f8de5ca30bfefc797cf371
Comment 6 Kevin Hao 2018-09-14 01:30:35 UTC
I have added the support to use the label in the /etc/fstab, please see the commit:
commit 821711bf2edc
Author: Kevin Hao <kexin.hao@windriver.com>
Date:   Wed Sep 12 08:44:46 2018 +0800

    wic: Introduce the --use-label partition parameter
    
    We can use this parameter to make the wic use the label to name a
    partition in /etc/fstab.
    
    (From OE-Core rev: 51638edaa00befaed58e2def255d46ae44d9234f)
    
    Signed-off-by: Kevin Hao <kexin.hao@windriver.com>
    Reviewed-by: Tom Rini <trini@konsulko.com>
    Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Comment 7 Diego 2018-10-09 06:04:37 UTC
(In reply to comment #6)
> I have added the support to use the label in the /etc/fstab, please see the
> commit:

Thanks. It works fine for me.