build: fix kernel component in CycloneDX SBOM
authorCedric DOURLENT <cedric.dourlent@softathome.com>
Fri, 1 Mar 2024 15:42:34 +0000 (16:42 +0100)
committerCedric DOURLENT <cedric.dourlent@softathome.com>
Fri, 1 Mar 2024 15:42:34 +0000 (16:42 +0100)
As stated in the cycloneDX documentation, the field "type" is mandatory for all components.

More details here (https://cyclonedx.org/docs/1.5/json/#components_items_type)

Signed-off-by: Cedric DOURLENT <cedric.dourlent@softathome.com>
scripts/package-metadata.pl

index 9e0e6dd9e58934d418fb3cd43fc436bdcb0b1c53..a46f819ab50f0fc8ce3b133ddff93ee6295b221f 100755 (executable)
@@ -677,6 +677,7 @@ sub gen_image_cyclonedxsbom() {
                license => "GPL-2.0",
                cpe_id  => "cpe:/o:linux:linux_kernel",
                name    => "kernel",
+               category  => "operating-system",
        };
 
        my %abimap;
@@ -705,6 +706,7 @@ sub gen_image_cyclonedxsbom() {
                if ($pkg->{category}) {
                        my $category = $pkg->{category};
                        my %cat_type = (
+                               "operating-system"        => "operating-system",
                                "Firmware"        => "firmware",
                                "Libraries"       => "library"
                        );