1
0

drop debug packages

This commit is contained in:
Konstantin Demin 2024-10-29 05:12:06 +03:00
parent f63f36de4f
commit 035dfc85aa
8 changed files with 4 additions and 123 deletions

View File

@ -233,9 +233,6 @@ Several build profiles are understood and supported:
- pkg.linux.mintools: Build minimal set of userland tool packages - pkg.linux.mintools: Build minimal set of userland tool packages
(linux-kbuild-<version>) (linux-kbuild-<version>)
- pkg.linux.nokernel: Exclude kernel image and header packages - pkg.linux.nokernel: Exclude kernel image and header packages
- pkg.linux.nokerneldbg: Exclude kernel debug packages
- pkg.linux.nokerneldbginfo: Build kernel without debug symbols (also disables
BTF)
- pkg.linux.nosource: Exclude source binary package (linux-source-<version>) - pkg.linux.nosource: Exclude source binary package (linux-source-<version>)
- cross: Needed when cross-building. - cross: Needed when cross-building.
- nopython: Disable Python bindings. This currently disables building the - nopython: Disable Python bindings. This currently disables building the

View File

@ -359,14 +359,6 @@ class Gencontrol(Base):
if config.build.enable_vdso: if config.build.enable_vdso:
makeflags['VDSO'] = True makeflags['VDSO'] = True
packages_own.extend(
self.bundle.add('image-dbg', ruleid, makeflags, vars, arch=arch)
)
if do_meta:
packages_own.extend(
self.bundle.add('image-dbg.meta', ruleid, makeflags, vars, arch=arch)
)
if ( if (
config.defs_flavour.is_default config.defs_flavour.is_default
# XXX # XXX

64
debian/rules.real vendored
View File

@ -71,8 +71,7 @@ source: $(STAMPS_DIR)/source_$(FEATURESET)
$(BUILD_DIR)/config.$(ARCH)_$(FEATURESET)_$(FLAVOUR): $(KCONFIG) $(BUILD_DIR)/config.$(ARCH)_$(FEATURESET)_$(FLAVOUR): $(KCONFIG)
mkdir -p '$(dir $@)' mkdir -p '$(dir $@)'
debian/bin/kconfig.py '$@' $(KCONFIG) $(KCONFIG_OPTIONS) \ debian/bin/kconfig.py '$@' $(KCONFIG) $(KCONFIG_OPTIONS)
$(call if_profile, pkg.linux.nokerneldbginfo pkg.linux.quick,-o DEBUG_INFO_NONE=y -o DEBUG_INFO_DWARF_TOOLCHAIN_DEFAULT=n)
define copy_source define copy_source
mkdir -p '$(1)' mkdir -p '$(1)'
@ -399,6 +398,7 @@ build_image: $(STAMPS_DIR)/build_$(ARCH)_$(FEATURESET)_$(FLAVOUR)
binary_image: DH_STRIP_ARGS = --no-automatic-dbgsym binary_image: DH_STRIP_ARGS = --no-automatic-dbgsym
binary_image: REAL_VERSION = $(ABINAME)$(LOCALVERSION) binary_image: REAL_VERSION = $(ABINAME)$(LOCALVERSION)
binary_image: SYSTEM_MAP_PATH = lib/modules/$(REAL_VERSION)/System.map.xz
binary_image: INSTALL_DIR = $(DESTDIR)/boot binary_image: INSTALL_DIR = $(DESTDIR)/boot
binary_image: DIR = $(BUILD_DIR)/build_$(ARCH)_$(FEATURESET)_$(FLAVOUR) binary_image: DIR = $(BUILD_DIR)/build_$(ARCH)_$(FEATURESET)_$(FLAVOUR)
binary_image: DIR2 = $(BUILD_DIR)/install_$(ARCH)_$(FEATURESET)_$(FLAVOUR) binary_image: DIR2 = $(BUILD_DIR)/install_$(ARCH)_$(FEATURESET)_$(FLAVOUR)
@ -411,8 +411,8 @@ ifneq ($(filter arm64 armel armhf mipsel mips64el mipsr6 mipsr6el mips64r6 mips6
dh_install --sourcedir=$(DIR2) usr dh_install --sourcedir=$(DIR2) usr
endif endif
sed '/CONFIG_\(MODULE_SIG_\(ALL\|KEY\)\|SYSTEM_TRUSTED_KEYS\|BUILD_SALT\)[ =]/d' $(DIR)/.config > $(DESTDIR)/boot/config-$(REAL_VERSION) sed '/CONFIG_\(MODULE_SIG_\(ALL\|KEY\)\|SYSTEM_TRUSTED_KEYS\|BUILD_SALT\)[ =]/d' $(DIR)/.config > $(DESTDIR)/boot/config-$(REAL_VERSION)
echo "ffffffffffffffff B The real System.map is in the linux-image-<version>-dbg package" \ xz -9k < $(DIR)/System.map > $(DESTDIR)/$(SYSTEM_MAP_PATH)
> $(DESTDIR)/boot/System.map-$(REAL_VERSION) echo "ffffffffffffffff B The real System.map is compressed into /$(SYSTEM_MAP_PATH)" > $(DESTDIR)/boot/System.map-$(REAL_VERSION)
rm $(DESTDIR)/lib/firmware -rf rm $(DESTDIR)/lib/firmware -rf
+$(MAKE_SELF) \ +$(MAKE_SELF) \
binary_image_bug \ binary_image_bug \
@ -425,62 +425,6 @@ binary_image_bug:
chmod 755 $(DESTDIR)/usr/share/bug/$(PACKAGE_NAME)/script chmod 755 $(DESTDIR)/usr/share/bug/$(PACKAGE_NAME)/script
printf "RELEASE='$(REAL_VERSION)'\nDISTRIBUTOR='$(DEB_VENDOR)'\nSOURCEVERSION='$(SOURCEVERSION)'\nPACKAGE_NAME='$(PACKAGE_NAME)'\nPACKAGE_VERSION='$(SOURCEVERSION)'" > $(DESTDIR)/usr/share/bug/$(PACKAGE_NAME)/info printf "RELEASE='$(REAL_VERSION)'\nDISTRIBUTOR='$(DEB_VENDOR)'\nSOURCEVERSION='$(SOURCEVERSION)'\nPACKAGE_NAME='$(PACKAGE_NAME)'\nPACKAGE_VERSION='$(SOURCEVERSION)'" > $(DESTDIR)/usr/share/bug/$(PACKAGE_NAME)/info
build_image-dbg: $(STAMPS_DIR)/build_$(ARCH)_$(FEATURESET)_$(FLAVOUR)
binary_image-dbg: REAL_VERSION = $(ABINAME)$(LOCALVERSION)
binary_image-dbg: DEBUG_DIR = $(DESTDIR)/usr/lib/debug
binary_image-dbg: DIR = $(BUILD_DIR)/build_$(ARCH)_$(FEATURESET)_$(FLAVOUR)
binary_image-dbg: $(STAMPS_DIR)/build_$(ARCH)_$(FEATURESET)_$(FLAVOUR)
$(dh_binary_pre)
dh_installdirs usr/lib/debug usr/lib/debug/boot usr/share/lintian/overrides/
install -m644 $(DIR)/vmlinux $(DEBUG_DIR)/boot/vmlinux-$(REAL_VERSION)
install -m644 $(DIR)/System.map $(DEBUG_DIR)/boot/System.map-$(REAL_VERSION)
# cmd_sign=: Don't sign modules
# suffix-y=: Don't compress modules
+$(MAKE_CLEAN) -C $(DIR) modules_install \
cmd_sign= \
suffix-y= \
DEPMOD='$(CURDIR)/debian/bin/no-depmod' \
INSTALL_MOD_PATH=$(DEBUG_DIR)
# Verify we don't have any signed modules installed
@if find $(DEBUG_DIR)/lib/modules/$(REAL_VERSION) -name '*.ko' | xargs grep -q '~Module signature appended~'; then \
echo; \
echo 'Signed modules to be installed into debug package $(PACKAGE_NAME)'; \
echo; \
exit 1; \
fi
# Verify we don't have any compressed modules installed
@if ! find $(DEBUG_DIR)/lib/modules/$(REAL_VERSION) -name '*.ko.*' -exec false {} +; then \
echo; \
echo 'Compressed modules to be installed into debug package $(PACKAGE_NAME)'; \
echo; \
exit 1; \
fi
find $(DEBUG_DIR)/lib/modules/$(REAL_VERSION)/ -mindepth 1 -maxdepth 1 \! -name kernel -exec rm {} \+
rm $(DEBUG_DIR)/lib/firmware -rf
ifeq ($(VDSO),True)
+$(MAKE_CLEAN) -C $(DIR) vdso_install INSTALL_MOD_PATH=$(DEBUG_DIR)
# Create .build-id links. Some architectures already do so, but in the
# wrong place, so delete those first.
rm -rf $(DEBUG_DIR)/lib/modules/$(REAL_VERSION)/vdso/.build-id
find $(DEBUG_DIR)/lib/modules/$(REAL_VERSION)/vdso/ -type f | while read vdso; do \
if buildid="$$(readelf -n "$$vdso" | sed -rne 's/^\s+Build ID: (.*)$$/\1/p')" && [ "$$buildid" ]; then \
mkdir -p "$(DEBUG_DIR)/.build-id/$${buildid:0:2}"; \
ln -s -r "$$vdso" "$(DEBUG_DIR)/.build-id/$${buildid:0:2}/$${buildid:2}.debug"; \
fi; \
done
endif
# Add symlinks to vmlinux from the locations expected by kdump-tools,
# systemtap and others
ln -s boot/vmlinux-$(REAL_VERSION) $(DEBUG_DIR)/
mkdir -p $(DEBUG_DIR)/lib/modules/$(REAL_VERSION)
ln -s ../../../boot/vmlinux-$(REAL_VERSION) $(DEBUG_DIR)/lib/modules/$(REAL_VERSION)/vmlinux
$(dh_binary_post)
build_source: build_source:
binary_source: BUILDDEB_ARGS = -Zxz -z0 binary_source: BUILDDEB_ARGS = -Zxz -z0

View File

@ -1,9 +0,0 @@
Package: linux-image-@abiname@@localversion@-dbg
Meta-Rules-Target: image-dbg
Build-Profiles: <!pkg.linux.nokernel !pkg.linux.nokerneldbg !pkg.linux.quick>
Depends: ${misc:Depends}
Section: debug
Priority: optional
Description: Debug symbols for linux-image-@abiname@@localversion@
This package provides the detached debug symbols for the Linux kernel
and modules in linux-image-@abiname@@localversion@.

View File

@ -1,32 +0,0 @@
# Kernel dbg packages contain a full image with debug data
{{package}}: dbg-package-missing-depends
# glibc doesn't seem to check for a PT_GNU_STACK section in vDSOs, so
# it's OK that they don't have it
{% if arch in ['arm64', 'armhf'] %}
{{package}}: shared-library-lacks-stack-section *usr/lib/debug/lib/modules/{{abiname}}{{localversion}}/vdso/vdso.so*
{% endif %}
{% if arch in ['amd64', 'arm64', 'ppc64el', 's390x'] %}
{{package}}: shared-library-lacks-stack-section *usr/lib/debug/lib/modules/{{abiname}}{{localversion}}/vdso/vdso32.so*
{% endif %}
{% if arch in ['amd64', 'ppc64el', 's390x'] %}
{{package}}: shared-library-lacks-stack-section *usr/lib/debug/lib/modules/{{abiname}}{{localversion}}/vdso/vdso64.so*
{% endif %}
{% if arch in ['amd64'] %}
{{package}}: shared-library-lacks-stack-section *usr/lib/debug/lib/modules/{{abiname}}{{localversion}}/vdso/vdsox32.so*
{% endif %}
# It is intended that 64-bit kernels provide vDSOs for 32-bit executables.
# lintian currently allows i386 executables on amd64.
{% if arch in ['arm64', 'ppc64el', 's390x'] %}
{{package}}: binary-from-other-architecture *usr/lib/debug/lib/modules/{{abiname}}{{localversion}}/vdso/vdso32.so*
{% endif %}
{% if arch in ['amd64'] %}
{{package}}: binary-from-other-architecture *usr/lib/debug/lib/modules/{{abiname}}{{localversion}}/vdso/vdsox32.so*
{% endif %}
# Some 32-bit architectures need 64-bit kernels and we still build
# these as the "wrong" architecture rather than mandating multiarch.
{% if arch in ['hppa', 'mips', 'mipsel', 'powerpc'] %}
{{package}}: binary-from-other-architecture *usr/lib/debug/*
{% endif %}

View File

@ -1,9 +0,0 @@
Package: linux-image@source_suffix@@localversion@-dbg
Meta-Rules-Target: meta
Meta-Rules-Makeflags: INSTALLDOCS_LINK_DOC=linux-image-@abiname@@localversion@-dbg
Build-Profiles: <!pkg.linux.nokernel !pkg.linux.nokerneldbg !pkg.linux.nometa !pkg.linux.quick>
Depends: linux-image-@abiname@@localversion@-dbg (= ${binary:Version}), ${misc:Depends}
Provides: linux-latest-image-dbg
Description: Debugging symbols for Linux @flavour@ configuration (meta-package)
This package depends on the detached debugging symbols for the latest
Linux kernel @flavour@ configuration.

View File

@ -1 +0,0 @@
@package@: wrong-section-according-to-package-name linux-image@source_suffix@-@flavour@-dbg => debug

View File

@ -1 +0,0 @@
dir_to_symlink /usr/share/doc/@package@ linux-image-@abiname@@localversion@-dbg 5.7~rc5-1~exp1 @package@