WARNING: THIS SITE IS A MIRROR OF GITHUB.COM / IT CANNOT LOGIN OR REGISTER ACCOUNTS / THE CONTENTS ARE PROVIDED AS-IS / THIS SITE ASSUMES NO RESPONSIBILITY FOR ANY DISPLAYED CONTENT OR LINKS / IF YOU FOUND SOMETHING MAY NOT GOOD FOR EVERYONE, CONTACT ADMIN AT ilovescratch@foxmail.com
Skip to content

Conversation

@igorpecovnik
Copy link
Member

@igorpecovnik igorpecovnik commented Nov 18, 2025

Description

Only when POWER_MANAGEMENT_FEATURES is exactly "yes" block does not run and suspend/hibernate remain enabled.

Ref: #8720 (comment)

Checklist:

  • My code follows the style guidelines of this project
  • I have performed a self-review of my own code

Summary by CodeRabbit

  • New Features
    • Power management is now configurable through a new feature flag. Users can enable power management capabilities according to their specific needs and deployment requirements. Previously, power management was unconditionally disabled on all systems. This change provides greater operational flexibility and customization options for different environments.

@igorpecovnik igorpecovnik requested a review from a team as a code owner November 18, 2025 08:11
@coderabbitai
Copy link
Contributor

coderabbitai bot commented Nov 18, 2025

Important

Review skipped

Auto reviews are limited based on label configuration.

🏷️ Required labels (at least one) (1)
  • Needs review

Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Walkthrough

Adds an exported global POWER_MANAGEMENT_FEATURES flag in UEFI config and makes creation of the systemd sleep override (/etc/systemd/sleep.conf.d/00-disable.conf) conditional on that flag during rootfs setup.

Changes

Cohort / File(s) Summary
Feature flag declaration
config/sources/families/include/uefi_common.inc
Exports new global variable POWER_MANAGEMENT_FEATURES set to yes
Conditional sleep override
lib/functions/rootfs/distro-specific.sh
Replaces unconditional creation of /etc/systemd/sleep.conf.d/00-disable.conf with a conditional block that only creates it when POWER_MANAGEMENT_FEATURES is not yes

Sequence Diagram(s)

sequenceDiagram
    autonumber
    participant Rootfs as rootfs build script
    participant Config as UEFI config
    participant FS as /etc/systemd

    note right of Config `#ccffcc`: new exported var\nPOWER_MANAGEMENT_FEATURES=yes

    Rootfs->>Config: read POWER_MANAGEMENT_FEATURES
    alt POWER_MANAGEMENT_FEATURES == "yes"
        Rootfs-->>FS: skip creating 00-disable.conf
        note right of Rootfs `#eef2ff`: power management overrides enabled
    else POWER_MANAGEMENT_FEATURES != "yes"
        Rootfs->>FS: create 00-disable.conf (disable suspend/hibernate)
        note right of FS `#fff2ee`: sleep.conf.d present
    end
Loading

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~10 minutes

  • Check flag name consistency and export visibility in uefi_common.inc
  • Verify the conditional branch in distro-specific.sh matches intended semantics and messaging
  • Confirm no other code assumes the previous unconditional presence of the sleep override

Possibly related PRs

Poem

🐰 I hopped into config, ribbon and pen,
A little flag for sleepy den.
Say "yes" and the suspend doors swing free,
Say no and we hush the battery.
Happy builds, from me to thee 🥕✨

Pre-merge checks and finishing touches

✅ Passed checks (3 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title is partially related to the changeset. It mentions making power management conditional and enabling it on UEFI targets, which aligns with the PR's intent. However, the title contains a typo ('Powere' instead of 'Power') and is somewhat verbose, though it does convey the main purpose of the changes.
Docstring Coverage ✅ Passed Docstring coverage is 100.00% which is sufficient. The required threshold is 80.00%.

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@github-actions github-actions bot added size/small PR with less then 50 lines 11 Milestone: Fourth quarter release Needs review Seeking for review Hardware Hardware related like kernel, U-Boot, ... Framework Framework components labels Nov 18, 2025
@igorpecovnik igorpecovnik force-pushed the conditional_pm branch 2 times, most recently from f087d8c to 946fd97 Compare November 18, 2025 08:15
@github-actions github-actions bot added the Documentation Documentation changes or additions label Nov 18, 2025
Copy link
Member

@rpardini rpardini left a comment

Choose a reason for hiding this comment

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

Nice, thanks.
I think for now this will do; other families/boards can enable POWER_MANAGEMENT_FEATURES=yes later.

@github-actions
Copy link
Contributor

✅ This PR has been reviewed and approved — all set for merge!

@github-actions github-actions bot added Ready to merge Reviewed, tested and ready for merge and removed Needs review Seeking for review labels Nov 18, 2025
@igorpecovnik igorpecovnik merged commit 39d6bc8 into main Nov 18, 2025
11 checks passed
@igorpecovnik igorpecovnik deleted the conditional_pm branch November 18, 2025 11:01
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

11 Milestone: Fourth quarter release Documentation Documentation changes or additions Framework Framework components Hardware Hardware related like kernel, U-Boot, ... Ready to merge Reviewed, tested and ready for merge size/small PR with less then 50 lines

Development

Successfully merging this pull request may close these issues.

3 participants