Bug 4229

Summary: can not install image from USB
Product: [Build System, Metadata & Runtime] BSPs Reporter: Stoicescu Cornel <corneliux.stoicescu>
Component: bsps-meta-intelAssignee: Nitin Kamble <nitin.a.kamble>
Status: VERIFIED FIXED QA Contact:
Severity: normal    
Priority: Medium+ CC: alexandru.c.georgescu, bruce.ashfield, jessica.zhang, meta.mr.watcher, meta.watcher, mihai.lindner, tom.zanussi
Version: 1.4   
Target Milestone: 1.4 M6   
Hardware: x86   
OS: Multiple   
Whiteboard:
OS type for building Yocto: --- Type of Regression: ---
Verified: Documentation change: ---
Attachments:
Description Flags
screenshot
none
.config for core-image-minimal-sugarbay none

Description Stoicescu Cornel 2013-04-08 17:03:51 UTC
Created attachment 1160 [details]
screenshot

master:59c073514c01b018f6123bb177141888b6f8c8ee
meta-intel:c69366c648e7288ea029ffcd59635575c15349ea

1) deploy a .hddimg core-image-minimal (I used core-image-minimal-sugarbay.hddimg) to USB stick
2) install image on hardware from USB stick

Result: When asked for a drive to install the image on, error appears(see attached image for more info):
"
cat: write errorL Invalid argument
Installation image failed

sh: can't access tty: job control turned off
"

Note: I did not get the chance to see if it's BSP specific. Will investigate if necessary.
Comment 1 Stoicescu Cornel 2013-04-09 08:11:03 UTC
Tested on same commits with core-image-lsb-sdk-sugarbay.hddimg and the issue is present.
Comment 2 Darren Hart 2013-04-10 15:41:14 UTC
The only call to "cat" in init-live.sh is the following:

    [ -z "$CMDLINE" ] && CMDLINE=`cat /proc/cmdline`

This would fail if /proc/cmdline didn't exist, which could happen if the kernel was misconfigured. Can you check your Linux .config?

build/tmp/work/sugarbay*/linux-yocto*/linux-*-build/.config

Look for:

CONFIG_PROC_FS=y


There were some recent changes made to the kern-tools to fix an issue with some config fragments being dropped which might address this.
Comment 3 Darren Hart 2013-04-10 15:41:38 UTC
.
Comment 4 Stoicescu Cornel 2013-04-11 09:35:53 UTC
"CONFIG_PROC_FS=y" can be found in tmp/work/sugarbay-poky-linux/linux-yocto/3.8.4+gitAUTOINC+2a6d36e75ca0a121570a389d7bab76ec240cbfda_47aed0c17c1c55988198ad39f86ae88894c8e0a4-r4.0/linux-sugarbay-standard-build/.config

Issue is still present using core-image-minimal-sugarbay.hddimg baked with:

master: cb4db44c14959ca76870cfaf02b5d314ac68ba8f
meta-intel: fd58fb07cf4fcc0553d0608f5688fc03e41ea15c
Comment 5 Stoicescu Cornel 2013-04-11 09:37:30 UTC
Created attachment 1161 [details]
.config for core-image-minimal-sugarbay
Comment 6 Darren Hart 2013-04-11 15:23:36 UTC
This doesn't occur on atom-pc with current master. Nitin, can you attempt to reproduce this?
Comment 7 Mihai Lindner 2013-04-11 16:30:17 UTC
Possible culprit in:
meta/recipes-core/initrdscripts/files/init-install.sh:81:cat /proc/mounts > /etc/mtab

Considering that /etc/mtab is sym-linked to /proc/mounts
Comment 8 Nitin Kamble 2013-04-12 22:16:32 UTC
I am able to reproduce this with latest trees on sugarbay system. I will start looking into it.
Comment 9 Alexandru Georgescu 2013-04-15 14:34:51 UTC
Hi,
Are there any updates regarding this? 

Thanks,
Alex.
Comment 10 Alexandru Georgescu 2013-04-15 14:36:00 UTC
Also, this happens for Atom-PC as well!
Comment 11 Nitin Kamble 2013-04-15 18:09:26 UTC
Mihai is right,

THis is the problem:
   /etc/mtab is sym-linked to /proc/mounts
Comment 12 Nitin Kamble 2013-04-15 18:19:36 UTC
I have a fix for this, will send it out to the list soon.
Comment 13 Nitin Kamble 2013-04-15 18:34:26 UTC
a fix is sent to OECORE ML
Comment 14 Alexandru Georgescu 2013-04-16 09:21:21 UTC
same on Crownbay-noemgd
Comment 15 Nitin Kamble 2013-04-16 15:13:30 UTC
Fixed in oecore master with this commit:

commit 169534539393e2b6ce8bf9502911d7a62d699467
Author: Nitin A Kamble <nitin.a.kamble@intel.com>
Date:   Mon Apr 15 11:33:46 2013 -0700

    initramfs-live-install*: fix the "install" boot option
    
    The install boot option was giving the following error when one tried to
    install the live image on a  permanent storage of a BSP.
    
    cat: write error Invalid argument
    Installation image failed
    sh: can't access tty: job control turned off
    
    Further digging into the issue, found out that the install script was trying
    to do this:
     cat /proc/mounts > /etc/mtab
    
    And in the base-files recipe the /etc/mtab is made soft link to /proc/mounts.
    So the cat command was failing to write on /etc/mtab. As the contents of
    the /proc/mounts is already reflected in the /etc/mtab file due to the
    symlink-ing, there is no need for this step to recreate /etc/mtab in the
    install script. So just removing this unnecessary step, which solves the
    install issue of the live images.
    
    Fixes this bug:
    [YOCTO #4229]
    
    (From OE-Core rev: f8663eac872882e94d956b1b604304e92b865766)
    
    Signed-off-by: Nitin A Kamble <nitin.a.kamble@intel.com>
    Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Comment 16 Alexandru Georgescu 2013-04-17 06:31:46 UTC
Just built an Atom-PC image and successfully installed it on the device.

Setting this to verified.