]> git.ipfire.org Git - thirdparty/systemd.git/commit
boot: skip random seed handling if seed file is marked read-only
authorLennart Poettering <lennart@amutable.com>
Mon, 13 Jul 2026 13:45:49 +0000 (15:45 +0200)
committerLennart Poettering <lennart@amutable.com>
Tue, 14 Jul 2026 08:12:50 +0000 (10:12 +0200)
commit78f81f02e89adf90522a7ca986eec79b9253b411
tree7d6210bf3772ec692e661d5a53d4e7fc63a97bf4
parent4e67935b77a0eb8e7d954ba37510355691ed1585
boot: skip random seed handling if seed file is marked read-only

If the read-only FAT file attribute is set on /loader/random-seed,
don't update the seed file — and hence don't use it either, since a
seed we cannot update would be the same on every boot.

This gives users an explicit way to turn off random seed handling by
marking the file read-only, useful for example in pre-built OS images
that are replicated to many systems, where the baked-in seed is shared
and hence must not be credited.

The check is done upfront in process_random_seed(), before any other
work, mirroring the existing check for read-only volumes. This covers
both systemd-boot and systemd-stub, which share this code.

Inspired-by: #42979
docs/RANDOM_SEEDS.md
man/systemd-boot.xml
src/boot/random-seed.c