2017-10-23 10:39:36 +03:00
|
|
|
RELEASE=5.1
|
2017-03-15 16:43:11 +03:00
|
|
|
|
2018-03-05 17:42:44 +03:00
|
|
|
# also update pve-kernel-meta.git if either of these change
|
2018-03-09 16:22:07 +03:00
|
|
|
KERNEL_VER=4.15.3
|
|
|
|
KREL=1
|
2017-03-15 16:43:11 +03:00
|
|
|
|
2018-03-09 16:22:07 +03:00
|
|
|
PKGREL=1
|
2018-03-05 17:42:44 +03:00
|
|
|
|
2018-03-09 13:25:58 +03:00
|
|
|
EXTRAVERSION=-${KREL}-pve
|
2017-03-15 16:43:11 +03:00
|
|
|
KVNAME=${KERNEL_VER}${EXTRAVERSION}
|
|
|
|
PACKAGE=pve-kernel-${KVNAME}
|
|
|
|
HDRPACKAGE=pve-headers-${KVNAME}
|
|
|
|
|
2017-05-10 17:33:45 +03:00
|
|
|
ARCH=$(shell dpkg-architecture -qDEB_BUILD_ARCH)
|
2017-05-10 17:33:47 +03:00
|
|
|
|
|
|
|
# amd64/x86_64/x86 share the arch subdirectory in the kernel, 'x86' so we need
|
|
|
|
# a mapping
|
|
|
|
KERNEL_ARCH=x86
|
|
|
|
ifneq (${ARCH}, amd64)
|
|
|
|
KERNEL_ARCH=${ARCH}
|
|
|
|
endif
|
|
|
|
|
2017-06-20 10:51:41 +03:00
|
|
|
GITVERSION:=$(shell git rev-parse HEAD)
|
2017-03-15 16:43:11 +03:00
|
|
|
|
2017-03-24 14:48:43 +03:00
|
|
|
SKIPABI=0
|
|
|
|
|
2018-02-14 14:21:05 +03:00
|
|
|
ifeq ($(CC), cc)
|
|
|
|
GCC=gcc
|
|
|
|
else
|
|
|
|
GCC=$(CC)
|
|
|
|
endif
|
|
|
|
|
2018-03-09 13:25:58 +03:00
|
|
|
BUILD_DIR=build
|
2017-03-15 16:43:11 +03:00
|
|
|
|
2018-03-09 16:22:07 +03:00
|
|
|
KERNEL_SRC=ubuntu-bionic
|
|
|
|
KERNEL_SRC_SUBMODULE=submodules/ubuntu-bionic
|
2017-03-15 16:43:11 +03:00
|
|
|
KERNEL_CFG_ORG=config-${KERNEL_VER}.org
|
|
|
|
|
2018-03-09 13:25:58 +03:00
|
|
|
E1000EDIR=e1000e-3.3.6
|
2017-07-28 14:09:25 +03:00
|
|
|
E1000ESRC=${E1000EDIR}.tar.gz
|
|
|
|
|
2018-03-09 13:25:58 +03:00
|
|
|
IGBDIR=igb-5.3.5.10
|
2017-07-28 14:09:25 +03:00
|
|
|
IGBSRC=${IGBDIR}.tar.gz
|
|
|
|
|
2018-03-09 13:25:58 +03:00
|
|
|
IXGBEDIR=ixgbe-5.3.3
|
2017-07-28 14:09:25 +03:00
|
|
|
IXGBESRC=${IXGBEDIR}.tar.gz
|
|
|
|
|
2017-10-12 15:56:28 +03:00
|
|
|
ZFSONLINUX_SUBMODULE=submodules/zfsonlinux
|
2018-03-09 13:25:58 +03:00
|
|
|
SPLDIR=pkg-spl
|
2017-10-12 15:56:28 +03:00
|
|
|
SPLSRC=${ZFSONLINUX_SUBMODULE}/spl-debian
|
2018-03-09 13:25:58 +03:00
|
|
|
ZFSDIR=pkg-zfs
|
2017-10-12 15:56:28 +03:00
|
|
|
ZFSSRC=${ZFSONLINUX_SUBMODULE}/zfs-debian
|
2018-02-28 11:31:06 +03:00
|
|
|
|
2018-03-09 13:25:58 +03:00
|
|
|
MODULES=modules
|
2018-03-09 17:27:36 +03:00
|
|
|
#intel out-of-tree drivers disabled for now - incompatible with 4.15
|
|
|
|
#MODULE_DIRS=${E1000EDIR} ${IGBDIR} ${IXGBEDIR} ${SPLDIR} ${ZFSDIR}
|
|
|
|
MODULE_DIRS=${SPLDIR} ${ZFSDIR}
|
2017-03-15 16:43:11 +03:00
|
|
|
|
2018-03-09 13:25:58 +03:00
|
|
|
# exported to debian/rules via debian/rules.d/dirs.mk
|
|
|
|
DIRS=KERNEL_SRC E1000EDIR IGBDIR IXGBEDIR SPLDIR ZFSDIR MODULES
|
|
|
|
|
2017-03-15 16:43:11 +03:00
|
|
|
DST_DEB=${PACKAGE}_${KERNEL_VER}-${PKGREL}_${ARCH}.deb
|
|
|
|
HDR_DEB=${HDRPACKAGE}_${KERNEL_VER}-${PKGREL}_${ARCH}.deb
|
2018-03-09 16:22:07 +03:00
|
|
|
LINUX_TOOLS_DEB=linux-tools-4.15_${KERNEL_VER}-${PKGREL}_${ARCH}.deb
|
2017-03-15 16:43:11 +03:00
|
|
|
|
2018-02-28 11:31:06 +03:00
|
|
|
DEBS=${DST_DEB} ${HDR_DEB} ${LINUX_TOOLS_DEB}
|
2017-03-15 16:43:11 +03:00
|
|
|
|
2017-08-02 15:45:53 +03:00
|
|
|
all: check_gcc deb
|
|
|
|
deb: ${DEBS}
|
2017-03-15 16:43:11 +03:00
|
|
|
|
2018-02-14 14:21:05 +03:00
|
|
|
check_gcc:
|
|
|
|
$(GCC) --version|grep "6\.3" || false
|
|
|
|
@$(GCC) -Werror -mindirect-branch=thunk-extern -mindirect-branch-register -c -x c /dev/null -o check_gcc.o \
|
|
|
|
|| ( rm -f check_gcc.o; \
|
|
|
|
echo "Please install gcc-6 packages with indirect thunk / RETPOLINE support"; \
|
|
|
|
false)
|
|
|
|
@rm -f check_gcc.o
|
2017-03-15 16:43:11 +03:00
|
|
|
|
2018-02-28 11:31:06 +03:00
|
|
|
${LINUX_TOOLS_DEB} ${HDR_DEB}: ${DST_DEB}
|
|
|
|
${DST_DEB}: ${BUILD_DIR}.prepared
|
|
|
|
cd ${BUILD_DIR}; dpkg-buildpackage --jobs=auto -b -uc -us
|
2017-03-15 16:43:11 +03:00
|
|
|
lintian ${DST_DEB}
|
2018-02-28 11:31:06 +03:00
|
|
|
#lintian ${HDR_DEB}
|
2017-03-15 16:43:11 +03:00
|
|
|
lintian ${LINUX_TOOLS_DEB}
|
|
|
|
|
2018-03-09 13:25:58 +03:00
|
|
|
${BUILD_DIR}.prepared: $(addsuffix .prepared,${KERNEL_SRC} ${MODULES} debian)
|
2018-02-28 11:31:06 +03:00
|
|
|
cp -a fwlist-previous ${BUILD_DIR}/
|
|
|
|
cp -a abi-previous ${BUILD_DIR}/
|
|
|
|
cp -a abi-blacklist ${BUILD_DIR}/
|
2018-03-09 13:25:58 +03:00
|
|
|
touch $@
|
|
|
|
|
|
|
|
debian.prepared: debian
|
|
|
|
rm -rf ${BUILD_DIR}/debian
|
|
|
|
mkdir -p ${BUILD_DIR}
|
|
|
|
cp -a debian ${BUILD_DIR}/debian
|
2018-02-28 11:31:06 +03:00
|
|
|
echo "git clone git://git.proxmox.com/git/pve-kernel.git\\ngit checkout ${GITVERSION}" > ${BUILD_DIR}/debian/SOURCE
|
2018-03-09 13:25:58 +03:00
|
|
|
@$(foreach dir, ${DIRS},echo "${dir}=${${dir}}" >> ${BUILD_DIR}/debian/rules.d/env.mk;)
|
|
|
|
echo "KVNAME=${KVNAME}" >> ${BUILD_DIR}/debian/rules.d/env.mk
|
|
|
|
cd ${BUILD_DIR}; debian/rules debian/control
|
2017-03-15 16:43:11 +03:00
|
|
|
touch $@
|
|
|
|
|
2018-02-28 11:31:06 +03:00
|
|
|
${KERNEL_SRC}.prepared: ${KERNEL_SRC_SUBMODULE} | submodule
|
|
|
|
rm -rf ${BUILD_DIR}/${KERNEL_SRC} $@
|
|
|
|
mkdir -p ${BUILD_DIR}
|
2018-03-09 13:27:15 +03:00
|
|
|
cp -a ${KERNEL_SRC_SUBMODULE} ${BUILD_DIR}/${KERNEL_SRC}
|
2018-02-28 11:31:06 +03:00
|
|
|
# TODO: split for archs, track and diff in our repository?
|
|
|
|
cat ${BUILD_DIR}/${KERNEL_SRC}/debian.master/config/config.common.ubuntu ${BUILD_DIR}/${KERNEL_SRC}/debian.master/config/${ARCH}/config.common.${ARCH} ${BUILD_DIR}/${KERNEL_SRC}/debian.master/config/${ARCH}/config.flavour.generic > ${KERNEL_CFG_ORG}
|
|
|
|
cp ${KERNEL_CFG_ORG} ${BUILD_DIR}/${KERNEL_SRC}/.config
|
|
|
|
sed -i ${BUILD_DIR}/${KERNEL_SRC}/Makefile -e 's/^EXTRAVERSION.*$$/EXTRAVERSION=${EXTRAVERSION}/'
|
|
|
|
rm -rf ${BUILD_DIR}/${KERNEL_SRC}/debian ${BUILD_DIR}/${KERNEL_SRC}/debian.master
|
|
|
|
cd ${BUILD_DIR}/${KERNEL_SRC}; for patch in ../../patches/kernel/*.patch; do patch -p1 < $${patch}; done
|
2017-03-15 16:43:11 +03:00
|
|
|
touch $@
|
|
|
|
|
2018-02-28 11:31:06 +03:00
|
|
|
${MODULES}.prepared: $(addsuffix .prepared,${MODULE_DIRS})
|
|
|
|
touch $@
|
|
|
|
|
|
|
|
${E1000EDIR}.prepared: ${E1000ESRC}
|
|
|
|
rm -rf ${BUILD_DIR}/${MODULES}/${E1000EDIR} $@
|
|
|
|
mkdir -p ${BUILD_DIR}/${MODULES}/${E1000EDIR}
|
|
|
|
tar --strip-components=1 -C ${BUILD_DIR}/${MODULES}/${E1000EDIR} -xf ${E1000ESRC}
|
|
|
|
cd ${BUILD_DIR}/${MODULES}/${E1000EDIR}; patch -p1 < ../../../patches/intel/intel-module-gcc6-compat.patch
|
|
|
|
cd ${BUILD_DIR}/${MODULES}/${E1000EDIR}; patch -p1 < ../../../patches/intel/e1000e/e1000e_4.10_max-mtu.patch
|
|
|
|
touch $@
|
|
|
|
|
|
|
|
${IGBDIR}.prepared: ${IGBSRC}
|
|
|
|
rm -rf ${BUILD_DIR}/${MODULES}/${IGBDIR} $@
|
|
|
|
mkdir -p ${BUILD_DIR}/${MODULES}/${IGBDIR}
|
|
|
|
tar --strip-components=1 -C ${BUILD_DIR}/${MODULES}/${IGBDIR} -xf ${IGBSRC}
|
|
|
|
cd ${BUILD_DIR}/${MODULES}/${IGBDIR}; patch -p1 < ../../../patches/intel/igb/igb_4.10_max-mtu.patch
|
|
|
|
cd ${BUILD_DIR}/${MODULES}/${IGBDIR}; patch -p1 < ../../../patches/intel/igb/igb_4.12_compat.patch
|
|
|
|
touch $@
|
|
|
|
|
|
|
|
${IXGBEDIR}.prepared: ${IXGBESRC}
|
|
|
|
rm -rf ${BUILD_DIR}/${MODULES}/${IXGBEDIR} $@
|
|
|
|
mkdir -p ${BUILD_DIR}/${MODULES}/${IXGBEDIR}
|
|
|
|
tar --strip-components=1 -C ${BUILD_DIR}/${MODULES}/${IXGBEDIR} -xf ${IXGBESRC}
|
|
|
|
touch $@
|
|
|
|
|
|
|
|
$(SPLDIR).prepared: ${SPLSRC}
|
|
|
|
rm -rf ${BUILD_DIR}/${MODULES}/${SPLDIR} $@
|
|
|
|
mkdir -p ${BUILD_DIR}/${MODULES}/${SPLDIR}
|
|
|
|
cp -a ${SPLSRC}/* ${BUILD_DIR}/${MODULES}/${SPLDIR}
|
|
|
|
cd ${BUILD_DIR}/${MODULES}/${SPLDIR}; for patch in ../../../${SPLSRC}/../spl-patches/*.patch; do patch -p1 < $${patch}; done
|
|
|
|
touch $@
|
|
|
|
|
|
|
|
$(ZFSDIR).prepared: ${ZFSSRC}
|
|
|
|
rm -rf ${BUILD_DIR}/${MODULES}/${ZFSDIR} $@
|
|
|
|
mkdir -p ${BUILD_DIR}/${MODULES}/${ZFSDIR}
|
|
|
|
cp -a ${ZFSSRC}/* ${BUILD_DIR}/${MODULES}/${ZFSDIR}
|
|
|
|
cd ${BUILD_DIR}/${MODULES}/${ZFSDIR}; for patch in ../../../${ZFSSRC}/../zfs-patches/*.patch; do patch -p1 < $${patch}; done
|
|
|
|
touch $@
|
2017-03-15 16:43:11 +03:00
|
|
|
|
|
|
|
.PHONY: upload
|
|
|
|
upload: ${DEBS}
|
2018-03-05 16:27:18 +03:00
|
|
|
tar cf - ${DEBS}|ssh repoman@repo.proxmox.com -- upload --product pve,pmg --dist stretch --arch ${ARCH}
|
2017-03-15 16:43:11 +03:00
|
|
|
|
|
|
|
.PHONY: distclean
|
|
|
|
distclean: clean
|
2018-02-28 11:31:06 +03:00
|
|
|
git submodule deinit --all
|
2017-03-15 16:43:11 +03:00
|
|
|
|
2017-03-15 17:21:54 +03:00
|
|
|
# upgrade to current master
|
|
|
|
.PHONY: update_modules
|
2017-10-13 09:30:09 +03:00
|
|
|
update_modules: submodule
|
2017-03-15 17:21:54 +03:00
|
|
|
git submodule foreach 'git pull --ff-only origin master'
|
2017-10-12 15:56:28 +03:00
|
|
|
cd ${ZFSSRC}; git pull --ff-only origin master
|
|
|
|
cd ${SPLSRC}; git pull --ff-only origin master
|
2017-03-15 17:21:54 +03:00
|
|
|
|
|
|
|
# make sure submodules were initialized
|
2017-10-13 09:30:09 +03:00
|
|
|
.PHONY: submodule
|
|
|
|
submodule:
|
2017-10-12 15:56:28 +03:00
|
|
|
test -f "${KERNEL_SRC_SUBMODULE}/README" || git submodule update --init ${KERNEL_SRC_SUBMODULE}
|
|
|
|
test -f "${ZFSONLINUX_SUBMODULE}/Makefile" || git submodule update --init ${ZFSONLINUX_SUBMODULE}
|
|
|
|
(test -f "${ZFSSRC}/debian/changelog" && test -f "${SPLZRC}/debian/changelog") || (cd ${ZFSONLINUX_SUBMODULE}; git submodule update --init)
|
2017-03-15 17:21:54 +03:00
|
|
|
|
|
|
|
|
2017-03-15 16:43:11 +03:00
|
|
|
.PHONY: clean
|
|
|
|
clean:
|
2018-02-28 11:31:06 +03:00
|
|
|
rm -rf *~ build *.prepared ${KERNEL_CFG_ORG}
|