forked from openSUSE/obs-build
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request openSUSE#997 from b1-systems/generate_sbom-debian
Adding debian support to generate_sbom
- Loading branch information
Showing
2 changed files
with
196 additions
and
20 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -3,7 +3,9 @@ | |
# Debian live-build specific functions. | ||
# | ||
# Copyright (c) 2014,2015 Brocade Communications Systems, Inc. | ||
# Copyright (c) 2024 Ciena Corporation | ||
# Author: Jan Blunck <[email protected]> | ||
# Author: Christian Schneemann <[email protected]> | ||
# | ||
# This file is part of build. | ||
# | ||
|
@@ -262,6 +264,22 @@ recipe_build_livebuild() { | |
done | ||
done | ||
|
||
BASE_NAME="${RECIPEFILE%.livebuild}-${ARCH}${buildnum}" | ||
for format in $(queryconfig --dist "$BUILD_DIST" --configdir "$CONFIG_DIR" --archpath "$BUILD_ARCH" buildflags+ sbom | sort -u) ; do | ||
echo "Generating $format sbom file" | ||
pushd $BUILD_ROOT/$TOPDIR/$LIVEBUILD_ROOT >/dev/null | ||
|
||
# ensure pretty subjectname in SBOM | ||
ln -sf "chroot" "${BASE_NAME}" | ||
|
||
generate_sbom --format "$format" --dir "${BASE_NAME}" > "$BUILD_ROOT/$TOPDIR/OTHER/${BASE_NAME}.${format/cyclonedx/cdx}.json" | ||
popd >/dev/null | ||
|
||
pushd $BUILD_ROOT/$TOPDIR/OTHER >/dev/null | ||
/usr/bin/sha256sum "${BASE_NAME}.${format/cyclonedx/cdx}.json" > "${BASE_NAME}.${format/cyclonedx/cdx}.json".sha256 | ||
popd >/dev/null | ||
done | ||
|
||
# copy recipe source tarball so that it can be published | ||
cp "$BUILD_ROOT/$TOPDIR/SOURCES/$RECIPEFILE" \ | ||
"$BUILD_ROOT/$TOPDIR/OTHER/${RECIPEFILE%.livebuild}${buildnum}".livebuild.tar | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters