systemd / package-notes

Tools to add packaging metadata to ELF files
16 stars 10 forks source link

Merging generate-package-note variant #13

Closed ismailhkose closed 2 years ago

ismailhkose commented 3 years ago

Hello,

TLDR; I have an implementation of generate-package-note tool, and we have been already using it in the internal projects for a while. I want to merge our tool here to have single version of the tool in open source community. I hope it could be okay to contribute here and combine our version with yours. I wonder if you could accept my changes in your repo, or what changes you could accept here.

Background story We were discussing different format at the beginning to embed meta data into ELF files. @bluca, who was part of the discussion here, were helping us to communicate with your community while defining the format. He advised us to follow the JSON format you have agreed. Therefore we could spread this format across the open source community easier.

The internal version of the script, which is now publicly available at CBL-Mariner github repository, already follows the JSON format discussed here, and here in the documentation. It has some additional fields for our needs.

It generates same output file that was described in this discussion:.

There are design differences between scripts, and it includes additional meta data, which is optionally passed to the tool at command line. Also, It supports generating two types of outputs.

1 - Linker script and optionally generated header file. Mariner project now uses this method.

2 - C code that keeps .note.package section in an array and mapped to .note.package note section. This method will be depricated soon, as soon as the dependent patches applied to our binutils version. Older version of binutils have Linker script related bug, and it can't get note section information thru linker script. I'm trying to find the relevant patches to backport.

Before creating a PR against your repo, I wanted to get your opinions about what you think and what could be your preferred merging strategy. The license will be also updated to follow yours.

Please let me know thoughts.

@keszybz, @bluca, @viccie30 , FYI

Thank, Ismail

keszybz commented 3 years ago

Hello,

TLDR; I have an implementation of generate-package-note tool, and we have been already using it in the internal projects for a while. I want to merge our tool here to have single version of the tool in open source community. I hope it could be okay to contribute here and combine our version with yours. I wonder if you could accept my changes in your repo, or what changes you could accept here.

Hi, in general, we want this tool to be useful in various build systems, so I'd say that we're happy to merge support for new features, as long as those features are at least somewhat generic. So for example the ability to add new fields to the output would be very welcome, but some hardcoded field name and value that is very specific to CBL-Mariner much less so.

There are design differences between scripts, and it includes additional meta data, which is optionally passed to the tool at command line.

I hope we can add something generic like --field=name=value that would cover most of such custom fields. A dedicated option should only be added for items that are widely applicable.

Also, It supports generating two types of outputs.

1 - Linker script and optionally generated header file. Mariner project now uses this method.

2 - C code that keeps .note.package section in an array and mapped to .note.package note section. This method will be depricated soon, as soon as the dependent patches applied to our binutils version. Older version of binutils have Linker script related bug, and it can't get note section information thru linker script. I'm trying to find the relevant patches to backport.

If it's deprecated, I'd prefer not to add it here.

Before creating a PR against your repo, I wanted to get your opinions about what you think and what could be your preferred merging strategy. The license will be also updated to follow yours.

Like any pull request? One commit per logical change, etc.

bluca commented 3 years ago

Also, It supports generating two types of outputs. 1 - Linker script and optionally generated header file. Mariner project now uses this method. 2 - C code that keeps .note.package section in an array and mapped to .note.package note section. This method will be depricated soon, as soon as the dependent patches applied to our binutils version. Older version of binutils have Linker script related bug, and it can't get note section information thru linker script. I'm trying to find the relevant patches to backport.

If it's deprecated, I'd prefer not to add it here.

Yes, let's not add this here, if there are bugs in older versions of binutils they can be documented and the patches can be backported.

keszybz commented 2 years ago

Let's close the issue, since there isn't anything to track on this side. A pull request would be welcome.