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 \
2020-01-10 01:15:11 +01:00
Prebuilt apk found in PRODUCT_COPY_FILES: $( 1) , use BUILD_PREBUILT instead!) ) ) \
$( if $ ( filter true ,$ ( BUILD_BROKEN_VINTF_PRODUCT_COPY_FILES ) ) ,, \
$( if $( filter $( TARGET_COPY_OUT_SYSTEM) /etc/vintf/% \
$( TARGET_COPY_OUT_SYSTEM) /manifest.xml \
$( TARGET_COPY_OUT_SYSTEM) /compatibility_matrix.xml,$( 2) ) , \
$( error VINTF metadata found in PRODUCT_COPY_FILES: $( 1) , use vintf_fragments instead!) ) \
$( if $( filter $( TARGET_COPY_OUT_PRODUCT) /etc/vintf/%,$( 2) ) , \
$( error VINTF metadata found in PRODUCT_COPY_FILES: $( 1) , \
use PRODUCT_MANIFEST_FILES / DEVICE_PRODUCT_COMPATIBILITY_MATRIX_FILE / vintf_compatibility_matrix / vintf_fragments instead!) ) \
$( if $( filter $( TARGET_COPY_OUT_SYSTEM_EXT) /etc/vintf/%,$( 2) ) , \
$( error VINTF metadata found in PRODUCT_COPY_FILES: $( 1) , \
use vintf_compatibility_matrix / vintf_fragments instead!) ) \
$( if $( filter $( TARGET_COPY_OUT_VENDOR) /etc/vintf/% \
$( TARGET_COPY_OUT_VENDOR) /manifest.xml \
$( TARGET_COPY_OUT_VENDOR) /compatibility_matrix.xml,$( 2) ) , \
$( error VINTF metadata found in PRODUCT_COPY_FILES: $( 1) , \
use DEVICE_MANIFEST_FILE / DEVICE_MATRIX_FILE / vintf_compatibility_matrix / vintf_fragments instead!) ) \
$( if $( filter $( TARGET_COPY_OUT_ODM) /etc/vintf/% \
$( TARGET_COPY_OUT_ODM) /etc/manifest%,$( 2) ) , \
$( error VINTF metadata found in PRODUCT_COPY_FILES: $( 1) , \
use ODM_MANIFEST_FILES / vintf_fragments instead!) ) \
)
2011-09-29 22:23:25 +02:00
e n d e f
2020-03-17 10:49:49 +01:00
2020-05-14 11:17:29 +02:00
# Phony target to check PRODUCT_COPY_FILES copy pairs don't contain ELF files
.PHONY : check -elf -prebuilt -product -copy -files
check-elf-prebuilt-product-copy-files :
2020-03-17 10:49:49 +01:00
check_elf_prebuilt_product_copy_files := true
2020-04-07 09:59:59 +02:00
i f n e q ( , $( filter true ,$ ( BUILD_BROKEN_ELF_PREBUILT_PRODUCT_COPY_FILES ) ) )
check_elf_prebuilt_product_copy_files :=
2020-03-17 10:49:49 +01:00
e n d i f
check_elf_prebuilt_product_copy_files_hint := \
found ELF prebuilt in PRODUCT_COPY_FILES, use cc_prebuilt_binary / cc_prebuilt_library_shared instead.
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) ) ) ,\
2020-03-17 10:49:49 +01:00
$( if $( and $( filter true,$( check_elf_prebuilt_product_copy_files) ) , \
$( filter bin lib lib64,$( subst /,$( space) ,$( _dest) ) ) ) , \
$( eval $( call copy-non-elf-file-checked,$( _src) ,$( _fulldest) ,$( check_elf_prebuilt_product_copy_files_hint) ) ) , \
$( 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" >$@
2021-06-16 04:35:06 +02:00
$(call dist-for-goals,droidcore-unbundled,$(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 :=
2019-04-18 18:38:25 +02:00
$( 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)
2018-08-15 23:28:01 +02:00
e n d i f
2019-12-14 03:55:18 +01:00
$( file >$ ( PRODUCT_OUT ) /.copied_headers_list ,$ ( TARGET_OUT_HEADERS ) $ ( ALL_COPIED_HEADERS ) )
2009-03-04 04:28:42 +01:00
# -----------------------------------------------------------------
# docs/index.html
2020-06-04 16:16:39 +02:00
i f e q ( , $( TARGET_BUILD_UNBUNDLED ) )
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
2021-09-16 23:50:08 +02:00
i f e q ( $( HOST_OS ) , l i n u x )
2019-04-18 23:46:48 +02:00
$( call dist -for -goals ,sdk ,$ ( API_FINGERPRINT ) )
2021-09-16 23:50:08 +02:00
e n d i f
2018-12-14 10:04:19 +01:00
2015-05-07 05:44:22 +02:00
INSTALLED_RECOVERYIMAGE_TARGET :=
2020-10-09 23:29:39 +02:00
# Build recovery image if
# BUILDING_RECOVERY_IMAGE && !BOARD_USES_RECOVERY_AS_BOOT && !BOARD_MOVE_RECOVERY_RESOURCES_TO_VENDOR_BOOT.
# If BOARD_USES_RECOVERY_AS_BOOT is true, leave empty because INSTALLED_BOOTIMAGE_TARGET is built
# with recovery resources.
# If BOARD_MOVE_RECOVERY_RESOURCES_TO_VENDOR_BOOT is true, leave empty to build recovery resources
# but not the final recovery image.
2019-04-22 20:09:57 +02:00
i f d e f B U I L D I N G _ R E C O V E R Y _ I M A G E
i f n e q ( $( BOARD_USES_RECOVERY_AS_BOOT ) , t r u e )
2020-10-09 23:29:39 +02:00
i f n e q ( $( BOARD_MOVE_RECOVERY_RESOURCES_TO_VENDOR_BOOT ) , t r u e )
2019-04-22 20:09:57 +02:00
INSTALLED_RECOVERYIMAGE_TARGET := $( PRODUCT_OUT) /recovery.img
e n d i f
2015-05-07 05:44:22 +02:00
e n d i f
2020-10-09 23:29:39 +02:00
e n d i f
2015-05-07 05:44:22 +02:00
2020-05-18 07:31:30 +02:00
i n c l u d e $( BUILD_SYSTEM ) / s y s p r o p . m k
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
2021-05-13 22:37:53 +02:00
$( hide) for x in $( strip $( 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 $@
2021-04-04 10:12:25 +02:00
# -----------------------------------------------------------------
# declare recovery ramdisk files
i f e q ( $( BUILDING_RECOVERY_IMAGE ) , t r u e )
INTERNAL_RECOVERY_RAMDISK_FILES_TIMESTAMP := $( call intermediates-dir-for,PACKAGING,recovery) /ramdisk_files-timestamp
e n d i f
2021-04-04 10:03:10 +02:00
# -----------------------------------------------------------------
# Declare vendor ramdisk fragments
INTERNAL_VENDOR_RAMDISK_FRAGMENTS :=
2021-04-04 10:12:25 +02:00
i f e q ( t r u e , $( BOARD_INCLUDE_RECOVERY_RAMDISK_IN_VENDOR_BOOT ) )
ifneq ( ,$( filter recovery,$( BOARD_VENDOR_RAMDISK_FRAGMENTS) ) )
$( error BOARD_VENDOR_RAMDISK_FRAGMENTS must not contain "recovery" if \
BOARD_INCLUDE_RECOVERY_RAMDISK_IN_VENDOR_BOOT is set )
endif
INTERNAL_VENDOR_RAMDISK_FRAGMENTS += recovery
VENDOR_RAMDISK_FRAGMENT.recovery.STAGING_DIR := $( TARGET_RECOVERY_ROOT_OUT)
VENDOR_RAMDISK_FRAGMENT.recovery.FILES := $( INTERNAL_RECOVERY_RAMDISK_FILES_TIMESTAMP)
BOARD_VENDOR_RAMDISK_FRAGMENT.recovery.MKBOOTIMG_ARGS += --ramdisk_type RECOVERY
.KATI_READONLY := VENDOR_RAMDISK_FRAGMENT.recovery.STAGING_DIR
e n d i f
2021-04-04 10:03:10 +02:00
# Validation check and assign default --ramdisk_type.
$( foreach vendor_ramdisk_fragment ,$ ( BOARD_VENDOR_RAMDISK_FRAGMENTS ) , \
$( if $( and $( BOARD_VENDOR_RAMDISK_FRAGMENT.$( vendor_ramdisk_fragment) .KERNEL_MODULE_DIRS) , \
$( BOARD_VENDOR_RAMDISK_FRAGMENT.$( vendor_ramdisk_fragment) .PREBUILT) ) , \
$( error Must not specify KERNEL_MODULE_DIRS for prebuilt vendor ramdisk fragment " $( vendor_ramdisk_fragment) " : $( BOARD_VENDOR_RAMDISK_FRAGMENT.$( vendor_ramdisk_fragment) .KERNEL_MODULE_DIRS) ) ) \
$( eval VENDOR_RAMDISK_FRAGMENT.$( vendor_ramdisk_fragment) .STAGING_DIR := $( call intermediates-dir-for,PACKAGING,vendor_ramdisk_fragment-stage-$( vendor_ramdisk_fragment) ) ) \
$( eval VENDOR_RAMDISK_FRAGMENT.$( vendor_ramdisk_fragment) .FILES := ) \
$( if $( BOARD_VENDOR_RAMDISK_FRAGMENT.$( vendor_ramdisk_fragment) .KERNEL_MODULE_DIRS) , \
$( if $( filter --ramdisk_type,$( BOARD_VENDOR_RAMDISK_FRAGMENT.$( vendor_ramdisk_fragment) .MKBOOTIMG_ARGS) ) ,, \
$( eval BOARD_VENDOR_RAMDISK_FRAGMENT.$( vendor_ramdisk_fragment) .MKBOOTIMG_ARGS += --ramdisk_type DLKM) ) ) \
)
# Create the "kernel module directory" to "vendor ramdisk fragment" inverse mapping.
$( foreach vendor_ramdisk_fragment ,$ ( BOARD_VENDOR_RAMDISK_FRAGMENTS ) , \
$( foreach kmd,$( BOARD_VENDOR_RAMDISK_FRAGMENT.$( vendor_ramdisk_fragment) .KERNEL_MODULE_DIRS) , \
$( eval kmd_vrf := KERNEL_MODULE_DIR_VENDOR_RAMDISK_FRAGMENT_$( kmd) ) \
$( if $( $( kmd_vrf) ) ,$( error Kernel module directory " $( kmd) " belongs to multiple vendor ramdisk fragments: " $( $( kmd_vrf) ) " " $( vendor_ramdisk_fragment) " , each kernel module directory should belong to exactly one or none vendor ramdisk fragment) ) \
$( eval $( kmd_vrf) := $( vendor_ramdisk_fragment) ) \
) \
)
INTERNAL_VENDOR_RAMDISK_FRAGMENTS += $( BOARD_VENDOR_RAMDISK_FRAGMENTS)
2021-04-09 14:09:13 +02:00
# Strip the list in case of any whitespace.
INTERNAL_VENDOR_RAMDISK_FRAGMENTS := \
$( strip $( INTERNAL_VENDOR_RAMDISK_FRAGMENTS) )
2021-04-04 10:03:10 +02:00
# Assign --ramdisk_name for each vendor ramdisk fragment.
$( foreach vendor_ramdisk_fragment ,$ ( INTERNAL_VENDOR_RAMDISK_FRAGMENTS ) , \
$( if $( filter --ramdisk_name,$( BOARD_VENDOR_RAMDISK_FRAGMENT.$( vendor_ramdisk_fragment) .MKBOOTIMG_ARGS) ) , \
$( error Must not specify --ramdisk_name for vendor ramdisk fragment: $( vendor_ramdisk_fragment) ) ) \
$( eval BOARD_VENDOR_RAMDISK_FRAGMENT.$( vendor_ramdisk_fragment) .MKBOOTIMG_ARGS += --ramdisk_name $( vendor_ramdisk_fragment) ) \
$( eval .KATI_READONLY := BOARD_VENDOR_RAMDISK_FRAGMENT.$( vendor_ramdisk_fragment) .MKBOOTIMG_ARGS) \
)
2019-06-05 20:53:43 +02:00
# -----------------------------------------------------------------
# kernel modules
# Depmod requires a well-formed kernel version so 0.0 is used as a placeholder.
DEPMOD_STAGING_SUBDIR := $= lib/modules/0.0
2020-05-13 01:40:02 +02:00
d e f i n e c o p y - a n d - s t r i p - k e r n e l - m o d u l e
$(2) : $( 1)
2020-06-19 22:42:17 +02:00
$( LLVM_STRIP) -o $( 2) --strip-debug $( 1)
2020-05-13 01:40:02 +02:00
e n d e f
2019-06-05 20:53:43 +02:00
# $(1): modules list
# $(2): output dir
# $(3): mount point
# $(4): staging dir
2019-06-19 21:56:48 +02:00
# $(5): module load list
# $(6): module load list filename
2019-11-13 22:29:02 +01:00
# $(7): module archive
2020-05-13 01:40:02 +02:00
# $(8): staging dir for stripped modules
2020-05-29 03:39:38 +02:00
# $(9): module directory name
2021-02-04 16:20:15 +01:00
# Returns a list of src:dest pairs to install the modules using copy-many-files.
2019-06-05 20:53:43 +02:00
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
2020-06-05 20:31:22 +02:00
$( if $( 9) , \
$( eval _dir := $( 9) /) , \
$( eval _dir := ) ) \
2020-05-13 01:40:02 +02:00
$( foreach module,$( 1) , \
$( eval _src := $( module) ) \
$( if $( 8) , \
$( eval _src := $( 8) /$( notdir $( module) ) ) \
$( eval $( call copy-and-strip-kernel-module,$( module) ,$( _src) ) ) ) \
2020-06-05 20:31:22 +02:00
$( _src) :$( 2) /lib/modules/$( _dir) $( notdir $( module) ) ) \
2020-05-29 03:39:38 +02:00
$( eval $( call build-image-kernel-modules-depmod,$( 1) ,$( 3) ,$( 4) ,$( 5) ,$( 6) ,$( 7) ,$( 2) ,$( 9) ) ) \
2020-06-05 20:31:22 +02:00
$( 4) /$( DEPMOD_STAGING_SUBDIR) /modules.dep:$( 2) /lib/modules/$( _dir) modules.dep \
$( 4) /$( DEPMOD_STAGING_SUBDIR) /modules.alias:$( 2) /lib/modules/$( _dir) modules.alias \
$( 4) /$( DEPMOD_STAGING_SUBDIR) /modules.softdep:$( 2) /lib/modules/$( _dir) modules.softdep \
$( 4) /$( DEPMOD_STAGING_SUBDIR) /$( 6) :$( 2) /lib/modules/$( _dir) $( 6)
2019-06-05 20:53:43 +02:00
e n d e f
# $(1): modules list
2019-06-19 21:56:48 +02:00
# $(2): mount point
# $(3): staging dir
# $(4): module load list
# $(5): module load list filename
2019-11-13 22:29:02 +01:00
# $(6): module archive
# $(7): output dir
2020-05-29 03:39:38 +02:00
# $(8): module directory name
2019-11-13 22:29:02 +01:00
# TODO(b/144844424): If a module archive is being used, this step (which
# generates obj/PACKAGING/.../modules.dep) also unzips the module archive into
# the output directory. This should be moved to a module with a
# LOCAL_POST_INSTALL_CMD so that if modules.dep is removed from the output dir,
# the archive modules are restored along with modules.dep.
2019-06-05 20:53:43 +02:00
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 - d e p m o d
2019-07-12 02:42:13 +02:00
$(3)/$(DEPMOD_STAGING_SUBDIR)/modules.dep : .KATI_IMPLICIT_OUTPUTS := $( 3) /$( DEPMOD_STAGING_SUBDIR ) /modules .alias $( 3) /$( DEPMOD_STAGING_SUBDIR ) /modules .softdep $( 3) /$( DEPMOD_STAGING_SUBDIR ) /$( 5)
2019-06-19 21:56:48 +02:00
$(3)/$(DEPMOD_STAGING_SUBDIR)/modules.dep : $( DEPMOD )
2021-05-13 22:37:53 +02:00
$(3)/$(DEPMOD_STAGING_SUBDIR)/modules.dep : PRIVATE_MODULES := $( strip $ ( 1) )
2019-06-19 21:56:48 +02:00
$(3)/$(DEPMOD_STAGING_SUBDIR)/modules.dep : PRIVATE_MOUNT_POINT := $( 2)
2020-05-29 03:39:38 +02:00
$(3)/$(DEPMOD_STAGING_SUBDIR)/modules.dep : PRIVATE_MODULE_DIR := $( 3) /$( DEPMOD_STAGING_SUBDIR ) /$( 2) /lib /modules /$( 8)
2019-06-19 21:56:48 +02:00
$(3)/$(DEPMOD_STAGING_SUBDIR)/modules.dep : PRIVATE_STAGING_DIR := $( 3)
2021-05-13 22:37:53 +02:00
$(3)/$(DEPMOD_STAGING_SUBDIR)/modules.dep : PRIVATE_LOAD_MODULES := $( strip $ ( 4) )
2019-06-19 21:56:48 +02:00
$(3)/$(DEPMOD_STAGING_SUBDIR)/modules.dep : PRIVATE_LOAD_FILE := $( 3) /$( DEPMOD_STAGING_SUBDIR ) /$( 5)
2019-11-13 22:29:02 +01:00
$(3)/$(DEPMOD_STAGING_SUBDIR)/modules.dep : PRIVATE_MODULE_ARCHIVE := $( 6)
$(3)/$(DEPMOD_STAGING_SUBDIR)/modules.dep : PRIVATE_OUTPUT_DIR := $( 7)
$(3)/$(DEPMOD_STAGING_SUBDIR)/modules.dep : $( 1) $( 6)
2019-06-05 20:53:43 +02:00
@echo depmod $$ ( PRIVATE_STAGING_DIR)
rm -rf $$ ( PRIVATE_STAGING_DIR)
2019-06-19 21:56:48 +02:00
mkdir -p $$ ( PRIVATE_MODULE_DIR)
2019-11-13 22:29:02 +01:00
$( if $( 6) ,\
2020-07-12 07:33:30 +02:00
unzip -qoDD -d $$ ( PRIVATE_MODULE_DIR) $$ ( PRIVATE_MODULE_ARCHIVE) ; \
2019-11-13 22:29:02 +01:00
mkdir -p $$ ( PRIVATE_OUTPUT_DIR) /lib; \
2020-05-29 03:39:38 +02:00
cp -r $( 3) /$( DEPMOD_STAGING_SUBDIR) /$( 2) /lib/modules $$ ( PRIVATE_OUTPUT_DIR) /lib/; \
2019-11-13 22:29:02 +01:00
find $$ ( PRIVATE_MODULE_DIR) -type f -name *.ko | xargs basename -a > $$ ( PRIVATE_LOAD_FILE) ; \
)
$( if $( 1) ,\
cp $$ ( PRIVATE_MODULES) $$ ( PRIVATE_MODULE_DIR) /; \
for MODULE in $$ ( PRIVATE_LOAD_MODULES) ; do \
basename $$ $$ MODULE >> $$ ( PRIVATE_LOAD_FILE) ; \
done ; \
)
2019-06-05 20:53:43 +02:00
$( DEPMOD) -b $$ ( PRIVATE_STAGING_DIR) 0.0
# Turn paths in modules.dep into absolute paths
2019-06-19 21:56:48 +02:00
sed -i.tmp -e 's|\([^: ]*lib/modules/[^: ]*\)|/\1|g' $$ ( PRIVATE_STAGING_DIR) /$$ ( DEPMOD_STAGING_SUBDIR) /modules.dep
touch $$ ( PRIVATE_LOAD_FILE)
e n d e f
# $(1): staging dir
2020-05-15 18:10:29 +02:00
# $(2): modules list
# $(3): module load list
# $(4): module load list filename
# $(5): output dir
2019-06-19 21:56:48 +02:00
d e f i n e m o d u l e - l o a d - l i s t - c o p y - p a t h s
2020-05-15 18:10:29 +02:00
$( eval $( call build-image-module-load-list,$( 1) ,$( 2) ,$( 3) ,$( 4) ) ) \
$( 1) /$( DEPMOD_STAGING_SUBDIR) /$( 4) :$( 5) /lib/modules/$( 4)
2019-06-05 20:53:43 +02:00
e n d e f
2019-06-19 21:56:48 +02:00
# $(1): staging dir
2020-05-15 18:10:29 +02:00
# $(2): modules list
# $(3): module load list
# $(4): module load list filename
2019-06-19 21:56:48 +02:00
d e f i n e b u i l d - i m a g e - m o d u l e - l o a d - l i s t
2020-05-15 18:10:29 +02:00
$(1)/$(DEPMOD_STAGING_SUBDIR)/$(4) : PRIVATE_LOAD_MODULES := $( 3)
$(1)/$(DEPMOD_STAGING_SUBDIR)/$(4) : $( 2)
@echo load-list $$ ( @)
@echo '$$(strip $$(notdir $$(PRIVATE_LOAD_MODULES)))' | tr ' ' '\n' > $$ ( @)
2019-06-19 21:56:48 +02:00
e n d e f
2021-04-04 15:30:48 +02:00
# $(1): source options file
# $(2): destination pathname
# Returns a build rule that checks the syntax of and installs a kernel modules
# options file. Strip and squeeze any extra space and blank lines.
# For use via $(eval).
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 - o p t i o n s - f i l e
$(2) : $( 1)
@echo " libmodprobe options $$ (@) "
$( hide) mkdir -p " $$ (dir $$ @) "
$( hide) rm -f " $$ @ "
$( hide) awk <" $$ < " >" $$ @ " \
' /^#/ { print; next } \
NF = = 0 { next } \
NF < 2 || $$ $$ 1 != "options" \
{ print "Invalid options line " FNR ": " $$ $$ 0 >"/dev/stderr" ; \
exit_status = 1; next } \
{ $$ $$ 1 = $$ $$ 1; print } \
END { exit exit_status } '
e n d e f
2021-02-04 16:20:15 +01:00
# $(1): source blocklist file
# $(2): destination pathname
# Returns a build rule that checks the syntax of and installs a kernel modules
2021-04-04 15:30:48 +02:00
# blocklist file. Strip and squeeze any extra space and blank lines.
2021-02-04 16:20:15 +01:00
# For use via $(eval).
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 - b l o c k l i s t - f i l e
$(2) : $( 1)
2021-04-04 15:30:48 +02:00
@echo " libmodprobe blocklist $$ (@) "
2021-02-04 16:20:15 +01:00
$( hide) mkdir -p " $$ (dir $$ @) "
$( hide) rm -f " $$ @ "
$( hide) awk <" $$ < " >" $$ @ " \
' /^#/ { print; next } \
NF = = 0 { next } \
NF != 2 || $$ $$ 1 != "blocklist" \
{ print "Invalid blocklist line " FNR ": " $$ $$ 0 >"/dev/stderr" ; \
exit_status = 1; next } \
{ $$ $$ 1 = $$ $$ 1; print } \
END { exit exit_status } '
e n d e f
2020-05-29 03:39:38 +02:00
# $(1): image name
# $(2): build output directory (TARGET_OUT_VENDOR, TARGET_RECOVERY_ROOT_OUT, etc)
# $(3): mount point
# $(4): module load filename
# $(5): stripped staging directory
# $(6): kernel module directory name (top is an out of band value for no directory)
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 - d i r
$( if $ ( filter top ,$ ( 6) ) ,\
$( eval _kver := ) $( eval _sep := ) ,\
$( eval _kver := $( 6) ) $( eval _sep := _) ) \
$( if $ ( 5) ,\
$( eval _stripped_staging_dir := $( 5) $( _sep) $( _kver) ) ,\
$( eval _stripped_staging_dir := ) ) \
$( if $ ( strip $ ( BOARD_ $ ( 1) _KERNEL_MODULES $ ( _sep ) $ ( _kver ) ) $ ( BOARD_ $ ( 1) _KERNEL_MODULES_ARCHIVE $ ( _sep ) $ ( _kver ) ) ) ,\
$( if $( BOARD_$( 1) _KERNEL_MODULES_LOAD$( _sep) $( _kver) ) ,,\
$( eval BOARD_$( 1) _KERNEL_MODULES_LOAD$( _sep) $( _kver) := $( BOARD_$( 1) _KERNEL_MODULES$( _sep) $( _kver) ) ) ) \
2021-02-04 16:20:15 +01:00
$( call copy-many-files,$( call build-image-kernel-modules,$( BOARD_$( 1) _KERNEL_MODULES$( _sep) $( _kver) ) ,$( 2) ,$( 3) ,$( call intermediates-dir-for,PACKAGING,depmod_$( 1) $( _sep) $( _kver) ) ,$( BOARD_$( 1) _KERNEL_MODULES_LOAD$( _sep) $( _kver) ) ,$( 4) ,$( BOARD_$( 1) _KERNEL_MODULES_ARCHIVE$( _sep) $( _kver) ) ,$( _stripped_staging_dir) ,$( _kver) ) ) ) \
2021-04-04 15:30:48 +02:00
$( if $ ( _kver ) , \
$( eval _dir := $( _kver) /) , \
$( eval _dir := ) ) \
$( if $ ( BOARD_ $ ( 1) _KERNEL_MODULES_OPTIONS_FILE $ ( _sep ) $ ( _kver ) ) , \
$( eval $( call build-image-kernel-modules-options-file, \
$( BOARD_$( 1) _KERNEL_MODULES_OPTIONS_FILE$( _sep) $( _kver) ) , \
$( 2) /lib/modules/$( _dir) modules.options) ) \
$( 2) /lib/modules/$( _dir) modules.options) \
2021-02-04 16:20:15 +01:00
$( if $ ( BOARD_ $ ( 1) _KERNEL_MODULES_BLOCKLIST_FILE $ ( _sep ) $ ( _kver ) ) , \
$( eval $( call build-image-kernel-modules-blocklist-file, \
$( BOARD_$( 1) _KERNEL_MODULES_BLOCKLIST_FILE$( _sep) $( _kver) ) , \
2021-04-04 15:30:48 +02:00
$( 2) /lib/modules/$( _dir) modules.blocklist) ) \
$( 2) /lib/modules/$( _dir) modules.blocklist)
2020-05-29 03:39:38 +02:00
e n d e f
# $(1): kernel module directory name (top is an out of band value for no directory)
d e f i n e b u i l d - r e c o v e r y - a s - b o o t - l o a d
$( if $ ( filter top ,$ ( 1) ) ,\
$( eval _kver := ) $( eval _sep := ) ,\
$( eval _kver := $( 1) ) $( eval _sep := _) ) \
$( if $( BOARD_GENERIC_RAMDISK_KERNEL_MODULES_LOAD$( _sep) $( _kver) ) ,\
$( call copy-many-files,$( call module-load-list-copy-paths,$( call intermediates-dir-for,PACKAGING,ramdisk_module_list$( _sep) $( _kver) ) ,$( BOARD_GENERIC_RAMDISK_KERNEL_MODULES$( _sep) $( _kver) ) ,$( BOARD_GENERIC_RAMDISK_KERNEL_MODULES_LOAD$( _sep) $( _kver) ) ,modules.load,$( TARGET_RECOVERY_ROOT_OUT) ) ) )
e n d e f
# $(1): kernel module directory name (top is an out of band value for no directory)
d e f i n e b u i l d - v e n d o r - r a m d i s k - r e c o v e r y - l o a d
$( if $ ( filter top ,$ ( 1) ) ,\
$( eval _kver := ) $( eval _sep := ) ,\
$( eval _kver := $( 1) ) $( eval _sep := _) ) \
$( if $( BOARD_VENDOR_RAMDISK_RECOVERY_KERNEL_MODULES_LOAD$( _sep) $( _kver) ) ,\
$( call copy-many-files,$( call module-load-list-copy-paths,$( call intermediates-dir-for,PACKAGING,vendor_ramdisk_recovery_module_list$( _sep) $( _kver) ) ,$( BOARD_VENDOR_RAMDISK_KERNEL_MODULES$( _sep) $( _kver) ) ,$( BOARD_VENDOR_RAMDISK_RECOVERY_KERNEL_MODULES_LOAD$( _sep) $( _kver) ) ,modules.load.recovery,$( TARGET_VENDOR_RAMDISK_OUT) ) ) )
e n d e f
2020-06-25 13:35:16 +02:00
# $(1): kernel module directory name (top is an out of band value for no directory)
d e f i n e b u i l d - v e n d o r - c h a r g e r - l o a d
$( if $ ( filter top ,$ ( 1) ) ,\
$( eval _kver := ) $( eval _sep := ) ,\
$( eval _kver := $( 1) ) $( eval _sep := _) ) \
$( if $( BOARD_VENDOR_CHARGER_KERNEL_MODULES_LOAD$( _sep) $( _kver) ) ,\
$( call copy-many-files,$( call module-load-list-copy-paths,$( call intermediates-dir-for,PACKAGING,vendor_charger_module_list$( _sep) $( _kver) ) ,$( BOARD_VENDOR_CHARGER_KERNEL_MODULES$( _sep) $( _kver) ) ,$( BOARD_VENDOR_CHARGER_KERNEL_MODULES_LOAD$( _sep) $( _kver) ) ,modules.load.charger,$( TARGET_OUT_VENDOR) ) ) )
e n d e f
2019-07-10 19:49:37 +02:00
i f n e q ( $( BUILDING_VENDOR_BOOT_IMAGE ) , t r u e )
# If there is no vendor boot partition, store vendor ramdisk kernel modules in the
# boot ramdisk.
2019-07-11 21:23:38 +02:00
BOARD_GENERIC_RAMDISK_KERNEL_MODULES += $( BOARD_VENDOR_RAMDISK_KERNEL_MODULES)
BOARD_GENERIC_RAMDISK_KERNEL_MODULES_LOAD += $( BOARD_VENDOR_RAMDISK_KERNEL_MODULES_LOAD)
e n d i f
2019-06-19 21:56:48 +02:00
2019-07-11 21:23:38 +02:00
i f e q ( $( BOARD_GENERIC_RAMDISK_KERNEL_MODULES_LOAD ) , )
BOARD_GENERIC_RAMDISK_KERNEL_MODULES_LOAD := $( BOARD_GENERIC_RAMDISK_KERNEL_MODULES)
2019-06-19 21:56:48 +02:00
e n d i f
2019-07-10 19:49:37 +02:00
i f n e q ( $( strip $ ( BOARD_GENERIC_RAMDISK_KERNEL_MODULES ) ) , )
2019-06-19 21:56:48 +02:00
ifeq ( $( BOARD_USES_RECOVERY_AS_BOOT) , true )
2019-07-11 21:23:38 +02:00
BOARD_RECOVERY_KERNEL_MODULES += $( BOARD_GENERIC_RAMDISK_KERNEL_MODULES)
2019-06-19 21:56:48 +02:00
endif
e n d i f
2021-08-23 12:01:51 +02:00
i f n e q ( $( BOARD_DO_NOT_STRIP_RECOVERY_MODULES ) , t r u e )
RECOVERY_STRIPPED_MODULE_STAGING_DIR := $( call intermediates-dir-for,PACKAGING,depmod_recovery_stripped)
e l s e
RECOVERY_STRIPPED_MODULE_STAGING_DIR :=
e n d i f
2020-05-13 01:40:02 +02:00
i f n e q ( $( BOARD_DO_NOT_STRIP_VENDOR_MODULES ) , t r u e )
VENDOR_STRIPPED_MODULE_STAGING_DIR := $( call intermediates-dir-for,PACKAGING,depmod_vendor_stripped)
e l s e
VENDOR_STRIPPED_MODULE_STAGING_DIR :=
e n d i f
2019-06-05 20:53:43 +02:00
2020-06-02 22:13:32 +02:00
i f n e q ( $( BOARD_DO_NOT_STRIP_VENDOR_RAMDISK_MODULES ) , t r u e )
VENDOR_RAMDISK_STRIPPED_MODULE_STAGING_DIR := $( call intermediates-dir-for,PACKAGING,depmod_vendor_ramdisk_stripped)
e l s e
VENDOR_RAMDISK_STRIPPED_MODULE_STAGING_DIR :=
e n d i f
2020-05-29 03:39:38 +02:00
BOARD_KERNEL_MODULE_DIRS += top
2021-04-04 10:03:10 +02:00
$( foreach kmd ,$ ( BOARD_KERNEL_MODULE_DIRS ) , \
2021-08-23 12:01:51 +02:00
$( eval ALL_DEFAULT_INSTALLED_MODULES += $( call build-image-kernel-modules-dir,RECOVERY,$( TARGET_RECOVERY_ROOT_OUT) ,,modules.load.recovery,$( RECOVERY_STRIPPED_MODULE_STAGING_DIR) ,$( kmd) ) ) \
2021-04-04 10:03:10 +02:00
$( eval vendor_ramdisk_fragment := $( KERNEL_MODULE_DIR_VENDOR_RAMDISK_FRAGMENT_$( kmd) ) ) \
2020-12-10 11:42:47 +01:00
$( if $( vendor_ramdisk_fragment) , \
$( eval output_dir := $( VENDOR_RAMDISK_FRAGMENT.$( vendor_ramdisk_fragment) .STAGING_DIR) ) \
$( eval result_var := VENDOR_RAMDISK_FRAGMENT.$( vendor_ramdisk_fragment) .FILES) \
$( eval ### else ###), \
$( eval output_dir := $( TARGET_VENDOR_RAMDISK_OUT) ) \
$( eval result_var := ALL_DEFAULT_INSTALLED_MODULES) ) \
2021-04-04 10:03:10 +02:00
$( eval $( result_var) += $( call build-image-kernel-modules-dir,VENDOR_RAMDISK,$( output_dir) ,,modules.load,$( VENDOR_RAMDISK_STRIPPED_MODULE_STAGING_DIR) ,$( kmd) ) ) \
$( eval ALL_DEFAULT_INSTALLED_MODULES += $( call build-vendor-ramdisk-recovery-load,$( kmd) ) ) \
$( eval ALL_DEFAULT_INSTALLED_MODULES += $( call build-image-kernel-modules-dir,VENDOR,$( if $( filter true,$( BOARD_USES_VENDOR_DLKMIMAGE) ) ,$( TARGET_OUT_VENDOR_DLKM) ,$( TARGET_OUT_VENDOR) ) ,vendor,modules.load,$( VENDOR_STRIPPED_MODULE_STAGING_DIR) ,$( kmd) ) ) \
$( eval ALL_DEFAULT_INSTALLED_MODULES += $( call build-vendor-charger-load,$( kmd) ) ) \
$( eval ALL_DEFAULT_INSTALLED_MODULES += $( call build-image-kernel-modules-dir,ODM,$( if $( filter true,$( BOARD_USES_ODM_DLKMIMAGE) ) ,$( TARGET_OUT_ODM_DLKM) ,$( TARGET_OUT_ODM) ) ,odm,modules.load,,$( kmd) ) ) \
2020-05-29 03:39:38 +02:00
$( if $( filter true,$( BOARD_USES_RECOVERY_AS_BOOT) ) ,\
2021-04-04 10:03:10 +02:00
$( eval ALL_DEFAULT_INSTALLED_MODULES += $( call build-recovery-as-boot-load,$( kmd) ) ) ,\
$( eval ALL_DEFAULT_INSTALLED_MODULES += $( call build-image-kernel-modules-dir,GENERIC_RAMDISK,$( TARGET_RAMDISK_OUT) ,,modules.load,,$( kmd) ) ) ) )
2019-06-05 20:53:43 +02:00
2009-03-04 04:28:42 +01:00
# -----------------------------------------------------------------
# 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
2020-05-01 03:29:09 +02:00
# $1 stem name of the package
2020-03-21 02:31:43 +01:00
# $2 certificate
# $3 private key
# $4 compressed
# $5 partition tag
# $6 output file
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
2020-03-21 02:31:43 +01:00
$( hide ) e c h o - n 'name="$(1).apk" certificate="$2" private_key="$3"' > > $ 6
$( if $ ( 4) , $ ( hide ) echo -n ' compressed ="$ 4"' >> $ 6)
$( if $ ( 5) , $ ( hide ) echo -n ' partition ="$ 5"' >> $ 6)
$( hide ) e c h o '' > > $ 6
2012-10-26 18:21:28 +02:00
e n d e f
2020-06-30 04:37:53 +02:00
# -----------------------------------------------------------------
# Merge an individual apkcerts output into the final apkcerts.txt output.
# Use a macro to make it compatible with _apkcerts_write_line
# $1 apkcerts file to be merged
# $2 output file
d e f i n e _ a p k c e r t s _ m e r g e
$( hide ) c a t $ 1 > > $ 2
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
2020-06-30 04:37:53 +02:00
all_apkcerts_files := $( sort $( foreach p,$( PACKAGES) ,$( PACKAGES.$( p) .APKCERTS_FILE) ) )
$(APKCERTS_FILE) : $( all_apkcerts_files )
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 $@
2019-05-02 21:42:09 +02:00
$( foreach p,$( sort $( PACKAGES) ) ,\
2020-06-30 04:37:53 +02:00
$( if $( PACKAGES.$( p) .APKCERTS_FILE) ,\
$( call _apkcerts_merge,$( PACKAGES.$( p) .APKCERTS_FILE) , $@ ) ,\
$( if $( PACKAGES.$( p) .EXTERNAL_KEY) ,\
2020-10-23 23:02:16 +02:00
$( call _apkcerts_write_line,$( PACKAGES.$( p) .STEM) ,EXTERNAL,,$( PACKAGES.$( p) .COMPRESSED) ,$( PACKAGES.$( p) .PARTITION) ,$@ ) ,\
2020-06-30 04:37:53 +02:00
$( call _apkcerts_write_line,$( PACKAGES.$( p) .STEM) ,$( PACKAGES.$( p) .CERTIFICATE) ,$( PACKAGES.$( p) .PRIVATE_KEY) ,$( PACKAGES.$( p) .COMPRESSED) ,$( PACKAGES.$( p) .PARTITION) ,$@ ) ) ) )
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) ) " >>$@ ; )
2021-06-16 04:35:06 +02:00
$( call dist -for -goals ,droidcore -unbundled ,$ ( BUILD_SYSTEM_STATS ) )
2009-06-15 23:30:14 +02:00
2019-02-27 03:15:51 +01:00
# -----------------------------------------------------------------
# build /product/etc/security/avb/system_other.avbpubkey if needed
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
2019-03-21 07:24:31 +01:00
i f e q ( $( BOARD_AVB_ENABLE ) , t r u e )
2019-02-27 03:15:51 +01:00
INSTALLED_PRODUCT_SYSTEM_OTHER_AVBKEY_TARGET := $( TARGET_OUT_PRODUCT_ETC) /security/avb/system_other.avbpubkey
ALL_DEFAULT_INSTALLED_MODULES += $( INSTALLED_PRODUCT_SYSTEM_OTHER_AVBKEY_TARGET)
2019-03-21 07:24:31 +01:00
e n d i f # BOARD_AVB_ENABLE
2019-02-27 03:15:51 +01:00
e n d i f # BUILDING_SYSTEM_OTHER_IMAGE
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 $@
2020-06-27 09:10:23 +02: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) ) ) , $( sort $( SOONG_CONV.$( s) .MAKEFILES) ) , $( sort $( SOONG_CONV.$( s) .INSTALLED) ) " >>$@ ; )
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) $< >$@
2021-06-16 04:35:06 +02:00
$( call dist -for -goals ,droidcore -unbundled ,$ ( SOONG_TO_CONVERT ) )
2016-08-26 22:27:13 +02:00
2020-06-27 09:10:23 +02:00
MK2BP_CATALOG_SCRIPT := build/make/tools/mk2bp_catalog.py
MK2BP_REMAINING_HTML := $( PRODUCT_OUT) /mk2bp_remaining.html
$(MK2BP_REMAINING_HTML) : PRIVATE_CODE_SEARCH_BASE_URL := "https ://cs .android .com /android /platform /superproject /+/master :"
$(MK2BP_REMAINING_HTML) : $( SOONG_CONV_DATA ) $( MK 2BP_CATALOG_SCRIPT )
@rm -f $@
$( hide) $( MK2BP_CATALOG_SCRIPT) \
--device= $( TARGET_DEVICE) \
--title= " Remaining Android.mk files for $( TARGET_DEVICE) - $( TARGET_BUILD_VARIANT) " \
--codesearch= $( PRIVATE_CODE_SEARCH_BASE_URL) \
--out_dir= " $( OUT_DIR) " \
2020-08-10 18:58:49 +02:00
--mode= html \
2020-06-27 09:10:23 +02:00
> $@
2021-06-16 04:35:06 +02:00
$( call dist -for -goals ,droidcore -unbundled ,$ ( MK 2BP_REMAINING_HTML ) )
2020-06-27 09:10:23 +02:00
2020-08-10 18:58:49 +02:00
MK2BP_REMAINING_CSV := $( PRODUCT_OUT) /mk2bp_remaining.csv
$(MK2BP_REMAINING_CSV) : $( SOONG_CONV_DATA ) $( MK 2BP_CATALOG_SCRIPT )
@rm -f $@
$( hide) $( MK2BP_CATALOG_SCRIPT) \
--device= $( TARGET_DEVICE) \
--out_dir= " $( OUT_DIR) " \
--mode= csv \
> $@
2021-06-16 04:35:06 +02:00
$( call dist -for -goals ,droidcore -unbundled ,$ ( MK 2BP_REMAINING_CSV ) )
2020-08-10 18:58:49 +02:00
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
2021-06-16 04:35:06 +02:00
$( call dist -for -goals ,droidcore -unbundled ,$ ( WALL_WERROR ) )
2017-11-06 19:47:24 +01:00
2019-09-14 02:02:32 +02:00
# -----------------------------------------------------------------
# C/C++ flag information for modules
2021-06-16 04:35:06 +02:00
$( call dist -for -goals ,droidcore -unbundled ,$ ( SOONG_MODULES_CFLAG_ARTIFACTS ) )
2019-09-14 02:02:32 +02:00
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 ) )
2020-12-08 21:56:02 +01:00
CERTIFICATE_VIOLATION_MODULES_FILENAME := $( PRODUCT_OUT) /certificate_violation_modules.txt
$(CERTIFICATE_VIOLATION_MODULES_FILENAME) :
rm -f $@
$( foreach m,$( sort $( CERTIFICATE_VIOLATION_MODULES) ) , echo $( m) >> $@ ; )
$( call dist -for -goals ,droidcore ,$ ( CERTIFICATE_VIOLATION_MODULES_FILENAME ) )
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) ) )
2020-05-29 00:46:33 +02:00
$(all_event_log_tags_file) : PRIVATE_SRC_FILES := $( all_event_log_tags_src )
$(all_event_log_tags_file) : $( all_event_log_tags_src ) $( 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,\
2020-05-13 14:19:05 +02:00
$( call resolve-bitness-for-modules,TARGET,$( PRODUCT_PACKAGES) ) \
2010-02-17 01:01:43 +01:00
$( 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
2020-05-29 00:46:33 +02:00
$(event_log_tags_file) : PRIVATE_SRC_FILES := $( event_log_tags_src )
2010-07-14 19:22:54 +02:00
$(event_log_tags_file) : PRIVATE_MERGED_FILE := $( all_event_log_tags_file )
2020-05-29 00:46:33 +02:00
$(event_log_tags_file) : $( event_log_tags_src ) $( all_event_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
2020-08-27 02:54:13 +02:00
ifdef BOARD_PREBUILT_BOOTLOADER
$( eval $( call copy-one-file,$( BOARD_PREBUILT_BOOTLOADER) ,$( INSTALLED_BOOTLOADER_MODULE) ) )
$( call dist-for-goals,dist_files,$( INSTALLED_BOOTLOADER_MODULE) )
endif # BOARD_PREBUILT_BOOTLOADER
2014-01-14 01:14:20 +01:00
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 )
2020-03-12 00:03:07 +01:00
ifneq ( $( strip $( BOARD_KERNEL_BINARIES) ) ,)
INSTALLED_KERNEL_TARGET := $( foreach k,$( BOARD_KERNEL_BINARIES) , \
$( PRODUCT_OUT) /$( k) )
else
INSTALLED_KERNEL_TARGET := $( PRODUCT_OUT) /kernel
endif
2014-01-14 01:14:20 +01:00
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 )
2019-06-11 01:39:45 +02:00
$(INSTALLED_FILES_FILE_ROOT) : $( INTERNAL_ROOT_FILES ) $( FILESLIST ) $( FILESLIST_UTIL )
2018-07-04 00:41:40 +02:00
@echo Installed file list: $@
2021-03-06 22:29:28 +01:00
mkdir -p $( dir $@ )
rm -f $@
$( FILESLIST) $( TARGET_ROOT_OUT) > $( @:.txt= .json)
$( FILESLIST_UTIL) -c $( @:.txt= .json) > $@
2018-07-04 00:41:40 +02:00
2021-09-16 23:50:08 +02:00
i f e q ( $( HOST_OS ) , l i n u x )
2018-07-04 00:41:40 +02:00
$( call dist -for -goals , sdk win_sdk sdk_addon , $ ( INSTALLED_FILES_FILE_ROOT ) )
2021-09-16 23:50:08 +02:00
e n d i f
2018-07-04 00:41:40 +02:00
2019-01-23 03:08:59 +01:00
#------------------------------------------------------------------
# dtb
2019-05-20 20:10:24 +02: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
2019-01-23 03:08:59 +01:00
INSTALLED_DTBIMAGE_TARGET := $( PRODUCT_OUT) /dtb.img
2019-05-20 20:10:24 +02:00
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
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
2019-05-20 20:10:24 +02:00
e n d i f
2019-01-23 03:08:59 +01:00
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 )
2019-06-11 01:39:45 +02:00
$(INSTALLED_FILES_FILE_RAMDISK) : $( INTERNAL_RAMDISK_FILES ) $( FILESLIST ) $( FILESLIST_UTIL )
2018-08-09 23:26:00 +02:00
@echo Installed file list: $@
2021-03-06 22:29:28 +01:00
mkdir -p $( TARGET_RAMDISK_OUT)
mkdir -p $( dir $@ )
rm -f $@
$( FILESLIST) $( TARGET_RAMDISK_OUT) > $( @:.txt= .json)
$( FILESLIST_UTIL) -c $( @:.txt= .json) > $@
2018-08-09 23:26:00 +02:00
2021-09-16 23:50:08 +02:00
i f e q ( $( HOST_OS ) , l i n u x )
2018-08-09 23:26:00 +02:00
$( call dist -for -goals , sdk win_sdk sdk_addon , $ ( INSTALLED_FILES_FILE_RAMDISK ) )
2021-09-16 23:50:08 +02:00
e n d i f
2009-04-10 04:31:12 +02:00
BUILT_RAMDISK_TARGET := $( PRODUCT_OUT) /ramdisk.img
2020-05-11 22:20:03 +02:00
i f e q ( $( BOARD_RAMDISK_USE_LZ 4) , t r u e )
# -l enables the legacy format used by the Linux kernel
COMPRESSION_COMMAND_DEPS := $( LZ4)
COMPRESSION_COMMAND := $( LZ4) -l -12 --favor-decSpeed
RAMDISK_EXT := .lz4
e l s e
COMPRESSION_COMMAND_DEPS := $( MINIGZIP)
COMPRESSION_COMMAND := $( MINIGZIP)
RAMDISK_EXT := .gz
e n d i f
2009-04-10 04:31:12 +02:00
# We just build this directly to the install location.
INSTALLED_RAMDISK_TARGET := $( BUILT_RAMDISK_TARGET)
2021-06-11 05:55:10 +02:00
$(INSTALLED_RAMDISK_TARGET) : PRIVATE_DIRS := debug_ramdisk dev metadata mnt proc second_stage_resources sys
2020-05-11 22:20:03 +02:00
$(INSTALLED_RAMDISK_TARGET) : $( MKBOOTFS ) $( INTERNAL_RAMDISK_FILES ) $( INSTALLED_FILES_FILE_RAMDISK ) | $( COMPRESSION_COMMAND_DEPS )
2021-03-06 22:26:01 +01:00
$( call pretty," Target ramdisk: $@ " )
2021-06-11 05:55:10 +02:00
$( hide) mkdir -p $( addprefix $( TARGET_RAMDISK_OUT) /,$( PRIVATE_DIRS) )
i f e q ( t r u e , $( BOARD_USES_GENERIC_KERNEL_IMAGE ) )
$( hide) mkdir -p $( addprefix $( TARGET_RAMDISK_OUT) /first_stage_ramdisk/,$( PRIVATE_DIRS) )
e n d i f
2020-05-11 22:20:03 +02:00
$( hide) $( MKBOOTFS) -d $( TARGET_OUT) $( TARGET_RAMDISK_OUT) | $( COMPRESSION_COMMAND) > $@
2009-03-04 04:28:42 +01:00
2013-08-09 01:34:29 +02:00
.PHONY : ramdisk -nodeps
2020-05-11 22:20:03 +02:00
ramdisk-nodeps : $( MKBOOTFS ) | $( COMPRESSION_COMMAND_DEPS )
2013-08-09 01:34:29 +02:00
@echo " make $@ : ignoring dependencies "
2020-05-11 22:20:03 +02:00
$( hide) $( MKBOOTFS) -d $( TARGET_OUT) $( TARGET_RAMDISK_OUT) | $( COMPRESSION_COMMAND) > $( 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
2019-04-22 20:09:57 +02:00
# -----------------------------------------------------------------
# the boot image, which is a collection of other images.
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
2019-04-22 20:09:57 +02:00
# This is defined here since we may be building recovery as boot
# below and only want to define this once
2020-03-12 00:03:07 +01:00
i f n e q ( $( strip $ ( BOARD_KERNEL_BINARIES ) ) , )
BUILT_BOOTIMAGE_TARGET := $( foreach k,$( subst kernel,boot,$( BOARD_KERNEL_BINARIES) ) , $( PRODUCT_OUT) /$( k) .img)
e l s e
BUILT_BOOTIMAGE_TARGET := $( PRODUCT_OUT) /boot.img
e n d i f
2020-10-22 23:37:01 +02:00
INTERNAL_PREBUILT_BOOTIMAGE :=
my_installed_prebuilt_gki_apex := $( strip $( foreach package,$( PRODUCT_PACKAGES) ,$( if $( ALL_MODULES.$( package) .EXTRACTED_BOOT_IMAGE) ,$( package) ) ) )
i f d e f m y _ i n s t a l l e d _ p r e b u i l t _ g k i _ a p e x
ifneq ( 1,$( words $( my_installed_prebuilt_gki_apex) ) ) # len(my_installed_prebuilt_gki_apex) > 1
$( error More than one prebuilt GKI APEXes are installed: $( my_installed_prebuilt_gki_apex) )
endif # len(my_installed_prebuilt_gki_apex) > 1
ifdef BOARD_PREBUILT_BOOTIMAGE
$( error Must not define BOARD_PREBUILT_BOOTIMAGE because a prebuilt GKI APEX is installed: $( my_installed_prebuilt_gki_apex) )
endif # BOARD_PREBUILT_BOOTIMAGE defined
my_apex_extracted_boot_image := $( ALL_MODULES.$( my_installed_prebuilt_gki_apex) .EXTRACTED_BOOT_IMAGE)
INSTALLED_BOOTIMAGE_TARGET := $( PRODUCT_OUT) /boot.img
$( eval $( call copy-one-file,$( my_apex_extracted_boot_image) ,$( INSTALLED_BOOTIMAGE_TARGET) ) )
INTERNAL_PREBUILT_BOOTIMAGE := $( my_apex_extracted_boot_image)
e l s e # my_installed_prebuilt_gki_apex not defined
2020-08-09 23:36:56 +02:00
# $1: boot image target
# returns the kernel used to make the bootimage
d e f i n e b o o t i m a g e - t o - k e r n e l
$( if $( BOARD_KERNEL_BINARIES) ,\
$( PRODUCT_OUT) /$( subst .img,,$( subst boot,kernel,$( notdir $( 1) ) ) ) ,\
$( INSTALLED_KERNEL_TARGET) )
e n d e f
2020-05-08 02:32:10 +02:00
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
BOARD_KERNEL_BOOTIMAGE_PARTITION_SIZE := $( BOARD_BOOTIMAGE_PARTITION_SIZE)
e n d i f
# $1: boot image file name
2021-03-04 07:41:16 +01:00
# $2: boot image variant (boot, boot-debug, boot-test-harness)
2020-05-08 02:32:10 +02:00
d e f i n e g e t - b o o t i m a g e - p a r t i t i o n - s i z e
$( BOARD_$( call to-upper,$( subst .img,,$( subst $( 2) ,kernel,$( notdir $( 1) ) ) ) ) _BOOTIMAGE_PARTITION_SIZE)
e n d e f
2017-07-18 19:05:13 +02:00
2009-03-04 04:28:42 +01:00
i f n e q ( $( strip $ ( TARGET_NO_KERNEL ) ) , t r u e )
INTERNAL_BOOTIMAGE_ARGS := \
2020-08-09 23:36:56 +02:00
$( addprefix --second ,$( INSTALLED_2NDBOOTLOADER_TARGET) )
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
2019-07-10 19:49:37 +02:00
i f n d e f B U I L D I N G _ V E N D O R _ B O O T _ I M A G E
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)
2009-05-08 04:43:08 +02:00
e n d i f
2010-08-23 21:56:25 +02:00
e n d i f
2019-07-10 19:49:37 +02:00
INTERNAL_BOOTIMAGE_FILES := $( filter-out --%,$( INTERNAL_BOOTIMAGE_ARGS) )
2019-03-28 16:45:40 +01:00
i f e q ( $( PRODUCT_SUPPORTS_VERITY ) , t r u e )
2016-05-27 18:49:49 +02:00
i f e q ( $( BOARD_BUILD_SYSTEM_ROOT_IMAGE ) , t r u e )
2019-03-28 16:45:40 +01:00
VERITY_KEYID := veritykeyid = id:` openssl x509 -in $( PRODUCT_VERITY_SIGNING_KEY) .x509.pem -text \
2016-05-27 18:49:49 +02:00
| 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) )
2019-07-10 19:49:37 +02:00
Do not assume GKI just with vendor_boot.
This change ensures changes to GENERIC_KERNEL_CMDLINE only affects
devices that explicitly says it uses GKI/generic boot image.
In details, if the device has vendor_boot, but does not explicitly
specify that it uses GKI/generic boot image, do not include
GENERIC_KERNEL_CMDLINE in boot. boot cmdline is left empty
in this case.
The old logic:
- If device uses GKI *OR* has vendor_boot:
boot uses GENERIC_KERNEL_CMDLINE, and do not include kernel base
and pagesize.
- If device has vendor_boot, INTERNAL_KERNEL_CMDLINE, kernel base
and pagesize goes in vendor_boot.
- If device does not use GKI nor have vendor_boot:
boot uses INTERNAL_KERNEL_CMDLINE, and includes kernel base and
pagesize.
The new logic:
- If using GKI, boot uses GENERIC_KERNEL_CMDLINE. Remove kernel base
and pagesize because they are device-specific.
- If not using GKI:
- If building vendor_boot, INTERNAL_KERNEL_CMDLINE, base and
pagesize goes in vendor_boot; boot does not have cmdline, base or
pagesize.
- Otherwise, put them in boot
Comparison of the code before and after:
- If device uses GKI,
- For boot partition:
- cmdline continues to be GENERIC_KERNEL_CMDLINE
- kernel base and pagesize continues to be excluded
- For vendor_boot partition:
- cmdline continues to be INTERNAL_KERNEL_CMDLINE
- kernel base and pagesize continues to be included
- If device does not use GKI:
- If device has a vendor_boot partition:
- For boot partition:
* cmdline changes from GENERIC_KERNEL_CMDLINE to empty
- kernel base and pagesize continues to be excluded
- For vendor_boot partition:
- cmdline continues to be INTERNAL_KERNEL_CMDLINE
- kernel base and pagesize continues to be included
- If device does not have a vendor_boot partition:
- For boot partition:
- cmdline continues to be INTERNAL_KERNEL_CMDLINE
- kernel base and pagesize continues to be included
Test: builds
Bug: 171512004
Change-Id: I4feac435698f43ac299b430bff66147057865a62
2020-10-28 21:50:47 +01:00
# kernel cmdline/base/pagesize in boot.
# - If using GKI, use GENERIC_KERNEL_CMDLINE. Remove kernel base and pagesize because they are
# device-specific.
# - If not using GKI:
# - If building vendor_boot, INTERNAL_KERNEL_CMDLINE, base and pagesize goes in vendor_boot.
# - Otherwise, put them in boot.
i f e q ( t r u e , $( BOARD_USES_GENERIC_KERNEL_IMAGE ) )
2020-10-12 20:08:30 +02:00
ifdef GENERIC_KERNEL_CMDLINE
INTERNAL_BOOTIMAGE_ARGS += --cmdline " $( GENERIC_KERNEL_CMDLINE) "
endif
Do not assume GKI just with vendor_boot.
This change ensures changes to GENERIC_KERNEL_CMDLINE only affects
devices that explicitly says it uses GKI/generic boot image.
In details, if the device has vendor_boot, but does not explicitly
specify that it uses GKI/generic boot image, do not include
GENERIC_KERNEL_CMDLINE in boot. boot cmdline is left empty
in this case.
The old logic:
- If device uses GKI *OR* has vendor_boot:
boot uses GENERIC_KERNEL_CMDLINE, and do not include kernel base
and pagesize.
- If device has vendor_boot, INTERNAL_KERNEL_CMDLINE, kernel base
and pagesize goes in vendor_boot.
- If device does not use GKI nor have vendor_boot:
boot uses INTERNAL_KERNEL_CMDLINE, and includes kernel base and
pagesize.
The new logic:
- If using GKI, boot uses GENERIC_KERNEL_CMDLINE. Remove kernel base
and pagesize because they are device-specific.
- If not using GKI:
- If building vendor_boot, INTERNAL_KERNEL_CMDLINE, base and
pagesize goes in vendor_boot; boot does not have cmdline, base or
pagesize.
- Otherwise, put them in boot
Comparison of the code before and after:
- If device uses GKI,
- For boot partition:
- cmdline continues to be GENERIC_KERNEL_CMDLINE
- kernel base and pagesize continues to be excluded
- For vendor_boot partition:
- cmdline continues to be INTERNAL_KERNEL_CMDLINE
- kernel base and pagesize continues to be included
- If device does not use GKI:
- If device has a vendor_boot partition:
- For boot partition:
* cmdline changes from GENERIC_KERNEL_CMDLINE to empty
- kernel base and pagesize continues to be excluded
- For vendor_boot partition:
- cmdline continues to be INTERNAL_KERNEL_CMDLINE
- kernel base and pagesize continues to be included
- If device does not have a vendor_boot partition:
- For boot partition:
- cmdline continues to be INTERNAL_KERNEL_CMDLINE
- kernel base and pagesize continues to be included
Test: builds
Bug: 171512004
Change-Id: I4feac435698f43ac299b430bff66147057865a62
2020-10-28 21:50:47 +01:00
e l s e i f n d e f B U I L D I N G _ V E N D O R _ B O O T _ I M A G E # && BOARD_USES_GENERIC_KERNEL_IMAGE != true
ifdef INTERNAL_KERNEL_CMDLINE
INTERNAL_BOOTIMAGE_ARGS += --cmdline " $( INTERNAL_KERNEL_CMDLINE) "
endif
ifdef BOARD_KERNEL_BASE
INTERNAL_BOOTIMAGE_ARGS += --base $( BOARD_KERNEL_BASE)
endif
ifdef BOARD_KERNEL_PAGESIZE
INTERNAL_BOOTIMAGE_ARGS += --pagesize $( BOARD_KERNEL_PAGESIZE)
endif
e n d i f # BUILDING_VENDOR_BOOT_IMAGE == "" && BOARD_USES_GENERIC_KERNEL_IMAGE != true
2016-05-27 18:49:49 +02:00
2016-03-15 17:49:30 +01:00
INTERNAL_MKBOOTIMG_VERSION_ARGS := \
2019-10-23 00:58:17 +02:00
--os_version $( PLATFORM_VERSION_LAST_STABLE) \
2016-03-15 17:49:30 +01:00
--os_patch_level $( PLATFORM_SECURITY_PATCH)
2021-03-12 14:40:32 +01:00
i f d e f B O A R D _ G K I _ S I G N I N G _ K E Y _ P A T H
i f n d e f B O A R D _ G K I _ S I G N I N G _ A L G O R I T H M
$( error BOARD_GKI_SIGNING_ALGORITHM should be defined with BOARD_GKI_SIGNING_KEY_PATH )
e n d i f
INTERNAL_MKBOOTIMG_GKI_SINGING_ARGS := \
--gki_signing_key $( BOARD_GKI_SIGNING_KEY_PATH) \
--gki_signing_algorithm $( BOARD_GKI_SIGNING_ALGORITHM) \
--gki_signing_avbtool_path $( AVBTOOL)
e n d i f
# Using double quote to pass BOARD_GKI_SIGNING_SIGNATURE_ARGS as a single string
# to MKBOOTIMG, although it may contain multiple args.
i f d e f B O A R D _ G K I _ S I G N I N G _ S I G N A T U R E _ A R G S
INTERNAL_MKBOOTIMG_GKI_SINGING_ARGS += \
--gki_signing_signature_args " $( BOARD_GKI_SIGNING_SIGNATURE_ARGS) "
e n d i f
2019-04-22 20:09:57 +02:00
# Define these only if we are building boot
i f d e f B U I L D I N G _ B O O T _ I M A G E
INSTALLED_BOOTIMAGE_TARGET := $( BUILT_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
i f e q ( $( TARGET_BOOTIMAGE_USE_EXT 2) , t r u e )
$( error TARGET_BOOTIMAGE_USE_EXT 2 is not supported anymore )
2020-09-30 06:18:20 +02:00
e n d i f # TARGET_BOOTIMAGE_USE_EXT2
$( foreach b ,$ ( INSTALLED_BOOTIMAGE_TARGET ) , $ ( eval $ ( call add -dependency ,$ ( b ) ,$ ( call bootimage -to -kernel ,$ ( b ) ) ) ) )
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
2020-09-30 06:18:20 +02:00
i f e q ( t r u e , $( BOARD_AVB_ENABLE ) )
2016-01-29 22:59:17 +01:00
2020-08-09 23:36:56 +02:00
# $1: boot image target
d e f i n e b u i l d _ b o o t _ b o a r d _ a v b _ e n a b l e d
2021-03-12 14:40:32 +01:00
$( MKBOOTIMG) --kernel $( call bootimage-to-kernel,$( 1) ) $( INTERNAL_BOOTIMAGE_ARGS) $( INTERNAL_MKBOOTIMG_VERSION_ARGS) \
$( INTERNAL_MKBOOTIMG_GKI_SINGING_ARGS) $( BOARD_MKBOOTIMG_ARGS) --output $( 1)
2020-10-15 23:48:07 +02:00
$( call assert-max-image-size,$( 1) ,$( call get-hash-image-max-size,$( call get-bootimage-partition-size,$( 1) ,boot) ) )
2020-08-09 23:36:56 +02:00
$( AVBTOOL) add_hash_footer \
--image $( 1) \
2020-10-15 23:48:07 +02:00
--partition_size $( call get-bootimage-partition-size,$( 1) ,boot) \
2020-08-09 23:36:56 +02:00
--partition_name boot $( INTERNAL_AVB_BOOT_SIGNING_ARGS) \
$( BOARD_AVB_BOOT_ADD_HASH_FOOTER_ARGS)
e n d e f
2021-03-12 14:40:32 +01:00
$(INSTALLED_BOOTIMAGE_TARGET) : $( MKBOOTIMG ) $( AVBTOOL ) $( INTERNAL_BOOTIMAGE_FILES ) $( BOARD_AVB_BOOT_KEY_PATH ) $( BOARD_GKI_SIGNING_KEY_PATH )
2016-01-29 22:59:17 +01:00
$( call pretty," Target boot image: $@ " )
2020-08-09 23:36:56 +02:00
$( call build_boot_board_avb_enabled,$@ )
2016-01-29 22:59:17 +01:00
.PHONY : bootimage -nodeps
2021-03-12 14:40:32 +01:00
bootimage-nodeps : $( MKBOOTIMG ) $( AVBTOOL ) $( BOARD_AVB_BOOT_KEY_PATH ) $( BOARD_GKI_SIGNING_KEY_PATH )
2016-01-29 22:59:17 +01:00
@echo " make $@ : ignoring dependencies "
2020-08-09 23:36:56 +02:00
$( foreach b,$( INSTALLED_BOOTIMAGE_TARGET) ,$( call build_boot_board_avb_enabled,$( b) ) )
2016-01-29 22:59:17 +01:00
2019-03-28 16:45:40 +01:00
e l s e i f e q ( t r u e , $( PRODUCT_SUPPORTS_BOOT_SIGNER ) ) # BOARD_AVB_ENABLE != true
2014-07-09 05:07:41 +02:00
2020-08-09 23:36:56 +02:00
# $1: boot image target
d e f i n e b u i l d _ b o o t _ s u p p o r t s _ b o o t _ s i g n e r
$( MKBOOTIMG) --kernel $( call bootimage-to-kernel,$( 1) ) $( INTERNAL_BOOTIMAGE_ARGS) $( INTERNAL_MKBOOTIMG_VERSION_ARGS) $( BOARD_MKBOOTIMG_ARGS) --output $( 1)
$( BOOT_SIGNER) /boot $@ $( PRODUCT_VERITY_SIGNING_KEY) .pk8 $( PRODUCT_VERITY_SIGNING_KEY) .x509.pem $( 1)
2020-10-15 23:48:07 +02:00
$( call assert-max-image-size,$( 1) ,$( call get-bootimage-partition-size,$( 1) ,boot) )
2020-08-09 23:36:56 +02:00
e n d e f
2020-09-30 06:18:20 +02:00
$(INSTALLED_BOOTIMAGE_TARGET) : $( MKBOOTIMG ) $( INTERNAL_BOOTIMAGE_FILES ) $( BOOT_SIGNER )
2014-07-09 05:07:41 +02:00
$( call pretty," Target boot image: $@ " )
2020-08-09 23:36:56 +02:00
$( call build_boot_supports_boot_signer,$@ )
2014-07-09 05:07:41 +02:00
.PHONY : bootimage -nodeps
bootimage-nodeps : $( MKBOOTIMG ) $( BOOT_SIGNER )
@echo " make $@ : ignoring dependencies "
2020-08-09 23:36:56 +02:00
$( foreach b,$( INSTALLED_BOOTIMAGE_TARGET) ,$( call build_boot_supports_boot_signer,$( b) ) )
2014-07-09 05:07:41 +02:00
2019-03-28 16:45:40 +01:00
e l s e i f e q ( t r u e , $( PRODUCT_SUPPORTS_VBOOT ) ) # PRODUCT_SUPPORTS_BOOT_SIGNER != true
2015-03-03 17:54:11 +01:00
2020-08-09 23:36:56 +02:00
# $1: boot image target
d e f i n e b u i l d _ b o o t _ s u p p o r t s _ v b o o t
$( MKBOOTIMG) --kernel $( call bootimage-to-kernel,$( 1) ) $( INTERNAL_BOOTIMAGE_ARGS) $( INTERNAL_MKBOOTIMG_VERSION_ARGS) $( BOARD_MKBOOTIMG_ARGS) --output $( 1) .unsigned
$( VBOOT_SIGNER) $( FUTILITY) $( 1) .unsigned $( PRODUCT_VBOOT_SIGNING_KEY) .vbpubk $( PRODUCT_VBOOT_SIGNING_KEY) .vbprivk $( PRODUCT_VBOOT_SIGNING_SUBKEY) .vbprivk $( 1) .keyblock $( 1)
2020-10-15 23:48:07 +02:00
$( call assert-max-image-size,$( 1) ,$( call get-bootimage-partition-size,$( 1) ,boot) )
2020-08-09 23:36:56 +02:00
e n d e f
2020-09-30 06:18:20 +02:00
$(INSTALLED_BOOTIMAGE_TARGET) : $( MKBOOTIMG ) $( INTERNAL_BOOTIMAGE_FILES ) $( VBOOT_SIGNER ) $( FUTILITY )
2015-03-03 17:54:11 +01:00
$( call pretty," Target boot image: $@ " )
2020-08-09 23:36:56 +02:00
$( call build_boot_supports_vboot,$@ )
2015-03-03 17:54:11 +01:00
.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 "
2020-08-09 23:36:56 +02:00
$( foreach b,$( INSTALLED_BOOTIMAGE_TARGET) ,$( call build_boot_supports_vboot,$( b) ) )
2015-03-03 17:54:11 +01:00
e l s e # PRODUCT_SUPPORTS_VBOOT != true
2009-03-04 04:28:42 +01:00
2020-08-09 23:36:56 +02:00
# $1: boot image target
d e f i n e b u i l d _ b o o t _ n o v b o o t
$( MKBOOTIMG) --kernel $( call bootimage-to-kernel,$( 1) ) $( INTERNAL_BOOTIMAGE_ARGS) $( INTERNAL_MKBOOTIMG_VERSION_ARGS) $( BOARD_MKBOOTIMG_ARGS) --output $( 1)
2020-10-15 23:48:07 +02:00
$( call assert-max-image-size,$1 ,$( call get-bootimage-partition-size,$( 1) ,boot) )
2020-08-09 23:36:56 +02:00
e n d e f
2020-09-30 06:18:20 +02:00
$(INSTALLED_BOOTIMAGE_TARGET) : $( MKBOOTIMG ) $( INTERNAL_BOOTIMAGE_FILES )
2009-03-04 04:28:42 +01:00
$( call pretty," Target boot image: $@ " )
2020-08-09 23:36:56 +02:00
$( call build_boot_novboot,$@ )
2013-08-09 01:34:29 +02:00
.PHONY : bootimage -nodeps
bootimage-nodeps : $( MKBOOTIMG )
@echo " make $@ : ignoring dependencies "
2020-08-09 23:36:56 +02:00
$( foreach b,$( INSTALLED_BOOTIMAGE_TARGET) ,$( call build_boot_novboot,$( b) ) )
2013-08-09 01:34:29 +02:00
2020-09-30 06:18:20 +02:00
e n d i f # BOARD_AVB_ENABLE
2019-04-22 20:09:57 +02:00
e n d i f # BUILDING_BOOT_IMAGE
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
2020-10-22 23:37:01 +02:00
INTERNAL_PREBUILT_BOOTIMAGE := $( BOARD_PREBUILT_BOOTIMAGE)
2019-06-20 07:27:45 +02:00
INSTALLED_BOOTIMAGE_TARGET := $( PRODUCT_OUT) /boot.img
2021-05-19 18:14:42 +02:00
i f e q ( $( BOARD_AVB_ENABLE ) , t r u e )
$(INSTALLED_BOOTIMAGE_TARGET) : $( INTERNAL_PREBUILT_BOOTIMAGE ) $( AVBTOOL ) $( BOARD_AVB_BOOT_KEY_PATH )
cp $( INTERNAL_PREBUILT_BOOTIMAGE) $@
$( AVBTOOL) add_hash_footer \
--image $@ \
--partition_size $( BOARD_BOOTIMAGE_PARTITION_SIZE) \
--partition_name boot $( INTERNAL_AVB_BOOT_SIGNING_ARGS) \
$( BOARD_AVB_BOOT_ADD_HASH_FOOTER_ARGS)
e l s e
$(INSTALLED_BOOTIMAGE_TARGET) : $( INTERNAL_PREBUILT_BOOTIMAGE )
cp $( INTERNAL_PREBUILT_BOOTIMAGE) $@
e n d i f # BOARD_AVB_ENABLE
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
2020-10-22 23:37:01 +02:00
e n d i f # my_installed_prebuilt_gki_apex not defined
my_apex_extracted_boot_image :=
my_installed_prebuilt_gki_apex :=
2009-03-04 04:28:42 +01:00
2019-07-10 19:49:37 +02:00
# -----------------------------------------------------------------
# vendor boot image
i f e q ( $( BUILDING_VENDOR_BOOT_IMAGE ) , t r u e )
i f e q ( $( PRODUCT_SUPPORTS_VERITY ) , t r u e )
$( error vboot 1.0 does not support vendor_boot partition)
e n d i f
INTERNAL_VENDOR_RAMDISK_FILES := $( filter $( TARGET_VENDOR_RAMDISK_OUT) /%, \
$( ALL_GENERATED_SOURCES) \
$( ALL_DEFAULT_INSTALLED_MODULES) )
2021-03-06 09:45:53 +01:00
INTERNAL_VENDOR_RAMDISK_TARGET := $( call intermediates-dir-for,PACKAGING,vendor_boot) /vendor_ramdisk.cpio$( RAMDISK_EXT)
2020-10-09 23:29:39 +02:00
2021-04-04 10:12:25 +02:00
# Exclude recovery files in the default vendor ramdisk if including a standalone
# recovery ramdisk in vendor_boot.
2020-10-09 23:29:39 +02:00
i f e q ( t r u e , $( BOARD_MOVE_RECOVERY_RESOURCES_TO_VENDOR_BOOT ) )
2021-04-04 10:12:25 +02:00
i f n e q ( t r u e , $( BOARD_INCLUDE_RECOVERY_RAMDISK_IN_VENDOR_BOOT ) )
2020-10-09 23:29:39 +02:00
$(INTERNAL_VENDOR_RAMDISK_TARGET) : $( INTERNAL_RECOVERY_RAMDISK_FILES_TIMESTAMP )
$(INTERNAL_VENDOR_RAMDISK_TARGET) : PRIVATE_ADDITIONAL_DIR := $( TARGET_RECOVERY_ROOT_OUT )
e n d i f
2021-04-04 10:12:25 +02:00
e n d i f
2020-10-09 23:29:39 +02:00
2020-05-11 22:20:03 +02:00
$(INTERNAL_VENDOR_RAMDISK_TARGET) : $( MKBOOTFS ) $( INTERNAL_VENDOR_RAMDISK_FILES ) | $( COMPRESSION_COMMAND_DEPS )
2020-10-09 23:29:39 +02:00
$( MKBOOTFS) -d $( TARGET_OUT) $( TARGET_VENDOR_RAMDISK_OUT) $( PRIVATE_ADDITIONAL_DIR) | $( COMPRESSION_COMMAND) > $@
2019-07-10 19:49:37 +02:00
2021-03-04 20:04:03 +01:00
i f e q ( t r u e , $( BOARD_BUILD_VENDOR_RAMDISK_IMAGE ) )
INSTALLED_VENDOR_RAMDISK_TARGET := $( PRODUCT_OUT) /vendor_ramdisk.img
$(INSTALLED_VENDOR_RAMDISK_TARGET) : $( INTERNAL_VENDOR_RAMDISK_TARGET )
2021-03-06 22:26:01 +01:00
$( call pretty," Target vendor ramdisk: $@ " )
2021-03-04 20:04:03 +01:00
$( copy-file-to-target)
e n d i f
2020-11-20 20:59:41 +01:00
INSTALLED_FILES_FILE_VENDOR_RAMDISK := $( PRODUCT_OUT) /installed-files-vendor-ramdisk.txt
INSTALLED_FILES_JSON_VENDOR_RAMDISK := $( INSTALLED_FILES_FILE_VENDOR_RAMDISK:.txt= .json)
$(INSTALLED_FILES_FILE_VENDOR_RAMDISK) : .KATI_IMPLICIT_OUTPUTS := $( INSTALLED_FILES_JSON_VENDOR_RAMDISK )
$(INSTALLED_FILES_FILE_VENDOR_RAMDISK) : $( INTERNAL_VENDOR_RAMDISK_TARGET )
$(INSTALLED_FILES_FILE_VENDOR_RAMDISK) : $( INTERNAL_VENDOR_RAMDISK_FILES ) $( FILESLIST ) $( FILESLIST_UTIL )
2021-03-06 22:29:28 +01:00
@echo Installed file list: $@
2020-11-20 20:59:41 +01:00
mkdir -p $( dir $@ )
rm -f $@
2021-03-06 22:29:28 +01:00
$( FILESLIST) $( TARGET_VENDOR_RAMDISK_OUT) > $( @:.txt= .json)
$( FILESLIST_UTIL) -c $( @:.txt= .json) > $@
2020-11-20 20:59:41 +01:00
2019-07-10 19:49:37 +02: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_VENDOR_BOOTIMAGE_ARGS += --dtb $( INSTALLED_DTBIMAGE_TARGET)
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_VENDOR_BOOTIMAGE_ARGS += --base $( BOARD_KERNEL_BASE)
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
INTERNAL_VENDOR_BOOTIMAGE_ARGS += --pagesize $( BOARD_KERNEL_PAGESIZE)
e n d i f
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_VENDOR_BOOTIMAGE_ARGS += --vendor_cmdline " $( INTERNAL_KERNEL_CMDLINE) "
e n d i f
2021-01-13 19:45:04 +01:00
i f d e f I N T E R N A L _ B O O T C O N F I G
2021-04-03 21:26:18 +02:00
INTERNAL_VENDOR_BOOTCONFIG_TARGET := $( PRODUCT_OUT) /vendor-bootconfig.img
$( INTERNAL_VENDOR_BOOTCONFIG_TARGET) :
2021-01-13 19:45:04 +01:00
rm -f $@
$( foreach param,$( INTERNAL_BOOTCONFIG) , \
printf "%s\n" $( param) >> $@ ; )
INTERNAL_VENDOR_BOOTIMAGE_ARGS += --vendor_bootconfig $( INTERNAL_VENDOR_BOOTCONFIG_TARGET)
e n d i f
2020-12-10 11:42:47 +01:00
# $(1): Build target name
# $(2): Staging dir to be compressed
# $(3): Build dependencies
d e f i n e b u i l d - v e n d o r - r a m d i s k - f r a g m e n t - t a r g e t
$(1) : $( 3) $( MKBOOTFS ) | $( COMPRESSION_COMMAND_DEPS )
$( MKBOOTFS) -d $( TARGET_OUT) $( 2) | $( COMPRESSION_COMMAND) > $$ @
e n d e f
# $(1): Ramdisk name
d e f i n e b u i l d - v e n d o r - r a m d i s k - f r a g m e n t
$( strip \
$( eval build_target := $( call intermediates-dir-for,PACKAGING,vendor_ramdisk_fragments) /$( 1) .cpio$( RAMDISK_EXT) ) \
$( eval $( call build-vendor-ramdisk-fragment-target,$( build_target) ,$( VENDOR_RAMDISK_FRAGMENT.$( 1) .STAGING_DIR) ,$( VENDOR_RAMDISK_FRAGMENT.$( 1) .FILES) ) ) \
$( build_target) \
)
e n d e f
# $(1): Ramdisk name
# $(2): Prebuilt file path
d e f i n e b u i l d - p r e b u i l t - v e n d o r - r a m d i s k - f r a g m e n t
$( strip \
$( eval build_target := $( call intermediates-dir-for,PACKAGING,prebuilt_vendor_ramdisk_fragments) /$( 1) ) \
$( eval $( call copy-one-file,$( 2) ,$( build_target) ) ) \
$( build_target) \
)
e n d e f
INTERNAL_VENDOR_RAMDISK_FRAGMENT_TARGETS :=
INTERNAL_VENDOR_RAMDISK_FRAGMENT_ARGS :=
2021-04-04 10:03:10 +02:00
$( foreach vendor_ramdisk_fragment ,$ ( INTERNAL_VENDOR_RAMDISK_FRAGMENTS ) , \
2020-12-10 11:42:47 +01:00
$( eval prebuilt_vendor_ramdisk_fragment_file := $( BOARD_VENDOR_RAMDISK_FRAGMENT.$( vendor_ramdisk_fragment) .PREBUILT) ) \
$( if $( prebuilt_vendor_ramdisk_fragment_file) , \
$( eval vendor_ramdisk_fragment_target := $( call build-prebuilt-vendor-ramdisk-fragment,$( vendor_ramdisk_fragment) ,$( prebuilt_vendor_ramdisk_fragment_file) ) ) \
$( eval ### else ###), \
2021-04-04 10:03:10 +02:00
$( eval vendor_ramdisk_fragment_target := $( call build-vendor-ramdisk-fragment,$( vendor_ramdisk_fragment) ) ) ) \
2020-12-10 11:42:47 +01:00
$( eval INTERNAL_VENDOR_RAMDISK_FRAGMENT_TARGETS += $( vendor_ramdisk_fragment_target) ) \
$( eval INTERNAL_VENDOR_RAMDISK_FRAGMENT_ARGS += $( BOARD_VENDOR_RAMDISK_FRAGMENT.$( vendor_ramdisk_fragment) .MKBOOTIMG_ARGS) --vendor_ramdisk_fragment $( vendor_ramdisk_fragment_target) ) \
)
2019-07-10 19:49:37 +02:00
INSTALLED_VENDOR_BOOTIMAGE_TARGET := $( PRODUCT_OUT) /vendor_boot.img
$(INSTALLED_VENDOR_BOOTIMAGE_TARGET) : $( MKBOOTIMG ) $( INTERNAL_VENDOR_RAMDISK_TARGET ) $( INSTALLED_DTBIMAGE_TARGET )
2021-01-13 19:45:04 +01:00
$(INSTALLED_VENDOR_BOOTIMAGE_TARGET) : $( INTERNAL_VENDOR_RAMDISK_FRAGMENT_TARGETS ) $( INTERNAL_VENDOR_BOOTCONFIG_TARGET )
2019-07-10 19:49:37 +02:00
i f e q ( $( BOARD_AVB_ENABLE ) , t r u e )
$(INSTALLED_VENDOR_BOOTIMAGE_TARGET) : $( AVBTOOL ) $( BOARD_AVB_VENDOR_BOOTIMAGE_KEY_PATH )
$( call pretty," Target vendor_boot image: $@ " )
2020-12-10 11:42:47 +01:00
$( MKBOOTIMG) $( INTERNAL_VENDOR_BOOTIMAGE_ARGS) $( BOARD_MKBOOTIMG_ARGS) --vendor_ramdisk $( INTERNAL_VENDOR_RAMDISK_TARGET) $( INTERNAL_VENDOR_RAMDISK_FRAGMENT_ARGS) --vendor_boot $@
2019-07-10 19:49:37 +02:00
$( call assert-max-image-size,$@ ,$( BOARD_VENDOR_BOOTIMAGE_PARTITION_SIZE) )
$( AVBTOOL) add_hash_footer \
--image $@ \
--partition_size $( BOARD_VENDOR_BOOTIMAGE_PARTITION_SIZE) \
--partition_name vendor_boot $( INTERNAL_AVB_VENDOR_BOOT_SIGNING_ARGS) \
$( BOARD_AVB_VENDOR_BOOT_ADD_HASH_FOOTER_ARGS)
e l s e
$(INSTALLED_VENDOR_BOOTIMAGE_TARGET) :
$( call pretty," Target vendor_boot image: $@ " )
2020-12-10 11:42:47 +01:00
$( MKBOOTIMG) $( INTERNAL_VENDOR_BOOTIMAGE_ARGS) $( BOARD_MKBOOTIMG_ARGS) --vendor_ramdisk $( INTERNAL_VENDOR_RAMDISK_TARGET) $( INTERNAL_VENDOR_RAMDISK_FRAGMENT_ARGS) --vendor_boot $@
2019-07-10 19:49:37 +02:00
$( call assert-max-image-size,$@ ,$( BOARD_VENDOR_BOOTIMAGE_PARTITION_SIZE) )
e n d i f
e n d i f # BUILDING_VENDOR_BOOT_IMAGE
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
2020-07-16 01:57:47 +02:00
# $(1) - xml_excluded_system_product_odm_vendor_dlkm_odm_dlkm|
# xml_excluded_vendor_product_odm_vendor_dlkm_odm_dlkm|
# xml_product|xml_odm|xml_system_ext|xml_system|xml_vendor_dlkm|
# xml_odm_dlkm|html
2017-04-19 08:26:47 +02:00
# $(2) - Plain text output file
# $(3) - HTML/XML output file
# $(4) - File title
2019-06-17 06:48:42 +02:00
# $(5) - Directory to use. Notice files are all $(5)/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
2020-01-28 22:23:39 +01:00
# $(7) - Directories to exclude
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
2020-04-29 00:57:32 +02:00
$(2) : PRIVATE_MESSAGE := $( 4)
$(2) : PRIVATE_DIR := $( 5)
$(2) : .KATI_IMPLICIT_OUTPUTS := $( 3)
$(2) : $( 6) $( BUILD_SYSTEM ) /Makefile build /make /tools /generate -notice -files .py
2020-01-28 22:23:39 +01:00
build/make/tools/generate-notice-files.py --text-output $( 2) $( foreach xdir, $( 7) , -e $( xdir) ) \
2020-07-16 01:57:47 +02:00
$( if $( filter $( 1) ,xml_excluded_vendor_product_odm_vendor_dlkm_odm_dlkm) ,-e vendor -e product -e system_ext -e odm -e vendor_dlkm -e odm_dlkm --xml-output, \
$( if $( filter $( 1) ,xml_excluded_system_product_odm_vendor_dlkm_odm_dlkm) ,-e system -e product -e system_ext -e odm -e vendor_dlkm -e odm_dlkm --xml-output, \
2018-11-26 19:12:05 +01:00
$( if $( filter $( 1) ,xml_product) ,-i product --xml-output, \
2019-06-25 08:58:13 +02:00
$( if $( filter $( 1) ,xml_system_ext) ,-i system_ext --xml-output, \
2019-06-13 18:43:26 +02:00
$( if $( filter $( 1) ,xml_system) ,-i system --xml-output, \
$( if $( filter $( 1) ,xml_odm) ,-i odm --xml-output, \
2020-05-12 03:35:11 +02:00
$( if $( filter $( 1) ,xml_vendor_dlkm) ,-i vendor_dlkm --xml-output, \
2020-07-16 01:57:47 +02:00
$( if $( filter $( 1) ,xml_odm_dlkm) ,-i odm_dlkm --xml-output, \
--html-output) ) ) ) ) ) ) ) $( 3) \
2020-07-18 05:47:42 +02:00
-t $$ ( PRIVATE_MESSAGE) $$ ( foreach dir,$$ ( sort $$ ( PRIVATE_DIR) ) , -s $$ ( 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
2009-03-04 04:28:42 +01:00
2020-01-28 22:23:39 +01:00
# Some targets get included under $(PRODUCT_OUT) for debug symbols or other
# reasons--not to be flashed onto any device. Targets under these directories
# need no associated notice file on the device UI.
exclude_target_dirs := apex
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) , \
2020-05-29 00:46:33 +02:00
$( ALL_DEFAULT_INSTALLED_MODULES) $( kernel_notice_file) , \
2020-01-28 22:23:39 +01:00
$( exclude_target_dirs) ) )
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
2019-06-25 08:58:13 +02:00
target_system_ext_notice_file_txt := $( TARGET_OUT_INTERMEDIATES) /NOTICE_SYSTEM_EXT.txt
target_system_ext_notice_file_xml := $( TARGET_OUT_INTERMEDIATES) /NOTICE_SYSTEM_EXT.xml
target_system_ext_notice_file_xml_gz := $( TARGET_OUT_INTERMEDIATES) /NOTICE_SYSTEM_EXT.xml.gz
installed_system_ext_notice_xml_gz := $( TARGET_OUT_SYSTEM_EXT) /etc/NOTICE.xml.gz
2017-04-19 08:26:47 +02:00
2019-07-16 23:38:43 +02:00
target_odm_notice_file_txt := $( TARGET_OUT_INTERMEDIATES) /NOTICE_ODM.txt
target_odm_notice_file_xml := $( TARGET_OUT_INTERMEDIATES) /NOTICE_ODM.xml
target_odm_notice_file_xml_gz := $( TARGET_OUT_INTERMEDIATES) /NOTICE_ODM.xml.gz
installed_odm_notice_xml_gz := $( TARGET_OUT_ODM) /etc/NOTICE.xml.gz
2020-05-12 03:35:11 +02:00
target_vendor_dlkm_notice_file_txt := $( TARGET_OUT_INTERMEDIATES) /NOTICE_VENDOR_DLKM.txt
target_vendor_dlkm_notice_file_xml := $( TARGET_OUT_INTERMEDIATES) /NOTICE_VENDOR_DLKM.xml
target_vendor_dlkm_notice_file_xml_gz := $( TARGET_OUT_INTERMEDIATES) /NOTICE_VENDOR_DLKM.xml.gz
installed_vendor_dlkm_notice_xml_gz := $( TARGET_OUT_VENDOR_DLKM) /etc/NOTICE.xml.gz
2020-07-16 01:57:47 +02:00
target_odm_dlkm_notice_file_txt := $( TARGET_OUT_INTERMEDIATES) /NOTICE_ODM_DLKM.txt
target_odm_dlkm_notice_file_xml := $( TARGET_OUT_INTERMEDIATES) /NOTICE_ODM_DLKM.xml
target_odm_dlkm_notice_file_xml_gz := $( TARGET_OUT_INTERMEDIATES) /NOTICE_ODM_DLKM.xml.gz
installed_odm_dlkm_notice_xml_gz := $( TARGET_OUT_ODM_DLKM) /etc/NOTICE.xml.gz
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.
2020-05-29 00:46:33 +02:00
license_modules := $( ALL_DEFAULT_INSTALLED_MODULES) $( kernel_notice_file)
2020-01-28 22:23:39 +01:00
# Only files copied to a system image need system image notices.
license_modules := $( filter $( PRODUCT_OUT) /%,$( license_modules) )
2018-11-13 00:33:47 +01:00
# Phonys/fakes don't have notice files (though their deps might)
license_modules := $( filter-out $( TARGET_OUT_FAKE) /%,$( license_modules) )
2019-05-29 11:28:22 +02:00
# testcases are not relevant to the system image.
license_modules := $( filter-out $( TARGET_OUT_TESTCASES) /%,$( license_modules) )
2020-07-16 01:57:47 +02:00
# filesystem images: system, vendor, product, system_ext, odm, vendor_dlkm, and odm_dlkm
2019-06-13 18:43:26 +02:00
license_modules_system := $( filter $( TARGET_OUT) /%,$( license_modules) )
2020-06-17 10:10:19 +02:00
# system_other is relevant to system partition.
license_modules_system += $( filter $( TARGET_OUT_SYSTEM_OTHER) /%,$( license_modules) )
2018-11-13 00:33:47 +01:00
license_modules_vendor := $( filter $( TARGET_OUT_VENDOR) /%,$( license_modules) )
license_modules_product := $( filter $( TARGET_OUT_PRODUCT) /%,$( license_modules) )
2019-06-25 08:58:13 +02:00
license_modules_system_ext := $( filter $( TARGET_OUT_SYSTEM_EXT) /%,$( license_modules) )
2019-07-16 23:38:43 +02:00
license_modules_odm := $( filter $( TARGET_OUT_ODM) /%,$( license_modules) )
2020-05-12 03:35:11 +02:00
license_modules_vendor_dlkm := $( filter $( TARGET_OUT_VENDOR_DLKM) /%,$( license_modules) )
2020-07-16 01:57:47 +02:00
license_modules_odm_dlkm := $( filter $( TARGET_OUT_ODM_DLKM) /%,$( license_modules) )
2019-06-13 18:43:26 +02:00
license_modules_agg := $( license_modules_system) \
$( license_modules_vendor) \
2019-07-16 23:38:43 +02:00
$( license_modules_product) \
$( license_modules_system_ext) \
2020-05-12 03:35:11 +02:00
$( license_modules_odm) \
2020-07-16 01:57:47 +02:00
$( license_modules_vendor_dlkm) \
$( license_modules_odm_dlkm)
2020-01-28 22:23:39 +01:00
# targets used for debug symbols only and do not get copied to the device
license_modules_symbols_only := $( filter $( PRODUCT_OUT) /apex/%,$( license_modules) )
2019-07-31 00:46:35 +02:00
license_modules_rest := $( filter-out $( license_modules_agg) ,$( license_modules) )
2020-01-28 22:23:39 +01:00
license_modules_rest := $( filter-out $( license_modules_symbols_only) ,$( license_modules_rest) )
# Identify the other targets we expect to have notices for:
# targets copied to the device but are not readable by the UI (e.g. must boot
# into a different partition to read or don't have an associated /etc
# directory) must have their notices built somewhere readable.
license_modules_rehomed := $( filter-out $( PRODUCT_OUT) /%/%,$( license_modules_rest) ) # files in root have no /etc
license_modules_rehomed += $( filter $( PRODUCT_OUT) /recovery/%,$( license_modules_rest) )
license_modules_rehomed += $( filter $( PRODUCT_OUT) /root/%,$( license_modules_rest) )
license_modules_rehomed += $( filter $( PRODUCT_OUT) /data/%,$( license_modules_rest) )
license_modules_rehomed += $( filter $( PRODUCT_OUT) /ramdisk/%,$( license_modules_rest) )
license_modules_rehomed += $( filter $( PRODUCT_OUT) /debug_ramdisk/%,$( license_modules_rest) )
2021-03-03 08:54:08 +01:00
license_modules_rehomed += $( filter $( PRODUCT_OUT) /vendor_ramdisk/%,$( license_modules_rest) )
2020-01-28 22:23:39 +01:00
license_modules_rehomed += $( filter $( PRODUCT_OUT) /persist/%,$( license_modules_rest) )
license_modules_rehomed += $( filter $( PRODUCT_OUT) /persist.img,$( license_modules_rest) )
license_modules_rehomed += $( filter $( PRODUCT_OUT) /system_other/%,$( license_modules_rest) )
license_modules_rehomed += $( filter $( PRODUCT_OUT) /kernel%,$( license_modules_rest) )
license_modules_rehomed += $( filter $( PRODUCT_OUT) /%.img,$( license_modules_rest) )
license_modules_rehomed += $( filter $( PRODUCT_OUT) /%.bin,$( license_modules_rest) )
# after removing targets in system images, targets reported in system images, and
# targets used for debug symbols that do not need notices, nothing must remain.
license_modules_rest := $( filter-out $( license_modules_rehomed) ,$( license_modules_rest) )
$( call maybe -print -list -and -error , $ ( license_modules_rest ) , \
" Targets added under $( PRODUCT_OUT) / unaccounted for notice handling. " )
2019-06-13 18:43:26 +02:00
# If we are building in a configuration that includes a prebuilt vendor.img, we can't
# update its notice file, so include those notices in the system partition instead
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
2020-01-28 22:23:39 +01:00
license_modules_system += $( license_modules_rehomed)
2020-07-16 01:57:47 +02:00
system_xml_directories := xml_excluded_vendor_product_odm_vendor_dlkm_odm_dlkm
system_notice_file_message := "Notices for files contained in all filesystem images except vendor/system_ext/product/odm/vendor_dlkm/odm_dlkm in this directory:"
2019-07-31 00:46:35 +02:00
e l s e
2020-01-28 22:23:39 +01:00
license_modules_vendor += $( license_modules_rehomed)
2019-07-31 00:46:35 +02:00
system_xml_directories := xml_system
system_notice_file_message := "Notices for files contained in the system filesystem image in this directory:"
2019-06-13 18:43:26 +02:00
e n d i f
2009-03-04 04:28:42 +01:00
2019-06-13 18:43:26 +02:00
$( eval $ ( call combine -notice -files , $ ( system_xml_directories ) , \
2018-11-26 19:12:05 +01:00
$( target_notice_file_txt) , \
$( target_notice_file_xml) , \
2019-06-13 18:43:26 +02:00
$( system_notice_file_message) , \
2018-11-26 19:12:05 +01:00
$( TARGET_OUT_NOTICE_FILES) , \
2020-01-28 22:23:39 +01:00
$( license_modules_system) , \
$( exclude_target_dirs) ) )
2020-07-16 01:57:47 +02:00
$( eval $ ( call combine -notice -files , xml_excluded_system_product_odm_vendor_dlkm_odm_dlkm , \
2018-11-26 19:12:05 +01:00
$( target_vendor_notice_file_txt) , \
$( target_vendor_notice_file_xml) , \
2020-07-16 01:57:47 +02:00
"Notices for files contained in all filesystem images except system/system_ext/product/odm/vendor_dlkm/odm_dlkm in this directory:" , \
2018-11-26 19:12:05 +01:00
$( TARGET_OUT_NOTICE_FILES) , \
2020-01-28 22:23:39 +01:00
$( license_modules_vendor) , \
$( exclude_target_dirs) ) )
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) , \
2020-01-28 22:23:39 +01:00
$( license_modules_product) , \
$( exclude_target_dirs) ) )
2019-06-25 08:58:13 +02:00
$( eval $ ( call combine -notice -files , xml_system_ext , \
$( target_system_ext_notice_file_txt) , \
$( target_system_ext_notice_file_xml) , \
"Notices for files contained in the system_ext filesystem image in this directory:" , \
2018-11-26 19:12:05 +01:00
$( TARGET_OUT_NOTICE_FILES) , \
2020-01-28 22:23:39 +01:00
$( license_modules_system_ext) , \
$( exclude_target_dirs) ) )
2019-07-16 23:38:43 +02:00
$( eval $ ( call combine -notice -files , xml_odm , \
$( target_odm_notice_file_txt) , \
$( target_odm_notice_file_xml) , \
"Notices for files contained in the odm filesystem image in this directory:" , \
$( TARGET_OUT_NOTICE_FILES) , \
2020-01-28 22:23:39 +01:00
$( license_modules_odm) , \
$( exclude_target_dirs) ) )
2020-05-12 03:35:11 +02:00
$( eval $ ( call combine -notice -files , xml_vendor_dlkm , \
$( target_vendor_dlkm_notice_file_txt) , \
$( target_vendor_dlkm_notice_file_xml) , \
"Notices for files contained in the vendor_dlkm filesystem image in this directory:" , \
$( TARGET_OUT_NOTICE_FILES) , \
$( license_modules_vendor_dlkm) , \
$( exclude_target_dirs) ) )
2020-07-16 01:57:47 +02:00
$( eval $ ( call combine -notice -files , xml_odm_dlkm , \
$( target_odm_dlkm_notice_file_txt) , \
$( target_odm_dlkm_notice_file_xml) , \
"Notices for files contained in the odm_dlkm filesystem image in this directory:" , \
$( TARGET_OUT_NOTICE_FILES) , \
$( license_modules_odm_dlkm) , \
$( exclude_target_dirs) ) )
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 < $< > $@
2019-06-25 08:58:13 +02:00
$(target_system_ext_notice_file_xml_gz) : $( target_system_ext_notice_file_xml ) | $( MINIGZIP )
2018-08-28 19:04:03 +02:00
$( hide) $( MINIGZIP) -9 < $< > $@
2019-07-16 23:38:43 +02:00
$(target_odm_notice_file_xml_gz) : $( target_odm_notice_file_xml ) | $( MINIGZIP )
$( hide) $( MINIGZIP) -9 < $< > $@
2020-05-12 03:35:11 +02:00
$(target_vendor_dlkm_notice_file_xml_gz) : $( target_vendor_dlkm_notice_file_xml ) | $( MINIGZIP )
$( hide) $( MINIGZIP) -9 < $< > $@
2020-07-16 01:57:47 +02:00
$(target_odm_dlkm_notice_file_xml_gz) : $( target_odm_dlkm_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-06-25 08:58:13 +02:00
$(installed_system_ext_notice_xml_gz) : $( target_system_ext_notice_file_xml_gz )
2018-08-28 19:04:03 +02:00
$( copy-file-to-target)
2019-07-16 23:38:43 +02:00
$(installed_odm_notice_xml_gz) : $( target_odm_notice_file_xml_gz )
$( copy-file-to-target)
2020-05-12 03:35:11 +02:00
$(installed_vendor_dlkm_notice_xml_gz) : $( target_vendor_dlkm_notice_file_xml_gz )
$( copy-file-to-target)
2020-07-16 01:57:47 +02:00
$(installed_odm_dlkm_notice_xml_gz) : $( target_odm_dlkm_notice_file_xml_gz )
$( copy-file-to-target)
2018-08-28 19:04:03 +02:00
2019-07-30 08:45:19 +02:00
ALL_DEFAULT_INSTALLED_MODULES += $( installed_notice_html_or_xml_gz)
ALL_DEFAULT_INSTALLED_MODULES += $( installed_vendor_notice_xml_gz)
ALL_DEFAULT_INSTALLED_MODULES += $( installed_product_notice_xml_gz)
ALL_DEFAULT_INSTALLED_MODULES += $( installed_system_ext_notice_xml_gz)
ALL_DEFAULT_INSTALLED_MODULES += $( installed_odm_notice_xml_gz)
2020-05-12 03:35:11 +02:00
ALL_DEFAULT_INSTALLED_MODULES += $( installed_vendor_dlkm_notice_xml_gz)
2020-07-16 01:57:47 +02:00
ALL_DEFAULT_INSTALLED_MODULES += $( installed_odm_dlkm_notice_xml_gz)
2018-11-13 00:29:13 +01:00
e n d i f # PRODUCT_NOTICE_SPLIT
2019-07-30 08:45:19 +02:00
ALL_DEFAULT_INSTALLED_MODULES += $( installed_notice_html_or_xml_gz)
2018-11-13 00:29:13 +01:00
$( 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) \
2020-01-28 22:23:39 +01:00
$( winpthreads_notice_file) , \
$( exclude_target_dirs) ) )
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.
2019-05-29 00:36:47 +02:00
$( eval $ ( call copy -one -file ,$ ( BUILD_SYSTEM ) /LINUX_KERNEL_COPYING ,$ ( kernel_notice_file ) ) )
2009-03-04 04:28:42 +01:00
2019-05-29 00:36:47 +02:00
$( eval $ ( call copy -one -file ,$ ( BUILD_SYSTEM ) /WINPTHREADS_COPYING ,$ ( winpthreads_notice_file ) ) )
2009-03-04 04:28:42 +01:00
2009-06-15 23:30:14 +02:00
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
2020-06-17 07:59:16 +02:00
i f n e q ( t r u e , $( TARGET_USERIMAGES_SPARSE_EROFS_DISABLED ) )
INTERNAL_USERIMAGES_SPARSE_EROFS_FLAG := -s
e n d i f
2019-06-24 19:39:54 +02:00
i f n e q ( t r u e , $( TARGET_USERIMAGES_SPARSE_SQUASHFS_DISABLED ) )
INTERNAL_USERIMAGES_SPARSE_SQUASHFS_FLAG := -s
2014-06-16 23:17:40 +02:00
e n d i f
2019-10-16 19:53:41 +02:00
i f n e q ( t r u e , $( TARGET_USERIMAGES_SPARSE_F 2FS_DISABLED ) )
INTERNAL_USERIMAGES_SPARSE_F2FS_FLAG := -S
e n d i f
2014-06-16 23:17:40 +02:00
2019-06-24 19:39:54 +02:00
INTERNAL_USERIMAGES_DEPS := \
2019-05-07 22:12:21 +02:00
$( BUILD_IMAGE) \
2019-06-24 19:39:54 +02:00
$( MKE2FS_CONF) \
2019-05-07 22:12:21 +02:00
$( MKEXTUSERIMG)
2017-06-21 22:51:46 +02:00
2019-06-24 19:39:54 +02:00
i f e q ( $( TARGET_USERIMAGES_USE_F 2FS ) , t r u e )
INTERNAL_USERIMAGES_DEPS += $( MKF2FSUSERIMG)
2015-12-16 03:00:14 +01:00
e n d i f
2019-06-24 19:39:54 +02:00
2020-06-17 07:59:16 +02:00
i f n e q ( $( filter \
$( BOARD_PRODUCTIMAGE_FILE_SYSTEM_TYPE) \
$( BOARD_SYSTEM_EXTIMAGE_FILE_SYSTEM_TYPE) \
$( BOARD_ODMIMAGE_FILE_SYSTEM_TYPE) \
$( BOARD_VENDORIMAGE_FILE_SYSTEM_TYPE) \
$( BOARD_SYSTEMIMAGE_FILE_SYSTEM_TYPE) \
$( BOARD_VENDOR_DLKMIMAGE_FILE_SYSTEM_TYPE) \
$( BOARD_ODM_DLKMIMAGE_FILE_SYSTEM_TYPE) \
,erofs) ,)
INTERNAL_USERIMAGES_DEPS += $( MKEROFSUSERIMG)
e n d i f
2020-05-07 23:58:20 +02:00
i f n e q ( $( filter \
$( BOARD_PRODUCTIMAGE_FILE_SYSTEM_TYPE) \
$( BOARD_SYSTEM_EXTIMAGE_FILE_SYSTEM_TYPE) \
$( BOARD_ODMIMAGE_FILE_SYSTEM_TYPE) \
$( BOARD_VENDORIMAGE_FILE_SYSTEM_TYPE) \
$( BOARD_SYSTEMIMAGE_FILE_SYSTEM_TYPE) \
$( BOARD_VENDOR_DLKMIMAGE_FILE_SYSTEM_TYPE) \
2020-07-16 01:52:59 +02:00
$( BOARD_ODM_DLKMIMAGE_FILE_SYSTEM_TYPE) \
2020-05-07 23:58:20 +02:00
,squashfs) ,)
2019-06-24 19:39:54 +02:00
INTERNAL_USERIMAGES_DEPS += $( MKSQUASHFSUSERIMG)
2015-03-03 21:30:37 +01:00
e n d i f
2019-03-28 16:45:40 +01:00
i f e q ( t r u e , $( PRODUCT_SUPPORTS_VERITY ) )
2018-03-16 07:21:28 +01:00
INTERNAL_USERIMAGES_DEPS += $( BUILD_VERITY_METADATA) $( BUILD_VERITY_TREE) $( APPEND2SIMG) $( VERITY_SIGNER)
2019-03-28 16:45:40 +01:00
i f e q ( t r u e , $( PRODUCT_SUPPORTS_VERITY_FEC ) )
2015-05-20 08:30:57 +02:00
INTERNAL_USERIMAGES_DEPS += $( FEC)
e n d i f
2013-06-17 02:26:08 +02:00
e n d i f
2019-06-24 19:39:54 +02:00
i f e q ( $( BOARD_AVB_ENABLE ) , t r u e )
INTERNAL_USERIMAGES_DEPS += $( AVBTOOL)
e n d i f
2012-11-21 19:47:00 +01:00
2019-06-24 19:39:54 +02:00
# Get a colon-separated list of search paths.
INTERNAL_USERIMAGES_BINARY_PATHS := $( subst $( space) ,:,$( sort $( dir $( INTERNAL_USERIMAGES_DEPS) ) ) )
2016-03-03 06:07:23 +01:00
2020-09-23 12:15:20 +02:00
# Collects file_contexts files from modules to be installed
$( call merge -fc -files , \
$( sort $( foreach m,$( product_MODULES) ,$( ALL_MODULES.$( m) .FILE_CONTEXTS) ) ) ,\
$( call intermediates-dir-for,ETC,file_contexts.bin) /file_contexts.modules.tmp)
2019-06-24 19:39:54 +02:00
SELINUX_FC := $( call intermediates-dir-for,ETC,file_contexts.bin) /file_contexts.bin
2020-09-23 12:15:20 +02:00
2019-06-24 19:39:54 +02:00
INTERNAL_USERIMAGES_DEPS += $( SELINUX_FC)
2017-03-11 01:53:45 +01:00
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
2019-03-28 16:45:40 +01:00
i f e q ( $( PRODUCT_SUPPORTS_VERITY ) , t r u e )
2018-06-19 01:32:35 +02:00
$( error vboot 1.0 doesn' t support logical partition)
e n d i f
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
2021-09-01 06:32:45 +02:00
# $(1) the partition variable component (eg SYSTEM)
# $(2) the partition prefix in properties (eg system)
# $(3) the image prop file
# $(4) optional "other" size
d e f i n e a d d - s p a r s e - f l a g s - t o - i m a g e - p r o p s
$(eval _size : = $( BOARD_ $ ( 1) IMAGE_PARTITION_SIZE ) )
$(eval _reserved : = $( BOARD_ $ ( 1) IMAGE_PARTITION_RESERVED_SIZE ) )
$(eval _headroom : = $( PRODUCT_ $ ( 1) _HEADROOM ) )
$( if $ ( or $ ( _size ) , $ ( _reserved ) , $ ( _headroom ) , $ ( 4) ) ,,
$( hide) echo " $( 2) _disable_sparse=true " >> $( 3) )
e n d e f
2011-10-29 02:02:30 +02:00
# $(1): the path of the output dictionary file
2020-07-16 01:52:59 +02:00
# $(2): a subset of "system vendor cache userdata product system_ext oem odm vendor_dlkm odm_dlkm"
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) )
2021-05-22 18:47:48 +02:00
$( if $( BOARD_SYSTEMIMAGE_FILE_SYSTEM_COMPRESS) ,$( hide) echo " system_f2fs_compress= $( BOARD_SYSTEMIMAGE_FILE_SYSTEM_COMPRESS) " >> $( 1) )
2020-11-04 02:29:09 +01:00
$( if $( BOARD_SYSTEMIMAGE_F2FS_SLOAD_COMPRESS_FLAGS) ,$( hide) echo " system_f2fs_sldc_flags= $( BOARD_SYSTEMIMAGE_F2FS_SLOAD_COMPRESS_FLAGS) " >> $( 1) )
2018-05-30 20:16:46 +02:00
$( 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) )
2019-03-28 16:45:40 +01:00
$( if $( PRODUCT_SYSTEM_BASE_FS_PATH) ,$( hide) echo " system_base_fs_file= $( PRODUCT_SYSTEM_BASE_FS_PATH) " >> $( 1) )
$( if $( PRODUCT_SYSTEM_HEADROOM) ,$( hide) echo " system_headroom= $( 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) )
2021-09-01 06:32:45 +02:00
$( call add-sparse-flags-to-image-props,SYSTEM,system,$( 1) )
2019-05-14 00:58:14 +02:00
$( hide) echo " system_selinux_fc= $( SELINUX_FC) " >> $( 1)
2020-05-30 04:39:12 +02:00
$( hide) echo " building_system_image= $( BUILDING_SYSTEM_IMAGE) " >> $( 1)
)
$( if $ ( filter $ ( 2) ,system_other ) ,\
$( hide) echo " building_system_other_image= $( BUILDING_SYSTEM_OTHER_IMAGE) " >> $( 1)
2021-09-01 06:32:45 +02:00
$( if $( INTERNAL_SYSTEM_OTHER_PARTITION_SIZE) ,,
$( hide) echo "system_other_disable_sparse=true" >> $( 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) )
2019-12-18 02:36:31 +01:00
$( if $( PRODUCT_FS_CASEFOLD) ,$( hide) echo " needs_casefold= $( PRODUCT_FS_CASEFOLD) " >> $( 1) )
$( if $( PRODUCT_QUOTA_PROJID) ,$( hide) echo " needs_projid= $( PRODUCT_QUOTA_PROJID) " >> $( 1) )
2020-10-13 04:50:05 +02:00
$( if $( PRODUCT_FS_COMPRESSION) ,$( hide) echo " needs_compress= $( PRODUCT_FS_COMPRESSION) " >> $( 1) )
2019-05-14 00:58:14 +02:00
$( hide) echo " userdata_selinux_fc= $( SELINUX_FC) " >> $( 1)
2020-05-30 04:39:12 +02:00
$( hide) echo " building_userdata_image= $( BUILDING_USERDATA_IMAGE) " >> $( 1)
2018-05-30 20:16:46 +02:00
)
$( 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) )
2019-05-14 00:58:14 +02:00
$( hide) echo " cache_selinux_fc= $( SELINUX_FC) " >> $( 1)
2020-05-30 04:39:12 +02:00
$( hide) echo " building_cache_image= $( BUILDING_CACHE_IMAGE) " >> $( 1)
2018-05-30 20:16:46 +02:00
)
$( if $ ( filter $ ( 2) ,vendor ) ,\
$( if $( BOARD_VENDORIMAGE_FILE_SYSTEM_TYPE) ,$( hide) echo " vendor_fs_type= $( BOARD_VENDORIMAGE_FILE_SYSTEM_TYPE) " >> $( 1) )
2021-05-22 18:47:48 +02:00
$( if $( BOARD_VENDORIMAGE_FILE_SYSTEM_COMPRESS) ,$( hide) echo " vendor_f2fs_compress= $( BOARD_VENDORIMAGE_FILE_SYSTEM_COMPRESS) " >> $( 1) )
$( if $( BOARD_VENDORIMAGE_F2FS_SLOAD_COMPRESS_FLAGS) ,$( hide) echo " vendor_f2fs_sldc_flags= $( BOARD_VENDORIMAGE_F2FS_SLOAD_COMPRESS_FLAGS) " >> $( 1) )
2018-05-30 20:16:46 +02:00
$( 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) )
2019-03-28 16:45:40 +01:00
$( if $( PRODUCT_VENDOR_BASE_FS_PATH) ,$( hide) echo " vendor_base_fs_file= $( 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) )
2021-09-01 06:32:45 +02:00
$( call add-sparse-flags-to-image-props,VENDOR,vendor,$( 1) )
2019-05-14 00:58:14 +02:00
$( hide) echo " vendor_selinux_fc= $( SELINUX_FC) " >> $( 1)
2020-05-30 04:39:12 +02:00
$( hide) echo " building_vendor_image= $( BUILDING_VENDOR_IMAGE) " >> $( 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) )
2021-05-22 18:47:48 +02:00
$( if $( BOARD_PRODUCTIMAGE_FILE_SYSTEM_COMPRESS) ,$( hide) echo " product_f2fs_compress= $( BOARD_PRODUCTIMAGE_FILE_SYSTEM_COMPRESS) " >> $( 1) )
$( if $( BOARD_PRODUCTIMAGE_F2FS_SLOAD_COMPRESS_FLAGS) ,$( hide) echo " product_f2fs_sldc_flags= $( BOARD_PRODUCTIMAGE_F2FS_SLOAD_COMPRESS_FLAGS) " >> $( 1) )
2018-05-30 20:16:46 +02:00
$( 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) )
2019-03-28 16:45:40 +01:00
$( if $( PRODUCT_PRODUCT_BASE_FS_PATH) ,$( hide) echo " product_base_fs_file= $( 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) )
2021-09-01 06:32:45 +02:00
$( call add-sparse-flags-to-image-props,PRODUCT,product,$( 1) )
2019-05-14 00:58:14 +02:00
$( hide) echo " product_selinux_fc= $( SELINUX_FC) " >> $( 1)
2020-05-30 04:39:12 +02:00
$( hide) echo " building_product_image= $( BUILDING_PRODUCT_IMAGE) " >> $( 1)
2018-05-30 20:16:46 +02:00
)
2019-06-25 08:58:13 +02:00
$( if $ ( filter $ ( 2) ,system_ext ) ,\
$( if $( BOARD_SYSTEM_EXTIMAGE_FILE_SYSTEM_TYPE) ,$( hide) echo " system_ext_fs_type= $( BOARD_SYSTEM_EXTIMAGE_FILE_SYSTEM_TYPE) " >> $( 1) )
2021-05-22 18:47:48 +02:00
$( if $( BOARD_SYSTEM_EXTIMAGE_FILE_SYSTEM_COMPRESS) ,$( hide) echo " system_ext_f2fs_compress= $( BOARD_SYSTEM_EXTIMAGE_FILE_SYSTEM_COMPRESS) " >> $( 1) )
$( if $( BOARD_SYSTEM_EXTIMAGE_F2FS_SLOAD_COMPRESS_FLAGS) ,$( hide) echo " system_ext_f2fs_sldc_flags= $( BOARD_SYSTEM_EXTIMAGE_F2FS_SLOAD_COMPRESS_FLAGS) " >> $( 1) )
2019-06-25 08:58:13 +02:00
$( if $( BOARD_SYSTEM_EXTIMAGE_EXTFS_INODE_COUNT) ,$( hide) echo " system_ext_extfs_inode_count= $( BOARD_SYSTEM_EXTIMAGE_EXTFS_INODE_COUNT) " >> $( 1) )
$( if $( BOARD_SYSTEM_EXTIMAGE_EXTFS_RSV_PCT) ,$( hide) echo " system_ext_extfs_rsv_pct= $( BOARD_SYSTEM_EXTIMAGE_EXTFS_RSV_PCT) " >> $( 1) )
$( if $( BOARD_SYSTEM_EXTIMAGE_PARTITION_SIZE) ,$( hide) echo " system_ext_size= $( BOARD_SYSTEM_EXTIMAGE_PARTITION_SIZE) " >> $( 1) )
$( if $( BOARD_SYSTEM_EXTIMAGE_JOURNAL_SIZE) ,$( hide) echo " system_ext_journal_size= $( BOARD_SYSTEM_EXTIMAGE_JOURNAL_SIZE) " >> $( 1) )
$( if $( BOARD_SYSTEM_EXTIMAGE_SQUASHFS_COMPRESSOR) ,$( hide) echo " system_ext_squashfs_compressor= $( BOARD_SYSTEM_EXTIMAGE_SQUASHFS_COMPRESSOR) " >> $( 1) )
$( if $( BOARD_SYSTEM_EXTIMAGE_SQUASHFS_COMPRESSOR_OPT) ,$( hide) echo " system_ext_squashfs_compressor_opt= $( BOARD_SYSTEM_EXTIMAGE_SQUASHFS_COMPRESSOR_OPT) " >> $( 1) )
$( if $( BOARD_SYSTEM_EXTIMAGE_SQUASHFS_BLOCK_SIZE) ,$( hide) echo " system_ext_squashfs_block_size= $( BOARD_SYSTEM_EXTIMAGE_SQUASHFS_BLOCK_SIZE) " >> $( 1) )
$( if $( BOARD_SYSTEM_EXTIMAGE_SQUASHFS_DISABLE_4K_ALIGN) ,$( hide) echo " system_ext_squashfs_disable_4k_align= $( BOARD_SYSTEM_EXTIMAGE_SQUASHFS_DISABLE_4K_ALIGN) " >> $( 1) )
$( if $( BOARD_SYSTEM_EXTIMAGE_PARTITION_RESERVED_SIZE) ,$( hide) echo " system_ext_reserved_size= $( BOARD_SYSTEM_EXTIMAGE_PARTITION_RESERVED_SIZE) " >> $( 1) )
2021-09-01 06:32:45 +02:00
$( call add-sparse-flags-to-image-props,SYSTEM_EXT,system_ext,$( 1) )
2019-06-25 08:58:13 +02:00
$( hide) echo " system_ext_selinux_fc= $( SELINUX_FC) " >> $( 1)
2020-05-30 04:39:12 +02:00
$( hide) echo " building_system_ext_image= $( BUILDING_SYSTEM_EXT_IMAGE) " >> $( 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) )
2019-03-28 16:45:40 +01:00
$( if $( PRODUCT_ODM_BASE_FS_PATH) ,$( hide) echo " odm_base_fs_file= $( PRODUCT_ODM_BASE_FS_PATH) " >> $( 1) )
2017-11-14 16:42:30 +01:00
$( if $( BOARD_ODMIMAGE_PARTITION_RESERVED_SIZE) ,$( hide) echo " odm_reserved_size= $( BOARD_ODMIMAGE_PARTITION_RESERVED_SIZE) " >> $( 1) )
2021-09-01 06:32:45 +02:00
$( call add-sparse-flags-to-image-props,ODM,odm,$( 1) )
2019-05-14 00:58:14 +02:00
$( hide) echo " odm_selinux_fc= $( SELINUX_FC) " >> $( 1)
2020-05-30 04:39:12 +02:00
$( hide) echo " building_odm_image= $( BUILDING_ODM_IMAGE) " >> $( 1)
2017-11-14 16:42:30 +01:00
)
2020-05-07 23:58:20 +02:00
$( if $ ( filter $ ( 2) ,vendor_dlkm ) ,\
$( if $( BOARD_VENDOR_DLKMIMAGE_FILE_SYSTEM_TYPE) ,$( hide) echo " vendor_dlkm_fs_type= $( BOARD_VENDOR_DLKMIMAGE_FILE_SYSTEM_TYPE) " >> $( 1) )
2021-05-22 18:47:48 +02:00
$( if $( BOARD_VENDOR_DLKMIMAGE_FILE_SYSTEM_COMPRESS) ,$( hide) echo " vendor_dlkm_f2fs_compress= $( BOARD_VENDOR_DLKMIMAGE_FILE_SYSTEM_COMPRESS) " >> $( 1) )
$( if $( BOARD_VENDOR_DLKMIMAGE_F2FS_SLOAD_COMPRESS_FLAGS) ,$( hide) echo " vendor_dlkm_f2fs_sldc_flags= $( BOARD_VENDOR_DLKMIMAGE_F2FS_SLOAD_COMPRESS_FLAGS) " >> $( 1) )
2020-05-07 23:58:20 +02:00
$( if $( BOARD_VENDOR_DLKMIMAGE_EXTFS_INODE_COUNT) ,$( hide) echo " vendor_dlkm_extfs_inode_count= $( BOARD_VENDOR_DLKMIMAGE_EXTFS_INODE_COUNT) " >> $( 1) )
$( if $( BOARD_VENDOR_DLKMIMAGE_EXTFS_RSV_PCT) ,$( hide) echo " vendor_dlkm_extfs_rsv_pct= $( BOARD_VENDOR_DLKMIMAGE_EXTFS_RSV_PCT) " >> $( 1) )
$( if $( BOARD_VENDOR_DLKMIMAGE_PARTITION_SIZE) ,$( hide) echo " vendor_dlkm_size= $( BOARD_VENDOR_DLKMIMAGE_PARTITION_SIZE) " >> $( 1) )
$( if $( BOARD_VENDOR_DLKMIMAGE_JOURNAL_SIZE) ,$( hide) echo " vendor_dlkm_journal_size= $( BOARD_VENDOR_DLKMIMAGE_JOURNAL_SIZE) " >> $( 1) )
$( if $( BOARD_VENDOR_DLKMIMAGE_SQUASHFS_COMPRESSOR) ,$( hide) echo " vendor_dlkm_squashfs_compressor= $( BOARD_VENDOR_DLKMIMAGE_SQUASHFS_COMPRESSOR) " >> $( 1) )
$( if $( BOARD_VENDOR_DLKMIMAGE_SQUASHFS_COMPRESSOR_OPT) ,$( hide) echo " vendor_dlkm_squashfs_compressor_opt= $( BOARD_VENDOR_DLKMIMAGE_SQUASHFS_COMPRESSOR_OPT) " >> $( 1) )
$( if $( BOARD_VENDOR_DLKMIMAGE_SQUASHFS_BLOCK_SIZE) ,$( hide) echo " vendor_dlkm_squashfs_block_size= $( BOARD_VENDOR_DLKMIMAGE_SQUASHFS_BLOCK_SIZE) " >> $( 1) )
$( if $( BOARD_VENDOR_DLKMIMAGE_SQUASHFS_DISABLE_4K_ALIGN) ,$( hide) echo " vendor_dlkm_squashfs_disable_4k_align= $( BOARD_VENDOR_DLKMIMAGE_SQUASHFS_DISABLE_4K_ALIGN) " >> $( 1) )
$( if $( BOARD_VENDOR_DLKMIMAGE_PARTITION_RESERVED_SIZE) ,$( hide) echo " vendor_dlkm_reserved_size= $( BOARD_VENDOR_DLKMIMAGE_PARTITION_RESERVED_SIZE) " >> $( 1) )
2021-09-01 06:32:45 +02:00
$( call add-sparse-flags-to-image-props,VENDOR_DLKM,vendor_dlkm,$( 1) )
2020-05-07 23:58:20 +02:00
$( hide) echo " vendor_dlkm_selinux_fc= $( SELINUX_FC) " >> $( 1)
$( hide) echo " building_vendor_dlkm_image= $( BUILDING_VENDOR_DLKM_IMAGE) " >> $( 1)
)
2020-07-16 01:52:59 +02:00
$( if $ ( filter $ ( 2) ,odm_dlkm ) ,\
$( if $( BOARD_ODM_DLKMIMAGE_FILE_SYSTEM_TYPE) ,$( hide) echo " odm_dlkm_fs_type= $( BOARD_ODM_DLKMIMAGE_FILE_SYSTEM_TYPE) " >> $( 1) )
$( if $( BOARD_ODM_DLKMIMAGE_EXTFS_INODE_COUNT) ,$( hide) echo " odm_dlkm_extfs_inode_count= $( BOARD_ODM_DLKMIMAGE_EXTFS_INODE_COUNT) " >> $( 1) )
$( if $( BOARD_ODM_DLKMIMAGE_EXTFS_RSV_PCT) ,$( hide) echo " odm_dlkm_extfs_rsv_pct= $( BOARD_ODM_DLKMIMAGE_EXTFS_RSV_PCT) " >> $( 1) )
$( if $( BOARD_ODM_DLKMIMAGE_PARTITION_SIZE) ,$( hide) echo " odm_dlkm_size= $( BOARD_ODM_DLKMIMAGE_PARTITION_SIZE) " >> $( 1) )
$( if $( BOARD_ODM_DLKMIMAGE_JOURNAL_SIZE) ,$( hide) echo " odm_dlkm_journal_size= $( BOARD_ODM_DLKMIMAGE_JOURNAL_SIZE) " >> $( 1) )
$( if $( BOARD_ODM_DLKMIMAGE_SQUASHFS_COMPRESSOR) ,$( hide) echo " odm_dlkm_squashfs_compressor= $( BOARD_ODM_DLKMIMAGE_SQUASHFS_COMPRESSOR) " >> $( 1) )
$( if $( BOARD_ODM_DLKMIMAGE_SQUASHFS_COMPRESSOR_OPT) ,$( hide) echo " odm_dlkm_squashfs_compressor_opt= $( BOARD_ODM_DLKMIMAGE_SQUASHFS_COMPRESSOR_OPT) " >> $( 1) )
$( if $( BOARD_ODM_DLKMIMAGE_SQUASHFS_BLOCK_SIZE) ,$( hide) echo " odm_dlkm_squashfs_block_size= $( BOARD_ODM_DLKMIMAGE_SQUASHFS_BLOCK_SIZE) " >> $( 1) )
$( if $( BOARD_ODM_DLKMIMAGE_SQUASHFS_DISABLE_4K_ALIGN) ,$( hide) echo " odm_dlkm_squashfs_disable_4k_align= $( BOARD_ODM_DLKMIMAGE_SQUASHFS_DISABLE_4K_ALIGN) " >> $( 1) )
$( if $( BOARD_ODM_DLKMIMAGE_PARTITION_RESERVED_SIZE) ,$( hide) echo " odm_dlkm_reserved_size= $( BOARD_ODM_DLKMIMAGE_PARTITION_RESERVED_SIZE) " >> $( 1) )
2021-09-01 06:32:45 +02:00
$( call add-sparse-flags-to-image-props,ODM_DLKM,odm_dlkm,$( 1) )
2020-07-16 01:52:59 +02:00
$( hide) echo " odm_dlkm_selinux_fc= $( SELINUX_FC) " >> $( 1)
$( hide) echo " building_odm_dlkm_image= $( BUILDING_ODM_DLKM_IMAGE) " >> $( 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) )
2019-05-14 00:58:14 +02:00
$( hide) echo " oem_selinux_fc= $( SELINUX_FC) " >> $( 1)
2018-05-30 20:16:46 +02:00
)
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) )
2020-06-17 07:59:16 +02:00
$( if $ ( INTERNAL_USERIMAGES_SPARSE_EROFS_FLAG ) ,$ ( hide ) echo "erofs_sparse_flag =$ ( INTERNAL_USERIMAGES_SPARSE_EROFS_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) )
2019-10-16 19:53:41 +02:00
$( if $ ( INTERNAL_USERIMAGES_SPARSE_F 2FS_FLAG ) ,$ ( hide ) echo "f 2fs_sparse_flag =$ ( INTERNAL_USERIMAGES_SPARSE_F 2FS_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) )
2019-03-28 16:45:40 +01:00
$( if $ ( PRODUCT_SUPPORTS_BOOT_SIGNER ) ,$ ( hide ) echo "boot_signer =$ ( PRODUCT_SUPPORTS_BOOT_SIGNER ) " >> $ ( 1) )
$( if $ ( PRODUCT_SUPPORTS_VERITY ) ,$ ( hide ) echo "verity =$ ( PRODUCT_SUPPORTS_VERITY ) " >> $ ( 1) )
$( if $ ( PRODUCT_SUPPORTS_VERITY ) ,$ ( hide ) echo "verity_key =$ ( PRODUCT_VERITY_SIGNING_KEY ) " >> $ ( 1) )
$( if $ ( PRODUCT_SUPPORTS_VERITY ) ,$ ( hide ) echo "verity_signer_cmd =$ ( notdir $ ( VERITY_SIGNER ) ) " >> $ ( 1) )
$( if $ ( PRODUCT_SUPPORTS_VERITY_FEC ) ,$ ( hide ) echo "verity_fec =$ ( 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) )
2019-03-28 16:45:40 +01:00
$( if $ ( PRODUCT_SYSTEM_VERITY_PARTITION ) ,$ ( hide ) echo "system_verity_block_device =$ ( PRODUCT_SYSTEM_VERITY_PARTITION ) " >> $ ( 1) )
$( if $ ( PRODUCT_VENDOR_VERITY_PARTITION ) ,$ ( hide ) echo "vendor_verity_block_device =$ ( PRODUCT_VENDOR_VERITY_PARTITION ) " >> $ ( 1) )
$( if $ ( PRODUCT_PRODUCT_VERITY_PARTITION ) ,$ ( hide ) echo "product_verity_block_device =$ ( PRODUCT_PRODUCT_VERITY_PARTITION ) " >> $ ( 1) )
2019-06-25 08:58:13 +02:00
$( if $ ( PRODUCT_SYSTEM_EXT_VERITY_PARTITION ) ,$ ( hide ) echo "system_ext_verity_block_device =$ ( PRODUCT_SYSTEM_EXT_VERITY_PARTITION ) " >> $ ( 1) )
2020-05-07 23:58:20 +02:00
$( if $ ( PRODUCT_VENDOR_DLKM_VERITY_PARTITION ) ,$ ( hide ) echo "vendor_dlkm_verity_block_device =$ ( PRODUCT_VENDOR_DLKM_VERITY_PARTITION ) " >> $ ( 1) )
2020-07-16 01:52:59 +02:00
$( if $ ( PRODUCT_ODM_DLKM_VERITY_PARTITION ) ,$ ( hide ) echo "odm_dlkm_verity_block_device =$ ( PRODUCT_ODM_DLKM_VERITY_PARTITION ) " >> $ ( 1) )
2019-03-28 16:45:40 +01:00
$( if $ ( PRODUCT_SUPPORTS_VBOOT ) ,$ ( hide ) echo "vboot =$ ( PRODUCT_SUPPORTS_VBOOT ) " >> $ ( 1) )
$( if $ ( PRODUCT_SUPPORTS_VBOOT ) ,$ ( hide ) echo "vboot_key =$ ( PRODUCT_VBOOT_SIGNING_KEY ) " >> $ ( 1) )
$( if $ ( PRODUCT_SUPPORTS_VBOOT ) ,$ ( hide ) echo "vboot_subkey =$ ( PRODUCT_VBOOT_SIGNING_SUBKEY ) " >> $ ( 1) )
$( if $ ( PRODUCT_SUPPORTS_VBOOT ) ,$ ( hide ) echo "futility =$ ( notdir $ ( FUTILITY ) ) " >> $ ( 1) )
$( if $ ( 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-02-27 03:15:51 +01:00
$( hide) echo " avb_system_other_algorithm= $( BOARD_AVB_SYSTEM_OTHER_ALGORITHM) " >> $( 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) ) )
2019-06-25 08:58:13 +02:00
$( if $ ( BOARD_AVB_ENABLE ) ,$ ( hide ) echo "avb_system_ext_hashtree_enable =$ ( BOARD_AVB_ENABLE ) " >> $ ( 1) )
2018-08-02 02:21:14 +02:00
$( if $ ( BOARD_AVB_ENABLE ) ,\
2019-06-25 08:58:13 +02:00
$( hide) echo " avb_system_ext_add_hashtree_footer_args= $( BOARD_AVB_SYSTEM_EXT_ADD_HASHTREE_FOOTER_ARGS) " >> $( 1) )
2018-05-29 14:09:01 +02:00
$( if $ ( BOARD_AVB_ENABLE ) ,\
2019-06-25 08:58:13 +02:00
$( if $( BOARD_AVB_SYSTEM_EXT_KEY_PATH) ,\
$( hide) echo " avb_system_ext_key_path= $( BOARD_AVB_SYSTEM_EXT_KEY_PATH) " >> $( 1)
$( hide) echo " avb_system_ext_algorithm= $( BOARD_AVB_SYSTEM_EXT_ALGORITHM) " >> $( 1)
$( hide) echo " avb_system_ext_rollback_index_location= $( BOARD_AVB_SYSTEM_EXT_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) ) )
2020-05-07 23:58:20 +02:00
$( if $ ( BOARD_AVB_ENABLE ) ,$ ( hide ) echo "avb_vendor_dlkm_hashtree_enable =$ ( BOARD_AVB_ENABLE ) " >> $ ( 1) )
$( if $ ( BOARD_AVB_ENABLE ) ,\
$( hide) echo " avb_vendor_dlkm_add_hashtree_footer_args= $( BOARD_AVB_VENDOR_DLKM_ADD_HASHTREE_FOOTER_ARGS) " >> $( 1) )
$( if $ ( BOARD_AVB_ENABLE ) ,\
$( if $( BOARD_AVB_VENDOR_DLKM_KEY_PATH) ,\
$( hide) echo " avb_vendor_dlkm_key_path= $( BOARD_AVB_VENDOR_DLKM_KEY_PATH) " >> $( 1)
$( hide) echo " avb_vendor_dlkm_algorithm= $( BOARD_AVB_VENDOR_DLKM_ALGORITHM) " >> $( 1)
$( hide) echo " avb_vendor_dlkm_rollback_index_location= $( BOARD_AVB_VENDOR_DLKM_ROLLBACK_INDEX_LOCATION) " >> $( 1) ) )
2020-07-16 01:52:59 +02:00
$( if $ ( BOARD_AVB_ENABLE ) ,$ ( hide ) echo "avb_odm_dlkm_hashtree_enable =$ ( BOARD_AVB_ENABLE ) " >> $ ( 1) )
$( if $ ( BOARD_AVB_ENABLE ) ,\
$( hide) echo " avb_odm_dlkm_add_hashtree_footer_args= $( BOARD_AVB_ODM_DLKM_ADD_HASHTREE_FOOTER_ARGS) " >> $( 1) )
$( if $ ( BOARD_AVB_ENABLE ) ,\
$( if $( BOARD_AVB_ODM_DLKM_KEY_PATH) ,\
$( hide) echo " avb_odm_dlkm_key_path= $( BOARD_AVB_ODM_DLKM_KEY_PATH) " >> $( 1)
$( hide) echo " avb_odm_dlkm_algorithm= $( BOARD_AVB_ODM_DLKM_ALGORITHM) " >> $( 1)
$( hide) echo " avb_odm_dlkm_rollback_index_location= $( BOARD_AVB_ODM_DLKM_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)
2020-02-03 15:40:15 +01:00
$( if $ ( filter true ,$ ( 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.
2019-05-14 00:58:14 +02:00
PROP_DICTIONARY_IMAGES := oem
i f d e f B U I L D I N G _ C A C H E _ I M A G E
PROP_DICTIONARY_IMAGES += cache
e n d i f
i f d e f B U I L D I N G _ S Y S T E M _ I M A G E
PROP_DICTIONARY_IMAGES += system
e n d i f
2020-05-30 04:39:12 +02: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
PROP_DICTIONARY_IMAGES += system_other
e n d i f
2019-05-14 00:58:14 +02: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
PROP_DICTIONARY_IMAGES += userdata
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
PROP_DICTIONARY_IMAGES += vendor
e n d i f
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
PROP_DICTIONARY_IMAGES += product
e n d i f
2019-06-25 08:58:13 +02:00
i f d e f B U I L D I N G _ S Y S T E M _ E X T _ I M A G E
PROP_DICTIONARY_IMAGES += system_ext
2019-05-14 00:58:14 +02:00
e n d i f
i f d e f B U I L D I N G _ O D M _ I M A G E
PROP_DICTIONARY_IMAGES += odm
e n d i f
2020-05-07 23:58:20 +02:00
i f d e f B U I L D I N G _ V E N D O R _ D L K M _ I M A G E
PROP_DICTIONARY_IMAGES += vendor_dlkm
e n d i f
2020-07-16 01:52:59 +02:00
i f d e f B U I L D I N G _ O D M _ D L K M _ I M A G E
PROP_DICTIONARY_IMAGES += odm_dlkm
e n d i f
2018-05-30 20:16:46 +02:00
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
2019-05-14 00:58:14 +02:00
$( call generate-image-prop-dictionary,$( 1) ,$( PROP_DICTIONARY_IMAGES) ,$( 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
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.
2019-04-22 20:09:57 +02:00
i f d e f B U I L D I N G _ R E C O V E R Y _ I M A G E
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)
2020-12-03 00:14:04 +01:00
i f e q ( $( BOARD_USES_RECOVERY_AS_BOOT ) , t r u e )
INSTALLED_BOOTIMAGE_TARGET := $( BUILT_BOOTIMAGE_TARGET)
e n d i f
2018-08-14 21:17:48 +02:00
# 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.
2020-12-03 00:14:04 +01:00
$(INSTALLED_FILES_FILE_RECOVERY) : $( INTERNAL_RECOVERY_RAMDISK_FILES_TIMESTAMP )
2018-08-14 21:17:48 +02:00
$(INSTALLED_FILES_FILE_RECOVERY) : .KATI_IMPLICIT_OUTPUTS := $( INSTALLED_FILES_JSON_RECOVERY )
2019-06-11 01:39:45 +02:00
$(INSTALLED_FILES_FILE_RECOVERY) : $( INTERNAL_RECOVERYIMAGE_FILES ) $( FILESLIST ) $( FILESLIST_UTIL )
2018-08-14 21:17:48 +02:00
@echo Installed file list: $@
2021-03-06 22:29:28 +01:00
mkdir -p $( dir $@ )
rm -f $@
$( FILESLIST) $( TARGET_RECOVERY_ROOT_OUT) > $( @:.txt= .json)
$( FILESLIST_UTIL) -c $( @:.txt= .json) > $@
2018-08-14 21:17:48 +02:00
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 \
2017-03-10 21:53:02 +01:00
$( TARGET_RECOVERY_ROOT_OUT) /plat_property_contexts \
2019-09-28 03:04:51 +02:00
$( TARGET_RECOVERY_ROOT_OUT) /system_ext_file_contexts \
$( TARGET_RECOVERY_ROOT_OUT) /system_ext_property_contexts \
$( TARGET_RECOVERY_ROOT_OUT) /vendor_file_contexts \
2019-02-19 20:23:12 +01:00
$( TARGET_RECOVERY_ROOT_OUT) /vendor_property_contexts \
2017-11-30 15:15:17 +01:00
$( TARGET_RECOVERY_ROOT_OUT) /odm_file_contexts \
2019-02-19 20:23:12 +01:00
$( TARGET_RECOVERY_ROOT_OUT) /odm_property_contexts \
$( TARGET_RECOVERY_ROOT_OUT) /product_file_contexts \
$( TARGET_RECOVERY_ROOT_OUT) /product_property_contexts
2017-11-30 15:15:17 +01:00
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) )
2020-08-09 23:36:56 +02:00
# if building multiple boot images from multiple kernels, use the first kernel listed
# for the recovery image
recovery_kernel := $( firstword $( INSTALLED_KERNEL_TARGET) )
2009-07-02 18:00:54 +02:00
recovery_ramdisk := $( PRODUCT_OUT) /ramdisk-recovery.img
Fix up recovery_text_res
First, make it safer for incremental builds. We used to just be
depending on the bootable/recovery/tools/recovery_l10n/res dir as a
dependency, but that would only trigger a rebuild if a direct child
file/directory was added or removed (so essentially, when a translation
was addded or removed). If a translation was updated, it wouldn't
re-trigger recovery_text_res.
So instead of depending on the directory, depend on the results from
running `find` to list all of the contents in that directory.
Next, move it out of PACKAGING. `m installclean`, which runs in between
incremental builds on our build servers, deletes the obj/PACKAGING
directory. So when recovery_text_res used that directory, we were having
to rebuild it on every incremental build, which isn't optimal when it
takes nearly 90s to build.
So with:
$ lunch aosp_coral-eng
$ m bootimage
$ m installclean
$ m bootimage
The second `m bootimage` went from executing 666 actions in 93s to
executing 658 actions in 6s.
Finally, remove the last uses of $(call include-path-for,recovery),
since they were all in this file (and they weren't using it for include
paths...). We'd like to remove all of these and switch them to header
libraries or other use cases, but in this case, it's just shorter to use
the real path.
Test: treehugger
Test: m bootimage;
touch bootable/recovery/tools/recovery_l10n/res/values/strings.xml
m bootimage
Test: m bootimage; m installclean; m bootimage
Change-Id: I005592e49443aab45ed039a2f0c63f7a69035565
2020-05-27 09:09:16 +02:00
recovery_resources_common := bootable/recovery/res
2013-03-07 00:04:31 +01:00
2019-01-18 15:06:34 +01:00
# Set recovery_density to a density bucket based on TARGET_SCREEN_DENSITY, PRODUCT_AAPT_PREF_CONFIG,
# or mdpi, in order of preference. We support both specific buckets (e.g. xdpi) and numbers,
# which get remapped to a bucket.
recovery_density := $( or $( TARGET_SCREEN_DENSITY) ,$( PRODUCT_AAPT_PREF_CONFIG) ,mdpi)
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) )
2019-01-18 15:06:34 +01:00
# We roughly use the medium point between the primary densities to split buckets.
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
# ------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
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 ) ) )
Fix up recovery_text_res
First, make it safer for incremental builds. We used to just be
depending on the bootable/recovery/tools/recovery_l10n/res dir as a
dependency, but that would only trigger a rebuild if a direct child
file/directory was added or removed (so essentially, when a translation
was addded or removed). If a translation was updated, it wouldn't
re-trigger recovery_text_res.
So instead of depending on the directory, depend on the results from
running `find` to list all of the contents in that directory.
Next, move it out of PACKAGING. `m installclean`, which runs in between
incremental builds on our build servers, deletes the obj/PACKAGING
directory. So when recovery_text_res used that directory, we were having
to rebuild it on every incremental build, which isn't optimal when it
takes nearly 90s to build.
So with:
$ lunch aosp_coral-eng
$ m bootimage
$ m installclean
$ m bootimage
The second `m bootimage` went from executing 666 actions in 93s to
executing 658 actions in 6s.
Finally, remove the last uses of $(call include-path-for,recovery),
since they were all in this file (and they weren't using it for include
paths...). We'd like to remove all of these and switch them to header
libraries or other use cases, but in this case, it's just shorter to use
the real path.
Test: treehugger
Test: m bootimage;
touch bootable/recovery/tools/recovery_l10n/res/values/strings.xml
m bootimage
Test: m bootimage; m installclean; m bootimage
Change-Id: I005592e49443aab45ed039a2f0c63f7a69035565
2020-05-27 09:09:16 +02:00
recovery_font := bootable/recovery/fonts/18x32.png
2013-03-07 00:04:31 +01:00
e l s e
Fix up recovery_text_res
First, make it safer for incremental builds. We used to just be
depending on the bootable/recovery/tools/recovery_l10n/res dir as a
dependency, but that would only trigger a rebuild if a direct child
file/directory was added or removed (so essentially, when a translation
was addded or removed). If a translation was updated, it wouldn't
re-trigger recovery_text_res.
So instead of depending on the directory, depend on the results from
running `find` to list all of the contents in that directory.
Next, move it out of PACKAGING. `m installclean`, which runs in between
incremental builds on our build servers, deletes the obj/PACKAGING
directory. So when recovery_text_res used that directory, we were having
to rebuild it on every incremental build, which isn't optimal when it
takes nearly 90s to build.
So with:
$ lunch aosp_coral-eng
$ m bootimage
$ m installclean
$ m bootimage
The second `m bootimage` went from executing 666 actions in 93s to
executing 658 actions in 6s.
Finally, remove the last uses of $(call include-path-for,recovery),
since they were all in this file (and they weren't using it for include
paths...). We'd like to remove all of these and switch them to header
libraries or other use cases, but in this case, it's just shorter to use
the real path.
Test: treehugger
Test: m bootimage;
touch bootable/recovery/tools/recovery_l10n/res/values/strings.xml
m bootimage
Test: m bootimage; m installclean; m bootimage
Change-Id: I005592e49443aab45ed039a2f0c63f7a69035565
2020-05-27 09:09:16 +02:00
recovery_font := bootable/recovery/fonts/12x22.png
2013-03-07 00:04:31 +01:00
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
Fix up recovery_text_res
First, make it safer for incremental builds. We used to just be
depending on the bootable/recovery/tools/recovery_l10n/res dir as a
dependency, but that would only trigger a rebuild if a direct child
file/directory was added or removed (so essentially, when a translation
was addded or removed). If a translation was updated, it wouldn't
re-trigger recovery_text_res.
So instead of depending on the directory, depend on the results from
running `find` to list all of the contents in that directory.
Next, move it out of PACKAGING. `m installclean`, which runs in between
incremental builds on our build servers, deletes the obj/PACKAGING
directory. So when recovery_text_res used that directory, we were having
to rebuild it on every incremental build, which isn't optimal when it
takes nearly 90s to build.
So with:
$ lunch aosp_coral-eng
$ m bootimage
$ m installclean
$ m bootimage
The second `m bootimage` went from executing 666 actions in 93s to
executing 658 actions in 6s.
Finally, remove the last uses of $(call include-path-for,recovery),
since they were all in this file (and they weren't using it for include
paths...). We'd like to remove all of these and switch them to header
libraries or other use cases, but in this case, it's just shorter to use
the real path.
Test: treehugger
Test: m bootimage;
touch bootable/recovery/tools/recovery_l10n/res/values/strings.xml
m bootimage
Test: m bootimage; m installclean; m bootimage
Change-Id: I005592e49443aab45ed039a2f0c63f7a69035565
2020-05-27 09:09:16 +02:00
RECOVERY_INSTALLING_TEXT_FILE := $( call intermediates-dir-for,ETC,recovery_text_res) /installing_text.png
2018-11-07 20:36:19 +01:00
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
Fix up recovery_text_res
First, make it safer for incremental builds. We used to just be
depending on the bootable/recovery/tools/recovery_l10n/res dir as a
dependency, but that would only trigger a rebuild if a direct child
file/directory was added or removed (so essentially, when a translation
was addded or removed). If a translation was updated, it wouldn't
re-trigger recovery_text_res.
So instead of depending on the directory, depend on the results from
running `find` to list all of the contents in that directory.
Next, move it out of PACKAGING. `m installclean`, which runs in between
incremental builds on our build servers, deletes the obj/PACKAGING
directory. So when recovery_text_res used that directory, we were having
to rebuild it on every incremental build, which isn't optimal when it
takes nearly 90s to build.
So with:
$ lunch aosp_coral-eng
$ m bootimage
$ m installclean
$ m bootimage
The second `m bootimage` went from executing 666 actions in 93s to
executing 658 actions in 6s.
Finally, remove the last uses of $(call include-path-for,recovery),
since they were all in this file (and they weren't using it for include
paths...). We'd like to remove all of these and switch them to header
libraries or other use cases, but in this case, it's just shorter to use
the real path.
Test: treehugger
Test: m bootimage;
touch bootable/recovery/tools/recovery_l10n/res/values/strings.xml
m bootimage
Test: m bootimage; m installclean; m bootimage
Change-Id: I005592e49443aab45ed039a2f0c63f7a69035565
2020-05-27 09:09:16 +02:00
resource_dir := bootable/recovery/tools/recovery_l10n/res/
resource_dir_deps := $( sort $( shell find $( resource_dir) -name *.xml -not -name .*) )
2018-11-07 20:36:19 +01:00
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 )
Fix up recovery_text_res
First, make it safer for incremental builds. We used to just be
depending on the bootable/recovery/tools/recovery_l10n/res dir as a
dependency, but that would only trigger a rebuild if a direct child
file/directory was added or removed (so essentially, when a translation
was addded or removed). If a translation was updated, it wouldn't
re-trigger recovery_text_res.
So instead of depending on the directory, depend on the results from
running `find` to list all of the contents in that directory.
Next, move it out of PACKAGING. `m installclean`, which runs in between
incremental builds on our build servers, deletes the obj/PACKAGING
directory. So when recovery_text_res used that directory, we were having
to rebuild it on every incremental build, which isn't optimal when it
takes nearly 90s to build.
So with:
$ lunch aosp_coral-eng
$ m bootimage
$ m installclean
$ m bootimage
The second `m bootimage` went from executing 666 actions in 93s to
executing 658 actions in 6s.
Finally, remove the last uses of $(call include-path-for,recovery),
since they were all in this file (and they weren't using it for include
paths...). We'd like to remove all of these and switch them to header
libraries or other use cases, but in this case, it's just shorter to use
the real path.
Test: treehugger
Test: m bootimage;
touch bootable/recovery/tools/recovery_l10n/res/values/strings.xml
m bootimage
Test: m bootimage; m installclean; m bootimage
Change-Id: I005592e49443aab45ed039a2f0c63f7a69035565
2020-05-27 09:09:16 +02:00
$(RECOVERY_INSTALLING_TEXT_FILE) : PRIVATE_RECOVERY_FONT_FILES_DIR := $( call intermediates -dir -for ,ETC ,recovery_font_files )
2018-11-07 20:36:19 +01:00
$(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 ) )
Fix up recovery_text_res
First, make it safer for incremental builds. We used to just be
depending on the bootable/recovery/tools/recovery_l10n/res dir as a
dependency, but that would only trigger a rebuild if a direct child
file/directory was added or removed (so essentially, when a translation
was addded or removed). If a translation was updated, it wouldn't
re-trigger recovery_text_res.
So instead of depending on the directory, depend on the results from
running `find` to list all of the contents in that directory.
Next, move it out of PACKAGING. `m installclean`, which runs in between
incremental builds on our build servers, deletes the obj/PACKAGING
directory. So when recovery_text_res used that directory, we were having
to rebuild it on every incremental build, which isn't optimal when it
takes nearly 90s to build.
So with:
$ lunch aosp_coral-eng
$ m bootimage
$ m installclean
$ m bootimage
The second `m bootimage` went from executing 666 actions in 93s to
executing 658 actions in 6s.
Finally, remove the last uses of $(call include-path-for,recovery),
since they were all in this file (and they weren't using it for include
paths...). We'd like to remove all of these and switch them to header
libraries or other use cases, but in this case, it's just shorter to use
the real path.
Test: treehugger
Test: m bootimage;
touch bootable/recovery/tools/recovery_l10n/res/values/strings.xml
m bootimage
Test: m bootimage; m installclean; m bootimage
Change-Id: I005592e49443aab45ed039a2f0c63f7a69035565
2020-05-27 09:09:16 +02:00
$(RECOVERY_INSTALLING_TEXT_FILE) : $( image_generator_jar ) $( resource_dir_deps ) $( 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).
2020-10-20 22:17:42 +02:00
# f) We build a single image that contains vendor_boot and recovery both - no recovery image to
# install
# (BOARD_MOVE_RECOVERY_RESOURCES_TO_VENDOR_BOOT = 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 ) \
2020-10-20 22:17:42 +02:00
$( BOARD_BUILD_SYSTEM_ROOT_IMAGE) $( BOARD_INCLUDE_RECOVERY_DTBO) $( BOARD_INCLUDE_RECOVERY_ACPIO) \
$( BOARD_MOVE_RECOVERY_RESOURCES_TO_VENDOR_BOOT) ) )
2012-08-21 00:38:58 +02:00
# Named '.dat' so we don't attempt to use imgdiff for patching it.
Moving recovery resources from /system to /vendor
This change is part of a topic that moves the recovery resources from the
system partition to the vendor partition, if it exists, or the vendor directory
on the system partition otherwise. The recovery resources are moving from the
system image to the vendor partition so that a single system image may be used
with either an A/B or a non-A/B vendor image. The topic removes a delta in the
system image that prevented such reuse in the past.
The recovery resources that are moving are involved with updating the recovery
partition after an update. In a non-A/B configuration, the system boots from
the recovery partition, updates the other partitions (system, vendor, etc.)
Then, the next time the system boots normally, a script updates the recovery
partition (if necessary). This script, the executables it invokes, and the data
files that it uses were previously on the system partition. The resources that
are moving include the following.
* install-recovery.sh
* applypatch
* recovery-resource.dat (if present)
* recovery-from-boot.p (if present)
This change includes the platform build system and release tools changes to
move the recovery resources from system to vendor (or /system/vendor). The
release tools need to know where to generate the recovery patch, and they
discover this from misc_info.txt variable board_uses_vendorimage, which the
platform build system generates.
We remove applypatch from PRODUCT_PACKAGES, but it is added back as a required
module in target/product/base_vendor.mk.
Several release tools rely on the misc_info.txt board_uses_vendorimage variable
to know how to generate and detect the recovery patch.
This change partially removes the --rebuild_recovery flag from the
merge_target_files.py script. The flag will be fully removed in a follow-on
change.
Bug: 68319577
Test: Ensure that recovery partition is updated correctly.
Change-Id: Ia4045bd67ffb3d899efa8d20dab4c4299b87ee5f
2019-09-18 02:06:47 +02:00
RECOVERY_RESOURCE_ZIP := $( TARGET_OUT_VENDOR) /etc/recovery-resource.dat
ALL_DEFAULT_INSTALLED_MODULES += $( RECOVERY_RESOURCE_ZIP)
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) : \
2020-05-25 20:18:36 +02:00
$( INSTALLED_BUILD_PROP_TARGET) \
2018-11-26 19:12:05 +01:00
$( INSTALLED_VENDOR_BUILD_PROP_TARGET) \
$( INSTALLED_ODM_BUILD_PROP_TARGET) \
$( INSTALLED_PRODUCT_BUILD_PROP_TARGET) \
2019-06-25 08:58:13 +02:00
$( INSTALLED_SYSTEM_EXT_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 $@
2020-05-25 20:18:36 +02:00
$( hide) cat $( INSTALLED_BUILD_PROP_TARGET) >> $@
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) >> $@
2019-06-25 08:58:13 +02:00
$( hide) cat $( INSTALLED_SYSTEM_EXT_BUILD_PROP_TARGET) >> $@
2018-07-31 22:26:54 +02:00
$( call append-recovery-ui-properties,$( PRIVATE_RECOVERY_UI_PROPERTIES) ,$@ )
2020-09-25 03:18:26 +02:00
# Only install boot/etc/build.prop to recovery image on recovery_as_boot.
# On device with dedicated recovery partition, the file should come from the boot
# ramdisk.
i f e q ( t r u e , $( BOARD_USES_RECOVERY_AS_BOOT ) )
INSTALLED_RECOVERY_RAMDISK_BUILD_PROP_TARGET := $( TARGET_RECOVERY_ROOT_OUT) /$( RAMDISK_BUILD_PROP_REL_PATH)
$(INSTALLED_RECOVERY_RAMDISK_BUILD_PROP_TARGET) : $( INSTALLED_RAMDISK_BUILD_PROP_TARGET )
$( copy-file-to-target)
e n d i f
2020-10-29 00:35:19 +01:00
INTERNAL_RECOVERYIMAGE_ARGS := --ramdisk $( recovery_ramdisk)
2020-10-12 20:08:30 +02:00
2020-10-28 22:15:21 +01:00
i f n e q ( t r u e t r u e , $( strip $ ( BUILDING_VENDOR_BOOT_IMAGE ) ) $( strip $ ( BOARD_USES_RECOVERY_AS_BOOT ) ) )
2020-10-29 00:35:19 +01:00
INTERNAL_RECOVERYIMAGE_ARGS += $( addprefix --second ,$( INSTALLED_2NDBOOTLOADER_TARGET) )
2009-07-02 18:00:54 +02:00
# Assumes this has already been stripped
2020-10-12 20:08:30 +02:00
i f n e q ( t r u e , $( BOARD_EXCLUDE_KERNEL_FROM_RECOVERY_IMAGE ) )
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) "
2020-10-12 20:08:30 +02:00
e n d i f # INTERNAL_KERNEL_CMDLINE != ""
e n d i f # BOARD_EXCLUDE_KERNEL_FROM_RECOVERY_IMAGE != true
2009-07-02 18:00:54 +02:00
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-07-10 19:49:37 +02:00
e n d i f # BOARD_INCLUDE_RECOVERY_DTBO
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
Remove device-specific bits if recovery_as_boot
On legacy devices (launched with R and below), if device:
- has a vendor_boot partition, and
- uses recovery_as_boot
Then, when building the recovery/boot partition, the
device-specific bits, including dtb/kernel base/pagesize should
be moved to vendor_boot.
Previously, it is incorrectly assumed that A/B => recovery_as_boot.
In reality, we do have A/B devices with a dedicated recovery partition.
Note that for devices that uses GKI (BOARD_USES_GENERIC_KERNEL_IMAGE),
recovery_as_boot is never set to true. Instead, recovery resources
are moved to vendor_boot. On these devices, the conditional
'vendor_boot && recovery-as-boot' is always false. Hence:
- If the device has a dedicated recovery partition, it should use V3 header,
and dtb/base/pagesize won't be in recovery header.
- If device does not have a dedicated recovery partition, the recovery
image won't be built.
Test: builds
Change-Id: I0db2af20470cbe8a21044a984cccf264590aaccf
2020-10-29 00:33:06 +01:00
e n d i f # (BUILDING_VENDOR_BOOT_IMAGE and BOARD_USES_RECOVERY_AS_BOOT)
2020-03-17 03:13:46 +01:00
i f n d e f B O A R D _ R E C O V E R Y _ M K B O O T I M G _ A R G S
BOARD_RECOVERY_MKBOOTIMG_ARGS := $( BOARD_MKBOOTIMG_ARGS)
e n d i f
2009-07-02 18:00:54 +02:00
2020-10-09 23:29:39 +02:00
$(INTERNAL_RECOVERY_RAMDISK_FILES_TIMESTAMP) : $( MKBOOTFS ) $( COMPRESSION_COMMAND_DEPS ) \
2020-03-12 00:03:07 +01:00
$( INTERNAL_ROOT_FILES) \
$( INSTALLED_RAMDISK_TARGET) \
$( INTERNAL_RECOVERYIMAGE_FILES) \
$( recovery_sepolicy) \
$( INSTALLED_2NDBOOTLOADER_TARGET) \
$( INSTALLED_RECOVERY_BUILD_PROP_TARGET) \
2020-09-25 03:18:26 +02:00
$( INSTALLED_RECOVERY_RAMDISK_BUILD_PROP_TARGET) \
2020-03-12 00:03:07 +01:00
$( recovery_resource_deps) \
$( recovery_fstab)
# Making recovery image
mkdir -p $( TARGET_RECOVERY_OUT)
mkdir -p $( TARGET_RECOVERY_ROOT_OUT) /sdcard $( TARGET_RECOVERY_ROOT_OUT) /tmp
# Copying baseline ramdisk...
# Use rsync because "cp -Rf" fails to overwrite broken symlinks on Mac.
rsync -a --exclude= sdcard $( IGNORE_RECOVERY_SEPOLICY) $( IGNORE_CACHE_LINK) $( TARGET_ROOT_OUT) $( TARGET_RECOVERY_OUT)
# Modifying ramdisk contents...
$( if $( filter true,$( BOARD_BUILD_SYSTEM_ROOT_IMAGE) ) ,, \
ln -sf /system/bin/init $( TARGET_RECOVERY_ROOT_OUT) /init)
# Removes $(TARGET_RECOVERY_ROOT_OUT)/init*.rc EXCEPT init.recovery*.rc.
find $( TARGET_RECOVERY_ROOT_OUT) -maxdepth 1 -name 'init*.rc' -type f -not -name "init.recovery.*.rc" | xargs rm -f
cp $( TARGET_ROOT_OUT) /init.recovery.*.rc $( TARGET_RECOVERY_ROOT_OUT) / 2> /dev/null || true # Ignore error when the src file doesn't exist.
mkdir -p $( TARGET_RECOVERY_ROOT_OUT) /res
rm -rf $( TARGET_RECOVERY_ROOT_OUT) /res/*
cp -rf $( recovery_resources_common) /* $( TARGET_RECOVERY_ROOT_OUT) /res
$( foreach recovery_text_file,$( generated_recovery_text_files) , \
cp -rf $( recovery_text_file) $( TARGET_RECOVERY_ROOT_OUT) /res/images/ && ) true
cp -f $( recovery_font) $( TARGET_RECOVERY_ROOT_OUT) /res/images/font.png
$( foreach item,$( TARGET_PRIVATE_RES_DIRS) , \
cp -rf $( item) $( TARGET_RECOVERY_ROOT_OUT) /$( newline) )
$( foreach item,$( recovery_fstab) , \
cp -f $( item) $( TARGET_RECOVERY_ROOT_OUT) /system/etc/recovery.fstab)
$( if $( strip $( recovery_wipe) ) , \
cp -f $( recovery_wipe) $( TARGET_RECOVERY_ROOT_OUT) /system/etc/recovery.wipe)
ln -sf prop.default $( TARGET_RECOVERY_ROOT_OUT) /default.prop
$( BOARD_RECOVERY_IMAGE_PREPARE)
2020-10-09 23:29:39 +02:00
$( hide) touch $@
$(recovery_ramdisk) : $( INTERNAL_RECOVERY_RAMDISK_FILES_TIMESTAMP )
2020-05-11 22:20:03 +02:00
$( MKBOOTFS) -d $( TARGET_OUT) $( TARGET_RECOVERY_ROOT_OUT) | $( COMPRESSION_COMMAND) > $( recovery_ramdisk)
2020-03-12 00:03:07 +01:00
2015-01-30 23:05:22 +01:00
# $(1): output file
2020-10-08 20:54:02 +02:00
# $(2): optional kernel file
2015-01-30 23:05:22 +01:00
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
2019-03-28 16:45:40 +01:00
$( if $( filter true,$( PRODUCT_SUPPORTS_VBOOT) ) , \
2020-10-08 20:54:02 +02:00
$( MKBOOTIMG) $( if $( strip $( 2) ) ,--kernel $( strip $( 2) ) ) $( INTERNAL_RECOVERYIMAGE_ARGS) \
2020-03-17 03:13:46 +01:00
$( INTERNAL_MKBOOTIMG_VERSION_ARGS) $( BOARD_RECOVERY_MKBOOTIMG_ARGS) \
2020-03-12 00:03:07 +01:00
--output $( 1) .unsigned, \
2020-10-08 20:54:02 +02:00
$( MKBOOTIMG) $( if $( strip $( 2) ) ,--kernel $( strip $( 2) ) ) $( INTERNAL_RECOVERYIMAGE_ARGS) \
2021-03-12 14:40:32 +01:00
$( INTERNAL_MKBOOTIMG_VERSION_ARGS) $( INTERNAL_MKBOOTIMG_GKI_SINGING_ARGS) \
$( BOARD_RECOVERY_MKBOOTIMG_ARGS) --output $( 1) )
2019-03-28 16:45:40 +01:00
$( if $( filter true,$( PRODUCT_SUPPORTS_BOOT_SIGNER) ) ,\
2016-08-08 19:51:10 +02:00
$( if $( filter true,$( BOARD_USES_RECOVERY_AS_BOOT) ) ,\
2019-03-28 16:45:40 +01:00
$( BOOT_SIGNER) /boot $( 1) $( PRODUCT_VERITY_SIGNING_KEY) .pk8 $( PRODUCT_VERITY_SIGNING_KEY) .x509.pem $( 1) ,\
$( BOOT_SIGNER) /recovery $( 1) $( PRODUCT_VERITY_SIGNING_KEY) .pk8 $( PRODUCT_VERITY_SIGNING_KEY) .x509.pem $( 1) \
2016-08-08 19:51:10 +02:00
) \
)
2019-03-28 16:45:40 +01:00
$( if $( filter true,$( PRODUCT_SUPPORTS_VBOOT) ) , \
$( VBOOT_SIGNER) $( FUTILITY) $( 1) .unsigned $( PRODUCT_VBOOT_SIGNING_KEY) .vbpubk $( PRODUCT_VBOOT_SIGNING_KEY) .vbprivk $( PRODUCT_VBOOT_SIGNING_SUBKEY) .vbprivk $( 1) .keyblock $( 1) )
2017-11-17 08:22:37 +01:00
$( if $( filter true,$( BOARD_USES_RECOVERY_AS_BOOT) ) , \
2020-05-08 02:32:10 +02:00
$( call assert-max-image-size,$( 1) ,$( call get-hash-image-max-size,$( call get-bootimage-partition-size,$( 1) ,boot) ) ) , \
2020-03-12 00:03:07 +01:00
$( 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) ) , \
2020-05-08 02:32:10 +02:00
$( AVBTOOL) add_hash_footer --image $( 1) --partition_size $( call get-bootimage-partition-size,$( 1) ,boot) --partition_name boot $( INTERNAL_AVB_BOOT_SIGNING_ARGS) $( BOARD_AVB_BOOT_ADD_HASH_FOOTER_ARGS) ,\
2020-03-12 00:03:07 +01:00
$( 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
2020-06-12 04:39:34 +02:00
recoveryimage-deps := $( MKBOOTIMG) $( recovery_ramdisk) $( recovery_kernel)
2019-03-28 16:45:40 +01:00
i f e q ( t r u e , $( PRODUCT_SUPPORTS_BOOT_SIGNER ) )
2020-06-12 04:39:34 +02:00
recoveryimage-deps += $( BOOT_SIGNER)
2016-03-10 21:57:33 +01:00
e n d i f
2019-03-28 16:45:40 +01:00
i f e q ( t r u e , $( PRODUCT_SUPPORTS_VBOOT ) )
2020-06-12 04:39:34 +02:00
recoveryimage-deps += $( VBOOT_SIGNER)
2016-03-10 21:57:33 +01:00
e n d i f
2017-05-04 22:58:04 +02:00
i f e q ( t r u e , $( BOARD_AVB_ENABLE ) )
2020-06-12 04:39:34 +02:00
recoveryimage-deps += $( AVBTOOL) $( BOARD_AVB_BOOT_KEY_PATH)
2017-05-04 22:58:04 +02:00
e n d i f
2021-03-12 14:40:32 +01:00
i f d e f B O A R D _ G K I _ S I G N I N G _ K E Y _ P A T H
recoveryimage-deps += $( BOARD_GKI_SIGNING_KEY_PATH) $( AVBTOOL)
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
2020-06-12 04:39:34 +02:00
ifdef BOARD_PREBUILT_RECOVERY_DTBOIMAGE
recoveryimage-deps += $( BOARD_PREBUILT_RECOVERY_DTBOIMAGE)
else
recoveryimage-deps += $( BOARD_PREBUILT_DTBOIMAGE)
endif
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
2020-06-12 04:39:34 +02:00
recoveryimage-deps += $( BOARD_RECOVERY_ACPIO)
2018-09-23 16:10:47 +02:00
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
2020-06-12 04:39:34 +02:00
recoveryimage-deps += $( INSTALLED_DTBIMAGE_TARGET)
2019-01-23 03:08:59 +01:00
e n d i f
2018-08-22 23:35:09 +02:00
2020-06-12 04:39:34 +02:00
i f e q ( $( BOARD_USES_RECOVERY_AS_BOOT ) , t r u e )
2020-09-30 06:18:20 +02:00
$( foreach b ,$ ( INSTALLED_BOOTIMAGE_TARGET ) , $ ( eval $ ( call add -dependency ,$ ( b ) ,$ ( call bootimage -to -kernel ,$ ( b ) ) ) ) )
2020-06-12 04:39:34 +02:00
$(INSTALLED_BOOTIMAGE_TARGET) : $( recoveryimage -deps )
2018-08-22 23:35:09 +02:00
$( call pretty," Target boot image from recovery: $@ " )
2020-03-12 00:03:07 +01:00
$( call build-recoveryimage-target, $@ , $( PRODUCT_OUT) /$( subst .img,,$( subst boot,kernel,$( notdir $@ ) ) ) )
2018-08-22 23:35:09 +02:00
e n d i f # BOARD_USES_RECOVERY_AS_BOOT
2020-06-12 04:39:34 +02:00
$(INSTALLED_RECOVERYIMAGE_TARGET) : $( recoveryimage -deps )
2020-10-08 20:54:02 +02:00
$( call build-recoveryimage-target, $@ , \
$( if $( filter true, $( BOARD_EXCLUDE_KERNEL_FROM_RECOVERY_IMAGE) ) ,, $( recovery_kernel) ) )
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 "
2020-10-08 20:54:02 +02:00
$( call build-recoveryimage-target, $( INSTALLED_RECOVERYIMAGE_TARGET) , \
$( if $( filter true, $( BOARD_EXCLUDE_KERNEL_FROM_RECOVERY_IMAGE) ) ,, $( recovery_kernel) ) )
2015-01-30 23:05:22 +01:00
2019-04-22 20:09:57 +02:00
e l s e # BUILDING_RECOVERY_IMAGE
2012-08-21 00:38:58 +02:00
RECOVERY_RESOURCE_ZIP :=
2019-04-22 20:09:57 +02:00
e n d i f # BUILDING_RECOVERY_IMAGE
2009-07-02 18:00:54 +02:00
.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
Adding boot-test-harness.img
In commit I30137c3caef91805d9143d404e5e4d06c0fccc30, we added
a boot-debug.img to allow adb root when using an user build GSI image.
However, to run automated tests, it requires additional properties,
which are not needed for GSI compliance:
ro.audio.silent=1
ro.test_harness=1
This CL adds an additional boot-test-harness.img for automated tests,
and keeps the original boot-debug.img for GSI compliance.
Note: boot-test-harness.img won't be built by default, it needs
explicit `make bootimage_test_harness`.
Bug: 140036184
Test: `m bootimage_test_harness`, flashes boot-test-harness.img and checks
adb root works and test harness props are set.
Test: `m bootimage_test_harness dist -j32`, checks both
boot-test-harness.img and ramdisk-test-harness.img are under ./out/dist/.
Test: `system/tools/mkbootimg/unpack_bootimg.py --boot_img $OUT/boot-test-harness.img --out ramdisk-test-harness`,
checks the extracted out/ramdisk is as expected
Test: Run `gunzip -c ramdisk | cpio -idm` for the ramdisk extracted from
$OUT/boot-test-harness.img and $OUT/boot-debug.img, respectively.
Then compare the root dirs of both, e.g.,
`diff -rq --no-dereference ./ramdisk-test-harness ./ramdisk-debug`
Test: `m ramdisk_test_harness-nodeps` and `m bootimage_test_harness-nodeps`
Change-Id: Iadea0b5c933c3b7fa10dcf3d9e85596916b3333d
2019-10-08 04:22:19 +02:00
i f n e q ( $( BOARD_BUILD_SYSTEM_ROOT_IMAGE ) , t r u e )
Adding boot-debug.img and ramdisk-debug.img
The two new debugging images adds additional files based on
boot.img and ramdisk.img/ramdisk-recovery.img, respectively.
File /force_debuggable is to trigger special logic in /init to load an
userdebug version of sepolicy and an additional property file from this
ramdisk to allow adb root, if the device is unlocked.
It's intentional to skip signing for boot-debug.img, as it can
only be used if the device is unlocked, where verification error
is allowed.
Those debugging images allows adb root on user build
system.img, vendor.img, product.img, etc. This can facilitate more
automated testings on user builds and is helpful to narrow down the
delta between what's being tested v.s. what's being shipped.
Bug: 126493225
Test: `make dist`, checks both boot-debug.img and ramdisk-debug.img
are in $OUT/ and out/dist.
Test: `make dist`, checks installed-files-ramdisk-debug.{json,txt} are
in out/dist.
Test: `system/core/mkbootimg/unpack_bootimg.py --boot_img $OUT/boot-debug.img`,
checks the extracted out/ramdisk is as expected
Test: Run `gunzip -c ramdisk | cpio -idm` for the ramdisk extracted from
$OUT/boot-debug.img and $OUT/boot.img, respectively.
Then compare the root dirs of both, e.g.,
`diff -rq --no-dereference ./ramdisk ./ramdisk-debug`
Test: `make ramdisk_debug-nodeps` and `make bootimage_debug-nodeps`
Change-Id: I30137c3caef91805d9143d404e5e4d06c0fccc30
2019-03-20 10:59:52 +01:00
# -----------------------------------------------------------------
# the debug ramdisk, which is the original ramdisk plus additional
# files: force_debuggable, adb_debug.prop and userdebug sepolicy.
# When /force_debuggable is present, /init will load userdebug sepolicy
# and property files to allow adb root, if the device is unlocked.
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
BUILT_DEBUG_RAMDISK_TARGET := $( PRODUCT_OUT) /ramdisk-debug.img
INSTALLED_DEBUG_RAMDISK_TARGET := $( BUILT_DEBUG_RAMDISK_TARGET)
INTERNAL_DEBUG_RAMDISK_FILES := $( filter $( TARGET_DEBUG_RAMDISK_OUT) /%, \
$( ALL_GENERATED_SOURCES) \
$( ALL_DEFAULT_INSTALLED_MODULES) )
INSTALLED_FILES_FILE_DEBUG_RAMDISK := $( PRODUCT_OUT) /installed-files-ramdisk-debug.txt
INSTALLED_FILES_JSON_DEBUG_RAMDISK := $( INSTALLED_FILES_FILE_DEBUG_RAMDISK:.txt= .json)
$(INSTALLED_FILES_FILE_DEBUG_RAMDISK) : .KATI_IMPLICIT_OUTPUTS := $( INSTALLED_FILES_JSON_DEBUG_RAMDISK )
2021-04-23 05:31:32 +02:00
# ramdisk-debug.img will merge the content from either ramdisk.img or
# ramdisk-recovery.img, depending on whether BOARD_USES_RECOVERY_AS_BOOT
# is set or not.
i f e q ( $( BOARD_USES_RECOVERY_AS_BOOT ) , t r u e )
$( INSTALLED_FILES_FILE_DEBUG_RAMDISK) : PRIVATE_ADDITIONAL_DIR := $( TARGET_RECOVERY_ROOT_OUT)
$( INSTALLED_FILES_FILE_DEBUG_RAMDISK) : $( recovery_ramdisk)
e l s e
$( INSTALLED_FILES_FILE_DEBUG_RAMDISK) : PRIVATE_ADDITIONAL_DIR := $( TARGET_RAMDISK_OUT)
$( INSTALLED_FILES_FILE_DEBUG_RAMDISK) : $( INSTALLED_RAMDISK_TARGET)
e n d i f # BOARD_USES_RECOVERY_AS_BOOT
2019-06-11 01:39:45 +02:00
$(INSTALLED_FILES_FILE_DEBUG_RAMDISK) : $( INTERNAL_DEBUG_RAMDISK_FILES ) $( FILESLIST ) $( FILESLIST_UTIL )
2021-03-06 22:29:28 +01:00
@echo Installed file list: $@
Adding boot-debug.img and ramdisk-debug.img
The two new debugging images adds additional files based on
boot.img and ramdisk.img/ramdisk-recovery.img, respectively.
File /force_debuggable is to trigger special logic in /init to load an
userdebug version of sepolicy and an additional property file from this
ramdisk to allow adb root, if the device is unlocked.
It's intentional to skip signing for boot-debug.img, as it can
only be used if the device is unlocked, where verification error
is allowed.
Those debugging images allows adb root on user build
system.img, vendor.img, product.img, etc. This can facilitate more
automated testings on user builds and is helpful to narrow down the
delta between what's being tested v.s. what's being shipped.
Bug: 126493225
Test: `make dist`, checks both boot-debug.img and ramdisk-debug.img
are in $OUT/ and out/dist.
Test: `make dist`, checks installed-files-ramdisk-debug.{json,txt} are
in out/dist.
Test: `system/core/mkbootimg/unpack_bootimg.py --boot_img $OUT/boot-debug.img`,
checks the extracted out/ramdisk is as expected
Test: Run `gunzip -c ramdisk | cpio -idm` for the ramdisk extracted from
$OUT/boot-debug.img and $OUT/boot.img, respectively.
Then compare the root dirs of both, e.g.,
`diff -rq --no-dereference ./ramdisk ./ramdisk-debug`
Test: `make ramdisk_debug-nodeps` and `make bootimage_debug-nodeps`
Change-Id: I30137c3caef91805d9143d404e5e4d06c0fccc30
2019-03-20 10:59:52 +01:00
mkdir -p $( dir $@ )
rm -f $@
2021-04-23 05:31:32 +02:00
$( FILESLIST) $( TARGET_DEBUG_RAMDISK_OUT) $( PRIVATE_ADDITIONAL_DIR) > $( @:.txt= .json)
2019-06-11 01:39:45 +02:00
$( FILESLIST_UTIL) -c $( @:.txt= .json) > $@
Adding boot-debug.img and ramdisk-debug.img
The two new debugging images adds additional files based on
boot.img and ramdisk.img/ramdisk-recovery.img, respectively.
File /force_debuggable is to trigger special logic in /init to load an
userdebug version of sepolicy and an additional property file from this
ramdisk to allow adb root, if the device is unlocked.
It's intentional to skip signing for boot-debug.img, as it can
only be used if the device is unlocked, where verification error
is allowed.
Those debugging images allows adb root on user build
system.img, vendor.img, product.img, etc. This can facilitate more
automated testings on user builds and is helpful to narrow down the
delta between what's being tested v.s. what's being shipped.
Bug: 126493225
Test: `make dist`, checks both boot-debug.img and ramdisk-debug.img
are in $OUT/ and out/dist.
Test: `make dist`, checks installed-files-ramdisk-debug.{json,txt} are
in out/dist.
Test: `system/core/mkbootimg/unpack_bootimg.py --boot_img $OUT/boot-debug.img`,
checks the extracted out/ramdisk is as expected
Test: Run `gunzip -c ramdisk | cpio -idm` for the ramdisk extracted from
$OUT/boot-debug.img and $OUT/boot.img, respectively.
Then compare the root dirs of both, e.g.,
`diff -rq --no-dereference ./ramdisk ./ramdisk-debug`
Test: `make ramdisk_debug-nodeps` and `make bootimage_debug-nodeps`
Change-Id: I30137c3caef91805d9143d404e5e4d06c0fccc30
2019-03-20 10:59:52 +01:00
i f e q ( $( BOARD_USES_RECOVERY_AS_BOOT ) , t r u e )
2021-04-23 05:31:32 +02:00
$( INSTALLED_DEBUG_RAMDISK_TARGET) : PRIVATE_ADDITIONAL_DIR := $( TARGET_RECOVERY_ROOT_OUT)
$( INSTALLED_DEBUG_RAMDISK_TARGET) : $( recovery_ramdisk)
Adding boot-debug.img and ramdisk-debug.img
The two new debugging images adds additional files based on
boot.img and ramdisk.img/ramdisk-recovery.img, respectively.
File /force_debuggable is to trigger special logic in /init to load an
userdebug version of sepolicy and an additional property file from this
ramdisk to allow adb root, if the device is unlocked.
It's intentional to skip signing for boot-debug.img, as it can
only be used if the device is unlocked, where verification error
is allowed.
Those debugging images allows adb root on user build
system.img, vendor.img, product.img, etc. This can facilitate more
automated testings on user builds and is helpful to narrow down the
delta between what's being tested v.s. what's being shipped.
Bug: 126493225
Test: `make dist`, checks both boot-debug.img and ramdisk-debug.img
are in $OUT/ and out/dist.
Test: `make dist`, checks installed-files-ramdisk-debug.{json,txt} are
in out/dist.
Test: `system/core/mkbootimg/unpack_bootimg.py --boot_img $OUT/boot-debug.img`,
checks the extracted out/ramdisk is as expected
Test: Run `gunzip -c ramdisk | cpio -idm` for the ramdisk extracted from
$OUT/boot-debug.img and $OUT/boot.img, respectively.
Then compare the root dirs of both, e.g.,
`diff -rq --no-dereference ./ramdisk ./ramdisk-debug`
Test: `make ramdisk_debug-nodeps` and `make bootimage_debug-nodeps`
Change-Id: I30137c3caef91805d9143d404e5e4d06c0fccc30
2019-03-20 10:59:52 +01:00
e l s e
2021-04-23 05:31:32 +02:00
$( INSTALLED_DEBUG_RAMDISK_TARGET) : PRIVATE_ADDITIONAL_DIR := $( TARGET_RAMDISK_OUT)
$( INSTALLED_DEBUG_RAMDISK_TARGET) : $( INSTALLED_RAMDISK_TARGET)
Adding boot-debug.img and ramdisk-debug.img
The two new debugging images adds additional files based on
boot.img and ramdisk.img/ramdisk-recovery.img, respectively.
File /force_debuggable is to trigger special logic in /init to load an
userdebug version of sepolicy and an additional property file from this
ramdisk to allow adb root, if the device is unlocked.
It's intentional to skip signing for boot-debug.img, as it can
only be used if the device is unlocked, where verification error
is allowed.
Those debugging images allows adb root on user build
system.img, vendor.img, product.img, etc. This can facilitate more
automated testings on user builds and is helpful to narrow down the
delta between what's being tested v.s. what's being shipped.
Bug: 126493225
Test: `make dist`, checks both boot-debug.img and ramdisk-debug.img
are in $OUT/ and out/dist.
Test: `make dist`, checks installed-files-ramdisk-debug.{json,txt} are
in out/dist.
Test: `system/core/mkbootimg/unpack_bootimg.py --boot_img $OUT/boot-debug.img`,
checks the extracted out/ramdisk is as expected
Test: Run `gunzip -c ramdisk | cpio -idm` for the ramdisk extracted from
$OUT/boot-debug.img and $OUT/boot.img, respectively.
Then compare the root dirs of both, e.g.,
`diff -rq --no-dereference ./ramdisk ./ramdisk-debug`
Test: `make ramdisk_debug-nodeps` and `make bootimage_debug-nodeps`
Change-Id: I30137c3caef91805d9143d404e5e4d06c0fccc30
2019-03-20 10:59:52 +01:00
e n d i f # BOARD_USES_RECOVERY_AS_BOOT
2021-04-23 05:31:32 +02:00
$(INSTALLED_DEBUG_RAMDISK_TARGET) : $( INSTALLED_FILES_FILE_DEBUG_RAMDISK )
2020-05-11 22:20:03 +02:00
$(INSTALLED_DEBUG_RAMDISK_TARGET) : $( MKBOOTFS ) $( INTERNAL_DEBUG_RAMDISK_FILES ) | $( COMPRESSION_COMMAND_DEPS )
2021-03-06 22:26:01 +01:00
$( call pretty," Target debug ramdisk: $@ " )
Adding boot-debug.img and ramdisk-debug.img
The two new debugging images adds additional files based on
boot.img and ramdisk.img/ramdisk-recovery.img, respectively.
File /force_debuggable is to trigger special logic in /init to load an
userdebug version of sepolicy and an additional property file from this
ramdisk to allow adb root, if the device is unlocked.
It's intentional to skip signing for boot-debug.img, as it can
only be used if the device is unlocked, where verification error
is allowed.
Those debugging images allows adb root on user build
system.img, vendor.img, product.img, etc. This can facilitate more
automated testings on user builds and is helpful to narrow down the
delta between what's being tested v.s. what's being shipped.
Bug: 126493225
Test: `make dist`, checks both boot-debug.img and ramdisk-debug.img
are in $OUT/ and out/dist.
Test: `make dist`, checks installed-files-ramdisk-debug.{json,txt} are
in out/dist.
Test: `system/core/mkbootimg/unpack_bootimg.py --boot_img $OUT/boot-debug.img`,
checks the extracted out/ramdisk is as expected
Test: Run `gunzip -c ramdisk | cpio -idm` for the ramdisk extracted from
$OUT/boot-debug.img and $OUT/boot.img, respectively.
Then compare the root dirs of both, e.g.,
`diff -rq --no-dereference ./ramdisk ./ramdisk-debug`
Test: `make ramdisk_debug-nodeps` and `make bootimage_debug-nodeps`
Change-Id: I30137c3caef91805d9143d404e5e4d06c0fccc30
2019-03-20 10:59:52 +01:00
mkdir -p $( TARGET_DEBUG_RAMDISK_OUT)
touch $( TARGET_DEBUG_RAMDISK_OUT) /force_debuggable
2021-04-23 05:31:32 +02:00
$( MKBOOTFS) -d $( TARGET_OUT) $( TARGET_DEBUG_RAMDISK_OUT) $( PRIVATE_ADDITIONAL_DIR) | $( COMPRESSION_COMMAND) > $@
Adding boot-debug.img and ramdisk-debug.img
The two new debugging images adds additional files based on
boot.img and ramdisk.img/ramdisk-recovery.img, respectively.
File /force_debuggable is to trigger special logic in /init to load an
userdebug version of sepolicy and an additional property file from this
ramdisk to allow adb root, if the device is unlocked.
It's intentional to skip signing for boot-debug.img, as it can
only be used if the device is unlocked, where verification error
is allowed.
Those debugging images allows adb root on user build
system.img, vendor.img, product.img, etc. This can facilitate more
automated testings on user builds and is helpful to narrow down the
delta between what's being tested v.s. what's being shipped.
Bug: 126493225
Test: `make dist`, checks both boot-debug.img and ramdisk-debug.img
are in $OUT/ and out/dist.
Test: `make dist`, checks installed-files-ramdisk-debug.{json,txt} are
in out/dist.
Test: `system/core/mkbootimg/unpack_bootimg.py --boot_img $OUT/boot-debug.img`,
checks the extracted out/ramdisk is as expected
Test: Run `gunzip -c ramdisk | cpio -idm` for the ramdisk extracted from
$OUT/boot-debug.img and $OUT/boot.img, respectively.
Then compare the root dirs of both, e.g.,
`diff -rq --no-dereference ./ramdisk ./ramdisk-debug`
Test: `make ramdisk_debug-nodeps` and `make bootimage_debug-nodeps`
Change-Id: I30137c3caef91805d9143d404e5e4d06c0fccc30
2019-03-20 10:59:52 +01:00
.PHONY : ramdisk_debug -nodeps
2021-04-23 05:31:32 +02:00
i f e q ( $( BOARD_USES_RECOVERY_AS_BOOT ) , t r u e )
ramdisk_debug-nodeps: PRIVATE_ADDITIONAL_DIR := $( TARGET_RECOVERY_ROOT_OUT)
e l s e
ramdisk_debug-nodeps: PRIVATE_ADDITIONAL_DIR := $( TARGET_RAMDISK_OUT)
e n d i f # BOARD_USES_RECOVERY_AS_BOOT
2020-05-11 22:20:03 +02:00
ramdisk_debug-nodeps : $( MKBOOTFS ) | $( COMPRESSION_COMMAND_DEPS )
Adding boot-debug.img and ramdisk-debug.img
The two new debugging images adds additional files based on
boot.img and ramdisk.img/ramdisk-recovery.img, respectively.
File /force_debuggable is to trigger special logic in /init to load an
userdebug version of sepolicy and an additional property file from this
ramdisk to allow adb root, if the device is unlocked.
It's intentional to skip signing for boot-debug.img, as it can
only be used if the device is unlocked, where verification error
is allowed.
Those debugging images allows adb root on user build
system.img, vendor.img, product.img, etc. This can facilitate more
automated testings on user builds and is helpful to narrow down the
delta between what's being tested v.s. what's being shipped.
Bug: 126493225
Test: `make dist`, checks both boot-debug.img and ramdisk-debug.img
are in $OUT/ and out/dist.
Test: `make dist`, checks installed-files-ramdisk-debug.{json,txt} are
in out/dist.
Test: `system/core/mkbootimg/unpack_bootimg.py --boot_img $OUT/boot-debug.img`,
checks the extracted out/ramdisk is as expected
Test: Run `gunzip -c ramdisk | cpio -idm` for the ramdisk extracted from
$OUT/boot-debug.img and $OUT/boot.img, respectively.
Then compare the root dirs of both, e.g.,
`diff -rq --no-dereference ./ramdisk ./ramdisk-debug`
Test: `make ramdisk_debug-nodeps` and `make bootimage_debug-nodeps`
Change-Id: I30137c3caef91805d9143d404e5e4d06c0fccc30
2019-03-20 10:59:52 +01:00
echo " make $@ : ignoring dependencies "
mkdir -p $( TARGET_DEBUG_RAMDISK_OUT)
touch $( TARGET_DEBUG_RAMDISK_OUT) /force_debuggable
2021-04-23 05:31:32 +02:00
$( MKBOOTFS) -d $( TARGET_OUT) $( TARGET_DEBUG_RAMDISK_OUT) $( PRIVATE_ADDITIONAL_DIR) | $( COMPRESSION_COMMAND) > $( INSTALLED_DEBUG_RAMDISK_TARGET)
Adding boot-debug.img and ramdisk-debug.img
The two new debugging images adds additional files based on
boot.img and ramdisk.img/ramdisk-recovery.img, respectively.
File /force_debuggable is to trigger special logic in /init to load an
userdebug version of sepolicy and an additional property file from this
ramdisk to allow adb root, if the device is unlocked.
It's intentional to skip signing for boot-debug.img, as it can
only be used if the device is unlocked, where verification error
is allowed.
Those debugging images allows adb root on user build
system.img, vendor.img, product.img, etc. This can facilitate more
automated testings on user builds and is helpful to narrow down the
delta between what's being tested v.s. what's being shipped.
Bug: 126493225
Test: `make dist`, checks both boot-debug.img and ramdisk-debug.img
are in $OUT/ and out/dist.
Test: `make dist`, checks installed-files-ramdisk-debug.{json,txt} are
in out/dist.
Test: `system/core/mkbootimg/unpack_bootimg.py --boot_img $OUT/boot-debug.img`,
checks the extracted out/ramdisk is as expected
Test: Run `gunzip -c ramdisk | cpio -idm` for the ramdisk extracted from
$OUT/boot-debug.img and $OUT/boot.img, respectively.
Then compare the root dirs of both, e.g.,
`diff -rq --no-dereference ./ramdisk ./ramdisk-debug`
Test: `make ramdisk_debug-nodeps` and `make bootimage_debug-nodeps`
Change-Id: I30137c3caef91805d9143d404e5e4d06c0fccc30
2019-03-20 10:59:52 +01:00
e n d i f # BUILDING_RAMDISK_IMAGE
# -----------------------------------------------------------------
# the boot-debug.img, which is the kernel plus ramdisk-debug.img
#
# Note: it's intentional to skip signing for boot-debug.img, because it
# can only be used if the device is unlocked with verification error.
2021-09-09 13:04:55 +02:00
i f n e q ( $( BUILDING_VENDOR_BOOT_IMAGE ) , t r u e )
2020-10-12 20:31:35 +02:00
i f n e q ( $( INSTALLED_BOOTIMAGE_TARGET ) , )
Adding boot-debug.img and ramdisk-debug.img
The two new debugging images adds additional files based on
boot.img and ramdisk.img/ramdisk-recovery.img, respectively.
File /force_debuggable is to trigger special logic in /init to load an
userdebug version of sepolicy and an additional property file from this
ramdisk to allow adb root, if the device is unlocked.
It's intentional to skip signing for boot-debug.img, as it can
only be used if the device is unlocked, where verification error
is allowed.
Those debugging images allows adb root on user build
system.img, vendor.img, product.img, etc. This can facilitate more
automated testings on user builds and is helpful to narrow down the
delta between what's being tested v.s. what's being shipped.
Bug: 126493225
Test: `make dist`, checks both boot-debug.img and ramdisk-debug.img
are in $OUT/ and out/dist.
Test: `make dist`, checks installed-files-ramdisk-debug.{json,txt} are
in out/dist.
Test: `system/core/mkbootimg/unpack_bootimg.py --boot_img $OUT/boot-debug.img`,
checks the extracted out/ramdisk is as expected
Test: Run `gunzip -c ramdisk | cpio -idm` for the ramdisk extracted from
$OUT/boot-debug.img and $OUT/boot.img, respectively.
Then compare the root dirs of both, e.g.,
`diff -rq --no-dereference ./ramdisk ./ramdisk-debug`
Test: `make ramdisk_debug-nodeps` and `make bootimage_debug-nodeps`
Change-Id: I30137c3caef91805d9143d404e5e4d06c0fccc30
2019-03-20 10:59:52 +01:00
i f n e q ( $( strip $ ( TARGET_NO_KERNEL ) ) , t r u e )
2020-03-12 00:03:07 +01:00
i f n e q ( $( strip $ ( BOARD_KERNEL_BINARIES ) ) , )
INSTALLED_DEBUG_BOOTIMAGE_TARGET := $( foreach k,$( subst kernel,boot-debug,$( BOARD_KERNEL_BINARIES) ) , \
$( PRODUCT_OUT) /$( k) .img)
e l s e
INSTALLED_DEBUG_BOOTIMAGE_TARGET := $( PRODUCT_OUT) /boot-debug.img
e n d i f
Adding boot-debug.img and ramdisk-debug.img
The two new debugging images adds additional files based on
boot.img and ramdisk.img/ramdisk-recovery.img, respectively.
File /force_debuggable is to trigger special logic in /init to load an
userdebug version of sepolicy and an additional property file from this
ramdisk to allow adb root, if the device is unlocked.
It's intentional to skip signing for boot-debug.img, as it can
only be used if the device is unlocked, where verification error
is allowed.
Those debugging images allows adb root on user build
system.img, vendor.img, product.img, etc. This can facilitate more
automated testings on user builds and is helpful to narrow down the
delta between what's being tested v.s. what's being shipped.
Bug: 126493225
Test: `make dist`, checks both boot-debug.img and ramdisk-debug.img
are in $OUT/ and out/dist.
Test: `make dist`, checks installed-files-ramdisk-debug.{json,txt} are
in out/dist.
Test: `system/core/mkbootimg/unpack_bootimg.py --boot_img $OUT/boot-debug.img`,
checks the extracted out/ramdisk is as expected
Test: Run `gunzip -c ramdisk | cpio -idm` for the ramdisk extracted from
$OUT/boot-debug.img and $OUT/boot.img, respectively.
Then compare the root dirs of both, e.g.,
`diff -rq --no-dereference ./ramdisk ./ramdisk-debug`
Test: `make ramdisk_debug-nodeps` and `make bootimage_debug-nodeps`
Change-Id: I30137c3caef91805d9143d404e5e4d06c0fccc30
2019-03-20 10:59:52 +01:00
# Replace ramdisk.img in $(MKBOOTIMG) ARGS with ramdisk-debug.img to build boot-debug.img
i f e q ( $( BOARD_USES_RECOVERY_AS_BOOT ) , t r u e )
2021-04-23 05:31:32 +02:00
INTERNAL_DEBUG_BOOTIMAGE_ARGS := $( subst $( recovery_ramdisk) ,$( INSTALLED_DEBUG_RAMDISK_TARGET) , $( INTERNAL_RECOVERYIMAGE_ARGS) )
Adding boot-debug.img and ramdisk-debug.img
The two new debugging images adds additional files based on
boot.img and ramdisk.img/ramdisk-recovery.img, respectively.
File /force_debuggable is to trigger special logic in /init to load an
userdebug version of sepolicy and an additional property file from this
ramdisk to allow adb root, if the device is unlocked.
It's intentional to skip signing for boot-debug.img, as it can
only be used if the device is unlocked, where verification error
is allowed.
Those debugging images allows adb root on user build
system.img, vendor.img, product.img, etc. This can facilitate more
automated testings on user builds and is helpful to narrow down the
delta between what's being tested v.s. what's being shipped.
Bug: 126493225
Test: `make dist`, checks both boot-debug.img and ramdisk-debug.img
are in $OUT/ and out/dist.
Test: `make dist`, checks installed-files-ramdisk-debug.{json,txt} are
in out/dist.
Test: `system/core/mkbootimg/unpack_bootimg.py --boot_img $OUT/boot-debug.img`,
checks the extracted out/ramdisk is as expected
Test: Run `gunzip -c ramdisk | cpio -idm` for the ramdisk extracted from
$OUT/boot-debug.img and $OUT/boot.img, respectively.
Then compare the root dirs of both, e.g.,
`diff -rq --no-dereference ./ramdisk ./ramdisk-debug`
Test: `make ramdisk_debug-nodeps` and `make bootimage_debug-nodeps`
Change-Id: I30137c3caef91805d9143d404e5e4d06c0fccc30
2019-03-20 10:59:52 +01:00
e l s e
2021-04-23 05:31:32 +02:00
INTERNAL_DEBUG_BOOTIMAGE_ARGS := $( subst $( INSTALLED_RAMDISK_TARGET) ,$( INSTALLED_DEBUG_RAMDISK_TARGET) , $( INTERNAL_BOOTIMAGE_ARGS) )
Adding boot-debug.img and ramdisk-debug.img
The two new debugging images adds additional files based on
boot.img and ramdisk.img/ramdisk-recovery.img, respectively.
File /force_debuggable is to trigger special logic in /init to load an
userdebug version of sepolicy and an additional property file from this
ramdisk to allow adb root, if the device is unlocked.
It's intentional to skip signing for boot-debug.img, as it can
only be used if the device is unlocked, where verification error
is allowed.
Those debugging images allows adb root on user build
system.img, vendor.img, product.img, etc. This can facilitate more
automated testings on user builds and is helpful to narrow down the
delta between what's being tested v.s. what's being shipped.
Bug: 126493225
Test: `make dist`, checks both boot-debug.img and ramdisk-debug.img
are in $OUT/ and out/dist.
Test: `make dist`, checks installed-files-ramdisk-debug.{json,txt} are
in out/dist.
Test: `system/core/mkbootimg/unpack_bootimg.py --boot_img $OUT/boot-debug.img`,
checks the extracted out/ramdisk is as expected
Test: Run `gunzip -c ramdisk | cpio -idm` for the ramdisk extracted from
$OUT/boot-debug.img and $OUT/boot.img, respectively.
Then compare the root dirs of both, e.g.,
`diff -rq --no-dereference ./ramdisk ./ramdisk-debug`
Test: `make ramdisk_debug-nodeps` and `make bootimage_debug-nodeps`
Change-Id: I30137c3caef91805d9143d404e5e4d06c0fccc30
2019-03-20 10:59:52 +01:00
e n d i f
2019-05-03 10:38:34 +02:00
# If boot.img is chained but boot-debug.img is not signed, libavb in bootloader
# will fail to find valid AVB metadata from the end of /boot, thus stop booting.
# Using a test key to sign boot-debug.img to continue booting with the mismatched
# public key, if the device is unlocked.
i f n e q ( $( BOARD_AVB_BOOT_KEY_PATH ) , )
Adding boot-test-harness.img
In commit I30137c3caef91805d9143d404e5e4d06c0fccc30, we added
a boot-debug.img to allow adb root when using an user build GSI image.
However, to run automated tests, it requires additional properties,
which are not needed for GSI compliance:
ro.audio.silent=1
ro.test_harness=1
This CL adds an additional boot-test-harness.img for automated tests,
and keeps the original boot-debug.img for GSI compliance.
Note: boot-test-harness.img won't be built by default, it needs
explicit `make bootimage_test_harness`.
Bug: 140036184
Test: `m bootimage_test_harness`, flashes boot-test-harness.img and checks
adb root works and test harness props are set.
Test: `m bootimage_test_harness dist -j32`, checks both
boot-test-harness.img and ramdisk-test-harness.img are under ./out/dist/.
Test: `system/tools/mkbootimg/unpack_bootimg.py --boot_img $OUT/boot-test-harness.img --out ramdisk-test-harness`,
checks the extracted out/ramdisk is as expected
Test: Run `gunzip -c ramdisk | cpio -idm` for the ramdisk extracted from
$OUT/boot-test-harness.img and $OUT/boot-debug.img, respectively.
Then compare the root dirs of both, e.g.,
`diff -rq --no-dereference ./ramdisk-test-harness ./ramdisk-debug`
Test: `m ramdisk_test_harness-nodeps` and `m bootimage_test_harness-nodeps`
Change-Id: Iadea0b5c933c3b7fa10dcf3d9e85596916b3333d
2019-10-08 04:22:19 +02:00
$(INSTALLED_DEBUG_BOOTIMAGE_TARGET) : $( AVBTOOL ) $( BOARD_AVB_BOOT_TEST_KEY_PATH )
e n d i f
BOARD_AVB_BOOT_TEST_KEY_PATH := external/avb/test/data/testkey_rsa2048.pem
INTERNAL_AVB_BOOT_TEST_SIGNING_ARGS := --algorithm SHA256_RSA2048 --key $( BOARD_AVB_BOOT_TEST_KEY_PATH)
# $(1): the bootimage to sign
2021-03-04 07:41:16 +01:00
# $(2): boot image variant (boot, boot-debug, boot-test-harness)
Adding boot-test-harness.img
In commit I30137c3caef91805d9143d404e5e4d06c0fccc30, we added
a boot-debug.img to allow adb root when using an user build GSI image.
However, to run automated tests, it requires additional properties,
which are not needed for GSI compliance:
ro.audio.silent=1
ro.test_harness=1
This CL adds an additional boot-test-harness.img for automated tests,
and keeps the original boot-debug.img for GSI compliance.
Note: boot-test-harness.img won't be built by default, it needs
explicit `make bootimage_test_harness`.
Bug: 140036184
Test: `m bootimage_test_harness`, flashes boot-test-harness.img and checks
adb root works and test harness props are set.
Test: `m bootimage_test_harness dist -j32`, checks both
boot-test-harness.img and ramdisk-test-harness.img are under ./out/dist/.
Test: `system/tools/mkbootimg/unpack_bootimg.py --boot_img $OUT/boot-test-harness.img --out ramdisk-test-harness`,
checks the extracted out/ramdisk is as expected
Test: Run `gunzip -c ramdisk | cpio -idm` for the ramdisk extracted from
$OUT/boot-test-harness.img and $OUT/boot-debug.img, respectively.
Then compare the root dirs of both, e.g.,
`diff -rq --no-dereference ./ramdisk-test-harness ./ramdisk-debug`
Test: `m ramdisk_test_harness-nodeps` and `m bootimage_test_harness-nodeps`
Change-Id: Iadea0b5c933c3b7fa10dcf3d9e85596916b3333d
2019-10-08 04:22:19 +02:00
d e f i n e t e s t - k e y - s i g n - b o o t i m a g e
2021-03-04 07:41:16 +01:00
$( call assert -max -image -size ,$ ( 1) ,$ ( call get -hash -image -max -size ,$ ( call get -bootimage -partition -size ,$ ( 1) ,$ ( 2) ) ) )
Adding boot-test-harness.img
In commit I30137c3caef91805d9143d404e5e4d06c0fccc30, we added
a boot-debug.img to allow adb root when using an user build GSI image.
However, to run automated tests, it requires additional properties,
which are not needed for GSI compliance:
ro.audio.silent=1
ro.test_harness=1
This CL adds an additional boot-test-harness.img for automated tests,
and keeps the original boot-debug.img for GSI compliance.
Note: boot-test-harness.img won't be built by default, it needs
explicit `make bootimage_test_harness`.
Bug: 140036184
Test: `m bootimage_test_harness`, flashes boot-test-harness.img and checks
adb root works and test harness props are set.
Test: `m bootimage_test_harness dist -j32`, checks both
boot-test-harness.img and ramdisk-test-harness.img are under ./out/dist/.
Test: `system/tools/mkbootimg/unpack_bootimg.py --boot_img $OUT/boot-test-harness.img --out ramdisk-test-harness`,
checks the extracted out/ramdisk is as expected
Test: Run `gunzip -c ramdisk | cpio -idm` for the ramdisk extracted from
$OUT/boot-test-harness.img and $OUT/boot-debug.img, respectively.
Then compare the root dirs of both, e.g.,
`diff -rq --no-dereference ./ramdisk-test-harness ./ramdisk-debug`
Test: `m ramdisk_test_harness-nodeps` and `m bootimage_test_harness-nodeps`
Change-Id: Iadea0b5c933c3b7fa10dcf3d9e85596916b3333d
2019-10-08 04:22:19 +02:00
$( AVBTOOL ) a d d _ h a s h _ f o o t e r \
--image $( 1) \
2021-03-04 07:41:16 +01:00
--partition_size $( call get-bootimage-partition-size,$( 1) ,$( 2) ) \
Adding boot-test-harness.img
In commit I30137c3caef91805d9143d404e5e4d06c0fccc30, we added
a boot-debug.img to allow adb root when using an user build GSI image.
However, to run automated tests, it requires additional properties,
which are not needed for GSI compliance:
ro.audio.silent=1
ro.test_harness=1
This CL adds an additional boot-test-harness.img for automated tests,
and keeps the original boot-debug.img for GSI compliance.
Note: boot-test-harness.img won't be built by default, it needs
explicit `make bootimage_test_harness`.
Bug: 140036184
Test: `m bootimage_test_harness`, flashes boot-test-harness.img and checks
adb root works and test harness props are set.
Test: `m bootimage_test_harness dist -j32`, checks both
boot-test-harness.img and ramdisk-test-harness.img are under ./out/dist/.
Test: `system/tools/mkbootimg/unpack_bootimg.py --boot_img $OUT/boot-test-harness.img --out ramdisk-test-harness`,
checks the extracted out/ramdisk is as expected
Test: Run `gunzip -c ramdisk | cpio -idm` for the ramdisk extracted from
$OUT/boot-test-harness.img and $OUT/boot-debug.img, respectively.
Then compare the root dirs of both, e.g.,
`diff -rq --no-dereference ./ramdisk-test-harness ./ramdisk-debug`
Test: `m ramdisk_test_harness-nodeps` and `m bootimage_test_harness-nodeps`
Change-Id: Iadea0b5c933c3b7fa10dcf3d9e85596916b3333d
2019-10-08 04:22:19 +02:00
--partition_name boot $( INTERNAL_AVB_BOOT_TEST_SIGNING_ARGS) \
$( BOARD_AVB_BOOT_ADD_HASH_FOOTER_ARGS)
2021-03-04 07:41:16 +01:00
$( call assert -max -image -size ,$ ( 1) ,$ ( call get -bootimage -partition -size ,$ ( 1) ,$ ( 2) ) )
Adding boot-test-harness.img
In commit I30137c3caef91805d9143d404e5e4d06c0fccc30, we added
a boot-debug.img to allow adb root when using an user build GSI image.
However, to run automated tests, it requires additional properties,
which are not needed for GSI compliance:
ro.audio.silent=1
ro.test_harness=1
This CL adds an additional boot-test-harness.img for automated tests,
and keeps the original boot-debug.img for GSI compliance.
Note: boot-test-harness.img won't be built by default, it needs
explicit `make bootimage_test_harness`.
Bug: 140036184
Test: `m bootimage_test_harness`, flashes boot-test-harness.img and checks
adb root works and test harness props are set.
Test: `m bootimage_test_harness dist -j32`, checks both
boot-test-harness.img and ramdisk-test-harness.img are under ./out/dist/.
Test: `system/tools/mkbootimg/unpack_bootimg.py --boot_img $OUT/boot-test-harness.img --out ramdisk-test-harness`,
checks the extracted out/ramdisk is as expected
Test: Run `gunzip -c ramdisk | cpio -idm` for the ramdisk extracted from
$OUT/boot-test-harness.img and $OUT/boot-debug.img, respectively.
Then compare the root dirs of both, e.g.,
`diff -rq --no-dereference ./ramdisk-test-harness ./ramdisk-debug`
Test: `m ramdisk_test_harness-nodeps` and `m bootimage_test_harness-nodeps`
Change-Id: Iadea0b5c933c3b7fa10dcf3d9e85596916b3333d
2019-10-08 04:22:19 +02:00
e n d e f
2019-05-03 10:38:34 +02:00
2020-03-12 00:03:07 +01:00
# $(1): output file
d e f i n e b u i l d - d e b u g - b o o t i m a g e - t a r g e t
$( MKBOOTIMG) --kernel $( PRODUCT_OUT) /$( subst .img,,$( subst boot-debug,kernel,$( notdir $( 1) ) ) ) \
2021-03-12 14:40:32 +01:00
$( INTERNAL_DEBUG_BOOTIMAGE_ARGS) $( INTERNAL_MKBOOTIMG_VERSION_ARGS) \
$( INTERNAL_MKBOOTIMG_GKI_SINGING_ARGS) $( BOARD_MKBOOTIMG_ARGS) --output $1
2021-03-04 07:41:16 +01:00
$( if $( BOARD_AVB_BOOT_KEY_PATH) ,$( call test-key-sign-bootimage,$1 ,boot-debug) )
2020-03-12 00:03:07 +01:00
e n d e f
Adding boot-debug.img and ramdisk-debug.img
The two new debugging images adds additional files based on
boot.img and ramdisk.img/ramdisk-recovery.img, respectively.
File /force_debuggable is to trigger special logic in /init to load an
userdebug version of sepolicy and an additional property file from this
ramdisk to allow adb root, if the device is unlocked.
It's intentional to skip signing for boot-debug.img, as it can
only be used if the device is unlocked, where verification error
is allowed.
Those debugging images allows adb root on user build
system.img, vendor.img, product.img, etc. This can facilitate more
automated testings on user builds and is helpful to narrow down the
delta between what's being tested v.s. what's being shipped.
Bug: 126493225
Test: `make dist`, checks both boot-debug.img and ramdisk-debug.img
are in $OUT/ and out/dist.
Test: `make dist`, checks installed-files-ramdisk-debug.{json,txt} are
in out/dist.
Test: `system/core/mkbootimg/unpack_bootimg.py --boot_img $OUT/boot-debug.img`,
checks the extracted out/ramdisk is as expected
Test: Run `gunzip -c ramdisk | cpio -idm` for the ramdisk extracted from
$OUT/boot-debug.img and $OUT/boot.img, respectively.
Then compare the root dirs of both, e.g.,
`diff -rq --no-dereference ./ramdisk ./ramdisk-debug`
Test: `make ramdisk_debug-nodeps` and `make bootimage_debug-nodeps`
Change-Id: I30137c3caef91805d9143d404e5e4d06c0fccc30
2019-03-20 10:59:52 +01:00
# Depends on original boot.img and ramdisk-debug.img, to build the new boot-debug.img
2021-03-12 14:40:32 +01:00
$(INSTALLED_DEBUG_BOOTIMAGE_TARGET) : $( MKBOOTIMG ) $( INSTALLED_BOOTIMAGE_TARGET ) $( INSTALLED_DEBUG_RAMDISK_TARGET ) $( BOARD_GKI_SIGNING_KEY_PATH ) $( AVBTOOL )
Adding boot-debug.img and ramdisk-debug.img
The two new debugging images adds additional files based on
boot.img and ramdisk.img/ramdisk-recovery.img, respectively.
File /force_debuggable is to trigger special logic in /init to load an
userdebug version of sepolicy and an additional property file from this
ramdisk to allow adb root, if the device is unlocked.
It's intentional to skip signing for boot-debug.img, as it can
only be used if the device is unlocked, where verification error
is allowed.
Those debugging images allows adb root on user build
system.img, vendor.img, product.img, etc. This can facilitate more
automated testings on user builds and is helpful to narrow down the
delta between what's being tested v.s. what's being shipped.
Bug: 126493225
Test: `make dist`, checks both boot-debug.img and ramdisk-debug.img
are in $OUT/ and out/dist.
Test: `make dist`, checks installed-files-ramdisk-debug.{json,txt} are
in out/dist.
Test: `system/core/mkbootimg/unpack_bootimg.py --boot_img $OUT/boot-debug.img`,
checks the extracted out/ramdisk is as expected
Test: Run `gunzip -c ramdisk | cpio -idm` for the ramdisk extracted from
$OUT/boot-debug.img and $OUT/boot.img, respectively.
Then compare the root dirs of both, e.g.,
`diff -rq --no-dereference ./ramdisk ./ramdisk-debug`
Test: `make ramdisk_debug-nodeps` and `make bootimage_debug-nodeps`
Change-Id: I30137c3caef91805d9143d404e5e4d06c0fccc30
2019-03-20 10:59:52 +01:00
$( call pretty," Target boot debug image: $@ " )
2020-03-12 00:03:07 +01:00
$( call build-debug-bootimage-target, $@ )
Adding boot-debug.img and ramdisk-debug.img
The two new debugging images adds additional files based on
boot.img and ramdisk.img/ramdisk-recovery.img, respectively.
File /force_debuggable is to trigger special logic in /init to load an
userdebug version of sepolicy and an additional property file from this
ramdisk to allow adb root, if the device is unlocked.
It's intentional to skip signing for boot-debug.img, as it can
only be used if the device is unlocked, where verification error
is allowed.
Those debugging images allows adb root on user build
system.img, vendor.img, product.img, etc. This can facilitate more
automated testings on user builds and is helpful to narrow down the
delta between what's being tested v.s. what's being shipped.
Bug: 126493225
Test: `make dist`, checks both boot-debug.img and ramdisk-debug.img
are in $OUT/ and out/dist.
Test: `make dist`, checks installed-files-ramdisk-debug.{json,txt} are
in out/dist.
Test: `system/core/mkbootimg/unpack_bootimg.py --boot_img $OUT/boot-debug.img`,
checks the extracted out/ramdisk is as expected
Test: Run `gunzip -c ramdisk | cpio -idm` for the ramdisk extracted from
$OUT/boot-debug.img and $OUT/boot.img, respectively.
Then compare the root dirs of both, e.g.,
`diff -rq --no-dereference ./ramdisk ./ramdisk-debug`
Test: `make ramdisk_debug-nodeps` and `make bootimage_debug-nodeps`
Change-Id: I30137c3caef91805d9143d404e5e4d06c0fccc30
2019-03-20 10:59:52 +01:00
.PHONY : bootimage_debug -nodeps
2021-03-12 14:40:32 +01:00
bootimage_debug-nodeps : $( MKBOOTIMG ) $( BOARD_GKI_SIGNING_KEY_PATH ) $( AVBTOOL )
Adding boot-debug.img and ramdisk-debug.img
The two new debugging images adds additional files based on
boot.img and ramdisk.img/ramdisk-recovery.img, respectively.
File /force_debuggable is to trigger special logic in /init to load an
userdebug version of sepolicy and an additional property file from this
ramdisk to allow adb root, if the device is unlocked.
It's intentional to skip signing for boot-debug.img, as it can
only be used if the device is unlocked, where verification error
is allowed.
Those debugging images allows adb root on user build
system.img, vendor.img, product.img, etc. This can facilitate more
automated testings on user builds and is helpful to narrow down the
delta between what's being tested v.s. what's being shipped.
Bug: 126493225
Test: `make dist`, checks both boot-debug.img and ramdisk-debug.img
are in $OUT/ and out/dist.
Test: `make dist`, checks installed-files-ramdisk-debug.{json,txt} are
in out/dist.
Test: `system/core/mkbootimg/unpack_bootimg.py --boot_img $OUT/boot-debug.img`,
checks the extracted out/ramdisk is as expected
Test: Run `gunzip -c ramdisk | cpio -idm` for the ramdisk extracted from
$OUT/boot-debug.img and $OUT/boot.img, respectively.
Then compare the root dirs of both, e.g.,
`diff -rq --no-dereference ./ramdisk ./ramdisk-debug`
Test: `make ramdisk_debug-nodeps` and `make bootimage_debug-nodeps`
Change-Id: I30137c3caef91805d9143d404e5e4d06c0fccc30
2019-03-20 10:59:52 +01:00
echo " make $@ : ignoring dependencies "
2020-03-12 00:03:07 +01:00
$( foreach b,$( INSTALLED_DEBUG_BOOTIMAGE_TARGET) ,$( call build-debug-bootimage-target,$b ) )
Adding boot-test-harness.img
In commit I30137c3caef91805d9143d404e5e4d06c0fccc30, we added
a boot-debug.img to allow adb root when using an user build GSI image.
However, to run automated tests, it requires additional properties,
which are not needed for GSI compliance:
ro.audio.silent=1
ro.test_harness=1
This CL adds an additional boot-test-harness.img for automated tests,
and keeps the original boot-debug.img for GSI compliance.
Note: boot-test-harness.img won't be built by default, it needs
explicit `make bootimage_test_harness`.
Bug: 140036184
Test: `m bootimage_test_harness`, flashes boot-test-harness.img and checks
adb root works and test harness props are set.
Test: `m bootimage_test_harness dist -j32`, checks both
boot-test-harness.img and ramdisk-test-harness.img are under ./out/dist/.
Test: `system/tools/mkbootimg/unpack_bootimg.py --boot_img $OUT/boot-test-harness.img --out ramdisk-test-harness`,
checks the extracted out/ramdisk is as expected
Test: Run `gunzip -c ramdisk | cpio -idm` for the ramdisk extracted from
$OUT/boot-test-harness.img and $OUT/boot-debug.img, respectively.
Then compare the root dirs of both, e.g.,
`diff -rq --no-dereference ./ramdisk-test-harness ./ramdisk-debug`
Test: `m ramdisk_test_harness-nodeps` and `m bootimage_test_harness-nodeps`
Change-Id: Iadea0b5c933c3b7fa10dcf3d9e85596916b3333d
2019-10-08 04:22:19 +02:00
e n d i f # TARGET_NO_KERNEL
2020-10-12 20:31:35 +02:00
e n d i f # INSTALLED_BOOTIMAGE_TARGET
2021-09-09 13:04:55 +02:00
e n d i f # BUILDING_VENDOR_BOOT_IMAGE is not true
Adding boot-test-harness.img
In commit I30137c3caef91805d9143d404e5e4d06c0fccc30, we added
a boot-debug.img to allow adb root when using an user build GSI image.
However, to run automated tests, it requires additional properties,
which are not needed for GSI compliance:
ro.audio.silent=1
ro.test_harness=1
This CL adds an additional boot-test-harness.img for automated tests,
and keeps the original boot-debug.img for GSI compliance.
Note: boot-test-harness.img won't be built by default, it needs
explicit `make bootimage_test_harness`.
Bug: 140036184
Test: `m bootimage_test_harness`, flashes boot-test-harness.img and checks
adb root works and test harness props are set.
Test: `m bootimage_test_harness dist -j32`, checks both
boot-test-harness.img and ramdisk-test-harness.img are under ./out/dist/.
Test: `system/tools/mkbootimg/unpack_bootimg.py --boot_img $OUT/boot-test-harness.img --out ramdisk-test-harness`,
checks the extracted out/ramdisk is as expected
Test: Run `gunzip -c ramdisk | cpio -idm` for the ramdisk extracted from
$OUT/boot-test-harness.img and $OUT/boot-debug.img, respectively.
Then compare the root dirs of both, e.g.,
`diff -rq --no-dereference ./ramdisk-test-harness ./ramdisk-debug`
Test: `m ramdisk_test_harness-nodeps` and `m bootimage_test_harness-nodeps`
Change-Id: Iadea0b5c933c3b7fa10dcf3d9e85596916b3333d
2019-10-08 04:22:19 +02:00
2020-02-14 12:00:15 +01:00
i f e q ( $( BUILDING_VENDOR_BOOT_IMAGE ) , t r u e )
i f e q ( $( BUILDING_RAMDISK_IMAGE ) , t r u e )
# -----------------------------------------------------------------
# vendor debug ramdisk
# Combines vendor ramdisk files and debug ramdisk files to build the vendor debug ramdisk.
2021-04-23 05:31:32 +02:00
#
INTERNAL_VENDOR_DEBUG_RAMDISK_FILES := $( filter $( TARGET_VENDOR_DEBUG_RAMDISK_OUT) /%, \
$( ALL_GENERATED_SOURCES) \
$( ALL_DEFAULT_INSTALLED_MODULES) )
INSTALLED_FILES_FILE_VENDOR_DEBUG_RAMDISK := $( PRODUCT_OUT) /installed-files-vendor-ramdisk-debug.txt
INSTALLED_FILES_JSON_VENDOR_DEBUG_RAMDISK := $( INSTALLED_FILES_FILE_VENDOR_DEBUG_RAMDISK:.txt= .json)
$(INSTALLED_FILES_FILE_VENDOR_DEBUG_RAMDISK) : .KATI_IMPLICIT_OUTPUTS := $( INSTALLED_FILES_JSON_VENDOR_DEBUG_RAMDISK )
$(INSTALLED_FILES_FILE_VENDOR_DEBUG_RAMDISK) : $( INTERNAL_VENDOR_RAMDISK_TARGET ) $( INSTALLED_DEBUG_RAMDISK_TARGET )
$(INSTALLED_FILES_FILE_VENDOR_DEBUG_RAMDISK) : $( INTERNAL_VENDOR_DEBUG_RAMDISK_FILES ) $( FILESLIST ) $( FILESLIST_UTIL )
@echo Installed file list: $@
mkdir -p $( dir $@ )
rm -f $@
mkdir -p $( TARGET_VENDOR_DEBUG_RAMDISK_OUT) # The dir might not be created if no modules are installed here.
$( FILESLIST) $( TARGET_VENDOR_RAMDISK_OUT) $( TARGET_DEBUG_RAMDISK_OUT) $( TARGET_VENDOR_DEBUG_RAMDISK_OUT) > $( @:.txt= .json)
$( FILESLIST_UTIL) -c $( @:.txt= .json) > $@
2021-03-06 09:45:53 +01:00
INTERNAL_VENDOR_DEBUG_RAMDISK_TARGET := $( call intermediates-dir-for,PACKAGING,vendor_boot-debug) /vendor_ramdisk-debug.cpio$( RAMDISK_EXT)
2020-02-14 12:00:15 +01:00
2021-04-04 10:12:25 +02:00
# Exclude recovery files in the default vendor ramdisk if including a standalone
# recovery ramdisk in vendor_boot.
2021-01-19 06:55:42 +01:00
i f e q ( t r u e , $( BOARD_MOVE_RECOVERY_RESOURCES_TO_VENDOR_BOOT ) )
2021-04-04 10:12:25 +02:00
i f n e q ( t r u e , $( BOARD_INCLUDE_RECOVERY_RAMDISK_IN_VENDOR_BOOT ) )
$(INTERNAL_VENDOR_DEBUG_RAMDISK_TARGET) : $( INTERNAL_RECOVERY_RAMDISK_FILES_TIMESTAMP )
2021-01-20 09:29:49 +01:00
$(INTERNAL_VENDOR_DEBUG_RAMDISK_TARGET) : PRIVATE_ADDITIONAL_DIR := $( TARGET_RECOVERY_ROOT_OUT )
2021-01-19 06:55:42 +01:00
e n d i f
2021-04-04 10:12:25 +02:00
e n d i f
2021-01-19 06:55:42 +01:00
2021-04-23 05:31:32 +02:00
# The vendor debug ramdisk combines vendor ramdisk and debug ramdisk.
2021-01-20 09:29:49 +01:00
$(INTERNAL_VENDOR_DEBUG_RAMDISK_TARGET) : $( INTERNAL_VENDOR_RAMDISK_TARGET ) $( INSTALLED_DEBUG_RAMDISK_TARGET )
2021-04-23 05:31:32 +02:00
$(INTERNAL_VENDOR_DEBUG_RAMDISK_TARGET) : $( INSTALLED_FILES_FILE_VENDOR_DEBUG_RAMDISK )
2021-01-20 09:29:49 +01:00
$(INTERNAL_VENDOR_DEBUG_RAMDISK_TARGET) : $( MKBOOTFS ) $( INTERNAL_VENDOR_DEBUG_RAMDISK_FILES ) | $( COMPRESSION_COMMAND_DEPS )
2020-02-14 12:00:15 +01:00
mkdir -p $( TARGET_VENDOR_DEBUG_RAMDISK_OUT)
2021-04-23 05:31:32 +02:00
$( MKBOOTFS) -d $( TARGET_OUT) $( TARGET_VENDOR_RAMDISK_OUT) $( TARGET_DEBUG_RAMDISK_OUT) $( TARGET_VENDOR_DEBUG_RAMDISK_OUT) $( PRIVATE_ADDITIONAL_DIR) | $( COMPRESSION_COMMAND) > $@
2020-02-14 12:00:15 +01:00
2021-03-10 21:38:15 +01:00
i f e q ( t r u e , $( BOARD_BUILD_VENDOR_RAMDISK_IMAGE ) )
INSTALLED_VENDOR_DEBUG_RAMDISK_TARGET := $( PRODUCT_OUT) /vendor_ramdisk-debug.img
$(INSTALLED_VENDOR_DEBUG_RAMDISK_TARGET) : $( INTERNAL_VENDOR_DEBUG_RAMDISK_TARGET )
$( call pretty," Target vendor debug ramdisk: $@ " )
$( copy-file-to-target)
e n d i f
2020-02-14 12:00:15 +01:00
# -----------------------------------------------------------------
# vendor_boot-debug.img.
INSTALLED_VENDOR_DEBUG_BOOTIMAGE_TARGET := $( PRODUCT_OUT) /vendor_boot-debug.img
# The util to sign vendor_boot-debug.img with a test key.
BOARD_AVB_VENDOR_BOOT_TEST_KEY_PATH := external/avb/test/data/testkey_rsa2048.pem
INTERNAL_AVB_VENDOR_BOOT_TEST_SIGNING_ARGS := --algorithm SHA256_RSA2048 --key $( BOARD_AVB_VENDOR_BOOT_TEST_KEY_PATH)
# $(1): the vendor bootimage to sign
d e f i n e t e s t - k e y - s i g n - v e n d o r - b o o t i m a g e
$( call assert -max -image -size ,$ ( 1) ,$ ( call get -hash -image -max -size ,$ ( BOARD_VENDOR_BOOTIMAGE_PARTITION_SIZE ) ) )
$( AVBTOOL ) a d d _ h a s h _ f o o t e r \
--image $( 1) \
--partition_size $( BOARD_VENDOR_BOOTIMAGE_PARTITION_SIZE) \
--partition_name vendor_boot $( INTERNAL_AVB_VENDOR_BOOT_TEST_SIGNING_ARGS) \
$( BOARD_AVB_VENDOR_BOOT_ADD_HASH_FOOTER_ARGS)
$( call assert -max -image -size ,$ ( 1) ,$ ( BOARD_VENDOR_BOOTIMAGE_PARTITION_SIZE ) )
e n d e f
i f n e q ( $( BOARD_AVB_VENDOR_BOOT_KEY_PATH ) , )
$(INSTALLED_VENDOR_DEBUG_BOOTIMAGE_TARGET) : $( AVBTOOL ) $( BOARD_AVB_VENDOR_BOOT_TEST_KEY_PATH )
e n d i f
# Depends on vendor_boot.img and vendor-ramdisk-debug.cpio.gz to build the new vendor_boot-debug.img
2021-01-20 09:29:49 +01:00
$(INSTALLED_VENDOR_DEBUG_BOOTIMAGE_TARGET) : $( MKBOOTIMG ) $( INSTALLED_VENDOR_BOOTIMAGE_TARGET ) $( INTERNAL_VENDOR_DEBUG_RAMDISK_TARGET )
2020-12-10 11:42:47 +01:00
$(INSTALLED_VENDOR_DEBUG_BOOTIMAGE_TARGET) : $( INTERNAL_VENDOR_RAMDISK_FRAGMENT_TARGETS )
2020-02-14 12:00:15 +01:00
$( call pretty," Target vendor_boot debug image: $@ " )
2021-01-20 09:29:49 +01:00
$( MKBOOTIMG) $( INTERNAL_VENDOR_BOOTIMAGE_ARGS) $( BOARD_MKBOOTIMG_ARGS) --vendor_ramdisk $( INTERNAL_VENDOR_DEBUG_RAMDISK_TARGET) $( INTERNAL_VENDOR_RAMDISK_FRAGMENT_ARGS) --vendor_boot $@
2020-02-14 12:00:15 +01:00
$( call assert-max-image-size,$@ ,$( BOARD_VENDOR_BOOTIMAGE_PARTITION_SIZE) )
$( if $( BOARD_AVB_VENDOR_BOOT_KEY_PATH) ,$( call test-key-sign-vendor-bootimage,$@ ) )
e n d i f # BUILDING_RAMDISK_IMAGE
e n d i f # BUILDING_VENDOR_BOOT_IMAGE
Adding boot-test-harness.img
In commit I30137c3caef91805d9143d404e5e4d06c0fccc30, we added
a boot-debug.img to allow adb root when using an user build GSI image.
However, to run automated tests, it requires additional properties,
which are not needed for GSI compliance:
ro.audio.silent=1
ro.test_harness=1
This CL adds an additional boot-test-harness.img for automated tests,
and keeps the original boot-debug.img for GSI compliance.
Note: boot-test-harness.img won't be built by default, it needs
explicit `make bootimage_test_harness`.
Bug: 140036184
Test: `m bootimage_test_harness`, flashes boot-test-harness.img and checks
adb root works and test harness props are set.
Test: `m bootimage_test_harness dist -j32`, checks both
boot-test-harness.img and ramdisk-test-harness.img are under ./out/dist/.
Test: `system/tools/mkbootimg/unpack_bootimg.py --boot_img $OUT/boot-test-harness.img --out ramdisk-test-harness`,
checks the extracted out/ramdisk is as expected
Test: Run `gunzip -c ramdisk | cpio -idm` for the ramdisk extracted from
$OUT/boot-test-harness.img and $OUT/boot-debug.img, respectively.
Then compare the root dirs of both, e.g.,
`diff -rq --no-dereference ./ramdisk-test-harness ./ramdisk-debug`
Test: `m ramdisk_test_harness-nodeps` and `m bootimage_test_harness-nodeps`
Change-Id: Iadea0b5c933c3b7fa10dcf3d9e85596916b3333d
2019-10-08 04:22:19 +02:00
# -----------------------------------------------------------------
# The test harness ramdisk, which is based off debug_ramdisk, plus a
# few additional test-harness-specific properties in adb_debug.prop.
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
BUILT_TEST_HARNESS_RAMDISK_TARGET := $( PRODUCT_OUT) /ramdisk-test-harness.img
INSTALLED_TEST_HARNESS_RAMDISK_TARGET := $( BUILT_TEST_HARNESS_RAMDISK_TARGET)
2021-04-23 05:31:32 +02:00
# Appends a few test harness specific properties into the adb_debug.prop.
Adding boot-test-harness.img
In commit I30137c3caef91805d9143d404e5e4d06c0fccc30, we added
a boot-debug.img to allow adb root when using an user build GSI image.
However, to run automated tests, it requires additional properties,
which are not needed for GSI compliance:
ro.audio.silent=1
ro.test_harness=1
This CL adds an additional boot-test-harness.img for automated tests,
and keeps the original boot-debug.img for GSI compliance.
Note: boot-test-harness.img won't be built by default, it needs
explicit `make bootimage_test_harness`.
Bug: 140036184
Test: `m bootimage_test_harness`, flashes boot-test-harness.img and checks
adb root works and test harness props are set.
Test: `m bootimage_test_harness dist -j32`, checks both
boot-test-harness.img and ramdisk-test-harness.img are under ./out/dist/.
Test: `system/tools/mkbootimg/unpack_bootimg.py --boot_img $OUT/boot-test-harness.img --out ramdisk-test-harness`,
checks the extracted out/ramdisk is as expected
Test: Run `gunzip -c ramdisk | cpio -idm` for the ramdisk extracted from
$OUT/boot-test-harness.img and $OUT/boot-debug.img, respectively.
Then compare the root dirs of both, e.g.,
`diff -rq --no-dereference ./ramdisk-test-harness ./ramdisk-debug`
Test: `m ramdisk_test_harness-nodeps` and `m bootimage_test_harness-nodeps`
Change-Id: Iadea0b5c933c3b7fa10dcf3d9e85596916b3333d
2019-10-08 04:22:19 +02:00
TEST_HARNESS_PROP_TARGET := $( TARGET_TEST_HARNESS_RAMDISK_OUT) /adb_debug.prop
ADDITIONAL_TEST_HARNESS_PROPERTIES := ro.audio.silent= 1
ADDITIONAL_TEST_HARNESS_PROPERTIES += ro.test_harness= 1
# $(1): a list of key=value pairs for additional property assignments
# $(2): the target .prop file to append the properties from $(1)
d e f i n e a p p e n d - t e s t - h a r n e s s - p r o p s
echo "#" >> $( 2) ; \
echo "# ADDITIONAL TEST HARNESS_PROPERTIES" >> $( 2) ; \
echo "#" >> $( 2) ;
$( foreach line,$( 1) , echo " $( line) " >> $( 2) ; )
e n d e f
2021-04-23 05:31:32 +02:00
INTERNAL_TEST_HARNESS_RAMDISK_FILES := $( filter $( TARGET_TEST_HARNESS_RAMDISK_OUT) /%, \
$( ALL_GENERATED_SOURCES) \
$( ALL_DEFAULT_INSTALLED_MODULES) )
# ramdisk-test-harness.img will merge the content from either ramdisk.img or
# ramdisk-recovery.img, depending on whether BOARD_USES_RECOVERY_AS_BOOT is set
# or not.
i f e q ( $( BOARD_USES_RECOVERY_AS_BOOT ) , t r u e )
$( INSTALLED_TEST_HARNESS_RAMDISK_TARGET) : PRIVATE_ADDITIONAL_DIR := $( TARGET_RECOVERY_ROOT_OUT)
$( INSTALLED_TEST_HARNESS_RAMDISK_TARGET) : $( recovery_ramdisk)
e l s e
$( INSTALLED_TEST_HARNESS_RAMDISK_TARGET) : PRIVATE_ADDITIONAL_DIR := $( TARGET_RAMDISK_OUT)
$( INSTALLED_TEST_HARNESS_RAMDISK_TARGET) : $( INSTALLED_RAMDISK_TARGET)
e n d i f # BOARD_USES_RECOVERY_AS_BOOT
# The test harness ramdisk will rsync the files from the debug ramdisk, then appends some props.
Adding boot-test-harness.img
In commit I30137c3caef91805d9143d404e5e4d06c0fccc30, we added
a boot-debug.img to allow adb root when using an user build GSI image.
However, to run automated tests, it requires additional properties,
which are not needed for GSI compliance:
ro.audio.silent=1
ro.test_harness=1
This CL adds an additional boot-test-harness.img for automated tests,
and keeps the original boot-debug.img for GSI compliance.
Note: boot-test-harness.img won't be built by default, it needs
explicit `make bootimage_test_harness`.
Bug: 140036184
Test: `m bootimage_test_harness`, flashes boot-test-harness.img and checks
adb root works and test harness props are set.
Test: `m bootimage_test_harness dist -j32`, checks both
boot-test-harness.img and ramdisk-test-harness.img are under ./out/dist/.
Test: `system/tools/mkbootimg/unpack_bootimg.py --boot_img $OUT/boot-test-harness.img --out ramdisk-test-harness`,
checks the extracted out/ramdisk is as expected
Test: Run `gunzip -c ramdisk | cpio -idm` for the ramdisk extracted from
$OUT/boot-test-harness.img and $OUT/boot-debug.img, respectively.
Then compare the root dirs of both, e.g.,
`diff -rq --no-dereference ./ramdisk-test-harness ./ramdisk-debug`
Test: `m ramdisk_test_harness-nodeps` and `m bootimage_test_harness-nodeps`
Change-Id: Iadea0b5c933c3b7fa10dcf3d9e85596916b3333d
2019-10-08 04:22:19 +02:00
$(INSTALLED_TEST_HARNESS_RAMDISK_TARGET) : $( INSTALLED_DEBUG_RAMDISK_TARGET )
2020-05-11 22:20:03 +02:00
$(INSTALLED_TEST_HARNESS_RAMDISK_TARGET) : $( MKBOOTFS ) $( INTERNAL_TEST_HARNESS_RAMDISK_FILES ) | $( COMPRESSION_COMMAND_DEPS )
2021-03-06 22:26:01 +01:00
$( call pretty," Target test harness ramdisk: $@ " )
2021-04-23 05:31:32 +02:00
rsync --chmod= u+w -a $( TARGET_DEBUG_RAMDISK_OUT) / $( TARGET_TEST_HARNESS_RAMDISK_OUT)
Adding boot-test-harness.img
In commit I30137c3caef91805d9143d404e5e4d06c0fccc30, we added
a boot-debug.img to allow adb root when using an user build GSI image.
However, to run automated tests, it requires additional properties,
which are not needed for GSI compliance:
ro.audio.silent=1
ro.test_harness=1
This CL adds an additional boot-test-harness.img for automated tests,
and keeps the original boot-debug.img for GSI compliance.
Note: boot-test-harness.img won't be built by default, it needs
explicit `make bootimage_test_harness`.
Bug: 140036184
Test: `m bootimage_test_harness`, flashes boot-test-harness.img and checks
adb root works and test harness props are set.
Test: `m bootimage_test_harness dist -j32`, checks both
boot-test-harness.img and ramdisk-test-harness.img are under ./out/dist/.
Test: `system/tools/mkbootimg/unpack_bootimg.py --boot_img $OUT/boot-test-harness.img --out ramdisk-test-harness`,
checks the extracted out/ramdisk is as expected
Test: Run `gunzip -c ramdisk | cpio -idm` for the ramdisk extracted from
$OUT/boot-test-harness.img and $OUT/boot-debug.img, respectively.
Then compare the root dirs of both, e.g.,
`diff -rq --no-dereference ./ramdisk-test-harness ./ramdisk-debug`
Test: `m ramdisk_test_harness-nodeps` and `m bootimage_test_harness-nodeps`
Change-Id: Iadea0b5c933c3b7fa10dcf3d9e85596916b3333d
2019-10-08 04:22:19 +02:00
$( call append-test-harness-props,$( ADDITIONAL_TEST_HARNESS_PROPERTIES) ,$( TEST_HARNESS_PROP_TARGET) )
2021-04-23 05:31:32 +02:00
$( MKBOOTFS) -d $( TARGET_OUT) $( TARGET_TEST_HARNESS_RAMDISK_OUT) $( PRIVATE_ADDITIONAL_DIR) | $( COMPRESSION_COMMAND) > $@
Adding boot-test-harness.img
In commit I30137c3caef91805d9143d404e5e4d06c0fccc30, we added
a boot-debug.img to allow adb root when using an user build GSI image.
However, to run automated tests, it requires additional properties,
which are not needed for GSI compliance:
ro.audio.silent=1
ro.test_harness=1
This CL adds an additional boot-test-harness.img for automated tests,
and keeps the original boot-debug.img for GSI compliance.
Note: boot-test-harness.img won't be built by default, it needs
explicit `make bootimage_test_harness`.
Bug: 140036184
Test: `m bootimage_test_harness`, flashes boot-test-harness.img and checks
adb root works and test harness props are set.
Test: `m bootimage_test_harness dist -j32`, checks both
boot-test-harness.img and ramdisk-test-harness.img are under ./out/dist/.
Test: `system/tools/mkbootimg/unpack_bootimg.py --boot_img $OUT/boot-test-harness.img --out ramdisk-test-harness`,
checks the extracted out/ramdisk is as expected
Test: Run `gunzip -c ramdisk | cpio -idm` for the ramdisk extracted from
$OUT/boot-test-harness.img and $OUT/boot-debug.img, respectively.
Then compare the root dirs of both, e.g.,
`diff -rq --no-dereference ./ramdisk-test-harness ./ramdisk-debug`
Test: `m ramdisk_test_harness-nodeps` and `m bootimage_test_harness-nodeps`
Change-Id: Iadea0b5c933c3b7fa10dcf3d9e85596916b3333d
2019-10-08 04:22:19 +02:00
.PHONY : ramdisk_test_harness -nodeps
2021-04-23 05:31:32 +02:00
i f e q ( $( BOARD_USES_RECOVERY_AS_BOOT ) , t r u e )
ramdisk_test_harness-nodeps: PRIVATE_ADDITIONAL_DIR := $( TARGET_RECOVERY_ROOT_OUT)
e l s e
ramdisk_test_harness-nodeps: PRIVATE_ADDITIONAL_DIR := $( TARGET_RAMDISK_OUT)
e n d i f # BOARD_USES_RECOVERY_AS_BOOT
2020-05-11 22:20:03 +02:00
ramdisk_test_harness-nodeps : $( MKBOOTFS ) | $( COMPRESSION_COMMAND_DEPS )
Adding boot-test-harness.img
In commit I30137c3caef91805d9143d404e5e4d06c0fccc30, we added
a boot-debug.img to allow adb root when using an user build GSI image.
However, to run automated tests, it requires additional properties,
which are not needed for GSI compliance:
ro.audio.silent=1
ro.test_harness=1
This CL adds an additional boot-test-harness.img for automated tests,
and keeps the original boot-debug.img for GSI compliance.
Note: boot-test-harness.img won't be built by default, it needs
explicit `make bootimage_test_harness`.
Bug: 140036184
Test: `m bootimage_test_harness`, flashes boot-test-harness.img and checks
adb root works and test harness props are set.
Test: `m bootimage_test_harness dist -j32`, checks both
boot-test-harness.img and ramdisk-test-harness.img are under ./out/dist/.
Test: `system/tools/mkbootimg/unpack_bootimg.py --boot_img $OUT/boot-test-harness.img --out ramdisk-test-harness`,
checks the extracted out/ramdisk is as expected
Test: Run `gunzip -c ramdisk | cpio -idm` for the ramdisk extracted from
$OUT/boot-test-harness.img and $OUT/boot-debug.img, respectively.
Then compare the root dirs of both, e.g.,
`diff -rq --no-dereference ./ramdisk-test-harness ./ramdisk-debug`
Test: `m ramdisk_test_harness-nodeps` and `m bootimage_test_harness-nodeps`
Change-Id: Iadea0b5c933c3b7fa10dcf3d9e85596916b3333d
2019-10-08 04:22:19 +02:00
echo " make $@ : ignoring dependencies "
2021-04-23 05:31:32 +02:00
rsync --chmod= u+w -a $( TARGET_DEBUG_RAMDISK_OUT) / $( TARGET_TEST_HARNESS_RAMDISK_OUT)
Adding boot-test-harness.img
In commit I30137c3caef91805d9143d404e5e4d06c0fccc30, we added
a boot-debug.img to allow adb root when using an user build GSI image.
However, to run automated tests, it requires additional properties,
which are not needed for GSI compliance:
ro.audio.silent=1
ro.test_harness=1
This CL adds an additional boot-test-harness.img for automated tests,
and keeps the original boot-debug.img for GSI compliance.
Note: boot-test-harness.img won't be built by default, it needs
explicit `make bootimage_test_harness`.
Bug: 140036184
Test: `m bootimage_test_harness`, flashes boot-test-harness.img and checks
adb root works and test harness props are set.
Test: `m bootimage_test_harness dist -j32`, checks both
boot-test-harness.img and ramdisk-test-harness.img are under ./out/dist/.
Test: `system/tools/mkbootimg/unpack_bootimg.py --boot_img $OUT/boot-test-harness.img --out ramdisk-test-harness`,
checks the extracted out/ramdisk is as expected
Test: Run `gunzip -c ramdisk | cpio -idm` for the ramdisk extracted from
$OUT/boot-test-harness.img and $OUT/boot-debug.img, respectively.
Then compare the root dirs of both, e.g.,
`diff -rq --no-dereference ./ramdisk-test-harness ./ramdisk-debug`
Test: `m ramdisk_test_harness-nodeps` and `m bootimage_test_harness-nodeps`
Change-Id: Iadea0b5c933c3b7fa10dcf3d9e85596916b3333d
2019-10-08 04:22:19 +02:00
$( call append-test-harness-props,$( ADDITIONAL_TEST_HARNESS_PROPERTIES) ,$( TEST_HARNESS_PROP_TARGET) )
2021-04-23 05:31:32 +02:00
$( MKBOOTFS) -d $( TARGET_OUT) $( TARGET_TEST_HARNESS_RAMDISK_OUT) $( PRIVATE_ADDITIONAL_DIR) | $( COMPRESSION_COMMAND) > $( INSTALLED_TEST_HARNESS_RAMDISK_TARGET)
Adding boot-test-harness.img
In commit I30137c3caef91805d9143d404e5e4d06c0fccc30, we added
a boot-debug.img to allow adb root when using an user build GSI image.
However, to run automated tests, it requires additional properties,
which are not needed for GSI compliance:
ro.audio.silent=1
ro.test_harness=1
This CL adds an additional boot-test-harness.img for automated tests,
and keeps the original boot-debug.img for GSI compliance.
Note: boot-test-harness.img won't be built by default, it needs
explicit `make bootimage_test_harness`.
Bug: 140036184
Test: `m bootimage_test_harness`, flashes boot-test-harness.img and checks
adb root works and test harness props are set.
Test: `m bootimage_test_harness dist -j32`, checks both
boot-test-harness.img and ramdisk-test-harness.img are under ./out/dist/.
Test: `system/tools/mkbootimg/unpack_bootimg.py --boot_img $OUT/boot-test-harness.img --out ramdisk-test-harness`,
checks the extracted out/ramdisk is as expected
Test: Run `gunzip -c ramdisk | cpio -idm` for the ramdisk extracted from
$OUT/boot-test-harness.img and $OUT/boot-debug.img, respectively.
Then compare the root dirs of both, e.g.,
`diff -rq --no-dereference ./ramdisk-test-harness ./ramdisk-debug`
Test: `m ramdisk_test_harness-nodeps` and `m bootimage_test_harness-nodeps`
Change-Id: Iadea0b5c933c3b7fa10dcf3d9e85596916b3333d
2019-10-08 04:22:19 +02:00
e n d i f # BUILDING_RAMDISK_IMAGE
# -----------------------------------------------------------------
# the boot-test-harness.img, which is the kernel plus ramdisk-test-harness.img
#
# Note: it's intentional to skip signing for boot-test-harness.img, because it
# can only be used if the device is unlocked with verification error.
2021-09-09 13:04:55 +02:00
i f n e q ( $( BUILDING_VENDOR_BOOT_IMAGE ) , t r u e )
2021-04-06 10:09:19 +02:00
i f n e q ( $( INSTALLED_BOOTIMAGE_TARGET ) , )
Adding boot-test-harness.img
In commit I30137c3caef91805d9143d404e5e4d06c0fccc30, we added
a boot-debug.img to allow adb root when using an user build GSI image.
However, to run automated tests, it requires additional properties,
which are not needed for GSI compliance:
ro.audio.silent=1
ro.test_harness=1
This CL adds an additional boot-test-harness.img for automated tests,
and keeps the original boot-debug.img for GSI compliance.
Note: boot-test-harness.img won't be built by default, it needs
explicit `make bootimage_test_harness`.
Bug: 140036184
Test: `m bootimage_test_harness`, flashes boot-test-harness.img and checks
adb root works and test harness props are set.
Test: `m bootimage_test_harness dist -j32`, checks both
boot-test-harness.img and ramdisk-test-harness.img are under ./out/dist/.
Test: `system/tools/mkbootimg/unpack_bootimg.py --boot_img $OUT/boot-test-harness.img --out ramdisk-test-harness`,
checks the extracted out/ramdisk is as expected
Test: Run `gunzip -c ramdisk | cpio -idm` for the ramdisk extracted from
$OUT/boot-test-harness.img and $OUT/boot-debug.img, respectively.
Then compare the root dirs of both, e.g.,
`diff -rq --no-dereference ./ramdisk-test-harness ./ramdisk-debug`
Test: `m ramdisk_test_harness-nodeps` and `m bootimage_test_harness-nodeps`
Change-Id: Iadea0b5c933c3b7fa10dcf3d9e85596916b3333d
2019-10-08 04:22:19 +02:00
i f n e q ( $( strip $ ( TARGET_NO_KERNEL ) ) , t r u e )
2020-04-02 20:31:08 +02:00
i f n e q ( $( strip $ ( BOARD_KERNEL_BINARIES ) ) , )
INSTALLED_TEST_HARNESS_BOOTIMAGE_TARGET := $( foreach k,$( subst kernel,boot-test-harness,$( BOARD_KERNEL_BINARIES) ) , \
$( PRODUCT_OUT) /$( k) .img)
e l s e
INSTALLED_TEST_HARNESS_BOOTIMAGE_TARGET := $( PRODUCT_OUT) /boot-test-harness.img
e n d i f
Adding boot-test-harness.img
In commit I30137c3caef91805d9143d404e5e4d06c0fccc30, we added
a boot-debug.img to allow adb root when using an user build GSI image.
However, to run automated tests, it requires additional properties,
which are not needed for GSI compliance:
ro.audio.silent=1
ro.test_harness=1
This CL adds an additional boot-test-harness.img for automated tests,
and keeps the original boot-debug.img for GSI compliance.
Note: boot-test-harness.img won't be built by default, it needs
explicit `make bootimage_test_harness`.
Bug: 140036184
Test: `m bootimage_test_harness`, flashes boot-test-harness.img and checks
adb root works and test harness props are set.
Test: `m bootimage_test_harness dist -j32`, checks both
boot-test-harness.img and ramdisk-test-harness.img are under ./out/dist/.
Test: `system/tools/mkbootimg/unpack_bootimg.py --boot_img $OUT/boot-test-harness.img --out ramdisk-test-harness`,
checks the extracted out/ramdisk is as expected
Test: Run `gunzip -c ramdisk | cpio -idm` for the ramdisk extracted from
$OUT/boot-test-harness.img and $OUT/boot-debug.img, respectively.
Then compare the root dirs of both, e.g.,
`diff -rq --no-dereference ./ramdisk-test-harness ./ramdisk-debug`
Test: `m ramdisk_test_harness-nodeps` and `m bootimage_test_harness-nodeps`
Change-Id: Iadea0b5c933c3b7fa10dcf3d9e85596916b3333d
2019-10-08 04:22:19 +02:00
# Replace ramdisk-debug.img in $(MKBOOTIMG) ARGS with ramdisk-test-harness.img to build boot-test-harness.img
INTERNAL_TEST_HARNESS_BOOTIMAGE_ARGS := $( subst $( INSTALLED_DEBUG_RAMDISK_TARGET) ,$( INSTALLED_TEST_HARNESS_RAMDISK_TARGET) ,$( INTERNAL_DEBUG_BOOTIMAGE_ARGS) )
# If boot.img is chained but boot-test-harness.img is not signed, libavb in bootloader
# will fail to find valid AVB metadata from the end of /boot, thus stop booting.
# Using a test key to sign boot-test-harness.img to continue booting with the mismatched
# public key, if the device is unlocked.
i f n e q ( $( BOARD_AVB_BOOT_KEY_PATH ) , )
$(INSTALLED_TEST_HARNESS_BOOTIMAGE_TARGET) : $( AVBTOOL ) $( BOARD_AVB_BOOT_TEST_KEY_PATH )
e n d i f
2020-04-02 20:31:08 +02:00
# $(1): output file
d e f i n e b u i l d - b o o t - t e s t - h a r n e s s - t a r g e t
$( MKBOOTIMG) --kernel $( PRODUCT_OUT) /$( subst .img,,$( subst boot-test-harness,kernel,$( notdir $( 1) ) ) ) \
2021-03-12 14:40:32 +01:00
$( INTERNAL_TEST_HARNESS_BOOTIMAGE_ARGS) $( INTERNAL_MKBOOTIMG_VERSION_ARGS) \
$( INTERNAL_MKBOOTIMG_GKI_SINGING_ARGS) $( BOARD_MKBOOTIMG_ARGS) --output $@
2021-03-04 07:41:16 +01:00
$( if $( BOARD_AVB_BOOT_KEY_PATH) ,$( call test-key-sign-bootimage,$@ ,boot-test-harness) )
2020-04-02 20:31:08 +02:00
e n d e f
Adding boot-test-harness.img
In commit I30137c3caef91805d9143d404e5e4d06c0fccc30, we added
a boot-debug.img to allow adb root when using an user build GSI image.
However, to run automated tests, it requires additional properties,
which are not needed for GSI compliance:
ro.audio.silent=1
ro.test_harness=1
This CL adds an additional boot-test-harness.img for automated tests,
and keeps the original boot-debug.img for GSI compliance.
Note: boot-test-harness.img won't be built by default, it needs
explicit `make bootimage_test_harness`.
Bug: 140036184
Test: `m bootimage_test_harness`, flashes boot-test-harness.img and checks
adb root works and test harness props are set.
Test: `m bootimage_test_harness dist -j32`, checks both
boot-test-harness.img and ramdisk-test-harness.img are under ./out/dist/.
Test: `system/tools/mkbootimg/unpack_bootimg.py --boot_img $OUT/boot-test-harness.img --out ramdisk-test-harness`,
checks the extracted out/ramdisk is as expected
Test: Run `gunzip -c ramdisk | cpio -idm` for the ramdisk extracted from
$OUT/boot-test-harness.img and $OUT/boot-debug.img, respectively.
Then compare the root dirs of both, e.g.,
`diff -rq --no-dereference ./ramdisk-test-harness ./ramdisk-debug`
Test: `m ramdisk_test_harness-nodeps` and `m bootimage_test_harness-nodeps`
Change-Id: Iadea0b5c933c3b7fa10dcf3d9e85596916b3333d
2019-10-08 04:22:19 +02:00
# Build the new boot-test-harness.img, based on boot-debug.img and ramdisk-test-harness.img.
2021-03-12 14:40:32 +01:00
$(INSTALLED_TEST_HARNESS_BOOTIMAGE_TARGET) : $( MKBOOTIMG ) $( INSTALLED_DEBUG_BOOTIMAGE_TARGET ) $( INSTALLED_TEST_HARNESS_RAMDISK_TARGET ) \
$( BOARD_GKI_SIGNING_KEY_PATH ) $( AVBTOOL )
Adding boot-test-harness.img
In commit I30137c3caef91805d9143d404e5e4d06c0fccc30, we added
a boot-debug.img to allow adb root when using an user build GSI image.
However, to run automated tests, it requires additional properties,
which are not needed for GSI compliance:
ro.audio.silent=1
ro.test_harness=1
This CL adds an additional boot-test-harness.img for automated tests,
and keeps the original boot-debug.img for GSI compliance.
Note: boot-test-harness.img won't be built by default, it needs
explicit `make bootimage_test_harness`.
Bug: 140036184
Test: `m bootimage_test_harness`, flashes boot-test-harness.img and checks
adb root works and test harness props are set.
Test: `m bootimage_test_harness dist -j32`, checks both
boot-test-harness.img and ramdisk-test-harness.img are under ./out/dist/.
Test: `system/tools/mkbootimg/unpack_bootimg.py --boot_img $OUT/boot-test-harness.img --out ramdisk-test-harness`,
checks the extracted out/ramdisk is as expected
Test: Run `gunzip -c ramdisk | cpio -idm` for the ramdisk extracted from
$OUT/boot-test-harness.img and $OUT/boot-debug.img, respectively.
Then compare the root dirs of both, e.g.,
`diff -rq --no-dereference ./ramdisk-test-harness ./ramdisk-debug`
Test: `m ramdisk_test_harness-nodeps` and `m bootimage_test_harness-nodeps`
Change-Id: Iadea0b5c933c3b7fa10dcf3d9e85596916b3333d
2019-10-08 04:22:19 +02:00
$( call pretty," Target boot test harness image: $@ " )
2020-04-02 20:31:08 +02:00
$( call build-boot-test-harness-target,$@ )
Adding boot-test-harness.img
In commit I30137c3caef91805d9143d404e5e4d06c0fccc30, we added
a boot-debug.img to allow adb root when using an user build GSI image.
However, to run automated tests, it requires additional properties,
which are not needed for GSI compliance:
ro.audio.silent=1
ro.test_harness=1
This CL adds an additional boot-test-harness.img for automated tests,
and keeps the original boot-debug.img for GSI compliance.
Note: boot-test-harness.img won't be built by default, it needs
explicit `make bootimage_test_harness`.
Bug: 140036184
Test: `m bootimage_test_harness`, flashes boot-test-harness.img and checks
adb root works and test harness props are set.
Test: `m bootimage_test_harness dist -j32`, checks both
boot-test-harness.img and ramdisk-test-harness.img are under ./out/dist/.
Test: `system/tools/mkbootimg/unpack_bootimg.py --boot_img $OUT/boot-test-harness.img --out ramdisk-test-harness`,
checks the extracted out/ramdisk is as expected
Test: Run `gunzip -c ramdisk | cpio -idm` for the ramdisk extracted from
$OUT/boot-test-harness.img and $OUT/boot-debug.img, respectively.
Then compare the root dirs of both, e.g.,
`diff -rq --no-dereference ./ramdisk-test-harness ./ramdisk-debug`
Test: `m ramdisk_test_harness-nodeps` and `m bootimage_test_harness-nodeps`
Change-Id: Iadea0b5c933c3b7fa10dcf3d9e85596916b3333d
2019-10-08 04:22:19 +02:00
.PHONY : bootimage_test_harness -nodeps
2021-03-12 14:40:32 +01:00
bootimage_test_harness-nodeps : $( MKBOOTIMG ) $( BOARD_GKI_SIGNING_KEY_PATH ) $( AVBTOOL )
Adding boot-test-harness.img
In commit I30137c3caef91805d9143d404e5e4d06c0fccc30, we added
a boot-debug.img to allow adb root when using an user build GSI image.
However, to run automated tests, it requires additional properties,
which are not needed for GSI compliance:
ro.audio.silent=1
ro.test_harness=1
This CL adds an additional boot-test-harness.img for automated tests,
and keeps the original boot-debug.img for GSI compliance.
Note: boot-test-harness.img won't be built by default, it needs
explicit `make bootimage_test_harness`.
Bug: 140036184
Test: `m bootimage_test_harness`, flashes boot-test-harness.img and checks
adb root works and test harness props are set.
Test: `m bootimage_test_harness dist -j32`, checks both
boot-test-harness.img and ramdisk-test-harness.img are under ./out/dist/.
Test: `system/tools/mkbootimg/unpack_bootimg.py --boot_img $OUT/boot-test-harness.img --out ramdisk-test-harness`,
checks the extracted out/ramdisk is as expected
Test: Run `gunzip -c ramdisk | cpio -idm` for the ramdisk extracted from
$OUT/boot-test-harness.img and $OUT/boot-debug.img, respectively.
Then compare the root dirs of both, e.g.,
`diff -rq --no-dereference ./ramdisk-test-harness ./ramdisk-debug`
Test: `m ramdisk_test_harness-nodeps` and `m bootimage_test_harness-nodeps`
Change-Id: Iadea0b5c933c3b7fa10dcf3d9e85596916b3333d
2019-10-08 04:22:19 +02:00
echo " make $@ : ignoring dependencies "
2020-04-02 20:31:08 +02:00
$( foreach b,$( INSTALLED_TEST_HARNESS_BOOTIMAGE_TARGET) ,$( call build-boot-test-harness-target,$b ) )
Adding boot-debug.img and ramdisk-debug.img
The two new debugging images adds additional files based on
boot.img and ramdisk.img/ramdisk-recovery.img, respectively.
File /force_debuggable is to trigger special logic in /init to load an
userdebug version of sepolicy and an additional property file from this
ramdisk to allow adb root, if the device is unlocked.
It's intentional to skip signing for boot-debug.img, as it can
only be used if the device is unlocked, where verification error
is allowed.
Those debugging images allows adb root on user build
system.img, vendor.img, product.img, etc. This can facilitate more
automated testings on user builds and is helpful to narrow down the
delta between what's being tested v.s. what's being shipped.
Bug: 126493225
Test: `make dist`, checks both boot-debug.img and ramdisk-debug.img
are in $OUT/ and out/dist.
Test: `make dist`, checks installed-files-ramdisk-debug.{json,txt} are
in out/dist.
Test: `system/core/mkbootimg/unpack_bootimg.py --boot_img $OUT/boot-debug.img`,
checks the extracted out/ramdisk is as expected
Test: Run `gunzip -c ramdisk | cpio -idm` for the ramdisk extracted from
$OUT/boot-debug.img and $OUT/boot.img, respectively.
Then compare the root dirs of both, e.g.,
`diff -rq --no-dereference ./ramdisk ./ramdisk-debug`
Test: `make ramdisk_debug-nodeps` and `make bootimage_debug-nodeps`
Change-Id: I30137c3caef91805d9143d404e5e4d06c0fccc30
2019-03-20 10:59:52 +01:00
e n d i f # TARGET_NO_KERNEL
2021-04-06 10:09:19 +02:00
e n d i f # INSTALLED_BOOTIMAGE_TARGET
2021-09-09 13:04:55 +02:00
e n d i f # BUILDING_VENDOR_BOOT_IMAGE is not true
Adding boot-test-harness.img
In commit I30137c3caef91805d9143d404e5e4d06c0fccc30, we added
a boot-debug.img to allow adb root when using an user build GSI image.
However, to run automated tests, it requires additional properties,
which are not needed for GSI compliance:
ro.audio.silent=1
ro.test_harness=1
This CL adds an additional boot-test-harness.img for automated tests,
and keeps the original boot-debug.img for GSI compliance.
Note: boot-test-harness.img won't be built by default, it needs
explicit `make bootimage_test_harness`.
Bug: 140036184
Test: `m bootimage_test_harness`, flashes boot-test-harness.img and checks
adb root works and test harness props are set.
Test: `m bootimage_test_harness dist -j32`, checks both
boot-test-harness.img and ramdisk-test-harness.img are under ./out/dist/.
Test: `system/tools/mkbootimg/unpack_bootimg.py --boot_img $OUT/boot-test-harness.img --out ramdisk-test-harness`,
checks the extracted out/ramdisk is as expected
Test: Run `gunzip -c ramdisk | cpio -idm` for the ramdisk extracted from
$OUT/boot-test-harness.img and $OUT/boot-debug.img, respectively.
Then compare the root dirs of both, e.g.,
`diff -rq --no-dereference ./ramdisk-test-harness ./ramdisk-debug`
Test: `m ramdisk_test_harness-nodeps` and `m bootimage_test_harness-nodeps`
Change-Id: Iadea0b5c933c3b7fa10dcf3d9e85596916b3333d
2019-10-08 04:22:19 +02:00
e n d i f # BOARD_BUILD_SYSTEM_ROOT_IMAGE is not true
Adding boot-debug.img and ramdisk-debug.img
The two new debugging images adds additional files based on
boot.img and ramdisk.img/ramdisk-recovery.img, respectively.
File /force_debuggable is to trigger special logic in /init to load an
userdebug version of sepolicy and an additional property file from this
ramdisk to allow adb root, if the device is unlocked.
It's intentional to skip signing for boot-debug.img, as it can
only be used if the device is unlocked, where verification error
is allowed.
Those debugging images allows adb root on user build
system.img, vendor.img, product.img, etc. This can facilitate more
automated testings on user builds and is helpful to narrow down the
delta between what's being tested v.s. what's being shipped.
Bug: 126493225
Test: `make dist`, checks both boot-debug.img and ramdisk-debug.img
are in $OUT/ and out/dist.
Test: `make dist`, checks installed-files-ramdisk-debug.{json,txt} are
in out/dist.
Test: `system/core/mkbootimg/unpack_bootimg.py --boot_img $OUT/boot-debug.img`,
checks the extracted out/ramdisk is as expected
Test: Run `gunzip -c ramdisk | cpio -idm` for the ramdisk extracted from
$OUT/boot-debug.img and $OUT/boot.img, respectively.
Then compare the root dirs of both, e.g.,
`diff -rq --no-dereference ./ramdisk ./ramdisk-debug`
Test: `make ramdisk_debug-nodeps` and `make bootimage_debug-nodeps`
Change-Id: I30137c3caef91805d9143d404e5e4d06c0fccc30
2019-03-20 10:59:52 +01:00
2021-07-29 17:35:33 +02:00
i f e q ( $( BUILDING_VENDOR_BOOT_IMAGE ) , t r u e )
i f e q ( $( BUILDING_RAMDISK_IMAGE ) , t r u e )
# -----------------------------------------------------------------
# vendor test harness ramdisk, which is a vendor ramdisk combined with
# a test harness ramdisk.
INTERNAL_VENDOR_TEST_HARNESS_RAMDISK_TARGET := $( call intermediates-dir-for,PACKAGING,vendor_boot-test-harness) /vendor_ramdisk-test-harness.cpio$( RAMDISK_EXT)
# Exclude recovery files in the default vendor ramdisk if including a standalone
# recovery ramdisk in vendor_boot.
i f e q ( t r u e , $( BOARD_MOVE_RECOVERY_RESOURCES_TO_VENDOR_BOOT ) )
i f n e q ( t r u e , $( BOARD_INCLUDE_RECOVERY_RAMDISK_IN_VENDOR_BOOT ) )
$(INTERNAL_VENDOR_TEST_HARNESS_RAMDISK_TARGET) : $( INTERNAL_RECOVERY_RAMDISK_FILES_TIMESTAMP )
$(INTERNAL_VENDOR_TEST_HARNESS_RAMDISK_TARGET) : PRIVATE_ADDITIONAL_DIR := $( TARGET_RECOVERY_ROOT_OUT )
e n d i f
e n d i f
# The vendor test harness ramdisk combines vendor ramdisk and test harness ramdisk.
$(INTERNAL_VENDOR_TEST_HARNESS_RAMDISK_TARGET) : $( INTERNAL_VENDOR_RAMDISK_TARGET ) $( INSTALLED_TEST_HARNESS_RAMDISK_TARGET )
$(INTERNAL_VENDOR_TEST_HARNESS_RAMDISK_TARGET) : $( MKBOOTFS ) | $( COMPRESSION_COMMAND_DEPS )
$( MKBOOTFS) -d $( TARGET_OUT) $( TARGET_VENDOR_RAMDISK_OUT) $( TARGET_TEST_HARNESS_RAMDISK_OUT) $( PRIVATE_ADDITIONAL_DIR) | $( COMPRESSION_COMMAND) > $@
# -----------------------------------------------------------------
# vendor_boot-test-harness.img.
INSTALLED_VENDOR_TEST_HARNESS_BOOTIMAGE_TARGET := $( PRODUCT_OUT) /vendor_boot-test-harness.img
i f n e q ( $( BOARD_AVB_VENDOR_BOOT_KEY_PATH ) , )
$(INSTALLED_VENDOR_TEST_HARNESS_BOOTIMAGE_TARGET) : $( AVBTOOL ) $( BOARD_AVB_VENDOR_BOOT_TEST_KEY_PATH )
e n d i f
# Depends on vendor_boot.img and vendor_ramdisk-test-harness.cpio$(RAMDISK_EXT) to build the new vendor_boot-test-harness.img
$(INSTALLED_VENDOR_TEST_HARNESS_BOOTIMAGE_TARGET) : $( MKBOOTIMG ) $( INSTALLED_VENDOR_BOOTIMAGE_TARGET )
$(INSTALLED_VENDOR_TEST_HARNESS_BOOTIMAGE_TARGET) : $( INTERNAL_VENDOR_TEST_HARNESS_RAMDISK_TARGET )
$(INSTALLED_VENDOR_TEST_HARNESS_BOOTIMAGE_TARGET) : $( INTERNAL_VENDOR_RAMDISK_FRAGMENT_TARGETS )
$( call pretty," Target vendor_boot test harness image: $@ " )
$( MKBOOTIMG) $( INTERNAL_VENDOR_BOOTIMAGE_ARGS) $( BOARD_MKBOOTIMG_ARGS) --vendor_ramdisk $( INTERNAL_VENDOR_TEST_HARNESS_RAMDISK_TARGET) $( INTERNAL_VENDOR_RAMDISK_FRAGMENT_ARGS) --vendor_boot $@
$( call assert-max-image-size,$@ ,$( BOARD_VENDOR_BOOTIMAGE_PARTITION_SIZE) )
$( if $( BOARD_AVB_VENDOR_BOOT_KEY_PATH) ,$( call test-key-sign-vendor-bootimage,$@ ) )
e n d i f # BUILDING_RAMDISK_IMAGE
e n d i f # BUILDING_VENDOR_BOOT_IMAGE
2020-08-27 00:08:57 +02:00
# Creates a compatibility symlink between two partitions, e.g. /system/vendor to /vendor
# $1: from location (e.g $(TARGET_OUT)/vendor)
# $2: destination location (e.g. /vendor)
# $3: partition image name (e.g. vendor.img)
d e f i n e c r e a t e - p a r t i t i o n - c o m p a t - s y m l i n k
$( eval \
$1 :
@echo Symlink $( patsubst $( PRODUCT_OUT) /%,%,$1 ) to $2
mkdir -p $( dir $1 )
if [ -d $1 ] && [ ! -h $1 ] ; then \
echo 'Non-symlink $1 detected!' 1>& 2; \
echo 'You cannot install files to $1 while building a separate $3!' 1>& 2; \
exit 1; \
fi
ln -sfn $2 $1
2020-09-22 15:47:13 +02:00
$1 : .KATI_SYMLINK_OUTPUTS := $1
2020-08-27 00:08:57 +02:00
)
$ 1
e n d e 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
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) \
2020-05-29 00:46:33 +02:00
$( ALL_DEFAULT_INSTALLED_MODULES) ) )
2012-03-14 02:58:27 +01:00
2020-08-27 00:08:57 +02:00
# Create symlink /system/vendor to /vendor if necessary.
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
INTERNAL_SYSTEMIMAGE_FILES += $( call create-partition-compat-symlink,$( TARGET_OUT) /vendor,/vendor,vendor.img)
e n d i f
# 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
INTERNAL_SYSTEMIMAGE_FILES += $( call create-partition-compat-symlink,$( TARGET_OUT) /product,/product,product.img)
e n d i f
# Create symlink /system/system_ext to /system_ext if necessary.
i f d e f B O A R D _ U S E S _ S Y S T E M _ E X T I M A G E
INTERNAL_SYSTEMIMAGE_FILES += $( call create-partition-compat-symlink,$( TARGET_OUT) /system_ext,/system_ext,system_ext.img)
e n d i f
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
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
2020-11-16 02:50:05 +01:00
# Install system linker configuration
# Collect all available stub libraries installed in system and install with predefined linker configuration
SYSTEM_LINKER_CONFIG := $( TARGET_OUT) /etc/linker.config.pb
$(SYSTEM_LINKER_CONFIG) : $( INTERNAL_SYSTEMIMAGE_FILES ) $( LINKER_CONFIG_PATH_system_linker_config ) | conv_linker_config
$( HOST_OUT_EXECUTABLES) /conv_linker_config systemprovide --source $( LINKER_CONFIG_PATH_system_linker_config) \
--output $@ --value " $( STUB_LIBRARIES) " --system " $( TARGET_OUT) "
FULL_SYSTEMIMAGE_DEPS += $( SYSTEM_LINKER_CONFIG)
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 )
2019-06-11 01:39:45 +02:00
$(INSTALLED_FILES_FILE) : $( FULL_SYSTEMIMAGE_DEPS ) $( FILESLIST ) $( FILESLIST_UTIL )
2011-09-10 01:35:53 +02:00
@echo Installed file list: $@
2021-03-06 22:29:28 +01:00
mkdir -p $( dir $@ )
rm -f $@
$( FILESLIST) $( TARGET_OUT) > $( @:.txt= .json)
$( FILESLIST_UTIL) -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
2021-09-16 23:50:08 +02:00
i f e q ( $( HOST_OS ) , l i n u x )
2013-03-02 01:45:35 +01:00
$( call dist -for -goals , sdk win_sdk sdk_addon , $ ( INSTALLED_FILES_FILE ) )
2021-09-16 23:50:08 +02:00
e n d i f
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
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) "
@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 )
2019-06-24 21:39:10 +02:00
PATH = $( INTERNAL_USERIMAGES_BINARY_PATHS) :$$ PATH \
2019-05-07 22:12:21 +02:00
$( BUILD_IMAGE) \
$( TARGET_OUT) $( systemimage_intermediates) /system_image_info.txt $( 1) $( TARGET_OUT) \
|| ( mkdir -p $$ { DIST_DIR} ; \
cp $( INSTALLED_FILES_FILE) $$ { DIST_DIR} /installed-files-rescued.txt; \
exit 1 )
2009-03-04 04:28:42 +01:00
e n d e f
2019-06-12 23:33:38 +02:00
i f e q ( $( BOARD_AVB_ENABLE ) , t r u e )
$(BUILT_SYSTEMIMAGE) : $( BOARD_AVB_SYSTEM_KEY_PATH )
e n d i f
2019-05-07 22:12:21 +02:00
$(BUILT_SYSTEMIMAGE) : $( FULL_SYSTEMIMAGE_DEPS ) $( INSTALLED_FILES_FILE )
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) \
2020-08-09 23:36:56 +02:00
$( firstword $( INSTALLED_BOOTIMAGE_TARGET) ) \
2018-11-26 19:12:05 +01:00
$( diff_tool)
2009-07-24 00:12:53 +02:00
@echo "Construct recovery from boot"
mkdir -p $( dir $@ )
2020-08-09 23:36:56 +02:00
$( PRIVATE_DIFF_TOOL) $( firstword $( 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
2020-04-28 04:06:59 +02:00
$(INSTALLED_SYSTEMIMAGE_TARGET) : $( BUILT_SYSTEMIMAGE )
2009-03-04 04:28:42 +01:00
@echo " Install system fs image: $@ "
$( copy-file-to-target)
2020-04-28 04:06:59 +02:00
$( hide) $( call assert-max-image-size,$@ ,$( BOARD_SYSTEMIMAGE_PARTITION_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) )
2019-04-09 19:03:57 +02:00
$( hide) $( call assert-max-image-size,$( INSTALLED_SYSTEMIMAGE_TARGET) ,$( BOARD_SYSTEMIMAGE_PARTITION_SIZE) )
2012-02-24 20:05:48 +01:00
i f e q ( t r u e , $( WITH_DEXPREOPT ) )
2020-03-05 00:50:53 +01:00
$( warning Warning: with dexpreopt enabled, you may need a full rebuild.)
2012-02-24 20:05:48 +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
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
2016-03-11 19:32:01 +01:00
# -----------------------------------------------------------------
2020-05-29 00:46:33 +02:00
# Old PDK fusion targets
2012-03-30 22:52:54 +02:00
.PHONY : platform
2020-05-29 00:46:33 +02:00
platform :
echo "Warning: 'platform' is obsolete"
2012-05-16 19:32:41 +02:00
.PHONY : platform -java
2020-05-29 00:46:33 +02:00
platform-java :
echo "Warning: 'platform-java' is obsolete"
2018-09-29 01:19:42 +02:00
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 )
2019-06-24 21:39:10 +02:00
PATH = $( INTERNAL_USERIMAGES_BINARY_PATHS) :$$ PATH \
2019-05-07 22:12:21 +02:00
$( BUILD_IMAGE) \
$( TARGET_OUT_DATA) $( userdataimage_intermediates) /userdata_image_info.txt \
$( INSTALLED_USERDATAIMAGE_TARGET) $( TARGET_OUT)
$( 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) \
2019-05-07 22:12:21 +02:00
$( INTERNAL_USERDATAIMAGE_FILES)
2017-03-25 00:06:31 +01:00
$(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
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 )
2019-06-24 21:39:10 +02:00
PATH = $( INTERNAL_USERIMAGES_BINARY_PATHS) :$$ PATH \
2019-05-07 22:12:21 +02:00
$( BUILD_IMAGE) \
$( TARGET_OUT_CACHE) $( cacheimage_intermediates) /cache_image_info.txt \
$( INSTALLED_CACHEIMAGE_TARGET) $( TARGET_OUT)
$( 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)
2019-05-07 22:12:21 +02:00
$(INSTALLED_CACHEIMAGE_TARGET) : $( INTERNAL_USERIMAGES_DEPS ) $( INTERNAL_CACHEIMAGE_FILES )
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) /%,\
2020-05-29 00:46:33 +02:00
$( ALL_DEFAULT_INSTALLED_MODULES) )
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 )
2019-06-11 01:39:45 +02:00
$(INSTALLED_FILES_FILE_SYSTEMOTHER) : $( INTERNAL_SYSTEMOTHERIMAGE_FILES ) $( FILESLIST ) $( FILESLIST_UTIL )
2016-06-16 23:47:10 +02:00
@echo Installed file list: $@
2021-03-06 22:29:28 +01:00
mkdir -p $( dir $@ )
rm -f $@
$( FILESLIST) $( TARGET_OUT_SYSTEM_OTHER) > $( @:.txt= .json)
$( FILESLIST_UTIL) -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 )
2019-06-24 21:39:10 +02:00
PATH = $( INTERNAL_USERIMAGES_BINARY_PATHS) :$$ PATH \
2019-05-07 22:12:21 +02:00
$( BUILD_IMAGE) \
$( TARGET_OUT_SYSTEM_OTHER) $( systemotherimage_intermediates) /system_other_image_info.txt \
$( INSTALLED_SYSTEMOTHERIMAGE_TARGET) $( TARGET_OUT)
$( call assert-max-image-size,$( INSTALLED_SYSTEMOTHERIMAGE_TARGET) ,$( BOARD_SYSTEMIMAGE_PARTITION_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) /%,\
2020-05-29 00:46:33 +02:00
$( ALL_DEFAULT_INSTALLED_MODULES) )
2013-03-20 19:02:05 +01:00
2015-09-15 23:22:12 +02:00
2019-07-04 00:58:48 +02: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
2020-08-27 00:08:57 +02:00
INTERNAL_VENDORIMAGE_FILES += $( call create-partition-compat-symlink,$( TARGET_OUT_VENDOR) /odm,/odm,odm.img)
2019-07-04 00:58:48 +02:00
e n d i f
2020-06-24 02:26:57 +02:00
# Create symlinks for vendor_dlkm on devices with a vendor_dlkm partition:
# /vendor/lib/modules -> /vendor_dlkm/lib/modules
#
# On devices with a vendor_dlkm partition,
# - /vendor/lib/modules is a symlink to a directory that stores vendor DLKMs.
# - /vendor_dlkm/{etc,...} store other vendor_dlkm files directly. The vendor_dlkm partition is
# mounted at /vendor_dlkm at runtime and the symlinks created in system/core/rootdir/Android.mk
# are hidden.
# On devices without a vendor_dlkm partition,
# - /vendor/lib/modules stores vendor DLKMs directly.
# - /vendor_dlkm/{etc,...} are symlinks to directories that store other vendor_dlkm files.
# See system/core/rootdir/Android.mk for a list of created symlinks.
# The vendor DLKMs and other vendor_dlkm files must not be accessed using other paths because they
# are not guaranteed to exist on all devices.
i f d e f B O A R D _ U S E S _ V E N D O R _ D L K M I M A G E
2020-08-27 00:08:57 +02:00
INTERNAL_VENDORIMAGE_FILES += $( call create-partition-compat-symlink,$( TARGET_OUT_VENDOR) /lib/modules,/vendor_dlkm/lib/modules,vendor_dlkm.img)
2020-06-24 02:26:57 +02:00
e n d i f
2020-08-27 00:08:57 +02:00
INSTALLED_FILES_FILE_VENDOR := $( PRODUCT_OUT) /installed-files-vendor.txt
INSTALLED_FILES_JSON_VENDOR := $( INSTALLED_FILES_FILE_VENDOR:.txt= .json)
$(INSTALLED_FILES_FILE_VENDOR) : .KATI_IMPLICIT_OUTPUTS := $( INSTALLED_FILES_JSON_VENDOR )
$(INSTALLED_FILES_FILE_VENDOR) : $( INTERNAL_VENDORIMAGE_FILES ) $( FILESLIST ) $( FILESLIST_UTIL )
@echo Installed file list: $@
2021-03-06 22:29:28 +01:00
mkdir -p $( dir $@ )
rm -f $@
$( FILESLIST) $( TARGET_OUT_VENDOR) > $( @:.txt= .json)
$( FILESLIST_UTIL) -c $( @:.txt= .json) > $@
2020-07-16 02:01:14 +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)
@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 )
2019-06-24 21:39:10 +02:00
PATH = $( INTERNAL_USERIMAGES_BINARY_PATHS) :$$ PATH \
2019-05-07 22:12:21 +02:00
$( BUILD_IMAGE) \
$( TARGET_OUT_VENDOR) $( vendorimage_intermediates) /vendor_image_info.txt \
$( INSTALLED_VENDORIMAGE_TARGET) $( TARGET_OUT)
2020-04-28 04:06:59 +02:00
$( call assert-max-image-size,$( INSTALLED_VENDORIMAGE_TARGET) $( RECOVERY_FROM_BOOT_PATCH) ,$( BOARD_VENDORIMAGE_PARTITION_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)
2019-05-07 22:12:21 +02:00
$(INSTALLED_VENDORIMAGE_TARGET) : \
$( INTERNAL_USERIMAGES_DEPS) \
$( INTERNAL_VENDORIMAGE_FILES) \
2020-04-28 04:06:59 +02:00
$( INSTALLED_FILES_FILE_VENDOR) \
$( RECOVERY_FROM_BOOT_PATCH)
2013-03-20 19:02:05 +01:00
$( build-vendorimage-target)
2017-03-07 21:10:09 +01:00
.PHONY : vendorimage -nodeps vnod
2019-06-05 20:53:43 +02:00
vendorimage-nodeps vnod : | $( INTERNAL_USERIMAGES_DEPS )
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) /%,\
2020-05-29 00:46:33 +02:00
$( ALL_DEFAULT_INSTALLED_MODULES) )
2017-11-27 09:04:47 +01:00
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 )
2019-06-11 01:39:45 +02:00
$(INSTALLED_FILES_FILE_PRODUCT) : $( INTERNAL_PRODUCTIMAGE_FILES ) $( FILESLIST ) $( FILESLIST_UTIL )
2017-11-27 09:04:47 +01:00
@echo Installed file list: $@
2021-03-06 22:29:28 +01:00
mkdir -p $( dir $@ )
rm -f $@
$( FILESLIST) $( TARGET_OUT_PRODUCT) > $( @:.txt= .json)
$( FILESLIST_UTIL) -c $( @:.txt= .json) > $@
2017-11-27 09:04:47 +01:00
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 )
2019-06-24 21:39:10 +02:00
PATH = $( INTERNAL_USERIMAGES_BINARY_PATHS) :$$ PATH \
2019-05-07 22:12:21 +02:00
$( BUILD_IMAGE) \
$( TARGET_OUT_PRODUCT) $( productimage_intermediates) /product_image_info.txt \
$( INSTALLED_PRODUCTIMAGE_TARGET) $( TARGET_OUT)
$( call assert-max-image-size,$( INSTALLED_PRODUCTIMAGE_TARGET) ,$( BOARD_PRODUCTIMAGE_PARTITION_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)
2019-05-07 22:12:21 +02:00
$(INSTALLED_PRODUCTIMAGE_TARGET) : \
$( INTERNAL_USERIMAGES_DEPS) \
$( INTERNAL_PRODUCTIMAGE_FILES) \
$( INSTALLED_FILES_FILE_PRODUCT)
2017-11-27 09:04:47 +01:00
$( 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
# -----------------------------------------------------------------
2019-06-25 08:58:13 +02:00
# system_ext partition image
i f d e f B U I L D I N G _ S Y S T E M _ E X T _ I M A G E
INTERNAL_SYSTEM_EXTIMAGE_FILES := \
$( filter $( TARGET_OUT_SYSTEM_EXT) /%,\
2020-05-29 00:46:33 +02:00
$( ALL_DEFAULT_INSTALLED_MODULES) )
2018-05-29 14:09:01 +02:00
2019-06-25 08:58:13 +02:00
INSTALLED_FILES_FILE_SYSTEM_EXT := $( PRODUCT_OUT) /installed-files-system_ext.txt
INSTALLED_FILES_JSON_SYSTEM_EXT := $( INSTALLED_FILES_FILE_SYSTEM_EXT:.txt= .json)
$(INSTALLED_FILES_FILE_SYSTEM_EXT) : .KATI_IMPLICIT_OUTPUTS := $( INSTALLED_FILES_JSON_SYSTEM_EXT )
$(INSTALLED_FILES_FILE_SYSTEM_EXT) : $( INTERNAL_SYSTEM_EXTIMAGE_FILES ) $( FILESLIST ) $( FILESLIST_UTIL )
2018-05-29 14:09:01 +02:00
@echo Installed file list: $@
2021-03-06 22:29:28 +01:00
mkdir -p $( dir $@ )
rm -f $@
$( FILESLIST) $( TARGET_OUT_SYSTEM_EXT) > $( @:.txt= .json)
$( FILESLIST_UTIL) -c $( @:.txt= .json) > $@
2018-05-29 14:09:01 +02:00
2019-06-25 08:58:13 +02:00
system_extimage_intermediates := \
$( call intermediates-dir-for,PACKAGING,system_ext)
BUILT_SYSTEM_EXTIMAGE_TARGET := $( PRODUCT_OUT) /system_ext.img
d e f i n e b u i l d - s y s t e m _ e x t i m a g e - t a r g e t
$( call pretty," Target system_ext fs image: $( INSTALLED_SYSTEM_EXTIMAGE_TARGET) " )
@mkdir -p $( TARGET_OUT_SYSTEM_EXT)
@mkdir -p $( system_extimage_intermediates) && rm -rf $( system_extimage_intermediates) /system_ext_image_info.txt
$( call generate-image-prop-dictionary, $( system_extimage_intermediates) /system_ext_image_info.txt,system_ext, skip_fsck = true )
2019-06-24 21:39:10 +02:00
PATH = $( INTERNAL_USERIMAGES_BINARY_PATHS) :$$ PATH \
2019-05-07 22:12:21 +02:00
$( BUILD_IMAGE) \
$( TARGET_OUT_SYSTEM_EXT) \
$( system_extimage_intermediates) /system_ext_image_info.txt \
$( INSTALLED_SYSTEM_EXTIMAGE_TARGET) \
$( TARGET_OUT)
$( call assert-max-image-size,$( INSTALLED_PRODUCT_SERVICESIMAGE_TARGET) ,$( BOARD_PRODUCT_SERVICESIMAGE_PARTITION_SIZE) )
2018-05-29 14:09:01 +02:00
e n d e f
# We just build this directly to the install location.
2019-06-25 08:58:13 +02:00
INSTALLED_SYSTEM_EXTIMAGE_TARGET := $( BUILT_SYSTEM_EXTIMAGE_TARGET)
2019-05-07 22:12:21 +02:00
$(INSTALLED_SYSTEM_EXTIMAGE_TARGET) : \
$( INTERNAL_USERIMAGES_DEPS) \
$( INTERNAL_SYSTEM_EXTIMAGE_FILES) \
$( INSTALLED_FILES_FILE_SYSTEM_EXT)
2019-06-25 08:58:13 +02:00
$( build-system_extimage-target)
2018-05-29 14:09:01 +02:00
2019-06-25 08:58:13 +02:00
.PHONY : systemextimage -nodeps senod
systemextimage-nodeps senod : | $( INTERNAL_USERIMAGES_DEPS )
$( build-system_extimage-target)
2018-05-29 14:09:01 +02:00
2019-06-25 08:58:13 +02:00
sync : $( INTERNAL_SYSTEM_EXTIMAGE_FILES )
2018-05-29 14:09:01 +02:00
2019-06-25 08:58:13 +02:00
e l s e i f d e f B O A R D _ P R E B U I L T _ S Y S T E M _ E X T I M A G E
INSTALLED_SYSTEM_EXTIMAGE_TARGET := $( PRODUCT_OUT) /system_ext.img
$( eval $ ( call copy -one -file ,$ ( BOARD_PREBUILT_SYSTEM_EXTIMAGE ) ,$ ( INSTALLED_SYSTEM_EXTIMAGE_TARGET ) ) )
2018-05-29 14:09:01 +02:00
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) /%,\
2020-05-29 00:46:33 +02:00
$( ALL_DEFAULT_INSTALLED_MODULES) )
2017-11-14 16:42:30 +01:00
2020-08-27 00:08:57 +02:00
# Create symlinks for odm_dlkm on devices with a odm_dlkm partition:
# /odm/lib/modules -> /odm_dlkm/lib/modules
#
# On devices with a odm_dlkm partition,
# - /odm/lib/modules is a symlink to a directory that stores odm DLKMs.
# - /odm_dlkm/{etc,...} store other odm_dlkm files directly. The odm_dlkm partition is
# mounted at /odm_dlkm at runtime and the symlinks created in system/core/rootdir/Android.mk
# are hidden.
# On devices without a odm_dlkm partition,
# - /odm/lib/modules stores odm DLKMs directly.
# - /odm_dlkm/{etc,...} are symlinks to directories that store other odm_dlkm files.
# See system/core/rootdir/Android.mk for a list of created symlinks.
# The odm DLKMs and other odm_dlkm files must not be accessed using other paths because they
# are not guaranteed to exist on all devices.
i f d e f B O A R D _ U S E S _ O D M _ D L K M I M A G E
INTERNAL_ODMIMAGE_FILES += $( call create-partition-compat-symlink,$( TARGET_OUT_ODM) /lib/modules,/odm_dlkm/lib/modules,odm_dlkm.img)
e n d i f
2017-11-14 16:42:30 +01:00
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 )
2019-06-11 01:39:45 +02:00
$(INSTALLED_FILES_FILE_ODM) : $( INTERNAL_ODMIMAGE_FILES ) $( FILESLIST ) $( FILESLIST_UTIL )
2017-11-14 16:42:30 +01:00
@echo Installed file list: $@
2021-03-06 22:29:28 +01:00
mkdir -p $( dir $@ )
rm -f $@
$( FILESLIST) $( TARGET_OUT_ODM) > $( @:.txt= .json)
$( FILESLIST_UTIL) -c $( @:.txt= .json) > $@
2017-11-14 16:42:30 +01:00
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
2021-08-28 01:43:09 +02:00
$( call generate-image-prop-dictionary, $( odmimage_intermediates) /odm_image_info.txt, odm, \
skip_fsck = true )
2019-06-24 21:39:10 +02:00
PATH = $( INTERNAL_USERIMAGES_BINARY_PATHS) :$$ PATH \
2019-05-07 22:12:21 +02:00
$( BUILD_IMAGE) \
$( TARGET_OUT_ODM) $( odmimage_intermediates) /odm_image_info.txt \
$( INSTALLED_ODMIMAGE_TARGET) $( TARGET_OUT)
$( call assert-max-image-size,$( INSTALLED_ODMIMAGE_TARGET) ,$( BOARD_ODMIMAGE_PARTITION_SIZE) )
2017-11-14 16:42:30 +01:00
e n d e f
# We just build this directly to the install location.
INSTALLED_ODMIMAGE_TARGET := $( BUILT_ODMIMAGE_TARGET)
2019-05-07 22:12:21 +02:00
$(INSTALLED_ODMIMAGE_TARGET) : \
$( INTERNAL_USERIMAGES_DEPS) \
$( INTERNAL_ODMIMAGE_FILES) \
$( INSTALLED_FILES_FILE_ODM)
2017-11-14 16:42:30 +01:00
$( build-odmimage-target)
.PHONY : odmimage -nodeps onod
2019-06-05 20:53:43 +02:00
odmimage-nodeps onod : | $( INTERNAL_USERIMAGES_DEPS )
2017-11-14 16:42:30 +01:00
$( 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
2020-05-07 23:58:20 +02:00
# -----------------------------------------------------------------
# vendor_dlkm partition image
i f d e f B U I L D I N G _ V E N D O R _ D L K M _ I M A G E
INTERNAL_VENDOR_DLKMIMAGE_FILES := \
$( filter $( TARGET_OUT_VENDOR_DLKM) /%,\
2020-05-29 00:46:33 +02:00
$( ALL_DEFAULT_INSTALLED_MODULES) )
2020-05-07 23:58:20 +02:00
INSTALLED_FILES_FILE_VENDOR_DLKM := $( PRODUCT_OUT) /installed-files-vendor_dlkm.txt
INSTALLED_FILES_JSON_VENDOR_DLKM := $( INSTALLED_FILES_FILE_VENDOR_DLKM:.txt= .json)
$(INSTALLED_FILES_FILE_VENDOR_DLKM) : .KATI_IMPLICIT_OUTPUTS := $( INSTALLED_FILES_JSON_VENDOR_DLKM )
$(INSTALLED_FILES_FILE_VENDOR_DLKM) : $( INTERNAL_VENDOR_DLKMIMAGE_FILES ) $( FILESLIST ) $( FILESLIST_UTIL )
@echo Installed file list: $@
2021-03-06 22:29:28 +01:00
mkdir -p $( dir $@ )
rm -f $@
$( FILESLIST) $( TARGET_OUT_VENDOR_DLKM) > $( @:.txt= .json)
$( FILESLIST_UTIL) -c $( @:.txt= .json) > $@
2020-05-07 23:58:20 +02:00
vendor_dlkmimage_intermediates := \
$( call intermediates-dir-for,PACKAGING,vendor_dlkm)
BUILT_VENDOR_DLKMIMAGE_TARGET := $( PRODUCT_OUT) /vendor_dlkm.img
d e f i n e b u i l d - v e n d o r _ d l k m i m a g e - t a r g e t
$( call pretty," Target vendor_dlkm fs image: $( INSTALLED_VENDOR_DLKMIMAGE_TARGET) " )
@mkdir -p $( TARGET_OUT_VENDOR_DLKM)
@mkdir -p $( vendor_dlkmimage_intermediates) && rm -rf $( vendor_dlkmimage_intermediates) /vendor_dlkm_image_info.txt
2021-08-28 01:43:09 +02:00
$( call generate-image-prop-dictionary, $( vendor_dlkmimage_intermediates) /vendor_dlkm_image_info.txt, \
vendor_dlkm, skip_fsck = true )
2020-05-07 23:58:20 +02:00
PATH = $( INTERNAL_USERIMAGES_BINARY_PATHS) :$$ PATH \
$( BUILD_IMAGE) \
$( TARGET_OUT_VENDOR_DLKM) $( vendor_dlkmimage_intermediates) /vendor_dlkm_image_info.txt \
$( INSTALLED_VENDOR_DLKMIMAGE_TARGET) $( TARGET_OUT)
$( call assert-max-image-size,$( INSTALLED_VENDOR_DLKMIMAGE_TARGET) ,$( BOARD_VENDOR_DLKMIMAGE_PARTITION_SIZE) )
e n d e f
# We just build this directly to the install location.
INSTALLED_VENDOR_DLKMIMAGE_TARGET := $( BUILT_VENDOR_DLKMIMAGE_TARGET)
$(INSTALLED_VENDOR_DLKMIMAGE_TARGET) : \
$( INTERNAL_USERIMAGES_DEPS) \
$( INTERNAL_VENDOR_DLKMIMAGE_FILES) \
$( INSTALLED_FILES_FILE_VENDOR_DLKM)
$( build-vendor_dlkmimage-target)
.PHONY : vendor_dlkmimage -nodeps vdnod
vendor_dlkmimage-nodeps vdnod : | $( INTERNAL_USERIMAGES_DEPS )
$( build-vendor_dlkmimage-target)
sync : $( INTERNAL_VENDOR_DLKMIMAGE_FILES )
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 _ D L K M I M A G E
INSTALLED_VENDOR_DLKMIMAGE_TARGET := $( PRODUCT_OUT) /vendor_dlkm.img
$( eval $ ( call copy -one -file ,$ ( BOARD_PREBUILT_VENDOR_DLKMIMAGE ) ,$ ( INSTALLED_VENDOR_DLKMIMAGE_TARGET ) ) )
e n d i f
2020-07-16 01:52:59 +02:00
# -----------------------------------------------------------------
# odm_dlkm partition image
i f d e f B U I L D I N G _ O D M _ D L K M _ I M A G E
INTERNAL_ODM_DLKMIMAGE_FILES := \
$( filter $( TARGET_OUT_ODM_DLKM) /%,\
2020-05-29 00:46:33 +02:00
$( ALL_DEFAULT_INSTALLED_MODULES) )
2020-07-16 01:52:59 +02:00
INSTALLED_FILES_FILE_ODM_DLKM := $( PRODUCT_OUT) /installed-files-odm_dlkm.txt
INSTALLED_FILES_JSON_ODM_DLKM := $( INSTALLED_FILES_FILE_ODM_DLKM:.txt= .json)
$(INSTALLED_FILES_FILE_ODM_DLKM) : .KATI_IMPLICIT_OUTPUTS := $( INSTALLED_FILES_JSON_ODM_DLKM )
$(INSTALLED_FILES_FILE_ODM_DLKM) : $( INTERNAL_ODM_DLKMIMAGE_FILES ) $( FILESLIST ) $( FILESLIST_UTIL )
@echo Installed file list: $@
2021-03-06 22:29:28 +01:00
mkdir -p $( dir $@ )
rm -f $@
$( FILESLIST) $( TARGET_OUT_ODM_DLKM) > $( @:.txt= .json)
$( FILESLIST_UTIL) -c $( @:.txt= .json) > $@
2020-07-16 01:52:59 +02:00
odm_dlkmimage_intermediates := \
$( call intermediates-dir-for,PACKAGING,odm_dlkm)
BUILT_ODM_DLKMIMAGE_TARGET := $( PRODUCT_OUT) /odm_dlkm.img
d e f i n e b u i l d - o d m _ d l k m i m a g e - t a r g e t
$( call pretty," Target odm_dlkm fs image: $( INSTALLED_ODM_DLKMIMAGE_TARGET) " )
@mkdir -p $( TARGET_OUT_ODM_DLKM)
@mkdir -p $( odm_dlkmimage_intermediates) && rm -rf $( odm_dlkmimage_intermediates) /odm_dlkm_image_info.txt
2021-08-28 01:43:09 +02:00
$( call generate-image-prop-dictionary, $( odm_dlkmimage_intermediates) /odm_dlkm_image_info.txt, \
odm_dlkm, skip_fsck = true )
2020-07-16 01:52:59 +02:00
PATH = $( INTERNAL_USERIMAGES_BINARY_PATHS) :$$ PATH \
$( BUILD_IMAGE) \
$( TARGET_OUT_ODM_DLKM) $( odm_dlkmimage_intermediates) /odm_dlkm_image_info.txt \
$( INSTALLED_ODM_DLKMIMAGE_TARGET) $( TARGET_OUT)
$( call assert-max-image-size,$( INSTALLED_ODM_DLKMIMAGE_TARGET) ,$( BOARD_ODM_DLKMIMAGE_PARTITION_SIZE) )
e n d e f
# We just build this directly to the install location.
INSTALLED_ODM_DLKMIMAGE_TARGET := $( BUILT_ODM_DLKMIMAGE_TARGET)
$(INSTALLED_ODM_DLKMIMAGE_TARGET) : \
$( INTERNAL_USERIMAGES_DEPS) \
$( INTERNAL_ODM_DLKMIMAGE_FILES) \
$( INSTALLED_FILES_FILE_ODM_DLKM)
$( build-odm_dlkmimage-target)
.PHONY : odm_dlkmimage -nodeps odnod
odm_dlkmimage-nodeps odnod : | $( INTERNAL_USERIMAGES_DEPS )
$( build-odm_dlkmimage-target)
sync : $( INTERNAL_ODM_DLKMIMAGE_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 _ D L K M I M A G E
INSTALLED_ODM_DLKMIMAGE_TARGET := $( PRODUCT_OUT) /odm_dlkm.img
$( eval $ ( call copy -one -file ,$ ( BOARD_PREBUILT_ODM_DLKMIMAGE ) ,$ ( INSTALLED_ODM_DLKMIMAGE_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
2020-11-29 15:04:28 +01:00
# -----------------------------------------------------------------
# Protected VM firmware image
i f d e f B O A R D _ P R E B U I L T _ P V M F W I M A G E
INSTALLED_PVMFWIMAGE_TARGET := $( PRODUCT_OUT) /pvmfw.img
i f e q ( $( BOARD_AVB_ENABLE ) , t r u e )
$(INSTALLED_PVMFWIMAGE_TARGET) : $( BOARD_PREBUILT_PVMFWIMAGE ) $( AVBTOOL ) $( BOARD_AVB_PVMFW_KEY_PATH )
cp $( BOARD_PREBUILT_PVMFWIMAGE) $@
$( AVBTOOL) add_hash_footer \
--image $@ \
--partition_size $( BOARD_PVMFWIMG_PARTITION_SIZE) \
--partition_name pvmfw $( INTERNAL_AVB_PVMFW_SIGNING_ARGS) \
$( BOARD_AVB_PVMFW_ADD_HASH_FOOTER_ARGS)
e l s e
$(INSTALLED_PVMFWIMAGE_TARGET) : $( BOARD_PREBUILT_PVMFWIMAGE )
cp $( BOARD_PREBUILT_PVMFWIMAGE) $@
e n d i f
e n d i f # BOARD_PREBUILT_PVMFWIMAGE
2018-08-23 07:53:41 +02:00
# 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".
2019-06-25 08:58:13 +02:00
# (1): list of partitions like "system", "vendor" or "system product system_ext".
2018-08-23 07:53:41 +02:00
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
2021-05-14 00:44:43 +02:00
$( strip $ ( foreach item ,$ ( 1) ,$ ( if $ ( filter $ ( item ) ,system_other ) ,$ ( INSTALLED_SYSTEMOTHERIMAGE_TARGET ) ,$ ( INSTALLED_ $ ( call to -upper ,$ ( item ) ) IMAGE_TARGET ) ) ) )
2018-08-23 07:53:41 +02:00
e n d e f
2017-04-27 09:34:50 +02:00
Add options to sign the prebuilt custom images.
The custom images are any images owned by OEMs and SoCs, oem images
mounted on /oem is an example. The oem images can be used to customize
devices for different carriers, like wallpaper, ringtones, and
carrier-specific apks. OEMs can generate multiple oem images, like
oem.img, oem-carrier1.img and oem-carrier2.img and flash different oem
images for different carriers. The oem images are only one case, OEMs
and SoCs can add more custom images and mount them to custom partitions.
This change enables custom images to be vbmeta.img chained partitions.
The following configuration in BoardConfig.mk is an exmaple. It has two
custom partitions: oem and test. They will be signed by different keys.
And they will be chained by vbmeta.img. The custom images here are
prebuilts, which can be built by `make custom_images` separately.
BOARD_AVB_<CUSTOM_PARTITION>_IMAGE_LIST should include all custom images
to apply AVB signing. And to every custom partition, one image whose
name is partition name must be added in its
BOARD_AVB_<CUSTOM_PARTITION>_IMAGE_LIST.
BOARD_CUSTOMIMAGES_PARTITION_LIST := oem test
BOARD_AVB_OEM_KEY_PATH := external/avb/test/data/testkey_rsa4096.pem
BOARD_AVB_OEM_ALGORITHM := SHA256_RSA4096
BOARD_AVB_OEM_ADD_HASHTREE_FOOTER_ARGS :=
BOARD_AVB_OEM_ROLLBACK_INDEX_LOCATION := 1
BOARD_AVB_OEM_PARTITION_SIZE := 5242880
BOARD_AVB_OEM_IMAGE_LIST := \
device/xxxx/yyyy/oem/oem.img \
device/xxxx/yyyy/oem/oem1.img
BOARD_AVB_TEST_KEY_PATH := external/avb/test/data/testkey_rsa2048.pem
BOARD_AVB_TEST_ALGORITHM := SHA256_RSA2048
BOARD_AVB_TEST_ADD_HASHTREE_FOOTER_ARGS :=
BOARD_AVB_TEST_ROLLBACK_INDEX_LOCATION := 2
BOARD_AVB_TEST_PARTITION_SIZE := 10485760
BOARD_AVB_TEST_IMAGE_LIST := \
device/xxxx/yyyy/test/test.img \
device/xxxx/yyyy/test/test1.img
To resign the custom images in the target zip file, the
avb_extra_custom_image_key, avb_extra_custom_image_algorithms and
avb_extra_custom_image_extra_args options are added to the
sign_target_files_apks tool too. The following test cases list some
examples about how to use them.
BUG: 154171021
Test: 1) "atest --host releasetools_test releasetools_py3_test -c"
2) Build images by 'make dist', sign and validate target files.
a) Test on dist w/ chained vbmeta_system and ome custom images
sign_target_files_apks -d certs \
--avb_extra_custom_image_key oem=oem_rsa4096.pem \
--avb_extra_custom_image_algorithm oem=SHA256_RSA4096 \
xxx-target_xxx.zip signed.zip
validate_target_files.py signed.zip
Flash image and boot up.
Verify the oem images and vbmeta images in OUT and target zips by
avbtool.
b) Test on dist w/ chained vbmeta_system and oem and test custom images
sign_target_files_apks -d certs \
--avb_extra_custom_image_key oem=oem_rsa4096.pem \
--avb_extra_custom_image_algorithm oem=SHA256_RSA4096 \
--avb_extra_custom_image_extra_args oem=--do_not_generate_fec \
--avb_extra_custom_image_key test=test_rsa4096.pem \
--avb_extra_custom_image_algorithm test=SHA256_RSA4096 \
xxx-target_xxx.zip signed.zip
validate_target_files.py signed.zip
Verify the oem, test images and vbmeta images in OUT and target zips
by avbtool.
c) Test on dist w/o chained partition.
sign_target_files_apks -d certs xxx-target_xxx.zip signed.zip
validate_target_files.py signed.zip
Flash image and boot up.
Verify the vbmeta images in OUT and target zips by avbtool.
Change-Id: Ifccfee5e8909697eef6ccda0cc352fa16a9f6db6
2020-04-28 03:36:36 +02:00
# -----------------------------------------------------------------
# custom images
INSTALLED_CUSTOMIMAGES_TARGET :=
i f n e q ( $( strip $ ( BOARD_CUSTOMIMAGES_PARTITION_LIST ) ) , )
INTERNAL_AVB_CUSTOMIMAGES_SIGNING_ARGS :=
# Sign custom image.
# $(1): the prebuilt custom image.
# $(2): the mount point of the prebuilt custom image.
# $(3): the signed custom image target.
d e f i n e s i g n _ c u s t o m _ i m a g e
$(3) : $( 1) $( INTERNAL_USERIMAGES_DEPS )
@echo Target custom image: $( 3)
mkdir -p $( dir $( 3) )
cp $( 1) $( 3)
i f e q ( $( BOARD_AVB_ENABLE ) , t r u e )
PATH = $( INTERNAL_USERIMAGES_BINARY_PATHS) :$$ $$ PATH \
$( AVBTOOL) add_hashtree_footer \
--image $( 3) \
--key $( BOARD_AVB_$( call to-upper,$( 2) ) _KEY_PATH) \
--algorithm $( BOARD_AVB_$( call to-upper,$( 2) ) _ALGORITHM) \
--partition_size $( BOARD_AVB_$( call to-upper,$( 2) ) _PARTITION_SIZE) \
--partition_name $( 2) \
$( INTERNAL_AVB_CUSTOMIMAGES_SIGNING_ARGS) \
$( BOARD_AVB_$( call to-upper,$( 2) ) _ADD_HASHTREE_FOOTER_ARGS)
e n d i f
INSTALLED_CUSTOMIMAGES_TARGET += $( 3)
e n d e f
$( foreach partition ,$ ( BOARD_CUSTOMIMAGES_PARTITION_LIST ) , \
$( foreach image,$( BOARD_AVB_$( call to-upper,$( partition) ) _IMAGE_LIST) , \
$( eval $( call sign_custom_image,$( image) ,$( partition) ,$( PRODUCT_OUT) /$( notdir $( image) ) ) ) ) )
e n d i f
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-02-27 03:15:51 +01:00
$(INSTALLED_PRODUCT_SYSTEM_OTHER_AVBKEY_TARGET) : $( AVBTOOL ) $( BOARD_AVB_SYSTEM_OTHER_KEY_PATH )
@echo Extracting system_other avb key: $@
@rm -f $@
@mkdir -p $( dir $@ )
$( AVBTOOL) extract_public_key --key $( BOARD_AVB_SYSTEM_OTHER_KEY_PATH) --output $@
2019-01-30 07:53:57 +01:00
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-09-20 16:45:06 +02:00
# When building a standalone recovery image for non-A/B devices, recovery image must be self-signed
# to be verified independently, and cannot be chained into vbmeta.img. See the link below for
# details.
2020-04-17 19:08:10 +02:00
i f e q ( $( TARGET_OTA_ALLOW_NON_AB ) , t r u e )
2019-09-20 16:45:06 +02:00
i f n e q ( $( INSTALLED_RECOVERYIMAGE_TARGET ) , )
$( if $ ( BOARD_AVB_RECOVERY_KEY_PATH ) ,,\
2020-04-17 19:08:10 +02:00
$( error BOARD_AVB_RECOVERY_KEY_PATH must be defined for if non-A/B is supported. \
2019-09-20 16:45:06 +02:00
See https://android.googlesource.com/platform/external/avb/+/master/README.md#booting-into-recovery) )
e n d i f
e n d i f
2019-05-14 10:57:03 +02:00
# Appends os version and security patch level as a AVB property descriptor
2019-01-30 14:52:32 +01:00
BOARD_AVB_SYSTEM_ADD_HASHTREE_FOOTER_ARGS += \
2019-10-09 09:04:28 +02:00
--prop com.android.build.system.fingerprint:$( BUILD_FINGERPRINT_FROM_FILE) \
2019-10-23 00:58:17 +02:00
--prop com.android.build.system.os_version:$( PLATFORM_VERSION_LAST_STABLE) \
2019-01-30 14:52:32 +01:00
--prop com.android.build.system.security_patch:$( PLATFORM_SECURITY_PATCH)
BOARD_AVB_PRODUCT_ADD_HASHTREE_FOOTER_ARGS += \
2019-10-09 09:04:28 +02:00
--prop com.android.build.product.fingerprint:$( BUILD_FINGERPRINT_FROM_FILE) \
2019-10-23 00:58:17 +02:00
--prop com.android.build.product.os_version:$( PLATFORM_VERSION_LAST_STABLE) \
2019-01-30 14:52:32 +01:00
--prop com.android.build.product.security_patch:$( PLATFORM_SECURITY_PATCH)
2019-06-25 08:58:13 +02:00
BOARD_AVB_SYSTEM_EXT_ADD_HASHTREE_FOOTER_ARGS += \
2019-10-09 09:04:28 +02:00
--prop com.android.build.system_ext.fingerprint:$( BUILD_FINGERPRINT_FROM_FILE) \
2019-10-23 00:58:17 +02:00
--prop com.android.build.system_ext.os_version:$( PLATFORM_VERSION_LAST_STABLE) \
2019-06-25 08:58:13 +02:00
--prop com.android.build.system_ext.security_patch:$( PLATFORM_SECURITY_PATCH)
2019-01-30 14:52:32 +01:00
2019-05-14 10:57:03 +02:00
BOARD_AVB_BOOT_ADD_HASH_FOOTER_ARGS += \
2019-10-09 09:04:28 +02:00
--prop com.android.build.boot.fingerprint:$( BUILD_FINGERPRINT_FROM_FILE) \
2019-10-23 00:58:17 +02:00
--prop com.android.build.boot.os_version:$( PLATFORM_VERSION_LAST_STABLE)
2019-05-14 10:57:03 +02:00
2019-10-09 09:04:28 +02:00
BOARD_AVB_VENDOR_BOOT_ADD_HASH_FOOTER_ARGS += \
--prop com.android.build.vendor_boot.fingerprint:$( BUILD_FINGERPRINT_FROM_FILE) \
BOARD_AVB_RECOVERY_ADD_HASH_FOOTER_ARGS += \
--prop com.android.build.recovery.fingerprint:$( BUILD_FINGERPRINT_FROM_FILE)
2019-05-14 10:57:03 +02:00
BOARD_AVB_VENDOR_ADD_HASHTREE_FOOTER_ARGS += \
2019-10-09 09:04:28 +02:00
--prop com.android.build.vendor.fingerprint:$( BUILD_FINGERPRINT_FROM_FILE) \
2019-10-23 00:58:17 +02:00
--prop com.android.build.vendor.os_version:$( PLATFORM_VERSION_LAST_STABLE)
2019-05-14 10:57:03 +02:00
BOARD_AVB_ODM_ADD_HASHTREE_FOOTER_ARGS += \
2019-10-09 09:04:28 +02:00
--prop com.android.build.odm.fingerprint:$( BUILD_FINGERPRINT_FROM_FILE) \
2019-10-23 00:58:17 +02:00
--prop com.android.build.odm.os_version:$( PLATFORM_VERSION_LAST_STABLE)
2019-05-14 10:57:03 +02:00
2020-05-07 23:58:20 +02:00
BOARD_AVB_VENDOR_DLKM_ADD_HASHTREE_FOOTER_ARGS += \
--prop com.android.build.vendor_dlkm.fingerprint:$( BUILD_FINGERPRINT_FROM_FILE) \
--prop com.android.build.vendor_dlkm.os_version:$( PLATFORM_VERSION_LAST_STABLE)
2020-07-16 01:52:59 +02:00
BOARD_AVB_ODM_DLKM_ADD_HASHTREE_FOOTER_ARGS += \
--prop com.android.build.odm_dlkm.fingerprint:$( BUILD_FINGERPRINT_FROM_FILE) \
--prop com.android.build.odm_dlkm.os_version:$( PLATFORM_VERSION_LAST_STABLE)
2019-10-09 09:04:28 +02:00
BOARD_AVB_DTBO_ADD_HASH_FOOTER_ARGS += \
--prop com.android.build.dtbo.fingerprint:$( BUILD_FINGERPRINT_FROM_FILE)
2020-11-29 15:04:28 +01:00
BOARD_AVB_PVMFW_ADD_HASH_FOOTER_ARGS += \
--prop com.android.build.pvmfw.fingerprint:$( BUILD_FINGERPRINT_FROM_FILE)
2019-05-14 10:57:03 +02:00
# The following vendor- and odm-specific images needs explicit SPL set per board.
2019-01-30 14:52:32 +01:00
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
2020-05-07 23:58:20 +02:00
i f d e f V E N D O R _ D L K M _ S E C U R I T Y _ P A T C H
BOARD_AVB_VENDOR_DLKM_ADD_HASHTREE_FOOTER_ARGS += \
--prop com.android.build.vendor_dlkm.security_patch:$( VENDOR_DLKM_SECURITY_PATCH)
e n d i f
2020-07-16 01:52:59 +02:00
i f d e f O D M _ D L K M _ S E C U R I T Y _ P A T C H
BOARD_AVB_ODM_DLKM_ADD_HASHTREE_FOOTER_ARGS += \
--prop com.android.build.odm_dlkm.security_patch:$( ODM_DLKM_SECURITY_PATCH)
e n d i f
2020-11-29 15:04:28 +01:00
i f d e f P V M F W _ S E C U R I T Y _ P A T C H
BOARD_AVB_PVMFW_ADD_HASH_FOOTER_ARGS += \
--prop com.android.build.pvmfw.security_patch:$( PVMFW_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
2019-07-10 19:49:37 +02:00
VENDOR_BOOT_FOOTER_ARGS := BOARD_AVB_VENDOR_BOOT_ADD_HASH_FOOTER_ARGS
2017-05-26 12:30:04 +02:00
DTBO_FOOTER_ARGS := BOARD_AVB_DTBO_ADD_HASH_FOOTER_ARGS
2020-11-29 15:04:28 +01:00
PVMFW_FOOTER_ARGS := BOARD_AVB_PVMFW_ADD_HASH_FOOTER_ARGS
2017-05-26 12:30:04 +02:00
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
2019-06-25 08:58:13 +02:00
SYSTEM_EXT_FOOTER_ARGS := BOARD_AVB_SYSTEM_EXT_ADD_HASHTREE_FOOTER_ARGS
2017-11-14 16:42:30 +01:00
ODM_FOOTER_ARGS := BOARD_AVB_ODM_ADD_HASHTREE_FOOTER_ARGS
2020-05-07 23:58:20 +02:00
VENDOR_DLKM_FOOTER_ARGS := BOARD_AVB_VENDOR_DLKM_ADD_HASHTREE_FOOTER_ARGS
2020-07-16 01:52:59 +02:00
ODM_DLKM_FOOTER_ARGS := BOARD_AVB_ODM_DLKM_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) ) )
2019-09-20 16:45:06 +02:00
# The recovery partition in non-A/B devices should be verified separately. Skip adding the chain
# partition descriptor for recovery partition into vbmeta.img.
2020-04-17 19:08:10 +02:00
$( if $ ( or $ ( filter -out true ,$ ( TARGET_OTA_ALLOW_NON_AB ) ) ,$ ( filter -out recovery ,$ ( part ) ) ) ,\
2019-09-20 16:45:06 +02:00
$( eval INTERNAL_AVB_MAKE_VBMETA_IMAGE_ARGS += \
--chain_partition $( part) :$( $( _rollback_index_location) ) :$( AVB_CHAIN_KEY_DIR) /$( part) .avbpubkey) )
2017-05-26 12:30:04 +02:00
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.
2020-06-09 04:54:13 +02:00
# Multiple boot images can be generated based on BOARD_KERNEL_BINARIES
# but vbmeta would capture the image descriptor of only the first boot
# image specified in BUILT_BOOTIMAGE_TARGET.
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) ,,\
2020-06-09 04:54:13 +02:00
$( if $( filter boot,$( 1) ) ,\
$( eval INTERNAL_AVB_MAKE_VBMETA_IMAGE_ARGS += \
--include_descriptors_from_image $( firstword $( call images-for-partitions,$( 1) ) ) ) ,\
$( 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
Add options to sign the prebuilt custom images.
The custom images are any images owned by OEMs and SoCs, oem images
mounted on /oem is an example. The oem images can be used to customize
devices for different carriers, like wallpaper, ringtones, and
carrier-specific apks. OEMs can generate multiple oem images, like
oem.img, oem-carrier1.img and oem-carrier2.img and flash different oem
images for different carriers. The oem images are only one case, OEMs
and SoCs can add more custom images and mount them to custom partitions.
This change enables custom images to be vbmeta.img chained partitions.
The following configuration in BoardConfig.mk is an exmaple. It has two
custom partitions: oem and test. They will be signed by different keys.
And they will be chained by vbmeta.img. The custom images here are
prebuilts, which can be built by `make custom_images` separately.
BOARD_AVB_<CUSTOM_PARTITION>_IMAGE_LIST should include all custom images
to apply AVB signing. And to every custom partition, one image whose
name is partition name must be added in its
BOARD_AVB_<CUSTOM_PARTITION>_IMAGE_LIST.
BOARD_CUSTOMIMAGES_PARTITION_LIST := oem test
BOARD_AVB_OEM_KEY_PATH := external/avb/test/data/testkey_rsa4096.pem
BOARD_AVB_OEM_ALGORITHM := SHA256_RSA4096
BOARD_AVB_OEM_ADD_HASHTREE_FOOTER_ARGS :=
BOARD_AVB_OEM_ROLLBACK_INDEX_LOCATION := 1
BOARD_AVB_OEM_PARTITION_SIZE := 5242880
BOARD_AVB_OEM_IMAGE_LIST := \
device/xxxx/yyyy/oem/oem.img \
device/xxxx/yyyy/oem/oem1.img
BOARD_AVB_TEST_KEY_PATH := external/avb/test/data/testkey_rsa2048.pem
BOARD_AVB_TEST_ALGORITHM := SHA256_RSA2048
BOARD_AVB_TEST_ADD_HASHTREE_FOOTER_ARGS :=
BOARD_AVB_TEST_ROLLBACK_INDEX_LOCATION := 2
BOARD_AVB_TEST_PARTITION_SIZE := 10485760
BOARD_AVB_TEST_IMAGE_LIST := \
device/xxxx/yyyy/test/test.img \
device/xxxx/yyyy/test/test1.img
To resign the custom images in the target zip file, the
avb_extra_custom_image_key, avb_extra_custom_image_algorithms and
avb_extra_custom_image_extra_args options are added to the
sign_target_files_apks tool too. The following test cases list some
examples about how to use them.
BUG: 154171021
Test: 1) "atest --host releasetools_test releasetools_py3_test -c"
2) Build images by 'make dist', sign and validate target files.
a) Test on dist w/ chained vbmeta_system and ome custom images
sign_target_files_apks -d certs \
--avb_extra_custom_image_key oem=oem_rsa4096.pem \
--avb_extra_custom_image_algorithm oem=SHA256_RSA4096 \
xxx-target_xxx.zip signed.zip
validate_target_files.py signed.zip
Flash image and boot up.
Verify the oem images and vbmeta images in OUT and target zips by
avbtool.
b) Test on dist w/ chained vbmeta_system and oem and test custom images
sign_target_files_apks -d certs \
--avb_extra_custom_image_key oem=oem_rsa4096.pem \
--avb_extra_custom_image_algorithm oem=SHA256_RSA4096 \
--avb_extra_custom_image_extra_args oem=--do_not_generate_fec \
--avb_extra_custom_image_key test=test_rsa4096.pem \
--avb_extra_custom_image_algorithm test=SHA256_RSA4096 \
xxx-target_xxx.zip signed.zip
validate_target_files.py signed.zip
Verify the oem, test images and vbmeta images in OUT and target zips
by avbtool.
c) Test on dist w/o chained partition.
sign_target_files_apks -d certs xxx-target_xxx.zip signed.zip
validate_target_files.py signed.zip
Flash image and boot up.
Verify the vbmeta images in OUT and target zips by avbtool.
Change-Id: Ifccfee5e8909697eef6ccda0cc352fa16a9f6db6
2020-04-28 03:36:36 +02:00
# Checks and sets build variables for a custom chained partition to include it into vbmeta.img.
# $(1): the custom partition to enable AVB chain.
d e f i n e c h e c k - a n d - s e t - c u s t o m - a v b - c h a i n - a r g s
$(eval part : = $( 1) )
$( eval PART =$ ( call to -upper ,$ ( part ) ) )
$(eval _rollback_index_location : = BOARD_AVB_ $( PART ) _ROLLBACK_INDEX_LOCATION )
$( if $ ( $ ( _rollback_index_location ) ) ,,$ ( error $ ( _rollback_index_location ) is not defined ) )
INTERNAL_AVB_MAKE_VBMETA_IMAGE_ARGS += \
--chain_partition $( part) :$( $( _rollback_index_location) ) :$( AVB_CHAIN_KEY_DIR) /$( part) .avbpubkey
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
2019-07-10 19:49:37 +02:00
i f d e f I N S T A L L E D _ V E N D O R _ B O O T I M A G E _ T A R G E T
$( eval $ ( call check -and -set -avb -args ,vendor_boot ) )
e n d i f
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
2019-06-25 08:58:13 +02:00
i f d e f I N S T A L L E D _ S Y S T E M _ E X T I M A G E _ T A R G E T
$( eval $ ( call check -and -set -avb -args ,system_ext ) )
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
2020-05-07 23:58:20 +02:00
i f d e f I N S T A L L E D _ V E N D O R _ D L K M I M A G E _ T A R G E T
$( eval $ ( call check -and -set -avb -args ,vendor_dlkm ) )
e n d i f
2020-07-16 01:52:59 +02:00
i f d e f I N S T A L L E D _ O D M _ D L K M I M A G E _ T A R G E T
$( eval $ ( call check -and -set -avb -args ,odm_dlkm ) )
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
2020-11-29 15:04:28 +01:00
i f d e f I N S T A L L E D _ P V M F W I M A G E _ T A R G E T
$( eval $ ( call check -and -set -avb -args ,pvmfw ) )
e n d i f
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
Add options to sign the prebuilt custom images.
The custom images are any images owned by OEMs and SoCs, oem images
mounted on /oem is an example. The oem images can be used to customize
devices for different carriers, like wallpaper, ringtones, and
carrier-specific apks. OEMs can generate multiple oem images, like
oem.img, oem-carrier1.img and oem-carrier2.img and flash different oem
images for different carriers. The oem images are only one case, OEMs
and SoCs can add more custom images and mount them to custom partitions.
This change enables custom images to be vbmeta.img chained partitions.
The following configuration in BoardConfig.mk is an exmaple. It has two
custom partitions: oem and test. They will be signed by different keys.
And they will be chained by vbmeta.img. The custom images here are
prebuilts, which can be built by `make custom_images` separately.
BOARD_AVB_<CUSTOM_PARTITION>_IMAGE_LIST should include all custom images
to apply AVB signing. And to every custom partition, one image whose
name is partition name must be added in its
BOARD_AVB_<CUSTOM_PARTITION>_IMAGE_LIST.
BOARD_CUSTOMIMAGES_PARTITION_LIST := oem test
BOARD_AVB_OEM_KEY_PATH := external/avb/test/data/testkey_rsa4096.pem
BOARD_AVB_OEM_ALGORITHM := SHA256_RSA4096
BOARD_AVB_OEM_ADD_HASHTREE_FOOTER_ARGS :=
BOARD_AVB_OEM_ROLLBACK_INDEX_LOCATION := 1
BOARD_AVB_OEM_PARTITION_SIZE := 5242880
BOARD_AVB_OEM_IMAGE_LIST := \
device/xxxx/yyyy/oem/oem.img \
device/xxxx/yyyy/oem/oem1.img
BOARD_AVB_TEST_KEY_PATH := external/avb/test/data/testkey_rsa2048.pem
BOARD_AVB_TEST_ALGORITHM := SHA256_RSA2048
BOARD_AVB_TEST_ADD_HASHTREE_FOOTER_ARGS :=
BOARD_AVB_TEST_ROLLBACK_INDEX_LOCATION := 2
BOARD_AVB_TEST_PARTITION_SIZE := 10485760
BOARD_AVB_TEST_IMAGE_LIST := \
device/xxxx/yyyy/test/test.img \
device/xxxx/yyyy/test/test1.img
To resign the custom images in the target zip file, the
avb_extra_custom_image_key, avb_extra_custom_image_algorithms and
avb_extra_custom_image_extra_args options are added to the
sign_target_files_apks tool too. The following test cases list some
examples about how to use them.
BUG: 154171021
Test: 1) "atest --host releasetools_test releasetools_py3_test -c"
2) Build images by 'make dist', sign and validate target files.
a) Test on dist w/ chained vbmeta_system and ome custom images
sign_target_files_apks -d certs \
--avb_extra_custom_image_key oem=oem_rsa4096.pem \
--avb_extra_custom_image_algorithm oem=SHA256_RSA4096 \
xxx-target_xxx.zip signed.zip
validate_target_files.py signed.zip
Flash image and boot up.
Verify the oem images and vbmeta images in OUT and target zips by
avbtool.
b) Test on dist w/ chained vbmeta_system and oem and test custom images
sign_target_files_apks -d certs \
--avb_extra_custom_image_key oem=oem_rsa4096.pem \
--avb_extra_custom_image_algorithm oem=SHA256_RSA4096 \
--avb_extra_custom_image_extra_args oem=--do_not_generate_fec \
--avb_extra_custom_image_key test=test_rsa4096.pem \
--avb_extra_custom_image_algorithm test=SHA256_RSA4096 \
xxx-target_xxx.zip signed.zip
validate_target_files.py signed.zip
Verify the oem, test images and vbmeta images in OUT and target zips
by avbtool.
c) Test on dist w/o chained partition.
sign_target_files_apks -d certs xxx-target_xxx.zip signed.zip
validate_target_files.py signed.zip
Flash image and boot up.
Verify the vbmeta images in OUT and target zips by avbtool.
Change-Id: Ifccfee5e8909697eef6ccda0cc352fa16a9f6db6
2020-04-28 03:36:36 +02:00
i f n e q ( $( strip $ ( BOARD_CUSTOMIMAGES_PARTITION_LIST ) ) , )
$( foreach partition ,$ ( BOARD_CUSTOMIMAGES_PARTITION_LIST ) , \
$( eval $( call check-and-set-custom-avb-chain-args,$( partition) ) ) )
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)
2019-07-10 19:49:37 +02:00
$( if $( BOARD_AVB_VENDOR_BOOT_KEY_PATH) ,\
$( AVBTOOL) extract_public_key --key $( BOARD_AVB_VENDOR_BOOT_KEY_PATH) \
--output $( 1) /vendor_boot.avbpubkey)
2017-05-26 12:30:04 +02:00
$( 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)
2019-06-25 08:58:13 +02:00
$( if $( BOARD_AVB_SYSTEM_EXT_KEY_PATH) ,\
$( hide) $( AVBTOOL) extract_public_key --key $( BOARD_AVB_SYSTEM_EXT_KEY_PATH) \
--output $( 1) /system_ext.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)
2020-05-07 23:58:20 +02:00
$( if $( BOARD_AVB_VENDOR_DLKM_KEY_PATH) ,\
$( hide) $( AVBTOOL) extract_public_key --key $( BOARD_AVB_VENDOR_DLKM_KEY_PATH) \
--output $( 1) /vendor_dlkm.avbpubkey)
2020-07-16 01:52:59 +02:00
$( if $( BOARD_AVB_ODM_DLKM_KEY_PATH) ,\
$( hide) $( AVBTOOL) extract_public_key --key $( BOARD_AVB_ODM_DLKM_KEY_PATH) \
--output $( 1) /odm_dlkm.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)
2020-11-29 15:04:28 +01:00
$( if $( BOARD_AVB_PVMFW_KEY_PATH) ,\
$( hide) $( AVBTOOL) extract_public_key --key $( BOARD_AVB_PVMFW_KEY_PATH) \
--output $( 1) /pvmfw.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)
Add options to sign the prebuilt custom images.
The custom images are any images owned by OEMs and SoCs, oem images
mounted on /oem is an example. The oem images can be used to customize
devices for different carriers, like wallpaper, ringtones, and
carrier-specific apks. OEMs can generate multiple oem images, like
oem.img, oem-carrier1.img and oem-carrier2.img and flash different oem
images for different carriers. The oem images are only one case, OEMs
and SoCs can add more custom images and mount them to custom partitions.
This change enables custom images to be vbmeta.img chained partitions.
The following configuration in BoardConfig.mk is an exmaple. It has two
custom partitions: oem and test. They will be signed by different keys.
And they will be chained by vbmeta.img. The custom images here are
prebuilts, which can be built by `make custom_images` separately.
BOARD_AVB_<CUSTOM_PARTITION>_IMAGE_LIST should include all custom images
to apply AVB signing. And to every custom partition, one image whose
name is partition name must be added in its
BOARD_AVB_<CUSTOM_PARTITION>_IMAGE_LIST.
BOARD_CUSTOMIMAGES_PARTITION_LIST := oem test
BOARD_AVB_OEM_KEY_PATH := external/avb/test/data/testkey_rsa4096.pem
BOARD_AVB_OEM_ALGORITHM := SHA256_RSA4096
BOARD_AVB_OEM_ADD_HASHTREE_FOOTER_ARGS :=
BOARD_AVB_OEM_ROLLBACK_INDEX_LOCATION := 1
BOARD_AVB_OEM_PARTITION_SIZE := 5242880
BOARD_AVB_OEM_IMAGE_LIST := \
device/xxxx/yyyy/oem/oem.img \
device/xxxx/yyyy/oem/oem1.img
BOARD_AVB_TEST_KEY_PATH := external/avb/test/data/testkey_rsa2048.pem
BOARD_AVB_TEST_ALGORITHM := SHA256_RSA2048
BOARD_AVB_TEST_ADD_HASHTREE_FOOTER_ARGS :=
BOARD_AVB_TEST_ROLLBACK_INDEX_LOCATION := 2
BOARD_AVB_TEST_PARTITION_SIZE := 10485760
BOARD_AVB_TEST_IMAGE_LIST := \
device/xxxx/yyyy/test/test.img \
device/xxxx/yyyy/test/test1.img
To resign the custom images in the target zip file, the
avb_extra_custom_image_key, avb_extra_custom_image_algorithms and
avb_extra_custom_image_extra_args options are added to the
sign_target_files_apks tool too. The following test cases list some
examples about how to use them.
BUG: 154171021
Test: 1) "atest --host releasetools_test releasetools_py3_test -c"
2) Build images by 'make dist', sign and validate target files.
a) Test on dist w/ chained vbmeta_system and ome custom images
sign_target_files_apks -d certs \
--avb_extra_custom_image_key oem=oem_rsa4096.pem \
--avb_extra_custom_image_algorithm oem=SHA256_RSA4096 \
xxx-target_xxx.zip signed.zip
validate_target_files.py signed.zip
Flash image and boot up.
Verify the oem images and vbmeta images in OUT and target zips by
avbtool.
b) Test on dist w/ chained vbmeta_system and oem and test custom images
sign_target_files_apks -d certs \
--avb_extra_custom_image_key oem=oem_rsa4096.pem \
--avb_extra_custom_image_algorithm oem=SHA256_RSA4096 \
--avb_extra_custom_image_extra_args oem=--do_not_generate_fec \
--avb_extra_custom_image_key test=test_rsa4096.pem \
--avb_extra_custom_image_algorithm test=SHA256_RSA4096 \
xxx-target_xxx.zip signed.zip
validate_target_files.py signed.zip
Verify the oem, test images and vbmeta images in OUT and target zips
by avbtool.
c) Test on dist w/o chained partition.
sign_target_files_apks -d certs xxx-target_xxx.zip signed.zip
validate_target_files.py signed.zip
Flash image and boot up.
Verify the vbmeta images in OUT and target zips by avbtool.
Change-Id: Ifccfee5e8909697eef6ccda0cc352fa16a9f6db6
2020-04-28 03:36:36 +02:00
$( if $( BOARD_CUSTOMIMAGES_PARTITION_LIST) ,\
$( hide) $( foreach partition,$( BOARD_CUSTOMIMAGES_PARTITION_LIST) , \
$( AVBTOOL) extract_public_key --key $( BOARD_AVB_$( call to-upper,$( partition) ) _KEY_PATH) \
--output $( 1) /$( partition) .avbpubkey; ) )
2018-08-21 06:09:07 +02:00
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
2019-06-25 08:58:13 +02:00
# := system system_ext`, `vbmeta_system.img` will be created that includes the descriptors for
# `system.img` and `system_ext.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
2019-04-16 19:06:13 +02: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
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
2019-04-16 19:06:13 +02:00
e n d i f # BUILDING_SYSTEM_IMAGE
2018-08-21 06:09:07 +02:00
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
2019-08-13 09:30:57 +02:00
i f d e f B U I L D I N G _ V B M E T A _ I M A G E
2017-03-31 09:21:26 +02:00
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) \
2019-07-10 19:49:37 +02:00
$( INSTALLED_VENDOR_BOOTIMAGE_TARGET) \
2018-11-26 19:12:05 +01:00
$( INSTALLED_SYSTEMIMAGE_TARGET) \
$( INSTALLED_VENDORIMAGE_TARGET) \
$( INSTALLED_PRODUCTIMAGE_TARGET) \
2019-06-25 08:58:13 +02:00
$( INSTALLED_SYSTEM_EXTIMAGE_TARGET) \
2018-11-26 19:12:05 +01:00
$( INSTALLED_ODMIMAGE_TARGET) \
2020-05-07 23:58:20 +02:00
$( INSTALLED_VENDOR_DLKMIMAGE_TARGET) \
2020-07-16 01:52:59 +02:00
$( INSTALLED_ODM_DLKMIMAGE_TARGET) \
2018-11-26 19:12:05 +01:00
$( INSTALLED_DTBOIMAGE_TARGET) \
2020-11-29 15:04:28 +01:00
$( INSTALLED_PVMFWIMAGE_TARGET) \
Add options to sign the prebuilt custom images.
The custom images are any images owned by OEMs and SoCs, oem images
mounted on /oem is an example. The oem images can be used to customize
devices for different carriers, like wallpaper, ringtones, and
carrier-specific apks. OEMs can generate multiple oem images, like
oem.img, oem-carrier1.img and oem-carrier2.img and flash different oem
images for different carriers. The oem images are only one case, OEMs
and SoCs can add more custom images and mount them to custom partitions.
This change enables custom images to be vbmeta.img chained partitions.
The following configuration in BoardConfig.mk is an exmaple. It has two
custom partitions: oem and test. They will be signed by different keys.
And they will be chained by vbmeta.img. The custom images here are
prebuilts, which can be built by `make custom_images` separately.
BOARD_AVB_<CUSTOM_PARTITION>_IMAGE_LIST should include all custom images
to apply AVB signing. And to every custom partition, one image whose
name is partition name must be added in its
BOARD_AVB_<CUSTOM_PARTITION>_IMAGE_LIST.
BOARD_CUSTOMIMAGES_PARTITION_LIST := oem test
BOARD_AVB_OEM_KEY_PATH := external/avb/test/data/testkey_rsa4096.pem
BOARD_AVB_OEM_ALGORITHM := SHA256_RSA4096
BOARD_AVB_OEM_ADD_HASHTREE_FOOTER_ARGS :=
BOARD_AVB_OEM_ROLLBACK_INDEX_LOCATION := 1
BOARD_AVB_OEM_PARTITION_SIZE := 5242880
BOARD_AVB_OEM_IMAGE_LIST := \
device/xxxx/yyyy/oem/oem.img \
device/xxxx/yyyy/oem/oem1.img
BOARD_AVB_TEST_KEY_PATH := external/avb/test/data/testkey_rsa2048.pem
BOARD_AVB_TEST_ALGORITHM := SHA256_RSA2048
BOARD_AVB_TEST_ADD_HASHTREE_FOOTER_ARGS :=
BOARD_AVB_TEST_ROLLBACK_INDEX_LOCATION := 2
BOARD_AVB_TEST_PARTITION_SIZE := 10485760
BOARD_AVB_TEST_IMAGE_LIST := \
device/xxxx/yyyy/test/test.img \
device/xxxx/yyyy/test/test1.img
To resign the custom images in the target zip file, the
avb_extra_custom_image_key, avb_extra_custom_image_algorithms and
avb_extra_custom_image_extra_args options are added to the
sign_target_files_apks tool too. The following test cases list some
examples about how to use them.
BUG: 154171021
Test: 1) "atest --host releasetools_test releasetools_py3_test -c"
2) Build images by 'make dist', sign and validate target files.
a) Test on dist w/ chained vbmeta_system and ome custom images
sign_target_files_apks -d certs \
--avb_extra_custom_image_key oem=oem_rsa4096.pem \
--avb_extra_custom_image_algorithm oem=SHA256_RSA4096 \
xxx-target_xxx.zip signed.zip
validate_target_files.py signed.zip
Flash image and boot up.
Verify the oem images and vbmeta images in OUT and target zips by
avbtool.
b) Test on dist w/ chained vbmeta_system and oem and test custom images
sign_target_files_apks -d certs \
--avb_extra_custom_image_key oem=oem_rsa4096.pem \
--avb_extra_custom_image_algorithm oem=SHA256_RSA4096 \
--avb_extra_custom_image_extra_args oem=--do_not_generate_fec \
--avb_extra_custom_image_key test=test_rsa4096.pem \
--avb_extra_custom_image_algorithm test=SHA256_RSA4096 \
xxx-target_xxx.zip signed.zip
validate_target_files.py signed.zip
Verify the oem, test images and vbmeta images in OUT and target zips
by avbtool.
c) Test on dist w/o chained partition.
sign_target_files_apks -d certs xxx-target_xxx.zip signed.zip
validate_target_files.py signed.zip
Flash image and boot up.
Verify the vbmeta images in OUT and target zips by avbtool.
Change-Id: Ifccfee5e8909697eef6ccda0cc352fa16a9f6db6
2020-04-28 03:36:36 +02:00
$( INSTALLED_CUSTOMIMAGES_TARGET) \
2018-11-26 19:12:05 +01:00
$( 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
2019-12-09 08:48:09 +01:00
vbmetaimage-nodeps : PRIVATE_AVB_VBMETA_SIGNING_ARGS := \
--algorithm $( BOARD_AVB_ALGORITHM) --key $( BOARD_AVB_KEY_PATH)
2017-03-31 09:21:26 +02:00
vbmetaimage-nodeps :
$( build-vbmetaimage-target)
2019-08-13 09:30:57 +02:00
e n d i f # BUILDING_VBMETA_IMAGE
2017-03-31 09:21:26 +02:00
e n d i f # BOARD_AVB_ENABLE
2021-01-14 03:19:54 +01:00
# List of files from all images
INTERNAL_ALLIMAGES_FILES := \
$( FULL_SYSTEMIMAGE_DEPS) \
$( INTERNAL_RAMDISK_FILES) \
$( INTERNAL_USERDATAIMAGE_FILES) \
$( INTERNAL_VENDORIMAGE_FILES) \
$( INTERNAL_PRODUCTIMAGE_FILES) \
$( INTERNAL_SYSTEM_EXTIMAGE_FILES) \
$( INTERNAL_ODMIMAGE_FILES) \
$( INTERNAL_VENDOR_DLKMIMAGE_FILES) \
$( INTERNAL_ODM_DLKMIMAGE_FILES) \
2020-01-14 22:35:45 +01:00
# -----------------------------------------------------------------
# Check VINTF of build
2020-09-15 21:07:39 +02:00
# Note: vendor_dlkm and odm_dlkm does not have VINTF files.
2020-06-04 16:16:39 +02:00
i f e q ( , $( TARGET_BUILD_UNBUNDLED ) )
2020-05-07 23:58:20 +02:00
2020-01-14 22:35:45 +01:00
intermediates := $( call intermediates-dir-for,PACKAGING,check_vintf_all)
check_vintf_all_deps :=
2020-01-21 21:46:57 +01:00
# The build system only writes VINTF metadata to */etc/vintf paths. Legacy paths aren't needed here
# because they are only used for prebuilt images.
check_vintf_common_srcs_patterns := \
$( TARGET_OUT) /etc/vintf/% \
$( TARGET_OUT_VENDOR) /etc/vintf/% \
$( TARGET_OUT_ODM) /etc/vintf/% \
$( TARGET_OUT_PRODUCT) /etc/vintf/% \
$( TARGET_OUT_SYSTEM_EXT) /etc/vintf/% \
2021-01-14 03:19:54 +01:00
check_vintf_common_srcs := $( sort $( filter $( check_vintf_common_srcs_patterns) ,$( INTERNAL_ALLIMAGES_FILES) ) )
2020-01-21 21:46:57 +01:00
check_vintf_common_srcs_patterns :=
check_vintf_has_system :=
check_vintf_has_vendor :=
2020-03-13 21:11:10 +01:00
i f n e q ( , $( filter EMPTY_ODM_SKU_PLACEHOLDER ,$ ( ODM_MANIFEST_SKUS ) ) )
$( error EMPTY_ODM_SKU_PLACEHOLDER is an internal variable and cannot be used for ODM_MANIFEST_SKUS )
e n d i f
i f n e q ( , $( filter EMPTY_VENDOR_SKU_PLACEHOLDER ,$ ( DEVICE_MANIFEST_SKUS ) ) )
$( error EMPTY_VENDOR_SKU_PLACEHOLDER is an internal variable and cannot be used for DEIVCE_MANIFEST_SKUS )
e n d i f
2020-01-14 22:36:00 +01:00
# -- Check system manifest / matrix including fragments (excluding other framework manifests / matrices, e.g. product);
2020-01-21 21:46:57 +01:00
check_vintf_system_deps := $( filter $( TARGET_OUT) /etc/vintf/%, $( check_vintf_common_srcs) )
i f n e q ( $( check_vintf_system_deps ) , )
check_vintf_has_system := true
2020-10-20 19:08:11 +02:00
2021-03-09 21:19:11 +01:00
check_vintf_system_log := $( intermediates) /check_vintf_system.log
2020-01-14 22:36:00 +01:00
check_vintf_all_deps += $( check_vintf_system_log)
2020-01-21 21:46:57 +01:00
$(check_vintf_system_log) : $( HOST_OUT_EXECUTABLES ) /checkvintf $( check_vintf_system_deps )
2020-01-14 22:36:00 +01:00
@( $< --check-one --dirmap /system:$( TARGET_OUT) > $@ 2>& 1 ) || ( cat $@ && exit 1 )
check_vintf_system_log :=
2020-10-20 19:08:11 +02:00
2021-03-09 21:19:11 +01:00
vintffm_log := $( intermediates) /vintffm.log
2020-10-20 19:08:11 +02:00
check_vintf_all_deps += $( vintffm_log)
$(vintffm_log) : $( HOST_OUT_EXECUTABLES ) /vintffm $( check_vintf_system_deps )
@( $< --check --dirmap /system:$( TARGET_OUT) \
$( VINTF_FRAMEWORK_MANIFEST_FROZEN_DIR) > $@ 2>& 1 ) || ( cat $@ && exit 1 )
2020-01-21 21:46:57 +01:00
e n d i f # check_vintf_system_deps
check_vintf_system_deps :=
2020-01-14 22:36:00 +01:00
# -- Check vendor manifest / matrix including fragments (excluding other device manifests / matrices)
2020-01-21 21:46:57 +01:00
check_vintf_vendor_deps := $( filter $( TARGET_OUT_VENDOR) /etc/vintf/%, $( check_vintf_common_srcs) )
i f n e q ( $( check_vintf_vendor_deps ) , )
check_vintf_has_vendor := true
2021-03-09 21:19:11 +01:00
check_vintf_vendor_log := $( intermediates) /check_vintf_vendor.log
2020-01-14 22:36:00 +01:00
check_vintf_all_deps += $( check_vintf_vendor_log)
2020-03-17 23:18:34 +01:00
# Check vendor SKU=(empty) case when:
# - DEVICE_MANIFEST_FILE is not empty; OR
# - DEVICE_MANIFEST_FILE is empty AND DEVICE_MANIFEST_SKUS is empty (only vendor manifest fragments are used)
2020-03-13 21:11:10 +01:00
$(check_vintf_vendor_log) : PRIVATE_VENDOR_SKUS := \
2020-03-17 23:18:34 +01:00
$( if $( DEVICE_MANIFEST_FILE) ,EMPTY_VENDOR_SKU_PLACEHOLDER,\
$( if $( DEVICE_MANIFEST_SKUS) ,,EMPTY_VENDOR_SKU_PLACEHOLDER) ) \
2020-03-13 21:11:10 +01:00
$( DEVICE_MANIFEST_SKUS)
2020-01-21 21:46:57 +01:00
$(check_vintf_vendor_log) : $( HOST_OUT_EXECUTABLES ) /checkvintf $( check_vintf_vendor_deps )
2020-03-13 21:11:10 +01:00
$( foreach vendor_sku,$( PRIVATE_VENDOR_SKUS) , \
( $< --check-one --dirmap /vendor:$( TARGET_OUT_VENDOR) \
--property ro.boot.product.vendor.sku= $( filter-out EMPTY_VENDOR_SKU_PLACEHOLDER,$( vendor_sku) ) \
> $@ 2>& 1 ) || ( cat $@ && exit 1 ) ; )
2020-01-14 22:36:00 +01:00
check_vintf_vendor_log :=
2020-01-21 21:46:57 +01:00
e n d i f # check_vintf_vendor_deps
check_vintf_vendor_deps :=
2020-01-14 22:36:00 +01:00
2020-01-14 22:35:45 +01:00
# -- Kernel version and configurations.
i f e q ( $( PRODUCT_OTA_ENFORCE_VINTF_KERNEL_REQUIREMENTS ) , t r u e )
2020-01-14 22:36:00 +01:00
BUILT_KERNEL_CONFIGS_FILE := $( intermediates) /kernel_configs.txt
BUILT_KERNEL_VERSION_FILE := $( intermediates) /kernel_version.txt
my_board_extracted_kernel :=
# 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_KERNEL_CONFIGS_FILE) : $( BOARD_KERNEL_CONFIG_FILE )
cp $< $@
$(BUILT_KERNEL_VERSION_FILE) :
echo $( BOARD_KERNEL_VERSION) > $@
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 )
# 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 \
2021-07-15 00:01:50 +02:00
e n d i f # my_board_extracted_kernel
i f n e q ( $( my_board_extracted_kernel ) , t r u e )
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
2020-01-14 22:36:00 +01:00
$(BUILT_KERNEL_CONFIGS_FILE) : .KATI_IMPLICIT_OUTPUTS := $( BUILT_KERNEL_VERSION_FILE )
$(BUILT_KERNEL_CONFIGS_FILE) : PRIVATE_DECOMPRESS_TOOLS := $( my_decompress_tools )
$(BUILT_KERNEL_CONFIGS_FILE) : $( foreach pair ,$ ( my_decompress_tools ) ,$ ( call word -colon ,2,$ ( pair ) ) )
2020-06-27 01:39:34 +02:00
$(BUILT_KERNEL_CONFIGS_FILE) : $( EXTRACT_KERNEL ) $( firstword $ ( INSTALLED_KERNEL_TARGET ) )
$< --tools $( PRIVATE_DECOMPRESS_TOOLS) --input $( firstword $( INSTALLED_KERNEL_TARGET) ) \
2020-01-14 22:36:00 +01:00
--output-configs $@ \
2020-11-14 03:33:01 +01:00
--output-release $( BUILT_KERNEL_VERSION_FILE)
2020-01-14 22:36:00 +01:00
2021-07-15 00:01:50 +02:00
my_board_extracted_kernel := true
e n d i f # INSTALLED_KERNEL_TARGET
e n d i f # my_board_extracted_kernel
i f n e q ( $( my_board_extracted_kernel ) , t r u e )
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
$(BUILT_KERNEL_CONFIGS_FILE) : .KATI_IMPLICIT_OUTPUTS := $( BUILT_KERNEL_VERSION_FILE )
$(BUILT_KERNEL_CONFIGS_FILE) : PRIVATE_DECOMPRESS_TOOLS := $( my_decompress_tools )
$(BUILT_KERNEL_CONFIGS_FILE) : $( foreach pair ,$ ( my_decompress_tools ) ,$ ( call word -colon ,2,$ ( pair ) ) )
$(BUILT_KERNEL_CONFIGS_FILE) : PRIVATE_UNPACKED_BOOTIMG := $( intermediates ) /unpacked_bootimage
$(BUILT_KERNEL_CONFIGS_FILE) : \
$( HOST_OUT_EXECUTABLES) /unpack_bootimg \
$( EXTRACT_KERNEL) \
$( INSTALLED_BOOTIMAGE_TARGET)
$( HOST_OUT_EXECUTABLES) /unpack_bootimg --boot_img $( INSTALLED_BOOTIMAGE_TARGET) --out $( PRIVATE_UNPACKED_BOOTIMG)
$( EXTRACT_KERNEL) --tools $( PRIVATE_DECOMPRESS_TOOLS) --input $( PRIVATE_UNPACKED_BOOTIMG) /kernel \
--output-configs $@ \
--output-release $( BUILT_KERNEL_VERSION_FILE)
2020-01-14 22:36:00 +01:00
2021-07-15 00:01:50 +02:00
my_board_extracted_kernel := true
e n d i f # INSTALLED_BOOTIMAGE_TARGET
2020-01-14 22:36:00 +01:00
e n d i f # my_board_extracted_kernel
2021-07-15 00:01:50 +02:00
i f n e q ( $( my_board_extracted_kernel ) , t r u e )
$( warning Neither INSTALLED_KERNEL_TARGET nor INSTALLED_BOOTIMAGE_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) Add a prebuilt boot image and specify it in BOARD_PREBUILT_BOOTIMAGE; or \
( 3) extracting kernel configuration and defining BOARD_KERNEL_CONFIG_FILE and \
BOARD_KERNEL_VERSION manually; or \
( 4) unsetting PRODUCT_OTA_ENFORCE_VINTF_KERNEL_REQUIREMENTS manually.)
# Clear their values to indicate that these two files does not exist.
BUILT_KERNEL_CONFIGS_FILE :=
BUILT_KERNEL_VERSION_FILE :=
e n d i f
my_decompress_tools :=
my_board_extracted_kernel :=
2020-01-14 22:36:00 +01:00
2021-03-17 19:25:31 +01:00
e n d i f # PRODUCT_OTA_ENFORCE_VINTF_KERNEL_REQUIREMENTS
# -- Check VINTF compatibility of build.
# Skip partial builds; only check full builds. Only check if:
# - PRODUCT_ENFORCE_VINTF_MANIFEST is true
# - system / vendor VINTF metadata exists
# - Building product / system_ext / odm images if board has product / system_ext / odm images
i f e q ( $( PRODUCT_ENFORCE_VINTF_MANIFEST ) , t r u e )
i f e q ( $( check_vintf_has_system ) , t r u e )
i f e q ( $( check_vintf_has_vendor ) , t r u e )
i f e q ( $( filter true ,$ ( BUILDING_ODM_IMAGE ) ) , $( filter true ,$ ( BOARD_USES_ODMIMAGE ) ) )
i f e q ( $( filter true ,$ ( BUILDING_PRODUCT_IMAGE ) ) , $( filter true ,$ ( BOARD_USES_PRODUCTIMAGE ) ) )
i f e q ( $( filter true ,$ ( BUILDING_SYSTEM_EXT_IMAGE ) ) , $( filter true ,$ ( BOARD_USES_SYSTEM_EXTIMAGE ) ) )
check_vintf_compatible_log := $( intermediates) /check_vintf_compatible.log
check_vintf_all_deps += $( check_vintf_compatible_log)
check_vintf_compatible_args :=
check_vintf_compatible_deps := $( check_vintf_common_srcs)
i f e q ( $( PRODUCT_OTA_ENFORCE_VINTF_KERNEL_REQUIREMENTS ) , t r u e )
2021-04-03 01:12:05 +02:00
i f n e q ( , $( BUILT_KERNEL_VERSION_FILE ) $( BUILT_KERNEL_CONFIGS_FILE ) )
2020-11-14 03:30:06 +01:00
check_vintf_compatible_args += --kernel $( BUILT_KERNEL_VERSION_FILE) :$( BUILT_KERNEL_CONFIGS_FILE)
2020-01-14 22:35:45 +01:00
check_vintf_compatible_deps += $( BUILT_KERNEL_CONFIGS_FILE) $( BUILT_KERNEL_VERSION_FILE)
2021-04-03 01:12:05 +02:00
e n d i f # BUILT_KERNEL_VERSION_FILE != "" || BUILT_KERNEL_CONFIGS_FILE != ""
2020-01-14 22:35:45 +01:00
e n d i f # PRODUCT_OTA_ENFORCE_VINTF_KERNEL_REQUIREMENTS
check_vintf_compatible_args += \
--dirmap /system:$( TARGET_OUT) \
--dirmap /vendor:$( TARGET_OUT_VENDOR) \
--dirmap /odm:$( TARGET_OUT_ODM) \
--dirmap /product:$( TARGET_OUT_PRODUCT) \
--dirmap /system_ext:$( TARGET_OUT_SYSTEM_EXT) \
i f d e f P R O D U C T _ S H I P P I N G _ A P I _ L E V E L
check_vintf_compatible_args += --property ro.product.first_api_level= $( PRODUCT_SHIPPING_API_LEVEL)
e n d i f # PRODUCT_SHIPPING_API_LEVEL
$(check_vintf_compatible_log) : PRIVATE_CHECK_VINTF_ARGS := $( check_vintf_compatible_args )
$(check_vintf_compatible_log) : PRIVATE_CHECK_VINTF_DEPS := $( check_vintf_compatible_deps )
2020-03-17 23:18:34 +01:00
# Check ODM SKU=(empty) case when:
# - ODM_MANIFEST_FILES is not empty; OR
# - ODM_MANIFEST_FILES is empty AND ODM_MANIFEST_SKUS is empty (only ODM manifest fragments are used)
2020-03-13 21:11:10 +01:00
$(check_vintf_compatible_log) : PRIVATE_ODM_SKUS := \
2020-03-17 23:18:34 +01:00
$( if $( ODM_MANIFEST_FILES) ,EMPTY_ODM_SKU_PLACEHOLDER,\
$( if $( ODM_MANIFEST_SKUS) ,,EMPTY_ODM_SKU_PLACEHOLDER) ) \
2020-03-13 21:11:10 +01:00
$( ODM_MANIFEST_SKUS)
2020-03-17 23:18:34 +01:00
# Check vendor SKU=(empty) case when:
# - DEVICE_MANIFEST_FILE is not empty; OR
# - DEVICE_MANIFEST_FILE is empty AND DEVICE_MANIFEST_SKUS is empty (only vendor manifest fragments are used)
2020-03-13 21:11:10 +01:00
$(check_vintf_compatible_log) : PRIVATE_VENDOR_SKUS := \
2020-03-17 23:18:34 +01:00
$( if $( DEVICE_MANIFEST_FILE) ,EMPTY_VENDOR_SKU_PLACEHOLDER,\
$( if $( DEVICE_MANIFEST_SKUS) ,,EMPTY_VENDOR_SKU_PLACEHOLDER) ) \
2020-03-13 21:11:10 +01:00
$( DEVICE_MANIFEST_SKUS)
2020-01-14 22:35:45 +01:00
$(check_vintf_compatible_log) : $( HOST_OUT_EXECUTABLES ) /checkvintf $( check_vintf_compatible_deps )
2021-03-11 03:10:05 +01:00
@echo " PRODUCT_OTA_ENFORCE_VINTF_KERNEL_REQUIREMENTS= $( PRODUCT_OTA_ENFORCE_VINTF_KERNEL_REQUIREMENTS) " > $@
@echo -n -e 'Deps: \n ' >> $@
2020-01-14 22:35:45 +01:00
@sed 's/ /\n /g' <<< " $( PRIVATE_CHECK_VINTF_DEPS) " >> $@
@echo -n -e 'Args: \n ' >> $@
@cat <<< " $( PRIVATE_CHECK_VINTF_ARGS) " >> $@
2020-03-13 21:11:10 +01:00
$( foreach odm_sku,$( PRIVATE_ODM_SKUS) , $( foreach vendor_sku,$( PRIVATE_VENDOR_SKUS) , \
echo " For ODM SKU = $( odm_sku) , vendor SKU = $( vendor_sku) " >> $@ ; \
2020-01-14 22:35:45 +01:00
( $< --check-compat $( PRIVATE_CHECK_VINTF_ARGS) \
2020-03-13 21:11:10 +01:00
--property ro.boot.product.hardware.sku= $( filter-out EMPTY_ODM_SKU_PLACEHOLDER,$( odm_sku) ) \
--property ro.boot.product.vendor.sku= $( filter-out EMPTY_VENDOR_SKU_PLACEHOLDER,$( vendor_sku) ) \
>> $@ 2>& 1 ) || ( cat $@ && exit 1) ; ) )
2020-01-14 22:35:45 +01:00
check_vintf_compatible_log :=
check_vintf_compatible_args :=
check_vintf_compatible_deps :=
e n d i f # BUILDING_SYSTEM_EXT_IMAGE equals BOARD_USES_SYSTEM_EXTIMAGE
e n d i f # BUILDING_PRODUCT_IMAGE equals BOARD_USES_PRODUCTIMAGE
e n d i f # BUILDING_ODM_IMAGE equals BOARD_USES_ODMIMAGE
2020-01-21 21:46:57 +01:00
e n d i f # check_vintf_has_vendor
e n d i f # check_vintf_has_system
2020-01-14 22:35:45 +01:00
e n d i f # PRODUCT_ENFORCE_VINTF_MANIFEST
# Add all logs of VINTF checks to dist builds
droid_targets : $( check_vintf_all_deps )
$( call dist -for -goals , droid_targets , $ ( check_vintf_all_deps ) )
# Helper alias to check all VINTF of current build.
.PHONY : check -vintf -all
check-vintf-all : $( check_vintf_all_deps )
$( foreach file,$^,echo " $( file) " ; cat " $( file) " ; echo; )
2020-01-21 21:46:57 +01:00
check_vintf_has_vendor :=
check_vintf_has_system :=
check_vintf_common_srcs :=
2020-01-14 22:35:45 +01:00
check_vintf_all_deps :=
intermediates :=
2020-06-04 16:16:39 +02:00
e n d i f # !TARGET_BUILD_UNBUNDLED
2020-01-14 22:35:45 +01:00
2018-07-25 02:45:08 +02:00
# -----------------------------------------------------------------
2018-11-29 22:51:48 +01:00
# Check image sizes <= size of super partition
2020-06-04 16:16:39 +02:00
i f e q ( , $( TARGET_BUILD_UNBUNDLED ) )
2018-11-29 22:51:48 +01:00
i f e q ( t r u e , $( PRODUCT_BUILD_SUPER_PARTITION ) )
2018-07-25 02:45:08 +02:00
2021-05-14 00:44:43 +02:00
PARTITIONS_AND_OTHER_IN_SUPER := $( BOARD_SUPER_PARTITION_PARTITION_LIST)
# Add the system other image to the misc_info. Because factory ota may install system_other to the super partition.
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
PARTITIONS_AND_OTHER_IN_SUPER += system_other
e n d i f # BUILDING_SYSTEM_OTHER_IMAGE
2019-11-01 19:23:19 +01:00
# $(1): misc_info.txt
2019-10-26 05:36:55 +02:00
# #(2): optional log file
2018-10-02 02:30:01 +02:00
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
2019-11-01 19:23:19 +01:00
mkdir -p $( dir $( 1) )
rm -f $( 1)
$( call dump-super-image-info, $( 1) )
2021-05-14 00:44:43 +02:00
$( foreach partition,$( PARTITIONS_AND_OTHER_IN_SUPER) , \
2019-11-01 19:23:19 +01:00
echo " $( partition) _image= " $( call images-for-partitions,$( partition) ) >> $( 1) ; )
2019-10-26 05:36:55 +02:00
$( CHECK_PARTITION_SIZES) $( if $( 2) ,--logfile $( 2) ,-v) $( 1)
2018-10-02 02:30:01 +02:00
e n d e f
2021-03-11 23:47:48 +01:00
check_all_partition_sizes_log := $( call intermediates-dir-for,PACKAGING,check-all-partition-sizes) /check_all_partition_sizes.log
2019-10-26 05:36:55 +02:00
droid_targets : $( check_all_partition_sizes_log )
$( call dist -for -goals , droid_targets , $ ( check_all_partition_sizes_log ) )
$(check_all_partition_sizes_log) : \
$( CHECK_PARTITION_SIZES) \
2021-05-14 00:44:43 +02:00
$( call images-for-partitions,$( PARTITIONS_AND_OTHER_IN_SUPER) )
2019-11-01 19:23:19 +01:00
$( call check-all-partition-sizes-target, \
2019-10-26 05:36:55 +02:00
$( call intermediates-dir-for,PACKAGING,check-all-partition-sizes) /misc_info.txt, \
$@ )
.PHONY : check -all -partition -sizes
check-all-partition-sizes : $( check_all_partition_sizes_log )
2019-05-18 00:51:39 +02:00
2019-10-26 05:36:55 +02:00
.PHONY : check -all -partition -sizes -nodeps
2019-05-18 00:51:39 +02:00
check-all-partition-sizes-nodeps :
2019-11-01 19:23:19 +01:00
$( call check-all-partition-sizes-target, \
$( call intermediates-dir-for,PACKAGING,check-all-partition-sizes-nodeps) /misc_info.txt)
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
2020-06-04 16:16:39 +02:00
e n d i f # !TARGET_BUILD_UNBUNDLED
2018-07-21 01:45:57 +02:00
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
2019-04-09 06:11:59 +02:00
# Set build_ota_package, and allow opt-out below.
2018-10-09 09:46:25 +02:00
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
2021-07-14 23:19:12 +02:00
# A target without a kernel may be one of the following:
2021-07-19 18:35:05 +02:00
# - A generic target. In this case, the OTA package usually isn't built.
# PRODUCT_BUILD_GENERIC_OTA_PACKAGE may be set to true to force OTA package
# generation.
# - A real device target, with TARGET_NO_KERNEL set to true and
# BOARD_PREBUILT_BOOTIMAGE set. In this case, it is valid to generate
# an OTA package.
2019-04-09 06:11:59 +02:00
ifneq ( $( PRODUCT_BUILD_GENERIC_OTA_PACKAGE) ,true)
ifneq ( $( filter generic%,$( TARGET_DEVICE) ) ,)
build_ota_package := false
endif
2021-07-19 18:35:05 +02:00
ifeq ( $( INSTALLED_BOOTIMAGE_TARGET) ,)
ifeq ( $( TARGET_NO_KERNEL) ,true)
build_ota_package := false
endif
endif # INSTALLED_BOOTIMAGE_TARGET == ""
2021-07-19 18:28:49 +02:00
ifeq ( $( recovery_fstab) ,)
build_ota_package := false
endif
2019-04-09 06:11:59 +02:00
endif # PRODUCT_BUILD_GENERIC_OTA_PACKAGE
# Set build_otatools_package, and allow opt-out below.
2018-10-09 09:46:25 +02:00
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 )
2019-05-02 06:17:13 +02:00
INTERNAL_OTATOOLS_MODULES := \
2019-07-08 03:59:00 +02:00
aapt2 \
2019-06-25 20:42:12 +02:00
add_img_to_target_files \
2020-05-29 21:01:32 +02:00
apksigner \
2019-05-02 06:17:13 +02:00
append2simg \
avbtool \
blk_alloc_to_base_fs \
boot_signer \
brillo_update_payload \
brotli \
bsdiff \
2019-05-07 22:12:21 +02:00
build_image \
build_super_image \
2019-05-02 06:17:13 +02:00
build_verity_metadata \
build_verity_tree \
care_map_generator \
2019-06-25 20:42:12 +02:00
check_ota_package_signature \
check_target_files_signatures \
2019-08-21 22:29:30 +02:00
check_target_files_vintf \
2019-05-02 06:17:13 +02:00
checkvintf \
delta_generator \
e2fsck \
e2fsdroid \
fc_sort \
fec \
2021-06-09 03:24:46 +02:00
fsck.f2fs \
2019-05-02 06:17:13 +02:00
fs_config \
generate_verity_key \
2020-12-03 01:18:25 +01:00
host_init_verifier \
2019-05-02 06:17:13 +02:00
img2simg \
2019-06-25 20:42:12 +02:00
img_from_target_files \
2019-05-02 06:17:13 +02:00
imgdiff \
libconscrypt_openjdk_jni \
lpmake \
2019-06-25 05:50:58 +02:00
lpunpack \
2020-06-24 20:20:36 +02:00
lz4 \
2019-05-02 06:17:13 +02:00
make_f2fs \
2020-07-18 05:18:10 +02:00
make_f2fs_casefold \
2019-06-25 20:42:12 +02:00
merge_target_files \
2019-05-02 06:17:13 +02:00
minigzip \
2019-07-05 11:30:41 +02:00
mk_combined_img \
2019-05-02 06:17:13 +02:00
mkbootfs \
mkbootimg \
mke2fs \
2020-01-30 02:42:59 +01:00
mke2fs.conf \
2020-06-17 07:59:16 +02:00
mkfs.erofs \
mkerofsimage.sh \
2019-05-02 06:17:13 +02:00
mkf2fsuserimg.sh \
mksquashfs \
mksquashfsimage.sh \
mkuserimg_mke2fs \
2019-08-05 21:05:45 +02:00
ota_from_target_files \
2021-02-05 11:01:15 +01:00
repack_bootimg \
2021-02-23 00:15:24 +01:00
secilc \
2019-05-02 06:17:13 +02:00
sefcontext_compile \
2019-07-05 11:30:41 +02:00
sgdisk \
2019-05-02 06:17:13 +02:00
shflags \
2019-06-25 20:42:12 +02:00
sign_apex \
sign_target_files_apks \
2019-05-02 06:17:13 +02:00
signapk \
simg2img \
sload_f2fs \
2020-09-25 02:07:03 +02:00
toybox \
2019-05-02 06:17:13 +02:00
tune2fs \
2020-01-05 00:18:09 +01:00
unpack_bootimg \
2019-06-11 23:35:59 +02:00
update_host_simulator \
2019-06-25 20:42:12 +02:00
validate_target_files \
2019-05-02 06:17:13 +02:00
verity_signer \
verity_verifier \
zipalign \
2021-08-20 19:09:20 +02:00
zucchini \
2017-02-23 01:38:19 +01:00
2020-01-23 22:59:13 +01:00
# Additional tools to unpack and repack the apex file.
INTERNAL_OTATOOLS_MODULES += \
apexer \
2021-01-20 02:32:28 +01:00
apex_compression_tool \
2020-01-23 22:59:13 +01:00
deapexer \
debugfs_static \
merge_zips \
resize2fs \
soong_zip \
2019-03-28 16:45:40 +01:00
i f e q ( t r u e , $( PRODUCT_SUPPORTS_VBOOT ) )
2019-05-02 06:17:13 +02:00
INTERNAL_OTATOOLS_MODULES += \
futility \
vboot_signer
e n d i f
2017-07-07 00:13:59 +02:00
2019-05-02 06:17:13 +02:00
INTERNAL_OTATOOLS_FILES := \
$( filter $( HOST_OUT) /%,$( call module-installed-files,$( INTERNAL_OTATOOLS_MODULES) ) )
2009-03-04 04:28:42 +01:00
2010-06-18 02:52:18 +02:00
.PHONY : otatools
2019-05-02 06:17:13 +02:00
otatools : $( INTERNAL_OTATOOLS_FILES )
2010-06-18 02:52:18 +02:00
2019-05-02 06:17:13 +02:00
# For each module, recursively resolve its host shared library dependencies. Then we have a full
# list of modules whose installed files need to be packed.
INTERNAL_OTATOOLS_MODULES_WITH_DEPS := \
$( sort $( INTERNAL_OTATOOLS_MODULES) \
$( foreach m,$( INTERNAL_OTATOOLS_MODULES) ,$( call get-all-shared-libs-deps,$( m) ) ) )
2014-08-22 17:04:58 +02:00
2019-05-02 06:17:13 +02:00
INTERNAL_OTATOOLS_PACKAGE_FILES := \
$( filter $( HOST_OUT) /%,$( call module-installed-files,$( INTERNAL_OTATOOLS_MODULES_WITH_DEPS) ) )
INTERNAL_OTATOOLS_PACKAGE_FILES += \
$( sort $( shell find build/make/target/product/security -type f -name "*.x509.pem" -o \
-name "*.pk8" -o -name verity_key) )
2018-10-12 20:03:04 +02:00
i f n e q ( , $( wildcard device ) )
2019-05-02 06:17:13 +02:00
INTERNAL_OTATOOLS_PACKAGE_FILES += \
2018-05-02 04:07:27 +02:00
$( sort $( shell find device $( wildcard vendor) -type f -name "*.pk8" -o -name "verifiedboot*" -o \
2019-07-30 06:12:37 +02:00
-name "*.pem" -o -name "oem*.prop" -o -name "*.avbpubkey" ) )
2018-10-12 20:03:04 +02:00
e n d i f
i f n e q ( , $( wildcard external /avb ) )
2019-05-02 06:17:13 +02:00
INTERNAL_OTATOOLS_PACKAGE_FILES += \
2018-10-12 20:03:04 +02:00
$( sort $( shell find external/avb/test/data -type f -name "testkey_*.pem" -o \
-name "atx_metadata.bin" ) )
e n d i f
2019-03-28 16:45:40 +01:00
i f e q ( t r u e , $( PRODUCT_SUPPORTS_VBOOT ) )
2019-05-02 06:17:13 +02:00
INTERNAL_OTATOOLS_PACKAGE_FILES += \
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
2019-05-02 06:17:13 +02:00
INTERNAL_OTATOOLS_RELEASETOOLS := \
$( sort $( shell find build/make/tools/releasetools -name "*.pyc" -prune -o \
\( -type f -o -type l \) -print) )
BUILT_OTATOOLS_PACKAGE := $( PRODUCT_OUT) /otatools.zip
$(BUILT_OTATOOLS_PACKAGE) : PRIVATE_ZIP_ROOT := $( call intermediates -dir -for ,PACKAGING ,otatools ) /otatools
$(BUILT_OTATOOLS_PACKAGE) : PRIVATE_OTATOOLS_PACKAGE_FILES := $( INTERNAL_OTATOOLS_PACKAGE_FILES )
$(BUILT_OTATOOLS_PACKAGE) : PRIVATE_OTATOOLS_RELEASETOOLS := $( INTERNAL_OTATOOLS_RELEASETOOLS )
$(BUILT_OTATOOLS_PACKAGE) : $( INTERNAL_OTATOOLS_PACKAGE_FILES ) $( INTERNAL_OTATOOLS_RELEASETOOLS )
2019-08-15 08:08:18 +02:00
$(BUILT_OTATOOLS_PACKAGE) : $( SOONG_ZIP ) $( ZIP 2ZIP )
2014-08-22 17:04:58 +02:00
@echo " Package OTA tools: $@ "
2019-05-02 06:17:13 +02:00
rm -rf $@ $( PRIVATE_ZIP_ROOT)
mkdir -p $( dir $@ )
$( call copy-files-with-structure,$( PRIVATE_OTATOOLS_PACKAGE_FILES) ,$( HOST_OUT) /,$( PRIVATE_ZIP_ROOT) )
$( call copy-files-with-structure,$( PRIVATE_OTATOOLS_RELEASETOOLS) ,build/make/tools/,$( PRIVATE_ZIP_ROOT) )
2020-01-29 04:17:35 +01:00
cp $( SOONG_ZIP) $( ZIP2ZIP) $( MERGE_ZIPS) $( PRIVATE_ZIP_ROOT) /bin/
2019-05-02 06:17:13 +02:00
$( SOONG_ZIP) -o $@ -C $( PRIVATE_ZIP_ROOT) -D $( PRIVATE_ZIP_ROOT)
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
2019-06-27 22:55:23 +02:00
# -----------------------------------------------------------------
# misc_info.txt
INSTALLED_MISC_INFO_TARGET := $( PRODUCT_OUT) /misc_info.txt
i f e q ( $( TARGET_RELEASETOOLS_EXTENSIONS ) , )
# default to common dir for device vendor
tool_extensions := $( TARGET_DEVICE_DIR) /../common
e l s e
tool_extensions := $( TARGET_RELEASETOOLS_EXTENSIONS)
e n d i f
.KATI_READONLY := tool_extensions
2020-05-08 02:32:10 +02:00
# $1: boot image file name
d e f i n e m i s c _ b o o t _ s i z e
$( subst .img ,_size ,$ ( 1) ) = $( BOARD_KERNEL $ ( call to -upper ,$ ( subst boot ,,$ ( subst .img ,,$ ( 1) ) ) ) _BOOTIMAGE_PARTITION_SIZE )
e n d e f
2019-06-27 22:55:23 +02:00
$(INSTALLED_MISC_INFO_TARGET) :
rm -f $@
$( call pretty," Target misc_info.txt: $@ " )
$( hide) echo " recovery_api_version= $( RECOVERY_API_VERSION) " >> $@
$( hide) echo " fstab_version= $( RECOVERY_FSTAB_VERSION) " >> $@
i f d e f B O A R D _ F L A S H _ B L O C K _ S I Z E
$( hide) echo " blocksize= $( BOARD_FLASH_BLOCK_SIZE) " >> $@
e n d i f
2020-05-08 02:32:10 +02:00
i f n e q ( $( strip $ ( BOARD_BOOTIMAGE_PARTITION_SIZE ) ) $( strip $ ( BOARD_KERNEL_BINARIES ) ) , )
$( foreach b,$( INSTALLED_BOOTIMAGE_TARGET) ,\
echo " $( call misc_boot_size,$( notdir $( b) ) ) " >> $@ ; )
2019-06-27 22:55:23 +02:00
e n d i f
i f e q ( $( INSTALLED_BOOTIMAGE_TARGET ) , )
$( hide) echo "no_boot=true" >> $@
2020-04-09 03:27:00 +02:00
e l s e
echo " boot_images= $( foreach b,$( INSTALLED_BOOTIMAGE_TARGET) ,$( notdir $( b) ) ) " >> $@
2019-06-27 22:55:23 +02:00
e n d i f
2020-06-10 22:09:10 +02:00
i f e q ( $( BOARD_RAMDISK_USE_LZ 4) , t r u e )
echo "lz4_ramdisks=true" >> $@
e n d i f
2019-07-10 19:49:37 +02:00
i f n e q ( $( INSTALLED_VENDOR_BOOTIMAGE_TARGET ) , )
echo "vendor_boot=true" >> $@
echo " vendor_boot_size= $( BOARD_VENDOR_BOOTIMAGE_PARTITION_SIZE) " >> $@
e n d i f
2019-06-27 22:55:23 +02:00
i f e q ( $( INSTALLED_RECOVERYIMAGE_TARGET ) , )
$( hide) echo "no_recovery=true" >> $@
e n d i f
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" >> $@
e n d i f
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" >> $@
e n d i f
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
$( hide) echo " recovery_size= $( BOARD_RECOVERYIMAGE_PARTITION_SIZE) " >> $@
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) " >> $@
e l s e
$( hide) echo " recovery_mount_options= $( DEFAULT_TARGET_RECOVERY_FSTYPE_MOUNT_OPTIONS) " >> $@
e n d i f
$( hide) echo " tool_extensions= $( tool_extensions) " >> $@
$( hide) echo " default_system_dev_certificate= $( DEFAULT_SYSTEM_DEV_CERTIFICATE) " >> $@
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) " >> $@
e n d i f
$( hide) echo 'mkbootimg_args=$(BOARD_MKBOOTIMG_ARGS)' >> $@
2020-03-17 03:13:46 +01:00
$( hide) echo 'recovery_mkbootimg_args=$(BOARD_RECOVERY_MKBOOTIMG_ARGS)' >> $@
2019-06-27 22:55:23 +02:00
$( hide) echo 'mkbootimg_version_args=$(INTERNAL_MKBOOTIMG_VERSION_ARGS)' >> $@
2021-03-12 14:40:32 +01:00
i f d e f B O A R D _ G K I _ S I G N I N G _ K E Y _ P A T H
$( hide) echo 'gki_signing_key_path=$(BOARD_GKI_SIGNING_KEY_PATH)' >> $@
$( hide) echo 'gki_signing_algorithm=$(BOARD_GKI_SIGNING_ALGORITHM)' >> $@
e n d i f
i f d e f B O A R D _ G K I _ S I G N I N G _ S I G N A T U R E _ A R G S
$( hide) echo 'gki_signing_signature_args=$(BOARD_GKI_SIGNING_SIGNATURE_ARGS)' >> $@
e n d i f
2019-06-27 22:55:23 +02:00
$( hide) echo "multistage_support=1" >> $@
$( hide) echo "blockimgdiff_versions=3,4" >> $@
i f e q ( $( PRODUCT_BUILD_GENERIC_OTA_PACKAGE ) , t r u e )
$( hide) echo "build_generic_ota_package=true" >> $@
e n d i f
i f n e q ( $( OEM_THUMBPRINT_PROPERTIES ) , )
# OTA scripts are only interested in fingerprint related properties
$( hide) echo " oem_fingerprint_properties= $( OEM_THUMBPRINT_PROPERTIES) " >> $@
e n d i f
i f n e q ( , $( filter address , $ ( SANITIZE_TARGET ) ) )
# We need to create userdata.img with real data because the instrumented libraries are in userdata.img.
$( hide) echo "userdata_img_with_data=true" >> $@
e n d i f
i f e q ( $( BOARD_USES_FULL_RECOVERY_IMAGE ) , t r u e )
$( hide) echo "full_recovery_image=true" >> $@
e n d i f
Moving recovery resources from /system to /vendor
This change is part of a topic that moves the recovery resources from the
system partition to the vendor partition, if it exists, or the vendor directory
on the system partition otherwise. The recovery resources are moving from the
system image to the vendor partition so that a single system image may be used
with either an A/B or a non-A/B vendor image. The topic removes a delta in the
system image that prevented such reuse in the past.
The recovery resources that are moving are involved with updating the recovery
partition after an update. In a non-A/B configuration, the system boots from
the recovery partition, updates the other partitions (system, vendor, etc.)
Then, the next time the system boots normally, a script updates the recovery
partition (if necessary). This script, the executables it invokes, and the data
files that it uses were previously on the system partition. The resources that
are moving include the following.
* install-recovery.sh
* applypatch
* recovery-resource.dat (if present)
* recovery-from-boot.p (if present)
This change includes the platform build system and release tools changes to
move the recovery resources from system to vendor (or /system/vendor). The
release tools need to know where to generate the recovery patch, and they
discover this from misc_info.txt variable board_uses_vendorimage, which the
platform build system generates.
We remove applypatch from PRODUCT_PACKAGES, but it is added back as a required
module in target/product/base_vendor.mk.
Several release tools rely on the misc_info.txt board_uses_vendorimage variable
to know how to generate and detect the recovery patch.
This change partially removes the --rebuild_recovery flag from the
merge_target_files.py script. The flag will be fully removed in a follow-on
change.
Bug: 68319577
Test: Ensure that recovery partition is updated correctly.
Change-Id: Ia4045bd67ffb3d899efa8d20dab4c4299b87ee5f
2019-09-18 02:06:47 +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
$( hide) echo "board_uses_vendorimage=true" >> $@
e n d i f
2019-06-27 22:55:23 +02:00
i f e q ( $( BOARD_AVB_ENABLE ) , t r u e )
2020-11-13 04:28:17 +01:00
i f e q ( $( BUILDING_VBMETA_IMAGE ) , t r u e )
$( hide) echo "avb_building_vbmeta_image=true" >> $@
e n d i f # BUILDING_VBMETA_IMAGE
2019-06-27 22:55:23 +02:00
$( hide) echo "avb_enable=true" >> $@
$( hide) echo " avb_vbmeta_key_path= $( BOARD_AVB_KEY_PATH) " >> $@
$( hide) echo " avb_vbmeta_algorithm= $( BOARD_AVB_ALGORITHM) " >> $@
$( hide) echo " avb_vbmeta_args= $( BOARD_AVB_MAKE_VBMETA_IMAGE_ARGS) " >> $@
$( hide) echo " avb_boot_add_hash_footer_args= $( BOARD_AVB_BOOT_ADD_HASH_FOOTER_ARGS) " >> $@
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) " >> $@
$( hide) echo " avb_boot_algorithm= $( BOARD_AVB_BOOT_ALGORITHM) " >> $@
$( hide) echo " avb_boot_rollback_index_location= $( BOARD_AVB_BOOT_ROLLBACK_INDEX_LOCATION) " >> $@
e n d i f # BOARD_AVB_BOOT_KEY_PATH
2019-07-10 19:49:37 +02:00
echo " avb_vendor_boot_add_hash_footer_args= $( BOARD_AVB_VENDOR_BOOT_ADD_HASH_FOOTER_ARGS) " >> $@
i f d e f B O A R D _ A V B _ V E N D O R _ B O O T _ K E Y _ P A T H
echo " avb_vendor_boot_key_path= $( BOARD_AVB_VENDOR_BOOT_KEY_PATH) " >> $@
echo " avb_vendor_boot_algorithm= $( BOARD_AVB_VENDOR_BOOT_ALGORITHM) " >> $@
echo " avb_vendor_boot_rollback_index_location= $( BOARD_AVB_VENDOR_BOOT_ROLLBACK_INDEX_LOCATION) " >> $@
e n d i f # BOARD_AVB_VENDOR_BOOT_KEY_PATH
2019-06-27 22:55:23 +02:00
$( hide) echo " avb_recovery_add_hash_footer_args= $( BOARD_AVB_RECOVERY_ADD_HASH_FOOTER_ARGS) " >> $@
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) " >> $@
$( hide) echo " avb_recovery_algorithm= $( BOARD_AVB_RECOVERY_ALGORITHM) " >> $@
$( hide) echo " avb_recovery_rollback_index_location= $( BOARD_AVB_RECOVERY_ROLLBACK_INDEX_LOCATION) " >> $@
e n d i f # BOARD_AVB_RECOVERY_KEY_PATH
Add options to sign the prebuilt custom images.
The custom images are any images owned by OEMs and SoCs, oem images
mounted on /oem is an example. The oem images can be used to customize
devices for different carriers, like wallpaper, ringtones, and
carrier-specific apks. OEMs can generate multiple oem images, like
oem.img, oem-carrier1.img and oem-carrier2.img and flash different oem
images for different carriers. The oem images are only one case, OEMs
and SoCs can add more custom images and mount them to custom partitions.
This change enables custom images to be vbmeta.img chained partitions.
The following configuration in BoardConfig.mk is an exmaple. It has two
custom partitions: oem and test. They will be signed by different keys.
And they will be chained by vbmeta.img. The custom images here are
prebuilts, which can be built by `make custom_images` separately.
BOARD_AVB_<CUSTOM_PARTITION>_IMAGE_LIST should include all custom images
to apply AVB signing. And to every custom partition, one image whose
name is partition name must be added in its
BOARD_AVB_<CUSTOM_PARTITION>_IMAGE_LIST.
BOARD_CUSTOMIMAGES_PARTITION_LIST := oem test
BOARD_AVB_OEM_KEY_PATH := external/avb/test/data/testkey_rsa4096.pem
BOARD_AVB_OEM_ALGORITHM := SHA256_RSA4096
BOARD_AVB_OEM_ADD_HASHTREE_FOOTER_ARGS :=
BOARD_AVB_OEM_ROLLBACK_INDEX_LOCATION := 1
BOARD_AVB_OEM_PARTITION_SIZE := 5242880
BOARD_AVB_OEM_IMAGE_LIST := \
device/xxxx/yyyy/oem/oem.img \
device/xxxx/yyyy/oem/oem1.img
BOARD_AVB_TEST_KEY_PATH := external/avb/test/data/testkey_rsa2048.pem
BOARD_AVB_TEST_ALGORITHM := SHA256_RSA2048
BOARD_AVB_TEST_ADD_HASHTREE_FOOTER_ARGS :=
BOARD_AVB_TEST_ROLLBACK_INDEX_LOCATION := 2
BOARD_AVB_TEST_PARTITION_SIZE := 10485760
BOARD_AVB_TEST_IMAGE_LIST := \
device/xxxx/yyyy/test/test.img \
device/xxxx/yyyy/test/test1.img
To resign the custom images in the target zip file, the
avb_extra_custom_image_key, avb_extra_custom_image_algorithms and
avb_extra_custom_image_extra_args options are added to the
sign_target_files_apks tool too. The following test cases list some
examples about how to use them.
BUG: 154171021
Test: 1) "atest --host releasetools_test releasetools_py3_test -c"
2) Build images by 'make dist', sign and validate target files.
a) Test on dist w/ chained vbmeta_system and ome custom images
sign_target_files_apks -d certs \
--avb_extra_custom_image_key oem=oem_rsa4096.pem \
--avb_extra_custom_image_algorithm oem=SHA256_RSA4096 \
xxx-target_xxx.zip signed.zip
validate_target_files.py signed.zip
Flash image and boot up.
Verify the oem images and vbmeta images in OUT and target zips by
avbtool.
b) Test on dist w/ chained vbmeta_system and oem and test custom images
sign_target_files_apks -d certs \
--avb_extra_custom_image_key oem=oem_rsa4096.pem \
--avb_extra_custom_image_algorithm oem=SHA256_RSA4096 \
--avb_extra_custom_image_extra_args oem=--do_not_generate_fec \
--avb_extra_custom_image_key test=test_rsa4096.pem \
--avb_extra_custom_image_algorithm test=SHA256_RSA4096 \
xxx-target_xxx.zip signed.zip
validate_target_files.py signed.zip
Verify the oem, test images and vbmeta images in OUT and target zips
by avbtool.
c) Test on dist w/o chained partition.
sign_target_files_apks -d certs xxx-target_xxx.zip signed.zip
validate_target_files.py signed.zip
Flash image and boot up.
Verify the vbmeta images in OUT and target zips by avbtool.
Change-Id: Ifccfee5e8909697eef6ccda0cc352fa16a9f6db6
2020-04-28 03:36:36 +02:00
i f n e q ( , $( strip $ ( BOARD_CUSTOMIMAGES_PARTITION_LIST ) ) )
$( hide) echo " avb_custom_images_partition_list= $( BOARD_CUSTOMIMAGES_PARTITION_LIST) " >> $@
$( hide) $( foreach partition,$( BOARD_CUSTOMIMAGES_PARTITION_LIST) , \
echo " avb_ $( partition) _key_path= $( BOARD_AVB_$( call to-upper,$( partition) ) _KEY_PATH) " >> $@ ; \
echo " avb_ $( partition) _algorithm= $( BOARD_AVB_$( call to-upper,$( partition) ) _ALGORITHM) " >> $@ ; \
echo " avb_ $( partition) _add_hashtree_footer_args= $( BOARD_AVB_$( call to-upper,$( partition) ) _ADD_HASHTREE_FOOTER_ARGS) " >> $@ ; \
echo " avb_ $( partition) _rollback_index_location= $( BOARD_AVB_$( call to-upper,$( partition) ) _ROLLBACK_INDEX_LOCATION) " >> $@ ; \
echo " avb_ $( partition) _partition_size= $( BOARD_AVB_$( call to-upper,$( partition) ) _PARTITION_SIZE) " >> $@ ; \
echo " avb_ $( partition) _image_list= $( foreach image,$( BOARD_AVB_$( call to-upper,$( partition) ) _IMAGE_LIST) ,$( notdir $( image) ) ) " >> $@ ; )
e n d i f # BOARD_CUSTOMIMAGES_PARTITION_LIST
2019-06-27 22:55:23 +02:00
i f n e q ( , $( strip $ ( BOARD_AVB_VBMETA_SYSTEM ) ) )
$( hide) echo " avb_vbmeta_system= $( BOARD_AVB_VBMETA_SYSTEM) " >> $@
$( hide) echo " avb_vbmeta_system_args= $( BOARD_AVB_MAKE_VBMETA_SYSTEM_IMAGE_ARGS) " >> $@
$( hide) echo " avb_vbmeta_system_key_path= $( BOARD_AVB_VBMETA_SYSTEM_KEY_PATH) " >> $@
$( hide) echo " avb_vbmeta_system_algorithm= $( BOARD_AVB_VBMETA_SYSTEM_ALGORITHM) " >> $@
$( hide) echo " avb_vbmeta_system_rollback_index_location= $( BOARD_AVB_VBMETA_SYSTEM_ROLLBACK_INDEX_LOCATION) " >> $@
e n d i f # BOARD_AVB_VBMETA_SYSTEM
i f n e q ( , $( strip $ ( BOARD_AVB_VBMETA_VENDOR ) ) )
$( hide) echo " avb_vbmeta_vendor= $( BOARD_AVB_VBMETA_VENDOR) " >> $@
$( hide) echo " avb_vbmeta_vendor_args= $( BOARD_AVB_MAKE_VBMETA_SYSTEM_IMAGE_ARGS) " >> $@
$( hide) echo " avb_vbmeta_vendor_key_path= $( BOARD_AVB_VBMETA_VENDOR_KEY_PATH) " >> $@
$( hide) echo " avb_vbmeta_vendor_algorithm= $( BOARD_AVB_VBMETA_VENDOR_ALGORITHM) " >> $@
$( hide) echo " avb_vbmeta_vendor_rollback_index_location= $( BOARD_AVB_VBMETA_VENDOR_ROLLBACK_INDEX_LOCATION) " >> $@
e n d i f # BOARD_AVB_VBMETA_VENDOR_KEY_PATH
e n d i f # BOARD_AVB_ENABLE
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" >> $@
$( hide) echo " board_bpt_make_table_args= $( BOARD_BPT_MAKE_TABLE_ARGS) " >> $@
$( hide) echo " board_bpt_input_files= $( BOARD_BPT_INPUT_FILES) " >> $@
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) " >> $@
e n d i f
$( call generate-userimage-prop-dictionary, $@ )
i f e q ( $( AB_OTA_UPDATER ) , t r u e )
@# Include the build type in META/misc_info.txt so the server can easily differentiate production builds.
$( hide) echo " build_type= $( TARGET_BUILD_VARIANT) " >> $@
$( hide) echo "ab_update=true" >> $@
e n d i f
2020-04-17 19:08:10 +02:00
i f e q ( $( TARGET_OTA_ALLOW_NON_AB ) , t r u e )
$( hide) echo "allow_non_ab=true" >> $@
e n d i f
2019-06-27 22:55:23 +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
$( hide) echo "has_dtbo=true" >> $@
i f e q ( $( BOARD_AVB_ENABLE ) , t r u e )
$( hide) echo " dtbo_size= $( BOARD_DTBOIMG_PARTITION_SIZE) " >> $@
$( hide) echo " avb_dtbo_add_hash_footer_args= $( BOARD_AVB_DTBO_ADD_HASH_FOOTER_ARGS) " >> $@
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) " >> $@
$( hide) echo " avb_dtbo_algorithm= $( BOARD_AVB_DTBO_ALGORITHM) " >> $@
$( hide) echo " avb_dtbo_rollback_index_location= $( BOARD_AVB_DTBO_ROLLBACK_INDEX_LOCATION) " >> $@
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
2020-11-29 15:04:28 +01:00
i f d e f B O A R D _ P R E B U I L T _ P V M F W I M A G E
$( hide) echo "has_pvmfw=true" >> $@
i f e q ( $( BOARD_AVB_ENABLE ) , t r u e )
$( hide) echo " pvmfw_size= $( BOARD_PVMFWIMG_PARTITION_SIZE) " >> $@
$( hide) echo " avb_pvmfw_add_hash_footer_args= $( BOARD_AVB_PVMFW_ADD_HASH_FOOTER_ARGS) " >> $@
i f d e f B O A R D _ A V B _ P V M F W _ K E Y _ P A T H
$( hide) echo " avb_pvmfw_key_path= $( BOARD_AVB_PVMFW_KEY_PATH) " >> $@
$( hide) echo " avb_pvmfw_algorithm= $( BOARD_AVB_PVMFW_ALGORITHM) " >> $@
$( hide) echo " avb_pvmfw_rollback_index_location= $( BOARD_AVB_PVMFW_ROLLBACK_INDEX_LOCATION) " >> $@
e n d i f # BOARD_AVB_PVMFW_KEY_PATH
e n d i f # BOARD_AVB_ENABLE
e n d i f # BOARD_PREBUILT_PVMFWIMAGE
2019-06-27 22:55:23 +02:00
$( call dump-dynamic-partitions-info,$@ )
2019-08-21 22:29:30 +02:00
@# VINTF checks
i f e q ( $( PRODUCT_ENFORCE_VINTF_MANIFEST ) , t r u e )
$( hide) echo "vintf_enforce=true" >> $@
e n d i f
i f d e f O D M _ M A N I F E S T _ S K U S
$( hide) echo " vintf_odm_manifest_skus= $( ODM_MANIFEST_SKUS) " >> $@
e n d i f
2020-03-13 21:11:10 +01:00
i f d e f O D M _ M A N I F E S T _ F I L E S
$( hide) echo "vintf_include_empty_odm_sku=true" >> $@
e n d i f
i f d e f D E V I C E _ M A N I F E S T _ S K U S
$( hide) echo " vintf_vendor_manifest_skus= $( DEVICE_MANIFEST_SKUS) " >> $@
e n d i f
i f d e f D E V I C E _ M A N I F E S T _ F I L E
$( hide) echo "vintf_include_empty_vendor_sku=true" >> $@
e n d i f
2020-08-27 02:54:13 +02:00
i f e q ( $( BOARD_BOOTLOADER_IN_UPDATE_PACKAGE ) , t r u e )
$( hide) echo "bootloader_in_update_package=true" >> $@
e n d i f
2020-10-08 20:54:02 +02:00
i f e q ( $( BOARD_EXCLUDE_KERNEL_FROM_RECOVERY_IMAGE ) , t r u e )
$( hide) echo "exclude_kernel_from_recovery_image=true" >> $@
e n d i f
2020-11-03 22:40:18 +01:00
i f n e q ( $( BOARD_PARTIAL_OTA_UPDATE_PARTITIONS_LIST ) , )
$( hide) echo " partial_ota_update_partitions_list= $( BOARD_PARTIAL_OTA_UPDATE_PARTITIONS_LIST) " >> $@
e n d i f
2021-07-21 18:34:08 +02:00
i f e q ( $( BUILDING_WITH_VSDK ) , t r u e )
$( hide) echo "building_with_vsdk=true" >> $@
e n d i f
i f e q ( $( TARGET_FLATTEN_APEX ) , f a l s e )
$( hide) echo "target_flatten_apex=false" >> $@
e n d i f
2019-06-27 22:55:23 +02:00
.PHONY : misc_info
misc_info : $( INSTALLED_MISC_INFO_TARGET )
2021-06-16 04:35:06 +02:00
droidcore-unbundled : $( INSTALLED_MISC_INFO_TARGET )
2019-06-27 22:55:23 +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 += \
2020-04-18 00:46:55 +02:00
$( call intermediates-dir-for,EXECUTABLES,updater) /updater
2015-06-23 03:35:35 +02:00
e n d i f
2009-03-04 04:28:42 +01:00
$(BUILT_TARGET_FILES_PACKAGE) : PRIVATE_OTA_TOOLS := $( built_ota_tools )
2017-03-21 23:47:37 +01:00
tool_extension := $( wildcard $( tool_extensions) /releasetools.py)
$(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
2020-04-17 19:08:10 +02:00
e n d i f
# Build OTA tools if non-A/B is allowed
i f e q ( $( TARGET_OTA_ALLOW_NON_AB ) , t r u e )
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
2020-04-17 19:08:10 +02:00
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/.
2020-10-09 23:29:39 +02:00
# If we are moving recovery resources to vendor_boot, output recovery files to VENDOR_BOOT/.
2015-11-11 04:21:34 +01:00
i f e q ( $( BOARD_USES_RECOVERY_AS_BOOT ) , t r u e )
$(BUILT_TARGET_FILES_PACKAGE) : PRIVATE_RECOVERY_OUT := BOOT
2020-10-09 23:29:39 +02:00
e l s e i f e q ( $( BOARD_MOVE_RECOVERY_RESOURCES_TO_VENDOR_BOOT ) , t r u e )
$(BUILT_TARGET_FILES_PACKAGE) : PRIVATE_RECOVERY_OUT := VENDOR_BOOT
2015-11-11 04:21:34 +01:00
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
2019-07-19 00:55:30 +02:00
# Not checking in board_config.mk, since AB_OTA_PARTITIONS may be updated in Android.mk (e.g. to
# additionally include radio or bootloader partitions).
ifeq ( $( AB_OTA_PARTITIONS) ,)
$( error AB_OTA_PARTITIONS must be defined when using AB_OTA_UPDATER)
endif
e n d i f
i f n e q ( $( AB_OTA_PARTITIONS ) , )
ifneq ( $( AB_OTA_UPDATER) ,true)
$( error AB_OTA_UPDATER must be true when defining AB_OTA_PARTITIONS)
endif
2017-03-21 23:47:37 +01:00
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
2019-11-01 19:39:45 +01:00
d e f i n e f i l t e r - o u t - m i s s i n g - v e n d o r
$( if $ ( INSTALLED_VENDORIMAGE_TARGET ) ,$ ( 1) ,$ ( filter -out vendor ,$ ( 1) ) )
e n d e f
2021-03-11 03:23:39 +01:00
d e f i n e f i l t e r - o u t - m i s s i n g - v e n d o r _ d l k m
$( if $ ( INSTALLED_VENDOR_DLKMIMAGE_TARGET ) ,$ ( 1) ,$ ( filter -out vendor_dlkm ,$ ( 1) ) )
e n d e f
d e f i n e f i l t e r - o u t - m i s s i n g - o d m
$( if $ ( INSTALLED_ODMIMAGE_TARGET ) ,$ ( 1) ,$ ( filter -out odm ,$ ( 1) ) )
e n d e f
d e f i n e f i l t e r - o u t - m i s s i n g - o d m _ d l k m
$( if $ ( INSTALLED_ODM_DLKMIMAGE_TARGET ) ,$ ( 1) ,$ ( filter -out odm_dlkm ,$ ( 1) ) )
e n d e f
# Filter out vendor,vendor_dlkm,odm,odm_dlkm from the list for AOSP targets.
# $(1): list
d e f i n e f i l t e r - o u t - m i s s i n g - p a r t i t i o n s
$( call filter -out -missing -vendor ,\
$( call filter-out-missing-vendor_dlkm,\
$( call filter-out-missing-odm,\
$( call filter-out-missing-odm_dlkm,$( 1) ) ) ) )
e n d e f
2019-11-01 19:39:45 +01:00
# Information related to dynamic partitions and virtual A/B. This information
# is needed for building the super image (see dump-super-image-info) and
# building OTA packages.
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) ) )
2021-03-25 11:12:28 +01:00
$( if $( BUILDING_SUPER_EMPTY_IMAGE) , \
echo "build_super_empty_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) , \
2021-03-11 03:23:39 +01:00
echo " dynamic_partition_list= $( call filter-out-missing-partitions,$( BOARD_SUPER_PARTITION_PARTITION_LIST) ) " >> $( 1) )
2018-11-29 21:06:31 +01:00
$( 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) , \
2021-03-11 03:23:39 +01:00
echo " super_ $( group) _partition_list= $( call filter-out-missing-partitions,$( BOARD_$( call to-upper,$( group) ) _PARTITION_LIST) ) " >> $( 1) ; ) )
2019-04-03 01:29:59 +02:00
$( if $( filter true,$( TARGET_USERIMAGES_SPARSE_EXT_DISABLED) ) , \
echo "build_non_sparse_super_partition=true" >> $( 1) )
2019-10-16 19:53:41 +02:00
$( if $( filter true,$( TARGET_USERIMAGES_SPARSE_F2FS_DISABLED) ) , \
echo "build_non_sparse_super_partition=true" >> $( 1) )
2019-04-17 23:28:52 +02:00
$( if $( filter true,$( BOARD_SUPER_IMAGE_IN_UPDATE_PACKAGE) ) , \
echo "super_image_in_update_package=true" >> $( 1) )
2019-11-01 19:23:19 +01:00
$( if $( BOARD_SUPER_PARTITION_SIZE) , \
echo " super_partition_size= $( BOARD_SUPER_PARTITION_SIZE) " >> $( 1) )
$( if $( BOARD_SUPER_PARTITION_ALIGNMENT) , \
echo " super_partition_alignment= $( BOARD_SUPER_PARTITION_ALIGNMENT) " >> $( 1) )
$( if $( BOARD_SUPER_PARTITION_WARN_LIMIT) , \
echo " super_partition_warn_limit= $( BOARD_SUPER_PARTITION_WARN_LIMIT) " >> $( 1) )
$( if $( BOARD_SUPER_PARTITION_ERROR_LIMIT) , \
echo " super_partition_error_limit= $( BOARD_SUPER_PARTITION_ERROR_LIMIT) " >> $( 1) )
2019-11-02 01:03:57 +01:00
$( if $( filter true,$( PRODUCT_VIRTUAL_AB_OTA) ) , \
echo "virtual_ab=true" >> $( 1) )
2021-01-15 19:47:52 +01:00
$( if $( filter true,$( PRODUCT_VIRTUAL_AB_COMPRESSION) ) , \
echo "virtual_ab_compression=true" >> $( 1) )
2019-11-02 01:03:57 +01:00
$( if $( filter true,$( PRODUCT_VIRTUAL_AB_OTA_RETROFIT) ) , \
echo "virtual_ab_retrofit=true" >> $( 1) )
2018-11-29 21:06:31 +01:00
e n d e f
2019-04-16 19:06:13 +02:00
# By conditionally including the dependency of the target files package on the
# full system image deps, we speed up builds that do not build the system
# image.
i f d e f B U I L D I N G _ S Y S T E M _ I M A G E
2020-08-27 03:41:29 +02:00
$( BUILT_TARGET_FILES_PACKAGE) : $( FULL_SYSTEMIMAGE_DEPS)
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
$( BUILT_TARGET_FILES_PACKAGE) : $( INTERNAL_USERDATAIMAGE_FILES)
e n d i f
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
$( BUILT_TARGET_FILES_PACKAGE) : $( INTERNAL_SYSTEMOTHERIMAGE_FILES)
e n d i f
i f d e f B U I L D I N G _ V E N D O R _ B O O T _ I M A G E
$( BUILT_TARGET_FILES_PACKAGE) : $( INTERNAL_VENDOR_RAMDISK_FILES)
2020-12-10 11:42:47 +01:00
$( BUILT_TARGET_FILES_PACKAGE) : $( INTERNAL_VENDOR_RAMDISK_FRAGMENT_TARGETS)
2021-06-09 19:44:44 +02:00
$( BUILT_TARGET_FILES_PACKAGE) : $( INTERNAL_VENDOR_BOOTCONFIG_TARGET)
2021-02-24 20:44:55 +01:00
# The vendor ramdisk may be built from the recovery ramdisk.
ifeq ( true,$( BOARD_MOVE_RECOVERY_RESOURCES_TO_VENDOR_BOOT) )
$( BUILT_TARGET_FILES_PACKAGE) : $( INTERNAL_RECOVERY_RAMDISK_FILES_TIMESTAMP)
endif
2020-08-27 03:41:29 +02:00
e n d i f
i f d e f B U I L D I N G _ R E C O V E R Y _ I M A G E
# TODO(b/30414428): Can't depend on INTERNAL_RECOVERYIMAGE_FILES alone like other
2021-02-24 20:44:55 +01:00
# BUILT_TARGET_FILES_PACKAGE dependencies because currently there're cp/rsync/rm
2020-08-27 03:41:29 +02:00
# commands in build-recoveryimage-target, which would touch the files under
# TARGET_RECOVERY_OUT and race with packaging target-files.zip.
ifeq ( $( BOARD_USES_RECOVERY_AS_BOOT) ,true)
$( BUILT_TARGET_FILES_PACKAGE) : $( INSTALLED_BOOTIMAGE_TARGET)
else
$( BUILT_TARGET_FILES_PACKAGE) : $( INSTALLED_RECOVERYIMAGE_TARGET)
endif
$( BUILT_TARGET_FILES_PACKAGE) : $( INTERNAL_RECOVERYIMAGE_FILES)
e n d i f
# Conditionally depend on the image files if the image is being built so the
# target-files.zip rule doesn't wait on the image creation rule, or the image
# if it is coming from a prebuilt.
i f d e f B U I L D I N G _ V E N D O R _ I M A G E
$( BUILT_TARGET_FILES_PACKAGE) : $( INTERNAL_VENDORIMAGE_FILES)
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
$( BUILT_TARGET_FILES_PACKAGE) : $( INSTALLED_VENDORIMAGE_TARGET)
e n d i f
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
$( BUILT_TARGET_FILES_PACKAGE) : $( 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
$( BUILT_TARGET_FILES_PACKAGE) : $( INSTALLED_PRODUCTIMAGE_TARGET)
e n d i f
i f d e f B U I L D I N G _ S Y S T E M _ E X T _ I M A G E
$( BUILT_TARGET_FILES_PACKAGE) : $( INTERNAL_SYSTEM_EXTIMAGE_FILES)
e l s e i f d e f B O A R D _ P R E B U I L T _ S Y S T E M _ E X T I M A G E
$( BUILT_TARGET_FILES_PACKAGE) : $( INSTALLED_SYSTEM_EXTIMAGE_TARGET)
e n d i f
i f d e f B U I L D I N G _ B O O T _ I M A G E
$( BUILT_TARGET_FILES_PACKAGE) : $( INTERNAL_RAMDISK_FILES)
2020-11-09 20:52:52 +01:00
e n d i f
i f n e q ( , $( INTERNAL_PREBUILT_BOOTIMAGE ) $( filter true ,$ ( BOARD_COPY_BOOT_IMAGE_TO_TARGET_FILES ) ) )
2020-08-27 03:41:29 +02:00
$( BUILT_TARGET_FILES_PACKAGE) : $( INSTALLED_BOOTIMAGE_TARGET)
e n d i f
i f d e f B U I L D I N G _ O D M _ I M A G E
$( BUILT_TARGET_FILES_PACKAGE) : $( 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
$( BUILT_TARGET_FILES_PACKAGE) : $( INSTALLED_ODMIMAGE_TARGET)
e n d i f
i f d e f B U I L D I N G _ V E N D O R _ D L K M _ I M A G E
$( BUILT_TARGET_FILES_PACKAGE) : $( INTERNAL_VENDOR_DLKMIMAGE_FILES)
2021-03-11 05:53:23 +01: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 _ D L K M I M A G E
2020-08-27 03:41:29 +02:00
$( BUILT_TARGET_FILES_PACKAGE) : $( INSTALLED_VENDOR_DLKMIMAGE_TARGET)
e n d i f
i f d e f B U I L D I N G _ O D M _ D L K M _ I M A G E
$( BUILT_TARGET_FILES_PACKAGE) : $( INTERNAL_ODM_DLKMIMAGE_FILES)
2021-03-11 05:53:23 +01:00
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 _ D L K M I M A G E
2020-08-27 03:41:29 +02:00
$( BUILT_TARGET_FILES_PACKAGE) : $( INSTALLED_ODM_DLKMIMAGE_TARGET)
2019-04-16 19:06:13 +02:00
e n d i f
2019-07-05 11:30:41 +02:00
i f e q ( $( BUILD_QEMU_IMAGES ) , t r u e )
2020-08-27 03:41:29 +02:00
MK_VBMETA_BOOT_KERNEL_CMDLINE_SH := device/generic/goldfish/tools/mk_vbmeta_boot_params.sh
$( BUILT_TARGET_FILES_PACKAGE) : $( MK_VBMETA_BOOT_KERNEL_CMDLINE_SH)
2019-07-05 11:30:41 +02:00
e n d i f
2020-08-27 02:54: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 L O A D E R
$(BUILT_TARGET_FILES_PACKAGE) : $( INSTALLED_BOOTLOADER_MODULE )
2021-06-16 04:35:06 +02:00
droidcore-unbundled : $( INSTALLED_BOOTLOADER_MODULE )
2020-08-27 02:54:13 +02:00
e n d i 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_RADIOIMAGE_TARGET) \
$( INSTALLED_RECOVERYIMAGE_TARGET) \
$( INSTALLED_CACHEIMAGE_TARGET) \
$( INSTALLED_DTBOIMAGE_TARGET) \
2020-11-29 15:04:28 +01:00
$( INSTALLED_PVMFWIMAGE_TARGET) \
Add options to sign the prebuilt custom images.
The custom images are any images owned by OEMs and SoCs, oem images
mounted on /oem is an example. The oem images can be used to customize
devices for different carriers, like wallpaper, ringtones, and
carrier-specific apks. OEMs can generate multiple oem images, like
oem.img, oem-carrier1.img and oem-carrier2.img and flash different oem
images for different carriers. The oem images are only one case, OEMs
and SoCs can add more custom images and mount them to custom partitions.
This change enables custom images to be vbmeta.img chained partitions.
The following configuration in BoardConfig.mk is an exmaple. It has two
custom partitions: oem and test. They will be signed by different keys.
And they will be chained by vbmeta.img. The custom images here are
prebuilts, which can be built by `make custom_images` separately.
BOARD_AVB_<CUSTOM_PARTITION>_IMAGE_LIST should include all custom images
to apply AVB signing. And to every custom partition, one image whose
name is partition name must be added in its
BOARD_AVB_<CUSTOM_PARTITION>_IMAGE_LIST.
BOARD_CUSTOMIMAGES_PARTITION_LIST := oem test
BOARD_AVB_OEM_KEY_PATH := external/avb/test/data/testkey_rsa4096.pem
BOARD_AVB_OEM_ALGORITHM := SHA256_RSA4096
BOARD_AVB_OEM_ADD_HASHTREE_FOOTER_ARGS :=
BOARD_AVB_OEM_ROLLBACK_INDEX_LOCATION := 1
BOARD_AVB_OEM_PARTITION_SIZE := 5242880
BOARD_AVB_OEM_IMAGE_LIST := \
device/xxxx/yyyy/oem/oem.img \
device/xxxx/yyyy/oem/oem1.img
BOARD_AVB_TEST_KEY_PATH := external/avb/test/data/testkey_rsa2048.pem
BOARD_AVB_TEST_ALGORITHM := SHA256_RSA2048
BOARD_AVB_TEST_ADD_HASHTREE_FOOTER_ARGS :=
BOARD_AVB_TEST_ROLLBACK_INDEX_LOCATION := 2
BOARD_AVB_TEST_PARTITION_SIZE := 10485760
BOARD_AVB_TEST_IMAGE_LIST := \
device/xxxx/yyyy/test/test.img \
device/xxxx/yyyy/test/test1.img
To resign the custom images in the target zip file, the
avb_extra_custom_image_key, avb_extra_custom_image_algorithms and
avb_extra_custom_image_extra_args options are added to the
sign_target_files_apks tool too. The following test cases list some
examples about how to use them.
BUG: 154171021
Test: 1) "atest --host releasetools_test releasetools_py3_test -c"
2) Build images by 'make dist', sign and validate target files.
a) Test on dist w/ chained vbmeta_system and ome custom images
sign_target_files_apks -d certs \
--avb_extra_custom_image_key oem=oem_rsa4096.pem \
--avb_extra_custom_image_algorithm oem=SHA256_RSA4096 \
xxx-target_xxx.zip signed.zip
validate_target_files.py signed.zip
Flash image and boot up.
Verify the oem images and vbmeta images in OUT and target zips by
avbtool.
b) Test on dist w/ chained vbmeta_system and oem and test custom images
sign_target_files_apks -d certs \
--avb_extra_custom_image_key oem=oem_rsa4096.pem \
--avb_extra_custom_image_algorithm oem=SHA256_RSA4096 \
--avb_extra_custom_image_extra_args oem=--do_not_generate_fec \
--avb_extra_custom_image_key test=test_rsa4096.pem \
--avb_extra_custom_image_algorithm test=SHA256_RSA4096 \
xxx-target_xxx.zip signed.zip
validate_target_files.py signed.zip
Verify the oem, test images and vbmeta images in OUT and target zips
by avbtool.
c) Test on dist w/o chained partition.
sign_target_files_apks -d certs xxx-target_xxx.zip signed.zip
validate_target_files.py signed.zip
Flash image and boot up.
Verify the vbmeta images in OUT and target zips by avbtool.
Change-Id: Ifccfee5e8909697eef6ccda0cc352fa16a9f6db6
2020-04-28 03:36:36 +02:00
$( INSTALLED_CUSTOMIMAGES_TARGET) \
2018-11-26 19:12:05 +01:00
$( INSTALLED_ANDROID_INFO_TXT_TARGET) \
$( INSTALLED_KERNEL_TARGET) \
2020-10-14 23:17:20 +02:00
$( INSTALLED_RAMDISK_TARGET) \
2019-05-20 20:10:24 +02:00
$( INSTALLED_DTBIMAGE_TARGET) \
2018-11-26 19:12:05 +01:00
$( 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) \
2019-03-28 16:45:40 +01:00
$( PRODUCT_SYSTEM_BASE_FS_PATH) \
$( PRODUCT_VENDOR_BASE_FS_PATH) \
$( PRODUCT_PRODUCT_BASE_FS_PATH) \
2019-06-25 08:58:13 +02:00
$( PRODUCT_SYSTEM_EXT_BASE_FS_PATH) \
2019-03-28 16:45:40 +01:00
$( PRODUCT_ODM_BASE_FS_PATH) \
2020-05-07 23:58:20 +02:00
$( PRODUCT_VENDOR_DLKM_BASE_FS_PATH) \
2020-07-16 01:52:59 +02:00
$( PRODUCT_ODM_DLKM_BASE_FS_PATH) \
2018-11-26 19:12:05 +01:00
$( LPMAKE) \
$( SELINUX_FC) \
2019-06-27 22:55:23 +02:00
$( INSTALLED_MISC_INFO_TARGET) \
2018-11-26 19:12:05 +01:00
$( 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 \
2019-06-25 20:42:12 +02:00
$( ADD_IMG_TO_TARGET_FILES) \
2019-08-07 08:21:23 +02:00
$( MAKE_RECOVERY_PATCH) \
2019-08-21 22:29:30 +02:00
$( BUILT_KERNEL_CONFIGS_FILE) \
$( BUILT_KERNEL_VERSION_FILE) \
2018-11-26 19:12:05 +01:00
| $( ACP)
2009-03-04 04:28:42 +01:00
@echo " Package target files: $@ "
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)
2020-10-09 23:29:39 +02:00
i f n e q ( , $( INSTALLED_RECOVERYIMAGE_TARGET ) $( filter true ,$ ( BOARD_USES_RECOVERY_AS_BOOT ) ) $( filter true ,$ ( BOARD_MOVE_RECOVERY_RESOURCES_TO_VENDOR_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)
2021-04-04 10:12:25 +02:00
# Exclude recovery files in the default vendor ramdisk if including a standalone
# recovery ramdisk in vendor_boot.
i f n e q ( t r u e , $( BOARD_INCLUDE_RECOVERY_RAMDISK_IN_VENDOR_BOOT ) )
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)
2021-04-04 10:12:25 +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
2020-08-09 23:36:56 +02:00
i f n e q ( , $( filter true ,$ ( BOARD_USES_RECOVERY_AS_BOOT ) ) )
2020-03-12 00:03:07 +01:00
cp $( INSTALLED_KERNEL_TARGET) $( zip_root) /$( PRIVATE_RECOVERY_OUT) /
2020-10-08 20:54:02 +02:00
e l s e i f n e q ( t r u e , $( BOARD_EXCLUDE_KERNEL_FROM_RECOVERY_IMAGE ) )
2020-08-09 23:36:56 +02:00
cp $( firstword $( INSTALLED_KERNEL_TARGET) ) $( zip_root) /$( PRIVATE_RECOVERY_OUT) /kernel
e n d i f
2009-03-04 04:28:42 +01:00
e n d i f
2020-10-28 22:15:21 +01:00
i f n e q ( t r u e t r u e , $( strip $ ( BUILDING_VENDOR_BOOT_IMAGE ) ) $( strip $ ( BOARD_USES_RECOVERY_AS_BOOT ) ) )
2009-03-04 04:28:42 +01:00
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
2019-07-10 19:49:37 +02:00
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
2019-07-10 19:49:37 +02:00
cp $( BOARD_PREBUILT_RECOVERY_DTBOIMAGE) $( zip_root) /$( PRIVATE_RECOVERY_OUT) /recovery_dtbo
2019-02-04 19:35:25 +01:00
e l s e
2019-07-10 19:49:37 +02:00
cp $( BOARD_PREBUILT_DTBOIMAGE) $( zip_root) /$( PRIVATE_RECOVERY_OUT) /recovery_dtbo
2019-02-04 19:35:25 +01:00
e n d i f
2019-07-10 19:49:37 +02:00
e n d i f # BOARD_INCLUDE_RECOVERY_DTBO
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
2019-07-10 19:49:37 +02:00
cp $( BOARD_RECOVERY_ACPIO) $( zip_root) /$( PRIVATE_RECOVERY_OUT) /recovery_acpio
2018-09-23 16:10:47 +02:00
e n d i f
2019-05-20 20:10:24 +02: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
2019-07-10 19:49:37 +02:00
cp $( INSTALLED_DTBIMAGE_TARGET) $( zip_root) /$( PRIVATE_RECOVERY_OUT) /dtb
2019-01-23 03:08:59 +01:00
e n d i f
2020-10-12 20:08:30 +02:00
i f n e q ( t r u e , $( BOARD_EXCLUDE_KERNEL_FROM_RECOVERY_IMAGE ) )
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
2019-07-10 19:49:37 +02:00
echo " $( INTERNAL_KERNEL_CMDLINE) " > $( zip_root) /$( PRIVATE_RECOVERY_OUT) /cmdline
2020-10-12 20:08:30 +02:00
e n d i f # INTERNAL_KERNEL_CMDLINE != ""
e n d i f # BOARD_EXCLUDE_KERNEL_FROM_RECOVERY_IMAGE != true
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
2019-07-10 19:49:37 +02:00
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
2019-07-10 19:49:37 +02:00
echo " $( BOARD_KERNEL_PAGESIZE) " > $( zip_root) /$( PRIVATE_RECOVERY_OUT) /pagesize
2009-03-04 04:28:42 +01:00
e n d i f
Remove device-specific bits if recovery_as_boot
On legacy devices (launched with R and below), if device:
- has a vendor_boot partition, and
- uses recovery_as_boot
Then, when building the recovery/boot partition, the
device-specific bits, including dtb/kernel base/pagesize should
be moved to vendor_boot.
Previously, it is incorrectly assumed that A/B => recovery_as_boot.
In reality, we do have A/B devices with a dedicated recovery partition.
Note that for devices that uses GKI (BOARD_USES_GENERIC_KERNEL_IMAGE),
recovery_as_boot is never set to true. Instead, recovery resources
are moved to vendor_boot. On these devices, the conditional
'vendor_boot && recovery-as-boot' is always false. Hence:
- If the device has a dedicated recovery partition, it should use V3 header,
and dtb/base/pagesize won't be in recovery header.
- If device does not have a dedicated recovery partition, the recovery
image won't be built.
Test: builds
Change-Id: I0db2af20470cbe8a21044a984cccf264590aaccf
2020-10-29 00:33:06 +01:00
e n d i f # not (BUILDING_VENDOR_BOOT_IMAGE and BOARD_USES_RECOVERY_AS_BOOT)
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
2020-08-09 23:36:56 +02:00
$( hide) cp $( INSTALLED_KERNEL_TARGET) $( zip_root) /BOOT/
2009-03-04 04:28:42 +01:00
e n d i f
Do not assume GKI just with vendor_boot.
This change ensures changes to GENERIC_KERNEL_CMDLINE only affects
devices that explicitly says it uses GKI/generic boot image.
In details, if the device has vendor_boot, but does not explicitly
specify that it uses GKI/generic boot image, do not include
GENERIC_KERNEL_CMDLINE in boot. boot cmdline is left empty
in this case.
The old logic:
- If device uses GKI *OR* has vendor_boot:
boot uses GENERIC_KERNEL_CMDLINE, and do not include kernel base
and pagesize.
- If device has vendor_boot, INTERNAL_KERNEL_CMDLINE, kernel base
and pagesize goes in vendor_boot.
- If device does not use GKI nor have vendor_boot:
boot uses INTERNAL_KERNEL_CMDLINE, and includes kernel base and
pagesize.
The new logic:
- If using GKI, boot uses GENERIC_KERNEL_CMDLINE. Remove kernel base
and pagesize because they are device-specific.
- If not using GKI:
- If building vendor_boot, INTERNAL_KERNEL_CMDLINE, base and
pagesize goes in vendor_boot; boot does not have cmdline, base or
pagesize.
- Otherwise, put them in boot
Comparison of the code before and after:
- If device uses GKI,
- For boot partition:
- cmdline continues to be GENERIC_KERNEL_CMDLINE
- kernel base and pagesize continues to be excluded
- For vendor_boot partition:
- cmdline continues to be INTERNAL_KERNEL_CMDLINE
- kernel base and pagesize continues to be included
- If device does not use GKI:
- If device has a vendor_boot partition:
- For boot partition:
* cmdline changes from GENERIC_KERNEL_CMDLINE to empty
- kernel base and pagesize continues to be excluded
- For vendor_boot partition:
- cmdline continues to be INTERNAL_KERNEL_CMDLINE
- kernel base and pagesize continues to be included
- If device does not have a vendor_boot partition:
- For boot partition:
- cmdline continues to be INTERNAL_KERNEL_CMDLINE
- kernel base and pagesize continues to be included
Test: builds
Bug: 171512004
Change-Id: I4feac435698f43ac299b430bff66147057865a62
2020-10-28 21:50:47 +01:00
i f e q ( t r u e , $( BOARD_USES_GENERIC_KERNEL_IMAGE ) )
2020-10-12 20:08:30 +02:00
echo " $( GENERIC_KERNEL_CMDLINE) " > $( zip_root) /BOOT/cmdline
Do not assume GKI just with vendor_boot.
This change ensures changes to GENERIC_KERNEL_CMDLINE only affects
devices that explicitly says it uses GKI/generic boot image.
In details, if the device has vendor_boot, but does not explicitly
specify that it uses GKI/generic boot image, do not include
GENERIC_KERNEL_CMDLINE in boot. boot cmdline is left empty
in this case.
The old logic:
- If device uses GKI *OR* has vendor_boot:
boot uses GENERIC_KERNEL_CMDLINE, and do not include kernel base
and pagesize.
- If device has vendor_boot, INTERNAL_KERNEL_CMDLINE, kernel base
and pagesize goes in vendor_boot.
- If device does not use GKI nor have vendor_boot:
boot uses INTERNAL_KERNEL_CMDLINE, and includes kernel base and
pagesize.
The new logic:
- If using GKI, boot uses GENERIC_KERNEL_CMDLINE. Remove kernel base
and pagesize because they are device-specific.
- If not using GKI:
- If building vendor_boot, INTERNAL_KERNEL_CMDLINE, base and
pagesize goes in vendor_boot; boot does not have cmdline, base or
pagesize.
- Otherwise, put them in boot
Comparison of the code before and after:
- If device uses GKI,
- For boot partition:
- cmdline continues to be GENERIC_KERNEL_CMDLINE
- kernel base and pagesize continues to be excluded
- For vendor_boot partition:
- cmdline continues to be INTERNAL_KERNEL_CMDLINE
- kernel base and pagesize continues to be included
- If device does not use GKI:
- If device has a vendor_boot partition:
- For boot partition:
* cmdline changes from GENERIC_KERNEL_CMDLINE to empty
- kernel base and pagesize continues to be excluded
- For vendor_boot partition:
- cmdline continues to be INTERNAL_KERNEL_CMDLINE
- kernel base and pagesize continues to be included
- If device does not have a vendor_boot partition:
- For boot partition:
- cmdline continues to be INTERNAL_KERNEL_CMDLINE
- kernel base and pagesize continues to be included
Test: builds
Bug: 171512004
Change-Id: I4feac435698f43ac299b430bff66147057865a62
2020-10-28 21:50:47 +01:00
e l s e i f n d e f I N S T A L L E D _ V E N D O R _ B O O T I M A G E _ T A R G E T # && BOARD_USES_GENERIC_KERNEL_IMAGE != true
2020-10-12 20:08:30 +02:00
echo " $( INTERNAL_KERNEL_CMDLINE) " > $( zip_root) /BOOT/cmdline
2009-03-04 04:28:42 +01:00
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
2019-07-10 19:49:37 +02:00
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
2019-07-10 19:49:37 +02:00
cp $( INSTALLED_DTBIMAGE_TARGET) $( zip_root) /BOOT/dtb
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
2019-07-10 19:49:37 +02:00
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
2019-07-10 19:49:37 +02:00
echo " $( BOARD_KERNEL_PAGESIZE) " > $( zip_root) /BOOT/pagesize
2009-06-17 18:07:09 +02:00
e n d i f
2020-10-12 20:08:30 +02:00
e n d i f # INSTALLED_VENDOR_BOOTIMAGE_TARGET == "" && BOARD_USES_GENERIC_KERNEL_IMAGE != true
2019-07-10 19:49:37 +02:00
e n d i f # BOARD_USES_RECOVERY_AS_BOOT not true
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) ) ; )
2019-07-10 19:49:37 +02:00
i f d e f I N S T A L L E D _ V E N D O R _ B O O T I M A G E _ T A R G E T
mkdir -p $( zip_root) /VENDOR_BOOT
$( call package_files-copy-root, \
$( TARGET_VENDOR_RAMDISK_OUT) ,$( zip_root) /VENDOR_BOOT/RAMDISK)
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
cp $( INSTALLED_DTBIMAGE_TARGET) $( zip_root) /VENDOR_BOOT/dtb
e n d i f
2021-01-13 19:45:04 +01:00
i f d e f I N T E R N A L _ V E N D O R _ B O O T C O N F I G _ T A R G E T
cp $( INTERNAL_VENDOR_BOOTCONFIG_TARGET) $( zip_root) /VENDOR_BOOT/vendor_bootconfig
e n d i f
2019-07-10 19:49:37 +02:00
i f d e f B O A R D _ K E R N E L _ B A S E
echo " $( BOARD_KERNEL_BASE) " > $( zip_root) /VENDOR_BOOT/base
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
echo " $( BOARD_KERNEL_PAGESIZE) " > $( zip_root) /VENDOR_BOOT/pagesize
e n d i f
echo " $( INTERNAL_KERNEL_CMDLINE) " > $( zip_root) /VENDOR_BOOT/vendor_cmdline
2021-04-04 10:03:10 +02:00
i f d e f I N T E R N A L _ V E N D O R _ R A M D I S K _ F R A G M E N T S
echo " $( INTERNAL_VENDOR_RAMDISK_FRAGMENTS) " > " $( zip_root) /VENDOR_BOOT/vendor_ramdisk_fragments "
$( foreach vendor_ramdisk_fragment,$( INTERNAL_VENDOR_RAMDISK_FRAGMENTS) , \
2020-12-10 11:42:47 +01:00
mkdir -p $( zip_root) /VENDOR_BOOT/RAMDISK_FRAGMENTS/$( vendor_ramdisk_fragment) ; \
echo " $( BOARD_VENDOR_RAMDISK_FRAGMENT.$( vendor_ramdisk_fragment) .MKBOOTIMG_ARGS) " > " $( zip_root) /VENDOR_BOOT/RAMDISK_FRAGMENTS/ $( vendor_ramdisk_fragment) /mkbootimg_args " ; \
$( eval prebuilt_ramdisk := $( BOARD_VENDOR_RAMDISK_FRAGMENT.$( vendor_ramdisk_fragment) .PREBUILT) ) \
$( if $( prebuilt_ramdisk) , \
cp " $( prebuilt_ramdisk) " " $( zip_root) /VENDOR_BOOT/RAMDISK_FRAGMENTS/ $( vendor_ramdisk_fragment) /prebuilt_ramdisk " ; , \
$( call package_files-copy-root, \
$( VENDOR_RAMDISK_FRAGMENT.$( vendor_ramdisk_fragment) .STAGING_DIR) , \
$( zip_root) /VENDOR_BOOT/RAMDISK_FRAGMENTS/$( vendor_ramdisk_fragment) /RAMDISK) ; \
) )
2021-04-04 10:03:10 +02:00
e n d i f # INTERNAL_VENDOR_RAMDISK_FRAGMENTS != ""
2019-07-10 19:49:37 +02:00
e n d i f # INSTALLED_VENDOR_BOOTIMAGE_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
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
2019-06-25 08:58:13 +02:00
i f d e f B U I L D I N G _ S Y S T E M _ E X T _ I M A G E
@# Contents of the system_ext image
2018-05-29 14:09:01 +02:00
$( hide) $( call package_files-copy-root, \
2019-06-25 08:58:13 +02:00
$( TARGET_OUT_SYSTEM_EXT) ,$( zip_root) /SYSTEM_EXT)
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
2020-05-07 23:58:20 +02:00
i f d e f B U I L D I N G _ V E N D O R _ D L K M _ I M A G E
@# Contents of the vendor_dlkm image
$( hide) $( call package_files-copy-root, \
$( TARGET_OUT_VENDOR_DLKM) ,$( zip_root) /VENDOR_DLKM)
e n d i f
2020-07-16 01:52:59 +02:00
i f d e f B U I L D I N G _ O D M _ D L K M _ I M A G E
@# Contents of the odm_dlkm image
$( hide) $( call package_files-copy-root, \
$( TARGET_OUT_ODM_DLKM) ,$( zip_root) /ODM_DLKM)
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/
2020-10-14 23:17:20 +02: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
i f e q ( t r u e , $( BOARD_IMG_USE_RAMDISK ) )
@# Contents of the ramdisk image
$( hide) mkdir -p $( zip_root) /IMAGES
$( hide) cp $( INSTALLED_RAMDISK_TARGET) $( zip_root) /IMAGES/
e n d i f
e n d i f
2020-04-17 19:08:10 +02:00
i f e q ( $( TARGET_OTA_ALLOW_NON_AB ) , 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
2019-06-27 22:55:23 +02:00
$( hide) cp $( INSTALLED_MISC_INFO_TARGET) $( zip_root) /META/misc_info.txt
2019-03-28 16:45:40 +01:00
i f n e q ( $( PRODUCT_SYSTEM_BASE_FS_PATH ) , )
$( hide) cp $( PRODUCT_SYSTEM_BASE_FS_PATH) \
$( zip_root) /META/$( notdir $( PRODUCT_SYSTEM_BASE_FS_PATH) )
2016-03-30 00:12:37 +02:00
e n d i f
2019-03-28 16:45:40 +01:00
i f n e q ( $( PRODUCT_VENDOR_BASE_FS_PATH ) , )
$( hide) cp $( PRODUCT_VENDOR_BASE_FS_PATH) \
$( zip_root) /META/$( notdir $( PRODUCT_VENDOR_BASE_FS_PATH) )
2016-03-30 00:12:37 +02:00
e n d i f
2019-03-28 16:45:40 +01:00
i f n e q ( $( PRODUCT_PRODUCT_BASE_FS_PATH ) , )
$( hide) cp $( PRODUCT_PRODUCT_BASE_FS_PATH) \
$( zip_root) /META/$( notdir $( PRODUCT_PRODUCT_BASE_FS_PATH) )
2017-11-27 09:04:47 +01:00
e n d i f
2019-06-25 08:58:13 +02:00
i f n e q ( $( PRODUCT_SYSTEM_EXT_BASE_FS_PATH ) , )
$( hide) cp $( PRODUCT_SYSTEM_EXT_BASE_FS_PATH) \
$( zip_root) /META/$( notdir $( PRODUCT_SYSTEM_EXT_BASE_FS_PATH) )
2018-05-29 14:09:01 +02:00
e n d i f
2019-03-28 16:45:40 +01:00
i f n e q ( $( PRODUCT_ODM_BASE_FS_PATH ) , )
$( hide) cp $( PRODUCT_ODM_BASE_FS_PATH) \
$( zip_root) /META/$( notdir $( PRODUCT_ODM_BASE_FS_PATH) )
2017-11-14 16:42:30 +01:00
e n d i f
2020-05-07 23:58:20 +02:00
i f n e q ( $( PRODUCT_VENDOR_DLKM_BASE_FS_PATH ) , )
$( hide) cp $( PRODUCT_VENDOR_DLKM_BASE_FS_PATH) \
$( zip_root) /META/$( notdir $( PRODUCT_VENDOR_DLKM_BASE_FS_PATH) )
e n d i f
2020-07-16 01:52:59 +02:00
i f n e q ( $( PRODUCT_ODM_DLKM_BASE_FS_PATH ) , )
$( hide) cp $( PRODUCT_ODM_DLKM_BASE_FS_PATH) \
$( zip_root) /META/$( notdir $( PRODUCT_ODM_DLKM_BASE_FS_PATH) )
e n d i f
2020-04-17 19:08:10 +02:00
i f e q ( $( TARGET_OTA_ALLOW_NON_AB ) , t r u e )
2015-08-19 03:03:56 +02:00
i f n e q ( $( INSTALLED_RECOVERYIMAGE_TARGET ) , )
2019-06-24 21:39:10 +02:00
$( hide) PATH = $( INTERNAL_USERIMAGES_BINARY_PATHS) :$$ PATH MKBOOTIMG = $( MKBOOTIMG) \
2019-08-07 08:21:23 +02:00
$( MAKE_RECOVERY_PATCH) $( zip_root) $( zip_root)
2015-09-25 03:12:33 +02:00
e n d i f
2019-11-07 20:27:02 +01: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
2021-05-13 22:37:53 +02:00
$( hide) for part in $( strip $( AB_OTA_PARTITIONS) ) ; do \
2015-10-02 02:38:09 +02:00
echo " $$ {part} " >> $( zip_root) /META/ab_partitions.txt; \
done
2021-05-13 22:37:53 +02:00
$( hide) for conf in $( strip $( AB_OTA_POSTINSTALL_CONFIG) ) ; do \
2015-11-12 22:53:25 +01:00
echo " $$ {conf} " >> $( zip_root) /META/postinstall_config.txt; \
done
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.
2019-05-29 00:36:47 +02:00
$( hide) cp -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
2019-06-25 08:58:13 +02:00
i f d e f B O A R D _ P R E B U I L T _ S Y S T E M _ E X T I M A G E
2018-05-29 14:09:01 +02:00
$( hide) mkdir -p $( zip_root) /IMAGES
2019-06-25 08:58:13 +02:00
$( hide) cp $( INSTALLED_SYSTEM_EXTIMAGE_TARGET) $( zip_root) /IMAGES/
2018-05-29 14:09:01 +02:00
e n d i f
2021-05-19 18:14:42 +02:00
i f n 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
2020-11-09 20:52:52 +01:00
i f n e q ( , $( INTERNAL_PREBUILT_BOOTIMAGE ) $( filter true ,$ ( BOARD_COPY_BOOT_IMAGE_TO_TARGET_FILES ) ) )
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
2017-07-18 19:05:13 +02:00
$( hide) mkdir -p $( zip_root) /IMAGES
$( hide) cp $( INSTALLED_BOOTIMAGE_TARGET) $( zip_root) /IMAGES/
2020-11-09 20:52:52 +01:00
e n d i f # INSTALLED_BOOTIMAGE_TARGET
e n d i f # INTERNAL_PREBUILT_BOOTIMAGE != "" || BOARD_COPY_BOOT_IMAGE_TO_TARGET_FILES == true
2021-05-19 18:14:42 +02:00
e l s e # BOARD_PREBUILT_BOOTIMAGE is defined
$( hide) mkdir -p $( zip_root) /PREBUILT_IMAGES
$( hide) cp $( INSTALLED_BOOTIMAGE_TARGET) $( zip_root) /PREBUILT_IMAGES/
e n d i f # BOARD_PREBUILT_BOOTIMAGE
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
2020-08-27 03:41:04 +02:00
i f d e f B O A R D _ P R E B U I L T _ V E N D O R _ D L K M I M A G E
2020-05-07 23:58:20 +02:00
$( hide) mkdir -p $( zip_root) /IMAGES
2020-08-27 03:41:04 +02:00
$( hide) cp $( INSTALLED_VENDOR_DLKMIMAGE_TARGET) $( zip_root) /IMAGES/
e n d i f
i f d e f B O A R D _ P R E B U I L T _ O D M _ D L K M I M A G E
$( hide) mkdir -p $( zip_root) /IMAGES
$( hide) cp $( INSTALLED_ODM_DLKMIMAGE_TARGET) $( zip_root) /IMAGES/
2020-05-07 23:58:20 +02:00
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/
2017-05-26 12:30:04 +02:00
e n d i f # BOARD_PREBUILT_DTBOIMAGE
2020-11-29 15:04:28 +01:00
i f d e f B O A R D _ P R E B U I L T _ P V M F W I M A G E
$( hide) mkdir -p $( zip_root) /PREBUILT_IMAGES
$( hide) cp $( INSTALLED_PVMFWIMAGE_TARGET) $( zip_root) /PREBUILT_IMAGES/
2021-10-07 12:18:17 +02:00
e l s e i f e q ( $( BUILDING_PVMFW_IMAGE ) , t r u e )
$( hide) mkdir -p $( zip_root) /IMAGES
$( hide) cp $( INSTALLED_PVMFWIMAGE_TARGET) $( zip_root) /IMAGES/
e n d i f
2020-08-27 02:54: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 L O A D E R
$( hide) mkdir -p $( zip_root) /IMAGES
$( hide) cp $( INSTALLED_BOOTLOADER_MODULE) $( zip_root) /IMAGES/
e n d i f
Add options to sign the prebuilt custom images.
The custom images are any images owned by OEMs and SoCs, oem images
mounted on /oem is an example. The oem images can be used to customize
devices for different carriers, like wallpaper, ringtones, and
carrier-specific apks. OEMs can generate multiple oem images, like
oem.img, oem-carrier1.img and oem-carrier2.img and flash different oem
images for different carriers. The oem images are only one case, OEMs
and SoCs can add more custom images and mount them to custom partitions.
This change enables custom images to be vbmeta.img chained partitions.
The following configuration in BoardConfig.mk is an exmaple. It has two
custom partitions: oem and test. They will be signed by different keys.
And they will be chained by vbmeta.img. The custom images here are
prebuilts, which can be built by `make custom_images` separately.
BOARD_AVB_<CUSTOM_PARTITION>_IMAGE_LIST should include all custom images
to apply AVB signing. And to every custom partition, one image whose
name is partition name must be added in its
BOARD_AVB_<CUSTOM_PARTITION>_IMAGE_LIST.
BOARD_CUSTOMIMAGES_PARTITION_LIST := oem test
BOARD_AVB_OEM_KEY_PATH := external/avb/test/data/testkey_rsa4096.pem
BOARD_AVB_OEM_ALGORITHM := SHA256_RSA4096
BOARD_AVB_OEM_ADD_HASHTREE_FOOTER_ARGS :=
BOARD_AVB_OEM_ROLLBACK_INDEX_LOCATION := 1
BOARD_AVB_OEM_PARTITION_SIZE := 5242880
BOARD_AVB_OEM_IMAGE_LIST := \
device/xxxx/yyyy/oem/oem.img \
device/xxxx/yyyy/oem/oem1.img
BOARD_AVB_TEST_KEY_PATH := external/avb/test/data/testkey_rsa2048.pem
BOARD_AVB_TEST_ALGORITHM := SHA256_RSA2048
BOARD_AVB_TEST_ADD_HASHTREE_FOOTER_ARGS :=
BOARD_AVB_TEST_ROLLBACK_INDEX_LOCATION := 2
BOARD_AVB_TEST_PARTITION_SIZE := 10485760
BOARD_AVB_TEST_IMAGE_LIST := \
device/xxxx/yyyy/test/test.img \
device/xxxx/yyyy/test/test1.img
To resign the custom images in the target zip file, the
avb_extra_custom_image_key, avb_extra_custom_image_algorithms and
avb_extra_custom_image_extra_args options are added to the
sign_target_files_apks tool too. The following test cases list some
examples about how to use them.
BUG: 154171021
Test: 1) "atest --host releasetools_test releasetools_py3_test -c"
2) Build images by 'make dist', sign and validate target files.
a) Test on dist w/ chained vbmeta_system and ome custom images
sign_target_files_apks -d certs \
--avb_extra_custom_image_key oem=oem_rsa4096.pem \
--avb_extra_custom_image_algorithm oem=SHA256_RSA4096 \
xxx-target_xxx.zip signed.zip
validate_target_files.py signed.zip
Flash image and boot up.
Verify the oem images and vbmeta images in OUT and target zips by
avbtool.
b) Test on dist w/ chained vbmeta_system and oem and test custom images
sign_target_files_apks -d certs \
--avb_extra_custom_image_key oem=oem_rsa4096.pem \
--avb_extra_custom_image_algorithm oem=SHA256_RSA4096 \
--avb_extra_custom_image_extra_args oem=--do_not_generate_fec \
--avb_extra_custom_image_key test=test_rsa4096.pem \
--avb_extra_custom_image_algorithm test=SHA256_RSA4096 \
xxx-target_xxx.zip signed.zip
validate_target_files.py signed.zip
Verify the oem, test images and vbmeta images in OUT and target zips
by avbtool.
c) Test on dist w/o chained partition.
sign_target_files_apks -d certs xxx-target_xxx.zip signed.zip
validate_target_files.py signed.zip
Flash image and boot up.
Verify the vbmeta images in OUT and target zips by avbtool.
Change-Id: Ifccfee5e8909697eef6ccda0cc352fa16a9f6db6
2020-04-28 03:36:36 +02:00
i f n e q ( $( strip $ ( BOARD_CUSTOMIMAGES_PARTITION_LIST ) ) , )
$( hide) mkdir -p $( zip_root) /PREBUILT_IMAGES
$( hide) $( foreach partition,$( BOARD_CUSTOMIMAGES_PARTITION_LIST) , \
$( foreach image,$( BOARD_AVB_$( call to-upper,$( partition) ) _IMAGE_LIST) ,cp $( image) $( zip_root) /PREBUILT_IMAGES/; ) )
e n d i f # BOARD_CUSTOMIMAGES_PARTITION_LIST
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
2019-06-25 08:58:13 +02:00
i f d e f B U I L D I N G _ S Y S T E M _ E X T _ I M A G E
$( hide) $( call fs_config,$( zip_root) /SYSTEM_EXT,system_ext/) > $( zip_root) /META/system_ext_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
2020-05-07 23:58:20 +02: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 _ D L K M _ I M A G E
$( hide) $( call fs_config,$( zip_root) /VENDOR_DLKM,vendor_dlkm/) > $( zip_root) /META/vendor_dlkm_filesystem_config.txt
2020-07-16 01:52:59 +02:00
e n d i f
i f d e f B U I L D I N G _ O D M _ D L K M _ I M A G E
$( hide) $( call fs_config,$( zip_root) /ODM_DLKM,odm_dlkm/) > $( zip_root) /META/odm_dlkm_filesystem_config.txt
2017-11-14 16:42:30 +01:00
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
2019-07-10 19:49:37 +02:00
i f n e q ( $( INSTALLED_VENDOR_BOOTIMAGE_TARGET ) , )
$( call fs_config,$( zip_root) /VENDOR_BOOT/RAMDISK,) > $( zip_root) /META/vendor_boot_filesystem_config.txt
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.
2019-08-21 22:29:30 +02:00
i f d e f B U I L T _ K E R N E L _ C O N F I G S _ F I L E
$( hide) cp $( BUILT_KERNEL_CONFIGS_FILE) $( zip_root) /META/kernel_configs.txt
e n d i f
i f d e f B U I L T _ K E R N E L _ V E R S I O N _ F I L E
$( hide) cp $( BUILT_KERNEL_VERSION_FILE) $( zip_root) /META/kernel_version.txt
e n d i f
2019-11-02 01:03:57 +01:00
rm -rf $( zip_root) /META/dynamic_partitions_info.txt
i f e q ( t r u e , $( PRODUCT_USE_DYNAMIC_PARTITIONS ) )
$( call dump-dynamic-partitions-info, $( zip_root) /META/dynamic_partitions_info.txt)
e n d i f
2019-10-08 07:46:02 +02:00
PATH = $( INTERNAL_USERIMAGES_BINARY_PATHS) :$$ PATH MKBOOTIMG = $( MKBOOTIMG) \
$( ADD_IMG_TO_TARGET_FILES) -a -v -p $( HOST_OUT) $( zip_root)
2019-07-05 11:30:41 +02:00
i f e q ( $( BUILD_QEMU_IMAGES ) , t r u e )
$( hide) AVBTOOL = $( AVBTOOL) $( MK_VBMETA_BOOT_KERNEL_CMDLINE_SH) $( zip_root) /IMAGES/vbmeta.img \
$( zip_root) /IMAGES/system.img $( zip_root) /IMAGES/VerifiedBootParams.textproto
e n d i f
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
2021-02-04 01:03:55 +01:00
$( hide) $( SOONG_ZIP) -d -o $@ -C $( zip_root) -r $@ .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
$( call dist -for -goals , target -files -package , $ ( BUILT_TARGET_FILES_PACKAGE ) )
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
2021-09-16 23:50:08 +02:00
i f e q ( $( HOST_OS ) , l i n u x )
2016-10-14 22:23:06 +02:00
$( call dist -for -goals ,sdk ,$ ( NDK_SYSROOT_TARGET ) )
2021-09-16 23:50:08 +02:00
e n d i f
2016-10-14 22:23:06 +02:00
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
2020-10-17 03:53:47 +02:00
PATH = $( INTERNAL_USERIMAGES_BINARY_PATHS) :$( dir $( ZIP2ZIP) ) :$$ PATH \
2019-08-05 21:05:45 +02:00
$( OTA_FROM_TARGET_FILES) \
--verbose \
--extracted_input_target_files $( patsubst %.zip,%,$( BUILT_TARGET_FILES_PACKAGE) ) \
--path $( HOST_OUT) \
$( if $( OEM_OTA_CONFIG) , --oem_settings $( OEM_OTA_CONFIG) ) \
$( 2) \
$( BUILT_TARGET_FILES_PACKAGE) $( 1)
2018-11-09 02:44:12 +01:00
e n d e f
2020-10-17 03:53:47 +02:00
product_name := $( TARGET_PRODUCT)
2009-06-15 23:30:14 +02:00
i f e q ( $( TARGET_BUILD_TYPE ) , d e b u g )
2020-10-17 03:53:47 +02:00
product_name := $( product_name) _debug
2009-06-15 23:30:14 +02:00
e n d i f
2020-10-17 03:53:47 +02:00
name := $( product_name) -ota-$( FILE_NAME_TAG)
2009-06-15 23:30:14 +02:00
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 )
2019-02-19 23:52:33 +01:00
$(INTERNAL_OTA_PACKAGE_TARGET) : .KATI_IMPLICIT_OUTPUTS := $( INTERNAL_OTA_METADATA )
2020-10-08 18:36:29 +02:00
$(INTERNAL_OTA_PACKAGE_TARGET) : $( BUILT_TARGET_FILES_PACKAGE ) $( OTA_FROM_TARGET_FILES ) $( INTERNAL_OTATOOLS_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 )
2020-10-17 03:53:47 +02:00
name := $( product_name) -ota-retrofit-$( FILE_NAME_TAG)
2018-11-09 02:44:12 +01:00
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 )
2019-08-05 21:05:45 +02:00
$(INTERNAL_OTA_RETROFIT_DYNAMIC_PARTITIONS_PACKAGE_TARGET) : \
$( BUILT_TARGET_FILES_PACKAGE) \
2020-10-08 18:36:29 +02:00
$( OTA_FROM_TARGET_FILES) \
$( INTERNAL_OTATOOLS_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
2020-10-17 03:53:47 +02:00
i f n e q ( $( BOARD_PARTIAL_OTA_UPDATE_PARTITIONS_LIST ) , )
name := $( product_name) -partial-ota-$( FILE_NAME_TAG)
INTERNAL_OTA_PARTIAL_PACKAGE_TARGET := $( PRODUCT_OUT) /$( name) .zip
$(INTERNAL_OTA_PARTIAL_PACKAGE_TARGET) : KEY_CERT_PAIR := $( DEFAULT_KEY_CERT_PAIR )
$(INTERNAL_OTA_PARTIAL_PACKAGE_TARGET) : $( BUILT_TARGET_FILES_PACKAGE ) $( OTA_FROM_TARGET_FILES ) $( INTERNAL_OTATOOLS_FILES )
@echo " Package partial OTA: $@ "
$( call build-ota-package-target,$@ ,-k $( KEY_CERT_PAIR) --partial " $( BOARD_PARTIAL_OTA_UPDATE_PARTITIONS_LIST) " )
.PHONY : partialotapackage
partialotapackage : $( INTERNAL_OTA_PARTIAL_PACKAGE_TARGET )
e n d i f # BOARD_PARTIAL_OTA_UPDATE_PARTITIONS_LIST
2015-08-11 20:24:19 +02:00
e n d i f # build_ota_package
2014-06-03 23:07:27 +02:00
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.
2020-06-04 16:16:39 +02:00
i f e q ( , $( TARGET_BUILD_UNBUNDLED ) )
2020-08-27 03:43:21 +02:00
$(APPCOMPAT_ZIP) : $( FULL_SYSTEMIMAGE_DEPS ) \
$( INTERNAL_RAMDISK_FILES) \
$( INTERNAL_USERDATAIMAGE_FILES) \
$( INTERNAL_VENDORIMAGE_FILES) \
$( INTERNAL_PRODUCTIMAGE_FILES) \
$( INTERNAL_SYSTEM_EXTIMAGE_FILES)
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)
2021-04-27 16:52:15 +02:00
# The mac build doesn't build dex2oat, so create the zip file only if the build OS is linux.
i f e q ( $( BUILD_OS ) , l i n u x )
2021-05-13 06:29:39 +02:00
i f n e q ( $( DEX 2OAT ) , )
2021-04-27 16:52:15 +02:00
dexpreopt_tools_deps := $( DEXPREOPT_GEN_DEPS) $( DEXPREOPT_GEN) $( AAPT2)
DEXPREOPT_TOOLS_ZIP := $( PRODUCT_OUT) /dexpreopt_tools.zip
$(DEXPREOPT_TOOLS_ZIP) : $( dexpreopt_tools_deps )
$(DEXPREOPT_TOOLS_ZIP) : PRIVATE_DEXPREOPT_TOOLS_DEPS := $( dexpreopt_tools_deps )
$(DEXPREOPT_TOOLS_ZIP) : $( SOONG_ZIP )
$( hide) mkdir -p $( dir $@ )
$( hide) $( SOONG_ZIP) -d -o $@ -j $( addprefix -f ,$( PRIVATE_DEXPREOPT_TOOLS_DEPS) ) -f $$ ( realpath $( DEX2OAT) )
2021-05-13 06:29:39 +02:00
e n d i f # DEX2OAT is set
e n d i f # BUILD_OS == linux
2021-04-27 16:52:15 +02:00
2021-04-07 16:57:16 +02:00
DEXPREOPT_CONFIG_ZIP := $( PRODUCT_OUT) /dexpreopt_config.zip
2021-06-08 04:31:31 +02:00
$(DEXPREOPT_CONFIG_ZIP) : $( INSTALLED_SYSTEMIMAGE_TARGET ) \
$( INSTALLED_VENDORIMAGE_TARGET) \
$( INSTALLED_ODMIMAGE_TARGET) \
$( INSTALLED_PRODUCTIMAGE_TARGET) \
i f e q ( , $( TARGET_BUILD_UNBUNDLED ) )
$(DEXPREOPT_CONFIG_ZIP) : $( DEX_PREOPT_CONFIG_FOR_MAKE ) \
$( DEX_PREOPT_SOONG_CONFIG_FOR_MAKE) \
e n d i f
2021-04-07 16:57:16 +02:00
$(DEXPREOPT_CONFIG_ZIP) : $( SOONG_ZIP )
$( hide) mkdir -p $( dir $@ ) $( PRODUCT_OUT) /dexpreopt_config
2021-06-08 04:31:31 +02:00
i f e q ( , $( TARGET_BUILD_UNBUNDLED ) )
2021-04-23 12:09:04 +02:00
i f n e q ( , $( DEX_PREOPT_CONFIG_FOR_MAKE ) )
2021-04-07 16:57:16 +02:00
$( hide) cp $( DEX_PREOPT_CONFIG_FOR_MAKE) $( PRODUCT_OUT) /dexpreopt_config
2021-04-23 12:09:04 +02:00
e n d i f
i f n e q ( , $( DEX_PREOPT_SOONG_CONFIG_FOR_MAKE ) )
2021-04-07 16:57:16 +02:00
$( hide) cp $( DEX_PREOPT_SOONG_CONFIG_FOR_MAKE) $( PRODUCT_OUT) /dexpreopt_config
2021-04-23 12:09:04 +02:00
e n d i f
2021-06-08 04:31:31 +02:00
e n d i f #!TARGET_BUILD_UNBUNDLED
2021-04-07 16:57:16 +02:00
$( hide) $( SOONG_ZIP) -d -o $@ -C $( PRODUCT_OUT) /dexpreopt_config -D $( PRODUCT_OUT) /dexpreopt_config
2021-06-08 04:31:31 +02:00
.PHONY : dexpreopt_config_zip
dexpreopt_config_zip : $( DEXPREOPT_CONFIG_ZIP )
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.
2020-06-04 16:16:39 +02:00
i f e q ( , $( TARGET_BUILD_UNBUNDLED ) )
2021-01-14 03:19:54 +01:00
$(SYMBOLS_ZIP) : $( INTERNAL_ALLIMAGES_FILES ) $( 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) )
2019-03-21 07:19:16 +01:00
$( hide) find -L $( TARGET_OUT_UNSTRIPPED) -type f | sort >$( PRIVATE_LIST_FILE)
2019-05-07 20:47:13 +02:00
$( hide) $( SOONG_ZIP) --ignore_missing_files -d -o $@ -C $( OUT_DIR) /.. -l $( PRIVATE_LIST_FILE)
2016-09-12 22:56:50 +02:00
# -----------------------------------------------------------------
# A zip of the coverage directory.
#
2019-05-01 00:14:44 +02:00
name := gcov-report-files-all
2016-09-12 22:56:50 +02:00
i f e q ( $( TARGET_BUILD_TYPE ) , d e b u g )
name := $( name) _debug
e n d i f
COVERAGE_ZIP := $( PRODUCT_OUT) /$( name) .zip
2020-06-04 16:16:39 +02:00
i f e q ( , $( TARGET_BUILD_UNBUNDLED ) )
2021-01-14 03:19:54 +01:00
$(COVERAGE_ZIP) : $( INTERNAL_ALLIMAGES_FILES )
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
2019-12-11 23:55:52 +01:00
#------------------------------------------------------------------
# Export the LLVM profile data tool and dependencies for Clang coverage processing
#
i f e q ( t r u e , $( CLANG_COVERAGE ) )
LLVM_PROFDATA := $( LLVM_PREBUILTS_BASE) /linux-x86/$( LLVM_PREBUILTS_VERSION) /bin/llvm-profdata
LIBCXX := $( LLVM_PREBUILTS_BASE) /linux-x86/$( LLVM_PREBUILTS_VERSION) /lib64/libc++.so.1
PROFDATA_ZIP := $( PRODUCT_OUT) /llvm-profdata.zip
$( PROFDATA_ZIP) : $( SOONG_ZIP)
$( hide) $( SOONG_ZIP) -d -o $@ -C $( LLVM_PREBUILTS_BASE) /linux-x86/$( LLVM_PREBUILTS_VERSION) -f $( LLVM_PROFDATA) -f $( LIBCXX)
2021-06-16 23:57:36 +02:00
$( call dist-for-goals,droidcore-unbundled,$( PROFDATA_ZIP) )
2019-12-11 23:55:52 +01:00
e n d i f
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
2020-08-27 03:43:21 +02:00
$(APPS_ZIP) : $( FULL_SYSTEMIMAGE_DEPS )
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
2021-04-07 03:04:06 +02:00
$(JACOCO_REPORT_CLASSES_ALL) : PRIVATE_TARGET_JACOCO_DIR := $( call intermediates -dir -for ,PACKAGING ,jacoco )
$(JACOCO_REPORT_CLASSES_ALL) : PRIVATE_HOST_JACOCO_DIR := $( call intermediates -dir -for ,PACKAGING ,jacoco ,HOST )
$(JACOCO_REPORT_CLASSES_ALL) : PRIVATE_TARGET_PROGUARD_USAGE_DIR := $( call intermediates -dir -for ,PACKAGING ,proguard_usage )
$(JACOCO_REPORT_CLASSES_ALL) : PRIVATE_HOST_PROGUARD_USAGE_DIR := $( call intermediates -dir -for ,PACKAGING ,proguard_usage ,HOST )
2017-04-12 01:36:46 +02:00
$(JACOCO_REPORT_CLASSES_ALL) :
@echo "Collecting uninstrumented classes"
2021-04-07 03:04:06 +02:00
mkdir -p $( PRIVATE_TARGET_JACOCO_DIR) $( PRIVATE_HOST_JACOCO_DIR) $( PRIVATE_TARGET_PROGUARD_USAGE_DIR) $( PRIVATE_HOST_PROGUARD_USAGE_DIR)
$( SOONG_ZIP) -o $@ -L 0 \
-C $( PRIVATE_TARGET_JACOCO_DIR) -P out/target/common/obj -D $( PRIVATE_TARGET_JACOCO_DIR) \
-C $( PRIVATE_HOST_JACOCO_DIR) -P out/target/common/obj -D $( PRIVATE_HOST_JACOCO_DIR) \
-C $( PRIVATE_TARGET_PROGUARD_USAGE_DIR) -P out/target/common/obj -D $( PRIVATE_TARGET_PROGUARD_USAGE_DIR) \
-C $( PRIVATE_HOST_PROGUARD_USAGE_DIR) -P out/target/common/obj -D $( PRIVATE_HOST_PROGUARD_USAGE_DIR)
2017-04-12 01:36:46 +02:00
2021-01-21 04:46:56 +01:00
i f e q ( , $( TARGET_BUILD_UNBUNDLED ) )
$( JACOCO_REPORT_CLASSES_ALL) : $( INTERNAL_ALLIMAGES_FILES)
e n d i f
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.
#
2013-08-29 03:38:25 +02:00
PROGUARD_DICT_ZIP := $( PRODUCT_OUT) /$( TARGET_PRODUCT) -proguard-dict-$( FILE_NAME_TAG) .zip
2019-09-06 02:19:35 +02:00
# For apps_only build we'll establish the dependency later in build/make/core/main.mk.
2020-06-04 16:16:39 +02:00
i f e q ( , $( TARGET_BUILD_UNBUNDLED ) )
2021-01-14 03:19:54 +01:00
$(PROGUARD_DICT_ZIP) : $( INTERNAL_ALLIMAGES_FILES ) $( updater_dep )
2019-09-06 02:19:35 +02:00
e n d i f
2021-04-07 03:04:06 +02:00
$(PROGUARD_DICT_ZIP) : PRIVATE_PACKAGING_DIR := $( call intermediates -dir -for ,PACKAGING ,proguard_dictionary )
2019-09-06 02:19:35 +02:00
$(PROGUARD_DICT_ZIP) : $( SOONG_ZIP )
2013-08-23 05:52:47 +02:00
@echo "Packaging Proguard obfuscation dictionary files."
2021-04-07 03:04:06 +02:00
mkdir -p $( dir $@ ) $( PRIVATE_PACKAGING_DIR)
$( SOONG_ZIP) --ignore_missing_files -d -o $@ -C $( PRIVATE_PACKAGING_DIR) -P out/target/common/obj -D $( PRIVATE_PACKAGING_DIR)
2013-08-23 05:52:47 +02:00
2020-08-15 02:43:35 +02:00
#------------------------------------------------------------------
# A zip of Proguard usage files.
#
PROGUARD_USAGE_ZIP := $( PRODUCT_OUT) /$( TARGET_PRODUCT) -proguard-usage-$( FILE_NAME_TAG) .zip
# For apps_only build we'll establish the dependency later in build/make/core/main.mk.
i f e q ( , $( TARGET_BUILD_UNBUNDLED ) )
$(PROGUARD_USAGE_ZIP) : \
$( INSTALLED_SYSTEMIMAGE_TARGET) \
$( INSTALLED_RAMDISK_TARGET) \
$( INSTALLED_BOOTIMAGE_TARGET) \
$( INSTALLED_USERDATAIMAGE_TARGET) \
$( INSTALLED_VENDORIMAGE_TARGET) \
$( INSTALLED_PRODUCTIMAGE_TARGET) \
$( INSTALLED_SYSTEM_EXTIMAGE_TARGET) \
$( INSTALLED_ODMIMAGE_TARGET) \
$( INSTALLED_VENDOR_DLKMIMAGE_TARGET) \
$( INSTALLED_ODM_DLKMIMAGE_TARGET) \
$( updater_dep)
e n d i f
2021-04-07 03:04:06 +02:00
$(PROGUARD_USAGE_ZIP) : PRIVATE_LIST_FILE := $( call intermediates -dir -for ,PACKAGING ,proguard_usage .zip ) /filelist
$(PROGUARD_USAGE_ZIP) : PRIVATE_PACKAGING_DIR := $( call intermediates -dir -for ,PACKAGING ,proguard_usage )
2020-08-15 02:43:35 +02:00
$(PROGUARD_USAGE_ZIP) : $( MERGE_ZIPS )
@echo "Packaging Proguard usage files."
2021-04-07 03:04:06 +02:00
mkdir -p $( dir $@ ) $( PRIVATE_PACKAGING_DIR) $( dir $( PRIVATE_LIST_FILE) )
find $( PRIVATE_PACKAGING_DIR) -name proguard_usage.zip > $( PRIVATE_LIST_FILE)
2020-08-15 02:43:35 +02:00
$( MERGE_ZIPS) $@ @$( PRIVATE_LIST_FILE)
2018-11-29 21:06:31 +01:00
2019-06-28 20:00:05 +02:00
i f e q ( t r u e , $( PRODUCT_USE_DYNAMIC_PARTITIONS ) )
2018-11-29 21:06:31 +01:00
2019-06-28 20:00:05 +02:00
# Dump variables used by build_super_image.py (for building super.img and super_empty.img).
# $(1): output file
2019-03-11 23:55:33 +01:00
d e f i n e d u m p - s u p e r - i m a g e - i n f o
$( call dump-dynamic-partitions-info,$( 1) )
$( if $( filter true,$( AB_OTA_UPDATER) ) , \
echo "ab_update=true" >> $( 1) )
e n d e f
2019-06-28 20:00:05 +02:00
e n d i f # PRODUCT_USE_DYNAMIC_PARTITIONS
# -----------------------------------------------------------------
# super partition image (dist)
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 ) , )
2018-11-29 21:06:31 +01:00
i f n e q ( t r u e , $( PRODUCT_RETROFIT_DYNAMIC_PARTITIONS ) )
2019-04-17 00:44:30 +02:00
# For real devices and for dist builds, build super image from target files to an intermediate directory.
INTERNAL_SUPERIMAGE_DIST_TARGET := $( call intermediates-dir-for,PACKAGING,super.img) /super.img
$(INTERNAL_SUPERIMAGE_DIST_TARGET) : extracted_input_target_files := $( patsubst %.zip ,%,$ ( BUILT_TARGET_FILES_PACKAGE ) )
$(INTERNAL_SUPERIMAGE_DIST_TARGET) : $( LPMAKE ) $( BUILT_TARGET_FILES_PACKAGE ) $( BUILD_SUPER_IMAGE )
$( call pretty," Target super fs image from target files: $@ " )
2018-12-13 19:45:46 +01:00
PATH = $( dir $( LPMAKE) ) :$$ PATH \
$( BUILD_SUPER_IMAGE) -v $( extracted_input_target_files) $@
2019-03-11 23:55:33 +01:00
2019-04-17 23:28:52 +02:00
# Skip packing it in dist package because it is in update package.
i f n e q ( t r u e , $( BOARD_SUPER_IMAGE_IN_UPDATE_PACKAGE ) )
2019-04-17 00:44:30 +02:00
$( call dist -for -goals ,dist_files ,$ ( INTERNAL_SUPERIMAGE_DIST_TARGET ) )
2019-04-17 23:28:52 +02:00
e n d i f
2019-04-17 00:44:30 +02:00
.PHONY : superimage_dist
superimage_dist : $( INTERNAL_SUPERIMAGE_DIST_TARGET )
e n d i f # PRODUCT_RETROFIT_DYNAMIC_PARTITIONS != "true"
e n d i f # BOARD_SUPER_PARTITION_SIZE != ""
e n d i f # PRODUCT_BUILD_SUPER_PARTITION == "true"
# -----------------------------------------------------------------
# super partition image for development
i f e q ( t r u e , $( PRODUCT_BUILD_SUPER_PARTITION ) )
i f n e q ( $( BOARD_SUPER_PARTITION_SIZE ) , )
i f n e q ( t r u e , $( PRODUCT_RETROFIT_DYNAMIC_PARTITIONS ) )
# Build super.img by using $(INSTALLED_*IMAGE_TARGET) to $(1)
# $(1): built image path
# $(2): misc_info.txt path; its contents should match expectation of build_super_image.py
d e f i n e b u i l d - s u p e r i m a g e - t a r g e t
mkdir -p $( dir $( 2) )
rm -rf $( 2)
$( call dump-super-image-info,$( 2) )
$( foreach p,$( BOARD_SUPER_PARTITION_PARTITION_LIST) , \
echo " $( p) _image= $( INSTALLED_$( call to-upper,$( p) ) IMAGE_TARGET) " >> $( 2) ; )
2019-10-15 06:26:19 +02:00
$( if $( BUILDING_SYSTEM_OTHER_IMAGE) , $( if $( filter system,$( BOARD_SUPER_PARTITION_PARTITION_LIST) ) , \
echo " system_other_image= $( INSTALLED_SYSTEMOTHERIMAGE_TARGET) " >> $( 2) ; ) )
2019-04-17 00:44:30 +02:00
mkdir -p $( dir $( 1) )
PATH = $( dir $( LPMAKE) ) :$$ PATH \
$( BUILD_SUPER_IMAGE) -v $( 2) $( 1)
e n d e f
INSTALLED_SUPERIMAGE_TARGET := $( PRODUCT_OUT) /super.img
INSTALLED_SUPERIMAGE_DEPENDENCIES := $( LPMAKE) $( BUILD_SUPER_IMAGE) \
2019-03-11 23:55:33 +01:00
$( foreach p, $( BOARD_SUPER_PARTITION_PARTITION_LIST) , $( INSTALLED_$( call to-upper,$( p) ) IMAGE_TARGET) )
2019-04-17 00:44:30 +02:00
2019-10-15 06:26:19 +02: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
i f n e q ( $( filter system ,$ ( BOARD_SUPER_PARTITION_PARTITION_LIST ) ) , )
INSTALLED_SUPERIMAGE_DEPENDENCIES += $( INSTALLED_SYSTEMOTHERIMAGE_TARGET)
e n d i f
e n d i f
2019-04-17 00:44:30 +02:00
# If BOARD_BUILD_SUPER_IMAGE_BY_DEFAULT is set, super.img is built from images in the
# $(PRODUCT_OUT) directory, and is built to $(PRODUCT_OUT)/super.img. Also, it will
# be built for non-dist builds. This is useful for devices that uses super.img directly, e.g.
# virtual devices.
i f e q ( t r u e , $( BOARD_BUILD_SUPER_IMAGE_BY_DEFAULT ) )
$(INSTALLED_SUPERIMAGE_TARGET) : $( INSTALLED_SUPERIMAGE_DEPENDENCIES )
$( call pretty," Target super fs image for debug: $@ " )
$( call build-superimage-target,$( INSTALLED_SUPERIMAGE_TARGET) ,\
2019-08-14 12:52:13 +02:00
$( call intermediates-dir-for,PACKAGING,superimage_debug) /misc_info.txt)
2019-04-17 00:44:30 +02:00
2021-06-16 04:35:06 +02:00
droidcore-unbundled : $( INSTALLED_SUPERIMAGE_TARGET )
2019-04-17 00:44:30 +02:00
# For devices that uses super image directly, the superimage target points to the file in $(PRODUCT_OUT).
.PHONY : superimage
superimage : $( INSTALLED_SUPERIMAGE_TARGET )
2019-08-14 12:52:13 +02:00
$(call dist-for-goals,dist_files,$(INSTALLED_MISC_INFO_TARGET) : super_misc_info .txt )
2019-04-17 00:44:30 +02:00
e n d i f # BOARD_BUILD_SUPER_IMAGE_BY_DEFAULT
# Build $(PRODUCT_OUT)/super.img without dependencies.
.PHONY : superimage -nodeps supernod
superimage-nodeps supernod : intermediates :=
superimage-nodeps supernod : | $( INSTALLED_SUPERIMAGE_DEPENDENCIES )
2019-03-11 23:55:33 +01:00
$( call pretty," make $( INSTALLED_SUPERIMAGE_TARGET) : ignoring dependencies " )
2019-04-17 00:44:30 +02:00
$( call build-superimage-target,$( INSTALLED_SUPERIMAGE_TARGET) ,\
$( call intermediates-dir-for,PACKAGING,superimage-nodeps) /misc_info.txt)
2019-03-11 23:55:33 +01:00
e n d i f # PRODUCT_RETROFIT_DYNAMIC_PARTITIONS != "true"
2019-04-17 00:44:30 +02:00
e n d i f # BOARD_SUPER_PARTITION_SIZE != ""
e n d i f # PRODUCT_BUILD_SUPER_PARTITION == "true"
2018-11-29 21:06:31 +01:00
2019-04-17 00:44:30 +02:00
# -----------------------------------------------------------------
# super empty image
2021-03-25 11:12:28 +01:00
i f d e f B U I L D I N G _ S U P E R _ E M P T Y _ I M A G E
2018-11-29 21:06:31 +01:00
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
2019-03-11 23:55:33 +01:00
$( call dump-super-image-info,$( intermediates) /misc_info.txt)
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 ) )
2021-03-25 11:12:28 +01:00
e n d i f # BUILDING_SUPER_EMPTY_IMAGE
2018-11-29 21:06:31 +01:00
2019-04-17 23:28:52 +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
2019-08-15 08:08:18 +02:00
$(INTERNAL_UPDATE_PACKAGE_TARGET) : $( BUILT_TARGET_FILES_PACKAGE ) $( IMG_FROM_TARGET_FILES )
$( call pretty," Package: $@ " )
PATH = $( INTERNAL_USERIMAGES_BINARY_PATHS) :$( dir $( ZIP2ZIP) ) :$$ PATH \
$( IMG_FROM_TARGET_FILES) \
--additional IMAGES/VerifiedBootParams.textproto:VerifiedBootParams.textproto \
$( BUILT_TARGET_FILES_PACKAGE) $@
2019-04-17 23:28:52 +02:00
.PHONY : updatepackage
updatepackage : $( INTERNAL_UPDATE_PACKAGE_TARGET )
2019-08-05 23:45:11 +02:00
$( call dist -for -goals ,updatepackage ,$ ( INTERNAL_UPDATE_PACKAGE_TARGET ) )
2019-04-17 23:28:52 +02:00
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
2019-07-05 11:30:41 +02:00
MK_COMBINE_QEMU_IMAGE := $( HOST_OUT_EXECUTABLES) /mk_combined_img
2017-08-01 21:02:09 +02:00
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
2019-03-07 19:03:41 +01:00
INSTALLED_SYSTEM_QEMU_CONFIG := $( PRODUCT_OUT) /system-qemu-config.txt
$(INSTALLED_SYSTEM_QEMU_CONFIG) : $( INSTALLED_SUPERIMAGE_TARGET ) $( INSTALLED_VBMETAIMAGE_TARGET )
@echo " $( PRODUCT_OUT) /vbmeta.img vbmeta 1 " > $@
@echo " $( INSTALLED_SUPERIMAGE_TARGET) super 2 " >> $@
2019-07-05 11:30:41 +02:00
$(INSTALLED_QEMU_SYSTEMIMAGE) : $( INSTALLED_VBMETAIMAGE_TARGET ) $( MK_COMBINE_QEMU_IMAGE ) $( SGDISK_HOST ) $( SIMG 2IMG ) \
2019-03-07 19:03:41 +01:00
$( INSTALLED_SUPERIMAGE_TARGET) $( INSTALLED_SYSTEM_QEMU_CONFIG)
@echo Create system-qemu.img now
( export SGDISK = $( SGDISK_HOST) SIMG2IMG = $( SIMG2IMG) ; \
2019-07-05 11:30:41 +02:00
$( MK_COMBINE_QEMU_IMAGE) -i $( INSTALLED_SYSTEM_QEMU_CONFIG) -o $@ )
2017-08-01 21:02:09 +02:00
systemimage : $( INSTALLED_QEMU_SYSTEMIMAGE )
2021-06-16 04:35:06 +02:00
droidcore-unbundled : $( 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 )
2021-06-16 04:35:06 +02:00
droidcore-unbundled : $( INSTALLED_QEMU_VENDORIMAGE )
2017-08-01 21:02:09 +02:00
e n d i f
2020-03-31 05:16:13 +02:00
i f d e f I N S T A L L E D _ R A M D I S K _ T A R G E T
i f d e f I N S T A L L E D _ V E N D O R _ B O O T I M A G E _ T A R G E T
i f d e f I N T E R N A L _ V E N D O R _ R A M D I S K _ T A R G E T
INSTALLED_QEMU_RAMDISKIMAGE := $( PRODUCT_OUT) /ramdisk-qemu.img
$(INSTALLED_QEMU_RAMDISKIMAGE) : $( INTERNAL_VENDOR_RAMDISK_TARGET ) $( INSTALLED_RAMDISK_TARGET )
@echo Create ramdisk-qemu.img
( cat $( INSTALLED_RAMDISK_TARGET) $( INTERNAL_VENDOR_RAMDISK_TARGET) > $( INSTALLED_QEMU_RAMDISKIMAGE) )
2021-06-16 04:35:06 +02:00
droidcore-unbundled : $( INSTALLED_QEMU_RAMDISKIMAGE )
2020-03-31 05:16:13 +02:00
e n d i f
e n d i f
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 )
2021-06-16 04:35:06 +02:00
droidcore-unbundled : $( INSTALLED_QEMU_PRODUCTIMAGE )
2017-11-27 09:04:47 +01:00
e n d i f
2019-06-25 08:58:13 +02:00
i f d e f I N S T A L L E D _ S Y S T E M _ E X T I M A G E _ T A R G E T
INSTALLED_QEMU_SYSTEM_EXTIMAGE := $( PRODUCT_OUT) /system_ext-qemu.img
$(INSTALLED_QEMU_SYSTEM_EXTIMAGE) : $( INSTALLED_SYSTEM_EXTIMAGE_TARGET ) $( MK_QEMU_IMAGE_SH ) $( SGDISK_HOST ) $( SIMG 2IMG )
@echo Create system_ext-qemu.img
( export SGDISK = $( SGDISK_HOST) SIMG2IMG = $( SIMG2IMG) ; $( MK_QEMU_IMAGE_SH) $( INSTALLED_SYSTEM_EXTIMAGE_TARGET) )
2018-05-29 14:09:01 +02:00
2019-06-25 08:58:13 +02:00
systemextimage : $( INSTALLED_QEMU_SYSTEM_EXTIMAGE )
2021-06-16 04:35:06 +02:00
droidcore-unbundled : $( INSTALLED_QEMU_SYSTEM_EXTIMAGE )
2018-05-29 14:09:01 +02: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 _ 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 )
2021-06-16 04:35:06 +02:00
droidcore-unbundled : $( INSTALLED_QEMU_ODMIMAGE )
2017-11-14 16:42:30 +01:00
e n d i f
2018-08-08 01:29:22 +02:00
2020-05-07 23:58:20 +02:00
i f d e f I N S T A L L E D _ V E N D O R _ D L K M I M A G E _ T A R G E T
INSTALLED_QEMU_VENDOR_DLKMIMAGE := $( PRODUCT_OUT) /vendor_dlkm-qemu.img
$(INSTALLED_QEMU_VENDOR_DLKMIMAGE) : $( INSTALLED_VENDOR_DLKMIMAGE_TARGET ) $( MK_QEMU_IMAGE_SH ) $( SGDISK_HOST )
@echo Create vendor_dlkm-qemu.img
( export SGDISK = $( SGDISK_HOST) ; $( MK_QEMU_IMAGE_SH) $( INSTALLED_VENDOR_DLKMIMAGE_TARGET) )
vendor_dlkmimage : $( INSTALLED_QEMU_VENDOR_DLKMIMAGE )
2021-06-16 04:35:06 +02:00
droidcore-unbundled : $( INSTALLED_QEMU_VENDOR_DLKMIMAGE )
2020-05-07 23:58:20 +02:00
e n d i f
2020-07-16 01:52:59 +02:00
i f d e f I N S T A L L E D _ O D M _ D L K M I M A G E _ T A R G E T
INSTALLED_QEMU_ODM_DLKMIMAGE := $( PRODUCT_OUT) /odm_dlkm-qemu.img
$(INSTALLED_QEMU_ODM_DLKMIMAGE) : $( INSTALLED_ODM_DLKMIMAGE_TARGET ) $( MK_QEMU_IMAGE_SH ) $( SGDISK_HOST )
@echo Create odm_dlkm-qemu.img
( export SGDISK = $( SGDISK_HOST) ; $( MK_QEMU_IMAGE_SH) $( INSTALLED_ODM_DLKMIMAGE_TARGET) )
odm_dlkmimage : $( INSTALLED_QEMU_ODM_DLKMIMAGE )
2021-06-16 04:35:06 +02:00
droidcore-unbundled : $( INSTALLED_QEMU_ODM_DLKMIMAGE )
2020-07-16 01:52:59 +02:00
e n d i f
2020-05-07 23:58:20 +02:00
2018-08-08 01:29:22 +02:00
QEMU_VERIFIED_BOOT_PARAMS := $( PRODUCT_OUT) /VerifiedBootParams.textproto
2019-03-07 19:03:41 +01:00
$(QEMU_VERIFIED_BOOT_PARAMS) : $( INSTALLED_VBMETAIMAGE_TARGET ) $( INSTALLED_SYSTEMIMAGE_TARGET ) \
$( MK_VBMETA_BOOT_KERNEL_CMDLINE_SH) $( AVBTOOL)
2018-08-08 01:29:22 +02:00
@echo Creating $@
2019-03-07 19:03:41 +01:00
( export AVBTOOL = $( AVBTOOL) ; $( MK_VBMETA_BOOT_KERNEL_CMDLINE_SH) $( INSTALLED_VBMETAIMAGE_TARGET) \
$( INSTALLED_SYSTEMIMAGE_TARGET) $( QEMU_VERIFIED_BOOT_PARAMS) )
2018-08-08 01:29:22 +02:00
systemimage : $( QEMU_VERIFIED_BOOT_PARAMS )
2021-06-16 04:35:06 +02:00
droidcore-unbundled : $( QEMU_VERIFIED_BOOT_PARAMS )
2019-03-07 19:03:41 +01:00
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
2012-02-28 00:49:23 +01:00
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) \
$( 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
2019-03-28 16:45:40 +01:00
i f n e q ( $( PRODUCT_SDK_ATREE_FILES ) , )
sdk_atree_files += $( PRODUCT_SDK_ATREE_FILES)
2014-02-28 17:45:59 +01:00
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 \
2019-10-10 20:35:08 +02:00
$( SDK_METADATA_FILES) \
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) \
2020-03-31 05:16:13 +02:00
$( INSTALLED_QEMU_RAMDISKIMAGE) \
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) $@
2021-05-13 22:37:53 +02:00
$( hide) for f in $( strip $( target_gnu_MODULES) ) ; do \
2009-03-04 04:28:42 +01:00
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
2019-09-27 01:37:59 +02:00
2019-10-18 04:24:46 +02:00
# -----------------------------------------------------------------
# Soong generates the list of all shared libraries that are depended on by fuzz
# targets. It saves this list as a source:destination pair to
# FUZZ_TARGET_SHARED_DEPS_INSTALL_PAIRS, where the source is the path to the
# build of the unstripped shared library, and the destination is the
# /data/fuzz/$ARCH/lib (for device) or /fuzz/$ARCH/lib (for host) directory
# where fuzz target shared libraries are to be "reinstalled". The
# copy-many-files below generates the rules to copy the unstripped shared
# libraries to the device or host "reinstallation" directory. These rules are
# depended on by each module in soong_cc_prebuilt.mk, where the module will have
# a dependency on each shared library that it needs to be "reinstalled".
FUZZ_SHARED_DEPS := $( call copy-many-files,$( strip $( FUZZ_TARGET_SHARED_DEPS_INSTALL_PAIRS) ) )
2019-09-27 01:37:59 +02:00
# -----------------------------------------------------------------
2021-04-29 21:44:16 +02:00
# The rule to build all fuzz targets for C++ and Rust, and package them.
2019-09-27 01:37:59 +02:00
# Note: The packages are created in Soong, and in a perfect world,
# we'd be able to create the phony rule there. But, if we want to
# have dist goals for the fuzz target, we need to have the PHONY
# target defined in make. MakeVarsContext.DistForGoal doesn't take
# into account that a PHONY rule create by Soong won't be available
# during make, and such will fail with `writing to readonly
2019-11-26 21:03:39 +01:00
# directory`, because kati will see 'haiku' as being a file, not a
2019-09-27 01:37:59 +02:00
# phony target.
2019-11-26 21:03:39 +01:00
.PHONY : haiku
haiku : $( SOONG_FUZZ_PACKAGING_ARCH_MODULES ) $( ALL_FUZZ_TARGETS )
$( call dist -for -goals ,haiku ,$ ( SOONG_FUZZ_PACKAGING_ARCH_MODULES ) )
2021-04-29 21:44:16 +02:00
.PHONY : haiku -rust
haiku-rust : $( SOONG_RUST_FUZZ_PACKAGING_ARCH_MODULES ) $( ALL_RUST_FUZZ_TARGETS )
$( call dist -for -goals ,haiku -rust ,$ ( SOONG_RUST_FUZZ_PACKAGING_ARCH_MODULES ) )