2009-03-04 04:28:42 +01:00
# Put some miscellaneous rules here
2014-03-02 00:32:04 +01:00
# HACK: clear LOCAL_PATH from including last build target before calling
# intermedites-dir-for
LOCAL_PATH := $( BUILD_SYSTEM)
2009-03-04 04:28:42 +01:00
# -----------------------------------------------------------------
# Define rules to copy PRODUCT_COPY_FILES defined by the product.
2012-09-21 01:35:36 +02:00
# PRODUCT_COPY_FILES contains words like <source file>:<dest file>[:<owner>].
2009-03-04 04:28:42 +01:00
# <dest file> is relative to $(PRODUCT_OUT), so it should look like,
# e.g., "system/etc/file.xml".
2010-03-02 01:18:59 +01:00
# The filter part means "only eval the copy-one-file rule if this
2010-11-03 05:31:47 +01:00
# src:dest pair is the first one to match the same dest"
2011-09-29 22:23:25 +02:00
#$(1): the src:dest pair
2018-05-01 01:01:33 +02:00
#$(2): the dest
2011-09-29 22:23:25 +02:00
d e f i n e c h e c k - p r o d u c t - c o p y - f i l e s
2018-05-01 01:01:33 +02:00
$( if $ ( filter -out $ ( TARGET_COPY_OUT_SYSTEM_OTHER ) /%,$ ( 2) ) , \
$( if $( filter %.apk, $( 2) ) ,$( error \
Prebuilt apk found in PRODUCT_COPY_FILES: $( 1) , use BUILD_PREBUILT instead!) ) )
2011-09-29 22:23:25 +02:00
e n d e f
2012-09-06 03:08:29 +02:00
# filter out the duplicate <source file>:<dest file> pairs.
unique_product_copy_files_pairs :=
2009-03-04 04:28:42 +01:00
$( foreach cf ,$ ( PRODUCT_COPY_FILES ) , \
2012-09-06 03:08:29 +02:00
$( if $( filter $( unique_product_copy_files_pairs) ,$( cf) ) ,,\
$( eval unique_product_copy_files_pairs += $( cf) ) ) )
unique_product_copy_files_destinations :=
2017-11-15 20:13:23 +01:00
product_copy_files_ignored :=
2012-09-06 03:08:29 +02:00
$( foreach cf ,$ ( unique_product_copy_files_pairs ) , \
2010-11-03 05:31:47 +01:00
$( eval _src := $( call word-colon,1,$( cf) ) ) \
$( eval _dest := $( call word-colon,2,$( cf) ) ) \
2018-05-01 01:01:33 +02:00
$( call check-product-copy-files,$( cf) ,$( _dest) ) \
2011-12-16 20:54:25 +01:00
$( if $( filter $( unique_product_copy_files_destinations) ,$( _dest) ) , \
2017-11-15 20:13:23 +01:00
$( eval product_copy_files_ignored += $( cf) ) , \
2010-11-03 05:31:47 +01:00
$( eval _fulldest := $( call append-path,$( PRODUCT_OUT) ,$( _dest) ) ) \
2012-05-14 23:39:00 +02:00
$( if $( filter %.xml,$( _dest) ) ,\
$( eval $( call copy-xml-file-checked,$( _src) ,$( _fulldest) ) ) ,\
2017-09-19 14:10:31 +02:00
$( if $( and $( filter %.jar,$( _dest) ) ,$( filter $( basename $( notdir $( _dest) ) ) ,$( PRODUCT_LOADED_BY_PRIVILEGED_MODULES) ) ) ,\
$( eval $( call copy-and-uncompress-dexs,$( _src) ,$( _fulldest) ) ) , \
2018-06-13 23:51:05 +02:00
$( if $( filter init%rc,$( notdir $( _dest) ) ) $( filter %/etc/init,$( dir $( _dest) ) ) ,\
$( eval $( call copy-init-script-file-checked,$( _src) ,$( _fulldest) ) ) ,\
$( eval $( call copy-one-file,$( _src) ,$( _fulldest) ) ) ) ) ) \
2011-06-18 02:05:35 +02:00
$( eval unique_product_copy_files_destinations += $( _dest) ) ) )
2017-11-15 20:13:23 +01:00
# Dump a list of overriden (and ignored PRODUCT_COPY_FILES entries)
2018-10-17 08:15:08 +02:00
pcf_ignored_file := $( PRODUCT_OUT) /product_copy_files_ignored.txt
$(pcf_ignored_file) : PRIVATE_IGNORED := $( sort $ ( product_copy_files_ignored ) )
$(pcf_ignored_file) :
echo " $( PRIVATE_IGNORED) " | tr " " "\n" >$@
$(call dist-for-goals,droidcore,$(pcf_ignored_file) : logs /$( notdir $ ( pcf_ignored_file ) ) )
2017-11-15 20:13:23 +01:00
2018-10-17 08:15:08 +02:00
pcf_ignored_file :=
2017-11-15 20:13:23 +01:00
product_copy_files_ignored :=
2012-09-06 03:08:29 +02:00
unique_product_copy_files_pairs :=
2011-06-18 02:05:35 +02:00
unique_product_copy_files_destinations :=
2009-03-04 04:28:42 +01:00
2017-11-17 08:22:37 +01:00
# -----------------------------------------------------------------
# Returns the max allowed size for an image suitable for hash verification
# (e.g., boot.img, recovery.img, etc).
# The value 69632 derives from MAX_VBMETA_SIZE + MAX_FOOTER_SIZE in $(AVBTOOL).
# $(1): partition size to flash the image
d e f i n e g e t - h a s h - i m a g e - m a x - s i z e
$( if $ ( 1) , \
$( if $( filter true,$( BOARD_AVB_ENABLE) ) , \
$( eval _hash_meta_size := 69632) , \
$( eval _hash_meta_size := 0) ) \
$( 1) -$( _hash_meta_size) )
e n d e f
2016-02-23 22:40:07 +01:00
# -----------------------------------------------------------------
# Define rules to copy headers defined in copy_headers.mk
# If more than one makefile declared a header, print a warning,
# then copy the last one defined. This matches the previous make
# behavior.
2018-08-15 23:28:01 +02:00
has_dup_copy_headers :=
2016-02-23 22:40:07 +01:00
$( foreach dest ,$ ( ALL_COPIED_HEADERS ) , \
$( eval _srcs := $( ALL_COPIED_HEADERS.$( dest) .SRC) ) \
2019-02-08 02:34:57 +01:00
$( eval _src := $( lastword $( _srcs) ) ) \
2016-02-23 22:40:07 +01:00
$( if $( call streq,$( _src) ,$( _srcs) ) ,, \
$( warning Duplicate header copy: $( dest) ) \
2019-02-08 02:34:57 +01:00
$( warning _ Using $( _src) ) \
$( warning __ from $( lastword $( ALL_COPIED_HEADERS.$( dest) .MAKEFILE) ) ) \
$( eval _makefiles := $$ ( wordlist 1,$( call int_subtract,$( words $( ALL_COPIED_HEADERS.$( dest) .MAKEFILE) ) ,1) ,$$ ( ALL_COPIED_HEADERS.$$ ( dest) .MAKEFILE) ) ) \
$( foreach src,$( wordlist 1,$( call int_subtract,$( words $( _srcs) ) ,1) ,$( _srcs) ) , \
$( warning _ Ignoring $( src) ) \
$( warning __ from $( firstword $( _makefiles) ) ) \
$( eval _makefiles := $$ ( wordlist 2,9999,$$ ( _makefiles) ) ) ) \
$( eval has_dup_copy_headers := true ) ) \
2016-02-23 22:40:07 +01:00
$( eval $( call copy-one-header,$( _src) ,$( dest) ) ) )
all_copied_headers : $( ALL_COPIED_HEADERS )
2018-08-15 23:28:01 +02:00
i f d e f h a s _ d u p _ c o p y _ h e a d e r s
has_dup_copy_headers :=
ifneq ( $( BUILD_BROKEN_DUP_COPY_HEADERS) ,true)
$( error duplicate header copies are no longer allowed. For more information about headers, see: https://android.googlesource.com/platform/build/soong/+/master/docs/best_practices.md#headers)
endif
e n d i f
2009-03-04 04:28:42 +01:00
# -----------------------------------------------------------------
# docs/index.html
2012-04-03 03:21:36 +02:00
i f e q ( , $( TARGET_BUILD_APPS ) )
2009-03-04 04:28:42 +01:00
gen := $( OUT_DOCS) /index.html
ALL_DOCS += $( gen)
$(gen) : frameworks /base /docs /docs -redirect -index .html
@mkdir -p $( dir $@ )
@cp -f $< $@
2012-04-03 03:21:36 +02:00
e n d i f
2009-03-04 04:28:42 +01:00
2017-10-04 19:20:20 +02:00
ndk_doxygen_out := $( OUT_NDK_DOCS)
ndk_headers := $( SOONG_OUT_DIR) /ndk/sysroot/usr/include
ndk_docs_src_dir := frameworks/native/docs
ndk_doxyfile := $( ndk_docs_src_dir) /Doxyfile
i f n e q ( $( wildcard $ ( ndk_docs_src_dir ) ) , )
ndk_docs_srcs := $( addprefix $( ndk_docs_src_dir) /,\
$( call find-files-in-subdirs,$( ndk_docs_src_dir) ,"*" ,.) )
$(ndk_doxygen_out)/index.html : $( ndk_docs_srcs ) $( SOONG_OUT_DIR ) /ndk .timestamp
@mkdir -p $( ndk_doxygen_out)
@echo " Generating NDK docs to $( ndk_doxygen_out) "
@( cat $( ndk_doxyfile) ; \
echo " INPUT= $( ndk_headers) " ; \
echo " HTML_OUTPUT= $( ndk_doxygen_out) " \
) | doxygen -
# Note: Not a part of the docs target because we don't have doxygen available.
# You can run this target locally if you have doxygen installed.
ndk-docs : $( ndk_doxygen_out ) /index .html
.PHONY : ndk -docs
e n d i f
2018-12-14 10:04:19 +01:00
# -----------------------------------------------------------------
# generate preview API fingerprint
api_fingerprint := $( call intermediates-dir-for,PACKAGING,api_fingerprint) /api_fingerprint.txt
.KATI_READONLY := api_fingerprint
i f e q ( R E L , $( PLATFORM_VERSION_CODENAME ) )
$( api_fingerprint) :
echo REL >$@
e l s e i f n e q ( $( TARGET_BUILD_APPS ) , )
# TODO: use a prebuilt api_fingerprint.txt from prebuilts/sdk/current.txt once we have one
#$(eval $(call copy-one-file,prebuilts/sdk/current/api_fingerprint.txt,$(api_fingerprint)))
$( api_fingerprint) :
echo $( PLATFORM_PREVIEW_SDK_VERSION) >$@
e l s e i f n e q ( $( TARGET_BUILD_PDK ) , )
$( eval $( call copy-one-file,$( _pdk_fusion_intermediates) /api_fingerprint.txt,$( api_fingerprint) ) )
e l s e
ifeq ( $( HOST_OS) ,darwin)
$( api_fingerprint) : PRIVATE_HASH := md5
else
$( api_fingerprint) : PRIVATE_HASH := md5sum
endif
$( api_fingerprint) : $( sort $( wildcard frameworks/base/api/*current.txt) )
cat $^ | $( PRIVATE_HASH) | cut -d' ' -f1 >$@
$( call dist-for-goals,sdk,$( api_fingerprint) )
e n d i f
2017-01-31 12:07:02 +01:00
# -----------------------------------------------------------------
2017-03-03 04:40:21 +01:00
# property_overrides_split_enabled
property_overrides_split_enabled :=
i f e q ( $( BOARD_PROPERTY_OVERRIDES_SPLIT_ENABLED ) , t r u e )
property_overrides_split_enabled := true
2017-01-31 12:07:02 +01:00
e n d i f
2018-02-07 23:19:55 +01:00
# -----------------------------------------------------------------
# FINAL_VENDOR_DEFAULT_PROPERTIES will be installed in vendor/default.prop if
# property_overrides_split_enabled is true. Otherwise it will be installed in
# ROOT/default.prop.
i f d e f B O A R D _ V N D K _ V E R S I O N
ifeq ( $( BOARD_VNDK_VERSION) ,current)
FINAL_VENDOR_DEFAULT_PROPERTIES := ro.vndk.version= $( PLATFORM_VNDK_VERSION)
else
FINAL_VENDOR_DEFAULT_PROPERTIES := ro.vndk.version= $( BOARD_VNDK_VERSION)
endif
2018-05-04 13:33:17 +02:00
ifdef BOARD_VNDK_RUNTIME_DISABLE
FINAL_VENDOR_DEFAULT_PROPERTIES += ro.vndk.lite= true
endif
2018-02-07 23:19:55 +01:00
e l s e
2018-05-04 13:33:17 +02:00
FINAL_VENDOR_DEFAULT_PROPERTIES := ro.vndk.version= $( PLATFORM_VNDK_VERSION)
FINAL_VENDOR_DEFAULT_PROPERTIES += ro.vndk.lite= true
2018-02-07 23:19:55 +01:00
e n d i f
FINAL_VENDOR_DEFAULT_PROPERTIES += \
$( call collapse-pairs, $( PRODUCT_DEFAULT_PROPERTY_OVERRIDES) )
2018-09-04 20:42:53 +02:00
2019-02-21 12:51:26 +01:00
# Add cpu properties for bionic and ART.
2018-11-04 18:20:09 +01:00
FINAL_VENDOR_DEFAULT_PROPERTIES += ro.bionic.arch= $( TARGET_ARCH)
2019-02-21 12:36:37 +01:00
FINAL_VENDOR_DEFAULT_PROPERTIES += ro.bionic.cpu_variant= $( TARGET_CPU_VARIANT_RUNTIME)
2018-11-04 18:20:09 +01:00
FINAL_VENDOR_DEFAULT_PROPERTIES += ro.bionic.2nd_arch= $( TARGET_2ND_ARCH)
2019-02-21 12:36:37 +01:00
FINAL_VENDOR_DEFAULT_PROPERTIES += ro.bionic.2nd_cpu_variant= $( TARGET_2ND_CPU_VARIANT_RUNTIME)
2018-11-04 18:20:09 +01:00
2019-02-21 12:51:26 +01:00
FINAL_VENDOR_DEFAULT_PROPERTIES += persist.sys.dalvik.vm.lib.2= libart.so
2019-02-21 12:36:37 +01:00
FINAL_VENDOR_DEFAULT_PROPERTIES += dalvik.vm.isa.$( TARGET_ARCH) .variant= $( DEX2OAT_TARGET_CPU_VARIANT_RUNTIME)
2019-02-21 12:51:26 +01:00
i f n e q ( $( DEX 2OAT_TARGET_INSTRUCTION_SET_FEATURES ) , )
FINAL_VENDOR_DEFAULT_PROPERTIES += dalvik.vm.isa.$( TARGET_ARCH) .features= $( DEX2OAT_TARGET_INSTRUCTION_SET_FEATURES)
e n d i f
i f d e f T A R G E T _ 2 N D _ A R C H
2019-02-21 12:36:37 +01:00
FINAL_VENDOR_DEFAULT_PROPERTIES += dalvik.vm.isa.$( TARGET_2ND_ARCH) .variant= $( $( TARGET_2ND_ARCH_VAR_PREFIX) DEX2OAT_TARGET_CPU_VARIANT_RUNTIME)
2019-02-21 12:51:26 +01:00
ifneq ( $( $( TARGET_2ND_ARCH_VAR_PREFIX) DEX2OAT_TARGET_INSTRUCTION_SET_FEATURES) ,)
FINAL_VENDOR_DEFAULT_PROPERTIES += dalvik.vm.isa.$( TARGET_2ND_ARCH) .features= $( $( TARGET_2ND_ARCH_VAR_PREFIX) DEX2OAT_TARGET_INSTRUCTION_SET_FEATURES)
endif
e n d i f
2018-09-04 20:42:53 +02:00
# Although these variables are prefixed with TARGET_RECOVERY_, they are also needed under charger
# mode (via libminui).
i f d e f T A R G E T _ R E C O V E R Y _ D E F A U L T _ R O T A T I O N
FINAL_VENDOR_DEFAULT_PROPERTIES += \
ro.minui.default_rotation= $( TARGET_RECOVERY_DEFAULT_ROTATION)
e n d i f
i f d e f T A R G E T _ R E C O V E R Y _ O V E R S C A N _ P E R C E N T
FINAL_VENDOR_DEFAULT_PROPERTIES += \
ro.minui.overscan_percent= $( TARGET_RECOVERY_OVERSCAN_PERCENT)
e n d i f
i f d e f T A R G E T _ R E C O V E R Y _ P I X E L _ F O R M A T
FINAL_VENDOR_DEFAULT_PROPERTIES += \
ro.minui.pixel_format= $( TARGET_RECOVERY_PIXEL_FORMAT)
e n d i f
2018-02-07 23:19:55 +01:00
FINAL_VENDOR_DEFAULT_PROPERTIES := $( call uniq-pairs-by-first-component, \
$( FINAL_VENDOR_DEFAULT_PROPERTIES) ,= )
2009-03-04 04:28:42 +01:00
# -----------------------------------------------------------------
2017-05-01 15:56:26 +02:00
# prop.default
2018-08-15 13:11:55 +02:00
BUILDINFO_SH := build/make/tools/buildinfo.sh
BUILDINFO_COMMON_SH := build/make/tools/buildinfo_common.sh
# Generates a set of common build system properties to a file.
# $(1): Partition name
# $(2): Output file name
d e f i n e g e n e r a t e - c o m m o n - b u i l d - p r o p s
BUILD_FINGERPRINT = " $( BUILD_FINGERPRINT_FROM_FILE) " \
BUILD_ID = " $( BUILD_ID) " \
BUILD_NUMBER = " $( BUILD_NUMBER_FROM_FILE) " \
BUILD_VERSION_TAGS = " $( BUILD_VERSION_TAGS) " \
DATE = " $( DATE_FROM_FILE) " \
PLATFORM_SDK_VERSION = " $( PLATFORM_SDK_VERSION) " \
PLATFORM_VERSION = " $( PLATFORM_VERSION) " \
PRODUCT_BRAND = " $( PRODUCT_BRAND) " \
PRODUCT_MANUFACTURER = " $( PRODUCT_MANUFACTURER) " \
PRODUCT_MODEL = " $( PRODUCT_MODEL) " \
PRODUCT_NAME = " $( TARGET_PRODUCT) " \
TARGET_BUILD_TYPE = " $( TARGET_BUILD_VARIANT) " \
TARGET_DEVICE = " $( TARGET_DEVICE) " \
bash $( BUILDINFO_COMMON_SH) " $( 1) " >> $( 2)
e n d e f
2017-05-01 15:56:26 +02:00
i f d e f p r o p e r t y _ o v e r r i d e s _ s p l i t _ e n a b l e d
INSTALLED_DEFAULT_PROP_TARGET := $( TARGET_OUT) /etc/prop.default
2017-07-13 11:04:10 +02:00
INSTALLED_DEFAULT_PROP_OLD_TARGET := $( TARGET_ROOT_OUT) /default.prop
ALL_DEFAULT_INSTALLED_MODULES += $( INSTALLED_DEFAULT_PROP_OLD_TARGET)
$(INSTALLED_DEFAULT_PROP_OLD_TARGET) : $( INSTALLED_DEFAULT_PROP_TARGET )
2017-05-01 15:56:26 +02:00
e l s e
# legacy path
2009-03-04 04:28:42 +01:00
INSTALLED_DEFAULT_PROP_TARGET := $( TARGET_ROOT_OUT) /default.prop
2017-05-01 15:56:26 +02:00
e n d i f
2009-03-04 04:28:42 +01:00
ALL_DEFAULT_INSTALLED_MODULES += $( INSTALLED_DEFAULT_PROP_TARGET)
2017-01-20 05:17:12 +01:00
FINAL_DEFAULT_PROPERTIES := \
2017-11-03 07:18:55 +01:00
$( call collapse-pairs, $( ADDITIONAL_DEFAULT_PROPERTIES) ) \
$( call collapse-pairs, $( PRODUCT_SYSTEM_DEFAULT_PROPERTIES) )
2017-03-03 04:40:21 +01:00
i f n d e f p r o p e r t y _ o v e r r i d e s _ s p l i t _ e n a b l e d
2017-01-31 12:07:02 +01:00
FINAL_DEFAULT_PROPERTIES += \
2018-02-07 23:19:55 +01:00
$( call collapse-pairs, $( FINAL_VENDOR_DEFAULT_PROPERTIES) )
2017-01-31 12:07:02 +01:00
e n d i f
2017-01-20 05:17:12 +01:00
FINAL_DEFAULT_PROPERTIES := $( call uniq-pairs-by-first-component, \
$( FINAL_DEFAULT_PROPERTIES) ,= )
2009-03-04 04:28:42 +01:00
2015-05-07 05:44:22 +02:00
intermediate_system_build_prop := $( call intermediates-dir-for,ETC,system_build_prop) /build.prop
2018-08-15 13:11:55 +02:00
$(INSTALLED_DEFAULT_PROP_TARGET) : $( BUILDINFO_COMMON_SH ) $( intermediate_system_build_prop )
2009-03-04 04:28:42 +01:00
@echo Target buildinfo: $@
@mkdir -p $( dir $@ )
2017-05-01 15:56:26 +02:00
@rm -f $@
2009-03-04 04:28:42 +01:00
$( hide) echo "#" > $@ ; \
echo "# ADDITIONAL_DEFAULT_PROPERTIES" >> $@ ; \
echo "#" >> $@ ;
2017-01-20 05:17:12 +01:00
$( hide) $( foreach line,$( FINAL_DEFAULT_PROPERTIES) , \
2018-11-26 19:12:05 +01:00
echo " $( line) " >> $@ ; )
2015-05-07 05:44:22 +02:00
$( hide) echo "#" >> $@ ; \
echo "# BOOTIMAGE_BUILD_PROPERTIES" >> $@ ; \
echo "#" >> $@ ;
2018-08-15 13:11:55 +02:00
$( hide) $( call generate-common-build-props,bootimage,$@ )
2017-12-06 23:38:40 +01:00
$( hide) build/make/tools/post_process_props.py $@
2017-05-01 15:56:26 +02:00
i f d e f p r o p e r t y _ o v e r r i d e s _ s p l i t _ e n a b l e d
$( hide) mkdir -p $( TARGET_ROOT_OUT)
2017-07-13 11:04:10 +02:00
$( hide) ln -sf system/etc/prop.default $( INSTALLED_DEFAULT_PROP_OLD_TARGET)
2017-05-01 15:56:26 +02:00
e n d i f
2009-03-04 04:28:42 +01:00
2017-01-31 12:07:02 +01:00
# -----------------------------------------------------------------
# vendor default.prop
INSTALLED_VENDOR_DEFAULT_PROP_TARGET :=
2017-03-03 04:40:21 +01:00
i f d e f p r o p e r t y _ o v e r r i d e s _ s p l i t _ e n a b l e d
2017-01-31 12:07:02 +01:00
INSTALLED_VENDOR_DEFAULT_PROP_TARGET := $( TARGET_OUT_VENDOR) /default.prop
ALL_DEFAULT_INSTALLED_MODULES += $( INSTALLED_VENDOR_DEFAULT_PROP_TARGET)
$(INSTALLED_VENDOR_DEFAULT_PROP_TARGET) : $( INSTALLED_DEFAULT_PROP_TARGET )
@echo Target buildinfo: $@
@mkdir -p $( dir $@ )
$( hide) echo "#" > $@ ; \
echo "# ADDITIONAL VENDOR DEFAULT PROPERTIES" >> $@ ; \
echo "#" >> $@ ;
$( hide) $( foreach line,$( FINAL_VENDOR_DEFAULT_PROPERTIES) , \
2018-11-26 19:12:05 +01:00
echo " $( line) " >> $@ ; )
2017-12-06 23:38:40 +01:00
$( hide) build/make/tools/post_process_props.py $@
2017-01-31 12:07:02 +01:00
2017-03-03 04:40:21 +01:00
e n d i f # property_overrides_split_enabled
2017-01-31 12:07:02 +01:00
2009-03-04 04:28:42 +01:00
# -----------------------------------------------------------------
# build.prop
INSTALLED_BUILD_PROP_TARGET := $( TARGET_OUT) /build.prop
ALL_DEFAULT_INSTALLED_MODULES += $( INSTALLED_BUILD_PROP_TARGET)
2017-01-20 05:17:12 +01:00
FINAL_BUILD_PROPERTIES := \
2011-06-18 02:05:35 +02:00
$( call collapse-pairs, $( ADDITIONAL_BUILD_PROPERTIES) )
2017-01-20 05:17:12 +01:00
FINAL_BUILD_PROPERTIES := $( call uniq-pairs-by-first-component, \
$( FINAL_BUILD_PROPERTIES) ,= )
2009-03-04 04:28:42 +01:00
# A list of arbitrary tags describing the build configuration.
# Force ":=" so we can use +=
BUILD_VERSION_TAGS := $( BUILD_VERSION_TAGS)
i f e q ( $( TARGET_BUILD_TYPE ) , d e b u g )
BUILD_VERSION_TAGS += debug
e n d i f
2011-10-05 21:41:56 +02:00
# The "test-keys" tag marks builds signed with the old test keys,
# which are available in the SDK. "dev-keys" marks builds signed with
# non-default dev keys (usually private keys from a vendor directory).
# Both of these tags will be removed and replaced with "release-keys"
# when the target-files is signed in a post-build step.
i f e q ( $( DEFAULT_SYSTEM_DEV_CERTIFICATE ) , b u i l d / t a r g e t / p r o d u c t / s e c u r i t y / t e s t k e y )
2013-07-23 20:51:04 +02:00
BUILD_KEYS := test-keys
2011-10-05 21:41:56 +02:00
e l s e
2013-07-23 20:51:04 +02:00
BUILD_KEYS := dev-keys
2011-10-05 21:41:56 +02:00
e n d i f
2013-07-23 20:51:04 +02:00
BUILD_VERSION_TAGS += $( BUILD_KEYS)
2009-03-04 04:28:42 +01:00
BUILD_VERSION_TAGS := $( subst $( space) ,$( comma) ,$( sort $( BUILD_VERSION_TAGS) ) )
# A human-readable string that descibes this build in detail.
2015-07-17 02:15:19 +02:00
build_desc := $( TARGET_PRODUCT) -$( TARGET_BUILD_VARIANT) $( PLATFORM_VERSION) $( BUILD_ID) $( BUILD_NUMBER_FROM_FILE) $( BUILD_VERSION_TAGS)
2015-05-07 05:44:22 +02:00
$(intermediate_system_build_prop) : PRIVATE_BUILD_DESC := $( build_desc )
2009-03-04 04:28:42 +01:00
2014-03-22 00:20:05 +01:00
# The string used to uniquely identify the combined build and product; used by the OTA server.
2009-03-04 04:28:42 +01:00
i f e q ( , $( strip $ ( BUILD_FINGERPRINT ) ) )
2018-02-21 02:00:39 +01:00
ifeq ( $( strip $( HAS_BUILD_NUMBER) ) ,false)
2019-01-02 21:27:43 +01:00
BF_BUILD_NUMBER := $( BUILD_USERNAME) $$ ( $( DATE_FROM_FILE) +%m%d%H%M)
2014-06-13 03:42:53 +02:00
else
2018-02-21 02:00:39 +01:00
BF_BUILD_NUMBER := $( file <$( BUILD_NUMBER_FILE) )
2014-06-13 03:42:53 +02:00
endif
BUILD_FINGERPRINT := $( PRODUCT_BRAND) /$( TARGET_PRODUCT) /$( TARGET_DEVICE) :$( PLATFORM_VERSION) /$( BUILD_ID) /$( BF_BUILD_NUMBER) :$( TARGET_BUILD_VARIANT) /$( BUILD_VERSION_TAGS)
2009-03-04 04:28:42 +01:00
e n d i f
2018-02-21 02:00:39 +01:00
# unset it for safety.
BF_BUILD_NUMBER :=
2009-03-04 04:28:42 +01:00
2018-02-21 02:00:39 +01:00
BUILD_FINGERPRINT_FILE := $( PRODUCT_OUT) /build_fingerprint.txt
i f n e q ( , $( shell mkdir -p $ ( PRODUCT_OUT ) && echo $ ( BUILD_FINGERPRINT ) >$ ( BUILD_FINGERPRINT_FILE ) && grep " " $ ( BUILD_FINGERPRINT_FILE ) ) )
$( error BUILD_FINGERPRINT cannot contain spaces: " $( file <$( BUILD_FINGERPRINT_FILE) ) " )
e n d i f
BUILD_FINGERPRINT_FROM_FILE := $$ ( cat $( BUILD_FINGERPRINT_FILE) )
# unset it for safety.
BUILD_FINGERPRINT :=
2015-07-17 02:15:19 +02:00
2014-03-22 00:20:05 +01:00
# The string used to uniquely identify the system build; used by the OTA server.
# This purposefully excludes any product-specific variables.
i f e q ( , $( strip $ ( BUILD_THUMBPRINT ) ) )
2018-02-21 02:00:39 +01:00
BUILD_THUMBPRINT := $( PLATFORM_VERSION) /$( BUILD_ID) /$( BUILD_NUMBER_FROM_FILE) :$( TARGET_BUILD_VARIANT) /$( BUILD_VERSION_TAGS)
2014-03-22 00:20:05 +01:00
e n d i f
2018-02-21 02:00:39 +01:00
BUILD_THUMBPRINT_FILE := $( PRODUCT_OUT) /build_thumbprint.txt
i f n e q ( , $( shell mkdir -p $ ( PRODUCT_OUT ) && echo $ ( BUILD_THUMBPRINT ) >$ ( BUILD_THUMBPRINT_FILE ) && grep " " $ ( BUILD_THUMBPRINT_FILE ) ) )
$( error BUILD_THUMBPRINT cannot contain spaces: " $( file <$( BUILD_THUMBPRINT_FILE) ) " )
2014-03-22 00:20:05 +01:00
e n d i f
2018-02-21 02:00:39 +01:00
BUILD_THUMBPRINT_FROM_FILE := $$ ( cat $( BUILD_THUMBPRINT_FILE) )
# unset it for safety.
BUILD_THUMBPRINT :=
2014-03-22 00:20:05 +01:00
2014-10-08 03:42:11 +02:00
KNOWN_OEM_THUMBPRINT_PROPERTIES := \
ro.product.brand \
ro.product.name \
ro.product.device
OEM_THUMBPRINT_PROPERTIES := $( filter $( KNOWN_OEM_THUMBPRINT_PROPERTIES) ,\
$( PRODUCTS.$( INTERNAL_PRODUCT) .PRODUCT_OEM_PROPERTIES) )
2009-03-25 06:40:59 +01:00
# Display parameters shown under Settings -> About Phone
i f e q ( $( TARGET_BUILD_VARIANT ) , u s e r )
# User builds should show:
# release build number or branch.buld_number non-release builds
# Dev. branches should have DISPLAY_BUILD_NUMBER set
2017-02-22 02:23:02 +01:00
ifeq ( true,$( DISPLAY_BUILD_NUMBER) )
2015-07-17 02:15:19 +02:00
BUILD_DISPLAY_ID := $( BUILD_ID) .$( BUILD_NUMBER_FROM_FILE) $( BUILD_KEYS)
2009-03-25 06:40:59 +01:00
else
2013-07-23 20:51:04 +02:00
BUILD_DISPLAY_ID := $( BUILD_ID) $( BUILD_KEYS)
2009-03-25 06:40:59 +01:00
endif
e l s e
# Non-user builds should show detailed build information
BUILD_DISPLAY_ID := $( build_desc)
e n d i f
2015-01-15 19:16:24 +01:00
# Accepts a whitespace separated list of product locales such as
# (en_US en_AU en_GB...) and returns the first locale in the list with
# underscores replaced with hyphens. In the example above, this will
# return "en-US".
d e f i n e g e t - d e f a u l t - p r o d u c t - l o c a l e
$( strip $ ( subst _ ,-, $ ( firstword $ ( 1) ) ) )
2009-03-04 04:28:42 +01:00
e n d e f
2017-05-09 18:54:49 +02:00
# TARGET_BUILD_FLAVOR and ro.build.flavor are used only by the test
# harness to distinguish builds. Only add _asan for a sanitized build
# if it isn't already a part of the flavor (via a dedicated lunch
# config for example).
2015-10-29 02:45:03 +01:00
TARGET_BUILD_FLAVOR := $( TARGET_PRODUCT) -$( TARGET_BUILD_VARIANT)
2017-08-14 16:57:37 +02:00
i f n e q ( , $( filter address , $ ( SANITIZE_TARGET ) ) )
2017-05-09 18:54:49 +02:00
i f e q ( , $( findstring _asan ,$ ( TARGET_BUILD_FLAVOR ) ) )
2015-10-29 02:45:03 +01:00
TARGET_BUILD_FLAVOR := $( TARGET_BUILD_FLAVOR) _asan
e n d i f
2017-05-09 18:54:49 +02:00
e n d i f
2015-10-29 02:45:03 +01:00
2012-09-28 18:33:45 +02:00
i f d e f T A R G E T _ S Y S T E M _ P R O P
system_prop_file := $( TARGET_SYSTEM_PROP)
e l s e
system_prop_file := $( wildcard $( TARGET_DEVICE_DIR) /system.prop)
e n d i f
2018-12-14 10:04:19 +01:00
$(intermediate_system_build_prop) : $( BUILDINFO_SH ) $( BUILDINFO_COMMON_SH ) $( INTERNAL_BUILD_ID_MAKEFILE ) $( BUILD_SYSTEM ) /version_defaults .mk $( system_prop_file ) $( INSTALLED_ANDROID_INFO_TXT_TARGET ) $( api_fingerprint )
2009-03-04 04:28:42 +01:00
@echo Target buildinfo: $@
@mkdir -p $( dir $@ )
2014-03-19 01:20:10 +01:00
$( hide) echo > $@
i f n e q ( $( PRODUCTS .$ ( INTERNAL_PRODUCT ) .PRODUCT_OEM_PROPERTIES ) , )
$( hide) echo "#" >> $@ ; \
echo "# PRODUCT_OEM_PROPERTIES" >> $@ ; \
2014-03-22 00:20:05 +01:00
echo "#" >> $@ ;
2014-03-19 01:20:10 +01:00
$( hide) $( foreach prop,$( PRODUCTS.$( INTERNAL_PRODUCT) .PRODUCT_OEM_PROPERTIES) , \
2018-11-26 19:12:05 +01:00
echo " import /oem/oem.prop $( prop) " >> $@ ; )
2014-03-19 01:20:10 +01:00
e n d i f
2018-08-15 13:11:55 +02:00
$( hide) $( call generate-common-build-props,system,$@ )
2009-03-04 04:28:42 +01:00
$( hide) TARGET_BUILD_TYPE = " $( TARGET_BUILD_VARIANT) " \
2018-11-26 19:12:05 +01:00
TARGET_BUILD_FLAVOR = " $( TARGET_BUILD_FLAVOR) " \
TARGET_DEVICE = " $( TARGET_DEVICE) " \
PRODUCT_DEFAULT_LOCALE = " $( call get-default-product-locale,$( PRODUCT_LOCALES) ) " \
PRODUCT_DEFAULT_WIFI_CHANNELS = " $( PRODUCT_DEFAULT_WIFI_CHANNELS) " \
PRIVATE_BUILD_DESC = " $( PRIVATE_BUILD_DESC) " \
BUILD_ID = " $( BUILD_ID) " \
BUILD_DISPLAY_ID = " $( BUILD_DISPLAY_ID) " \
DATE = " $( DATE_FROM_FILE) " \
2019-01-02 21:27:43 +01:00
BUILD_USERNAME = " $( BUILD_USERNAME) " \
BUILD_HOSTNAME = " $( BUILD_HOSTNAME) " \
2018-11-26 19:12:05 +01:00
BUILD_NUMBER = " $( BUILD_NUMBER_FROM_FILE) " \
BOARD_BUILD_SYSTEM_ROOT_IMAGE = " $( BOARD_BUILD_SYSTEM_ROOT_IMAGE) " \
AB_OTA_UPDATER = " $( AB_OTA_UPDATER) " \
PLATFORM_VERSION = " $( PLATFORM_VERSION) " \
PLATFORM_SECURITY_PATCH = " $( PLATFORM_SECURITY_PATCH) " \
PLATFORM_BASE_OS = " $( PLATFORM_BASE_OS) " \
PLATFORM_SDK_VERSION = " $( PLATFORM_SDK_VERSION) " \
PLATFORM_PREVIEW_SDK_VERSION = " $( PLATFORM_PREVIEW_SDK_VERSION) " \
2018-12-14 10:04:19 +01:00
PLATFORM_PREVIEW_SDK_FINGERPRINT = " $$ (cat $( api_fingerprint) ) " \
2018-11-26 19:12:05 +01:00
PLATFORM_VERSION_CODENAME = " $( PLATFORM_VERSION_CODENAME) " \
PLATFORM_VERSION_ALL_CODENAMES = " $( PLATFORM_VERSION_ALL_CODENAMES) " \
PLATFORM_MIN_SUPPORTED_TARGET_SDK_VERSION = " $( PLATFORM_MIN_SUPPORTED_TARGET_SDK_VERSION) " \
BUILD_VERSION_TAGS = " $( BUILD_VERSION_TAGS) " \
$( if $( OEM_THUMBPRINT_PROPERTIES) ,BUILD_THUMBPRINT= " $( BUILD_THUMBPRINT_FROM_FILE) " ) \
TARGET_CPU_ABI_LIST = " $( TARGET_CPU_ABI_LIST) " \
TARGET_CPU_ABI_LIST_32_BIT = " $( TARGET_CPU_ABI_LIST_32_BIT) " \
TARGET_CPU_ABI_LIST_64_BIT = " $( TARGET_CPU_ABI_LIST_64_BIT) " \
TARGET_CPU_ABI = " $( TARGET_CPU_ABI) " \
TARGET_CPU_ABI2 = " $( TARGET_CPU_ABI2) " \
2014-03-19 01:20:10 +01:00
bash $( BUILDINFO_SH) >> $@
2012-04-12 17:00:58 +02:00
$( hide) $( foreach file,$( system_prop_file) , \
2018-11-26 19:12:05 +01:00
if [ -f " $( file) " ] ; then \
echo Target buildinfo from: " $( file) " ; \
echo "" >> $@ ; \
echo "#" >> $@ ; \
echo " # from $( file) " >> $@ ; \
echo "#" >> $@ ; \
cat $( file) >> $@ ; \
echo " # end of $( file) " >> $@ ; \
fi ; )
2017-01-20 05:17:12 +01:00
$( if $( FINAL_BUILD_PROPERTIES) , \
2018-11-26 19:12:05 +01:00
$( hide) echo >> $@ ; \
echo "#" >> $@ ; \
echo "# ADDITIONAL_BUILD_PROPERTIES" >> $@ ; \
echo "#" >> $@ ; )
2017-01-20 05:17:12 +01:00
$( hide) $( foreach line,$( FINAL_BUILD_PROPERTIES) , \
2018-11-26 19:12:05 +01:00
echo " $( line) " >> $@ ; )
2015-02-06 19:12:55 +01:00
$( hide) cat $( INSTALLED_ANDROID_INFO_TXT_TARGET) | grep 'require version-' | sed -e 's/require version-/ro.build.expect./g' >> $@
2017-12-06 23:38:40 +01:00
$( hide) build/make/tools/post_process_props.py $@ $( PRODUCTS.$( INTERNAL_PRODUCT) .PRODUCT_SYSTEM_PROPERTY_BLACKLIST)
2009-03-04 04:28:42 +01:00
build_desc :=
2015-05-07 05:44:22 +02:00
i f e q ( , $( filter true , $ ( TARGET_NO_KERNEL ) $ ( TARGET_NO_RECOVERY ) ) )
INSTALLED_RECOVERYIMAGE_TARGET := $( PRODUCT_OUT) /recovery.img
e l s e
INSTALLED_RECOVERYIMAGE_TARGET :=
e n d i f
$(INSTALLED_BUILD_PROP_TARGET) : $( intermediate_system_build_prop ) $( INSTALLED_RECOVERYIMAGE_TARGET )
@echo " Target build info: $@ "
2017-10-22 11:11:47 +02:00
$( hide) grep -v 'ro.product.first_api_level' $( intermediate_system_build_prop) > $@
2015-05-07 05:44:22 +02:00
2014-07-22 02:21:20 +02:00
# -----------------------------------------------------------------
# vendor build.prop
#
2016-01-10 15:18:54 +01:00
# For verifying that the vendor build is what we think it is
2014-07-22 02:21:20 +02:00
INSTALLED_VENDOR_BUILD_PROP_TARGET := $( TARGET_OUT_VENDOR) /build.prop
ALL_DEFAULT_INSTALLED_MODULES += $( INSTALLED_VENDOR_BUILD_PROP_TARGET)
2017-01-31 12:07:02 +01:00
2017-03-03 04:40:21 +01:00
i f d e f p r o p e r t y _ o v e r r i d e s _ s p l i t _ e n a b l e d
2017-01-31 12:07:02 +01:00
FINAL_VENDOR_BUILD_PROPERTIES += \
$( call collapse-pairs, $( PRODUCT_PROPERTY_OVERRIDES) )
FINAL_VENDOR_BUILD_PROPERTIES := $( call uniq-pairs-by-first-component, \
$( FINAL_VENDOR_BUILD_PROPERTIES) ,= )
2017-03-03 04:40:21 +01:00
e n d i f # property_overrides_split_enabled
2017-01-31 12:07:02 +01:00
2018-08-15 13:11:55 +02:00
$(INSTALLED_VENDOR_BUILD_PROP_TARGET) : $( BUILDINFO_COMMON_SH ) $( intermediate_system_build_prop )
2014-07-22 02:21:20 +02:00
@echo Target vendor buildinfo: $@
@mkdir -p $( dir $@ )
$( hide) echo > $@
2017-10-24 04:47:43 +02:00
$( hide) grep 'ro.product.first_api_level' $( intermediate_system_build_prop) >> $@ || true
2018-03-29 00:48:13 +02:00
$( hide) echo ro.vendor.build.security_patch= " $( VENDOR_SECURITY_PATCH) " >>$@
2018-01-31 07:27:37 +01:00
$( hide) echo ro.vendor.product.cpu.abilist= " $( TARGET_CPU_ABI_LIST) " >>$@
$( hide) echo ro.vendor.product.cpu.abilist32= " $( TARGET_CPU_ABI_LIST_32_BIT) " >>$@
$( hide) echo ro.vendor.product.cpu.abilist64= " $( TARGET_CPU_ABI_LIST_64_BIT) " >>$@
2018-08-15 13:11:55 +02:00
$( hide) echo ro.product.board= " $( TARGET_BOOTLOADER_BOARD_NAME) " >>$@
$( hide) echo ro.board.platform= " $( TARGET_BOARD_PLATFORM) " >>$@
$( hide) $( call generate-common-build-props,vendor,$@ )
2017-10-25 05:08:32 +02:00
i f d e f p r o p e r t y _ o v e r r i d e s _ s p l i t _ e n a b l e d
2017-01-31 12:07:02 +01:00
$( hide) echo "#" >> $@ ; \
echo "# ADDITIONAL VENDOR BUILD PROPERTIES" >> $@ ; \
echo "#" >> $@ ;
$( hide) $( foreach line,$( FINAL_VENDOR_BUILD_PROPERTIES) , \
2018-11-26 19:12:05 +01:00
echo " $( line) " >> $@ ; )
2017-03-03 04:40:21 +01:00
e n d i f # property_overrides_split_enabled
2018-03-29 16:22:33 +02:00
$( hide) build/make/tools/post_process_props.py $@ $( PRODUCTS.$( INTERNAL_PRODUCT) .PRODUCT_VENDOR_PROPERTY_BLACKLIST)
2014-07-22 02:21:20 +02:00
2017-11-27 09:04:47 +01:00
# -----------------------------------------------------------------
# product build.prop
INSTALLED_PRODUCT_BUILD_PROP_TARGET := $( TARGET_OUT_PRODUCT) /build.prop
ALL_DEFAULT_INSTALLED_MODULES += $( INSTALLED_PRODUCT_BUILD_PROP_TARGET)
2018-11-22 16:27:35 +01:00
i f d e f T A R G E T _ P R O D U C T _ P R O P
product_prop_files := $( TARGET_PRODUCT_PROP)
e l s e
product_prop_files := $( wildcard $( TARGET_DEVICE_DIR) /product.prop)
e n d i f
2017-11-27 09:04:47 +01:00
FINAL_PRODUCT_PROPERTIES += \
2018-07-27 22:11:50 +02:00
$( call collapse-pairs, $( PRODUCT_PRODUCT_PROPERTIES) $( ADDITIONAL_PRODUCT_PROPERTIES) )
2017-11-27 09:04:47 +01:00
FINAL_PRODUCT_PROPERTIES := $( call uniq-pairs-by-first-component, \
$( FINAL_PRODUCT_PROPERTIES) ,= )
2018-11-22 16:27:35 +01:00
$(INSTALLED_PRODUCT_BUILD_PROP_TARGET) : $( BUILDINFO_COMMON_SH ) $( product_prop_files )
2017-11-27 09:04:47 +01:00
@echo Target product buildinfo: $@
@mkdir -p $( dir $@ )
$( hide) echo > $@
i f d e f B O A R D _ U S E S _ P R O D U C T I M A G E
2018-08-15 13:11:55 +02:00
$( hide) $( call generate-common-build-props,product,$@ )
2017-11-27 09:04:47 +01:00
e n d i f # BOARD_USES_PRODUCTIMAGE
2018-11-22 16:27:35 +01:00
$( hide) $( foreach file,$( product_prop_files) , \
2018-11-26 19:12:05 +01:00
if [ -f " $( file) " ] ; then \
echo Target product properties from: " $( file) " ; \
echo "" >> $@ ; \
echo "#" >> $@ ; \
echo " # from $( file) " >> $@ ; \
echo "#" >> $@ ; \
cat $( file) >> $@ ; \
echo " # end of $( file) " >> $@ ; \
fi ; )
2017-11-27 09:04:47 +01:00
$( hide) echo "#" >> $@ ; \
echo "# ADDITIONAL PRODUCT PROPERTIES" >> $@ ; \
2018-11-05 18:29:28 +01:00
echo "#" >> $@ ; \
2018-11-22 16:27:35 +01:00
echo " ro.build.characteristics= $( TARGET_AAPT_CHARACTERISTICS) " >> $@ ;
2017-11-27 09:04:47 +01:00
$( hide) $( foreach line,$( FINAL_PRODUCT_PROPERTIES) , \
2018-11-26 19:12:05 +01:00
echo " $( line) " >> $@ ; )
2017-11-27 09:04:47 +01:00
$( hide) build/make/tools/post_process_props.py $@
2015-01-14 00:30:34 +01:00
# ----------------------------------------------------------------
2017-11-14 16:42:30 +01:00
# odm build.prop
INSTALLED_ODM_BUILD_PROP_TARGET := $( TARGET_OUT_ODM) /build.prop
ALL_DEFAULT_INSTALLED_MODULES += $( INSTALLED_ODM_BUILD_PROP_TARGET)
FINAL_ODM_BUILD_PROPERTIES += \
$( call collapse-pairs, $( PRODUCT_ODM_PROPERTIES) )
FINAL_ODM_BUILD_PROPERTIES := $( call uniq-pairs-by-first-component, \
$( FINAL_ODM_BUILD_PROPERTIES) ,= )
2018-08-15 13:11:55 +02:00
$(INSTALLED_ODM_BUILD_PROP_TARGET) : $( BUILDINFO_COMMON_SH )
2017-11-14 16:42:30 +01:00
@echo Target odm buildinfo: $@
@mkdir -p $( dir $@ )
$( hide) echo > $@
$( hide) echo ro.odm.product.cpu.abilist= " $( TARGET_CPU_ABI_LIST) " >>$@
$( hide) echo ro.odm.product.cpu.abilist32= " $( TARGET_CPU_ABI_LIST_32_BIT) " >>$@
$( hide) echo ro.odm.product.cpu.abilist64= " $( TARGET_CPU_ABI_LIST_64_BIT) " >>$@
2018-08-15 13:11:55 +02:00
$( hide) $( call generate-common-build-props,odm,$@ )
2017-11-14 16:42:30 +01:00
$( hide) echo "#" >> $@ ; \
echo "# ADDITIONAL ODM BUILD PROPERTIES" >> $@ ; \
echo "#" >> $@ ;
$( hide) $( foreach line,$( FINAL_ODM_BUILD_PROPERTIES) , \
2018-11-26 19:12:05 +01:00
echo " $( line) " >> $@ ; )
2017-11-14 16:42:30 +01:00
$( hide) build/make/tools/post_process_props.py $@
2015-01-14 00:30:34 +01:00
2018-05-29 14:09:01 +02:00
# -----------------------------------------------------------------
2019-01-28 18:49:00 +01:00
# product_services build.prop (unless it's merged into /product)
i f d e f M E R G E _ P R O D U C T _ S E R V I C E S _ I N T O _ P R O D U C T
ifneq ( ,$( PRODUCT_PRODUCT_SERVICES_PROPERTIES) )
$( error PRODUCT_PRODUCT_SERVICES_PROPERTIES is not supported in this build.)
endif
e l s e
2018-05-29 14:09:01 +02:00
INSTALLED_PRODUCT_SERVICES_BUILD_PROP_TARGET := $( TARGET_OUT_PRODUCT_SERVICES) /build.prop
ALL_DEFAULT_INSTALLED_MODULES += $( INSTALLED_PRODUCT_SERVICES_BUILD_PROP_TARGET)
FINAL_PRODUCT_SERVICES_PROPERTIES += \
$( call collapse-pairs, $( PRODUCT_PRODUCT_SERVICES_PROPERTIES) )
FINAL_PRODUCT_SERVICES_PROPERTIES := $( call uniq-pairs-by-first-component, \
$( FINAL_PRODUCT_SERVICES_PROPERTIES) ,= )
2018-08-15 13:11:55 +02:00
$(INSTALLED_PRODUCT_SERVICES_BUILD_PROP_TARGET) : $( BUILDINFO_COMMON_SH )
2018-08-17 01:56:14 +02:00
@echo Target product_services buildinfo: $@
2018-05-29 14:09:01 +02:00
@mkdir -p $( dir $@ )
$( hide) echo > $@
i f d e f B O A R D _ U S E S _ P R O D U C T _ S E R V I C E S I M A G E
2018-08-15 13:11:55 +02:00
$( hide) $( call generate-common-build-props,product_services,$@ )
2018-05-29 14:09:01 +02:00
e n d i f # BOARD_USES_PRODUCT_SERVICESIMAGE
$( hide) echo "#" >> $@ ; \
echo "# ADDITIONAL PRODUCT_SERVICES PROPERTIES" >> $@ ; \
echo "#" >> $@ ;
$( hide) $( foreach line,$( FINAL_PRODUCT_SERVICES_PROPERTIES) , \
2018-11-26 19:12:05 +01:00
echo " $( line) " >> $@ ; )
2018-05-29 14:09:01 +02:00
$( hide) build/make/tools/post_process_props.py $@
2019-01-28 18:49:00 +01:00
e n d i f # MERGE_PRODUCT_SERVICES_INTO_PRODUCT
2018-05-29 14:09:01 +02:00
# ----------------------------------------------------------------
2009-03-04 04:28:42 +01:00
# -----------------------------------------------------------------
# sdk-build.prop
#
# There are certain things in build.prop that we don't want to
# ship with the sdk; remove them.
# This must be a list of entire property keys followed by
# "=" characters, without any internal spaces.
sdk_build_prop_remove := \
ro.build.user= \
ro.build.host= \
ro.product.brand= \
ro.product.manufacturer= \
ro.product.device=
# TODO: Remove this soon-to-be obsolete property
sdk_build_prop_remove += ro.build.product=
INSTALLED_SDK_BUILD_PROP_TARGET := $( PRODUCT_OUT) /sdk/sdk-build.prop
$(INSTALLED_SDK_BUILD_PROP_TARGET) : $( INSTALLED_BUILD_PROP_TARGET )
@echo SDK buildinfo: $@
@mkdir -p $( dir $@ )
$( hide) grep -v " $( subst $( space) ,\| ,$( strip \
2018-11-26 19:12:05 +01:00
$( sdk_build_prop_remove) ) ) " $< > $@ .tmp
2009-03-04 04:28:42 +01:00
$( hide) for x in $( sdk_build_prop_remove) ; do \
2018-11-26 19:12:05 +01:00
echo " $$ x " generic >> $@ .tmp; done
2009-03-04 04:28:42 +01:00
$( hide) mv $@ .tmp $@
# -----------------------------------------------------------------
# package stats
PACKAGE_STATS_FILE := $( PRODUCT_OUT) /package-stats.txt
PACKAGES_TO_STAT := \
$( sort $( filter $( TARGET_OUT) /% $( TARGET_OUT_DATA) /%, \
$( filter %.jar %.apk, $( ALL_DEFAULT_INSTALLED_MODULES) ) ) )
$(PACKAGE_STATS_FILE) : $( PACKAGES_TO_STAT )
@echo Package stats: $@
@mkdir -p $( dir $@ )
$( hide) rm -f $@
2015-08-23 18:40:05 +02:00
i f e q ( $( PACKAGES_TO_STAT ) , )
# Create empty package stats file if target builds no jar(s) or apk(s).
$( hide) touch $@
e l s e
2017-12-06 23:38:40 +01:00
$( hide) build/make/tools/dump-package-stats $^ > $@
2015-08-23 18:40:05 +02:00
e n d i f
2009-03-04 04:28:42 +01:00
.PHONY : package -stats
package-stats : $( PACKAGE_STATS_FILE )
# -----------------------------------------------------------------
# Cert-to-package mapping. Used by the post-build signing tools.
2012-10-26 18:21:28 +02:00
# Use a macro to add newline to each echo command
2017-08-14 11:53:50 +02:00
d e f i n e _ a p k c e r t s _ w r i t e _ l i n e
$( hide ) e c h o - n 'name="$(1).apk" certificate="$2" private_key="$3"' > > $ 5
$( if $ ( 4) , $ ( hide ) echo -n ' compressed ="$ 4"' >> $ 5)
$( hide ) e c h o '' > > $ 5
2012-10-26 18:21:28 +02:00
e n d e f
2009-03-04 04:28:42 +01:00
name := $( TARGET_PRODUCT)
i f e q ( $( TARGET_BUILD_TYPE ) , d e b u g )
name := $( name) _debug
e n d i f
name := $( name) -apkcerts-$( FILE_NAME_TAG)
intermediates := \
$( call intermediates-dir-for,PACKAGING,apkcerts)
APKCERTS_FILE := $( intermediates) /$( name) .txt
2011-02-15 19:56:18 +01:00
# We don't need to really build all the modules.
# TODO: rebuild APKCERTS_FILE if any app change its cert.
2010-07-24 01:42:13 +02:00
$(APKCERTS_FILE) :
2009-03-04 04:28:42 +01:00
@echo APK certs list: $@
@mkdir -p $( dir $@ )
@rm -f $@
2012-10-26 18:21:28 +02:00
$( foreach p,$( PACKAGES) ,\
$( if $( PACKAGES.$( p) .EXTERNAL_KEY) ,\
2017-08-14 11:53:50 +02:00
$( call _apkcerts_write_line,$( p) ,"EXTERNAL" ,"" ,$( PACKAGES.$( p) .COMPRESSED) ,$@ ) ,\
$( call _apkcerts_write_line,$( p) ,$( PACKAGES.$( p) .CERTIFICATE) ,$( PACKAGES.$( p) .PRIVATE_KEY) ,$( PACKAGES.$( p) .COMPRESSED) ,$@ ) ) )
2012-10-26 18:21:28 +02:00
# In case value of PACKAGES is empty.
2011-09-26 21:05:06 +02:00
$( hide) touch $@
2009-03-04 04:28:42 +01:00
.PHONY : apkcerts -list
apkcerts-list : $( APKCERTS_FILE )
2011-02-15 19:56:18 +01:00
i f n e q ( , $( TARGET_BUILD_APPS ) )
$( call dist-for-goals, apps_only, $( APKCERTS_FILE) :apkcerts.txt)
2019-02-18 07:21:19 +01:00
$( call dist-for-goals, apps_only, $( SOONG_APEX_KEYS_FILE) :apexkeys.txt)
2011-02-15 19:56:18 +01:00
e n d i f
2010-07-24 01:42:13 +02:00
2019-02-18 07:21:19 +01:00
2009-06-15 23:30:14 +02:00
# -----------------------------------------------------------------
2016-07-26 01:03:53 +02:00
# build system stats
BUILD_SYSTEM_STATS := $( PRODUCT_OUT) /build_system_stats.txt
$(BUILD_SYSTEM_STATS) :
@rm -f $@
@$( foreach s,$( STATS.MODULE_TYPE) ,echo " modules_type_make, $( s) , $( words $( STATS.MODULE_TYPE.$( s) ) ) " >>$@ ; )
@$( foreach s,$( STATS.SOONG_MODULE_TYPE) ,echo " modules_type_soong, $( s) , $( STATS.SOONG_MODULE_TYPE.$( s) ) " >>$@ ; )
$( call dist -for -goals ,droidcore ,$ ( BUILD_SYSTEM_STATS ) )
2009-06-15 23:30:14 +02:00
2016-08-26 22:27:13 +02:00
# -----------------------------------------------------------------
# Modules ready to be converted to Soong, ordered by how many
# modules depend on them.
SOONG_CONV := $( sort $( SOONG_CONV) )
SOONG_CONV_DATA := $( call intermediates-dir-for,PACKAGING,soong_conversion) /soong_conv_data
$(SOONG_CONV_DATA) :
@rm -f $@
2017-12-06 23:37:06 +01:00
@$( foreach s,$( SOONG_CONV) ,echo " $( s) , $( SOONG_CONV.$( s) .TYPE) , $( sort $( SOONG_CONV.$( s) .PROBLEMS) ) , $( sort $( filter-out $( SOONG_ALREADY_CONV) ,$( SOONG_CONV.$( s) .DEPS) ) ) " >>$@ ; )
2016-08-26 22:27:13 +02:00
2017-12-06 23:38:40 +01:00
SOONG_TO_CONVERT_SCRIPT := build/make/tools/soong_to_convert.py
2016-08-26 22:27:13 +02:00
SOONG_TO_CONVERT := $( PRODUCT_OUT) /soong_to_convert.txt
$(SOONG_TO_CONVERT) : $( SOONG_CONV_DATA ) $( SOONG_TO_CONVERT_SCRIPT )
@rm -f $@
$( hide) $( SOONG_TO_CONVERT_SCRIPT) $< >$@
$( call dist -for -goals ,droidcore ,$ ( SOONG_TO_CONVERT ) )
2017-11-06 19:47:24 +01:00
# -----------------------------------------------------------------
# Modules use -Wno-error, or added default -Wall -Werror
WALL_WERROR := $( PRODUCT_OUT) /wall_werror.txt
$(WALL_WERROR) :
@rm -f $@
echo "# Modules using -Wno-error" >> $@
for m in $( sort $( SOONG_MODULES_USING_WNO_ERROR) $( MODULES_USING_WNO_ERROR) ) ; do echo $$ m >> $@ ; done
echo "# Modules added default -Wall" >> $@
for m in $( sort $( SOONG_MODULES_ADDED_WALL) $( MODULES_ADDED_WALL) ) ; do echo $$ m >> $@ ; done
$( call dist -for -goals ,droidcore ,$ ( WALL_WERROR ) )
2018-01-29 18:22:24 +01:00
# -----------------------------------------------------------------
# Modules missing profile files
PGO_PROFILE_MISSING := $( PRODUCT_OUT) /pgo_profile_file_missing.txt
$(PGO_PROFILE_MISSING) :
@rm -f $@
echo "# Modules missing PGO profile files" >> $@
for m in $( SOONG_MODULES_MISSING_PGO_PROFILE_FILE) ; do echo $$ m >> $@ ; done
$( call dist -for -goals ,droidcore ,$ ( PGO_PROFILE_MISSING ) )
2009-06-15 23:30:14 +02:00
# -----------------------------------------------------------------
2011-10-04 19:50:08 +02:00
# The dev key is used to sign this package, and as the key required
2009-06-15 23:30:14 +02:00
# for future OTA packages installed by this system. Actual product
# deliverables will be re-signed by hand. We expect this file to
# exist with the suffixes ".x509.pem" and ".pk8".
2018-09-15 06:51:11 +02:00
DEFAULT_KEY_CERT_PAIR := $( strip $( DEFAULT_SYSTEM_DEV_CERTIFICATE) )
2009-06-15 23:30:14 +02:00
2011-07-12 07:11:46 +02:00
# Rules that need to be present for the all targets, even
2009-03-04 04:28:42 +01:00
# if they don't do anything.
.PHONY : systemimage
systemimage :
2010-02-17 01:01:43 +01:00
# -----------------------------------------------------------------
.PHONY : event -log -tags
2010-07-14 19:22:54 +02:00
# Produce an event logs tag file for everything we know about, in order
# to properly allocate numbers. Then produce a file that's filtered
# for what's going to be installed.
all_event_log_tags_file := $( TARGET_OUT_COMMON_INTERMEDIATES) /all-event-log-tags.txt
2012-04-12 22:25:54 +02:00
event_log_tags_file := $( TARGET_OUT) /etc/event-log-tags
2010-07-14 19:22:54 +02:00
# Include tags from all packages that we know about
all_event_log_tags_src := \
$( sort $( foreach m, $( ALL_MODULES) , $( ALL_MODULES.$( m) .EVENT_LOG_TAGS) ) )
2012-04-12 22:25:54 +02:00
# PDK builds will already have a full list of tags that needs to get merged
# in with the ones from source
pdk_fusion_log_tags_file := $( patsubst $( PRODUCT_OUT) /%,$( _pdk_fusion_intermediates) /%,$( filter $( event_log_tags_file) ,$( ALL_PDK_FUSION_FILES) ) )
$(all_event_log_tags_file) : PRIVATE_SRC_FILES := $( all_event_log_tags_src ) $( pdk_fusion_log_tags_file )
2017-12-06 23:38:40 +01:00
$(all_event_log_tags_file) : $( all_event_log_tags_src ) $( pdk_fusion_log_tags_file ) $( MERGETAGS ) build /make /tools /event_log_tags .py
2010-07-14 19:22:54 +02:00
$( hide) mkdir -p $( dir $@ )
2016-03-28 20:29:21 +02:00
$( hide) $( MERGETAGS) -o $@ $( PRIVATE_SRC_FILES)
2010-07-14 19:22:54 +02:00
2011-02-23 21:17:29 +01:00
# Include tags from all packages included in this product, plus all
# tags that are part of the system (ie, not in a vendor/ or device/
# directory).
2010-02-17 01:01:43 +01:00
event_log_tags_src := \
$( sort $( foreach m,\
$( PRODUCTS.$( INTERNAL_PRODUCT) .PRODUCT_PACKAGES) \
$( call module-names-for-tag-list,user) , \
2011-02-23 21:17:29 +01:00
$( ALL_MODULES.$( m) .EVENT_LOG_TAGS) ) \
$( filter-out vendor/% device/% out/%,$( all_event_log_tags_src) ) )
2010-02-17 01:01:43 +01:00
2012-04-12 22:25:54 +02:00
$(event_log_tags_file) : PRIVATE_SRC_FILES := $( event_log_tags_src ) $( pdk_fusion_log_tags_file )
2010-07-14 19:22:54 +02:00
$(event_log_tags_file) : PRIVATE_MERGED_FILE := $( all_event_log_tags_file )
2017-12-06 23:38:40 +01:00
$(event_log_tags_file) : $( event_log_tags_src ) $( all_event_log_tags_file ) $( pdk_fusion_log_tags_file ) $( MERGETAGS ) build /make /tools /event_log_tags .py
2010-02-17 01:01:43 +01:00
$( hide) mkdir -p $( dir $@ )
2016-03-28 20:29:21 +02:00
$( hide) $( MERGETAGS) -o $@ -m $( PRIVATE_MERGED_FILE) $( PRIVATE_SRC_FILES)
2010-02-17 01:01:43 +01:00
event-log-tags : $( event_log_tags_file )
ALL_DEFAULT_INSTALLED_MODULES += $( event_log_tags_file)
2010-07-14 19:22:54 +02:00
2009-03-04 04:28:42 +01:00
# #################################################################
# Targets for boot/OS images
# #################################################################
2014-01-14 01:14:20 +01:00
i f n e q ( $( strip $ ( TARGET_NO_BOOTLOADER ) ) , t r u e )
INSTALLED_BOOTLOADER_MODULE := $( PRODUCT_OUT) /bootloader
ifeq ( $( strip $( TARGET_BOOTLOADER_IS_2ND) ) ,true)
INSTALLED_2NDBOOTLOADER_TARGET := $( PRODUCT_OUT) /2ndbootloader
else
INSTALLED_2NDBOOTLOADER_TARGET :=
endif
e l s e
INSTALLED_BOOTLOADER_MODULE :=
INSTALLED_2NDBOOTLOADER_TARGET :=
e n d i f # TARGET_NO_BOOTLOADER
i f n e q ( $( strip $ ( TARGET_NO_KERNEL ) ) , t r u e )
INSTALLED_KERNEL_TARGET := $( PRODUCT_OUT) /kernel
e l s e
INSTALLED_KERNEL_TARGET :=
e n d i f
2009-03-04 04:28:42 +01:00
# -----------------------------------------------------------------
2018-08-09 23:26:00 +02:00
# the root dir
INTERNAL_ROOT_FILES := $( filter $( TARGET_ROOT_OUT) /%, \
2009-03-04 04:28:42 +01:00
$( ALL_GENERATED_SOURCES) \
$( ALL_DEFAULT_INSTALLED_MODULES) )
2018-07-04 00:41:40 +02:00
INSTALLED_FILES_FILE_ROOT := $( PRODUCT_OUT) /installed-files-root.txt
INSTALLED_FILES_JSON_ROOT := $( INSTALLED_FILES_FILE_ROOT:.txt= .json)
$(INSTALLED_FILES_FILE_ROOT) : .KATI_IMPLICIT_OUTPUTS := $( INSTALLED_FILES_JSON_ROOT )
2018-08-09 23:26:00 +02:00
$(INSTALLED_FILES_FILE_ROOT) : $( INTERNAL_ROOT_FILES ) $( FILESLIST )
2018-07-04 00:41:40 +02:00
@echo Installed file list: $@
@mkdir -p $( dir $@ )
@rm -f $@
$( hide) $( FILESLIST) $( TARGET_ROOT_OUT) > $( @:.txt= .json)
$( hide) build/make/tools/fileslist_util.py -c $( @:.txt= .json) > $@
$( call dist -for -goals , sdk win_sdk sdk_addon , $ ( INSTALLED_FILES_FILE_ROOT ) )
2019-01-23 03:08:59 +01:00
#------------------------------------------------------------------
# dtb
i f d e f B O A R D _ P R E B U I L T _ D T B I M A G E _ D I R
INSTALLED_DTBIMAGE_TARGET := $( PRODUCT_OUT) /dtb.img
2019-02-07 20:38:18 +01:00
$(INSTALLED_DTBIMAGE_TARGET) : $( sort $ ( wildcard $ ( BOARD_PREBUILT_DTBIMAGE_DIR ) /*.dtb ) )
2019-01-23 03:08:59 +01:00
cat $^ > $@
e n d i f
2018-08-09 23:26:00 +02:00
# -----------------------------------------------------------------
# the ramdisk
Add PRODUCT_BUILD_*_IMAGE, BUILDING_*_IMAGE to control building of images
These centralize the decisions on whether to build certain images or
not, and allow the product definition to override that choice.
There are a few use cases here:
* For GSI-like cases, we only want to build the system image. This
didn't really change, but it's somewhat simpler to configure, and
easier to understand the build logic.
* On the opposite side, when you're planning on using a GSI, the device
specific build can only build the vendor images (or some other set).
* Some cases (Fuchsia, etc) don't want to build any images, as they'll
be distributing the build artifacts in their own packaging.
I suspect in the future, TARGET_BUILD_APPS may be able to be refactored
into the third use case.
Test: treehugger
Test: Create a product definition that includes nothing, try to build it.
Test: compare build-aosp_crosshatch.ninja and build-crosshatch.ninja before/after
Change-Id: I685ab841be3718d3dd7052c28ccd764bb6f1991a
2019-01-16 21:42:05 +01:00
i f d e f B U I L D I N G _ R A M D I S K _ I M A G E
2018-08-09 23:26:00 +02:00
INTERNAL_RAMDISK_FILES := $( filter $( TARGET_RAMDISK_OUT) /%, \
$( ALL_GENERATED_SOURCES) \
$( ALL_DEFAULT_INSTALLED_MODULES) )
INSTALLED_FILES_FILE_RAMDISK := $( PRODUCT_OUT) /installed-files-ramdisk.txt
INSTALLED_FILES_JSON_RAMDISK := $( INSTALLED_FILES_FILE_RAMDISK:.txt= .json)
$(INSTALLED_FILES_FILE_RAMDISK) : .KATI_IMPLICIT_OUTPUTS := $( INSTALLED_FILES_JSON_RAMDISK )
$(INSTALLED_FILES_FILE_RAMDISK) : $( INTERNAL_RAMDISK_FILES ) $( FILESLIST )
@echo Installed file list: $@
@mkdir -p $( dir $@ )
@rm -f $@
$( hide) $( FILESLIST) $( TARGET_RAMDISK_OUT) > $( @:.txt= .json)
$( hide) build/make/tools/fileslist_util.py -c $( @:.txt= .json) > $@
$( call dist -for -goals , sdk win_sdk sdk_addon , $ ( INSTALLED_FILES_FILE_RAMDISK ) )
2009-04-10 04:31:12 +02:00
BUILT_RAMDISK_TARGET := $( PRODUCT_OUT) /ramdisk.img
# We just build this directly to the install location.
INSTALLED_RAMDISK_TARGET := $( BUILT_RAMDISK_TARGET)
2018-08-09 23:26:00 +02:00
$(INSTALLED_RAMDISK_TARGET) : $( MKBOOTFS ) $( INTERNAL_RAMDISK_FILES ) $( INSTALLED_FILES_FILE_RAMDISK ) | $( MINIGZIP )
2009-03-04 04:28:42 +01:00
$( call pretty," Target ram disk: $@ " )
2018-08-09 23:26:00 +02:00
$( hide) $( MKBOOTFS) -d $( TARGET_OUT) $( TARGET_RAMDISK_OUT) | $( MINIGZIP) > $@
2009-03-04 04:28:42 +01:00
2013-08-09 01:34:29 +02:00
.PHONY : ramdisk -nodeps
ramdisk-nodeps : $( MKBOOTFS ) | $( MINIGZIP )
@echo " make $@ : ignoring dependencies "
2018-08-09 23:26:00 +02:00
$( hide) $( MKBOOTFS) -d $( TARGET_OUT) $( TARGET_RAMDISK_OUT) | $( MINIGZIP) > $( INSTALLED_RAMDISK_TARGET)
2009-03-04 04:28:42 +01:00
Add PRODUCT_BUILD_*_IMAGE, BUILDING_*_IMAGE to control building of images
These centralize the decisions on whether to build certain images or
not, and allow the product definition to override that choice.
There are a few use cases here:
* For GSI-like cases, we only want to build the system image. This
didn't really change, but it's somewhat simpler to configure, and
easier to understand the build logic.
* On the opposite side, when you're planning on using a GSI, the device
specific build can only build the vendor images (or some other set).
* Some cases (Fuchsia, etc) don't want to build any images, as they'll
be distributing the build artifacts in their own packaging.
I suspect in the future, TARGET_BUILD_APPS may be able to be refactored
into the third use case.
Test: treehugger
Test: Create a product definition that includes nothing, try to build it.
Test: compare build-aosp_crosshatch.ninja and build-crosshatch.ninja before/after
Change-Id: I685ab841be3718d3dd7052c28ccd764bb6f1991a
2019-01-16 21:42:05 +01:00
e n d i f # BUILDING_RAMDISK_IMAGE
2017-07-18 19:05:13 +02:00
INSTALLED_BOOTIMAGE_TARGET := $( PRODUCT_OUT) /boot.img
2009-03-04 04:28:42 +01:00
i f n e q ( $( strip $ ( TARGET_NO_KERNEL ) ) , t r u e )
# -----------------------------------------------------------------
# the boot image, which is a collection of other images.
INTERNAL_BOOTIMAGE_ARGS := \
$( addprefix --second ,$( INSTALLED_2NDBOOTLOADER_TARGET) ) \
2015-04-09 00:11:47 +02:00
--kernel $( INSTALLED_KERNEL_TARGET)
2019-01-23 03:08:59 +01:00
i f d e f B O A R D _ I N C L U D E _ D T B _ I N _ B O O T I M G
INTERNAL_BOOTIMAGE_ARGS += --dtb $( INSTALLED_DTBIMAGE_TARGET)
e n d i f
2015-04-09 00:11:47 +02:00
i f n e q ( $( BOARD_BUILD_SYSTEM_ROOT_IMAGE ) , t r u e )
INTERNAL_BOOTIMAGE_ARGS += --ramdisk $( INSTALLED_RAMDISK_TARGET)
e n d i f
2009-03-04 04:28:42 +01:00
INTERNAL_BOOTIMAGE_FILES := $( filter-out --%,$( INTERNAL_BOOTIMAGE_ARGS) )
2009-05-08 04:43:08 +02:00
i f d e f B O A R D _ K E R N E L _ B A S E
INTERNAL_BOOTIMAGE_ARGS += --base $( BOARD_KERNEL_BASE)
e n d i f
2010-08-23 21:56:25 +02:00
i f d e f B O A R D _ K E R N E L _ P A G E S I Z E
INTERNAL_BOOTIMAGE_ARGS += --pagesize $( BOARD_KERNEL_PAGESIZE)
e n d i f
2016-05-27 18:49:49 +02:00
i f e q ( $( PRODUCTS .$ ( INTERNAL_PRODUCT ) .PRODUCT_SUPPORTS_VERITY ) , t r u e )
i f e q ( $( BOARD_BUILD_SYSTEM_ROOT_IMAGE ) , t r u e )
VERITY_KEYID := veritykeyid = id:` openssl x509 -in $( PRODUCTS.$( INTERNAL_PRODUCT) .PRODUCT_VERITY_SIGNING_KEY) .x509.pem -text \
| grep keyid | sed 's/://g' | tr -d '[:space:]' | tr '[:upper:]' '[:lower:]' | sed 's/keyid//g' `
e n d i f
e n d i f
2019-02-26 18:36:30 +01:00
INTERNAL_KERNEL_CMDLINE := $( strip $( INTERNAL_KERNEL_CMDLINE) buildvariant = $( TARGET_BUILD_VARIANT) $( VERITY_KEYID) )
2016-10-06 01:57:27 +02:00
i f d e f I N T E R N A L _ K E R N E L _ C M D L I N E
INTERNAL_BOOTIMAGE_ARGS += --cmdline " $( INTERNAL_KERNEL_CMDLINE) "
2016-05-27 18:49:49 +02:00
e n d i f
2016-03-15 17:49:30 +01:00
INTERNAL_MKBOOTIMG_VERSION_ARGS := \
--os_version $( PLATFORM_VERSION) \
--os_patch_level $( PLATFORM_SECURITY_PATCH)
Update for new Android Verified Boot (AVB).
This updates the build system for the new Android Verified Boot
codebase. As this is based on Brillo Verified Boot, this change replaces
the existing BVB support.
Android Verified Boot is enabled by the BOARD_AVB_ENABLE variable
BOARD_AVB_ENABLE := true
This will make the build system create vbmeta.img which will contain a
hash descriptor for boot.img, a hashtree descriptor for system.img, a
kernel-cmdline descriptor for setting up dm-verity for system.img and
append a hash-tree to system.img.
Additionally, the descriptors are left in boot.img and system.img so a
third party can create their own vbmeta.img file linking - using the
option --chain_partition - to these images. If this is not needed
footers can be erased using the 'avbtool erase_footer' command. It's
also harmless to just leave them in the images.
By default, the algorithm SHA256_RSA4096 is used with a test key from
the AVB source directory. This can be overriden by the
BOARD_AVB_ALGORITHM and BOARD_AVB_KEY_PATH variables to use e.g. a
4096-bit RSA key and SHA-512:
BOARD_AVB_ALGORITHM := SHA512_RSA4096
BOARD_AVB_KEY_PATH := /path/to/rsa_key_4096bits.pem
To prevent rollback attacks, the rollback index should be increased on a
regular basis. The rollback index can be set with the
BOARD_AVB_ROLLBACK_INDEX variable:
BOARD_AVB_ROLLBACK_INDEX := 5
If this is not set, the rollback index defaults to 0.
The variable BOARD_AVB_MAKE_VBMETA_IMAGE_ARGS can be used to specify
additional options passed to 'avbtool make_vbmeta_image'. Typical
options to be used here include '--prop', '--prop_from_file', and
'--chain_partition'.
The variable BOARD_AVBTOOL_BOOT_ADD_HASH_FOOTER_ARGS can be used to
specify additional options passed to 'avbtool add_hash_footer' for
boot.img. Typical options to be used here include '--hash_algorithm' and
'--salt'.
The variable BOARD_AVBTOOL_SYSTEM_ADD_HASHTREE_FOOTER_ARGS can be used
to specify additional options passed to 'avbtool add_hashtree_footer'
for systems.img. Typical options to be used here include
'--hash_algorithm', '--salt', and '--block_size'.
Bug: 31264226
Test: aosp_x86_64-eng 'm' and 'm dist' successful.
Change-Id: Ic9a61cfc65c148b12996e57f04da5432eef6b982
2016-09-28 23:55:27 +02:00
# We build recovery as boot image if BOARD_USES_RECOVERY_AS_BOOT is true.
i f n e q ( $( BOARD_USES_RECOVERY_AS_BOOT ) , t r u e )
i f e q ( $( TARGET_BOOTIMAGE_USE_EXT 2) , t r u e )
$( error TARGET_BOOTIMAGE_USE_EXT 2 is not supported anymore )
e l s e i f e q ( t r u e , $( BOARD_AVB_ENABLE ) ) # TARGET_BOOTIMAGE_USE_EXT2 != true
2016-01-29 22:59:17 +01:00
2017-05-26 12:30:04 +02:00
$(INSTALLED_BOOTIMAGE_TARGET) : $( MKBOOTIMG ) $( AVBTOOL ) $( INTERNAL_BOOTIMAGE_FILES ) $( BOARD_AVB_BOOT_KEY_PATH )
2016-01-29 22:59:17 +01:00
$( call pretty," Target boot image: $@ " )
Update for new Android Verified Boot (AVB).
This updates the build system for the new Android Verified Boot
codebase. As this is based on Brillo Verified Boot, this change replaces
the existing BVB support.
Android Verified Boot is enabled by the BOARD_AVB_ENABLE variable
BOARD_AVB_ENABLE := true
This will make the build system create vbmeta.img which will contain a
hash descriptor for boot.img, a hashtree descriptor for system.img, a
kernel-cmdline descriptor for setting up dm-verity for system.img and
append a hash-tree to system.img.
Additionally, the descriptors are left in boot.img and system.img so a
third party can create their own vbmeta.img file linking - using the
option --chain_partition - to these images. If this is not needed
footers can be erased using the 'avbtool erase_footer' command. It's
also harmless to just leave them in the images.
By default, the algorithm SHA256_RSA4096 is used with a test key from
the AVB source directory. This can be overriden by the
BOARD_AVB_ALGORITHM and BOARD_AVB_KEY_PATH variables to use e.g. a
4096-bit RSA key and SHA-512:
BOARD_AVB_ALGORITHM := SHA512_RSA4096
BOARD_AVB_KEY_PATH := /path/to/rsa_key_4096bits.pem
To prevent rollback attacks, the rollback index should be increased on a
regular basis. The rollback index can be set with the
BOARD_AVB_ROLLBACK_INDEX variable:
BOARD_AVB_ROLLBACK_INDEX := 5
If this is not set, the rollback index defaults to 0.
The variable BOARD_AVB_MAKE_VBMETA_IMAGE_ARGS can be used to specify
additional options passed to 'avbtool make_vbmeta_image'. Typical
options to be used here include '--prop', '--prop_from_file', and
'--chain_partition'.
The variable BOARD_AVBTOOL_BOOT_ADD_HASH_FOOTER_ARGS can be used to
specify additional options passed to 'avbtool add_hash_footer' for
boot.img. Typical options to be used here include '--hash_algorithm' and
'--salt'.
The variable BOARD_AVBTOOL_SYSTEM_ADD_HASHTREE_FOOTER_ARGS can be used
to specify additional options passed to 'avbtool add_hashtree_footer'
for systems.img. Typical options to be used here include
'--hash_algorithm', '--salt', and '--block_size'.
Bug: 31264226
Test: aosp_x86_64-eng 'm' and 'm dist' successful.
Change-Id: Ic9a61cfc65c148b12996e57f04da5432eef6b982
2016-09-28 23:55:27 +02:00
$( hide) $( MKBOOTIMG) $( INTERNAL_BOOTIMAGE_ARGS) $( INTERNAL_MKBOOTIMG_VERSION_ARGS) $( BOARD_MKBOOTIMG_ARGS) --output $@
2017-11-17 08:22:37 +01:00
$( hide) $( call assert-max-image-size,$@ ,$( call get-hash-image-max-size,$( BOARD_BOOTIMAGE_PARTITION_SIZE) ) )
Update for new Android Verified Boot (AVB).
This updates the build system for the new Android Verified Boot
codebase. As this is based on Brillo Verified Boot, this change replaces
the existing BVB support.
Android Verified Boot is enabled by the BOARD_AVB_ENABLE variable
BOARD_AVB_ENABLE := true
This will make the build system create vbmeta.img which will contain a
hash descriptor for boot.img, a hashtree descriptor for system.img, a
kernel-cmdline descriptor for setting up dm-verity for system.img and
append a hash-tree to system.img.
Additionally, the descriptors are left in boot.img and system.img so a
third party can create their own vbmeta.img file linking - using the
option --chain_partition - to these images. If this is not needed
footers can be erased using the 'avbtool erase_footer' command. It's
also harmless to just leave them in the images.
By default, the algorithm SHA256_RSA4096 is used with a test key from
the AVB source directory. This can be overriden by the
BOARD_AVB_ALGORITHM and BOARD_AVB_KEY_PATH variables to use e.g. a
4096-bit RSA key and SHA-512:
BOARD_AVB_ALGORITHM := SHA512_RSA4096
BOARD_AVB_KEY_PATH := /path/to/rsa_key_4096bits.pem
To prevent rollback attacks, the rollback index should be increased on a
regular basis. The rollback index can be set with the
BOARD_AVB_ROLLBACK_INDEX variable:
BOARD_AVB_ROLLBACK_INDEX := 5
If this is not set, the rollback index defaults to 0.
The variable BOARD_AVB_MAKE_VBMETA_IMAGE_ARGS can be used to specify
additional options passed to 'avbtool make_vbmeta_image'. Typical
options to be used here include '--prop', '--prop_from_file', and
'--chain_partition'.
The variable BOARD_AVBTOOL_BOOT_ADD_HASH_FOOTER_ARGS can be used to
specify additional options passed to 'avbtool add_hash_footer' for
boot.img. Typical options to be used here include '--hash_algorithm' and
'--salt'.
The variable BOARD_AVBTOOL_SYSTEM_ADD_HASHTREE_FOOTER_ARGS can be used
to specify additional options passed to 'avbtool add_hashtree_footer'
for systems.img. Typical options to be used here include
'--hash_algorithm', '--salt', and '--block_size'.
Bug: 31264226
Test: aosp_x86_64-eng 'm' and 'm dist' successful.
Change-Id: Ic9a61cfc65c148b12996e57f04da5432eef6b982
2016-09-28 23:55:27 +02:00
$( hide) $( AVBTOOL) add_hash_footer \
--image $@ \
--partition_size $( BOARD_BOOTIMAGE_PARTITION_SIZE) \
2017-05-26 12:30:04 +02:00
--partition_name boot $( INTERNAL_AVB_BOOT_SIGNING_ARGS) \
Update for new Android Verified Boot (AVB).
This updates the build system for the new Android Verified Boot
codebase. As this is based on Brillo Verified Boot, this change replaces
the existing BVB support.
Android Verified Boot is enabled by the BOARD_AVB_ENABLE variable
BOARD_AVB_ENABLE := true
This will make the build system create vbmeta.img which will contain a
hash descriptor for boot.img, a hashtree descriptor for system.img, a
kernel-cmdline descriptor for setting up dm-verity for system.img and
append a hash-tree to system.img.
Additionally, the descriptors are left in boot.img and system.img so a
third party can create their own vbmeta.img file linking - using the
option --chain_partition - to these images. If this is not needed
footers can be erased using the 'avbtool erase_footer' command. It's
also harmless to just leave them in the images.
By default, the algorithm SHA256_RSA4096 is used with a test key from
the AVB source directory. This can be overriden by the
BOARD_AVB_ALGORITHM and BOARD_AVB_KEY_PATH variables to use e.g. a
4096-bit RSA key and SHA-512:
BOARD_AVB_ALGORITHM := SHA512_RSA4096
BOARD_AVB_KEY_PATH := /path/to/rsa_key_4096bits.pem
To prevent rollback attacks, the rollback index should be increased on a
regular basis. The rollback index can be set with the
BOARD_AVB_ROLLBACK_INDEX variable:
BOARD_AVB_ROLLBACK_INDEX := 5
If this is not set, the rollback index defaults to 0.
The variable BOARD_AVB_MAKE_VBMETA_IMAGE_ARGS can be used to specify
additional options passed to 'avbtool make_vbmeta_image'. Typical
options to be used here include '--prop', '--prop_from_file', and
'--chain_partition'.
The variable BOARD_AVBTOOL_BOOT_ADD_HASH_FOOTER_ARGS can be used to
specify additional options passed to 'avbtool add_hash_footer' for
boot.img. Typical options to be used here include '--hash_algorithm' and
'--salt'.
The variable BOARD_AVBTOOL_SYSTEM_ADD_HASHTREE_FOOTER_ARGS can be used
to specify additional options passed to 'avbtool add_hashtree_footer'
for systems.img. Typical options to be used here include
'--hash_algorithm', '--salt', and '--block_size'.
Bug: 31264226
Test: aosp_x86_64-eng 'm' and 'm dist' successful.
Change-Id: Ic9a61cfc65c148b12996e57f04da5432eef6b982
2016-09-28 23:55:27 +02:00
$( BOARD_AVB_BOOT_ADD_HASH_FOOTER_ARGS)
2016-01-29 22:59:17 +01:00
.PHONY : bootimage -nodeps
2017-05-26 12:30:04 +02:00
bootimage-nodeps : $( MKBOOTIMG ) $( AVBTOOL ) $( BOARD_AVB_BOOT_KEY_PATH )
2016-01-29 22:59:17 +01:00
@echo " make $@ : ignoring dependencies "
Update for new Android Verified Boot (AVB).
This updates the build system for the new Android Verified Boot
codebase. As this is based on Brillo Verified Boot, this change replaces
the existing BVB support.
Android Verified Boot is enabled by the BOARD_AVB_ENABLE variable
BOARD_AVB_ENABLE := true
This will make the build system create vbmeta.img which will contain a
hash descriptor for boot.img, a hashtree descriptor for system.img, a
kernel-cmdline descriptor for setting up dm-verity for system.img and
append a hash-tree to system.img.
Additionally, the descriptors are left in boot.img and system.img so a
third party can create their own vbmeta.img file linking - using the
option --chain_partition - to these images. If this is not needed
footers can be erased using the 'avbtool erase_footer' command. It's
also harmless to just leave them in the images.
By default, the algorithm SHA256_RSA4096 is used with a test key from
the AVB source directory. This can be overriden by the
BOARD_AVB_ALGORITHM and BOARD_AVB_KEY_PATH variables to use e.g. a
4096-bit RSA key and SHA-512:
BOARD_AVB_ALGORITHM := SHA512_RSA4096
BOARD_AVB_KEY_PATH := /path/to/rsa_key_4096bits.pem
To prevent rollback attacks, the rollback index should be increased on a
regular basis. The rollback index can be set with the
BOARD_AVB_ROLLBACK_INDEX variable:
BOARD_AVB_ROLLBACK_INDEX := 5
If this is not set, the rollback index defaults to 0.
The variable BOARD_AVB_MAKE_VBMETA_IMAGE_ARGS can be used to specify
additional options passed to 'avbtool make_vbmeta_image'. Typical
options to be used here include '--prop', '--prop_from_file', and
'--chain_partition'.
The variable BOARD_AVBTOOL_BOOT_ADD_HASH_FOOTER_ARGS can be used to
specify additional options passed to 'avbtool add_hash_footer' for
boot.img. Typical options to be used here include '--hash_algorithm' and
'--salt'.
The variable BOARD_AVBTOOL_SYSTEM_ADD_HASHTREE_FOOTER_ARGS can be used
to specify additional options passed to 'avbtool add_hashtree_footer'
for systems.img. Typical options to be used here include
'--hash_algorithm', '--salt', and '--block_size'.
Bug: 31264226
Test: aosp_x86_64-eng 'm' and 'm dist' successful.
Change-Id: Ic9a61cfc65c148b12996e57f04da5432eef6b982
2016-09-28 23:55:27 +02:00
$( hide) $( MKBOOTIMG) $( INTERNAL_BOOTIMAGE_ARGS) $( INTERNAL_MKBOOTIMG_VERSION_ARGS) $( BOARD_MKBOOTIMG_ARGS) --output $( INSTALLED_BOOTIMAGE_TARGET)
2017-11-17 08:22:37 +01:00
$( hide) $( call assert-max-image-size,$( INSTALLED_BOOTIMAGE_TARGET) ,$( call get-hash-image-max-size,$( BOARD_BOOTIMAGE_PARTITION_SIZE) ) )
Update for new Android Verified Boot (AVB).
This updates the build system for the new Android Verified Boot
codebase. As this is based on Brillo Verified Boot, this change replaces
the existing BVB support.
Android Verified Boot is enabled by the BOARD_AVB_ENABLE variable
BOARD_AVB_ENABLE := true
This will make the build system create vbmeta.img which will contain a
hash descriptor for boot.img, a hashtree descriptor for system.img, a
kernel-cmdline descriptor for setting up dm-verity for system.img and
append a hash-tree to system.img.
Additionally, the descriptors are left in boot.img and system.img so a
third party can create their own vbmeta.img file linking - using the
option --chain_partition - to these images. If this is not needed
footers can be erased using the 'avbtool erase_footer' command. It's
also harmless to just leave them in the images.
By default, the algorithm SHA256_RSA4096 is used with a test key from
the AVB source directory. This can be overriden by the
BOARD_AVB_ALGORITHM and BOARD_AVB_KEY_PATH variables to use e.g. a
4096-bit RSA key and SHA-512:
BOARD_AVB_ALGORITHM := SHA512_RSA4096
BOARD_AVB_KEY_PATH := /path/to/rsa_key_4096bits.pem
To prevent rollback attacks, the rollback index should be increased on a
regular basis. The rollback index can be set with the
BOARD_AVB_ROLLBACK_INDEX variable:
BOARD_AVB_ROLLBACK_INDEX := 5
If this is not set, the rollback index defaults to 0.
The variable BOARD_AVB_MAKE_VBMETA_IMAGE_ARGS can be used to specify
additional options passed to 'avbtool make_vbmeta_image'. Typical
options to be used here include '--prop', '--prop_from_file', and
'--chain_partition'.
The variable BOARD_AVBTOOL_BOOT_ADD_HASH_FOOTER_ARGS can be used to
specify additional options passed to 'avbtool add_hash_footer' for
boot.img. Typical options to be used here include '--hash_algorithm' and
'--salt'.
The variable BOARD_AVBTOOL_SYSTEM_ADD_HASHTREE_FOOTER_ARGS can be used
to specify additional options passed to 'avbtool add_hashtree_footer'
for systems.img. Typical options to be used here include
'--hash_algorithm', '--salt', and '--block_size'.
Bug: 31264226
Test: aosp_x86_64-eng 'm' and 'm dist' successful.
Change-Id: Ic9a61cfc65c148b12996e57f04da5432eef6b982
2016-09-28 23:55:27 +02:00
$( hide) $( AVBTOOL) add_hash_footer \
2017-11-17 08:22:37 +01:00
--image $( INSTALLED_BOOTIMAGE_TARGET) \
Update for new Android Verified Boot (AVB).
This updates the build system for the new Android Verified Boot
codebase. As this is based on Brillo Verified Boot, this change replaces
the existing BVB support.
Android Verified Boot is enabled by the BOARD_AVB_ENABLE variable
BOARD_AVB_ENABLE := true
This will make the build system create vbmeta.img which will contain a
hash descriptor for boot.img, a hashtree descriptor for system.img, a
kernel-cmdline descriptor for setting up dm-verity for system.img and
append a hash-tree to system.img.
Additionally, the descriptors are left in boot.img and system.img so a
third party can create their own vbmeta.img file linking - using the
option --chain_partition - to these images. If this is not needed
footers can be erased using the 'avbtool erase_footer' command. It's
also harmless to just leave them in the images.
By default, the algorithm SHA256_RSA4096 is used with a test key from
the AVB source directory. This can be overriden by the
BOARD_AVB_ALGORITHM and BOARD_AVB_KEY_PATH variables to use e.g. a
4096-bit RSA key and SHA-512:
BOARD_AVB_ALGORITHM := SHA512_RSA4096
BOARD_AVB_KEY_PATH := /path/to/rsa_key_4096bits.pem
To prevent rollback attacks, the rollback index should be increased on a
regular basis. The rollback index can be set with the
BOARD_AVB_ROLLBACK_INDEX variable:
BOARD_AVB_ROLLBACK_INDEX := 5
If this is not set, the rollback index defaults to 0.
The variable BOARD_AVB_MAKE_VBMETA_IMAGE_ARGS can be used to specify
additional options passed to 'avbtool make_vbmeta_image'. Typical
options to be used here include '--prop', '--prop_from_file', and
'--chain_partition'.
The variable BOARD_AVBTOOL_BOOT_ADD_HASH_FOOTER_ARGS can be used to
specify additional options passed to 'avbtool add_hash_footer' for
boot.img. Typical options to be used here include '--hash_algorithm' and
'--salt'.
The variable BOARD_AVBTOOL_SYSTEM_ADD_HASHTREE_FOOTER_ARGS can be used
to specify additional options passed to 'avbtool add_hashtree_footer'
for systems.img. Typical options to be used here include
'--hash_algorithm', '--salt', and '--block_size'.
Bug: 31264226
Test: aosp_x86_64-eng 'm' and 'm dist' successful.
Change-Id: Ic9a61cfc65c148b12996e57f04da5432eef6b982
2016-09-28 23:55:27 +02:00
--partition_size $( BOARD_BOOTIMAGE_PARTITION_SIZE) \
2017-05-26 12:30:04 +02:00
--partition_name boot $( INTERNAL_AVB_BOOT_SIGNING_ARGS) \
Update for new Android Verified Boot (AVB).
This updates the build system for the new Android Verified Boot
codebase. As this is based on Brillo Verified Boot, this change replaces
the existing BVB support.
Android Verified Boot is enabled by the BOARD_AVB_ENABLE variable
BOARD_AVB_ENABLE := true
This will make the build system create vbmeta.img which will contain a
hash descriptor for boot.img, a hashtree descriptor for system.img, a
kernel-cmdline descriptor for setting up dm-verity for system.img and
append a hash-tree to system.img.
Additionally, the descriptors are left in boot.img and system.img so a
third party can create their own vbmeta.img file linking - using the
option --chain_partition - to these images. If this is not needed
footers can be erased using the 'avbtool erase_footer' command. It's
also harmless to just leave them in the images.
By default, the algorithm SHA256_RSA4096 is used with a test key from
the AVB source directory. This can be overriden by the
BOARD_AVB_ALGORITHM and BOARD_AVB_KEY_PATH variables to use e.g. a
4096-bit RSA key and SHA-512:
BOARD_AVB_ALGORITHM := SHA512_RSA4096
BOARD_AVB_KEY_PATH := /path/to/rsa_key_4096bits.pem
To prevent rollback attacks, the rollback index should be increased on a
regular basis. The rollback index can be set with the
BOARD_AVB_ROLLBACK_INDEX variable:
BOARD_AVB_ROLLBACK_INDEX := 5
If this is not set, the rollback index defaults to 0.
The variable BOARD_AVB_MAKE_VBMETA_IMAGE_ARGS can be used to specify
additional options passed to 'avbtool make_vbmeta_image'. Typical
options to be used here include '--prop', '--prop_from_file', and
'--chain_partition'.
The variable BOARD_AVBTOOL_BOOT_ADD_HASH_FOOTER_ARGS can be used to
specify additional options passed to 'avbtool add_hash_footer' for
boot.img. Typical options to be used here include '--hash_algorithm' and
'--salt'.
The variable BOARD_AVBTOOL_SYSTEM_ADD_HASHTREE_FOOTER_ARGS can be used
to specify additional options passed to 'avbtool add_hashtree_footer'
for systems.img. Typical options to be used here include
'--hash_algorithm', '--salt', and '--block_size'.
Bug: 31264226
Test: aosp_x86_64-eng 'm' and 'm dist' successful.
Change-Id: Ic9a61cfc65c148b12996e57f04da5432eef6b982
2016-09-28 23:55:27 +02:00
$( BOARD_AVB_BOOT_ADD_HASH_FOOTER_ARGS)
2016-01-29 22:59:17 +01:00
Update for new Android Verified Boot (AVB).
This updates the build system for the new Android Verified Boot
codebase. As this is based on Brillo Verified Boot, this change replaces
the existing BVB support.
Android Verified Boot is enabled by the BOARD_AVB_ENABLE variable
BOARD_AVB_ENABLE := true
This will make the build system create vbmeta.img which will contain a
hash descriptor for boot.img, a hashtree descriptor for system.img, a
kernel-cmdline descriptor for setting up dm-verity for system.img and
append a hash-tree to system.img.
Additionally, the descriptors are left in boot.img and system.img so a
third party can create their own vbmeta.img file linking - using the
option --chain_partition - to these images. If this is not needed
footers can be erased using the 'avbtool erase_footer' command. It's
also harmless to just leave them in the images.
By default, the algorithm SHA256_RSA4096 is used with a test key from
the AVB source directory. This can be overriden by the
BOARD_AVB_ALGORITHM and BOARD_AVB_KEY_PATH variables to use e.g. a
4096-bit RSA key and SHA-512:
BOARD_AVB_ALGORITHM := SHA512_RSA4096
BOARD_AVB_KEY_PATH := /path/to/rsa_key_4096bits.pem
To prevent rollback attacks, the rollback index should be increased on a
regular basis. The rollback index can be set with the
BOARD_AVB_ROLLBACK_INDEX variable:
BOARD_AVB_ROLLBACK_INDEX := 5
If this is not set, the rollback index defaults to 0.
The variable BOARD_AVB_MAKE_VBMETA_IMAGE_ARGS can be used to specify
additional options passed to 'avbtool make_vbmeta_image'. Typical
options to be used here include '--prop', '--prop_from_file', and
'--chain_partition'.
The variable BOARD_AVBTOOL_BOOT_ADD_HASH_FOOTER_ARGS can be used to
specify additional options passed to 'avbtool add_hash_footer' for
boot.img. Typical options to be used here include '--hash_algorithm' and
'--salt'.
The variable BOARD_AVBTOOL_SYSTEM_ADD_HASHTREE_FOOTER_ARGS can be used
to specify additional options passed to 'avbtool add_hashtree_footer'
for systems.img. Typical options to be used here include
'--hash_algorithm', '--salt', and '--block_size'.
Bug: 31264226
Test: aosp_x86_64-eng 'm' and 'm dist' successful.
Change-Id: Ic9a61cfc65c148b12996e57f04da5432eef6b982
2016-09-28 23:55:27 +02:00
e l s e i f e q ( t r u e , $( PRODUCTS .$ ( INTERNAL_PRODUCT ) .PRODUCT_SUPPORTS_BOOT_SIGNER ) ) # BOARD_AVB_ENABLE != true
2014-07-09 05:07:41 +02:00
$(INSTALLED_BOOTIMAGE_TARGET) : $( MKBOOTIMG ) $( INTERNAL_BOOTIMAGE_FILES ) $( BOOT_SIGNER )
$( call pretty," Target boot image: $@ " )
2016-03-15 17:49:30 +01:00
$( hide) $( MKBOOTIMG) $( INTERNAL_BOOTIMAGE_ARGS) $( INTERNAL_MKBOOTIMG_VERSION_ARGS) $( BOARD_MKBOOTIMG_ARGS) --output $@
2014-11-07 05:38:00 +01:00
$( BOOT_SIGNER) /boot $@ $( PRODUCTS.$( INTERNAL_PRODUCT) .PRODUCT_VERITY_SIGNING_KEY) .pk8 $( PRODUCTS.$( INTERNAL_PRODUCT) .PRODUCT_VERITY_SIGNING_KEY) .x509.pem $@
2014-07-09 05:07:41 +02:00
$( hide) $( call assert-max-image-size,$@ ,$( BOARD_BOOTIMAGE_PARTITION_SIZE) )
.PHONY : bootimage -nodeps
bootimage-nodeps : $( MKBOOTIMG ) $( BOOT_SIGNER )
@echo " make $@ : ignoring dependencies "
2016-03-15 17:49:30 +01:00
$( hide) $( MKBOOTIMG) $( INTERNAL_BOOTIMAGE_ARGS) $( INTERNAL_MKBOOTIMG_VERSION_ARGS) $( BOARD_MKBOOTIMG_ARGS) --output $( INSTALLED_BOOTIMAGE_TARGET)
2014-11-07 05:38:00 +01:00
$( BOOT_SIGNER) /boot $( INSTALLED_BOOTIMAGE_TARGET) $( PRODUCTS.$( INTERNAL_PRODUCT) .PRODUCT_VERITY_SIGNING_KEY) .pk8 $( PRODUCTS.$( INTERNAL_PRODUCT) .PRODUCT_VERITY_SIGNING_KEY) .x509.pem $( INSTALLED_BOOTIMAGE_TARGET)
2014-07-09 05:07:41 +02:00
$( hide) $( call assert-max-image-size,$( INSTALLED_BOOTIMAGE_TARGET) ,$( BOARD_BOOTIMAGE_PARTITION_SIZE) )
2015-04-07 16:08:59 +02:00
e l s e i f e q ( t r u e , $( PRODUCTS .$ ( INTERNAL_PRODUCT ) .PRODUCT_SUPPORTS_VBOOT ) ) # PRODUCT_SUPPORTS_BOOT_SIGNER != true
2015-03-03 17:54:11 +01:00
2017-02-23 07:54:39 +01:00
$(INSTALLED_BOOTIMAGE_TARGET) : $( MKBOOTIMG ) $( INTERNAL_BOOTIMAGE_FILES ) $( VBOOT_SIGNER ) $( FUTILITY )
2015-03-03 17:54:11 +01:00
$( call pretty," Target boot image: $@ " )
2016-03-15 17:49:30 +01:00
$( hide) $( MKBOOTIMG) $( INTERNAL_BOOTIMAGE_ARGS) $( INTERNAL_MKBOOTIMG_VERSION_ARGS) $( BOARD_MKBOOTIMG_ARGS) --output $@ .unsigned
2015-08-07 20:58:05 +02:00
$( VBOOT_SIGNER) $( FUTILITY) $@ .unsigned $( PRODUCTS.$( INTERNAL_PRODUCT) .PRODUCT_VBOOT_SIGNING_KEY) .vbpubk $( PRODUCTS.$( INTERNAL_PRODUCT) .PRODUCT_VBOOT_SIGNING_KEY) .vbprivk $( PRODUCTS.$( INTERNAL_PRODUCT) .PRODUCT_VBOOT_SIGNING_SUBKEY) .vbprivk $@ .keyblock $@
2015-03-03 17:54:11 +01:00
$( hide) $( call assert-max-image-size,$@ ,$( BOARD_BOOTIMAGE_PARTITION_SIZE) )
.PHONY : bootimage -nodeps
2017-02-23 07:54:39 +01:00
bootimage-nodeps : $( MKBOOTIMG ) $( VBOOT_SIGNER ) $( FUTILITY )
2015-03-03 17:54:11 +01:00
@echo " make $@ : ignoring dependencies "
2016-03-15 17:49:30 +01:00
$( hide) $( MKBOOTIMG) $( INTERNAL_BOOTIMAGE_ARGS) $( INTERNAL_MKBOOTIMG_VERSION_ARGS) $( BOARD_MKBOOTIMG_ARGS) --output $( INSTALLED_BOOTIMAGE_TARGET) .unsigned
2015-08-07 20:58:05 +02:00
$( VBOOT_SIGNER) $( FUTILITY) $( INSTALLED_BOOTIMAGE_TARGET) .unsigned $( PRODUCTS.$( INTERNAL_PRODUCT) .PRODUCT_VBOOT_SIGNING_KEY) .vbpubk $( PRODUCTS.$( INTERNAL_PRODUCT) .PRODUCT_VBOOT_SIGNING_KEY) .vbprivk $( PRODUCTS.$( INTERNAL_PRODUCT) .PRODUCT_VBOOT_SIGNING_SUBKEY) .vbprivk $( INSTALLED_BOOTIMAGE_TARGET) .keyblock $( INSTALLED_BOOTIMAGE_TARGET)
2015-03-03 17:54:11 +01:00
$( hide) $( call assert-max-image-size,$( INSTALLED_BOOTIMAGE_TARGET) ,$( BOARD_BOOTIMAGE_PARTITION_SIZE) )
e l s e # PRODUCT_SUPPORTS_VBOOT != true
2009-03-04 04:28:42 +01:00
$(INSTALLED_BOOTIMAGE_TARGET) : $( MKBOOTIMG ) $( INTERNAL_BOOTIMAGE_FILES )
$( call pretty," Target boot image: $@ " )
2016-03-15 17:49:30 +01:00
$( hide) $( MKBOOTIMG) $( INTERNAL_BOOTIMAGE_ARGS) $( INTERNAL_MKBOOTIMG_VERSION_ARGS) $( BOARD_MKBOOTIMG_ARGS) --output $@
2014-06-16 23:19:36 +02:00
$( hide) $( call assert-max-image-size,$@ ,$( BOARD_BOOTIMAGE_PARTITION_SIZE) )
2013-08-09 01:34:29 +02:00
.PHONY : bootimage -nodeps
bootimage-nodeps : $( MKBOOTIMG )
@echo " make $@ : ignoring dependencies "
2016-03-15 17:49:30 +01:00
$( hide) $( MKBOOTIMG) $( INTERNAL_BOOTIMAGE_ARGS) $( INTERNAL_MKBOOTIMG_VERSION_ARGS) $( BOARD_MKBOOTIMG_ARGS) --output $( INSTALLED_BOOTIMAGE_TARGET)
2014-06-16 23:19:36 +02:00
$( hide) $( call assert-max-image-size,$( INSTALLED_BOOTIMAGE_TARGET) ,$( BOARD_BOOTIMAGE_PARTITION_SIZE) )
2013-08-09 01:34:29 +02:00
2009-03-04 04:28:42 +01:00
e n d i f # TARGET_BOOTIMAGE_USE_EXT2
2015-11-11 04:21:34 +01:00
e n d i f # BOARD_USES_RECOVERY_AS_BOOT
2009-03-04 04:28:42 +01:00
2018-08-15 01:17:12 +02:00
e l s e # TARGET_NO_KERNEL == "true"
2017-07-18 19:05:13 +02:00
i f d e f B O A R D _ P R E B U I L T _ B O O T I M A G E
i f n e q ( $( BOARD_BUILD_SYSTEM_ROOT_IMAGE ) , t r u e )
# Remove when b/63676296 is resolved.
$( error Prebuilt bootimage is only supported for AB targets )
e n d i f
$( eval $ ( call copy -one -file ,$ ( BOARD_PREBUILT_BOOTIMAGE ) ,$ ( INSTALLED_BOOTIMAGE_TARGET ) ) )
2018-08-15 01:17:12 +02:00
e l s e # BOARD_PREBUILT_BOOTIMAGE not defined
INSTALLED_BOOTIMAGE_TARGET :=
e n d i f # BOARD_PREBUILT_BOOTIMAGE
e n d i f # TARGET_NO_KERNEL
2009-03-04 04:28:42 +01:00
# -----------------------------------------------------------------
# NOTICE files
#
2012-03-01 12:34:41 +01:00
# We are required to publish the licenses for all code under BSD, GPL and
# Apache licenses (and possibly other more exotic ones as well). We err on the
# side of caution, so the licenses for other third-party code are included here
# too.
#
2009-03-04 04:28:42 +01:00
# This needs to be before the systemimage rules, because it adds to
# ALL_DEFAULT_INSTALLED_MODULES, which those use to pick which files
# go into the systemimage.
2012-02-29 20:18:08 +01:00
.PHONY : notice_files
2017-04-19 08:26:47 +02:00
# Create the rule to combine the files into text and html/xml forms
2018-07-09 19:38:38 +02:00
# $(1) - xml_excluded_vendor_product|xml_vendor|xml_product|html
2017-04-19 08:26:47 +02:00
# $(2) - Plain text output file
# $(3) - HTML/XML output file
# $(4) - File title
# $(5) - Directory to use. Notice files are all $(4)/src. Other
2009-03-04 04:28:42 +01:00
# directories in there will be used for scratch
2017-04-19 08:26:47 +02:00
# $(6) - Dependencies for the output files
2009-03-04 04:28:42 +01:00
#
# The algorithm here is that we go collect a hash for each of the notice
# files and write the names of the files that match that hash. Then
# to generate the real files, we go print out all of the files and their
# hashes.
#
# These rules are fairly complex, so they depend on this makefile so if
# it changes, they'll run again.
#
# TODO: We could clean this up so that we just record the locations of the
# original notice files instead of making rules to copy them somwehere.
# Then we could traverse that without quite as much bash drama.
d e f i n e c o m b i n e - n o t i c e - f i l e s
2017-04-19 08:26:47 +02:00
$(2) $(3) : PRIVATE_MESSAGE := $( 4)
$(2) $(3) : PRIVATE_DIR := $( 5)
$(2) : $( 3)
2017-12-06 23:38:40 +01:00
$(3) : $( 6) $( BUILD_SYSTEM ) /Makefile build /make /tools /generate -notice -files .py
build/make/tools/generate-notice-files.py --text-output $( 2) \
2018-11-26 19:12:05 +01:00
$( if $( filter $( 1) ,xml_excluded_extra_partitions) ,-e vendor -e product -e product_services --xml-output, \
$( if $( filter $( 1) ,xml_vendor) ,-i vendor --xml-output, \
$( if $( filter $( 1) ,xml_product) ,-i product --xml-output, \
$( if $( filter $( 1) ,xml_product_services) ,-i product_services --xml-output, \
--html-output) ) ) ) $( 3) \
-t $$ ( PRIVATE_MESSAGE) -s $$ ( PRIVATE_DIR) /src
2017-04-19 08:26:47 +02:00
notice_files : $( 2) $( 3)
2009-03-04 04:28:42 +01:00
e n d e f
2018-11-13 00:29:13 +01:00
# Notice file logic isn't relevant for TARGET_BUILD_APPS
i f n d e f T A R G E T _ B U I L D _ A P P S
2009-03-04 04:28:42 +01:00
# TODO These intermediate NOTICE.txt/NOTICE.html files should go into
# TARGET_OUT_NOTICE_FILES now that the notice files are gathered from
# the src subdirectory.
2012-02-29 20:18:08 +01:00
target_notice_file_txt := $( TARGET_OUT_INTERMEDIATES) /NOTICE.txt
tools_notice_file_txt := $( HOST_OUT_INTERMEDIATES) /NOTICE.txt
2009-03-04 04:28:42 +01:00
tools_notice_file_html := $( HOST_OUT_INTERMEDIATES) /NOTICE.html
2018-11-13 00:29:13 +01:00
kernel_notice_file := $( TARGET_OUT_NOTICE_FILES) /src/kernel.txt
winpthreads_notice_file := $( TARGET_OUT_NOTICE_FILES) /src/winpthreads.txt
pdk_fusion_notice_files := $( filter $( TARGET_OUT_NOTICE_FILES) /%, $( ALL_PDK_FUSION_FILES) )
2009-03-04 04:28:42 +01:00
2017-12-15 23:49:55 +01:00
# TODO(b/69865032): Make PRODUCT_NOTICE_SPLIT the default behavior.
2018-11-13 00:29:13 +01:00
i f n e q ( $( PRODUCT_NOTICE_SPLIT ) , t r u e )
target_notice_file_html := $( TARGET_OUT_INTERMEDIATES) /NOTICE.html
target_notice_file_html_gz := $( TARGET_OUT_INTERMEDIATES) /NOTICE.html.gz
installed_notice_html_or_xml_gz := $( TARGET_OUT) /etc/NOTICE.html.gz
$( eval $ ( call combine -notice -files , html , \
2018-11-26 19:12:05 +01:00
$( target_notice_file_txt) , \
$( target_notice_file_html) , \
"Notices for files contained in the filesystem images in this directory:" , \
$( TARGET_OUT_NOTICE_FILES) , \
$( ALL_DEFAULT_INSTALLED_MODULES) $( kernel_notice_file) $( pdk_fusion_notice_files) ) )
2018-11-13 00:29:13 +01:00
$(target_notice_file_html_gz) : $( target_notice_file_html ) | $( MINIGZIP )
$( hide) $( MINIGZIP) -9 < $< > $@
$(installed_notice_html_or_xml_gz) : $( target_notice_file_html_gz )
$( copy-file-to-target)
e l s e
target_notice_file_xml := $( TARGET_OUT_INTERMEDIATES) /NOTICE.xml
target_notice_file_xml_gz := $( TARGET_OUT_INTERMEDIATES) /NOTICE.xml.gz
2017-04-19 08:26:47 +02:00
installed_notice_html_or_xml_gz := $( TARGET_OUT) /etc/NOTICE.xml.gz
target_vendor_notice_file_txt := $( TARGET_OUT_INTERMEDIATES) /NOTICE_VENDOR.txt
target_vendor_notice_file_xml := $( TARGET_OUT_INTERMEDIATES) /NOTICE_VENDOR.xml
target_vendor_notice_file_xml_gz := $( TARGET_OUT_INTERMEDIATES) /NOTICE_VENDOR.xml.gz
installed_vendor_notice_xml_gz := $( TARGET_OUT_VENDOR) /etc/NOTICE.xml.gz
2018-07-09 19:38:38 +02:00
target_product_notice_file_txt := $( TARGET_OUT_INTERMEDIATES) /NOTICE_PRODUCT.txt
target_product_notice_file_xml := $( TARGET_OUT_INTERMEDIATES) /NOTICE_PRODUCT.xml
target_product_notice_file_xml_gz := $( TARGET_OUT_INTERMEDIATES) /NOTICE_PRODUCT.xml.gz
installed_product_notice_xml_gz := $( TARGET_OUT_PRODUCT) /etc/NOTICE.xml.gz
2018-08-28 19:04:03 +02:00
target_product_services_notice_file_txt := $( TARGET_OUT_INTERMEDIATES) /NOTICE_PRODUCT_SERVICES.txt
target_product_services_notice_file_xml := $( TARGET_OUT_INTERMEDIATES) /NOTICE_PRODUCT_SERVICES.xml
target_product_services_notice_file_xml_gz := $( TARGET_OUT_INTERMEDIATES) /NOTICE_PRODUCT_SERVICES.xml.gz
installed_product_services_notice_xml_gz := $( TARGET_OUT_PRODUCT_SERVICES) /etc/NOTICE.xml.gz
2017-04-19 08:26:47 +02:00
2018-11-13 00:33:47 +01:00
# Notice files are copied to TARGET_OUT_NOTICE_FILES as a side-effect of their module
# being built. A notice xml file must depend on all modules that could potentially
# install a license file relevant to it.
license_modules := $( ALL_DEFAULT_INSTALLED_MODULES) $( kernel_notice_file) $( pdk_fusion_notice_files)
# Phonys/fakes don't have notice files (though their deps might)
license_modules := $( filter-out $( TARGET_OUT_FAKE) /%,$( license_modules) )
license_modules_vendor := $( filter $( TARGET_OUT_VENDOR) /%,$( license_modules) )
license_modules_product := $( filter $( TARGET_OUT_PRODUCT) /%,$( license_modules) )
license_modules_product_services := $( filter $( TARGET_OUT_PRODUCT_SERVICES) /%,$( license_modules) )
license_modules_agg := $( license_modules_vendor) $( license_modules_product) $( license_modules_product_services)
license_modules_rest := $( filter-out $( license_modules_agg) ,$( license_modules) )
2009-03-04 04:28:42 +01:00
2018-08-28 19:04:03 +02:00
$( eval $ ( call combine -notice -files , xml_excluded_extra_partitions , \
2018-11-26 19:12:05 +01:00
$( target_notice_file_txt) , \
$( target_notice_file_xml) , \
"Notices for files contained in the filesystem images in this directory:" , \
$( TARGET_OUT_NOTICE_FILES) , \
$( license_modules_rest) ) )
2017-04-19 08:26:47 +02:00
$( eval $ ( call combine -notice -files , xml_vendor , \
2018-11-26 19:12:05 +01:00
$( target_vendor_notice_file_txt) , \
$( target_vendor_notice_file_xml) , \
"Notices for files contained in the vendor filesystem image in this directory:" , \
$( TARGET_OUT_NOTICE_FILES) , \
$( license_modules_vendor) ) )
2018-07-09 19:38:38 +02:00
$( eval $ ( call combine -notice -files , xml_product , \
2018-11-26 19:12:05 +01:00
$( target_product_notice_file_txt) , \
$( target_product_notice_file_xml) , \
"Notices for files contained in the product filesystem image in this directory:" , \
$( TARGET_OUT_NOTICE_FILES) , \
$( license_modules_product) ) )
2018-08-28 19:04:03 +02:00
$( eval $ ( call combine -notice -files , xml_product_services , \
2018-11-26 19:12:05 +01:00
$( target_product_services_notice_file_txt) , \
$( target_product_services_notice_file_xml) , \
"Notices for files contained in the product_services filesystem image in this directory:" , \
$( TARGET_OUT_NOTICE_FILES) , \
$( license_modules_product_services) ) )
2009-03-04 04:28:42 +01:00
2018-11-13 00:29:13 +01:00
$(target_notice_file_xml_gz) : $( target_notice_file_xml ) | $( MINIGZIP )
2009-06-15 23:30:14 +02:00
$( hide) $( MINIGZIP) -9 < $< > $@
2017-04-19 08:26:47 +02:00
$(target_vendor_notice_file_xml_gz) : $( target_vendor_notice_file_xml ) | $( MINIGZIP )
$( hide) $( MINIGZIP) -9 < $< > $@
2018-07-09 19:38:38 +02:00
$(target_product_notice_file_xml_gz) : $( target_product_notice_file_xml ) | $( MINIGZIP )
$( hide) $( MINIGZIP) -9 < $< > $@
2018-08-28 19:04:03 +02:00
$(target_product_services_notice_file_xml_gz) : $( target_product_services_notice_file_xml ) | $( MINIGZIP )
$( hide) $( MINIGZIP) -9 < $< > $@
2018-11-13 00:29:13 +01:00
$(installed_notice_html_or_xml_gz) : $( target_notice_file_xml_gz )
$( copy-file-to-target)
$(installed_vendor_notice_xml_gz) : $( target_vendor_notice_file_xml_gz )
$( copy-file-to-target)
$(installed_product_notice_xml_gz) : $( target_product_notice_file_xml_gz )
$( copy-file-to-target)
2019-01-28 18:49:00 +01:00
# No notice file for product_services if its contents are merged into /product.
# The notices will be part of the /product notice file.
i f n d e f M E R G E _ P R O D U C T _ S E R V I C E S _ I N T O _ P R O D U C T
2018-08-28 19:04:03 +02:00
$(installed_product_services_notice_xml_gz) : $( target_product_services_notice_file_xml_gz )
$( copy-file-to-target)
2019-01-28 18:49:00 +01:00
e n d i f
2018-08-28 19:04:03 +02:00
2009-04-30 22:52:50 +02:00
# if we've been run my mm, mmm, etc, don't reinstall this every time
i f e q ( $( ONE_SHOT_MAKEFILE ) , )
2017-04-19 08:26:47 +02:00
ALL_DEFAULT_INSTALLED_MODULES += $( installed_notice_html_or_xml_gz)
2018-11-13 00:29:13 +01:00
ALL_DEFAULT_INSTALLED_MODULES += $( installed_vendor_notice_xml_gz)
ALL_DEFAULT_INSTALLED_MODULES += $( installed_product_notice_xml_gz)
ALL_DEFAULT_INSTALLED_MODULES += $( installed_product_services_notice_xml_gz)
2009-04-30 22:52:50 +02:00
e n d i f
2018-11-13 00:29:13 +01:00
e n d i f # PRODUCT_NOTICE_SPLIT
i f e q ( $( ONE_SHOT_MAKEFILE ) , )
ALL_DEFAULT_INSTALLED_MODULES += $( installed_notice_html_or_xml_gz)
e n d i f
$( eval $ ( call combine -notice -files , html , \
2018-11-26 19:12:05 +01:00
$( tools_notice_file_txt) , \
$( tools_notice_file_html) , \
"Notices for files contained in the tools directory:" , \
$( HOST_OUT_NOTICE_FILES) , \
$( ALL_DEFAULT_INSTALLED_MODULES) \
$( winpthreads_notice_file) ) )
2018-11-13 00:29:13 +01:00
2013-08-23 05:02:03 +02:00
e n d i f # TARGET_BUILD_APPS
2009-03-04 04:28:42 +01:00
# The kernel isn't really a module, so to get its module file in there, we
# make the target NOTICE files depend on this particular file too, which will
# then be in the right directory for the find in combine-notice-files to work.
$(kernel_notice_file) : \
2015-11-09 01:28:15 +01:00
$( BUILD_SYSTEM) /LINUX_KERNEL_COPYING \
2009-03-04 04:28:42 +01:00
| $( ACP)
@echo Copying: $@
$( hide) mkdir -p $( dir $@ )
$( hide) $( ACP) $< $@
2017-02-23 22:17:46 +01:00
$(winpthreads_notice_file) : \
$( BUILD_SYSTEM) /WINPTHREADS_COPYING \
| $( ACP)
@echo Copying: $@
$( hide) mkdir -p $( dir $@ )
$( hide) $( ACP) $< $@
2009-03-04 04:28:42 +01:00
2009-06-15 23:30:14 +02:00
# -----------------------------------------------------------------
# Build a keystore with the authorized keys in it, used to verify the
# authenticity of downloaded OTA packages.
#
# This rule adds to ALL_DEFAULT_INSTALLED_MODULES, so it needs to come
# before the rules that use that variable to build the image.
2015-10-29 22:26:18 +01:00
ALL_DEFAULT_INSTALLED_MODULES += $( TARGET_OUT_ETC) /security/otacerts.zip
2018-09-15 06:51:11 +02:00
$(TARGET_OUT_ETC)/security/otacerts.zip : PRIVATE_CERT := $( DEFAULT_KEY_CERT_PAIR ) .x 509.pem
$(TARGET_OUT_ETC)/security/otacerts.zip : $( SOONG_ZIP )
$(TARGET_OUT_ETC)/security/otacerts.zip : $( DEFAULT_KEY_CERT_PAIR ) .x 509.pem
2009-06-15 23:30:14 +02:00
$( hide) rm -f $@
$( hide) mkdir -p $( dir $@ )
2018-09-15 06:51:11 +02:00
$( hide) $( SOONG_ZIP) -o $@ -C $( dir $( PRIVATE_CERT) ) -f $( PRIVATE_CERT)
2009-06-15 23:30:14 +02:00
2017-03-29 05:48:18 +02:00
# Carry the public key for update_engine if it's a non-IoT target that
2016-01-21 05:58:20 +01:00
# uses the AB updater. We use the same key as otacerts but in RSA public key
# format.
i f e q ( $( AB_OTA_UPDATER ) , t r u e )
2017-03-29 05:48:18 +02:00
i f n e q ( $( PRODUCT_IOT ) , t r u e )
2016-01-21 23:28:50 +01:00
ALL_DEFAULT_INSTALLED_MODULES += $( TARGET_OUT_ETC) /update_engine/update-payload-key.pub.pem
2018-09-15 06:51:11 +02:00
$(TARGET_OUT_ETC)/update_engine/update-payload-key.pub.pem : $( DEFAULT_KEY_CERT_PAIR ) .x 509.pem
2016-01-21 05:58:20 +01:00
$( hide) rm -f $@
$( hide) mkdir -p $( dir $@ )
$( hide) openssl x509 -pubkey -noout -in $< > $@
2016-08-04 05:52:54 +02:00
2018-08-18 01:27:01 +02:00
ALL_DEFAULT_INSTALLED_MODULES += \
$( TARGET_RECOVERY_ROOT_OUT) /system/etc/update_engine/update-payload-key.pub.pem
$(TARGET_RECOVERY_ROOT_OUT)/system/etc/update_engine/update-payload-key.pub.pem : \
2018-11-26 19:12:05 +01:00
$( TARGET_OUT_ETC) /update_engine/update-payload-key.pub.pem
2016-08-04 05:52:54 +02:00
$( hide) cp -f $< $@
2016-01-21 05:58:20 +01:00
e n d i f
e n d i f
2009-06-15 23:30:14 +02:00
.PHONY : otacerts
otacerts : $( TARGET_OUT_ETC ) /security /otacerts .zip
2009-03-04 04:28:42 +01:00
# #################################################################
# Targets for user images
# #################################################################
2010-06-16 23:31:34 +02:00
INTERNAL_USERIMAGES_EXT_VARIANT :=
2009-03-04 04:28:42 +01:00
i f e q ( $( TARGET_USERIMAGES_USE_EXT 2) , t r u e )
2010-05-07 11:23:59 +02:00
INTERNAL_USERIMAGES_EXT_VARIANT := ext2
e l s e
i f e q ( $( TARGET_USERIMAGES_USE_EXT 3) , t r u e )
INTERNAL_USERIMAGES_EXT_VARIANT := ext3
e l s e
i f e q ( $( TARGET_USERIMAGES_USE_EXT 4) , t r u e )
INTERNAL_USERIMAGES_EXT_VARIANT := ext4
e n d i f
e n d i f
e n d i f
2014-10-23 05:01:22 +02:00
# These options tell the recovery updater/installer how to mount the partitions writebale.
# <fstype>=<fstype_opts>[|<fstype_opts>]...
# fstype_opts := <opt>[,<opt>]...
# opt := <name>[=<value>]
2014-10-24 01:27:03 +02:00
# The following worked on Nexus devices with Kernel 3.1, 3.4, 3.10
DEFAULT_TARGET_RECOVERY_FSTYPE_MOUNT_OPTIONS := ext4 = max_batch_time = 0,commit= 1,data= ordered,barrier= 1,errors= panic,nodelalloc
2014-10-23 05:01:22 +02:00
2010-11-18 00:40:38 +01:00
i f n e q ( t r u e , $( TARGET_USERIMAGES_SPARSE_EXT_DISABLED ) )
INTERNAL_USERIMAGES_SPARSE_EXT_FLAG := -s
e n d i f
2014-06-16 23:17:40 +02:00
INTERNAL_USERIMAGES_DEPS := $( SIMG2IMG)
2018-10-19 22:44:36 +02:00
INTERNAL_USERIMAGES_DEPS += $( MKEXTUSERIMG) $( MAKE_EXT4FS) $( E2FSCK) $( TUNE2FS)
2014-06-16 23:17:40 +02:00
i f e q ( $( TARGET_USERIMAGES_USE_F 2FS ) , t r u e )
INTERNAL_USERIMAGES_DEPS += $( MKF2FSUSERIMG) $( MAKE_F2FS)
e n d i f
2017-06-21 22:51:46 +02:00
i f e q ( $( BOARD_AVB_ENABLE ) , t r u e )
INTERNAL_USERIMAGES_DEPS += $( AVBTOOL)
e n d i f
2015-12-16 03:00:14 +01:00
i f n e q ( t r u e , $( TARGET_USERIMAGES_SPARSE_SQUASHFS_DISABLED ) )
INTERNAL_USERIMAGES_SPARSE_SQUASHFS_FLAG := -s
e n d i f
2017-11-14 16:42:30 +01:00
i f n e q ( $( filter $ ( BOARD_PRODUCTIMAGE_FILE_SYSTEM_TYPE ) $ ( BOARD_PRODUCT_SERVICESIMAGE_FILE_SYSTEM_TYPE ) $ ( BOARD_ODMIMAGE_FILE_SYSTEM_TYPE ) $ ( BOARD_VENDORIMAGE_FILE_SYSTEM_TYPE ) $ ( BOARD_SYSTEMIMAGE_FILE_SYSTEM_TYPE ) ,squashfs ) , )
2015-06-25 00:42:19 +02:00
INTERNAL_USERIMAGES_DEPS += $( MAKE_SQUASHFS) $( MKSQUASHFSUSERIMG) $( IMG2SIMG)
2015-03-03 21:30:37 +01:00
e n d i f
2011-11-01 02:13:30 +01:00
INTERNAL_USERIMAGES_BINARY_PATHS := $( sort $( dir $( INTERNAL_USERIMAGES_DEPS) ) )
2009-03-04 04:28:42 +01:00
2014-04-29 01:27:32 +02:00
i f e q ( t r u e , $( PRODUCTS .$ ( INTERNAL_PRODUCT ) .PRODUCT_SUPPORTS_VERITY ) )
2018-03-16 07:21:28 +01:00
INTERNAL_USERIMAGES_DEPS += $( BUILD_VERITY_METADATA) $( BUILD_VERITY_TREE) $( APPEND2SIMG) $( VERITY_SIGNER)
2015-05-20 08:30:57 +02:00
i f e q ( t r u e , $( PRODUCTS .$ ( INTERNAL_PRODUCT ) .PRODUCT_SUPPORTS_VERITY_FEC ) )
INTERNAL_USERIMAGES_DEPS += $( FEC)
e n d i f
2013-06-17 02:26:08 +02:00
e n d i f
Add /file_contexts.bin only to devices which need it
/file_contexts.bin is needed only by devices which do not have
PRODUCT_FULL_TREBLE set to true. Adding this file to devices which
have PRODUCT_FULL_TREBLE set to true causes confusion and wastes
about 800 kB of space.
/file_contexts.bin was being added unconditionally to all devices due
to the build system needing the combined file_contexts file for
host-side labelling of filesystems in images and for inclusion into
target files ZIP (again, to be used for host-side labelling later).
This change switches these targets to depend on the same file, but
from intermediates directory. As a result, everything continues to
work just fine, but without pulling in /file_contexts.bin. On devices
which need /file_contexts.bin, it is pulled in by
system/core/init/Android.mk.
Test: /file_contexts.bin still there on bullhead, but not there on
sailfish with PRODUCT_FULL_TREBLE set to true.
Test: Clean build, device boots up with, no new denials.
Reboot to recovery, recovery boots up fine too, no denials.
This was tested on sailfish-eng and marlin-eng.
Bug: 36002414
Change-Id: I9bbbb08bbf7d874bba0bafcc19bcbf9eec564326
2017-03-13 21:28:34 +01:00
SELINUX_FC := $( call intermediates-dir-for,ETC,file_contexts.bin) /file_contexts.bin
2012-11-21 19:47:00 +01:00
INTERNAL_USERIMAGES_DEPS += $( SELINUX_FC)
2016-03-03 06:07:23 +01:00
INTERNAL_USERIMAGES_DEPS += $( BLK_ALLOC_TO_BASE_FS)
2017-03-11 01:53:45 +01:00
INTERNAL_USERIMAGES_DEPS += $( MKE2FS_CONF)
2018-11-09 19:27:23 +01:00
i f e q ( t r u e , $( PRODUCT_USE_DYNAMIC_PARTITIONS ) )
2018-06-19 01:32:35 +02:00
i f e q ( $( PRODUCTS .$ ( INTERNAL_PRODUCT ) .PRODUCT_SUPPORTS_VERITY ) , t r u e )
$( error vboot 1.0 doesn' t support logical partition)
e n d i f
# TODO(b/80195851): Should not define BOARD_AVB_SYSTEM_KEY_PATH without
# BOARD_AVB_SYSTEM_DETACHED_VBMETA.
2018-11-09 19:27:23 +01:00
e n d i f # PRODUCT_USE_DYNAMIC_PARTITIONS
2018-06-19 01:32:35 +02:00
2011-10-29 02:02:30 +02:00
# $(1): the path of the output dictionary file
2017-11-14 16:42:30 +01:00
# $(2): a subset of "system vendor cache userdata product product_services oem odm"
2018-05-30 20:16:46 +02:00
# $(3): additional "key=value" pairs to append to the dictionary file.
d e f i n e g e n e r a t e - i m a g e - p r o p - d i c t i o n a r y
$( if $ ( filter $ ( 2) ,system ) ,\
$( if $( BOARD_SYSTEMIMAGE_PARTITION_SIZE) ,$( hide) echo " system_size= $( BOARD_SYSTEMIMAGE_PARTITION_SIZE) " >> $( 1) )
2019-01-29 06:30:18 +01:00
$( if $( INTERNAL_SYSTEM_OTHER_PARTITION_SIZE) ,$( hide) echo " system_other_size= $( INTERNAL_SYSTEM_OTHER_PARTITION_SIZE) " >> $( 1) )
2018-05-30 20:16:46 +02:00
$( if $( BOARD_SYSTEMIMAGE_FILE_SYSTEM_TYPE) ,$( hide) echo " system_fs_type= $( BOARD_SYSTEMIMAGE_FILE_SYSTEM_TYPE) " >> $( 1) )
$( if $( BOARD_SYSTEMIMAGE_EXTFS_INODE_COUNT) ,$( hide) echo " system_extfs_inode_count= $( BOARD_SYSTEMIMAGE_EXTFS_INODE_COUNT) " >> $( 1) )
$( if $( BOARD_SYSTEMIMAGE_EXTFS_RSV_PCT) ,$( hide) echo " system_extfs_rsv_pct= $( BOARD_SYSTEMIMAGE_EXTFS_RSV_PCT) " >> $( 1) )
$( if $( BOARD_SYSTEMIMAGE_JOURNAL_SIZE) ,$( hide) echo " system_journal_size= $( BOARD_SYSTEMIMAGE_JOURNAL_SIZE) " >> $( 1) )
$( if $( BOARD_SYSTEMIMAGE_SQUASHFS_COMPRESSOR) ,$( hide) echo " system_squashfs_compressor= $( BOARD_SYSTEMIMAGE_SQUASHFS_COMPRESSOR) " >> $( 1) )
$( if $( BOARD_SYSTEMIMAGE_SQUASHFS_COMPRESSOR_OPT) ,$( hide) echo " system_squashfs_compressor_opt= $( BOARD_SYSTEMIMAGE_SQUASHFS_COMPRESSOR_OPT) " >> $( 1) )
$( if $( BOARD_SYSTEMIMAGE_SQUASHFS_BLOCK_SIZE) ,$( hide) echo " system_squashfs_block_size= $( BOARD_SYSTEMIMAGE_SQUASHFS_BLOCK_SIZE) " >> $( 1) )
$( if $( BOARD_SYSTEMIMAGE_SQUASHFS_DISABLE_4K_ALIGN) ,$( hide) echo " system_squashfs_disable_4k_align= $( BOARD_SYSTEMIMAGE_SQUASHFS_DISABLE_4K_ALIGN) " >> $( 1) )
$( if $( PRODUCTS.$( INTERNAL_PRODUCT) .PRODUCT_SYSTEM_BASE_FS_PATH) ,$( hide) echo " system_base_fs_file= $( PRODUCTS.$( INTERNAL_PRODUCT) .PRODUCT_SYSTEM_BASE_FS_PATH) " >> $( 1) )
$( if $( PRODUCTS.$( INTERNAL_PRODUCT) .PRODUCT_SYSTEM_HEADROOM) ,$( hide) echo " system_headroom= $( PRODUCTS.$( INTERNAL_PRODUCT) .PRODUCT_SYSTEM_HEADROOM) " >> $( 1) )
2018-06-19 01:32:35 +02:00
$( if $( BOARD_SYSTEMIMAGE_PARTITION_RESERVED_SIZE) ,$( hide) echo " system_reserved_size= $( BOARD_SYSTEMIMAGE_PARTITION_RESERVED_SIZE) " >> $( 1) )
2018-05-30 20:16:46 +02:00
)
$( if $ ( filter $ ( 2) ,userdata ) ,\
$( if $( BOARD_USERDATAIMAGE_FILE_SYSTEM_TYPE) ,$( hide) echo " userdata_fs_type= $( BOARD_USERDATAIMAGE_FILE_SYSTEM_TYPE) " >> $( 1) )
$( if $( BOARD_USERDATAIMAGE_PARTITION_SIZE) ,$( hide) echo " userdata_size= $( BOARD_USERDATAIMAGE_PARTITION_SIZE) " >> $( 1) )
)
$( if $ ( filter $ ( 2) ,cache ) ,\
$( if $( BOARD_CACHEIMAGE_FILE_SYSTEM_TYPE) ,$( hide) echo " cache_fs_type= $( BOARD_CACHEIMAGE_FILE_SYSTEM_TYPE) " >> $( 1) )
$( if $( BOARD_CACHEIMAGE_PARTITION_SIZE) ,$( hide) echo " cache_size= $( BOARD_CACHEIMAGE_PARTITION_SIZE) " >> $( 1) )
)
$( if $ ( filter $ ( 2) ,vendor ) ,\
$( if $( BOARD_VENDORIMAGE_FILE_SYSTEM_TYPE) ,$( hide) echo " vendor_fs_type= $( BOARD_VENDORIMAGE_FILE_SYSTEM_TYPE) " >> $( 1) )
$( if $( BOARD_VENDORIMAGE_EXTFS_INODE_COUNT) ,$( hide) echo " vendor_extfs_inode_count= $( BOARD_VENDORIMAGE_EXTFS_INODE_COUNT) " >> $( 1) )
$( if $( BOARD_VENDORIMAGE_EXTFS_RSV_PCT) ,$( hide) echo " vendor_extfs_rsv_pct= $( BOARD_VENDORIMAGE_EXTFS_RSV_PCT) " >> $( 1) )
$( if $( BOARD_VENDORIMAGE_PARTITION_SIZE) ,$( hide) echo " vendor_size= $( BOARD_VENDORIMAGE_PARTITION_SIZE) " >> $( 1) )
$( if $( BOARD_VENDORIMAGE_JOURNAL_SIZE) ,$( hide) echo " vendor_journal_size= $( BOARD_VENDORIMAGE_JOURNAL_SIZE) " >> $( 1) )
$( if $( BOARD_VENDORIMAGE_SQUASHFS_COMPRESSOR) ,$( hide) echo " vendor_squashfs_compressor= $( BOARD_VENDORIMAGE_SQUASHFS_COMPRESSOR) " >> $( 1) )
$( if $( BOARD_VENDORIMAGE_SQUASHFS_COMPRESSOR_OPT) ,$( hide) echo " vendor_squashfs_compressor_opt= $( BOARD_VENDORIMAGE_SQUASHFS_COMPRESSOR_OPT) " >> $( 1) )
$( if $( BOARD_VENDORIMAGE_SQUASHFS_BLOCK_SIZE) ,$( hide) echo " vendor_squashfs_block_size= $( BOARD_VENDORIMAGE_SQUASHFS_BLOCK_SIZE) " >> $( 1) )
$( if $( BOARD_VENDORIMAGE_SQUASHFS_DISABLE_4K_ALIGN) ,$( hide) echo " vendor_squashfs_disable_4k_align= $( BOARD_VENDORIMAGE_SQUASHFS_DISABLE_4K_ALIGN) " >> $( 1) )
$( if $( PRODUCTS.$( INTERNAL_PRODUCT) .PRODUCT_VENDOR_BASE_FS_PATH) ,$( hide) echo " vendor_base_fs_file= $( PRODUCTS.$( INTERNAL_PRODUCT) .PRODUCT_VENDOR_BASE_FS_PATH) " >> $( 1) )
2018-06-20 01:23:16 +02:00
$( if $( BOARD_VENDORIMAGE_PARTITION_RESERVED_SIZE) ,$( hide) echo " vendor_reserved_size= $( BOARD_VENDORIMAGE_PARTITION_RESERVED_SIZE) " >> $( 1) )
2018-05-30 20:16:46 +02:00
)
$( if $ ( filter $ ( 2) ,product ) ,\
$( if $( BOARD_PRODUCTIMAGE_FILE_SYSTEM_TYPE) ,$( hide) echo " product_fs_type= $( BOARD_PRODUCTIMAGE_FILE_SYSTEM_TYPE) " >> $( 1) )
$( if $( BOARD_PRODUCTIMAGE_EXTFS_INODE_COUNT) ,$( hide) echo " product_extfs_inode_count= $( BOARD_PRODUCTIMAGE_EXTFS_INODE_COUNT) " >> $( 1) )
$( if $( BOARD_PRODUCTIMAGE_EXTFS_RSV_PCT) ,$( hide) echo " product_extfs_rsv_pct= $( BOARD_PRODUCTIMAGE_EXTFS_RSV_PCT) " >> $( 1) )
$( if $( BOARD_PRODUCTIMAGE_PARTITION_SIZE) ,$( hide) echo " product_size= $( BOARD_PRODUCTIMAGE_PARTITION_SIZE) " >> $( 1) )
$( if $( BOARD_PRODUCTIMAGE_JOURNAL_SIZE) ,$( hide) echo " product_journal_size= $( BOARD_PRODUCTIMAGE_JOURNAL_SIZE) " >> $( 1) )
$( if $( BOARD_PRODUCTIMAGE_SQUASHFS_COMPRESSOR) ,$( hide) echo " product_squashfs_compressor= $( BOARD_PRODUCTIMAGE_SQUASHFS_COMPRESSOR) " >> $( 1) )
$( if $( BOARD_PRODUCTIMAGE_SQUASHFS_COMPRESSOR_OPT) ,$( hide) echo " product_squashfs_compressor_opt= $( BOARD_PRODUCTIMAGE_SQUASHFS_COMPRESSOR_OPT) " >> $( 1) )
$( if $( BOARD_PRODUCTIMAGE_SQUASHFS_BLOCK_SIZE) ,$( hide) echo " product_squashfs_block_size= $( BOARD_PRODUCTIMAGE_SQUASHFS_BLOCK_SIZE) " >> $( 1) )
$( if $( BOARD_PRODUCTIMAGE_SQUASHFS_DISABLE_4K_ALIGN) ,$( hide) echo " product_squashfs_disable_4k_align= $( BOARD_PRODUCTIMAGE_SQUASHFS_DISABLE_4K_ALIGN) " >> $( 1) )
$( if $( PRODUCTS.$( INTERNAL_PRODUCT) .PRODUCT_PRODUCT_BASE_FS_PATH) ,$( hide) echo " product_base_fs_file= $( PRODUCTS.$( INTERNAL_PRODUCT) .PRODUCT_PRODUCT_BASE_FS_PATH) " >> $( 1) )
2018-07-21 00:19:34 +02:00
$( if $( BOARD_PRODUCTIMAGE_PARTITION_RESERVED_SIZE) ,$( hide) echo " product_reserved_size= $( BOARD_PRODUCTIMAGE_PARTITION_RESERVED_SIZE) " >> $( 1) )
2018-05-30 20:16:46 +02:00
)
2018-07-27 01:02:52 +02:00
$( if $ ( filter $ ( 2) ,product_services ) ,\
$( if $( BOARD_PRODUCT_SERVICESIMAGE_FILE_SYSTEM_TYPE) ,$( hide) echo " product_services_fs_type= $( BOARD_PRODUCT_SERVICESIMAGE_FILE_SYSTEM_TYPE) " >> $( 1) )
$( if $( BOARD_PRODUCT_SERVICESIMAGE_EXTFS_INODE_COUNT) ,$( hide) echo " product_services_extfs_inode_count= $( BOARD_PRODUCT_SERVICESIMAGE_EXTFS_INODE_COUNT) " >> $( 1) )
$( if $( BOARD_PRODUCT_SERVICESIMAGE_EXTFS_RSV_PCT) ,$( hide) echo " product_services_extfs_rsv_pct= $( BOARD_PRODUCT_SERVICESIMAGE_EXTFS_RSV_PCT) " >> $( 1) )
$( if $( BOARD_PRODUCT_SERVICESIMAGE_PARTITION_SIZE) ,$( hide) echo " product_services_size= $( BOARD_PRODUCT_SERVICESIMAGE_PARTITION_SIZE) " >> $( 1) )
$( if $( BOARD_PRODUCT_SERVICESIMAGE_JOURNAL_SIZE) ,$( hide) echo " product_services_journal_size= $( BOARD_PRODUCT_SERVICESIMAGE_JOURNAL_SIZE) " >> $( 1) )
$( if $( BOARD_PRODUCT_SERVICESIMAGE_SQUASHFS_COMPRESSOR) ,$( hide) echo " product_services_squashfs_compressor= $( BOARD_PRODUCT_SERVICESIMAGE_SQUASHFS_COMPRESSOR) " >> $( 1) )
$( if $( BOARD_PRODUCT_SERVICESIMAGE_SQUASHFS_COMPRESSOR_OPT) ,$( hide) echo " product_services_squashfs_compressor_opt= $( BOARD_PRODUCT_SERVICESIMAGE_SQUASHFS_COMPRESSOR_OPT) " >> $( 1) )
$( if $( BOARD_PRODUCT_SERVICESIMAGE_SQUASHFS_BLOCK_SIZE) ,$( hide) echo " product_services_squashfs_block_size= $( BOARD_PRODUCT_SERVICESIMAGE_SQUASHFS_BLOCK_SIZE) " >> $( 1) )
$( if $( BOARD_PRODUCT_SERVICESIMAGE_SQUASHFS_DISABLE_4K_ALIGN) ,$( hide) echo " product_services_squashfs_disable_4k_align= $( BOARD_PRODUCT_SERVICESIMAGE_SQUASHFS_DISABLE_4K_ALIGN) " >> $( 1) )
$( if $( BOARD_PRODUCT_SERVICESIMAGE_PARTITION_RESERVED_SIZE) ,$( hide) echo " product_services_reserved_size= $( BOARD_PRODUCT_SERVICESIMAGE_PARTITION_RESERVED_SIZE) " >> $( 1) )
2018-05-29 14:09:01 +02:00
)
2017-11-14 16:42:30 +01:00
$( if $ ( filter $ ( 2) ,odm ) ,\
$( if $( BOARD_ODMIMAGE_FILE_SYSTEM_TYPE) ,$( hide) echo " odm_fs_type= $( BOARD_ODMIMAGE_FILE_SYSTEM_TYPE) " >> $( 1) )
$( if $( BOARD_ODMIMAGE_EXTFS_INODE_COUNT) ,$( hide) echo " odm_extfs_inode_count= $( BOARD_ODMIMAGE_EXTFS_INODE_COUNT) " >> $( 1) )
$( if $( BOARD_ODMIMAGE_EXTFS_RSV_PCT) ,$( hide) echo " odm_extfs_rsv_pct= $( BOARD_ODMIMAGE_EXTFS_RSV_PCT) " >> $( 1) )
$( if $( BOARD_ODMIMAGE_PARTITION_SIZE) ,$( hide) echo " odm_size= $( BOARD_ODMIMAGE_PARTITION_SIZE) " >> $( 1) )
$( if $( BOARD_ODMIMAGE_JOURNAL_SIZE) ,$( hide) echo " odm_journal_size= $( BOARD_ODMIMAGE_JOURNAL_SIZE) " >> $( 1) )
$( if $( BOARD_ODMIMAGE_SQUASHFS_COMPRESSOR) ,$( hide) echo " odm_squashfs_compressor= $( BOARD_ODMIMAGE_SQUASHFS_COMPRESSOR) " >> $( 1) )
$( if $( BOARD_ODMIMAGE_SQUASHFS_COMPRESSOR_OPT) ,$( hide) echo " odm_squashfs_compressor_opt= $( BOARD_ODMIMAGE_SQUASHFS_COMPRESSOR_OPT) " >> $( 1) )
$( if $( BOARD_ODMIMAGE_SQUASHFS_BLOCK_SIZE) ,$( hide) echo " odm_squashfs_block_size= $( BOARD_ODMIMAGE_SQUASHFS_BLOCK_SIZE) " >> $( 1) )
$( if $( BOARD_ODMIMAGE_SQUASHFS_DISABLE_4K_ALIGN) ,$( hide) echo " odm_squashfs_disable_4k_align= $( BOARD_ODMIMAGE_SQUASHFS_DISABLE_4K_ALIGN) " >> $( 1) )
$( if $( PRODUCTS.$( INTERNAL_PRODUCT) .PRODUCT_ODM_BASE_FS_PATH) ,$( hide) echo " odm_base_fs_file= $( PRODUCTS.$( INTERNAL_PRODUCT) .PRODUCT_ODM_BASE_FS_PATH) " >> $( 1) )
$( if $( BOARD_ODMIMAGE_PARTITION_RESERVED_SIZE) ,$( hide) echo " odm_reserved_size= $( BOARD_ODMIMAGE_PARTITION_RESERVED_SIZE) " >> $( 1) )
)
2018-05-30 20:16:46 +02:00
$( if $ ( filter $ ( 2) ,oem ) ,\
$( if $( BOARD_OEMIMAGE_PARTITION_SIZE) ,$( hide) echo " oem_size= $( BOARD_OEMIMAGE_PARTITION_SIZE) " >> $( 1) )
$( if $( BOARD_OEMIMAGE_JOURNAL_SIZE) ,$( hide) echo " oem_journal_size= $( BOARD_OEMIMAGE_JOURNAL_SIZE) " >> $( 1) )
$( if $( BOARD_OEMIMAGE_EXTFS_INODE_COUNT) ,$( hide) echo " oem_extfs_inode_count= $( BOARD_OEMIMAGE_EXTFS_INODE_COUNT) " >> $( 1) )
$( if $( BOARD_OEMIMAGE_EXTFS_RSV_PCT) ,$( hide) echo " oem_extfs_rsv_pct= $( BOARD_OEMIMAGE_EXTFS_RSV_PCT) " >> $( 1) )
)
2018-07-10 19:53:55 +02:00
$( hide ) e c h o "ext_mkuserimg=$(notdir $(MKEXTUSERIMG))" > > $( 1)
2017-11-14 16:42:30 +01:00
2018-07-10 19:53:55 +02:00
$( if $ ( INTERNAL_USERIMAGES_EXT_VARIANT ) ,$ ( hide ) echo "fs_type =$ ( INTERNAL_USERIMAGES_EXT_VARIANT ) " >> $ ( 1) )
2011-10-29 02:02:30 +02:00
$( if $ ( INTERNAL_USERIMAGES_SPARSE_EXT_FLAG ) ,$ ( hide ) echo "extfs_sparse_flag =$ ( INTERNAL_USERIMAGES_SPARSE_EXT_FLAG ) " >> $ ( 1) )
2015-12-16 03:00:14 +01:00
$( if $ ( INTERNAL_USERIMAGES_SPARSE_SQUASHFS_FLAG ) ,$ ( hide ) echo "squashfs_sparse_flag =$ ( INTERNAL_USERIMAGES_SPARSE_SQUASHFS_FLAG ) " >> $ ( 1) )
2018-07-10 19:53:55 +02:00
$( if $ ( BOARD_EXT 4_SHARE_DUP_BLOCKS ) ,$ ( hide ) echo "ext 4_share_dup_blocks =$ ( BOARD_EXT 4_SHARE_DUP_BLOCKS ) " >> $ ( 1) )
$( if $ ( BOARD_FLASH_LOGICAL_BLOCK_SIZE ) , $ ( hide ) echo "flash_logical_block_size =$ ( BOARD_FLASH_LOGICAL_BLOCK_SIZE ) " >> $ ( 1) )
$( if $ ( BOARD_FLASH_ERASE_BLOCK_SIZE ) , $ ( hide ) echo "flash_erase_block_size =$ ( BOARD_FLASH_ERASE_BLOCK_SIZE ) " >> $ ( 1) )
2012-11-21 19:47:00 +01:00
$( hide ) e c h o "selinux_fc=$(SELINUX_FC)" > > $( 1)
2015-04-07 16:08:59 +02:00
$( if $ ( PRODUCTS .$ ( INTERNAL_PRODUCT ) .PRODUCT_SUPPORTS_BOOT_SIGNER ) ,$ ( hide ) echo "boot_signer =$ ( PRODUCTS .$ ( INTERNAL_PRODUCT ) .PRODUCT_SUPPORTS_BOOT_SIGNER ) " >> $ ( 1) )
2014-07-11 00:42:38 +02:00
$( if $ ( PRODUCTS .$ ( INTERNAL_PRODUCT ) .PRODUCT_SUPPORTS_VERITY ) ,$ ( hide ) echo "verity =$ ( PRODUCTS .$ ( INTERNAL_PRODUCT ) .PRODUCT_SUPPORTS_VERITY ) " >> $ ( 1) )
2014-11-14 02:54:30 +01:00
$( if $ ( PRODUCTS .$ ( INTERNAL_PRODUCT ) .PRODUCT_SUPPORTS_VERITY ) ,$ ( hide ) echo "verity_key =$ ( PRODUCTS .$ ( INTERNAL_PRODUCT ) .PRODUCT_VERITY_SIGNING_KEY ) " >> $ ( 1) )
2015-06-02 11:03:27 +02:00
$( if $ ( PRODUCTS .$ ( INTERNAL_PRODUCT ) .PRODUCT_SUPPORTS_VERITY ) ,$ ( hide ) echo "verity_signer_cmd =$ ( notdir $ ( VERITY_SIGNER ) ) " >> $ ( 1) )
2015-05-20 08:30:57 +02:00
$( if $ ( PRODUCTS .$ ( INTERNAL_PRODUCT ) .PRODUCT_SUPPORTS_VERITY_FEC ) ,$ ( hide ) echo "verity_fec =$ ( PRODUCTS .$ ( INTERNAL_PRODUCT ) .PRODUCT_SUPPORTS_VERITY_FEC ) " >> $ ( 1) )
2017-10-11 10:21:48 +02:00
$( if $ ( filter eng , $ ( TARGET_BUILD_VARIANT ) ) ,$ ( hide ) echo "verity_disable =true " >> $ ( 1) )
2014-07-11 00:42:38 +02:00
$( if $ ( PRODUCTS .$ ( INTERNAL_PRODUCT ) .PRODUCT_SYSTEM_VERITY_PARTITION ) ,$ ( hide ) echo "system_verity_block_device =$ ( PRODUCTS .$ ( INTERNAL_PRODUCT ) .PRODUCT_SYSTEM_VERITY_PARTITION ) " >> $ ( 1) )
$( if $ ( PRODUCTS .$ ( INTERNAL_PRODUCT ) .PRODUCT_VENDOR_VERITY_PARTITION ) ,$ ( hide ) echo "vendor_verity_block_device =$ ( PRODUCTS .$ ( INTERNAL_PRODUCT ) .PRODUCT_VENDOR_VERITY_PARTITION ) " >> $ ( 1) )
2017-11-27 09:04:47 +01:00
$( if $ ( PRODUCTS .$ ( INTERNAL_PRODUCT ) .PRODUCT_PRODUCT_VERITY_PARTITION ) ,$ ( hide ) echo "product_verity_block_device =$ ( PRODUCTS .$ ( INTERNAL_PRODUCT ) .PRODUCT_PRODUCT_VERITY_PARTITION ) " >> $ ( 1) )
2018-07-27 01:02:52 +02:00
$( if $ ( PRODUCTS .$ ( INTERNAL_PRODUCT ) .PRODUCT_PRODUCT_SERVICES_VERITY_PARTITION ) ,$ ( hide ) echo "product_services_verity_block_device =$ ( PRODUCTS .$ ( INTERNAL_PRODUCT ) .PRODUCT_PRODUCT_SERVICES_VERITY_PARTITION ) " >> $ ( 1) )
2015-03-30 08:07:41 +02:00
$( if $ ( PRODUCTS .$ ( INTERNAL_PRODUCT ) .PRODUCT_SUPPORTS_VBOOT ) ,$ ( hide ) echo "vboot =$ ( PRODUCTS .$ ( INTERNAL_PRODUCT ) .PRODUCT_SUPPORTS_VBOOT ) " >> $ ( 1) )
$( if $ ( PRODUCTS .$ ( INTERNAL_PRODUCT ) .PRODUCT_SUPPORTS_VBOOT ) ,$ ( hide ) echo "vboot_key =$ ( PRODUCTS .$ ( INTERNAL_PRODUCT ) .PRODUCT_VBOOT_SIGNING_KEY ) " >> $ ( 1) )
2015-08-07 20:58:05 +02:00
$( if $ ( PRODUCTS .$ ( INTERNAL_PRODUCT ) .PRODUCT_SUPPORTS_VBOOT ) ,$ ( hide ) echo "vboot_subkey =$ ( PRODUCTS .$ ( INTERNAL_PRODUCT ) .PRODUCT_VBOOT_SIGNING_SUBKEY ) " >> $ ( 1) )
2017-02-23 20:03:45 +01:00
$( if $ ( PRODUCTS .$ ( INTERNAL_PRODUCT ) .PRODUCT_SUPPORTS_VBOOT ) ,$ ( hide ) echo "futility =$ ( notdir $ ( FUTILITY ) ) " >> $ ( 1) )
2015-03-30 08:07:41 +02:00
$( if $ ( PRODUCTS .$ ( INTERNAL_PRODUCT ) .PRODUCT_SUPPORTS_VBOOT ) ,$ ( hide ) echo "vboot_signer_cmd =$ ( VBOOT_SIGNER ) " >> $ ( 1) )
2017-05-17 01:27:25 +02:00
$( if $ ( BOARD_AVB_ENABLE ) ,$ ( hide ) echo "avb_avbtool =$ ( notdir $ ( AVBTOOL ) ) " >> $ ( 1) )
2017-05-26 12:30:04 +02:00
$( if $ ( BOARD_AVB_ENABLE ) ,$ ( hide ) echo "avb_system_hashtree_enable =$ ( BOARD_AVB_ENABLE ) " >> $ ( 1) )
$( if $ ( BOARD_AVB_ENABLE ) ,$ ( hide ) echo "avb_system_add_hashtree_footer_args =$ ( BOARD_AVB_SYSTEM_ADD_HASHTREE_FOOTER_ARGS ) " >> $ ( 1) )
$( if $ ( BOARD_AVB_ENABLE ) ,\
$( if $( BOARD_AVB_SYSTEM_KEY_PATH) ,\
$( hide) echo " avb_system_key_path= $( BOARD_AVB_SYSTEM_KEY_PATH) " >> $( 1)
$( hide) echo " avb_system_algorithm= $( BOARD_AVB_SYSTEM_ALGORITHM) " >> $( 1)
$( hide) echo " avb_system_rollback_index_location= $( BOARD_AVB_SYSTEM_ROLLBACK_INDEX_LOCATION) " >> $( 1) ) )
2019-01-23 15:19:19 +01:00
$( if $ ( BOARD_AVB_ENABLE ) ,$ ( hide ) echo "avb_system_other_hashtree_enable =$ ( BOARD_AVB_ENABLE ) " >> $ ( 1) )
$( if $ ( BOARD_AVB_ENABLE ) ,$ ( hide ) echo "avb_system_other_add_hashtree_footer_args =$ ( BOARD_AVB_SYSTEM_OTHER_ADD_HASHTREE_FOOTER_ARGS ) " >> $ ( 1) )
$( if $ ( BOARD_AVB_ENABLE ) ,\
$( if $( BOARD_AVB_SYSTEM_OTHER_KEY_PATH) ,\
$( hide) echo " avb_system_other_key_path= $( BOARD_AVB_SYSTEM_OTHER_KEY_PATH) " >> $( 1)
2019-01-30 07:53:57 +01:00
$( hide) echo " avb_system_other_algorithm= $( BOARD_AVB_SYSTEM_OTHER_ALGORITHM) " >> $( 1)
$( hide) echo "avb_system_extract_system_other_key=true" >> $( 1) ) )
2017-05-26 12:30:04 +02:00
$( if $ ( BOARD_AVB_ENABLE ) ,$ ( hide ) echo "avb_vendor_hashtree_enable =$ ( BOARD_AVB_ENABLE ) " >> $ ( 1) )
$( if $ ( BOARD_AVB_ENABLE ) ,$ ( hide ) echo "avb_vendor_add_hashtree_footer_args =$ ( BOARD_AVB_VENDOR_ADD_HASHTREE_FOOTER_ARGS ) " >> $ ( 1) )
$( if $ ( BOARD_AVB_ENABLE ) ,\
$( if $( BOARD_AVB_VENDOR_KEY_PATH) ,\
$( hide) echo " avb_vendor_key_path= $( BOARD_AVB_VENDOR_KEY_PATH) " >> $( 1)
$( hide) echo " avb_vendor_algorithm= $( BOARD_AVB_VENDOR_ALGORITHM) " >> $( 1)
$( hide) echo " avb_vendor_rollback_index_location= $( BOARD_AVB_VENDOR_ROLLBACK_INDEX_LOCATION) " >> $( 1) ) )
2017-11-27 09:04:47 +01:00
$( if $ ( BOARD_AVB_ENABLE ) ,$ ( hide ) echo "avb_product_hashtree_enable =$ ( BOARD_AVB_ENABLE ) " >> $ ( 1) )
$( if $ ( BOARD_AVB_ENABLE ) ,$ ( hide ) echo "avb_product_add_hashtree_footer_args =$ ( BOARD_AVB_PRODUCT_ADD_HASHTREE_FOOTER_ARGS ) " >> $ ( 1) )
$( if $ ( BOARD_AVB_ENABLE ) ,\
$( if $( BOARD_AVB_PRODUCT_KEY_PATH) ,\
$( hide) echo " avb_product_key_path= $( BOARD_AVB_PRODUCT_KEY_PATH) " >> $( 1)
$( hide) echo " avb_product_algorithm= $( BOARD_AVB_PRODUCT_ALGORITHM) " >> $( 1)
$( hide) echo " avb_product_rollback_index_location= $( BOARD_AVB_PRODUCT_ROLLBACK_INDEX_LOCATION) " >> $( 1) ) )
2018-08-02 02:21:14 +02:00
$( if $ ( BOARD_AVB_ENABLE ) ,$ ( hide ) echo "avb_product_services_hashtree_enable =$ ( BOARD_AVB_ENABLE ) " >> $ ( 1) )
$( if $ ( BOARD_AVB_ENABLE ) ,\
$( hide) echo " avb_product_services_add_hashtree_footer_args= $( BOARD_AVB_PRODUCT_SERVICES_ADD_HASHTREE_FOOTER_ARGS) " >> $( 1) )
2018-05-29 14:09:01 +02:00
$( if $ ( BOARD_AVB_ENABLE ) ,\
$( if $( BOARD_AVB_PRODUCT_SERVICES_KEY_PATH) ,\
2018-07-27 01:02:52 +02:00
$( hide) echo " avb_product_services_key_path= $( BOARD_AVB_PRODUCT_SERVICES_KEY_PATH) " >> $( 1)
$( hide) echo " avb_product_services_algorithm= $( BOARD_AVB_PRODUCT_SERVICES_ALGORITHM) " >> $( 1)
$( hide) echo " avb_product_services_rollback_index_location= $( BOARD_AVB_PRODUCT_SERVICES_ROLLBACK_INDEX_LOCATION) " >> $( 1) ) )
2017-11-14 16:42:30 +01:00
$( if $ ( BOARD_AVB_ENABLE ) ,$ ( hide ) echo "avb_odm_hashtree_enable =$ ( BOARD_AVB_ENABLE ) " >> $ ( 1) )
$( if $ ( BOARD_AVB_ENABLE ) ,$ ( hide ) echo "avb_odm_add_hashtree_footer_args =$ ( BOARD_AVB_ODM_ADD_HASHTREE_FOOTER_ARGS ) " >> $ ( 1) )
$( if $ ( BOARD_AVB_ENABLE ) ,\
$( if $( BOARD_AVB_ODM_KEY_PATH) ,\
$( hide) echo " avb_odm_key_path= $( BOARD_AVB_ODM_KEY_PATH) " >> $( 1)
$( hide) echo " avb_odm_algorithm= $( BOARD_AVB_ODM_ALGORITHM) " >> $( 1)
$( hide) echo " avb_odm_rollback_index_location= $( BOARD_AVB_ODM_ROLLBACK_INDEX_LOCATION) " >> $( 1) ) )
2015-11-11 04:21:34 +01:00
$( if $ ( filter true ,$ ( BOARD_USES_RECOVERY_AS_BOOT ) ) ,\
$( hide) echo "recovery_as_boot=true" >> $( 1) )
2015-03-25 03:07:40 +01:00
$( if $ ( filter true ,$ ( BOARD_BUILD_SYSTEM_ROOT_IMAGE ) ) ,\
2018-08-09 23:26:00 +02:00
$( hide) echo "system_root_image=true" >> $( 1) )
$( hide ) e c h o "root_dir=$(TARGET_ROOT_OUT)" > > $( 1)
2018-07-31 21:47:27 +02:00
$( if $ ( PRODUCT_USE_DYNAMIC_PARTITION_SIZE ) ,$ ( hide ) echo "use_dynamic_partition_size =true " >> $ ( 1) )
2018-05-30 20:16:46 +02:00
$( if $ ( 3) ,$ ( hide ) $ ( foreach kv ,$ ( 3) ,echo "$ ( kv ) " >> $ ( 1) ;) )
e n d e f
# $(1): the path of the output dictionary file
# $(2): additional "key=value" pairs to append to the dictionary file.
d e f i n e g e n e r a t e - u s e r i m a g e - p r o p - d i c t i o n a r y
2017-11-14 16:42:30 +01:00
$( call generate -image -prop -dictionary ,$ ( 1) ,system vendor cache userdata product product_services oem odm ,$ ( 2) )
2011-10-29 02:02:30 +02:00
e n d e f
2018-06-19 01:32:35 +02:00
# $(1): the path of the input dictionary file, where each line has the format key=value
# $(2): the key to look up
d e f i n e r e a d - i m a g e - p r o p - d i c t i o n a r y
$$ ( g r e p '$(2)=' $( 1) | c u t - f 2 - - d '=' )
e n d e f
2017-07-06 08:34:31 +02:00
# $(1): modules list
# $(2): output dir
# $(3): mount point
# $(4): staging dir
# Depmod requires a well-formed kernel version so 0.0 is used as a placeholder.
d e f i n e b u i l d - i m a g e - k e r n e l - m o d u l e s
$( hide) rm -rf $( 2) /lib/modules
$( hide) mkdir -p $( 2) /lib/modules
$( hide) cp $( 1) $( 2) /lib/modules/
$( hide) rm -rf $( 4)
$( hide) mkdir -p $( 4) /lib/modules/0.0/$( 3) lib/modules
$( hide) cp $( 1) $( 4) /lib/modules/0.0/$( 3) lib/modules
$( hide) $( DEPMOD) -b $( 4) 0.0
$( hide) sed -e 's/\(.*modules.*\):/\/\1:/g' -e 's/ \([^ ]*modules[^ ]*\)/ \/\1/g' $( 4) /lib/modules/0.0/modules.dep > $( 2) /lib/modules/modules.dep
$( hide) cp $( 4) /lib/modules/0.0/modules.alias $( 2) /lib/modules
e n d e f
2009-07-02 18:00:54 +02:00
# -----------------------------------------------------------------
# Recovery image
2009-07-08 02:14:25 +02:00
2015-11-11 04:21:34 +01:00
# Recovery image exists if we are building recovery, or building recovery as boot.
i f n e q ( , $( INSTALLED_RECOVERYIMAGE_TARGET ) $( filter true ,$ ( BOARD_USES_RECOVERY_AS_BOOT ) ) )
2009-07-02 18:00:54 +02:00
2015-03-10 20:02:57 +01:00
INTERNAL_RECOVERYIMAGE_FILES := $( filter $( TARGET_RECOVERY_OUT) /%, \
$( ALL_DEFAULT_INSTALLED_MODULES) )
2018-08-14 21:17:48 +02:00
INSTALLED_FILES_FILE_RECOVERY := $( PRODUCT_OUT) /installed-files-recovery.txt
INSTALLED_FILES_JSON_RECOVERY := $( INSTALLED_FILES_FILE_RECOVERY:.txt= .json)
# TODO(b/30414428): Can't depend on INTERNAL_RECOVERYIMAGE_FILES alone like other
# INSTALLED_FILES_FILE_* rules. Because currently there're cp/rsync/rm commands in
# build-recoveryimage-target, which would touch the files under TARGET_RECOVERY_OUT and race with
# the call to FILELIST.
i f e q ( $( BOARD_USES_RECOVERY_AS_BOOT ) , t r u e )
$(INSTALLED_FILES_FILE_RECOVERY) : $( INSTALLED_BOOTIMAGE_TARGET )
e l s e
$(INSTALLED_FILES_FILE_RECOVERY) : $( INSTALLED_RECOVERYIMAGE_TARGET )
e n d i f
$(INSTALLED_FILES_FILE_RECOVERY) : .KATI_IMPLICIT_OUTPUTS := $( INSTALLED_FILES_JSON_RECOVERY )
$(INSTALLED_FILES_FILE_RECOVERY) : $( INTERNAL_RECOVERYIMAGE_FILES ) $( FILESLIST )
@echo Installed file list: $@
@mkdir -p $( dir $@ )
@rm -f $@
$( hide) $( FILESLIST) $( TARGET_RECOVERY_ROOT_OUT) > $( @:.txt= .json)
$( hide) build/make/tools/fileslist_util.py -c $( @:.txt= .json) > $@
2009-07-02 18:00:54 +02:00
recovery_initrc := $( call include-path-for, recovery) /etc/init.rc
2017-03-10 21:53:02 +01:00
recovery_sepolicy := \
$( TARGET_RECOVERY_ROOT_OUT) /sepolicy \
2017-06-13 17:30:46 +02:00
$( TARGET_RECOVERY_ROOT_OUT) /plat_file_contexts \
2018-02-05 10:32:20 +01:00
$( TARGET_RECOVERY_ROOT_OUT) /vendor_file_contexts \
2017-03-10 21:53:02 +01:00
$( TARGET_RECOVERY_ROOT_OUT) /plat_property_contexts \
2018-02-05 10:32:20 +01:00
$( TARGET_RECOVERY_ROOT_OUT) /vendor_property_contexts
2017-11-30 15:15:17 +01:00
i f d e f B O A R D _ O D M _ S E P O L I C Y _ D I R S
recovery_sepolicy += \
$( TARGET_RECOVERY_ROOT_OUT) /odm_file_contexts \
$( TARGET_RECOVERY_ROOT_OUT) /odm_property_contexts
e n d i f
2017-03-10 21:53:02 +01:00
# Passed into rsync from non-recovery root to recovery root, to avoid overwriting recovery-specific
# SELinux files
IGNORE_RECOVERY_SEPOLICY := $( patsubst $( TARGET_RECOVERY_OUT) /%,--exclude= /%,$( recovery_sepolicy) )
2009-07-02 18:00:54 +02:00
recovery_kernel := $( INSTALLED_KERNEL_TARGET) # same as a non-recovery system
recovery_ramdisk := $( PRODUCT_OUT) /ramdisk-recovery.img
recovery_resources_common := $( call include-path-for, recovery) /res
2013-03-07 00:04:31 +01:00
Map numeric dpi value to density bucket for recovery resources.
When choosing the density for recovery resources, the code used to
handle primary density values only, i.e. mdpi, hdpi, xhdpi, 400dpi,
xxhdpi, 560dpi and xxxhdpi. Unlisted values, such as 500dpi, will be
categorized as xhdpi, but with tiny font size selected for recovery.
This CL improves the handling of numeric dpi values. It allows targets
using numeric values in PRODUCT_AAPT_PREF_CONFIG, and maps that to a
proper density bucket. Targets can still specify the density bucket
directly, which will take priority.
Bug: 111559919
Test: `m -j bootimage` with marlin/sailfish/walleye/taimen respectively.
Check the chosen density bucket for recovery resources
(xxxhdpi/xxhdpi/xxhdpi/xxxhdpi).
Test: Set PRODUCT_AAPT_PREF_CONFIG to 279/280/281/500/559/560/640. Check
the computed bucket and the selected recovery font file.
Change-Id: Ia40fcdec5a2752c08172716bcc622a36a2a83cea
2018-08-30 05:36:00 +02:00
# Set recovery_density to a density bucket based on PRODUCT_AAPT_PREF_CONFIG if set. Otherwise use
# the default medium density.
2014-05-13 00:32:20 +02:00
i f n e q ( , $( PRODUCT_AAPT_PREF_CONFIG ) )
Map numeric dpi value to density bucket for recovery resources.
When choosing the density for recovery resources, the code used to
handle primary density values only, i.e. mdpi, hdpi, xhdpi, 400dpi,
xxhdpi, 560dpi and xxxhdpi. Unlisted values, such as 500dpi, will be
categorized as xhdpi, but with tiny font size selected for recovery.
This CL improves the handling of numeric dpi values. It allows targets
using numeric values in PRODUCT_AAPT_PREF_CONFIG, and maps that to a
proper density bucket. Targets can still specify the density bucket
directly, which will take priority.
Bug: 111559919
Test: `m -j bootimage` with marlin/sailfish/walleye/taimen respectively.
Check the chosen density bucket for recovery resources
(xxxhdpi/xxhdpi/xxhdpi/xxxhdpi).
Test: Set PRODUCT_AAPT_PREF_CONFIG to 279/280/281/500/559/560/640. Check
the computed bucket and the selected recovery font file.
Change-Id: Ia40fcdec5a2752c08172716bcc622a36a2a83cea
2018-08-30 05:36:00 +02:00
# If PRODUCT_AAPT_PREF_CONFIG includes a non-numeric dpi bucket, always perfer that value.
2014-05-13 00:32:20 +02:00
recovery_density := $( filter %dpi,$( PRODUCT_AAPT_PREF_CONFIG) )
Map numeric dpi value to density bucket for recovery resources.
When choosing the density for recovery resources, the code used to
handle primary density values only, i.e. mdpi, hdpi, xhdpi, 400dpi,
xxhdpi, 560dpi and xxxhdpi. Unlisted values, such as 500dpi, will be
categorized as xhdpi, but with tiny font size selected for recovery.
This CL improves the handling of numeric dpi values. It allows targets
using numeric values in PRODUCT_AAPT_PREF_CONFIG, and maps that to a
proper density bucket. Targets can still specify the density bucket
directly, which will take priority.
Bug: 111559919
Test: `m -j bootimage` with marlin/sailfish/walleye/taimen respectively.
Check the chosen density bucket for recovery resources
(xxxhdpi/xxhdpi/xxhdpi/xxxhdpi).
Test: Set PRODUCT_AAPT_PREF_CONFIG to 279/280/281/500/559/560/640. Check
the computed bucket and the selected recovery font file.
Change-Id: Ia40fcdec5a2752c08172716bcc622a36a2a83cea
2018-08-30 05:36:00 +02:00
i f e q ( , $( filter xxxhdpi xxhdpi xhdpi hdpi mdpi ,$ ( recovery_density ) ) )
recovery_density_value := $( patsubst %dpi,%,$( recovery_density) )
# Map the numeric dpi value to a bucket. We roughly use the medium point between the primary
# densities to split buckets.
# ------160------240------320----------480------------640------
# mdpi hdpi xhdpi xxhdpi xxxhdpi
recovery_density := $( strip \
$( or $( if $( filter $( shell echo $$ ( ( $( recovery_density_value) >= 560) ) ) ,1) ,xxxhdpi) ,\
$( if $( filter $( shell echo $$ ( ( $( recovery_density_value) >= 400) ) ) ,1) ,xxhdpi) ,\
$( if $( filter $( shell echo $$ ( ( $( recovery_density_value) >= 280) ) ) ,1) ,xhdpi) ,\
$( if $( filter $( shell echo $$ ( ( $( recovery_density_value) >= 200) ) ) ,1) ,hdpi,mdpi) ) )
e n d i f
e l s e # PRODUCT_AAPT_PREF_CONFIG is empty
recovery_density := mdpi
e n d i f # PRODUCT_AAPT_PREF_CONFIG
2014-05-13 00:32:20 +02:00
i f n e q ( , $( wildcard $ ( recovery_resources_common ) -$ ( recovery_density ) ) )
recovery_resources_common := $( recovery_resources_common) -$( recovery_density)
2014-04-04 22:51:15 +02:00
e l s e
recovery_resources_common := $( recovery_resources_common) -xhdpi
e n d i f
Map numeric dpi value to density bucket for recovery resources.
When choosing the density for recovery resources, the code used to
handle primary density values only, i.e. mdpi, hdpi, xhdpi, 400dpi,
xxhdpi, 560dpi and xxxhdpi. Unlisted values, such as 500dpi, will be
categorized as xhdpi, but with tiny font size selected for recovery.
This CL improves the handling of numeric dpi values. It allows targets
using numeric values in PRODUCT_AAPT_PREF_CONFIG, and maps that to a
proper density bucket. Targets can still specify the density bucket
directly, which will take priority.
Bug: 111559919
Test: `m -j bootimage` with marlin/sailfish/walleye/taimen respectively.
Check the chosen density bucket for recovery resources
(xxxhdpi/xxhdpi/xxhdpi/xxxhdpi).
Test: Set PRODUCT_AAPT_PREF_CONFIG to 279/280/281/500/559/560/640. Check
the computed bucket and the selected recovery font file.
Change-Id: Ia40fcdec5a2752c08172716bcc622a36a2a83cea
2018-08-30 05:36:00 +02:00
# Select the 18x32 font on high-density devices (xhdpi and up); and the 12x22 font on other devices.
# Note that the font selected here can be overridden for a particular device by putting a font.png
# in its private recovery resources.
i f n e q ( , $( filter xxxhdpi xxhdpi xhdpi ,$ ( recovery_density ) ) )
2013-03-07 00:04:31 +01:00
recovery_font := $( call include-path-for, recovery) /fonts/18x32.png
e l s e
recovery_font := $( call include-path-for, recovery) /fonts/12x22.png
e n d i f
2018-11-07 20:36:19 +01:00
# We will only generate the recovery background text images if the variable
# TARGET_RECOVERY_UI_SCREEN_WIDTH is defined. For devices with xxxhdpi and xxhdpi, we set the
# variable to the commonly used values here, if it hasn't been intialized elsewhere. While for
# devices with lower density, they must have TARGET_RECOVERY_UI_SCREEN_WIDTH defined in their
# BoardConfig in order to use this feature.
i f e q ( $( recovery_density ) , x x x h d p i )
TARGET_RECOVERY_UI_SCREEN_WIDTH ?= 1440
e l s e i f e q ( $( recovery_density ) , x x h d p i )
TARGET_RECOVERY_UI_SCREEN_WIDTH ?= 1080
e n d i f
i f n e q ( $( TARGET_RECOVERY_UI_SCREEN_WIDTH ) , )
# Subtracts the margin width and menu indent from the screen width; it's safe to be conservative.
i f e q ( $( TARGET_RECOVERY_UI_MARGIN_WIDTH ) , )
recovery_image_width := $$ ( ( $( TARGET_RECOVERY_UI_SCREEN_WIDTH) - 10) )
e l s e
recovery_image_width := $$ ( ( $( TARGET_RECOVERY_UI_SCREEN_WIDTH) - $( TARGET_RECOVERY_UI_MARGIN_WIDTH) - 10) )
e n d i f
RECOVERY_INSTALLING_TEXT_FILE := $( call intermediates-dir-for,PACKAGING,recovery_text_res) /installing_text.png
RECOVERY_INSTALLING_SECURITY_TEXT_FILE := $( dir $( RECOVERY_INSTALLING_TEXT_FILE) ) /installing_security_text.png
RECOVERY_ERASING_TEXT_FILE := $( dir $( RECOVERY_INSTALLING_TEXT_FILE) ) /erasing_text.png
RECOVERY_ERROR_TEXT_FILE := $( dir $( RECOVERY_INSTALLING_TEXT_FILE) ) /error_text.png
RECOVERY_NO_COMMAND_TEXT_FILE := $( dir $( RECOVERY_INSTALLING_TEXT_FILE) ) /no_command_text.png
2018-12-07 21:12:17 +01:00
RECOVERY_CANCEL_WIPE_DATA_TEXT_FILE := $( dir $( RECOVERY_INSTALLING_TEXT_FILE) ) /cancel_wipe_data_text.png
RECOVERY_FACTORY_DATA_RESET_TEXT_FILE := $( dir $( RECOVERY_INSTALLING_TEXT_FILE) ) /factory_data_reset_text.png
RECOVERY_TRY_AGAIN_TEXT_FILE := $( dir $( RECOVERY_INSTALLING_TEXT_FILE) ) /try_again_text.png
RECOVERY_WIPE_DATA_CONFIRMATION_TEXT_FILE := $( dir $( RECOVERY_INSTALLING_TEXT_FILE) ) /wipe_data_confirmation_text.png
RECOVERY_WIPE_DATA_MENU_HEADER_TEXT_FILE := $( dir $( RECOVERY_INSTALLING_TEXT_FILE) ) /wipe_data_menu_header_text.png
generated_recovery_text_files := \
2018-11-07 20:36:19 +01:00
$( RECOVERY_INSTALLING_TEXT_FILE) \
$( RECOVERY_INSTALLING_SECURITY_TEXT_FILE) \
$( RECOVERY_ERASING_TEXT_FILE) \
$( RECOVERY_ERROR_TEXT_FILE) \
2018-12-07 21:12:17 +01:00
$( RECOVERY_NO_COMMAND_TEXT_FILE) \
$( RECOVERY_CANCEL_WIPE_DATA_TEXT_FILE) \
$( RECOVERY_FACTORY_DATA_RESET_TEXT_FILE) \
$( RECOVERY_TRY_AGAIN_TEXT_FILE) \
$( RECOVERY_WIPE_DATA_CONFIRMATION_TEXT_FILE) \
$( RECOVERY_WIPE_DATA_MENU_HEADER_TEXT_FILE)
2018-11-07 20:36:19 +01:00
resource_dir := $( call include-path-for, recovery) /tools/recovery_l10n/res/
image_generator_jar := $( HOST_OUT_JAVA_LIBRARIES) /RecoveryImageGenerator.jar
2018-12-07 21:12:17 +01:00
zopflipng := $( HOST_OUT_EXECUTABLES) /zopflipng
2018-11-07 20:36:19 +01:00
$(RECOVERY_INSTALLING_TEXT_FILE) : PRIVATE_SOURCE_FONTS := $( recovery_noto -fonts_dep ) $( recovery_roboto -fonts_dep )
$(RECOVERY_INSTALLING_TEXT_FILE) : PRIVATE_RECOVERY_FONT_FILES_DIR := $( call intermediates -dir -for ,PACKAGING ,recovery_font_files )
$(RECOVERY_INSTALLING_TEXT_FILE) : PRIVATE_RESOURCE_DIR := $( resource_dir )
$(RECOVERY_INSTALLING_TEXT_FILE) : PRIVATE_IMAGE_GENERATOR_JAR := $( image_generator_jar )
2018-12-07 21:12:17 +01:00
$(RECOVERY_INSTALLING_TEXT_FILE) : PRIVATE_ZOPFLIPNG := $( zopflipng )
2018-11-07 20:36:19 +01:00
$(RECOVERY_INSTALLING_TEXT_FILE) : PRIVATE_RECOVERY_IMAGE_WIDTH := $( recovery_image_width )
2018-12-20 02:15:14 +01:00
$(RECOVERY_INSTALLING_TEXT_FILE) : PRIVATE_RECOVERY_BACKGROUND_TEXT_LIST := \
2018-12-07 21:12:17 +01:00
recovery_installing \
recovery_installing_security \
recovery_erasing \
recovery_error \
2018-12-20 02:15:14 +01:00
recovery_no_command
$(RECOVERY_INSTALLING_TEXT_FILE) : PRIVATE_RECOVERY_WIPE_DATA_TEXT_LIST := \
2018-12-07 21:12:17 +01:00
recovery_cancel_wipe_data \
recovery_factory_data_reset \
recovery_try_again \
recovery_wipe_data_menu_header \
recovery_wipe_data_confirmation
$(RECOVERY_INSTALLING_TEXT_FILE) : .KATI_IMPLICIT_OUTPUTS := $( filter -out $ ( RECOVERY_INSTALLING_TEXT_FILE ) ,$ ( generated_recovery_text_files ) )
$(RECOVERY_INSTALLING_TEXT_FILE) : $( image_generator_jar ) $( resource_dir ) $( recovery_noto -fonts_dep ) $( recovery_roboto -fonts_dep ) $( zopflipng )
2018-11-07 20:36:19 +01:00
# Prepares the font directory.
@rm -rf $( PRIVATE_RECOVERY_FONT_FILES_DIR)
@mkdir -p $( PRIVATE_RECOVERY_FONT_FILES_DIR)
2018-12-07 21:12:17 +01:00
$( foreach filename,$( PRIVATE_SOURCE_FONTS) , cp $( filename) $( PRIVATE_RECOVERY_FONT_FILES_DIR) && ) true
2018-11-07 20:36:19 +01:00
@rm -rf $( dir $@ )
@mkdir -p $( dir $@ )
2018-12-20 02:15:14 +01:00
$( foreach text_name,$( PRIVATE_RECOVERY_BACKGROUND_TEXT_LIST) $( PRIVATE_RECOVERY_WIPE_DATA_TEXT_LIST) , \
2018-12-07 21:12:17 +01:00
$( eval output_file := $( dir $@ ) /$( patsubst recovery_%,%_text.png,$( text_name) ) ) \
2018-12-20 02:15:14 +01:00
$( eval center_alignment := $( if $( filter $( text_name) ,$( PRIVATE_RECOVERY_BACKGROUND_TEXT_LIST) ) , --center_alignment) ) \
2018-11-07 20:36:19 +01:00
java -jar $( PRIVATE_IMAGE_GENERATOR_JAR) \
--image_width $( PRIVATE_RECOVERY_IMAGE_WIDTH) \
--text_name $( text_name) \
--font_dir $( PRIVATE_RECOVERY_FONT_FILES_DIR) \
--resource_dir $( PRIVATE_RESOURCE_DIR) \
2018-12-20 02:15:14 +01:00
--output_file $( output_file) $( center_alignment) && \
2018-12-07 21:12:17 +01:00
$( PRIVATE_ZOPFLIPNG) -y --iterations= 1 --filters= 0 $( output_file) $( output_file) > /dev/null && ) true
2018-11-07 20:36:19 +01:00
e l s e
RECOVERY_INSTALLING_TEXT_FILE :=
RECOVERY_INSTALLING_SECURITY_TEXT_FILE :=
RECOVERY_ERASING_TEXT_FILE :=
RECOVERY_ERROR_TEXT_FILE :=
RECOVERY_NO_COMMAND_TEXT_FILE :=
2018-12-07 21:12:17 +01:00
RECOVERY_CANCEL_WIPE_DATA_TEXT_FILE :=
RECOVERY_FACTORY_DATA_RESET_TEXT_FILE :=
RECOVERY_TRY_AGAIN_TEXT_FILE :=
RECOVERY_WIPE_DATA_CONFIRMATION_TEXT_FILE :=
RECOVERY_WIPE_DATA_MENU_HEADER_TEXT_FILE :=
2018-11-07 20:36:19 +01:00
e n d i f # TARGET_RECOVERY_UI_SCREEN_WIDTH
2015-08-06 20:47:47 +02:00
i f n d e f T A R G E T _ P R I V A T E _ R E S _ D I R S
TARGET_PRIVATE_RES_DIRS := $( wildcard $( TARGET_DEVICE_DIR) /recovery/res)
e n d i f
2009-07-02 18:00:54 +02:00
recovery_resource_deps := $( shell find $( recovery_resources_common) \
2015-08-06 20:47:47 +02:00
$( TARGET_PRIVATE_RES_DIRS) -type f)
2018-12-07 21:12:17 +01:00
recovery_resource_deps += $( generated_recovery_text_files)
2018-11-07 20:36:19 +01:00
2012-09-28 18:33:45 +02:00
i f d e f T A R G E T _ R E C O V E R Y _ F S T A B
recovery_fstab := $( TARGET_RECOVERY_FSTAB)
e l s e
2010-09-21 03:04:41 +02:00
recovery_fstab := $( strip $( wildcard $( TARGET_DEVICE_DIR) /recovery.fstab) )
2012-09-28 18:33:45 +02:00
e n d i f
2016-06-10 19:11:54 +02:00
i f d e f T A R G E T _ R E C O V E R Y _ W I P E
recovery_wipe := $( TARGET_RECOVERY_WIPE)
2016-06-01 08:56:23 +02:00
e l s e
2016-06-10 19:11:54 +02:00
recovery_wipe :=
2016-06-01 08:56:23 +02:00
e n d i f
2015-07-22 21:33:18 +02:00
2018-03-10 02:04:42 +01:00
# Traditionally with non-A/B OTA we have:
2015-11-11 04:21:34 +01:00
# boot.img + recovery-from-boot.p + recovery-resource.dat = recovery.img.
2018-03-10 02:04:42 +01:00
# recovery-resource.dat is needed only if we carry an imgdiff patch of the boot and recovery images
# and invoke install-recovery.sh on the first boot post an OTA update.
2015-11-11 04:21:34 +01:00
#
# We no longer need that if one of the following conditions holds:
2018-03-10 02:04:42 +01:00
# a) We carry a full copy of the recovery image - no patching needed
2015-11-11 04:21:34 +01:00
# (BOARD_USES_FULL_RECOVERY_IMAGE = true);
2018-03-10 02:04:42 +01:00
# b) We build a single image that contains boot and recovery both - no recovery image to install
# (BOARD_USES_RECOVERY_AS_BOOT = true);
2018-09-20 20:04:37 +02:00
# c) We mount the system image as / and therefore do not have a ramdisk in boot.img
2018-03-10 02:04:42 +01:00
# (BOARD_BUILD_SYSTEM_ROOT_IMAGE = true).
2018-03-21 20:15:11 +01:00
# d) We include the recovery DTBO image within recovery - not needing the resource file as we
# do bsdiff because boot and recovery will contain different number of entries
# (BOARD_INCLUDE_RECOVERY_DTBO = true).
2018-09-23 16:10:47 +02:00
# e) We include the recovery ACPIO image within recovery - not needing the resource file as we
# do bsdiff because boot and recovery will contain different number of entries
# (BOARD_INCLUDE_RECOVERY_ACPIO = true).
2018-03-10 02:04:42 +01:00
2018-09-20 20:04:37 +02:00
i f e q ( , $( filter true , $ ( BOARD_USES_FULL_RECOVERY_IMAGE ) $ ( BOARD_USES_RECOVERY_AS_BOOT ) \
2018-09-23 16:10:47 +02:00
$( BOARD_BUILD_SYSTEM_ROOT_IMAGE) $( BOARD_INCLUDE_RECOVERY_DTBO) $( BOARD_INCLUDE_RECOVERY_ACPIO) ) )
2012-08-21 00:38:58 +02:00
# Named '.dat' so we don't attempt to use imgdiff for patching it.
RECOVERY_RESOURCE_ZIP := $( TARGET_OUT) /etc/recovery-resource.dat
2015-07-22 21:33:18 +02:00
e l s e
RECOVERY_RESOURCE_ZIP :=
e n d i f
2009-07-02 18:00:54 +02:00
2018-07-31 22:26:54 +02:00
INSTALLED_RECOVERY_BUILD_PROP_TARGET := $( TARGET_RECOVERY_ROOT_OUT) /prop.default
$(INSTALLED_RECOVERY_BUILD_PROP_TARGET) : PRIVATE_RECOVERY_UI_PROPERTIES := \
TARGET_RECOVERY_UI_ANIMATION_FPS:animation_fps \
TARGET_RECOVERY_UI_MARGIN_HEIGHT:margin_height \
TARGET_RECOVERY_UI_MARGIN_WIDTH:margin_width \
TARGET_RECOVERY_UI_MENU_UNUSABLE_ROWS:menu_unusable_rows \
TARGET_RECOVERY_UI_PROGRESS_BAR_BASELINE:progress_bar_baseline \
TARGET_RECOVERY_UI_TOUCH_LOW_THRESHOLD:touch_low_threshold \
TARGET_RECOVERY_UI_TOUCH_HIGH_THRESHOLD:touch_high_threshold \
TARGET_RECOVERY_UI_VR_STEREO_OFFSET:vr_stereo_offset
# Parses the given list of build variables and writes their values as build properties if defined.
# For example, if a target defines `TARGET_RECOVERY_UI_MARGIN_HEIGHT := 100`,
# `ro.recovery.ui.margin_height=100` will be appended to the given output file.
# $(1): Map from the build variable names to property names
# $(2): Output file
d e f i n e a p p e n d - r e c o v e r y - u i - p r o p e r t i e s
e c h o "#" > > $( 2)
e c h o "# RECOVERY UI BUILD PROPERTIES" > > $( 2)
e c h o "#" > > $( 2)
$( foreach prop ,$ ( 1) , \
$( eval _varname := $( call word-colon,1,$( prop) ) ) \
$( eval _propname := $( call word-colon,2,$( prop) ) ) \
$( eval _value := $( $( _varname) ) ) \
$( if $( _value) , \
echo ro.recovery.ui.$( _propname) = $( _value) >> $( 2) && ) ) true
e n d e f
$(INSTALLED_RECOVERY_BUILD_PROP_TARGET) : \
2018-11-26 19:12:05 +01:00
$( INSTALLED_DEFAULT_PROP_TARGET) \
$( INSTALLED_VENDOR_DEFAULT_PROP_TARGET) \
$( intermediate_system_build_prop) \
$( INSTALLED_VENDOR_BUILD_PROP_TARGET) \
$( INSTALLED_ODM_BUILD_PROP_TARGET) \
$( INSTALLED_PRODUCT_BUILD_PROP_TARGET) \
$( INSTALLED_PRODUCT_SERVICES_BUILD_PROP_TARGET)
2018-09-18 19:22:54 +02:00
@echo " Target recovery buildinfo: $@ "
2018-07-31 22:26:54 +02:00
$( hide) mkdir -p $( dir $@ )
$( hide) rm -f $@
$( hide) cat $( INSTALLED_DEFAULT_PROP_TARGET) > $@
$( hide) cat $( INSTALLED_VENDOR_DEFAULT_PROP_TARGET) >> $@
2018-08-06 16:33:45 +02:00
$( hide) cat $( intermediate_system_build_prop) >> $@
2018-07-31 22:26:54 +02:00
$( hide) cat $( INSTALLED_VENDOR_BUILD_PROP_TARGET) >> $@
2017-11-14 16:42:30 +01:00
$( hide) cat $( INSTALLED_ODM_BUILD_PROP_TARGET) >> $@
2018-07-31 22:26:54 +02:00
$( hide) cat $( INSTALLED_PRODUCT_BUILD_PROP_TARGET) >> $@
$( hide) cat $( INSTALLED_PRODUCT_SERVICES_BUILD_PROP_TARGET) >> $@
$( call append-recovery-ui-properties,$( PRIVATE_RECOVERY_UI_PROPERTIES) ,$@ )
2009-07-02 18:00:54 +02:00
INTERNAL_RECOVERYIMAGE_ARGS := \
$( addprefix --second ,$( INSTALLED_2NDBOOTLOADER_TARGET) ) \
--kernel $( recovery_kernel) \
--ramdisk $( recovery_ramdisk)
# Assumes this has already been stripped
2016-10-06 01:57:27 +02:00
i f d e f I N T E R N A L _ K E R N E L _ C M D L I N E
INTERNAL_RECOVERYIMAGE_ARGS += --cmdline " $( INTERNAL_KERNEL_CMDLINE) "
2009-07-02 18:00:54 +02:00
e n d i f
i f d e f B O A R D _ K E R N E L _ B A S E
INTERNAL_RECOVERYIMAGE_ARGS += --base $( BOARD_KERNEL_BASE)
e n d i f
2010-08-25 23:29:34 +02:00
i f d e f B O A R D _ K E R N E L _ P A G E S I Z E
INTERNAL_RECOVERYIMAGE_ARGS += --pagesize $( BOARD_KERNEL_PAGESIZE)
e n d i f
2018-03-21 20:15:11 +01:00
i f d e f B O A R D _ I N C L U D E _ R E C O V E R Y _ D T B O
2019-02-04 19:35:25 +01:00
i f d e f B O A R D _ P R E B U I L T _ R E C O V E R Y _ D T B O I M A G E
INTERNAL_RECOVERYIMAGE_ARGS += --recovery_dtbo $( BOARD_PREBUILT_RECOVERY_DTBOIMAGE)
e l s e
2018-03-21 20:15:11 +01:00
INTERNAL_RECOVERYIMAGE_ARGS += --recovery_dtbo $( BOARD_PREBUILT_DTBOIMAGE)
e n d i f
2019-02-04 19:35:25 +01:00
e n d i f
2018-09-23 16:10:47 +02:00
i f d e f B O A R D _ I N C L U D E _ R E C O V E R Y _ A C P I O
INTERNAL_RECOVERYIMAGE_ARGS += --recovery_acpio $( BOARD_RECOVERY_ACPIO)
e n d i f
2019-01-23 03:08:59 +01:00
i f d e f B O A R D _ I N C L U D E _ D T B _ I N _ B O O T I M G
INTERNAL_RECOVERYIMAGE_ARGS += --dtb $( INSTALLED_DTBIMAGE_TARGET)
e n d i f
2009-07-02 18:00:54 +02:00
# Keys authorized to sign OTA packages this build will accept. The
2011-10-04 19:50:08 +02:00
# build always uses dev-keys for this; release packaging tools will
2009-07-02 18:00:54 +02:00
# substitute other keys for this one.
2011-10-04 19:50:08 +02:00
OTA_PUBLIC_KEYS := $( DEFAULT_SYSTEM_DEV_CERTIFICATE) .x509.pem
2009-07-02 18:00:54 +02:00
# Generate a file containing the keys that will be read by the
# recovery binary.
RECOVERY_INSTALL_OTA_KEYS := \
2018-10-19 23:34:15 +02:00
$( call intermediates-dir-for,PACKAGING,ota_keys) /otacerts.zip
2009-07-02 18:00:54 +02:00
$(RECOVERY_INSTALL_OTA_KEYS) : PRIVATE_OTA_PUBLIC_KEYS := $( OTA_PUBLIC_KEYS )
2011-03-16 15:49:13 +01:00
$(RECOVERY_INSTALL_OTA_KEYS) : extra_keys := $( patsubst %,%.x 509.pem ,$ ( PRODUCT_EXTRA_RECOVERY_KEYS ) )
2018-10-19 23:34:15 +02:00
$(RECOVERY_INSTALL_OTA_KEYS) : $( SOONG_ZIP ) $( OTA_PUBLIC_KEYS ) $( extra_keys )
$( hide) rm -f $@
$( hide) mkdir -p $( dir $@ )
$( hide) $( SOONG_ZIP) -o $@ $( foreach key_file, $( PRIVATE_OTA_PUBLIC_KEYS) $( extra_keys) , -C $( dir $( key_file) ) -f $( key_file) )
2009-07-02 18:00:54 +02:00
2015-05-07 05:44:22 +02:00
RECOVERYIMAGE_ID_FILE := $( PRODUCT_OUT) /recovery.id
2017-02-22 10:27:10 +01:00
2015-01-30 23:05:22 +01:00
# $(1): output file
d e f i n e b u i l d - r e c o v e r y i m a g e - t a r g e t
2017-11-15 19:34:01 +01:00
# Making recovery image
2015-01-30 23:05:22 +01:00
$( hide) mkdir -p $( TARGET_RECOVERY_OUT)
2018-08-18 01:27:01 +02:00
$( hide) mkdir -p $( TARGET_RECOVERY_ROOT_OUT) /sdcard $( TARGET_RECOVERY_ROOT_OUT) /tmp
2017-11-15 19:34:01 +01:00
# Copying baseline ramdisk...
2017-03-10 21:53:02 +01:00
# Use rsync because "cp -Rf" fails to overwrite broken symlinks on Mac.
2018-08-18 01:27:01 +02:00
$( hide) rsync -a --exclude= sdcard $( IGNORE_RECOVERY_SEPOLICY) $( IGNORE_CACHE_LINK) $( TARGET_ROOT_OUT) $( TARGET_RECOVERY_OUT)
2017-11-15 19:34:01 +01:00
# Modifying ramdisk contents...
2018-11-06 23:23:44 +01:00
$( if $( filter true,$( BOARD_BUILD_SYSTEM_ROOT_IMAGE) ) ,, \
$( hide) ln -sf /system/bin/init $( TARGET_RECOVERY_ROOT_OUT) /init)
2017-02-22 10:27:10 +01:00
$( if $( BOARD_RECOVERY_KERNEL_MODULES) , \
$( call build-image-kernel-modules,$( BOARD_RECOVERY_KERNEL_MODULES) ,$( TARGET_RECOVERY_ROOT_OUT) ,,$( call intermediates-dir-for,PACKAGING,depmod_recovery) ) )
2017-09-25 11:50:41 +02:00
# Removes $(TARGET_RECOVERY_ROOT_OUT)/init*.rc EXCEPT init.recovery*.rc.
$( hide) find $( TARGET_RECOVERY_ROOT_OUT) -maxdepth 1 -name 'init*.rc' -type f -not -name "init.recovery.*.rc" | xargs rm -f
2015-01-30 23:05:22 +01:00
$( hide) cp -f $( recovery_initrc) $( TARGET_RECOVERY_ROOT_OUT) /
2018-08-13 23:27:32 +02:00
$( hide) cp $( TARGET_ROOT_OUT) /init.recovery.*.rc $( TARGET_RECOVERY_ROOT_OUT) / 2> /dev/null || true # Ignore error when the src file doesn't exist.
2015-01-30 23:05:22 +01:00
$( hide) mkdir -p $( TARGET_RECOVERY_ROOT_OUT) /res
$( hide) rm -rf $( TARGET_RECOVERY_ROOT_OUT) /res/*
$( hide) cp -rf $( recovery_resources_common) /* $( TARGET_RECOVERY_ROOT_OUT) /res
2018-12-07 21:12:17 +01:00
$( hide) $( foreach recovery_text_file,$( generated_recovery_text_files) , \
cp -rf $( recovery_text_file) $( TARGET_RECOVERY_ROOT_OUT) /res/images/ && ) true
2015-01-30 23:05:22 +01:00
$( hide) cp -f $( recovery_font) $( TARGET_RECOVERY_ROOT_OUT) /res/images/font.png
2015-08-06 20:47:47 +02:00
$( hide) $( foreach item,$( TARGET_PRIVATE_RES_DIRS) , \
cp -rf $( item) $( TARGET_RECOVERY_ROOT_OUT) /$( newline) )
2015-01-30 23:05:22 +01:00
$( hide) $( foreach item,$( recovery_fstab) , \
2018-08-18 01:27:01 +02:00
cp -f $( item) $( TARGET_RECOVERY_ROOT_OUT) /system/etc/recovery.fstab)
2016-06-10 19:11:54 +02:00
$( if $( strip $( recovery_wipe) ) , \
2018-08-18 01:27:01 +02:00
$( hide) cp -f $( recovery_wipe) $( TARGET_RECOVERY_ROOT_OUT) /system/etc/recovery.wipe)
2018-10-19 23:34:15 +02:00
$( hide) mkdir -p $( TARGET_RECOVERY_ROOT_OUT) /system/etc/security
$( hide) cp $( RECOVERY_INSTALL_OTA_KEYS) $( TARGET_RECOVERY_ROOT_OUT) /system/etc/security/otacerts.zip
2017-05-01 15:56:26 +02:00
$( hide) ln -sf prop.default $( TARGET_RECOVERY_ROOT_OUT) /default.prop
2016-07-22 20:03:31 +02:00
$( BOARD_RECOVERY_IMAGE_PREPARE)
2015-07-09 18:54:55 +02:00
$( hide) $( MKBOOTFS) -d $( TARGET_OUT) $( TARGET_RECOVERY_ROOT_OUT) | $( MINIGZIP) > $( recovery_ramdisk)
2015-03-30 08:07:41 +02:00
$( if $( filter true,$( PRODUCTS.$( INTERNAL_PRODUCT) .PRODUCT_SUPPORTS_VBOOT) ) , \
2016-03-15 17:49:30 +01:00
$( hide) $( MKBOOTIMG) $( INTERNAL_RECOVERYIMAGE_ARGS) $( INTERNAL_MKBOOTIMG_VERSION_ARGS) $( BOARD_MKBOOTIMG_ARGS) --output $( 1) .unsigned, \
$( hide) $( MKBOOTIMG) $( INTERNAL_RECOVERYIMAGE_ARGS) $( INTERNAL_MKBOOTIMG_VERSION_ARGS) $( BOARD_MKBOOTIMG_ARGS) --output $( 1) --id > $( RECOVERYIMAGE_ID_FILE) )
2015-04-07 16:08:59 +02:00
$( if $( filter true,$( PRODUCTS.$( INTERNAL_PRODUCT) .PRODUCT_SUPPORTS_BOOT_SIGNER) ) ,\
2016-08-08 19:51:10 +02:00
$( if $( filter true,$( BOARD_USES_RECOVERY_AS_BOOT) ) ,\
$( BOOT_SIGNER) /boot $( 1) $( PRODUCTS.$( INTERNAL_PRODUCT) .PRODUCT_VERITY_SIGNING_KEY) .pk8 $( PRODUCTS.$( INTERNAL_PRODUCT) .PRODUCT_VERITY_SIGNING_KEY) .x509.pem $( 1) ,\
$( BOOT_SIGNER) /recovery $( 1) $( PRODUCTS.$( INTERNAL_PRODUCT) .PRODUCT_VERITY_SIGNING_KEY) .pk8 $( PRODUCTS.$( INTERNAL_PRODUCT) .PRODUCT_VERITY_SIGNING_KEY) .x509.pem $( 1) \
) \
)
2015-03-30 08:07:41 +02:00
$( if $( filter true,$( PRODUCTS.$( INTERNAL_PRODUCT) .PRODUCT_SUPPORTS_VBOOT) ) , \
2015-08-07 20:58:05 +02:00
$( VBOOT_SIGNER) $( FUTILITY) $( 1) .unsigned $( PRODUCTS.$( INTERNAL_PRODUCT) .PRODUCT_VBOOT_SIGNING_KEY) .vbpubk $( PRODUCTS.$( INTERNAL_PRODUCT) .PRODUCT_VBOOT_SIGNING_KEY) .vbprivk $( PRODUCTS.$( INTERNAL_PRODUCT) .PRODUCT_VBOOT_SIGNING_SUBKEY) .vbprivk $( 1) .keyblock $( 1) )
2017-11-17 08:22:37 +01:00
$( if $( filter true,$( BOARD_USES_RECOVERY_AS_BOOT) ) , \
$( hide) $( call assert-max-image-size,$( 1) ,$( call get-hash-image-max-size,$( BOARD_BOOTIMAGE_PARTITION_SIZE) ) ) , \
$( hide) $( call assert-max-image-size,$( 1) ,$( call get-hash-image-max-size,$( BOARD_RECOVERYIMAGE_PARTITION_SIZE) ) ) )
2017-12-01 22:24:01 +01:00
$( if $( filter true,$( BOARD_AVB_ENABLE) ) , \
$( if $( filter true,$( BOARD_USES_RECOVERY_AS_BOOT) ) , \
$( hide) $( AVBTOOL) add_hash_footer --image $( 1) --partition_size $( BOARD_BOOTIMAGE_PARTITION_SIZE) --partition_name boot $( INTERNAL_AVB_BOOT_SIGNING_ARGS) $( BOARD_AVB_BOOT_ADD_HASH_FOOTER_ARGS) ,\
$( hide) $( AVBTOOL) add_hash_footer --image $( 1) --partition_size $( BOARD_RECOVERYIMAGE_PARTITION_SIZE) --partition_name recovery $( INTERNAL_AVB_RECOVERY_SIGNING_ARGS) $( BOARD_AVB_RECOVERY_ADD_HASH_FOOTER_ARGS) ) )
2015-01-30 23:05:22 +01:00
e n d e f
2015-11-11 04:21:34 +01:00
i f e q ( $( BOARD_USES_RECOVERY_AS_BOOT ) , t r u e )
2016-03-10 21:57:33 +01:00
i f e q ( t r u e , $( PRODUCTS .$ ( INTERNAL_PRODUCT ) .PRODUCT_SUPPORTS_BOOT_SIGNER ) )
$(INSTALLED_BOOTIMAGE_TARGET) : $( BOOT_SIGNER )
e n d i f
i f e q ( t r u e , $( PRODUCTS .$ ( INTERNAL_PRODUCT ) .PRODUCT_SUPPORTS_VBOOT ) )
$(INSTALLED_BOOTIMAGE_TARGET) : $( VBOOT_SIGNER )
e n d i f
2017-05-04 22:58:04 +02:00
i f e q ( t r u e , $( BOARD_AVB_ENABLE ) )
2017-05-26 12:30:04 +02:00
$(INSTALLED_BOOTIMAGE_TARGET) : $( AVBTOOL ) $( BOARD_AVB_BOOT_KEY_PATH )
2017-05-04 22:58:04 +02:00
e n d i f
2018-08-22 23:35:09 +02:00
i f d e f B O A R D _ I N C L U D E _ R E C O V E R Y _ D T B O
2019-02-04 19:35:25 +01:00
i f d e f B O A R D _ P R E B U I L T _ R E C O V E R Y _ D T B O I M A G E
$(INSTALLED_BOOTIMAGE_TARGET) : $( BOARD_PREBUILT_RECOVERY_DTBOIMAGE )
e l s e
2018-08-22 23:35:09 +02:00
$(INSTALLED_BOOTIMAGE_TARGET) : $( BOARD_PREBUILT_DTBOIMAGE )
e n d i f
2019-02-04 19:35:25 +01:00
e n d i f
2018-09-23 16:10:47 +02:00
i f d e f B O A R D _ I N C L U D E _ R E C O V E R Y _ A C P I O
$(INSTALLED_BOOTIMAGE_TARGET) : $( BOARD_RECOVERY_ACPIO )
e n d i f
2019-01-23 03:08:59 +01:00
i f d e f B O A R D _ I N C L U D E _ D T B _ I N _ B O O T I M G
$(INSTALLED_BOOTIMAGE_TARGET) : $( INSTALLED_DTBIMAGE_TARGET )
e n d i f
2018-08-22 23:35:09 +02:00
2018-05-24 07:24:50 +02:00
$(INSTALLED_BOOTIMAGE_TARGET) : $( MKBOOTFS ) $( MKBOOTIMG ) $( MINIGZIP ) \
2018-11-26 19:12:05 +01:00
$( INTERNAL_ROOT_FILES) \
$( INSTALLED_RAMDISK_TARGET) \
$( INTERNAL_RECOVERYIMAGE_FILES) \
$( recovery_initrc) $( recovery_sepolicy) $( recovery_kernel) \
$( INSTALLED_2NDBOOTLOADER_TARGET) \
$( INSTALLED_RECOVERY_BUILD_PROP_TARGET) \
$( recovery_resource_deps) \
$( recovery_fstab) \
$( RECOVERY_INSTALL_OTA_KEYS) \
$( BOARD_RECOVERY_KERNEL_MODULES) \
$( DEPMOD)
2018-08-22 23:35:09 +02:00
$( call pretty," Target boot image from recovery: $@ " )
$( call build-recoveryimage-target, $@ )
e n d i f # BOARD_USES_RECOVERY_AS_BOOT
i f d e f B O A R D _ I N C L U D E _ R E C O V E R Y _ D T B O
2019-02-04 19:35:25 +01:00
i f d e f B O A R D _ P R E B U I L T _ R E C O V E R Y _ D T B O I M A G E
$(INSTALLED_RECOVERYIMAGE_TARGET) : $( BOARD_PREBUILT_RECOVERY_DTBOIMAGE )
e l s e
2018-08-22 23:35:09 +02:00
$(INSTALLED_RECOVERYIMAGE_TARGET) : $( BOARD_PREBUILT_DTBOIMAGE )
2015-11-11 04:21:34 +01:00
e n d i f
2019-02-04 19:35:25 +01:00
e n d i f
2018-09-23 16:10:47 +02:00
i f d e f B O A R D _ I N C L U D E _ R E C O V E R Y _ A C P I O
$(INSTALLED_RECOVERYIMAGE_TARGET) : $( BOARD_RECOVERY_ACPIO )
e n d i f
2019-01-23 03:08:59 +01:00
i f d e f B O A R D _ I N C L U D E _ D T B _ I N _ B O O T I M G
$(INSTALLED_RECOVERYIMAGE_TARGET) : $( INSTALLED_DTBIMAGE_TARGET )
e n d i f
2015-11-11 04:21:34 +01:00
2018-05-24 07:24:50 +02:00
$(INSTALLED_RECOVERYIMAGE_TARGET) : $( MKBOOTFS ) $( MKBOOTIMG ) $( MINIGZIP ) \
2018-11-26 19:12:05 +01:00
$( INTERNAL_ROOT_FILES) \
$( INSTALLED_RAMDISK_TARGET) \
$( INSTALLED_BOOTIMAGE_TARGET) \
$( INTERNAL_RECOVERYIMAGE_FILES) \
$( recovery_initrc) $( recovery_sepolicy) $( recovery_kernel) \
$( INSTALLED_2NDBOOTLOADER_TARGET) \
$( INSTALLED_RECOVERY_BUILD_PROP_TARGET) \
$( recovery_resource_deps) \
$( recovery_fstab) \
$( RECOVERY_INSTALL_OTA_KEYS) \
$( BOARD_RECOVERY_KERNEL_MODULES) \
$( DEPMOD)
2018-08-22 23:35:09 +02:00
$( call build-recoveryimage-target, $@ )
2009-07-02 18:00:54 +02:00
2015-12-22 18:47:46 +01:00
i f d e f R E C O V E R Y _ R E S O U R C E _ Z I P
2015-10-30 00:33:05 +01:00
$(RECOVERY_RESOURCE_ZIP) : $( INSTALLED_RECOVERYIMAGE_TARGET ) | $( ZIPTIME )
2012-09-04 23:45:11 +02:00
$( hide) mkdir -p $( dir $@ )
2015-10-30 00:33:05 +01:00
$( hide) find $( TARGET_RECOVERY_ROOT_OUT) /res -type f | sort | zip -0qrjX $@ -@
$( remove-timestamps-from-package)
2015-07-22 21:33:18 +02:00
e n d i f
2012-08-21 00:38:58 +02:00
2015-01-30 23:05:22 +01:00
.PHONY : recoveryimage -nodeps
recoveryimage-nodeps :
@echo " make $@ : ignoring dependencies "
$( call build-recoveryimage-target, $( INSTALLED_RECOVERYIMAGE_TARGET) )
2015-07-22 21:33:18 +02:00
e l s e # INSTALLED_RECOVERYIMAGE_TARGET not defined
2012-08-21 00:38:58 +02:00
RECOVERY_RESOURCE_ZIP :=
2009-07-02 18:00:54 +02:00
e n d i f
.PHONY : recoveryimage
2012-08-21 00:38:58 +02:00
recoveryimage : $( INSTALLED_RECOVERYIMAGE_TARGET ) $( RECOVERY_RESOURCE_ZIP )
2009-07-02 18:00:54 +02:00
2017-10-04 14:22:41 +02:00
i f n e q ( $( BOARD_NAND_PAGE_SIZE ) , )
$( error MTD device is no longer supported and thus BOARD_NAND_PAGE_SIZE is deprecated .)
2010-02-05 22:34:34 +01:00
e n d i f
2017-10-04 14:22:41 +02:00
i f n e q ( $( BOARD_NAND_SPARE_SIZE ) , )
$( error MTD device is no longer supported and thus BOARD_NAND_SPARE_SIZE is deprecated .)
2010-08-06 21:19:29 +02:00
e n d i f
2009-03-04 04:28:42 +01:00
# -----------------------------------------------------------------
2010-09-27 19:37:25 +02:00
# system image
2009-03-04 04:28:42 +01:00
#
2012-08-09 00:27:00 +02:00
# Remove overridden packages from $(ALL_PDK_FUSION_FILES)
PDK_FUSION_SYSIMG_FILES := \
$( filter-out $( foreach p,$( overridden_packages) ,$( p) %/$( p) .apk) , \
$( ALL_PDK_FUSION_FILES) )
2009-03-04 04:28:42 +01:00
2018-11-01 00:31:46 +01:00
INTERNAL_SYSTEMIMAGE_FILES := $( sort $( filter $( TARGET_OUT) /%, \
2012-03-14 02:58:27 +01:00
$( ALL_GENERATED_SOURCES) \
2012-08-21 00:38:58 +02:00
$( ALL_DEFAULT_INSTALLED_MODULES) \
$( PDK_FUSION_SYSIMG_FILES) \
2018-03-06 23:07:21 +01:00
$( RECOVERY_RESOURCE_ZIP) ) \
2018-11-01 00:31:46 +01:00
$( PDK_FUSION_SYMLINK_STAMP) )
2012-03-14 02:58:27 +01:00
2012-08-14 00:03:00 +02:00
FULL_SYSTEMIMAGE_DEPS := $( INTERNAL_SYSTEMIMAGE_FILES) $( INTERNAL_USERIMAGES_DEPS)
2017-03-25 00:06:31 +01:00
# ASAN libraries in the system image - add dependency.
ASAN_IN_SYSTEM_INSTALLED := $( TARGET_OUT) /asan.tar.bz2
2018-07-27 20:54:32 +02:00
i f n e q ( , $( filter address , $ ( SANITIZE_TARGET ) ) )
2017-03-25 00:06:31 +01:00
ifeq ( true,$( SANITIZE_TARGET_SYSTEM) )
FULL_SYSTEMIMAGE_DEPS += $( ASAN_IN_SYSTEM_INSTALLED)
endif
e n d i f
2018-08-09 23:26:00 +02:00
FULL_SYSTEMIMAGE_DEPS += $( INTERNAL_ROOT_FILES) $( INSTALLED_FILES_FILE_ROOT)
2018-07-04 00:41:40 +02:00
2018-05-01 18:54:21 +02:00
# -----------------------------------------------------------------
# Final System VINTF manifest including fragments. This is not assembled
# on the device because it depends on everything in a given device
# image which defines a vintf_fragment.
BUILT_ASSEMBLED_SYSTEM_MANIFEST := $( PRODUCT_OUT) /verified_assembled_system_manifest.xml
$(BUILT_ASSEMBLED_SYSTEM_MANIFEST) : $( HOST_OUT_EXECUTABLES ) /assemble_vintf
$(BUILT_ASSEMBLED_SYSTEM_MANIFEST) : $( BUILT_VENDOR_MATRIX )
$(BUILT_ASSEMBLED_SYSTEM_MANIFEST) : $( BUILT_SYSTEM_MANIFEST )
$(BUILT_ASSEMBLED_SYSTEM_MANIFEST) : $( FULL_SYSTEMIMAGE_DEPS )
@echo "Verifying system VINTF manifest."
PRODUCT_ENFORCE_VINTF_MANIFEST = $( PRODUCT_ENFORCE_VINTF_MANIFEST) \
$( HOST_OUT_EXECUTABLES) /assemble_vintf \
2018-11-26 19:12:05 +01:00
-c $( BUILT_VENDOR_MATRIX) \
-i $( BUILT_SYSTEM_MANIFEST) \
$$ ( [ -d $( TARGET_OUT) /etc/vintf/manifest ] && \
find $( TARGET_OUT) /etc/vintf/manifest -type f -name "*.xml" | \
sed "s/^/-i /" | tr '\n' ' ' ) -o $@
2018-05-01 18:54:21 +02:00
2011-09-10 01:35:53 +02:00
# -----------------------------------------------------------------
Add PRODUCT_BUILD_*_IMAGE, BUILDING_*_IMAGE to control building of images
These centralize the decisions on whether to build certain images or
not, and allow the product definition to override that choice.
There are a few use cases here:
* For GSI-like cases, we only want to build the system image. This
didn't really change, but it's somewhat simpler to configure, and
easier to understand the build logic.
* On the opposite side, when you're planning on using a GSI, the device
specific build can only build the vendor images (or some other set).
* Some cases (Fuchsia, etc) don't want to build any images, as they'll
be distributing the build artifacts in their own packaging.
I suspect in the future, TARGET_BUILD_APPS may be able to be refactored
into the third use case.
Test: treehugger
Test: Create a product definition that includes nothing, try to build it.
Test: compare build-aosp_crosshatch.ninja and build-crosshatch.ninja before/after
Change-Id: I685ab841be3718d3dd7052c28ccd764bb6f1991a
2019-01-16 21:42:05 +01:00
i f d e f B U I L D I N G _ S Y S T E M _ I M A G E
2011-09-10 01:35:53 +02:00
# installed file list
# Depending on anything that $(BUILT_SYSTEMIMAGE) depends on.
# We put installed-files.txt ahead of image itself in the dependency graph
# so that we can get the size stat even if the build fails due to too large
# system image.
INSTALLED_FILES_FILE := $( PRODUCT_OUT) /installed-files.txt
2018-06-13 23:04:22 +02:00
INSTALLED_FILES_JSON := $( INSTALLED_FILES_FILE:.txt= .json)
$(INSTALLED_FILES_FILE) : .KATI_IMPLICIT_OUTPUTS := $( INSTALLED_FILES_JSON )
2017-03-16 17:41:19 +01:00
$(INSTALLED_FILES_FILE) : $( FULL_SYSTEMIMAGE_DEPS ) $( FILESLIST )
2011-09-10 01:35:53 +02:00
@echo Installed file list: $@
@mkdir -p $( dir $@ )
@rm -f $@
2017-03-16 17:41:19 +01:00
$( hide) $( FILESLIST) $( TARGET_OUT) > $( @:.txt= .json)
2017-12-06 23:38:40 +01:00
$( hide) build/make/tools/fileslist_util.py -c $( @:.txt= .json) > $@
2011-09-10 01:35:53 +02:00
.PHONY : installed -file -list
installed-file-list : $( INSTALLED_FILES_FILE )
2013-03-02 01:45:35 +01:00
$( call dist -for -goals , sdk win_sdk sdk_addon , $ ( INSTALLED_FILES_FILE ) )
2011-09-10 01:35:53 +02:00
systemimage_intermediates := \
2011-11-04 19:37:01 +01:00
$( call intermediates-dir-for,PACKAGING,systemimage)
2011-09-10 01:35:53 +02:00
BUILT_SYSTEMIMAGE := $( systemimage_intermediates) /system.img
2014-06-19 05:26:24 +02:00
# Create symlink /system/vendor to /vendor if necessary.
2016-06-17 23:07:37 +02:00
i f d e f B O A R D _ U S E S _ V E N D O R I M A G E
2014-06-19 05:26:24 +02:00
d e f i n e c r e a t e - s y s t e m - v e n d o r - s y m l i n k
2014-07-17 21:56:49 +02:00
$( hide ) i f [ - d $( TARGET_OUT ) / v e n d o r ] & & [ ! - h $( TARGET_OUT ) / v e n d o r ] ; t h e n \
echo 'Non-symlink $(TARGET_OUT)/vendor detected!' 1>& 2; \
echo 'You cannot install files to $(TARGET_OUT)/vendor while building a separate vendor.img!' 1>& 2; \
exit 1; \
f i
2014-06-19 05:26:24 +02:00
$( hide ) l n - s f / v e n d o r $( TARGET_OUT ) / v e n d o r
e n d e f
e l s e
d e f i n e c r e a t e - s y s t e m - v e n d o r - s y m l i n k
e n d e f
e n d i f
2017-11-27 09:04:47 +01:00
# Create symlink /system/product to /product if necessary.
i f d e f B O A R D _ U S E S _ P R O D U C T I M A G E
d e f i n e c r e a t e - s y s t e m - p r o d u c t - s y m l i n k
$( hide ) i f [ - d $( TARGET_OUT ) / p r o d u c t ] & & [ ! - h $( TARGET_OUT ) / p r o d u c t ] ; t h e n \
echo 'Non-symlink $(TARGET_OUT)/product detected!' 1>& 2; \
echo 'You cannot install files to $(TARGET_OUT)/product while building a separate product.img!' 1>& 2; \
exit 1; \
f i
$( hide ) l n - s f / p r o d u c t $( TARGET_OUT ) / p r o d u c t
e n d e f
e l s e
d e f i n e c r e a t e - s y s t e m - p r o d u c t - s y m l i n k
e n d e f
e n d i f
2018-08-17 01:56:14 +02:00
# Create symlink /system/product_services to /product_services if necessary.
2018-05-29 14:09:01 +02:00
i f d e f B O A R D _ U S E S _ P R O D U C T _ S E R V I C E S I M A G E
2018-08-17 01:56:14 +02:00
d e f i n e c r e a t e - s y s t e m - p r o d u c t _ s e r v i c e s - s y m l i n k
$( hide ) i f [ - d $( TARGET_OUT ) / p r o d u c t _ s e r v i c e s ] & & [ ! - h $( TARGET_OUT ) / p r o d u c t _ s e r v i c e s ] ; t h e n \
echo 'Non-symlink $(TARGET_OUT)/product_services detected!' 1>& 2; \
echo 'You cannot install files to $(TARGET_OUT)/product_services while building a separate product_services.img!' 1>& 2; \
2018-05-29 14:09:01 +02:00
exit 1; \
f i
2018-08-17 01:56:14 +02:00
$( hide ) l n - s f / p r o d u c t _ s e r v i c e s $( TARGET_OUT ) / p r o d u c t _ s e r v i c e s
2018-05-29 14:09:01 +02:00
e n d e f
e l s e
2018-08-17 01:56:14 +02:00
d e f i n e c r e a t e - s y s t e m - p r o d u c t _ s e r v i c e s - s y m l i n k
2018-05-29 14:09:01 +02:00
e n d e f
e n d i f
2017-11-14 16:42:30 +01:00
# Create symlink /vendor/odm to /odm if necessary.
i f d e f B O A R D _ U S E S _ O D M I M A G E
d e f i n e c r e a t e - v e n d o r - o d m - s y m l i n k
$( hide ) i f [ - d $( TARGET_OUT_VENDOR ) / o d m ] & & [ ! - h $( TARGET_OUT_VENDOR ) / o d m ] ; t h e n \
echo 'Non-symlink $(TARGET_OUT_VENDOR)/odm detected!' 1>& 2; \
echo 'You cannot install files to $(TARGET_OUT_VENDOR)/odm while building a separate odm.img!' 1>& 2; \
exit 1; \
f i
$( hide ) l n - s f / o d m $( TARGET_OUT_VENDOR ) / o d m
e n d e f
e l s e
d e f i n e c r e a t e - v e n d o r - o d m - s y m l i n k
e n d e f
e n d i f
2009-03-04 04:28:42 +01:00
# $(1): output file
d e f i n e b u i l d - s y s t e m i m a g e - t a r g e t
2011-10-29 02:02:30 +02:00
@echo " Target system fs image: $( 1) "
2014-06-19 05:26:24 +02:00
$( call create-system-vendor-symlink)
2017-11-27 09:04:47 +01:00
$( call create-system-product-symlink)
2018-08-17 01:56:14 +02:00
$( call create-system-product_services-symlink)
2011-10-29 02:02:30 +02:00
@mkdir -p $( dir $( 1) ) $( systemimage_intermediates) && rm -rf $( systemimage_intermediates) /system_image_info.txt
2018-05-30 20:16:46 +02:00
$( call generate-image-prop-dictionary, $( systemimage_intermediates) /system_image_info.txt,system, \
2014-05-06 07:19:37 +02:00
skip_fsck = true )
2011-10-29 02:02:30 +02:00
$( hide) PATH = $( foreach p,$( INTERNAL_USERIMAGES_BINARY_PATHS) ,$( p) :) $$ PATH \
2017-12-06 23:38:40 +01:00
build/make/tools/releasetools/build_image.py \
2015-07-09 18:54:55 +02:00
$( TARGET_OUT) $( systemimage_intermediates) /system_image_info.txt $( 1) $( TARGET_OUT) \
2018-06-19 01:32:35 +02:00
$( systemimage_intermediates) /generated_system_image_info.txt \
2018-10-21 06:37:44 +02:00
|| ( mkdir -p $$ { DIST_DIR} ; cp $( INSTALLED_FILES_FILE) $$ { DIST_DIR} /installed-files-rescued.txt; \
2014-08-13 21:36:05 +02:00
exit 1 )
2009-03-04 04:28:42 +01:00
e n d e f
2018-05-01 18:54:21 +02:00
$(BUILT_SYSTEMIMAGE) : $( BUILT_ASSEMBLED_SYSTEM_MANIFEST )
2016-04-19 11:41:27 +02:00
$(BUILT_SYSTEMIMAGE) : $( FULL_SYSTEMIMAGE_DEPS ) $( INSTALLED_FILES_FILE ) $( BUILD_IMAGE_SRCS )
2009-03-04 04:28:42 +01:00
$( call build-systemimage-target,$@ )
2018-08-21 06:09:07 +02:00
INSTALLED_SYSTEMIMAGE_TARGET := $( PRODUCT_OUT) /system.img
2010-09-27 19:37:25 +02:00
SYSTEMIMAGE_SOURCE_DIR := $( TARGET_OUT)
2009-03-04 04:28:42 +01:00
2018-08-21 06:09:07 +02:00
# INSTALLED_SYSTEMIMAGE_TARGET used to be named INSTALLED_SYSTEMIMAGE. Create an alias for backward
# compatibility, in case device-specific Makefiles still refer to the old name.
INSTALLED_SYSTEMIMAGE := $( INSTALLED_SYSTEMIMAGE_TARGET)
2009-07-24 00:12:53 +02:00
# The system partition needs room for the recovery image as well. We
# now store the recovery image as a binary patch using the boot image
# as the source (since they are very similar). Generate the patch so
# we can see how big it's going to be, and include that in the system
# image size check calculation.
2018-08-15 01:17:12 +02:00
i f n e q ( $( INSTALLED_BOOTIMAGE_TARGET ) , )
2009-07-24 22:52:32 +02:00
i f n e q ( $( INSTALLED_RECOVERYIMAGE_TARGET ) , )
2015-07-22 21:33:18 +02:00
i f n e q ( $( BOARD_USES_FULL_RECOVERY_IMAGE ) , t r u e )
2018-09-23 16:10:47 +02:00
i f n e q ( , $( filter true , $ ( BOARD_BUILD_SYSTEM_ROOT_IMAGE ) $ ( BOARD_INCLUDE_RECOVERY_DTBO ) $ ( BOARD_INCLUDE_RECOVERY_ACPIO ) ) )
2018-03-10 02:04:42 +01:00
diff_tool := $( HOST_OUT_EXECUTABLES) /bsdiff
e l s e
diff_tool := $( HOST_OUT_EXECUTABLES) /imgdiff
e n d i f
2009-07-24 00:12:53 +02:00
intermediates := $( call intermediates-dir-for,PACKAGING,recovery_patch)
RECOVERY_FROM_BOOT_PATCH := $( intermediates) /recovery_from_boot.p
2018-03-10 02:04:42 +01:00
$(RECOVERY_FROM_BOOT_PATCH) : PRIVATE_DIFF_TOOL := $( diff_tool )
$(RECOVERY_FROM_BOOT_PATCH) : \
2018-11-26 19:12:05 +01:00
$( INSTALLED_RECOVERYIMAGE_TARGET) \
$( INSTALLED_BOOTIMAGE_TARGET) \
$( diff_tool)
2009-07-24 00:12:53 +02:00
@echo "Construct recovery from boot"
mkdir -p $( dir $@ )
2018-03-10 02:04:42 +01:00
$( PRIVATE_DIFF_TOOL) $( INSTALLED_BOOTIMAGE_TARGET) $( INSTALLED_RECOVERYIMAGE_TARGET) $@
2015-07-22 21:33:18 +02:00
e l s e # $(BOARD_USES_FULL_RECOVERY_IMAGE) == true
RECOVERY_FROM_BOOT_PATCH := $( INSTALLED_RECOVERYIMAGE_TARGET)
2018-08-15 01:17:12 +02:00
e n d i f # BOARD_USES_FULL_RECOVERY_IMAGE
e n d i f # INSTALLED_RECOVERYIMAGE_TARGET
e n d i f # INSTALLED_BOOTIMAGE_TARGET
2009-07-24 00:12:53 +02:00
2018-08-21 06:09:07 +02:00
$(INSTALLED_SYSTEMIMAGE_TARGET) : $( BUILT_SYSTEMIMAGE ) $( RECOVERY_FROM_BOOT_PATCH )
2009-03-04 04:28:42 +01:00
@echo " Install system fs image: $@ "
$( copy-file-to-target)
2019-02-20 00:42:45 +01:00
i f d e f R E C O V E R Y _ F R O M _ B O O T _ P A T C H
i f e q ( $( PRODUCT_USE_DYNAMIC_PARTITION_SIZE ) , t r u e )
i f e q ( $( BOARD_SYSTEMIMAGE_PARTITION_SIZE ) , )
# system image size is dynamic, hence system_size in generated_system_image_info.txt does not
# have room for recovery from boot patch. Increase system_size so that check-all-partition-sizes
# accounts for the size of the patch.
sed -i'.bak' -e 's/^system_size=.*$$/system_size=' " $$ (( \
$( call read-image-prop-dictionary,$( systemimage_intermediates) /generated_system_image_info.txt,system_size) + \
$$ ( $( call get-file-size,$( RECOVERY_FROM_BOOT_PATCH) ) ) ) ) " '/' \
$( systemimage_intermediates) /generated_system_image_info.txt
e n d i f
e n d i f
e n d i f
2018-06-19 01:32:35 +02:00
$( hide) $( call assert-max-image-size,$@ $( RECOVERY_FROM_BOOT_PATCH) ,\
2018-11-26 19:12:05 +01:00
$( call read-image-prop-dictionary,\
$( systemimage_intermediates) /generated_system_image_info.txt,system_size) )
2009-03-04 04:28:42 +01:00
2018-08-21 06:09:07 +02:00
systemimage : $( INSTALLED_SYSTEMIMAGE_TARGET )
2009-03-04 04:28:42 +01:00
.PHONY : systemimage -nodeps snod
systemimage-nodeps snod : $( filter -out systemimage -nodeps snod ,$ ( MAKECMDGOALS ) ) \
2010-05-10 22:04:47 +02:00
| $( INTERNAL_USERIMAGES_DEPS)
2009-03-04 04:28:42 +01:00
@echo " make $@ : ignoring dependencies "
2018-08-21 06:09:07 +02:00
$( call build-systemimage-target,$( INSTALLED_SYSTEMIMAGE_TARGET) )
$( hide) $( call assert-max-image-size,$( INSTALLED_SYSTEMIMAGE_TARGET) ,\
2018-11-26 19:12:05 +01:00
$( call read-image-prop-dictionary,\
$( systemimage_intermediates) /generated_system_image_info.txt,system_size) )
2009-03-04 04:28:42 +01:00
2012-02-24 20:05:48 +01:00
i f n e q ( , $( filter systemimage -nodeps snod , $ ( MAKECMDGOALS ) ) )
i f e q ( t r u e , $( WITH_DEXPREOPT ) )
$(warning Warning : with dexpreopt enabled , you may need a full rebuild .)
e n d i f
e n d i f
Add PRODUCT_BUILD_*_IMAGE, BUILDING_*_IMAGE to control building of images
These centralize the decisions on whether to build certain images or
not, and allow the product definition to override that choice.
There are a few use cases here:
* For GSI-like cases, we only want to build the system image. This
didn't really change, but it's somewhat simpler to configure, and
easier to understand the build logic.
* On the opposite side, when you're planning on using a GSI, the device
specific build can only build the vendor images (or some other set).
* Some cases (Fuchsia, etc) don't want to build any images, as they'll
be distributing the build artifacts in their own packaging.
I suspect in the future, TARGET_BUILD_APPS may be able to be refactored
into the third use case.
Test: treehugger
Test: Create a product definition that includes nothing, try to build it.
Test: compare build-aosp_crosshatch.ninja and build-crosshatch.ninja before/after
Change-Id: I685ab841be3718d3dd7052c28ccd764bb6f1991a
2019-01-16 21:42:05 +01:00
e n d i f # BUILDING_SYSTEM_IMAGE
2018-11-12 14:36:46 +01:00
.PHONY : sync syncsys
sync syncsys : $( INTERNAL_SYSTEMIMAGE_FILES )
2017-06-21 01:57:52 +02:00
2009-03-04 04:28:42 +01:00
#######
## system tarball
d e f i n e b u i l d - s y s t e m t a r b a l l - t a r g e t
2014-06-19 05:26:24 +02:00
$( call pretty," Target system fs tarball: $( INSTALLED_SYSTEMTARBALL_TARGET) " )
$( call create-system-vendor-symlink)
2017-11-27 09:04:47 +01:00
$( call create-system-product-symlink)
2018-08-17 01:56:14 +02:00
$( call create-system-product_services-symlink)
2014-06-19 05:26:24 +02:00
$( MKTARBALL) $( FS_GET_STATS) \
$( PRODUCT_OUT) system $( PRIVATE_SYSTEM_TAR) \
2015-07-09 18:54:55 +02:00
$( INSTALLED_SYSTEMTARBALL_TARGET) $( TARGET_OUT)
2009-03-04 04:28:42 +01:00
e n d e f
2010-06-11 21:05:57 +02:00
i f n d e f S Y S T E M _ T A R B A L L _ F O R M A T
SYSTEM_TARBALL_FORMAT := bz2
e n d i f
2009-03-04 04:28:42 +01:00
system_tar := $( PRODUCT_OUT) /system.tar
2010-06-11 21:05:57 +02:00
INSTALLED_SYSTEMTARBALL_TARGET := $( system_tar) .$( SYSTEM_TARBALL_FORMAT)
2009-03-04 04:28:42 +01:00
$(INSTALLED_SYSTEMTARBALL_TARGET) : PRIVATE_SYSTEM_TAR := $( system_tar )
$(INSTALLED_SYSTEMTARBALL_TARGET) : $( FS_GET_STATS ) $( INTERNAL_SYSTEMIMAGE_FILES )
$( build-systemtarball-target)
.PHONY : systemtarball -nodeps
systemtarball-nodeps : $( FS_GET_STATS ) \
$( filter-out systemtarball-nodeps stnod,$( MAKECMDGOALS) )
$( build-systemtarball-target)
.PHONY : stnod
stnod : systemtarball -nodeps
2016-03-11 19:32:01 +01:00
# -----------------------------------------------------------------
2012-04-10 02:04:12 +02:00
## platform.zip: system, plus other files to be used in PDK fusion build,
## in a zip file
2013-07-22 23:54:58 +02:00
##
## PDK_PLATFORM_ZIP_PRODUCT_BINARIES is used to store specified files to platform.zip.
## The variable will be typically set from BoardConfig.mk.
## Files under out dir will be rejected to prevent possible conflicts with other rules.
2018-09-29 01:19:42 +02:00
i f n e q ( , $( BUILD_PLATFORM_ZIP ) )
2016-03-11 19:32:01 +01:00
pdk_odex_javalibs := $( strip $( foreach m,$( DEXPREOPT.MODULES.JAVA_LIBRARIES) ,\
2018-11-17 06:26:33 +01:00
$( if $( filter $( DEXPREOPT.$( m) .INSTALLED_STRIPPED) ,$( ALL_DEFAULT_INSTALLED_MODULES) ) ,$( m) ) ) )
2016-03-11 19:32:01 +01:00
pdk_odex_apps := $( strip $( foreach m,$( DEXPREOPT.MODULES.APPS) ,\
2018-11-17 06:26:33 +01:00
$( if $( filter $( DEXPREOPT.$( m) .INSTALLED_STRIPPED) ,$( ALL_DEFAULT_INSTALLED_MODULES) ) ,$( m) ) ) )
2016-03-11 19:32:01 +01:00
pdk_classes_dex := $( strip \
$( foreach m,$( pdk_odex_javalibs) ,$( call intermediates-dir-for,JAVA_LIBRARIES,$( m) ,,COMMON) /javalib.jar) \
$( foreach m,$( pdk_odex_apps) ,$( call intermediates-dir-for,APPS,$( m) ) /package.dex.apk) )
pdk_odex_config_mk := $( PRODUCT_OUT) /pdk_dexpreopt_config.mk
$(pdk_odex_config_mk) : PRIVATE_JAVA_LIBRARIES := $( pdk_odex_javalibs )
$(pdk_odex_config_mk) : PRIVATE_APPS := $( pdk_odex_apps )
$(pdk_odex_config_mk) :
@echo " PDK odex config makefile: $@ "
$( hide) mkdir -p $( dir $@ )
$( hide) echo "# Auto-generated. Do not modify." > $@
$( hide) echo " PDK.DEXPREOPT.JAVA_LIBRARIES:= $( PRIVATE_JAVA_LIBRARIES) " >> $@
$( hide) echo " PDK.DEXPREOPT.APPS:= $( PRIVATE_APPS) " >> $@
$( foreach m,$( PRIVATE_JAVA_LIBRARIES) ,\
$( hide) echo " PDK.DEXPREOPT. $( m) .SRC:= $( patsubst $( OUT_DIR) /%,%,$( call intermediates-dir-for,JAVA_LIBRARIES,$( m) ,,COMMON) /javalib.jar) " >> $@ $( newline) \
$( hide) echo " PDK.DEXPREOPT. $( m) .DEX_PREOPT:= $( DEXPREOPT.$( m) .DEX_PREOPT) " >> $@ $( newline) \
$( hide) echo " PDK.DEXPREOPT. $( m) .MULTILIB:= $( DEXPREOPT.$( m) .MULTILIB) " >> $@ $( newline) \
$( hide) echo " PDK.DEXPREOPT. $( m) .DEX_PREOPT_FLAGS:= $( DEXPREOPT.$( m) .DEX_PREOPT_FLAGS) " >> $@ $( newline) \
)
$( foreach m,$( PRIVATE_APPS) ,\
$( hide) echo " PDK.DEXPREOPT. $( m) .SRC:= $( patsubst $( OUT_DIR) /%,%,$( call intermediates-dir-for,APPS,$( m) ) /package.dex.apk) " >> $@ $( newline) \
$( hide) echo " PDK.DEXPREOPT. $( m) .DEX_PREOPT:= $( DEXPREOPT.$( m) .DEX_PREOPT) " >> $@ $( newline) \
$( hide) echo " PDK.DEXPREOPT. $( m) .MULTILIB:= $( DEXPREOPT.$( m) .MULTILIB) " >> $@ $( newline) \
$( hide) echo " PDK.DEXPREOPT. $( m) .DEX_PREOPT_FLAGS:= $( DEXPREOPT.$( m) .DEX_PREOPT_FLAGS) " >> $@ $( newline) \
$( hide) echo " PDK.DEXPREOPT. $( m) .PRIVILEGED_MODULE:= $( DEXPREOPT.$( m) .PRIVILEGED_MODULE) " >> $@ $( newline) \
2017-03-21 02:31:17 +01:00
$( hide) echo " PDK.DEXPREOPT. $( m) .VENDOR_MODULE:= $( DEXPREOPT.$( m) .VENDOR_MODULE) " >> $@ $( newline) \
2016-03-11 19:32:01 +01:00
$( hide) echo " PDK.DEXPREOPT. $( m) .TARGET_ARCH:= $( DEXPREOPT.$( m) .TARGET_ARCH) " >> $@ $( newline) \
$( hide) echo " PDK.DEXPREOPT. $( m) .STRIPPED_SRC:= $( patsubst $( PRODUCT_OUT) /%,%,$( DEXPREOPT.$( m) .INSTALLED_STRIPPED) ) " >> $@ $( newline) \
)
2013-07-22 23:54:58 +02:00
PDK_PLATFORM_ZIP_PRODUCT_BINARIES := $( filter-out $( OUT_DIR) /%,$( PDK_PLATFORM_ZIP_PRODUCT_BINARIES) )
2012-05-16 19:32:41 +02:00
INSTALLED_PLATFORM_ZIP := $( PRODUCT_OUT) /platform.zip
2016-03-11 19:32:01 +01:00
$(INSTALLED_PLATFORM_ZIP) : PRIVATE_DEX_FILES := $( pdk_classes_dex )
$(INSTALLED_PLATFORM_ZIP) : PRIVATE_ODEX_CONFIG := $( pdk_odex_config_mk )
2018-09-15 06:51:11 +02:00
$(INSTALLED_PLATFORM_ZIP) : $( SOONG_ZIP )
# dependencies for the other partitions are defined below after their file lists
# are known
2018-12-14 10:04:19 +01:00
$(INSTALLED_PLATFORM_ZIP) : $( INTERNAL_SYSTEMIMAGE_FILES ) $( pdk_classes_dex ) $( pdk_odex_config_mk ) $( api_fingerprint )
2012-05-16 19:32:41 +02:00
$( call pretty," Platform zip package: $( INSTALLED_PLATFORM_ZIP) " )
2018-09-15 06:51:11 +02:00
rm -f $@ $@ .lst
echo " -C $( PRODUCT_OUT) " >> $@ .lst
echo " -D $( TARGET_OUT) " >> $@ .lst
echo " -D $( TARGET_OUT_NOTICE_FILES) " >> $@ .lst
echo " $( addprefix -f $( TARGET_OUT_UNSTRIPPED) /,$( PDK_SYMBOL_FILES_LIST) ) " >> $@ .lst
Add PRODUCT_BUILD_*_IMAGE, BUILDING_*_IMAGE to control building of images
These centralize the decisions on whether to build certain images or
not, and allow the product definition to override that choice.
There are a few use cases here:
* For GSI-like cases, we only want to build the system image. This
didn't really change, but it's somewhat simpler to configure, and
easier to understand the build logic.
* On the opposite side, when you're planning on using a GSI, the device
specific build can only build the vendor images (or some other set).
* Some cases (Fuchsia, etc) don't want to build any images, as they'll
be distributing the build artifacts in their own packaging.
I suspect in the future, TARGET_BUILD_APPS may be able to be refactored
into the third use case.
Test: treehugger
Test: Create a product definition that includes nothing, try to build it.
Test: compare build-aosp_crosshatch.ninja and build-crosshatch.ninja before/after
Change-Id: I685ab841be3718d3dd7052c28ccd764bb6f1991a
2019-01-16 21:42:05 +01:00
i f d e f B U I L D I N G _ V E N D O R _ I M A G E
2018-09-15 06:51:11 +02:00
echo " -D $( TARGET_OUT_VENDOR) " >> $@ .lst
2014-07-17 02:46:35 +02:00
e n d i f
Add PRODUCT_BUILD_*_IMAGE, BUILDING_*_IMAGE to control building of images
These centralize the decisions on whether to build certain images or
not, and allow the product definition to override that choice.
There are a few use cases here:
* For GSI-like cases, we only want to build the system image. This
didn't really change, but it's somewhat simpler to configure, and
easier to understand the build logic.
* On the opposite side, when you're planning on using a GSI, the device
specific build can only build the vendor images (or some other set).
* Some cases (Fuchsia, etc) don't want to build any images, as they'll
be distributing the build artifacts in their own packaging.
I suspect in the future, TARGET_BUILD_APPS may be able to be refactored
into the third use case.
Test: treehugger
Test: Create a product definition that includes nothing, try to build it.
Test: compare build-aosp_crosshatch.ninja and build-crosshatch.ninja before/after
Change-Id: I685ab841be3718d3dd7052c28ccd764bb6f1991a
2019-01-16 21:42:05 +01:00
i f d e f B U I L D I N G _ P R O D U C T _ I M A G E
2018-09-15 06:51:11 +02:00
echo " -D $( TARGET_OUT_PRODUCT) " >> $@ .lst
2017-11-27 09:04:47 +01:00
e n d i f
Add PRODUCT_BUILD_*_IMAGE, BUILDING_*_IMAGE to control building of images
These centralize the decisions on whether to build certain images or
not, and allow the product definition to override that choice.
There are a few use cases here:
* For GSI-like cases, we only want to build the system image. This
didn't really change, but it's somewhat simpler to configure, and
easier to understand the build logic.
* On the opposite side, when you're planning on using a GSI, the device
specific build can only build the vendor images (or some other set).
* Some cases (Fuchsia, etc) don't want to build any images, as they'll
be distributing the build artifacts in their own packaging.
I suspect in the future, TARGET_BUILD_APPS may be able to be refactored
into the third use case.
Test: treehugger
Test: Create a product definition that includes nothing, try to build it.
Test: compare build-aosp_crosshatch.ninja and build-crosshatch.ninja before/after
Change-Id: I685ab841be3718d3dd7052c28ccd764bb6f1991a
2019-01-16 21:42:05 +01:00
i f d e f B U I L D I N G _ P R O D U C T _ S E R V I C E S _ I M A G E
2018-09-15 06:51:11 +02:00
echo " -D $( TARGET_OUT_PRODUCT_SERVICES) " >> $@ .lst
2018-05-29 14:09:01 +02:00
e n d i f
Add PRODUCT_BUILD_*_IMAGE, BUILDING_*_IMAGE to control building of images
These centralize the decisions on whether to build certain images or
not, and allow the product definition to override that choice.
There are a few use cases here:
* For GSI-like cases, we only want to build the system image. This
didn't really change, but it's somewhat simpler to configure, and
easier to understand the build logic.
* On the opposite side, when you're planning on using a GSI, the device
specific build can only build the vendor images (or some other set).
* Some cases (Fuchsia, etc) don't want to build any images, as they'll
be distributing the build artifacts in their own packaging.
I suspect in the future, TARGET_BUILD_APPS may be able to be refactored
into the third use case.
Test: treehugger
Test: Create a product definition that includes nothing, try to build it.
Test: compare build-aosp_crosshatch.ninja and build-crosshatch.ninja before/after
Change-Id: I685ab841be3718d3dd7052c28ccd764bb6f1991a
2019-01-16 21:42:05 +01:00
i f d e f B U I L D I N G _ O D M _ I M A G E
2018-09-15 06:51:11 +02:00
echo " -D $( TARGET_OUT_ODM) " >> $@ .lst
2017-11-14 16:42:30 +01:00
e n d i f
2013-12-19 04:36:44 +01:00
i f n e q ( $( PDK_PLATFORM_JAVA_ZIP_CONTENTS ) , )
2018-09-15 06:51:11 +02:00
echo " -C $( OUT_DIR) " >> $@ .lst
for f in $( filter-out $( PRIVATE_DEX_FILES) ,$( addprefix -f $( OUT_DIR) /,$( PDK_PLATFORM_JAVA_ZIP_CONTENTS) ) ) ; do \
if [ -e $$ f ] ; then \
echo " -f $$ f " ; \
fi \
done >> $@ .lst
2012-05-16 19:32:41 +02:00
e n d i f
2013-07-22 23:54:58 +02:00
i f n e q ( $( PDK_PLATFORM_ZIP_PRODUCT_BINARIES ) , )
2018-09-15 06:51:11 +02:00
echo " -C . $( addprefix -f ,$( PDK_PLATFORM_ZIP_PRODUCT_BINARIES) ) " >> $@ .lst
2013-07-22 23:54:58 +02:00
e n d i f
2016-03-11 19:32:01 +01:00
@# Add dex-preopt files and config.
2018-09-15 06:51:11 +02:00
$( if $( PRIVATE_DEX_FILES) ,\
echo " -C $( OUT_DIR) $( addprefix -f ,$( PRIVATE_DEX_FILES) ) " ) >> $@ .lst
2018-12-14 10:04:19 +01:00
echo " -C $( dir $( api_fingerprint) ) -f $( api_fingerprint) " >> $@ .lst
2018-09-15 06:51:11 +02:00
touch $( PRODUCT_OUT) /pdk.mk
echo " -C $( PRODUCT_OUT) -f $( PRIVATE_ODEX_CONFIG) -f $( PRODUCT_OUT) /pdk.mk " >> $@ .lst
$( SOONG_ZIP) --ignore_missing_files -o $@ @$@ .lst
2012-03-30 22:52:54 +02:00
.PHONY : platform
2012-05-16 19:32:41 +02:00
platform : $( INSTALLED_PLATFORM_ZIP )
.PHONY : platform -java
platform-java : platform
2012-03-30 22:52:54 +02:00
# Dist the platform.zip
2012-05-30 02:55:46 +02:00
i f n e q ( , $( filter platform platform -java , $ ( MAKECMDGOALS ) ) )
$( call dist -for -goals , platform platform -java , $ ( INSTALLED_PLATFORM_ZIP ) )
2012-03-30 22:52:54 +02:00
e n d i f
2009-03-04 04:28:42 +01:00
2018-09-29 01:19:42 +02:00
e n d i f # BUILD_PLATFORM_ZIP
2016-03-11 19:32:01 +01:00
# -----------------------------------------------------------------
2010-06-05 00:24:49 +02:00
## boot tarball
d e f i n e b u i l d - b o o t t a r b a l l - t a r g e t
2010-06-24 23:02:00 +02:00
$( hide) echo " Target boot fs tarball: $( INSTALLED_BOOTTARBALL_TARGET) "
2010-06-05 00:24:49 +02:00
$( hide) mkdir -p $( PRODUCT_OUT) /boot
$( hide) cp -f $( INTERNAL_BOOTIMAGE_FILES) $( PRODUCT_OUT) /boot/.
2016-10-06 01:57:27 +02:00
$( hide) echo $( INTERNAL_KERNEL_CMDLINE) > $( PRODUCT_OUT) /boot/cmdline
2010-06-05 00:24:49 +02:00
$( hide) $( MKTARBALL) $( FS_GET_STATS) \
$( PRODUCT_OUT) boot $( PRIVATE_BOOT_TAR) \
2015-07-09 18:54:55 +02:00
$( INSTALLED_BOOTTARBALL_TARGET) $( TARGET_OUT)
2010-06-05 00:24:49 +02:00
e n d e f
i f n d e f B O O T _ T A R B A L L _ F O R M A T
BOOT_TARBALL_FORMAT := bz2
e n d i f
boot_tar := $( PRODUCT_OUT) /boot.tar
INSTALLED_BOOTTARBALL_TARGET := $( boot_tar) .$( BOOT_TARBALL_FORMAT)
$(INSTALLED_BOOTTARBALL_TARGET) : PRIVATE_BOOT_TAR := $( boot_tar )
$(INSTALLED_BOOTTARBALL_TARGET) : $( FS_GET_STATS ) $( INTERNAL_BOOTIMAGE_FILES )
$( build-boottarball-target)
.PHONY : boottarball -nodeps btnod
boottarball-nodeps btnod : $( FS_GET_STATS ) \
$( filter-out boottarball-nodeps btnod,$( MAKECMDGOALS) )
$( build-boottarball-target)
2009-03-04 04:28:42 +01:00
# -----------------------------------------------------------------
# data partition image
INTERNAL_USERDATAIMAGE_FILES := \
2011-11-04 19:37:01 +01:00
$( filter $( TARGET_OUT_DATA) /%,$( ALL_DEFAULT_INSTALLED_MODULES) )
2009-03-04 04:28:42 +01:00
Add PRODUCT_BUILD_*_IMAGE, BUILDING_*_IMAGE to control building of images
These centralize the decisions on whether to build certain images or
not, and allow the product definition to override that choice.
There are a few use cases here:
* For GSI-like cases, we only want to build the system image. This
didn't really change, but it's somewhat simpler to configure, and
easier to understand the build logic.
* On the opposite side, when you're planning on using a GSI, the device
specific build can only build the vendor images (or some other set).
* Some cases (Fuchsia, etc) don't want to build any images, as they'll
be distributing the build artifacts in their own packaging.
I suspect in the future, TARGET_BUILD_APPS may be able to be refactored
into the third use case.
Test: treehugger
Test: Create a product definition that includes nothing, try to build it.
Test: compare build-aosp_crosshatch.ninja and build-crosshatch.ninja before/after
Change-Id: I685ab841be3718d3dd7052c28ccd764bb6f1991a
2019-01-16 21:42:05 +01:00
i f d e f B U I L D I N G _ U S E R D A T A _ I M A G E
2011-10-29 02:02:30 +02:00
userdataimage_intermediates := \
2011-11-04 19:37:01 +01:00
$( call intermediates-dir-for,PACKAGING,userdata)
2011-10-29 02:02:30 +02:00
BUILT_USERDATAIMAGE_TARGET := $( PRODUCT_OUT) /userdata.img
2009-03-04 04:28:42 +01:00
d e f i n e b u i l d - u s e r d a t a i m a g e - t a r g e t
2011-10-29 02:02:30 +02:00
$( call pretty," Target userdata fs image: $( INSTALLED_USERDATAIMAGE_TARGET) " )
@mkdir -p $( TARGET_OUT_DATA)
@mkdir -p $( userdataimage_intermediates) && rm -rf $( userdataimage_intermediates) /userdata_image_info.txt
2018-05-30 20:16:46 +02:00
$( call generate-image-prop-dictionary, $( userdataimage_intermediates) /userdata_image_info.txt,userdata,skip_fsck= true )
2011-10-29 02:02:30 +02:00
$( hide) PATH = $( foreach p,$( INTERNAL_USERIMAGES_BINARY_PATHS) ,$( p) :) $$ PATH \
2017-12-06 23:38:40 +01:00
build/make/tools/releasetools/build_image.py \
2015-07-09 18:54:55 +02:00
$( TARGET_OUT_DATA) $( userdataimage_intermediates) /userdata_image_info.txt $( INSTALLED_USERDATAIMAGE_TARGET) $( TARGET_OUT)
2014-06-16 23:19:36 +02:00
$( hide) $( call assert-max-image-size,$( INSTALLED_USERDATAIMAGE_TARGET) ,$( BOARD_USERDATAIMAGE_PARTITION_SIZE) )
2009-03-04 04:28:42 +01:00
e n d e f
2009-04-10 04:31:12 +02:00
# We just build this directly to the install location.
INSTALLED_USERDATAIMAGE_TARGET := $( BUILT_USERDATAIMAGE_TARGET)
2017-03-25 00:06:31 +01:00
INSTALLED_USERDATAIMAGE_TARGET_DEPS := \
$( INTERNAL_USERIMAGES_DEPS) \
$( INTERNAL_USERDATAIMAGE_FILES) \
$( BUILD_IMAGE_SRCS)
$(INSTALLED_USERDATAIMAGE_TARGET) : $( INSTALLED_USERDATAIMAGE_TARGET_DEPS )
2009-03-04 04:28:42 +01:00
$( build-userdataimage-target)
.PHONY : userdataimage -nodeps
2010-05-10 22:04:47 +02:00
userdataimage-nodeps : | $( INTERNAL_USERIMAGES_DEPS )
2009-03-04 04:28:42 +01:00
$( build-userdataimage-target)
Add PRODUCT_BUILD_*_IMAGE, BUILDING_*_IMAGE to control building of images
These centralize the decisions on whether to build certain images or
not, and allow the product definition to override that choice.
There are a few use cases here:
* For GSI-like cases, we only want to build the system image. This
didn't really change, but it's somewhat simpler to configure, and
easier to understand the build logic.
* On the opposite side, when you're planning on using a GSI, the device
specific build can only build the vendor images (or some other set).
* Some cases (Fuchsia, etc) don't want to build any images, as they'll
be distributing the build artifacts in their own packaging.
I suspect in the future, TARGET_BUILD_APPS may be able to be refactored
into the third use case.
Test: treehugger
Test: Create a product definition that includes nothing, try to build it.
Test: compare build-aosp_crosshatch.ninja and build-crosshatch.ninja before/after
Change-Id: I685ab841be3718d3dd7052c28ccd764bb6f1991a
2019-01-16 21:42:05 +01:00
e n d i f # BUILDING_USERDATA_IMAGE
2012-10-15 23:36:22 +02:00
2017-03-25 00:06:31 +01:00
# ASAN libraries in the system image - build rule.
ASAN_OUT_DIRS_FOR_SYSTEM_INSTALL := $( sort $( patsubst $( PRODUCT_OUT) /%,%,\
$( TARGET_OUT_SHARED_LIBRARIES) \
$( 2ND_TARGET_OUT_SHARED_LIBRARIES) \
$( TARGET_OUT_VENDOR_SHARED_LIBRARIES) \
$( 2ND_TARGET_OUT_VENDOR_SHARED_LIBRARIES) ) )
2017-03-31 01:54:23 +02:00
# Extra options: Enforce the system user for the files to avoid having to change ownership.
ASAN_SYSTEM_INSTALL_OPTIONS := --owner= 1000 --group= 1000
2017-03-25 00:06:31 +01:00
# Note: experimentally, it seems not worth it to try to get "best" compression. We don't save
# enough space.
$(ASAN_IN_SYSTEM_INSTALLED) : $( INSTALLED_USERDATAIMAGE_TARGET_DEPS )
2017-03-31 01:54:23 +02:00
tar cfj $( ASAN_IN_SYSTEM_INSTALLED) $( ASAN_SYSTEM_INSTALL_OPTIONS) -C $( TARGET_OUT_DATA) /.. $( ASAN_OUT_DIRS_FOR_SYSTEM_INSTALL) >/dev/null
2017-03-25 00:06:31 +01:00
2009-03-04 04:28:42 +01:00
#######
## data partition tarball
d e f i n e b u i l d - u s e r d a t a t a r b a l l - t a r g e t
$( call pretty,"Target userdata fs tarball: " \
" $( INSTALLED_USERDATATARBALL_TARGET) " )
$( MKTARBALL) $( FS_GET_STATS) \
2018-11-26 19:12:05 +01:00
$( PRODUCT_OUT) data $( PRIVATE_USERDATA_TAR) \
$( INSTALLED_USERDATATARBALL_TARGET) $( TARGET_OUT)
2009-03-04 04:28:42 +01:00
e n d e f
userdata_tar := $( PRODUCT_OUT) /userdata.tar
INSTALLED_USERDATATARBALL_TARGET := $( userdata_tar) .bz2
$(INSTALLED_USERDATATARBALL_TARGET) : PRIVATE_USERDATA_TAR := $( userdata_tar )
$(INSTALLED_USERDATATARBALL_TARGET) : $( FS_GET_STATS ) $( INTERNAL_USERDATAIMAGE_FILES )
$( build-userdatatarball-target)
2016-08-17 01:36:05 +02:00
$( call dist -for -goals ,userdatatarball ,$ ( INSTALLED_USERDATATARBALL_TARGET ) )
2009-03-04 04:28:42 +01:00
.PHONY : userdatatarball -nodeps
userdatatarball-nodeps : $( FS_GET_STATS )
$( build-userdatatarball-target)
2016-04-08 21:08:03 +02:00
# -----------------------------------------------------------------
# partition table image
i f d e f B O A R D _ B P T _ I N P U T _ F I L E S
BUILT_BPTIMAGE_TARGET := $( PRODUCT_OUT) /partition-table.img
2016-08-19 19:59:57 +02:00
BUILT_BPTJSON_TARGET := $( PRODUCT_OUT) /partition-table.bpt
2016-04-08 21:08:03 +02:00
INTERNAL_BVBTOOL_MAKE_TABLE_ARGS := \
--output_gpt $( BUILT_BPTIMAGE_TARGET) \
2016-08-19 19:59:57 +02:00
--output_json $( BUILT_BPTJSON_TARGET) \
2016-04-08 21:08:03 +02:00
$( foreach file, $( BOARD_BPT_INPUT_FILES) , --input $( file) )
i f d e f B O A R D _ B P T _ D I S K _ S I Z E
INTERNAL_BVBTOOL_MAKE_TABLE_ARGS += --disk_size $( BOARD_BPT_DISK_SIZE)
e n d i f
d e f i n e b u i l d - b p t i m a g e - t a r g e t
$( call pretty," Target partition table image: $( INSTALLED_BPTIMAGE_TARGET) " )
$( hide) $( BPTTOOL) make_table $( INTERNAL_BVBTOOL_MAKE_TABLE_ARGS) $( BOARD_BPT_MAKE_TABLE_ARGS)
e n d e f
INSTALLED_BPTIMAGE_TARGET := $( BUILT_BPTIMAGE_TARGET)
2016-08-19 19:59:57 +02:00
$(BUILT_BPTJSON_TARGET) : $( INSTALLED_BPTIMAGE_TARGET )
$( hide) touch -c $( BUILT_BPTJSON_TARGET)
2016-04-08 21:08:03 +02:00
$(INSTALLED_BPTIMAGE_TARGET) : $( BPTTOOL ) $( BOARD_BPT_INPUT_FILES )
$( build-bptimage-target)
.PHONY : bptimage -nodeps
bptimage-nodeps :
$( build-bptimage-target)
e n d i f # BOARD_BPT_INPUT_FILES
2011-11-04 19:37:01 +01:00
# -----------------------------------------------------------------
# cache partition image
Add PRODUCT_BUILD_*_IMAGE, BUILDING_*_IMAGE to control building of images
These centralize the decisions on whether to build certain images or
not, and allow the product definition to override that choice.
There are a few use cases here:
* For GSI-like cases, we only want to build the system image. This
didn't really change, but it's somewhat simpler to configure, and
easier to understand the build logic.
* On the opposite side, when you're planning on using a GSI, the device
specific build can only build the vendor images (or some other set).
* Some cases (Fuchsia, etc) don't want to build any images, as they'll
be distributing the build artifacts in their own packaging.
I suspect in the future, TARGET_BUILD_APPS may be able to be refactored
into the third use case.
Test: treehugger
Test: Create a product definition that includes nothing, try to build it.
Test: compare build-aosp_crosshatch.ninja and build-crosshatch.ninja before/after
Change-Id: I685ab841be3718d3dd7052c28ccd764bb6f1991a
2019-01-16 21:42:05 +01:00
i f d e f B U I L D I N G _ C A C H E _ I M A G E
2011-11-04 19:37:01 +01:00
INTERNAL_CACHEIMAGE_FILES := \
$( filter $( TARGET_OUT_CACHE) /%,$( ALL_DEFAULT_INSTALLED_MODULES) )
cacheimage_intermediates := \
$( call intermediates-dir-for,PACKAGING,cache)
BUILT_CACHEIMAGE_TARGET := $( PRODUCT_OUT) /cache.img
d e f i n e b u i l d - c a c h e i m a g e - t a r g e t
$( call pretty," Target cache fs image: $( INSTALLED_CACHEIMAGE_TARGET) " )
@mkdir -p $( TARGET_OUT_CACHE)
@mkdir -p $( cacheimage_intermediates) && rm -rf $( cacheimage_intermediates) /cache_image_info.txt
2018-05-30 20:16:46 +02:00
$( call generate-image-prop-dictionary, $( cacheimage_intermediates) /cache_image_info.txt,cache,skip_fsck= true )
2011-11-04 19:37:01 +01:00
$( hide) PATH = $( foreach p,$( INTERNAL_USERIMAGES_BINARY_PATHS) ,$( p) :) $$ PATH \
2017-12-06 23:38:40 +01:00
build/make/tools/releasetools/build_image.py \
2015-07-09 18:54:55 +02:00
$( TARGET_OUT_CACHE) $( cacheimage_intermediates) /cache_image_info.txt $( INSTALLED_CACHEIMAGE_TARGET) $( TARGET_OUT)
2014-06-16 23:19:36 +02:00
$( hide) $( call assert-max-image-size,$( INSTALLED_CACHEIMAGE_TARGET) ,$( BOARD_CACHEIMAGE_PARTITION_SIZE) )
2011-11-04 19:37:01 +01:00
e n d e f
# We just build this directly to the install location.
INSTALLED_CACHEIMAGE_TARGET := $( BUILT_CACHEIMAGE_TARGET)
2016-04-19 11:41:27 +02:00
$(INSTALLED_CACHEIMAGE_TARGET) : $( INTERNAL_USERIMAGES_DEPS ) $( INTERNAL_CACHEIMAGE_FILES ) $( BUILD_IMAGE_SRCS )
2011-11-04 19:37:01 +01:00
$( build-cacheimage-target)
.PHONY : cacheimage -nodeps
cacheimage-nodeps : | $( INTERNAL_USERIMAGES_DEPS )
$( build-cacheimage-target)
Add PRODUCT_BUILD_*_IMAGE, BUILDING_*_IMAGE to control building of images
These centralize the decisions on whether to build certain images or
not, and allow the product definition to override that choice.
There are a few use cases here:
* For GSI-like cases, we only want to build the system image. This
didn't really change, but it's somewhat simpler to configure, and
easier to understand the build logic.
* On the opposite side, when you're planning on using a GSI, the device
specific build can only build the vendor images (or some other set).
* Some cases (Fuchsia, etc) don't want to build any images, as they'll
be distributing the build artifacts in their own packaging.
I suspect in the future, TARGET_BUILD_APPS may be able to be refactored
into the third use case.
Test: treehugger
Test: Create a product definition that includes nothing, try to build it.
Test: compare build-aosp_crosshatch.ninja and build-crosshatch.ninja before/after
Change-Id: I685ab841be3718d3dd7052c28ccd764bb6f1991a
2019-01-16 21:42:05 +01:00
e l s e # BUILDING_CACHE_IMAGE
2016-05-14 00:26:09 +02:00
# we need to ignore the broken cache link when doing the rsync
IGNORE_CACHE_LINK := --exclude= cache
Add PRODUCT_BUILD_*_IMAGE, BUILDING_*_IMAGE to control building of images
These centralize the decisions on whether to build certain images or
not, and allow the product definition to override that choice.
There are a few use cases here:
* For GSI-like cases, we only want to build the system image. This
didn't really change, but it's somewhat simpler to configure, and
easier to understand the build logic.
* On the opposite side, when you're planning on using a GSI, the device
specific build can only build the vendor images (or some other set).
* Some cases (Fuchsia, etc) don't want to build any images, as they'll
be distributing the build artifacts in their own packaging.
I suspect in the future, TARGET_BUILD_APPS may be able to be refactored
into the third use case.
Test: treehugger
Test: Create a product definition that includes nothing, try to build it.
Test: compare build-aosp_crosshatch.ninja and build-crosshatch.ninja before/after
Change-Id: I685ab841be3718d3dd7052c28ccd764bb6f1991a
2019-01-16 21:42:05 +01:00
e n d i f # BUILDING_CACHE_IMAGE
2011-11-04 19:37:01 +01:00
2016-06-16 23:47:10 +02:00
# -----------------------------------------------------------------
# system_other partition image
Add PRODUCT_BUILD_*_IMAGE, BUILDING_*_IMAGE to control building of images
These centralize the decisions on whether to build certain images or
not, and allow the product definition to override that choice.
There are a few use cases here:
* For GSI-like cases, we only want to build the system image. This
didn't really change, but it's somewhat simpler to configure, and
easier to understand the build logic.
* On the opposite side, when you're planning on using a GSI, the device
specific build can only build the vendor images (or some other set).
* Some cases (Fuchsia, etc) don't want to build any images, as they'll
be distributing the build artifacts in their own packaging.
I suspect in the future, TARGET_BUILD_APPS may be able to be refactored
into the third use case.
Test: treehugger
Test: Create a product definition that includes nothing, try to build it.
Test: compare build-aosp_crosshatch.ninja and build-crosshatch.ninja before/after
Change-Id: I685ab841be3718d3dd7052c28ccd764bb6f1991a
2019-01-16 21:42:05 +01:00
i f d e f B U I L D I N G _ S Y S T E M _ O T H E R _ I M A G E
2016-06-16 23:47:10 +02:00
i f e q ( $( BOARD_USES_SYSTEM_OTHER_ODEX ) , t r u e )
# Marker file to identify that odex files are installed
INSTALLED_SYSTEM_OTHER_ODEX_MARKER := $( TARGET_OUT_SYSTEM_OTHER) /system-other-odex-marker
ALL_DEFAULT_INSTALLED_MODULES += $( INSTALLED_SYSTEM_OTHER_ODEX_MARKER)
$(INSTALLED_SYSTEM_OTHER_ODEX_MARKER) :
$( hide) touch $@
e n d i f
INTERNAL_SYSTEMOTHERIMAGE_FILES := \
$( filter $( TARGET_OUT_SYSTEM_OTHER) /%,\
$( ALL_DEFAULT_INSTALLED_MODULES) \
2018-03-06 23:07:21 +01:00
$( ALL_PDK_FUSION_FILES) ) \
$( PDK_FUSION_SYMLINK_STAMP)
2016-06-16 23:47:10 +02:00
2018-11-17 06:26:33 +01:00
# system_other dex files are installed as a side-effect of installing system image files
INTERNAL_SYSTEMOTHERIMAGE_FILES += $( INTERNAL_SYSTEMIMAGE_FILES)
2016-06-16 23:47:10 +02:00
INSTALLED_FILES_FILE_SYSTEMOTHER := $( PRODUCT_OUT) /installed-files-system-other.txt
2018-06-13 23:04:22 +02:00
INSTALLED_FILES_JSON_SYSTEMOTHER := $( INSTALLED_FILES_FILE_SYSTEMOTHER:.txt= .json)
$(INSTALLED_FILES_FILE_SYSTEMOTHER) : .KATI_IMPLICIT_OUTPUTS := $( INSTALLED_FILES_JSON_SYSTEMOTHER )
2017-03-16 17:41:19 +01:00
$(INSTALLED_FILES_FILE_SYSTEMOTHER) : $( INTERNAL_SYSTEMOTHERIMAGE_FILES ) $( FILESLIST )
2016-06-16 23:47:10 +02:00
@echo Installed file list: $@
@mkdir -p $( dir $@ )
@rm -f $@
2017-03-16 17:41:19 +01:00
$( hide) $( FILESLIST) $( TARGET_OUT_SYSTEM_OTHER) > $( @:.txt= .json)
2017-12-06 23:38:40 +01:00
$( hide) build/make/tools/fileslist_util.py -c $( @:.txt= .json) > $@
2016-06-16 23:47:10 +02:00
2019-01-29 06:30:18 +01:00
# Determines partition size for system_other.img.
i f e q ( $( PRODUCT_RETROFIT_DYNAMIC_PARTITIONS ) , t r u e )
i f n e q ( $( filter system ,$ ( BOARD_SUPER_PARTITION_BLOCK_DEVICES ) ) , )
INTERNAL_SYSTEM_OTHER_PARTITION_SIZE := $( BOARD_SUPER_PARTITION_SYSTEM_DEVICE_SIZE)
e n d i f
e n d i f
i f n d e f I N T E R N A L _ S Y S T E M _ O T H E R _ P A R T I T I O N _ S I Z E
INTERNAL_SYSTEM_OTHER_PARTITION_SIZE := $( BOARD_SYSTEMIMAGE_PARTITION_SIZE)
e n d i f
2016-06-16 23:47:10 +02:00
systemotherimage_intermediates := \
$( call intermediates-dir-for,PACKAGING,system_other)
BUILT_SYSTEMOTHERIMAGE_TARGET := $( PRODUCT_OUT) /system_other.img
# Note that we assert the size is SYSTEMIMAGE_PARTITION_SIZE since this is the 'b' system image.
d e f i n e b u i l d - s y s t e m o t h e r i m a g e - t a r g e t
$( call pretty," Target system_other fs image: $( INSTALLED_SYSTEMOTHERIMAGE_TARGET) " )
@mkdir -p $( TARGET_OUT_SYSTEM_OTHER)
@mkdir -p $( systemotherimage_intermediates) && rm -rf $( systemotherimage_intermediates) /system_other_image_info.txt
2018-05-30 20:16:46 +02:00
$( call generate-image-prop-dictionary, $( systemotherimage_intermediates) /system_other_image_info.txt,system,skip_fsck= true )
2016-06-16 23:47:10 +02:00
$( hide) PATH = $( foreach p,$( INTERNAL_USERIMAGES_BINARY_PATHS) ,$( p) :) $$ PATH \
2017-12-06 23:38:40 +01:00
build/make/tools/releasetools/build_image.py \
2018-06-19 01:32:35 +02:00
$( TARGET_OUT_SYSTEM_OTHER) $( systemotherimage_intermediates) /system_other_image_info.txt $( INSTALLED_SYSTEMOTHERIMAGE_TARGET) $( TARGET_OUT) \
$( systemotherimage_intermediates) /generated_system_other_image_info.txt
$( hide) $( call assert-max-image-size,$( INSTALLED_SYSTEMOTHERIMAGE_TARGET) ,\
$( call read-image-prop-dictionary,\
2019-01-29 06:30:18 +01:00
$( systemotherimage_intermediates) /generated_system_other_image_info.txt,system_other_size) )
2016-06-16 23:47:10 +02:00
e n d e f
# We just build this directly to the install location.
INSTALLED_SYSTEMOTHERIMAGE_TARGET := $( BUILT_SYSTEMOTHERIMAGE_TARGET)
2017-06-16 19:24:54 +02:00
i f n e q ( t r u e , $( SANITIZE_LITE ) )
# Only create system_other when not building the second stage of a SANITIZE_LITE build.
2016-06-16 23:47:10 +02:00
$(INSTALLED_SYSTEMOTHERIMAGE_TARGET) : $( INTERNAL_USERIMAGES_DEPS ) $( INTERNAL_SYSTEMOTHERIMAGE_FILES ) $( INSTALLED_FILES_FILE_SYSTEMOTHER )
$( build-systemotherimage-target)
2017-06-16 19:24:54 +02:00
e n d i f
2016-06-16 23:47:10 +02:00
.PHONY : systemotherimage -nodeps
systemotherimage-nodeps : | $( INTERNAL_USERIMAGES_DEPS )
$( build-systemotherimage-target)
Add PRODUCT_BUILD_*_IMAGE, BUILDING_*_IMAGE to control building of images
These centralize the decisions on whether to build certain images or
not, and allow the product definition to override that choice.
There are a few use cases here:
* For GSI-like cases, we only want to build the system image. This
didn't really change, but it's somewhat simpler to configure, and
easier to understand the build logic.
* On the opposite side, when you're planning on using a GSI, the device
specific build can only build the vendor images (or some other set).
* Some cases (Fuchsia, etc) don't want to build any images, as they'll
be distributing the build artifacts in their own packaging.
I suspect in the future, TARGET_BUILD_APPS may be able to be refactored
into the third use case.
Test: treehugger
Test: Create a product definition that includes nothing, try to build it.
Test: compare build-aosp_crosshatch.ninja and build-crosshatch.ninja before/after
Change-Id: I685ab841be3718d3dd7052c28ccd764bb6f1991a
2019-01-16 21:42:05 +01:00
e n d i f # BUILDING_SYSTEM_OTHER_IMAGE
2016-06-16 23:47:10 +02:00
2013-03-20 19:02:05 +01:00
# -----------------------------------------------------------------
# vendor partition image
Add PRODUCT_BUILD_*_IMAGE, BUILDING_*_IMAGE to control building of images
These centralize the decisions on whether to build certain images or
not, and allow the product definition to override that choice.
There are a few use cases here:
* For GSI-like cases, we only want to build the system image. This
didn't really change, but it's somewhat simpler to configure, and
easier to understand the build logic.
* On the opposite side, when you're planning on using a GSI, the device
specific build can only build the vendor images (or some other set).
* Some cases (Fuchsia, etc) don't want to build any images, as they'll
be distributing the build artifacts in their own packaging.
I suspect in the future, TARGET_BUILD_APPS may be able to be refactored
into the third use case.
Test: treehugger
Test: Create a product definition that includes nothing, try to build it.
Test: compare build-aosp_crosshatch.ninja and build-crosshatch.ninja before/after
Change-Id: I685ab841be3718d3dd7052c28ccd764bb6f1991a
2019-01-16 21:42:05 +01:00
i f d e f B U I L D I N G _ V E N D O R _ I M A G E
2013-03-20 19:02:05 +01:00
INTERNAL_VENDORIMAGE_FILES := \
2014-07-17 02:46:35 +02:00
$( filter $( TARGET_OUT_VENDOR) /%,\
$( ALL_DEFAULT_INSTALLED_MODULES) \
2018-03-06 23:07:21 +01:00
$( ALL_PDK_FUSION_FILES) ) \
$( PDK_FUSION_SYMLINK_STAMP)
2014-07-17 02:46:35 +02:00
2018-05-01 18:54:21 +02:00
# Final Vendor VINTF manifest including fragments. This is not assembled
# on the device because it depends on everything in a given device
# image which defines a vintf_fragment.
i f d e f B U I L T _ V E N D O R _ M A N I F E S T
BUILT_ASSEMBLED_VENDOR_MANIFEST := $( PRODUCT_OUT) /verified_assembled_vendor_manifest.xml
i f e q ( t r u e , $( strip $ ( PRODUCT_ENFORCE_VINTF_MANIFEST ) ) )
2019-01-28 19:32:37 +01:00
i f n e q ( $( strip $ ( DEVICE_FRAMEWORK_COMPATIBILITY_MATRIX_FILE ) $ ( DEVICE_PRODUCT_COMPATIBILITY_MATRIX_FILE ) ) , )
2018-05-01 18:54:21 +02:00
$(BUILT_ASSEMBLED_VENDOR_MANIFEST) : PRIVATE_SYSTEM_ASSEMBLE_VINTF_ENV_VARS := VINTF_ENFORCE_NO_UNUSED_HALS =true
2019-01-28 19:32:37 +01:00
e n d i f # DEVICE_FRAMEWORK_COMPATIBILITY_MATRIX_FILE or DEVICE_PRODUCT_COMPATIBILITY_MATRIX_FILE
2018-05-01 18:54:21 +02:00
e n d i f # PRODUCT_ENFORCE_VINTF_MANIFEST
$(BUILT_ASSEMBLED_VENDOR_MANIFEST) : $( HOST_OUT_EXECUTABLES ) /assemble_vintf
$(BUILT_ASSEMBLED_VENDOR_MANIFEST) : $( BUILT_SYSTEM_MATRIX )
$(BUILT_ASSEMBLED_VENDOR_MANIFEST) : $( BUILT_VENDOR_MANIFEST )
$(BUILT_ASSEMBLED_VENDOR_MANIFEST) : $( INTERNAL_VENDORIMAGE_FILES )
2018-11-02 21:43:30 +01:00
$(BUILT_ASSEMBLED_VENDOR_MANIFEST) : PRIVATE_FLAGS :=
# -- Kernel version and configurations.
i f e q ( $( PRODUCT_OTA_ENFORCE_VINTF_KERNEL_REQUIREMENTS ) , t r u e )
# BOARD_KERNEL_CONFIG_FILE and BOARD_KERNEL_VERSION can be used to override the values extracted
# from INSTALLED_KERNEL_TARGET.
i f d e f B O A R D _ K E R N E L _ C O N F I G _ F I L E
i f d e f B O A R D _ K E R N E L _ V E R S I O N
$(BUILT_ASSEMBLED_VENDOR_MANIFEST) : $( BOARD_KERNEL_CONFIG_FILE )
$(BUILT_ASSEMBLED_VENDOR_MANIFEST) : PRIVATE_FLAGS += --kernel $( BOARD_KERNEL_VERSION ) :$( BOARD_KERNEL_CONFIG_FILE )
my_board_extracted_kernel := true
e n d i f # BOARD_KERNEL_VERSION
e n d i f # BOARD_KERNEL_CONFIG_FILE
i f n e q ( $( my_board_extracted_kernel ) , t r u e )
i f n d e f I N S T A L L E D _ K E R N E L _ T A R G E T
$( warning No INSTALLED_KERNEL_TARGET is defined when PRODUCT_OTA_ENFORCE_VINTF_KERNEL_REQUIREMENTS \
is true. Information about the updated kernel cannot be built into OTA update package. \
You can fix this by: ( 1) setting TARGET_NO_KERNEL to false and installing the built kernel \
to $( PRODUCT_OUT) /kernel, so that kernel information will be extracted from the built kernel; \
or ( 2) extracting kernel configuration and defining BOARD_KERNEL_CONFIG_FILE and \
BOARD_KERNEL_VERSION manually; or ( 3) unsetting PRODUCT_OTA_ENFORCE_VINTF_KERNEL_REQUIREMENTS \
manually.)
e l s e
intermediates := $( call intermediates-dir-for,ETC,$( notdir $( BUILT_ASSEMBLED_VENDOR_MANIFEST) ) )
# Tools for decompression that is not in PATH.
# Check $(EXTRACT_KERNEL) for decompression algorithms supported by the script.
# Algorithms that are in the script but not in this list will be found in PATH.
my_decompress_tools := \
lz4:$( HOST_OUT_EXECUTABLES) /lz4 \
my_kernel_configs := $( intermediates) /kernel_configs.txt
my_kernel_version := $( intermediates) /kernel_version.txt
$(my_kernel_configs) : .KATI_IMPLICIT_OUTPUTS := $( my_kernel_version )
$(my_kernel_configs) : PRIVATE_KERNEL_VERSION_FILE := $( my_kernel_version )
$(my_kernel_configs) : PRIVATE_DECOMPRESS_TOOLS := $( my_decompress_tools )
$(my_kernel_configs) : $( foreach pair ,$ ( my_decompress_tools ) ,$ ( call word -colon ,2,$ ( pair ) ) )
$(my_kernel_configs) : $( EXTRACT_KERNEL ) $( INSTALLED_KERNEL_TARGET )
$< --tools $( PRIVATE_DECOMPRESS_TOOLS) --input $( INSTALLED_KERNEL_TARGET) \
--output-configs $@ \
--output-version $( PRIVATE_KERNEL_VERSION_FILE)
$(BUILT_ASSEMBLED_VENDOR_MANIFEST) : $( my_kernel_configs ) $( my_kernel_version )
$(BUILT_ASSEMBLED_VENDOR_MANIFEST) : PRIVATE_FLAGS += --kernel $$( cat $ ( my_kernel_version ) ) :$( my_kernel_configs )
intermediates :=
my_kernel_configs :=
my_kernel_version :=
my_decompress_tools :=
e n d i f # my_board_extracted_kernel
my_board_extracted_kernel :=
e n d i f # INSTALLED_KERNEL_TARGET
e n d i f # PRODUCT_OTA_ENFORCE_VINTF_KERNEL_REQUIREMENTS
$(BUILT_ASSEMBLED_VENDOR_MANIFEST) :
2018-05-01 18:54:21 +02:00
@echo "Verifying vendor VINTF manifest."
PRODUCT_ENFORCE_VINTF_MANIFEST = $( PRODUCT_ENFORCE_VINTF_MANIFEST) \
$( PRIVATE_SYSTEM_ASSEMBLE_VINTF_ENV_VARS) \
$( HOST_OUT_EXECUTABLES) /assemble_vintf \
2018-11-02 21:43:30 +01:00
$( PRIVATE_FLAGS) \
2018-11-26 19:12:05 +01:00
-c $( BUILT_SYSTEM_MATRIX) \
-i $( BUILT_VENDOR_MANIFEST) \
$$ ( [ -d $( TARGET_OUT_VENDOR) /etc/vintf/manifest ] && \
find $( TARGET_OUT_VENDOR) /etc/vintf/manifest -type f -name "*.xml" | \
sed "s/^/-i /" | tr '\n' ' ' ) -o $@
2018-05-01 18:54:21 +02:00
e n d i f # BUILT_VENDOR_MANIFEST
2014-07-17 02:46:35 +02:00
# platform.zip depends on $(INTERNAL_VENDORIMAGE_FILES).
$(INSTALLED_PLATFORM_ZIP) : $( INTERNAL_VENDORIMAGE_FILES )
2013-03-20 19:02:05 +01:00
2015-09-15 23:22:12 +02:00
INSTALLED_FILES_FILE_VENDOR := $( PRODUCT_OUT) /installed-files-vendor.txt
2018-06-13 23:04:22 +02:00
INSTALLED_FILES_JSON_VENDOR := $( INSTALLED_FILES_FILE_VENDOR:.txt= .json)
$(INSTALLED_FILES_FILE_VENDOR) : .KATI_IMPLICIT_OUTPUTS := $( INSTALLED_FILES_JSON_VENDOR )
2017-03-16 17:41:19 +01:00
$(INSTALLED_FILES_FILE_VENDOR) : $( INTERNAL_VENDORIMAGE_FILES ) $( FILESLIST )
2015-09-15 23:22:12 +02:00
@echo Installed file list: $@
@mkdir -p $( dir $@ )
@rm -f $@
2017-03-16 17:41:19 +01:00
$( hide) $( FILESLIST) $( TARGET_OUT_VENDOR) > $( @:.txt= .json)
2017-12-06 23:38:40 +01:00
$( hide) build/make/tools/fileslist_util.py -c $( @:.txt= .json) > $@
2015-09-15 23:22:12 +02:00
2013-03-20 19:02:05 +01:00
vendorimage_intermediates := \
$( call intermediates-dir-for,PACKAGING,vendor)
BUILT_VENDORIMAGE_TARGET := $( PRODUCT_OUT) /vendor.img
d e f i n e b u i l d - v e n d o r i m a g e - t a r g e t
$( call pretty," Target vendor fs image: $( INSTALLED_VENDORIMAGE_TARGET) " )
@mkdir -p $( TARGET_OUT_VENDOR)
2017-11-14 16:42:30 +01:00
$( call create-vendor-odm-symlink)
2013-03-20 19:02:05 +01:00
@mkdir -p $( vendorimage_intermediates) && rm -rf $( vendorimage_intermediates) /vendor_image_info.txt
2018-05-30 20:16:46 +02:00
$( call generate-image-prop-dictionary, $( vendorimage_intermediates) /vendor_image_info.txt,vendor,skip_fsck= true )
2017-02-22 10:27:10 +01:00
$( if $( BOARD_VENDOR_KERNEL_MODULES) , \
$( call build-image-kernel-modules,$( BOARD_VENDOR_KERNEL_MODULES) ,$( TARGET_OUT_VENDOR) ,vendor/,$( call intermediates-dir-for,PACKAGING,depmod_vendor) ) )
2013-03-20 19:02:05 +01:00
$( hide) PATH = $( foreach p,$( INTERNAL_USERIMAGES_BINARY_PATHS) ,$( p) :) $$ PATH \
2017-12-06 23:38:40 +01:00
build/make/tools/releasetools/build_image.py \
2018-06-20 01:23:16 +02:00
$( TARGET_OUT_VENDOR) $( vendorimage_intermediates) /vendor_image_info.txt $( INSTALLED_VENDORIMAGE_TARGET) $( TARGET_OUT) \
$( vendorimage_intermediates) /generated_vendor_image_info.txt
$( hide) $( call assert-max-image-size,$( INSTALLED_VENDORIMAGE_TARGET) ,\
$( call read-image-prop-dictionary,\
$( vendorimage_intermediates) /generated_vendor_image_info.txt,vendor_size) )
2013-03-20 19:02:05 +01:00
e n d e f
# We just build this directly to the install location.
INSTALLED_VENDORIMAGE_TARGET := $( BUILT_VENDORIMAGE_TARGET)
2018-05-01 18:54:21 +02:00
i f d e f B U I L T _ V E N D O R _ M A N I F E S T
$(INSTALLED_VENDORIMAGE_TARGET) : $( BUILT_ASSEMBLED_VENDOR_MANIFEST )
e n d i f
2017-02-22 10:27:10 +01:00
$(INSTALLED_VENDORIMAGE_TARGET) : $( INTERNAL_USERIMAGES_DEPS ) $( INTERNAL_VENDORIMAGE_FILES ) $( INSTALLED_FILES_FILE_VENDOR ) $( BUILD_IMAGE_SRCS ) $( DEPMOD ) $( BOARD_VENDOR_KERNEL_MODULES )
2013-03-20 19:02:05 +01:00
$( build-vendorimage-target)
2017-03-07 21:10:09 +01:00
.PHONY : vendorimage -nodeps vnod
vendorimage-nodeps vnod : | $( INTERNAL_USERIMAGES_DEPS ) $( DEPMOD )
2013-03-20 19:02:05 +01:00
$( build-vendorimage-target)
2017-06-21 01:57:52 +02:00
sync : $( INTERNAL_VENDORIMAGE_FILES )
2016-06-17 23:07:37 +02:00
e l s e i f d e f B O A R D _ P R E B U I L T _ V E N D O R I M A G E
INSTALLED_VENDORIMAGE_TARGET := $( PRODUCT_OUT) /vendor.img
$( eval $ ( call copy -one -file ,$ ( BOARD_PREBUILT_VENDORIMAGE ) ,$ ( INSTALLED_VENDORIMAGE_TARGET ) ) )
e n d i f
2013-03-20 19:02:05 +01:00
2017-11-27 09:04:47 +01:00
# -----------------------------------------------------------------
# product partition image
Add PRODUCT_BUILD_*_IMAGE, BUILDING_*_IMAGE to control building of images
These centralize the decisions on whether to build certain images or
not, and allow the product definition to override that choice.
There are a few use cases here:
* For GSI-like cases, we only want to build the system image. This
didn't really change, but it's somewhat simpler to configure, and
easier to understand the build logic.
* On the opposite side, when you're planning on using a GSI, the device
specific build can only build the vendor images (or some other set).
* Some cases (Fuchsia, etc) don't want to build any images, as they'll
be distributing the build artifacts in their own packaging.
I suspect in the future, TARGET_BUILD_APPS may be able to be refactored
into the third use case.
Test: treehugger
Test: Create a product definition that includes nothing, try to build it.
Test: compare build-aosp_crosshatch.ninja and build-crosshatch.ninja before/after
Change-Id: I685ab841be3718d3dd7052c28ccd764bb6f1991a
2019-01-16 21:42:05 +01:00
i f d e f B U I L D I N G _ P R O D U C T _ I M A G E
2017-11-27 09:04:47 +01:00
INTERNAL_PRODUCTIMAGE_FILES := \
$( filter $( TARGET_OUT_PRODUCT) /%,\
$( ALL_DEFAULT_INSTALLED_MODULES) \
2018-03-06 23:07:21 +01:00
$( ALL_PDK_FUSION_FILES) ) \
$( PDK_FUSION_SYMLINK_STAMP)
2017-11-27 09:04:47 +01:00
# platform.zip depends on $(INTERNAL_PRODUCTIMAGE_FILES).
$(INSTALLED_PLATFORM_ZIP) : $( INTERNAL_PRODUCTIMAGE_FILES )
INSTALLED_FILES_FILE_PRODUCT := $( PRODUCT_OUT) /installed-files-product.txt
2018-06-13 23:04:22 +02:00
INSTALLED_FILES_JSON_PRODUCT := $( INSTALLED_FILES_FILE_PRODUCT:.txt= .json)
$(INSTALLED_FILES_FILE_PRODUCT) : .KATI_IMPLICIT_OUTPUTS := $( INSTALLED_FILES_JSON_PRODUCT )
2017-11-27 09:04:47 +01:00
$(INSTALLED_FILES_FILE_PRODUCT) : $( INTERNAL_PRODUCTIMAGE_FILES ) $( FILESLIST )
@echo Installed file list: $@
@mkdir -p $( dir $@ )
@rm -f $@
$( hide) $( FILESLIST) $( TARGET_OUT_PRODUCT) > $( @:.txt= .json)
$( hide) build/tools/fileslist_util.py -c $( @:.txt= .json) > $@
productimage_intermediates := \
$( call intermediates-dir-for,PACKAGING,product)
BUILT_PRODUCTIMAGE_TARGET := $( PRODUCT_OUT) /product.img
d e f i n e b u i l d - p r o d u c t i m a g e - t a r g e t
$( call pretty," Target product fs image: $( INSTALLED_PRODUCTIMAGE_TARGET) " )
@mkdir -p $( TARGET_OUT_PRODUCT)
@mkdir -p $( productimage_intermediates) && rm -rf $( productimage_intermediates) /product_image_info.txt
2018-05-30 20:16:46 +02:00
$( call generate-image-prop-dictionary, $( productimage_intermediates) /product_image_info.txt,product,skip_fsck= true )
2017-11-27 09:04:47 +01:00
$( hide) PATH = $( foreach p,$( INTERNAL_USERIMAGES_BINARY_PATHS) ,$( p) :) $$ PATH \
./build/tools/releasetools/build_image.py \
2018-07-21 00:19:34 +02:00
$( TARGET_OUT_PRODUCT) $( productimage_intermediates) /product_image_info.txt $( INSTALLED_PRODUCTIMAGE_TARGET) $( TARGET_OUT) \
$( productimage_intermediates) /generated_product_image_info.txt
$( hide) $( call assert-max-image-size,$( INSTALLED_PRODUCTIMAGE_TARGET) ,\
$( call read-image-prop-dictionary,\
$( productimage_intermediates) /generated_product_image_info.txt,product_size) )
2017-11-27 09:04:47 +01:00
e n d e f
# We just build this directly to the install location.
INSTALLED_PRODUCTIMAGE_TARGET := $( BUILT_PRODUCTIMAGE_TARGET)
$(INSTALLED_PRODUCTIMAGE_TARGET) : $( INTERNAL_USERIMAGES_DEPS ) $( INTERNAL_PRODUCTIMAGE_FILES ) $( INSTALLED_FILES_FILE_PRODUCT ) $( BUILD_IMAGE_SRCS )
$( build-productimage-target)
.PHONY : productimage -nodeps pnod
productimage-nodeps pnod : | $( INTERNAL_USERIMAGES_DEPS )
$( build-productimage-target)
sync : $( INTERNAL_PRODUCTIMAGE_FILES )
e l s e i f d e f B O A R D _ P R E B U I L T _ P R O D U C T I M A G E
INSTALLED_PRODUCTIMAGE_TARGET := $( PRODUCT_OUT) /product.img
$( eval $ ( call copy -one -file ,$ ( BOARD_PREBUILT_PRODUCTIMAGE ) ,$ ( INSTALLED_PRODUCTIMAGE_TARGET ) ) )
e n d i f
2018-05-29 14:09:01 +02:00
# -----------------------------------------------------------------
2018-08-17 01:56:14 +02:00
# product_services partition image
Add PRODUCT_BUILD_*_IMAGE, BUILDING_*_IMAGE to control building of images
These centralize the decisions on whether to build certain images or
not, and allow the product definition to override that choice.
There are a few use cases here:
* For GSI-like cases, we only want to build the system image. This
didn't really change, but it's somewhat simpler to configure, and
easier to understand the build logic.
* On the opposite side, when you're planning on using a GSI, the device
specific build can only build the vendor images (or some other set).
* Some cases (Fuchsia, etc) don't want to build any images, as they'll
be distributing the build artifacts in their own packaging.
I suspect in the future, TARGET_BUILD_APPS may be able to be refactored
into the third use case.
Test: treehugger
Test: Create a product definition that includes nothing, try to build it.
Test: compare build-aosp_crosshatch.ninja and build-crosshatch.ninja before/after
Change-Id: I685ab841be3718d3dd7052c28ccd764bb6f1991a
2019-01-16 21:42:05 +01:00
i f d e f B U I L D I N G _ P R O D U C T _ S E R V I C E S _ I M A G E
2018-05-29 14:09:01 +02:00
INTERNAL_PRODUCT_SERVICESIMAGE_FILES := \
$( filter $( TARGET_OUT_PRODUCT_SERVICES) /%,\
$( ALL_DEFAULT_INSTALLED_MODULES) \
$( ALL_PDK_FUSION_FILES) ) \
$( PDK_FUSION_SYMLINK_STAMP)
# platform.zip depends on $(INTERNAL_PRODUCT_SERVICESIMAGE_FILES).
$(INSTALLED_PLATFORM_ZIP) : $( INTERNAL_PRODUCT_SERVICESIMAGE_FILES )
2018-08-17 01:56:14 +02:00
INSTALLED_FILES_FILE_PRODUCT_SERVICES := $( PRODUCT_OUT) /installed-files-product_services.txt
2018-05-29 14:09:01 +02:00
INSTALLED_FILES_JSON_PRODUCT_SERVICES := $( INSTALLED_FILES_FILE_PRODUCT_SERVICES:.txt= .json)
$(INSTALLED_FILES_FILE_PRODUCT_SERVICES) : .KATI_IMPLICIT_OUTPUTS := $( INSTALLED_FILES_JSON_PRODUCT_SERVICES )
$(INSTALLED_FILES_FILE_PRODUCT_SERVICES) : $( INTERNAL_PRODUCT_SERVICESIMAGE_FILES ) $( FILESLIST )
@echo Installed file list: $@
@mkdir -p $( dir $@ )
@rm -f $@
$( hide) $( FILESLIST) $( TARGET_OUT_PRODUCT_SERVICES) > $( @:.txt= .json)
$( hide) build/tools/fileslist_util.py -c $( @:.txt= .json) > $@
2018-07-27 01:02:52 +02:00
product_servicesimage_intermediates := \
$( call intermediates-dir-for,PACKAGING,product_services)
2018-08-17 01:56:14 +02:00
BUILT_PRODUCT_SERVICESIMAGE_TARGET := $( PRODUCT_OUT) /product_services.img
d e f i n e b u i l d - p r o d u c t _ s e r v i c e s i m a g e - t a r g e t
$( call pretty," Target product_services fs image: $( INSTALLED_PRODUCT_SERVICESIMAGE_TARGET) " )
2018-05-29 14:09:01 +02:00
@mkdir -p $( TARGET_OUT_PRODUCT_SERVICES)
2018-07-27 01:02:52 +02:00
@mkdir -p $( product_servicesimage_intermediates) && rm -rf $( product_servicesimage_intermediates) /product_services_image_info.txt
$( call generate-image-prop-dictionary, $( product_servicesimage_intermediates) /product_services_image_info.txt,product_services, skip_fsck = true )
2018-05-29 14:09:01 +02:00
$( hide) PATH = $( foreach p,$( INTERNAL_USERIMAGES_BINARY_PATHS) ,$( p) :) $$ PATH \
./build/tools/releasetools/build_image.py \
2018-07-27 01:02:52 +02:00
$( TARGET_OUT_PRODUCT_SERVICES) $( product_servicesimage_intermediates) /product_services_image_info.txt $( INSTALLED_PRODUCT_SERVICESIMAGE_TARGET) $( TARGET_OUT) \
$( product_servicesimage_intermediates) /generated_product_services_image_info.txt
2018-07-21 00:33:47 +02:00
$( hide) $( call assert-max-image-size,$( INSTALLED_PRODUCT_SERVICESIMAGE_TARGET) ,\
$( call read-image-prop-dictionary,\
2018-07-27 01:02:52 +02:00
$( product_servicesimage_intermediates) /generated_product_services_image_info.txt,product_services_size) )
2018-05-29 14:09:01 +02:00
e n d e f
# We just build this directly to the install location.
INSTALLED_PRODUCT_SERVICESIMAGE_TARGET := $( BUILT_PRODUCT_SERVICESIMAGE_TARGET)
$(INSTALLED_PRODUCT_SERVICESIMAGE_TARGET) : $( INTERNAL_USERIMAGES_DEPS ) $( INTERNAL_PRODUCT_SERVICESIMAGE_FILES ) $( INSTALLED_FILES_FILE_PRODUCT_SERVICES ) $( BUILD_IMAGE_SRCS )
2018-08-17 01:56:14 +02:00
$( build-product_servicesimage-target)
2018-05-29 14:09:01 +02:00
.PHONY : productservicesimage -nodeps psnod
productservicesimage-nodeps psnod : | $( INTERNAL_USERIMAGES_DEPS )
2018-08-17 01:56:14 +02:00
$( build-product_servicesimage-target)
2018-05-29 14:09:01 +02:00
sync : $( INTERNAL_PRODUCT_SERVICESIMAGE_FILES )
e l s e i f d e f B O A R D _ P R E B U I L T _ P R O D U C T _ S E R V I C E S I M A G E
2018-08-17 01:56:14 +02:00
INSTALLED_PRODUCT_SERVICESIMAGE_TARGET := $( PRODUCT_OUT) /product_services.img
2018-05-29 14:09:01 +02:00
$( eval $ ( call copy -one -file ,$ ( BOARD_PREBUILT_PRODUCT_SERVICESIMAGE ) ,$ ( INSTALLED_PRODUCT_SERVICESIMAGE_TARGET ) ) )
e n d i f
2017-11-14 16:42:30 +01:00
# -----------------------------------------------------------------
# odm partition image
Add PRODUCT_BUILD_*_IMAGE, BUILDING_*_IMAGE to control building of images
These centralize the decisions on whether to build certain images or
not, and allow the product definition to override that choice.
There are a few use cases here:
* For GSI-like cases, we only want to build the system image. This
didn't really change, but it's somewhat simpler to configure, and
easier to understand the build logic.
* On the opposite side, when you're planning on using a GSI, the device
specific build can only build the vendor images (or some other set).
* Some cases (Fuchsia, etc) don't want to build any images, as they'll
be distributing the build artifacts in their own packaging.
I suspect in the future, TARGET_BUILD_APPS may be able to be refactored
into the third use case.
Test: treehugger
Test: Create a product definition that includes nothing, try to build it.
Test: compare build-aosp_crosshatch.ninja and build-crosshatch.ninja before/after
Change-Id: I685ab841be3718d3dd7052c28ccd764bb6f1991a
2019-01-16 21:42:05 +01:00
i f d e f B U I L D I N G _ O D M _ I M A G E
2017-11-14 16:42:30 +01:00
INTERNAL_ODMIMAGE_FILES := \
$( filter $( TARGET_OUT_ODM) /%,\
$( ALL_DEFAULT_INSTALLED_MODULES) \
$( ALL_PDK_FUSION_FILES) ) \
$( PDK_FUSION_SYMLINK_STAMP)
# platform.zip depends on $(INTERNAL_ODMIMAGE_FILES).
$(INSTALLED_PLATFORM_ZIP) : $( INTERNAL_ODMIMAGE_FILES )
INSTALLED_FILES_FILE_ODM := $( PRODUCT_OUT) /installed-files-odm.txt
INSTALLED_FILES_JSON_ODM := $( INSTALLED_FILES_FILE_ODM:.txt= .json)
$(INSTALLED_FILES_FILE_ODM) : .KATI_IMPLICIT_OUTPUTS := $( INSTALLED_FILES_JSON_ODM )
$(INSTALLED_FILES_FILE_ODM) : $( INTERNAL_ODMIMAGE_FILES ) $( FILESLIST )
@echo Installed file list: $@
@mkdir -p $( dir $@ )
@rm -f $@
$( hide) $( FILESLIST) $( TARGET_OUT_ODM) > $( @:.txt= .json)
$( hide) build/tools/fileslist_util.py -c $( @:.txt= .json) > $@
odmimage_intermediates := \
$( call intermediates-dir-for,PACKAGING,odm)
BUILT_ODMIMAGE_TARGET := $( PRODUCT_OUT) /odm.img
d e f i n e b u i l d - o d m i m a g e - t a r g e t
$( call pretty," Target odm fs image: $( INSTALLED_ODMIMAGE_TARGET) " )
@mkdir -p $( TARGET_OUT_ODM)
@mkdir -p $( odmimage_intermediates) && rm -rf $( odmimage_intermediates) /odm_image_info.txt
$( call generate-userimage-prop-dictionary, $( odmimage_intermediates) /odm_image_info.txt, skip_fsck = true )
$( if $( BOARD_ODM_KERNEL_MODULES) , \
$( call build-image-kernel-modules,$( BOARD_ODM_KERNEL_MODULES) ,$( TARGET_OUT_ODM) ,odm/,$( call intermediates-dir-for,PACKAGING,depmod_odm) ) )
$( hide) PATH = $( foreach p,$( INTERNAL_USERIMAGES_BINARY_PATHS) ,$( p) :) $$ PATH \
./build/tools/releasetools/build_image.py \
$( TARGET_OUT_ODM) $( odmimage_intermediates) /odm_image_info.txt $( INSTALLED_ODMIMAGE_TARGET) $( TARGET_OUT) \
$( odmimage_intermediates) /generated_odm_image_info.txt
$( hide) $( call assert-max-image-size,$( INSTALLED_ODMIMAGE_TARGET) ,\
$( call read-image-prop-dictionary,\
$( odmimage_intermediates) /generated_odm_image_info.txt,odm_size) )
e n d e f
# We just build this directly to the install location.
INSTALLED_ODMIMAGE_TARGET := $( BUILT_ODMIMAGE_TARGET)
$(INSTALLED_ODMIMAGE_TARGET) : $( INTERNAL_USERIMAGES_DEPS ) $( INTERNAL_ODMIMAGE_FILES ) $( INSTALLED_FILES_FILE_ODM ) $( BUILD_IMAGE_SRCS ) $( DEPMOD ) $( BOARD_ODM_KERNEL_MODULES )
$( build-odmimage-target)
.PHONY : odmimage -nodeps onod
odmimage-nodeps onod : | $( INTERNAL_USERIMAGES_DEPS ) $( DEPMOD )
$( build-odmimage-target)
sync : $( INTERNAL_ODMIMAGE_FILES )
e l s e i f d e f B O A R D _ P R E B U I L T _ O D M I M A G E
INSTALLED_ODMIMAGE_TARGET := $( PRODUCT_OUT) /odm.img
$( eval $ ( call copy -one -file ,$ ( BOARD_PREBUILT_ODMIMAGE ) ,$ ( INSTALLED_ODMIMAGE_TARGET ) ) )
e n d i f
2017-04-27 09:34:50 +02:00
# -----------------------------------------------------------------
# dtbo image
i f d e f B O A R D _ P R E B U I L T _ D T B O I M A G E
INSTALLED_DTBOIMAGE_TARGET := $( PRODUCT_OUT) /dtbo.img
i f e q ( $( BOARD_AVB_ENABLE ) , t r u e )
2017-05-26 12:30:04 +02:00
$(INSTALLED_DTBOIMAGE_TARGET) : $( BOARD_PREBUILT_DTBOIMAGE ) $( AVBTOOL ) $( BOARD_AVB_DTBO_KEY_PATH )
2017-04-27 09:34:50 +02:00
cp $( BOARD_PREBUILT_DTBOIMAGE) $@
$( AVBTOOL) add_hash_footer \
2018-11-26 19:12:05 +01:00
--image $@ \
--partition_size $( BOARD_DTBOIMG_PARTITION_SIZE) \
--partition_name dtbo $( INTERNAL_AVB_DTBO_SIGNING_ARGS) \
$( BOARD_AVB_DTBO_ADD_HASH_FOOTER_ARGS)
2017-04-27 09:34:50 +02:00
e l s e
$(INSTALLED_DTBOIMAGE_TARGET) : $( BOARD_PREBUILT_DTBOIMAGE )
cp $( BOARD_PREBUILT_DTBOIMAGE) $@
e n d i f
2018-08-23 07:53:41 +02:00
e n d i f # BOARD_PREBUILT_DTBOIMAGE
# Returns a list of image targets corresponding to the given list of partitions. For example, it
# returns "$(INSTALLED_PRODUCTIMAGE_TARGET)" for "product", or "$(INSTALLED_SYSTEMIMAGE_TARGET)
# $(INSTALLED_VENDORIMAGE_TARGET)" for "system vendor".
# (1): list of partitions like "system", "vendor" or "system product product_services".
d e f i n e i m a g e s - f o r - p a r t i t i o n s
$( strip $ ( foreach item ,$ ( 1) ,$ ( INSTALLED_ $ ( call to -upper ,$ ( item ) ) IMAGE_TARGET ) ) )
e n d e f
2017-04-27 09:34:50 +02:00
2017-03-31 09:21:26 +02:00
# -----------------------------------------------------------------
# vbmeta image
i f e q ( $( BOARD_AVB_ENABLE ) , t r u e )
BUILT_VBMETAIMAGE_TARGET := $( PRODUCT_OUT) /vbmeta.img
2017-05-26 12:30:04 +02:00
AVB_CHAIN_KEY_DIR := $( TARGET_OUT_INTERMEDIATES) /avb_chain_keys
2017-03-31 09:21:26 +02:00
2017-05-26 12:30:04 +02:00
i f d e f B O A R D _ A V B _ K E Y _ P A T H
$( if $ ( BOARD_AVB_ALGORITHM ) ,,$ ( error BOARD_AVB_ALGORITHM is not defined ) )
e l s e
# If key path isn't specified, use the 4096-bit test key.
BOARD_AVB_ALGORITHM := SHA256_RSA4096
BOARD_AVB_KEY_PATH := external/avb/test/data/testkey_rsa4096.pem
e n d i f
2019-01-23 15:19:19 +01:00
# AVB signing for system_other.img.
i f d e f B U I L D I N G _ S Y S T E M _ O T H E R _ I M A G E
i f d e f B O A R D _ A V B _ S Y S T E M _ O T H E R _ K E Y _ P A T H
$( if $ ( BOARD_AVB_SYSTEM_OTHER_ALGORITHM ) ,,$ ( error BOARD_AVB_SYSTEM_OTHER_ALGORITHM is not defined ) )
e l s e
# If key path isn't specified, use the same key as BOARD_AVB_KEY_PATH.
BOARD_AVB_SYSTEM_OTHER_KEY_PATH := $( BOARD_AVB_KEY_PATH)
BOARD_AVB_SYSTEM_OTHER_ALGORITHM := $( BOARD_AVB_ALGORITHM)
e n d i f
2019-01-30 07:53:57 +01:00
# To extract the public key of SYSTEM_OTHER_KEY_PATH will into system.img:
# /system/etc/security/avb/system_other.avbpubkey.
FULL_SYSTEMIMAGE_DEPS += $( BOARD_AVB_SYSTEM_OTHER_KEY_PATH)
2019-01-23 15:19:19 +01:00
i f n d e f B O A R D _ A V B _ S Y S T E M _ O T H E R _ R O L L B A C K _ I N D E X
BOARD_AVB_SYSTEM_OTHER_ROLLBACK_INDEX := $( PLATFORM_SECURITY_PATCH_TIMESTAMP)
e n d i f
BOARD_AVB_SYSTEM_OTHER_ADD_HASHTREE_FOOTER_ARGS += --rollback_index $( BOARD_AVB_SYSTEM_OTHER_ROLLBACK_INDEX)
e n d i f # end of AVB for BUILDING_SYSTEM_OTHER_IMAGE
2018-08-21 06:09:07 +02:00
INTERNAL_AVB_PARTITIONS_IN_CHAINED_VBMETA_IMAGES := \
2018-10-15 23:41:34 +02:00
$( BOARD_AVB_VBMETA_SYSTEM) \
2018-08-21 06:09:07 +02:00
$( BOARD_AVB_VBMETA_VENDOR)
# Not allowing the same partition to appear in multiple groups.
i f n e q ( $( words $ ( sort $ ( INTERNAL_AVB_PARTITIONS_IN_CHAINED_VBMETA_IMAGES ) ) ) , $( words $ ( INTERNAL_AVB_PARTITIONS_IN_CHAINED_VBMETA_IMAGES ) ) )
2018-10-15 23:41:34 +02:00
$( error BOARD_AVB_VBMETA_SYSTEM and BOARD_AVB_VBMETA_VENDOR cannot have duplicates)
2018-08-21 06:09:07 +02:00
e n d i f
2019-01-30 14:52:32 +01:00
# Appends security patch level as a AVB property descriptor
BOARD_AVB_SYSTEM_ADD_HASHTREE_FOOTER_ARGS += \
--prop com.android.build.system.security_patch:$( PLATFORM_SECURITY_PATCH)
BOARD_AVB_PRODUCT_ADD_HASHTREE_FOOTER_ARGS += \
--prop com.android.build.product.security_patch:$( PLATFORM_SECURITY_PATCH)
BOARD_AVB_PRODUCT_SERVICES_ADD_HASHTREE_FOOTER_ARGS += \
--prop com.android.build.product_services.security_patch:$( PLATFORM_SECURITY_PATCH)
# The following vendor- and odm-specific images needs explicitly set per board.
i f d e f B O O T _ S E C U R I T Y _ P A T C H
BOARD_AVB_BOOT_ADD_HASH_FOOTER_ARGS += \
--prop com.android.build.boot.security_patch:$( BOOT_SECURITY_PATCH)
e n d i f
i f d e f V E N D O R _ S E C U R I T Y _ P A T C H
BOARD_AVB_VENDOR_ADD_HASHTREE_FOOTER_ARGS += \
--prop com.android.build.vendor.security_patch:$( VENDOR_SECURITY_PATCH)
e n d i f
i f d e f O D M _ S E C U R I T Y _ P A T C H
BOARD_AVB_ODM_ADD_HASHTREE_FOOTER_ARGS += \
--prop com.android.build.odm.security_patch:$( ODM_SECURITY_PATCH)
e n d i f
2017-05-26 12:30:04 +02:00
BOOT_FOOTER_ARGS := BOARD_AVB_BOOT_ADD_HASH_FOOTER_ARGS
DTBO_FOOTER_ARGS := BOARD_AVB_DTBO_ADD_HASH_FOOTER_ARGS
SYSTEM_FOOTER_ARGS := BOARD_AVB_SYSTEM_ADD_HASHTREE_FOOTER_ARGS
VENDOR_FOOTER_ARGS := BOARD_AVB_VENDOR_ADD_HASHTREE_FOOTER_ARGS
2017-12-01 22:24:01 +01:00
RECOVERY_FOOTER_ARGS := BOARD_AVB_RECOVERY_ADD_HASH_FOOTER_ARGS
2017-11-27 09:04:47 +01:00
PRODUCT_FOOTER_ARGS := BOARD_AVB_PRODUCT_ADD_HASHTREE_FOOTER_ARGS
2018-05-29 14:09:01 +02:00
PRODUCT_SERVICES_FOOTER_ARGS := BOARD_AVB_PRODUCT_SERVICES_ADD_HASHTREE_FOOTER_ARGS
2017-11-14 16:42:30 +01:00
ODM_FOOTER_ARGS := BOARD_AVB_ODM_ADD_HASHTREE_FOOTER_ARGS
2017-05-26 12:30:04 +02:00
2018-08-23 07:53:41 +02:00
# Helper function that checks and sets required build variables for an AVB chained partition.
2018-10-15 23:41:34 +02:00
# $(1): the partition to enable AVB chain, e.g., boot or system or vbmeta_system.
2018-08-23 07:53:41 +02:00
d e f i n e _ c h e c k - a n d - s e t - a v b - c h a i n - a r g s
$(eval part : = $( 1) )
$( eval PART =$ ( call to -upper ,$ ( part ) ) )
2017-05-26 12:30:04 +02:00
$(eval _key_path : = BOARD_AVB_ $( PART ) _KEY_PATH )
$(eval _signing_algorithm : = BOARD_AVB_ $( PART ) _ALGORITHM )
$(eval _rollback_index : = BOARD_AVB_ $( PART ) _ROLLBACK_INDEX )
$(eval _rollback_index_location : = BOARD_AVB_ $( PART ) _ROLLBACK_INDEX_LOCATION )
$( if $ ( $ ( _key_path ) ) ,,$ ( error $ ( _key_path ) is not defined ) )
$( if $ ( $ ( _signing_algorithm ) ) ,,$ ( error $ ( _signing_algorithm ) is not defined ) )
$( if $ ( $ ( _rollback_index ) ) ,,$ ( error $ ( _rollback_index ) is not defined ) )
$( if $ ( $ ( _rollback_index_location ) ) ,,$ ( error $ ( _rollback_index_location ) is not defined ) )
# Set INTERNAL_AVB_(PART)_SIGNING_ARGS
$(eval _signing_args : = INTERNAL_AVB_ $( PART ) _SIGNING_ARGS )
$(eval $(_signing_args) : = \
--algorithm $( $( _signing_algorithm) ) --key $( $( _key_path) ) )
$( eval INTERNAL_AVB_MAKE_VBMETA_IMAGE_ARGS += \
--chain_partition $( part) :$( $( _rollback_index_location) ) :$( AVB_CHAIN_KEY_DIR) /$( part) .avbpubkey)
2018-08-21 06:09:07 +02:00
# Set rollback_index via footer args for non-chained vbmeta image. Chained vbmeta image will pick up
2018-10-15 23:41:34 +02:00
# the index via a separate flag (e.g. BOARD_AVB_VBMETA_SYSTEM_ROLLBACK_INDEX).
2018-08-21 06:09:07 +02:00
$(if $(filter $(part),$(part : vbmeta_ %=%)), \
$( eval _footer_args := $( PART) _FOOTER_ARGS) \
$( eval $( $( _footer_args) ) += --rollback_index $( $( _rollback_index) ) ) )
2017-05-26 12:30:04 +02:00
e n d e f
2018-08-23 07:53:41 +02:00
# Checks and sets the required build variables for an AVB partition. The partition will be
# configured as a chained partition, if BOARD_AVB_<partition>_KEY_PATH is defined. Otherwise the
2018-08-21 06:09:07 +02:00
# image descriptor will be included into vbmeta.img, unless it has been already added to any chained
# VBMeta image.
2018-08-23 07:53:41 +02:00
# $(1): Partition name, e.g. boot or system.
d e f i n e c h e c k - a n d - s e t - a v b - a r g s
2018-08-21 06:09:07 +02:00
$(eval _in_chained_vbmeta : = $( filter $ ( 1) ,$ ( INTERNAL_AVB_PARTITIONS_IN_CHAINED_VBMETA_IMAGES ) ) )
2018-08-23 07:53:41 +02:00
$( if $ ( BOARD_AVB_ $ ( call to -upper ,$ ( 1) ) _KEY_PATH ) ,\
2018-08-21 06:09:07 +02:00
$( if $( _in_chained_vbmeta) ,\
$( error Chaining partition " $( 1) " in chained VBMeta image is not supported) ) \
2018-08-23 07:53:41 +02:00
$( call _check-and-set-avb-chain-args,$( 1) ) ,\
2018-08-21 06:09:07 +02:00
$( if $( _in_chained_vbmeta) ,,\
$( eval INTERNAL_AVB_MAKE_VBMETA_IMAGE_ARGS += \
--include_descriptors_from_image $( call images-for-partitions,$( 1) ) ) ) )
2018-08-23 07:53:41 +02:00
e n d e f
2018-08-15 01:17:12 +02:00
i f d e f I N S T A L L E D _ B O O T I M A G E _ T A R G E T
2018-08-23 07:53:41 +02:00
$( eval $ ( call check -and -set -avb -args ,boot ) )
2018-08-15 01:17:12 +02:00
e n d i f
2017-05-26 12:30:04 +02:00
2018-08-23 07:53:41 +02:00
$( eval $ ( call check -and -set -avb -args ,system ) )
2017-03-31 09:21:26 +02:00
i f d e f I N S T A L L E D _ V E N D O R I M A G E _ T A R G E T
2018-08-23 07:53:41 +02:00
$( eval $ ( call check -and -set -avb -args ,vendor ) )
2017-05-26 12:30:04 +02:00
e n d i f
2017-03-31 09:21:26 +02:00
2017-11-27 09:04:47 +01:00
i f d e f I N S T A L L E D _ P R O D U C T I M A G E _ T A R G E T
2018-08-23 07:53:41 +02:00
$( eval $ ( call check -and -set -avb -args ,product ) )
2017-11-27 09:04:47 +01:00
e n d i f
2018-08-23 08:39:03 +02:00
i f d e f I N S T A L L E D _ P R O D U C T _ S E R V I C E S I M A G E _ T A R G E T
2018-08-23 07:53:41 +02:00
$( eval $ ( call check -and -set -avb -args ,product_services ) )
2018-08-23 08:39:03 +02:00
e n d i f
2017-11-14 16:42:30 +01:00
i f d e f I N S T A L L E D _ O D M I M A G E _ T A R G E T
2018-08-23 07:53:41 +02:00
$( eval $ ( call check -and -set -avb -args ,odm ) )
2017-11-14 16:42:30 +01:00
e n d i f
2017-04-27 09:34:50 +02:00
i f d e f I N S T A L L E D _ D T B O I M A G E _ T A R G E T
2018-08-23 07:53:41 +02:00
$( eval $ ( call check -and -set -avb -args ,dtbo ) )
2017-05-26 12:30:04 +02:00
e n d i f
2017-04-27 09:34:50 +02:00
2017-12-01 22:24:01 +01:00
i f d e f I N S T A L L E D _ R E C O V E R Y I M A G E _ T A R G E T
2018-08-23 07:53:41 +02:00
$( eval $ ( call check -and -set -avb -args ,recovery ) )
2017-12-01 22:24:01 +01:00
e n d i f
2018-10-15 23:41:34 +02:00
# Not using INSTALLED_VBMETA_SYSTEMIMAGE_TARGET as it won't be set yet.
i f d e f B O A R D _ A V B _ V B M E T A _ S Y S T E M
$( eval $ ( call check -and -set -avb -args ,vbmeta_system ) )
2018-08-21 06:09:07 +02:00
e n d i f
i f d e f B O A R D _ A V B _ V B M E T A _ V E N D O R
$( eval $ ( call check -and -set -avb -args ,vbmeta_vendor ) )
e n d i f
2017-05-26 12:30:04 +02:00
# Add kernel cmdline descriptor for kernel to mount system.img as root with
# dm-verity. This works when system.img is either chained or not-chained:
# - chained: The --setup_as_rootfs_from_kernel option will add dm-verity kernel
# cmdline descriptor to system.img
# - not-chained: The --include_descriptors_from_image option for make_vbmeta_image
# will include the kernel cmdline descriptor from system.img into vbmeta.img
2017-04-14 12:50:11 +02:00
i f e q ( $( BOARD_BUILD_SYSTEM_ROOT_IMAGE ) , t r u e )
2018-09-19 00:46:59 +02:00
i f e q ( $( filter system , $ ( BOARD_SUPER_PARTITION_PARTITION_LIST ) ) , )
2017-05-26 12:30:04 +02:00
BOARD_AVB_SYSTEM_ADD_HASHTREE_FOOTER_ARGS += --setup_as_rootfs_from_kernel
2017-04-14 12:50:11 +02:00
e n d i f
2018-09-19 00:46:59 +02:00
e n d i f
2017-04-14 12:50:11 +02:00
2018-08-23 07:53:41 +02:00
BOARD_AVB_MAKE_VBMETA_IMAGE_ARGS += --padding_size 4096
2018-10-15 23:41:34 +02:00
BOARD_AVB_MAKE_VBMETA_SYSTEM_IMAGE_ARGS += --padding_size 4096
2018-08-21 06:09:07 +02:00
BOARD_AVB_MAKE_VBMETA_VENDOR_IMAGE_ARGS += --padding_size 4096
i f e q ( e n g , $( filter eng , $ ( TARGET_BUILD_VARIANT ) ) )
2018-10-22 22:02:53 +02:00
# We only need the flag in top-level vbmeta.img.
2018-08-21 06:09:07 +02:00
BOARD_AVB_MAKE_VBMETA_IMAGE_ARGS += --set_hashtree_disabled_flag
e n d i f
2018-08-23 07:53:41 +02:00
2017-03-31 09:21:26 +02:00
i f d e f B O A R D _ A V B _ R O L L B A C K _ I N D E X
2017-05-26 12:30:04 +02:00
BOARD_AVB_MAKE_VBMETA_IMAGE_ARGS += --rollback_index $( BOARD_AVB_ROLLBACK_INDEX)
2017-03-31 09:21:26 +02:00
e n d i f
2018-10-15 23:41:34 +02:00
i f d e f B O A R D _ A V B _ V B M E T A _ S Y S T E M _ R O L L B A C K _ I N D E X
BOARD_AVB_MAKE_VBMETA_SYSTEM_IMAGE_ARGS += \
--rollback_index $( BOARD_AVB_VBMETA_SYSTEM_ROLLBACK_INDEX)
2018-08-21 06:09:07 +02:00
e n d i f
i f d e f B O A R D _ A V B _ V B M E T A _ V E N D O R _ R O L L B A C K _ I N D E X
BOARD_AVB_MAKE_VBMETA_VENDOR_IMAGE_ARGS += \
--rollback_index $( BOARD_AVB_VBMETA_VENDOR_ROLLBACK_INDEX)
2018-05-03 22:20:01 +02:00
e n d i f
2017-05-26 12:30:04 +02:00
# $(1): the directory to extract public keys to
d e f i n e e x t r a c t - a v b - c h a i n - p u b l i c - k e y s
$( if $( BOARD_AVB_BOOT_KEY_PATH) ,\
$( hide) $( AVBTOOL) extract_public_key --key $( BOARD_AVB_BOOT_KEY_PATH) \
--output $( 1) /boot.avbpubkey)
$( if $( BOARD_AVB_SYSTEM_KEY_PATH) ,\
$( hide) $( AVBTOOL) extract_public_key --key $( BOARD_AVB_SYSTEM_KEY_PATH) \
--output $( 1) /system.avbpubkey)
$( if $( BOARD_AVB_VENDOR_KEY_PATH) ,\
$( hide) $( AVBTOOL) extract_public_key --key $( BOARD_AVB_VENDOR_KEY_PATH) \
--output $( 1) /vendor.avbpubkey)
2017-11-27 09:04:47 +01:00
$( if $( BOARD_AVB_PRODUCT_KEY_PATH) ,\
$( hide) $( AVBTOOL) extract_public_key --key $( BOARD_AVB_PRODUCT_KEY_PATH) \
--output $( 1) /product.avbpubkey)
2018-05-29 14:09:01 +02:00
$( if $( BOARD_AVB_PRODUCT_SERVICES_KEY_PATH) ,\
$( hide) $( AVBTOOL) extract_public_key --key $( BOARD_AVB_PRODUCT_SERVICES_KEY_PATH) \
2018-08-17 01:56:14 +02:00
--output $( 1) /product_services.avbpubkey)
2017-11-14 16:42:30 +01:00
$( if $( BOARD_AVB_ODM_KEY_PATH) ,\
$( hide) $( AVBTOOL) extract_public_key --key $( BOARD_AVB_ODM_KEY_PATH) \
--output $( 1) /odm.avbpubkey)
2017-05-26 12:30:04 +02:00
$( if $( BOARD_AVB_DTBO_KEY_PATH) ,\
$( hide) $( AVBTOOL) extract_public_key --key $( BOARD_AVB_DTBO_KEY_PATH) \
--output $( 1) /dtbo.avbpubkey)
2017-12-01 22:24:01 +01:00
$( if $( BOARD_AVB_RECOVERY_KEY_PATH) ,\
$( hide) $( AVBTOOL) extract_public_key --key $( BOARD_AVB_RECOVERY_KEY_PATH) \
--output $( 1) /recovery.avbpubkey)
2018-10-15 23:41:34 +02:00
$( if $( BOARD_AVB_VBMETA_SYSTEM_KEY_PATH) ,\
$( hide) $( AVBTOOL) extract_public_key --key $( BOARD_AVB_VBMETA_SYSTEM_KEY_PATH) \
--output $( 1) /vbmeta_system.avbpubkey)
2018-08-21 06:09:07 +02:00
$( if $( BOARD_AVB_VBMETA_VENDOR_KEY_PATH) ,\
$( hide) $( AVBTOOL) extract_public_key --key $( BOARD_AVB_VBMETA_VENDOR_KEY_PATH) \
--output $( 1) /vbmeta_vendor.avbpubkey)
e n d e f
# Builds a chained VBMeta image. This VBMeta image will contain the descriptors for the partitions
# specified in BOARD_AVB_VBMETA_<NAME>. The built VBMeta image will be included into the top-level
2018-10-15 23:41:34 +02:00
# vbmeta image as a chained partition. For example, if a target defines `BOARD_AVB_VBMETA_SYSTEM
# := system product_services`, `vbmeta_system.img` will be created that includes the descriptors
# for `system.img` and `product_services.img`. `vbmeta_system.img` itself will be included into
2018-08-21 06:09:07 +02:00
# `vbmeta.img` as a chained partition.
2018-10-15 23:41:34 +02:00
# $(1): VBMeta image name, such as "vbmeta_system", "vbmeta_vendor" etc.
2018-08-21 06:09:07 +02:00
# $(2): Output filename.
d e f i n e b u i l d - c h a i n e d - v b m e t a - i m a g e
$( call pretty," Target chained vbmeta image: $@ " )
$( hide) $( AVBTOOL) make_vbmeta_image \
$( INTERNAL_AVB_$( call to-upper,$( 1) ) _SIGNING_ARGS) \
$( BOARD_AVB_MAKE_$( call to-upper,$( 1) ) _IMAGE_ARGS) \
$( foreach image,$( BOARD_AVB_$( call to-upper,$( 1) ) ) , \
--include_descriptors_from_image $( call images-for-partitions,$( image) ) ) \
--output $@
2017-05-26 12:30:04 +02:00
e n d e f
2018-10-15 23:41:34 +02:00
i f d e f B O A R D _ A V B _ V B M E T A _ S Y S T E M
INSTALLED_VBMETA_SYSTEMIMAGE_TARGET := $( PRODUCT_OUT) /vbmeta_system.img
$(INSTALLED_VBMETA_SYSTEMIMAGE_TARGET) : \
2018-11-26 19:12:05 +01:00
$( AVBTOOL) \
$( call images-for-partitions,$( BOARD_AVB_VBMETA_SYSTEM) ) \
$( BOARD_AVB_VBMETA_SYSTEM_KEY_PATH)
2018-10-15 23:41:34 +02:00
$( call build-chained-vbmeta-image,vbmeta_system)
2018-08-21 06:09:07 +02:00
e n d i f
i f d e f B O A R D _ A V B _ V B M E T A _ V E N D O R
INSTALLED_VBMETA_VENDORIMAGE_TARGET := $( PRODUCT_OUT) /vbmeta_vendor.img
$(INSTALLED_VBMETA_VENDORIMAGE_TARGET) : \
2018-11-26 19:12:05 +01:00
$( AVBTOOL) \
$( call images-for-partitions,$( BOARD_AVB_VBMETA_VENDOR) ) \
$( BOARD_AVB_VBMETA_VENDOR_KEY_PATH)
2018-08-21 06:09:07 +02:00
$( call build-chained-vbmeta-image,vbmeta_vendor)
e n d i f
2017-03-31 09:21:26 +02:00
d e f i n e b u i l d - v b m e t a i m a g e - t a r g e t
$( call pretty," Target vbmeta image: $( INSTALLED_VBMETAIMAGE_TARGET) " )
2017-05-26 12:30:04 +02:00
$( hide) mkdir -p $( AVB_CHAIN_KEY_DIR)
$( call extract-avb-chain-public-keys, $( AVB_CHAIN_KEY_DIR) )
2017-03-31 09:21:26 +02:00
$( hide) $( AVBTOOL) make_vbmeta_image \
$( INTERNAL_AVB_MAKE_VBMETA_IMAGE_ARGS) \
2018-08-23 07:53:41 +02:00
$( PRIVATE_AVB_VBMETA_SIGNING_ARGS) \
2017-03-31 09:21:26 +02:00
$( BOARD_AVB_MAKE_VBMETA_IMAGE_ARGS) \
--output $@
2017-05-26 12:30:04 +02:00
$( hide) rm -rf $( AVB_CHAIN_KEY_DIR)
2017-03-31 09:21:26 +02:00
e n d e f
INSTALLED_VBMETAIMAGE_TARGET := $( BUILT_VBMETAIMAGE_TARGET)
2018-08-23 07:53:41 +02:00
$(INSTALLED_VBMETAIMAGE_TARGET) : PRIVATE_AVB_VBMETA_SIGNING_ARGS := \
--algorithm $( BOARD_AVB_ALGORITHM) --key $( BOARD_AVB_KEY_PATH)
2017-12-01 22:24:01 +01:00
$(INSTALLED_VBMETAIMAGE_TARGET) : \
2018-11-26 19:12:05 +01:00
$( AVBTOOL) \
$( INSTALLED_BOOTIMAGE_TARGET) \
$( INSTALLED_SYSTEMIMAGE_TARGET) \
$( INSTALLED_VENDORIMAGE_TARGET) \
$( INSTALLED_PRODUCTIMAGE_TARGET) \
$( INSTALLED_PRODUCT_SERVICESIMAGE_TARGET) \
$( INSTALLED_ODMIMAGE_TARGET) \
$( INSTALLED_DTBOIMAGE_TARGET) \
$( INSTALLED_RECOVERYIMAGE_TARGET) \
$( INSTALLED_VBMETA_SYSTEMIMAGE_TARGET) \
$( INSTALLED_VBMETA_VENDORIMAGE_TARGET) \
$( BOARD_AVB_VBMETA_SYSTEM_KEY_PATH) \
$( BOARD_AVB_VBMETA_VENDOR_KEY_PATH) \
$( BOARD_AVB_KEY_PATH)
2017-03-31 09:21:26 +02:00
$( build-vbmetaimage-target)
.PHONY : vbmetaimage -nodeps
vbmetaimage-nodeps :
$( build-vbmetaimage-target)
e n d i f # BOARD_AVB_ENABLE
2018-07-25 02:45:08 +02:00
# -----------------------------------------------------------------
2018-11-29 22:51:48 +01:00
# Check image sizes <= size of super partition
i f e q ( , $( TARGET_BUILD_APPS ) )
# Do not check for apps-only build
i f e q ( t r u e , $( PRODUCT_BUILD_SUPER_PARTITION ) )
2018-07-25 02:45:08 +02:00
# (1): list of items like "system", "vendor", "product", "product_services"
# return: map each item into a command ( wrapped in $$() ) that reads the size
d e f i n e r e a d - s i z e - o f - p a r t i t i o n s
$( foreach p ,$ ( 1) ,$ ( call read -image -prop -dictionary ,$ ( $ ( p ) image_intermediates ) /generated_ $ ( p ) _image_info .txt ,$ ( p ) _size ) )
e n d e f
2019-01-29 18:08:21 +01:00
# round result to BOARD_SUPER_PARTITION_ALIGNMENT
#$(1): the calculated size
i f e q ( , $( BOARD_SUPER_PARTITION_ALIGNMENT ) )
d e f i n e r o u n d - p a r t i t i o n - s i z e
$( 1)
e n d e f
e l s e
d e f i n e r o u n d - p a r t i t i o n - s i z e
$$ ( ( ( $( 1) + $( BOARD_SUPER_PARTITION_ALIGNMENT ) - 1 ) / $( BOARD_SUPER_PARTITION_ALIGNMENT ) * $( BOARD_SUPER_PARTITION_ALIGNMENT ) ) )
e n d e f
e n d i f
2018-10-31 02:47:59 +01:00
d e f i n e s u p e r - s l o t - s u f f i x
$( if $ ( filter true ,$ ( AB_OTA_UPDATER ) ) ,$ ( if $ ( filter true ,$ ( PRODUCT_RETROFIT_DYNAMIC_PARTITIONS ) ) ,,_a ) )
e n d e f
2018-08-30 22:11:47 +02:00
2018-10-02 02:30:01 +02:00
droid_targets : check -all -partition -sizes
2018-07-21 01:45:57 +02:00
2018-10-02 02:30:01 +02:00
.PHONY : check -all -partition -sizes check -all -partition -sizes -nodeps
2018-07-21 01:45:57 +02:00
# Add image dependencies so that generated_*_image_info.txt are written before checking.
2018-10-02 02:30:01 +02:00
check-all-partition-sizes : $( call images -for -partitions ,$ ( BOARD_SUPER_PARTITION_PARTITION_LIST ) )
2018-10-31 02:47:59 +01:00
i f e q ( $( PRODUCT_RETROFIT_DYNAMIC_PARTITIONS ) , t r u e )
2018-11-19 23:22:43 +01:00
# Check sum(super partition block devices) == super partition
2018-10-31 02:47:59 +01:00
# Non-retrofit devices already defines BOARD_SUPER_PARTITION_SUPER_DEVICE_SIZE = BOARD_SUPER_PARTITION_SIZE
d e f i n e c h e c k - s u p e r - p a r t i t i o n - s i z e
size_list = " $( foreach device,$( call to-upper,$( BOARD_SUPER_PARTITION_BLOCK_DEVICES) ) ,$( BOARD_SUPER_PARTITION_$( device) _DEVICE_SIZE) ) " ; \
sum_sizes_expr = $$ ( sed -e 's/ /+/g' <<< " $$ {size_list} " ) ; \
2018-11-19 23:22:43 +01:00
max_size_expr = " $( BOARD_SUPER_PARTITION_SIZE) " ; \
2018-10-31 02:47:59 +01:00
if [ $$ ( ( $$ { sum_sizes_expr} ) ) -ne $$ ( ( $$ { max_size_expr} ) ) ] ; then \
2018-11-19 23:22:43 +01:00
echo "The sum of super partition block device sizes is not equal to BOARD_SUPER_PARTITION_SIZE:" ; \
2018-10-31 02:47:59 +01:00
echo $$ { sum_sizes_expr} '!=' $$ { max_size_expr} ; \
exit 1; \
else \
2018-11-19 23:22:43 +01:00
echo "The sum of super partition block device sizes is equal to BOARD_SUPER_PARTITION_SIZE:" ; \
2018-10-31 02:47:59 +01:00
echo $$ { sum_sizes_expr} '==' $$ { max_size_expr} ; \
fi
e n d e f
e n d i f
2018-10-02 02:30:01 +02:00
# $(1): human-readable max size string
# $(2): max size expression
# $(3): list of partition names
d e f i n e c h e c k - s u m - o f - p a r t i t i o n - s i z e s
2019-01-29 18:08:21 +01:00
partition_size_list = " $$ (for i in $( call read-size-of-partitions,$( 3) ) ; do \
echo $( call round-partition-size,$$ { i} ) ; \
done ) " ; \
sum_sizes_expr = $$ ( tr '\n' '+' <<< " $$ {partition_size_list} " | sed 's/+$$//' ) ; \
2018-10-02 02:30:01 +02:00
if [ $$ ( ( $$ { sum_sizes_expr} ) ) -gt $$ ( ( $( 2) ) ) ] ; then \
echo " The sum of sizes of [ $( strip $( 3) ) ] is larger than $( strip $( 1) ) : " ; \
echo $$ { sum_sizes_expr} '==' $$ ( ( $$ { sum_sizes_expr} ) ) '>' " $( 2) " '==' $$ ( ( $( 2) ) ) ; \
exit 1; \
else \
echo " The sum of sizes of [ $( strip $( 3) ) ] is within $( strip $( 1) ) : " ; \
echo $$ { sum_sizes_expr} '==' $$ ( ( $$ { sum_sizes_expr} ) ) '<=' " $( 2) " '==' $$ ( ( $( 2) ) ) ; \
2019-01-11 22:20:52 +01:00
fi ;
2018-10-02 02:30:01 +02:00
e n d e f
d e f i n e c h e c k - a l l - p a r t i t i o n - s i z e s - t a r g e t
2018-11-19 23:22:43 +01:00
# Check sum(all partitions) <= super partition (/ 2 for A/B devices launched with dynamic partitions)
2018-10-02 02:30:01 +02:00
$( if $( BOARD_SUPER_PARTITION_SIZE) ,$( if $( BOARD_SUPER_PARTITION_PARTITION_LIST) , \
2018-11-19 23:22:43 +01:00
$( call check-sum-of-partition-sizes,BOARD_SUPER_PARTITION_SIZE$( if $( call super-slot-suffix) , / 2) , \
$( BOARD_SUPER_PARTITION_SIZE) $( if $( call super-slot-suffix) , / 2) ,$( BOARD_SUPER_PARTITION_PARTITION_LIST) ) ) )
2018-10-02 02:30:01 +02:00
# For each group, check sum(partitions in group) <= group size
$( foreach group,$( call to-upper,$( BOARD_SUPER_PARTITION_GROUPS) ) , \
$( if $( BOARD_$( group) _SIZE) ,$( if $( BOARD_$( group) _PARTITION_LIST) , \
$( call check-sum-of-partition-sizes,BOARD_$( group) _SIZE,$( BOARD_$( group) _SIZE) ,$( BOARD_$( group) _PARTITION_LIST) ) ) ) )
2018-11-19 23:22:43 +01:00
# Check sum(all group sizes) <= super partition (/ 2 for A/B devices launched with dynamic partitions)
2018-10-02 02:30:01 +02:00
if [ [ ! -z $( BOARD_SUPER_PARTITION_SIZE) ] ] ; then \
group_size_list = " $( foreach group,$( call to-upper,$( BOARD_SUPER_PARTITION_GROUPS) ) ,$( BOARD_$( group) _SIZE) ) " ; \
sum_sizes_expr = $$ ( sed -e 's/ /+/g' <<< " $$ {group_size_list} " ) ; \
2018-11-19 23:22:43 +01:00
max_size_tail = $( if $( call super-slot-suffix) ," / 2" ) ; \
2018-10-02 02:30:01 +02:00
max_size_expr = " $( BOARD_SUPER_PARTITION_SIZE) $$ {max_size_tail} " ; \
if [ $$ ( ( $$ { sum_sizes_expr} ) ) -gt $$ ( ( $$ { max_size_expr} ) ) ] ; then \
echo " The sum of sizes of [ $( strip $( BOARD_SUPER_PARTITION_GROUPS) ) ] is larger than BOARD_SUPER_PARTITION_SIZE $$ {max_size_tail}: " ; \
echo $$ { sum_sizes_expr} '==' $$ ( ( $$ { sum_sizes_expr} ) ) '>' $$ { max_size_expr} '==' $$ ( ( $$ { max_size_expr} ) ) ; \
exit 1; \
else \
echo " The sum of sizes of [ $( strip $( BOARD_SUPER_PARTITION_GROUPS) ) ] is within BOARD_SUPER_PARTITION_SIZE $$ {max_size_tail}: " ; \
echo $$ { sum_sizes_expr} '==' $$ ( ( $$ { sum_sizes_expr} ) ) '<=' $$ { max_size_expr} '==' $$ ( ( $$ { max_size_expr} ) ) ; \
fi \
fi
e n d e f
check-all-partition-sizes check-all-partition-sizes-nodeps :
$( call check-all-partition-sizes-target)
2018-10-31 02:47:59 +01:00
$( call check-super-partition-size)
2018-10-02 02:30:01 +02:00
2018-07-31 21:47:27 +02:00
e n d i f # PRODUCT_BUILD_SUPER_PARTITION
2018-07-21 01:45:57 +02:00
e n d i f # TARGET_BUILD_APPS
2009-03-04 04:28:42 +01:00
# -----------------------------------------------------------------
2014-11-05 06:17:06 +01:00
# bring in the installer image generation defines if necessary
i f e q ( $( TARGET_USE_DISKINSTALLER ) , t r u e )
i n c l u d e b o o t a b l e / d i s k i n s t a l l e r / c o n f i g . m k
e n d i f
2009-03-04 04:28:42 +01:00
# -----------------------------------------------------------------
2012-04-19 22:54:39 +02:00
# host tools needed to build dist and OTA packages
2009-06-15 23:30:14 +02:00
2015-09-22 20:17:52 +02:00
i f e q ( $( BUILD_OS ) , d a r w i n )
2018-10-09 09:46:25 +02:00
build_ota_package := false
build_otatools_package := false
e l s e
# set build_ota_package, and allow opt-out below
build_ota_package := true
ifeq ( $( TARGET_SKIP_OTA_PACKAGE) ,true)
build_ota_package := false
endif
2018-11-14 23:12:10 +01:00
ifneq ( ,$( filter address, $( SANITIZE_TARGET) ) )
2018-10-09 09:46:25 +02:00
build_ota_package := false
endif
ifeq ( $( TARGET_PRODUCT) ,sdk)
build_ota_package := false
endif
ifneq ( $( filter generic%,$( TARGET_DEVICE) ) ,)
build_ota_package := false
endif
ifeq ( $( TARGET_NO_KERNEL) ,true)
build_ota_package := false
endif
ifeq ( $( recovery_fstab) ,)
build_ota_package := false
endif
ifeq ( $( TARGET_BUILD_PDK) ,true)
build_ota_package := false
endif
# set build_otatools_package, and allow opt-out below
build_otatools_package := true
ifeq ( $( TARGET_SKIP_OTATOOLS_PACKAGE) ,true)
build_otatools_package := false
endif
2016-02-05 00:09:23 +01:00
e n d i f
2015-09-22 20:17:52 +02:00
2018-10-09 09:46:25 +02:00
i f e q ( $( build_otatools_package ) , t r u e )
2015-08-11 20:24:19 +02:00
OTATOOLS := $( HOST_OUT_EXECUTABLES) /minigzip \
$( HOST_OUT_EXECUTABLES) /aapt \
2017-11-08 20:45:14 +01:00
$( HOST_OUT_EXECUTABLES) /checkvintf \
2015-04-08 21:24:37 +02:00
$( HOST_OUT_EXECUTABLES) /mkbootfs \
$( HOST_OUT_EXECUTABLES) /mkbootimg \
$( HOST_OUT_EXECUTABLES) /fs_config \
$( HOST_OUT_EXECUTABLES) /zipalign \
$( HOST_OUT_EXECUTABLES) /bsdiff \
$( HOST_OUT_EXECUTABLES) /imgdiff \
$( HOST_OUT_JAVA_LIBRARIES) /signapk.jar \
$( HOST_OUT_JAVA_LIBRARIES) /BootSignature.jar \
2017-05-17 20:41:50 +02:00
$( HOST_OUT_JAVA_LIBRARIES) /VeritySigner.jar \
2017-01-06 23:24:18 +01:00
$( HOST_OUT_EXECUTABLES) /mke2fs \
2018-08-16 01:16:21 +02:00
$( HOST_OUT_EXECUTABLES) /mkuserimg_mke2fs \
2017-01-06 23:24:18 +01:00
$( HOST_OUT_EXECUTABLES) /e2fsdroid \
2018-10-19 22:44:36 +02:00
$( HOST_OUT_EXECUTABLES) /tune2fs \
2016-04-14 21:11:36 +02:00
$( HOST_OUT_EXECUTABLES) /mksquashfsimage.sh \
$( HOST_OUT_EXECUTABLES) /mksquashfs \
$( HOST_OUT_EXECUTABLES) /mkf2fsuserimg.sh \
$( HOST_OUT_EXECUTABLES) /make_f2fs \
2017-11-29 04:21:28 +01:00
$( HOST_OUT_EXECUTABLES) /sload_f2fs \
2015-04-08 21:24:37 +02:00
$( HOST_OUT_EXECUTABLES) /simg2img \
$( HOST_OUT_EXECUTABLES) /e2fsck \
2017-12-18 19:40:57 +01:00
$( HOST_OUT_EXECUTABLES) /generate_verity_key \
2015-04-08 21:24:37 +02:00
$( HOST_OUT_EXECUTABLES) /verity_signer \
2016-11-19 02:04:24 +01:00
$( HOST_OUT_EXECUTABLES) /verity_verifier \
2015-04-08 21:24:37 +02:00
$( HOST_OUT_EXECUTABLES) /append2simg \
2015-06-25 00:42:19 +02:00
$( HOST_OUT_EXECUTABLES) /img2simg \
2015-05-20 08:30:57 +02:00
$( HOST_OUT_EXECUTABLES) /boot_signer \
2016-01-04 18:57:32 +01:00
$( HOST_OUT_EXECUTABLES) /fec \
2016-01-19 23:47:17 +01:00
$( HOST_OUT_EXECUTABLES) /brillo_update_payload \
$( HOST_OUT_EXECUTABLES) /lib/shflags/shflags \
2016-03-30 00:12:37 +02:00
$( HOST_OUT_EXECUTABLES) /delta_generator \
2018-08-15 23:28:27 +02:00
$( HOST_OUT_EXECUTABLES) /care_map_generator \
2019-02-20 03:02:46 +01:00
$( HOST_OUT_EXECUTABLES) /fc_sort \
$( HOST_OUT_EXECUTABLES) /sefcontext_compile \
2018-08-30 22:11:47 +02:00
$( LPMAKE) \
2017-05-17 01:27:25 +02:00
$( AVBTOOL) \
2017-07-07 00:13:59 +02:00
$( BLK_ALLOC_TO_BASE_FS) \
2018-03-16 07:21:28 +01:00
$( BROTLI) \
$( BUILD_VERITY_METADATA) \
$( BUILD_VERITY_TREE)
2017-02-23 01:38:19 +01:00
i f e q ( t r u e , $( PRODUCTS .$ ( INTERNAL_PRODUCT ) .PRODUCT_SUPPORTS_VBOOT ) )
OTATOOLS += \
2017-02-23 20:03:45 +01:00
$( FUTILITY) \
$( VBOOT_SIGNER)
2017-02-23 01:38:19 +01:00
e n d i f
2016-01-04 18:57:32 +01:00
2015-04-08 21:24:37 +02:00
# Shared libraries.
2015-08-11 20:24:19 +02:00
OTATOOLS += \
2015-04-13 18:01:24 +02:00
$( HOST_LIBRARY_PATH) /libc++$( HOST_SHLIB_SUFFIX) \
$( HOST_LIBRARY_PATH) /liblog$( HOST_SHLIB_SUFFIX) \
$( HOST_LIBRARY_PATH) /libcutils$( HOST_SHLIB_SUFFIX) \
2015-06-03 08:35:52 +02:00
$( HOST_LIBRARY_PATH) /libselinux$( HOST_SHLIB_SUFFIX) \
2017-12-18 19:40:57 +01:00
$( HOST_LIBRARY_PATH) /libcrypto_utils$( HOST_SHLIB_SUFFIX) \
2015-06-03 08:35:52 +02:00
$( HOST_LIBRARY_PATH) /libcrypto-host$( HOST_SHLIB_SUFFIX) \
2015-12-10 03:02:56 +01:00
$( HOST_LIBRARY_PATH) /libext2fs-host$( HOST_SHLIB_SUFFIX) \
$( HOST_LIBRARY_PATH) /libext2_blkid-host$( HOST_SHLIB_SUFFIX) \
$( HOST_LIBRARY_PATH) /libext2_com_err-host$( HOST_SHLIB_SUFFIX) \
$( HOST_LIBRARY_PATH) /libext2_e2p-host$( HOST_SHLIB_SUFFIX) \
2017-01-30 21:41:31 +01:00
$( HOST_LIBRARY_PATH) /libext2_misc$( HOST_SHLIB_SUFFIX) \
2015-12-10 03:02:56 +01:00
$( HOST_LIBRARY_PATH) /libext2_profile-host$( HOST_SHLIB_SUFFIX) \
$( HOST_LIBRARY_PATH) /libext2_quota-host$( HOST_SHLIB_SUFFIX) \
2015-12-10 22:38:50 +01:00
$( HOST_LIBRARY_PATH) /libext2_uuid-host$( HOST_SHLIB_SUFFIX) \
2016-01-04 18:57:32 +01:00
$( HOST_LIBRARY_PATH) /libconscrypt_openjdk_jni$( HOST_SHLIB_SUFFIX) \
$( HOST_LIBRARY_PATH) /libbrillo$( HOST_SHLIB_SUFFIX) \
$( HOST_LIBRARY_PATH) /libbrillo-stream$( HOST_SHLIB_SUFFIX) \
$( HOST_LIBRARY_PATH) /libchrome$( HOST_SHLIB_SUFFIX) \
$( HOST_LIBRARY_PATH) /libcurl-host$( HOST_SHLIB_SUFFIX) \
2016-07-23 01:16:30 +02:00
$( HOST_LIBRARY_PATH) /libevent-host$( HOST_SHLIB_SUFFIX) \
2016-02-11 18:50:41 +01:00
$( HOST_LIBRARY_PATH) /libprotobuf-cpp-lite$( HOST_SHLIB_SUFFIX) \
2016-01-04 18:57:32 +01:00
$( HOST_LIBRARY_PATH) /libssl-host$( HOST_SHLIB_SUFFIX) \
2016-03-24 13:57:03 +01:00
$( HOST_LIBRARY_PATH) /libz-host$( HOST_SHLIB_SUFFIX) \
2017-01-26 17:16:57 +01:00
$( HOST_LIBRARY_PATH) /libsparse-host$( HOST_SHLIB_SUFFIX) \
2016-12-16 16:33:03 +01:00
$( HOST_LIBRARY_PATH) /libbase$( HOST_SHLIB_SUFFIX) \
2017-07-07 00:13:59 +02:00
$( HOST_LIBRARY_PATH) /libpcre2$( HOST_SHLIB_SUFFIX) \
2018-08-30 22:11:47 +02:00
$( HOST_LIBRARY_PATH) /libbrotli$( HOST_SHLIB_SUFFIX) \
$( HOST_LIBRARY_PATH) /liblp$( HOST_SHLIB_SUFFIX) \
2019-01-03 08:22:42 +01:00
$( HOST_LIBRARY_PATH) /libext4_utils$( HOST_SHLIB_SUFFIX) \
2019-01-03 21:18:24 +01:00
$( HOST_LIBRARY_PATH) /libfec$( HOST_SHLIB_SUFFIX) \
$( HOST_LIBRARY_PATH) /libsquashfs_utils$( HOST_SHLIB_SUFFIX)
2017-07-07 00:13:59 +02:00
2009-03-04 04:28:42 +01:00
2010-06-18 02:52:18 +02:00
.PHONY : otatools
otatools : $( OTATOOLS )
2014-08-22 17:04:58 +02:00
BUILT_OTATOOLS_PACKAGE := $( PRODUCT_OUT) /otatools.zip
2015-04-09 01:37:34 +02:00
$(BUILT_OTATOOLS_PACKAGE) : zip_root := $( call intermediates -dir -for ,PACKAGING ,otatools ) /otatools
2014-08-22 17:04:58 +02:00
2017-05-17 20:41:50 +02:00
OTATOOLS_DEPS := \
system/extras/ext4_utils/mke2fs.conf \
2018-05-02 04:07:27 +02:00
$( sort $( shell find build/target/product/security -type f -name "*.x509.pem" -o -name "*.pk8" -o \
2018-10-12 20:03:04 +02:00
-name verity_key) )
i f n e q ( , $( wildcard device ) )
OTATOOLS_DEPS += \
2018-05-02 04:07:27 +02:00
$( sort $( shell find device $( wildcard vendor) -type f -name "*.pk8" -o -name "verifiedboot*" -o \
-name "*.x509.pem" -o -name "oem*.prop" ) )
2018-10-12 20:03:04 +02:00
e n d i f
i f n e q ( , $( wildcard external /avb ) )
OTATOOLS_DEPS += \
$( sort $( shell find external/avb/test/data -type f -name "testkey_*.pem" -o \
-name "atx_metadata.bin" ) )
e n d i f
i f n e q ( , $( wildcard system /update_engine ) )
OTATOOLS_DEPS += \
$( sort $( shell find system/update_engine/scripts -name "*.pyc" -prune -o -type f -print) )
e n d i f
2017-05-17 20:41:50 +02:00
OTATOOLS_RELEASETOOLS := \
2018-05-02 04:07:27 +02:00
$( sort $( shell find build/make/tools/releasetools -name "*.pyc" -prune -o -type f) )
2017-05-17 20:41:50 +02:00
i f e q ( t r u e , $( PRODUCTS .$ ( INTERNAL_PRODUCT ) .PRODUCT_SUPPORTS_VBOOT ) )
OTATOOLS_DEPS += \
2018-02-10 05:03:32 +01:00
$( sort $( shell find external/vboot_reference/tests/devkeys -type f) )
2017-05-17 20:41:50 +02:00
e n d i f
2018-09-15 06:51:11 +02:00
$(BUILT_OTATOOLS_PACKAGE) : $( OTATOOLS ) $( OTATOOLS_DEPS ) $( OTATOOLS_RELEASETOOLS ) $( SOONG_ZIP )
2014-08-22 17:04:58 +02:00
@echo " Package OTA tools: $@ "
$( hide) rm -rf $@ $( zip_root)
2017-05-17 20:41:50 +02:00
$( hide) mkdir -p $( dir $@ ) $( zip_root) /bin $( zip_root) /framework $( zip_root) /releasetools
2015-04-08 21:24:37 +02:00
$( call copy-files-with-structure,$( OTATOOLS) ,$( HOST_OUT) /,$( zip_root) )
2019-02-15 20:25:34 +01:00
$( hide) cp $( SOONG_ZIP) $( zip_root) /bin/
2018-09-15 06:51:11 +02:00
$( hide) cp -r -d -p build/make/tools/releasetools/* $( zip_root) /releasetools
2014-08-22 17:04:58 +02:00
$( hide) rm -rf $@ $( zip_root) /releasetools/*.pyc
2018-09-15 06:51:11 +02:00
$( hide) $( SOONG_ZIP) -o $@ -C $( zip_root) -D $( zip_root) \
-C . $( addprefix -f ,$( OTATOOLS_DEPS) )
2014-08-22 17:04:58 +02:00
.PHONY : otatools -package
otatools-package : $( BUILT_OTATOOLS_PACKAGE )
2018-10-09 09:46:25 +02:00
e n d i f # build_otatools_package
2014-08-22 17:04:58 +02:00
2009-03-04 04:28:42 +01:00
# -----------------------------------------------------------------
# A zip of the directories that map to the target filesystem.
# This zip can be used to create an OTA package or filesystem image
# as a post-build step.
#
name := $( TARGET_PRODUCT)
i f e q ( $( TARGET_BUILD_TYPE ) , d e b u g )
name := $( name) _debug
e n d i f
name := $( name) -target_files-$( FILE_NAME_TAG)
intermediates := $( call intermediates-dir-for,PACKAGING,target_files)
BUILT_TARGET_FILES_PACKAGE := $( intermediates) /$( name) .zip
$(BUILT_TARGET_FILES_PACKAGE) : intermediates := $( intermediates )
$(BUILT_TARGET_FILES_PACKAGE) : \
2018-11-26 19:12:05 +01:00
zip_root := $( intermediates) /$( name)
2009-03-04 04:28:42 +01:00
# $(1): Directory to copy
# $(2): Location to copy it to
# The "ls -A" is to prevent "acp s/* d" from failing if s is empty.
d e f i n e p a c k a g e _ f i l e s - c o p y - r o o t
if [ -d " $( strip $( 1) ) " -a " $$ (ls -A $( 1) ) " ] ; then \
mkdir -p $( 2) && \
$( ACP) -rd $( strip $( 1) ) /* $( 2) ; \
fi
e n d e f
2015-11-30 21:22:24 +01:00
built_ota_tools :=
2015-06-23 03:35:35 +02:00
# We can't build static executables when SANITIZE_TARGET=address
2018-11-14 23:12:10 +01:00
i f e q ( , $( filter address , $ ( SANITIZE_TARGET ) ) )
2015-06-23 03:35:35 +02:00
built_ota_tools += \
$( call intermediates-dir-for,EXECUTABLES,updater,,,$( TARGET_PREFER_32_BIT) ) /updater
e n d i f
2009-03-04 04:28:42 +01:00
$(BUILT_TARGET_FILES_PACKAGE) : PRIVATE_OTA_TOOLS := $( built_ota_tools )
2009-06-18 02:09:40 +02:00
$(BUILT_TARGET_FILES_PACKAGE) : PRIVATE_RECOVERY_API_VERSION := $( RECOVERY_API_VERSION )
2013-02-22 01:27:25 +01:00
$(BUILT_TARGET_FILES_PACKAGE) : PRIVATE_RECOVERY_FSTAB_VERSION := $( RECOVERY_FSTAB_VERSION )
2009-06-18 02:09:40 +02:00
2009-09-30 18:20:32 +02:00
i f e q ( $( TARGET_RELEASETOOLS_EXTENSIONS ) , )
# default to common dir for device vendor
2017-03-21 23:47:37 +01:00
tool_extensions := $( TARGET_DEVICE_DIR) /../common
2009-09-30 18:20:32 +02:00
e l s e
2017-03-21 23:47:37 +01:00
tool_extensions := $( TARGET_RELEASETOOLS_EXTENSIONS)
2009-09-30 18:20:32 +02:00
e n d i f
2017-03-21 23:47:37 +01:00
tool_extension := $( wildcard $( tool_extensions) /releasetools.py)
$(BUILT_TARGET_FILES_PACKAGE) : PRIVATE_TOOL_EXTENSIONS := $( tool_extensions )
$(BUILT_TARGET_FILES_PACKAGE) : PRIVATE_TOOL_EXTENSION := $( tool_extension )
2009-09-30 18:20:32 +02:00
2016-03-08 01:51:01 +01:00
i f e q ( $( AB_OTA_UPDATER ) , t r u e )
2017-12-20 00:24:43 +01:00
updater_dep := system/update_engine/update_engine.conf
2016-03-08 01:51:01 +01:00
e l s e
2015-10-02 08:53:31 +02:00
# Build OTA tools if not using the AB Updater.
2016-05-10 09:40:38 +02:00
updater_dep := $( built_ota_tools)
2015-10-02 08:53:31 +02:00
e n d i f
2016-05-10 09:40:38 +02:00
$(BUILT_TARGET_FILES_PACKAGE) : $( updater_dep )
2015-10-02 08:53:31 +02:00
2015-11-11 04:21:34 +01:00
# If we are using recovery as boot, output recovery files to BOOT/.
i f e q ( $( BOARD_USES_RECOVERY_AS_BOOT ) , t r u e )
$(BUILT_TARGET_FILES_PACKAGE) : PRIVATE_RECOVERY_OUT := BOOT
e l s e
$(BUILT_TARGET_FILES_PACKAGE) : PRIVATE_RECOVERY_OUT := RECOVERY
e n d i f
2017-03-21 23:47:37 +01:00
i f e q ( $( AB_OTA_UPDATER ) , t r u e )
ifdef OSRELEASED_DIRECTORY
$( BUILT_TARGET_FILES_PACKAGE) : $( TARGET_OUT_OEM) /$( OSRELEASED_DIRECTORY) /product_id
$( BUILT_TARGET_FILES_PACKAGE) : $( TARGET_OUT_OEM) /$( OSRELEASED_DIRECTORY) /product_version
$( BUILT_TARGET_FILES_PACKAGE) : $( TARGET_OUT_ETC) /$( OSRELEASED_DIRECTORY) /system_version
endif
e n d i f
2017-03-06 04:56:52 +01:00
# Run fs_config while creating the target files package
# $1: root directory
# $2: add prefix
d e f i n e f s _ c o n f i g
2018-02-07 18:49:52 +01:00
( c d $( 1) ; f i n d . - t y p e d | s e d 's,$$,/,' ; f i n d . \ ! - t y p e d ) | c u t - c 3 - | s o r t | s e d 's,^,$(2),' | $( HOST_OUT_EXECUTABLES ) / f s _ c o n f i g - C - D $( TARGET_OUT ) - S $( SELINUX_FC ) - R "$(2)"
2017-03-06 04:56:52 +01:00
e n d e f
2018-11-29 21:06:31 +01:00
# $(1): file
d e f i n e d u m p - d y n a m i c - p a r t i t i o n s - i n f o
$( if $( filter true,$( PRODUCT_USE_DYNAMIC_PARTITIONS) ) , \
echo "use_dynamic_partitions=true" >> $( 1) )
$( if $( filter true,$( PRODUCT_RETROFIT_DYNAMIC_PARTITIONS) ) , \
echo "dynamic_partition_retrofit=true" >> $( 1) )
2018-11-29 22:51:48 +01:00
echo " lpmake= $( notdir $( LPMAKE) ) " >> $( 1)
$( if $( filter true,$( PRODUCT_BUILD_SUPER_PARTITION) ) , $( if $( BOARD_SUPER_PARTITION_SIZE) , \
echo "build_super_partition=true" >> $( 1) ) )
2018-12-27 21:47:23 +01:00
$( if $( filter true,$( BOARD_BUILD_RETROFIT_DYNAMIC_PARTITIONS_OTA_PACKAGE) ) , \
echo "build_retrofit_dynamic_partitions_ota_package=true" >> $( 1) )
2018-11-29 21:06:31 +01:00
echo " super_metadata_device= $( BOARD_SUPER_PARTITION_METADATA_DEVICE) " >> $( 1)
$( if $( BOARD_SUPER_PARTITION_BLOCK_DEVICES) , \
echo " super_block_devices= $( BOARD_SUPER_PARTITION_BLOCK_DEVICES) " >> $( 1) )
$( foreach device,$( BOARD_SUPER_PARTITION_BLOCK_DEVICES) , \
echo " super_ $( device) _device_size= $( BOARD_SUPER_PARTITION_$( call to-upper,$( device) ) _DEVICE_SIZE) " >> $( 1) ; )
$( if $( BOARD_SUPER_PARTITION_PARTITION_LIST) , \
echo " dynamic_partition_list= $( BOARD_SUPER_PARTITION_PARTITION_LIST) " >> $( 1) )
$( if $( BOARD_SUPER_PARTITION_GROUPS) ,
echo " super_partition_groups= $( BOARD_SUPER_PARTITION_GROUPS) " >> $( 1) )
$( foreach group,$( BOARD_SUPER_PARTITION_GROUPS) , \
echo " super_ $( group) _group_size= $( BOARD_$( call to-upper,$( group) ) _SIZE) " >> $( 1) ; \
$( if $( BOARD_$( call to-upper,$( group) ) _PARTITION_LIST) , \
echo " super_ $( group) _partition_list= $( BOARD_$( call to-upper,$( group) ) _PARTITION_LIST) " >> $( 1) ; ) )
e n d e f
2009-03-04 04:28:42 +01:00
# Depending on the various images guarantees that the underlying
# directories are up-to-date.
$(BUILT_TARGET_FILES_PACKAGE) : \
2018-11-26 19:12:05 +01:00
$( INSTALLED_RAMDISK_TARGET) \
$( INSTALLED_BOOTIMAGE_TARGET) \
$( INSTALLED_RADIOIMAGE_TARGET) \
$( INSTALLED_RECOVERYIMAGE_TARGET) \
$( FULL_SYSTEMIMAGE_DEPS) \
$( INSTALLED_USERDATAIMAGE_TARGET) \
$( INSTALLED_CACHEIMAGE_TARGET) \
$( INSTALLED_VENDORIMAGE_TARGET) \
$( INSTALLED_PRODUCTIMAGE_TARGET) \
$( INSTALLED_PRODUCT_SERVICESIMAGE_TARGET) \
$( INSTALLED_VBMETAIMAGE_TARGET) \
$( INSTALLED_ODMIMAGE_TARGET) \
$( INSTALLED_DTBOIMAGE_TARGET) \
$( INTERNAL_SYSTEMOTHERIMAGE_FILES) \
$( INSTALLED_ANDROID_INFO_TXT_TARGET) \
$( INSTALLED_KERNEL_TARGET) \
$( INSTALLED_2NDBOOTLOADER_TARGET) \
$( BOARD_PREBUILT_DTBOIMAGE) \
2019-02-04 19:35:25 +01:00
$( BOARD_PREBUILT_RECOVERY_DTBOIMAGE) \
2018-09-23 16:10:47 +02:00
$( BOARD_RECOVERY_ACPIO) \
2018-11-26 19:12:05 +01:00
$( PRODUCTS.$( INTERNAL_PRODUCT) .PRODUCT_SYSTEM_BASE_FS_PATH) \
$( PRODUCTS.$( INTERNAL_PRODUCT) .PRODUCT_VENDOR_BASE_FS_PATH) \
$( PRODUCTS.$( INTERNAL_PRODUCT) .PRODUCT_PRODUCT_BASE_FS_PATH) \
$( PRODUCTS.$( INTERNAL_PRODUCT) .PRODUCT_PRODUCT_SERVICES_BASE_FS_PATH) \
$( PRODUCTS.$( INTERNAL_PRODUCT) .PRODUCT_ODM_BASE_FS_PATH) \
$( LPMAKE) \
$( SELINUX_FC) \
$( APKCERTS_FILE) \
2019-02-18 07:21:19 +01:00
$( SOONG_APEX_KEYS_FILE) \
2018-11-26 19:12:05 +01:00
$( SOONG_ZIP) \
$( HOST_OUT_EXECUTABLES) /fs_config \
$( HOST_OUT_EXECUTABLES) /imgdiff \
$( HOST_OUT_EXECUTABLES) /bsdiff \
$( HOST_OUT_EXECUTABLES) /care_map_generator \
$( BUILD_IMAGE_SRCS) \
$( BUILT_ASSEMBLED_SYSTEM_MANIFEST) \
$( BUILT_ASSEMBLED_VENDOR_MANIFEST) \
$( BUILT_SYSTEM_MATRIX) \
$( BUILT_VENDOR_MATRIX) \
| $( ACP)
2009-03-04 04:28:42 +01:00
@echo " Package target files: $@ "
2017-03-23 21:09:21 +01:00
$( call create-system-vendor-symlink)
2017-11-27 09:04:47 +01:00
$( call create-system-product-symlink)
2018-08-17 01:56:14 +02:00
$( call create-system-product_services-symlink)
2017-11-14 16:42:30 +01:00
$( call create-vendor-odm-symlink)
2016-08-07 05:15:06 +02:00
$( hide) rm -rf $@ $@ .list $( zip_root)
2009-03-04 04:28:42 +01:00
$( hide) mkdir -p $( dir $@ ) $( zip_root)
2015-11-11 04:21:34 +01:00
i f n e q ( , $( INSTALLED_RECOVERYIMAGE_TARGET ) $( filter true ,$ ( BOARD_USES_RECOVERY_AS_BOOT ) ) )
2009-03-04 04:28:42 +01:00
@# Components of the recovery image
2015-11-11 04:21:34 +01:00
$( hide) mkdir -p $( zip_root) /$( PRIVATE_RECOVERY_OUT)
2009-03-04 04:28:42 +01:00
$( hide) $( call package_files-copy-root, \
2018-11-26 19:12:05 +01:00
$( TARGET_RECOVERY_ROOT_OUT) ,$( zip_root) /$( PRIVATE_RECOVERY_OUT) /RAMDISK)
2009-03-04 04:28:42 +01:00
i f d e f I N S T A L L E D _ K E R N E L _ T A R G E T
2017-03-21 23:47:37 +01:00
$( hide) cp $( INSTALLED_KERNEL_TARGET) $( zip_root) /$( PRIVATE_RECOVERY_OUT) /kernel
2009-03-04 04:28:42 +01:00
e n d i f
i f d e f I N S T A L L E D _ 2 N D B O O T L O A D E R _ T A R G E T
2017-03-21 23:47:37 +01:00
$( hide) cp $( INSTALLED_2NDBOOTLOADER_TARGET) $( zip_root) /$( PRIVATE_RECOVERY_OUT) /second
2009-03-04 04:28:42 +01:00
e n d i f
2018-03-21 20:15:11 +01:00
i f d e f B O A R D _ I N C L U D E _ R E C O V E R Y _ D T B O
2019-02-04 19:35:25 +01:00
i f d e f B O A R D _ P R E B U I L T _ R E C O V E R Y _ D T B O I M A G E
$( hide) cp $( BOARD_PREBUILT_RECOVERY_DTBOIMAGE) $( zip_root) /$( PRIVATE_RECOVERY_OUT) /recovery_dtbo
e l s e
2018-08-22 10:21:41 +02:00
$( hide) cp $( BOARD_PREBUILT_DTBOIMAGE) $( zip_root) /$( PRIVATE_RECOVERY_OUT) /recovery_dtbo
2018-03-21 20:15:11 +01:00
e n d i f
2019-02-04 19:35:25 +01:00
e n d i f
2018-09-23 16:10:47 +02:00
i f d e f B O A R D _ I N C L U D E _ R E C O V E R Y _ A C P I O
$( hide) cp $( BOARD_RECOVERY_ACPIO) $( zip_root) /$( PRIVATE_RECOVERY_OUT) /recovery_acpio
e n d i f
2019-01-23 03:08:59 +01:00
i f d e f B O A R D _ I N C L U D E _ D T B _ I N _ B O O T I M G
$( hide) cp $( INSTALLED_DTBIMAGE_TARGET) $( zip_root) /$( PRIVATE_RECOVERY_OUT) /dtb
e n d i f
2016-10-06 01:57:27 +02:00
i f d e f I N T E R N A L _ K E R N E L _ C M D L I N E
$( hide) echo " $( INTERNAL_KERNEL_CMDLINE) " > $( zip_root) /$( PRIVATE_RECOVERY_OUT) /cmdline
2009-06-17 18:07:09 +02:00
e n d i f
i f d e f B O A R D _ K E R N E L _ B A S E
2015-11-11 04:21:34 +01:00
$( hide) echo " $( BOARD_KERNEL_BASE) " > $( zip_root) /$( PRIVATE_RECOVERY_OUT) /base
2010-08-25 23:29:34 +02:00
e n d i f
i f d e f B O A R D _ K E R N E L _ P A G E S I Z E
2015-11-11 04:21:34 +01:00
$( hide) echo " $( BOARD_KERNEL_PAGESIZE) " > $( zip_root) /$( PRIVATE_RECOVERY_OUT) /pagesize
2009-03-04 04:28:42 +01:00
e n d i f
2015-11-11 04:21:34 +01:00
e n d i f # INSTALLED_RECOVERYIMAGE_TARGET defined or BOARD_USES_RECOVERY_AS_BOOT is true
2009-03-04 04:28:42 +01:00
@# Components of the boot image
$( hide) mkdir -p $( zip_root) /BOOT
2015-07-22 03:01:20 +02:00
$( hide) mkdir -p $( zip_root) /ROOT
$( hide) $( call package_files-copy-root, \
2018-11-26 19:12:05 +01:00
$( TARGET_ROOT_OUT) ,$( zip_root) /ROOT)
2018-11-06 23:23:44 +01:00
@# If we are using recovery as boot, this is already done when processing recovery.
i f n e q ( $( BOARD_USES_RECOVERY_AS_BOOT ) , t r u e )
2018-08-09 23:26:00 +02:00
i f n e q ( $( BOARD_BUILD_SYSTEM_ROOT_IMAGE ) , t r u e )
2009-03-04 04:28:42 +01:00
$( hide) $( call package_files-copy-root, \
2018-11-26 19:12:05 +01:00
$( TARGET_RAMDISK_OUT) ,$( zip_root) /BOOT/RAMDISK)
2015-07-22 03:01:20 +02:00
e n d i f
2009-03-04 04:28:42 +01:00
i f d e f I N S T A L L E D _ K E R N E L _ T A R G E T
2017-03-21 23:47:37 +01:00
$( hide) cp $( INSTALLED_KERNEL_TARGET) $( zip_root) /BOOT/kernel
2009-03-04 04:28:42 +01:00
e n d i f
i f d e f I N S T A L L E D _ 2 N D B O O T L O A D E R _ T A R G E T
2017-03-21 23:47:37 +01:00
$( hide) cp $( INSTALLED_2NDBOOTLOADER_TARGET) $( zip_root) /BOOT/second
2009-03-04 04:28:42 +01:00
e n d i f
2019-01-23 03:08:59 +01:00
i f d e f I N S T A L L E D _ D T B I M A G E _ T A R G E T
$( hide) cp $( INSTALLED_DTBIMAGE_TARGET) $( zip_root) /BOOT/dtb
e n d i f
2016-10-06 01:57:27 +02:00
i f d e f I N T E R N A L _ K E R N E L _ C M D L I N E
$( hide) echo " $( INTERNAL_KERNEL_CMDLINE) " > $( zip_root) /BOOT/cmdline
2009-03-04 04:28:42 +01:00
e n d i f
2009-06-17 18:07:09 +02:00
i f d e f B O A R D _ K E R N E L _ B A S E
$( hide) echo " $( BOARD_KERNEL_BASE) " > $( zip_root) /BOOT/base
2010-08-25 23:29:34 +02:00
e n d i f
i f d e f B O A R D _ K E R N E L _ P A G E S I Z E
$( hide) echo " $( BOARD_KERNEL_PAGESIZE) " > $( zip_root) /BOOT/pagesize
2009-06-17 18:07:09 +02:00
e n d i f
2015-11-11 04:21:34 +01:00
e n d i f # BOARD_USES_RECOVERY_AS_BOOT
2009-06-20 02:12:18 +02:00
$( hide) $( foreach t,$( INSTALLED_RADIOIMAGE_TARGET) ,\
mkdir -p $( zip_root) /RADIO; \
2017-03-21 23:47:37 +01:00
cp $( t) $( zip_root) /RADIO/$( notdir $( t) ) ; )
Add PRODUCT_BUILD_*_IMAGE, BUILDING_*_IMAGE to control building of images
These centralize the decisions on whether to build certain images or
not, and allow the product definition to override that choice.
There are a few use cases here:
* For GSI-like cases, we only want to build the system image. This
didn't really change, but it's somewhat simpler to configure, and
easier to understand the build logic.
* On the opposite side, when you're planning on using a GSI, the device
specific build can only build the vendor images (or some other set).
* Some cases (Fuchsia, etc) don't want to build any images, as they'll
be distributing the build artifacts in their own packaging.
I suspect in the future, TARGET_BUILD_APPS may be able to be refactored
into the third use case.
Test: treehugger
Test: Create a product definition that includes nothing, try to build it.
Test: compare build-aosp_crosshatch.ninja and build-crosshatch.ninja before/after
Change-Id: I685ab841be3718d3dd7052c28ccd764bb6f1991a
2019-01-16 21:42:05 +01:00
i f d e f B U I L D I N G _ S Y S T E M _ I M A G E
2009-03-04 04:28:42 +01:00
@# Contents of the system image
$( hide) $( call package_files-copy-root, \
2018-11-26 19:12:05 +01:00
$( SYSTEMIMAGE_SOURCE_DIR) ,$( zip_root) /SYSTEM)
Add PRODUCT_BUILD_*_IMAGE, BUILDING_*_IMAGE to control building of images
These centralize the decisions on whether to build certain images or
not, and allow the product definition to override that choice.
There are a few use cases here:
* For GSI-like cases, we only want to build the system image. This
didn't really change, but it's somewhat simpler to configure, and
easier to understand the build logic.
* On the opposite side, when you're planning on using a GSI, the device
specific build can only build the vendor images (or some other set).
* Some cases (Fuchsia, etc) don't want to build any images, as they'll
be distributing the build artifacts in their own packaging.
I suspect in the future, TARGET_BUILD_APPS may be able to be refactored
into the third use case.
Test: treehugger
Test: Create a product definition that includes nothing, try to build it.
Test: compare build-aosp_crosshatch.ninja and build-crosshatch.ninja before/after
Change-Id: I685ab841be3718d3dd7052c28ccd764bb6f1991a
2019-01-16 21:42:05 +01:00
e n d i f
i f d e f B U I L D I N G _ U S E R D A T A _ I M A G E
2009-03-04 04:28:42 +01:00
@# Contents of the data image
$( hide) $( call package_files-copy-root, \
2018-11-26 19:12:05 +01:00
$( TARGET_OUT_DATA) ,$( zip_root) /DATA)
Add PRODUCT_BUILD_*_IMAGE, BUILDING_*_IMAGE to control building of images
These centralize the decisions on whether to build certain images or
not, and allow the product definition to override that choice.
There are a few use cases here:
* For GSI-like cases, we only want to build the system image. This
didn't really change, but it's somewhat simpler to configure, and
easier to understand the build logic.
* On the opposite side, when you're planning on using a GSI, the device
specific build can only build the vendor images (or some other set).
* Some cases (Fuchsia, etc) don't want to build any images, as they'll
be distributing the build artifacts in their own packaging.
I suspect in the future, TARGET_BUILD_APPS may be able to be refactored
into the third use case.
Test: treehugger
Test: Create a product definition that includes nothing, try to build it.
Test: compare build-aosp_crosshatch.ninja and build-crosshatch.ninja before/after
Change-Id: I685ab841be3718d3dd7052c28ccd764bb6f1991a
2019-01-16 21:42:05 +01:00
e n d i f
i f d e f B U I L D I N G _ V E N D O R _ I M A G E
2013-03-20 19:02:05 +01:00
@# Contents of the vendor image
$( hide) $( call package_files-copy-root, \
2018-11-26 19:12:05 +01:00
$( TARGET_OUT_VENDOR) ,$( zip_root) /VENDOR)
2016-06-16 23:47:10 +02:00
e n d i f
Add PRODUCT_BUILD_*_IMAGE, BUILDING_*_IMAGE to control building of images
These centralize the decisions on whether to build certain images or
not, and allow the product definition to override that choice.
There are a few use cases here:
* For GSI-like cases, we only want to build the system image. This
didn't really change, but it's somewhat simpler to configure, and
easier to understand the build logic.
* On the opposite side, when you're planning on using a GSI, the device
specific build can only build the vendor images (or some other set).
* Some cases (Fuchsia, etc) don't want to build any images, as they'll
be distributing the build artifacts in their own packaging.
I suspect in the future, TARGET_BUILD_APPS may be able to be refactored
into the third use case.
Test: treehugger
Test: Create a product definition that includes nothing, try to build it.
Test: compare build-aosp_crosshatch.ninja and build-crosshatch.ninja before/after
Change-Id: I685ab841be3718d3dd7052c28ccd764bb6f1991a
2019-01-16 21:42:05 +01:00
i f d e f B U I L D I N G _ P R O D U C T _ I M A G E
2017-11-27 09:04:47 +01:00
@# Contents of the product image
$( hide) $( call package_files-copy-root, \
2018-11-26 19:12:05 +01:00
$( TARGET_OUT_PRODUCT) ,$( zip_root) /PRODUCT)
2017-11-27 09:04:47 +01:00
e n d i f
Add PRODUCT_BUILD_*_IMAGE, BUILDING_*_IMAGE to control building of images
These centralize the decisions on whether to build certain images or
not, and allow the product definition to override that choice.
There are a few use cases here:
* For GSI-like cases, we only want to build the system image. This
didn't really change, but it's somewhat simpler to configure, and
easier to understand the build logic.
* On the opposite side, when you're planning on using a GSI, the device
specific build can only build the vendor images (or some other set).
* Some cases (Fuchsia, etc) don't want to build any images, as they'll
be distributing the build artifacts in their own packaging.
I suspect in the future, TARGET_BUILD_APPS may be able to be refactored
into the third use case.
Test: treehugger
Test: Create a product definition that includes nothing, try to build it.
Test: compare build-aosp_crosshatch.ninja and build-crosshatch.ninja before/after
Change-Id: I685ab841be3718d3dd7052c28ccd764bb6f1991a
2019-01-16 21:42:05 +01:00
i f d e f B U I L D I N G _ P R O D U C T _ S E R V I C E S _ I M A G E
2018-08-17 01:56:14 +02:00
@# Contents of the product_services image
2018-05-29 14:09:01 +02:00
$( hide) $( call package_files-copy-root, \
2018-11-26 19:12:05 +01:00
$( TARGET_OUT_PRODUCT_SERVICES) ,$( zip_root) /PRODUCT_SERVICES)
2018-05-29 14:09:01 +02:00
e n d i f
Add PRODUCT_BUILD_*_IMAGE, BUILDING_*_IMAGE to control building of images
These centralize the decisions on whether to build certain images or
not, and allow the product definition to override that choice.
There are a few use cases here:
* For GSI-like cases, we only want to build the system image. This
didn't really change, but it's somewhat simpler to configure, and
easier to understand the build logic.
* On the opposite side, when you're planning on using a GSI, the device
specific build can only build the vendor images (or some other set).
* Some cases (Fuchsia, etc) don't want to build any images, as they'll
be distributing the build artifacts in their own packaging.
I suspect in the future, TARGET_BUILD_APPS may be able to be refactored
into the third use case.
Test: treehugger
Test: Create a product definition that includes nothing, try to build it.
Test: compare build-aosp_crosshatch.ninja and build-crosshatch.ninja before/after
Change-Id: I685ab841be3718d3dd7052c28ccd764bb6f1991a
2019-01-16 21:42:05 +01:00
i f d e f B U I L D I N G _ O D M _ I M A G E
2017-11-14 16:42:30 +01:00
@# Contents of the odm image
$( hide) $( call package_files-copy-root, \
2018-11-26 19:12:05 +01:00
$( TARGET_OUT_ODM) ,$( zip_root) /ODM)
2017-11-14 16:42:30 +01:00
e n d i f
Add PRODUCT_BUILD_*_IMAGE, BUILDING_*_IMAGE to control building of images
These centralize the decisions on whether to build certain images or
not, and allow the product definition to override that choice.
There are a few use cases here:
* For GSI-like cases, we only want to build the system image. This
didn't really change, but it's somewhat simpler to configure, and
easier to understand the build logic.
* On the opposite side, when you're planning on using a GSI, the device
specific build can only build the vendor images (or some other set).
* Some cases (Fuchsia, etc) don't want to build any images, as they'll
be distributing the build artifacts in their own packaging.
I suspect in the future, TARGET_BUILD_APPS may be able to be refactored
into the third use case.
Test: treehugger
Test: Create a product definition that includes nothing, try to build it.
Test: compare build-aosp_crosshatch.ninja and build-crosshatch.ninja before/after
Change-Id: I685ab841be3718d3dd7052c28ccd764bb6f1991a
2019-01-16 21:42:05 +01:00
i f d e f B U I L D I N G _ S Y S T E M _ O T H E R _ I M A G E
2016-06-16 23:47:10 +02:00
@# Contents of the system_other image
$( hide) $( call package_files-copy-root, \
2018-11-26 19:12:05 +01:00
$( TARGET_OUT_SYSTEM_OTHER) ,$( zip_root) /SYSTEM_OTHER)
2013-03-20 19:02:05 +01:00
e n d i f
2009-03-04 04:28:42 +01:00
@# Extra contents of the OTA package
2015-10-02 08:53:31 +02:00
$( hide) mkdir -p $( zip_root) /OTA
2017-03-21 23:47:37 +01:00
$( hide) cp $( INSTALLED_ANDROID_INFO_TXT_TARGET) $( zip_root) /OTA/
2015-10-02 08:53:31 +02:00
i f n e q ( $( AB_OTA_UPDATER ) , t r u e )
2015-12-07 19:45:19 +01:00
i f n e q ( $( built_ota_tools ) , )
2015-10-02 08:53:31 +02:00
$( hide) mkdir -p $( zip_root) /OTA/bin
2017-03-21 23:47:37 +01:00
$( hide) cp $( PRIVATE_OTA_TOOLS) $( zip_root) /OTA/bin/
2015-12-07 19:45:19 +01:00
e n d i f
2015-10-02 08:53:31 +02:00
e n d i f
2009-06-15 23:30:14 +02:00
@# Files that do not end up in any images, but are necessary to
2009-03-04 04:28:42 +01:00
@# build them.
$( hide) mkdir -p $( zip_root) /META
2017-03-21 23:47:37 +01:00
$( hide) cp $( APKCERTS_FILE) $( zip_root) /META/apkcerts.txt
2019-02-18 07:21:19 +01:00
$( hide) cp $( SOONG_APEX_KEYS_FILE) $( zip_root) /META/apexkeys.txt
2017-03-21 23:47:37 +01:00
i f n e q ( $( tool_extension ) , )
$( hide) cp $( PRIVATE_TOOL_EXTENSION) $( zip_root) /META/
e n d i f
2015-03-25 03:07:40 +01:00
$( hide) echo " $( PRODUCT_OTA_PUBLIC_KEYS) " > $( zip_root) /META/otakeys.txt
2017-03-21 23:47:37 +01:00
$( hide) cp $( SELINUX_FC) $( zip_root) /META/file_contexts.bin
2010-09-17 02:44:38 +02:00
$( hide) echo " recovery_api_version= $( PRIVATE_RECOVERY_API_VERSION) " > $( zip_root) /META/misc_info.txt
2013-02-22 01:27:25 +01:00
$( hide) echo " fstab_version= $( PRIVATE_RECOVERY_FSTAB_VERSION) " >> $( zip_root) /META/misc_info.txt
2010-07-02 00:30:11 +02:00
i f d e f B O A R D _ F L A S H _ B L O C K _ S I Z E
2010-09-17 02:44:38 +02:00
$( hide) echo " blocksize= $( BOARD_FLASH_BLOCK_SIZE) " >> $( zip_root) /META/misc_info.txt
2010-07-02 00:30:11 +02:00
e n d i f
i f d e f B O A R D _ B O O T I M A G E _ P A R T I T I O N _ S I Z E
2011-01-14 20:30:56 +01:00
$( hide) echo " boot_size= $( BOARD_BOOTIMAGE_PARTITION_SIZE) " >> $( zip_root) /META/misc_info.txt
2010-07-02 00:30:11 +02:00
e n d i f
2015-10-28 03:25:18 +01:00
i f e q ( $( INSTALLED_RECOVERYIMAGE_TARGET ) , )
$( hide) echo "no_recovery=true" >> $( zip_root) /META/misc_info.txt
e n d i f
2018-03-21 20:15:11 +01:00
i f d e f B O A R D _ I N C L U D E _ R E C O V E R Y _ D T B O
$( hide) echo "include_recovery_dtbo=true" >> $( zip_root) /META/misc_info.txt
e n d i f
2018-09-23 16:10:47 +02:00
i f d e f B O A R D _ I N C L U D E _ R E C O V E R Y _ A C P I O
$( hide) echo "include_recovery_acpio=true" >> $( zip_root) /META/misc_info.txt
e n d i f
2010-07-02 00:30:11 +02:00
i f d e f B O A R D _ R E C O V E R Y I M A G E _ P A R T I T I O N _ S I Z E
2011-01-14 20:30:56 +01:00
$( hide) echo " recovery_size= $( BOARD_RECOVERYIMAGE_PARTITION_SIZE) " >> $( zip_root) /META/misc_info.txt
2014-10-23 05:01:22 +02:00
e n d i f
i f d e f T A R G E T _ R E C O V E R Y _ F S T Y P E _ M O U N T _ O P T I O N S
@# TARGET_RECOVERY_FSTYPE_MOUNT_OPTIONS can be empty to indicate that nothing but defaults should be used.
$( hide) echo " recovery_mount_options= $( TARGET_RECOVERY_FSTYPE_MOUNT_OPTIONS) " >> $( zip_root) /META/misc_info.txt
e l s e
$( hide) echo " recovery_mount_options= $( DEFAULT_TARGET_RECOVERY_FSTYPE_MOUNT_OPTIONS) " >> $( zip_root) /META/misc_info.txt
2010-07-02 00:30:11 +02:00
e n d i f
2017-03-21 23:47:37 +01:00
$( hide) echo " tool_extensions= $( PRIVATE_TOOL_EXTENSIONS) " >> $( zip_root) /META/misc_info.txt
2011-10-04 19:50:08 +02:00
$( hide) echo " default_system_dev_certificate= $( DEFAULT_SYSTEM_DEV_CERTIFICATE) " >> $( zip_root) /META/misc_info.txt
2011-03-16 15:49:13 +01:00
i f d e f P R O D U C T _ E X T R A _ R E C O V E R Y _ K E Y S
$( hide) echo " extra_recovery_keys= $( PRODUCT_EXTRA_RECOVERY_KEYS) " >> $( zip_root) /META/misc_info.txt
2010-08-26 05:39:41 +02:00
e n d i f
2013-04-18 00:19:19 +02:00
$( hide) echo 'mkbootimg_args=$(BOARD_MKBOOTIMG_ARGS)' >> $( zip_root) /META/misc_info.txt
2016-03-15 17:49:30 +01:00
$( hide) echo 'mkbootimg_version_args=$(INTERNAL_MKBOOTIMG_VERSION_ARGS)' >> $( zip_root) /META/misc_info.txt
2013-11-25 23:44:12 +01:00
$( hide) echo "multistage_support=1" >> $( zip_root) /META/misc_info.txt
2017-03-01 23:36:26 +01:00
$( hide) echo "blockimgdiff_versions=3,4" >> $( zip_root) /META/misc_info.txt
2014-10-08 03:42:11 +02:00
i f n e q ( $( OEM_THUMBPRINT_PROPERTIES ) , )
2014-03-22 00:20:05 +01:00
# OTA scripts are only interested in fingerprint related properties
2014-10-08 03:42:11 +02:00
$( hide) echo " oem_fingerprint_properties= $( OEM_THUMBPRINT_PROPERTIES) " >> $( zip_root) /META/misc_info.txt
2015-06-25 22:56:53 +02:00
e n d i f
2016-03-30 00:12:37 +02:00
i f n e q ( $( PRODUCTS .$ ( INTERNAL_PRODUCT ) .PRODUCT_SYSTEM_BASE_FS_PATH ) , )
2017-03-21 23:47:37 +01:00
$( hide) cp $( PRODUCTS.$( INTERNAL_PRODUCT) .PRODUCT_SYSTEM_BASE_FS_PATH) \
2016-03-30 00:12:37 +02:00
$( zip_root) /META/$( notdir $( PRODUCTS.$( INTERNAL_PRODUCT) .PRODUCT_SYSTEM_BASE_FS_PATH) )
e n d i f
i f n e q ( $( PRODUCTS .$ ( INTERNAL_PRODUCT ) .PRODUCT_VENDOR_BASE_FS_PATH ) , )
2017-03-21 23:47:37 +01:00
$( hide) cp $( PRODUCTS.$( INTERNAL_PRODUCT) .PRODUCT_VENDOR_BASE_FS_PATH) \
2016-03-30 00:12:37 +02:00
$( zip_root) /META/$( notdir $( PRODUCTS.$( INTERNAL_PRODUCT) .PRODUCT_VENDOR_BASE_FS_PATH) )
e n d i f
2017-11-27 09:04:47 +01:00
i f n e q ( $( PRODUCTS .$ ( INTERNAL_PRODUCT ) .PRODUCT_PRODUCT_BASE_FS_PATH ) , )
$( hide) cp $( PRODUCTS.$( INTERNAL_PRODUCT) .PRODUCT_PRODUCT_BASE_FS_PATH) \
$( zip_root) /META/$( notdir $( PRODUCTS.$( INTERNAL_PRODUCT) .PRODUCT_PRODUCT_BASE_FS_PATH) )
e n d i f
2018-05-29 14:09:01 +02:00
i f n e q ( $( PRODUCTS .$ ( INTERNAL_PRODUCT ) .PRODUCT_PRODUCT_SERVICES_BASE_FS_PATH ) , )
$( hide) cp $( PRODUCTS.$( INTERNAL_PRODUCT) .PRODUCT_PRODUCT_SERVICES_BASE_FS_PATH) \
$( zip_root) /META/$( notdir $( PRODUCTS.$( INTERNAL_PRODUCT) .PRODUCT_PRODUCT_SERVICES_BASE_FS_PATH) )
e n d i f
2017-11-14 16:42:30 +01:00
i f n e q ( $( PRODUCTS .$ ( INTERNAL_PRODUCT ) .PRODUCT_ODM_BASE_FS_PATH ) , )
$( hide) cp $( PRODUCTS.$( INTERNAL_PRODUCT) .PRODUCT_ODM_BASE_FS_PATH) \
$( zip_root) /META/$( notdir $( PRODUCTS.$( INTERNAL_PRODUCT) .PRODUCT_ODM_BASE_FS_PATH) )
e n d i f
2019-01-18 22:53:52 +01:00
i f n e q ( , $( filter address , $ ( SANITIZE_TARGET ) ) )
2015-06-25 22:56:53 +02:00
# We need to create userdata.img with real data because the instrumented libraries are in userdata.img.
$( hide) echo "userdata_img_with_data=true" >> $( zip_root) /META/misc_info.txt
2015-07-22 21:33:18 +02:00
e n d i f
i f e q ( $( BOARD_USES_FULL_RECOVERY_IMAGE ) , t r u e )
$( hide) echo "full_recovery_image=true" >> $( zip_root) /META/misc_info.txt
2016-01-29 22:59:17 +01:00
e n d i f
Update for new Android Verified Boot (AVB).
This updates the build system for the new Android Verified Boot
codebase. As this is based on Brillo Verified Boot, this change replaces
the existing BVB support.
Android Verified Boot is enabled by the BOARD_AVB_ENABLE variable
BOARD_AVB_ENABLE := true
This will make the build system create vbmeta.img which will contain a
hash descriptor for boot.img, a hashtree descriptor for system.img, a
kernel-cmdline descriptor for setting up dm-verity for system.img and
append a hash-tree to system.img.
Additionally, the descriptors are left in boot.img and system.img so a
third party can create their own vbmeta.img file linking - using the
option --chain_partition - to these images. If this is not needed
footers can be erased using the 'avbtool erase_footer' command. It's
also harmless to just leave them in the images.
By default, the algorithm SHA256_RSA4096 is used with a test key from
the AVB source directory. This can be overriden by the
BOARD_AVB_ALGORITHM and BOARD_AVB_KEY_PATH variables to use e.g. a
4096-bit RSA key and SHA-512:
BOARD_AVB_ALGORITHM := SHA512_RSA4096
BOARD_AVB_KEY_PATH := /path/to/rsa_key_4096bits.pem
To prevent rollback attacks, the rollback index should be increased on a
regular basis. The rollback index can be set with the
BOARD_AVB_ROLLBACK_INDEX variable:
BOARD_AVB_ROLLBACK_INDEX := 5
If this is not set, the rollback index defaults to 0.
The variable BOARD_AVB_MAKE_VBMETA_IMAGE_ARGS can be used to specify
additional options passed to 'avbtool make_vbmeta_image'. Typical
options to be used here include '--prop', '--prop_from_file', and
'--chain_partition'.
The variable BOARD_AVBTOOL_BOOT_ADD_HASH_FOOTER_ARGS can be used to
specify additional options passed to 'avbtool add_hash_footer' for
boot.img. Typical options to be used here include '--hash_algorithm' and
'--salt'.
The variable BOARD_AVBTOOL_SYSTEM_ADD_HASHTREE_FOOTER_ARGS can be used
to specify additional options passed to 'avbtool add_hashtree_footer'
for systems.img. Typical options to be used here include
'--hash_algorithm', '--salt', and '--block_size'.
Bug: 31264226
Test: aosp_x86_64-eng 'm' and 'm dist' successful.
Change-Id: Ic9a61cfc65c148b12996e57f04da5432eef6b982
2016-09-28 23:55:27 +02:00
i f e q ( $( BOARD_AVB_ENABLE ) , t r u e )
2017-05-26 12:30:04 +02:00
$( hide) echo "avb_enable=true" >> $( zip_root) /META/misc_info.txt
$( hide) echo " avb_vbmeta_key_path= $( BOARD_AVB_KEY_PATH) " >> $( zip_root) /META/misc_info.txt
$( hide) echo " avb_vbmeta_algorithm= $( BOARD_AVB_ALGORITHM) " >> $( zip_root) /META/misc_info.txt
$( hide) echo " avb_vbmeta_args= $( BOARD_AVB_MAKE_VBMETA_IMAGE_ARGS) " >> $( zip_root) /META/misc_info.txt
$( hide) echo " avb_boot_add_hash_footer_args= $( BOARD_AVB_BOOT_ADD_HASH_FOOTER_ARGS) " >> $( zip_root) /META/misc_info.txt
i f d e f B O A R D _ A V B _ B O O T _ K E Y _ P A T H
$( hide) echo " avb_boot_key_path= $( BOARD_AVB_BOOT_KEY_PATH) " >> $( zip_root) /META/misc_info.txt
$( hide) echo " avb_boot_algorithm= $( BOARD_AVB_BOOT_ALGORITHM) " >> $( zip_root) /META/misc_info.txt
$( hide) echo " avb_boot_rollback_index_location= $( BOARD_AVB_BOOT_ROLLBACK_INDEX_LOCATION) " >> $( zip_root) /META/misc_info.txt
e n d i f # BOARD_AVB_BOOT_KEY_PATH
2017-12-01 22:24:01 +01:00
$( hide) echo " avb_recovery_add_hash_footer_args= $( BOARD_AVB_RECOVERY_ADD_HASH_FOOTER_ARGS) " >> $( zip_root) /META/misc_info.txt
i f d e f B O A R D _ A V B _ R E C O V E R Y _ K E Y _ P A T H
$( hide) echo " avb_recovery_key_path= $( BOARD_AVB_RECOVERY_KEY_PATH) " >> $( zip_root) /META/misc_info.txt
$( hide) echo " avb_recovery_algorithm= $( BOARD_AVB_RECOVERY_ALGORITHM) " >> $( zip_root) /META/misc_info.txt
$( hide) echo " avb_recovery_rollback_index_location= $( BOARD_AVB_RECOVERY_ROLLBACK_INDEX_LOCATION) " >> $( zip_root) /META/misc_info.txt
e n d i f # BOARD_AVB_RECOVERY_KEY_PATH
2018-10-15 23:41:34 +02:00
i f n e q ( , $( strip $ ( BOARD_AVB_VBMETA_SYSTEM ) ) )
$( hide) echo " avb_vbmeta_system= $( BOARD_AVB_VBMETA_SYSTEM) " >> $( zip_root) /META/misc_info.txt
$( hide) echo " avb_vbmeta_system_args= $( BOARD_AVB_MAKE_VBMETA_SYSTEM_IMAGE_ARGS) " >> $( zip_root) /META/misc_info.txt
$( hide) echo " avb_vbmeta_system_key_path= $( BOARD_AVB_VBMETA_SYSTEM_KEY_PATH) " >> $( zip_root) /META/misc_info.txt
$( hide) echo " avb_vbmeta_system_algorithm= $( BOARD_AVB_VBMETA_SYSTEM_ALGORITHM) " >> $( zip_root) /META/misc_info.txt
$( hide) echo " avb_vbmeta_system_rollback_index_location= $( BOARD_AVB_VBMETA_SYSTEM_ROLLBACK_INDEX_LOCATION) " >> $( zip_root) /META/misc_info.txt
e n d i f # BOARD_AVB_VBMETA_SYSTEM
2018-08-21 06:09:07 +02:00
i f n e q ( , $( strip $ ( BOARD_AVB_VBMETA_VENDOR ) ) )
$( hide) echo " avb_vbmeta_vendor= $( BOARD_AVB_VBMETA_VENDOR) " >> $( zip_root) /META/misc_info.txt
2018-10-15 23:41:34 +02:00
$( hide) echo " avb_vbmeta_vendor_args= $( BOARD_AVB_MAKE_VBMETA_SYSTEM_IMAGE_ARGS) " >> $( zip_root) /META/misc_info.txt
2018-08-21 06:09:07 +02:00
$( hide) echo " avb_vbmeta_vendor_key_path= $( BOARD_AVB_VBMETA_VENDOR_KEY_PATH) " >> $( zip_root) /META/misc_info.txt
$( hide) echo " avb_vbmeta_vendor_algorithm= $( BOARD_AVB_VBMETA_VENDOR_ALGORITHM) " >> $( zip_root) /META/misc_info.txt
$( hide) echo " avb_vbmeta_vendor_rollback_index_location= $( BOARD_AVB_VBMETA_VENDOR_ROLLBACK_INDEX_LOCATION) " >> $( zip_root) /META/misc_info.txt
e n d i f # BOARD_AVB_VBMETA_VENDOR_KEY_PATH
2017-05-26 12:30:04 +02:00
e n d i f # BOARD_AVB_ENABLE
2016-04-08 21:08:03 +02:00
i f d e f B O A R D _ B P T _ I N P U T _ F I L E S
$( hide) echo "board_bpt_enable=true" >> $( zip_root) /META/misc_info.txt
$( hide) echo " board_bpt_make_table_args= $( BOARD_BPT_MAKE_TABLE_ARGS) " >> $( zip_root) /META/misc_info.txt
$( hide) echo " board_bpt_input_files= $( BOARD_BPT_INPUT_FILES) " >> $( zip_root) /META/misc_info.txt
e n d i f
i f d e f B O A R D _ B P T _ D I S K _ S I Z E
$( hide) echo " board_bpt_disk_size= $( BOARD_BPT_DISK_SIZE) " >> $( zip_root) /META/misc_info.txt
2014-03-22 00:20:05 +01:00
e n d i f
2011-10-29 02:02:30 +02:00
$( call generate-userimage-prop-dictionary, $( zip_root) /META/misc_info.txt)
2015-08-19 03:03:56 +02:00
i f n e q ( $( INSTALLED_RECOVERYIMAGE_TARGET ) , )
2015-03-25 14:06:30 +01:00
$( hide) PATH = $( foreach p,$( INTERNAL_USERIMAGES_BINARY_PATHS) ,$( p) :) $$ PATH MKBOOTIMG = $( MKBOOTIMG) \
2017-12-06 23:38:40 +01:00
build/make/tools/releasetools/make_recovery_patch $( zip_root) $( zip_root)
2015-09-25 03:12:33 +02:00
e n d i f
2015-09-30 04:05:37 +02:00
i f e q ( $( AB_OTA_UPDATER ) , t r u e )
@# When using the A/B updater, include the updater config files in the zip.
2017-03-21 23:47:37 +01:00
$( hide) cp $( TOPDIR) system/update_engine/update_engine.conf $( zip_root) /META/update_engine_config.txt
2015-10-23 03:15:27 +02:00
$( hide) for part in $( AB_OTA_PARTITIONS) ; do \
2015-10-02 02:38:09 +02:00
echo " $$ {part} " >> $( zip_root) /META/ab_partitions.txt; \
done
2015-11-12 22:53:25 +01:00
$( hide) for conf in $( AB_OTA_POSTINSTALL_CONFIG) ; do \
echo " $$ {conf} " >> $( zip_root) /META/postinstall_config.txt; \
done
2015-11-05 11:04:04 +01:00
@# Include the build type in META/misc_info.txt so the server can easily differentiate production builds.
$( hide) echo " build_type= $( TARGET_BUILD_VARIANT) " >> $( zip_root) /META/misc_info.txt
2015-11-11 04:21:34 +01:00
$( hide) echo "ab_update=true" >> $( zip_root) /META/misc_info.txt
2015-10-09 00:32:40 +02:00
i f d e f O S R E L E A S E D _ D I R E C T O R Y
2017-03-21 23:47:37 +01:00
$( hide) cp $( TARGET_OUT_OEM) /$( OSRELEASED_DIRECTORY) /product_id $( zip_root) /META/product_id.txt
$( hide) cp $( TARGET_OUT_OEM) /$( OSRELEASED_DIRECTORY) /product_version $( zip_root) /META/product_version.txt
$( hide) cp $( TARGET_OUT_ETC) /$( OSRELEASED_DIRECTORY) /system_version $( zip_root) /META/system_version.txt
2015-10-09 00:32:40 +02:00
e n d i f
2015-09-30 04:05:37 +02:00
e n d i f
2015-09-25 03:12:33 +02:00
i f e q ( $( BREAKPAD_GENERATE_SYMBOLS ) , t r u e )
2015-09-30 04:05:37 +02:00
@# If breakpad symbols have been generated, add them to the zip.
2015-09-25 03:12:33 +02:00
$( hide) $( ACP) -r $( TARGET_OUT_BREAKPAD) $( zip_root) /BREAKPAD
2016-06-17 23:07:37 +02:00
e n d i f
i f d e f B O A R D _ P R E B U I L T _ V E N D O R I M A G E
$( hide) mkdir -p $( zip_root) /IMAGES
$( hide) cp $( INSTALLED_VENDORIMAGE_TARGET) $( zip_root) /IMAGES/
2017-05-13 02:50:46 +02:00
e n d i f
2017-11-27 09:04:47 +01:00
i f d e f B O A R D _ P R E B U I L T _ P R O D U C T I M A G E
$( hide) mkdir -p $( zip_root) /IMAGES
$( hide) cp $( INSTALLED_PRODUCTIMAGE_TARGET) $( zip_root) /IMAGES/
e n d i f
2018-05-29 14:09:01 +02:00
i f d e f B O A R D _ P R E B U I L T _ P R O D U C T _ S E R V I C E S I M A G E
$( hide) mkdir -p $( zip_root) /IMAGES
$( hide) cp $( INSTALLED_PRODUCT_SERVICESIMAGE_TARGET) $( zip_root) /IMAGES/
e n d i f
2017-07-18 19:05:13 +02:00
i f d e f B O A R D _ P R E B U I L T _ B O O T I M A G E
$( hide) mkdir -p $( zip_root) /IMAGES
$( hide) cp $( INSTALLED_BOOTIMAGE_TARGET) $( zip_root) /IMAGES/
e n d i f
2017-11-14 16:42:30 +01:00
i f d e f B O A R D _ P R E B U I L T _ O D M I M A G E
$( hide) mkdir -p $( zip_root) /IMAGES
$( hide) cp $( INSTALLED_ODMIMAGE_TARGET) $( zip_root) /IMAGES/
e n d i f
2017-05-13 02:50:46 +02:00
i f d e f B O A R D _ P R E B U I L T _ D T B O I M A G E
2017-05-31 06:46:33 +02:00
$( hide) mkdir -p $( zip_root) /PREBUILT_IMAGES
$( hide) cp $( INSTALLED_DTBOIMAGE_TARGET) $( zip_root) /PREBUILT_IMAGES/
$( hide) echo "has_dtbo=true" >> $( zip_root) /META/misc_info.txt
i f e q ( $( BOARD_AVB_ENABLE ) , t r u e )
$( hide) echo " dtbo_size= $( BOARD_DTBOIMG_PARTITION_SIZE) " >> $( zip_root) /META/misc_info.txt
2017-05-26 12:30:04 +02:00
$( hide) echo " avb_dtbo_add_hash_footer_args= $( BOARD_AVB_DTBO_ADD_HASH_FOOTER_ARGS) " >> $( zip_root) /META/misc_info.txt
i f d e f B O A R D _ A V B _ D T B O _ K E Y _ P A T H
$( hide) echo " avb_dtbo_key_path= $( BOARD_AVB_DTBO_KEY_PATH) " >> $( zip_root) /META/misc_info.txt
$( hide) echo " avb_dtbo_algorithm= $( BOARD_AVB_DTBO_ALGORITHM) " >> $( zip_root) /META/misc_info.txt
$( hide) echo " avb_dtbo_rollback_index_location= $( BOARD_AVB_DTBO_ROLLBACK_INDEX_LOCATION) " \
2017-05-31 06:46:33 +02:00
>> $( zip_root) /META/misc_info.txt
2017-05-26 12:30:04 +02:00
e n d i f # BOARD_AVB_DTBO_KEY_PATH
e n d i f # BOARD_AVB_ENABLE
e n d i f # BOARD_PREBUILT_DTBOIMAGE
2018-11-29 21:06:31 +01:00
$( call dump-dynamic-partitions-info,$( zip_root) /META/misc_info.txt)
2017-06-17 00:30:23 +02:00
@# The radio images in BOARD_PACK_RADIOIMAGES will be additionally copied from RADIO/ into
@# IMAGES/, which then will be added into <product>-img.zip. Such images must be listed in
@# INSTALLED_RADIOIMAGE_TARGET.
$( hide) $( foreach part,$( BOARD_PACK_RADIOIMAGES) , \
echo $( part) >> $( zip_root) /META/pack_radioimages.txt; )
2014-06-17 00:16:31 +02:00
@# Run fs_config on all the system, vendor, boot ramdisk,
@# and recovery ramdisk files in the zip, and save the output
Add PRODUCT_BUILD_*_IMAGE, BUILDING_*_IMAGE to control building of images
These centralize the decisions on whether to build certain images or
not, and allow the product definition to override that choice.
There are a few use cases here:
* For GSI-like cases, we only want to build the system image. This
didn't really change, but it's somewhat simpler to configure, and
easier to understand the build logic.
* On the opposite side, when you're planning on using a GSI, the device
specific build can only build the vendor images (or some other set).
* Some cases (Fuchsia, etc) don't want to build any images, as they'll
be distributing the build artifacts in their own packaging.
I suspect in the future, TARGET_BUILD_APPS may be able to be refactored
into the third use case.
Test: treehugger
Test: Create a product definition that includes nothing, try to build it.
Test: compare build-aosp_crosshatch.ninja and build-crosshatch.ninja before/after
Change-Id: I685ab841be3718d3dd7052c28ccd764bb6f1991a
2019-01-16 21:42:05 +01:00
i f d e f B U I L D I N G _ S Y S T E M _ I M A G E
2017-03-06 04:56:52 +01:00
$( hide) $( call fs_config,$( zip_root) /SYSTEM,system/) > $( zip_root) /META/filesystem_config.txt
Add PRODUCT_BUILD_*_IMAGE, BUILDING_*_IMAGE to control building of images
These centralize the decisions on whether to build certain images or
not, and allow the product definition to override that choice.
There are a few use cases here:
* For GSI-like cases, we only want to build the system image. This
didn't really change, but it's somewhat simpler to configure, and
easier to understand the build logic.
* On the opposite side, when you're planning on using a GSI, the device
specific build can only build the vendor images (or some other set).
* Some cases (Fuchsia, etc) don't want to build any images, as they'll
be distributing the build artifacts in their own packaging.
I suspect in the future, TARGET_BUILD_APPS may be able to be refactored
into the third use case.
Test: treehugger
Test: Create a product definition that includes nothing, try to build it.
Test: compare build-aosp_crosshatch.ninja and build-crosshatch.ninja before/after
Change-Id: I685ab841be3718d3dd7052c28ccd764bb6f1991a
2019-01-16 21:42:05 +01:00
e n d i f
i f d e f B U I L D I N G _ V E N D O R _ I M A G E
2017-03-06 04:56:52 +01:00
$( hide) $( call fs_config,$( zip_root) /VENDOR,vendor/) > $( zip_root) /META/vendor_filesystem_config.txt
e n d i f
Add PRODUCT_BUILD_*_IMAGE, BUILDING_*_IMAGE to control building of images
These centralize the decisions on whether to build certain images or
not, and allow the product definition to override that choice.
There are a few use cases here:
* For GSI-like cases, we only want to build the system image. This
didn't really change, but it's somewhat simpler to configure, and
easier to understand the build logic.
* On the opposite side, when you're planning on using a GSI, the device
specific build can only build the vendor images (or some other set).
* Some cases (Fuchsia, etc) don't want to build any images, as they'll
be distributing the build artifacts in their own packaging.
I suspect in the future, TARGET_BUILD_APPS may be able to be refactored
into the third use case.
Test: treehugger
Test: Create a product definition that includes nothing, try to build it.
Test: compare build-aosp_crosshatch.ninja and build-crosshatch.ninja before/after
Change-Id: I685ab841be3718d3dd7052c28ccd764bb6f1991a
2019-01-16 21:42:05 +01:00
i f d e f B U I L D I N G _ P R O D U C T _ I M A G E
2017-11-27 09:04:47 +01:00
$( hide) $( call fs_config,$( zip_root) /PRODUCT,product/) > $( zip_root) /META/product_filesystem_config.txt
e n d i f
Add PRODUCT_BUILD_*_IMAGE, BUILDING_*_IMAGE to control building of images
These centralize the decisions on whether to build certain images or
not, and allow the product definition to override that choice.
There are a few use cases here:
* For GSI-like cases, we only want to build the system image. This
didn't really change, but it's somewhat simpler to configure, and
easier to understand the build logic.
* On the opposite side, when you're planning on using a GSI, the device
specific build can only build the vendor images (or some other set).
* Some cases (Fuchsia, etc) don't want to build any images, as they'll
be distributing the build artifacts in their own packaging.
I suspect in the future, TARGET_BUILD_APPS may be able to be refactored
into the third use case.
Test: treehugger
Test: Create a product definition that includes nothing, try to build it.
Test: compare build-aosp_crosshatch.ninja and build-crosshatch.ninja before/after
Change-Id: I685ab841be3718d3dd7052c28ccd764bb6f1991a
2019-01-16 21:42:05 +01:00
i f d e f B U I L D I N G _ P R O D U C T _ S E R V I C E S _ I M A G E
2018-08-17 01:56:14 +02:00
$( hide) $( call fs_config,$( zip_root) /PRODUCT_SERVICES,product_services/) > $( zip_root) /META/product_services_filesystem_config.txt
2018-05-29 14:09:01 +02:00
e n d i f
Add PRODUCT_BUILD_*_IMAGE, BUILDING_*_IMAGE to control building of images
These centralize the decisions on whether to build certain images or
not, and allow the product definition to override that choice.
There are a few use cases here:
* For GSI-like cases, we only want to build the system image. This
didn't really change, but it's somewhat simpler to configure, and
easier to understand the build logic.
* On the opposite side, when you're planning on using a GSI, the device
specific build can only build the vendor images (or some other set).
* Some cases (Fuchsia, etc) don't want to build any images, as they'll
be distributing the build artifacts in their own packaging.
I suspect in the future, TARGET_BUILD_APPS may be able to be refactored
into the third use case.
Test: treehugger
Test: Create a product definition that includes nothing, try to build it.
Test: compare build-aosp_crosshatch.ninja and build-crosshatch.ninja before/after
Change-Id: I685ab841be3718d3dd7052c28ccd764bb6f1991a
2019-01-16 21:42:05 +01:00
i f d e f B U I L D I N G _ O D M _ I M A G E
2017-11-14 16:42:30 +01:00
$( hide) $( call fs_config,$( zip_root) /ODM,odm/) > $( zip_root) /META/odm_filesystem_config.txt
e n d i f
2018-08-09 23:26:00 +02:00
@# ROOT always contains the files for the root under normal boot.
2017-03-06 04:56:52 +01:00
$( hide) $( call fs_config,$( zip_root) /ROOT,) > $( zip_root) /META/root_filesystem_config.txt
2018-03-01 06:20:08 +01:00
i f e q ( $( BOARD_USES_RECOVERY_AS_BOOT ) , t r u e )
2018-09-20 20:04:37 +02:00
@# BOOT/RAMDISK exists and contains the ramdisk for recovery if using BOARD_USES_RECOVERY_AS_BOOT.
2018-03-01 06:20:08 +01:00
$( hide) $( call fs_config,$( zip_root) /BOOT/RAMDISK,) > $( zip_root) /META/boot_filesystem_config.txt
2015-07-22 03:01:20 +02:00
e n d i f
2018-09-20 20:04:37 +02:00
i f n e q ( $( BOARD_BUILD_SYSTEM_ROOT_IMAGE ) , t r u e )
@# BOOT/RAMDISK also exists and contains the first stage ramdisk if not using BOARD_BUILD_SYSTEM_ROOT_IMAGE.
2017-03-06 04:56:52 +01:00
$( hide) $( call fs_config,$( zip_root) /BOOT/RAMDISK,) > $( zip_root) /META/boot_filesystem_config.txt
2018-03-01 06:20:08 +01:00
e n d i f
2015-10-28 03:25:18 +01:00
i f n e q ( $( INSTALLED_RECOVERYIMAGE_TARGET ) , )
2017-03-06 04:56:52 +01:00
$( hide) $( call fs_config,$( zip_root) /RECOVERY/RAMDISK,) > $( zip_root) /META/recovery_filesystem_config.txt
2016-06-16 23:47:10 +02:00
e n d i f
Add PRODUCT_BUILD_*_IMAGE, BUILDING_*_IMAGE to control building of images
These centralize the decisions on whether to build certain images or
not, and allow the product definition to override that choice.
There are a few use cases here:
* For GSI-like cases, we only want to build the system image. This
didn't really change, but it's somewhat simpler to configure, and
easier to understand the build logic.
* On the opposite side, when you're planning on using a GSI, the device
specific build can only build the vendor images (or some other set).
* Some cases (Fuchsia, etc) don't want to build any images, as they'll
be distributing the build artifacts in their own packaging.
I suspect in the future, TARGET_BUILD_APPS may be able to be refactored
into the third use case.
Test: treehugger
Test: Create a product definition that includes nothing, try to build it.
Test: compare build-aosp_crosshatch.ninja and build-crosshatch.ninja before/after
Change-Id: I685ab841be3718d3dd7052c28ccd764bb6f1991a
2019-01-16 21:42:05 +01:00
i f d e f B U I L D I N G _ S Y S T E M _ O T H E R _ I M A G E
2017-03-06 04:56:52 +01:00
$( hide) $( call fs_config,$( zip_root) /SYSTEM_OTHER,system/) > $( zip_root) /META/system_other_filesystem_config.txt
2015-10-28 03:25:18 +01:00
e n d i f
2017-04-04 22:01:18 +02:00
@# Metadata for compatibility verification.
2018-05-01 20:06:15 +02:00
$( hide) cp $( BUILT_SYSTEM_MATRIX) $( zip_root) /META/system_matrix.xml
2018-05-01 18:54:21 +02:00
$( hide) cp $( BUILT_ASSEMBLED_SYSTEM_MANIFEST) $( zip_root) /META/system_manifest.xml
i f d e f B U I L T _ A S S E M B L E D _ V E N D O R _ M A N I F E S T
$( hide) cp $( BUILT_ASSEMBLED_VENDOR_MANIFEST) $( zip_root) /META/vendor_manifest.xml
2017-04-04 22:01:18 +02:00
e n d i f
2017-04-14 09:00:46 +02:00
i f d e f B U I L T _ V E N D O R _ M A T R I X
$( hide) cp $( BUILT_VENDOR_MATRIX) $( zip_root) /META/vendor_matrix.xml
2017-04-04 22:01:18 +02:00
e n d i f
2018-10-17 00:55:25 +02:00
i f n e q ( $( BOARD_SUPER_PARTITION_GROUPS ) , )
$( hide) echo " super_partition_groups= $( BOARD_SUPER_PARTITION_GROUPS) " > $( zip_root) /META/dynamic_partitions_info.txt
2018-12-19 19:39:34 +01:00
@# Remove 'vendor' from the group partition list if the image is not available. This should only
@# happen to AOSP targets built without vendor.img. We can' t remove the partition from the
@# BoardConfig file, as it' s still needed elsewhere ( e.g. when creating super_empty.img) .
2018-10-17 00:55:25 +02:00
$( foreach group,$( BOARD_SUPER_PARTITION_GROUPS) , \
2018-12-19 19:39:34 +01:00
$( eval _group_partition_list := $( BOARD_$( call to-upper,$( group) ) _PARTITION_LIST) ) \
$( if $( INSTALLED_VENDORIMAGE_TARGET) ,,$( eval _group_partition_list := $( filter-out vendor,$( _group_partition_list) ) ) ) \
2018-10-17 00:55:25 +02:00
echo " $( group) _size= $( BOARD_$( call to-upper,$( group) ) _SIZE) " >> $( zip_root) /META/dynamic_partitions_info.txt; \
2018-12-19 19:39:34 +01:00
$( if $( _group_partition_list) , \
echo " $( group) _partition_list= $( _group_partition_list) " >> $( zip_root) /META/dynamic_partitions_info.txt; ) )
e n d i f # BOARD_SUPER_PARTITION_GROUPS
2015-03-25 14:06:30 +01:00
$( hide) PATH = $( foreach p,$( INTERNAL_USERIMAGES_BINARY_PATHS) ,$( p) :) $$ PATH MKBOOTIMG = $( MKBOOTIMG) \
2017-12-06 23:38:40 +01:00
build/make/tools/releasetools/add_img_to_target_files -a -v -p $( HOST_OUT) $( zip_root)
2017-03-06 04:56:52 +01:00
@# Zip everything up, preserving symlinks and placing META/ files first to
@# help early validation of the .zip file while uploading it.
$( hide) find $( zip_root) /META | sort >$@ .list
2017-03-21 02:22:43 +01:00
$( hide) find $( zip_root) -path $( zip_root) /META -prune -o -print | sort >>$@ .list
2017-03-06 04:56:52 +01:00
$( hide) $( SOONG_ZIP) -d -o $@ -C $( zip_root) -l $@ .list
2010-03-16 01:52:32 +01:00
2013-03-20 19:02:05 +01:00
.PHONY : target -files -package
2009-03-04 04:28:42 +01:00
target-files-package : $( BUILT_TARGET_FILES_PACKAGE )
2014-04-15 02:25:43 +02:00
i f n e q ( $( filter $ ( MAKECMDGOALS ) ,target -files -package ) , )
$( call dist -for -goals , target -files -package , $ ( BUILT_TARGET_FILES_PACKAGE ) )
e n d i f
2009-06-16 03:56:51 +02:00
2016-10-14 22:23:06 +02:00
# -----------------------------------------------------------------
# NDK Sysroot Package
NDK_SYSROOT_TARGET := $( PRODUCT_OUT) /ndk_sysroot.tar.bz2
2018-06-18 06:54:21 +02:00
$(NDK_SYSROOT_TARGET) : $( SOONG_OUT_DIR ) /ndk .timestamp
2016-10-14 22:23:06 +02:00
@echo Package NDK sysroot...
$( hide) tar cjf $@ -C $( SOONG_OUT_DIR) ndk
$( call dist -for -goals ,sdk ,$ ( NDK_SYSROOT_TARGET ) )
2015-08-11 20:24:19 +02:00
i f e q ( $( build_ota_package ) , t r u e )
2010-10-20 23:01:09 +02:00
# -----------------------------------------------------------------
# OTA update package
2018-11-09 02:44:12 +01:00
# $(1): output file
# $(2): additional args
d e f i n e b u i l d - o t a - p a c k a g e - t a r g e t
PATH = $( foreach p,$( INTERNAL_USERIMAGES_BINARY_PATHS) ,$( p) :) $$ PATH MKBOOTIMG = $( MKBOOTIMG) \
build/make/tools/releasetools/ota_from_target_files -v \
--block \
--extracted_input_target_files $( patsubst %.zip,%,$( BUILT_TARGET_FILES_PACKAGE) ) \
-p $( HOST_OUT) \
$( if $( OEM_OTA_CONFIG) , -o $( OEM_OTA_CONFIG) ) \
$( 2) \
$( BUILT_TARGET_FILES_PACKAGE) $( 1)
e n d e f
2009-06-15 23:30:14 +02:00
name := $( TARGET_PRODUCT)
i f e q ( $( TARGET_BUILD_TYPE ) , d e b u g )
name := $( name) _debug
e n d i f
name := $( name) -ota-$( FILE_NAME_TAG)
INTERNAL_OTA_PACKAGE_TARGET := $( PRODUCT_OUT) /$( name) .zip
2019-02-19 23:52:33 +01:00
INTERNAL_OTA_METADATA := $( PRODUCT_OUT) /ota_metadata
2009-06-15 23:30:14 +02:00
$(INTERNAL_OTA_PACKAGE_TARGET) : KEY_CERT_PAIR := $( DEFAULT_KEY_CERT_PAIR )
2017-04-20 00:54:22 +02:00
i f e q ( $( AB_OTA_UPDATER ) , t r u e )
$(INTERNAL_OTA_PACKAGE_TARGET) : $( BRILLO_UPDATE_PAYLOAD )
2017-07-07 00:13:59 +02:00
e l s e
2017-11-09 23:53:42 +01:00
$(INTERNAL_OTA_PACKAGE_TARGET) : $( BROTLI )
2017-04-20 00:54:22 +02:00
e n d i f
2019-02-19 23:52:33 +01:00
$(INTERNAL_OTA_PACKAGE_TARGET) : .KATI_IMPLICIT_OUTPUTS := $( INTERNAL_OTA_METADATA )
2016-05-10 09:40:38 +02:00
$(INTERNAL_OTA_PACKAGE_TARGET) : $( BUILT_TARGET_FILES_PACKAGE ) \
2018-11-26 19:12:05 +01:00
build/make/tools/releasetools/ota_from_target_files
2009-06-15 23:30:14 +02:00
@echo " Package OTA: $@ "
2019-02-19 23:52:33 +01:00
$( call build-ota-package-target,$@ ,-k $( KEY_CERT_PAIR) --output_metadata_path $( INTERNAL_OTA_METADATA) )
2009-06-15 23:30:14 +02:00
.PHONY : otapackage
otapackage : $( INTERNAL_OTA_PACKAGE_TARGET )
2018-12-27 21:47:23 +01:00
i f e q ( $( BOARD_BUILD_RETROFIT_DYNAMIC_PARTITIONS_OTA_PACKAGE ) , t r u e )
2018-11-09 02:44:12 +01:00
name := $( TARGET_PRODUCT)
i f e q ( $( TARGET_BUILD_TYPE ) , d e b u g )
name := $( name) _debug
e n d i f
name := $( name) -ota-retrofit-$( FILE_NAME_TAG)
INTERNAL_OTA_RETROFIT_DYNAMIC_PARTITIONS_PACKAGE_TARGET := $( PRODUCT_OUT) /$( name) .zip
$(INTERNAL_OTA_RETROFIT_DYNAMIC_PARTITIONS_PACKAGE_TARGET) : KEY_CERT_PAIR := $( DEFAULT_KEY_CERT_PAIR )
i f e q ( $( AB_OTA_UPDATER ) , t r u e )
$(INTERNAL_OTA_RETROFIT_DYNAMIC_PARTITIONS_PACKAGE_TARGET) : $( BRILLO_UPDATE_PAYLOAD )
e l s e
$(INTERNAL_OTA_RETROFIT_DYNAMIC_PARTITIONS_PACKAGE_TARGET) : $( BROTLI )
e n d i f
$(INTERNAL_OTA_RETROFIT_DYNAMIC_PARTITIONS_PACKAGE_TARGET) : $( BUILT_TARGET_FILES_PACKAGE ) \
2018-11-26 19:12:05 +01:00
build/make/tools/releasetools/ota_from_target_files
2018-11-09 02:44:12 +01:00
@echo " Package OTA (retrofit dynamic partitions): $@ "
$( call build-ota-package-target,$@ ,-k $( KEY_CERT_PAIR) --retrofit_dynamic_partitions)
.PHONY : otardppackage
otapackage otardppackage : $( INTERNAL_OTA_RETROFIT_DYNAMIC_PARTITIONS_PACKAGE_TARGET )
2018-12-27 21:47:23 +01:00
e n d i f # BOARD_BUILD_RETROFIT_DYNAMIC_PARTITIONS_OTA_PACKAGE
2018-11-09 02:44:12 +01:00
2015-08-11 20:24:19 +02:00
e n d i f # build_ota_package
2014-06-03 23:07:27 +02:00
2010-10-20 23:01:09 +02:00
# -----------------------------------------------------------------
# The update package
name := $( TARGET_PRODUCT)
i f e q ( $( TARGET_BUILD_TYPE ) , d e b u g )
name := $( name) _debug
e n d i f
name := $( name) -img-$( FILE_NAME_TAG)
INTERNAL_UPDATE_PACKAGE_TARGET := $( PRODUCT_OUT) /$( name) .zip
2016-08-07 05:15:06 +02:00
$(INTERNAL_UPDATE_PACKAGE_TARGET) : $( BUILT_TARGET_FILES_PACKAGE ) $( ZIP 2ZIP )
2010-10-20 23:01:09 +02:00
@echo " Package: $@ "
2016-08-07 05:15:06 +02:00
$( hide) $( ZIP2ZIP) -i $( BUILT_TARGET_FILES_PACKAGE) -o $@ \
OTA/android-info.txt:android-info.txt "IMAGES/*.img:."
2010-10-20 23:01:09 +02:00
.PHONY : updatepackage
updatepackage : $( INTERNAL_UPDATE_PACKAGE_TARGET )
2018-07-23 21:20:15 +02:00
# -----------------------------------------------------------------
# A zip of the appcompat directory containing logs
APPCOMPAT_ZIP := $( PRODUCT_OUT) /appcompat.zip
# For apps_only build we'll establish the dependency later in build/make/core/main.mk.
i f n d e f T A R G E T _ B U I L D _ A P P S
2018-08-21 06:09:07 +02:00
$(APPCOMPAT_ZIP) : $( INSTALLED_SYSTEMIMAGE_TARGET ) \
2018-11-26 19:12:05 +01:00
$( INSTALLED_RAMDISK_TARGET) \
$( INSTALLED_BOOTIMAGE_TARGET) \
$( INSTALLED_USERDATAIMAGE_TARGET) \
$( INSTALLED_VENDORIMAGE_TARGET) \
$( INSTALLED_PRODUCTIMAGE_TARGET) \
$( INSTALLED_PRODUCT_SERVICESIMAGE_TARGET)
2018-07-23 21:20:15 +02:00
e n d i f
$(APPCOMPAT_ZIP) : PRIVATE_LIST_FILE := $( call intermediates -dir -for ,PACKAGING ,appcompat ) /filelist
$(APPCOMPAT_ZIP) : $( SOONG_ZIP )
@echo " appcompat logs: $@ "
$( hide) rm -rf $@ $( PRIVATE_LIST_FILE)
$( hide) mkdir -p $( dir $@ ) $( PRODUCT_OUT) /appcompat $( dir $( PRIVATE_LIST_FILE) )
$( hide) find $( PRODUCT_OUT) /appcompat | sort >$( PRIVATE_LIST_FILE)
$( hide) $( SOONG_ZIP) -d -o $@ -C $( PRODUCT_OUT) /appcompat -l $( PRIVATE_LIST_FILE)
2009-03-04 04:28:42 +01:00
# -----------------------------------------------------------------
# A zip of the symbols directory. Keep the full paths to make it
# more obvious where these files came from.
#
name := $( TARGET_PRODUCT)
i f e q ( $( TARGET_BUILD_TYPE ) , d e b u g )
name := $( name) _debug
e n d i f
name := $( name) -symbols-$( FILE_NAME_TAG)
SYMBOLS_ZIP := $( PRODUCT_OUT) /$( name) .zip
2017-10-20 20:37:33 +02:00
# For apps_only build we'll establish the dependency later in build/make/core/main.mk.
2014-10-24 20:36:59 +02:00
i f n d e f T A R G E T _ B U I L D _ A P P S
2018-08-21 06:09:07 +02:00
$(SYMBOLS_ZIP) : $( INSTALLED_SYSTEMIMAGE_TARGET ) \
2018-11-26 19:12:05 +01:00
$( INSTALLED_RAMDISK_TARGET) \
$( INSTALLED_BOOTIMAGE_TARGET) \
$( INSTALLED_USERDATAIMAGE_TARGET) \
$( INSTALLED_VENDORIMAGE_TARGET) \
$( INSTALLED_PRODUCTIMAGE_TARGET) \
$( INSTALLED_PRODUCT_SERVICESIMAGE_TARGET) \
$( INSTALLED_ODMIMAGE_TARGET) \
$( updater_dep)
2014-10-24 20:36:59 +02:00
e n d i f
2016-08-07 05:15:06 +02:00
$(SYMBOLS_ZIP) : PRIVATE_LIST_FILE := $( call intermediates -dir -for ,PACKAGING ,symbols ) /filelist
$(SYMBOLS_ZIP) : $( SOONG_ZIP )
2009-03-04 04:28:42 +01:00
@echo " Package symbols: $@ "
2016-08-07 05:15:06 +02:00
$( hide) rm -rf $@ $( PRIVATE_LIST_FILE)
$( hide) mkdir -p $( dir $@ ) $( TARGET_OUT_UNSTRIPPED) $( dir $( PRIVATE_LIST_FILE) )
$( hide) find $( TARGET_OUT_UNSTRIPPED) | sort >$( PRIVATE_LIST_FILE)
2017-01-31 05:42:28 +01:00
$( hide) $( SOONG_ZIP) -d -o $@ -C $( OUT_DIR) /.. -l $( PRIVATE_LIST_FILE)
2016-09-12 22:56:50 +02:00
# -----------------------------------------------------------------
# A zip of the coverage directory.
#
name := $( TARGET_PRODUCT)
i f e q ( $( TARGET_BUILD_TYPE ) , d e b u g )
name := $( name) _debug
e n d i f
name := $( name) -coverage-$( FILE_NAME_TAG)
COVERAGE_ZIP := $( PRODUCT_OUT) /$( name) .zip
i f n d e f T A R G E T _ B U I L D _ A P P S
2018-08-21 06:09:07 +02:00
$(COVERAGE_ZIP) : $( INSTALLED_SYSTEMIMAGE_TARGET ) \
2018-11-26 19:12:05 +01:00
$( INSTALLED_RAMDISK_TARGET) \
$( INSTALLED_BOOTIMAGE_TARGET) \
$( INSTALLED_USERDATAIMAGE_TARGET) \
$( INSTALLED_VENDORIMAGE_TARGET) \
$( INSTALLED_PRODUCTIMAGE_TARGET) \
$( INSTALLED_PRODUCT_SERVICESIMAGE_TARGET) \
$( INSTALLED_ODMIMAGE_TARGET)
2016-09-12 22:56:50 +02:00
e n d i f
$(COVERAGE_ZIP) : PRIVATE_LIST_FILE := $( call intermediates -dir -for ,PACKAGING ,coverage ) /filelist
$(COVERAGE_ZIP) : $( SOONG_ZIP )
@echo " Package coverage: $@ "
$( hide) rm -rf $@ $( PRIVATE_LIST_FILE)
$( hide) mkdir -p $( dir $@ ) $( TARGET_OUT_COVERAGE) $( dir $( PRIVATE_LIST_FILE) )
$( hide) find $( TARGET_OUT_COVERAGE) | sort >$( PRIVATE_LIST_FILE)
$( hide) $( SOONG_ZIP) -d -o $@ -C $( TARGET_OUT_COVERAGE) -l $( PRIVATE_LIST_FILE)
2009-03-04 04:28:42 +01:00
# -----------------------------------------------------------------
# A zip of the Android Apps. Not keeping full path so that we don't
# include product names when distributing
#
name := $( TARGET_PRODUCT)
i f e q ( $( TARGET_BUILD_TYPE ) , d e b u g )
name := $( name) _debug
e n d i f
name := $( name) -apps-$( FILE_NAME_TAG)
APPS_ZIP := $( PRODUCT_OUT) /$( name) .zip
2018-08-21 06:09:07 +02:00
$(APPS_ZIP) : $( INSTALLED_SYSTEMIMAGE_TARGET )
2009-03-04 04:28:42 +01:00
@echo " Package apps: $@ "
$( hide) rm -rf $@
$( hide) mkdir -p $( dir $@ )
2015-08-23 18:40:05 +02:00
$( hide) apps_to_zip = ` find $( TARGET_OUT_APPS) $( TARGET_OUT_APPS_PRIVILEGED) -mindepth 2 -maxdepth 3 -name "*.apk" ` ; \
if [ -z " $$ apps_to_zip " ] ; then \
2018-11-26 19:12:05 +01:00
echo "No apps to zip up. Generating empty apps archive." ; \
a = $$ ( mktemp /tmp/XXXXXXX) && touch $$ a && zip $@ $$ a && zip -d $@ $$ a; \
2015-08-23 18:40:05 +02:00
else \
2018-11-26 19:12:05 +01:00
zip -qjX $@ $$ apps_to_zip; \
2015-08-23 18:40:05 +02:00
fi
2010-04-23 20:54:37 +02:00
2012-08-15 21:22:44 +02:00
i f e q ( t r u e , $( EMMA_INSTRUMENT ) )
2017-09-27 23:28:41 +02:00
#------------------------------------------------------------------
# An archive of classes for use in generating code-coverage reports
# These are the uninstrumented versions of any classes that were
# to be instrumented.
2017-10-20 20:37:33 +02:00
# Any dependencies are set up later in build/make/core/main.mk.
2017-09-27 23:28:41 +02:00
JACOCO_REPORT_CLASSES_ALL := $( PRODUCT_OUT) /jacoco-report-classes-all.jar
2017-04-12 01:36:46 +02:00
$(JACOCO_REPORT_CLASSES_ALL) :
@echo "Collecting uninstrumented classes"
$( hide) find $( TARGET_COMMON_OUT_ROOT) $( HOST_COMMON_OUT_ROOT) -name "jacoco-report-classes.jar" | \
2018-11-26 19:12:05 +01:00
zip -@ -0 -q -X $@
2017-04-12 01:36:46 +02:00
# Meaning of these options:
# -@ scan stdin for file paths to add to the zip
# -0 don't do any compression
# -q supress most output
# -X skip storing extended file attributes
2012-08-15 21:22:44 +02:00
e n d i f # EMMA_INSTRUMENT=true
2017-04-12 01:36:46 +02:00
2013-08-23 05:52:47 +02:00
#------------------------------------------------------------------
# A zip of Proguard obfuscation dictionary files.
# Only for apps_only build.
#
i f d e f T A R G E T _ B U I L D _ A P P S
2013-08-29 03:38:25 +02:00
PROGUARD_DICT_ZIP := $( PRODUCT_OUT) /$( TARGET_PRODUCT) -proguard-dict-$( FILE_NAME_TAG) .zip
2017-10-20 20:37:33 +02:00
# the dependency will be set up later in build/make/core/main.mk.
2013-08-23 05:52:47 +02:00
$(PROGUARD_DICT_ZIP) :
@echo "Packaging Proguard obfuscation dictionary files."
2017-09-27 23:28:41 +02:00
$( hide) dict_files = ` find $( TARGET_OUT_COMMON_INTERMEDIATES) /APPS -name proguard_dictionary` ; \
2018-11-26 19:12:05 +01:00
if [ -n " $$ dict_files " ] ; then \
unobfuscated_jars = $$ { dict_files//proguard_dictionary/classes.jar} ; \
zip -qX $@ $$ dict_files $$ unobfuscated_jars; \
else \
touch $( dir $@ ) /zipdummy; \
( cd $( dir $@ ) && zip -q $( notdir $@ ) zipdummy) ; \
zip -qd $@ zipdummy; \
rm $( dir $@ ) /zipdummy; \
fi
2013-08-23 05:52:47 +02:00
e n d i f # TARGET_BUILD_APPS
2018-11-29 21:06:31 +01:00
# -----------------------------------------------------------------
# super partition image
i f e q ( t r u e , $( PRODUCT_BUILD_SUPER_PARTITION ) )
# BOARD_SUPER_PARTITION_SIZE must be defined to build super image.
i f n e q ( $( BOARD_SUPER_PARTITION_SIZE ) , )
i f n e q ( t r u e , $( PRODUCT_RETROFIT_DYNAMIC_PARTITIONS ) )
INSTALLED_SUPERIMAGE_TARGET := $( PRODUCT_OUT) /super.img
$(INSTALLED_SUPERIMAGE_TARGET) : extracted_input_target_files := $( patsubst %.zip ,%,$ ( BUILT_TARGET_FILES_PACKAGE ) )
$(INSTALLED_SUPERIMAGE_TARGET) : $( LPMAKE ) $( BUILT_TARGET_FILES_PACKAGE ) $( BUILD_SUPER_IMAGE )
$( call pretty," Target super fs image: $@ " )
2018-12-13 19:45:46 +01:00
PATH = $( dir $( LPMAKE) ) :$$ PATH \
$( BUILD_SUPER_IMAGE) -v $( extracted_input_target_files) $@
2018-11-29 21:06:31 +01:00
e n d i f
$( call dist -for -goals ,dist_files ,$ ( INSTALLED_SUPERIMAGE_TARGET ) )
2018-11-29 21:32:00 +01:00
INSTALLED_SUPERIMAGE_EMPTY_TARGET := $( PRODUCT_OUT) /super_empty.img
$(INSTALLED_SUPERIMAGE_EMPTY_TARGET) : intermediates := $( call intermediates -dir -for ,PACKAGING ,super_empty )
$(INSTALLED_SUPERIMAGE_EMPTY_TARGET) : $( LPMAKE ) $( BUILD_SUPER_IMAGE )
$( call pretty," Target empty super fs image: $@ " )
mkdir -p $( intermediates)
rm -rf $( intermediates) /misc_info.txt
$( call dump-dynamic-partitions-info,$( intermediates) /misc_info.txt)
i f e q ( $( AB_OTA_UPDATER ) , t r u e )
2018-12-13 19:45:46 +01:00
echo "ab_update=true" >> $( intermediates) /misc_info.txt
2018-11-29 21:32:00 +01:00
e n d i f
2018-12-13 19:45:46 +01:00
PATH = $( dir $( LPMAKE) ) :$$ PATH \
$( BUILD_SUPER_IMAGE) -v $( intermediates) /misc_info.txt $@
2018-11-29 21:32:00 +01:00
$( call dist -for -goals ,dist_files ,$ ( INSTALLED_SUPERIMAGE_EMPTY_TARGET ) )
2018-11-29 21:06:31 +01:00
e n d i f # BOARD_SUPER_PARTITION_SIZE != ""
e n d i f # PRODUCT_BUILD_SUPER_PARTITION == "true"
2009-03-04 04:28:42 +01:00
# -----------------------------------------------------------------
# dalvik something
.PHONY : dalvikfiles
dalvikfiles : $( INTERNAL_DALVIK_MODULES )
2017-08-01 21:02:09 +02:00
i f e q ( $( BUILD_QEMU_IMAGES ) , t r u e )
MK_QEMU_IMAGE_SH := device/generic/goldfish/tools/mk_qemu_image.sh
SGDISK_HOST := $( HOST_OUT_EXECUTABLES) /sgdisk
2019-02-15 01:45:33 +01:00
i f d e f I N S T A L L E D _ S Y S T E M I M A G E _ T A R G E T
INSTALLED_QEMU_SYSTEMIMAGE := $( PRODUCT_OUT) /system-qemu.img
2018-08-21 06:09:07 +02:00
$(INSTALLED_QEMU_SYSTEMIMAGE) : $( INSTALLED_SYSTEMIMAGE_TARGET ) $( MK_QEMU_IMAGE_SH ) $( SGDISK_HOST ) $( SIMG 2IMG )
2017-08-01 21:02:09 +02:00
@echo Create system-qemu.img
2019-02-15 19:22:45 +01:00
( export SGDISK = $( SGDISK_HOST) SIMG2IMG = $( SIMG2IMG) ; $( MK_QEMU_IMAGE_SH) $( INSTALLED_SYSTEMIMAGE_TARGET) )
2017-08-01 21:02:09 +02:00
systemimage : $( INSTALLED_QEMU_SYSTEMIMAGE )
droidcore : $( INSTALLED_QEMU_SYSTEMIMAGE )
2019-02-15 01:45:33 +01:00
e n d i f
2018-12-13 15:34:18 +01:00
i f d e f I N S T A L L E D _ V E N D O R I M A G E _ T A R G E T
2017-08-01 21:02:09 +02:00
INSTALLED_QEMU_VENDORIMAGE := $( PRODUCT_OUT) /vendor-qemu.img
2018-08-03 20:34:55 +02:00
$(INSTALLED_QEMU_VENDORIMAGE) : $( INSTALLED_VENDORIMAGE_TARGET ) $( MK_QEMU_IMAGE_SH ) $( SGDISK_HOST ) $( SIMG 2IMG )
2017-08-01 21:02:09 +02:00
@echo Create vendor-qemu.img
2019-02-15 19:22:45 +01:00
( export SGDISK = $( SGDISK_HOST) SIMG2IMG = $( SIMG2IMG) ; $( MK_QEMU_IMAGE_SH) $( INSTALLED_VENDORIMAGE_TARGET) )
2017-08-01 21:02:09 +02:00
vendorimage : $( INSTALLED_QEMU_VENDORIMAGE )
droidcore : $( INSTALLED_QEMU_VENDORIMAGE )
e n d i f
2018-12-13 15:34:18 +01:00
i f d e f I N S T A L L E D _ P R O D U C T I M A G E _ T A R G E T
2017-11-27 09:04:47 +01:00
INSTALLED_QEMU_PRODUCTIMAGE := $( PRODUCT_OUT) /product-qemu.img
2018-08-03 20:34:55 +02:00
$(INSTALLED_QEMU_PRODUCTIMAGE) : $( INSTALLED_PRODUCTIMAGE_TARGET ) $( MK_QEMU_IMAGE_SH ) $( SGDISK_HOST ) $( SIMG 2IMG )
2017-11-27 09:04:47 +01:00
@echo Create product-qemu.img
2019-02-15 19:22:45 +01:00
( export SGDISK = $( SGDISK_HOST) SIMG2IMG = $( SIMG2IMG) ; $( MK_QEMU_IMAGE_SH) $( INSTALLED_PRODUCTIMAGE_TARGET) )
2017-11-27 09:04:47 +01:00
productimage : $( INSTALLED_QEMU_PRODUCTIMAGE )
droidcore : $( INSTALLED_QEMU_PRODUCTIMAGE )
e n d i f
2018-12-13 15:34:18 +01:00
i f d e f I N S T A L L E D _ P R O D U C T _ S E R V I C E S I M A G E _ T A R G E T
2018-08-17 01:56:14 +02:00
INSTALLED_QEMU_PRODUCT_SERVICESIMAGE := $( PRODUCT_OUT) /product_services-qemu.img
2018-08-03 20:34:55 +02:00
$(INSTALLED_QEMU_PRODUCT_SERVICESIMAGE) : $( INSTALLED_PRODUCT_SERVICESIMAGE_TARGET ) $( MK_QEMU_IMAGE_SH ) $( SGDISK_HOST ) $( SIMG 2IMG )
2018-08-17 01:56:14 +02:00
@echo Create product_services-qemu.img
2019-02-15 19:22:45 +01:00
( export SGDISK = $( SGDISK_HOST) SIMG2IMG = $( SIMG2IMG) ; $( MK_QEMU_IMAGE_SH) $( INSTALLED_PRODUCT_SERVICESIMAGE_TARGET) )
2018-05-29 14:09:01 +02:00
productservicesimage : $( INSTALLED_QEMU_PRODUCT_SERVICESIMAGE )
droidcore : $( INSTALLED_QEMU_PRODUCT_SERVICESIMAGE )
e n d i f
2018-12-13 15:34:18 +01:00
i f d e f I N S T A L L E D _ O D M I M A G E _ T A R G E T
2017-11-14 16:42:30 +01:00
INSTALLED_QEMU_ODMIMAGE := $( PRODUCT_OUT) /odm-qemu.img
$(INSTALLED_QEMU_ODMIMAGE) : $( INSTALLED_ODMIMAGE_TARGET ) $( MK_QEMU_IMAGE_SH ) $( SGDISK_HOST )
@echo Create odm-qemu.img
2019-02-15 19:22:45 +01:00
( export SGDISK = $( SGDISK_HOST) ; $( MK_QEMU_IMAGE_SH) $( INSTALLED_ODMIMAGE_TARGET) )
2017-11-14 16:42:30 +01:00
odmimage : $( INSTALLED_QEMU_ODMIMAGE )
droidcore : $( INSTALLED_QEMU_ODMIMAGE )
e n d i f
2018-08-08 01:29:22 +02:00
i f e q ( $( BOARD_AVB_ENABLE ) , t r u e )
QEMU_VERIFIED_BOOT_PARAMS := $( PRODUCT_OUT) /VerifiedBootParams.textproto
MK_VERIFIED_BOOT_KERNEL_CMDLINE_SH := device/generic/goldfish/tools/mk_verified_boot_params.sh
$(QEMU_VERIFIED_BOOT_PARAMS) : $( INSTALLED_QEMU_SYSTEMIMAGE ) $( MK_VERIFIED_BOOT_KERNEL_CMDLINE_SH ) $( INSTALLED_VBMETAIMAGE_TARGET ) $( SGDISK_HOST ) $( AVBTOOL )
@echo Creating $@
2018-09-27 21:49:18 +02:00
( export SGDISK = $( SGDISK_HOST) AVBTOOL = $( AVBTOOL) ; $( MK_VERIFIED_BOOT_KERNEL_CMDLINE_SH) $( INSTALLED_VBMETAIMAGE_TARGET) $( INSTALLED_QEMU_SYSTEMIMAGE) $( QEMU_VERIFIED_BOOT_PARAMS) )
2018-08-08 01:29:22 +02:00
systemimage : $( QEMU_VERIFIED_BOOT_PARAMS )
droidcore : $( QEMU_VERIFIED_BOOT_PARAMS )
e n d i f
2017-08-01 21:02:09 +02:00
e n d i f
2009-03-04 04:28:42 +01:00
# -----------------------------------------------------------------
# The emulator package
2012-07-26 19:15:21 +02:00
i f e q ( $( BUILD_EMULATOR ) , t r u e )
2009-03-04 04:28:42 +01:00
INTERNAL_EMULATOR_PACKAGE_FILES += \
$( HOST_OUT_EXECUTABLES) /emulator$( HOST_EXECUTABLE_SUFFIX) \
2012-01-07 01:44:06 +01:00
prebuilts/qemu-kernel/$( TARGET_ARCH) /kernel-qemu \
2009-03-04 04:28:42 +01:00
$( INSTALLED_RAMDISK_TARGET) \
2018-08-21 06:09:07 +02:00
$( INSTALLED_SYSTEMIMAGE_TARGET) \
$( INSTALLED_USERDATAIMAGE_TARGET)
2009-03-04 04:28:42 +01:00
name := $( TARGET_PRODUCT) -emulator-$( FILE_NAME_TAG)
INTERNAL_EMULATOR_PACKAGE_TARGET := $( PRODUCT_OUT) /$( name) .zip
2015-11-04 19:06:25 +01:00
$(INTERNAL_EMULATOR_PACKAGE_TARGET) : $( INTERNAL_EMULATOR_PACKAGE_FILES )
2009-03-04 04:28:42 +01:00
@echo " Package: $@ "
2015-10-30 00:33:05 +01:00
$( hide) zip -qjX $@ $( INTERNAL_EMULATOR_PACKAGE_FILES)
2009-03-04 04:28:42 +01:00
2012-07-26 19:15:21 +02:00
e n d i f
2009-03-04 04:28:42 +01:00
# -----------------------------------------------------------------
2012-02-28 00:49:23 +01:00
# Old PDK stuffs, retired
2009-03-04 04:28:42 +01:00
# The pdk package (Platform Development Kit)
2012-02-28 00:49:23 +01:00
#ifneq (,$(filter pdk,$(MAKECMDGOALS)))
# include development/pdk/Pdk.mk
#endif
2009-03-04 04:28:42 +01:00
# -----------------------------------------------------------------
# The SDK
# The SDK includes host-specific components, so it belongs under HOST_OUT.
2014-06-03 01:16:53 +02:00
sdk_dir := $( HOST_OUT) /sdk/$( TARGET_PRODUCT)
2009-03-04 04:28:42 +01:00
# Build a name that looks like:
#
# linux-x86 --> android-sdk_12345_linux-x86
# darwin-x86 --> android-sdk_12345_mac-x86
# windows-x86 --> android-sdk_12345_windows
#
sdk_name := android-sdk_$( FILE_NAME_TAG)
i f e q ( $( HOST_OS ) , d a r w i n )
2009-04-13 17:31:16 +02:00
INTERNAL_SDK_HOST_OS_NAME := mac
2009-03-04 04:28:42 +01:00
e l s e
2009-04-13 17:31:16 +02:00
INTERNAL_SDK_HOST_OS_NAME := $( HOST_OS)
2009-03-04 04:28:42 +01:00
e n d i f
i f n e q ( $( HOST_OS ) , w i n d o w s )
2014-06-09 21:31:12 +02:00
INTERNAL_SDK_HOST_OS_NAME := $( INTERNAL_SDK_HOST_OS_NAME) -$( SDK_HOST_ARCH)
2009-03-04 04:28:42 +01:00
e n d i f
2009-04-13 17:31:16 +02:00
sdk_name := $( sdk_name) _$( INTERNAL_SDK_HOST_OS_NAME)
2009-03-04 04:28:42 +01:00
sdk_dep_file := $( sdk_dir) /sdk_deps.mk
ATREE_FILES :=
- i n c l u d e $( sdk_dep_file )
# if we don't have a real list, then use "everything"
i f e q ( $( strip $ ( ATREE_FILES ) ) , )
ATREE_FILES := \
$( ALL_DEFAULT_INSTALLED_MODULES) \
$( INSTALLED_RAMDISK_TARGET) \
$( ALL_DOCS) \
2018-08-08 00:26:32 +02:00
$( TARGET_OUT_COMMON_INTERMEDIATES) /PACKAGING/api-stubs-docs_annotations.zip \
2009-03-04 04:28:42 +01:00
$( ALL_SDK_FILES)
e n d i f
atree_dir := development/build
2011-03-23 11:20:14 +01:00
2009-03-04 04:28:42 +01:00
sdk_atree_files := \
$( atree_dir) /sdk.exclude.atree \
2014-06-09 21:31:12 +02:00
$( atree_dir) /sdk-$( HOST_OS) -$( SDK_HOST_ARCH) .atree
2009-03-04 04:28:42 +01:00
2011-06-23 12:49:02 +02:00
# development/build/sdk-android-<abi>.atree is used to differentiate
# between architecture models (e.g. ARMv5TE versus ARMv7) when copying
# files like the kernel image. We use TARGET_CPU_ABI because we don't
# have a better way to distinguish between CPU models.
i f n e q ( , $( strip $ ( wildcard $ ( atree_dir ) /sdk -android -$ ( TARGET_CPU_ABI ) .atree ) ) )
sdk_atree_files += $( atree_dir) /sdk-android-$( TARGET_CPU_ABI) .atree
e n d i f
2014-02-28 17:45:59 +01:00
i f n e q ( $( PRODUCTS .$ ( INTERNAL_PRODUCT ) .PRODUCT_SDK_ATREE_FILES ) , )
sdk_atree_files += $( PRODUCTS.$( INTERNAL_PRODUCT) .PRODUCT_SDK_ATREE_FILES)
e l s e
sdk_atree_files += $( atree_dir) /sdk.atree
e n d i f
2014-08-12 00:20:02 +02:00
i n c l u d e $( BUILD_SYSTEM ) / s d k _ f o n t . m k
2014-08-01 19:14:15 +02:00
2009-03-04 04:28:42 +01:00
deps := \
$( target_notice_file_txt) \
$( tools_notice_file_txt) \
$( OUT_DOCS) /offline-sdk-timestamp \
2010-04-01 02:29:04 +02:00
$( SYMBOLS_ZIP) \
2016-09-12 22:56:50 +02:00
$( COVERAGE_ZIP) \
2018-07-23 21:20:15 +02:00
$( APPCOMPAT_ZIP) \
2018-08-21 06:09:07 +02:00
$( INSTALLED_SYSTEMIMAGE_TARGET) \
2017-08-01 21:02:09 +02:00
$( INSTALLED_QEMU_SYSTEMIMAGE) \
2017-08-14 23:52:20 +02:00
$( INSTALLED_QEMU_VENDORIMAGE) \
2018-08-08 01:29:22 +02:00
$( QEMU_VERIFIED_BOOT_PARAMS) \
2009-06-16 06:25:32 +02:00
$( INSTALLED_USERDATAIMAGE_TARGET) \
$( INSTALLED_RAMDISK_TARGET) \
2009-03-04 04:28:42 +01:00
$( INSTALLED_SDK_BUILD_PROP_TARGET) \
2010-04-01 02:29:04 +02:00
$( INSTALLED_BUILD_PROP_TARGET) \
2009-03-04 04:28:42 +01:00
$( ATREE_FILES) \
2014-02-18 23:29:59 +01:00
$( sdk_atree_files) \
2009-03-04 04:28:42 +01:00
$( HOST_OUT_EXECUTABLES) /atree \
2014-08-01 19:14:15 +02:00
$( HOST_OUT_EXECUTABLES) /line_endings \
2014-08-12 00:20:02 +02:00
$( SDK_FONT_DEPS)
2009-03-04 04:28:42 +01:00
INTERNAL_SDK_TARGET := $( sdk_dir) /$( sdk_name) .zip
$(INTERNAL_SDK_TARGET) : PRIVATE_NAME := $( sdk_name )
$(INTERNAL_SDK_TARGET) : PRIVATE_DIR := $( sdk_dir ) /$( sdk_name )
$(INTERNAL_SDK_TARGET) : PRIVATE_DEP_FILE := $( sdk_dep_file )
$(INTERNAL_SDK_TARGET) : PRIVATE_INPUT_FILES := $( sdk_atree_files )
# Set SDK_GNU_ERROR to non-empty to fail when a GNU target is built.
#
#SDK_GNU_ERROR := true
2015-11-04 19:06:25 +01:00
$(INTERNAL_SDK_TARGET) : $( deps )
2009-03-04 04:28:42 +01:00
@echo " Package SDK: $@ "
$( hide) rm -rf $( PRIVATE_DIR) $@
$( hide) for f in $( target_gnu_MODULES) ; do \
if [ -f $$ f ] ; then \
echo SDK: $( if $( SDK_GNU_ERROR) ,ERROR:,warning:) \
including GNU target $$ f >& 2; \
FAIL = $( SDK_GNU_ERROR) ; \
fi ; \
done ; \
if [ $$ FAIL ] ; then exit 1; fi
2014-08-12 19:23:58 +02:00
$( hide) echo $( notdir $( SDK_FONT_DEPS) ) | tr " " "\n" > $( SDK_FONT_TEMP) /fontsInSdk.txt
2009-03-04 04:28:42 +01:00
$( hide) ( \
2018-11-26 19:12:05 +01:00
ATREE_STRIP = " $( HOST_STRIP) -x " \
$( HOST_OUT_EXECUTABLES) /atree \
$( addprefix -f ,$( PRIVATE_INPUT_FILES) ) \
-m $( PRIVATE_DEP_FILE) \
-I . \
-I $( PRODUCT_OUT) \
-I $( HOST_OUT) \
-I $( TARGET_COMMON_OUT_ROOT) \
-v " PLATFORM_NAME=android- $( PLATFORM_VERSION) " \
-v " OUT_DIR= $( OUT_DIR) " \
-v " HOST_OUT= $( HOST_OUT) " \
-v " TARGET_ARCH= $( TARGET_ARCH) " \
-v " TARGET_CPU_ABI= $( TARGET_CPU_ABI) " \
-v " DLL_EXTENSION= $( HOST_SHLIB_SUFFIX) " \
-v " FONT_OUT= $( SDK_FONT_TEMP) " \
-o $( PRIVATE_DIR) && \
cp -f $( target_notice_file_txt) \
$( PRIVATE_DIR) /system-images/android-$( PLATFORM_VERSION) /$( TARGET_CPU_ABI) /NOTICE.txt && \
cp -f $( tools_notice_file_txt) $( PRIVATE_DIR) /platform-tools/NOTICE.txt && \
HOST_OUT_EXECUTABLES = $( HOST_OUT_EXECUTABLES) HOST_OS = $( HOST_OS) \
development/build/tools/sdk_clean.sh $( PRIVATE_DIR) && \
chmod -R ug+rwX $( PRIVATE_DIR) && \
cd $( dir $@ ) && zip -rqX $( notdir $@ ) $( PRIVATE_NAME) \
2009-03-04 04:28:42 +01:00
) || ( rm -rf $( PRIVATE_DIR) $@ && exit 44 )
2010-04-17 02:50:09 +02:00
# Is a Windows SDK requested? If so, we need some definitions from here
# in order to find the Linux SDK used to create the Windows one.
2011-02-16 01:09:36 +01:00
MAIN_SDK_NAME := $( sdk_name)
MAIN_SDK_DIR := $( sdk_dir)
MAIN_SDK_ZIP := $( INTERNAL_SDK_TARGET)
2015-01-27 21:47:10 +01:00
i f n e q ( $( filter win_sdk winsdk -tools ,$ ( MAKECMDGOALS ) ) , )
2010-04-17 02:50:09 +02:00
i n c l u d e $( TOPDIR ) d e v e l o p m e n t / b u i l d / t o o l s / w i n d o w s _ s d k . m k
e n d i f
2009-03-04 04:28:42 +01:00
# -----------------------------------------------------------------
# Findbugs
INTERNAL_FINDBUGS_XML_TARGET := $( PRODUCT_OUT) /findbugs.xml
INTERNAL_FINDBUGS_HTML_TARGET := $( PRODUCT_OUT) /findbugs.html
$(INTERNAL_FINDBUGS_XML_TARGET) : $( ALL_FINDBUGS_FILES )
@echo UnionBugs: $@
2014-05-20 10:04:16 +02:00
$( hide) $( FINDBUGS_DIR) /unionBugs $( ALL_FINDBUGS_FILES) \
2009-03-04 04:28:42 +01:00
> $@
$(INTERNAL_FINDBUGS_HTML_TARGET) : $( INTERNAL_FINDBUGS_XML_TARGET )
@echo ConvertXmlToText: $@
2014-05-20 10:04:16 +02:00
$( hide) $( FINDBUGS_DIR) /convertXmlToText -html:fancy.xsl \
2013-08-09 01:34:29 +02:00
$( INTERNAL_FINDBUGS_XML_TARGET) > $@
2009-03-04 04:28:42 +01:00
# -----------------------------------------------------------------
# Findbugs
# -----------------------------------------------------------------
# These are some additional build tasks that need to be run.
2013-08-09 01:34:29 +02:00
i f n e q ( $( dont_bother ) , t r u e )
2009-03-04 04:28:42 +01:00
i n c l u d e $( sort $ ( wildcard $ ( BUILD_SYSTEM ) /tasks /*.mk ) )
2010-11-12 15:46:00 +01:00
- i n c l u d e $( sort $ ( wildcard vendor /*/build /tasks /*.mk ) )
2012-04-16 19:03:16 +02:00
- i n c l u d e $( sort $ ( wildcard device /*/build /tasks /*.mk ) )
2015-08-21 00:39:56 +02:00
- i n c l u d e $( sort $ ( wildcard product /*/build /tasks /*.mk ) )
2014-09-06 02:47:34 +02:00
# Also the project-specific tasks
- i n c l u d e $( sort $ ( wildcard vendor /*/*/build /tasks /*.mk ) )
- i n c l u d e $( sort $ ( wildcard device /*/*/build /tasks /*.mk ) )
2015-08-21 00:39:56 +02:00
- i n c l u d e $( sort $ ( wildcard product /*/*/build /tasks /*.mk ) )
2016-06-21 07:03:24 +02:00
# Also add test specifc tasks
i n c l u d e $( sort $ ( wildcard platform_testing /build /tasks /*.mk ) )
2016-08-31 18:20:51 +02:00
i n c l u d e $( sort $ ( wildcard test /vts /tools /build /tasks /*.mk ) )
2013-08-09 01:34:29 +02:00
e n d i f
2011-02-16 01:09:36 +01:00
2015-10-29 00:42:39 +01:00
i n c l u d e $( BUILD_SYSTEM ) / p r o d u c t - g r a p h . m k
2011-02-16 01:09:36 +01:00
# -----------------------------------------------------------------
# Create SDK repository packages. Must be done after tasks/* since
# we need the addon rules defined.
i f n e q ( $( sdk_repo_goal ) , )
i n c l u d e $( TOPDIR ) d e v e l o p m e n t / b u i l d / t o o l s / s d k _ r e p o . m k
e n d i f