From 0fc8c3a325bf97edf542417467f9a98015b88eb8 Mon Sep 17 00:00:00 2001 From: Captain Throwback Date: Tue, 22 Oct 2019 12:29:09 -0400 Subject: [PATCH] m8: update tree for USB config and bootloader offset - Add missing LD_PRELOAD - Remove ld.config.txt (use upstream fix) Change-Id: Ibd3114ecbcdf9ade346b0ff1908a4be7caf4854b --- BoardConfig.mk | 9 +++-- recovery/root/fstab.qcom | 10 ------ recovery/root/init.recovery.qcom.rc | 3 +- recovery/root/init.recovery.usb.rc | 51 ++++++++++------------------- recovery/root/sbin/ld.config.txt | 15 --------- 5 files changed, 25 insertions(+), 63 deletions(-) delete mode 100755 recovery/root/fstab.qcom delete mode 100755 recovery/root/sbin/ld.config.txt diff --git a/BoardConfig.mk b/BoardConfig.mk index 493b0facf..ab816ca3c 100755 --- a/BoardConfig.mk +++ b/BoardConfig.mk @@ -73,6 +73,11 @@ endif TARGET_USERIMAGES_USE_EXT4 := true TARGET_USERIMAGES_USE_F2FS := true +# Android version & Security Patch Level +# Default TWRP Values +PLATFORM_VERSION := 16.1.0 +PLATFORM_SECURITY_PATCH := 2025-12-05 + # Recovery BOARD_HAS_LARGE_FILESYSTEM := true BOARD_HAS_NO_MISC_PARTITION := true @@ -80,14 +85,12 @@ BOARD_HAS_NO_SELECT_BUTTON := true BOARD_NEEDS_LZMA_MINIGZIP := true BOARD_RECOVERY_SWIPE := true BOARD_USES_MMCUTILS := true -BOARD_RECOVERY_BLDRMSG_OFFSET := 2048 -COMMON_GLOBAL_CPPFLAGS += -DBOARD_RECOVERY_BLDRMSG_OFFSET=2048 +BOOTLOADER_MESSAGE_OFFSET := 2048 # TWRP Build Flags TW_THEME := portrait_hdpi TW_EXCLUDE_DEFAULT_USB_INIT := true TW_INCLUDE_CRYPTO := true -#TW_CRYPTO_USE_SYSTEM_VOLD := qseecomd hwservicemanager TW_NO_EXFAT_FUSE := true TARGET_RECOVERY_DEVICE_MODULES := chargeled liblog_htc_sbin tzdata TW_RECOVERY_ADDITIONAL_RELINK_FILES += $(TARGET_OUT)/usr/share/zoneinfo/tzdata diff --git a/recovery/root/fstab.qcom b/recovery/root/fstab.qcom deleted file mode 100755 index 7fa3605e4..000000000 --- a/recovery/root/fstab.qcom +++ /dev/null @@ -1,10 +0,0 @@ -# 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 - -#TODO: Add 'check' as fs_mgr_flags with data partition. -# Currently we dont have e2fsck compiled. So fs check would failed. - -# -/dev/block/platform/msm_sdcc.1/by-name/userdata /data ext4 noatime,nosuid,nodev,barrier=1,data=ordered,noauto_da_alloc,journal_async_commit,errors=panic wait,check,encryptable=/dev/block/platform/msm_sdcc.1/by-name/extra - diff --git a/recovery/root/init.recovery.qcom.rc b/recovery/root/init.recovery.qcom.rc index e796f1603..4f8a22a06 100755 --- a/recovery/root/init.recovery.qcom.rc +++ b/recovery/root/init.recovery.qcom.rc @@ -3,9 +3,10 @@ import /init.recovery.qcom_decrypt.rc on fs && property:ro.build.system_root_image=true # Pie (SAR) update ONLY export ANDROID_ROOT /system_root - export LD_CONFIG_FILE /sbin/ld.config.txt on fs + export LD_PRELOAD /sbin/liblog_htc_sbin.so + wait /dev/block/platform/${ro.boot.bootdevice} symlink /dev/block/platform/${ro.boot.bootdevice} /dev/block/bootdevice diff --git a/recovery/root/init.recovery.usb.rc b/recovery/root/init.recovery.usb.rc index 88bde6edc..16b6622d3 100755 --- a/recovery/root/init.recovery.usb.rc +++ b/recovery/root/init.recovery.usb.rc @@ -8,45 +8,16 @@ on fs write /sys/class/android_usb/android0/iProduct ${ro.product.model} write /sys/class/android_usb/android0/iSerial ${ro.serialno} - mkdir /dev/usb-ffs 0770 shell shell - mkdir /dev/usb-ffs/adb 0770 shell shell - mount functionfs adb /dev/usb-ffs/adb uid=2000,gid=2000 - write /sys/class/android_usb/android0/f_ffs/aliases adb - -# adb only USB configuration -# This is the fallback configuration if the -# USB manager fails to set a standard configuration -on property:sys.usb.config=adb - stop adbd - write /sys/class/android_usb/android0/idVendor 0bb4 - write /sys/class/android_usb/android0/idProduct 0c81 - write /sys/class/android_usb/android0/functions ${sys.usb.config} - start adbd - write /sys/devices/platform/android_usb/usb_function_switch 2 - setprop sys.usb.state ${sys.usb.config} - -on property:persist.sys.usb.config=adb - setprop sys.usb.config ${persist.sys.usb.config} - -# Used to disable USB when switching states on property:sys.usb.config=none stop adbd write /sys/class/android_usb/android0/enable 0 write /sys/class/android_usb/android0/bDeviceClass 0 setprop sys.usb.state ${sys.usb.config} -# this is for M charge-only -on property:sys.usb.config=charged - write /sys/class/android_usb/android0/enable 0 - write /sys/class/android_usb/android0/idVendor 0bb4 - write /sys/class/android_usb/android0/idProduct 0f0b - write /sys/class/android_usb/android0/functions charging - write /sys/class/android_usb/android0/enable 1 - write /sys/devices/platform/android_usb/usb_function_switch 1048576 - setprop sys.usb.state ${sys.usb.config} - -# this is for M charge-only but USB debugging is on, we switch to adb -on property:sys.usb.config=charged,adb +# adb only USB configuration +# This is the fallback configuration if the +# USB manager fails to set a standard configuration +on property:sys.usb.config=adb stop adbd write /sys/class/android_usb/android0/enable 0 write /sys/class/android_usb/android0/idVendor 0bb4 @@ -58,11 +29,23 @@ on property:sys.usb.config=charged,adb setprop sys.usb.state ${sys.usb.config} on property:sys.usb.config=mass_storage,adb + stop adbd + write /sys/class/android_usb/android0/enable 0 + write /sys/class/android_usb/android0/idVendor 0bb4 + write /sys/class/android_usb/android0/idProduct 0c02 + write /sys/class/android_usb/android0/functions mass_storage,adb + write /sys/class/android_usb/android0/enable 1 start adbd write /sys/devices/platform/android_usb/usb_function_switch 3 setprop sys.usb.state ${sys.usb.config} on property:sys.usb.config=mtp,adb + stop adbd + write /sys/class/android_usb/android0/enable 0 + write /sys/class/android_usb/android0/idVendor 0bb4 + write /sys/class/android_usb/android0/idProduct 0f87 + write /sys/class/android_usb/android0/functions mtp,adb + write /sys/class/android_usb/android0/enable 1 start adbd - write /sys/devices/platform/android_usb/usb_function_switch 130 + write /sys/devices/platform/android_usb/usb_function_switch 131 setprop sys.usb.state ${sys.usb.config} diff --git a/recovery/root/sbin/ld.config.txt b/recovery/root/sbin/ld.config.txt deleted file mode 100755 index c22edfec6..000000000 --- a/recovery/root/sbin/ld.config.txt +++ /dev/null @@ -1,15 +0,0 @@ -# Copyright (C) 2017 The Android Open Source Project -# -# Bionic loader config file. -# This gives the exactly the same namespace setup in pre-O. -# - -# All binaries gets the same configuration 'legacy' -dir.legacy = /system -dir.legacy = /vendor -dir.legacy = /sbin - -[legacy] -namespace.default.isolated = false -namespace.default.search.paths = /system/${LIB}:/vendor/${LIB} -namespace.default.asan.search.paths = /data/asan/system/${LIB}:/system/${LIB}:/data/asan/vendor/${LIB}:/vendor/${LIB}