Sophie

Sophie

distrib > Scientific%20Linux > 5x > x86_64 > by-pkgid > 3160499aacb81f6735941eb4c372d87a > files > 43

kvm-83-164.el5_5.30.src.rpm

From f73d39aca5204fcbca5e582d9e19fcd09d2b5c02 Mon Sep 17 00:00:00 2001
From: Andrea Arcangeli <aarcange@redhat.com>
Date: Tue, 20 Jan 2009 22:26:08 +0100
Subject: [PATCH 42/54] ksm buildsystem

Build ksm along with kvm sharing the same kvm compat code.

Signed-off-by: Izik Eidus <ieidus@redhat.com>
Signed-off-by: Andrea Arcangeli <aarcange@redhat.com>
RH-Upstream-status: pending
---
 Makefile        |    1 +
 kernel/Makefile |   14 ++++++++++++++
 2 files changed, 15 insertions(+), 0 deletions(-)

diff --git a/Makefile b/Makefile
index a7ce0ba..e4f4c47 100644
--- a/Makefile
+++ b/Makefile
@@ -77,6 +77,7 @@ install-rpm:
 	make -C qemu DESTDIR=$(DESTDIR)/ install
 	ln -sf /usr/kvm/bin/qemu-system-x86_64 $(DESTDIR)/$(bin)
 	install -m 755 kvm_stat $(DESTDIR)/$(bindir)/kvm_stat
+	install -m 755 user/ksmctl $(DESTDIR)/$(bindir)/ksmctl
 	cp scripts/kvm $(DESTDIR)/$(initdir)/kvm
 	cp scripts/qemu-ifup $(DESTDIR)/$(confdir)/qemu-ifup
 	install -t $(DESTDIR)/etc/udev/rules.d scripts/*kvm*.rules
diff --git a/kernel/Makefile b/kernel/Makefile
index 6bf474b..34fdf74 100644
--- a/kernel/Makefile
+++ b/kernel/Makefile
@@ -47,6 +47,16 @@ all:: header-link prerequisite
 		-include include/linux/autoconf.h \
 		-include `pwd`/$(ARCH_DIR)/external-module-compat.h $(module_defines)"
 		"$$@"
+ifndef SKIP_KSM
+	cp Module.symvers ksm
+	$(MAKE) -C $(KERNELDIR) M=`pwd`/ksm \
+		LINUXINCLUDE="-I`pwd`/include -Iinclude \
+		$(if $(KERNELSOURCEDIR),-Iinclude2 -I$(KERNELSOURCEDIR)/include) \
+		-Iarch/${ARCH_DIR}/include -I`pwd`/include-compat \
+		-include include/linux/autoconf.h \
+		-include `pwd`/$(ARCH_DIR)/external-module-compat.h $(module_defines)"
+		"$$@"
+endif
 
 sync: header-sync source-sync header-link
 
@@ -103,6 +113,9 @@ include $(MAKEFILE_PRE)
 install:
 	mkdir -p $(DESTDIR)/$(INSTALLDIR)
 	cp $(ARCH_DIR)/*.ko $(DESTDIR)/$(INSTALLDIR)
+ifndef SKIP_KSM
+	cp $(ARCH_DIR)/ksm/*.ko $(DESTDIR)/$(INSTALLDIR)
+endif
 	for i in $(ORIGMODDIR)/drivers/kvm/*.ko \
 		 $(ORIGMODDIR)/arch/$(ARCH_DIR)/kvm/*.ko; do \
 		if [ -f "$$i" ]; then mv "$$i" "$$i.orig"; fi; \
@@ -127,3 +140,4 @@ rpm:	all
 
 clean:
 	$(MAKE) -C $(KERNELDIR) M=`pwd` $@
+	$(MAKE) -C $(KERNELDIR) M=`pwd`/ksm $@
-- 
1.6.1