Skip to content

Commit 46e1984

Browse files
authored
Merge pull request #41 from flatcar/ader1990/cgroupv1-no-upgrade
cgroupv1: abort the update if Flatcar version does not support it
2 parents 541576a + 1ad22ef commit 46e1984

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

flatcar-postinst

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -244,6 +244,14 @@ if mountpoint -q /etc; then
244244
unshare -m sh -c "umount /etc && mkdir -p /etc/extensions && attr -R -r overlay.opaque /etc/extensions || true"
245245
fi
246246

247+
# Systemd version >= 256 does not boot anymore if cgroupv1 is enabled or SYSTEMD_CGROUP_ENABLE_LEGACY_FORCE=1 is set
248+
# See: https://github.com/systemd/systemd/releases/tag/v256-rc3
249+
NO_CGROUPV1_VERSION_ID=4187
250+
if [ ! -f "/sys/fs/cgroup/cgroup.controllers" ]; then
251+
echo "Flatcar version ${NO_CGROUPV1_VERSION_ID} or higher does not support cgroupv1 anymore. Aborting the update..." >&2
252+
exit 1
253+
fi
254+
247255
# Keep old nodes on cgroup v1
248256
if [[ "${BUILD_ID}" != "dev-"* ]]; then
249257
if [ "${VERSION_ID%%.*}" -lt 2956 ]; then

0 commit comments

Comments
 (0)