[Merge] ~jchittum/livecd-rootfs:devel-add-sbom-generation-everywhere into livecd-rootfs:ubuntu/master

John Chittum mp+471355 at code.launchpad.net
Mon Aug 19 15:12:08 UTC 2024



Diff comments:

> diff --git a/live-build/functions b/live-build/functions
> index 7dc688b..a16b02d 100644
> --- a/live-build/functions
> +++ b/live-build/functions
> @@ -48,6 +52,33 @@ create_manifest() {
>          echo "create_manifest creating file listing."
>          local target_filelist=${2%.manifest}.filelist
>          (cd "${chroot_root}" && find -xdev) | sort > "${target_filelist}"
> +        # only creating sboms for CPC project at this time
> +        if [[ ! $(which cpc-sbom) ]]; then
> +            # install as a snap, which requires snapd installed and running
> +            # on launchpad builders, this may not be true
> +            # so try to install 
> +            if [[ ! $(which snap) ]]; then
> +                # snapd provides the snap command
> +                # if it's not available, we need to install snapd
> +                apt install snapd

i should have branched my branch :P this is all terrible debugging things that will go away.

i've now branched it with even more horribleness :)

> +            fi
> +            # ensure the service is started
> +            # restart will kick it if it is started, just in case.
> +            sudo systemctl restart snapd.service
> +            # ensure the tool is installed
> +            sudo snap install --classic --edge cpc-sbom
> +        fi
> +        # generate the SBOM
> +        cpc-sbom --rootdir ${chroot_root} --ignore-copyright-parsing-errors --ignore-copyright-file-not-found-errors --document-name ${sbom_document_name} >"${sbom_file_name}" 2>"${sbom_log}"
> +        SBOM_GENERATION_EXIT_CODE=$?
> +        if [[ ${SBOM_GENERATION_EXIT_CODE} !=  "0" ]]; then
> +        # check for failure and print log
> +            echo "ERROR: SBOM generation failed. See ${sbom_log}"
> +            cat "$sbom_log"
> +            exit 1
> +        else
> +            echo "SBOM generation succeeded. see ${sbom_log} for details"
> +        fi    
>      fi
>      echo "create_manifest finished"
>  }


-- 
https://code.launchpad.net/~jchittum/livecd-rootfs/+git/livecd-rootfs/+merge/471355
Your team Ubuntu Core Development Team is subscribed to branch livecd-rootfs:ubuntu/master.




More information about the Ubuntu-reviews mailing list