Skip to content

Commit

Permalink
ginkgo: Update For A11
Browse files Browse the repository at this point in the history
Signed-off-by: erwinabs <[email protected]>
Change-Id: I1d86cc0c0a1b962f4c3cc1164f600b4000db0b2b
  • Loading branch information
erwinabs committed Sep 10, 2022
1 parent ff7a58d commit 9bc49a4
Show file tree
Hide file tree
Showing 72 changed files with 502 additions and 706 deletions.
5 changes: 2 additions & 3 deletions AndroidProducts.mk
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,7 @@
#

PRODUCT_MAKEFILES := \
$(LOCAL_DIR)/omni_ginkgo.mk
$(LOCAL_DIR)/twrp_ginkgo.mk

COMMON_LUNCH_CHOICES := \
omni_ginkgo-userdebug \
omni_ginkgo-eng
twrp_ginkgo-eng
100 changes: 47 additions & 53 deletions BoardConfig.mk
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,8 @@
# limitations under the License.
#

DEVICE_PATH := device/xiaomi/ginkgo
# Default device path
DEVICE_PATH := device/$(PRODUCT_BRAND)/$(TARGET_DEVICE)

# For building with minimal manifest
ALLOW_MISSING_DEPENDENCIES := true
Expand All @@ -37,15 +38,15 @@ ENABLE_CPUSETS := true
ENABLE_SCHEDBOOST := true

# Bootloader
TARGET_BOOTLOADER_BOARD_NAME := trinket
TARGET_BOOTLOADER_BOARD_NAME := $(PRODUCT_PLATFORM)
TARGET_NO_BOOTLOADER := true

# Platform
TARGET_BOARD_PLATFORM := trinket
TARGET_BOARD_PLATFORM := $(TARGET_BOOTLOADER_BOARD_NAME)
TARGET_BOARD_PLATFORM_GPU := qcom-adreno640

# Kernel
BOARD_KERNEL_CMDLINE := console=ttyMSM0,115200n8 earlycon=msm_geni_serial,0xa90000 androidboot.hardware=qcom androidboot.console=ttyMSM0 androidboot.memcg=1 lpm_levels.sleep_disabled=1 video=vfb:640x400,bpp=32,memsize=3072000 msm_rtb.filter=0x237 service_locator.enable=1 swiotlb=2048 firmware_class.path=/vendor/firmware_mnt/image loop.max_part=7 androidboot.usbcontroller=a600000.dwc3 androidboot.selinux=permissive
BOARD_KERNEL_CMDLINE := console=ttyMSM0,115200n8 androidboot.hardware=qcom androidboot.console=ttyMSM0 androidboot.memcg=1 lpm_levels.sleep_disabled=1 video=vfb:640x400,bpp=32,memsize=3072000 msm_rtb.filter=0x237 service_locator.enable=1 swiotlb=1 earlycon=msm_geni_serial,0x4a90000 loop.max_part=7 cgroup.memory=nokmem,nosocket androidboot.selinux=permissive androidboot.usbconfigfs=true
BOARD_KERNEL_BASE := 0x00000000
BOARD_KERNEL_PAGESIZE := 4096
BOARD_KERNEL_TAGS_OFFSET := 0x00000100
Expand All @@ -68,7 +69,11 @@ TARGET_OTA_ASSERT_DEVICE := ginkgo

# Avb
BOARD_AVB_ENABLE := true
BOARD_AVB_ROLLBACK_INDEX := $(PLATFORM_SECURITY_PATCH_TIMESTAMP)
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
BOARD_AVB_MAKE_VBMETA_IMAGE_ARGS += --flag 2

# Partitions
BOARD_FLASH_BLOCK_SIZE := 262144
Expand All @@ -83,9 +88,7 @@ BOARD_VENDORIMAGE_PARTITION_SIZE := 1610612736
BOARD_VENDORIMAGE_FILE_SYSTEM_TYPE := ext4

# System as root
#BOARD_BUILD_SYSTEM_ROOT_IMAGE := true
BOARD_ROOT_EXTRA_FOLDERS := bluetooth dsp firmware persist
BOARD_SUPPRESS_SECURE_ERASE := true
BOARD_BUILD_SYSTEM_ROOT_IMAGE := true

# File systems
TARGET_USERIMAGES_USE_EXT4 := true
Expand All @@ -95,68 +98,59 @@ TARGET_USERIMAGES_USE_F2FS := true
BOARD_VENDORIMAGE_FILE_SYSTEM_TYPE := ext4
TARGET_COPY_OUT_VENDOR := vendor

# Encryption
BOARD_USES_METADATA_PARTITION := true
BOARD_USES_QCOM_FBE_DECRYPTION := true
TW_INCLUDE_CRYPTO := true
TW_INCLUDE_FBE_METADATA_DECRYPT := true
TW_USE_FSCRYPT_POLICY := 1
PLATFORM_SECURITY_PATCH := 2127-12-31
VENDOR_SECURITY_PATCH := $(PLATFORM_SECURITY_PATCH)

# Extras
BOARD_SUPPRESS_SECURE_ERASE := true
TARGET_SYSTEM_PROP += $(DEVICE_PATH)/system.prop

# Recovery
BOARD_HAS_LARGE_FILESYSTEM := true
TARGET_RECOVERY_PIXEL_FORMAT := "BGRA_8888"
TARGET_RECOVERY_DEVICE_MODULES += \
libandroidicu \
libcap \
libion \
libxml2

# Crypto
TW_INCLUDE_CRYPTO := true
BOARD_USES_QCOM_FBE_DECRYPTION := true
TW_INCLUDE_FBE_METADATA_DECRYPT := true
TW_RECOVERY_ADDITIONAL_RELINK_LIBRARY_FILES += \
$(TARGET_OUT_SHARED_LIBRARIES)/libcap.so \
$(TARGET_OUT_SHARED_LIBRARIES)/libion.so \
$(TARGET_OUT_SHARED_LIBRARIES)/libxml2.so

#TARGET_RECOVERY_FSTAB := $(DEVICE_PATH)/recovery/root/system/etc/recovery.fstab

# TWRP specific build flags
TW_THEME := portrait_hdpi
RECOVERY_SDCARD_ON_DATA := true
TARGET_RECOVERY_QCOM_RTC_FIX := true
TARGET_RECOVERY_PIXEL_FORMAT := BGRA_8888
TW_THEME := portrait_hdpi
TW_EXCLUDE_DEFAULT_USB_INIT := true
TW_EXTRA_LANGUAGES := true
TW_INCLUDE_NTFS_3G := true
TW_FORCE_USE_BUSYBOX := true
TW_INPUT_BLACKLIST := "hbtp_vm"
#TARGET_USE_CUSTOM_LUN_FILE_PATH := "/config/usb_gadget/g1/functions/mass_storage.0/lun.%d/file"
TW_BRIGHTNESS_PATH := "/sys/class/backlight/panel0-backlight/brightness"
TW_INPUT_BLACKLIST := hbtp_vm
TARGET_USE_CUSTOM_LUN_FILE_PATH := /config/usb_gadget/g1/functions/mass_storage.0/lun.%d/file
TW_BRIGHTNESS_PATH := /sys/class/backlight/panel0-backlight/brightness
TW_MAX_BRIGHTNESS := 2047
TW_DEFAULT_BRIGHTNESS := 1200
TW_Y_OFFSET := 80
TW_H_OFFSET := -80
#TW_SCREEN_BLANK_ON_BOOT := true
TWRP_INCLUDE_LOGCAT := true
TARGET_USES_LOGD := true
TARGET_USES_MKE2FS := true
TW_EXCLUDE_TWRPAPP := true
TW_HAS_EDL_MODE := true
TW_NO_SCREEN_TIMEOUT := true
TW_INCLUDE_RESETPROP := true
TW_INCLUDE_REPACKTOOLS := true
TW_OVERRIDE_SYSTEM_PROPS := \
"ro.build.product;ro.build.fingerprint=ro.system.build.fingerprint;ro.build.version.incremental;ro.product.device=ro.product.system.device;ro.product.model=ro.product.system.model;ro.product.name=ro.product.system.name"

TARGET_RECOVERY_DEVICE_MODULES += \
[email protected] \
ashmemd \
ashmemd_aidl_interface-cpp \
libashmemd_client \
libcap \
libicui18n \
libion \
libicuuc \
libpcrecpp \
libxml2

TW_RECOVERY_ADDITIONAL_RELINK_BINARY_FILES += \
$(TARGET_OUT_EXECUTABLES)/ashmemd
"ro.build.product;ro.build.fingerprint=ro.system.build.fingerprint;ro.build.version.incremental;ro.product.device=ro.product.system.device;ro.product.model=ro.product.system.model;ro.product.name=ro.product.system.name"

TW_RECOVERY_ADDITIONAL_RELINK_LIBRARY_FILES += \
$(TARGET_OUT_SHARED_LIBRARIES)/[email protected] \
$(TARGET_OUT_SHARED_LIBRARIES)/ashmemd_aidl_interface-cpp.so \
$(TARGET_OUT_SHARED_LIBRARIES)/libashmemd_client.so \
$(TARGET_OUT_SHARED_LIBRARIES)/libcap.so \
$(TARGET_OUT_SHARED_LIBRARIES)/libicui18n.so \
$(TARGET_OUT_SHARED_LIBRARIES)/libicuuc.so \
$(TARGET_OUT_SHARED_LIBRARIES)/libion.so \
$(TARGET_OUT_SHARED_LIBRARIES)/libpcrecpp.so \
$(TARGET_OUT_SHARED_LIBRARIES)/libxml2.so

# Hack: prevent anti rollback
PLATFORM_SECURITY_PATCH := 2099-12-31
PLATFORM_VERSION := 16.1.0
VENDOR_SECURITY_PATCH := 2099-12-31
# TWRP Debug Flags
TWRP_INCLUDE_LOGCAT := true
TARGET_USES_LOGD := true
TARGET_RECOVERY_DEVICE_MODULES += debuggerd
TW_RECOVERY_ADDITIONAL_RELINK_FILES += $(TARGET_OUT_EXECUTABLES)/debuggerd
24 changes: 24 additions & 0 deletions device.mk
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
# Api
PRODUCT_SHIPPING_API_LEVEL := 28

# Dependencies
PRODUCT_COPY_FILES += \
$(OUT_DIR)/target/product/$(PRODUCT_RELEASE_NAME)/obj/SHARED_LIBRARIES/libandroidicu_intermediates/libandroidicu.so:$(TARGET_COPY_OUT_RECOVERY)/root/system/lib64/libandroidicu.so

# Health HAL
PRODUCT_PACKAGES += \
[email protected]

# HIDL
PRODUCT_PACKAGES += \
libhidltransport \
libhwbinder

# qcom decryption
PRODUCT_PACKAGES_ENG += \
qcom_decrypt \
qcom_decrypt_fbe

# Soong namespaces
PRODUCT_SOONG_NAMESPACES += \
$(LOCAL_PATH)
41 changes: 0 additions & 41 deletions omni_ginkgo.mk

This file was deleted.

Binary file modified prebuilt/Image.gz
Binary file not shown.
Binary file modified prebuilt/dtb.img
Binary file not shown.
Binary file modified prebuilt/dtbo.img
Binary file not shown.
18 changes: 7 additions & 11 deletions recovery/root/init.recovery.qcom.rc
Original file line number Diff line number Diff line change
Expand Up @@ -27,18 +27,14 @@

import /init.recovery.qcom_decrypt.rc

on init
setprop prepdecrypt.setpatch true
setprop prepdecrypt.loglevel 2

on fs
wait /dev/block/platform/soc/${ro.boot.bootdevice}
symlink /dev/block/platform/soc/${ro.boot.bootdevice} /dev/block/bootdevice
setprop prepdecrypt.setpatch true

service unified-script /system/bin/unified-script.sh
user root
group root
disabled
oneshot
seclabel u:r:recovery:s0
export ANDROID_ROOT /system_root

on boot
chmod 0777 /system/bin/unified-script.sh
start unified-script
on boot
start health-hal-2-1
1 change: 0 additions & 1 deletion recovery/root/mnt/vendor/persist

This file was deleted.

Binary file modified recovery/root/system/bin/[email protected]
Binary file not shown.
Binary file modified recovery/root/system/bin/[email protected]
Binary file not shown.
Binary file modified recovery/root/system/bin/qseecomd
Binary file not shown.
44 changes: 0 additions & 44 deletions recovery/root/system/bin/unified-script.sh

This file was deleted.

6 changes: 6 additions & 0 deletions recovery/root/system/etc/init/[email protected]
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
service health-hal-2-1 /vendor/bin/hw/[email protected]
class hal charger
user system
group system
capabilities WAKE_ALARM
file /dev/kmsg w
4 changes: 0 additions & 4 deletions recovery/root/system/etc/init/ashmemd.rc

This file was deleted.

2 changes: 1 addition & 1 deletion recovery/root/system/etc/recovery.fstab
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@
/dev/block/bootdevice/by-name/system / ext4 ro,barrier=1,discard wait,avb
/dev/block/bootdevice/by-name/cache /cache ext4 nosuid,noatime,nodev,barrier=1 wait
/dev/block/bootdevice/by-name/metadata /metadata ext4 noatime,nosuid,nodev,discard wait,formattable,first_stage_mount
/dev/block/bootdevice/by-name/userdata /data f2fs noatime,nosuid,nodev,nodiscard,alloc_mode=reuse,fsync_mode=nobarrier latemount,wait,check,fileencryption=ice,reservedsize=128M,quota
/dev/block/bootdevice/by-name/userdata /data f2fs noatime,nosuid,nodev,nodiscard,alloc_mode=reuse,fsync_mode=nobarrier,inlinecrypt latemount,wait,check,fileencryption=ice,reservedsize=128M,quota
/devices/platform/soc/4784000.sdhci/mmc_host* /storage/sdcard1 vfat nosuid,nodev wait,voldmanaged=sdcard1:auto,encryptable=footer
/devices/platform/soc/1da4000.ufshc_card/host* /storage/sdcard1 vfat nosuid,nodev wait,voldmanaged=sdcard1:auto,encryptable=footer
/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
Expand Down
Loading

0 comments on commit 9bc49a4

Please sign in to comment.