Cannot parse config file: No such file or directory

768 views
Skip to first unread message

amcg...@ad-holdings.co.uk

unread,
Apr 7, 2016, 7:41:34 AM4/7/16
to swupdate
Hi Stefano

Following on from last week, I now have a "swupdate" enabled boot/root system that is working well and have started to test the .swu files that I previously generated.

The results of testing make me think that the bitbake generated .swu files are not correct.

I'm trying to update a target ext3 rootfs. My bitbake swu .bb and sw-description files are nearly identical to those you've seen previously (included below).

I wonder whether you could provide some advice for what is wrong with my .swu generation scripts. I've highlighted the target serial output error in red.

Many thanks

Adrian


Scenario: Upload an "ext3 rootfs" to my target
Target Serial Output
root@swan-target:~# X_FILENAME: vblade-swu-image-imx6qswan.swu lenght: 872416256
[NOTIFY] : SWUPDATE running :  [network_thread] : Incoming network request: processing...
[NOTIFY] : SWUPDATE started :  Software Update started !
[NOTIFY] : SWUPDATE running :  [extract_files] : Found file:
        filename sw-description
        size 190
Version 1.9.32
[NOTIFY] : SWUPDATE running :  [parse_hw_compatibility] : Accepted Hw Revision : 1.0
[NOTIFY] : SWUPDATE running :  [parse_images] : Found Image  : vblade-image-imx6qswan.ext3 in device : /dev/mmcblk2p2 for handler 

[NOTIFY] : SWUPDATE running :  [check_hw_compatibility] : Hardware swan Revision: 1.0
[NOTIFY] : SWUPDATE running :  [check_hw_compatibility] : Hardware compatibility verified
[NOTIFY] : SWUPDATE running :  [extract_files] : Found file:
        filename vblade-image-imx6qswan.ext3
        size 872415232 required
ERROR core/cpio_utils.c : copy_write : 148 : cannot write 12288 bytes
[NOTIFY] : SWUPDATE failed [0] ERROR core/cpio_utils.c : copy_write : 148 : cannot write 12288 bytes
[NOTIFY] : SWUPDATE failed [1] Image invalid or corrupted. Not installing ...

[NOTIFY] : SWUPDATE running :  [network_initializer] : Main thread sleep again !
[NOTIFY] : No SWUPDATE running :  Waiting for requests...
Main loop Daemon

root@swan-target:~#



File: vblade-swu-image.bb
DESCRIPTION = "Compound image for Swan"
SECTION = ""

PR = "r1"

SRC_URI += "file://sw-description "
inherit swupdate

LICENSE = "MIT"
LIC_FILES_CHKSUM = "file://${COREBASE}/LICENSE;md5=4d92cd373abda3937c2bc47fbc49d690 \
                    file://${COREBASE}/meta/COPYING.MIT;md5=3da9cfbcb788c80a0384361b4de20420"

IMAGE_DEPENDS = "vblade-image"
SWUPDATE_IMAGES = " \
                vblade-image \
                "
SWUPDATE_IMAGES_FSTYPES[vblade-image] = ".ext3"

COMPATIBLE = "imx6qswan"


File: sw-description
software =
{
    version = "1.9.32";

    hardware-compatibility: [ "1.0" ];

    images: (
        {
            filename = "vblade-image-imx6qswan.ext3";
            device = "/dev/mmcblk2p2";
            type = "raw";
        }
    );
}

amcg...@ad-holdings.co.uk

unread,
Apr 7, 2016, 7:53:14 AM4/7/16
to swupdate

amcg...@ad-holdings.co.uk

unread,
Apr 7, 2016, 7:54:47 AM4/7/16
to swupdate
Hi Stefano

Apologies for the double post, I realised that I had pasted the wrong text into the subject and was trying to correct it.



amcg...@ad-holdings.co.uk

unread,
Apr 7, 2016, 9:33:21 AM4/7/16
to swupdate
Hi Stefano

I've been generating and uploading a number of different .swu image files. Sadly still no success with updating the file system.

Please see below for the results of a .swu file that is to update a single file on an ext3 file system and the files used to generate the .swu file.

Interestingly, the target serial output shows an error that is different from the first error posted. This error refers to a missing config file rather than a function error (as seen before). As far as I can see from the documentation the only mandatory file in a .swu is the sw-description file. Please correct me if my understanding needs adjusting.


Many thanks for your time and insight.


Adrian


Scenario: SWU to update a single file

Target Serial Output
root@swan-target:~# X_FILENAME: vblade-swu-image-imx6qswan.swu lenght: 512

[NOTIFY] : SWUPDATE running :  [network_thread] : Incoming network request: processing...
[NOTIFY] : SWUPDATE started :  Software Update started !
[NOTIFY] : SWUPDATE running :  [extract_files] : Found file:
        filename sw-description
        size 208

Version 1.9.32
[NOTIFY] : SWUPDATE running :  [parse_hw_compatibility] : Accepted Hw Revision : 1.0
[NOTIFY] : SWUPDATE running :  [parse_hw_compatibility] : Accepted Hw Revision : 1.1
[NOTIFY] : SWUPDATE running :  [parse_files] : Found File  : adh-version --> /etc/adh-version (ROOTFS)

[NOTIFY] : SWUPDATE running :  [check_hw_compatibility] : Hardware swan Revision: 1.0
[NOTIFY] : SWUPDATE running :  [check_hw_compatibility] : Hardware compatibility verified
[NOTIFY] : SWUPDATE running :  [network_initializer] : Valid image found: copying to FLASH
Cannot parse config file: No such file or directory
Error: environment not initialized

[NOTIFY] : SWUPDATE running :  Installation in progress
[NOTIFY] : SWUPDATE running :  [install_images] : /tmp/adh-version not found or wrong
Cannot parse config file: No such file or directory
Error: environment not initialized
[NOTIFY] : SWUPDATE failed [1] Installation failed !

[NOTIFY] : SWUPDATE running :  [network_initializer] : Main thread sleep again !
[NOTIFY] : No SWUPDATE running :  Waiting for requests...
Main loop Daemon

root@swan-target:~#


File: vblade-swu-image.bb
DESCRIPTION = "Compound image for Swan running Vblade"

SECTION = ""

PR = "r1"

SRC_URI += "file://sw-description "
inherit swupdate

LICENSE = "MIT"
LIC_FILES_CHKSUM = "file://${COREBASE}/LICENSE;md5=4d92cd373abda3937c2bc47fbc49d690 \
                    file://${COREBASE}/meta/COPYING.MIT;md5=3da9cfbcb788c80a0384361b4de20420"

FILE_DEPENDS = ""

SWUPDATE_FILES = " \
                adh-version \
                "
SWUPDATE_FILES_FSTYPES[adh-version] = ".ext3"
COMPATIBLE = "imx6qswan"


File: sw-description
software =
{
    version = "1.9.32";

    hardware-compatibility: [ "1.0" ];

    files: (
        {
            filename = "adh-version";
            path = "/etc/adh-version"
            volume = "rootfs";
            filesystem = "ext3";
        }
    );
}

Stefano Babic

unread,
Apr 7, 2016, 10:28:03 AM4/7/16
to amcg...@ad-holdings.co.uk, swupdate
Hi Adrian,

On 07/04/2016 13:53, amcg...@ad-holdings.co.uk wrote:
>
>
> On Thursday, 7 April 2016 12:41:34 UTC+1, amcg...@ad-holdings.co.uk wrote:
>
> Hi Stefano
>
> Following on from last week, I now have a "swupdate" enabled
> boot/root system that is working well and have started to test the
> .swu files that I previously generated.
>
> The results of testing make me think that the bitbake generated .swu
> files are not correct.
>
> I'm trying to update a target ext3 rootfs. My bitbake swu .bb and
> sw-description files are nearly identical to those you've seen
> previously (included below).
>
> I wonder whether you could provide some advice for what is wrong
> with my .swu generation scripts. I've highlighted the target serial
> output error in red.
>
> Many thanks
>
> Adrian
>
>
> *Scenario: Upload an "ext3 rootfs" to my target*
> _Target Serial Output_
> root@swan-target:~# X_FILENAME: vblade-swu-image-imx6qswan.swu
> lenght: 872416256
> [NOTIFY] : SWUPDATE running : [network_thread] : Incoming network
> request: processing...
> [NOTIFY] : SWUPDATE started : Software Update started !
> [NOTIFY] : SWUPDATE running : [extract_files] : Found file:
> filename sw-description
> size 190
> Version 1.9.32
> [NOTIFY] : SWUPDATE running : [parse_hw_compatibility] : Accepted
> Hw Revision : 1.0
> [NOTIFY] : SWUPDATE running : [parse_images] : Found Image :
> vblade-image-imx6qswan.ext3 in device : /dev/mmcblk2p2 for handler
>
> [NOTIFY] : SWUPDATE running : [check_hw_compatibility] : Hardware
> swan Revision: 1.0
> [NOTIFY] : SWUPDATE running : [check_hw_compatibility] : Hardware
> compatibility verified
> [NOTIFY] : SWUPDATE running : [extract_files] : Found file:
> filename vblade-image-imx6qswan.ext3
> size 872415232 required

The very simple question is: do you have really ~870MB free on RAM ? The
file is firstly copied into tmpfs.

> ERROR core/cpio_utils.c : copy_write : 148 : cannot write 12288 bytes
> [NOTIFY] : SWUPDATE failed [0] ERROR core/cpio_utils.c : copy_write
> : 148 : cannot write 12288 bytes

The error tells us that there is no more space available - you get rid
of RAM.

If you have such as big file that get rid of your resources, you should
flag it into sw-description to be streamed directly to the target.

> [NOTIFY] : SWUPDATE failed [1] Image invalid or corrupted. Not
> installing ...
> [NOTIFY] : SWUPDATE running : [network_initializer] : Main thread
> sleep again !
> [NOTIFY] : No SWUPDATE running : Waiting for requests...
> Main loop Daemon
>
> root@swan-target:~#
>
>
> _File: vblade-swu-image.bb <http://vblade-swu-image.bb>_
> DESCRIPTION = "Compound image for Swan"
> SECTION = ""
>
> PR = "r1"
>
> SRC_URI += "file://sw-description "
> inherit swupdate
>
> LICENSE = "MIT"
> LIC_FILES_CHKSUM =
> "file://${COREBASE}/LICENSE;md5=4d92cd373abda3937c2bc47fbc49d690 \
>
> file://${COREBASE}/meta/COPYING.MIT;md5=3da9cfbcb788c80a0384361b4de20420"
>
> IMAGE_DEPENDS = "vblade-image"
> SWUPDATE_IMAGES = " \
> vblade-image \
> "
> SWUPDATE_IMAGES_FSTYPES[vblade-image] = ".ext3"
>
> COMPATIBLE = "imx6qswan"
>
>
> _File: sw-description_
> software =
> {
> version = "1.9.32";
>
> hardware-compatibility: [ "1.0" ];
>
> images: (
> {
> filename = "vblade-image-imx6qswan.ext3";
> device = "/dev/mmcblk2p2";
> type = "raw";

This is the default behavior: artifact is copied into /tmp and then
installed into eMMC. This works when RAM is bigger as flash.

You should add:

installed-directly = true;

> }
> );
> }

Best regards,
Stefano Babic

--
=====================================================================
DENX Software Engineering GmbH, Managing Director: Wolfgang Denk
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: +49-8142-66989-53 Fax: +49-8142-66989-80 Email: sba...@denx.de
=====================================================================

amcg...@ad-holdings.co.uk

unread,
Apr 7, 2016, 11:14:21 AM4/7/16
to swupdate
Thanks Stefano

I updated the sw-description as per your suggestion and got further along the process.

I'm a little confused by the output I now see. The output contains an "error" and a "success" message (highlighted in red below). Please could you decode output this for me? What config file does the error message refer to?


Many thanks

Target Serial output:

root@swan-target:~# X_FILENAME: vblade-swu-image-imx6qswan.swu lenght: 872416256
[NOTIFY] : SWUPDATE running :  [network_thread] : Incoming network request: processing...
[NOTIFY] : SWUPDATE started :  Software Update started !
[NOTIFY] : SWUPDATE running :  [extract_files] : Found file:
        filename sw-description
        size 220

Version 1.9.32
[NOTIFY] : SWUPDATE running :  [parse_hw_compatibility] : Accepted Hw Revision : 1.0
[NOTIFY] : SWUPDATE running :  [parse_images] : Found Image  : vblade-image-imx6qswan.ext3 in device : /dev/mmcblk2p2 for handler 

[NOTIFY] : SWUPDATE running :  [check_hw_compatibility] : Hardware swan Revision: 1.0
[NOTIFY] : SWUPDATE running :  [check_hw_compatibility] : Hardware compatibility verified
[NOTIFY] : SWUPDATE running :  [extract_files] : Found file:
        filename vblade-image-imx6qswan.ext3
        size 872415232 required
[NOTIFY] : SWUPDATE running :  [extract_files] : Installing STREAM vblade-image-imx6qswan.ext3, 872415232 bytes

[NOTIFY] : SWUPDATE running :  [install_single_image] : Found installer for stream vblade-image-imx6qswan.ext3 raw
[NOTIFY] : SWUPDATE running :  [extract_files] : END INSTALLIN STREAMING

[NOTIFY] : SWUPDATE running :  [network_initializer] : Valid image found: copying to FLASH
Cannot parse config file: No such file or directory
Error: environment not initialized
[NOTIFY] : SWUPDATE running :  Installation in progress
Cannot parse config file: No such file or directory
Error: environment not initialized
[NOTIFY] : SWUPDATE successful ! SWUPDATE successful !

amcg...@ad-holdings.co.uk

unread,
Apr 7, 2016, 11:18:12 AM4/7/16
to swupdate

...
[NOTIFY] : SWUPDATE running :  [network_initializer] : Valid image found: copying to FLASH
Cannot parse config file: No such file or directory
Error: environment not initialized

[NOTIFY] : SWUPDATE running :  Installation in progress
Cannot parse config file: No such file or directory
Error: environment not initialized
[NOTIFY] : SWUPDATE successful ! SWUPDATE successful !
[NOTIFY] : SWUPDATE running :  [network_initializer] : Main thread sleep again !
[NOTIFY] : No SWUPDATE running :  Waiting for requests...

...

Stefano Babic

unread,
Apr 7, 2016, 12:07:10 PM4/7/16
to amcg...@ad-holdings.co.uk, swupdate
Hi Adrian,
This is related to U-Boot environment. Because the configuration file is
not found (fw_env.cfg), the environment is not set. This is not a
blocking error, but it serves as transaction flag between swupdate and
u-boot. Until the flag is not reset, the system is "under updateing".
U-Boot can evaluate the flag and restarts swupdate after a power-off
during updating.


> [NOTIFY] : SWUPDATE running : Installation in progress
> Cannot parse config file: No such file or directory
> Error: environment not initialized
> [NOTIFY] : SWUPDATE successful ! SWUPDATE successful !

Gratulations ! Your update was successful, and I expect you can mount
your new rootfs after reboot.
Reply all
Reply to author
Forward
0 new messages