Skip to content

fix(postinst): handle cgroup switch on systems with /boot/cmdline.txt #398

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

Conversation

matteocostantini
Copy link

Added logic to manage the switch to cgroup v2 on systems using /boot/cmdline.txt. This update ensures compatibility by checking for the presence of "systemd.unified_cgroup_hierarchy=false" and updating it, aligning system requirements, and prompting a reboot as necessary. Improved warning message for better clarity when neither configuration file is found.

Added logic to manage the switch to cgroup v2 on systems using /boot/cmdline.txt. This update ensures compatibility by checking for the presence of "systemd.unified_cgroup_hierarchy=false" and updating it, aligning system requirements, and prompting a reboot as necessary. Improved warning message for better clarity when neither configuration file is found.
Copy link

@home-assistant home-assistant bot left a comment

Choose a reason for hiding this comment

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

Hi @matteocostantini

It seems you haven't yet signed a CLA. Please do so here.

Once you do that we will be able to review and accept this pull request.

Thanks!

@home-assistant
Copy link

Please take a look at the requested changes, and use the Ready for review button when you are done, thanks 👍

Learn more about our pull request process.

@home-assistant home-assistant bot marked this pull request as draft March 12, 2025 08:01
@matteocostantini matteocostantini marked this pull request as ready for review March 12, 2025 08:03
Copy link
Member

@sairon sairon left a comment

Choose a reason for hiding this comment

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

I think the goal of this code is to revert changes that were previously done by the Supervised installation, see b45f5cd. It never touched /boot/cmdline.txt. Otherwise, if the code should really handle removing this kernel option, more cases would need to be addressed - e.g. the option at the start of the file (currently it won't be replaced, because the sed replaces pattern starting with a space) or value 0 which is valid (and maybe even more common) way to disable an option.

@home-assistant home-assistant bot marked this pull request as draft March 14, 2025 09:00
@matteocostantini
Copy link
Author

@sairon i want to remove the cgroupv1 istrunction from my legacy cmdline path. i dont have /boot/firmware/cmdline.txt. I think is need to put the remove operation to switch to cgroupv2 , because i think anyone have my situation. I made this operation editing manually my legacy path cmdline file!

@matteocostantini matteocostantini marked this pull request as ready for review March 14, 2025 12:30
@home-assistant home-assistant bot requested a review from sairon March 14, 2025 12:30
@ikifar2012
Copy link
Member

As @sairon said, I think this PR is a bit out of scope given the fact that we never touched /boot/cmdline.txt before, we don't know what could be in there. I think it is best to just get people who changed it manually to also revert their own changes manually

If you have any further questions please do not hesitate to @ mention me in your reply but for now I will be closing this

@ikifar2012 ikifar2012 closed this Mar 18, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants