mirror of
https://github.com/gentoo-mirror/gentoo.git
synced 2026-11-22 23:07:10 -08:00
app-containers/runc: add kernel config checks
Taken from upstream check-config.sh, https://github.com/opencontainers/runc/blob/main/script/check-config.sh Closes: https://bugs.gentoo.org/958647 Signed-off-by: Brahmajit Das <listout@listout.xyz> Part-of: https://github.com/gentoo/gentoo/pull/42794 Closes: https://github.com/gentoo/gentoo/pull/42794 Signed-off-by: Joonas Niilola <juippis@gentoo.org>
This commit is contained in:
@@ -1,4 +1,4 @@
|
||||
# Copyright 1999-2025 Gentoo Authors
|
||||
# Copyright 1999-2026 Gentoo Authors
|
||||
# Distributed under the terms of the GNU General Public License v2
|
||||
|
||||
EAPI=8
|
||||
@@ -9,8 +9,6 @@ inherit go-module linux-info
|
||||
# https://github.com/opencontainers/runc
|
||||
RUNC_COMMIT=d842d7719497cc3b774fd71620278ac9e17710e0
|
||||
|
||||
CONFIG_CHECK="~USER_NS"
|
||||
|
||||
DESCRIPTION="runc container cli tools"
|
||||
HOMEPAGE="https://github.com/opencontainers/runc/"
|
||||
MY_PV="${PV/_/-}"
|
||||
@@ -38,6 +36,89 @@ BDEPEND="
|
||||
# majority of tests pass
|
||||
RESTRICT+=" test"
|
||||
|
||||
# Please refer:
|
||||
# https://github.com/opencontainers/runc/blob/main/script/check-config.sh
|
||||
pkg_setup() {
|
||||
CONFIG_CHECK="
|
||||
~NAMESPACES
|
||||
~NET_NS
|
||||
~PID_NS
|
||||
~IPC_NS
|
||||
~UTS_NS
|
||||
~CGROUPS
|
||||
~CGROUP_CPUACCT
|
||||
~CGROUP_DEVICE
|
||||
~CGROUP_FREEZER
|
||||
~CGROUP_SCHED
|
||||
~CPUSETS
|
||||
~MEMCG
|
||||
~KEYS
|
||||
~VETH
|
||||
~BRIDGE
|
||||
~BRIDGE_NETFILTER
|
||||
~IP_NF_FILTER
|
||||
~IP_NF_TARGET_MASQUERADE
|
||||
~NETFILTER_XT_MATCH_ADDRTYPE
|
||||
~NETFILTER_XT_MATCH_COMMENT
|
||||
~NETFILTER_XT_MATCH_CONNTRACK
|
||||
~NETFILTER_XT_MATCH_IPVS
|
||||
~IP_NF_NAT
|
||||
~NF_NAT
|
||||
~POSIX_MQUEUE
|
||||
~OVERLAY_FS
|
||||
"
|
||||
|
||||
CONFIG_CHECK+="
|
||||
~USER_NS
|
||||
"
|
||||
|
||||
use seccomp && CONFIG_CHECK+="
|
||||
~SECCOMP
|
||||
~SECCOMP_FILTER
|
||||
"
|
||||
WARNING_SECCOMP="CONFIG_SECCOMP is required as optional feature"
|
||||
|
||||
CONFIG_CHECK+="
|
||||
~CGROUP_PIDS
|
||||
"
|
||||
WARNING_CGROUP_PIDS="CONFIG_CGROUP_PIDS is required as optional feature"
|
||||
|
||||
if kernel_is lt 6 1; then
|
||||
CONFIG_CHECK+="
|
||||
~MEMCG_SWAP
|
||||
"
|
||||
fi
|
||||
|
||||
CONFIG_CHECK+="
|
||||
~BLK_CGROUP
|
||||
~BLK_DEV_THROTTLING
|
||||
~CGROUP_PERF
|
||||
~CGROUP_HUGETLB
|
||||
~NET_CLS_CGROUP
|
||||
~CFS_BANDWIDTH
|
||||
~FAIR_GROUP_SCHED
|
||||
~RT_GROUP_SCHED
|
||||
~IP_NF_TARGET_REDIRECT
|
||||
~IP_VS
|
||||
~IP_VS_NFCT
|
||||
~IP_VS_PROTO_TCP
|
||||
~IP_VS_PROTO_UDP
|
||||
~IP_VS_RR
|
||||
~CHECKPOINT_RESTORE
|
||||
~CGROUP_NET_PRIO
|
||||
"
|
||||
|
||||
use selinux && CONFIG_CHECK+="
|
||||
~SECURITY_SELINUX"
|
||||
|
||||
use apparmor && CONFIG_CHECK+="
|
||||
~SECURITY_APPARMOR"
|
||||
|
||||
if [[ -n ${CONFIG_CHECK} ]]; then
|
||||
linux-info_pkg_setup
|
||||
fi
|
||||
}
|
||||
|
||||
src_compile() {
|
||||
# build up optional flags
|
||||
local options=(
|
||||
|
||||
Reference in New Issue
Block a user