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

Unlock registers if running linux 4+ #2

Merged
merged 5 commits into from Jan 19, 2019
Merged

Unlock registers if running linux 4+ #2

merged 5 commits into from Jan 19, 2019

Conversation

abferm
Copy link

@abferm abferm commented Jan 18, 2019

Check kernel version using uname and call bbbrtc unlock if needed.

Before this was adding a 30 second delay to shutdown.
I use an external RTC for time syncronization, and others may as
well. It's better to trust the date command than bbbrtc, especially
when a reset here overwrites the now value in the clock.
Moved all logic to a script in /usr/sbin. This will make it easier
to call the script manually or support systemd rather than systemv.
The cool kids use systemd, so lets make that nicer.
@abferm
Copy link
Author

abferm commented Jan 18, 2019

Note, this depends on bbbrtc #2

Copy link
Owner

@bigjosh bigjosh left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Much better. Thank you for cleaning up my mess! :)

@bigjosh bigjosh merged commit c1c949e into bigjosh:dev Jan 19, 2019
chkphy Outdated

sleep 1

# unlock rtc registers if we are running a kernel newer than 3.X
if [ "$kernel_major" -ge "4" ]; then
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just curious: is there any downside to unlocking these if they are already unlocked? If not, could avoid the version check and just always unlock?

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.

None yet

2 participants