From 153cfbd83f3dc1dbdaabf0da4aa69b9bfc3c19e8 Mon Sep 17 00:00:00 2001 From: Rama Bondan Prakoso Date: Thu, 31 Oct 2019 09:52:19 +0000 Subject: [PATCH] sdm660-common: Add support for lavender (Redmi Note 7/7S) * add A-only SAR fstab * hax manifest keymaster version Signed-off-by: Rama Bondan Prakoso --- Android.mk | 2 +- BoardConfigCommon.mk | 8 +++++++- rootdir/Android.mk | 4 +++- rootdir/etc/fstab_A.qcom | 28 ++++++++++++++++++++++++++++ setup-makefiles.sh | 2 +- 5 files changed, 40 insertions(+), 4 deletions(-) create mode 100644 rootdir/etc/fstab_A.qcom diff --git a/Android.mk b/Android.mk index 1f91f027..746c415b 100644 --- a/Android.mk +++ b/Android.mk @@ -16,7 +16,7 @@ LOCAL_PATH := $(call my-dir) -ifneq ($(filter twolip jasmine_sprout wayne clover,$(TARGET_DEVICE)),) +ifneq ($(filter twolip jasmine_sprout wayne clover lavender,$(TARGET_DEVICE)),) $(shell mkdir -p $(TARGET_OUT_VENDOR)/firmware; \ ln -sf /dev/block/bootdevice/by-name/msadp \ diff --git a/BoardConfigCommon.mk b/BoardConfigCommon.mk index 2c953dcb..47aa53c0 100644 --- a/BoardConfigCommon.mk +++ b/BoardConfigCommon.mk @@ -192,7 +192,11 @@ BOARD_VENDOR_QCOM_GPS_LOC_API_HARDWARE := $(TARGET_BOARD_PLATFORM) # HIDL DEVICE_FRAMEWORK_MANIFEST_FILE := $(COMMON_PATH)/framework_manifest.xml +ifneq ($(filter lavender,$(TARGET_DEVICE)),) +DEVICE_MANIFEST_FILE := $(shell sed 's/3.0/4.0/g' $(COMMON_PATH)/manifest.xml > manifest.xml && echo manifest.xml) +else DEVICE_MANIFEST_FILE := $(COMMON_PATH)/manifest.xml +endif DEVICE_MATRIX_FILE := $(COMMON_PATH)/compatibility_matrix.xml # HWUI @@ -249,7 +253,9 @@ TARGET_USES_INTERACTION_BOOST := true BOARD_PROPERTY_OVERRIDES_SPLIT_ENABLED := true # Recovery -ifeq ($(AB_OTA_UPDATER), true) +ifneq ($(filter lavender,$(TARGET_DEVICE)),) +TARGET_RECOVERY_FSTAB := $(COMMON_PATH)/rootdir/etc/fstab_A.qcom +else ifeq ($(AB_OTA_UPDATER), true) TARGET_RECOVERY_FSTAB := $(COMMON_PATH)/rootdir/etc/fstab_AB.qcom else TARGET_RECOVERY_FSTAB := $(COMMON_PATH)/rootdir/etc/fstab.qcom diff --git a/rootdir/Android.mk b/rootdir/Android.mk index 640e5905..dc05fd7b 100644 --- a/rootdir/Android.mk +++ b/rootdir/Android.mk @@ -87,7 +87,9 @@ include $(CLEAR_VARS) LOCAL_MODULE := fstab.qcom LOCAL_MODULE_TAGS := optional LOCAL_MODULE_CLASS := ETC -ifeq ($(AB_OTA_UPDATER), true) +ifneq ($(filter lavender,$(TARGET_DEVICE)),) +LOCAL_SRC_FILES := etc/fstab_A.qcom +else ifeq ($(AB_OTA_UPDATER), true) LOCAL_SRC_FILES := etc/fstab_AB.qcom else LOCAL_SRC_FILES := etc/fstab.qcom diff --git a/rootdir/etc/fstab_A.qcom b/rootdir/etc/fstab_A.qcom new file mode 100644 index 00000000..deb5f911 --- /dev/null +++ b/rootdir/etc/fstab_A.qcom @@ -0,0 +1,28 @@ +# 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 + +# NOTE: /system and /vendor partitions are now early-mounted and the fstab entry is specified in device tree (duplicated below for recovery image purposes only): +# /proc/device-tree/firmware/android/fstab/system +# /proc/device-tree/firmware/android/fstab/vendor + +#TODO: Add 'check' as fs_mgr_flags with data partition. +# Currently we dont have e2fsck compiled. So fs check would failed. + +# Non-A/B fstab.qcom variant +# +/dev/block/bootdevice/by-name/userdata /data ext4 nosuid,nodev,barrier=1,noauto_da_alloc,discard,noatime,lazytime wait,check,forceencrypt=footer,quota,reservedsize=128M +/dev/block/bootdevice/by-name/userdata /data f2fs noatime,nosuid,nodev,nodiratime,fsync_mode=nobarrier,background_gc=off wait,check,forceencrypt=footer,quota,reservedsize=128M +/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/cache /cache f2fs noatime,nosuid,nodev,nodiratime,discard,fsync_mode=nobarrier,inline_xattr,inline_data,data_flush wait +/dev/block/bootdevice/by-name/persist /mnt/vendor/persist ext4 nosuid,nodev,barrier=1,noatime wait,check + +/dev/block/bootdevice/by-name/system / ext4 ro,barrier=1 wait +/dev/block/bootdevice/by-name/vendor /vendor ext4 ro,barrier=1 wait,recoveryonly +/dev/block/bootdevice/by-name/boot /boot emmc defaults defaults diff --git a/setup-makefiles.sh b/setup-makefiles.sh index 6f61285f..f089313a 100755 --- a/setup-makefiles.sh +++ b/setup-makefiles.sh @@ -39,7 +39,7 @@ fi setup_vendor "$DEVICE_COMMON" "$VENDOR" "$LINEAGE_ROOT" true # Copyright headers and guards -write_headers "twolip jasmine_sprout wayne clover" +write_headers "twolip jasmine_sprout wayne clover lavender" write_makefiles "$MY_DIR"/proprietary-files.txt true