5 # also include firmware of previous versrion into
6 # the fw package: fwlist-2.6.32-PREV-pve
12 KERNELSRCRPM
=vzkernel-
${KERNEL_VER}-${OVZVER}.src.rpm
14 EXTRAVERSION
=-${KREL}-pve
15 KVNAME
=${KERNEL_VER}${EXTRAVERSION}
16 PACKAGE
=pve-kernel-
${KVNAME}
17 HDRPACKAGE
=pve-headers-
${KVNAME}
20 GITVERSION
:=$(shell cat .git
/refs
/heads
/master
)
24 KERNEL_SRC
=linux-2.6
-${KERNEL_VER}
25 RHKERSRCDIR
=rh-kernel-src
26 KERNEL_CFG
=config-
${KERNEL_VER}
27 KERNEL_CFG_ORG
=config-
${KERNEL_VER}-${OVZVER}.x86_64
30 AOESRC
=${AOEDIR}.
tar.gz
32 E1000EDIR
=e1000e-3
.1.0.2
33 E1000ESRC
=${E1000EDIR}.
tar.gz
36 IGBSRC
=${IGBDIR}.
tar.gz
39 IXGBESRC
=${IXGBEDIR}.
tar.gz
41 BNX2DIR
=netxtreme2-7.10
.14
42 BNX2SRC
=${BNX2DIR}.
tar.gz
44 AACRAIDVER
=1.2.1-40700
45 AACRAIDSRC
=aacraid-linux-src-
${AACRAIDVER}.tgz
48 MEGARAID_DIR
=megaraid_sas-06.703
.11.00
49 MEGARAID_SRC
=${MEGARAID_DIR}-src.
tar.gz
51 ARECADIR
=arcmsr-1.30
.0X
.19-140509
52 ARECASRC
=${ARECADIR}.zip
54 RR272XSRC
=RR272x_1x-Linux-Src-v1.5
-130325-0732.
tar.gz
55 RR272XDIR
=rr272x_1x-linux-src-v1.5
57 ISCSITARGETDIR
=iscsitarget-1.4
.20.2
58 ISCSITARGETSRC
=${ISCSITARGETDIR}.
tar.gz
60 DST_DEB
=${PACKAGE}_
${KERNEL_VER}-${PKGREL}_
${ARCH}.deb
61 HDR_DEB
=${HDRPACKAGE}_
${KERNEL_VER}-${PKGREL}_
${ARCH}.deb
62 PVEPKG
=proxmox-ve-
${KERNEL_VER}
63 PVE_DEB
=${PVEPKG}_
${RELEASE}-${PKGREL}_all.deb
65 all: check_gcc
${DST_DEB} ${PVE_DEB} ${HDR_DEB}
67 ${PVE_DEB} pve
: proxmox-ve
/control proxmox-ve
/postinst
68 rm -rf proxmox-ve
/data
69 mkdir
-p proxmox-ve
/data
/DEBIAN
70 mkdir
-p proxmox-ve
/data
/usr
/share
/doc
/${PVEPKG}/
71 install -m
0644 proxmox-ve
/proxmox-release\@proxmox.com.pubkey proxmox-ve
/data
/usr
/share
/doc
/${PVEPKG}
72 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
73 sed
-e
's/@KERNEL_VER@/${KERNEL_VER}/' <proxmox-ve
/postinst
>proxmox-ve
/data
/DEBIAN
/postinst
74 chmod
0755 proxmox-ve
/data
/DEBIAN
/postinst
75 echo
"git clone git://git.proxmox.com/git/pve-kernel-2.6.32.git\\ngit checkout ${GITVERSION}" > proxmox-ve
/data
/usr
/share
/doc
/${PVEPKG}/SOURCE
76 install -m
0644 proxmox-ve
/copyright proxmox-ve
/data
/usr
/share
/doc
/${PVEPKG}
77 install -m
0644 proxmox-ve
/changelog.Debian proxmox-ve
/data
/usr
/share
/doc
/${PVEPKG}
78 gzip
--best proxmox-ve
/data
/usr
/share
/doc
/${PVEPKG}/changelog.Debian
79 dpkg-deb
--build proxmox-ve
/data
${PVE_DEB}
83 gcc
--version|grep
"4\.7\.2" || false
85 $(CC
) --version|grep
"4\.7" || false
88 ${DST_DEB}: data control.in postinst.in postrm.in
90 sed
-e
's/@KERNEL_VER@/${KERNEL_VER}/' -e
's/@KVNAME@/${KVNAME}/' -e
's/@PKGREL@/${PKGREL}/' <control.in
>data
/DEBIAN
/control
91 sed
-e
's/@@KVNAME@@/${KVNAME}/g' <postinst.in
>data
/DEBIAN
/postinst
92 chmod
0755 data
/DEBIAN
/postinst
93 sed
-e
's/@@KVNAME@@/${KVNAME}/g' <postrm.in
>data
/DEBIAN
/postrm
94 chmod
0755 data
/DEBIAN
/postrm
95 install -D
-m
644 copyright data
/usr
/share
/doc
/${PACKAGE}/copyright
96 install -D
-m
644 changelog.Debian data
/usr
/share
/doc
/${PACKAGE}/changelog.Debian
97 echo
"git clone git://git.proxmox.com/git/pve-kernel-2.6.32.git\\ngit checkout ${GITVERSION}" > data
/usr
/share
/doc
/${PACKAGE}/SOURCE
98 gzip
-f
--best data
/usr
/share
/doc
/${PACKAGE}/changelog.Debian
99 rm -f data
/lib
/modules
/${KVNAME}/source
100 rm -f data
/lib
/modules
/${KVNAME}/build
101 dpkg-deb
--build data
${DST_DEB}
105 fwlist-
${KVNAME} fwtest
: data
106 .
/find-firmware.pl data
/lib
/modules
/${KVNAME} >fwlist.tmp
107 cmp fwlist.tmp fwlist-2.6
.32-20-pve
110 data
: .compile_mark
${KERNEL_CFG} aoe.ko e1000e.ko igb.ko ixgbe.ko bnx2.ko cnic.ko bnx2x.ko iscsi_trgt.ko aacraid.ko megaraid_sas.ko rr272x_1x.ko arcmsr.ko
111 rm -rf data tmp
; mkdir
-p tmp
/lib
/modules
/${KVNAME}
113 install -m
644 ${KERNEL_CFG} tmp
/boot
/config-
${KVNAME}
114 install -m
644 ${KERNEL_SRC}/System.map tmp
/boot
/System.map-
${KVNAME}
115 install -m
644 ${KERNEL_SRC}/arch
/x86_64
/boot
/bzImage tmp
/boot
/vmlinuz-
${KVNAME}
116 cd
${KERNEL_SRC}; make INSTALL_MOD_PATH
=..
/tmp
/ modules_install
117 # install latest aoe driver
118 install -m
644 aoe.ko tmp
/lib
/modules
/${KVNAME}/kernel
/drivers
/block
/aoe
/aoe.ko
119 # install latest ixgbe driver
120 install -m
644 ixgbe.ko tmp
/lib
/modules
/${KVNAME}/kernel
/drivers
/net
/ixgbe
/
121 # install latest e1000e driver
122 install -m
644 e1000e.ko tmp
/lib
/modules
/${KVNAME}/kernel
/drivers
/net
/e1000e
/
123 # install latest ibg driver
124 install -m
644 igb.ko tmp
/lib
/modules
/${KVNAME}/kernel
/drivers
/net
/igb
/
125 # install bnx2 drivers
126 install -m
644 bnx2.ko tmp
/lib
/modules
/${KVNAME}/kernel
/drivers
/net
/
127 install -m
644 cnic.ko tmp
/lib
/modules
/${KVNAME}/kernel
/drivers
/net
/
128 install -m
644 bnx2x.ko tmp
/lib
/modules
/${KVNAME}/kernel
/drivers
/net
/bnx2x
/
129 # install aacraid drivers
130 install -m
644 aacraid.ko tmp
/lib
/modules
/${KVNAME}/kernel
/drivers
/scsi
/aacraid
/
131 # install megaraid_sas driver
132 install -m
644 megaraid_sas.ko tmp
/lib
/modules
/${KVNAME}/kernel
/drivers
/scsi
/megaraid
/
133 # install Highpoint 2710 RAID driver
134 install -m
644 rr272x_1x.ko
-D tmp
/lib
/modules
/${KVNAME}/kernel
/drivers
/scsi
/rr272x_1x
/rr272x_1x.ko
135 # install areca driver
136 install -m
644 arcmsr.ko tmp
/lib
/modules
/${KVNAME}/kernel
/drivers
/scsi
/arcmsr
/
137 # install iscsitarget module
138 install -m
644 -D iscsi_trgt.ko tmp
/lib
/modules
/${KVNAME}/kernel
/drivers
/scsi
/iscsi_trgt.ko
140 rm -rf tmp
/lib
/firmware
142 find tmp
/lib
/modules
-name \
*.ko
-print | while read f
; do
strip --strip-debug
"$$f"; done
144 depmod
-b tmp
/ ${KVNAME}
147 .compile_mark
: ${KERNEL_SRC}/README
${KERNEL_CFG}
148 cp
${KERNEL_CFG} ${KERNEL_SRC}/.config
149 cd
${KERNEL_SRC}; make oldconfig
150 cd
${KERNEL_SRC}; make
-j
8
153 ${KERNEL_CFG}: ${KERNEL_CFG_ORG} config-
${KERNEL_VER}.diff
154 cp
${KERNEL_CFG_ORG} ${KERNEL_CFG}.new
155 patch
--no-backup
${KERNEL_CFG}.new config-
${KERNEL_VER}.diff
156 mv
${KERNEL_CFG}.new
${KERNEL_CFG}
158 ${KERNEL_SRC}/README
: ${KERNEL_SRC}.org
/README
160 cp
-a
${KERNEL_SRC}.org
${KERNEL_SRC}
161 cd
${KERNEL_SRC}; patch
-p1
<..
/bootsplash-3.1
.9-2.6.31-rh.patch
162 cd
${KERNEL_SRC}; patch
-p1
<..
/${RHKERSRCDIR}/patch-042stab092
163 cd
${KERNEL_SRC}; patch
-p1
<..
/do-not-use-barrier-on-ext3.patch
164 cd
${KERNEL_SRC}; patch
-p1
<..
/bridge-patch.diff
165 #cd ${KERNEL_SRC}; patch -p1 <../kvm-fix-invalid-secondary-exec-controls.patch
166 #cd ${KERNEL_SRC}; patch -p1 <../0001-bridge-disable-querier.patch
167 #cd ${KERNEL_SRC}; patch -p1 <../0002-bridge-disable-querier.patch
168 #cd ${KERNEL_SRC}; patch -p1 <../0003-bridge-disable-querier.patch
169 #cd ${KERNEL_SRC}; patch -p1 <../0004-bridge-disable-querier.patch
170 # this enable querier by default
171 cd
${KERNEL_SRC}; patch
-p1
<..
/0005-bridge-disable-querier.patch
172 #cd ${KERNEL_SRC}; patch -p1 <../0001-bridge-only-expire-the-mdb-entry-when-query-is-recei.patch
173 #cd ${KERNEL_SRC}; patch -p1 <../0002-bridge-send-query-as-soon-as-leave-is-received.patch
174 cd
${KERNEL_SRC}; patch
-p1
<..
/fix-aspm-policy.patch
175 cd
${KERNEL_SRC}; patch
-p1
<..
/kbuild-generate-mudules-builtin.patch
176 cd
${KERNEL_SRC}; patch
-p1
<..
/add-tiocgdev-ioctl.patch
177 #cd ${KERNEL_SRC}; patch -p1 <../fix-nfs-block-count.patch
178 cd
${KERNEL_SRC}; patch
-p1
<..
/fix-idr-header-for-drbd-compilation.patch
179 cd
${KERNEL_SRC}; patch
-p1
<..
/kvm-x86-ignore-ioapic-polarity.patch
180 sed
-i
${KERNEL_SRC}/Makefile
-e
's/^EXTRAVERSION.*$$/EXTRAVERSION=${EXTRAVERSION}/'
183 ${KERNEL_SRC}.org
/README
: ${RHKERSRCDIR}/kernel.spec
${RHKERSRCDIR}/linux-
${KERNEL_VER}-${RHKVER}.
tar.bz2
184 rm -rf
${KERNEL_SRC}.org linux-
${KERNEL_VER}-${RHKVER}
185 tar xf
${RHKERSRCDIR}/linux-
${KERNEL_VER}-${RHKVER}.
tar.bz2
186 mv linux-
${KERNEL_VER}-${RHKVER} ${KERNEL_SRC}.org
189 ${RHKERSRCDIR}/kernel.spec
: ${KERNELSRCRPM}
190 rm -rf
${RHKERSRCDIR}
192 cd
${RHKERSRCDIR};rpm2cpio ..
/${KERNELSRCRPM} |cpio
-i
195 rr272x_1x.ko
: .compile_mark
${RR272XSRC}
198 mkdir
-p
/lib
/modules
/${KVNAME}
199 ln
-sf
${TOP}/${KERNEL_SRC} /lib
/modules
/${KVNAME}/build
200 make
-C
${TOP}/${RR272XDIR}/product
/rr272x
/linux KERNELDIR
=${TOP}/${KERNEL_SRC}
201 cp
${RR272XDIR}/product
/rr272x
/linux
/$@ .
203 megaraid_sas.ko
: .compile_mark
${MEGARAID_SRC}
204 rm -rf
${MEGARAID_DIR}
205 tar xf
${MEGARAID_SRC}
206 mkdir
-p
/lib
/modules
/${KVNAME}
207 ln
-sf
${TOP}/${KERNEL_SRC} /lib
/modules
/${KVNAME}/build
208 make
-C
${TOP}/${KERNEL_SRC} M
=${TOP}/${MEGARAID_DIR} modules
209 cp
${MEGARAID_DIR}/megaraid_sas.ko .
211 aacraid.ko
: .compile_mark
${AACRAIDSRC}
214 cd
${AACRAIDDIR};tar xzf ..
/${AACRAIDSRC}
215 cd
${AACRAIDDIR};rpm2cpio aacraid-
${AACRAIDVER}.src.rpm|cpio
-i
216 cd
${AACRAIDDIR};tar xf aacraid_source.tgz
217 mkdir
-p
/lib
/modules
/${KVNAME}
218 ln
-sf
${TOP}/${KERNEL_SRC} /lib
/modules
/${KVNAME}/build
219 make
-C
${TOP}/${KERNEL_SRC} M
=${TOP}/${AACRAIDDIR} modules
220 cp
${AACRAIDDIR}/aacraid.ko .
222 aoe.ko aoe
: .compile_mark
${AOESRC}
224 rm -rf
${AOEDIR} aoe.ko
226 mkdir
-p
/lib
/modules
/${KVNAME}
227 ln
-sf
${TOP}/${KERNEL_SRC} /lib
/modules
/${KVNAME}/build
228 cd
${AOEDIR}; make KVER
=${KVNAME}
229 cp
${AOEDIR}/linux
/drivers
/block
/aoe
/aoe.ko aoe.ko
231 e1000e.ko e1000e
: .compile_mark
${E1000ESRC}
234 mkdir
-p
/lib
/modules
/${KVNAME}
235 ln
-sf
${TOP}/${KERNEL_SRC} /lib
/modules
/${KVNAME}/build
236 cd
${E1000EDIR}/src
; make BUILD_KERNEL
=${KVNAME}
237 cp
${E1000EDIR}/src
/e1000e.ko e1000e.ko
239 igb.ko igb
: .compile_mark
${IGBSRC}
242 mkdir
-p
/lib
/modules
/${KVNAME}
243 ln
-sf
${TOP}/${KERNEL_SRC} /lib
/modules
/${KVNAME}/build
244 cd
${IGBDIR}/src
; make BUILD_KERNEL
=${KVNAME}
245 cp
${IGBDIR}/src
/igb.ko igb.ko
247 ixgbe.ko ixgbe
: .compile_mark
${IXGBESRC}
250 mkdir
-p
/lib
/modules
/${KVNAME}
251 ln
-sf
${TOP}/${KERNEL_SRC} /lib
/modules
/${KVNAME}/build
252 cd
${IXGBEDIR}/src
; make CFLAGS_EXTRA
="-DIXGBE_NO_LRO" BUILD_KERNEL
=${KVNAME}
253 cp
${IXGBEDIR}/src
/ixgbe.ko ixgbe.ko
255 bnx2.ko cnic.ko bnx2x.ko
: ${BNX2SRC}
258 mkdir
-p
/lib
/modules
/${KVNAME}
259 ln
-sf
${TOP}/${KERNEL_SRC} /lib
/modules
/${KVNAME}/build
260 cd
${BNX2DIR}; make
-C bnx2
/src KVER
=${KVNAME}
261 cd
${BNX2DIR}; make
-C bnx2x
/src KVER
=${KVNAME}
262 cp
`find ${BNX2DIR} -name bnx2.ko -o -name cnic.ko -o -name bnx2x.ko` .
264 arcmsr.ko
: .compile_mark
${ARECASRC}
266 mkdir
${ARECADIR}; cd
${ARECADIR}; unzip ..
/${ARECASRC}
267 mkdir
-p
/lib
/modules
/${KVNAME}
268 ln
-sf
${TOP}/${KERNEL_SRC} /lib
/modules
/${KVNAME}/build
269 cd
${ARECADIR}; make
-C
${TOP}/${KERNEL_SRC} SUBDIRS
=${TOP}/${ARECADIR} modules
270 cp
${ARECADIR}/arcmsr.ko arcmsr.ko
272 iscsi_trgt.ko
: .compile_mark
${ISCSITARGETSRC}
273 rm -rf
${ISCSITARGETDIR}
274 tar xf
${ISCSITARGETSRC}
275 cd
${ISCSITARGETDIR}; make KSRC
=${TOP}/${KERNEL_SRC}
276 cp
${ISCSITARGETDIR}/kernel
/iscsi_trgt.ko iscsi_trgt.ko
278 headers_tmp
:= $(CURDIR
)/tmp-headers
279 headers_dir
:= $(headers_tmp
)/usr
/src
/linux-headers-
${KVNAME}
281 ${HDR_DEB} hdr
: .compile_mark headers-control.in headers-postinst.in
282 rm -rf
$(headers_tmp
)
283 install -d
$(headers_tmp
)/DEBIAN
$(headers_dir
)/include/
284 sed
-e
's/@KERNEL_VER@/${KERNEL_VER}/' -e
's/@KVNAME@/${KVNAME}/' -e
's/@PKGREL@/${PKGREL}/' <headers-control.in
>$(headers_tmp
)/DEBIAN
/control
285 sed
-e
's/@@KVNAME@@/${KVNAME}/g' <headers-postinst.in
>$(headers_tmp
)/DEBIAN
/postinst
286 chmod
0755 $(headers_tmp
)/DEBIAN
/postinst
287 install -D
-m
644 copyright
$(headers_tmp
)/usr
/share
/doc
/${HDRPACKAGE}/copyright
288 install -D
-m
644 changelog.Debian
$(headers_tmp
)/usr
/share
/doc
/${HDRPACKAGE}/changelog.Debian
289 echo
"git clone git://git.proxmox.com/git/pve-kernel-2.6.32.git\\ngit checkout ${GITVERSION}" > $(headers_tmp
)/usr
/share
/doc
/${HDRPACKAGE}/SOURCE
290 gzip
-f
--best
$(headers_tmp
)/usr
/share
/doc
/${HDRPACKAGE}/changelog.Debian
291 install -m
0644 ${KERNEL_SRC}/.config
$(headers_dir
)
292 install -m
0644 ${KERNEL_SRC}/Module.symvers
$(headers_dir
)
293 cd
${KERNEL_SRC}; find .
-path
'./debian/*' -prune
-o
-path
'./include/*' -prune
-o
-path
'./Documentation' -prune \
294 -o
-path
'./scripts' -prune
-o
-type f \
295 \
( -name
'Makefile*' -o
-name
'Kconfig*' -o
-name
'Kbuild*' -o \
296 -name
'*.sh' -o
-name
'*.pl' \
) \
297 -print | cpio
-pd
--preserve-modification-time
$(headers_dir
)
298 cd
${KERNEL_SRC}; cp
-a
include scripts
$(headers_dir
)
299 cd
${KERNEL_SRC}; (find arch
/x86
-name
include -type d
-print | \
300 xargs
-n1
-i
: find
: -type f
) | \
301 cpio
-pd
--preserve-modification-time
$(headers_dir
)
302 dpkg-deb
--build
$(headers_tmp
) ${HDR_DEB}
306 upload
: ${DST_DEB} ${PVE_DEB} ${HDR_DEB}
307 umount
/pve
/${RELEASE}; mount
/pve
/${RELEASE} -o rw
308 mkdir
-p
/pve
/${RELEASE}/extra
309 mkdir
-p
/pve
/${RELEASE}/install
310 rm -rf
/pve
/${RELEASE}/extra
/${PACKAGE}_
*.deb
311 rm -rf
/pve
/${RELEASE}/extra
/${HDRPACKAGE}_
*.deb
312 rm -rf
/pve
/${RELEASE}/extra
/${PVEPKG}_
*.deb
313 rm -rf
/pve
/${RELEASE}/extra
/Packages
*
314 cp
${DST_DEB} ${PVE_DEB} ${HDR_DEB} /pve
/${RELEASE}/extra
315 cd
/pve
/${RELEASE}/extra
; dpkg-scanpackages .
/dev
/null | gzip
-9c
> Packages.gz
316 umount
/pve
/${RELEASE}; mount
/pve
/${RELEASE} -o ro
320 rm -rf linux-firmware.git linux-firmware-from-kernel.git
${KERNEL_SRC}.org
${RHKERSRCDIR}
324 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} ${BNX2DIR} bnx2.ko cnic.ko bnx2x.ko aacraid.ko
${AACRAIDDIR} megaraid_sas.ko
${MEGARAID_DIR} rr272x_1x.ko
${RR272XDIR} ${ARECADIR}.ko
${ARECADIR}