AOSP的开源合规研究_第1页
AOSP的开源合规研究_第2页
AOSP的开源合规研究_第3页
AOSP的开源合规研究_第4页
AOSP的开源合规研究_第5页
已阅读5页,还剩55页未读, 继续免费阅读

下载本文档

版权说明:本文档由用户提供并上传,收益归属内容提供方,若内容存在侵权,请进行举报或认领

文档简介

OpenSourceComplianceforAOSP

Buildenvironment

Source

android-16.0.0_r4

Product

aosp_cf_x86_64_phone

Releaseconfiguration

trunk_staging

Buildsystem

Soong

Scope:Android16withSoong.Otherbuildconfigurationsmaydiffer.

WHAT’STHELICENSEOFAOSP

AOSPlicensedatainoneproductbuild

SBOMmeasure

Count

Filerecords

9,879

Packagerecords

1,023

Installedfilepaths

4,660

Android16r4,Cuttlefishx86_64.

Howmanydifferentlicenses?

Othermeasures

Count

SBOMLicenseRefrecords

731

Distinctlicensetextblocks

394

Countsusethelicensemodulesbehindthe731SBOMreferences.

HowtheLicenseInforeachesSBOMandNOTICE

Android.bp

example_toolusesexample_licenseandLICENSE

Soong

compliance-metadata.db

Moduleassociation+textpath+installedpath

vendorNOTICE

/vendor/bin/example_tool+MITlicensetext

gen_sbom.pygen_notice_xml.py

SBOM

LicenseRef-example-license+extractedText

BothgeneratorsreadtheLICENSEfilereferencedbylicense_text.

SBOMandNOTICEaregeneratedrespectively

SBOM

NOTICE

gen_sbom.py

PackagesandfilesLicensereferencesExplicitrelationships

gen_notice_xml.py

Installedfilepaths

Licensetextblocks

Selectedstaticaggregation

AnAndroid.bpfile

package{

default_applicable_licenses:[

"example_license",

],

}

license{

name:"example_license",

license_kinds:[

"SPDX-license-identifier-MIT",],

license_text:["LICENSE"],}

cc_binary{

name:"example_tool",

srcs:["main.cpp"],

vendor:true,}

Packagedefault

Appliesexample_licensetomoduleswithoutanexplicitlicensesproperty.

Licensetext

LICENSEsuppliestheMITtext.

Buildtarget

cc_binarycompilesmain.cpp.

Theproductselectsexample_toolforinstallationin/vendor/bin.

license_text

license{

name:"example_license",

license_kinds:[

"SPDX-license-identifier-MIT",],

license_text:["NOTICE"],

}

Validtextfile

SBOMstoresextractedText.

NOTICEincludesthereferencedtext.

Missinglicense_text

Licensecontentismissing,

evenwitharecognizedlicensekind.NoBuilderror

Missingreferencedfile

Thebuildreportsanerror.

Defaultandexplicitlicenseassociations

package{

default_applicable_licenses:[

"example_license",],

}

license{

name:"example_license",

license_text:["LICENSE"],}

license{

name:"other_license",

license_text:["OTHER_LICENSE"],}

cc_binary{

name:"example_tool",

srcs:["main.cpp"],

licenses:["other_license"],

vendor:true,

}

Packagedefault

example_licenseapplieswhenamoduleomitslicenses.

Explicitassociation

other_licenseisdefinedhere.

example_toolusesOTHER_LICENSEinsteadofthepackagedefault.

Bothlicensetextfilesmustexist.

Missingdeclarationsandinvalidreferences

//CaseA:nolicenseassociation

cc_binary{

name:"example_tool",

srcs:["main.cpp"],}

//CaseB:undefinedlicensemodulecc_binary{

name:"other_tool",

licenses:["missing_license"],

}

//CaseC:nonexistenttextfilelicense{

name:"example_license",

license_text:["MISSING"],

}

Noassociatedlicenses

Withnopackagedefaultorexplicitlicenses:NOTICEabsent,

SBOMNOASSERTION.

NoBuilderror

Undefinedmodulereference

Builderror.

Invalidtextreference

Builderror.

Omittinglicense_textleavesacontentgapinbothoutputs.

license_kindandconditions

license{

name:"example_license",

license_kinds:[

"SPDX-license-identifier-AGPL-1.0",],

license_text:["LICENSE"],}

license_kind{

name:

"SPDX-license-identifier-AGPL-1.0",

conditions:[

"by_exception_only",

"not_allowed",

],

}

license_kinds

Referencesalicense_kinddefinition.

license_kind

Definesthelicenseclassification.Itdoesnotsupplythelicensetext.

conditions

Suppliespolicylabelsforchecks.

Buildblockingrequiresintegration.

NodirectSBOM/NOTICEtextchange.

Generatedoutputsstillneedreview

AOSP16r4canproduce

incompleteorinconsistentSBOMandNOTICEfiles.

Correctcomponentdeclarationsarethestartingpoint.

Sixrecurringgaps

01DirectcopiesthroughPRODUCT_COPY_FILES

02Generated.fsv_metafiles

03Missingupstreamlicensedeclarationsortext

04KernelmodulesfromBoardConfig

05PartitionsoutsidedefaultNOTICEcoverage

06Staticdependenciesoutsidethreepartitions

Directfileinstallation

PRODUCT_COPY_FILES

Productmakefilesspecifyasourcefileanditsdestination.

PRODUCT_COPY_FILESinproductmakefiles

Definedinproduct.mkfilesandinheriteddeviceconfigurationfiles.

Example:device/google/cuttlefish/vsoc_x86_64/phone/aosp_cf.mk

PRODUCT_COPY_FILES+=<source>:<destination>

Sourceframeworks/native/data/etc/aosp_excluded_hardware.xmlDestinationvendor/etc/permissions/aosp_excluded_hardware.xml

PRODUCT_COPY_FILES

Directcopy,withoutanamed

Android.bpmoduleoritslicenseassociation.

prebuilt_etc

NamedAndroid.bpmodule

withaneffectivelicenseassociation.

TheSBOMgenerator’shard-codedallowlist

build/make/tools/sbom/gen_sbom.py

defget_license_of_product_copy_file(file_path):

paths={

'device/sample/etc/',

'frameworks/av/media/libeffects/data/',

'frameworks/av/media/libstagefright/data/','frameworks/av/services/audiopolicy/config/','frameworks/base/config/',

'frameworks/base/data/keyboards/','frameworks/base/data/sounds/',

'frameworks/native/data/etc/',

'hardware/google/camera/devices/EmulatedCamera/hwl/configs/',

'system/core/rootdir/etc/',}

forpinpaths:

iffile_path.startswith(p):

return

return''

'build/soong/licenses/LICENSE'

Thecopiedfilecanhavethewronglicense

ForPRODUCT_COPY_FILESsourcesinthehard-codedpathallowlist

SBOM

Apache-2.0,

regardlessoftheactuallicense.

NOTICE

Nolicenseentry

forthecopiedfile.

TheSBOMruleusesthesourcepath.Itdoesnotreadthefile’sAndroid.bplicense.

Optionsforcopiedfiles

Moduleinstallation

useprebuiltetcmoduletododirectfilecopies

Requireddirect

CompleteSBOMandinformationmanually

copy

NOTICE

Generatedmetadatafiles

.fsv_metafiles

AseparateSBOMruleforbuild-generatedhelperfiles.

Whatisa.fsv_metafile?

Build-generatedmetadataforfs-verity,

Android’sfile-integrityverificationmechanism.

Thebuildderivesitfromselectedfilesandinstallsitalongsidethem.

SBOMassignsAndroidApache-2.0.

NOTICEomitsthecorrespondingentry.

AddmatchingNOTICEentrieswhenbothdocumentsmustcoverthesamefiles.

Missingupstreamlicensetext

Licensedeclarationswithoutlicense_text

AOSPcomponentscanomitthetextrequiredbythegenerators.

Upstreamdeclarationscanomitthetext

prebuilts/rust/Android.bp,shortenedexcerpt

license{

name:"prebuilts_rust_stdlib_license",

visibility:[":subpackages"],

license_kinds:[

"SPDX-license-identifier-Apache-2.0",

"SPDX-license-identifier-MIT",

//Additionalkindsomittedhere

],

//large-scale-changeunabletoidentify

//anylicense_textfiles

}

Kernelmoduleinstallation

BoardConfig.mk

Deviceconfigurationcanselectkernelmodulesforinstallation.

BoardConfigkernelinstallation

BoardConfig.mkconfiguresthedevice’skernelandimagebuild.

#BoardConfig.mk

BOARD_SYSTEM_KERNEL_MODULES:=\path/example.ko

SBOM:NOASSERTION

NOTICE:nolicenseentry

Evenwithvalidlicense_text

Soongusesacopy-basedinstallationpath,similartoPRODUCT_COPY_FILES.Theautomaticbuilddoesnotretrievetheconfiguredlicensetext.

ASoongmodulecanfixthat

license{

name:"kernel_license",

license_kinds:[

"SPDX-license-identifier-GPL-2.0-only",],

license_text:["COPYING"],

}

prebuilt_kernel_modules{

name:"example_kernel_module",

srcs:["example.ko"],

system_dlkm_specific:true,

licenses:["kernel_license"],

}

Module-basedinstallation

Android.bpdefinesthe.koinstallationandexplicitly

associatesitsGPLtext.

GPLtextreaches

bothSBOMandNOTICE.

SelectthemoduleinPRODUCT_PACKAGES.Reviewkernelloadinganddependenciesseparately.

NOTICEcoveragebypartition

Whichpartitions

receiveaNOTICEfile?

Eachdeliveredareaneedsadeclarationandanimage-builddependency.

DefaultNOTICEcoverage

Eightpartitiontargetsaredeclaredbydefault

system,system_ext,system_dlkmproduct

vendor,vendor_dlkmodm,odm_dlkm

root,ramdisk,vendor_ramdiskandotherdeliveredareasneedadditionalNOTICEconfiguration.

Declarations:build/soong/compliance/Android.bp

Additionalpartitionconfiguration

RamdiskNOTICEdeclarationandimagedependency//build/soong/compliance/Android.bp

notice_xml{

name:"notice_xml_ramdisk",

partition_name:"ramdisk",}

//build/soong/fsgen/fsgen_mutators.go

"ramdisk":{

"notice_xml_ramdisk":defaultDepCandidateProps(ctx.Config()),},

Theproduct'simagebuildmustincludetheNOTICEtarget.

Static-librarylicensecoverage

WhichdependencylicensesreachNOTICE?

Aninstalledprogramcancontaincodefromseveralstaticlibraries.

Staticlibrariesrequiredependencycoverage

SBOM

Separatelibraryentries

STATICLINKrelationshipsLibrarylicensereferences

NOTICE

Installedparentpathwithtransitivestaticdependencies

Thefinalartifactcontainscodef

温馨提示

  • 1. 本站所有资源如无特殊说明,都需要本地电脑安装OFFICE2007和PDF阅读器。图纸软件为CAD,CAXA,PROE,UG,SolidWorks等.压缩文件请下载最新的WinRAR软件解压。
  • 2. 本站的文档不包含任何第三方提供的附件图纸等,如果需要附件,请联系上传者。文件的所有权益归上传用户所有。
  • 3. 本站RAR压缩包中若带图纸,网页内容里面会有图纸预览,若没有图纸预览就没有图纸。
  • 4. 未经权益所有人同意不得将文件中的内容挪作商业或盈利用途。
  • 5. 人人文库网仅提供信息存储空间,仅对用户上传内容的表现方式做保护处理,对用户上传分享的文档内容本身不做任何修改或编辑,并不能对任何下载内容负责。
  • 6. 下载文件中如有侵权或不适当内容,请与我们联系,我们立即纠正。
  • 7. 本站不保证下载资源的准确性、安全性和完整性, 同时也不承担用户因使用这些下载资源对自己和他人造成任何形式的伤害或损失。

评论

0/150

提交评论