[CRIU] [PATCH 12/12] csripts: .config generator
Pavel Emelyanov
xemul at virtuozzo.com
Mon Apr 24 13:09:36 PDT 2017
Add a script that would create .config file corresponding to
local kernel and tools.
Signed-off-by: Pavel Emelyanov <xemul at virtuozzo.com>
---
scripts/mklocalconfig.sh | 32 ++++++++++++++++++++++++++++++++
1 file changed, 32 insertions(+)
create mode 100755 scripts/mklocalconfig.sh
diff --git a/scripts/mklocalconfig.sh b/scripts/mklocalconfig.sh
new file mode 100755
index 0000000..42d0a98
--- /dev/null
+++ b/scripts/mklocalconfig.sh
@@ -0,0 +1,32 @@
+#!/bin/sh
+
+CRIU="./criu/criu -v0"
+
+echo "NO_MODULES_PRELOAD"
+
+if ${CRIU} check --feature loginuid; then
+ if ${CRIU} check --feature loginuid_r; then
+ echo "KERNEL_LOGINUID 2"
+ else
+ echo "KERNEL_LOGINUID 1"
+ fi
+else
+ echo "KERNEL_LOGINUID 0"
+fi
+
+function config_from_feature() {
+ if ${CRIU} check --feature "${1}"; then
+ echo "${2} true"
+ else
+ echo "${2} false"
+ fi
+}
+
+config_from_feature "tcp_half_closed" "KERNEL_TCP_REPAIR_HC"
+config_from_feature "nsid" "KERNEL_NSID"
+config_from_feature "sk_ns" "KERNEL_SOCK_NETNS"
+echo "KERNEL_LASTCAP $(cat /proc/sys/kernel/cap_last_cap)"
+echo "KERNEL_IPV6 $( [ -e '/proc/sys/net/ipv6' ] && echo 'true' || echo 'false')"
+
+echo "IPTABLES_HAS_XTLOCKS $(iptables -w -L 2>&1 > /dev/null && echo '1' || echo '0')"
+gcc $(dirname ${0})/check_pid.c -o /tmp/ckp && /tmp/ckp && echo 'GLIBC_GETPID_OK'
--
2.5.5
More information about the CRIU
mailing list