Skip to content

Commit

Permalink
cgroupv1: abort the update if Flatcar version does not support it
Browse files Browse the repository at this point in the history
  • Loading branch information
ader1990 committed Oct 24, 2024
1 parent 541576a commit 626d4b7
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions flatcar-postinst
Original file line number Diff line number Diff line change
Expand Up @@ -244,6 +244,14 @@ if mountpoint -q /etc; then
unshare -m sh -c "umount /etc && mkdir -p /etc/extensions && attr -R -r overlay.opaque /etc/extensions || true"
fi

# Systemd version >= 256 does not boot anymore if cgroupv1 is enabled or SYSTEMD_CGROUP_ENABLE_LEGACY_FORCE=1 is set
# See: https://github.com/systemd/systemd/releases/tag/v256-rc3
MAX_NEXT_VERSION_ID=5000
if [ ! -f "/sys/fs/cgroup/cgroup.controllers" ]; then
echo "Flatcar version ${MAX_NEXT_VERSION_ID} or higher does not support cgroupv1 anymore. Aborting the update..." >&2
exit 1
fi

# Keep old nodes on cgroup v1
if [[ "${BUILD_ID}" != "dev-"* ]]; then
if [ "${VERSION_ID%%.*}" -lt 2956 ]; then
Expand Down

0 comments on commit 626d4b7

Please sign in to comment.