See https://uapi-group.org/specifications/specs/boot_loader_specification/#boot-counting and https://systemd.io/AUTOMATIC_BOOT_ASSESSMENT/ . Related to #284135.