public inbox for elfutils@sourceware.org
 help / color / mirror / Atom feed
From: Mark Wielaard <mark@klomp.org>
To: "Luca Boccassi" <bluca@debian.org>,
	"Zbigniew Jędrzejewski-Szmek" <zbyszek@in.waw.pl>
Cc: devel@lists.fedoraproject.org,
	systemd-devel@lists.freedesktop.org,
	 debhelper@packages.debian.org, binutils@sourceware.org,
	Lennart Poettering <lennart@poettering.net>,
	debian-dpkg@lists.debian.org,
	 "elfutils-devel@sourceware.org" <elfutils-devel@sourceware.org>
Subject: Re: Storing package metadata in ELF objects
Date: Thu, 06 May 2021 03:17:30 +0200	[thread overview]
Message-ID: <f289ad7cbd0a92d524f7467cbd048b20676155b4.camel@klomp.org> (raw)
In-Reply-To: <177ac3ccb8dbb0dbc3a18c6ce75c53b691b38d47.camel@debian.org>

[-- Attachment #1: Type: text/plain, Size: 1064 bytes --]

Hi Luca,

On Tue, 2021-05-04 at 14:43 +0100, Luca Boccassi wrote:
> On Fri, 2021-04-30 at 19:57 +0200, Mark Wielaard wrote:
> > Is there a list of default keys (and their canonical spelling, upper-
> > lower-Camel_Case, etc.)? If there is, could we have a "debuginfod" key
> > with as value an URL pointing to the debuginfod server URL where the
> > embedded build-id executable, debuginfo and sources can be found?
> > https://sourceware.org/elfutils/Debuginfod.html
> 
> The "Implementation" section of the spec lists the "main" fields:
> 
> https://systemd.io/COREDUMP_PACKAGE_METADATA/
> 
> (source for that is https://github.com/systemd/systemd/blob/main/docs/COREDUMP_PACKAGE_METADATA.md )
> 
> Would you like to send a PR to update it and add that field?

Sorry, I don't have a github account. But attached is a patch for to
document it and one for the package-notes generator to add an --
debuginfod argument (maybe the distro should set a default value for
that?) Hopefully those patches could be applied somehow.

Thanks,

Mark

[-- Attachment #2: 0001-docs-COREDUMP_PACKAGE_METADATA.md-Add-debuginfod-key.patch --]
[-- Type: text/x-patch, Size: 1462 bytes --]

From 176dde09fcfeff9bff97fbf65d47a641dbd2fa3a Mon Sep 17 00:00:00 2001
From: Mark Wielaard <mark@klomp.org>
Date: Thu, 6 May 2021 03:05:02 +0200
Subject: [PATCH] docs/COREDUMP_PACKAGE_METADATA.md: Add debuginfod key

Signed-off-by: Mark Wielaard <mark@klomp.org>
---
 docs/COREDUMP_PACKAGE_METADATA.md | 5 +++++
 1 file changed, 5 insertions(+)

diff --git a/docs/COREDUMP_PACKAGE_METADATA.md b/docs/COREDUMP_PACKAGE_METADATA.md
index ab7c4596de..b7be9ca797 100644
--- a/docs/COREDUMP_PACKAGE_METADATA.md
+++ b/docs/COREDUMP_PACKAGE_METADATA.md
@@ -26,6 +26,10 @@ Thus it becomes desirable to add additional metadata to a binary at build time,
 `systemd-coredump` and other services analyzing core files are able to extract said
 metadata simply from the core file itself, without external dependencies.
 
+And in case external dependencies and network are available the core file
+should also include the debuginfod server URL that can provide the original
+executable, debuginfo and sources to facilitate debugging.
+
 ## Implementation
 
 This document will attempt to define a common metadata format specification, so that
@@ -58,6 +62,7 @@ Value: a JSON string with the structure described below
      "name":"coreutils",
      "version": "4711.0815.fc13.arm32",
      "osCpe":               # A CPE name for the operating system, `CPE_NAME` from os-release is a good default
+     "debuginfod": "https://debuginfod.fedoraproject.org"
 }
 ```
 
-- 
2.18.4


[-- Attachment #3: 0001-generate-package-notes.py-Add-debuginfod-argument.patch --]
[-- Type: text/x-patch, Size: 997 bytes --]

From 6264605699cbac02ed3060cc1ff6497b32e90382 Mon Sep 17 00:00:00 2001
From: Mark Wielaard <mark@klomp.org>
Date: Thu, 6 May 2021 03:13:57 +0200
Subject: [PATCH] generate-package-notes.py: Add --debuginfod argument

Signed-off-by: Mark Wielaard <mark@klomp.org>
---
 generate-package-notes.py | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/generate-package-notes.py b/generate-package-notes.py
index c0b5d98..92126f7 100755
--- a/generate-package-notes.py
+++ b/generate-package-notes.py
@@ -71,6 +71,7 @@ def parse_args():
     p.add_argument('--package-version')
     p.add_argument('--cpe')
     p.add_argument('--rpm', metavar='NEVRA')
+    p.add_argument('--debuginfod')
 
     opts = p.parse_args()
 
@@ -143,6 +144,8 @@ def generate_section(opts):
     else:
         data['os'] = read_os_release('ID')
         data['osVersion'] = read_os_release('VERSION_ID')
+    if opts.debuginfod:
+        data['debuginfod'] = opts.debuginfod
 
     json = json_serialize(data)
 
-- 
2.18.4


  reply	other threads:[~2021-05-06  1:17 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-04-10 12:29 Luca Boccassi
2021-04-10 12:38 ` Luca Boccassi
2021-04-10 18:44   ` Zbigniew Jędrzejewski-Szmek
2021-04-30 17:57     ` Mark Wielaard
2021-05-04 13:43       ` Luca Boccassi
2021-05-06  1:17         ` Mark Wielaard [this message]
2021-05-06 11:43           ` Luca Boccassi
2021-05-14 10:41   ` Guillem Jover
2021-05-14 13:41     ` Luca Boccassi
2021-05-19  0:19       ` Guillem Jover
2021-05-19 14:58         ` Mark Wielaard
2021-05-24 10:17           ` Luca Boccassi

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=f289ad7cbd0a92d524f7467cbd048b20676155b4.camel@klomp.org \
    --to=mark@klomp.org \
    --cc=binutils@sourceware.org \
    --cc=bluca@debian.org \
    --cc=debhelper@packages.debian.org \
    --cc=debian-dpkg@lists.debian.org \
    --cc=devel@lists.fedoraproject.org \
    --cc=elfutils-devel@sourceware.org \
    --cc=lennart@poettering.net \
    --cc=systemd-devel@lists.freedesktop.org \
    --cc=zbyszek@in.waw.pl \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).