5 # also include firmware of previous versrion into
6 # the fw package: fwlist-2.6.32-PREV-pve
11 KERNELSRCRPM
=kernel-
${KERNEL_VER}-${RHKVER}.src.rpm
13 EXTRAVERSION
=-${KREL}-pve
14 KVNAME
=${KERNEL_VER}${EXTRAVERSION}
15 PACKAGE
=pve-kernel-
${KVNAME}
16 HDRPACKAGE
=pve-headers-
${KVNAME}
19 GITVERSION
:=$(shell cat .git
/refs
/heads
/master
)
23 KERNEL_SRC
=linux-2.6
-${KERNEL_VER}
24 RHKERSRCDIR
=rh-kernel-src
25 KERNEL_CFG
=config-
${KERNEL_VER}
27 KERNEL_CFG_ORG
=${RHKERSRCDIR}/kernel-
${KERNEL_VER}-x86_64.config
31 FW_DEB
=pve-firmware_
${FW_VER}-${FW_REL}_all.deb
33 E1000EDIR
=e1000e-3
.1.0.2
34 E1000ESRC
=${E1000EDIR}.
tar.gz
37 IGBSRC
=${IGBDIR}.
tar.gz
40 IXGBESRC
=${IXGBEDIR}.
tar.gz
42 BNX2DIR
=netxtreme2-7.10
.14
43 BNX2SRC
=${BNX2DIR}.
tar.gz
45 AACRAIDVER
=1.2.1-40700
46 AACRAIDDIR
=aacraid-
${AACRAIDVER}.src
47 AACRAIDSRC
=aacraid-linux-src-
${AACRAIDVER}.tgz
49 # driver does not compile
50 #MEGARAID_DIR=megaraid_sas-06.703.11.00
51 #MEGARAID_SRC=${MEGARAID_DIR}-src.tar.gz
53 ARECADIR
=arcmsr-1.30
.0X
.19-140509
54 ARECASRC
=${ARECADIR}.zip
56 # this one does not compile with newer 3.10 kernels!
57 #RR272XSRC=RR272x_1x-Linux-Src-v1.5-130325-0732.tar.gz
58 #RR272XDIR=rr272x_1x-linux-src-v1.5
60 # this project look dead - no updates since 3 years
61 #ISCSITARGETDIR=iscsitarget-1.4.20.2
62 #ISCSITARGETSRC=${ISCSITARGETDIR}.tar.gz
64 DST_DEB
=${PACKAGE}_
${KERNEL_VER}-${PKGREL}_
${ARCH}.deb
65 HDR_DEB
=${HDRPACKAGE}_
${KERNEL_VER}-${PKGREL}_
${ARCH}.deb
66 PVEPKG
=proxmox-ve-
${KERNEL_VER}
67 PVE_DEB
=${PVEPKG}_
${RELEASE}-${PKGREL}_all.deb
69 all: check_gcc
${DST_DEB} ${FW_DEB} ${HDR_DEB}
74 #wget http://vault.centos.org/7.0.1406/os/Source/SPackages/${KERNELSRCRPM}
75 wget http
://vault.centos.org
/7.0.1406/updates
/Source
/SPackages
/${KERNELSRCRPM}
79 gcc
--version|grep
"4\.7\.2" || false
81 $(CC
) --version|grep
"4\.7" || false
84 ${DST_DEB}: data control.in postinst.in postrm.in copyright changelog.Debian
86 sed
-e
's/@KERNEL_VER@/${KERNEL_VER}/' -e
's/@KVNAME@/${KVNAME}/' -e
's/@PKGREL@/${PKGREL}/' <control.in
>data
/DEBIAN
/control
87 sed
-e
's/@@KVNAME@@/${KVNAME}/g' <postinst.in
>data
/DEBIAN
/postinst
88 chmod
0755 data
/DEBIAN
/postinst
89 sed
-e
's/@@KVNAME@@/${KVNAME}/g' <postrm.in
>data
/DEBIAN
/postrm
90 chmod
0755 data
/DEBIAN
/postrm
91 install -D
-m
644 copyright data
/usr
/share
/doc
/${PACKAGE}/copyright
92 install -D
-m
644 changelog.Debian data
/usr
/share
/doc
/${PACKAGE}/changelog.Debian
93 echo
"git clone git://git.proxmox.com/git/pve-kernel-3.2.0.git\\ngit checkout ${GITVERSION}" > data
/usr
/share
/doc
/${PACKAGE}/SOURCE
94 gzip
-f
--best data
/usr
/share
/doc
/${PACKAGE}/changelog.Debian
95 rm -f data
/lib
/modules
/${KVNAME}/source
96 rm -f data
/lib
/modules
/${KVNAME}/build
97 dpkg-deb
--build data
${DST_DEB}
101 fwlist-
${KVNAME}: data
102 .
/find-firmware.pl data
/lib
/modules
/${KVNAME} >fwlist.tmp
105 # fixme: bnx2.ko cnic.ko bnx2x.ko
106 data
: .compile_mark
${KERNEL_CFG} e1000e.ko igb.ko ixgbe.ko bnx2.ko cnic.ko bnx2x.ko aacraid.ko arcmsr.ko
107 rm -rf data tmp
; mkdir
-p tmp
/lib
/modules
/${KVNAME}
109 install -m
644 ${KERNEL_CFG} tmp
/boot
/config-
${KVNAME}
110 install -m
644 ${KERNEL_SRC}/System.map tmp
/boot
/System.map-
${KVNAME}
111 install -m
644 ${KERNEL_SRC}/arch
/x86_64
/boot
/bzImage tmp
/boot
/vmlinuz-
${KVNAME}
112 cd
${KERNEL_SRC}; make INSTALL_MOD_PATH
=..
/tmp
/ modules_install
113 # install latest ixgbe driver
114 install -m
644 ixgbe.ko tmp
/lib
/modules
/${KVNAME}/kernel
/drivers
/net
/ethernet
/intel
/ixgbe
/
115 # install latest e1000e driver
116 install -m
644 e1000e.ko tmp
/lib
/modules
/${KVNAME}/kernel
/drivers
/net
/ethernet
/intel
/e1000e
/
117 # install latest ibg driver
118 install -m
644 igb.ko tmp
/lib
/modules
/${KVNAME}/kernel
/drivers
/net
/ethernet
/intel
/igb
/
119 ## install bnx2 drivers
120 install -m
644 bnx2.ko tmp
/lib
/modules
/${KVNAME}/kernel
/drivers
/net
/ethernet
/broadcom
/
121 install -m
644 cnic.ko tmp
/lib
/modules
/${KVNAME}/kernel
/drivers
/net
/ethernet
/broadcom
/
122 install -m
644 bnx2x.ko tmp
/lib
/modules
/${KVNAME}/kernel
/drivers
/net
/ethernet
/broadcom
/bnx2x
/
123 # install aacraid drivers
124 install -m
644 aacraid.ko tmp
/lib
/modules
/${KVNAME}/kernel
/drivers
/scsi
/aacraid
/
125 # install megaraid_sas driver
126 # install -m 644 megaraid_sas.ko tmp/lib/modules/${KVNAME}/kernel/drivers/scsi/megaraid/
127 ## install Highpoint 2710 RAID driver
128 #install -m 644 rr272x_1x.ko -D tmp/lib/modules/${KVNAME}/kernel/drivers/scsi/rr272x_1x/rr272x_1x.ko
129 # install areca driver
130 install -m
644 arcmsr.ko tmp
/lib
/modules
/${KVNAME}/kernel
/drivers
/scsi
/arcmsr
/
132 rm -rf tmp
/lib
/firmware
134 find tmp
/lib
/modules
-name \
*.ko
-print | while read f
; do
strip --strip-debug
"$$f"; done
136 depmod
-b tmp
/ ${KVNAME}
139 .compile_mark
: ${KERNEL_SRC}/README
${KERNEL_CFG}
140 cp
${KERNEL_CFG} ${KERNEL_SRC}/.config
141 cd
${KERNEL_SRC}; make oldconfig
142 cd
${KERNEL_SRC}; make
-j
8
145 ${KERNEL_CFG}: ${KERNEL_CFG_ORG} config-
${KERNEL_VER}.diff
146 cp
${KERNEL_CFG_ORG} ${KERNEL_CFG}.new
147 patch
--no-backup
${KERNEL_CFG}.new config-
${KERNEL_VER}.diff
148 mv
${KERNEL_CFG}.new
${KERNEL_CFG}
150 ${KERNEL_SRC}/README
: ${KERNEL_SRC}.org
/README
152 cp
-a
${KERNEL_SRC}.org
${KERNEL_SRC}
153 #cd ${KERNEL_SRC}; patch -p1 <../bootsplash-3.8.diff
154 #cd ${KERNEL_SRC}; patch -p1 <../${RHKERSRCDIR}/patch-042stab083
155 #cd ${KERNEL_SRC}; patch -p1 <../do-not-use-barrier-on-ext3.patch
156 cd
${KERNEL_SRC}; patch
-p1
<..
/bridge-patch.diff
157 #cd ${KERNEL_SRC}; patch -p1 <../kvm-fix-invalid-secondary-exec-controls.patch
158 #cd ${KERNEL_SRC}; patch -p1 <../fix-aspm-policy.patch
159 #cd ${KERNEL_SRC}; patch -p1 <../kbuild-generate-mudules-builtin.patch
160 #cd ${KERNEL_SRC}; patch -p1 <../add-tiocgdev-ioctl.patch
161 #cd ${KERNEL_SRC}; patch -p1 <../fix-nfs-block-count.patch
162 #cd ${KERNEL_SRC}; patch -p1 <../fix-idr-header-for-drbd-compilation.patch
163 cd
${KERNEL_SRC}; patch
-p1
<..
/add-empty-ndo_poll_controller-to-veth.patch
164 cd
${KERNEL_SRC}; patch
-p1
<..
/override_for_missing_acs_capabilities.patch
165 cd
${KERNEL_SRC}; patch
-p1
<..
/tg3-fix-deadlock_in_tg3_change_mtu.patch
166 sed
-i
${KERNEL_SRC}/Makefile
-e
's/^EXTRAVERSION.*$$/EXTRAVERSION=${EXTRAVERSION}/'
169 ${KERNEL_SRC}.org
/README
: ${RHKERSRCDIR}/kernel.spec
${RHKERSRCDIR}/linux-
${KERNEL_VER}-${RHKVER}.
tar.xz
170 rm -rf
${KERNEL_SRC}.org linux-
${KERNEL_VER}-${RHKVER}
171 tar xf
${RHKERSRCDIR}/linux-
${KERNEL_VER}-${RHKVER}.
tar.xz
172 mv linux-
${KERNEL_VER}-${RHKVER} ${KERNEL_SRC}.org
175 ${RHKERSRCDIR}/kernel.spec
: ${KERNELSRCRPM}
176 rm -rf
${RHKERSRCDIR}
178 cd
${RHKERSRCDIR};rpm2cpio ..
/${KERNELSRCRPM} |cpio
-i
181 #rr272x_1x.ko: .compile_mark ${RR272XSRC}
182 # rm -rf ${RR272XDIR}
183 # tar xf ${RR272XSRC}
184 # mkdir -p /lib/modules/${KVNAME}
185 # ln -sf ${TOP}/${KERNEL_SRC} /lib/modules/${KVNAME}/build
186 # make -C ${TOP}/${RR272XDIR}/product/rr272x/linux KERNELDIR=${TOP}/${KERNEL_SRC}
187 # cp ${RR272XDIR}/product/rr272x/linux/$@ .
189 aacraid.ko
: .compile_mark
${AACRAIDSRC}
192 cd
${AACRAIDDIR};tar xzf ..
/${AACRAIDSRC}
193 cd
${AACRAIDDIR};rpm2cpio aacraid-
${AACRAIDVER}.src.rpm|cpio
-i
194 cd
${AACRAIDDIR};tar xf aacraid_source.tgz
195 mkdir
-p
/lib
/modules
/${KVNAME}
196 ln
-sf
${TOP}/${KERNEL_SRC} /lib
/modules
/${KVNAME}/build
197 make
-C
${TOP}/${KERNEL_SRC} M
=${TOP}/${AACRAIDDIR} modules
198 cp
${AACRAIDDIR}/aacraid.ko .
200 e1000e.ko e1000e
: .compile_mark
${E1000ESRC}
203 mkdir
-p
/lib
/modules
/${KVNAME}
204 ln
-sf
${TOP}/${KERNEL_SRC} /lib
/modules
/${KVNAME}/build
205 cd
${E1000EDIR}/src
; make BUILD_KERNEL
=${KVNAME}
206 cp
${E1000EDIR}/src
/e1000e.ko e1000e.ko
208 igb.ko igb
: .compile_mark
${IGBSRC}
211 mkdir
-p
/lib
/modules
/${KVNAME}
212 ln
-sf
${TOP}/${KERNEL_SRC} /lib
/modules
/${KVNAME}/build
213 cd
${IGBDIR}/src
; make BUILD_KERNEL
=${KVNAME}
214 cp
${IGBDIR}/src
/igb.ko igb.ko
216 ixgbe.ko ixgbe
: .compile_mark
${IXGBESRC}
219 mkdir
-p
/lib
/modules
/${KVNAME}
220 ln
-sf
${TOP}/${KERNEL_SRC} /lib
/modules
/${KVNAME}/build
221 cd
${IXGBEDIR}/src
; make CFLAGS_EXTRA
="-DIXGBE_NO_LRO" BUILD_KERNEL
=${KVNAME}
222 cp
${IXGBEDIR}/src
/ixgbe.ko ixgbe.ko
224 bnx2.ko cnic.ko bnx2x.ko
: ${BNX2SRC}
227 mkdir
-p
/lib
/modules
/${KVNAME}
228 ln
-sf
${TOP}/${KERNEL_SRC} /lib
/modules
/${KVNAME}/build
229 cd
${BNX2DIR}; make
-C bnx2
/src KVER
=${KVNAME}
230 cd
${BNX2DIR}; make
-C bnx2x
/src KVER
=${KVNAME}
231 cp
`find ${BNX2DIR} -name bnx2.ko -o -name cnic.ko -o -name bnx2x.ko` .
233 arcmsr.ko
: .compile_mark
${ARECASRC}
235 mkdir
${ARECADIR}; cd
${ARECADIR}; unzip ..
/${ARECASRC}
236 mkdir
-p
/lib
/modules
/${KVNAME}
237 ln
-sf
${TOP}/${KERNEL_SRC} /lib
/modules
/${KVNAME}/build
238 cd
${ARECADIR}; make
-C
${TOP}/${KERNEL_SRC} SUBDIRS
=${TOP}/${ARECADIR} modules
239 cp
${ARECADIR}/arcmsr.ko arcmsr.ko
241 #iscsi_trgt.ko: .compile_mark ${ISCSITARGETSRC}
242 # rm -rf ${ISCSITARGETDIR}
243 # tar xf ${ISCSITARGETSRC}
244 # cd ${ISCSITARGETDIR}; make KSRC=${TOP}/${KERNEL_SRC}
245 # cp ${ISCSITARGETDIR}/kernel/iscsi_trgt.ko iscsi_trgt.ko
247 headers_tmp
:= $(CURDIR
)/tmp-headers
248 headers_dir
:= $(headers_tmp
)/usr
/src
/linux-headers-
${KVNAME}
250 ${HDR_DEB} hdr
: .compile_mark headers-control.in headers-postinst.in
251 rm -rf
$(headers_tmp
)
252 install -d
$(headers_tmp
)/DEBIAN
$(headers_dir
)/include/
253 sed
-e
's/@KERNEL_VER@/${KERNEL_VER}/' -e
's/@KVNAME@/${KVNAME}/' -e
's/@PKGREL@/${PKGREL}/' <headers-control.in
>$(headers_tmp
)/DEBIAN
/control
254 sed
-e
's/@@KVNAME@@/${KVNAME}/g' <headers-postinst.in
>$(headers_tmp
)/DEBIAN
/postinst
255 chmod
0755 $(headers_tmp
)/DEBIAN
/postinst
256 install -D
-m
644 copyright
$(headers_tmp
)/usr
/share
/doc
/${HDRPACKAGE}/copyright
257 install -D
-m
644 changelog.Debian
$(headers_tmp
)/usr
/share
/doc
/${HDRPACKAGE}/changelog.Debian
258 echo
"git clone git://git.proxmox.com/git/pve-kernel-3.10.0.git\\ngit checkout ${GITVERSION}" > $(headers_tmp
)/usr
/share
/doc
/${HDRPACKAGE}/SOURCE
259 gzip
-f
--best
$(headers_tmp
)/usr
/share
/doc
/${HDRPACKAGE}/changelog.Debian
260 install -m
0644 ${KERNEL_SRC}/.config
$(headers_dir
)
261 install -m
0644 ${KERNEL_SRC}/Module.symvers
$(headers_dir
)
262 cd
${KERNEL_SRC}; find .
-path
'./debian/*' -prune
-o
-path
'./include/*' -prune
-o
-path
'./Documentation' -prune \
263 -o
-path
'./scripts' -prune
-o
-type f \
264 \
( -name
'Makefile*' -o
-name
'Kconfig*' -o
-name
'Kbuild*' -o \
265 -name
'*.sh' -o
-name
'*.pl' \
) \
266 -print | cpio
-pd
--preserve-modification-time
$(headers_dir
)
267 cd
${KERNEL_SRC}; cp
-a
include scripts
$(headers_dir
)
268 cd
${KERNEL_SRC}; (find arch
/x86
-name
include -type d
-print | \
269 xargs
-n1
-i
: find
: -type f
) | \
270 cpio
-pd
--preserve-modification-time
$(headers_dir
)
271 dpkg-deb
--build
$(headers_tmp
) ${HDR_DEB}
274 dvb-firmware.git
/README
:
275 git clone https
://github.com
/OpenELEC
/dvb-firmware.git dvb-firmware.git
277 linux-firmware.git
/WHENCE
:
278 git clone git
://git.kernel.org
/pub
/scm
/linux
/kernel
/git
/firmware
/linux-firmware.git linux-firmware.git
280 ${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
.35-1-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-
${KVNAME}
282 mkdir
-p fwdata
/lib
/firmware
283 .
/assemble-firmware.pl fwlist-
${KVNAME} fwdata
/lib
/firmware
284 # include any files from older/newer kernels here
285 .
/assemble-firmware.pl fwlist-2.6
.24-12-pve fwdata
/lib
/firmware
286 .
/assemble-firmware.pl fwlist-2.6
.18-2-pve fwdata
/lib
/firmware
287 .
/assemble-firmware.pl fwlist-2.6
.32-3-pve fwdata
/lib
/firmware
288 .
/assemble-firmware.pl fwlist-2.6
.32-4-pve fwdata
/lib
/firmware
289 .
/assemble-firmware.pl fwlist-2.6
.32-6-pve fwdata
/lib
/firmware
290 .
/assemble-firmware.pl fwlist-2.6
.35-1-pve fwdata
/lib
/firmware
291 .
/assemble-firmware.pl fwlist-2.6
.32-13-pve fwdata
/lib
/firmware
292 .
/assemble-firmware.pl fwlist-2.6
.32-14-pve fwdata
/lib
/firmware
293 .
/assemble-firmware.pl fwlist-2.6
.32-20-pve fwdata
/lib
/firmware
294 .
/assemble-firmware.pl fwlist-2.6
.32-21-pve fwdata
/lib
/firmware
295 .
/assemble-firmware.pl fwlist-3.10
.0-3-pve fwdata
/lib
/firmware
296 install -d fwdata
/usr
/share
/doc
/pve-firmware
297 cp linux-firmware.git
/WHENCE fwdata
/usr
/share
/doc
/pve-firmware
/README
298 install -d fwdata
/usr
/share
/doc
/pve-firmware
/licenses
299 cp linux-firmware.git
/LICEN
[CS
]E
* fwdata
/usr
/share
/doc
/pve-firmware
/licenses
300 install -D
-m
0644 changelog.firmware fwdata
/usr
/share
/doc
/pve-firmware
/changelog.Debian
301 gzip
-9 fwdata
/usr
/share
/doc
/pve-firmware
/changelog.Debian
302 echo
"git clone git://git.proxmox.com/git/pve-kernel-2.6.32.git\\ngit checkout ${GITVERSION}" >fwdata
/usr
/share
/doc
/pve-firmware
/SOURCE
303 install -d fwdata
/DEBIAN
304 sed
-e
's/@VERSION@/${FW_VER}-${FW_REL}/' <control.firmware
>fwdata
/DEBIAN
/control
305 dpkg-deb
--build fwdata
${FW_DEB}
308 upload
: ${DST_DEB} ${HDR_DEB} ${FW_DEB}
309 umount
/pve
/${RELEASE}; mount
/pve
/${RELEASE} -o rw
310 mkdir
-p
/pve
/${RELEASE}/extra
311 mkdir
-p
/pve
/${RELEASE}/install
312 rm -rf
/pve
/${RELEASE}/extra
/${PACKAGE}_
*.deb
313 rm -rf
/pve
/${RELEASE}/extra
/${HDRPACKAGE}_
*.deb
314 rm -rf
/pve
/${RELEASE}/extra
/pve-firmware
*.deb
315 rm -rf
/pve
/${RELEASE}/extra
/Packages
*
316 cp
${DST_DEB} ${FW_DEB} ${HDR_DEB} /pve
/${RELEASE}/extra
317 cd
/pve
/${RELEASE}/extra
; dpkg-scanpackages .
/dev
/null | gzip
-9c
> Packages.gz
318 umount
/pve
/${RELEASE}; mount
/pve
/${RELEASE} -o ro
322 rm -rf linux-firmware.git dvb-firmware.git
${KERNEL_SRC}.org
${RHKERSRCDIR}
326 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} ${BNX2DIR} bnx2.ko cnic.ko bnx2x.ko aacraid.ko
${AACRAIDDIR} rr272x_1x.ko
${RR272XDIR} ${ARECADIR}.ko
${ARECADIR}