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
.0.4.1
34 E1000ESRC
=${E1000EDIR}.
tar.gz
37 IGBSRC
=${IGBDIR}.
tar.gz
40 IXGBESRC
=${IXGBEDIR}.
tar.gz
42 # this does not compile correctly
43 BNX2DIR
=netxtreme2-7.8
.56
44 BNX2SRC
=${BNX2DIR}.
tar.gz
46 AACRAIDVER
=1.2.1-40300
47 AACRAIDDIR
=aacraid-
${AACRAIDVER}.src
48 AACRAIDSRC
=aacraid-linux-src-
${AACRAIDVER}.tgz
50 # kernel contains newer version 06.700.06.00-rc1
51 #MEGARAID_DIR=megaraid_sas-06.600.18.00
52 #MEGARAID_SRC=${MEGARAID_DIR}-src.tar.gz
54 ARECADIR
=arcmsr-1.30
.0X
.16-20131206
55 ARECASRC
=${ARECADIR}.zip
57 # this one does not compile with newer 3.10 kernels!
58 #RR272XSRC=RR272x_1x-Linux-Src-v1.5-130325-0732.tar.gz
59 #RR272XDIR=rr272x_1x-linux-src-v1.5
61 # this project look dead - no updates since 3 years
62 #ISCSITARGETDIR=iscsitarget-1.4.20.2
63 #ISCSITARGETSRC=${ISCSITARGETDIR}.tar.gz
65 DST_DEB
=${PACKAGE}_
${KERNEL_VER}-${PKGREL}_
${ARCH}.deb
66 HDR_DEB
=${HDRPACKAGE}_
${KERNEL_VER}-${PKGREL}_
${ARCH}.deb
67 PVEPKG
=proxmox-ve-
${KERNEL_VER}
68 PVE_DEB
=${PVEPKG}_
${RELEASE}-${PKGREL}_all.deb
70 all: check_gcc
${DST_DEB} ${FW_DEB} ${HDR_DEB}
75 wget http
://vault.centos.org
/7.0.1406/os
/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 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 install -D
-m
644 copyright data
/usr
/share
/doc
/${PACKAGE}/copyright
90 install -D
-m
644 changelog.Debian data
/usr
/share
/doc
/${PACKAGE}/changelog.Debian
91 echo
"git clone git://git.proxmox.com/git/pve-kernel-3.2.0.git\\ngit checkout ${GITVERSION}" > data
/usr
/share
/doc
/${PACKAGE}/SOURCE
92 gzip
-f
--best data
/usr
/share
/doc
/${PACKAGE}/changelog.Debian
93 rm -f data
/lib
/modules
/${KVNAME}/source
94 rm -f data
/lib
/modules
/${KVNAME}/build
95 dpkg-deb
--build data
${DST_DEB}
99 fwlist-
${KVNAME}: data
100 .
/find-firmware.pl data
/lib
/modules
/${KVNAME} >fwlist.tmp
103 # fixme: bnx2.ko cnic.ko bnx2x.ko
104 data
: .compile_mark
${KERNEL_CFG} e1000e.ko igb.ko ixgbe.ko aacraid.ko arcmsr.ko
105 rm -rf data tmp
; mkdir
-p tmp
/lib
/modules
/${KVNAME}
107 install -m
644 ${KERNEL_CFG} tmp
/boot
/config-
${KVNAME}
108 install -m
644 ${KERNEL_SRC}/System.map tmp
/boot
/System.map-
${KVNAME}
109 install -m
644 ${KERNEL_SRC}/arch
/x86_64
/boot
/bzImage tmp
/boot
/vmlinuz-
${KVNAME}
110 cd
${KERNEL_SRC}; make INSTALL_MOD_PATH
=..
/tmp
/ modules_install
111 # install latest ixgbe driver
112 install -m
644 ixgbe.ko tmp
/lib
/modules
/${KVNAME}/kernel
/drivers
/net
/ethernet
/intel
/ixgbe
/
113 # install latest e1000e driver
114 install -m
644 e1000e.ko tmp
/lib
/modules
/${KVNAME}/kernel
/drivers
/net
/ethernet
/intel
/e1000e
/
115 # install latest ibg driver
116 install -m
644 igb.ko tmp
/lib
/modules
/${KVNAME}/kernel
/drivers
/net
/ethernet
/intel
/igb
/
117 ## install bnx2 drivers
118 #install -m 644 bnx2.ko tmp/lib/modules/${KVNAME}/kernel/drivers/net/ethernet/broadcom/
119 #install -m 644 cnic.ko tmp/lib/modules/${KVNAME}/kernel/drivers/net/ethernet/broadcom/
120 #install -m 644 bnx2x.ko tmp/lib/modules/${KVNAME}/kernel/drivers/net/ethernet/broadcom/bnx2x/
121 # install aacraid drivers
122 install -m
644 aacraid.ko tmp
/lib
/modules
/${KVNAME}/kernel
/drivers
/scsi
/aacraid
/
123 ## install Highpoint 2710 RAID driver
124 #install -m 644 rr272x_1x.ko -D tmp/lib/modules/${KVNAME}/kernel/drivers/scsi/rr272x_1x/rr272x_1x.ko
125 # install areca driver
126 install -m
644 arcmsr.ko tmp
/lib
/modules
/${KVNAME}/kernel
/drivers
/scsi
/arcmsr
/
128 rm -rf tmp
/lib
/firmware
130 find tmp
/lib
/modules
-name \
*.ko
-print | while read f
; do
strip --strip-debug
"$$f"; done
132 depmod
-b tmp
/ ${KVNAME}
135 .compile_mark
: ${KERNEL_SRC}/README
${KERNEL_CFG}
136 cp
${KERNEL_CFG} ${KERNEL_SRC}/.config
137 cd
${KERNEL_SRC}; make oldconfig
138 cd
${KERNEL_SRC}; make
-j
8
141 ${KERNEL_CFG}: ${KERNEL_CFG_ORG} config-
${KERNEL_VER}.diff
142 cp
${KERNEL_CFG_ORG} ${KERNEL_CFG}.new
143 patch
--no-backup
${KERNEL_CFG}.new config-
${KERNEL_VER}.diff
144 mv
${KERNEL_CFG}.new
${KERNEL_CFG}
146 ${KERNEL_SRC}/README
: ${KERNEL_SRC}.org
/README
148 cp
-a
${KERNEL_SRC}.org
${KERNEL_SRC}
149 #cd ${KERNEL_SRC}; patch -p1 <../bootsplash-3.8.diff
150 #cd ${KERNEL_SRC}; patch -p1 <../${RHKERSRCDIR}/patch-042stab083
151 #cd ${KERNEL_SRC}; patch -p1 <../do-not-use-barrier-on-ext3.patch
152 cd
${KERNEL_SRC}; patch
-p1
<..
/bridge-patch.diff
153 #cd ${KERNEL_SRC}; patch -p1 <../kvm-fix-invalid-secondary-exec-controls.patch
154 #cd ${KERNEL_SRC}; patch -p1 <../fix-aspm-policy.patch
155 #cd ${KERNEL_SRC}; patch -p1 <../kbuild-generate-mudules-builtin.patch
156 #cd ${KERNEL_SRC}; patch -p1 <../add-tiocgdev-ioctl.patch
157 #cd ${KERNEL_SRC}; patch -p1 <../fix-nfs-block-count.patch
158 #cd ${KERNEL_SRC}; patch -p1 <../fix-idr-header-for-drbd-compilation.patch
159 cd
${KERNEL_SRC}; patch
-p1
<..
/n_tty-Fix-n_tty_write-crash-when-echoing-in-raw-mode.patch
160 cd
${KERNEL_SRC}; patch
-p1
<..
/add-empty-ndo_poll_controller-to-veth.patch
161 sed
-i
${KERNEL_SRC}/Makefile
-e
's/^EXTRAVERSION.*$$/EXTRAVERSION=${EXTRAVERSION}/'
164 ${KERNEL_SRC}.org
/README
: ${RHKERSRCDIR}/kernel.spec
${RHKERSRCDIR}/linux-
${KERNEL_VER}-${RHKVER}.
tar.xz
165 rm -rf
${KERNEL_SRC}.org linux-
${KERNEL_VER}-${RHKVER}
166 tar xf
${RHKERSRCDIR}/linux-
${KERNEL_VER}-${RHKVER}.
tar.xz
167 mv linux-
${KERNEL_VER}-${RHKVER} ${KERNEL_SRC}.org
170 ${RHKERSRCDIR}/kernel.spec
: ${KERNELSRCRPM}
171 rm -rf
${RHKERSRCDIR}
173 cd
${RHKERSRCDIR};rpm2cpio ..
/${KERNELSRCRPM} |cpio
-i
176 #rr272x_1x.ko: .compile_mark ${RR272XSRC}
177 # rm -rf ${RR272XDIR}
178 # tar xf ${RR272XSRC}
179 # mkdir -p /lib/modules/${KVNAME}
180 # ln -sf ${TOP}/${KERNEL_SRC} /lib/modules/${KVNAME}/build
181 # make -C ${TOP}/${RR272XDIR}/product/rr272x/linux KERNELDIR=${TOP}/${KERNEL_SRC}
182 # cp ${RR272XDIR}/product/rr272x/linux/$@ .
185 aacraid.ko
: .compile_mark
${AACRAIDSRC}
187 tar xzf
${AACRAIDSRC}
188 mkdir
-p
/lib
/modules
/${KVNAME}
189 ln
-sf
${TOP}/${KERNEL_SRC} /lib
/modules
/${KVNAME}/build
190 make
-C
${TOP}/${KERNEL_SRC} M
=${TOP}/${AACRAIDDIR}/aacraid_source modules
191 cp
${AACRAIDDIR}/aacraid_source
/aacraid.ko .
193 e1000e.ko e1000e
: .compile_mark
${E1000ESRC}
196 mkdir
-p
/lib
/modules
/${KVNAME}
197 ln
-sf
${TOP}/${KERNEL_SRC} /lib
/modules
/${KVNAME}/build
198 cd
${E1000EDIR}/src
; make BUILD_KERNEL
=${KVNAME}
199 cp
${E1000EDIR}/src
/e1000e.ko e1000e.ko
201 igb.ko igb
: .compile_mark
${IGBSRC}
204 mkdir
-p
/lib
/modules
/${KVNAME}
205 ln
-sf
${TOP}/${KERNEL_SRC} /lib
/modules
/${KVNAME}/build
206 cd
${IGBDIR}/src
; make BUILD_KERNEL
=${KVNAME}
207 cp
${IGBDIR}/src
/igb.ko igb.ko
209 ixgbe.ko ixgbe
: .compile_mark
${IXGBESRC}
212 mkdir
-p
/lib
/modules
/${KVNAME}
213 ln
-sf
${TOP}/${KERNEL_SRC} /lib
/modules
/${KVNAME}/build
214 cd
${IXGBEDIR}/src
; make CFLAGS_EXTRA
="-DIXGBE_NO_LRO" BUILD_KERNEL
=${KVNAME}
215 cp
${IXGBEDIR}/src
/ixgbe.ko ixgbe.ko
217 bnx2.ko cnic.ko bnx2x.ko
: ${BNX2SRC}
220 mkdir
-p
/lib
/modules
/${KVNAME}
221 ln
-sf
${TOP}/${KERNEL_SRC} /lib
/modules
/${KVNAME}/build
222 cd
${BNX2DIR}; make
-C bnx2
/src KVER
=${KVNAME}
223 cd
${BNX2DIR}; make
-C bnx2x
/src KVER
=${KVNAME}
224 cp
`find ${BNX2DIR} -name bnx2.ko -o -name cnic.ko -o -name bnx2x.ko` .
226 arcmsr.ko
: .compile_mark
${ARECASRC}
228 mkdir
${ARECADIR}; cd
${ARECADIR}; unzip ..
/${ARECASRC}
229 mkdir
-p
/lib
/modules
/${KVNAME}
230 ln
-sf
${TOP}/${KERNEL_SRC} /lib
/modules
/${KVNAME}/build
231 cd
${ARECADIR}; make
-C
${TOP}/${KERNEL_SRC} SUBDIRS
=${TOP}/${ARECADIR} modules
232 cp
${ARECADIR}/arcmsr.ko arcmsr.ko
234 #iscsi_trgt.ko: .compile_mark ${ISCSITARGETSRC}
235 # rm -rf ${ISCSITARGETDIR}
236 # tar xf ${ISCSITARGETSRC}
237 # cd ${ISCSITARGETDIR}; make KSRC=${TOP}/${KERNEL_SRC}
238 # cp ${ISCSITARGETDIR}/kernel/iscsi_trgt.ko iscsi_trgt.ko
240 headers_tmp
:= $(CURDIR
)/tmp-headers
241 headers_dir
:= $(headers_tmp
)/usr
/src
/linux-headers-
${KVNAME}
243 ${HDR_DEB} hdr
: .compile_mark headers-control.in headers-postinst.in
244 rm -rf
$(headers_tmp
)
245 install -d
$(headers_tmp
)/DEBIAN
$(headers_dir
)/include/
246 sed
-e
's/@KERNEL_VER@/${KERNEL_VER}/' -e
's/@KVNAME@/${KVNAME}/' -e
's/@PKGREL@/${PKGREL}/' <headers-control.in
>$(headers_tmp
)/DEBIAN
/control
247 sed
-e
's/@@KVNAME@@/${KVNAME}/g' <headers-postinst.in
>$(headers_tmp
)/DEBIAN
/postinst
248 chmod
0755 $(headers_tmp
)/DEBIAN
/postinst
249 install -D
-m
644 copyright
$(headers_tmp
)/usr
/share
/doc
/${HDRPACKAGE}/copyright
250 install -D
-m
644 changelog.Debian
$(headers_tmp
)/usr
/share
/doc
/${HDRPACKAGE}/changelog.Debian
251 echo
"git clone git://git.proxmox.com/git/pve-kernel-3.10.0.git\\ngit checkout ${GITVERSION}" > $(headers_tmp
)/usr
/share
/doc
/${HDRPACKAGE}/SOURCE
252 gzip
-f
--best
$(headers_tmp
)/usr
/share
/doc
/${HDRPACKAGE}/changelog.Debian
253 install -m
0644 ${KERNEL_SRC}/.config
$(headers_dir
)
254 install -m
0644 ${KERNEL_SRC}/Module.symvers
$(headers_dir
)
255 cd
${KERNEL_SRC}; find .
-path
'./debian/*' -prune
-o
-path
'./include/*' -prune
-o
-path
'./Documentation' -prune \
256 -o
-path
'./scripts' -prune
-o
-type f \
257 \
( -name
'Makefile*' -o
-name
'Kconfig*' -o
-name
'Kbuild*' -o \
258 -name
'*.sh' -o
-name
'*.pl' \
) \
259 -print | cpio
-pd
--preserve-modification-time
$(headers_dir
)
260 cd
${KERNEL_SRC}; cp
-a
include scripts
$(headers_dir
)
261 cd
${KERNEL_SRC}; (find arch
/x86
-name
include -type d
-print | \
262 xargs
-n1
-i
: find
: -type f
) | \
263 cpio
-pd
--preserve-modification-time
$(headers_dir
)
264 dpkg-deb
--build
$(headers_tmp
) ${HDR_DEB}
267 dvb-firmware.git
/README
:
268 git clone https
://github.com
/OpenELEC
/dvb-firmware.git dvb-firmware.git
270 linux-firmware.git
/WHENCE
:
271 git clone git
://git.kernel.org
/pub
/scm
/linux
/kernel
/git
/firmware
/linux-firmware.git linux-firmware.git
273 ${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-
${KVNAME}
275 mkdir
-p fwdata
/lib
/firmware
276 .
/assemble-firmware.pl fwlist-
${KVNAME} fwdata
/lib
/firmware
277 # include any files from older/newer kernels here
278 .
/assemble-firmware.pl fwlist-2.6
.24-12-pve fwdata
/lib
/firmware
279 .
/assemble-firmware.pl fwlist-2.6
.18-2-pve fwdata
/lib
/firmware
280 .
/assemble-firmware.pl fwlist-2.6
.32-3-pve fwdata
/lib
/firmware
281 .
/assemble-firmware.pl fwlist-2.6
.32-4-pve fwdata
/lib
/firmware
282 .
/assemble-firmware.pl fwlist-2.6
.32-6-pve fwdata
/lib
/firmware
283 .
/assemble-firmware.pl fwlist-2.6
.35-1-pve fwdata
/lib
/firmware
284 .
/assemble-firmware.pl fwlist-2.6
.32-13-pve fwdata
/lib
/firmware
285 .
/assemble-firmware.pl fwlist-2.6
.32-14-pve fwdata
/lib
/firmware
286 .
/assemble-firmware.pl fwlist-2.6
.32-20-pve fwdata
/lib
/firmware
287 .
/assemble-firmware.pl fwlist-2.6
.32-21-pve fwdata
/lib
/firmware
288 install -d fwdata
/usr
/share
/doc
/pve-firmware
289 cp linux-firmware.git
/WHENCE fwdata
/usr
/share
/doc
/pve-firmware
/README
290 install -d fwdata
/usr
/share
/doc
/pve-firmware
/licenses
291 cp linux-firmware.git
/LICEN
[CS
]E
* fwdata
/usr
/share
/doc
/pve-firmware
/licenses
292 install -D
-m
0644 changelog.firmware fwdata
/usr
/share
/doc
/pve-firmware
/changelog.Debian
293 gzip
-9 fwdata
/usr
/share
/doc
/pve-firmware
/changelog.Debian
294 echo
"git clone git://git.proxmox.com/git/pve-kernel-2.6.32.git\\ngit checkout ${GITVERSION}" >fwdata
/usr
/share
/doc
/pve-firmware
/SOURCE
295 install -d fwdata
/DEBIAN
296 sed
-e
's/@VERSION@/${FW_VER}-${FW_REL}/' <control.firmware
>fwdata
/DEBIAN
/control
297 dpkg-deb
--build fwdata
${FW_DEB}
300 upload
: ${DST_DEB} ${HDR_DEB} ${FW_DEB}
301 umount
/pve
/${RELEASE}; mount
/pve
/${RELEASE} -o rw
302 mkdir
-p
/pve
/${RELEASE}/extra
303 mkdir
-p
/pve
/${RELEASE}/install
304 rm -rf
/pve
/${RELEASE}/extra
/${PACKAGE}_
*.deb
305 rm -rf
/pve
/${RELEASE}/extra
/${HDRPACKAGE}_
*.deb
306 rm -rf
/pve
/${RELEASE}/extra
/pve-firmware
*.deb
307 rm -rf
/pve
/${RELEASE}/extra
/Packages
*
308 cp
${DST_DEB} ${FW_DEB} ${HDR_DEB} /pve
/${RELEASE}/extra
309 cd
/pve
/${RELEASE}/extra
; dpkg-scanpackages .
/dev
/null | gzip
-9c
> Packages.gz
310 umount
/pve
/${RELEASE}; mount
/pve
/${RELEASE} -o ro
314 rm -rf linux-firmware.git dvb-firmware.git
${KERNEL_SRC}.org
${RHKERSRCDIR}
318 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}