Skip to content

FreeOS 0.1.57 — packages, A/B slots, services

Choose a tag to compare

@anomal3 anomal3 released this 14 Aug 10:29
· 77 commits to main since this release

Phases 31, 32 and 33: packages, two systems on one disk, and services that come back.

What is new

Packages. pkg install /media/hello-1.0.fpk lays a package out under
/opt, pkg list shows it, pkg verify checks every file by length and
checksum, pkg remove takes away exactly what was put there and nothing else.
The .fpk container has a fixed place for a signature from the very first
version — it is empty today, but adding it later would move the manifest, which
is a second format rather than a new field.

Two systems on one disk. The layout is now ESP, two root slots and a state
partition:

ESP (FAT32)      bootloader, kernel-a/-b, initrd-a/-b, the slot record
root_a (ext2)    the system; mounted read-only while it runs
root_b (ext2)    the other slot, the same size to the sector
state  (ext2)    /etc, /home, /root, /var, /opt

sysupdate apply <file.fpk> writes a whole new system into the free slot and
switches the pointer. If the new system does not come up, the bootloader spends
three attempts and returns to the previous slot by itself — no console, no
second computer, and not one file of /home lost. That is the case the whole
scheme exists for, and it is what the rollback scenario on the test bench
does end to end.

Services. /bin/init reads /etc/services and puts back what dies: a
service that is killed comes back in half a second, and one that crashes on
every start is stopped after three attempts with a line in the log — because
restarting a broken service forever is not resilience, it is hiding the fault.
A service runs as whoever its description says, not as whoever started it.

Three defects found on the way, all older than these phases

  • kill did not reach a sleeping program: killing was checked only on the way
    out of an interrupt, so a service that sleeps between log lines died as many
    seconds late as it had left to sleep.
  • Reading a large file from ext2 cost three device round trips per block, and
    went one block at a time. The indirect table now survives the loop iteration
    and consecutive blocks are read in one request.
  • One volume mounted at five prefixes counted as five volumes, so fsck
    checked the state partition five times over.

Verification

cargo xtask test --full — 34 scenarios on both architectures in both
profiles, 134 runs. All green; the two that failed first time were defects in
the new checks themselves (a command longer than the 32-byte PL011 FIFO, and a
step ordered by events rather than by log lines), fixed and re-run on AArch64.

Four new scenarios: pkg, services, rollback, update.

Which file to take

  • FreeOS-Installer_*.iso — installs onto a disk: partitions it, asks for an
    account, keyboard and timezone. This is the one that gives you the A/B
    slots and the state partition
    ; the live image has neither.
  • FreeOS_*.iso — boots into the running system without touching any disk.

x86_64 for a PC or an ordinary virtual machine, aarch64 for ARM64
(QEMU virt, UTM, VirtualBox on Apple Silicon). UEFI only — there is no BIOS
boot path.