]>
Commit | Line | Data |
---|---|---|
ba2f1a67 FG |
1 | RELEASE=5.0 |
2 | ||
3 | # also update proxmox-ve/changelog if you change KERNEL_VER or KREL | |
4 | KERNEL_VER=4.10.1 | |
5 | PKGREL=2 | |
6 | # also include firmware of previous version into | |
7 | # the fw package: fwlist-2.6.32-PREV-pve | |
8 | KREL=2 | |
9 | ||
10 | KERNEL_SRC=ubuntu-zesty | |
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=2.0 | |
27 | FW_REL=1 | |
28 | FW_DEB=pve-firmware_${FW_VER}-${FW_REL}_all.deb | |
29 | ||
30 | E1000EDIR=e1000e-3.3.5.3 | |
31 | E1000ESRC=${E1000EDIR}.tar.gz | |
32 | ||
33 | IGBDIR=igb-5.3.5.4 | |
34 | IGBSRC=${IGBDIR}.tar.gz | |
35 | ||
36 | IXGBEDIR=ixgbe-5.0.4 | |
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.6-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.10 | |
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 | all: check_gcc ${DEBS} | |
94 | ||
95 | ${PVE_DEB} pve: proxmox-ve/control proxmox-ve/postinst ${PVE_RELEASE_KEYS} | |
96 | rm -rf proxmox-ve/data | |
97 | mkdir -p proxmox-ve/data/DEBIAN | |
98 | mkdir -p proxmox-ve/data/usr/share/doc/${PVEPKG}/ | |
99 | mkdir -p proxmox-ve/data/etc/apt/trusted.gpg.d | |
100 | install -m 0644 proxmox-ve/proxmox-release-4.x.pubkey proxmox-ve/data/etc/apt/trusted.gpg.d/proxmox-ve-release-4.x.gpg | |
101 | install -m 0644 proxmox-ve/proxmox-release-5.x.pubkey proxmox-ve/data/etc/apt/trusted.gpg.d/proxmox-ve-release-5.x.gpg | |
102 | 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 | |
103 | sed -e 's/@KVNAME@/${KVNAME}/' <proxmox-ve/postinst >proxmox-ve/data/DEBIAN/postinst | |
104 | chmod 0755 proxmox-ve/data/DEBIAN/postinst | |
105 | install -m 0755 proxmox-ve/postrm proxmox-ve/data/DEBIAN/postrm | |
106 | echo "git clone git://git.proxmox.com/git/pve-kernel.git\\ngit checkout ${GITVERSION}" > proxmox-ve/data/usr/share/doc/${PVEPKG}/SOURCE | |
107 | install -m 0644 proxmox-ve/copyright proxmox-ve/data/usr/share/doc/${PVEPKG} | |
108 | install -m 0644 proxmox-ve/changelog.Debian proxmox-ve/data/usr/share/doc/${PVEPKG} | |
109 | gzip -n --best proxmox-ve/data/usr/share/doc/${PVEPKG}/changelog.Debian | |
110 | dpkg-deb --build proxmox-ve/data ${PVE_DEB} | |
111 | ||
112 | ${VIRTUAL_HDR_DEB} pve-headers: proxmox-ve/pve-headers.control | |
113 | rm -rf proxmox-ve/data | |
114 | mkdir -p proxmox-ve/data/DEBIAN | |
115 | mkdir -p proxmox-ve/data/usr/share/doc/${VIRTUALHDRPACKAGE}/ | |
116 | 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 | |
117 | echo "git clone git://git.proxmox.com/git/pve-kernel-4.0.git\\ngit checkout ${GITVERSION}" > proxmox-ve/data/usr/share/doc/${VIRTUALHDRPACKAGE}/SOURCE | |
118 | install -m 0644 proxmox-ve/copyright proxmox-ve/data/usr/share/doc/${VIRTUALHDRPACKAGE} | |
119 | install -m 0644 proxmox-ve/changelog.Debian proxmox-ve/data/usr/share/doc/${VIRTUALHDRPACKAGE} | |
120 | gzip -n --best proxmox-ve/data/usr/share/doc/${VIRTUALHDRPACKAGE}/changelog.Debian | |
121 | dpkg-deb --build proxmox-ve/data ${VIRTUAL_HDR_DEB} | |
122 | ||
123 | # see https://wiki.ubuntu.com/Kernel/Dev/KernelGitGuide | |
124 | .PHONY: download | |
125 | download: | |
126 | rm -rf ${KERNEL_SRC} ${KERNELSRCTAR} | |
127 | #git clone git://kernel.ubuntu.com/ubuntu/ubuntu-vivid.git | |
128 | git clone --single-branch -b Ubuntu-4.10.0-13.15 git://kernel.ubuntu.com/ubuntu/ubuntu-zesty.git ${KERNEL_SRC} | |
129 | tar czf ${KERNELSRCTAR} --exclude .git ${KERNEL_SRC} | |
130 | ||
131 | check_gcc: | |
132 | ifeq ($(CC), cc) | |
133 | gcc --version|grep "6\.3" || false | |
134 | else | |
135 | $(CC) --version|grep "6\.3" || false | |
136 | endif | |
137 | ||
138 | ${DST_DEB}: data control.in prerm.in postinst.in postrm.in copyright changelog.Debian | |
139 | mkdir -p data/DEBIAN | |
140 | sed -e 's/@KERNEL_VER@/${KERNEL_VER}/' -e 's/@KVNAME@/${KVNAME}/' -e 's/@PKGREL@/${PKGREL}/' <control.in >data/DEBIAN/control | |
141 | sed -e 's/@@KVNAME@@/${KVNAME}/g' <prerm.in >data/DEBIAN/prerm | |
142 | chmod 0755 data/DEBIAN/prerm | |
143 | sed -e 's/@@KVNAME@@/${KVNAME}/g' <postinst.in >data/DEBIAN/postinst | |
144 | chmod 0755 data/DEBIAN/postinst | |
145 | sed -e 's/@@KVNAME@@/${KVNAME}/g' <postrm.in >data/DEBIAN/postrm | |
146 | chmod 0755 data/DEBIAN/postrm | |
147 | install -D -m 644 copyright data/usr/share/doc/${PACKAGE}/copyright | |
148 | install -D -m 644 changelog.Debian data/usr/share/doc/${PACKAGE}/changelog.Debian | |
149 | echo "git clone git://git.proxmox.com/git/pve-kernel.git\\ngit checkout ${GITVERSION}" > data/usr/share/doc/${PACKAGE}/SOURCE | |
150 | gzip -n -f --best data/usr/share/doc/${PACKAGE}/changelog.Debian | |
151 | rm -f data/lib/modules/${KVNAME}/source | |
152 | rm -f data/lib/modules/${KVNAME}/build | |
153 | dpkg-deb --build data ${DST_DEB} | |
154 | lintian ${DST_DEB} | |
155 | ||
156 | LINUX_TOOLS_DH_LIST=strip installchangelogs installdocs compress shlibdeps gencontrol md5sums builddeb | |
157 | ||
158 | ${LINUX_TOOLS_DEB}: .compile_mark control.tools changelog.Debian copyright | |
159 | rm -rf linux-tools ${LINUX_TOOLS_DEB} | |
160 | mkdir -p linux-tools/debian | |
161 | cp control.tools linux-tools/debian/control | |
162 | echo 9 > linux-tools/debian/compat | |
163 | cp changelog.Debian linux-tools/debian/changelog | |
164 | cp copyright linux-tools/debian | |
165 | mkdir -p linux-tools/debian/linux-tools-4.10/usr/bin | |
166 | install -m 0755 ${KERNEL_SRC}/tools/perf/perf linux-tools/debian/linux-tools-4.10/usr/bin/perf_4.10 | |
167 | cd linux-tools; for i in ${LINUX_TOOLS_DH_LIST}; do dh_$$i; done | |
168 | lintian ${LINUX_TOOLS_DEB} | |
169 | ||
170 | fwlist-${KVNAME}: data | |
171 | ./find-firmware.pl data/lib/modules/${KVNAME} >fwlist.tmp | |
172 | mv fwlist.tmp $@ | |
173 | ||
174 | data: .compile_mark igb.ko ixgbe.ko e1000e.ko ${SPL_MODULES} ${ZFS_MODULES} | |
175 | rm -rf data tmp; mkdir -p tmp/lib/modules/${KVNAME} | |
176 | mkdir tmp/boot | |
177 | install -m 644 ${KERNEL_SRC}/.config tmp/boot/config-${KVNAME} | |
178 | install -m 644 ${KERNEL_SRC}/System.map tmp/boot/System.map-${KVNAME} | |
179 | install -m 644 ${KERNEL_SRC}/arch/x86_64/boot/bzImage tmp/boot/vmlinuz-${KVNAME} | |
180 | cd ${KERNEL_SRC}; make INSTALL_MOD_PATH=../tmp/ modules_install | |
181 | ## install latest ibg driver | |
182 | install -m 644 igb.ko tmp/lib/modules/${KVNAME}/kernel/drivers/net/ethernet/intel/igb/ | |
183 | # install latest ixgbe driver | |
184 | install -m 644 ixgbe.ko tmp/lib/modules/${KVNAME}/kernel/drivers/net/ethernet/intel/ixgbe/ | |
185 | # install latest e1000e driver | |
186 | install -m 644 e1000e.ko tmp/lib/modules/${KVNAME}/kernel/drivers/net/ethernet/intel/e1000e/ | |
187 | ## install hpsa driver | |
188 | #install -m 644 hpsa.ko tmp/lib/modules/${KVNAME}/kernel/drivers/scsi/ | |
189 | # install zfs drivers | |
190 | install -d -m 0755 tmp/lib/modules/${KVNAME}/zfs | |
191 | install -m 644 ${SPL_MODULES} ${ZFS_MODULES} tmp/lib/modules/${KVNAME}/zfs | |
192 | # install drbd9 | |
193 | #install -m 644 ${DRBD_MODULES} tmp/lib/modules/${KVNAME}/kernel/drivers/block/drbd | |
194 | # remove firmware | |
195 | rm -rf tmp/lib/firmware | |
196 | # strip debug info | |
197 | find tmp/lib/modules -name \*.ko -print | while read f ; do strip --strip-debug "$$f"; done | |
198 | # finalize | |
199 | /sbin/depmod -b tmp/ ${KVNAME} | |
200 | # Autogenerate blacklist for watchdog devices (see README) | |
201 | install -m 0755 -d tmp/lib/modprobe.d | |
202 | ls tmp/lib/modules/${KVNAME}/kernel/drivers/watchdog/ > watchdog-blacklist.tmp | |
203 | echo ipmi_watchdog.ko >> watchdog-blacklist.tmp | |
204 | cat watchdog-blacklist.tmp|sed -e 's/^/blacklist /' -e 's/.ko$$//'|sort -u > tmp/lib/modprobe.d/blacklist_${PACKAGE}.conf | |
205 | mv tmp data | |
206 | ||
207 | PVE_CONFIG_OPTS= \ | |
208 | -m INTEL_MEI_WDT \ | |
209 | -d CONFIG_SND_PCM_OSS \ | |
210 | -e CONFIG_TRANSPARENT_HUGEPAGE_MADVISE \ | |
211 | -d CONFIG_TRANSPARENT_HUGEPAGE_ALWAYS \ | |
212 | -m CONFIG_CEPH_FS \ | |
213 | -m CONFIG_BLK_DEV_NBD \ | |
214 | -m CONFIG_BLK_DEV_RBD \ | |
215 | -m CONFIG_BCACHE \ | |
216 | -m CONFIG_JFS_FS \ | |
217 | -m CONFIG_HFS_FS \ | |
218 | -m CONFIG_HFSPLUS_FS \ | |
219 | -e CONFIG_BRIDGE \ | |
220 | -e CONFIG_BRIDGE_NETFILTER \ | |
221 | -e CONFIG_BLK_DEV_SD \ | |
222 | -e CONFIG_BLK_DEV_SR \ | |
223 | -e CONFIG_BLK_DEV_DM \ | |
224 | -e CONFIG_BLK_DEV_NVME \ | |
225 | -d CONFIG_INPUT_EVBUG \ | |
226 | -d CONFIG_CPU_FREQ_DEFAULT_GOV_ONDEMAND \ | |
227 | -e CONFIG_CPU_FREQ_DEFAULT_GOV_PERFORMANCE \ | |
228 | -d CONFIG_MODULE_SIG \ | |
229 | -d CONFIG_MEMCG_DISABLED \ | |
230 | -e CONFIG_MEMCG_SWAP_ENABLED \ | |
231 | -e CONFIG_MEMCG_KMEM \ | |
232 | -d CONFIG_DEFAULT_CFQ \ | |
233 | --set-str CONFIG_DEFAULT_IOSCHED deadline \ | |
234 | -d CONFIG_DEFAULT_SECURITY_DAC \ | |
235 | -e CONFIG_DEFAULT_SECURITY_APPARMOR \ | |
236 | --set-str CONFIG_DEFAULT_SECURITY apparmor | |
237 | ||
238 | .compile_mark: ${KERNEL_SRC}/README ${KERNEL_CFG_ORG} | |
239 | cp ${KERNEL_CFG_ORG} ${KERNEL_SRC}/.config | |
240 | cd ${KERNEL_SRC}; ./scripts/config ${PVE_CONFIG_OPTS} | |
241 | cd ${KERNEL_SRC}; make oldconfig | |
242 | cd ${KERNEL_SRC}; make KBUILD_BUILD_VERSION_TIMESTAMP="PVE ${KERNEL_VER}-${PKGREL} ($(CHANGELOG_DATE))" -j 8 | |
243 | make -C ${KERNEL_SRC}/tools/perf prefix=/usr HAVE_CPLUS_DEMANGLE=1 NO_LIBPYTHON=1 NO_LIBPERL=1 NO_LIBCRYPTO=1 PYTHON=python2.7 | |
244 | make -C ${KERNEL_SRC}/tools/perf man | |
245 | touch $@ | |
246 | ||
247 | ${KERNEL_SRC}/README ${KERNEL_CFG_ORG}: ${KERNELSRCTAR} | |
248 | rm -rf ${KERNEL_SRC} | |
249 | tar xf ${KERNELSRCTAR} | |
250 | 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} | |
251 | cd ${KERNEL_SRC}; patch -p1 < ../uname-version-timestamp.patch | |
252 | cd ${KERNEL_SRC}; patch -p1 <../bridge-patch.diff | |
253 | #cd ${KERNEL_SRC}; patch -p1 <../bridge-forward-ipv6-neighbor-solicitation.patch | |
254 | #cd ${KERNEL_SRC}; patch -p1 <../add-empty-ndo_poll_controller-to-veth.patch | |
255 | cd ${KERNEL_SRC}; patch -p1 <../override_for_missing_acs_capabilities.patch | |
256 | #cd ${KERNEL_SRC}; patch -p1 <../vhost-net-extend-device-allocation-to-vmalloc.patch | |
257 | cd ${KERNEL_SRC}; patch -p1 < ../kvm-dynamic-halt-polling-disable-default.patch | |
258 | cd ${KERNEL_SRC}; patch -p1 < ../cgroup-cpuset-add-cpuset.remap_cpus.patch | |
259 | cd ${KERNEL_SRC}; patch -p1 < ../CVE-2017-2596-kvm-page-reference-leakage-in-handle_vmon.patch | |
260 | sed -i ${KERNEL_SRC}/Makefile -e 's/^EXTRAVERSION.*$$/EXTRAVERSION=${EXTRAVERSION}/' | |
261 | touch $@ | |
262 | ||
263 | aacraid.ko: .compile_mark ${AACRAIDSRC} | |
264 | rm -rf ${AACRAIDDIR} | |
265 | mkdir ${AACRAIDDIR} | |
266 | cd ${AACRAIDDIR};tar xzf ../${AACRAIDSRC} | |
267 | cd ${AACRAIDDIR};rpm2cpio aacraid-${AACRAIDVER}.src.rpm|cpio -i | |
268 | cd ${AACRAIDDIR};tar xf aacraid_source.tgz | |
269 | [ ! -e /lib/modules/${KVNAME}/build ] || rm /lib/modules/${KVNAME}/build | |
270 | make -C ${TOP}/${KERNEL_SRC} M=${TOP}/${AACRAIDDIR} KSRC=${TOP}/${KERNEL_SRC} modules | |
271 | cp ${AACRAIDDIR}/aacraid.ko . | |
272 | ||
273 | hpsa.ko hpsa: .compile_mark ${HPSASRC} | |
274 | rm -rf ${HPSADIR} | |
275 | tar xf ${HPSASRC} | |
276 | # sed -i ${HPSADIR}/drivers/scsi/hpsa_kernel_compat.h -e 's/^\/\* #define RHEL7.*/#define RHEL7/' | |
277 | [ ! -e /lib/modules/${KVNAME}/build ] || rm /lib/modules/${KVNAME}/build | |
278 | make -C ${TOP}/${KERNEL_SRC} M=${TOP}/${HPSADIR}/drivers/scsi KSRC=${TOP}/${KERNEL_SRC} modules | |
279 | cp ${HPSADIR}/drivers/scsi/hpsa.ko hpsa.ko | |
280 | ||
281 | e1000e.ko e1000e: .compile_mark ${E1000ESRC} | |
282 | rm -rf ${E1000EDIR} | |
283 | tar xf ${E1000ESRC} | |
284 | [ ! -e /lib/modules/${KVNAME}/build ] || rm /lib/modules/${KVNAME}/build | |
285 | cd ${E1000EDIR}; patch -p1 < ../intel-module-gcc6-compat.patch | |
286 | cd ${E1000EDIR}; patch -p1 < ../e1000e_4.10_compat.patch | |
287 | cd ${E1000EDIR}/src; make BUILD_KERNEL=${KVNAME} KSRC=${TOP}/${KERNEL_SRC} | |
288 | cp ${E1000EDIR}/src/e1000e.ko e1000e.ko | |
289 | ||
290 | igb.ko igb: .compile_mark ${IGBSRC} | |
291 | rm -rf ${IGBDIR} | |
292 | tar xf ${IGBSRC} | |
293 | [ ! -e /lib/modules/${KVNAME}/build ] || rm /lib/modules/${KVNAME}/build | |
294 | cd ${IGBDIR}; patch -p1 < ../intel-module-gcc6-compat.patch | |
295 | cd ${IGBDIR}; patch -p1 < ../igb_4.9_compat.patch | |
296 | cd ${IGBDIR}; patch -p1 < ../igb_4.10_compat.patch | |
297 | cd ${IGBDIR}/src; make BUILD_KERNEL=${KVNAME} KSRC=${TOP}/${KERNEL_SRC} | |
298 | cp ${IGBDIR}/src/igb.ko igb.ko | |
299 | ||
300 | ixgbe.ko ixgbe: .compile_mark ${IXGBESRC} | |
301 | rm -rf ${IXGBEDIR} | |
302 | tar xf ${IXGBESRC} | |
303 | [ ! -e /lib/modules/${KVNAME}/build ] || rm /lib/modules/${KVNAME}/build | |
304 | cd ${IXGBEDIR}; patch -p1 < ../ixgbe_4.10_compat.patch | |
305 | cd ${IXGBEDIR}/src; make CFLAGS_EXTRA="-DIXGBE_NO_LRO" BUILD_KERNEL=${KVNAME} KSRC=${TOP}/${KERNEL_SRC} | |
306 | cp ${IXGBEDIR}/src/ixgbe.ko ixgbe.ko | |
307 | ||
308 | i40e.ko i40e: .compile_mark ${I40ESRC} | |
309 | rm -rf ${I40EDIR} | |
310 | tar xf ${I40ESRC} | |
311 | [ ! -e /lib/modules/${KVNAME}/build ] || rm /lib/modules/${KVNAME}/build | |
312 | cd ${I40EDIR}/src; make BUILD_KERNEL=${KVNAME} KSRC=${TOP}/${KERNEL_SRC} | |
313 | cp ${I40EDIR}/src/i40e.ko i40e.ko | |
314 | ||
315 | bnx2.ko cnic.ko bnx2x.ko: ${BNX2SRC} | |
316 | rm -rf ${BNX2DIR} | |
317 | tar xf ${BNX2SRC} | |
318 | [ ! -e /lib/modules/${KVNAME}/build ] || rm /lib/modules/${KVNAME}/build | |
319 | cd ${BNX2DIR}; make -C bnx2/src KVER=${KVNAME} KSRC=${TOP}/${KERNEL_SRC} | |
320 | cd ${BNX2DIR}; make -C bnx2x/src KVER=${KVNAME} KSRC=${TOP}/${KERNEL_SRC} | |
321 | cp `find ${BNX2DIR} -name bnx2.ko -o -name cnic.ko -o -name bnx2x.ko` . | |
322 | ||
323 | arcmsr.ko: .compile_mark ${ARECASRC} | |
324 | rm -rf ${ARECADIR} | |
325 | mkdir ${ARECADIR}; cd ${ARECADIR}; unzip ../${ARECASRC} | |
326 | [ ! -e /lib/modules/${KVNAME}/build ] || rm /lib/modules/${KVNAME}/build | |
327 | cd ${ARECADIR}; make -C ${TOP}/${KERNEL_SRC} SUBDIRS=${TOP}/${ARECADIR} KSRC=${TOP}/${KERNEL_SRC} modules | |
328 | cp ${ARECADIR}/arcmsr.ko arcmsr.ko | |
329 | ||
330 | ${SPL_MODULES}: .compile_mark ${SPLSRC} | |
331 | rm -rf ${SPLDIR} | |
332 | tar xf ${SPLSRC} | |
333 | cd ${SPLDIR}; ./autogen.sh | |
334 | cd ${SPLDIR}; ./configure --with-config=kernel --with-linux=${TOP}/${KERNEL_SRC} --with-linux-obj=${TOP}/${KERNEL_SRC} | |
335 | cd ${SPLDIR}; make | |
336 | cp ${SPLDIR}/module/spl/spl.ko spl.ko | |
337 | cp ${SPLDIR}/module/splat/splat.ko splat.ko | |
338 | ||
339 | ${ZFS_MODULES}: .compile_mark ${ZFSSRC} | |
340 | rm -rf ${ZFSDIR} | |
341 | tar xf ${ZFSSRC} | |
342 | cd ${ZFSDIR}; ./autogen.sh | |
343 | 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} | |
344 | cd ${ZFSDIR}; make | |
345 | cp ${ZFSDIR}/module/zfs/zfs.ko zfs.ko | |
346 | cp ${ZFSDIR}/module/avl/zavl.ko zavl.ko | |
347 | cp ${ZFSDIR}/module/nvpair/znvpair.ko znvpair.ko | |
348 | cp ${ZFSDIR}/module/unicode/zunicode.ko zunicode.ko | |
349 | cp ${ZFSDIR}/module/zcommon/zcommon.ko zcommon.ko | |
350 | cp ${ZFSDIR}/module/zpios/zpios.ko zpios.ko | |
351 | ||
352 | #.PHONY: update-drbd | |
353 | #update-drbd: | |
354 | # rm -rf ${DRBDDIR} ${DRBDSRC} drbd-9.0 | |
355 | # git clone --recursive git://git.drbd.org/drbd-9.0 | |
356 | # cd drbd-9.0; make tarball | |
357 | # mv drbd-9.0/${DRBDSRC} ${DRBDSRC} | |
358 | # | |
359 | #.PHONY: drbd | |
360 | #drbd ${DRBD_MODULES}: .compile_mark ${DRBDSRC} | |
361 | # rm -rf ${DRBDDIR} | |
362 | # tar xzf ${DRBDSRC} | |
363 | # [ ! -e /lib/modules/${KVNAME}/build ] || rm /lib/modules/${KVNAME}/build | |
364 | # cd ${DRBDDIR}; make KVER=${KVNAME} KDIR=${TOP}/${KERNEL_SRC} | |
365 | # mv ${DRBDDIR}/drbd/drbd.ko drbd.ko | |
366 | # mv ${DRBDDIR}/drbd/drbd_transport_tcp.ko drbd_transport_tcp.ko | |
367 | ||
368 | #iscsi_trgt.ko: .compile_mark ${ISCSITARGETSRC} | |
369 | # rm -rf ${ISCSITARGETDIR} | |
370 | # tar xf ${ISCSITARGETSRC} | |
371 | # cd ${ISCSITARGETDIR}; make KSRC=${TOP}/${KERNEL_SRC} | |
372 | # cp ${ISCSITARGETDIR}/kernel/iscsi_trgt.ko iscsi_trgt.ko | |
373 | ||
374 | headers_tmp := $(CURDIR)/tmp-headers | |
375 | headers_dir := $(headers_tmp)/usr/src/linux-headers-${KVNAME} | |
376 | ||
377 | ${HDR_DEB} hdr: .compile_mark headers-control.in headers-postinst.in | |
378 | rm -rf $(headers_tmp) | |
379 | install -d $(headers_tmp)/DEBIAN $(headers_dir)/include/ | |
380 | sed -e 's/@KERNEL_VER@/${KERNEL_VER}/' -e 's/@KVNAME@/${KVNAME}/' -e 's/@PKGREL@/${PKGREL}/' <headers-control.in >$(headers_tmp)/DEBIAN/control | |
381 | sed -e 's/@@KVNAME@@/${KVNAME}/g' <headers-postinst.in >$(headers_tmp)/DEBIAN/postinst | |
382 | chmod 0755 $(headers_tmp)/DEBIAN/postinst | |
383 | install -D -m 644 copyright $(headers_tmp)/usr/share/doc/${HDRPACKAGE}/copyright | |
384 | install -D -m 644 changelog.Debian $(headers_tmp)/usr/share/doc/${HDRPACKAGE}/changelog.Debian | |
385 | echo "git clone git://git.proxmox.com/git/pve-kernel.git\\ngit checkout ${GITVERSION}" > $(headers_tmp)/usr/share/doc/${HDRPACKAGE}/SOURCE | |
386 | gzip -n -f --best $(headers_tmp)/usr/share/doc/${HDRPACKAGE}/changelog.Debian | |
387 | install -m 0644 ${KERNEL_SRC}/.config $(headers_dir) | |
388 | install -m 0644 ${KERNEL_SRC}/Module.symvers $(headers_dir) | |
389 | cd ${KERNEL_SRC}; find . -path './debian/*' -prune -o -path './include/*' -prune -o -path './Documentation' -prune \ | |
390 | -o -path './scripts' -prune -o -type f \ | |
391 | \( -name 'Makefile*' -o -name 'Kconfig*' -o -name 'Kbuild*' -o \ | |
392 | -name '*.sh' -o -name '*.pl' \) \ | |
393 | -print | cpio -pd --preserve-modification-time $(headers_dir) | |
394 | cd ${KERNEL_SRC}; cp -a include scripts $(headers_dir) | |
395 | cd ${KERNEL_SRC}; (find arch/x86 -name include -type d -print | \ | |
396 | xargs -n1 -i: find : -type f) | \ | |
397 | cpio -pd --preserve-modification-time $(headers_dir) | |
398 | mkdir -p ${headers_tmp}/lib/modules/${KVNAME} | |
399 | ln -sf /usr/src/linux-headers-${KVNAME} ${headers_tmp}/lib/modules/${KVNAME}/build | |
400 | dpkg-deb --build $(headers_tmp) ${HDR_DEB} | |
401 | #lintian ${HDR_DEB} | |
402 | ||
403 | dvb-firmware.git/README: | |
404 | git clone https://github.com/OpenELEC/dvb-firmware.git dvb-firmware.git | |
405 | ||
406 | linux-firmware.git/WHENCE: | |
407 | git clone git://git.kernel.org/pub/scm/linux/kernel/git/firmware/linux-firmware.git linux-firmware.git | |
408 | ||
409 | ${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-4.4.44-1-pve fwlist-${KVNAME} | |
410 | rm -rf fwdata | |
411 | mkdir -p fwdata/lib/firmware | |
412 | ./assemble-firmware.pl fwlist-${KVNAME} fwdata/lib/firmware | |
413 | # include any files from older/newer kernels here | |
414 | ./assemble-firmware.pl fwlist-2.6.18-2-pve fwdata/lib/firmware | |
415 | ./assemble-firmware.pl fwlist-2.6.24-12-pve fwdata/lib/firmware | |
416 | ./assemble-firmware.pl fwlist-2.6.32-3-pve fwdata/lib/firmware | |
417 | ./assemble-firmware.pl fwlist-2.6.32-4-pve fwdata/lib/firmware | |
418 | ./assemble-firmware.pl fwlist-2.6.32-6-pve fwdata/lib/firmware | |
419 | ./assemble-firmware.pl fwlist-2.6.32-13-pve fwdata/lib/firmware | |
420 | ./assemble-firmware.pl fwlist-2.6.32-14-pve fwdata/lib/firmware | |
421 | ./assemble-firmware.pl fwlist-2.6.32-20-pve fwdata/lib/firmware | |
422 | ./assemble-firmware.pl fwlist-2.6.32-21-pve fwdata/lib/firmware | |
423 | ./assemble-firmware.pl fwlist-3.10.0-3-pve fwdata/lib/firmware | |
424 | ./assemble-firmware.pl fwlist-3.10.0-7-pve fwdata/lib/firmware | |
425 | ./assemble-firmware.pl fwlist-3.10.0-8-pve fwdata/lib/firmware | |
426 | ./assemble-firmware.pl fwlist-3.19.8-1-pve fwdata/lib/firmware | |
427 | ./assemble-firmware.pl fwlist-4.2.8-1-pve fwdata/lib/firmware | |
428 | ./assemble-firmware.pl fwlist-4.4.13-2-pve fwdata/lib/firmware | |
429 | ./assemble-firmware.pl fwlist-4.4.16-1-pve fwdata/lib/firmware | |
430 | ./assemble-firmware.pl fwlist-4.4.21-1-pve fwdata/lib/firmware | |
431 | ./assemble-firmware.pl fwlist-4.4.44-1-pve fwdata/lib/firmware | |
432 | install -d fwdata/usr/share/doc/pve-firmware | |
433 | cp linux-firmware.git/WHENCE fwdata/usr/share/doc/pve-firmware/README | |
434 | install -d fwdata/usr/share/doc/pve-firmware/licenses | |
435 | cp linux-firmware.git/LICEN[CS]E* fwdata/usr/share/doc/pve-firmware/licenses | |
436 | install -D -m 0644 changelog.firmware fwdata/usr/share/doc/pve-firmware/changelog.Debian | |
437 | gzip -n -9 fwdata/usr/share/doc/pve-firmware/changelog.Debian | |
438 | echo "git clone git://git.proxmox.com/git/pve-kernel.git\\ngit checkout ${GITVERSION}" >fwdata/usr/share/doc/pve-firmware/SOURCE | |
439 | install -d fwdata/DEBIAN | |
440 | sed -e 's/@VERSION@/${FW_VER}-${FW_REL}/' <control.firmware >fwdata/DEBIAN/control | |
441 | dpkg-deb --build fwdata ${FW_DEB} | |
442 | ||
443 | .PHONY: upload | |
444 | upload: ${DEBS} | |
445 | tar cf - ${DEBS}|ssh repoman@repo.proxmox.com -- upload --product pve --dist stretch --arch ${ARCH} | |
446 | ||
447 | .PHONY: distclean | |
448 | distclean: clean | |
449 | rm -rf linux-firmware.git dvb-firmware.git ${KERNEL_SRC}.org | |
450 | ||
451 | .PHONY: clean | |
452 | clean: | |
453 | 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} | |
454 | ||
455 | ||
456 | ||
457 | ||
458 |