UBUNTU: [Packaging] check debian.env to determine do_libc_dev_package

The linux-libc-dev package provides UAPI headers. The Linux kernel
promises backward compatibile API to userspace. That is the reason
why there exists only one linux-lib-dev per series. Its package name
does not contain any ABI number or flavour string since there is no
point in installing multiple instances of linux-lib-dev.

This leads to an obvious conclusion; only the master kernel should
provide linux-libc-dev.

Currently, it is checked at compile-time. If you attempt to build
linux-libc-dev on a non-master kernel, it errors out with
"non-master branch building linux-libc-dev, aborting".

When constructing debian/control, the linux-libc-dev enablement is
determined by do_libc_dev_package, which is set to true if the
'variants' variable contains '--'. This is tricky, and it is difficult
to understand the intention. In fact, do_libc_dev_package is true for
most kernels except linux-unstable. Derivative kernels disable
linux-libc-dev by removing linux-libc-dev.stub.

This commits adopts a simpler logic; enable linux-libc-dev if
debian/debian.env contains DEBIAN=debian.master.

Please note this commit changes the behaviour of linux-unstable.
linux-unstable previously disabled linux-lib-dev because it defined
variants=-wip, but it is enabled now. It should not be a big deal
since we do not publish linux-unstable.

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 b4c9addfdb
commit 12489d44e9
3 changed files with 1 additions and 9 deletions
-2
View File
@@ -173,10 +173,8 @@ include $(DROOT)/rules.d/4-checks.mk
control_files := $(DEBIAN)/control.stub.in
ifeq ($(do_libc_dev_package),true)
ifneq (,$(wildcard $(DEBIAN)/control.d/linux-libc-dev.stub))
control_files += $(DEBIAN)/control.d/linux-libc-dev.stub
endif
endif
# Calculate Ubuntu Compatible Signing levels
UBUNTU_COMPATIBLE_SIGNING=$(shell grep -qx ' *Subject: C = GB, ST = Isle of Man, O = Canonical Ltd., OU = Secure Boot, CN = Canonical Ltd. Secure Boot Signing (2021 v3)' debian/canonical-revoked-certs.pem && echo ubuntu/4 pro/3)
+1 -3
View File
@@ -121,9 +121,7 @@ ifeq ($(do_full_build),false)
do_source_package_content=false
endif
# linux-libc-dev may not be needed, default to building it only for the
# primary variant
ifneq ($(filter --,$(variants)),)
ifeq ($(DEBIAN),debian.master)
do_libc_dev_package=true
else
do_libc_dev_package=false
-4
View File
@@ -557,10 +557,6 @@ binary-arch-headers: install-arch-headers
dh_testdir
dh_testroot
ifeq ($(do_libc_dev_package),true)
ifeq ($(filter debian.master%,$(DEBIAN)),)
echo "non-master branch building linux-libc-dev, aborting"
exit 1
endif
$(call dh_all,linux-libc-dev)
endif