summaryrefslogtreecommitdiff
path: root/units/systemd-boot-update.service
Commit message (Collapse)AuthorAgeFilesLines
* units: rename/rework systemd-boot-system-token.service → ↵Lennart Poettering2023-01-041-1/+2
| | | | | | | | | | | | | | | | | | | | | | | | | systemd-boot-random-seed.service This renames systemd-boot-system-token.service to systemd-boot-random-seed.service and conditions it less strictly. Previously, the job of the service was to write a "system token" EFI variable if it was missing. It called "bootctl --graceful random-seed" for that. With this change we condition it more liberally: instead of calling it only when the "system token" EFI variable isn't set, we call it whenever a boot loader interface compatible boot loader is used. This means, previously it was invoked on the first boot only: now it is invoked at every boot. This doesn#t change the command that is invoked. That's because previously already the "bootctl --graceful random-seed" did two things: set the system token if not set yet *and* refresh the random seed in the ESP. Previousy we put the focus on the former, now we shift the focus to the latter. With this simple change we can replace the logic f913c784ad4c93894fd6cb2590738113dff5a694 added, but from a service that can run much later and doesn't keep the ESP pinned.
* boot: optionally update sd-boot on bootLennart Poettering2021-07-301-0/+24
Boot loaders are software like any other, and hence muse be updated in regular intervals. Let's add a simple (optional) service that updates sd-boot automatically from the host if it is found installed but out-of-date in the ESP. Note that traditional distros probably should invoke "bootctl update" directly from the package scripts whenver they update the sd-boot package. This new service is primarily intended for image-based update systems, i.e. where the rootfs or /usr are atomically updated in A/B style and where the current boot loader should be synced into the ESP from the currently booted image every now and then. It can also act as safety net if the packaging scripts in classic systems are't doing the bootctl update stuff themselves. Since updating boot loaders mit be a tiny bit risky (even though we try really hard to make them robust, by fsck'ing the ESP and mounting it only on demand, by doing updates mostly as single file updates and by fsync()ing heavily) this is an optional feature, i.e. subject to "systemctl enable". However, since it's the right thing to do I think, it's enabled by default via the preset logic. Note that the updating logic is implemented gracefully: i.e. it's a NOP if the boot loader is already new enough, or was never installed.