Reduce length of kernel version

This change reduces the length of the kernel version that is set by the
build process. We find that the most recent version is too long for the
kernel and causes certain kernel detection processes to fail.

We also remove the concept of build flavor or build profile. These
concepts should be reflected in the Debian package name and version
instead of separately in the kernel version.
This commit is contained in:
Fabian Mastenbroek 2021-11-28 14:10:53 +01:00
parent c2ad95159b
commit 138e5893be
No known key found for this signature in database
GPG key ID: 405FC6F81F0A7B85
3 changed files with 9 additions and 32 deletions

View file

@ -121,20 +121,9 @@ debuild -ePVE* --jobs=auto -b -uc -us
``` ```
The Makefile provides several environmental variables to control: The Makefile provides several environmental variables to control:
1. `PVE_BUILD_FLAVOR` 1. `PVE_KERNEL_CC`
The name of the kernel flavor which represents a selection of kernel
functionality (e.g. [hardened](https://github.com/anthraxx/linux-hardened) or [zen](https://github.com/zen-kernel/zen-kernel)).
This name is part of the kernel version and package name, which means that you
can have multiple flavors of the same kernel installed alongside each other.
Note that the name itself does not control the selection of kernel functionality.
2. `PVE_BUILD_PROFILE` (default `generic`)
The name of the kernel build type which represents the compilation options of
the kernel (e.g. optimization level or micro architecture).
This name is appended as suffix to the Debian package version in case it is not
the default value.
3. `PVE_KERNEL_CC`
The compiler to use for the kernel build. The compiler to use for the kernel build.
4. `PVE_KERNEL_CFLAGS` 2. `PVE_KERNEL_CFLAGS`
The compilation options to use for the kernel build. Use this variable to specify The compilation options to use for the kernel build. Use this variable to specify
the optimization level or micro architecture to build for. the optimization level or micro architecture to build for.

2
debian/rules vendored
View file

@ -62,7 +62,7 @@ override_dh_auto_build:
KCFLAGS="${PVE_KERNEL_CFLAGS}" \ KCFLAGS="${PVE_KERNEL_CFLAGS}" \
EXTRAVERSION="${EXTRAVERSION}" \ EXTRAVERSION="${EXTRAVERSION}" \
LOCALVERSION="${LOCALVERSION}" \ LOCALVERSION="${LOCALVERSION}" \
KBUILD_BUILD_VERSION_TIMESTAMP="PVE Edge ${DEB_VERSION} ${PVE_BUILD_PROFILE} (${PKG_DATE})" KBUILD_BUILD_VERSION_TIMESTAMP="${PKG_DISTRIBUTOR} ${DEB_VERSION} (${PKG_DATE_UTC_ISO})"
# ZFS # ZFS
dh_auto_configure -D ${ZFS_SRC} -- CC="${PVE_ZFS_CC}" --with-config=kernel --with-linux=$(realpath ${KERNEL_SRC}) --with-linux-obj=$(realpath ${KERNEL_SRC}) dh_auto_configure -D ${ZFS_SRC} -- CC="${PVE_ZFS_CC}" --with-config=kernel --with-linux=$(realpath ${KERNEL_SRC}) --with-linux-obj=$(realpath ${KERNEL_SRC})
dh_auto_build -D ${ZFS_SRC} dh_auto_build -D ${ZFS_SRC}

View file

@ -3,30 +3,18 @@ KERNEL_MAJMIN=$(shell ./scripts/version.sh -n)
KERNEL_VER=$(shell ./scripts/version.sh -L) KERNEL_VER=$(shell ./scripts/version.sh -L)
## Debian package information ## Debian package information
PKG_RELEASE=$(shell ./scripts/version.sh -r) PKG_DISTRIBUTOR ?= PVE Edge
PKG_DATE:=$(shell dpkg-parsechangelog -SDate) PKG_RELEASE = $(shell ./scripts/version.sh -r)
PKG_GIT_VERSION:=$(shell git rev-parse HEAD) PKG_DATE := $(shell dpkg-parsechangelog -SDate)
PKG_DATE_UTC_ISO := $(shell date -u -d '$(PKG_DATE)' +%Y-%m-%d)
## Build flavor PKG_GIT_VERSION := $(shell git rev-parse HEAD)
# Default to PVE flavor
PKG_BUILD_FLAVOR ?= edge
ifneq (${PKG_BUILD_FLAVOR},edge)
_ := $(info Using custom build flavor: ${PKG_BUILD_FLAVOR})
endif
## Build profile
# Default to generic march optimizations
PKG_BUILD_PROFILE ?= generic
ifneq (${PKG_BUILD_PROFILE},generic)
_ := $(info Using custom build profile: ${PKG_BUILD_PROFILE})
endif
# Build settings # Build settings
PVE_KERNEL_CC ?= ${CC} PVE_KERNEL_CC ?= ${CC}
PVE_ZFS_CC ?= ${CC} PVE_ZFS_CC ?= ${CC}
### Debian package names ### Debian package names
EXTRAVERSION=-${PKG_BUILD_FLAVOR} EXTRAVERSION=-edge
KVNAME=${KERNEL_VER}${EXTRAVERSION} KVNAME=${KERNEL_VER}${EXTRAVERSION}
PVE_KERNEL_PKG=pve-kernel-${KVNAME} PVE_KERNEL_PKG=pve-kernel-${KVNAME}