[PATCH v4 2/4] deb-pkg: split debug symbols in their own package

Ben Hutchings ben at decadent.org.uk
Wed May 8 03:14:41 UTC 2013


On Tue, 2013-05-07 at 17:46 +0200, Anisse Astier wrote:
> This can reduce almost 3 times the size of the linux-image package,
> while keeping the debug symbols available for this particular build, in
> their own package.
> 
> This mimics the way kernels are built in debian, ubuntu, or with
> make-kpkg, and comes at the price of a small slowdown in the building of
> packages.
> 
> Signed-off-by: Anisse Astier <anisse at astier.eu>
> ---
>  scripts/package/builddeb | 43 ++++++++++++++++++++++++++++++++++++++++++-
>  1 file changed, 42 insertions(+), 1 deletion(-)
> 
> diff --git a/scripts/package/builddeb b/scripts/package/builddeb
> index 2d84671..797484b 100644
> --- a/scripts/package/builddeb
> +++ b/scripts/package/builddeb
> @@ -78,17 +78,21 @@ tmpdir="$objtree/debian/tmp"
>  fwdir="$objtree/debian/fwtmp"
>  kernel_headers_dir="$objtree/debian/hdrtmp"
>  libc_headers_dir="$objtree/debian/headertmp"
> +dbg_dir="$objtree/debian/dbgtmp"
>  packagename=linux-image-$version
>  fwpackagename=linux-firmware-image
>  kernel_headers_packagename=linux-headers-$version
>  libc_headers_packagename=linux-libc-dev
> +dbg_packagename=$packagename-dbg
>  
>  if [ "$ARCH" = "um" ] ; then
>  	packagename=user-mode-linux-$version
>  fi
>  
> +BUILD_DEBUG="$(grep -s '^CONFIG_DEBUG_INFO=y' $objtree/$KCONFIG_CONFIG || true)"

As in the previous patch, you can omit $objtree/ here.

[...]
> @@ -128,6 +136,20 @@ if grep -q '^CONFIG_MODULES=y' $objtree/$KCONFIG_CONFIG ; then
>  		mv "$tmpdir/lib/modules/$version"/* "$tmpdir/usr/lib/uml/modules/$version/"
>  		rmdir "$tmpdir/lib/modules/$version"
>  	fi
> +	if [ -n "$BUILD_DEBUG" ] ; then
> +		(
> +			cd $tmpdir
> +			for module in $(find lib/modules/ -name *.ko); do

What if this is a non-modular kernel?

[...] 
> +if [ -n "$BUILD_DEBUG" ] ; then
> +	# Build debug package
> +	mkdir -p $dbg_dir/usr/lib/debug/lib/modules/$version/
> +	cp vmlinux $dbg_dir/usr/lib/debug/lib/modules/$version/
[...]

Different tools have different ideas about where vmlinux debuginfo
should be.  What I ended up doing in Debian's own kernel debug packages
in wheezy was installing/symlinking to all of:

/usr/lib/debug/boot/vmlinux-$version        [systemtap]
/usr/lib/debug/lib/modules/$version/vmlinux [perf]
/usr/lib/debug/vmlinux-$version             [kdump-tools]

So unless anyone has a better suggestion I think you'd better do the
same here.

(But really, the Linux development community ought to agree on a single
canonical path format that all such tools will support.)

Ben.

-- 
Ben Hutchings
For every action, there is an equal and opposite criticism. - Harrison

-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 828 bytes
Desc: This is a digitally signed message part
URL: <https://lists.ubuntu.com/archives/kernel-team/attachments/20130508/cc5ecaab/attachment.sig>


More information about the kernel-team mailing list