make mcoverlayfs optional (default: enabled)
This commit is contained in:
@@ -1,5 +1,8 @@
|
||||
/* executer/config.h.in. Generated from configure.ac by autoheader. */
|
||||
|
||||
/* whether mcoverlayfs is enabled */
|
||||
#undef ENABLE_MCOVERLAYFS
|
||||
|
||||
/* whether memdump feature is enabled */
|
||||
#undef ENABLE_MEMDUMP
|
||||
|
||||
|
||||
@@ -2,9 +2,14 @@ KDIR ?= @KDIR@
|
||||
ARCH ?= @ARCH@
|
||||
KMODDIR=@KMODDIR@
|
||||
src = @abs_srcdir@
|
||||
ENABLE_MCOVERLAYFS=@ENABLE_MCOVERLAYFS@
|
||||
|
||||
RELEASE=$(shell uname -r)
|
||||
ENABLE_BUILD=$(shell if [[ ${RELEASE} =~ ^4.* ]]; then echo "yes"; fi)
|
||||
RELEASE=$(shell uname -r | cut -d"." -f1)
|
||||
ifeq ($(ENABLE_MCOVERLAYFS),yes)
|
||||
ENABLE_BUILD=$(shell if [ "${RELEASE}" == "4" ]; then echo "yes"; fi)
|
||||
else
|
||||
ENABLE_BUILD=no
|
||||
endif
|
||||
|
||||
obj-m += mcoverlay.o
|
||||
|
||||
|
||||
@@ -1089,6 +1089,7 @@ void init_worker_threads(int fd)
|
||||
pthread_barrier_wait(&init_ready);
|
||||
}
|
||||
|
||||
#ifdef ENABLE_MCOVERLAYFS
|
||||
#if LINUX_VERSION_CODE >= KERNEL_VERSION(4,0,0)
|
||||
#define READ_BUFSIZE 1024
|
||||
static int isunshare(void)
|
||||
@@ -1162,6 +1163,7 @@ static int isunshare(void)
|
||||
return err;
|
||||
}
|
||||
#endif
|
||||
#endif // ENABLE_MCOVERLAYFS
|
||||
|
||||
#define MCK_RLIMIT_AS 0
|
||||
#define MCK_RLIMIT_CORE 1
|
||||
@@ -1349,6 +1351,7 @@ int main(int argc, char **argv)
|
||||
return 1;
|
||||
}
|
||||
|
||||
#ifdef ENABLE_MCOVERLAYFS
|
||||
#if LINUX_VERSION_CODE >= KERNEL_VERSION(4,0,0)
|
||||
__dprintf("mcoverlay enable\n");
|
||||
char mcos_procdir[PATH_MAX];
|
||||
@@ -1397,9 +1400,10 @@ int main(int argc, char **argv)
|
||||
} else if (error == -1) {
|
||||
return 1;
|
||||
}
|
||||
#endif // LINUX_VERSION_CODE >= KERNEL_VERSION(4,0,0)
|
||||
#else
|
||||
__dprintf("mcoverlay disable\n");
|
||||
#endif
|
||||
#endif // ENABLE_MCOVERLAYFS
|
||||
|
||||
if (lookup_exec_path(argv[optind], path, sizeof(path)) != 0) {
|
||||
fprintf(stderr, "error: finding file: %s\n", argv[optind]);
|
||||
|
||||
Reference in New Issue
Block a user