diff --git a/Android.mk b/Android.mk index 25042d5..dd4f3ee 100755 --- a/Android.mk +++ b/Android.mk @@ -14,7 +14,7 @@ # limitations under the License. # -ifneq ($(filter a32x, $(TARGET_DEVICE)),) +ifneq ($(filter a32, $(TARGET_DEVICE)),) LOCAL_PATH := $(call my-dir) diff --git a/AndroidProducts.mk b/AndroidProducts.mk index 70cc108..ee8f99e 100755 --- a/AndroidProducts.mk +++ b/AndroidProducts.mk @@ -15,6 +15,6 @@ # PRODUCT_MAKEFILES := \ - $(LOCAL_DIR)/twrp_a32x.mk + $(LOCAL_DIR)/twrp_a32.mk -COMMON_LUNCH_CHOICES := twrp_a32x-eng +COMMON_LUNCH_CHOICES := twrp_a32-eng diff --git a/BoardConfig.mk b/BoardConfig.mk index 837677e..94b79ab 100755 --- a/BoardConfig.mk +++ b/BoardConfig.mk @@ -1,5 +1,6 @@ # # Copyright (C) 2020 The Android Open Source Project +# Credit to afaneh92 @ GitHub # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. @@ -14,10 +15,15 @@ # limitations under the License. # +DEVICE_PATH := device/samsung/a32 + +# For building with minimal manifest +ALLOW_MISSING_DEPENDENCIES := true + # Bootloader BOARD_VENDOR := samsung -TARGET_SOC := k6853v1_64_titan -TARGET_BOOTLOADER_BOARD_NAME := mt6853 +TARGET_SOC := k6769tv1_64_titan +TARGET_BOOTLOADER_BOARD_NAME := mt6768 TARGET_NO_BOOTLOADER := true TARGET_NO_RADIOIMAGE := true TARGET_USES_UEFI := true @@ -50,13 +56,13 @@ TARGET_USERIMAGES_USE_EXT4 := true TARGET_USERIMAGES_USE_F2FS := true # Platform -TARGET_BOARD_PLATFORM := mt6853 +TARGET_BOARD_PLATFORM := mt6768 TARGET_BOARD_PLATFORM_GPU := mali-g57 # Kernel -TARGET_PREBUILT_KERNEL := device/samsung/a32x/prebuilt/Image.gz -TARGET_PREBUILT_DTB := device/samsung/a32x/prebuilt/dtb -BOARD_PREBUILT_DTBOIMAGE := device/samsung/a32x/prebuilt/recoverydtbo +TARGET_PREBUILT_KERNEL := $(DEVICE_PATH)/prebuilt/Image.gz +TARGET_PREBUILT_DTB := $(DEVICE_PATH)/prebuilt/dtb +BOARD_PREBUILT_DTBOIMAGE := $(DEVICE_PATH)/prebuilt/dtbo.img #BOARD_INCLUDE_DTB_IN_BOOTIMG := true BOARD_INCLUDE_RECOVERY_DTBO := true TARGET_KERNEL_ARCH := arm64 @@ -72,11 +78,19 @@ BOARD_RAMDISK_OFFSET := 0x07c08000 BOARD_KERNEL_SECOND_OFFSET := 0xbff88000 BOARD_KERNEL_TAGS_OFFSET := 0x0bc08000 BOARD_DTB_OFFSET := 0x0bc08000 -BOARD_MKBOOTIMG_ARGS := --kernel_offset $(BOARD_KERNEL_OFFSET) --ramdisk_offset $(BOARD_RAMDISK_OFFSET) -BOARD_MKBOOTIMG_ARGS += --tags_offset $(BOARD_KERNEL_TAGS_OFFSET) --second_offset $(BOARD_KERNEL_SECOND_OFFSET) -BOARD_MKBOOTIMG_ARGS += --header_version $(BOARD_BOOT_HEADER_VERSION) --pagesize $(BOARD_KERNEL_PAGESIZE) --board "SRPTK17B004" -BOARD_MKBOOTIMG_ARGS += --dtb $(TARGET_PREBUILT_DTB) --dtb_offset $(BOARD_DTB_OFFSET) -BOARD_CUSTOM_BOOTIMG_MK := device/samsung/a32x/bootimg.mk +BOARD_MKBOOTIMG_ARGS := \ + --kernel_offset $(BOARD_KERNEL_OFFSET) \ + --ramdisk_offset $(BOARD_RAMDISK_OFFSET) \ + --tags_offset $(BOARD_KERNEL_TAGS_OFFSET) \ + --second_offset $(BOARD_KERNEL_SECOND_OFFSET) \ + --header_version $(BOARD_BOOT_HEADER_VERSION) \ + --pagesize $(BOARD_KERNEL_PAGESIZE) \ + --board "SRPUB24A003" \ + --dtb $(TARGET_PREBUILT_DTB) \ + --dtb_offset $(BOARD_DTB_OFFSET) \ + --recovery_dtbo $(BOARD_PREBUILT_DTBOIMAGE) + +BOARD_CUSTOM_BOOTIMG_MK := $(DEVICE_PATH)/bootimg.mk # Recovery BOARD_HAS_LARGE_FILESYSTEM := true @@ -122,7 +136,7 @@ TW_INCLUDE_FBE_METADATA_DECRYPT := false BOARD_USES_METADATA_PARTITION := true # TWRP specific build flags -TW_DEVICE_VERSION := 4_afaneh92 +#TW_DEVICE_VERSION := 4_afaneh92 TW_THEME := portrait_hdpi RECOVERY_SDCARD_ON_DATA := true TARGET_RECOVERY_PIXEL_FORMAT := "RGBX_8888" diff --git a/README.md b/README.md index 1328853..f776a77 100755 --- a/README.md +++ b/README.md @@ -1,13 +1,13 @@ -## Recovery Device Tree for the Samsung Galaxy A32 5G (MTK) +## Recovery Device Tree for the Samsung Galaxy A32 4G (MTK) ## How-to compile it: ```sh export ALLOW_MISSING_DEPENDENCIES=true . build/envsetup.sh -lunch twrp_a32x-eng +lunch twrp_a32-eng make recoveryimage ``` -Kernel source: -https://github.com/mohammad92/android_kernel_samsung_a32x +Based on: +https://github.com/mohammad92/android_device_samsung_a32x diff --git a/bootimg.mk b/bootimg.mk index a61f5ae..59e5ab6 100755 --- a/bootimg.mk +++ b/bootimg.mk @@ -1,4 +1,4 @@ -MKBOOTIMG := device/samsung/a32x/mkbootimg +MKBOOTIMG := device/samsung/a32/mkbootimg FLASH_IMAGE_TARGET ?= $(PRODUCT_OUT)/recovery.tar diff --git a/prebuilt/Image.gz b/prebuilt/Image.gz index db99d97..f7043aa 100644 Binary files a/prebuilt/Image.gz and b/prebuilt/Image.gz differ diff --git a/prebuilt/dtb b/prebuilt/dtb index 6db3753..872503e 100644 Binary files a/prebuilt/dtb and b/prebuilt/dtb differ diff --git a/prebuilt/dtbo.img b/prebuilt/dtbo.img new file mode 100644 index 0000000..fb43360 Binary files /dev/null and b/prebuilt/dtbo.img differ diff --git a/prebuilt/recoverydtbo b/prebuilt/recoverydtbo deleted file mode 100644 index 3cab97b..0000000 Binary files a/prebuilt/recoverydtbo and /dev/null differ diff --git a/recovery/root/init.recovery.mt6853.rc b/recovery/root/init.recovery.mt6769t.rc similarity index 100% rename from recovery/root/init.recovery.mt6853.rc rename to recovery/root/init.recovery.mt6769t.rc diff --git a/recovery/root/system/etc/recovery.fstab b/recovery/root/system/etc/recovery.fstab index fc74cdf..0707d6e 100644 --- a/recovery/root/system/etc/recovery.fstab +++ b/recovery/root/system/etc/recovery.fstab @@ -1,65 +1,54 @@ -# Copyright (c) 2013, 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 "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. +# 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 -# -system /system ext4 ro,barrier=1 wait,logical,first_stage_mount -vendor /vendor ext4 ro,barrier=1 wait,logical,first_stage_mount -product /product ext4 ro,barrier=1 wait,logical,first_stage_mount -odm /odm ext4 ro,barrier=1 wait,logical,first_stage_mount +# Currently we dont have e2fsck compiled. So fs check would failed. -/dev/block/platform/bootdevice/by-name/boot /boot emmc defaults recoveryonly -/dev/block/platform/bootdevice/by-name/recovery /recovery emmc defaults recoveryonly -/dev/block/platform/bootdevice/by-name/userdata /data f2fs noatime,nosuid,nodev,discard,usrquota,grpquota,fsync_mode=nobarrier,reserve_root=32768,resgid=5678 wait,length=-16384 -/dev/block/platform/bootdevice/by-name/cache /cache ext4 defaults recoveryonly -/dev/block/platform/bootdevice/by-name/sec_efs /efs ext4 defaults recoveryonly -#/dev/block/platform/bootdevice/by-name/carrier /carrier ext4 defaults recoveryonly -/dev/block/platform/bootdevice/by-name/hidden /preload ext4 defaults recoveryonly -/dev/block/platform/bootdevice/by-name/misc /misc emmc defaults recoveryonly -/dev/block/platform/bootdevice/by-name/metadata /metadata ext4 defaults wait,first_stage_mount -# external SD card -#/dev/block/mmcblk1p1 /sdcard vfat defaults recoveryonly +# +/data ext4 /dev/block/platform/bootdevice/by-name/userdata flags=display="data";fileencryption=ice:aes-256-cts;wrappedkey;keydirectory=/metadata/vold/metadata_encryption;encryptable=footer;backup=1 +/cache ext4 /dev/block/platform/bootdevice/by-name/cache flags=display="cache";wipeingui;wipeduringfactoryreset;backup=1 -# FOTA -/dev/block/platform/bootdevice/by-name/apnhlos /modem emmc defaults recoveryonly -/dev/block/platform/bootdevice/by-name/modem /mdm emmc defaults recoveryonly -/dev/block/platform/bootdevice/by-name/dsp /dsp emmc defaults recoveryonly -/dev/block/platform/bootdevice/by-name/dtbo /dtbo emmc defaults recoveryonly -/dev/block/platform/bootdevice/by-name/md1img /md1img emmc defaults recoveryonly -/dev/block/platform/bootdevice/by-name/spmfw /spmfw emmc defaults recoveryonly -/dev/block/platform/bootdevice/by-name/scp1 /scp1 emmc defaults recoveryonly -/dev/block/platform/bootdevice/by-name/sspm_1 /sspm_1 emmc defaults recoveryonly +/super ext4 /dev/block/platform/bootdevice/by-name/super flags=display="super";backup=1 +/system ext4 /dev/block/platform/bootdevice/by-name/system flags=display="system";backup=1 +/vendor ext4 /dev/block/platform/bootdevice/by-name/vendor flags=display="vendor";backup=1 +/product ext4 /dev/block/platform/bootdevice/by-name/product flags=display="product";backup=1 +/metadata ext4 /dev/block/platform/bootdevice/by-name/md_udc flags=display="metadata";backup=1 -#Auto-generated code by FOTA Portal -/dev/block/platform/bootdevice/by-name/gz1 /gz1 emmc default recoveryonly -/dev/block/platform/bootdevice/by-name/optics /optics ext4 default recoveryonly -/dev/block/platform/bootdevice/by-name/prism /prism ext4 default recoveryonly +/super_image emmc /dev/block/platform/bootdevice/by-name/super flags=display="super_image";backup=1;flashimg=1 +/system_image emmc /dev/block/platform/bootdevice/by-name/system flags=display="system_image";backup=1;flashimg=1 +/vendor_image emmc /dev/block/platform/bootdevice/by-name/vendor flags=display="vendor_image";backup=1;flashimg=1 +/product_image emmc /dev/block/platform/bootdevice/by-name/product flags=display="product_image";backup=1;flashimg=1 +/metadata_image emmc /dev/block/platform/bootdevice/by-name/md_udc flags=display="metadata_image";backup=1;flashimg=1 + +/cust ext4 /dev/block/platform/bootdevice/by-name/cust flags=display="cust";backup=1 +/boot ext4 /dev/block/platform/bootdevice/by-name/boot flags=display="boot";backup=1 +/recovery ext4 /dev/block/platform/bootdevice/by-name/recovery flags=display="recovery"backup=1 +/dtbo ext4 /dev/block/platform/bootdevice/by-name/dtbo flags=display="dtbo";backup=1 +/vbmeta ext4 /dev/block/platform/bootdevice/by-name/vbmeta flags=display="vbmeta";backup=1 + +/cust_image emmc /dev/block/platform/bootdevice/by-name/cust flags=display="cust_image";backup=1;flashimg=1 +/boot_image emmc /dev/block/platform/bootdevice/by-name/boot flags=display="boot_image";backup=1;flashimg=1 +/recovery_image emmc /dev/block/platform/bootdevice/by-name/recovery flags=display="recovery_image"backup=1;flashimg=1 +/dtbo_image emmc /dev/block/platform/bootdevice/by-name/dtbo flags=display="dtbo_image";backup=1;flashimg=1 +/vbmeta_image emmc /dev/block/platform/bootdevice/by-name/vbmeta flags=display="vbmeta_image";backup=1;flashimg=1 + + +/bootloader emmc /dev/block/platform/bootdevice/by-name/lk flags=display="lk";backup=1 +/bootloader2 emmc /dev/block/platform/bootdevice/by-name/lk2 flags=display="lk2";backup=1 +/protect_f emmc /dev/block/platform/bootdevice/by-name/protect1 flags=display="protect1";backup=1 +/protect_s emmc /dev/block/platform/bootdevice/by-name/protect2 flags=display="protect2";backup=1 +/nvdata emmc /dev/block/platform/bootdevice/by-name/nvdata flags=display="nvdata";backup=1 +/nvcfg emmc /dev/block/platform/bootdevice/by-name/nvcfg flags=display="nvcfg";backup=1 +/persist emmc /dev/block/platform/bootdevice/by-name/persist flags=display="persist";backup=1 +/nvram emmc /dev/block/platform/bootdevice/by-name/nvram flags=display="nvram";backup=1 +/proinfo emmc /dev/block/platform/bootdevice/by-name/proinfo flags=display="proinfo";backup=1 +/logo emmc /dev/block/platform/bootdevice/by-name/logo flags=display="logo";backup=1 +/tee1 emmc /dev/block/platform/bootdevice/by-name/tee1 flags=display="tee1";backup=1 +/tee2 emmc /dev/block/platform/bootdevice/by-name/tee2 flags=display="tee2";backup=1 +/para emmc /dev/block/platform/bootdevice/by-name/para flags=display="para";backup=1 +/misc emmc /dev/block/platform/bootdevice/by-name/misc flags=display="misc";backup=1 +/persistent emmc /dev/block/platform/bootdevice/by-name/frp flags=display="frp";backup=1 + +/external_sd vfat /dev/block/mmcblk1p1 /dev/block/mmcblk1 flags=display="external_sd";storage;wipeingui;removable;fsflags="utf8" +/usb-otg vfat /dev/block/sda1 /dev/block/sda flags=display="usb-otg";storage;wipeingui;removable;fsflags="utf8" -#Auto-generated code by FOTA Portal -/dev/block/platform/bootdevice/by-name/cam_vpu1 /cam_vpu1 emmc default recoveryonly -/dev/block/platform/bootdevice/by-name/cam_vpu2 /cam_vpu2 emmc default recoveryonly -/dev/block/platform/bootdevice/by-name/cam_vpu3 /cam_vpu3 emmc default recoveryonly -/dev/block/platform/bootdevice/by-name/pi_img /pi_img emmc default recoveryonly diff --git a/recovery/root/system/etc/twrp.flags b/recovery/root/system/etc/twrp.flags.bak similarity index 100% rename from recovery/root/system/etc/twrp.flags rename to recovery/root/system/etc/twrp.flags.bak diff --git a/system.prop b/system.prop index 3d1a222..2507b99 100644 --- a/system.prop +++ b/system.prop @@ -1,6 +1,6 @@ -ro.display.series=Samsung A32 5G -ro.product.board=k6853v1_64_titan -ro.board.platform=mt6853 +ro.display.series=Samsung A32 4G +ro.product.board=k6769tv1_64_titan +ro.board.platform=mt6768 sys.usb.controller=musb-hdrc ro.boot.dynamic_partitions=true #fbe.metadata.wrappedkey=true diff --git a/twrp_a32x.mk b/twrp_a32.mk similarity index 84% rename from twrp_a32x.mk rename to twrp_a32.mk index ee7d3fe..a10c3c6 100755 --- a/twrp_a32x.mk +++ b/twrp_a32.mk @@ -15,7 +15,7 @@ # # Release name -PRODUCT_RELEASE_NAME := a32x +PRODUCT_RELEASE_NAME := a32 # Inherit from common AOSP config $(call inherit-product, $(SRC_TARGET_DIR)/product/aosp_base.mk) @@ -24,18 +24,18 @@ $(call inherit-product, $(SRC_TARGET_DIR)/product/aosp_base.mk) $(call inherit-product, vendor/twrp/config/common.mk) # Inherit device configuration -$(call inherit-product, device/samsung/a32x/device.mk) +$(call inherit-product, device/samsung/a32/device.mk) # Charger PRODUCT_PACKAGES += \ charger_res_images -PRODUCT_COPY_FILES += $(call find-copy-subdir-files,*,device/samsung/a32x/recovery/root,recovery/root) +PRODUCT_COPY_FILES += $(call find-copy-subdir-files,*,device/samsung/a32/recovery/root,recovery/root) ## Device identifier. This must come after all inclusions -PRODUCT_NAME := twrp_a32x -PRODUCT_DEVICE := a32x -PRODUCT_MODEL := SM-A326U +PRODUCT_NAME := twrp_a32 +PRODUCT_DEVICE := a32 +PRODUCT_MODEL := SM-A325F PRODUCT_BRAND := samsung PRODUCT_MANUFACTURER := samsung PRODUCT_GMS_CLIENTID_BASE := android-samsung