Skip to contentSkip to conversation

meta-swupdate integration with the custom Yocto image #dunfell

DISCUSSION Mahendra Sondagar 4 participants 6 messages Sep 25, 2022 – Sep 26, 2022

lore
Share & tools
lore
#0 lore raw

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

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 ( https://sbabic.github.io/swupdate/building-with-yocto.html )

All suggestions & comments welcome

Regards
Mahendra Sondagar

#1 lore raw

Hi Mahendra

I think the below folder structure will work.
.

└── swupdate
    ├── files
    │ ├── 09-swupdate-args
    │ ├── defconfig
    │ ├── sw-description
    │ └── swupdate.cfg
    └── swupdate_%.bbappend
Quoted 102 lines · 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 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

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
<https://sbabic.github.io/swupdate/building-with-yocto.html>

All suggestions & comments welcome

Regards
Mahendra Sondagar
-=-=-=-=-=-=-=-=-=-=-=-
Links: You receive all messages sent to this group. View/Reply Online (#58152):
https://lists.yoctoproject.org/g/yocto/message/58152
Mute This Topic: https://lists.yoctoproject.org/mt/93911152/4077624
Mute #dunfell:https://lists.yoctoproject.org/g/yocto/mutehashtag/dunfell Group Owner: [email protected]
Unsubscribe: https://lists.yoctoproject.org/g/yocto/unsub [ [email protected]]
-=-=-=-=-=-=-=-=-=-=-=-

#2 lore raw

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

WARNING: swupdate-2022.05-r0 do_fetch: Failed to fetch URL file://sw-description, attempting MIRRORS if available
ERROR: swupdate-2022.05-r0 do_fetch: Fetcher failure: Unable to find file file://sw-description anywhere. The paths that were searched were:
/home/mahendra/STM32MPU_workspace/Digikey_YoctoSeries/Digikey_Yocto/meta-swupdate/recipes-support/swupdate/swupdate-2022.05/poky /home/mahendra/STM32MPU_workspace/Digikey_YoctoSeries/Digikey_Yocto/meta-swupdate/recipes-support/swupdate/swupdate/poky /home/mahendra/STM32MPU_workspace/Digikey_YoctoSeries/Digikey_Yocto/meta-swupdate/recipes-support/swupdate/files/poky /home/mahendra/STM32MPU_workspace/Digikey_YoctoSeries/Digikey_Yocto/meta-swupdate/recipes-support/swupdate/swupdate-2022.05/stm32mp15common /home/mahendra/STM32MPU_workspace/Digikey_YoctoSeries/Digikey_Yocto/meta-swupdate/recipes-support/swupdate/swupdate/stm32mp15common /home/mahendra/STM32MPU_workspace/Digikey_YoctoSeries/Digikey_Yocto/meta-swupdate/recipes-support/swupdate/files/stm32mp15common /home/mahendra/STM32MPU_workspace/Digikey_YoctoSeries/Digikey_Yocto/meta-swupdate/recipes-support/swupdate/swupdate-2022.05/stm32mp1common /home/mahendra/STM32MPU_workspace/Digikey_YoctoSeries/Digikey_Yocto/meta-swupdate/recipes-support/swupdate/swupdate/stm32mp1common /home/mahendra/STM32MPU_workspace/Digikey_YoctoSeries/Digikey_Yocto/meta-swupdate/recipes-support/swupdate/files/stm32mp1common /home/mahendra/STM32MPU_workspace/Digikey_YoctoSeries/Digikey_Yocto/meta-swupdate/recipes-support/swupdate/swupdate-2022.05/stm32mpcommon /home/mahendra/STM32MPU_workspace/Digikey_YoctoSeries/Digikey_Yocto/meta-swupdate/recipes-support/swupdate/swupdate/stm32mpcommon /home/mahendra/STM32MPU_workspace/Digikey_YoctoSeries/Digikey_Yocto/meta-swupdate/recipes-support/swupdate/files/stm32mpcommon /home/mahendra/STM32MPU_workspace/Digikey_YoctoSeries/Digikey_Yocto/meta-swupdate/recipes-support/swupdate/swupdate-2022.05/stcommon /home/mahendra/STM32MPU_workspace/Digikey_YoctoSeries/Digikey_Yocto/meta-swupdate/recipes-support/swupdate/swupdate/stcommon /home/mahendra/STM32MPU_workspace/Digikey_YoctoSeries/Digikey_Yocto/meta-swupdate/recipes-support/swupdate/files/stcommon /home/mahendra/STM32MPU_workspace/Digikey_YoctoSeries/Digikey_Yocto/meta-swupdate/recipes-support/swupdate/swupdate-2022.05/stm32mp1 /home/mahendra/STM32MPU_workspace/Digikey_YoctoSeries/Digikey_Yocto/meta-swupdate/recipes-support/swupdate/swupdate/stm32mp1 /home/mahendra/STM32MPU_workspace/Digikey_YoctoSeries/Digikey_Yocto/meta-swupdate/recipes-support/swupdate/files/stm32mp1 /home/mahendra/STM32MPU_workspace/Digikey_YoctoSeries/Digikey_Yocto/meta-swupdate/recipes-support/swupdate/swupdate-2022.05/armv7ve /home/mahendra/STM32MPU_workspace/Digikey_YoctoSeries/Digikey_Yocto/meta-swupdate/recipes-support/swupdate/swupdate/armv7ve /home/mahendra/STM32MPU_workspace/Digikey_YoctoSeries/Digikey_Yocto/meta-swupdate/recipes-support/swupdate/files/armv7ve /home/mahendra/STM32MPU_workspace/Digikey_YoctoSeries/Digikey_Yocto/meta-swupdate/recipes-support/swupdate/swupdate-2022.05/arm /home/mahendra/STM32MPU_workspace/Digikey_YoctoSeries/Digikey_Yocto/meta-swupdate/recipes-support/swupdate/swupdate/arm /home/mahendra/STM32MPU_workspace/Digikey_YoctoSeries/Digikey_Yocto/meta-swupdate/recipes-support/swupdate/files/arm /home/mahendra/STM32MPU_workspace/Digikey_YoctoSeries/Digikey_Yocto/meta-swupdate/recipes-support/swupdate/swupdate-2022.05/ /home/mahendra/STM32MPU_workspace/Digikey_YoctoSeries/Digikey_Yocto/meta-swupdate/recipes-support/swupdate/swupdate/ /home/mahendra/STM32MPU_workspace/Digikey_YoctoSeries/Digikey_Yocto/meta-swupdate/recipes-support/swupdate/files/ /home/mahendra/STM32MPU_workspace/Digikey_YoctoSeries/Digikey_Yocto/poky/build-mp1/downloads
ERROR: swupdate-2022.05-r0 do_fetch: Bitbake Fetcher Error: FetchError('Unable to fetch URL from any source.', 'file://sw-description')
ERROR: Logfile of failure stored in: /home/mahendra/STM32MPU_workspace/Digikey_YoctoSeries/Digikey_Yocto/poky/build-mp1/tmp/work/stm32mp1-poky-linux-gnueabi/swupdate/2022.05-r0/temp/log.do_fetch.218113
ERROR: Task (/home/mahendra/STM32MPU_workspace/Digikey_YoctoSeries/Digikey_Yocto/meta-swupdate/recipes-support/swupdate/swupdate_2022.05.bb:do_fetch) failed with exit code '1'

#3 lore raw

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 <[email protected]> schrieb am So., 25. Sept. 2022, 20:01:

Quoted 36 lines

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

-=-=-=-=-=-=-=-=-=-=-=-
Links: You receive all messages sent to this group. View/Reply Online (#58154):
https://lists.yoctoproject.org/g/yocto/message/58154
Mute This Topic: https://lists.yoctoproject.org/mt/93911152/4454582
Mute #dunfell:https://lists.yoctoproject.org/g/yocto/mutehashtag/dunfell Group Owner: [email protected]
Unsubscribe: https://lists.yoctoproject.org/g/yocto/unsub [ [email protected]]
-=-=-=-=-=-=-=-=-=-=-=-

#4 lore raw
In reply to Mahendra Sondagar

Hi Mahendra Sondagar,

Quoted 12 lines · 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 r *ecipes-myswupdate* file inside the meta-custom layers The content of the recipes-myswupdate are as follows
.

Quoted 8 lines
└── 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
Quoted 21 lines

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"
Quoted 9 lines
# 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

#5 lore raw

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

let me try this

Regards
Mahendra

Quoted 89 lines · Quentin Schulz

Hi Mahendra Sondagar,

Quoted 4 lines · 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

Quoted 3 lines

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

Quoted 3 lines

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

Quoted 10 lines

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
Quoted 3 lines

The content of the *swupdate_%.bbappend* are as follows

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

Quoted 18 lines

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"
Quoted 9 lines
# 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