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

v252 backports #251

Merged
merged 10 commits into from Feb 10, 2023
Merged

v252 backports #251

merged 10 commits into from Feb 10, 2023

Conversation

eworm-de
Copy link
Collaborator

@eworm-de eworm-de commented Feb 4, 2023

No description provided.

Fixes a bug introduced by 953c928.

Fixes #25811.

(cherry picked from commit de8409a)
Before v252, HibernateDelaySec= specifies the maximum timespan that the
system in suspend state, and the system hibernate after the timespan.

However, after 96d662f, the setting is
repurposed as the default interval to measure battery charge level and
estimate the battery discharging late. And if the system has enough
battery capacity, then the system will stay in suspend state and not
hibernate even if the time passed. See issue #25269.

To keep the backward compatibility, let's introduce another setting
SuspendEstimationSec= for controlling the interval to measure
battery charge level, and make HibernateDelaySec= work as of v251.

This also drops implementation details from the man page.

Fixes #25269.

(cherry picked from commit 4f58b65)
(cherry picked from commit 3c3f460)
- use device_get_sysattr_int(),
- drop redundant log message.

(cherry picked from commit 3d9ca76)
Also, rename get_battery_identifier() to siphash24_compress_device_sysattr().

This also makes any errors in sd_id128_get_machine() or id128_get_product()
ignored. For the machine ID, the failure should not be significant unless
the file stored in the discharge level is reused by another system, which
is quite unusual. For the product ID, if the firmware provides useless
ID (all zero or all 0xFF), then loading/storing the discharge rate
becomes completely broken, that should be avoided.

Note, now sysattrs are used instead of properties in uevent files, but
both provide the same information, hence no functionality should be
changed.

(cherry picked from commit a7795a4)
(cherry picked from commit 3332cfe)
The enumerator is now mostly consistent with on_ac_power() in
udev-util.c.

(cherry picked from commit fe8e0f8)
@bluca
Copy link
Member

bluca commented Feb 7, 2023

This is a new option, and we don't add new options to stable releases usually?

@eworm-de
Copy link
Collaborator Author

eworm-de commented Feb 7, 2023

The merge request from main branch (systemd/systemd#25374) has the needs-stable-backport label set. But I can understand your concern and I am fine to wait for v253.

@boudekerk
Copy link

boudekerk commented Feb 10, 2023

I know this his been debated at length, in systemd/systemd#25269. But most people seem to believe it to be a breaking change to an existing option, which would warrant a backport IMO. The new option being introduced is part of the fix. i.e. the original functionality is restored, but the new (previously breaking) behaviour is not removed, but instead being made available in a new option.

As the new option is part of the "fix", wouldn't a backport be appropriate regardless?

@keszybz
Copy link
Member

keszybz commented Feb 10, 2023

Pfff, this is tough. But I think we're better off merging this. For people upgrading from v251, this is clear: we maintain compatibility. People who were already on v252 and adjusted to the new behaviour would see a disruption. But I think that the amount of such people will be small. There were many people who commented in #25269, so the change in v252 was clearly causing problems.

@keszybz keszybz merged commit c6f2f5a into systemd:v252-stable Feb 10, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

None yet

5 participants