Creating static deltas¶
OSTree downloads updates from a remote OSTree repository. OSTree repositories contain all the files that compose some version of an image. When you create and manage images with OSTree, you can also create static deltas. Static deltas are a collection of updates generated between two OSTree commits. Static deltas optimize updates by fetching only objects from the new commit that do not already exist in the image. If a static delta is available for a specific transaction, OSTree will automatically use it.
Prerequisites
- Two or more OSTree-based images, such as the versions you created in Building OSTree-based images and Upgrading OSTree-based images
- You have cloned the sample-images repository for the generate-deltas tool.
Procedure
-
Run
ostree log
to get the commit IDs of the available versions:For example:
$ ostree log --repo=my-repo autosd9-sig/x86_64/qemu-ostree_upgrade commit 5c94cb5ee2409b0219e8d3cf3bda1b56dafb9dcbc0846da97309491524e4fcee Parent: 8be6158fa1862950d8751663728bdb82d1c7d537770b1f0fc9b8eba4939480ae ContentChecksum: 8c82a9801802d726e546bf9475f719c3760e660f8165bd034876e04aa84092d1 Date: 2025-05-06 18:28:23 +0000 Version: 1.1 (no subject) commit 8be6158fa1862950d8751663728bdb82d1c7d537770b1f0fc9b8eba4939480ae ContentChecksum: 422d0de2ea20a009a754b699d3ca65ea7db1881bfa7c6c254258b84fa3c9ce9b Date: 2025-05-06 18:11:26 +0000 Version: 1.0
There are two commits. Version 1.1, the most recent commit, has the ID
5c94cb5ee2
. Its parent commit,8be6158fa1
, matches the commit ID for Version 1.0. -
Generate a static delta using the following syntax:
The
REV
values are the commit IDs of the versions between which you want to create a static delta. The example, which uses partial commit IDs, creates a static delta from Version 1.0 to Version 1.1: