A utility to read an ELF file and print its packaging metadata. It looks for the note section header of type 0xCAFE1A7E
(.note.packaging
) and extracts the owner and value, following the specification.
Section header
SECTION: `.note.package`
note type: `0xcafe1a7e`
Owner: `FDO` (FreeDesktop.org)
Value: a single JSON object encoded as a zero-terminated UTF-8 string
Value example
{
"type": "rpm",
"name": "coreutils",
"version": "9.0-5.fc36",
"architecture": "x86_64",
"osCpe": "cpe:/o:fedoraproject:fedora:36"
}
Run pkgnote FILE
to print the JSON object or pkgnote -o FILE
to print the owner.
See Package Metadata for Core Files for the overview and details.
Requirements
- make
- gcc
- libelf
- json-c
git clone https://github.com/xfgusta/pkgnote
cd pkgnote
make
- Add a -k option to print a specific key
- Add man page