24 Commits

Author SHA1 Message Date
Wei Li
0c6bc1ad45 Extract class MetadataDb to a separate python library so it can be used in notice files generation.
Bug: 330949782
Test: m sbom, no diffs in generated SBOM before/after the change
Test: build/soong/tests/sbom_test.sh
Test: CIs
Change-Id: I3cf944f744a1a5d359fd925621d1597b9681da9b
2024-09-23 21:25:12 +00:00
Wei Li
486c627e72 Revert "Revert "Add command line tool that generates NOTICE.xml...."
Revert submission 3272666-revert-3273112-soong-notice-xml-XKFAUDLTXP

Reason for revert: reland it

Reverted changes: /q/submissionid:3272666-revert-3273112-soong-notice-xml-XKFAUDLTXP

Change-Id: Ica8daafbc5f1bc0bc473c939c595666403349739
2024-09-19 17:55:12 +00:00
Priyanka Advani (xWF)
2f37c1980c Revert "Add command line tool that generates NOTICE.xml.gz for p..."
Revert submission 3273112-soong-notice-xml

Reason for revert: Droidmonitor created revert due to b/368348129.

Reverted changes: /q/submissionid:3273112-soong-notice-xml

Change-Id: I55e1e93aa6d4b311c6ee461d4216a104909af842
2024-09-19 17:43:39 +00:00
Wei Li
e4c1ec9466 Add command line tool that generates NOTICE.xml.gz for partitions.
The tool currently generates a XML file with the root element only and its content will be filled in in following CLs.

Also disable the generation of NOTICE.xml.gz in make when USE_SOONG_DEFINED_SYSTEM_IMAGE is true, so the Soong module could be used without conflict.

Bug: 330949782
Bug: 338342381
Test: lunch aosp_cf_x86_64_phone-trunk_staging-eng && m, and check that system/etc/NOTICE.xml.gz have all the XML elements.
Test: lunch aosp_cf_x86_64_phone_soong_system-trunk_staging-eng && m, and check that system/etc/NOTICE.xml.gz has root element only.
Change-Id: I82e90bd9aa3dabc605acfe8da697ab1f7e7ecf9b
2024-09-18 20:48:34 +00:00
Jerome Gaillard
c97c0b4a7c Add overlay files to layoutlib res.zip
This adds resource overlay files to the res.zip file created by
layoutlib_data.mk. This also updates the script generating the
corresponding SBOM file.

Bug: 335355919
Test: m layoutlib
Change-Id: I2427be23720324eb03bd428d220b8777e3bf49bb
2024-08-20 13:37:41 +01:00
Wei Li
a3265ef0a1 Add new SBOM generation tool.
Bug: 324465531
Test: CIs
Test: m soong-sbom
Change-Id: Icfb7a9062158853b85c2de95f678ab164fc3fd90
2024-07-24 22:32:38 -07:00
Wei Li
c6b4046787 Support license information in SBOM writers library.
Bug: 324465531
Test: CIs
Test: atest --host sbom_data_test sbom_writers_test
Test: build/soong/tests/sbom_test.sh
Change-Id: Iac2be2e65f308caabb11237e72dbdc6b047cfd55
2024-06-18 12:34:30 -07:00
Wei Li
0268764c0e Add a package in the SBOM of framework_res.jar.
Bug: 303906275
Test: m layoutlib dist
Change-Id: Ie7a0b97173643fc2cafbd9c7e5c6618ad9c68aeb
2024-01-08 09:34:42 -08:00
Wei Li
b32ad827c7 Fix the function invocation which missed the package name.
The issue was introduced in the last refactoring, but the logic using the function is currently not used so nothing is broken.

Bug: 303904827
Test: CIs
Change-Id: I428e5b8d525ec49d0d5f62b7fbcc54caf482ac59
2023-12-11 12:19:30 -08:00
Wei Li
ee4ab5359d Generate SBOM of .kcm files in layoutlib.
Bug: 303905932
Test: CIs; m layoutlib dist
Change-Id: Iab35c44bdfff7ea82734a8efd37dfa005bae2664
2023-10-25 15:49:26 -07:00
Wei Li
420d7d5878 Merge "Initial implementation of layoutlib SBOM generation." into main 2023-10-24 17:11:20 +00:00
Wei Li
427dacb239 Support third_party.identifier in METADATA files of external packages.
Bug: 303688820
Test: CIs
Test: "m sbom" after lunch
Change-Id: Ic329d87cdcfbe4152b0fe6a8fd71c4867593b674
2023-10-18 16:45:31 -07:00
Wei Li
c134b76375 Initial implementation of layoutlib SBOM generation.
1) Build/dist build.prop, resource files
2) Generate layoutlib SBOM that includes build.prop, resource files,
   font files and font configuration files
3) Generate SBOM of framework_res.jar with placeholders for substitution
   in release_layoutlib.sh

Bug: 303903787
Bug: 303904046
Bug: 303904808
Bug: 303905932
Bug: 303906000
Bug: 303906275
Test: lunch sdk_phone64_arm64-userdebug && m layoutlib dist
Change-Id: Ib004e199e740ccc901e93b11201db2477464be1d
2023-10-17 23:52:30 -07:00
Wei Li
f99db9977c Fix the calculation of package verification code which should not include algorithm information.
Bug: 293304694
Test: atest --host sbom_data_test
Test: build/soong/tests/sbom_test.sh
Change-Id: I94ea42284a9a6b5cc787a3489bfa575aa7663282
2023-07-31 15:09:16 -07:00
Wei Li
d263695cd4 Include static libraries information in Android SBOM.
Bug: 280852724
Test: CIs
Test: lunch aosp_cf_x86_64_phone-userdebug && m sbom
Change-Id: Ie2365d79ba24910b7ace132b578589be10a17d78
2023-06-16 23:02:09 -07:00
Wei Li
eb035dc89f Merge "Some changes to support SBOM generation for b build unbundled APEXs." 2023-05-17 19:19:47 +00:00
Wei Li
16e7aa3c2e Add upstream package of a prebuilt fork package, which will have the package information from the METADATA file.
Test: CIs
Test: lunch barbet-user && m sbom
Change-Id: Ic8eb42c369de8c94c7977b9631ff4b9084dfef01
2023-05-17 01:38:05 +00:00
Wei Li
fd7e6517d3 Some changes to support SBOM generation for b build unbundled APEXs.
1) Use output file path of installed files in build system since there is no PRODUCT_OUT in Bazel
2) Use CONTAINS to describe the relationship between a APEX and files it contains
3) Generate SBOM of APEXs, which is similar to SBOM of products

Bug: 275472038
Test: CIs
Change-Id: I41622366e5e6ed9dc78cca7bc7bb69a1f8f9bd9f
2023-05-11 13:58:37 -07:00
Treehugger Robot
269248add6 Merge "Cleanup the list of Soong prebuilt module types." 2023-04-21 01:40:01 +00:00
Wei Li
6f407ba0a8 Cleanup the list of Soong prebuilt module types.
Bug: 272356622
Test: CIs
Change-Id: I4031f0a73f5af1bbf1eb374bcd7d3a19b9609a46
2023-04-20 14:13:58 -07:00
Bob Badour
ffba21bbae [LSC] Add LOCAL_LICENSE_KINDS to build/make
Added SPDX-license-identifier-Apache-2.0 to:
  tools/sbom/Android.bp

Bug: 68860345
Bug: 151177513
Bug: 151953481

Test: m all
Change-Id: I1f8e5fd8e787a4c53bf4caf80a4000d46d0291e4
2023-04-19 09:48:01 -07:00
Wei Li
49af939a23 Copy SBOM files of unbundled APKs to dist directory.
Bug: 266726655
Test: CIs
Test: tapas Browser2 Calendar arm userdebug && m dist
Change-Id: I82328dc4916451a99ad0bf6d7bb945c9b98d0bea
2023-04-18 15:57:34 -07:00
Wei Li
5290825452 Fix the following issues mentioned in Pixel SBOM review.
1) PackageSupplier should be NOASSERTION if there is no homepage
   information in METADATA file of source packages
2) PackageDownloadLocation of upstream packages should be NOASSERTION if
   there is no code repository URL in METADATA file of source packages

Test: CIs
Test: atest --host sbom_writers_test
Change-Id: I8a0298b7bacc2f96555f9d7dde0d21ada8c6b564
2023-04-15 06:05:32 +00:00
Wei Li
dec97b1462 Create separate python libraries for the following logic and refactor SBOM generation script accordingly.
1) writer classes of generating SBOM in different SPDX formats
2) data classes to model the SBOM structure in SPDX

Bug: 272358880
Test: CIs
Test: build/soong/tests/sbom_test.sh
Test: atest --host sbom_writers_test

Change-Id: I1175cf0d99864bc4304559a59484ef0ba401cd64
2023-04-13 13:34:57 -07:00