Ver Fonte

first commit

Vinylsmith há 6 meses atrás
commit
07f079ecc2

+ 23 - 0
Android.mk

@@ -0,0 +1,23 @@
+#
+# Copyright (C) 2020 The Android Open Source Project
+# Copyright (C) 2020 The TWRP Open Source Project
+# Copyright (C) 2020 SebaUbuntu's TWRP device tree generator
+#
+# 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.
+#
+
+LOCAL_PATH := $(call my-dir)
+
+ifeq ($(TARGET_DEVICE), WSP_sprout)
+include $(call all-subdir-makefiles,$(LOCAL_PATH))
+endif

+ 20 - 0
AndroidProducts.mk

@@ -0,0 +1,20 @@
+#
+# Copyright (C) 2020 The Android Open Source Project
+# Copyright (C) 2020 The TWRP Open Source Project
+# Copyright (C) 2020 SebaUbuntu's TWRP device tree generator
+#
+# 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)/twrp_WSP_sprout.mk

+ 89 - 0
BoardConfig.mk

@@ -0,0 +1,89 @@
+#
+# Copyright (C) 2020 The Android Open Source Project
+# Copyright (C) 2020 The TWRP Open Source Project
+# Copyright (C) 2020 SebaUbuntu's TWRP device tree generator
+#
+# 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.
+#
+
+DEVICE_PATH := device/hmd/WSP_sprout
+
+# For building with minimal manifest
+ALLOW_MISSING_DEPENDENCIES := true
+
+# Architecture
+TARGET_ARCH := arm64
+TARGET_ARCH_VARIANT := armv8-a
+TARGET_CPU_ABI := arm64-v8a
+TARGET_CPU_ABI2 :=
+TARGET_CPU_VARIANT := generic
+
+TARGET_2ND_ARCH := arm
+TARGET_2ND_ARCH_VARIANT := armv7-a-neon
+TARGET_2ND_CPU_ABI := armeabi-v7a
+TARGET_2ND_CPU_ABI2 := armeabi
+TARGET_2ND_CPU_VARIANT := generic
+TARGET_BOARD_SUFFIX := _64
+TARGET_USES_64_BIT_BINDER := true
+
+# Assert
+TARGET_OTA_ASSERT_DEVICE := WSP_sprout
+
+# File systems
+BOARD_HAS_LARGE_FILESYSTEM := true
+#BOARD_RECOVERYIMAGE_PARTITION_SIZE := 33554432 # This is the maximum known partition size, but it can be higher, so we just omit it
+BOARD_SYSTEMIMAGE_PARTITION_TYPE := ext4
+BOARD_USERDATAIMAGE_FILE_SYSTEM_TYPE := ext4
+BOARD_VENDORIMAGE_FILE_SYSTEM_TYPE := ext4
+TARGET_USERIMAGES_USE_EXT4 := true
+TARGET_USERIMAGES_USE_F2FS := true
+TARGET_COPY_OUT_VENDOR := vendor
+
+# A/B
+AB_OTA_UPDATER := true
+TW_INCLUDE_REPACKTOOLS := true
+
+# Kernel
+BOARD_KERNEL_CMDLINE := bootopt=64S3,32N2,64N2 buildvariant=user
+TARGET_PREBUILT_KERNEL := $(DEVICE_PATH)/prebuilt/Image.gz
+TARGET_PREBUILT_DTB := $(DEVICE_PATH)/prebuilt/dtb.img
+BOARD_BOOTIMG_HEADER_VERSION := 2
+BOARD_KERNEL_BASE := 0x40078000
+BOARD_KERNEL_PAGESIZE := 2048
+BOARD_RAMDISK_OFFSET := 0x11a88000
+BOARD_KERNEL_TAGS_OFFSET := 0x07808000
+BOARD_FLASH_BLOCK_SIZE := 131072 # (BOARD_KERNEL_PAGESIZE * 64)
+BOARD_MKBOOTIMG_ARGS += --ramdisk_offset $(BOARD_RAMDISK_OFFSET)
+BOARD_MKBOOTIMG_ARGS += --tags_offset $(BOARD_KERNEL_TAGS_OFFSET)
+BOARD_MKBOOTIMG_ARGS += --dtb $(TARGET_PREBUILT_DTB)
+BOARD_MKBOOTIMG_ARGS += --header_version $(BOARD_BOOTIMG_HEADER_VERSION)
+BOARD_KERNEL_IMAGE_NAME := Image.gz
+TARGET_KERNEL_ARCH := arm64
+TARGET_KERNEL_HEADER_ARCH := arm64
+TARGET_KERNEL_SOURCE := kernel/hmd/WSP_sprout
+TARGET_KERNEL_CONFIG := WSP_sprout_defconfig
+
+# Platform
+TARGET_BOARD_PLATFORM := mt6761
+
+# Hack: prevent anti rollback
+PLATFORM_SECURITY_PATCH := 2099-12-31
+VENDOR_SECURITY_PATCH := 2099-12-31
+PLATFORM_VERSION := 16.1.0
+
+# TWRP Configuration
+TW_THEME := portrait_hdpi
+TW_EXTRA_LANGUAGES := true
+TW_SCREEN_BLANK_ON_BOOT := true
+TW_INPUT_BLACKLIST := "hbtp_vm"
+TW_USE_TOOLBOX := true

+ 1 - 0
README.md

@@ -0,0 +1 @@
+# WSP_sprout

+ 52 - 0
device.mk

@@ -0,0 +1,52 @@
+#
+# Copyright (C) 2020 The Android Open Source Project
+# Copyright (C) 2020 The TWRP Open Source Project
+# Copyright (C) 2020 SebaUbuntu's TWRP device tree generator
+#
+# 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.
+#
+
+LOCAL_PATH := device/hmd/WSP_sprout
+
+# A/B
+AB_OTA_PARTITIONS += \
+    boot \
+    system \
+    vendor
+
+AB_OTA_POSTINSTALL_CONFIG += \
+    RUN_POSTINSTALL_system=true \
+    POSTINSTALL_PATH_system=system/bin/otapreopt_script \
+    FILESYSTEM_TYPE_system=ext4 \
+    POSTINSTALL_OPTIONAL_system=true
+
+# Boot control HAL
+PRODUCT_PACKAGES += \
+    android.hardware.boot@1.0-impl \
+    android.hardware.boot@1.0-service
+
+PRODUCT_PACKAGES += \
+    bootctrl.mt6761
+
+PRODUCT_STATIC_BOOT_CONTROL_HAL := \
+    bootctrl.mt6761 \
+    libgptutils \
+    libz \
+    libcutils
+
+PRODUCT_PACKAGES += \
+    otapreopt_script \
+    cppreopts.sh \
+    update_engine \
+    update_verifier \
+    update_engine_sideload

BIN
prebuilt/Image.gz


BIN
prebuilt/dtb.img


+ 20 - 0
recovery/root/init.recovery.mt6761.rc

@@ -0,0 +1,20 @@
+on init
+    setprop sys.usb.configfs 1
+    setprop sys.usb.ffs.aio_compat 0
+
+on fs && 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 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
+    symlink /dev/block/mmcblk0boot0 /dev/block/by-name/preloader_a
+    symlink /dev/block/mmcblk0boot1 /dev/block/by-name/preloader_b
+
+    exec u:r:update_engine:s0 root root -- /system/bin/mtk_plpath_utils

+ 6 - 0
recovery/root/system/etc/recovery.fstab

@@ -0,0 +1,6 @@
+/dev/block/platform/bootdevice/by-name/system /system ext4 ro wait,slotselect,avb=vbmeta,first_stage_mount,wipeingui,logical,backup=1
+
+/dev/block/platform/bootdevice/by-name/vendor /vendor ext4 ro wait,slotselect,avb,first_stage_mount,wipeingui,backup=1,flashimg=1
+
+/dev/block/platform/bootdevice/by-name/vbmeta /vbmeta emmc defaults defaults
+

+ 50 - 0
recovery/root/system/etc/twrp.flags

@@ -0,0 +1,50 @@
+# mount point	fstype	   device					device2				flags  
+
+# Slotselect partitions 
+/system             ext4      /dev/block/platform/bootdevice/by-name/system       flags=slotselect;backup=1;display="System"
+/vendor             ext4      /dev/block/platform/bootdevice/by-name/vendor       flags=slotselect;backup=1;display="Vendor"
+/product            ext4      /dev/block/platform/bootdevice/by-name/product      flags=slotselect;backup=1;display="Product"
+/system_image       emmc      /dev/block/platform/bootdevice/by-name/system       flags=backup=1;flashimg=1;display="System Image"
+/vendor_image       emmc      /dev/block/platform/bootdevice/by-name/vendor       flags=backup=1;flashimg=1;display="Vendor Image"
+/product_image      emmc      /dev/block/platform/bootdevice/by-name/product      flags=backup=1;flashimg=1;display="Product Image"
+/vbmeta             emmc      /dev/block/platform/bootdevice/by-name/vbmeta       flags=slotselect;backup=1;flashimg=1;display="VBmeta"
+/boot             	emmc      /dev/block/platform/bootdevice/by-name/boot         flags=slotselect;backup=1;flashimg=1
+/tee          		emmc      /dev/block/platform/bootdevice/by-name/tee          flags=slotselect;backup=1;flashimg=1
+
+/system_a_image     emmc      /dev/block/platform/bootdevice/by-name/system_a     flags=flashimg=1;backup=1
+/system_b_image     emmc      /dev/block/platform/bootdevice/by-name/system_b     flags=flashimg=1;backup=1
+/boot_a           	emmc      /dev/block/platform/bootdevice/by-name/boot_a       flags=backup=1;flashimg=1;wipeingui
+/boot_b           	emmc      /dev/block/platform/bootdevice/by-name/boot_b       flags=backup=1;flashimg=1;wipeingui
+/vendor_a_image     emmc      /dev/block/platform/bootdevice/by-name/vendor_a     flags=flashimg=1;backup=1
+/vendor_b_image     emmc      /dev/block/platform/bootdevice/by-name/vendor_b     flags=flashimg=1;backup=1
+/vbmeta_a           emmc      /dev/block/platform/bootdevice/by-name/vbmeta_a     flags=backup=1;flashimg=1;wipeingui
+/vbmeta_b           emmc      /dev/block/platform/bootdevice/by-name/vbmeta_b     flags=backup=1;flashimg=1;wipeingui
+/tee1          		emmc      /dev/block/platform/bootdevice/by-name/tee1         flags=backup=1;flashimg=1
+/tee2          		emmc      /dev/block/platform/bootdevice/by-name/tee2         flags=backup=1;flashimg=1
+
+/data		  		ext4      /dev/block/platform/bootdevice/by-name/userdata     flags=encryptable=/dev/block/platform/bootdevice/by-name/metadata
+
+/bootloader       	emmc      /dev/block/platform/bootdevice/by-name/lk           flags=display="bootloader";backup=1;flashimg=1;slotselect
+
+
+/nvram            	emmc     /dev/block/platform/bootdevice/by-name/nvram        flags=display="nvram";backup=1;flashimg=1
+/proinfo          	emmc     /dev/block/platform/bootdevice/by-name/proinfo      flags=display="proinfo";backup=1;flashimg=1
+/preloader        	emmc     /dev/block/platform/bootdevice/by-name/preloader  flags=display="preloader";backup=1;flashimg=1;slotselect
+/logo             	emmc     /dev/block/platform/bootdevice/by-name/logo         flags=display="logo";backup=1;flashimg=1
+/tee1             	emmc     /dev/block/platform/bootdevice/by-name/tee         flags=display="trustzone1";backup=1;flashimg=1;slotselect
+/misc             	emmc     /dev/block/platform/bootdevice/by-name/para
+/metadata         	emmc     /dev/block/platform/bootdevice/by-name/metadata
+/persistent       	emmc     /dev/block/platform/bootdevice/by-name/frp
+/protect_f        	ext4     /dev/block/platform/bootdevice/by-name/protect1     flags=display="protect_f";backup=1
+/protect_s        	ext4     /dev/block/platform/bootdevice/by-name/protect2     flags=display="protect_s";backup=1
+/nvdata           	ext4     /dev/block/platform/bootdevice/by-name/nvdata       flags=display="nvdata";backup=1
+/nvcfg            	ext4     /dev/block/platform/bootdevice/by-name/nvcfg        flags=display="nvcfg";backup=1
+/private          	emmc     /dev/block/platform/bootdevice/by-name/private
+/scp              	emmc     /dev/block/platform/bootdevice/by-name/scp          flags=slotselect
+/sec1             	emmc     /dev/block/platform/bootdevice/by-name/sec1
+/seccfg           	emmc     /dev/block/platform/bootdevice/by-name/seccfg
+/sspm             	emmc     /dev/block/platform/bootdevice/by-name/sspm         flags=slotselect
+/spmfw            	emmc     /dev/block/platform/bootdevice/by-name/spmfw        flags=slotselect
+
+/external_sd   		auto     /dev/block/mmcblk1p1  /dev/block/mmcblk1  			 flags=display="External_SDcard";storage;wipeingui;removable;fsflags="utf8" 
+/usb-otg       		auto     /dev/block/sda1      /dev/block/sda         		 flags=display="Usb_Otg";storage;wipeingui;removable;fsflags="utf8"

+ 38 - 0
twrp_WSP_sprout.mk

@@ -0,0 +1,38 @@
+#
+# Copyright (C) 2020 The Android Open Source Project
+# Copyright (C) 2020 The TWRP Open Source Project
+# Copyright (C) 2020 SebaUbuntu's TWRP device tree generator
+#
+# 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.
+#
+
+# Inherit from those products. Most specific first.
+$(call inherit-product, $(SRC_TARGET_DIR)/product/core_64_bit.mk)
+$(call inherit-product-if-exists, $(SRC_TARGET_DIR)/product/embedded.mk)
+$(call inherit-product, $(SRC_TARGET_DIR)/product/full_base_telephony.mk)
+$(call inherit-product, $(SRC_TARGET_DIR)/product/languages_full.mk)
+
+# Inherit from WSP_sprout device
+$(call inherit-product, device/hmd/WSP_sprout/device.mk)
+
+# Inherit some common Omni stuff.
+$(call inherit-product, vendor/twrp/config/common.mk)
+$(call inherit-product, vendor/twrp/config/gsm.mk)
+
+# Device identifier. This must come after all inclusions
+PRODUCT_DEVICE := WSP_sprout
+PRODUCT_NAME := twrp_WSP_sprout
+PRODUCT_BRAND := Nokia
+PRODUCT_MODEL := Nokia 2.2
+PRODUCT_MANUFACTURER := hmd
+PRODUCT_RELEASE_NAME := Nokia Nokia 2.2

+ 20 - 0
vendorsetup.sh

@@ -0,0 +1,20 @@
+#
+# Copyright (C) 2020 The Android Open Source Project
+# Copyright (C) 2020 The TWRP Open Source Project
+# Copyright (C) 2020 SebaUbuntu's TWRP device tree generator
+#
+# 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.
+#
+
+add_lunch_combo twrp_WSP_sprout-userdebug
+add_lunch_combo twrp_WSP_sprout-eng