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 d13ccd0
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion flatcar-postinst
Original file line number Diff line number Diff line change
Expand Up @@ -244,11 +244,17 @@ if mountpoint -q /etc; then
unshare -m sh -c "umount /etc && mkdir -p /etc/extensions && attr -R -r overlay.opaque /etc/extensions || true"
fi

MAX_NEXT_VERSION_ID=5000
if [ "${NEXT_VERSION_ID%%.*}" -ge $MAX_NEXT_VERSION_ID && ! -f "/sys/fs/cgroup/cgroup.controllers" ]; then
echo "Flatcar version ${MAX_NEXT_VERSION_ID} or higher does not support cgroupv1 anymore. Aborting the update..."
exit
fi

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

# if there is an explicit setting, don't touch it. Otherwise...
# if there is an explicit setting, don't touch it. Otherwise...
if ! grep -q systemd.unified_cgroup_hierarchy "${OEM_MNT}/grub.cfg" 2>/dev/null; then
cat >>"${OEM_MNT}/grub.cfg" <<EOF
Expand Down

0 comments on commit d13ccd0

Please sign in to comment.