|
|
|
@@ -975,12 +975,10 @@ INTERNAL_BOOTIMAGE_ARGS := \
|
|
|
|
|
|
|
|
|
|
# TODO(b/229701033): clean up BOARD_BUILD_GKI_BOOT_IMAGE_WITHOUT_RAMDISK.
|
|
|
|
|
ifneq ($(BOARD_BUILD_GKI_BOOT_IMAGE_WITHOUT_RAMDISK),true)
|
|
|
|
|
ifneq ($(BOARD_BUILD_SYSTEM_ROOT_IMAGE),true)
|
|
|
|
|
ifneq ($(BUILDING_INIT_BOOT_IMAGE),true)
|
|
|
|
|
INTERNAL_BOOTIMAGE_ARGS += --ramdisk $(INSTALLED_RAMDISK_TARGET)
|
|
|
|
|
endif
|
|
|
|
|
endif
|
|
|
|
|
endif
|
|
|
|
|
|
|
|
|
|
ifndef BUILDING_VENDOR_BOOT_IMAGE
|
|
|
|
|
ifdef BOARD_INCLUDE_DTB_IN_BOOTIMG
|
|
|
|
@@ -990,9 +988,6 @@ endif
|
|
|
|
|
|
|
|
|
|
INTERNAL_BOOTIMAGE_FILES := $(filter-out --%,$(INTERNAL_BOOTIMAGE_ARGS))
|
|
|
|
|
|
|
|
|
|
# TODO(b/241346584) Remove this when BOARD_BUILD_SYSTEM_ROOT_IMAGE is deprecated
|
|
|
|
|
INTERNAL_KERNEL_CMDLINE := $(strip $(INTERNAL_KERNEL_CMDLINE) buildvariant=$(TARGET_BUILD_VARIANT))
|
|
|
|
|
|
|
|
|
|
# kernel cmdline/base/pagesize in boot.
|
|
|
|
|
# - If using GKI, use GENERIC_KERNEL_CMDLINE. Remove kernel base and pagesize because they are
|
|
|
|
|
# device-specific.
|
|
|
|
@@ -1989,8 +1984,6 @@ $(if $(BOARD_AVB_ENABLE),\
|
|
|
|
|
$(hide) echo "avb_system_dlkm_rollback_index_location=$(BOARD_SYSTEM_SYSTEM_DLKM_ROLLBACK_INDEX_LOCATION)" >> $(1)))
|
|
|
|
|
$(if $(filter true,$(BOARD_USES_RECOVERY_AS_BOOT)),\
|
|
|
|
|
$(hide) echo "recovery_as_boot=true" >> $(1))
|
|
|
|
|
$(if $(filter true,$(BOARD_BUILD_SYSTEM_ROOT_IMAGE)),\
|
|
|
|
|
$(hide) echo "system_root_image=true" >> $(1))
|
|
|
|
|
$(if $(filter true,$(BOARD_BUILD_GKI_BOOT_IMAGE_WITHOUT_RAMDISK)),\
|
|
|
|
|
$(hide) echo "gki_boot_image_without_ramdisk=true" >> $(1))
|
|
|
|
|
$(hide) echo "root_dir=$(TARGET_ROOT_OUT)" >> $(1)
|
|
|
|
@@ -2267,20 +2260,18 @@ endif
|
|
|
|
|
# (BOARD_USES_FULL_RECOVERY_IMAGE = true);
|
|
|
|
|
# b) We build a single image that contains boot and recovery both - no recovery image to install
|
|
|
|
|
# (BOARD_USES_RECOVERY_AS_BOOT = true);
|
|
|
|
|
# c) We mount the system image as / and therefore do not have a ramdisk in boot.img
|
|
|
|
|
# (BOARD_BUILD_SYSTEM_ROOT_IMAGE = true).
|
|
|
|
|
# d) We include the recovery DTBO image within recovery - not needing the resource file as we
|
|
|
|
|
# c) 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).
|
|
|
|
|
# e) We include the recovery ACPIO image within recovery - not needing the resource file as we
|
|
|
|
|
# d) 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).
|
|
|
|
|
# f) We build a single image that contains vendor_boot and recovery both - no recovery image to
|
|
|
|
|
# e) 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).
|
|
|
|
|
|
|
|
|
|
ifeq (,$(filter true, $(BOARD_USES_FULL_RECOVERY_IMAGE) $(BOARD_USES_RECOVERY_AS_BOOT) \
|
|
|
|
|
$(BOARD_BUILD_SYSTEM_ROOT_IMAGE) $(BOARD_INCLUDE_RECOVERY_DTBO) $(BOARD_INCLUDE_RECOVERY_ACPIO) \
|
|
|
|
|
$(BOARD_INCLUDE_RECOVERY_DTBO) $(BOARD_INCLUDE_RECOVERY_ACPIO) \
|
|
|
|
|
$(BOARD_MOVE_RECOVERY_RESOURCES_TO_VENDOR_BOOT)))
|
|
|
|
|
# Named '.dat' so we don't attempt to use imgdiff for patching it.
|
|
|
|
|
RECOVERY_RESOURCE_ZIP := $(TARGET_OUT_VENDOR)/etc/recovery-resource.dat
|
|
|
|
@@ -2402,8 +2393,7 @@ $(INTERNAL_RECOVERY_RAMDISK_FILES_TIMESTAMP): $(MKBOOTFS) $(COMPRESSION_COMMAND_
|
|
|
|
|
# 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)
|
|
|
|
|
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.
|
|
|
|
@@ -3156,7 +3146,7 @@ INSTALLED_SYSTEMIMAGE := $(INSTALLED_SYSTEMIMAGE_TARGET)
|
|
|
|
|
ifneq ($(INSTALLED_BOOTIMAGE_TARGET),)
|
|
|
|
|
ifneq ($(INSTALLED_RECOVERYIMAGE_TARGET),)
|
|
|
|
|
ifneq ($(BOARD_USES_FULL_RECOVERY_IMAGE),true)
|
|
|
|
|
ifneq (,$(filter true, $(BOARD_BUILD_SYSTEM_ROOT_IMAGE) $(BOARD_INCLUDE_RECOVERY_DTBO) $(BOARD_INCLUDE_RECOVERY_ACPIO)))
|
|
|
|
|
ifneq (,$(filter true,$(BOARD_INCLUDE_RECOVERY_DTBO) $(BOARD_INCLUDE_RECOVERY_ACPIO)))
|
|
|
|
|
diff_tool := $(HOST_OUT_EXECUTABLES)/bsdiff
|
|
|
|
|
else
|
|
|
|
|
diff_tool := $(HOST_OUT_EXECUTABLES)/imgdiff
|
|
|
|
@@ -4357,18 +4347,6 @@ $(foreach partition,$(BOARD_CUSTOMIMAGES_PARTITION_LIST), \
|
|
|
|
|
$(eval $(call check-and-set-custom-avb-chain-args,$(partition))))
|
|
|
|
|
endif
|
|
|
|
|
|
|
|
|
|
# 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
|
|
|
|
|
ifeq ($(BOARD_BUILD_SYSTEM_ROOT_IMAGE),true)
|
|
|
|
|
ifeq ($(filter system, $(BOARD_SUPER_PARTITION_PARTITION_LIST)),)
|
|
|
|
|
BOARD_AVB_SYSTEM_ADD_HASHTREE_FOOTER_ARGS += --setup_as_rootfs_from_kernel
|
|
|
|
|
endif
|
|
|
|
|
endif
|
|
|
|
|
|
|
|
|
|
BOARD_AVB_MAKE_VBMETA_IMAGE_ARGS += --padding_size 4096
|
|
|
|
|
BOARD_AVB_MAKE_VBMETA_SYSTEM_IMAGE_ARGS += --padding_size 4096
|
|
|
|
|
BOARD_AVB_MAKE_VBMETA_VENDOR_IMAGE_ARGS += --padding_size 4096
|
|
|
|
@@ -5727,10 +5705,8 @@ endif # INSTALLED_RECOVERYIMAGE_TARGET defined or BOARD_USES_RECOVERY_AS_BOOT is
|
|
|
|
|
$(TARGET_ROOT_OUT),$(zip_root)/ROOT)
|
|
|
|
|
@# If we are using recovery as boot, this is already done when processing recovery.
|
|
|
|
|
ifneq ($(BOARD_USES_RECOVERY_AS_BOOT),true)
|
|
|
|
|
ifneq ($(BOARD_BUILD_SYSTEM_ROOT_IMAGE),true)
|
|
|
|
|
$(hide) $(call package_files-copy-root, \
|
|
|
|
|
$(TARGET_RAMDISK_OUT),$(zip_root)/BOOT/RAMDISK)
|
|
|
|
|
endif
|
|
|
|
|
ifdef INSTALLED_KERNEL_TARGET
|
|
|
|
|
$(hide) cp $(INSTALLED_KERNEL_TARGET) $(zip_root)/BOOT/
|
|
|
|
|
endif
|
|
|
|
@@ -6036,10 +6012,8 @@ ifdef BUILDING_SYSTEM_DLKM_IMAGE
|
|
|
|
|
endif
|
|
|
|
|
@# ROOT always contains the files for the root under normal boot.
|
|
|
|
|
$(hide) $(call fs_config,$(zip_root)/ROOT,) > $(zip_root)/META/root_filesystem_config.txt
|
|
|
|
|
ifeq ($(BOARD_USES_RECOVERY_AS_BOOT),true)
|
|
|
|
|
@# BOOT/RAMDISK exists and contains the ramdisk for recovery if using BOARD_USES_RECOVERY_AS_BOOT.
|
|
|
|
|
@# BOOT/RAMDISK contains the first stage and recovery ramdisk.
|
|
|
|
|
$(hide) $(call fs_config,$(zip_root)/BOOT/RAMDISK,) > $(zip_root)/META/boot_filesystem_config.txt
|
|
|
|
|
endif
|
|
|
|
|
ifdef BUILDING_INIT_BOOT_IMAGE
|
|
|
|
|
$(hide) $(call package_files-copy-root, $(TARGET_RAMDISK_OUT),$(zip_root)/INIT_BOOT/RAMDISK)
|
|
|
|
|
$(hide) $(call fs_config,$(zip_root)/INIT_BOOT/RAMDISK,) > $(zip_root)/META/init_boot_filesystem_config.txt
|
|
|
|
@@ -6050,10 +6024,6 @@ endif # BUILDING_INIT_BOOT_IMAGE
|
|
|
|
|
ifneq ($(INSTALLED_VENDOR_BOOTIMAGE_TARGET),)
|
|
|
|
|
$(call fs_config,$(zip_root)/VENDOR_BOOT/RAMDISK,) > $(zip_root)/META/vendor_boot_filesystem_config.txt
|
|
|
|
|
endif
|
|
|
|
|
ifneq ($(BOARD_BUILD_SYSTEM_ROOT_IMAGE),true)
|
|
|
|
|
@# BOOT/RAMDISK also exists and contains the first stage ramdisk if not using BOARD_BUILD_SYSTEM_ROOT_IMAGE.
|
|
|
|
|
$(hide) $(call fs_config,$(zip_root)/BOOT/RAMDISK,) > $(zip_root)/META/boot_filesystem_config.txt
|
|
|
|
|
endif
|
|
|
|
|
ifneq ($(INSTALLED_RECOVERYIMAGE_TARGET),)
|
|
|
|
|
$(hide) $(call fs_config,$(zip_root)/RECOVERY/RAMDISK,) > $(zip_root)/META/recovery_filesystem_config.txt
|
|
|
|
|
endif
|
|
|
|
|