2020-08-09 12:31:08 +00:00
|
|
|
PKGREL=1
|
2020-08-08 12:17:53 +00:00
|
|
|
PKGRELLOCAL=1
|
|
|
|
PKGRELFULL=${PKGREL}
|
2018-03-05 14:42:44 +00:00
|
|
|
|
2021-03-27 15:01:11 +00:00
|
|
|
KERNEL_MAJMIN=$(shell ./scripts/version.sh -n)
|
|
|
|
KERNEL_VER=$(shell ./scripts/version.sh -L)
|
2018-05-28 09:04:46 +00:00
|
|
|
|
2021-03-27 15:01:11 +00:00
|
|
|
KREL=1
|
2021-04-18 09:30:19 +00:00
|
|
|
EXTRAVERSION=-${KREL}-edge
|
2020-04-28 13:13:50 +00:00
|
|
|
|
|
|
|
# Append Linux flavor name to EXTRAVERSION
|
|
|
|
ifdef PVE_BUILD_FLAVOR
|
|
|
|
_ := $(info Using build flavor: ${PVE_BUILD_FLAVOR})
|
|
|
|
EXTRAVERSION:=${EXTRAVERSION}-${PVE_BUILD_FLAVOR}
|
|
|
|
endif
|
|
|
|
|
2020-04-29 10:08:37 +00:00
|
|
|
# Default to generic micro architecture
|
|
|
|
PVE_BUILD_TYPE ?= generic
|
|
|
|
|
|
|
|
ifneq (${PVE_BUILD_TYPE},generic)
|
|
|
|
_ := $(info Using build type: ${PVE_BUILD_TYPE})
|
2020-08-08 12:17:53 +00:00
|
|
|
PKGRELFULL:=${PKGRELFULL}+${PVE_BUILD_TYPE}${PKGRELLOCAL}
|
2020-04-28 13:13:50 +00:00
|
|
|
endif
|
|
|
|
|
2017-03-15 13:43:11 +00:00
|
|
|
KVNAME=${KERNEL_VER}${EXTRAVERSION}
|
2021-04-18 09:30:19 +00:00
|
|
|
PACKAGE=pve-kernel-${KVNAME}
|
|
|
|
HDRPACKAGE=pve-headers-${KVNAME}
|
2017-03-15 13:43:11 +00:00
|
|
|
|
2017-05-10 14:33:45 +00:00
|
|
|
ARCH=$(shell dpkg-architecture -qDEB_BUILD_ARCH)
|
2017-05-10 14:33:47 +00:00
|
|
|
|
2018-03-09 10:25:58 +00:00
|
|
|
BUILD_DIR=build
|
2017-03-15 13:43:11 +00:00
|
|
|
|
2021-03-15 19:34:24 +00:00
|
|
|
KERNEL_SRC=linux
|
|
|
|
KERNEL_SRC_SUBMODULE=$(KERNEL_SRC)
|
2017-03-15 13:43:11 +00:00
|
|
|
KERNEL_CFG_ORG=config-${KERNEL_VER}.org
|
|
|
|
|
2018-03-09 10:25:58 +00:00
|
|
|
MODULES=modules
|
2019-05-24 12:40:34 +00:00
|
|
|
MODULE_DIRS=${ZFSDIR}
|
2017-03-15 13:43:11 +00:00
|
|
|
|
2018-03-09 10:25:58 +00:00
|
|
|
# exported to debian/rules via debian/rules.d/dirs.mk
|
2021-04-18 10:17:29 +00:00
|
|
|
DIRS=KERNEL_SRC MODULES
|
2018-03-09 10:25:58 +00:00
|
|
|
|
2020-08-08 12:17:53 +00:00
|
|
|
DST_DEB=${PACKAGE}_${KERNEL_VER}-${PKGRELFULL}_${ARCH}.deb
|
|
|
|
HDR_DEB=${HDRPACKAGE}_${KERNEL_VER}-${PKGRELFULL}_${ARCH}.deb
|
|
|
|
LINUX_TOOLS_DEB=linux-tools-$(KERNEL_MAJMIN)_${KERNEL_VER}-${PKGRELFULL}_${ARCH}.deb
|
2017-03-15 13:43:11 +00:00
|
|
|
|
2018-02-28 08:31:06 +00:00
|
|
|
DEBS=${DST_DEB} ${HDR_DEB} ${LINUX_TOOLS_DEB}
|
2017-03-15 13:43:11 +00:00
|
|
|
|
2020-04-28 21:01:54 +00:00
|
|
|
all: deb release.txt artifacts.txt
|
2017-08-02 12:45:53 +00:00
|
|
|
deb: ${DEBS}
|
2017-03-15 13:43:11 +00:00
|
|
|
|
2020-04-28 18:22:14 +00:00
|
|
|
release.txt:
|
|
|
|
echo "${KVNAME}" > release.txt
|
2020-04-28 21:01:54 +00:00
|
|
|
echo "${KERNEL_VER}" >> release.txt
|
|
|
|
echo "${PKGREL}" >> release.txt
|
|
|
|
echo "${ARCH}" >> release.txt
|
2020-04-28 18:22:14 +00:00
|
|
|
echo "${PVE_BUILD_FLAVOR}" >> release.txt
|
|
|
|
echo "${PVE_BUILD_TYPE}" >> release.txt
|
|
|
|
|
2020-04-28 21:01:54 +00:00
|
|
|
artifacts.txt:
|
|
|
|
echo "${DST_DEB}" > artifacts.txt
|
|
|
|
echo "${HDR_DEB}" >> artifacts.txt
|
|
|
|
echo "${LINUX_TOOLS_DEB}" >> artifacts.txt
|
|
|
|
|
2018-02-28 08:31:06 +00: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 13:43:11 +00:00
|
|
|
|
2018-03-09 10:25:58 +00:00
|
|
|
${BUILD_DIR}.prepared: $(addsuffix .prepared,${KERNEL_SRC} ${MODULES} debian)
|
|
|
|
touch $@
|
|
|
|
|
|
|
|
debian.prepared: debian
|
|
|
|
rm -rf ${BUILD_DIR}/debian
|
|
|
|
mkdir -p ${BUILD_DIR}
|
|
|
|
cp -a debian ${BUILD_DIR}/debian
|
|
|
|
cd ${BUILD_DIR}; debian/rules debian/control
|
2020-08-08 12:17:53 +00:00
|
|
|
ifneq (${PVE_BUILD_TYPE},generic)
|
|
|
|
cd ${BUILD_DIR}; debchange -l +${PVE_BUILD_TYPE} -D edge --force-distribution -U -M "Specialization for ${PVE_BUILD_TYPE}"
|
|
|
|
endif
|
2017-03-15 13:43:11 +00:00
|
|
|
touch $@
|
|
|
|
|
2020-04-29 14:55:31 +00:00
|
|
|
${KERNEL_SRC}.prepared: ${KERNEL_SRC_SUBMODULE}
|
2021-03-27 15:07:46 +00:00
|
|
|
git -C ${KERNEL_SRC} fetch ../crack.bundle $$(git -C ${KERNEL_SRC} ls-remote ../crack.bundle | cut -f1)
|
|
|
|
git -C ${KERNEL_SRC} checkout -f FETCH_HEAD
|
2018-02-28 08:31:06 +00:00
|
|
|
rm -rf ${BUILD_DIR}/${KERNEL_SRC} $@
|
|
|
|
mkdir -p ${BUILD_DIR}
|
2018-03-09 10:27:15 +00:00
|
|
|
cp -a ${KERNEL_SRC_SUBMODULE} ${BUILD_DIR}/${KERNEL_SRC}
|
2021-03-28 13:01:15 +00:00
|
|
|
rm -rf ${BUILD_DIR}/${KERNEL_SRC}/debian
|
2021-04-18 17:30:23 +00:00
|
|
|
cp -r zfs scripts ${BUILD_DIR}/
|
2017-03-15 13:43:11 +00:00
|
|
|
touch $@
|
|
|
|
|
2018-02-28 08:31:06 +00:00
|
|
|
${MODULES}.prepared: $(addsuffix .prepared,${MODULE_DIRS})
|
|
|
|
touch $@
|
|
|
|
|
2017-03-15 13:43:11 +00:00
|
|
|
.PHONY: clean
|
|
|
|
clean:
|
2018-02-28 08:31:06 +00:00
|
|
|
rm -rf *~ build *.prepared ${KERNEL_CFG_ORG}
|
2020-09-16 20:24:33 +00:00
|
|
|
rm -f *.deb *.ddeb *.changes *.buildinfo release.txt artifacts.txt
|
2021-04-18 17:30:23 +00:00
|
|
|
rm -f debian/control debian/pve-edge-*.postinst debian/pve-edge-*.prerm debian/pve-edge-*.postrm
|