KDIR := @KERNEL@ PWD := @PWD@ ifneq ($(KERNELRELEASE),) ifeq ($(CGROUP),0) $(error Cloud Linux 5 is not supported by this lve-kmod branch) endif LSM_ON := $(shell grep -c "KMOD_LSM 1" $(PWD)/include/lve_kmod_c.h) SYSCTL_ON := $(shell grep -c "FEAT_SYSCTL 1" $(PWD)/include/lve_kmod_c.h) LINKPROT_ON := $(shell grep -c "FEAT_LINK_PROT 1" $(PWD)/include/lve_kmod_c.h) GCOV_PROFILE := y obj-m := kmodlve.o kmodlve-objs := lve_cmd.o lve_mod.o lve_tags.o lve_procfs.o lve_list.o kmodlve-objs += lve_exec.o lve_ns.o kmodlve-objs += lve_resource.o kmodlve-objs += lve_global_params.o kmodlve-objs += lve_task_locker.o kmodlve-objs += lve_lvp.o kmodlve-objs += lve_map.o kmodlve-objs += lve_net.o net/lve_net_traf.o net/lve_net_port.o kmodlve-objs += lve_loadavg.o kmodlve-objs += lve_filemon.o kmodlve-objs += os/kernel_exp.o kmodlve-objs += os/cgroup_lib.o os/cgroup_generic.o kmodlve-objs += os/mm.o kmodlve-objs += os/bsearch.o ifeq ($(LSM_ON), 1) kmodlve-objs += lsm/lsm.o kmodlve-objs += lsm/open.o lsm/perm.o lsm/ptrace.o ifeq ($(LINKPROT_ON),1) kmodlve-objs += lsm/link_protect_new.o lsm/link_protect.o endif kmodlve-objs += lsm/setuid.o kmodlve-objs += lsm/net.o endif ifeq ($(SYSCTL_ON),1) kmodlve-objs += lve_sysctl.o endif kmodlve-objs += lve_hooks.o ifeq ($(OPENVZ),7) kmodlve-objs += os/openvz7.o endif ifeq ($(OPENVZ),0) kmodlve-objs += os/cgroups.o kmodlve-objs += os/linux_callchain.o kmodlve-objs += os/iolimits.o else kmodlve-objs += os/openvz_connect.o kmodlve-objs += os/ubc_lib.o kmodlve-objs += os/openvz_iolimits.o kmodlve-objs += os/openvz_callchain.o endif else default: module @echo "done" endif module: $(MAKE) -C $(KDIR) M=$(PWD) CGROUP=@CGROUP@ OPENVZ=@OPENVZ@ EXTRA_CFLAGS="-Werror -I @COMMON@ -I $(KDIR) -I $(PWD)/include @DEBUG_FL@ @LVE_PER_VE@" modules install: $(MAKE) -C $(KDIR) M=$(PWD) CGROUP=@CGROUP@ OPENVZ=@OPENVZ@ modules_install clean: $(MAKE) -C $(KDIR) M=$(PWD) CGROUP=@CGROUP@ OPENVZ=@OPENVZ@ clean rm -f Module.markers Module.symvers modules.order mod_info.h Makefile load: modprobe -q vzdev || true modprobe -q ext4 insmod ./kmodlve.ko unload: rmmod kmodlve