From patchwork Mon May 17 18:50:01 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Krzysztof Kozlowski X-Patchwork-Id: 1479772 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=none (no SPF record) smtp.mailfrom=lists.ubuntu.com (client-ip=91.189.94.19; helo=huckleberry.canonical.com; envelope-from=kernel-team-bounces@lists.ubuntu.com; receiver=) Received: from huckleberry.canonical.com (huckleberry.canonical.com [91.189.94.19]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 4FkSqq4YCvz9sWT; Tue, 18 May 2021 04:50:15 +1000 (AEST) Received: from localhost ([127.0.0.1] helo=huckleberry.canonical.com) by huckleberry.canonical.com with esmtp (Exim 4.86_2) (envelope-from ) id 1liiJf-0002Gd-1p; Mon, 17 May 2021 18:50:11 +0000 Received: from youngberry.canonical.com ([91.189.89.112]) by huckleberry.canonical.com with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.86_2) (envelope-from ) id 1liiJd-0002GW-9D for kernel-team@lists.ubuntu.com; Mon, 17 May 2021 18:50:09 +0000 Received: from mail-qk1-f200.google.com ([209.85.222.200]) by youngberry.canonical.com with esmtps (TLS1.2) tls TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256 (Exim 4.93) (envelope-from ) id 1liiJc-0004ue-VL for kernel-team@lists.ubuntu.com; Mon, 17 May 2021 18:50:09 +0000 Received: by mail-qk1-f200.google.com with SMTP id v1-20020a05620a1221b02902ea88445e01so5402879qkj.9 for ; Mon, 17 May 2021 11:50:08 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:subject:date:message-id:mime-version :content-transfer-encoding; bh=eU/AGNxBRZtoYzxPkdlfhZ/hfccCf9zQ0UHuNAjMCiA=; b=WSww080eRY3Q8ITmb62/dRea26xwAgRinn6/Ps/lvudFQ3RzEsssQVuUHd/E/yyHgo gOM8cJxhi+UAp8XDtU9E0y7uVOlmbTGzilkWdZMVRgM0x1EqeiIMS1EuQQp8y2b0YXYJ 2hhyh6zpWN4PzCYvSX+ECIg/fmTdNeti/Go9Vf+NlOkTgHBCRviERK7FfavbRPb4rOtX ydrt2pYmCEKaegr/I0yjRAWIiIgVDj5eTqITFVqZWBlry+dIXgs6l7cwXVEI8QnQlUCY 8cgHvNgV46bSaromC6msM5wuS537PY0PW4EDWiTwFuH0ntsKmCO8MFYOOQNYIKkyA2oY ECxw== X-Gm-Message-State: AOAM530NZlp0gQiOalE/Z2bbQbKZXL6KiVawOS71fOWM3yBwE0bdGsl1 eXtiAjbchqNaRZcddbyASZ5xRiXAVMVxXLKHtX4d9zIIMy8lO/vkiSv0MQ0OGdfUuwCryWQ1TAM QcCWFq0EZdZVxVCV5sWJP2nZ1wr0A7H2pPW2Q4ZpUjg== X-Received: by 2002:ac8:543:: with SMTP id c3mr884128qth.241.1621277407782; Mon, 17 May 2021 11:50:07 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwe/9aRZJraoL5m+1U2mPWf2FJCia4xj8/iz7LLXseMZouxCxxJ7Obep2faFeDV3fqV2yaOTA== X-Received: by 2002:ac8:543:: with SMTP id c3mr884107qth.241.1621277407503; Mon, 17 May 2021 11:50:07 -0700 (PDT) Received: from localhost.localdomain ([45.237.48.3]) by smtp.gmail.com with ESMTPSA id t5sm10999350qtr.19.2021.05.17.11.50.06 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 17 May 2021 11:50:06 -0700 (PDT) From: Krzysztof Kozlowski To: kernel-team@lists.ubuntu.com Subject: [UNSTABLE][PATCH v2] UBUNTU: [Packaging] Build and include GDB Python scripts into debug packages Date: Mon, 17 May 2021 14:50:01 -0400 Message-Id: <20210517185001.123609-1-krzysztof.kozlowski@canonical.com> X-Mailer: git-send-email 2.27.0 MIME-Version: 1.0 X-BeenThere: kernel-team@lists.ubuntu.com X-Mailman-Version: 2.1.20 Precedence: list List-Id: Kernel team discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: kernel-team-bounces@lists.ubuntu.com Sender: "kernel-team" The kernel comes with useful GDB debugging scripts/commands (enabled with CONFIG_GDB_SCRIPTS), however these are built either with "all" make target or with "scripts_gdb". Build these in "$(stampdir)/stamp-build-%" target and package in "install-%" under /usr/lib/debug/share. BugLink: https://bugs.launchpad.net/bugs/1928715 Signed-off-by: Krzysztof Kozlowski --- Changes since v1 (RFC): 1. Add a comment inside .mk. 2. More tests. --- debian/rules.d/2-binary-arch.mk | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/debian/rules.d/2-binary-arch.mk b/debian/rules.d/2-binary-arch.mk index 0b008df5a853..d297dc84ff48 100644 --- a/debian/rules.d/2-binary-arch.mk +++ b/debian/rules.d/2-binary-arch.mk @@ -49,6 +49,13 @@ $(stampdir)/stamp-build-%: $(stampdir)/stamp-prepare-% @echo Debug: $@ build_image $(build_image) bldimg $(bldimg) $(build_cd) $(kmake) $(build_O) $(conc_level) $(bldimg) modules $(if $(filter true,$(do_dtbs)),dtbs) +ifneq ($(skipdbg),true) + # The target scripts_gdb is part of "all", so we need to call it manually + if grep -q CONFIG_GDB_SCRIPTS=y $(builddir)/build-$*/.config; then \ + $(build_cd) $(kmake) $(build_O) $(conc_level) scripts_gdb ; \ + fi +endif + @touch $@ define build_dkms_sign = @@ -295,6 +302,12 @@ ifneq ($(skipdbg),true) # Debug image is simple install -m644 -D $(builddir)/build-$*/vmlinux \ $(dbgpkgdir)/usr/lib/debug/boot/vmlinux-$(abi_release)-$* + if [ -d $(builddir)/build-$*/scripts/gdb/linux ]; then \ + install -m644 -D $(builddir)/build-$*/vmlinux-gdb.py \ + $(dbgpkgdir)/usr/lib/debug/share/$(abi_release)-$*/vmlinux-gdb.py; \ + install -m644 -D $(builddir)/build-$*/scripts/gdb/linux/* \ + --target-directory=$(dbgpkgdir)/usr/lib/debug/share/$(abi_release)-$*/scripts/gdb/linux; \ + fi $(build_cd) $(kmake) $(build_O) modules_install $(vdso) \ INSTALL_MOD_PATH=$(dbgpkgdir)/usr/lib/debug # Add .gnu_debuglink sections only after all/DKMS modules are built.