Permalink
Browse files

Added basic OpenVZ checking in the Makefiles

  • Loading branch information...
1 parent 9a050da commit f71dd61933ec8fe97d322301095fe045d54863ca @codyro codyro committed Aug 23, 2012
Showing with 15 additions and 0 deletions.
  1. +7 −0 Makefile
  2. +8 −0 src/Makefile
View
@@ -9,6 +9,13 @@ ifneq "$(RHEL5_VER)" ""
KERNEL_TREE := $(RHEL5_TREE)
endif
+# Check for OpenVZ (/proc/vz)
+OPENVZ_VER ?= $(shell if [ -e /proc/vz ]; then grep 5.[0-9] /etc/redhat-release; else false; fi)
+ifneq "$(OPENVZ_VER)" ""
+ RHEL5_TREE := /usr/src/redhat/BUILD/ovzkernel-2.6.18/linux-$(shell uname -r).$(shell uname -i)
+ KERNEL_TREE := $(RHEL5_TREE)
+endif
+
all:
$(MAKE) -C src KERNEL_TREE=$(KERNEL_TREE) PWD=$(shell pwd)/src all
View
@@ -16,6 +16,14 @@ ifneq "$(RHEL5_VER)" ""
KERNEL_TREE := $(RHEL5_TREE)
endif
+# Check for OpenVZ (/proc/vz)
+OPENVZ_VER ?= $(shell if [ -e /proc/vz ]; then grep 5.[0-9] /etc/redhat-release; else false; fi)
+ifneq "$(OPENVZ_VER)" ""
+ RHEL5_SPEC := /usr/src/redhat/SPECS/kernel-ovz.spec
+ RHEL5_TREE := /usr/src/redhat/BUILD/ovzkernel-2.6.18/linux-$(shell uname -r).$(shell uname -i)
+ KERNEL_TREE := $(RHEL5_TREE)
+endif
+
obj-m += flashcache.o
flashcache-objs := flashcache_conf.o flashcache_main.o flashcache_subr.o flashcache_ioctl.o flashcache_procfs.o

0 comments on commit f71dd61

Please sign in to comment.