Skip to content

Update key-init.sh year sanity check for 2026#2162

Open
PeonyThePeon wants to merge 1 commit into
linuxboot:masterfrom
PeonyThePeon:patch-1
Open

Update key-init.sh year sanity check for 2026#2162
PeonyThePeon wants to merge 1 commit into
linuxboot:masterfrom
PeonyThePeon:patch-1

Conversation

@PeonyThePeon

Copy link
Copy Markdown

No description provided.

Signed-off-by: PeonyThePeon <github-peon@runbox.com>
@tlaurion

tlaurion commented Jul 21, 2026

Copy link
Copy Markdown
Collaborator

@PeonyThePeon, first, thank you for your contribution.

The goal of the check for 2024 (year check was implemented) was to check if CMOS battery was disconnected, which resets RTC system clock to take time of build in combination to CONFIG_USE_PC_CMOS_ALTCENTURY bit (#2087), so key-init.sh checks system clock < date and guide user into configuring date+time in UTC/GMT as guided.

Changing the date in code to 2026 has no impact on this; any date > 1970 (timeless build) will trip the condition and guide user with https://github.com/linuxboot/heads/blob/master/initrd/bin/change-time.sh

depending on platform, with CONFIG_USE_PC_CMOS_ALTCENTURY, date can be either 1900 or 2000 (the century bit).

Again, emphasizing here on the role of the check; time drift is common in all systems not syncing clock through ntp (which most OSes do silently through different mechanisms). This is also why Heads shows date+time averywhere (?) with timezone (UTC/GMT) so user can check the time; since a time drift of only a couple of seconds will not generate the same TOTP code on phone vs Heads. As doc says (?) if TOTP is wrong, do not type any secret, and then GUI proposes to change time too under Settings and TOTP/HOTP mismatch, also guiding user to actually launch change-time.sh, which guide the user into checking an external, and proper synchronized clock source, to set date+time in UTC/GMT.

TLDR: Maybe the code comments could be clearer here, but changing 2024 to 2026 is not a needed fix.
@PeonyThePeon Can you close this PR and open another to clarify what was unclear in code comments if you find this is still needed?

@tlaurion

Copy link
Copy Markdown
Collaborator

Recent validation #2133 (comment)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants