瀏覽代碼

Introduce BLU G9 - G0130WW

Signed-off-by: rokibhasansagar <rokibhasansagar2014@outlook.com>
lopestorm 6 年之前
當前提交
db9c3bef3d
共有 13 個文件被更改,包括 482 次插入0 次删除
  1. 6 0
      Android.mk
  2. 19 0
      AndroidProducts.mk
  3. 138 0
      BoardConfig.mk
  4. 58 0
      README.md
  5. 2 0
      omni.dependencies
  6. 30 0
      omni_G0130WW.mk
  7. 二進制
      prebuilt/Image.gz-dtb
  8. 49 0
      recovery/root/etc/recovery.fstab
  9. 37 0
      recovery/root/init.recovery.mt6765.rc
  10. 135 0
      recovery/root/init.recovery.usb.rc
  11. 二進制
      recovery/root/sbin/mke2fs_static
  12. 5 0
      system.prop
  13. 3 0
      vendorsetup.sh

+ 6 - 0
Android.mk

@@ -0,0 +1,6 @@
+LOCAL_PATH := $(call my-dir)
+
+ifeq ($(TARGET_DEVICE),G0130WW)
+include $(call all-makefiles-under,$(LOCAL_PATH))
+include $(CLEAR_VARS)
+endif

+ 19 - 0
AndroidProducts.mk

@@ -0,0 +1,19 @@
+#
+# Copyright 2020 The Android Open Source Project
+#
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+#
+#      http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+#
+
+PRODUCT_MAKEFILES := \
+    $(LOCAL_DIR)/omni_G0130WW.mk
+

+ 138 - 0
BoardConfig.mk

@@ -0,0 +1,138 @@
+# Device path
+LOCAL_PATH := device/BLU/G0130WW
+
+# Bootloader
+TARGET_NO_BOOTLOADER := true
+TARGET_BOOTLOADER_BOARD_NAME := mt6765
+
+# Platform
+TARGET_BOARD_PLATFORM := mt6765
+
+TARGET_BOARD_SUFFIX := _64
+TARGET_USES_64_BIT_BINDER := true
+
+# MTK Hardware
+BOARD_HAS_MTK_HARDWARE := true
+MTK_HARDWARE := true
+
+# Architecture
+TARGET_ARCH := arm64
+TARGET_ARCH_VARIANT := armv8-a
+TARGET_CPU_ABI := arm64-v8a
+TARGET_CPU_ABI2 :=
+TARGET_CPU_VARIANT := cortex-a53
+
+TARGET_2ND_ARCH := arm
+TARGET_2ND_ARCH_VARIANT := armv8-a
+TARGET_2ND_CPU_ABI := armeabi-v7a
+TARGET_2ND_CPU_ABI2 := armeabi
+TARGET_2ND_CPU_VARIANT := cortex-a53
+
+TARGET_CPU_ABI_LIST_64_BIT := $(TARGET_CPU_ABI)
+TARGET_CPU_ABI_LIST_32_BIT := $(TARGET_2ND_CPU_ABI),$(TARGET_2ND_CPU_ABI2)
+TARGET_CPU_ABI_LIST := $(TARGET_CPU_ABI_LIST_64_BIT),$(TARGET_CPU_ABI_LIST_32_BIT)
+
+# Kernel
+BOARD_KERNEL_BASE := 0x40078000
+BOARD_KERNEL_PAGESIZE := 2048
+BOARD_KERNEL_CMDLINE := bootopt=64S3,32N2,64N2 androidboot.selinux=permissive
+BOARD_MKBOOTIMG_ARGS := --base 0x40078000 --ramdisk_offset 0x11a88000 --second_offset 0x00e88000 --tags_offset 0x07808000
+TARGET_PREBUILT_KERNEL := $(LOCAL_PATH)/prebuilt/Image.gz-dtb
+BOARD_KERNEL_IMAGE_NAME := Image.gz-dtb
+TARGET_KERNEL_ARCH := arm64
+TARGET_KERNEL_HEADER_ARCH := arm64
+
+# system.prop
+TARGET_SYSTEM_PROP := $(LOCAL_PATH)/system.prop
+
+# OTA Assert
+TARGET_OTA_ASSERT_DEVICE := G0130WW
+
+#Partitions
+BOARD_BOOTIMAGE_PARTITION_SIZE := 33554432
+BOARD_RECOVERYIMAGE_PARTITION_SIZE := 33554432
+BOARD_SYSTEMIMAGE_PARTITION_SIZE := 3758096384
+BOARD_USERDATAIMAGE_PARTITION_SIZE := 56913542656
+BOARD_USERDATAIMAGE_FILE_SYSTEM_TYPE := ext4
+BOARD_CACHEIMAGE_PARTITION_SIZE := 452984832
+BOARD_CACHEIMAGE_FILE_SYSTEM_TYPE := ext4
+BOARD_VENDORIMAGE_PARTITION_SIZE := 838860800
+BOARD_VENDORIMAGE_FILE_SYSTEM_TYPE := ext4
+BOARD_FLASH_BLOCK_SIZE := 131072 # BOARD_KERNEL_PAGESIZE * 64
+
+TARGET_USERIMAGES_USE_EXT4 := true
+TARGET_USERIMAGES_USE_F2FS := true
+
+# Workaround for error copying vendor files to recovery ramdisk
+BOARD_VENDORIMAGE_FILE_SYSTEM_TYPE := ext4
+TARGET_COPY_OUT_VENDOR := vendor
+
+# Recovery
+TARGET_RECOVERY_PIXEL_FORMAT := "BGRA_8888"
+TARGET_RECOVERY_FSTAB := $(LOCAL_PATH)/recovery/root/etc/recovery.fstab
+BOARD_HAS_NO_SELECT_BUTTON := true
+BOARD_HAS_LARGE_FILESYSTEM := true
+BOARD_SUPPRESS_SECURE_ERASE := true
+BOARD_USE_FRAMEBUFFER_ALPHA_CHANNEL := true
+RECOVERY_SDCARD_ON_DATA := true
+RECOVERY_GRAPHICS_USE_LINELENGTH := true
+TARGET_USE_CUSTOM_LUN_FILE_PATH := /sys/devices/platform/mt_usb/musb-hdrc.0.auto/gadget/lun%d/file
+TARGET_DISABLE_TRIPLE_BUFFERING := false
+TARGET_RECOVERY_LCD_BACKLIGHT_PATH := \"/sys/class/leds/lcd-backlight/brightness\"
+
+########
+# TWRP #
+########
+
+# Resolution
+TW_THEME := portrait_hdpi
+# DEVICE_RESOLUTION := 720x1520 (deprecated)
+DEVICE_SCREEN_WIDTH := 720
+DEVICE_SCREEN_HEIGHT := 1520
+
+# Display
+TW_BRIGHTNESS_PATH := /sys/class/leds/lcd-backlight/brightness
+TW_DEFAULT_BRIGHTNESS := 188
+TW_MAX_BRIGHTNESS := 255
+TW_NO_SCREEN_BLANK := true
+TW_NO_SCREEN_TIMEOUT := true
+TW_NO_BATT_PERCENT := false
+TW_SCREEN_BLANK_ON_BOOT := true
+
+TW_CUSTOM_CPU_TEMP_PATH := /sys/devices/virtual/thermal/thermal_zone1/temp
+
+# Toolbox instead of busybox
+#TW_FORCE_USE_BUSYBOX := true
+TW_USE_TOOLBOX := true
+
+# NTFS and ExFAT support
+TW_INCLUDE_NTFS_3G := true
+TW_INCLUDE_FUSE_EXFAT := true
+
+# Excludes
+TW_EXCLUDE_TWRPAPP := true
+
+# Crypto
+TW_INCLUDE_CRYPTO := true
+TW_CRYPTO_FS_TYPE := "ext4"
+TW_CRYPTO_REAL_BLKDEV := "/dev/block/platform/bootdevice/by-name/userdata"
+TW_CRYPTO_MNT_POINT := "/data"
+TW_CRYPTO_FS_OPTIONS := "nosuid,nodev,noatime,discard,noauto_da_alloc,barrier=0,data=ordered"
+
+# Debug
+TWRP_INCLUDE_LOGCAT := true
+TARGET_USES_LOGD := true
+
+# Storage
+TW_HAS_MTP := true
+TW_MTP_DEVICE := /dev/mtp_usb
+TW_INTERNAL_STORAGE_PATH := "/data/media"
+TW_INTERNAL_STORAGE_MOUNT_POINT := "data"
+TW_EXTERNAL_STORAGE_PATH := "/external_sd"
+TW_EXTERNAL_STORAGE_MOUNT_POINT := "external_sd"
+TW_DEFAULT_EXTERNAL_STORAGE := true
+TW_NO_USB_STORAGE := false
+
+# Languages
+TW_EXTRA_LANGUAGES := true
+TW_DEFAULT_LANGUAGE := en

+ 58 - 0
README.md

@@ -0,0 +1,58 @@
+# TWRP Device Tree - BLU G9 - G0130WW
+
+## About Device
+
+![BLU G9 G0130WW](https://fdn2.gsmarena.com/vv/pics/blu/blu-g9-1.jpg)
+
+### Specifications
+
+Component Type | Details
+-------:|:-------------------------
+CPU     | Octa-core 2.0 GHz Cortex-A53 Helio P22 (12 nm)
+Platform | MediaTek MT6762
+GPU     | PowerVR GE8320
+Architecture | 64 bit
+Memory  | 4 GB RAM
+Shipped Android Version | 	Android 9.0 Pie
+Storage | 64 GB
+Battery | 4000 mAh
+Height | 155.4 mm
+Width | 71.8 mm
+Thickness | 8.1 mm
+Weight | 165 g
+Display | 6.3" (99.1 cm2)
+Screen resolution | 720 x 1520 pixels, HD+
+Pixel density | 267 PPI
+Video | 1920p, 1080p video, 30fps
+Primary Camera | 13 MP + 2 MP(depth), f/2.0, 1/3", Five lenses Rear Camera, PDAF
+Secondary Camera | 13 MP, f/2.0, 1/3"
+Quick charging | Fast charging
+Wifi | Yes, IEEE802.11 a/b/g/n, Supports 5G Wi-Fi Signal / Wi-Fi Direct / Wi-Fi Display
+Bluetooth | v4.0, Bluetooth, A2DP
+USB Type-C | Yes, 2.0, Type-C 1.0 reversible connector
+NFC | No
+Network support | Both SIM slots are compatible with 4G
+GPRS | Available
+EDGE | Available
+SIM size | SIM1: Micro, SIM2: Nano
+CARD slot |	microSD, up to 128 GB (microSDXC)
+SD slot |	SIM1 + microSD or SIM2 + microSD
+Sensors | Fingerprint (rear-mounted), Accelerometer, Gyroscope, Geomagnetic Sensor
+
+Network | Bands
+-------:|:-------------------------
+2G | GSM 850 / 900 / 1800 / 1900 - SIM 1 & SIM 2
+3G | HSDPA B1 (2100), B2 (1900), B4 (1700/2100 AWS A-F), B5 (850), B8 (900)
+4G | LTE band 1 (2100), 2 (1900), 3 (1800), 4 (1700/2100 AWS 1), 5 (850), 7 (2600), 8 (900), 12 (700), 13 (700), 17 (700), 28 (700)
+Speed | HSPA 42.2/11.5 Mbps, LTE-A (2CA) Cat6 300/50 Mbps
+
+**This device tree can be used to build TWRP for BLU G9 - G0130WW**
+
+
+## Build Instructions
+```bash
+export ALLOW_MISSING_DEPENDENCIES=true
+. build/envsetup.sh
+lunch omni_G0130WW-eng
+mka recoveryimage
+```

+ 2 - 0
omni.dependencies

@@ -0,0 +1,2 @@
+[
+]

+ 30 - 0
omni_G0130WW.mk

@@ -0,0 +1,30 @@
+# Release name
+PRODUCT_RELEASE_NAME := G0130WW
+
+# Inherit from those products. Most specific first.
+$(call inherit-product, $(SRC_TARGET_DIR)/product/embedded.mk)
+$(call inherit-product, $(SRC_TARGET_DIR)/product/core_64_bit.mk)
+$(call inherit-product, $(SRC_TARGET_DIR)/product/treble_common_64.mk)
+$(call inherit-product, $(SRC_TARGET_DIR)/product/runtime_libart.mk)
+$(call inherit-product, $(SRC_TARGET_DIR)/product/languages_full.mk)
+
+# Inherit from our custom product configuration
+$(call inherit-product, vendor/omni/config/common.mk)
+
+# Device identifier. This must come after all inclusions
+PRODUCT_BRAND := BLU
+PRODUCT_DEVICE := G0130WW
+PRODUCT_MANUFACTURER := BLU
+PRODUCT_MODEL := G0130WW
+PRODUCT_NAME := omni_G0130WW
+PRODUCT_BOARD := mt6765
+
+# enable stock zip packages flash
+PRODUCT_DEFAULT_PROPERTY_OVERRIDES += \
+    ro.treble.enabled=true \
+    persist.sys.usb.config=mtp \
+    persist.service.adb.enable=1 \
+    persist.service.debuggable=1 \
+    ro.secure=1 \
+    ro.adb.secure=0 \
+    ro.allow.mock.location=0

二進制
prebuilt/Image.gz-dtb


+ 49 - 0
recovery/root/etc/recovery.fstab

@@ -0,0 +1,49 @@
+#fstab file by lopestom for BLU G9_G0130WW_V9.0.04.07_GENERIC 04-03-2020
+#
+/boot_para	    emmc	/dev/block/platform/bootdevice/by-name/boot_para        flags=display="boot_para";backup=1
+/boot		    emmc	/dev/block/platform/bootdevice/by-name/boot             flags=display="Boot";backup=1;flashimg=1
+/recovery	    emmc	/dev/block/platform/bootdevice/by-name/recovery         flags=display="Recovery";backup=1;flashimg=1
+/para		    emmc	/dev/block/platform/bootdevice/by-name/para             flags=display="Para_misc";backup=1;flashimg=1
+/expdb		    emmc	/dev/block/platform/bootdevice/by-name/expdb             flags=display="expdb";backup=1
+/frp		    emmc	/dev/block/platform/bootdevice/by-name/frp              flags=display="frp";backup=1
+/metadata	    ext4	/dev/block/platform/bootdevice/by-name/md_udc
+/nvcfg		    ext4	/dev/block/platform/bootdevice/by-name/nvcfg            flags=display="NvCfg";backup=1
+/nvdata		    ext4	/dev/block/platform/bootdevice/by-name/nvdata           flags=display="NvData";backup=1
+/nvram		    emmc	/dev/block/platform/bootdevice/by-name/nvram            flags=display="NvRam";backup=1;flashimg=1
+/protect_f	    ext4	/dev/block/platform/bootdevice/by-name/protect1         flags=display="Protect";backup=1
+/protect_s	    ext4	/dev/block/platform/bootdevice/by-name/protect2         flags=backup=1;subpartitionof=/protect_f
+/seccfg		    emmc	/dev/block/platform/bootdevice/by-name/seccfg           flags=display="SecCfg";backup=1
+/lk             emmc	/dev/block/platform/bootdevice/by-name/lk               flags=display="Uboot";backup=1;flashimg=1
+/lk2		    emmc	/dev/block/platform/bootdevice/by-name/lk2              flags=backup=1;subpartitionof=/lk
+/logo		    emmc	/dev/block/platform/bootdevice/by-name/logo             flags=display="logo";backup=1;flashimg=1
+/tee1		    emmc	/dev/block/platform/bootdevice/by-name/tee1             flags=display="Tee";backup=1;flashimg=1
+/tee2		    emmc	/dev/block/platform/bootdevice/by-name/tee2             flags=backup=1;subpartitionof=/tee1         
+/spmfw		    emmc	/dev/block/platform/bootdevice/by-name/spmfw            flags=display="Spm";backup=1
+/sspm_1		    emmc	/dev/block/platform/bootdevice/by-name/sspm_1           flags=display="sspm_1";backup=1
+/sspm_2		    emmc	/dev/block/platform/bootdevice/by-name/sspm_2           flags=backup=1;subpartitionof=/sspm_1
+/proinfo	    emmc	/dev/block/platform/bootdevice/by-name/proinfo          flags=display="Proinfo";backup=1
+/md1img		    emmc	/dev/block/platform/bootdevice/by-name/md1img           flags=display="Modem";backup=1;flashimg=1
+/md1dsp         emmc    /dev/block/platform/bootdevice/by-name/md1dsp            flags=backup=1;subpartitionof=/md1img
+/md3img         emmc    /dev/block/platform/bootdevice/by-name/md3img            flags=display="md3img";backup=1           
+/md1arm7        emmc    /dev/block/platform/bootdevice/by-name/md1arm7           flags=display="md1arm7";backup=1          
+/system		    ext4	/dev/block/platform/bootdevice/by-name/system           flags=display="System";backup=1;wipeingui
+/system_image	emmc	/dev/block/platform/bootdevice/by-name/system           flags=display="System_Image";backup=1;flashimg=1
+/cache		    ext4	/dev/block/platform/bootdevice/by-name/cache            flags=display="cache";backup=1;wipeingui
+/vendor		    ext4	/dev/block/platform/bootdevice/by-name/vendor           flags=display="Vendor";backup=1;wipeingui
+/vendor_image     emmc    /dev/block/platform/bootdevice/by-name/vendor           flags=display="Vendor_Image";backup=1;flashimg=1 
+/data		    ext4	/dev/block/platform/bootdevice/by-name/userdata         flags=encryptable=/dev/block/platform/bootdevice/by-name/metadata
+#
+/vbmeta		    emmc	/dev/block/platform/bootdevice/by-name/vbmeta           flags=display="vbmeta";backup=1;flashimg=1
+/dtbo		    emmc	/dev/block/platform/bootdevice/by-name/dtbo             flags=display="dtbo";backup=1
+/odmdtbo            emmc	/dev/block/platform/bootdevice/by-name/odmdtbo          flags=display="odmdtbo";backup=1
+/scp1		    emmc	/dev/block/platform/bootdevice/by-name/scp1             flags=display="scp1";backup=1
+/scp2		    emmc	/dev/block/platform/bootdevice/by-name/scp2             flags=backup=1;subpartitionof=/scp1         
+/sec1           emmc    /dev/block/platform/bootdevice/by-name/sec1              flags=display="sec1";backup=1
+/gz1            emmc    /dev/block/platform/bootdevice/by-name/gz1               flags=display="gz1";backup=1
+/gz2            emmc    /dev/block/platform/bootdevice/by-name/gz2               flags=display="gz2";backup=1
+/otp            emmc    /dev/block/platform/bootdevice/by-name/otp               flags=display="otp";backup=1
+/devinfo          emmc     /dev/block/platform/bootdevice/by-name/devinfo      flags=display="devinfo";backup=1;flashimg=1
+/flashinfo      emmc    /dev/block/platform/bootdevice/by-name/flashinfo         flags=display="flashinfo";backup=1
+
+/external_sd	auto	/dev/block/mmcblk1p1	/dev/block/mmcblk1              flags=display="External SDcard";storage;wipeingui;removable;backup=0
+/usbotg		    auto    /dev/block/sda1		    /dev/block/sda                  flags=display="Usb-Otg";storage;removable;backup=0

+ 37 - 0
recovery/root/init.recovery.mt6765.rc

@@ -0,0 +1,37 @@
+on init
+    mkdir /config
+    mount configfs none /config
+    mkdir /config/usb_gadget/g1 0770 shell shell
+    write /config/usb_gadget/g1/idVendor 0x18d1
+    write /config/usb_gadget/g1/idProduct 0xd001
+    mkdir /config/usb_gadget/g1/strings/0x409 0770
+    write /config/usb_gadget/g1/strings/0x409/serialnumber ${ro.serialno}
+    write /config/usb_gadget/g1/strings/0x409/manufacturer ${ro.product.manufacturer}
+    write /config/usb_gadget/g1/strings/0x409/product ${ro.product.model}
+    mkdir /config/usb_gadget/g1/configs/b.1 0777 shell shell
+    mkdir /config/usb_gadget/g1/configs/b.1/strings/0x409 0770 shell shell
+    mkdir /config/usb_gadget/g1/functions/ffs.adb
+    setprop sys.usb.ffs.aio_compat 1
+
+on property:ro.debuggable=0
+    # distinguish USB shoulde connect or not, i.e. CDP vs SDP
+    write /sys/class/udc/musb-hdrc/device/cmode 2
+    # set charging free due to it wait for USB activation
+    start adbd
+
+on property:sys.usb.ffs.ready=1
+    write /config/usb_gadget/g1/UDC "none"
+    rm /config/usb_gadget/g1/configs/b.1/f1
+    rm /config/usb_gadget/g1/configs/b.1/f2
+    write /config/usb_gadget/g1/configs/b.1/strings/0x409/configuration "adb"
+    write /config/usb_gadget/g1/idVendor 0x18d1
+    write /config/usb_gadget/g1/idProduct 0xd001
+    symlink /config/usb_gadget/g1/functions/ffs.adb /config/usb_gadget/g1/configs/b.1/f1
+    write /config/usb_gadget/g1/UDC "musb-hdrc"
+
+on post-fs
+    # Support A/B feature for emmc boot region
+    symlink /dev/block/sda /dev/block/mmcblk0boot0
+    symlink /dev/block/sdb /dev/block/mmcblk0boot1
+    symlink /dev/block/mmcblk0boot0 /dev/block/platform/bootdevice/by-name/preloader_a
+    symlink /dev/block/mmcblk0boot1 /dev/block/platform/bootdevice/by-name/preloader_b

+ 135 - 0
recovery/root/init.recovery.usb.rc

@@ -0,0 +1,135 @@
+# Copyright (c) 2011-2016, 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 BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "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 boot
+    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 configfs none /config
+    mkdir /config/usb_gadget/g1 0770 shell shell
+    mkdir /config/usb_gadget/g1/strings/0x409 0770 shell shell
+    write /config/usb_gadget/g1/bcdUSB 0x0200
+    write /config/usb_gadget/g1/os_desc/use 1
+    write /config/usb_gadget/g1/strings/0x409/serialnumber ${ro.serialno}
+    write /config/usb_gadget/g1/strings/0x409/manufacturer ${ro.product.manufacturer}
+    write /config/usb_gadget/g1/strings/0x409/product ${ro.product.model}
+    mkdir /config/usb_gadget/g1/functions/mass_storage.0
+    mkdir /config/usb_gadget/g1/functions/mtp.gs0
+    mkdir /config/usb_gadget/g1/functions/ptp.gs1
+    mkdir /config/usb_gadget/g1/functions/accessory.gs2
+    mkdir /config/usb_gadget/g1/functions/audio_source.gs3
+    mkdir /config/usb_gadget/g1/functions/midi.gs5
+    mkdir /config/usb_gadget/g1/functions/ffs.adb
+    mkdir /config/usb_gadget/g1/functions/diag.diag
+    mkdir /config/usb_gadget/g1/functions/diag.diag_mdm
+    mkdir /config/usb_gadget/g1/functions/cser.dun.0
+    mkdir /config/usb_gadget/g1/functions/cser.nmea.1
+    mkdir /config/usb_gadget/g1/functions/cser.dun.2
+    mkdir /config/usb_gadget/g1/functions/gsi.rmnet
+    mkdir /config/usb_gadget/g1/functions/gsi.rndis
+    mkdir /config/usb_gadget/g1/functions/gsi.dpl
+    mkdir /config/usb_gadget/g1/functions/qdss.qdss
+    mkdir /config/usb_gadget/g1/functions/qdss.qdss_mdm
+    mkdir /config/usb_gadget/g1/functions/rndis_bam.rndis
+    mkdir /config/usb_gadget/g1/functions/rmnet_bam.rmnet
+    mkdir /config/usb_gadget/g1/functions/rmnet_bam.dpl
+    mkdir /config/usb_gadget/g1/functions/ncm.0
+    mkdir /config/usb_gadget/g1/functions/ccid.ccid
+    mkdir /config/usb_gadget/g1/functions/uac2.0
+    mkdir /config/usb_gadget/g1/functions/uvc.0
+    mkdir /config/usb_gadget/g1/configs/b.1 0770 shell shell
+    mkdir /config/usb_gadget/g1/configs/b.1/strings/0x409 0770 shell shell
+    write /config/usb_gadget/g1/os_desc/b_vendor_code 0x1
+    write /config/usb_gadget/g1/os_desc/qw_sign "MSFT100"
+    symlink /config/usb_gadget/g1/configs/b.1 /config/usb_gadget/g1/os_desc/b.1
+    mount functionfs adb /dev/usb-ffs/adb uid=2000,gid=2000
+    write /sys/class/android_usb/android0/f_ffs/aliases adb
+
+on property:sys.usb.config=none
+    write /config/usb_gadget/g1/UDC "none"
+    stop adbd
+    setprop sys.usb.ffs.ready 0
+    setprop sys.usb.ffs.mtp.ready 0
+    write /config/usb_gadget/g1/bDeviceClass 0
+    write /config/usb_gadget/g1/bDeviceSubClass 0
+    write /config/usb_gadget/g1/bDeviceProtocol 0
+    rm /config/usb_gadget/g1/configs/b.1/f1
+    rm /config/usb_gadget/g1/configs/b.1/f2
+    rm /config/usb_gadget/g1/configs/b.1/f3
+    rm /config/usb_gadget/g1/configs/b.1/f4
+    rm /config/usb_gadget/g1/configs/b.1/f5
+    rmdir /config/usb_gadget/g1/functions/rndis.gs4
+    setprop sys.usb.state ${sys.usb.config}
+
+on property:sys.usb.config=adb
+    start adbd
+
+on property:sys.usb.ffs.ready=1 && property:sys.usb.config=adb
+    write /config/usb_gadget/g1/configs/b.1/strings/0x409/configuration "adb"
+    rm /config/usb_gadget/g1/configs/b.1/f1
+    rm /config/usb_gadget/g1/configs/b.1/f2
+    rm /config/usb_gadget/g1/configs/b.1/f3
+    rm /config/usb_gadget/g1/configs/b.1/f4
+    rm /config/usb_gadget/g1/configs/b.1/f5
+    write /config/usb_gadget/g1/idVendor 0x18d1
+    write /config/usb_gadget/g1/idProduct 0x4ee7
+    symlink /config/usb_gadget/g1/functions/ffs.adb /config/usb_gadget/g1/configs/b.1/f1
+    write /config/usb_gadget/g1/UDC ${sys.usb.controller}
+    setprop sys.usb.state ${sys.usb.config}
+
+on property:sys.usb.config=mtp
+    write /config/usb_gadget/g1/configs/b.1/strings/0x409/configuration "mtp"
+    rm /config/usb_gadget/g1/configs/b.1/f1
+    rm /config/usb_gadget/g1/configs/b.1/f2
+    rm /config/usb_gadget/g1/configs/b.1/f3
+    rm /config/usb_gadget/g1/configs/b.1/f4
+    rm /config/usb_gadget/g1/configs/b.1/f5
+    write /config/usb_gadget/g1/idVendor 0x2717
+    write /config/usb_gadget/g1/idProduct 0xff60
+    symlink /config/usb_gadget/g1/functions/mtp.gs0 /config/usb_gadget/g1/configs/b.1/f1
+    write /config/usb_gadget/g1/UDC ${sys.usb.controller}
+    setprop sys.usb.state ${sys.usb.config}
+
+on property:sys.usb.config=mtp,adb
+    start adbd
+
+on property:sys.usb.ffs.ready=1 && property:sys.usb.config=mtp,adb
+    write /config/usb_gadget/g1/configs/b.1/strings/0x409/configuration "mtp_adb"
+    rm /config/usb_gadget/g1/configs/b.1/f1
+    rm /config/usb_gadget/g1/configs/b.1/f2
+    rm /config/usb_gadget/g1/configs/b.1/f3
+    rm /config/usb_gadget/g1/configs/b.1/f4
+    rm /config/usb_gadget/g1/configs/b.1/f5
+    write /config/usb_gadget/g1/idVendor 0x2717
+    write /config/usb_gadget/g1/idProduct 0xff68
+    symlink /config/usb_gadget/g1/functions/mtp.gs0 /config/usb_gadget/g1/configs/b.1/f1
+    symlink /config/usb_gadget/g1/functions/ffs.adb /config/usb_gadget/g1/configs/b.1/f2
+    write /config/usb_gadget/g1/UDC ${sys.usb.controller}
+    setprop sys.usb.state ${sys.usb.config}
+
+on property:ro.boot.usbcontroller=*
+    setprop sys.usb.controller ${ro.boot.usbcontroller}

二進制
recovery/root/sbin/mke2fs_static


+ 5 - 0
system.prop

@@ -0,0 +1,5 @@
+ro.product.brand=BLU
+ro.product.name=G9
+ro.product.device=G0130WW
+ro.build.product=G0130WW
+ro.treble.enabled=true

+ 3 - 0
vendorsetup.sh

@@ -0,0 +1,3 @@
+for var in eng user userdebug; do
+add_lunch_combo omni_G0130WW-$var
+done