Update GRUB kernel bootargs via OTA update

Hello Guys,

Is there any way to update kernel bootargs in grub configuration via an OTA update?

I’m on a x86 platform and only root partitions are currently updated by mender update. I would like to update kernel bootargs set in grub.cfg in the boot/efi partition as well.

How can I do that?

Hi @perceval,

It can be done via two primary ways, depending a bit on your exact requirements.
The somewhat more straightforward way would be to create a single-file application deployment that just drops a new grub.cfg in the boot partition.
The more involved, but also more dynamic way would be to create an ArtifactCommit_Leave_xyz script that you ship with the system update that requires the modification. This script will be executed once the system update is done deploying to the inactive partition, and can then take care of arbitrary changes. In this script you can change anything on the boot partition at your will - but be careful to make things bullet-proof, as you are leaving the safe area of rollbacks then. Scripts can be added by passing the -s argument to mender-artifact write.

Hope this helps, let me know if you need additional information.

Greetz,
Josef

Hi @TheYoctoJester,

Thank you for your reply.

What do you mean by a single file application deployment? Does it imply to create a recipes taking the new grub.cfg and put it in a mender image update file? How do you effectively implement this solution?

Concerning the ArtifactCommit_Leave_xyz script, should it be added in a custom my-mender-artifactimg.bbclass recipe? How do you see the implementation for a custom distro?

Greetings
Perceval