rauc / meta-rauc

Yocto/Open Embedded meta layer for RAUC, the embedded Linux update framework
MIT License
158 stars 89 forks source link

post-install hook after uboot bundle. #303

Closed umarFarooq-emb closed 6 months ago

umarFarooq-emb commented 6 months ago

I am trying to update my uboot image using RAUC,, this slot contains a bootloader(SSBL) and this partition is not ext4,, I want to run a post-install script only when my ssbl(uboot) is updated. To do this I am using a post install hook like follows in the bundle

RAUC_BUNDLE_HOOKS[file] = "update-metadata.sh"
RAUC_SLOT_fip-senec-os[hooks] = "pre-install"

and I am getting the following logs while the bundle is updated in the system

 60% Checking manifest contents done.
 60% Determining target install group
 80% Determining target install group done.
 80% Updating slots
[13910.481015] EXT4-fs (mmcblk1p6): VFS: Can't find ext4 filesystem
 80% Checking slot fip-senec-os.1
 90% Checking slot fip-senec-os.1 done.
 90% Copying image to fip-senec-os.1
 99% Copying image to fip-senec-os.1 failed.
 99% Updating slots failed.
100% Installing failed.
LastError: Installation error: Failed updating slot fip-senec-os.1: failed to mount slot: failed to run mount: Child process exited with code 32

As far as I get this thing is , the post-install hook tries mounting the uboot partition and as my uboot partition is not ext4 is returns the errors.

My kernel, rootfs and tfa are also being updated using rauc and I want the script to run only when uboot is updated.

If i can use handlers? if using the handlers I can run a script only when my uboot is updated? or If using some flag or config I can stop the post-install hook from mounting uboot partition? as the post install hook has nothing to change inside the bootloader.

~Umar

ejoerns commented 6 months ago

@umarFarooq-emb Maybe you have erroneously configured your non-ext4 slot as type=ext4? If that's the case, please try to replace it with type=raw.

For a mountable file system, like ext4, it should be a safe assumption to be able to mount the slot after the update. This is documented in the 'post-install' section of https://rauc.readthedocs.io/en/latest/using.html#slot-hooks

umarFarooq-emb commented 6 months ago

@ejoerns thanks for your reply. I have changed the type to raw. It works fine.

Issue can be closed,

thanks

jluebbe commented 6 months ago

I am trying to update my uboot image using RAUC,, this slot contains a bootloader(SSBL) and this partition is not ext4,, I want to run a post-install script only when my ssbl(uboot) is updated. To do this I am using a post install hook like follows in the bundle

RAUC_BUNDLE_HOOKS[file] = "update-metadata.sh"
RAUC_SLOT_fip-senec-os[hooks] = "pre-install"

You say post install hook, but specify pre-install in the config?

umarFarooq-emb commented 6 months ago

@jluebbe for the sake of testing I tried both the post-install and pre-install hooks but it always returned the same ext4 slot mount error.

The issue was in the system.conf file, where I changed the slot type=ext4 to type=raw.

It is resolved now. Thanks