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

[testing] Add coreos-keep-cgroup-v1.service #238

Merged
merged 2 commits into from
Nov 26, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 7 additions & 0 deletions fedora-coreos-base.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -146,6 +146,13 @@ packages:
- whois-nls
# Parsing/Interacting with JSON data
- jq
# HACK for https://github.com/coreos/fedora-coreos-config/pull/238#issuecomment-558707064
- brotli-1.0.7-3.fc30.x86_64
- curl-7.65.3-4.fc30.x86_64
- libcurl-7.65.3-4.fc30.x86_64
- libmetalink-0.1.3-8.fc30.x86_64
- libssh-0.9.0-5.fc30.x86_64
- libssh-config-0.9.0-5.fc30.noarch

# This thing is crying out to be pulled into systemd, but that hasn't happened
# yet. Also we may want to add to rpm-ostree something like arch negation;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,3 +13,4 @@ enable afterburn-firstboot-checkin.service
enable afterburn-sshkeys@.service
# Update agent
enable zincati.service
enable coreos-keep-cgroup-v1.service
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
[Unit]
Description=CoreOS Keep CGroups v1
Documentation=https://github.com/coreos/fedora-coreos-tracker/issues/292
RequiresMountsFor=/boot
# Note we don't conditionalize on ConditionKernelCommandLine= here because the
# kernel arg might've been added manually just for this boot; we still want to
# change the BLS entries in that case.

[Service]
Type=oneshot
RemainAfterExit=yes
ExecStart=/usr/libexec/coreos-keep-cgroup-v1

[Install]
WantedBy=multi-user.target
17 changes: 17 additions & 0 deletions overlay.d/90cgroups/usr/libexec/coreos-keep-cgroup-v1
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
#!/bin/bash
set -euo pipefail

for f in /boot/loader/entries/*.conf; do
options=$(grep '^options ' "$f" | cut -f2- -d' ')

# If it's already specified, don't touch whatever value is there. That way,
# users that purposely opted into v2 early keep it. It also makes this
# script idempotent.
if grep -q "systemd.unified_cgroup_hierarchy" <<< "$options"; then
continue
fi

# otherwise, make sure we stay on v1
sed -e "/^options / s/$/ systemd.unified_cgroup_hierarchy=0/" -i "$f"
echo "$(basename "$f"): injected systemd.unified_cgroup_hierarchy=0"
done