-
Notifications
You must be signed in to change notification settings - Fork 834
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
More flexible cgroup settings (#352)
* More flexible cgroup settings If there are already required cgroup boot parameters present but in a different order than specified, the script will add them again. It is better to test for the individual parameter in a loop and selectively add them as necessary. Signed-off-by: Marko Vukovic <[email protected]> Signed-off-by: Marko Vukovic <[email protected]> Signed-off-by: Marko Vukovic <[email protected]>
- Loading branch information
1 parent
b6e4c8b
commit 04c8ae9
Showing
5 changed files
with
45 additions
and
20 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,8 +1,13 @@ | ||
--- | ||
- name: Enable cgroup via boot commandline if not already enabled | ||
ansible.builtin.lineinfile: | ||
ansible.builtin.replace: | ||
path: /boot/boot.txt | ||
regexp: '^(setenv bootargs console=ttyS1,115200 console=tty0 root=PARTUUID=\${uuid} rw rootwait smsc95xx.macaddr="\${usbethaddr}")' | ||
line: '\1 cgroup_enable=cpuset cgroup_memory=1 cgroup_enable=memory' | ||
backrefs: true | ||
regexp: '^(setenv bootargs console=ttyS1,115200 console=tty0 root=PARTUUID=\${uuid} rw rootwait smsc95xx.macaddr="\${usbethaddr}"(?!.*\b{{ cgroup_item }}\b).*)$' | ||
replace: '\1 {{ cgroup_item }}' | ||
with_items: | ||
- "cgroup_enable=cpuset" | ||
- "cgroup_memory=1" | ||
- "cgroup_enable=memory" | ||
loop_control: | ||
loop_var: cgroup_item | ||
notify: Regenerate bootloader image |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,8 +1,13 @@ | ||
--- | ||
- name: Enable cgroup via boot commandline if not already enabled | ||
ansible.builtin.lineinfile: | ||
ansible.builtin.replace: | ||
path: /boot/cmdline.txt | ||
backrefs: true | ||
regexp: '^((?!.*\bcgroup_enable=cpuset cgroup_memory=1 cgroup_enable=memory\b).*)$' | ||
line: '\1 cgroup_enable=cpuset cgroup_memory=1 cgroup_enable=memory' | ||
regexp: '^([\w](?!.*\b{{ cgroup_item }}\b).*)$' | ||
replace: '\1 {{ cgroup_item }}' | ||
with_items: | ||
- "cgroup_enable=cpuset" | ||
- "cgroup_memory=1" | ||
- "cgroup_enable=memory" | ||
loop_control: | ||
loop_var: cgroup_item | ||
notify: Reboot Pi |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters