Skip to content
This repository has been archived by the owner on Jan 6, 2023. It is now read-only.

Format bump rationale

Patrick McCarty edited this page Nov 22, 2016 · 1 revision

On occasion it is necessary to ship an incompatibility in the operating system.

For example, we may want to change the bootloader. If you ship new things which depend on the new bootloader (e.g. scripting/hooks), but if the bootloader is not yet present, the new thing will fail. A new kernel will try to insert itself into the new bootloader, but only the old bootloader is present. The old bootloader then does not get informed of the new kernel. The new kernel is not bootable. That is a problem.

Even if the kernel is deployed by tools which understand the new and old bootloader, at some point you want to deprecate and retire support for the old. Stop shipping it. Delete the unused code to hook into it. To delete the old support, you must ensure that nobody can upgrade from a time prior to all of these changes to the place where the changes are assumed and compatibility code is gone.

We need a mechanism then generally to ensure people update to a particular version of the OS and not beyond. That version would include all prerequisites for the later code. Once that has happened, they can update to a version of the OS which includes the changes which depend on the prior ones. And then the old code can be removed.

SWUPD's mechanism for this is a "format" marker which is a shared construct between the update server and update client. The update client is hardcoded to look for a specific format on the server side. Example: a client is hardcoded to look for format1 and a stream of latest versions are published to format1. The last version published to format1 would include a client hardcoded to look for format2. Then the server is publishing a different stream of latest versions to format2, which are undetectable to any older update client.

The format is effectively an OS format. The OS at format1 is incompatible with the OS in format2, unless one updates between them via a fixed version that includes the needed compatibility fix(es).

For details on how to implement a format bump, see Format-bumps.

Clone this wiki locally