Re: atomic updates with ostree on Beaglebone boards



Hi,

On Wed, May 5, 2021, at 1:31 PM, John Allwine wrote:
Hi all,

I'm looking into adapting the Beaglebone image-builder scripts 
(https://github.com/beagleboard/image-builder) to offer an option to 
build with ostree support for full system atomic updates.

Cool.

I'm sure 
there are many challenges involved with this, but I'd like to better 
understand the boot process. The standard Beaglebone images leverage 
the /boot/uEnv.txt file to read in various device tree overlays at 
boot. Does anyone have any insights into what would be necessary to 
adapt the process to use ostree?

As of recently ostree supports DT, see https://github.com/ostreedev/ostree/pull/2001

The ostree documentation 
(https://ostreedev.github.io/ostree/deployment/) mentions calculating 
the checksum of  the vmlinuz, initramfs and device tree files and 
appending that checksum to each file name. What is the purpose of doing 
that? Is there a way to make that work with device tree overlays? Is 
there a different method? I'm just starting to scratch the surface of 
what is necessary to make this work, so any insights are welcome!

The ostree model is that it maintains "deployments" which are pairs of (kernel, userspace).  There is exactly 
one kernel in each deployment (unlike e.g. apt/yum which often have multiple kernels installed for one 
userspace).

The rationale for the checksum is a mechanism to deduplicate kernels across deployments.

When you have a machine at ostree commit A, and you go to deploy commit B, the contents of A do not matter.  
(This is part of being an image system, see also 
https://blog.verbum.org/2020/08/22/immutable-%E2%86%92-reprovisionable-anti-hysteresis/ )

If commit A and B happen to have the same kernel, when we lay down the update we'll notice the kernel with 
the same checksum is already there, and skip writing it.  But if they differ, we do write it.

The garbage collection process effectively refcounts the kernel/initramfs/DT and prunes unused ones.

Hope that helps!


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]