Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 70c07dda authored by Bob Badour's avatar Bob Badour
Browse files

Notice files and non-module targets.

Bug: 68860345
Bug: 151177513
Bug: 151953481
Bug: 213388645
Bug: 210912771

Test: m nothing reportmissinglicenses

Change-Id: Icdb11d3c72b180cd02231e8dc98ae500d6566a98
Merged-in: Icdb11d3c72b180cd02231e8dc98ae500d6566a98
parent 9fee6bef
Loading
Loading
Loading
Loading
+284 −146

File changed.

Preview size limit exceeded, changes collapsed.

+8 −3
Original line number Diff line number Diff line
@@ -580,9 +580,12 @@ endef
# License metadata targets corresponding to targets in $(1)
###########################################################
define corresponding-license-metadata
$(strip $(eval _dir := $(call license-metadata-dir)) \
$(foreach target, $(sort $(1)), $(_dir)/$(target).meta_lic) \
)
$(strip $(foreach target, $(sort $(1)), \
  $(if $(strip $(ALL_MODULES.$(target).META_LIC)), \
    $(ALL_MODULES.$(target).META_LIC), \
    $(if $(strip $(ALL_TARGETS.$(target).META_LIC)), \
      $(ALL_TARGETS.$(target).META_LIC), \
      $(call license-metadata-dir)/$(target).meta_lic))))
endef

###########################################################
@@ -868,9 +871,11 @@ endef
define report-missing-licenses-rule
.PHONY: reportmissinglicenses
reportmissinglicenses: PRIVATE_NON_MODULES:=$(sort $(NON_MODULES_WITHOUT_LICENSE_METADATA))
reportmissinglicenses: PRIVATE_COPIED_FILES:=$(sort $(filter $(NON_MODULES_WITHOUT_LICENSE_METADATA),$(foreach _pair,$(PRODUCT_COPY_FILES), $(PRODUCT_OUT)/$(call word-colon,2,$(_pair)))))
reportmissinglicenses:
	@echo Reporting $$(words $$(PRIVATE_NON_MODULES)) targets without license metadata
	$$(foreach t,$$(PRIVATE_NON_MODULES),if ! [ -h $$(t) ]; then echo No license metadata for $$(t) >&2; fi;)
	$$(foreach t,$$(PRIVATE_COPIED_FILES),if ! [ -h $$(t) ]; then echo No license metadata for copied file $$(t) >&2; fi;)

endef

core/os_licensing.mk

0 → 100644
+171 −0
Original line number Diff line number Diff line
.PHONY: systemlicense
systemlicense: $(call corresponding-license-metadata, $(SYSTEM_NOTICE_DEPS)) reportmissinglicenses

ifneq (,$(SYSTEM_NOTICE_DEPS))

SYSTEM_NOTICE_DEPS += $(UNMOUNTED_NOTICE_DEPS)

ifneq ($(PRODUCT_NOTICE_SPLIT),true)
$(eval $(call html-notice-rule,$(target_notice_file_html_gz),"System image",$(system_notice_file_message),$(SYSTEM_NOTICE_DEPS),$(SYSTEM_NOTICE_DEPS)))

$(installed_notice_html_or_xml_gz): $(target_notice_file_html_gz)
	$(copy-file-to-target)
else
$(eval $(call xml-notice-rule,$(target_notice_file_xml_gz),"System image",$(system_notice_file_message),$(SYSTEM_NOTICE_DEPS),$(SYSTEM_NOTICE_DEPS)))

$(eval $(call text-notice-rule,$(target_notice_file_txt),"System image",$(system_notice_file_message),$(SYSTEM_NOTICE_DEPS),$(SYSTEM_NOTICE_DEPS)))

$(installed_notice_html_or_xml_gz): $(target_notice_file_xml_gz)
	$(copy-file-to-target)
endif

$(call declare-0p-target,$(target_notice_file_xml_gz))
$(call declare-0p-target,$(installed_notice_html_or_xml_gz))
ALL_DEFAULT_INSTALLED_MODULES += $(installed_notice_html_or_xml_gz)
endif

.PHONY: vendorlicense
vendorlicense: $(call corresponding-license-metadata, $(VENDOR_NOTICE_DEPS)) reportmissinglicenses

ifneq (,$(VENDOR_NOTICE_DEPS))

VENDOR_NOTICE_DEPS += $(UNMOUNTED_NOTICE_DEPS)

$(eval $(call text-notice-rule,$(target_vendor_notice_file_txt),"Vendor image", \
         "Notices for files contained in all filesystem images except system/system_ext/product/odm/vendor_dlkm/odm_dlkm in this directory:", \
         $(VENDOR_NOTICE_DEPS)))

$(eval $(call xml-notice-rule,$(target_vendor_notice_file_xml_gz),"Vendor image", \
         "Notices for files contained in all filesystem images except system/system_ext/product/odm/vendor_dlkm/odm_dlkm in this directory:", \
         $(VENDOR_NOTICE_DEPS)))

$(installed_vendor_notice_xml_gz): $(target_vendor_notice_file_xml_gz)
	$(copy-file-to-target)

$(call declare-0p-target,$(target_vendor_notice_file_xml_gz))
$(call declare-0p-target,$(installed_vendor_notice_xml_gz))
ALL_DEFAULT_INSTALLED_MODULES += $(installed_vendor_notice_xml_gz)
endif

.PHONY: odmlicense
odmlicense: $(call corresponding-license-metadata, $(ODM_NOTICE_DEPS)) reportmissinglicenses

ifneq (,$(ODM_NOTICE_DEPS))
$(eval $(call text-notice-rule,$(target_odm_notice_file_txt),"ODM filesystem image", \
         "Notices for files contained in the odm filesystem image in this directory:", \
         $(ODM_NOTICE_DEPS)))

$(eval $(call xml-notice-rule,$(target_odm_notice_file_xml_gz),"ODM filesystem image", \
         "Notices for files contained in the odm filesystem image in this directory:", \
         $(ODM_NOTICE_DEPS)))

$(installed_odm_notice_xml_gz): $(target_odm_notice_file_xml_gz)
	$(copy-file-to-target)

$(call declare-0p-target,$(target_odm_notice_file_xml_gz))
$(call declare-0p-target,$(installed_odm_notice_xml_gz))
ALL_DEFAULT_INSTALLED_MODULES += $(installed_odm_notice_xml_gz)
endif

.PHONY: oemlicense
oemlicense: $(call corresponding-license-metadata, $(OEM_NOTICE_DEPS)) reportmissinglicenses

.PHONY: productlicense
productlicense: $(call corresponding-license-metadata, $(PRODUCT_NOTICE_DEPS)) reportmissinglicenses

ifneq (,$(PRODUCT_NOTICE_DEPS))
$(eval $(call text-notice-rule,$(target_product_notice_file_txt),"Product image", \
         "Notices for files contained in the product filesystem image in this directory:", \
         $(PRODUCT_NOTICE_DEPS)))

$(eval $(call xml-notice-rule,$(target_product_notice_file_xml_gz),"Product image", \
         "Notices for files contained in the product filesystem image in this directory:", \
         $(PRODUCT_NOTICE_DEPS)))

$(installed_product_notice_xml_gz): $(target_product_notice_file_xml_gz)
	$(copy-file-to-target)

$(call declare-0p-target,$(target_product_notice_file_xml_gz))
$(call declare-0p-target,$(installed_product_notice_xml_gz))
ALL_DEFAULT_INSTALLED_MODULES += $(installed_product_notice_xml_gz)
endif

.PHONY: systemextlicense
systemextlicense: $(call corresponding-license-metadata, $(SYSTEM_EXT_NOTICE_DEPS)) reportmissinglicenses

ifneq (,$(SYSTEM_EXT_NOTICE_DEPS))
$(eval $(call text-notice-rule,$(target_system_ext_notice_file_txt),"System_ext image", \
         "Notices for files contained in the system_ext filesystem image in this directory:", \
         $(SYSTEM_EXT_NOTICE_DEPS)))

$(eval $(call xml-notice-rule,$(target_system_ext_notice_file_xml_gz),"System_ext image", \
         "Notices for files contained in the system_ext filesystem image in this directory:", \
         $(SYSTEM_EXT_NOTICE_DEPS)))

$(installed_system_ext_notice_xml_gz): $(target_system_ext_notice_file_xml_gz)
	$(copy-file-to-target)

$(call declare-0p-target,$(target_system_ext_notice_file_xml_gz))
$(call declare-0p-target,$(installed_system_ext_notice_xml_gz))
ALL_DEFAULT_INSTALLED_MODULES += $(installed_system_ext_notice_xml_gz)
endif

.PHONY: vendor_dlkmlicense
vendor_dlkmlicense: $(call corresponding-license-metadata, $(VENDOR_DLKM_NOTICE_DEPS)) reportmissinglicenses

ifneq (,$(VENDOR_DLKM_NOTICE_DEPS))
$(eval $(call text-notice-rule,$(target_vendor_dlkm_notice_file_txt),"Vendor_dlkm image", \
         "Notices for files contained in the vendor_dlkm filesystem image in this directory:", \
         $(VENDOR_DLKM_NOTICE_DEPS)))

$(eval $(call xml-notice-rule,$(target_vendor_dlkm_notice_file_xml_gz),"Vendor_dlkm image", \
         "Notices for files contained in the vendor_dlkm filesystem image in this directory:", \
         $(VENDOR_DLKM_NOTICE_DEPS)))

$(installed_vendor_dlkm_notice_xml_gz): $(target_vendor_dlkm_notice_file_xml_gz)
	$(copy-file-to-target)

$(call declare-0p-target,$(target_vendor_dlkm_notice_file_xml_gz))
$(call declare-0p-target,$(installed_vendor_dlkm_notice_xml_gz))
ALL_DEFAULT_INSTALLED_MODULES += $(installed_vendor_dlkm_notice_xml_gz)
endif

.PHONY: odm_dlkmlicense
odm_dlkmlicense: $(call corresponding-license-metadata, $(ODM_DLKM_NOTICE_DEPS)) reportmissinglicenses

ifneq (,$(ODM_DLKM_NOTICE_DEPS))
$(eval $(call text-notice-rule,$(target_odm_dlkm_notice_file_txt),"ODM_dlkm filesystem image", \
         "Notices for files contained in the odm_dlkm filesystem image in this directory:", \
         $(ODM_DLKM_NOTICE_DEPS)))

$(eval $(call xml-notice-rule,$(target_odm_dlkm_notice_file_xml_gz),"ODM_dlkm filesystem image", \
         "Notices for files contained in the odm_dlkm filesystem image in this directory:", \
         $(ODM_DLMK_NOTICE_DEPS)))

$(installed_odm_dlkm_notice_xml_gz): $(target_odm_dlkm_notice_file_xml_gz)
	$(copy-file-to-target)

$(call declare-0p-target,$(target_odm_dlkm_notice_file_xml_gz))
$(call declare-0p-target,$(installed_odm_dlkm_notice_xml_gz))
ALL_DEFAULT_INSTALLED_MODULES += $(installed_odm_dlkm_notice_xml_gz)
endif

.PHONY: system_dlkmlicense
system_dlkmlicense: $(call corresponding-license-metadata, $(SYSTEM_DLKM_NOTICE_DEPS)) reportmissinglicenses

ifneq (,$(SYSTEM_DLKM_NOTICE_DEPS))
$(eval $(call text-notice-rule,$(target_system_dlkm_notice_file_txt),"System_dlkm filesystem image", \
         "Notices for files contained in the system_dlkm filesystem image in this directory:", \
         $(SYSTEM_DLKM_NOTICE_DEPS)))

$(eval $(call xml-notice-rule,$(target_system_dlkm_notice_file_xml_gz),"System_dlkm filesystem image", \
         "Notices for files contained in the system_dlkm filesystem image in this directory:", \
         $(SYSTEM_DLMK_NOTICE_DEPS)))

$(installed_system_dlkm_notice_xml_gz): $(target_system_dlkm_notice_file_xml_gz)
	$(copy-file-to-target)

$(call declare-0p-target,$(target_system_dlkm_notice_file_xml_gz))
$(call declare-0p-target,$(installed_sysetm_dlkm_notice_xml_gz))
ALL_DEFAULT_INSTALLED_MODULES += $(installed_system_dlkm_notice_xml_gz)
endif
+18 −0
Original line number Diff line number Diff line
@@ -321,6 +321,8 @@ $(eval $(call build-properties,\
    $(empty),\
    $(empty)))

$(eval $(call declare-1p-target,$(INSTALLED_BUILD_PROP_TARGET)))

# -----------------------------------------------------------------
# vendor/build.prop
#
@@ -359,6 +361,8 @@ $(eval $(call build-properties,\
    $(empty),\
    $(empty)))

$(eval $(call declare-1p-target,$(INSTALLED_VENDOR_BUILD_PROP_TARGET)))

# -----------------------------------------------------------------
# product/etc/build.prop
#
@@ -411,6 +415,8 @@ $(eval $(call build-properties,\
    $(_footers_),\
    $(_skip_common_properties)))

$(eval $(call declare-1p-target,$(INSTALLED_PRODUCT_BUILD_PROP_TARGET)))

_skip_common_properties :=

# ----------------------------------------------------------------
@@ -436,6 +442,8 @@ $(eval $(call build-properties,\
    $(empty),\
    $(empty)))

$(eval $(call declare-1p-target,$(INSTALLED_ODM_BUILD_PROP_TARGET)))

# ----------------------------------------------------------------
# vendor_dlkm/etc/build.prop
#
@@ -450,6 +458,8 @@ $(eval $(call build-properties,\
    $(empty),\
    $(empty)))

$(eval $(call declare-1p-target,$(INSTALLED_VENDOR_DLKM_BUILD_PROP_TARGET)))

# ----------------------------------------------------------------
# odm_dlkm/etc/build.prop
#
@@ -464,6 +474,8 @@ $(eval $(call build-properties,\
    $(empty),\
    $(empty)))

$(eval $(call declare-1p-target,$(INSTALLED_ODM_DLKM_BUILD_PROP_TARGET)))

# ----------------------------------------------------------------
# system_dlkm/build.prop
#
@@ -478,6 +490,8 @@ $(eval $(call build-properties,\
    $(empty),\
    $(empty)))

$(eval $(call declare-1p-target,$(INSTALLED_SYSTEM_DLKM_BUILD_PROP_TARGET)))

# -----------------------------------------------------------------
# system_ext/etc/build.prop
#
@@ -499,6 +513,8 @@ $(eval $(call build-properties,\
    $(empty),\
    $(empty)))

$(eval $(call declare-1p-target,$(INSTALLED_SYSTEM_EXT_BUILD_PROP_TARGET)))

# ----------------------------------------------------------------
# ramdisk/boot/etc/build.prop
#
@@ -513,3 +529,5 @@ $(eval $(call build-properties,\
    $(empty),\
    $(empty),\
    $(empty)))

$(eval $(call declare-1p-target,$(INSTALLED_RAMDISK_BUILD_PROP_TARGET)))