]>
Commit | Line | Data |
---|---|---|
793eb444 | 1 | RELEASE=2.2 |
1cfff965 DM |
2 | |
3 | KERNEL_VER=2.6.32 | |
ef003dcf | 4 | PKGREL=78 |
1cfff965 DM |
5 | # also include firmware of previous versrion into |
6 | # the fw package: fwlist-2.6.32-PREV-pve | |
ef003dcf | 7 | KREL=15 |
1cfff965 | 8 | |
9d1cc7ef | 9 | RHKVER=279.5.1.el6 |
793eb444 | 10 | OVZVER=042stab061.9 |
1cfff965 DM |
11 | |
12 | KERNELSRCRPM=vzkernel-${KERNEL_VER}-${OVZVER}.src.rpm | |
13 | ||
14 | EXTRAVERSION=-${KREL}-pve | |
15 | KVNAME=${KERNEL_VER}${EXTRAVERSION} | |
16 | PACKAGE=pve-kernel-${KVNAME} | |
17 | HDRPACKAGE=pve-headers-${KVNAME} | |
18 | ||
19 | ARCH=amd64 | |
20 | TOP=$(shell pwd) | |
21 | ||
22 | KERNEL_SRC=linux-2.6-${KERNEL_VER} | |
23 | RHKERSRCDIR=rh-kernel-src | |
24 | KERNEL_CFG=config-${KERNEL_VER} | |
25 | KERNEL_CFG_ORG=config-${KERNEL_VER}-${OVZVER}.x86_64 | |
26 | ||
27 | FW_VER=1.0 | |
ef003dcf | 28 | FW_REL=19 |
1cfff965 DM |
29 | FW_DEB=pve-firmware_${FW_VER}-${FW_REL}_all.deb |
30 | ||
31 | AOEDIR=aoe6-77 | |
32 | AOESRC=${AOEDIR}.tar.gz | |
33 | ||
ef003dcf | 34 | E1000EDIR=e1000e-2.1.4 |
1cfff965 DM |
35 | E1000ESRC=${E1000EDIR}.tar.gz |
36 | ||
cce6412b | 37 | IGBDIR=igb-3.4.8 |
1cfff965 DM |
38 | IGBSRC=${IGBDIR}.tar.gz |
39 | ||
793eb444 | 40 | IXGBEDIR=ixgbe-3.10.17 |
1cfff965 DM |
41 | IXGBESRC=${IXGBEDIR}.tar.gz |
42 | ||
e21b3827 DM |
43 | #ARECADIR=arcmsr.1.20.0X.15-110330 |
44 | #ARECASRC=${ARECADIR}.zip | |
1cfff965 | 45 | |
f353f339 DM |
46 | ISCSITARGETDIR=iscsitarget-1.4.20.2 |
47 | ISCSITARGETSRC=${ISCSITARGETDIR}.tar.gz | |
48 | ||
1cfff965 DM |
49 | DST_DEB=${PACKAGE}_${KERNEL_VER}-${PKGREL}_${ARCH}.deb |
50 | HDR_DEB=${HDRPACKAGE}_${KERNEL_VER}-${PKGREL}_${ARCH}.deb | |
51 | PVEPKG=proxmox-ve-${KERNEL_VER} | |
52 | PVE_DEB=${PVEPKG}_${RELEASE}-${PKGREL}_all.deb | |
53 | ||
54 | all: check_gcc ${DST_DEB} ${PVE_DEB} ${FW_DEB} ${HDR_DEB} | |
55 | ||
56 | ${PVE_DEB} pve: proxmox-ve/control proxmox-ve/postinst | |
57 | rm -rf proxmox-ve/data | |
58 | mkdir -p proxmox-ve/data/DEBIAN | |
59 | mkdir -p proxmox-ve/data/usr/share/doc/${PVEPKG}/ | |
60 | install -m 0644 proxmox-ve/proxmox-release\@proxmox.com.pubkey proxmox-ve/data/usr/share/doc/${PVEPKG} | |
61 | 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 | |
62 | sed -e 's/@KERNEL_VER@/${KERNEL_VER}/' <proxmox-ve/postinst >proxmox-ve/data/DEBIAN/postinst | |
63 | chmod 0755 proxmox-ve/data/DEBIAN/postinst | |
64 | install -m 0644 proxmox-ve/copyright proxmox-ve/data/usr/share/doc/${PVEPKG} | |
65 | install -m 0644 proxmox-ve/changelog.Debian proxmox-ve/data/usr/share/doc/${PVEPKG} | |
66 | gzip --best proxmox-ve/data/usr/share/doc/${PVEPKG}/changelog.Debian | |
67 | dpkg-deb --build proxmox-ve/data ${PVE_DEB} | |
68 | ||
69 | check_gcc: | |
70 | gcc --version|grep "4.4.5" || false | |
71 | ||
72 | ${DST_DEB}: data control.in postinst.in | |
73 | mkdir -p data/DEBIAN | |
74 | sed -e 's/@KERNEL_VER@/${KERNEL_VER}/' -e 's/@KVNAME@/${KVNAME}/' -e 's/@PKGREL@/${PKGREL}/' <control.in >data/DEBIAN/control | |
75 | sed -e 's/@@KVNAME@@/${KVNAME}/g' <postinst.in >data/DEBIAN/postinst | |
76 | chmod 0755 data/DEBIAN/postinst | |
77 | install -D -m 644 copyright data/usr/share/doc/${PACKAGE}/copyright | |
78 | install -D -m 644 changelog.Debian data/usr/share/doc/${PACKAGE}/changelog.Debian | |
79 | gzip -f --best data/usr/share/doc/${PACKAGE}/changelog.Debian | |
80 | rm -f data/lib/modules/${KVNAME}/source | |
81 | rm -f data/lib/modules/${KVNAME}/build | |
82 | dpkg-deb --build data ${DST_DEB} | |
83 | lintian ${DST_DEB} | |
84 | ||
85 | ||
86 | fwlist-${KVNAME}: data | |
87 | ./find-firmware.pl data/lib/modules/${KVNAME} >fwlist.tmp | |
88 | mv fwlist.tmp $@ | |
89 | ||
e21b3827 | 90 | data: .compile_mark ${KERNEL_CFG} aoe.ko e1000e.ko igb.ko ixgbe.ko iscsi_trgt.ko |
1cfff965 DM |
91 | rm -rf data tmp; mkdir -p tmp/lib/modules/${KVNAME} |
92 | mkdir tmp/boot | |
93 | install -m 644 ${KERNEL_CFG} tmp/boot/config-${KVNAME} | |
94 | install -m 644 ${KERNEL_SRC}/System.map tmp/boot/System.map-${KVNAME} | |
95 | install -m 644 ${KERNEL_SRC}/arch/x86_64/boot/bzImage tmp/boot/vmlinuz-${KVNAME} | |
96 | cd ${KERNEL_SRC}; make INSTALL_MOD_PATH=../tmp/ modules_install | |
97 | # install latest aoe driver | |
98 | install -m 644 aoe.ko tmp/lib/modules/${KVNAME}/kernel/drivers/block/aoe/aoe.ko | |
99 | # install latest ixgbe driver | |
100 | install -m 644 ixgbe.ko tmp/lib/modules/${KVNAME}/kernel/drivers/net/ixgbe/ | |
101 | # install latest e1000e driver | |
102 | install -m 644 e1000e.ko tmp/lib/modules/${KVNAME}/kernel/drivers/net/e1000e/ | |
103 | # install latest ibg driver | |
104 | install -m 644 igb.ko tmp/lib/modules/${KVNAME}/kernel/drivers/net/igb/ | |
1cfff965 | 105 | # install areca driver |
e21b3827 | 106 | #install -m 644 arcmsr.ko tmp/lib/modules/${KVNAME}/kernel/drivers/scsi/arcmsr/ |
f353f339 DM |
107 | # install iscsitarget module |
108 | install -m 644 -D iscsi_trgt.ko tmp/lib/modules/${KVNAME}/kernel/drivers/scsi/iscsi_trgt.ko | |
1cfff965 DM |
109 | # remove firmware |
110 | rm -rf tmp/lib/firmware | |
111 | # strip debug info | |
112 | find tmp/lib/modules -name \*.ko -print | while read f ; do strip --strip-debug "$$f"; done | |
113 | # finalize | |
114 | depmod -b tmp/ ${KVNAME} | |
115 | mv tmp data | |
116 | ||
117 | .compile_mark: ${KERNEL_SRC}/README ${KERNEL_CFG} | |
118 | cp ${KERNEL_CFG} ${KERNEL_SRC}/.config | |
119 | cd ${KERNEL_SRC}; make oldconfig | |
120 | cd ${KERNEL_SRC}; make -j 8 | |
121 | touch $@ | |
122 | ||
123 | ${KERNEL_CFG}: ${KERNEL_CFG_ORG} config-${KERNEL_VER}.diff | |
124 | cp ${KERNEL_CFG_ORG} ${KERNEL_CFG}.new | |
ed2a6bee | 125 | patch --no-backup ${KERNEL_CFG}.new config-${KERNEL_VER}.diff |
1cfff965 DM |
126 | mv ${KERNEL_CFG}.new ${KERNEL_CFG} |
127 | ||
128 | ${KERNEL_SRC}/README: ${KERNEL_SRC}.org/README | |
129 | rm -rf ${KERNEL_SRC} | |
130 | cp -a ${KERNEL_SRC}.org ${KERNEL_SRC} | |
131 | cd ${KERNEL_SRC}; patch -p1 <../bootsplash-3.1.9-2.6.31-rh.patch | |
9d1cc7ef | 132 | cd ${KERNEL_SRC}; patch -p1 <../${RHKERSRCDIR}/patch-042stab061 |
1cfff965 | 133 | cd ${KERNEL_SRC}; patch -p1 <../do-not-use-barrier-on-ext3.patch |
1cfff965 | 134 | cd ${KERNEL_SRC}; patch -p1 <../bridge-patch.diff |
2153c684 | 135 | cd ${KERNEL_SRC}; patch -p1 <../fix-aspm-policy.patch |
c9fd4d77 | 136 | cd ${KERNEL_SRC}; patch -p1 <../optimize-cfq-parameters.patch |
1cfff965 DM |
137 | sed -i ${KERNEL_SRC}/Makefile -e 's/^EXTRAVERSION.*$$/EXTRAVERSION=${EXTRAVERSION}/' |
138 | touch $@ | |
139 | ||
140 | ${KERNEL_SRC}.org/README: ${RHKERSRCDIR}/kernel.spec ${RHKERSRCDIR}/linux-${KERNEL_VER}-${RHKVER}.tar.bz2 | |
141 | rm -rf ${KERNEL_SRC}.org linux-${KERNEL_VER}-${RHKVER} | |
142 | tar xf ${RHKERSRCDIR}/linux-${KERNEL_VER}-${RHKVER}.tar.bz2 | |
143 | mv linux-${KERNEL_VER}-${RHKVER} ${KERNEL_SRC}.org | |
144 | touch $@ | |
145 | ||
146 | ${RHKERSRCDIR}/kernel.spec: ${KERNELSRCRPM} | |
147 | rm -rf ${RHKERSRCDIR} | |
148 | mkdir ${RHKERSRCDIR} | |
149 | cd ${RHKERSRCDIR};rpm2cpio ../${KERNELSRCRPM} |cpio -i | |
150 | touch $@ | |
151 | ||
152 | aoe.ko aoe: .compile_mark ${AOESRC} | |
153 | # aoe driver updates | |
154 | rm -rf ${AOEDIR} aoe.ko | |
155 | tar xf ${AOESRC} | |
156 | mkdir -p /lib/modules/${KVNAME} | |
157 | ln -sf ${TOP}/${KERNEL_SRC} /lib/modules/${KVNAME}/build | |
158 | cd ${AOEDIR}; make KVER=${KVNAME} | |
159 | cp ${AOEDIR}/linux/drivers/block/aoe/aoe.ko aoe.ko | |
160 | ||
2355a739 | 161 | e1000e.ko e1000e: .compile_mark ${E1000ESRC} |
1cfff965 DM |
162 | rm -rf ${E1000EDIR} |
163 | tar xf ${E1000ESRC} | |
164 | mkdir -p /lib/modules/${KVNAME} | |
165 | ln -sf ${TOP}/${KERNEL_SRC} /lib/modules/${KVNAME}/build | |
166 | cd ${E1000EDIR}/src; make BUILD_KERNEL=${KVNAME} | |
167 | cp ${E1000EDIR}/src/e1000e.ko e1000e.ko | |
168 | ||
2355a739 | 169 | igb.ko igb: .compile_mark ${IGBSRC} |
1cfff965 DM |
170 | rm -rf ${IGBDIR} |
171 | tar xf ${IGBSRC} | |
172 | mkdir -p /lib/modules/${KVNAME} | |
173 | ln -sf ${TOP}/${KERNEL_SRC} /lib/modules/${KVNAME}/build | |
174 | cd ${IGBDIR}/src; make BUILD_KERNEL=${KVNAME} | |
175 | cp ${IGBDIR}/src/igb.ko igb.ko | |
176 | ||
2355a739 | 177 | ixgbe.ko ixgbe: .compile_mark ${IXGBESRC} |
1cfff965 DM |
178 | rm -rf ${IXGBEDIR} |
179 | tar xf ${IXGBESRC} | |
180 | mkdir -p /lib/modules/${KVNAME} | |
181 | ln -sf ${TOP}/${KERNEL_SRC} /lib/modules/${KVNAME}/build | |
182 | cd ${IXGBEDIR}/src; make CFLAGS_EXTRA="-DIXGBE_NO_LRO" BUILD_KERNEL=${KVNAME} | |
183 | cp ${IXGBEDIR}/src/ixgbe.ko ixgbe.ko | |
184 | ||
2355a739 | 185 | #arcmsr.ko: .compile_mark ${ARECASRC} |
e21b3827 DM |
186 | # rm -rf ${ARECADIR} |
187 | # unzip ${ARECASRC} | |
188 | # mkdir -p /lib/modules/${KVNAME} | |
189 | # ln -sf ${TOP}/${KERNEL_SRC} /lib/modules/${KVNAME}/build | |
190 | # cd ${ARECADIR}; make -C ${TOP}/${KERNEL_SRC} CONFIG_SCSI_ARCMSR=m SUBDIRS=${TOP}/${ARECADIR} modules | |
191 | # cp ${ARECADIR}/arcmsr.ko arcmsr.ko | |
1cfff965 | 192 | |
2355a739 | 193 | iscsi_trgt.ko: .compile_mark ${ISCSITARGETSRC} |
f353f339 DM |
194 | rm -rf ${ISCSITARGETDIR} |
195 | tar xf ${ISCSITARGETSRC} | |
2355a739 | 196 | cd ${ISCSITARGETDIR}; make KSRC=${TOP}/${KERNEL_SRC} |
f353f339 | 197 | cp ${ISCSITARGETDIR}/kernel/iscsi_trgt.ko iscsi_trgt.ko |
1cfff965 DM |
198 | |
199 | headers_tmp := $(CURDIR)/tmp-headers | |
200 | headers_dir := $(headers_tmp)/usr/src/linux-headers-${KVNAME} | |
201 | ||
202 | ${HDR_DEB} hdr: .compile_mark headers-control.in headers-postinst.in | |
203 | rm -rf $(headers_tmp) | |
204 | install -d $(headers_tmp)/DEBIAN $(headers_dir)/include/ | |
205 | sed -e 's/@KERNEL_VER@/${KERNEL_VER}/' -e 's/@KVNAME@/${KVNAME}/' -e 's/@PKGREL@/${PKGREL}/' <headers-control.in >$(headers_tmp)/DEBIAN/control | |
206 | sed -e 's/@@KVNAME@@/${KVNAME}/g' <headers-postinst.in >$(headers_tmp)/DEBIAN/postinst | |
207 | chmod 0755 $(headers_tmp)/DEBIAN/postinst | |
208 | install -D -m 644 copyright $(headers_tmp)/usr/share/doc/${HDRPACKAGE}/copyright | |
209 | install -D -m 644 changelog.Debian $(headers_tmp)/usr/share/doc/${HDRPACKAGE}/changelog.Debian | |
210 | gzip -f --best $(headers_tmp)/usr/share/doc/${HDRPACKAGE}/changelog.Debian | |
211 | install -m 0644 ${KERNEL_SRC}/.config $(headers_dir) | |
212 | install -m 0644 ${KERNEL_SRC}/Module.symvers $(headers_dir) | |
213 | cd ${KERNEL_SRC}; find . -path './debian/*' -prune -o -path './include/*' -prune -o -path './Documentation' -prune \ | |
214 | -o -path './scripts' -prune -o -type f \ | |
215 | \( -name 'Makefile*' -o -name 'Kconfig*' -o -name 'Kbuild*' -o \ | |
216 | -name '*.sh' -o -name '*.pl' \) \ | |
217 | -print | cpio -pd --preserve-modification-time $(headers_dir) | |
218 | cd ${KERNEL_SRC}; cp -a include scripts $(headers_dir) | |
219 | cd ${KERNEL_SRC}; (find arch/x86 -name include -type d -print | \ | |
220 | xargs -n1 -i: find : -type f) | \ | |
221 | cpio -pd --preserve-modification-time $(headers_dir) | |
222 | dpkg-deb --build $(headers_tmp) ${HDR_DEB} | |
223 | #lintian ${HDR_DEB} | |
224 | ||
225 | linux-firmware.git/WHENCE: | |
70957e30 | 226 | git clone git://git.kernel.org/pub/scm/linux/kernel/git/firmware/linux-firmware.git linux-firmware.git |
1cfff965 | 227 | |
a67892ea | 228 | ${FW_DEB} fw: control.firmware linux-firmware.git/WHENCE 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-5-pve fwlist-2.6.32-6-pve fwlist-2.6.35-1-pve fwlist-2.6.32-13-pve fwlist-${KVNAME} |
1cfff965 DM |
229 | rm -rf fwdata |
230 | mkdir -p fwdata/lib/firmware | |
231 | ./assemble-firmware.pl fwlist-${KVNAME} fwdata/lib/firmware | |
232 | # include any files from older/newer kernels here | |
233 | ./assemble-firmware.pl fwlist-2.6.24-12-pve fwdata/lib/firmware | |
234 | ./assemble-firmware.pl fwlist-2.6.18-2-pve fwdata/lib/firmware | |
235 | ./assemble-firmware.pl fwlist-2.6.32-3-pve fwdata/lib/firmware | |
236 | ./assemble-firmware.pl fwlist-2.6.32-4-pve fwdata/lib/firmware | |
237 | ./assemble-firmware.pl fwlist-2.6.32-5-pve fwdata/lib/firmware | |
e21b3827 | 238 | ./assemble-firmware.pl fwlist-2.6.32-6-pve fwdata/lib/firmware |
1cfff965 | 239 | ./assemble-firmware.pl fwlist-2.6.35-1-pve fwdata/lib/firmware |
a67892ea | 240 | ./assemble-firmware.pl fwlist-2.6.32-13-pve fwdata/lib/firmware |
1cfff965 DM |
241 | install -d fwdata/usr/share/doc/pve-firmware |
242 | cp linux-firmware.git/WHENCE fwdata/usr/share/doc/pve-firmware/README | |
243 | install -d fwdata/usr/share/doc/pve-firmware/licenses | |
244 | cp linux-firmware.git/LICEN[CS]E* fwdata/usr/share/doc/pve-firmware/licenses | |
245 | install -D -m 0644 changelog.firmware fwdata/usr/share/doc/pve-firmware/changelog.Debian | |
246 | gzip -9 fwdata/usr/share/doc/pve-firmware/changelog.Debian | |
247 | install -d fwdata/DEBIAN | |
248 | sed -e 's/@VERSION@/${FW_VER}-${FW_REL}/' <control.firmware >fwdata/DEBIAN/control | |
249 | dpkg-deb --build fwdata ${FW_DEB} | |
250 | ||
251 | .PHONY: upload | |
252 | upload: ${DST_DEB} ${PVE_DEB} ${HDR_DEB} ${FW_DEB} | |
253 | umount /pve/${RELEASE}; mount /pve/${RELEASE} -o rw | |
254 | mkdir -p /pve/${RELEASE}/extra | |
255 | mkdir -p /pve/${RELEASE}/install | |
256 | rm -rf /pve/${RELEASE}/extra/${PACKAGE}_*.deb | |
257 | rm -rf /pve/${RELEASE}/extra/${HDRPACKAGE}_*.deb | |
258 | rm -rf /pve/${RELEASE}/extra/${PVEPKG}_*.deb | |
259 | rm -rf /pve/${RELEASE}/extra/pve-firmware*.deb | |
260 | rm -rf /pve/${RELEASE}/extra/Packages* | |
261 | cp ${DST_DEB} ${PVE_DEB} ${HDR_DEB} ${FW_DEB} /pve/${RELEASE}/extra | |
262 | cd /pve/${RELEASE}/extra; dpkg-scanpackages . /dev/null | gzip -9c > Packages.gz | |
263 | umount /pve/${RELEASE}; mount /pve/${RELEASE} -o ro | |
264 | ||
265 | .PHONY: distclean | |
266 | distclean: clean | |
267 | rm -rf linux-firmware.git linux-firmware-from-kernel.git ${KERNEL_SRC}.org ${RHKERSRCDIR} | |
268 | ||
269 | .PHONY: clean | |
270 | clean: | |
e21b3827 | 271 | rm -rf *~ .compile_mark ${KERNEL_CFG} ${KERNEL_SRC} tmp data proxmox-ve/data *.deb ${AOEDIR} aoe.ko ${headers_tmp} fwdata fwlist.tmp *.ko ${IXGBEDIR} ${E1000EDIR} e1000e.ko ${IGBDIR} igb.ko fwlist-${KVNAME} iscsi_trgt.ko ${ISCSITARGETDIR} |
1cfff965 | 272 | |
ed2a6bee DM |
273 | |
274 |