]> git.proxmox.com Git - pve-kernel.git/blob - Makefile
add OVS MTU fix
[pve-kernel.git] / Makefile
1 RELEASE=5.0
2
3 # also update proxmox-ve/changelog if you change KERNEL_VER or KREL
4 KERNEL_VER=4.10.3
5 PKGREL=3
6 # also include firmware of previous version into
7 # the fw package: fwlist-2.6.32-PREV-pve
8 KREL=1
9
10 KERNEL_SRC=ubuntu-zesty
11 KERNEL_SRC_SUBMODULE=submodules/ubuntu-zesty
12
13 EXTRAVERSION=-${KREL}-pve
14 KVNAME=${KERNEL_VER}${EXTRAVERSION}
15 PACKAGE=pve-kernel-${KVNAME}
16 HDRPACKAGE=pve-headers-${KVNAME}
17
18 ARCH=amd64
19 GITVERSION:=$(shell cat .git/refs/heads/master)
20 CHANGELOG_DATE:=$(shell dpkg-parsechangelog -SDate -lchangelog.Debian)
21
22 SKIPABI=0
23
24 TOP=$(shell pwd)
25
26 KERNEL_CFG_ORG=config-${KERNEL_VER}.org
27
28 E1000EDIR=e1000e-3.3.5.3
29 E1000ESRC=${E1000EDIR}.tar.gz
30
31 IGBDIR=igb-5.3.5.4
32 IGBSRC=${IGBDIR}.tar.gz
33
34 IXGBEDIR=ixgbe-5.0.4
35 IXGBESRC=${IXGBEDIR}.tar.gz
36
37 # does not compile with kernel 3.19.8
38 #I40EDIR=i40e-1.2.38
39 #I40ESRC=${I40EDIR}.tar.gz
40
41 # looks up to date with kernel 3.19.8
42 #BNX2DIR=netxtreme2-7.11.05
43 #BNX2SRC=${BNX2DIR}.tar.gz
44
45 # does not compile with kernel 3.19.8
46 #AACRAIDVER=1.2.1-40700
47 #AACRAIDDIR=aacraid-${AACRAIDVER}.src
48 #AACRAIDSRC=aacraid-linux-src-${AACRAIDVER}.tgz
49
50 # does not compile with kernel 3.19.8
51 HPSAVER=3.4.8
52 HPSADIR=hpsa-${HPSAVER}
53 HPSASRC=${HPSADIR}-140.tar.bz2
54
55 # driver does not compile
56 #MEGARAID_DIR=megaraid_sas-06.703.11.00
57 #MEGARAID_SRC=${MEGARAID_DIR}-src.tar.gz
58
59 #ARECADIR=arcmsr-1.30.0X.19-140509
60 #ARECASRC=${ARECADIR}.zip
61
62 # this one does not compile with newer 3.10 kernels!
63 #RR272XSRC=RR272x_1x-Linux-Src-v1.5-130325-0732.tar.gz
64 #RR272XDIR=rr272x_1x-linux-src-v1.5
65
66 SPLDIR=pkg-spl
67 SPLSRC=submodules/zfs/pkg-spl.tar.gz
68 ZFSDIR=pkg-zfs
69 ZFSSRC=submodules/zfs/pkg-zfs.tar.gz
70 ZFS_MODULES=zfs.ko zavl.ko znvpair.ko zunicode.ko zcommon.ko zpios.ko
71 SPL_MODULES=spl.ko splat.ko
72
73 # DRBD9
74 #DRBDVER=9.0.6-1
75 #DRBDDIR=drbd-${DRBDVER}
76 #DRBDSRC=${DRBDDIR}.tar.gz
77 #DRBD_MODULES=drbd.ko drbd_transport_tcp.ko
78
79 DST_DEB=${PACKAGE}_${KERNEL_VER}-${PKGREL}_${ARCH}.deb
80 HDR_DEB=${HDRPACKAGE}_${KERNEL_VER}-${PKGREL}_${ARCH}.deb
81 PVEPKG=proxmox-ve
82 PVE_DEB=${PVEPKG}_${RELEASE}-${PKGREL}_all.deb
83 VIRTUALHDRPACKAGE=pve-headers
84 VIRTUAL_HDR_DEB=${VIRTUALHDRPACKAGE}_${RELEASE}-${PKGREL}_all.deb
85
86 LINUX_TOOLS_PKG=linux-tools-4.10
87 LINUX_TOOLS_DEB=${LINUX_TOOLS_PKG}_${KERNEL_VER}-${PKGREL}_amd64.deb
88
89 DEBS=${DST_DEB} ${HDR_DEB} ${PVE_DEB} ${VIRTUAL_HDR_DEB} ${LINUX_TOOLS_DEB}
90
91 all: check_gcc ${DEBS}
92
93 ${PVE_DEB} pve: proxmox-ve/control proxmox-ve/postinst ${PVE_RELEASE_KEYS}
94 rm -rf proxmox-ve/data
95 mkdir -p proxmox-ve/data/DEBIAN
96 mkdir -p proxmox-ve/data/usr/share/doc/${PVEPKG}/
97 mkdir -p proxmox-ve/data/etc/apt/trusted.gpg.d
98 install -m 0644 proxmox-ve/proxmox-release-4.x.pubkey proxmox-ve/data/etc/apt/trusted.gpg.d/proxmox-ve-release-4.x.gpg
99 install -m 0644 proxmox-ve/proxmox-release-5.x.pubkey proxmox-ve/data/etc/apt/trusted.gpg.d/proxmox-ve-release-5.x.gpg
100 sed -e 's/@KVNAME@/${KVNAME}/' -e 's/@KERNEL_VER@/${KERNEL_VER}/' -e 's/@RELEASE@/${RELEASE}/' -e 's/@PKGREL@/${PKGREL}/' <proxmox-ve/control >proxmox-ve/data/DEBIAN/control
101 sed -e 's/@KVNAME@/${KVNAME}/' <proxmox-ve/postinst >proxmox-ve/data/DEBIAN/postinst
102 chmod 0755 proxmox-ve/data/DEBIAN/postinst
103 install -m 0755 proxmox-ve/postrm proxmox-ve/data/DEBIAN/postrm
104 echo "git clone git://git.proxmox.com/git/pve-kernel.git\\ngit checkout ${GITVERSION}" > proxmox-ve/data/usr/share/doc/${PVEPKG}/SOURCE
105 install -m 0644 proxmox-ve/copyright proxmox-ve/data/usr/share/doc/${PVEPKG}
106 install -m 0644 proxmox-ve/changelog.Debian proxmox-ve/data/usr/share/doc/${PVEPKG}
107 gzip -n --best proxmox-ve/data/usr/share/doc/${PVEPKG}/changelog.Debian
108 dpkg-deb --build proxmox-ve/data ${PVE_DEB}
109
110 ${VIRTUAL_HDR_DEB} pve-headers: proxmox-ve/pve-headers.control
111 rm -rf proxmox-ve/data
112 mkdir -p proxmox-ve/data/DEBIAN
113 mkdir -p proxmox-ve/data/usr/share/doc/${VIRTUALHDRPACKAGE}/
114 sed -e 's/@KVNAME@/${KVNAME}/' -e 's/@KERNEL_VER@/${KERNEL_VER}/' -e 's/@RELEASE@/${RELEASE}/' -e 's/@PKGREL@/${PKGREL}/' <proxmox-ve/pve-headers.control >proxmox-ve/data/DEBIAN/control
115 echo "git clone git://git.proxmox.com/git/pve-kernel-4.0.git\\ngit checkout ${GITVERSION}" > proxmox-ve/data/usr/share/doc/${VIRTUALHDRPACKAGE}/SOURCE
116 install -m 0644 proxmox-ve/copyright proxmox-ve/data/usr/share/doc/${VIRTUALHDRPACKAGE}
117 install -m 0644 proxmox-ve/changelog.Debian proxmox-ve/data/usr/share/doc/${VIRTUALHDRPACKAGE}
118 gzip -n --best proxmox-ve/data/usr/share/doc/${VIRTUALHDRPACKAGE}/changelog.Debian
119 dpkg-deb --build proxmox-ve/data ${VIRTUAL_HDR_DEB}
120
121 check_gcc:
122 ifeq ($(CC), cc)
123 gcc --version|grep "6\.3" || false
124 else
125 $(CC) --version|grep "6\.3" || false
126 endif
127
128 ${DST_DEB}: data control.in prerm.in postinst.in postrm.in copyright changelog.Debian fwcheck abicheck
129 mkdir -p data/DEBIAN
130 sed -e 's/@KERNEL_VER@/${KERNEL_VER}/' -e 's/@KVNAME@/${KVNAME}/' -e 's/@PKGREL@/${PKGREL}/' <control.in >data/DEBIAN/control
131 sed -e 's/@@KVNAME@@/${KVNAME}/g' <prerm.in >data/DEBIAN/prerm
132 chmod 0755 data/DEBIAN/prerm
133 sed -e 's/@@KVNAME@@/${KVNAME}/g' <postinst.in >data/DEBIAN/postinst
134 chmod 0755 data/DEBIAN/postinst
135 sed -e 's/@@KVNAME@@/${KVNAME}/g' <postrm.in >data/DEBIAN/postrm
136 chmod 0755 data/DEBIAN/postrm
137 install -D -m 644 copyright data/usr/share/doc/${PACKAGE}/copyright
138 install -D -m 644 changelog.Debian data/usr/share/doc/${PACKAGE}/changelog.Debian
139 echo "git clone git://git.proxmox.com/git/pve-kernel.git\\ngit checkout ${GITVERSION}" > data/usr/share/doc/${PACKAGE}/SOURCE
140 gzip -n -f --best data/usr/share/doc/${PACKAGE}/changelog.Debian
141 rm -f data/lib/modules/${KVNAME}/source
142 rm -f data/lib/modules/${KVNAME}/build
143 dpkg-deb --build data ${DST_DEB}
144 lintian ${DST_DEB}
145
146 LINUX_TOOLS_DH_LIST=strip installchangelogs installdocs compress shlibdeps gencontrol md5sums builddeb
147
148 ${LINUX_TOOLS_DEB}: .compile_mark control.tools changelog.Debian copyright
149 rm -rf linux-tools ${LINUX_TOOLS_DEB}
150 mkdir -p linux-tools/debian
151 cp control.tools linux-tools/debian/control
152 echo 9 > linux-tools/debian/compat
153 cp changelog.Debian linux-tools/debian/changelog
154 cp copyright linux-tools/debian
155 mkdir -p linux-tools/debian/linux-tools-4.10/usr/bin
156 install -m 0755 ${KERNEL_SRC}/tools/perf/perf linux-tools/debian/linux-tools-4.10/usr/bin/perf_4.10
157 cd linux-tools; for i in ${LINUX_TOOLS_DH_LIST}; do dh_$$i; done
158 lintian ${LINUX_TOOLS_DEB}
159
160 fwlist-${KVNAME}: data
161 ./find-firmware.pl data/lib/modules/${KVNAME} >fwlist.tmp
162 mv fwlist.tmp $@
163
164 fwcheck: fwlist-${KVNAME} fwlist-previous
165 echo "checking fwlist for changes since last built firmware package.."
166 echo "if this check fails, add fwlist-${KVNAME} to the pve-firmware repository and upload a new firmware package together with the ${KVNAME} kernel"
167 bash -c "diff -up -N <(sort fwlist-previous | uniq) <(sort fwlist-${KVNAME} | uniq) > fwlist.diff"
168 rm fwlist.diff
169
170 abi-${KVNAME}: .compile_mark
171 sed -e 's/^\(.\+\)[[:space:]]\+\(.\+\)[[:space:]]\(.\+\)$$/\3 \2 \1/' ${KERNEL_SRC}/Module.symvers | sort > abi-${KVNAME}
172
173 abicheck: abi-${KVNAME} abi-current abi-blacklist
174 ./abi-check abi-${KVNAME} abi-current ${SKIPABI}
175
176 data: .compile_mark igb.ko ixgbe.ko e1000e.ko ${SPL_MODULES} ${ZFS_MODULES}
177 rm -rf data tmp; mkdir -p tmp/lib/modules/${KVNAME}
178 mkdir tmp/boot
179 install -m 644 ${KERNEL_SRC}/.config tmp/boot/config-${KVNAME}
180 install -m 644 ${KERNEL_SRC}/System.map tmp/boot/System.map-${KVNAME}
181 install -m 644 ${KERNEL_SRC}/arch/x86_64/boot/bzImage tmp/boot/vmlinuz-${KVNAME}
182 cd ${KERNEL_SRC}; make INSTALL_MOD_PATH=../tmp/ modules_install
183 ## install latest ibg driver
184 install -m 644 igb.ko tmp/lib/modules/${KVNAME}/kernel/drivers/net/ethernet/intel/igb/
185 # install latest ixgbe driver
186 install -m 644 ixgbe.ko tmp/lib/modules/${KVNAME}/kernel/drivers/net/ethernet/intel/ixgbe/
187 # install latest e1000e driver
188 install -m 644 e1000e.ko tmp/lib/modules/${KVNAME}/kernel/drivers/net/ethernet/intel/e1000e/
189 ## install hpsa driver
190 #install -m 644 hpsa.ko tmp/lib/modules/${KVNAME}/kernel/drivers/scsi/
191 # install zfs drivers
192 install -d -m 0755 tmp/lib/modules/${KVNAME}/zfs
193 install -m 644 ${SPL_MODULES} ${ZFS_MODULES} tmp/lib/modules/${KVNAME}/zfs
194 # install drbd9
195 #install -m 644 ${DRBD_MODULES} tmp/lib/modules/${KVNAME}/kernel/drivers/block/drbd
196 # remove firmware
197 rm -rf tmp/lib/firmware
198 # strip debug info
199 find tmp/lib/modules -name \*.ko -print | while read f ; do strip --strip-debug "$$f"; done
200 # finalize
201 /sbin/depmod -b tmp/ ${KVNAME}
202 # Autogenerate blacklist for watchdog devices (see README)
203 install -m 0755 -d tmp/lib/modprobe.d
204 ls tmp/lib/modules/${KVNAME}/kernel/drivers/watchdog/ > watchdog-blacklist.tmp
205 echo ipmi_watchdog.ko >> watchdog-blacklist.tmp
206 cat watchdog-blacklist.tmp|sed -e 's/^/blacklist /' -e 's/.ko$$//'|sort -u > tmp/lib/modprobe.d/blacklist_${PACKAGE}.conf
207 mv tmp data
208
209 PVE_CONFIG_OPTS= \
210 -m INTEL_MEI_WDT \
211 -d CONFIG_SND_PCM_OSS \
212 -e CONFIG_TRANSPARENT_HUGEPAGE_MADVISE \
213 -d CONFIG_TRANSPARENT_HUGEPAGE_ALWAYS \
214 -m CONFIG_CEPH_FS \
215 -m CONFIG_BLK_DEV_NBD \
216 -m CONFIG_BLK_DEV_RBD \
217 -m CONFIG_BCACHE \
218 -m CONFIG_JFS_FS \
219 -m CONFIG_HFS_FS \
220 -m CONFIG_HFSPLUS_FS \
221 -e CONFIG_BRIDGE \
222 -e CONFIG_BRIDGE_NETFILTER \
223 -e CONFIG_BLK_DEV_SD \
224 -e CONFIG_BLK_DEV_SR \
225 -e CONFIG_BLK_DEV_DM \
226 -e CONFIG_BLK_DEV_NVME \
227 -d CONFIG_INPUT_EVBUG \
228 -d CONFIG_CPU_FREQ_DEFAULT_GOV_ONDEMAND \
229 -e CONFIG_CPU_FREQ_DEFAULT_GOV_PERFORMANCE \
230 -d CONFIG_MODULE_SIG \
231 -d CONFIG_MEMCG_DISABLED \
232 -e CONFIG_MEMCG_SWAP_ENABLED \
233 -e CONFIG_MEMCG_KMEM \
234 -d CONFIG_DEFAULT_CFQ \
235 --set-str CONFIG_DEFAULT_IOSCHED deadline \
236 -e CONFIG_MODVERSIONS \
237 -d CONFIG_DEFAULT_SECURITY_DAC \
238 -e CONFIG_DEFAULT_SECURITY_APPARMOR \
239 --set-str CONFIG_DEFAULT_SECURITY apparmor
240
241 .compile_mark: ${KERNEL_SRC}/README ${KERNEL_CFG_ORG}
242 cp ${KERNEL_CFG_ORG} ${KERNEL_SRC}/.config
243 cd ${KERNEL_SRC}; ./scripts/config ${PVE_CONFIG_OPTS}
244 cd ${KERNEL_SRC}; make oldconfig
245 cd ${KERNEL_SRC}; make KBUILD_BUILD_VERSION_TIMESTAMP="PVE ${KERNEL_VER}-${PKGREL} ($(CHANGELOG_DATE))" -j 8
246 make -C ${KERNEL_SRC}/tools/perf prefix=/usr HAVE_CPLUS_DEMANGLE=1 NO_LIBPYTHON=1 NO_LIBPERL=1 NO_LIBCRYPTO=1 PYTHON=python2.7
247 make -C ${KERNEL_SRC}/tools/perf man
248 touch $@
249
250 ${KERNEL_SRC}/README ${KERNEL_CFG_ORG}: ${KERNEL_SRC_SUBMODULE} | submodules
251 rm -rf ${KERNEL_SRC}
252 cp -a ${KERNEL_SRC_SUBMODULE} ${KERNEL_SRC}
253 cat ${KERNEL_SRC}/debian.master/config/config.common.ubuntu ${KERNEL_SRC}/debian.master/config/amd64/config.common.amd64 ${KERNEL_SRC}/debian.master/config/amd64/config.flavour.generic > ${KERNEL_CFG_ORG}
254 cd ${KERNEL_SRC}; patch -p1 < ../uname-version-timestamp.patch
255 cd ${KERNEL_SRC}; patch -p1 <../bridge-patch.diff
256 #cd ${KERNEL_SRC}; patch -p1 <../bridge-forward-ipv6-neighbor-solicitation.patch
257 #cd ${KERNEL_SRC}; patch -p1 <../add-empty-ndo_poll_controller-to-veth.patch
258 cd ${KERNEL_SRC}; patch -p1 <../override_for_missing_acs_capabilities.patch
259 #cd ${KERNEL_SRC}; patch -p1 <../vhost-net-extend-device-allocation-to-vmalloc.patch
260 cd ${KERNEL_SRC}; patch -p1 < ../kvm-dynamic-halt-polling-disable-default.patch
261 cd ${KERNEL_SRC}; patch -p1 < ../cgroup-cpuset-add-cpuset.remap_cpus.patch
262 cd ${KERNEL_SRC}; patch -p1 < ../CVE-2017-2596-kvm-page-reference-leakage-in-handle_vmon.patch
263 cd ${KERNEL_SRC}; patch -p1 < ../openvswitch-Set-internal-device-max-mtu-to-ETH_MAX_M.patch
264 sed -i ${KERNEL_SRC}/Makefile -e 's/^EXTRAVERSION.*$$/EXTRAVERSION=${EXTRAVERSION}/'
265 touch $@
266
267 aacraid.ko: .compile_mark ${AACRAIDSRC}
268 rm -rf ${AACRAIDDIR}
269 mkdir ${AACRAIDDIR}
270 cd ${AACRAIDDIR};tar xzf ../${AACRAIDSRC}
271 cd ${AACRAIDDIR};rpm2cpio aacraid-${AACRAIDVER}.src.rpm|cpio -i
272 cd ${AACRAIDDIR};tar xf aacraid_source.tgz
273 [ ! -e /lib/modules/${KVNAME}/build ] || rm /lib/modules/${KVNAME}/build
274 make -C ${TOP}/${KERNEL_SRC} M=${TOP}/${AACRAIDDIR} KSRC=${TOP}/${KERNEL_SRC} modules
275 cp ${AACRAIDDIR}/aacraid.ko .
276
277 hpsa.ko hpsa: .compile_mark ${HPSASRC}
278 rm -rf ${HPSADIR}
279 tar xf ${HPSASRC}
280 # sed -i ${HPSADIR}/drivers/scsi/hpsa_kernel_compat.h -e 's/^\/\* #define RHEL7.*/#define RHEL7/'
281 [ ! -e /lib/modules/${KVNAME}/build ] || rm /lib/modules/${KVNAME}/build
282 make -C ${TOP}/${KERNEL_SRC} M=${TOP}/${HPSADIR}/drivers/scsi KSRC=${TOP}/${KERNEL_SRC} modules
283 cp ${HPSADIR}/drivers/scsi/hpsa.ko hpsa.ko
284
285 e1000e.ko e1000e: .compile_mark ${E1000ESRC}
286 rm -rf ${E1000EDIR}
287 tar xf ${E1000ESRC}
288 [ ! -e /lib/modules/${KVNAME}/build ] || rm /lib/modules/${KVNAME}/build
289 cd ${E1000EDIR}; patch -p1 < ../intel-module-gcc6-compat.patch
290 cd ${E1000EDIR}; patch -p1 < ../e1000e_4.10_compat.patch
291 cd ${E1000EDIR}/src; make BUILD_KERNEL=${KVNAME} KSRC=${TOP}/${KERNEL_SRC}
292 cp ${E1000EDIR}/src/e1000e.ko e1000e.ko
293
294 igb.ko igb: .compile_mark ${IGBSRC}
295 rm -rf ${IGBDIR}
296 tar xf ${IGBSRC}
297 [ ! -e /lib/modules/${KVNAME}/build ] || rm /lib/modules/${KVNAME}/build
298 cd ${IGBDIR}; patch -p1 < ../intel-module-gcc6-compat.patch
299 cd ${IGBDIR}; patch -p1 < ../igb_4.9_compat.patch
300 cd ${IGBDIR}; patch -p1 < ../igb_4.10_compat.patch
301 cd ${IGBDIR}/src; make BUILD_KERNEL=${KVNAME} KSRC=${TOP}/${KERNEL_SRC}
302 cp ${IGBDIR}/src/igb.ko igb.ko
303
304 ixgbe.ko ixgbe: .compile_mark ${IXGBESRC}
305 rm -rf ${IXGBEDIR}
306 tar xf ${IXGBESRC}
307 [ ! -e /lib/modules/${KVNAME}/build ] || rm /lib/modules/${KVNAME}/build
308 cd ${IXGBEDIR}; patch -p1 < ../ixgbe_4.10_compat.patch
309 cd ${IXGBEDIR}/src; make CFLAGS_EXTRA="-DIXGBE_NO_LRO" BUILD_KERNEL=${KVNAME} KSRC=${TOP}/${KERNEL_SRC}
310 cp ${IXGBEDIR}/src/ixgbe.ko ixgbe.ko
311
312 i40e.ko i40e: .compile_mark ${I40ESRC}
313 rm -rf ${I40EDIR}
314 tar xf ${I40ESRC}
315 [ ! -e /lib/modules/${KVNAME}/build ] || rm /lib/modules/${KVNAME}/build
316 cd ${I40EDIR}/src; make BUILD_KERNEL=${KVNAME} KSRC=${TOP}/${KERNEL_SRC}
317 cp ${I40EDIR}/src/i40e.ko i40e.ko
318
319 bnx2.ko cnic.ko bnx2x.ko: ${BNX2SRC}
320 rm -rf ${BNX2DIR}
321 tar xf ${BNX2SRC}
322 [ ! -e /lib/modules/${KVNAME}/build ] || rm /lib/modules/${KVNAME}/build
323 cd ${BNX2DIR}; make -C bnx2/src KVER=${KVNAME} KSRC=${TOP}/${KERNEL_SRC}
324 cd ${BNX2DIR}; make -C bnx2x/src KVER=${KVNAME} KSRC=${TOP}/${KERNEL_SRC}
325 cp `find ${BNX2DIR} -name bnx2.ko -o -name cnic.ko -o -name bnx2x.ko` .
326
327 arcmsr.ko: .compile_mark ${ARECASRC}
328 rm -rf ${ARECADIR}
329 mkdir ${ARECADIR}; cd ${ARECADIR}; unzip ../${ARECASRC}
330 [ ! -e /lib/modules/${KVNAME}/build ] || rm /lib/modules/${KVNAME}/build
331 cd ${ARECADIR}; make -C ${TOP}/${KERNEL_SRC} SUBDIRS=${TOP}/${ARECADIR} KSRC=${TOP}/${KERNEL_SRC} modules
332 cp ${ARECADIR}/arcmsr.ko arcmsr.ko
333
334 ${SPL_MODULES}: .compile_mark ${SPLSRC}
335 rm -rf ${SPLDIR}
336 tar xf ${SPLSRC}
337 cd ${SPLDIR}; ./autogen.sh
338 cd ${SPLDIR}; ./configure --with-config=kernel --with-linux=${TOP}/${KERNEL_SRC} --with-linux-obj=${TOP}/${KERNEL_SRC}
339 cd ${SPLDIR}; make
340 cp ${SPLDIR}/module/spl/spl.ko spl.ko
341 cp ${SPLDIR}/module/splat/splat.ko splat.ko
342
343 ${ZFS_MODULES}: .compile_mark ${ZFSSRC}
344 rm -rf ${ZFSDIR}
345 tar xf ${ZFSSRC}
346 cd ${ZFSDIR}; ./autogen.sh
347 cd ${ZFSDIR}; ./configure --with-spl=${TOP}/${SPLDIR} --with-spl-obj=${TOP}/${SPLDIR} --with-config=kernel --with-linux=${TOP}/${KERNEL_SRC} --with-linux-obj=${TOP}/${KERNEL_SRC}
348 cd ${ZFSDIR}; make
349 cp ${ZFSDIR}/module/zfs/zfs.ko zfs.ko
350 cp ${ZFSDIR}/module/avl/zavl.ko zavl.ko
351 cp ${ZFSDIR}/module/nvpair/znvpair.ko znvpair.ko
352 cp ${ZFSDIR}/module/unicode/zunicode.ko zunicode.ko
353 cp ${ZFSDIR}/module/zcommon/zcommon.ko zcommon.ko
354 cp ${ZFSDIR}/module/zpios/zpios.ko zpios.ko
355
356 #.PHONY: update-drbd
357 #update-drbd:
358 # rm -rf ${DRBDDIR} ${DRBDSRC} drbd-9.0
359 # git clone --recursive git://git.drbd.org/drbd-9.0
360 # cd drbd-9.0; make tarball
361 # mv drbd-9.0/${DRBDSRC} ${DRBDSRC}
362 #
363 #.PHONY: drbd
364 #drbd ${DRBD_MODULES}: .compile_mark ${DRBDSRC}
365 # rm -rf ${DRBDDIR}
366 # tar xzf ${DRBDSRC}
367 # [ ! -e /lib/modules/${KVNAME}/build ] || rm /lib/modules/${KVNAME}/build
368 # cd ${DRBDDIR}; make KVER=${KVNAME} KDIR=${TOP}/${KERNEL_SRC}
369 # mv ${DRBDDIR}/drbd/drbd.ko drbd.ko
370 # mv ${DRBDDIR}/drbd/drbd_transport_tcp.ko drbd_transport_tcp.ko
371
372 #iscsi_trgt.ko: .compile_mark ${ISCSITARGETSRC}
373 # rm -rf ${ISCSITARGETDIR}
374 # tar xf ${ISCSITARGETSRC}
375 # cd ${ISCSITARGETDIR}; make KSRC=${TOP}/${KERNEL_SRC}
376 # cp ${ISCSITARGETDIR}/kernel/iscsi_trgt.ko iscsi_trgt.ko
377
378 headers_tmp := $(CURDIR)/tmp-headers
379 headers_dir := $(headers_tmp)/usr/src/linux-headers-${KVNAME}
380
381 ${HDR_DEB} hdr: .compile_mark headers-control.in headers-postinst.in
382 rm -rf $(headers_tmp)
383 install -d $(headers_tmp)/DEBIAN $(headers_dir)/include/
384 sed -e 's/@KERNEL_VER@/${KERNEL_VER}/' -e 's/@KVNAME@/${KVNAME}/' -e 's/@PKGREL@/${PKGREL}/' <headers-control.in >$(headers_tmp)/DEBIAN/control
385 sed -e 's/@@KVNAME@@/${KVNAME}/g' <headers-postinst.in >$(headers_tmp)/DEBIAN/postinst
386 chmod 0755 $(headers_tmp)/DEBIAN/postinst
387 install -D -m 644 copyright $(headers_tmp)/usr/share/doc/${HDRPACKAGE}/copyright
388 install -D -m 644 changelog.Debian $(headers_tmp)/usr/share/doc/${HDRPACKAGE}/changelog.Debian
389 echo "git clone git://git.proxmox.com/git/pve-kernel.git\\ngit checkout ${GITVERSION}" > $(headers_tmp)/usr/share/doc/${HDRPACKAGE}/SOURCE
390 gzip -n -f --best $(headers_tmp)/usr/share/doc/${HDRPACKAGE}/changelog.Debian
391 install -m 0644 ${KERNEL_SRC}/.config $(headers_dir)
392 install -m 0644 ${KERNEL_SRC}/Module.symvers $(headers_dir)
393 cd ${KERNEL_SRC}; find . -path './debian/*' -prune -o -path './include/*' -prune -o -path './Documentation' -prune \
394 -o -path './scripts' -prune -o -type f \
395 \( -name 'Makefile*' -o -name 'Kconfig*' -o -name 'Kbuild*' -o \
396 -name '*.sh' -o -name '*.pl' \) \
397 -print | cpio -pd --preserve-modification-time $(headers_dir)
398 cd ${KERNEL_SRC}; cp -a include scripts $(headers_dir)
399 cd ${KERNEL_SRC}; (find arch/x86 -name include -type d -print | \
400 xargs -n1 -i: find : -type f) | \
401 cpio -pd --preserve-modification-time $(headers_dir)
402 mkdir -p ${headers_tmp}/lib/modules/${KVNAME}
403 ln -sf /usr/src/linux-headers-${KVNAME} ${headers_tmp}/lib/modules/${KVNAME}/build
404 dpkg-deb --build $(headers_tmp) ${HDR_DEB}
405 #lintian ${HDR_DEB}
406
407 dvb-firmware.git/README:
408 git clone https://github.com/OpenELEC/dvb-firmware.git dvb-firmware.git
409
410 linux-firmware.git/WHENCE:
411 git clone git://git.kernel.org/pub/scm/linux/kernel/git/firmware/linux-firmware.git linux-firmware.git
412
413
414 .PHONY: upload
415 upload: ${DEBS}
416 tar cf - ${DEBS}|ssh repoman@repo.proxmox.com -- upload --product pve --dist stretch --arch ${ARCH}
417
418 .PHONY: distclean
419 distclean: clean
420 rm -rf linux-firmware.git dvb-firmware.git ${KERNEL_SRC}.org
421
422 # upgrade to current master
423 .PHONY: update_modules
424 update_modules: submodules
425 git submodule foreach 'git pull --ff-only origin master'
426
427 # make sure submodules were initialized
428 .PHONY: submodules
429 submodules ${SPLSRC} ${ZFSSRC}:
430 test -f "${KERNEL_SRC_SUBMODULE}/README" || git submodule update --init
431
432
433 .PHONY: clean
434 clean:
435 rm -rf *~ .compile_mark watchdog-blacklist.tmp ${KERNEL_CFG_ORG} ${KERNEL_SRC} ${KERNEL_SRC}.tmp ${KERNEL_CFG_ORG} ${KERNEL_SRC}.org orig tmp data proxmox-ve/data *.deb ${headers_tmp} fwdata fwlist.tmp *.ko abi-${KVNAME} fwlist-${KVNAME} ${ZFSDIR} ${SPLDIR} ${SPL_MODULES} ${ZFS_MODULES} hpsa.ko ${HPSADIR} ${DRBDDIR} drbd-9.0 ${IGBDIR} igb.ko ${IXGBEDIR} ixgbe.ko ${E1000EDIR} e1000e.ko linux-tools ${LINUX_TOOLS_DEB}
436
437
438
439
440