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