From 346fd24e7abb7e520734f1f60087df53a7a693df Mon Sep 17 00:00:00 2001 From: Arvind Kumar Date: Thu, 16 Jan 2020 09:08:48 +0530 Subject: [PATCH] sdm660_64: Enable new launch feature support Enable following Q new launch features for 4.14 kernel by default: - Dynamic partition support - Product partition support - Metadata partition support - Userdata checkpointing - Ext4 + FBE - Split manifest to support OTA and new launch target - Split init.target.rc to support OTA and new launch target - DTBO support - AVB support. Change-Id: Id8e699a60e2a9b9c03df4b3e1a1042b60ced7f17 --- AndroidBoard.mk | 44 ++++++- BoardConfig.mk | 129 +++++++++++++++------ fstab_AB_dynamic_partition_variant.qti | 45 +++++++ fstab_non_AB_dynamic_partition_variant.qti | 46 ++++++++ init.target.rc | 15 +-- init.target_dap.rc | 43 +++++++ init.target_ota.rc | 40 +++++++ manifest.xml | 2 +- manifest_target_level_3.xml | 29 +++++ manifest_target_level_4.xml | 29 +++++ recovery_AB_dynamic_variant.fstab | 39 +++++++ recovery_non-AB_dynamic_variant.fstab | 40 +++++++ sdm660_64.mk | 95 +++++++++++---- 13 files changed, 524 insertions(+), 72 deletions(-) create mode 100644 fstab_AB_dynamic_partition_variant.qti create mode 100644 fstab_non_AB_dynamic_partition_variant.qti create mode 100644 init.target_dap.rc create mode 100644 init.target_ota.rc create mode 100644 manifest_target_level_3.xml create mode 100644 manifest_target_level_4.xml create mode 100644 recovery_AB_dynamic_variant.fstab create mode 100644 recovery_non-AB_dynamic_variant.fstab diff --git a/AndroidBoard.mk b/AndroidBoard.mk index 5bb47f8..55d3b14 100644 --- a/AndroidBoard.mk +++ b/AndroidBoard.mk @@ -38,16 +38,26 @@ ifeq ($(TARGET_KERNEL_SOURCE),) TARGET_KERNEL_SOURCE := kernel endif -include $(TARGET_KERNEL_SOURCE)/AndroidKernel.mk - # ../../ prepended to paths because kernel is at ./kernel/msm-x.x TEMP_TOP=$(shell pwd) +ifeq ($(TARGET_KERNEL_VERSION), 4.14) + DTC := $(HOST_OUT_EXECUTABLES)/dtc$(HOST_EXECUTABLE_SUFFIX) + UFDT_APPLY_OVERLAY := $(HOST_OUT_EXECUTABLES)/ufdt_apply_overlay$(HOST_EXECUTABLE_SUFFIX) + TARGET_KERNEL_MAKE_ENV := DTC_EXT=$(TEMP_TOP)/$(DTC) + TARGET_KERNEL_MAKE_ENV += DTC_OVERLAY_TEST_EXT=$(TEMP_TOP)/$(UFDT_APPLY_OVERLAY) + TARGET_KERNEL_MAKE_ENV += CONFIG_BUILD_ARM64_DT_OVERLAY=y +endif TARGET_KERNEL_MAKE_ENV += HOSTCC=$(TEMP_TOP)/prebuilts/gcc/linux-x86/host/x86_64-linux-glibc2.17-4.8/bin/x86_64-linux-gcc TARGET_KERNEL_MAKE_ENV += HOSTAR=$(TEMP_TOP)/prebuilts/gcc/linux-x86/host/x86_64-linux-glibc2.17-4.8/bin/x86_64-linux-ar TARGET_KERNEL_MAKE_ENV += HOSTLD=$(TEMP_TOP)/prebuilts/gcc/linux-x86/host/x86_64-linux-glibc2.17-4.8/bin/x86_64-linux-ld TARGET_KERNEL_MAKE_ENV += HOSTCFLAGS="-I/usr/include -I/usr/include/x86_64-linux-gnu -L/usr/lib -L/usr/lib/x86_64-linux-gnu" TARGET_KERNEL_MAKE_ENV += HOSTLDFLAGS="-L/usr/lib -L/usr/lib/x86_64-linux-gnu" +include $(TARGET_KERNEL_SOURCE)/AndroidKernel.mk +ifeq ($(TARGET_KERNEL_VERSION), 4.14) + $(TARGET_PREBUILT_KERNEL): $(DTC) $(UFDT_APPLY_OVERLAY) +endif + $(INSTALLED_KERNEL_TARGET): $(TARGET_PREBUILT_KERNEL) | $(ACP) $(transform-prebuilt-to-target) @@ -61,6 +71,22 @@ LOCAL_MODULE_CLASS := ETC LOCAL_SRC_FILES := $(LOCAL_MODULE) include $(BUILD_PREBUILT) +include $(CLEAR_VARS) +LOCAL_MODULE := init.target_ota.rc +LOCAL_MODULE_TAGS := optional +LOCAL_MODULE_CLASS := ETC +LOCAL_SRC_FILES := $(LOCAL_MODULE) +LOCAL_MODULE_PATH := $(TARGET_OUT_VENDOR_ETC)/init/hw +include $(BUILD_PREBUILT) + +include $(CLEAR_VARS) +LOCAL_MODULE := init.target_dap.rc +LOCAL_MODULE_TAGS := optional +LOCAL_MODULE_CLASS := ETC +LOCAL_SRC_FILES := $(LOCAL_MODULE) +LOCAL_MODULE_PATH := $(TARGET_OUT_VENDOR_ETC)/init/hw +include $(BUILD_PREBUILT) + include $(CLEAR_VARS) LOCAL_MODULE := init.target.rc LOCAL_MODULE_TAGS := optional @@ -77,6 +103,19 @@ LOCAL_SRC_FILES := $(LOCAL_MODULE) LOCAL_MODULE_PATH := $(TARGET_OUT_KEYLAYOUT) include $(BUILD_PREBUILT) +ifeq ($(strip $(BOARD_DYNAMIC_PARTITION_ENABLE)),true) +include $(CLEAR_VARS) +LOCAL_MODULE := fstab.qcom +LOCAL_MODULE_TAGS := optional +LOCAL_MODULE_CLASS := ETC +ifeq ($(ENABLE_AB), true) +LOCAL_SRC_FILES := fstab_AB_dynamic_partition_variant.qti +else +LOCAL_SRC_FILES := fstab_non_AB_dynamic_partition_variant.qti +endif +LOCAL_MODULE_PATH := $(TARGET_OUT_VENDOR_ETC) +include $(BUILD_PREBUILT) +else include $(CLEAR_VARS) LOCAL_MODULE := fstab.qcom LOCAL_MODULE_TAGS := optional @@ -88,6 +127,7 @@ LOCAL_SRC_FILES := fstab_non_AB_variant.qcom endif LOCAL_MODULE_PATH := $(TARGET_OUT_VENDOR_ETC) include $(BUILD_PREBUILT) +endif ifeq ($(strip $(BOARD_HAS_QCOM_WLAN)),true) include $(CLEAR_VARS) diff --git a/BoardConfig.mk b/BoardConfig.mk index b59172d..2bb6ffe 100644 --- a/BoardConfig.mk +++ b/BoardConfig.mk @@ -45,6 +45,79 @@ BOARD_BOOTIMAGE_PARTITION_SIZE := 0x04000000 TARGET_KERNEL_APPEND_DTB := true +ifeq ($(ENABLE_AB), true) +#A/B related defines +AB_OTA_UPDATER := true +# Full A/B partiton update set +# AB_OTA_PARTITIONS := xbl rpm tz hyp pmic modem abl boot keymaster cmnlib cmnlib64 system bluetooth +# Subset A/B partitions for Android-only image update +ifeq ($(ENABLE_VENDOR_IMAGE), true) + ifeq ($(strip $(BOARD_DYNAMIC_PARTITION_ENABLE)),true) + AB_OTA_PARTITIONS ?= boot system vendor product + else + AB_OTA_PARTITIONS ?= boot system vendor + endif +else + AB_OTA_PARTITIONS ?= boot system +endif +else +BOARD_CACHEIMAGE_PARTITION_SIZE := 268435456 +BOARD_CACHEIMAGE_FILE_SYSTEM_TYPE := ext4 +ifeq ($(BOARD_AVB_ENABLE), true) + BOARD_AVB_RECOVERY_KEY_PATH := external/avb/test/data/testkey_rsa4096.pem + BOARD_AVB_RECOVERY_ALGORITHM := SHA256_RSA4096 + BOARD_AVB_RECOVERY_ROLLBACK_INDEX := 1 + BOARD_AVB_RECOVERY_ROLLBACK_INDEX_LOCATION := 1 +endif +endif + +### Dynamic partition Handling +ifneq ($(strip $(BOARD_DYNAMIC_PARTITION_ENABLE)),true) + ifeq ($(ENABLE_VENDOR_IMAGE), true) + BOARD_VENDORIMAGE_PARTITION_SIZE := 838860800 + endif + BOARD_SYSTEMIMAGE_PARTITION_SIZE := 3221225472 + BOARD_BUILD_SYSTEM_ROOT_IMAGE := true + ifeq ($(ENABLE_AB), true) + TARGET_NO_RECOVERY := true + BOARD_USES_RECOVERY_AS_BOOT := true + else + BOARD_RECOVERYIMAGE_PARTITION_SIZE := 0x04000000 + ifeq ($(BOARD_KERNEL_SEPARATED_DTBO),true) + # Enable DTBO for recovery image + BOARD_INCLUDE_RECOVERY_DTBO := true + endif + endif +else + #dtbo support + BOARD_DTBOIMG_PARTITION_SIZE := 0x0800000 + BOARD_KERNEL_SEPARATED_DTBO := true + + # Product partition support + TARGET_COPY_OUT_PRODUCT := product + BOARD_USES_PRODUCTIMAGE := true + BOARD_PRODUCTIMAGE_FILE_SYSTEM_TYPE := ext4 + # Define the Dynamic Partition sizes and groups. + ifeq ($(ENABLE_AB), true) + BOARD_SUPER_PARTITION_SIZE := 12884901888 + else + BOARD_SUPER_PARTITION_SIZE := 5318967296 + endif + ifeq ($(BOARD_KERNEL_SEPARATED_DTBO),true) + # Enable DTBO for recovery image + BOARD_INCLUDE_RECOVERY_DTBO := true + endif + BOARD_SUPER_PARTITION_GROUPS := qti_dynamic_partitions + BOARD_QTI_DYNAMIC_PARTITIONS_SIZE := 5314772992 + BOARD_QTI_DYNAMIC_PARTITIONS_PARTITION_LIST := system product vendor + BOARD_EXT4_SHARE_DUP_BLOCKS := true + BOARD_RECOVERYIMAGE_PARTITION_SIZE := 67108864 + # Metadata partition (applicable only for new launches) + BOARD_METADATAIMAGE_PARTITION_SIZE := 16777216 + BOARD_USES_METADATA_PARTITION := true +endif +### Dynamic partition Handling + ifeq ($(BOARD_KERNEL_SEPARATED_DTBO), true) # Set Header version for bootimage ifneq ($(strip $(TARGET_KERNEL_APPEND_DTB)),true) @@ -56,46 +129,31 @@ ifeq ($(BOARD_KERNEL_SEPARATED_DTBO), true) endif BOARD_MKBOOTIMG_ARGS := --header_version $(BOARD_BOOTIMG_HEADER_VERSION) - ifneq ($(ENABLE_AB), true) - # Enable DTBO for recovery image - BOARD_INCLUDE_RECOVERY_DTBO := true - endif endif -ifeq ($(ENABLE_AB), true) -#A/B related defines -AB_OTA_UPDATER := true -# Full A/B partiton update set -# AB_OTA_PARTITIONS := xbl rpm tz hyp pmic modem abl boot keymaster cmnlib cmnlib64 system bluetooth -# Subset A/B partitions for Android-only image update -AB_OTA_PARTITIONS ?= boot system -BOARD_BUILD_SYSTEM_ROOT_IMAGE := true -TARGET_NO_RECOVERY := true -BOARD_USES_RECOVERY_AS_BOOT := true -else -BOARD_RECOVERYIMAGE_PARTITION_SIZE := 0x04000000 -BOARD_CACHEIMAGE_PARTITION_SIZE := 268435456 -BOARD_CACHEIMAGE_FILE_SYSTEM_TYPE := ext4 -# Enable System As Root even for non-A/B from P onwards -BOARD_BUILD_SYSTEM_ROOT_IMAGE := true -#TARGET_RECOVERY_UPDATER_LIBS += librecovery_updater_msm -endif - -ifeq ($(ENABLE_AB), true) - ifeq ($(ENABLE_VENDOR_IMAGE), true) - TARGET_RECOVERY_FSTAB := device/qcom/sdm660_64/recovery_AB_split_variant.fstab +# Recovery fstab handling +ifneq ($(strip $(BOARD_DYNAMIC_PARTITION_ENABLE)),true) + ifeq ($(ENABLE_AB), true) + ifeq ($(ENABLE_VENDOR_IMAGE), true) + TARGET_RECOVERY_FSTAB := device/qcom/sdm660_64/recovery_AB_split_variant.fstab + else + TARGET_RECOVERY_FSTAB := device/qcom/sdm660_64/recovery_AB_non-split_variant.fstab + endif else - TARGET_RECOVERY_FSTAB := device/qcom/sdm660_64/recovery_AB_non-split_variant.fstab + ifeq ($(ENABLE_VENDOR_IMAGE), true) + TARGET_RECOVERY_FSTAB := device/qcom/sdm660_64/recovery_non-AB_split_variant.fstab + else + TARGET_RECOVERY_FSTAB := device/qcom/sdm660_64/recovery_non-AB_non-split_variant.fstab + endif endif else - ifeq ($(ENABLE_VENDOR_IMAGE), true) - TARGET_RECOVERY_FSTAB := device/qcom/sdm660_64/recovery_non-AB_split_variant.fstab + ifeq ($(ENABLE_AB), true) + TARGET_RECOVERY_FSTAB := device/qcom/sdm660_64/recovery_AB_dynamic_variant.fstab else - TARGET_RECOVERY_FSTAB := device/qcom/sdm660_64/recovery_non-AB_non-split_variant.fstab + TARGET_RECOVERY_FSTAB := device/qcom/sdm660_64/recovery_non-AB_dynamic_variant.fstab endif endif -BOARD_SYSTEMIMAGE_PARTITION_SIZE := 3221225472 BOARD_USERDATAIMAGE_PARTITION_SIZE := 48318382080 BOARD_PERSISTIMAGE_PARTITION_SIZE := 33554432 BOARD_PERSISTIMAGE_FILE_SYSTEM_TYPE := ext4 @@ -104,7 +162,6 @@ BOARD_FLASH_BLOCK_SIZE := 131072 # (BOARD_KERNEL_PAGESIZE * 64) #Enable split vendor image ENABLE_VENDOR_IMAGE := true ifeq ($(ENABLE_VENDOR_IMAGE), true) -BOARD_VENDORIMAGE_PARTITION_SIZE := 838860800 BOARD_VENDORIMAGE_FILE_SYSTEM_TYPE := ext4 TARGET_COPY_OUT_VENDOR := vendor BOARD_PROPERTY_OVERRIDES_SPLIT_ENABLED := true @@ -250,8 +307,12 @@ endif #Enable DRM plugins 64 bit compilation TARGET_ENABLE_MEDIADRM_64 := true -#Flag to enable System SDK Requirements. -BOARD_SYSTEMSDK_VERSIONS:=28 + #Flag to enable System SDK Requirements. +ifeq ($(strip $(PRODUCT_SHIPPING_API_LEVEL)),29) + BOARD_SYSTEMSDK_VERSIONS:=29 +else + BOARD_SYSTEMSDK_VERSIONS:=28 +endif #All vendor APK will be compiled against system_current API set. BOARD_VNDK_VERSION := current diff --git a/fstab_AB_dynamic_partition_variant.qti b/fstab_AB_dynamic_partition_variant.qti new file mode 100644 index 0000000..b08d002 --- /dev/null +++ b/fstab_AB_dynamic_partition_variant.qti @@ -0,0 +1,45 @@ +# Copyright (c) 2020, The Linux Foundation. All rights reserved. +# +# Redistribution and use in source and binary forms, with or without +# modification, are permitted provided that the following conditions are +# met: +# * Redistributions of source code must retain the above copyright +# notice, this list of conditions and the following disclaimer. +# * Redistributions in binary form must reproduce the above +# copyright notice, this list of conditions and the following +# disclaimer in the documentation and/or other materials provided +# with the distribution. +# * Neither the name of The Linux Foundation nor the names of its +# contributors may be used to endorse or promote products derived +# from this software without specific prior written permission. +# +# THIS SOFTWARE IS PROVIDED "AS IS" AND ANY EXPRESS OR IMPLIED +# WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF +# MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT +# ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS +# BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR +# CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF +# SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR +# BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, +# WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE +# OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN +# IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +# Android fstab file. +# The filesystem that contains the filesystem checker binary (typically /system) cannot +# specify MF_CHECK, and must come before any filesystems that do specify MF_CHECK + +# DAP enabled A/B fstab.qcom variant +# +system /system ext4 ro,barrier=1,discard wait,slotselect,avb=vbmeta_system,logical,first_stage_mount,avb_keys=/avb/q-gsi.avbpubkey:/avb/r-gsi.avbpubkey:/avb/s-gsi.avbpubkey +product /product ext4 ro,barrier=1,discard wait,slotselect,avb=vbmeta_system,logical,first_stage_mount +vendor /vendor ext4 ro,barrier=1,discard wait,slotselect,avb,logical,first_stage_mount +/dev/block/by-name/metadata /metadata ext4 noatime,nosuid,nodev,discard wait,formattable,first_stage_mount +/dev/block/bootdevice/by-name/userdata /data ext4 nosuid,nodev,barrier=1,noauto_da_alloc,discard,noatime,lazytime latemount,wait,check,formattable,fileencryption=ice,quota,reservedsize=128M,checkpoint=block +/devices/soc/c084000.sdhci/mmc_host* /storage/sdcard1 vfat nosuid,nodev wait,voldmanaged=sdcard1:auto,encryptable=footer +/dev/block/bootdevice/by-name/misc /misc emmc defaults defaults +/dev/block/bootdevice/by-name/modem /vendor/firmware_mnt vfat ro,shortname=lower,uid=1000,gid=1000,dmask=227,fmask=337,context=u:object_r:firmware_file:s0 wait,slotselect +/dev/block/bootdevice/by-name/bluetooth /vendor/bt_firmware vfat ro,shortname=lower,uid=1002,gid=3002,dmask=227,fmask=337,context=u:object_r:bt_firmware_file:s0 wait,slotselect +/devices/soc/a800000.ssusb/a800000.dwc3/xhci-hcd.0.auto* /storage/usbotg vfat nosuid,nodev wait,voldmanaged=usbotg:auto +/dev/block/bootdevice/by-name/dsp /vendor/dsp ext4 ro,nosuid,nodev,barrier=1 wait,slotselect +/dev/block/bootdevice/by-name/persist /mnt/vendor/persist ext4 noatime,nosuid,nodev,barrier=1 wait diff --git a/fstab_non_AB_dynamic_partition_variant.qti b/fstab_non_AB_dynamic_partition_variant.qti new file mode 100644 index 0000000..1f57e1f --- /dev/null +++ b/fstab_non_AB_dynamic_partition_variant.qti @@ -0,0 +1,46 @@ +# Copyright (c) 2020, The Linux Foundation. All rights reserved. +# +# Redistribution and use in source and binary forms, with or without +# modification, are permitted provided that the following conditions are +# met: +# * Redistributions of source code must retain the above copyright +# notice, this list of conditions and the following disclaimer. +# * Redistributions in binary form must reproduce the above +# copyright notice, this list of conditions and the following +# disclaimer in the documentation and/or other materials provided +# with the distribution. +# * Neither the name of The Linux Foundation nor the names of its +# contributors may be used to endorse or promote products derived +# from this software without specific prior written permission. +# +# THIS SOFTWARE IS PROVIDED "AS IS" AND ANY EXPRESS OR IMPLIED +# WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF +# MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT +# ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS +# BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR +# CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF +# SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR +# BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, +# WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE +# OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN +# IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +# Android fstab file. +# The filesystem that contains the filesystem checker binary (typically /system) cannot +# specify MF_CHECK, and must come before any filesystems that do specify MF_CHECK + +# DAP enabled Non-A/B fstab.qcom variant +# +system /system ext4 ro,barrier=1,discard wait,avb=vbmeta_system,logical,first_stage_mount,avb_keys=/avb/q-gsi.avbpubkey:/avb/r-gsi.avbpubkey:/avb/s-gsi.avbpubkey +product /product ext4 ro,barrier=1,discard wait,avb=vbmeta_system,logical,first_stage_mount +vendor /vendor ext4 ro,barrier=1,discard wait,avb,logical,first_stage_mount +/dev/block/by-name/metadata /metadata ext4 noatime,nosuid,nodev,discard wait,formattable,first_stage_mount +/dev/block/bootdevice/by-name/userdata /data ext4 nosuid,nodev,barrier=1,noauto_da_alloc,discard,noatime,lazytime latemount,wait,check,formattable,fileencryption=ice,quota,reservedsize=128M,checkpoint=block +/devices/soc/c084000.sdhci/mmc_host* /storage/sdcard1 vfat nosuid,nodev wait,voldmanaged=sdcard1:auto,encryptable=footer +/dev/block/bootdevice/by-name/misc /misc emmc defaults defaults +/dev/block/bootdevice/by-name/modem /vendor/firmware_mnt vfat ro,shortname=lower,uid=1000,gid=1000,dmask=227,fmask=337,context=u:object_r:firmware_file:s0 wait +/dev/block/bootdevice/by-name/bluetooth /vendor/bt_firmware vfat ro,shortname=lower,uid=1002,gid=3002,dmask=227,fmask=337,context=u:object_r:bt_firmware_file:s0 wait +/devices/soc/a800000.ssusb/a800000.dwc3/xhci-hcd.0.auto* /storage/usbotg vfat nosuid,nodev wait,voldmanaged=usbotg:auto +/dev/block/bootdevice/by-name/dsp /vendor/dsp ext4 ro,nosuid,nodev,barrier=1 wait +/dev/block/bootdevice/by-name/cache /cache ext4 nosuid,nodev,noatime,barrier=1 wait +/dev/block/bootdevice/by-name/persist /mnt/vendor/persist ext4 noatime,nosuid,nodev,barrier=1 wait diff --git a/init.target.rc b/init.target.rc index 079fcbd..704b8d6 100644 --- a/init.target.rc +++ b/init.target.rc @@ -27,6 +27,9 @@ # # +import /vendor/etc/init/hw/init.target_dap.rc +import /vendor/etc/init/hw/init.target_ota.rc + on early-init exec u:r:vendor_modprobe:s0 -- /vendor/bin/modprobe -a -d /vendor/lib/modules audio_apr audio_wglink audio_adsp_loader audio_q6_pdr audio_q6_notifier audio_q6 audio_usf audio_native audio_pinctrl_wcd audio_pinctrl_lpi audio_swr audio_platform audio_hdmi audio_wcd_spi audio_stub audio_digital_cdc audio_analog_cdc audio_msm_sdw audio_wcd_cpe audio_cpe_lsm audio_wcd9335 audio_machine_sdm660 audio_wcd934x audio_mbhc audio_wcd9xxx audio_wcd_core mkdir /firmware 0771 system system @@ -42,18 +45,6 @@ on init write /dev/stune/foreground/schedtune.colocate 0 write /dev/stune/top-app/schedtune.colocate 1 -on fs - wait /dev/block/platform/soc/${ro.boot.bootdevice} - symlink /dev/block/platform/soc/${ro.boot.bootdevice} /dev/block/bootdevice - mount_all /vendor/etc/fstab.qcom - swapon_all /vendor/etc/fstab.qcom - chown root system /mnt/vendor/persist - chmod 0771 /mnt/vendor/persist - mkdir /mnt/vendor/persist/data 0700 system system - mkdir /mnt/vendor/persist/bms 0700 root system - restorecon_recursive /mnt/vendor/persist - write /sys/kernel/boot_adsp/boot 1 - on post-fs start vendor.qseecomd exec - system system -- /vendor/bin/init.qti.qseecomd.sh diff --git a/init.target_dap.rc b/init.target_dap.rc new file mode 100644 index 0000000..77c483d --- /dev/null +++ b/init.target_dap.rc @@ -0,0 +1,43 @@ +# Copyright (c) 2020 The Linux Foundation. All rights reserved. +# +# Redistribution and use in source and binary forms, with or without +# modification, are permitted provided that the following conditions are +# met: +# * Redistributions of source code must retain the above copyright +# notice, this list of conditions and the following disclaimer. +# * Redistributions in binary form must reproduce the above +# copyright notice, this list of conditions and the following +# disclaimer in the documentation and/or other materials provided +# with the distribution. +# * Neither the name of The Linux Foundation nor the names of its +# contributors may be used to endorse or promote products derived +# from this software without specific prior written permission. +# +# THIS SOFTWARE IS PROVIDED "AS IS" AND ANY EXPRESS OR IMPLIED +# WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF +# MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT +# ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS +# BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR +# CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF +# SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR +# BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, +# WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE +# OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN +# IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +# +# + +on fs + wait /dev/block/platform/soc/${ro.boot.bootdevice} + symlink /dev/block/platform/soc/${ro.boot.bootdevice} /dev/block/bootdevice + mount_all /vendor/etc/fstab.qcom --early + swapon_all /vendor/etc/fstab.qcom + chown root system /mnt/vendor/persist + chmod 0771 /mnt/vendor/persist + mkdir /mnt/vendor/persist/data 0700 system system + mkdir /mnt/vendor/persist/bms 0700 root system + restorecon_recursive /mnt/vendor/persist + write /sys/kernel/boot_adsp/boot 1 + +on late-fs + mount_all /vendor/etc/fstab.qcom --late diff --git a/init.target_ota.rc b/init.target_ota.rc new file mode 100644 index 0000000..7d94307 --- /dev/null +++ b/init.target_ota.rc @@ -0,0 +1,40 @@ +# Copyright (c) 2020 The Linux Foundation. All rights reserved. +# +# Redistribution and use in source and binary forms, with or without +# modification, are permitted provided that the following conditions are +# met: +# * Redistributions of source code must retain the above copyright +# notice, this list of conditions and the following disclaimer. +# * Redistributions in binary form must reproduce the above +# copyright notice, this list of conditions and the following +# disclaimer in the documentation and/or other materials provided +# with the distribution. +# * Neither the name of The Linux Foundation nor the names of its +# contributors may be used to endorse or promote products derived +# from this software without specific prior written permission. +# +# THIS SOFTWARE IS PROVIDED "AS IS" AND ANY EXPRESS OR IMPLIED +# WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF +# MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT +# ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS +# BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR +# CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF +# SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR +# BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, +# WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE +# OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN +# IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +# +# + +on fs + wait /dev/block/platform/soc/${ro.boot.bootdevice} + symlink /dev/block/platform/soc/${ro.boot.bootdevice} /dev/block/bootdevice + mount_all /vendor/etc/fstab.qcom + swapon_all /vendor/etc/fstab.qcom + chown root system /mnt/vendor/persist + chmod 0771 /mnt/vendor/persist + mkdir /mnt/vendor/persist/data 0700 system system + mkdir /mnt/vendor/persist/bms 0700 root system + restorecon_recursive /mnt/vendor/persist + write /sys/kernel/boot_adsp/boot 1 diff --git a/manifest.xml b/manifest.xml index 0c94b6b..7066195 100644 --- a/manifest.xml +++ b/manifest.xml @@ -25,7 +25,7 @@ WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. --> - + android.hardware.audio hwbinder diff --git a/manifest_target_level_3.xml b/manifest_target_level_3.xml new file mode 100644 index 0000000..0d4c718 --- /dev/null +++ b/manifest_target_level_3.xml @@ -0,0 +1,29 @@ + + + diff --git a/manifest_target_level_4.xml b/manifest_target_level_4.xml new file mode 100644 index 0000000..5441f85 --- /dev/null +++ b/manifest_target_level_4.xml @@ -0,0 +1,29 @@ + + + diff --git a/recovery_AB_dynamic_variant.fstab b/recovery_AB_dynamic_variant.fstab new file mode 100644 index 0000000..2a91f41 --- /dev/null +++ b/recovery_AB_dynamic_variant.fstab @@ -0,0 +1,39 @@ +# Copyright (c) 2020, The Linux Foundation. All rights reserved. +# +# Redistribution and use in source and binary forms, with or without +# modification, are permitted provided that the following conditions are +# met: +# * Redistributions of source code must retain the above copyright +# notice, this list of conditions and the following disclaimer. +# * Redistributions in binary form must reproduce the above +# copyright notice, this list of conditions and the following +# disclaimer in the documentation and/or other materials provided +# with the distribution. +# * Neither the name of The Linux Foundation nor the names of its +# contributors may be used to endorse or promote products derived +# from this software without specific prior written permission. +# +# THIS SOFTWARE IS PROVIDED "AS IS" AND ANY EXPRESS OR IMPLIED +# WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF +# MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT +# ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS +# BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR +# CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF +# SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR +# BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, +# WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE +# OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN +# IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +# DAP enabled A/B recovery.fstab variant. + +#device mount point fstype [device2] [length=] + +system /system ext4 ro,barrier=1,discard wait,slotselect,avb=vbmeta_system,logical,first_stage_mount +product /product ext4 ro,barrier=1,discard wait,slotselect,avb=vbmeta_system,logical,first_stage_mount +vendor /vendor ext4 ro,barrier=1,discard wait,slotselect,avb,logical,first_stage_mount +/dev/block/bootdevice/by-name/userdata /data ext4 noatime,nosuid,nodev,barrier=1,data=ordered,noauto_da_alloc wait,check,encryptable=footer +/dev/block/bootdevice/by-name/metadata /metadata ext4 noatime,nosuid,nodev,discard wait,formattable,wrappedkey +/dev/block/mmcblk1p1 /sdcard vfat nosuid,nodev wait +/dev/block/bootdevice/by-name/boot /boot emmc defaults defaults +/dev/block/bootdevice/by-name/misc /misc emmc defaults defaults diff --git a/recovery_non-AB_dynamic_variant.fstab b/recovery_non-AB_dynamic_variant.fstab new file mode 100644 index 0000000..09ac2f0 --- /dev/null +++ b/recovery_non-AB_dynamic_variant.fstab @@ -0,0 +1,40 @@ +# Copyright (c) 2020, The Linux Foundation. All rights reserved. +# +# Redistribution and use in source and binary forms, with or without +# modification, are permitted provided that the following conditions are +# met: +# * Redistributions of source code must retain the above copyright +# notice, this list of conditions and the following disclaimer. +# * Redistributions in binary form must reproduce the above +# copyright notice, this list of conditions and the following +# disclaimer in the documentation and/or other materials provided +# with the distribution. +# * Neither the name of The Linux Foundation nor the names of its +# contributors may be used to endorse or promote products derived +# from this software without specific prior written permission. +# +# THIS SOFTWARE IS PROVIDED "AS IS" AND ANY EXPRESS OR IMPLIED +# WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF +# MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT +# ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS +# BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR +# CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF +# SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR +# BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, +# WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE +# OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN +# IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +# DAP enabled Non A/B recovery.fstab variant. + +#device mount point fstype [device2] [length=] + +system /system ext4 ro,barrier=1,discard wait,avb=vbmeta_system,logical,first_stage_mount +product /product ext4 ro,barrier=1,discard wait,avb=vbmeta_system,logical,first_stage_mount +vendor /vendor ext4 ro,barrier=1,discard wait,avb,logical,first_stage_mount +/dev/block/bootdevice/by-name/cache /cache ext4 noatime,nosuid,nodev,barrier=1,data=ordered wait,check +/dev/block/bootdevice/by-name/userdata /data ext4 noatime,nosuid,nodev,barrier=1,data=ordered,noauto_da_alloc wait,check,encryptable=footer +/dev/block/mmcblk1p1 /sdcard vfat nosuid,nodev wait +/dev/block/bootdevice/by-name/boot /boot emmc defaults defaults +/dev/block/bootdevice/by-name/recovery /recovery emmc defaults defaults +/dev/block/bootdevice/by-name/misc /misc emmc defaults defaults diff --git a/sdm660_64.mk b/sdm660_64.mk index 412668f..f15ec34 100644 --- a/sdm660_64.mk +++ b/sdm660_64.mk @@ -1,10 +1,5 @@ -TARGET_USES_AOSP := true ALLOW_MISSING_DEPENDENCIES := true - -TARGET_SYSTEM_PROP := device/qcom/sdm660_64/system.prop - -DEVICE_PACKAGE_OVERLAYS := device/qcom/sdm660_64/overlay - +TARGET_USES_AOSP := true # Default vendor configuration. ifeq ($(ENABLE_VENDOR_IMAGE),) ENABLE_VENDOR_IMAGE := true @@ -13,16 +8,6 @@ endif # Default A/B configuration. ENABLE_AB ?= true -# Disable QTIC until it's brought up in split system/vendor -# configuration to avoid compilation breakage. -ifeq ($(ENABLE_VENDOR_IMAGE), true) -#TARGET_USES_QTIC := false -endif - -TARGET_USES_AOSP_FOR_AUDIO := false -TARGET_ENABLE_QC_AV_ENHANCEMENTS := true -TARGET_DISABLE_DASH := true - ifneq ($(wildcard kernel/msm-4.14),) TARGET_KERNEL_VERSION := 4.14 $(warning "Build with 4.14 kernel.") @@ -33,6 +18,56 @@ else $(warning "Unknown kernel") endif +ifeq ($(strip $(TARGET_KERNEL_VERSION)),4.14) + # Dynamic-partition enabled by default for new launch config + BOARD_DYNAMIC_PARTITION_ENABLE ?= true + # First launch API level + PRODUCT_SHIPPING_API_LEVEL := 29 +else + BOARD_DYNAMIC_PARTITION_ENABLE := false + $(call inherit-product, build/make/target/product/product_launched_with_p.mk) +endif + +# New launch config +ifeq ($(strip $(BOARD_DYNAMIC_PARTITION_ENABLE)),true) +PRODUCT_USE_DYNAMIC_PARTITIONS := true +PRODUCT_PACKAGES += fastbootd +# Add default implementation of fastboot HAL. +PRODUCT_PACKAGES += android.hardware.fastboot@1.0-impl-mock +ifeq ($(ENABLE_AB), true) +PRODUCT_COPY_FILES += $(LOCAL_PATH)/fstab_AB_dynamic_partition_variant.qti:$(TARGET_COPY_OUT_RAMDISK)/fstab.qcom +else +PRODUCT_COPY_FILES += $(LOCAL_PATH)/fstab_non_AB_dynamic_partition_variant.qti:$(TARGET_COPY_OUT_RAMDISK)/fstab.qcom +endif + +BOARD_AVB_ENABLE := true + +# Enable product partition +PRODUCT_BUILD_PRODUCT_IMAGE := true +# Enable vbmeta_system +BOARD_AVB_VBMETA_SYSTEM := system product +BOARD_AVB_VBMETA_SYSTEM_KEY_PATH := external/avb/test/data/testkey_rsa2048.pem +BOARD_AVB_VBMETA_SYSTEM_ALGORITHM := SHA256_RSA2048 +BOARD_AVB_VBMETA_SYSTEM_ROLLBACK_INDEX := $(PLATFORM_SECURITY_PATCH_TIMESTAMP) +BOARD_AVB_VBMETA_SYSTEM_ROLLBACK_INDEX_LOCATION := 2 +$(call inherit-product, build/make/target/product/gsi_keys.mk) +endif +# End New launch config + +TARGET_SYSTEM_PROP := device/qcom/sdm660_64/system.prop + +DEVICE_PACKAGE_OVERLAYS := device/qcom/sdm660_64/overlay + +# Disable QTIC until it's brought up in split system/vendor +# configuration to avoid compilation breakage. +ifeq ($(ENABLE_VENDOR_IMAGE), true) +#TARGET_USES_QTIC := false +endif + +TARGET_USES_AOSP_FOR_AUDIO := false +TARGET_ENABLE_QC_AV_ENHANCEMENTS := true +TARGET_DISABLE_DASH := true + ifeq ($(TARGET_KERNEL_VERSION), 4.14) #Enable llvm support for kernel KERNEL_LLVM_SUPPORT := true @@ -89,6 +124,15 @@ ifneq ($(TARGET_DISABLE_DASH), true) PRODUCT_BOOT_JARS += qcmediaplayer endif +# split init.target.rc to support OTA and new launch targets +ifeq ($(strip $(BOARD_DYNAMIC_PARTITION_ENABLE)),true) +PRODUCT_PACKAGES += \ + init.target_dap.rc +else +PRODUCT_PACKAGES += \ + init.target_ota.rc +endif + # Power PRODUCT_PACKAGES += \ android.hardware.power@1.0-service \ @@ -147,6 +191,11 @@ PRODUCT_PROPERTY_OVERRIDES += \ vendor.qcom.bluetooth.soc=cherokee DEVICE_MANIFEST_FILE := device/qcom/sdm660_64/manifest.xml +ifeq ($(strip $(PRODUCT_SHIPPING_API_LEVEL)),29) + DEVICE_MANIFEST_FILE += device/qcom/sdm660_64/manifest_target_level_4.xml +else + DEVICE_MANIFEST_FILE += device/qcom/sdm660_64/manifest_target_level_3.xml +endif DEVICE_MATRIX_FILE := device/qcom/common/compatibility_matrix.xml DEVICE_FRAMEWORK_MANIFEST_FILE := device/qcom/sdm660_64/framework_manifest.xml DEVICE_FRAMEWORK_COMPATIBILITY_MATRIX_FILE := vendor/qcom/opensource/core-utils/vendor_framework_compatibility_matrix.xml @@ -255,11 +304,13 @@ PRODUCT_COPY_FILES += device/qcom/sdm660_64/msm_irqbalance.conf:$(TARGET_COPY_OU # MSM IRQ Balancer configuration file for SDM630 PRODUCT_COPY_FILES += device/qcom/sdm660_64/msm_irqbalance_sdm630.conf:$(TARGET_COPY_OUT_VENDOR)/etc/msm_irqbalance_sdm630.conf -# dm-verity configuration -PRODUCT_SUPPORTS_VERITY := true -PRODUCT_SYSTEM_VERITY_PARTITION := /dev/block/bootdevice/by-name/system -ifeq ($(ENABLE_VENDOR_IMAGE), true) -PRODUCT_VENDOR_VERITY_PARTITION := /dev/block/bootdevice/by-name/vendor +ifneq ($(BOARD_AVB_ENABLE), true) + # dm-verity configuration + PRODUCT_SUPPORTS_VERITY := true + PRODUCT_SYSTEM_VERITY_PARTITION := /dev/block/bootdevice/by-name/system + ifeq ($(ENABLE_VENDOR_IMAGE), true) + PRODUCT_VENDOR_VERITY_PARTITION := /dev/block/bootdevice/by-name/vendor + endif endif PRODUCT_FULL_TREBLE_OVERRIDE := true @@ -379,8 +430,6 @@ SEC_USERSPACE_BRINGUP_NEW_SP := true PRODUCT_COPY_FILES += \ frameworks/native/data/etc/android.hardware.telephony.ims.xml:$(TARGET_COPY_OUT_VENDOR)/etc/permissions/android.hardware.telephony.ims.xml -$(call inherit-product, build/make/target/product/product_launched_with_p.mk) - ################################################################################### # This is the End of target.mk file. # Now, Pickup other split product.mk files: