Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

RTC clock drifting problems - manual/automatic correction guides #103

Closed
tlaurion opened this issue Sep 14, 2022 · 6 comments · Fixed by linuxboot/heads#1267
Closed

RTC clock drifting problems - manual/automatic correction guides #103

tlaurion opened this issue Sep 14, 2022 · 6 comments · Fixed by linuxboot/heads#1267

Comments

@tlaurion
Copy link
Collaborator

tlaurion commented Sep 14, 2022

Not sure how that happeneds and from where (or if Mandala effect... Was that ever documented?!) , but I have found no reference under osresearch.net on ntp/skew/time/date to automatically set/manually correct time after first flash and/or in case of a bad RTC battery.

Bad RTC battery is a pretty common thing across second hand bought devices, but not as much impactful as under Heads, where valid time is needed to generate keys, sign and validate signed content and generate TOTP code which will be invalid if time skew can be of 20 years, unless synced from OS over network first thing when connected, sometimes going unnoticed per users but while still being problematic anyhow from a log perspective, if that only that matters.

There is currently no actual reference to network-recovery-init to sync time against router through NTP protocol.
Nor manual instructions on fixing the time in case of linuxboot/heads#1021 (which is most probably a bad RTC clock battery, needing to be changed, but how users can know if not documented).

Menu options will permit to go to console, and give instructions in case of invalid TOTP code, but as linuxboot/heads#1021 shows us, there are real problems into not documenting this properly, since users may not reach Heads and therefore Heads menus to get to the console with proper instructions from that Heads menu option.

Basically, an Heads entree should be added under heads-wiki so that users can easily find what is documented under linuxboot/heads#1021 (comment). Referenced through FAQ?

@githubuseravailable: where would you have loved to see that documented?

@githubuseravailable
Copy link

@tlaurion

maybe it's part of configuration, since most of 2nd hand device, will have bad RTC battery,
but at the same time, it's also an issue.

so, maybe it's good idea to document it under heads-wiki,
for heads issue already documented in 1021
with link to this ticket, under heads-wiki

@tlaurion
Copy link
Collaborator Author

#78 covers that, needs review and adaptation.

Fix fourth issue reported linuxboot/heads#1213 (comment)

@githubuseravailable
Copy link

@tlaurion

i have tried this 1st solution, in TOTP Mismatch

date -s hh:mm:ss && hwclock -w

but it will set the HW clock only, without setting the HW date,
therefore the HW date still incorrect,
maybe that's the reason why the TOTP still mismatch,
even after setting the HW clock correctly

@githubuseravailable
Copy link

@tlaurion i tried

date -s 'yyyy-mm-dd hh:mm:ss' && hwclock -w

and now the date time has been set correctly,
and TOTP finally match,
maybe can add on into the wiki

@tlaurion
Copy link
Collaborator Author

Should have not been closed. PR should be modified accordingly to code changes upstream.

@tlaurion tlaurion reopened this Jan 13, 2023
@tlaurion
Copy link
Collaborator Author

Sorry for the noise. PR that needs to be modified is here: #78

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 a pull request may close this issue.

2 participants