Skip to content

Commit

Permalink
m8: update tree for USB config and bootloader offset
Browse files Browse the repository at this point in the history
- Add missing LD_PRELOAD
- Remove ld.config.txt (use upstream fix)

Change-Id: Ibd3114ecbcdf9ade346b0ff1908a4be7caf4854b
  • Loading branch information
CaptainThrowback committed Oct 22, 2019
1 parent 83c4285 commit 0fc8c3a
Show file tree
Hide file tree
Showing 5 changed files with 25 additions and 63 deletions.
9 changes: 6 additions & 3 deletions BoardConfig.mk
Original file line number Diff line number Diff line change
Expand Up @@ -73,21 +73,24 @@ 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
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
Expand Down
10 changes: 0 additions & 10 deletions recovery/root/fstab.qcom

This file was deleted.

3 changes: 2 additions & 1 deletion recovery/root/init.recovery.qcom.rc
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
51 changes: 17 additions & 34 deletions recovery/root/init.recovery.usb.rc
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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}
15 changes: 0 additions & 15 deletions recovery/root/sbin/ld.config.txt

This file was deleted.

0 comments on commit 0fc8c3a

Please sign in to comment.