]> git.proxmox.com Git - pve-kernel-jessie.git/blob - Makefile
fix #1276: include package version in uname information
[pve-kernel-jessie.git] / Makefile
1 RELEASE=4.4
2
3 # also update proxmox-ve/changelog if you change KERNEL_VER or KREL
4 KERNEL_VER=4.4.40
5 PKGREL=80
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-xenial
11 KERNELSRCTAR=${KERNEL_SRC}.tgz
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 TOP=$(shell pwd)
23
24 KERNEL_CFG_ORG=config-${KERNEL_VER}.org
25
26 FW_VER=1.1
27 FW_REL=10
28 FW_DEB=pve-firmware_${FW_VER}-${FW_REL}_all.deb
29
30 E1000EDIR=e1000e-3.3.5
31 E1000ESRC=${E1000EDIR}.tar.gz
32
33 IGBDIR=igb-5.3.5.3
34 IGBSRC=${IGBDIR}.tar.gz
35
36 IXGBEDIR=ixgbe-4.4.6
37 IXGBESRC=${IXGBEDIR}.tar.gz
38
39 # does not compile with kernel 3.19.8
40 #I40EDIR=i40e-1.2.38
41 #I40ESRC=${I40EDIR}.tar.gz
42
43 # looks up to date with kernel 3.19.8
44 #BNX2DIR=netxtreme2-7.11.05
45 #BNX2SRC=${BNX2DIR}.tar.gz
46
47 # does not compile with kernel 3.19.8
48 #AACRAIDVER=1.2.1-40700
49 #AACRAIDDIR=aacraid-${AACRAIDVER}.src
50 #AACRAIDSRC=aacraid-linux-src-${AACRAIDVER}.tgz
51
52 # does not compile with kernel 3.19.8
53 HPSAVER=3.4.8
54 HPSADIR=hpsa-${HPSAVER}
55 HPSASRC=${HPSADIR}-140.tar.bz2
56
57 # driver does not compile
58 #MEGARAID_DIR=megaraid_sas-06.703.11.00
59 #MEGARAID_SRC=${MEGARAID_DIR}-src.tar.gz
60
61 #ARECADIR=arcmsr-1.30.0X.19-140509
62 #ARECASRC=${ARECADIR}.zip
63
64 # this one does not compile with newer 3.10 kernels!
65 #RR272XSRC=RR272x_1x-Linux-Src-v1.5-130325-0732.tar.gz
66 #RR272XDIR=rr272x_1x-linux-src-v1.5
67
68 SPLDIR=pkg-spl
69 SPLSRC=pkg-spl.tar.gz
70 ZFSDIR=pkg-zfs
71 ZFSSRC=pkg-zfs.tar.gz
72 ZFS_MODULES=zfs.ko zavl.ko znvpair.ko zunicode.ko zcommon.ko zpios.ko
73 SPL_MODULES=spl.ko splat.ko
74
75 # DRBD9
76 DRBDVER=9.0.5-1
77 DRBDDIR=drbd-${DRBDVER}
78 DRBDSRC=${DRBDDIR}.tar.gz
79 DRBD_MODULES=drbd.ko drbd_transport_tcp.ko
80
81 DST_DEB=${PACKAGE}_${KERNEL_VER}-${PKGREL}_${ARCH}.deb
82 HDR_DEB=${HDRPACKAGE}_${KERNEL_VER}-${PKGREL}_${ARCH}.deb
83 PVEPKG=proxmox-ve
84 PVE_DEB=${PVEPKG}_${RELEASE}-${PKGREL}_all.deb
85 VIRTUALHDRPACKAGE=pve-headers
86 VIRTUAL_HDR_DEB=${VIRTUALHDRPACKAGE}_${RELEASE}-${PKGREL}_all.deb
87
88 LINUX_TOOLS_PKG=linux-tools-4.4
89 LINUX_TOOLS_DEB=${LINUX_TOOLS_PKG}_${KERNEL_VER}-${PKGREL}_amd64.deb
90
91 DEBS=${DST_DEB} ${HDR_DEB} ${FW_DEB} ${PVE_DEB} ${VIRTUAL_HDR_DEB} ${LINUX_TOOLS_DEB}
92
93 PVE_RELEASE_KEYS= \
94 proxmox-ve/proxmox-release-4.x.pubkey \
95 proxmox-ve/proxmox-release-5.x.pubkey
96
97 all: check_gcc ${DEBS}
98
99 ${PVE_DEB} pve: proxmox-ve/control proxmox-ve/postinst ${PVE_RELEASE_KEYS}
100 rm -rf proxmox-ve/data
101 mkdir -p proxmox-ve/data/DEBIAN
102 mkdir -p proxmox-ve/data/usr/share/doc/${PVEPKG}/
103 mkdir -p proxmox-ve/data/etc/apt/trusted.gpg.d
104 gpg2 --no-default-keyring --keyring ./proxmox-ve/data/etc/apt/trusted.gpg.d/proxmox-ve.gpg --import ${PVE_RELEASE_KEYS}
105 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
106 sed -e 's/@KVNAME@/${KVNAME}/' <proxmox-ve/postinst >proxmox-ve/data/DEBIAN/postinst
107 chmod 0755 proxmox-ve/data/DEBIAN/postinst
108 install -m 0755 proxmox-ve/postrm proxmox-ve/data/DEBIAN/postrm
109 echo "git clone git://git.proxmox.com/git/pve-kernel.git\\ngit checkout ${GITVERSION}" > proxmox-ve/data/usr/share/doc/${PVEPKG}/SOURCE
110 install -m 0644 proxmox-ve/copyright proxmox-ve/data/usr/share/doc/${PVEPKG}
111 install -m 0644 proxmox-ve/changelog.Debian proxmox-ve/data/usr/share/doc/${PVEPKG}
112 gzip --best proxmox-ve/data/usr/share/doc/${PVEPKG}/changelog.Debian
113 dpkg-deb --build proxmox-ve/data ${PVE_DEB}
114
115 ${VIRTUAL_HDR_DEB} pve-headers: proxmox-ve/pve-headers.control
116 rm -rf proxmox-ve/data
117 mkdir -p proxmox-ve/data/DEBIAN
118 mkdir -p proxmox-ve/data/usr/share/doc/${VIRTUALHDRPACKAGE}/
119 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
120 echo "git clone git://git.proxmox.com/git/pve-kernel-4.0.git\\ngit checkout ${GITVERSION}" > proxmox-ve/data/usr/share/doc/${VIRTUALHDRPACKAGE}/SOURCE
121 install -m 0644 proxmox-ve/copyright proxmox-ve/data/usr/share/doc/${VIRTUALHDRPACKAGE}
122 install -m 0644 proxmox-ve/changelog.Debian proxmox-ve/data/usr/share/doc/${VIRTUALHDRPACKAGE}
123 gzip --best proxmox-ve/data/usr/share/doc/${VIRTUALHDRPACKAGE}/changelog.Debian
124 dpkg-deb --build proxmox-ve/data ${VIRTUAL_HDR_DEB}
125
126 # see https://wiki.ubuntu.com/Kernel/Dev/KernelGitGuide
127 .PHONY: download
128 download:
129 rm -rf ${KERNEL_SRC} ${KERNELSRCTAR}
130 #git clone git://kernel.ubuntu.com/ubuntu/ubuntu-vivid.git
131 git clone --single-branch -b Ubuntu-4.4.0-62.83 git://kernel.ubuntu.com/ubuntu/ubuntu-xenial.git ${KERNEL_SRC}
132 tar czf ${KERNELSRCTAR} --exclude .git ${KERNEL_SRC}
133
134 check_gcc:
135 ifeq ($(CC), cc)
136 gcc --version|grep "4\.9" || false
137 else
138 $(CC) --version|grep "4\.9" || false
139 endif
140
141 ${DST_DEB}: data control.in prerm.in postinst.in postrm.in copyright changelog.Debian
142 mkdir -p data/DEBIAN
143 sed -e 's/@KERNEL_VER@/${KERNEL_VER}/' -e 's/@KVNAME@/${KVNAME}/' -e 's/@PKGREL@/${PKGREL}/' <control.in >data/DEBIAN/control
144 sed -e 's/@@KVNAME@@/${KVNAME}/g' <prerm.in >data/DEBIAN/prerm
145 chmod 0755 data/DEBIAN/prerm
146 sed -e 's/@@KVNAME@@/${KVNAME}/g' <postinst.in >data/DEBIAN/postinst
147 chmod 0755 data/DEBIAN/postinst
148 sed -e 's/@@KVNAME@@/${KVNAME}/g' <postrm.in >data/DEBIAN/postrm
149 chmod 0755 data/DEBIAN/postrm
150 install -D -m 644 copyright data/usr/share/doc/${PACKAGE}/copyright
151 install -D -m 644 changelog.Debian data/usr/share/doc/${PACKAGE}/changelog.Debian
152 echo "git clone git://git.proxmox.com/git/pve-kernel.git\\ngit checkout ${GITVERSION}" > data/usr/share/doc/${PACKAGE}/SOURCE
153 gzip -f --best data/usr/share/doc/${PACKAGE}/changelog.Debian
154 rm -f data/lib/modules/${KVNAME}/source
155 rm -f data/lib/modules/${KVNAME}/build
156 dpkg-deb --build data ${DST_DEB}
157 lintian ${DST_DEB}
158
159 LINUX_TOOLS_DH_LIST=strip installchangelogs installdocs compress shlibdeps gencontrol md5sums builddeb
160
161 ${LINUX_TOOLS_DEB}: .compile_mark control.tools changelog.Debian copyright
162 rm -rf linux-tools ${LINUX_TOOLS_DEB}
163 mkdir -p linux-tools/debian
164 cp control.tools linux-tools/debian/control
165 echo 9 > linux-tools/debian/compat
166 cp changelog.Debian linux-tools/debian/changelog
167 cp copyright linux-tools/debian
168 mkdir -p linux-tools/debian/linux-tools-4.4/usr/bin
169 install -m 0755 ${KERNEL_SRC}/tools/perf/perf linux-tools/debian/linux-tools-4.4/usr/bin/perf_4.4
170 cd linux-tools; for i in ${LINUX_TOOLS_DH_LIST}; do dh_$$i; done
171 lintian ${LINUX_TOOLS_DEB}
172
173 fwlist-${KVNAME}: data
174 ./find-firmware.pl data/lib/modules/${KVNAME} >fwlist.tmp
175 mv fwlist.tmp $@
176
177 data: .compile_mark igb.ko ixgbe.ko e1000e.ko ${SPL_MODULES} ${ZFS_MODULES} ${DRBD_MODULES}
178 rm -rf data tmp; mkdir -p tmp/lib/modules/${KVNAME}
179 mkdir tmp/boot
180 install -m 644 ${KERNEL_SRC}/.config tmp/boot/config-${KVNAME}
181 install -m 644 ${KERNEL_SRC}/System.map tmp/boot/System.map-${KVNAME}
182 install -m 644 ${KERNEL_SRC}/arch/x86_64/boot/bzImage tmp/boot/vmlinuz-${KVNAME}
183 cd ${KERNEL_SRC}; make INSTALL_MOD_PATH=../tmp/ modules_install
184 ## install latest ibg driver
185 install -m 644 igb.ko tmp/lib/modules/${KVNAME}/kernel/drivers/net/ethernet/intel/igb/
186 # install latest ixgbe driver
187 install -m 644 ixgbe.ko tmp/lib/modules/${KVNAME}/kernel/drivers/net/ethernet/intel/ixgbe/
188 # install latest e1000e driver
189 install -m 644 e1000e.ko tmp/lib/modules/${KVNAME}/kernel/drivers/net/ethernet/intel/e1000e/
190 ## install hpsa driver
191 #install -m 644 hpsa.ko tmp/lib/modules/${KVNAME}/kernel/drivers/scsi/
192 # install zfs drivers
193 install -d -m 0755 tmp/lib/modules/${KVNAME}/zfs
194 install -m 644 ${SPL_MODULES} ${ZFS_MODULES} tmp/lib/modules/${KVNAME}/zfs
195 # install drbd9
196 install -m 644 ${DRBD_MODULES} tmp/lib/modules/${KVNAME}/kernel/drivers/block/drbd
197 # remove firmware
198 rm -rf tmp/lib/firmware
199 # strip debug info
200 find tmp/lib/modules -name \*.ko -print | while read f ; do strip --strip-debug "$$f"; done
201 # finalize
202 /sbin/depmod -b tmp/ ${KVNAME}
203 # Autogenerate blacklist for watchdog devices (see README)
204 install -m 0755 -d tmp/lib/modprobe.d
205 ls tmp/lib/modules/${KVNAME}/kernel/drivers/watchdog/ > watchdog-blacklist.tmp
206 echo ipmi_watchdog.ko >> watchdog-blacklist.tmp
207 cat watchdog-blacklist.tmp|sed -e 's/^/blacklist /' -e 's/.ko$$//'|sort -u > tmp/lib/modprobe.d/blacklist_${PACKAGE}.conf
208 mv tmp data
209
210 PVE_CONFIG_OPTS= \
211 -m INTEL_MEI_WDT \
212 -d CONFIG_SND_PCM_OSS \
213 -e CONFIG_TRANSPARENT_HUGEPAGE_MADVISE \
214 -d CONFIG_TRANSPARENT_HUGEPAGE_ALWAYS \
215 -m CONFIG_CEPH_FS \
216 -m CONFIG_BLK_DEV_NBD \
217 -m CONFIG_BLK_DEV_RBD \
218 -m CONFIG_BCACHE \
219 -m CONFIG_JFS_FS \
220 -m CONFIG_HFS_FS \
221 -m CONFIG_HFSPLUS_FS \
222 -e CONFIG_BRIDGE \
223 -e CONFIG_BRIDGE_NETFILTER \
224 -e CONFIG_BLK_DEV_SD \
225 -e CONFIG_BLK_DEV_SR \
226 -e CONFIG_BLK_DEV_DM \
227 -e CONFIG_BLK_DEV_NVME \
228 -d CONFIG_INPUT_EVBUG \
229 -d CONFIG_CPU_FREQ_DEFAULT_GOV_ONDEMAND \
230 -e CONFIG_CPU_FREQ_DEFAULT_GOV_PERFORMANCE \
231 -d CONFIG_MODULE_SIG \
232 -d CONFIG_MEMCG_DISABLED \
233 -e CONFIG_MEMCG_SWAP_ENABLED \
234 -e CONFIG_MEMCG_KMEM \
235 -d CONFIG_DEFAULT_CFQ \
236 --set-str CONFIG_DEFAULT_IOSCHED deadline \
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}: ${KERNELSRCTAR}
251 rm -rf ${KERNEL_SRC}
252 tar xf ${KERNELSRCTAR}
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 <../bug-950-tcp-fix-tcp_mark_head_lost-to-check-skb-len-before-f.patch
261 cd ${KERNEL_SRC}; patch -p1 < ../981-1-PCI-Reverse-standard-ACS-vs-device-specific-ACS-enabling.patch
262 cd ${KERNEL_SRC}; patch -p1 < ../981-2-PCI-Quirk-PCH-root-port-ACS-for-Sunrise-Point.patch
263 cd ${KERNEL_SRC}; patch -p1 < ../kvm-dynamic-halt-polling-disable-default.patch
264 # avoid iAMT watchdog problems (not a real watchdog, because does not reset the host)
265 cd ${KERNEL_SRC}; patch -p1 < ../watchdog_implement-mei-iamt-driver.patch
266 cd ${KERNEL_SRC}; patch -p1 < ../mei_drop-watchdog-code.patch
267 cd ${KERNEL_SRC}; patch -p1 < ../mei_bus-whitelist-watchdog-client.patch
268 # IPoIB performance regression fix
269 cd ${KERNEL_SRC}; patch -p1 < ../IB-ipoib-move-back-the-IB-LL-address-into-the-hard-header.patch
270 cd ${KERNEL_SRC}; patch -p1 < ../cgroup-cpuset-add-cpuset.remap_cpus.patch
271 cd ${KERNEL_SRC}; patch -p1 < ../0001-Revert-mm-throttle-on-IO-only-when-there-are-too-man.patch
272 cd ${KERNEL_SRC}; patch -p1 < ../0002-Revert-mm-oom-rework-oom-detection.patch
273 cd ${KERNEL_SRC}; patch -p1 < ../CVE-2017-2583-KVM-x86-fix-emulation-of-MOV-SS-null-selector.patch
274 cd ${KERNEL_SRC}; patch -p1 < ../CVE-2017-2596-kvm-page-reference-leakage-in-handle_vmon.patch
275 sed -i ${KERNEL_SRC}/Makefile -e 's/^EXTRAVERSION.*$$/EXTRAVERSION=${EXTRAVERSION}/'
276 touch $@
277
278 aacraid.ko: .compile_mark ${AACRAIDSRC}
279 rm -rf ${AACRAIDDIR}
280 mkdir ${AACRAIDDIR}
281 cd ${AACRAIDDIR};tar xzf ../${AACRAIDSRC}
282 cd ${AACRAIDDIR};rpm2cpio aacraid-${AACRAIDVER}.src.rpm|cpio -i
283 cd ${AACRAIDDIR};tar xf aacraid_source.tgz
284 [ ! -e /lib/modules/${KVNAME}/build ] || rm /lib/modules/${KVNAME}/build
285 make -C ${TOP}/${KERNEL_SRC} M=${TOP}/${AACRAIDDIR} KSRC=${TOP}/${KERNEL_SRC} modules
286 cp ${AACRAIDDIR}/aacraid.ko .
287
288 hpsa.ko hpsa: .compile_mark ${HPSASRC}
289 rm -rf ${HPSADIR}
290 tar xf ${HPSASRC}
291 # sed -i ${HPSADIR}/drivers/scsi/hpsa_kernel_compat.h -e 's/^\/\* #define RHEL7.*/#define RHEL7/'
292 [ ! -e /lib/modules/${KVNAME}/build ] || rm /lib/modules/${KVNAME}/build
293 make -C ${TOP}/${KERNEL_SRC} M=${TOP}/${HPSADIR}/drivers/scsi KSRC=${TOP}/${KERNEL_SRC} modules
294 cp ${HPSADIR}/drivers/scsi/hpsa.ko hpsa.ko
295
296 e1000e.ko e1000e: .compile_mark ${E1000ESRC}
297 rm -rf ${E1000EDIR}
298 tar xf ${E1000ESRC}
299 [ ! -e /lib/modules/${KVNAME}/build ] || rm /lib/modules/${KVNAME}/build
300 # patch used for igb and e1000e!
301 cd ${E1000EDIR}; patch -p1 < ../igb_e1000e-kcompat-version-check-fix.patch
302 cd ${E1000EDIR}/src; make BUILD_KERNEL=${KVNAME} KSRC=${TOP}/${KERNEL_SRC}
303 cp ${E1000EDIR}/src/e1000e.ko e1000e.ko
304
305 igb.ko igb: .compile_mark ${IGBSRC}
306 rm -rf ${IGBDIR}
307 tar xf ${IGBSRC}
308 [ ! -e /lib/modules/${KVNAME}/build ] || rm /lib/modules/${KVNAME}/build
309 # patch used for igb and e1000e!
310 cd ${IGBDIR}; patch -p1 < ../igb_e1000e-kcompat-version-check-fix.patch
311 cd ${IGBDIR}/src; make BUILD_KERNEL=${KVNAME} KSRC=${TOP}/${KERNEL_SRC}
312 cp ${IGBDIR}/src/igb.ko igb.ko
313
314 ixgbe.ko ixgbe: .compile_mark ${IXGBESRC}
315 rm -rf ${IXGBEDIR}
316 tar xf ${IXGBESRC}
317 [ ! -e /lib/modules/${KVNAME}/build ] || rm /lib/modules/${KVNAME}/build
318 # HACK: for kernel < 4.6, we need to set UTS_UBUNTU_RELEASE_ABI manually
319 # to make it compile
320 cd ${IXGBEDIR}/src; make CFLAGS_EXTRA="-DIXGBE_NO_LRO -DUTS_UBUNTU_RELEASE_ABI=22" BUILD_KERNEL=${KVNAME} KSRC=${TOP}/${KERNEL_SRC}
321 cp ${IXGBEDIR}/src/ixgbe.ko ixgbe.ko
322
323 i40e.ko i40e: .compile_mark ${I40ESRC}
324 rm -rf ${I40EDIR}
325 tar xf ${I40ESRC}
326 [ ! -e /lib/modules/${KVNAME}/build ] || rm /lib/modules/${KVNAME}/build
327 cd ${I40EDIR}/src; make BUILD_KERNEL=${KVNAME} KSRC=${TOP}/${KERNEL_SRC}
328 cp ${I40EDIR}/src/i40e.ko i40e.ko
329
330 bnx2.ko cnic.ko bnx2x.ko: ${BNX2SRC}
331 rm -rf ${BNX2DIR}
332 tar xf ${BNX2SRC}
333 [ ! -e /lib/modules/${KVNAME}/build ] || rm /lib/modules/${KVNAME}/build
334 cd ${BNX2DIR}; make -C bnx2/src KVER=${KVNAME} KSRC=${TOP}/${KERNEL_SRC}
335 cd ${BNX2DIR}; make -C bnx2x/src KVER=${KVNAME} KSRC=${TOP}/${KERNEL_SRC}
336 cp `find ${BNX2DIR} -name bnx2.ko -o -name cnic.ko -o -name bnx2x.ko` .
337
338 arcmsr.ko: .compile_mark ${ARECASRC}
339 rm -rf ${ARECADIR}
340 mkdir ${ARECADIR}; cd ${ARECADIR}; unzip ../${ARECASRC}
341 [ ! -e /lib/modules/${KVNAME}/build ] || rm /lib/modules/${KVNAME}/build
342 cd ${ARECADIR}; make -C ${TOP}/${KERNEL_SRC} SUBDIRS=${TOP}/${ARECADIR} KSRC=${TOP}/${KERNEL_SRC} modules
343 cp ${ARECADIR}/arcmsr.ko arcmsr.ko
344
345 ${SPL_MODULES}: .compile_mark ${SPLSRC}
346 rm -rf ${SPLDIR}
347 tar xf ${SPLSRC}
348 cd ${SPLDIR}; ./autogen.sh
349 cd ${SPLDIR}; ./configure --with-config=kernel --with-linux=${TOP}/${KERNEL_SRC} --with-linux-obj=${TOP}/${KERNEL_SRC}
350 cd ${SPLDIR}; make
351 cp ${SPLDIR}/module/spl/spl.ko spl.ko
352 cp ${SPLDIR}/module/splat/splat.ko splat.ko
353
354 ${ZFS_MODULES}: .compile_mark ${ZFSSRC}
355 rm -rf ${ZFSDIR}
356 tar xf ${ZFSSRC}
357 cd ${ZFSDIR}; ./autogen.sh
358 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}
359 cd ${ZFSDIR}; make
360 cp ${ZFSDIR}/module/zfs/zfs.ko zfs.ko
361 cp ${ZFSDIR}/module/avl/zavl.ko zavl.ko
362 cp ${ZFSDIR}/module/nvpair/znvpair.ko znvpair.ko
363 cp ${ZFSDIR}/module/unicode/zunicode.ko zunicode.ko
364 cp ${ZFSDIR}/module/zcommon/zcommon.ko zcommon.ko
365 cp ${ZFSDIR}/module/zpios/zpios.ko zpios.ko
366
367 .PHONY: update-drbd
368 update-drbd:
369 rm -rf ${DRBDDIR} ${DRBDSRC} drbd-9.0
370 git clone --recursive git://git.drbd.org/drbd-9.0
371 cd drbd-9.0; make tarball
372 mv drbd-9.0/${DRBDSRC} ${DRBDSRC}
373
374 .PHONY: drbd
375 drbd ${DRBD_MODULES}: .compile_mark ${DRBDSRC}
376 rm -rf ${DRBDDIR}
377 tar xzf ${DRBDSRC}
378 [ ! -e /lib/modules/${KVNAME}/build ] || rm /lib/modules/${KVNAME}/build
379 cd ${DRBDDIR}; make KVER=${KVNAME} KDIR=${TOP}/${KERNEL_SRC}
380 mv ${DRBDDIR}/drbd/drbd.ko drbd.ko
381 mv ${DRBDDIR}/drbd/drbd_transport_tcp.ko drbd_transport_tcp.ko
382
383 #iscsi_trgt.ko: .compile_mark ${ISCSITARGETSRC}
384 # rm -rf ${ISCSITARGETDIR}
385 # tar xf ${ISCSITARGETSRC}
386 # cd ${ISCSITARGETDIR}; make KSRC=${TOP}/${KERNEL_SRC}
387 # cp ${ISCSITARGETDIR}/kernel/iscsi_trgt.ko iscsi_trgt.ko
388
389 headers_tmp := $(CURDIR)/tmp-headers
390 headers_dir := $(headers_tmp)/usr/src/linux-headers-${KVNAME}
391
392 ${HDR_DEB} hdr: .compile_mark headers-control.in headers-postinst.in
393 rm -rf $(headers_tmp)
394 install -d $(headers_tmp)/DEBIAN $(headers_dir)/include/
395 sed -e 's/@KERNEL_VER@/${KERNEL_VER}/' -e 's/@KVNAME@/${KVNAME}/' -e 's/@PKGREL@/${PKGREL}/' <headers-control.in >$(headers_tmp)/DEBIAN/control
396 sed -e 's/@@KVNAME@@/${KVNAME}/g' <headers-postinst.in >$(headers_tmp)/DEBIAN/postinst
397 chmod 0755 $(headers_tmp)/DEBIAN/postinst
398 install -D -m 644 copyright $(headers_tmp)/usr/share/doc/${HDRPACKAGE}/copyright
399 install -D -m 644 changelog.Debian $(headers_tmp)/usr/share/doc/${HDRPACKAGE}/changelog.Debian
400 echo "git clone git://git.proxmox.com/git/pve-kernel.git\\ngit checkout ${GITVERSION}" > $(headers_tmp)/usr/share/doc/${HDRPACKAGE}/SOURCE
401 gzip -f --best $(headers_tmp)/usr/share/doc/${HDRPACKAGE}/changelog.Debian
402 install -m 0644 ${KERNEL_SRC}/.config $(headers_dir)
403 install -m 0644 ${KERNEL_SRC}/Module.symvers $(headers_dir)
404 cd ${KERNEL_SRC}; find . -path './debian/*' -prune -o -path './include/*' -prune -o -path './Documentation' -prune \
405 -o -path './scripts' -prune -o -type f \
406 \( -name 'Makefile*' -o -name 'Kconfig*' -o -name 'Kbuild*' -o \
407 -name '*.sh' -o -name '*.pl' \) \
408 -print | cpio -pd --preserve-modification-time $(headers_dir)
409 cd ${KERNEL_SRC}; cp -a include scripts $(headers_dir)
410 cd ${KERNEL_SRC}; (find arch/x86 -name include -type d -print | \
411 xargs -n1 -i: find : -type f) | \
412 cpio -pd --preserve-modification-time $(headers_dir)
413 mkdir -p ${headers_tmp}/lib/modules/${KVNAME}
414 ln -sf /usr/src/linux-headers-${KVNAME} ${headers_tmp}/lib/modules/${KVNAME}/build
415 dpkg-deb --build $(headers_tmp) ${HDR_DEB}
416 #lintian ${HDR_DEB}
417
418 dvb-firmware.git/README:
419 git clone https://github.com/OpenELEC/dvb-firmware.git dvb-firmware.git
420
421 linux-firmware.git/WHENCE:
422 git clone git://git.kernel.org/pub/scm/linux/kernel/git/firmware/linux-firmware.git linux-firmware.git
423
424 ${FW_DEB} fw: control.firmware linux-firmware.git/WHENCE dvb-firmware.git/README changelog.firmware fwlist-2.6.18-2-pve fwlist-2.6.24-12-pve fwlist-2.6.32-3-pve fwlist-2.6.32-4-pve fwlist-2.6.32-6-pve fwlist-2.6.32-13-pve fwlist-2.6.32-14-pve fwlist-2.6.32-20-pve fwlist-2.6.32-21-pve fwlist-3.10.0-3-pve fwlist-3.10.0-7-pve fwlist-3.10.0-8-pve fwlist-3.19.8-1-pve fwlist-4.2.8-1-pve fwlist-4.4.13-2-pve fwlist-4.4.16-1-pve fwlist-4.4.21-1-pve fwlist-${KVNAME}
425 rm -rf fwdata
426 mkdir -p fwdata/lib/firmware
427 ./assemble-firmware.pl fwlist-${KVNAME} fwdata/lib/firmware
428 # include any files from older/newer kernels here
429 ./assemble-firmware.pl fwlist-2.6.18-2-pve fwdata/lib/firmware
430 ./assemble-firmware.pl fwlist-2.6.24-12-pve fwdata/lib/firmware
431 ./assemble-firmware.pl fwlist-2.6.32-3-pve fwdata/lib/firmware
432 ./assemble-firmware.pl fwlist-2.6.32-4-pve fwdata/lib/firmware
433 ./assemble-firmware.pl fwlist-2.6.32-6-pve fwdata/lib/firmware
434 ./assemble-firmware.pl fwlist-2.6.32-13-pve fwdata/lib/firmware
435 ./assemble-firmware.pl fwlist-2.6.32-14-pve fwdata/lib/firmware
436 ./assemble-firmware.pl fwlist-2.6.32-20-pve fwdata/lib/firmware
437 ./assemble-firmware.pl fwlist-2.6.32-21-pve fwdata/lib/firmware
438 ./assemble-firmware.pl fwlist-3.10.0-3-pve fwdata/lib/firmware
439 ./assemble-firmware.pl fwlist-3.10.0-7-pve fwdata/lib/firmware
440 ./assemble-firmware.pl fwlist-3.10.0-8-pve fwdata/lib/firmware
441 ./assemble-firmware.pl fwlist-3.19.8-1-pve fwdata/lib/firmware
442 ./assemble-firmware.pl fwlist-4.2.8-1-pve fwdata/lib/firmware
443 ./assemble-firmware.pl fwlist-4.4.13-2-pve fwdata/lib/firmware
444 ./assemble-firmware.pl fwlist-4.4.16-1-pve fwdata/lib/firmware
445 ./assemble-firmware.pl fwlist-4.4.21-1-pve fwdata/lib/firmware
446 install -d fwdata/usr/share/doc/pve-firmware
447 cp linux-firmware.git/WHENCE fwdata/usr/share/doc/pve-firmware/README
448 install -d fwdata/usr/share/doc/pve-firmware/licenses
449 cp linux-firmware.git/LICEN[CS]E* fwdata/usr/share/doc/pve-firmware/licenses
450 install -D -m 0644 changelog.firmware fwdata/usr/share/doc/pve-firmware/changelog.Debian
451 gzip -9 fwdata/usr/share/doc/pve-firmware/changelog.Debian
452 echo "git clone git://git.proxmox.com/git/pve-kernel.git\\ngit checkout ${GITVERSION}" >fwdata/usr/share/doc/pve-firmware/SOURCE
453 install -d fwdata/DEBIAN
454 sed -e 's/@VERSION@/${FW_VER}-${FW_REL}/' <control.firmware >fwdata/DEBIAN/control
455 dpkg-deb --build fwdata ${FW_DEB}
456
457 .PHONY: upload
458 upload: ${DEBS}
459 tar cf - ${DEBS}|ssh repoman@repo.proxmox.com upload
460
461 .PHONY: distclean
462 distclean: clean
463 rm -rf linux-firmware.git dvb-firmware.git ${KERNEL_SRC}.org
464
465 .PHONY: clean
466 clean:
467 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 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}
468
469
470
471
472