build: fix kernel component in CycloneDX SBOM
authorCedric DOURLENT <cedric.dourlent@softathome.com>
Fri, 1 Mar 2024 15:42:34 +0000 (16:42 +0100)
committerPetr Štetiar <ynezz@true.cz>
Wed, 17 Apr 2024 04:34:36 +0000 (04:34 +0000)
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>
(cherry picked from commit 84331215e57090a9cdae4af75af2539c39cd7de7)

scripts/package-metadata.pl

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