diff --git a/Makefile b/Makefile index 81bd44d..0062e92 100644 --- a/Makefile +++ b/Makefile @@ -105,7 +105,6 @@ ${KERNEL_SRC}.prepared: ${KERNEL_SRC_SUBMODULE} cp -a ${KERNEL_SRC_SUBMODULE} ${BUILD_DIR}/${KERNEL_SRC} sed -i ${BUILD_DIR}/${KERNEL_SRC}/Makefile -e 's/^EXTRAVERSION.*$$/EXTRAVERSION=${EXTRAVERSION}/' 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 $@ ${MODULES}.prepared: $(addsuffix .prepared,${MODULE_DIRS}) diff --git a/README.md b/README.md index ee11a14..1f624ac 100644 --- a/README.md +++ b/README.md @@ -64,13 +64,13 @@ apt install ./dwarves_1.17-1_amd64.deb ``` #### Obtaining the source +Select the branch of your likings (e.g. `v5.8.x`) and update the submodules: ```bash git clone https://github.com/fabianishere/pve-edge-kernel cd pve-ede-kernel git submodule update --init --depth=1 --recursive linux git submodule update --init --recursive ``` -Afterwards, select the branch of your likings (e.g. `v5.8.x`). #### Building 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. 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 If you have any questions or want to see additional versions, flavors or micro architectures being built, feel diff --git a/patches/pve/0001-Make-mkcompile_h-accept-an-alternate-timestamp-strin.patch b/debian/patches/pve/0001-Make-mkcompile_h-accept-an-alternate-timestamp-strin.patch similarity index 100% rename from patches/pve/0001-Make-mkcompile_h-accept-an-alternate-timestamp-strin.patch rename to debian/patches/pve/0001-Make-mkcompile_h-accept-an-alternate-timestamp-strin.patch diff --git a/patches/pve/0002-bridge-keep-MAC-of-first-assigned-port.patch b/debian/patches/pve/0002-bridge-keep-MAC-of-first-assigned-port.patch similarity index 100% rename from patches/pve/0002-bridge-keep-MAC-of-first-assigned-port.patch rename to debian/patches/pve/0002-bridge-keep-MAC-of-first-assigned-port.patch diff --git a/patches/pve/0003-pci-Enable-overrides-for-missing-ACS-capabilities-4..patch b/debian/patches/pve/0003-pci-Enable-overrides-for-missing-ACS-capabilities-4..patch similarity index 100% rename from patches/pve/0003-pci-Enable-overrides-for-missing-ACS-capabilities-4..patch rename to debian/patches/pve/0003-pci-Enable-overrides-for-missing-ACS-capabilities-4..patch diff --git a/patches/pve/0004-kvm-disable-default-dynamic-halt-polling-growth.patch b/debian/patches/pve/0004-kvm-disable-default-dynamic-halt-polling-growth.patch similarity index 100% rename from patches/pve/0004-kvm-disable-default-dynamic-halt-polling-growth.patch rename to debian/patches/pve/0004-kvm-disable-default-dynamic-halt-polling-growth.patch diff --git a/patches/pve/0005-net-core-downgrade-unregister_netdevice-refcount-lea.patch b/debian/patches/pve/0005-net-core-downgrade-unregister_netdevice-refcount-lea.patch similarity index 100% rename from patches/pve/0005-net-core-downgrade-unregister_netdevice-refcount-lea.patch rename to debian/patches/pve/0005-net-core-downgrade-unregister_netdevice-refcount-lea.patch diff --git a/debian/patches/series.linux b/debian/patches/series.linux new file mode 100644 index 0000000..ff37420 --- /dev/null +++ b/debian/patches/series.linux @@ -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 diff --git a/debian/rules b/debian/rules index 0f81857..883f6d0 100755 --- a/debian/rules +++ b/debian/rules @@ -1,9 +1,6 @@ #!/usr/bin/make -f # -*- makefile -*- -# Uncomment this to turn on verbose mode. -#export DH_VERBOSE=1 - # TODO: check for headers not being installed BUILD_DIR=$(shell pwd) @@ -23,7 +20,7 @@ KERNEL_SRC_COPY=${KERNEL_SRC}_tmp PVE_BUILD_CC ?= ${CC} %: - dh $@ + dh $@ --with quilt debian/control: $(wildcard debian/*.in) 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: 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_install: debian/SOURCE .install_mark .tools_install_mark .headers_install_mark .usr_headers_install_mark