[pve-devel] [RFC PATCH kernel 1/2] buildsys: pass kernel source directory instead to modules

Wolfgang Bumiller w.bumiller at proxmox.com
Fri Apr 8 14:55:39 CEST 2016


---
 Makefile | 22 +++++++++++-----------
 1 file changed, 11 insertions(+), 11 deletions(-)

diff --git a/Makefile b/Makefile
index 12e4a30..1caa2a5 100644
--- a/Makefile
+++ b/Makefile
@@ -180,7 +180,7 @@ data: .compile_mark ixgbe.ko e1000e.ko ${SPL_MODULES} ${ZFS_MODULES} ${DRBD_MODU
 	# strip debug info
 	find tmp/lib/modules -name \*.ko -print | while read f ; do strip --strip-debug "$$f"; done
 	# finalize
-	depmod -b tmp/ ${KVNAME}
+	/sbin/depmod -b tmp/ ${KVNAME}
 	# Autogenerate blacklist for watchdog devices (see README)
 	install -m 0755 -d tmp/lib/modprobe.d
 	ls tmp/lib/modules/${KVNAME}/kernel/drivers/watchdog/ > watchdog-blacklist.tmp
@@ -263,7 +263,7 @@ aacraid.ko: .compile_mark ${AACRAIDSRC}
 	cd ${AACRAIDDIR};tar xf aacraid_source.tgz
 	mkdir -p /lib/modules/${KVNAME}
 	ln -sf ${TOP}/${KERNEL_SRC} /lib/modules/${KVNAME}/build
-	make -C ${TOP}/${KERNEL_SRC} M=${TOP}/${AACRAIDDIR} modules
+	make -C ${TOP}/${KERNEL_SRC} M=${TOP}/${AACRAIDDIR} KSRC=${TOP}/${KERNEL_SRC} modules
 	cp ${AACRAIDDIR}/aacraid.ko .
 
 hpsa.ko hpsa: .compile_mark ${HPSASRC}
@@ -272,7 +272,7 @@ hpsa.ko hpsa: .compile_mark ${HPSASRC}
 #	sed -i ${HPSADIR}/drivers/scsi/hpsa_kernel_compat.h -e 's/^\/\* #define RHEL7.*/#define RHEL7/'
 	mkdir -p /lib/modules/${KVNAME}
 	ln -sf ${TOP}/${KERNEL_SRC} /lib/modules/${KVNAME}/build
-	make -C ${TOP}/${KERNEL_SRC} M=${TOP}/${HPSADIR}/drivers/scsi modules
+	make -C ${TOP}/${KERNEL_SRC} M=${TOP}/${HPSADIR}/drivers/scsi KSRC=${TOP}/${KERNEL_SRC} modules
 	cp ${HPSADIR}/drivers/scsi/hpsa.ko hpsa.ko
 
 e1000e.ko e1000e: .compile_mark ${E1000ESRC}
@@ -280,7 +280,7 @@ e1000e.ko e1000e: .compile_mark ${E1000ESRC}
 	tar xf ${E1000ESRC}
 	mkdir -p /lib/modules/${KVNAME}
 	ln -sf ${TOP}/${KERNEL_SRC} /lib/modules/${KVNAME}/build
-	cd ${E1000EDIR}/src; make BUILD_KERNEL=${KVNAME}
+	cd ${E1000EDIR}/src; make BUILD_KERNEL=${KVNAME} KSRC=${TOP}/${KERNEL_SRC}
 	cp ${E1000EDIR}/src/e1000e.ko e1000e.ko
 
 igb.ko igb: .compile_mark ${IGBSRC}
@@ -288,7 +288,7 @@ igb.ko igb: .compile_mark ${IGBSRC}
 	tar xf ${IGBSRC}
 	mkdir -p /lib/modules/${KVNAME}
 	ln -sf ${TOP}/${KERNEL_SRC} /lib/modules/${KVNAME}/build
-	cd ${IGBDIR}/src; make BUILD_KERNEL=${KVNAME}
+	cd ${IGBDIR}/src; make BUILD_KERNEL=${KVNAME} KSRC=${TOP}/${KERNEL_SRC}
 	cp ${IGBDIR}/src/igb.ko igb.ko
 
 ixgbe.ko ixgbe: .compile_mark ${IXGBESRC}
@@ -296,7 +296,7 @@ ixgbe.ko ixgbe: .compile_mark ${IXGBESRC}
 	tar xf ${IXGBESRC}
 	mkdir -p /lib/modules/${KVNAME}
 	ln -sf ${TOP}/${KERNEL_SRC} /lib/modules/${KVNAME}/build
-	cd ${IXGBEDIR}/src; make CFLAGS_EXTRA="-DIXGBE_NO_LRO" BUILD_KERNEL=${KVNAME}
+	cd ${IXGBEDIR}/src; make CFLAGS_EXTRA="-DIXGBE_NO_LRO" BUILD_KERNEL=${KVNAME} KSRC=${TOP}/${KERNEL_SRC}
 	cp ${IXGBEDIR}/src/ixgbe.ko ixgbe.ko
 
 i40e.ko i40e: .compile_mark ${I40ESRC}
@@ -304,7 +304,7 @@ i40e.ko i40e: .compile_mark ${I40ESRC}
 	tar xf ${I40ESRC}
 	mkdir -p /lib/modules/${KVNAME}
 	ln -sf ${TOP}/${KERNEL_SRC} /lib/modules/${KVNAME}/build
-	cd ${I40EDIR}/src; make BUILD_KERNEL=${KVNAME}
+	cd ${I40EDIR}/src; make BUILD_KERNEL=${KVNAME} KSRC=${TOP}/${KERNEL_SRC}
 	cp ${I40EDIR}/src/i40e.ko i40e.ko
 
 bnx2.ko cnic.ko bnx2x.ko: ${BNX2SRC}
@@ -312,8 +312,8 @@ bnx2.ko cnic.ko bnx2x.ko: ${BNX2SRC}
 	tar xf ${BNX2SRC}
 	mkdir -p /lib/modules/${KVNAME}
 	ln -sf ${TOP}/${KERNEL_SRC} /lib/modules/${KVNAME}/build
-	cd ${BNX2DIR}; make -C bnx2/src KVER=${KVNAME}
-	cd ${BNX2DIR}; make -C bnx2x/src KVER=${KVNAME}
+	cd ${BNX2DIR}; make -C bnx2/src KVER=${KVNAME} KSRC=${TOP}/${KERNEL_SRC}
+	cd ${BNX2DIR}; make -C bnx2x/src KVER=${KVNAME} KSRC=${TOP}/${KERNEL_SRC}
 	cp `find ${BNX2DIR} -name bnx2.ko -o -name cnic.ko -o -name bnx2x.ko` .
 
 arcmsr.ko: .compile_mark ${ARECASRC}
@@ -321,7 +321,7 @@ arcmsr.ko: .compile_mark ${ARECASRC}
 	mkdir ${ARECADIR}; cd ${ARECADIR}; unzip ../${ARECASRC}
 	mkdir -p /lib/modules/${KVNAME}
 	ln -sf ${TOP}/${KERNEL_SRC} /lib/modules/${KVNAME}/build
-	cd ${ARECADIR}; make -C ${TOP}/${KERNEL_SRC} SUBDIRS=${TOP}/${ARECADIR} modules
+	cd ${ARECADIR}; make -C ${TOP}/${KERNEL_SRC} SUBDIRS=${TOP}/${ARECADIR} KSRC=${TOP}/${KERNEL_SRC} modules
 	cp ${ARECADIR}/arcmsr.ko arcmsr.ko
 
 ${SPL_MODULES}: .compile_mark ${SPLSRC}
@@ -359,7 +359,7 @@ drbd ${DRBD_MODULES}: .compile_mark ${DRBDSRC}
 	tar xzf ${DRBDSRC}
 	mkdir -p /lib/modules/${KVNAME}
 	ln -sf ${TOP}/${KERNEL_SRC} /lib/modules/${KVNAME}/build
-	cd ${DRBDDIR}; make KVER=${KVNAME}
+	cd ${DRBDDIR}; make KVER=${KVNAME} KDIR=${TOP}/${KERNEL_SRC}
 	mv ${DRBDDIR}/drbd/drbd.ko drbd.ko
 	mv ${DRBDDIR}/drbd/drbd_transport_tcp.ko drbd_transport_tcp.ko
 
-- 
2.1.4





More information about the pve-devel mailing list