Manage kernel patches with Quilt

This commit is contained in:
Fabian Mastenbroek 2021-03-28 21:51:08 +02:00
parent 972a1ef601
commit 5e900bd9f3
No known key found for this signature in database
GPG key ID: 405FC6F81F0A7B85
9 changed files with 22 additions and 7 deletions

View file

@ -105,7 +105,6 @@ ${KERNEL_SRC}.prepared: ${KERNEL_SRC_SUBMODULE}
cp -a ${KERNEL_SRC_SUBMODULE} ${BUILD_DIR}/${KERNEL_SRC} cp -a ${KERNEL_SRC_SUBMODULE} ${BUILD_DIR}/${KERNEL_SRC}
sed -i ${BUILD_DIR}/${KERNEL_SRC}/Makefile -e 's/^EXTRAVERSION.*$$/EXTRAVERSION=${EXTRAVERSION}/' sed -i ${BUILD_DIR}/${KERNEL_SRC}/Makefile -e 's/^EXTRAVERSION.*$$/EXTRAVERSION=${EXTRAVERSION}/'
rm -rf ${BUILD_DIR}/${KERNEL_SRC}/debian rm -rf ${BUILD_DIR}/${KERNEL_SRC}/debian
set -e; cd ${BUILD_DIR}/${KERNEL_SRC}; for patch in ${PVE_PATCHES}; do echo "applying PVE patch '$$patch'" && patch -p1 < ../../$${patch}; done
touch $@ touch $@
${MODULES}.prepared: $(addsuffix .prepared,${MODULE_DIRS}) ${MODULES}.prepared: $(addsuffix .prepared,${MODULE_DIRS})

View file

@ -64,13 +64,13 @@ apt install ./dwarves_1.17-1_amd64.deb
``` ```
#### Obtaining the source #### Obtaining the source
Select the branch of your likings (e.g. `v5.8.x`) and update the submodules:
```bash ```bash
git clone https://github.com/fabianishere/pve-edge-kernel git clone https://github.com/fabianishere/pve-edge-kernel
cd pve-ede-kernel cd pve-ede-kernel
git submodule update --init --depth=1 --recursive linux git submodule update --init --depth=1 --recursive linux
git submodule update --init --recursive git submodule update --init --recursive
``` ```
Afterwards, select the branch of your likings (e.g. `v5.8.x`).
#### Building #### Building
Invoking the following command will build the kernel and its associated packages: Invoking the following command will build the kernel and its associated packages:
@ -97,7 +97,8 @@ The Makefile provides several environmental variables to control:
the optimization level or micro architecture to build for. the optimization level or micro architecture to build for.
Kernel options may be controlled from the [debian/rules](debian/rules) file. To build with Kernel options may be controlled from the [debian/rules](debian/rules) file. To build with
additional patches, you may add them to the [patches/pve](patches/pve) directory. additional patches, you may add them to the [debian/patches/pve](debian/patches/pve) directory
and update the [series](debian/patches/series.linux) file accordingly.
## Questions ## Questions
If you have any questions or want to see additional versions, flavors or micro architectures being built, feel If you have any questions or want to see additional versions, flavors or micro architectures being built, feel

5
debian/patches/series.linux vendored Normal file
View file

@ -0,0 +1,5 @@
pve/0001-Make-mkcompile_h-accept-an-alternate-timestamp-strin.patch
pve/0002-bridge-keep-MAC-of-first-assigned-port.patch
pve/0003-pci-Enable-overrides-for-missing-ACS-capabilities-4..patch
pve/0004-kvm-disable-default-dynamic-halt-polling-growth.patch
pve/0005-net-core-downgrade-unregister_netdevice-refcount-lea.patch

18
debian/rules vendored
View file

@ -1,9 +1,6 @@
#!/usr/bin/make -f #!/usr/bin/make -f
# -*- makefile -*- # -*- makefile -*-
# Uncomment this to turn on verbose mode.
#export DH_VERBOSE=1
# TODO: check for headers not being installed # TODO: check for headers not being installed
BUILD_DIR=$(shell pwd) BUILD_DIR=$(shell pwd)
@ -23,7 +20,7 @@ KERNEL_SRC_COPY=${KERNEL_SRC}_tmp
PVE_BUILD_CC ?= ${CC} PVE_BUILD_CC ?= ${CC}
%: %:
dh $@ dh $@ --with quilt
debian/control: $(wildcard debian/*.in) debian/control: $(wildcard debian/*.in)
sed -e 's/@@KVNAME@@/${KVNAME}/g' < debian/templates/pve-kernel.prerm.in > debian/${PVE_KERNEL_PKG}.prerm sed -e 's/@@KVNAME@@/${KVNAME}/g' < debian/templates/pve-kernel.prerm.in > debian/${PVE_KERNEL_PKG}.prerm
@ -39,6 +36,19 @@ debian/control: $(wildcard debian/*.in)
debian/SOURCE: debian/SOURCE:
echo "git clone git@github.com:fabianishere/pve-kernel-edge.git\\ngit checkout $(shell git rev-parse HEAD)" > $@ echo "git clone git@github.com:fabianishere/pve-kernel-edge.git\\ngit checkout $(shell git rev-parse HEAD)" > $@
override_dh_quilt_patch:
cd linux; \
QUILT_PATCHES=../debian/patches \
QUILT_SERIES=series.linux \
quilt --quiltrc /dev/null --color=always push -a || test $$? = 2
override_dh_quilt_unpatch:
cd linux; \
QUILT_PATCHES=../debian/patches \
QUILT_SERIES=series.linux \
quilt --quiltrc /dev/null pop -a || test $$? = 2
rm -rf linux/.pc
override_dh_auto_build: .compile_mark .tools_compile_mark .modules_compile_mark override_dh_auto_build: .compile_mark .tools_compile_mark .modules_compile_mark
override_dh_auto_install: debian/SOURCE .install_mark .tools_install_mark .headers_install_mark .usr_headers_install_mark override_dh_auto_install: debian/SOURCE .install_mark .tools_install_mark .headers_install_mark .usr_headers_install_mark