Repository navigation
Update and OTA EN
Language: English | Update-and-OTA
kernel/ota/ota_ab.c maintains two slots (A and B) plus a boot flag:
- GRUB reads the flag and boots the active slot; the menu offers force-slot entries as the manual override.
- An update installs onto the inactive slot while you keep running.
- The next boot flips to the updated slot;
update rollbackflips back if you reject it.
From a running ISO boot:
oc> dskstat (pick a target disk, e.g. ata0)
oc> install ata0 (partition + copy the running kernel +
GRUB boot files + /etc volume)
install copies the multiboot2 module self - literally the kernel
ELF that is running right now - onto the disk, so the installed
system always matches its installer. abdisk <dev> does the same
shaped as an A/B update disk (two slots + flags; destroys data).
abcfg shows the exact grub.cfg files those commands write.
oc> checkupdate (reads the update URL from /etc/opencube.conf
- http or https - and parses the manifest)
oc> config get update_url (the configuration key it uses)
The manifest is the website's update.json: version, build, package
URL, package SHA256, size.
oc> update download (fetch the OTA package)
oc> update verify (SHA256 + signature check)
oc> update install a (install onto slot A/B - the inactive one)
oc> reboot (boot the updated slot)
The OTA package (opencube-<version>-update.tar.gz) carries the new
kernel ELF plus a manifest. Verification is cryptographic: hash plus
signature - a package that fails either is refused.
If a slot misbehaves after a flip:
- Pick the other slot from the GRUB menu (force entry), or
-
oc> update rollbackfrom inside a running system.
ab_partition_test exercises slot discovery, flags and slot
switching on a scratch disk without touching your real boot disk.
checkupdate, checkupdate_test, update (the chain above),
ab_partition_test, abcfg, abdisk, config (update URL keys).
The full list with one page each:
Command-Reference-EN - "OTA updates and A/B slots"
domain.
For how the flags are stored, how install stages the inactive slot, and the boot-flag handshake with GRUB, see Internals-OTA-AB-EN.