Skip to main content
Visitor II
July 9, 2020
Question

Using RAUC with openstlinux

  • July 9, 2020
  • 6 replies
  • 2865 views

We are using rauc to perform remote updates on your target devices.

However, to create the rauc bundle, rauc uses a different image format than the ST image created.

The default imagesource in rauc is:

imgsource = "%s-%s.%s" % (d.getVar('RAUC_SLOT_%s' % slot), machine, img_fstype)

 in file  https://github.com/rauc/meta-rauc/blob/345732f8ef81700e5ca17b4e6a66ae33019cb73b/classes/bundle.bbclass#L197

which I edited to:

imgsource = "%s-%s-%s.%s" % (d.getVar('RAUC_SLOT_%s' % slot), "openstlinux", machine, img_fstype)

What would be the best way to comply with the filenames created by the ST yocto distribution?

What do you suggest?

    This topic has been closed for replies.

    6 replies

    ST Employee
    July 9, 2020

    Hello @meiss.M​ ,

    The issue comes from stm32 extension files which are not supported by RAUC.

    I would recommand to apply the following patch in RAUC :

    diff --git a/src/update_handler.c b/src/update_handler.c
    index bcd6fd8..c77d7f8 100644
    --- a/src/update_handler.c
    +++ b/src/update_handler.c
    @@ -1520,6 +1520,7 @@ typedef struct {
     RaucUpdatePair updatepairs[] = {
     	{"*.ext4.caibx", "ext4", img_to_fs_handler},
     	{"*.ext4.caibx", "raw", img_to_raw_handler},
    +	{"*.stm32", "raw", img_to_raw_handler},
     	{"*.vfat.caibx", "raw", img_to_raw_handler},
     	{"*.ubifs.caibx", "ubivol", img_to_ubivol_handler},
     	{"*.ubifs.caibx", "ubifs", img_to_ubifs_handler},

    BR,

    Christophe

    meiss.MAuthor
    Visitor II
    July 9, 2020

    Thanks for this, I will try.

    Do you recommend using a custom uboot.env script and a copy of the root device?

    by adding in st-machine-common-stm32mp.inc :

    PARTITIONS_CONFIG[rootfsrauc]  ?= "${IMAGE_BASENAME},rootfs,,${ROOTFS_PARTITION_SIZE},FileSystem"

    (after PARTITIONS_CONFIG[rootfs]  ?= "${IMAGE_BASENAME},rootfs,,${ROOTFS_PARTITION_SIZE},FileSystem")

    BTF, this is much more convenient in dunfell now.

    Greetings, Markus

    ST Employee
    July 9, 2020

    Hi @meiss.M​ ,

    I'am not sure to catch what you want to do : could you please elaborate for which purpose you need to use a custom u-boot env script ?

    BTY, you will have to add u-boot-fw-config-stm32mp recipe to you image to allow RAUC to read and write into u-boot env.

    BR,

    Christophe

    meiss.MAuthor
    Visitor II
    July 9, 2020

    We have built up RAUC with symmetric ROOTFS slots: https://rauc.readthedocs.io/en/latest/scenarios.html#symmetric-root-fs-slots

    > BTY, you will have to add u-boot-fw-config-stm32mp recipe to you image to allow RAUC to read and write into u-boot env.

    Yes i did this - it works, by patching the thud uboot for adding the respective stm32mp15_trusted_defconfig

    Luckily in dunfell it is included, which makes it possible to update the uboot fw env

    is this the recommended way to add the additional rootfs :

    > PARTITIONS_CONFIG[rootfsrauc]  ?= "${IMAGE_BASENAME},rootfs,,${ROOTFS_PARTITION_SIZE},FileSystem"

    ST Employee
    July 9, 2020

    Hi @meiss.M​ ,

    There is no specific recommended way to add the additional rootfs on STM32MP1.

    Nevertheless, a proposition would to build a rootfs image for A, flash this image for both A and B, but you need to run post-install.sh script after flashing B to update partition mount points (kernel cmdline, vendorfs ....). Hope I'am clear enough.

    BR,

    Christophe

    meiss.MAuthor
    Visitor II
    July 29, 2020

    Hello @Christophe Guibout​ ,

    Thank you for your advice,

    can you please post me your system.conf

    mine looks like this:

    # rauc configuration file
     
    [system]
    compatible=SDM array
    bootloader=uboot
    statusfile=/boot/raucstatus
     
    [autoinstall]
    path=/data/fw_update
     
    [keyring] 
    path=/etc/rauc/ca.cert.pem
     
    # [handlers]
    # post-install=/sbin/resize-helper # from thud
     
    # [slot.bootfs.0]
    # device=/dev/mmcblk0p4
    # type=ext4
     
    [slot.rootfs.0]
    device=/dev/mmcblk0p6
    type=ext4
    bootname=system0
     
    [slot.rootfs.1]
    device=/dev/mmcblk0p7
    type=ext4
    bootname=system1

     device=/dev/mmcblk0p7 is the added root device (slot B)

    ST Employee
    July 29, 2020

    Hello @meiss.M​ ,

    Here is mine :

    [system]
    compatible=stm32mp1
    bootloader=uboot
    mountprefix=/mnt/rauc
    max-bundle-download-size=805306368
     
    [keyring]
    path=/etc/rauc/ca.cert.pem
     
    [handlers]
    post-install=/usr/lib/rauc/post-install.sh
     
    [slot.rootfs.0]
    device=/dev/mmcblk1p13
    type=ext4
    bootname=A
     
    [slot.rootfs.1]
    device=/dev/mmcblk1p14
    type=ext4
    bootname=B
     
    [slot.bootfs.0]
    device=/dev/mmcblk1p9
    type=ext4
    parent=rootfs.0
     
    [slot.bootfs.1]
    device=/dev/mmcblk1p10
    type=ext4
    parent=rootfs.1
     
    [slot.vendorfs.0]
    device=/dev/mmcblk1p11
    type=ext4
    parent=bootfs.0
     
    [slot.vendorfs.1]
    device=/dev/mmcblk1p12
    type=ext4
    parent=bootfs.1

    BR,

    Christophe