UBUNTU: [Packaging] remove do_libc_dev_package variable

We should make a decision about linux-libc-package when constructing
debian/control.

Once debian/control is generated, builders must follow it. In other
words, we should not re-evaluate the do_libc_dev_package variable at
the build time.

Debian kernel commit fdd6dadb4aee ("Use dh_listpackages to determine
which packages to build") [1] introduced the if_package macro.

Import it to consult dh_listpackage to check if linux-libc-package is
listed in debian/control.

[1]: https://salsa.debian.org/kernel-team/linux/-/commit/fdd6dadb4aeea81342effdebd5edbf4bc19ccf4d

Signed-off-by: Masahiro Yamada <masahiro.yamada@canonical.com>
Acked-by: Dimitri John Ledkov <dimitri.ledkov@canonical.com>
Signed-off-by: Dimitri John Ledkov <dimitri.ledkov@canonical.com>
This commit is contained in:
Masahiro Yamada
2023-12-06 17:29:25 +09:00
committed by Paolo Pisati
parent 3744987cf0
commit c5108944af
4 changed files with 9 additions and 15 deletions
+1 -1
View File
@@ -172,7 +172,7 @@ include $(DROOT)/rules.d/3-binary-indep.mk
include $(DROOT)/rules.d/4-checks.mk
control_files := $(DEBIAN)/control.stub.in
ifeq ($(do_libc_dev_package),true)
ifeq ($(DEBIAN),debian.master)
control_files += $(DEBIAN)/control.d/linux-libc-dev.stub
endif
+5 -6
View File
@@ -27,6 +27,11 @@ upstream_tag := "v$(upstream_version).$(upstream_patchlevel)"
# Get the kernels own extra version to be added to the release signature.
raw_kernelversion=$(shell make kernelversion)
packages_enabled := $(shell dh_listpackages 2>/dev/null)
define if_package
$(if $(filter $(1),$(packages_enabled)),$(2))
endef
#
# do_full_build -- are we doing a full buildd style build, i.e., are we
# building in a PPA
@@ -115,12 +120,6 @@ ifeq ($(do_full_build),false)
do_source_package_content=false
endif
ifeq ($(DEBIAN),debian.master)
do_libc_dev_package=true
else
do_libc_dev_package=false
endif
# common headers normally is built as an indep package, but may be arch
do_common_headers_indep=true
-1
View File
@@ -70,7 +70,6 @@ printenv:
@echo "do_source_package = $(do_source_package)"
@echo "do_source_package_content = $(do_source_package_content)"
@echo "do_extras_package = $(do_extras_package)"
@echo "do_libc_dev_package = $(do_libc_dev_package)"
@echo "do_flavour_image_package = $(do_flavour_image_package)"
@echo "do_flavour_header_package = $(do_flavour_header_package)"
@echo "do_common_headers_indep = $(do_common_headers_indep)"
+3 -7
View File
@@ -520,9 +520,7 @@ install-arch-headers:
@echo Debug: $@
dh_testdir
dh_testroot
ifeq ($(do_libc_dev_package),true)
dh_prep -plinux-libc-dev
endif
$(call if_package, linux-libc-dev, dh_prep -plinux-libc-dev)
rm -rf $(headers_tmp) $(headers_dir)
$(kmake) O=$(headers_tmp) INSTALL_HDR_PATH=$(headers_dir)/usr $(conc_level) headers_install
mkdir $(headers_dir)/usr/include/$(DEB_HOST_MULTIARCH)
@@ -556,9 +554,7 @@ binary-arch-headers: install-arch-headers
@echo Debug: $@
dh_testdir
dh_testroot
ifeq ($(do_libc_dev_package),true)
$(call dh_all,linux-libc-dev)
endif
$(call if_package, linux-libc-dev, $(call dh_all,linux-libc-dev))
-include $(builddir)/skipped-dkms.mk
binary-%: pkgimg = $(bin_pkg_name)-$*
@@ -766,7 +762,7 @@ build-arch: $(build-arch-deps-true)
@echo Debug: $@
binary-arch-deps-$(do_flavour_image_package) += binary-debs
binary-arch-deps-$(do_libc_dev_package) += binary-arch-headers
binary-arch-deps-true += binary-arch-headers
ifneq ($(do_common_headers_indep),true)
binary-arch-deps-$(do_flavour_header_package) += binary-headers
endif