From 21b31824f55d6ca448eae23f82c7de340e5150aa Mon Sep 17 00:00:00 2001 From: Simon Deziel Date: Wed, 2 Oct 2024 10:19:02 -0400 Subject: [PATCH] bin/custom-kernel: hard fail if swappacount is used on modern kernel Signed-off-by: Simon Deziel --- bin/custom-kernel | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/bin/custom-kernel b/bin/custom-kernel index 2eb04b7f6..33a65bb61 100755 --- a/bin/custom-kernel +++ b/bin/custom-kernel @@ -24,6 +24,12 @@ case "$i" in swapaccount) echo "===> CGroup swap accounting" + if ! uname -r | grep -q ^5\. ; then + # https://github.com/torvalds/linux/commit/b25806dcd3d5248833f7d2544ee29a701735159f#diff-e0db206dcb17671bc1db8f4784a96e0014c488a004472b434f919b74e494b2aeR7506 + echo "swapaccounting is always enabled with Linux 6.1+" + exit 1 + fi + # shellcheck disable=SC2016 echo 'GRUB_CMDLINE_LINUX="${GRUB_CMDLINE_LINUX} swapaccount=1"' > /etc/default/grub.d/99-cgroup-swap.cfg ;;