meta-swupdate integration with the custom Yocto image #dunfell


Mahendra Sondagar
 

Hey.. There
Hope all are doing well

I'm dealing with the swupdate with the my custom Yocto image created for STM32MP1 dk1 board
The intend is, to update the rootfs remotely

I have successfully integrated meta-swupdate layer with the custom Yocto image by adding the layers in to bblayer.conf file
The both layers meta-swupdate & meta-custom are parallel to each-others

To change the flags and setting with the swupdate, i have created the recipes-myswupdate file inside the meta-custom layers
The content of the recipes-myswupdate are as follows
.
└── swupdate
    ├── stm32mp1
    │   ├── 09-swupdate-args
    │   ├── defconfig
    │   ├── sw-description
    │   └── swupdate.cfg
    └── swupdate_%.bbappend


The content of the swupdate_%.bbappend are as follows

--------------------------------------------------------------------------------------

DESCRIPTION = "Example recipe generating SWU image"
SECTION = ""

LICENSE = ""

# Add all local files to be added to the SWU
# sw-description must always be in the list.
# You can extend with scripts or wahtever you need
SRC_URI += " \
    file://sw-description \
    file://09-swupdate-args \
    file://swupdate.cfg \
    "

# images to build before building swupdate image
IMAGE_DEPENDS = "core-image-full-cmdline virtual/kernel"

# images and files that will be included in the .swu image
SWUPDATE_IMAGES = "core-image-full-cmdline uImage"

# a deployable image can have multiple format, choose one
SWUPDATE_IMAGES_FSTYPES[core-image-full-cmdline] = ".ubifs"
SWUPDATE_IMAGES_FSTYPES[uImage] = ".bin"

inherit swupdate


--------------------------------------------------------------------------------------------------------
I'm building the image by adding the machine name to update the image by following command
MACHINE=stm32mp1 bitbake swupdate-image

However, image unable!
As bitbake unable find the sw-description file
here, is the error log
Bitbake Fetcher Error: FetchError('Unable to fetch URL from any source.', 'file://sw-description')


I'm new with the swupdate
I have a following concerns

a) is it right approach to add the separate recipes for the swupdate in to the meta-custom layers, which I'm doing now  ?

b) do i need to deal with the only recipes-support, which is the part of the meta-swupdate layer , instead of creating separate recipes in to meta-custom?

c) can any one help me with the right integration steps for the swupdate with yocto ?


for the instance, I'm following official guide from here

All suggestions & comments welcome 

Regards
Mahendra Sondagar


Chetan
 

Hi Mahendra

I think the below folder structure will work.
.
└── swupdate
    ├── files
    │ ├── 09-swupdate-args
    │ ├── defconfig
    │ ├── sw-description
    │ └── swupdate.cfg
    └── swupdate_%.bbappend




On Sun, 25 Sept, 2022, 11:08 pm Mahendra Sondagar, <mahendrasondagar08@...> wrote:
Hey.. There
Hope all are doing well

I'm dealing with the swupdate with the my custom Yocto image created for STM32MP1 dk1 board
The intend is, to update the rootfs remotely

I have successfully integrated meta-swupdate layer with the custom Yocto image by adding the layers in to bblayer.conf file
The both layers meta-swupdate & meta-custom are parallel to each-others

To change the flags and setting with the swupdate, i have created the recipes-myswupdate file inside the meta-custom layers
The content of the recipes-myswupdate are as follows
.
└── swupdate
    ├── stm32mp1
    │   ├── 09-swupdate-args
    │   ├── defconfig
    │   ├── sw-description
    │   └── swupdate.cfg
    └── swupdate_%.bbappend


The content of the swupdate_%.bbappend are as follows

--------------------------------------------------------------------------------------

DESCRIPTION = "Example recipe generating SWU image"
SECTION = ""

LICENSE = ""

# Add all local files to be added to the SWU
# sw-description must always be in the list.
# You can extend with scripts or wahtever you need
SRC_URI += " \
    file://sw-description \
    file://09-swupdate-args \
    file://swupdate.cfg \
    "

# images to build before building swupdate image
IMAGE_DEPENDS = "core-image-full-cmdline virtual/kernel"

# images and files that will be included in the .swu image
SWUPDATE_IMAGES = "core-image-full-cmdline uImage"

# a deployable image can have multiple format, choose one
SWUPDATE_IMAGES_FSTYPES[core-image-full-cmdline] = ".ubifs"
SWUPDATE_IMAGES_FSTYPES[uImage] = ".bin"

inherit swupdate


--------------------------------------------------------------------------------------------------------
I'm building the image by adding the machine name to update the image by following command
MACHINE=stm32mp1 bitbake swupdate-image

However, image unable!
As bitbake unable find the sw-description file
here, is the error log
Bitbake Fetcher Error: FetchError('Unable to fetch URL from any source.', 'file://sw-description')


I'm new with the swupdate
I have a following concerns

a) is it right approach to add the separate recipes for the swupdate in to the meta-custom layers, which I'm doing now  ?

b) do i need to deal with the only recipes-support, which is the part of the meta-swupdate layer , instead of creating separate recipes in to meta-custom?

c) can any one help me with the right integration steps for the swupdate with yocto ?


for the instance, I'm following official guide from here

All suggestions & comments welcome 

Regards
Mahendra Sondagar



Mahendra Sondagar
 

Thanks, Chetan for swift reply :)

However, swupdate unable to fetch the files mentioned in .bbappend file!

The error logs are attahced here

As i said in my post, I have created recipes-myswupdate in to the meta-custom file, which is parallel to meta-swupdate
All the above files distributions are inside this recipes-myswupdate file
I guess, that's the issue

From the error logs, you can see, it's tries to find the file in to the default meta-swupdate/recipes-support files rather than meta-custom/recipes-myswupdate!

Anyone else ?

Regards
Mahendra


Thanks,
Mahendra Sondagar


Adrian Freihofer
 

Hi,

I guess the sw-description file must be added to the Image recipe not to swupdate.bb.

Note: There is a specific mailing list for swupdate.

Regards,
Adrian

Mahendra Sondagar <mahendrasondagar08@...> schrieb am So., 25. Sept. 2022, 20:01:

Thanks, Chetan for swift reply :)

However, swupdate unable to fetch the files mentioned in .bbappend file!

The error logs are attahced here

As i said in my post, I have created recipes-myswupdate in to the meta-custom file, which is parallel to meta-swupdate
All the above files distributions are inside this recipes-myswupdate file
I guess, that's the issue

From the error logs, you can see, it's tries to find the file in to the default meta-swupdate/recipes-support files rather than meta-custom/recipes-myswupdate!

Anyone else ?

Regards
Mahendra


Thanks,
Mahendra Sondagar





Quentin Schulz
 

Hi Mahendra Sondagar,

On 9/25/22 19:38, Mahendra Sondagar wrote:
Hey.. There
Hope all are doing well
I'm dealing with the swupdate with the my custom Yocto image created for STM32MP1 dk1 board
The intend is, to update the rootfs remotely
I have successfully integrated meta-swupdate layer with the custom Yocto image by adding the layers in to bblayer.conf file
The both layers meta-swupdate & meta-custom are parallel to each-others
To change the flags and setting with the swupdate, i have created the r *ecipes-myswupdate* file inside the meta-custom layers
The content of the recipes-myswupdate are as follows
.
└── swupdate
├── stm32mp1
│   ├── 09-swupdate-args
│   ├── defconfig
│   ├── sw-description
│   └── swupdate.cfg
└── swupdate_%.bbappend
Considering you're using SRC_URI unconditionally, I suggest you use:
.
├── swupdate
│ ├── 09-swupdate-args
│ ├── defconfig
│ ├── sw-description
│ └── swupdate.cfg
└── swupdate_%.bbappend

The content of the *swupdate_%.bbappend* are as follows
--------------------------------------------------------------------------------------
DESCRIPTION = "Example recipe generating SWU image"
SECTION = ""
LICENSE = ""
# Add all local files to be added to the SWU
# sw-description must always be in the list.
# You can extend with scripts or wahtever you need
SRC_URI += " \
file://sw-description \
file://09-swupdate-args \
file://swupdate.cfg \
"
# images to build before building swupdate image
IMAGE_DEPENDS = "core-image-full-cmdline virtual/kernel"
# images and files that will be included in the .swu image
SWUPDATE_IMAGES = "core-image-full-cmdline uImage"
# a deployable image can have multiple format, choose one
SWUPDATE_IMAGES_FSTYPES[core-image-full-cmdline] = ".ubifs"
SWUPDATE_IMAGES_FSTYPES[uImage] = ".bin"
inherit swupdate
I'm pretty sure you're not appending to the correct recipe, swupdate recipe is the SWUpdate recipe for building the SWUpdate update mechanism SW, it's not for building an image that is making use of SWUpdate mechanism.

I think you want to append to swupdate-image recipe or create your own inheriting swupdate-image?

Or probably both actually, one for adding your configuration files to the SWUpdate SW and the IMAGE_DEPENDS/SWUPDATE_IMAGES/SWUIPDATE_IMAGE_FSTYPES to the image recipe.

In any case, you're missing:
FILESEXTRAPATHS:prepend := "${THISDIR}/${PN}:"
in your bbappend for adding files. c.f. https://docs.yoctoproject.org/ref-manual/variables.html#term-FILESEXTRAPATHS

Cheers,
Quentin


Mahendra Sondagar
 

Hi... Quentin
Thanks for the reply...

let me try this

Regards
Mahendra


On Mon, Sep 26, 2022 at 1:44 PM Quentin Schulz <quentin.schulz@...> wrote:
Hi Mahendra Sondagar,

On 9/25/22 19:38, Mahendra Sondagar wrote:
> Hey.. There
> Hope all are doing well
>
> I'm dealing with the swupdate with the my custom Yocto image created for STM32MP1 dk1 board
> The intend is, to update the rootfs remotely
>
> I have successfully integrated meta-swupdate layer with the custom Yocto image by adding the layers in to bblayer.conf file
> The both layers meta-swupdate & meta-custom are parallel to each-others
>
> To change the flags and setting with the swupdate, i have created the r *ecipes-myswupdate* file inside the meta-custom layers
> The content of the recipes-myswupdate are as follows
> .
> └── swupdate
> ├── stm32mp1
> │   ├── 09-swupdate-args
> │   ├── defconfig
> │   ├── sw-description
> │   └── swupdate.cfg
> └── swupdate_%.bbappend
>

Considering you're using SRC_URI unconditionally, I suggest you use:
.
├── swupdate
│   ├── 09-swupdate-args
│   ├── defconfig
│   ├── sw-description
│   └── swupdate.cfg
└── swupdate_%.bbappend

> The content of the *swupdate_%.bbappend* are as follows
>
> --------------------------------------------------------------------------------------
>
> DESCRIPTION = "Example recipe generating SWU image"
> SECTION = ""
>
> LICENSE = ""
>
> # Add all local files to be added to the SWU
> # sw-description must always be in the list.
> # You can extend with scripts or wahtever you need
> SRC_URI += " \
> file://sw-description \
> file://09-swupdate-args \
> file://swupdate.cfg \
> "
>
> # images to build before building swupdate image
> IMAGE_DEPENDS = "core-image-full-cmdline virtual/kernel"
>
> # images and files that will be included in the .swu image
> SWUPDATE_IMAGES = "core-image-full-cmdline uImage"
>
> # a deployable image can have multiple format, choose one
> SWUPDATE_IMAGES_FSTYPES[core-image-full-cmdline] = ".ubifs"
> SWUPDATE_IMAGES_FSTYPES[uImage] = ".bin"
>
> inherit swupdate
>

I'm pretty sure you're not appending to the correct recipe, swupdate
recipe is the SWUpdate recipe for building the SWUpdate update mechanism
SW, it's not for building an image that is making use of SWUpdate mechanism.

I think you want to append to swupdate-image recipe or create your own
inheriting swupdate-image?

Or probably both actually, one for adding your configuration files to
the SWUpdate SW and the
IMAGE_DEPENDS/SWUPDATE_IMAGES/SWUIPDATE_IMAGE_FSTYPES to the image recipe.

In any case, you're missing:
FILESEXTRAPATHS:prepend := "${THISDIR}/${PN}:"
in your bbappend for adding files. c.f.
https://docs.yoctoproject.org/ref-manual/variables.html#term-FILESEXTRAPATHS

Cheers,
Quentin