From 2c7a817dc512d77400f7367818d9febc5d5de51e Mon Sep 17 00:00:00 2001 From: "Yann E. MORIN" Date: Sat, 15 Mar 2025 20:57:04 +0100 Subject: [PATCH] package/cgroupfs-mount: tweak the kernel config When it was introduced in 2016 with commit 0e1547a87cfd (cgroupfs-mount: new package), we did not yet have the infrastructure for package to set kernel config options, which only came 4 years later with commit 0aed4c2dae76 (linux: allow packages to set kernel config options). So at that time, the requirements for cgroupfs-mount were documented in the help for the Kconfig symbol. But now that we do have the infrastructure in place, actually use it to set the required options, and drop the list from the Kconfig entry (that would be duplication, prone to bit-rot with time, and other packages do not document their requirements in Kconfig, they just use the infra to set the options). Signed-off-by: Yann E. MORIN Signed-off-by: Julien Olivain --- package/cgroupfs-mount/Config.in | 12 +----------- package/cgroupfs-mount/cgroupfs-mount.mk | 11 +++++++++++ 2 files changed, 12 insertions(+), 11 deletions(-) diff --git a/package/cgroupfs-mount/Config.in b/package/cgroupfs-mount/Config.in index 0b2e4ba1e7..29a40c93d1 100644 --- a/package/cgroupfs-mount/Config.in +++ b/package/cgroupfs-mount/Config.in @@ -4,16 +4,6 @@ config BR2_PACKAGE_CGROUPFS_MOUNT help cgroupfs mount and umount scripts. - requires a Linux kernel >= 3.0 with the following options - enabled: - - - CONFIG_BLK_CGROUP - - CONFIG_CGROUPS - - CONFIG_CGROUP_CPUACCT - - CONFIG_CGROUP_DEVICE - - CONFIG_CGROUP_FREEZER - - CONFIG_CGROUP_WRITEBACK - - CONFIG_CGROUP_SCHED - - CONFIG_CGROUP_PIDS + Requires a Linux kernel >= 3.0 https://github.com/tianon/cgroupfs-mount diff --git a/package/cgroupfs-mount/cgroupfs-mount.mk b/package/cgroupfs-mount/cgroupfs-mount.mk index 5af87629ea..156d584266 100644 --- a/package/cgroupfs-mount/cgroupfs-mount.mk +++ b/package/cgroupfs-mount/cgroupfs-mount.mk @@ -10,6 +10,17 @@ CGROUPFS_MOUNT_LICENSE = GPL-3.0+ CGROUPFS_MOUNT_LICENSE_FILES = debian/copyright CGROUPFS_MOUNT_CPE_ID_VALID = YES +define CGROUPFS_MOUNT_LINUX_CONFIG_FIXUPS + $(call KCONFIG_ENABLE_OPT,CONFIG_BLK_CGROUP) + $(call KCONFIG_ENABLE_OPT,CONFIG_CGROUPS) + $(call KCONFIG_ENABLE_OPT,CONFIG_CGROUP_CPUACCT) + $(call KCONFIG_ENABLE_OPT,CONFIG_CGROUP_DEVICE) + $(call KCONFIG_ENABLE_OPT,CONFIG_CGROUP_FREEZER) + $(call KCONFIG_ENABLE_OPT,CONFIG_CGROUP_WRITEBACK) + $(call KCONFIG_ENABLE_OPT,CONFIG_CGROUP_SCHED) + $(call KCONFIG_ENABLE_OPT,CONFIG_CGROUP_PIDS) +endef + define CGROUPFS_MOUNT_INSTALL_TARGET_CMDS $(INSTALL) -D -m 0755 $(@D)/cgroupfs-mount $(TARGET_DIR)/usr/bin/cgroupfs-mount $(INSTALL) -D -m 0755 $(@D)/cgroupfs-umount $(TARGET_DIR)/usr/bin/cgroupfs-umount