mirror of
https://github.com/morgan9e/systemd
synced 2026-04-14 00:14:32 +09:00
coredump: update and shorten package metadata keys
Follow-up for a7ea0a460b
This commit is contained in:
@@ -52,12 +52,12 @@ Value: a JSON string with the structure described below
|
||||
|
||||
```json
|
||||
{
|
||||
"packageType":"rpm", # this provides a namespace for the package+package-version fields
|
||||
"packageDistro":"fedora",
|
||||
"packageDistroVersion":"33",
|
||||
"package":"coreutils",
|
||||
"packageVersion": "4711.0815.fc13.arm32",
|
||||
"cpe": # A CPE name for the operating system, `CPE_NAME` from os-release is a good default
|
||||
"type":"rpm", # this provides a namespace for the package+package-version fields
|
||||
"os":"fedora",
|
||||
"osVersion":"33",
|
||||
"name":"coreutils",
|
||||
"version": "4711.0815.fc13.arm32",
|
||||
"osCpe": # A CPE name for the operating system, `CPE_NAME` from os-release is a good default
|
||||
}
|
||||
```
|
||||
|
||||
@@ -72,38 +72,34 @@ SECTIONS
|
||||
{
|
||||
.note.package : ALIGN(4) {
|
||||
BYTE(0x04) BYTE(0x00) BYTE(0x00) BYTE(0x00) /* Length of Owner including NUL */
|
||||
BYTE(0x73) BYTE(0x00) BYTE(0x00) BYTE(0x00) /* Length of Value including NUL */
|
||||
BYTE(0x64) BYTE(0x00) BYTE(0x00) BYTE(0x00) /* Length of Value including NUL */
|
||||
BYTE(0x7e) BYTE(0x1a) BYTE(0xfe) BYTE(0xca) /* Note ID */
|
||||
BYTE(0x46) BYTE(0x44) BYTE(0x4f) BYTE(0x00) /* Owner: 'FDO\x00' */
|
||||
BYTE(0x7b) BYTE(0x22) BYTE(0x70) BYTE(0x61) /* Value: '{"packageType":"rpm","package":"systemd","packageVersion":"248~rc2-1.fc34","cpe":"cpe:/o:fedoraproject:fedora:33"}\x00\x00' */
|
||||
BYTE(0x63) BYTE(0x6b) BYTE(0x61) BYTE(0x67)
|
||||
BYTE(0x65) BYTE(0x54) BYTE(0x79) BYTE(0x70)
|
||||
BYTE(0x65) BYTE(0x22) BYTE(0x3a) BYTE(0x22)
|
||||
BYTE(0x72) BYTE(0x70) BYTE(0x6d) BYTE(0x22)
|
||||
BYTE(0x2c) BYTE(0x22) BYTE(0x70) BYTE(0x61)
|
||||
BYTE(0x63) BYTE(0x6b) BYTE(0x61) BYTE(0x67)
|
||||
BYTE(0x65) BYTE(0x22) BYTE(0x3a) BYTE(0x22)
|
||||
BYTE(0x73) BYTE(0x79) BYTE(0x73) BYTE(0x74)
|
||||
BYTE(0x65) BYTE(0x6d) BYTE(0x64) BYTE(0x22)
|
||||
BYTE(0x2c) BYTE(0x22) BYTE(0x70) BYTE(0x61)
|
||||
BYTE(0x63) BYTE(0x6b) BYTE(0x61) BYTE(0x67)
|
||||
BYTE(0x65) BYTE(0x56) BYTE(0x65) BYTE(0x72)
|
||||
BYTE(0x73) BYTE(0x69) BYTE(0x6f) BYTE(0x6e)
|
||||
BYTE(0x22) BYTE(0x3a) BYTE(0x22) BYTE(0x32)
|
||||
BYTE(0x34) BYTE(0x38) BYTE(0x7e) BYTE(0x72)
|
||||
BYTE(0x63) BYTE(0x32) BYTE(0x2d) BYTE(0x31)
|
||||
BYTE(0x2e) BYTE(0x66) BYTE(0x63) BYTE(0x33)
|
||||
BYTE(0x34) BYTE(0x22) BYTE(0x2c) BYTE(0x22)
|
||||
BYTE(0x63) BYTE(0x70) BYTE(0x65) BYTE(0x22)
|
||||
BYTE(0x3a) BYTE(0x22) BYTE(0x63) BYTE(0x70)
|
||||
BYTE(0x65) BYTE(0x3a) BYTE(0x2f) BYTE(0x6f)
|
||||
BYTE(0x3a) BYTE(0x66) BYTE(0x65) BYTE(0x64)
|
||||
BYTE(0x6f) BYTE(0x72) BYTE(0x61) BYTE(0x70)
|
||||
BYTE(0x72) BYTE(0x6f) BYTE(0x6a) BYTE(0x65)
|
||||
BYTE(0x63) BYTE(0x74) BYTE(0x3a) BYTE(0x66)
|
||||
BYTE(0x65) BYTE(0x64) BYTE(0x6f) BYTE(0x72)
|
||||
BYTE(0x61) BYTE(0x3a) BYTE(0x33) BYTE(0x33)
|
||||
BYTE(0x22) BYTE(0x7d) BYTE(0x00) BYTE(0x00)
|
||||
BYTE(0x7b) BYTE(0x22) BYTE(0x74) BYTE(0x79) /* Value: '{"type":"rpm","name":"systemd","version":"248~rc2-1.fc34","osCpe":"cpe:/o:fedoraproject:fedora:33"}\x00' */
|
||||
BYTE(0x70) BYTE(0x65) BYTE(0x22) BYTE(0x3a)
|
||||
BYTE(0x22) BYTE(0x72) BYTE(0x70) BYTE(0x6d)
|
||||
BYTE(0x22) BYTE(0x2c) BYTE(0x22) BYTE(0x6e)
|
||||
BYTE(0x61) BYTE(0x6d) BYTE(0x65) BYTE(0x22)
|
||||
BYTE(0x3a) BYTE(0x22) BYTE(0x73) BYTE(0x79)
|
||||
BYTE(0x73) BYTE(0x74) BYTE(0x65) BYTE(0x6d)
|
||||
BYTE(0x64) BYTE(0x22) BYTE(0x2c) BYTE(0x22)
|
||||
BYTE(0x76) BYTE(0x65) BYTE(0x72) BYTE(0x73)
|
||||
BYTE(0x69) BYTE(0x6f) BYTE(0x6e) BYTE(0x22)
|
||||
BYTE(0x3a) BYTE(0x22) BYTE(0x32) BYTE(0x34)
|
||||
BYTE(0x38) BYTE(0x7e) BYTE(0x72) BYTE(0x63)
|
||||
BYTE(0x32) BYTE(0x2d) BYTE(0x31) BYTE(0x2e)
|
||||
BYTE(0x66) BYTE(0x63) BYTE(0x33) BYTE(0x34)
|
||||
BYTE(0x22) BYTE(0x2c) BYTE(0x22) BYTE(0x6f)
|
||||
BYTE(0x73) BYTE(0x43) BYTE(0x70) BYTE(0x65)
|
||||
BYTE(0x22) BYTE(0x3a) BYTE(0x22) BYTE(0x63)
|
||||
BYTE(0x70) BYTE(0x65) BYTE(0x3a) BYTE(0x2f)
|
||||
BYTE(0x6f) BYTE(0x3a) BYTE(0x66) BYTE(0x65)
|
||||
BYTE(0x64) BYTE(0x6f) BYTE(0x72) BYTE(0x61)
|
||||
BYTE(0x70) BYTE(0x72) BYTE(0x6f) BYTE(0x6a)
|
||||
BYTE(0x65) BYTE(0x63) BYTE(0x74) BYTE(0x3a)
|
||||
BYTE(0x66) BYTE(0x65) BYTE(0x64) BYTE(0x6f)
|
||||
BYTE(0x72) BYTE(0x61) BYTE(0x3a) BYTE(0x33)
|
||||
BYTE(0x33) BYTE(0x22) BYTE(0x7d) BYTE(0x00)
|
||||
}
|
||||
}
|
||||
INSERT AFTER .note.gnu.build-id;
|
||||
|
||||
@@ -802,11 +802,11 @@ log:
|
||||
if (!path_equal_filename(module_name, context->meta[META_EXE]))
|
||||
continue;
|
||||
|
||||
package_name = json_variant_by_key(module_json, "package");
|
||||
package_name = json_variant_by_key(module_json, "name");
|
||||
if (package_name)
|
||||
(void) iovw_put_string_field(iovw, "COREDUMP_PACKAGE_NAME=", json_variant_string(package_name));
|
||||
|
||||
package_version = json_variant_by_key(module_json, "packageVersion");
|
||||
package_version = json_variant_by_key(module_json, "version");
|
||||
if (package_version)
|
||||
(void) iovw_put_string_field(iovw, "COREDUMP_PACKAGE_VERSION=", json_variant_string(package_version));
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user