[PATCH 2/2] UBUNTU: [Packaging] correctly implement noudeb build profiles.

Seth Forshee seth.forshee at canonical.com
Fri Feb 19 16:55:23 UTC 2021


On Fri, Feb 19, 2021 at 12:26:05AM +0000, Dimitri John Ledkov wrote:
> When building under either of stage1, noudeb, cross or autopkgtest
> profiles udeb packages are not desired. Stop generating them, and drop
> build-dependencies that are used just to create udebs.
> 
> Also note that dpkg in hirsute and up automatically buidlds packages
> with a noudeb profile, thus hirsute+ builds will be now much faster.
> 
> This is a correct and backwards compatibles support for build profiles
> and can be backported to any prior release, where by default packages
> will be build with udebs.
> 
> BugLink: https://bugs.launchpad.net/bugs/1916095
> Signed-off-by: Dimitri John Ledkov <xnox at ubuntu.com>
> ---
>  debian.master/control.d/flavour-control.stub | 2 +-
>  debian.master/control.stub.in                | 4 ++--
>  debian/rules                                 | 5 +++++
>  3 files changed, 8 insertions(+), 3 deletions(-)
> 
> diff --git a/debian.master/control.d/flavour-control.stub b/debian.master/control.d/flavour-control.stub
> index 17be49dbd..df6377ce1 100644
> --- a/debian.master/control.d/flavour-control.stub
> +++ b/debian.master/control.d/flavour-control.stub
> @@ -141,7 +141,7 @@ Description: Linux kernel version specific cloud tools for version PKGVER-ABINUM
>   =HUMAN=.
>  
>  Package: SRCPKGNAME-udebs-FLAVOUR
> -Build-Profiles: <!stage1>
> +Build-Profiles: <!stage1> <!noudeb> <!cross> <!autopkgtest>
>  XC-Package-Type: udeb
>  Section: debian-installer
>  Architecture: ARCH
> diff --git a/debian.master/control.stub.in b/debian.master/control.stub.in
> index cae6f6783..1c1ee8857 100644
> --- a/debian.master/control.stub.in
> +++ b/debian.master/control.stub.in
> @@ -7,8 +7,8 @@ Build-Depends:
>   debhelper-compat (= 10),
>   dh-systemd,
>   cpio,
> - kernel-wedge,
> - dctrl-tools,
> + kernel-wedge <!stage1> <!noudeb> <!cross> <!autopkgtest>,
> + dctrl-tools <!stage1> <!noudeb> <!cross> <!autopkgtest>,
>   kmod <!stage1>,
>   makedumpfile [amd64] <!stage1>,
>   libcap-dev <!stage1>,
> diff --git a/debian/rules b/debian/rules
> index ceffe36be..bedcd4f60 100755
> --- a/debian/rules
> +++ b/debian/rules
> @@ -39,6 +39,9 @@ do_tools_common?=true
>  do_tools_host?=false
>  do_tools_perf_jvmti?=false
>  do_enforce_all?=false
> +ifneq ($(filter noudeb,$(DEB_BUILD_PROFILES)),)
> +disable_d_i=true
> +endif

I'm not that knowledgable about build profiles, so maybe this is a dumb
question. There's a larger set of build profiles where you omit the
build dependencies for the udebs, but you only disable the code which
requires those tools when noudeb is in DEB_BUILD_PROFILES. Do the other
profiles imply noudeb, such that DEB_BUILD_PROFILES will contain noudeb
when those other build profiles are activated?

Thanks,
Seth

>  
>  # Don't build tools or udebs in a cross compile environment.
>  ifneq ($(DEB_HOST_ARCH),$(DEB_BUILD_ARCH))
> @@ -220,6 +223,7 @@ $(DEBIAN)/control.stub: 				\
>  debian/control: $(DEBIAN)/control.stub
>  	echo "# placebo control.stub for kernel-wedge flow change" >debian/control.stub
>  	cp $(DEBIAN)/control.stub debian/control
> +ifeq ($(disable_d_i),)
>  	# start new paragraph in debian/control
>  	echo >> debian/control
>  	# append udeb packages
> @@ -228,6 +232,7 @@ debian/control: $(DEBIAN)/control.stub
>  	LANG=C kernel-wedge gen-control $(release)-$(abinum) | \
>  		grep-dctrl -FArchitecture $(arch) \
>  		>>$(CURDIR)/debian/control
> +endif
>  
>  debian/canonical-certs.pem: $(wildcard $(DROOT)/certs/*-all.pem) $(wildcard $(DROOT)/certs/*-$(arch).pem) $(wildcard $(DEBIAN)/certs/*-all.pem) $(wildcard $(DEBIAN)/certs/*-$(arch).pem)
>  	for cert in $(sort $(notdir $^));					\
> -- 
> 2.27.0
> 
> 
> -- 
> kernel-team mailing list
> kernel-team at lists.ubuntu.com
> https://lists.ubuntu.com/mailman/listinfo/kernel-team



More information about the kernel-team mailing list