[lunar:linux][lunar:linux-unstable][PATCH v2 1/3] UBUNTU: [Packaging] Support skipped dkms modules

Andrea Righi andrea.righi at canonical.com
Tue Mar 7 09:46:41 UTC 2023


On Mon, Feb 27, 2023 at 02:49:51PM +0000, Dimitri John Ledkov wrote:
> In recent releases we have fixed up most dkms modules to correctly
> detect, and skip building dkms modules when compiling against
> incompatible kernels. For example, trying to build a WiFi driver
> against a kernel without 80221 config enabled, results in dkms
> returning error code 9 skipped build, due to incompatibility. Our DKMS
> autopkgtests already honor such cases, and mark test results as
> passing for skipped {kernel, dkms-module} combinations.
> 
> Improve kernel's dkms-build script to distinguish failed versus
> skipped builds, by propagating exact status code. For standalone
> skipped dkms modules, skip generating an empty deb packages.
> 
> Also do not fail over missing make.log for the skipped dkms builds,
> which do not have one.
> 
> This change will enable us to use a static list of dkms-versions
> across all kernels, without need to do anything special for cases were
> a vendored dkms module is declared incompatible in dkms.conf for a
> given kernel.
> 
> For example, v4l2loopback incompatible with cloud kernels that do not
> enable CONFIG_VIDEO, or backports-iwlwifi incompatible with kvm
> kernel.
> 
> This patch is tested against working, skipepd, and FTBFS dkms modules,
> which correctly built the full kernel, skipped some dkms modules, or
> failed the overall build.
> 
> Signed-off-by: Dimitri John Ledkov <dimitri.ledkov at canonical.com>
> ---
>  debian/rules.d/2-binary-arch.mk | 3 ++-
>  debian/scripts/dkms-build       | 5 ++---
>  2 files changed, 4 insertions(+), 4 deletions(-)
> 
> diff --git a/debian/rules.d/2-binary-arch.mk b/debian/rules.d/2-binary-arch.mk
> index 4cebe66dfd..4d393e890e 100644
> --- a/debian/rules.d/2-binary-arch.mk
> +++ b/debian/rules.d/2-binary-arch.mk
> @@ -71,7 +71,7 @@ define build_dkms_sign =
>  	)
>  endef
>  define build_dkms =
> -	ARCH=$(build_arch) CROSS_COMPILE=$(CROSS_COMPILE) $(SHELL) $(DROOT)/scripts/dkms-build $(dkms_dir) $(abi_release)-$* '$(call build_dkms_sign,$(builddir)/build-$*)' $(1) $(2) $(3) $(4) $(5)
> +	rc=0; ARCH=$(build_arch) CROSS_COMPILE=$(CROSS_COMPILE) $(SHELL) $(DROOT)/scripts/dkms-build $(dkms_dir) $(abi_release)-$* '$(call build_dkms_sign,$(builddir)/build-$*)' $(1) $(2) $(3) $(4) $(5) || rc=$$?; if [ "$$rc" = "9" ]; then echo do_$(4)_$*=false >> $(builddir)/skipped-dkms.mk; rc=0; fi; if [ "$$rc" != "0" ]; then exit $$rc; fi

What does rc==9 mean? It seems to be the "skip case, right? Maybe a
little comment here explaining the meaning of this special value would
be helpful.

Everything else looks good to me.

-Andrea



More information about the kernel-team mailing list