[Q] Htc evo 4g build error ( boot.img too large)!! - General Questions and Answers

I want to compile the kernel from source for the HTC evo 4g (model: supersonic). I downloaded the kernel source from https://github.com/CyanogenMod/htc-kernel-supersonic .
I compiled it successfully getting the zImage.
However, when i try to build the whole tree ,using the previous zImage instead of the prebuilt kernel, i get an error:
out/target/product/supersonic/boot.img total size is 2457600
error: out/target/product/supersonic/boot.img too large (2457600 > [2703360 - 270336])
make: *** [out/target/product/supersonic/boot.img] Error 1
make: *** Deleting file `out/target/product/supersonic/boot.img'
I found that the size of partitions are defined in the file device/htc/supersonic/BoardConfig.mk.
BOARD_BOOTIMAGE_PARTITION_SIZE := 0x00280000
BOARD_RECOVERYIMAGE_PARTITION_SIZE := 0x00500000
BOARD_SYSTEMIMAGE_PARTITION_SIZE := 0x15e00000 # limited so we enforce room to grow
BOARD_USERDATAIMAGE_PARTITION_SIZE := 0x1aba0000
BOARD_FLASH_BLOCK_SIZE := 131072
I dont know how to solve this issue. Please help! :crying:

Related

OpenSSL for android: linking shared libs error

I am trying to compile a simple program with ndk-build that uses functions from the OpenSSL libcrypto.so shared library, but I have some errors:
This is my Android.mk
LOCAL_PATH := $(call my-dir)
include $(CLEAR_VARS)
LOCAL_MODULE := lib-crypto
LOCAL_SRC_FILES := libcrypto.so
include $(PREBUILT_SHARED_LIBRARY)
include $(CLEAR_VARS)
LOCAL_MODULE := tema1
LOCAL_SRC_FILES := tema1.c
LOCAL_SHARED_LIBRARIES := lib-crypto
LOCAL_C_INCLUDES := /home/aleksei/openSSL0.9.8/include
include $(BUILD_EXECUTABLE)
libcrypto.so is the library that I have built for android. I want to make a program using it. Now it gives me this error:
Install : libcrypto.so => libs/armeabi/libcrypto.so
Executable : tema1
./obj/local/armeabi/libcrypto.so: undefined reference to `dladdr'
collect2: ld returned 1 exit status
make: *** [obj/local/armeabi/tema1] Error 1
What am I doing wrong?

[Completed] cyanogenmod 12.1 build error(s) for hydro XTRM c6522n

As the title suggests I'm porting cyanogenmod to my old phone so when I root my hydro wave c6740n...I'll have the source & knowledge to do the same with the hydro wave as well, but back to my problem. I keep getting this error when ever i try to build the recovery.
build/core/tasks/kernel.mk:290: warning: overriding recipe for target '/media/xstar97/Acer/Users/xstar97/Desktop/cm12.1/out/target/product/c6522n/kernel'
build/core/Makefile:46: warning: ignoring old recipe for target '/media/xstar97/Acer/Users/xstar97/Desktop/cm12.1/out/target/product/c6522n/kernel'
Target boot image: /media/xstar97/Acer/Users/xstar97/Desktop/cm12.1/out/target/product/c6522n/boot.img
/media/xstar97/Acer/Users/xstar97/Desktop/cm12.1/out/target/product/c6522n/boot.img maxsize=3514368 blocksize=135168 total=6680576 reserve=270336
error: /media/xstar97/Acer/Users/xstar97/Desktop/cm12.1/out/target/product/c6522n/boot.img too large (6680576 > [3784704 - 270336])
build/core/Makefile:570: recipe for target '/media/xstar97/Acer/Users/xstar97/Desktop/cm12.1/out/target/product/c6522n/boot.img' failed
make: *** [/media/xstar97/Acer/Users/xstar97/Desktop/cm12.1/out/target/product/c6522n/boot.img] Error 1
make: *** Deleting file '/media/xstar97/Acer/Users/xstar97/Desktop/cm12.1/out/target/product/c6522n/boot.img'
#### make failed to build some targets (02:55 (mm:ss)) ####
it keeps stating its too large & i'm just stuck at this point..
also im trying to build recovery NOT the boot.img which I don't why it states boot.img instead of recovery.
BOARD_BOOTIMAGE_PARTITION_SIZE := 0x00380000
BOARD_RECOVERYIMAGE_PARTITION_SIZE := 0x00480000
BOARD_SYSTEMIMAGE_PARTITION_SIZE := 0x08c60000
BOARD_USERDATAIMAGE_PARTITION_SIZE := 0x105c0000
BOARD_FLASH_BLOCK_SIZE := 131072
aslo I am having trouble with the board config as well
BOARD_KERNEL_CMDLINE := console=ttyHSL0,115200,n8 no_console_suspend=1 androidboot.hardware=qcom user_debug=31 msm_rtb.filter=0x3F ehci-hcd.park=3 vmalloc=312M
BOARD_KERNEL_BASE := 0x
BOARD_KERNEL_PAGESIZE := 2048
I don't know what the kernel base would be in the mess below...
Kernel size 5820152
Kernel address 0x80208000
Ramdisk size 336324
Ramdisk address 0x82200000
Secondary size 0
Secondary address 0x81100000
Kernel tags address 0x80200100
Flash page size 2048
if you need more info to help just ask...I'm truly new to all this.
update-still not working, but...
Target boot image: /media/xstar97/Acer/Users/xstar97/Desktop/cm12.1/out/target/product/c6522n/boot.img
/media/xstar97/Acer/Users/xstar97/Desktop/cm12.1/out/target/product/c6522n/boot.img maxsize=10040448 blocksize=135168 total=6676480 reserve=270336
Made boot image: /media/xstar97/Acer/Users/xstar97/Desktop/cm12.1/out/target/product/c6522n/boot.img
target StaticExecutable: recovery (/media/xstar97/Acer/Users/xstar97/Desktop/cm12.1/out/target/product/c6522n/obj/EXECUTABLES/recovery_intermediates/LINKED/recovery)
target Symbolic: recovery (/media/xstar97/Acer/Users/xstar97/Desktop/cm12.1/out/target/product/c6522n/symbols/system/bin/recovery)
target Strip: recovery (/media/xstar97/Acer/Users/xstar97/Desktop/cm12.1/out/target/product/c6522n/obj/EXECUTABLES/recovery_intermediates/recovery)
----- Making recovery image ------
Copying baseline ramdisk...
Modifying ramdisk contents...
cp: cannot stat ‘/media/xstar97/Acer/Users/xstar97/Desktop/cm12.1/out/target/product/c6522n/root/init.recovery.*.rc’: No such file or directory
build/core/Makefile:944: recipe for target '/media/xstar97/Acer/Users/xstar97/Desktop/cm12.1/out/target/product/c6522n/ramdisk-recovery.img' failed
make: [/media/xstar97/Acer/Users/xstar97/Desktop/cm12.1/out/target/product/c6522n/ramdisk-recovery.img] Error 1 (ignored)
/media/xstar97/Acer/Users/xstar97/Desktop/cm12.1/out/target/product/c6522n/recovery.img maxsize=8177664 blocksize=135168 total=9250816 reserve=270336
error: /media/xstar97/Acer/Users/xstar97/Desktop/cm12.1/out/target/product/c6522n/recovery.img too large (9250816 > [8448000 - 270336])
build/core/Makefile:978: recipe for target '/media/xstar97/Acer/Users/xstar97/Desktop/cm12.1/out/target/product/c6522n/recovery.img' failed
make: *** [/media/xstar97/Acer/Users/xstar97/Desktop/cm12.1/out/target/product/c6522n/recovery.img] Error 1
make: *** Deleting file '/media/xstar97/Acer/Users/xstar97/Desktop/cm12.1/out/target/product/c6522n/recovery.img'
#### make failed to build some targets (11:50 (mm:ss)) ####
build error!
I tried many things now, but I can't seem to get the recovery maxsize right during build...
im going to change the recovery size from 8000000 to 8177664
update 2-not working
----- Making recovery image ------
Copying baseline ramdisk...
Modifying ramdisk contents...
cp: cannot stat ‘/media/xstar97/Acer/Users/xstar97/Desktop/cm12.1/out/target/product/c6522n/root/init.recovery.*.rc’: No such file or directory
build/core/Makefile:944: recipe for target '/media/xstar97/Acer/Users/xstar97/Desktop/cm12.1/out/target/product/c6522n/ramdisk-recovery.img' failed
make: [/media/xstar97/Acer/Users/xstar97/Desktop/cm12.1/out/target/product/c6522n/ramdisk-recovery.img] Error 1 (ignored)
/media/xstar97/Acer/Users/xstar97/Desktop/cm12.1/out/target/product/c6522n/recovery.img maxsize=8162880 blocksize=135168 total=9250816 reserve=270336
error: /media/xstar97/Acer/Users/xstar97/Desktop/cm12.1/out/target/product/c6522n/recovery.img too large (9250816 > [8433216 - 270336])
build/core/Makefile:978: recipe for target '/media/xstar97/Acer/Users/xstar97/Desktop/cm12.1/out/target/product/c6522n/recovery.img' failed
make: *** [/media/xstar97/Acer/Users/xstar97/Desktop/cm12.1/out/target/product/c6522n/recovery.img] Error 1
make: *** Deleting file '/media/xstar97/Acer/Users/xstar97/Desktop/cm12.1/out/target/product/c6522n/recovery.img'
#### make failed to build some targets (10:29 (mm:ss)) ####
I'm honestly stuck trying to build the recovery
almost working
It's still saying that it's too large & i finally noticed i been missing a file called init.recovery.*.rc
I gotten boardconfig.mk all set up and correct
BOARD_KERNEL_CMDLINE := console=ttyHSL0,115200,n8 no_console_suspend=1 androidboot.hardware=qcom user_debug=31 msm_rtb.filter=0x3F ehci-hcd.park=3 vmalloc=312M
BOARD_KERNEL_BASE := 0x80200000
BOARD_KERNEL_PAGESIZE := 2048
# fix this up by examining /proc/mtd on a running device
BOARD_BOOTIMAGE_PARTITION_SIZE := 10485760
BOARD_RECOVERYIMAGE_PARTITION_SIZE := 8388608
BOARD_SYSTEMIMAGE_PARTITION_SIZE := 674234368
BOARD_USERDATAIMAGE_PARTITION_SIZE := 1073741824
BOARD_FLASH_BLOCK_SIZE := 131072
recovery.fstab
# mount point fstype device [device2]
/boot mtd /dev/block/mmcblk0p7
/cache yaffs2 /dev/block/mmcblk0p15
/data yaffs2 /dev/block/mmcblk0p13
/misc mtd /dev/block/mmcblk0p17
/recovery mtd /dev/block/mmcblk0p18
/sdcard vfat /dev/block/mmcblk0p1 /dev/block/mmcblk0
/system yaffs2 /dev/block/mmcblk0p12
/sd-ext ext4 /dev/block/mmcblk0p2
do I need to add more?
such as ...0p1 to ..0p37
what else do I need to do?
I give up on cyanogenmod recovery
BUT, I found a perfect substitute for it...PhilZ recovery.img for hydro xtrm c6522 varients
I tested it & works like a charm, but the only downside is that you have to constantly connect your PC and boot(NOT FLASH) into PhilZ recovery.
so I made all steps easier by creating script(s) & provide the PhilZ recovery & stock recovery.
1. please open a terminal within the folder with all the files
2. you can either run & read the help.sh or just run setup.sh (basically the same info, but setup.sh starts the process)
to run the scripts please type "./setup.sh" without ""
the following info in the script will tell you what to do from then on.
NOTE:
DO NOT FLASH PhilZ recovery because it's NOT a standalone recovery.
click the link below to download from my dropbox, if by any chance that dropbox decides to stop allowing you to download, just PM & I WILL send you a new link personally.
philz.zip
You can check the scripts/edit them to your hearts content, but there's nothing in them that will harm your PC, device, or your mom..
also the credits
the one & only dev who built this recovery for us! is hroark13

Maguro / Galaxy Nexus CM 12.1 build

Hi,
I've been playing a bit with CM's build as I expect to retire my Galaxy Nexus from its duty soon. The build went fine if not for the following build error:
Code:
target Executable: pvrsrvinit (/home/user/Development/Cyanogenmod/android/system/out/target/product/p5100/obj/EXECUTABLES/pvrsrvinit_intermediates/LINKED/pvrsrvinit)
/home/user/Development/Cyanogenmod/android/system/prebuilts/gcc/linux-x86/arm/arm-linux-androideabi-4.8/bin/../lib/gcc/arm-linux-androideabi/4.8/../../../../arm-linux-androideabi/bin/ld: error: cannot find -lsrv_init_SGX540_120
/home/user/Development/Cyanogenmod/android/system/prebuilts/gcc/linux-x86/arm/arm-linux-androideabi-4.8/bin/../lib/gcc/arm-linux-androideabi/4.8/../../../../arm-linux-androideabi/bin/ld: error: cannot find -lsrv_um_SGX540_120
hardware/ti/omap4/pvrsrvinit/pvrsrvinit.c:8: error: undefined reference to 'SrvInit'
collect2: error: ld returned 1 exit status
make: *** [/home/user/Development/Cyanogenmod/android/system/out/target/product/p5100/obj/EXECUTABLES/pvrsrvinit_intermediates/LINKED/pvrsrvinit] Error 1
make: *** Waiting for unfinished jobs....
make: Leaving directory `/home/user/Development/Cyanogenmod/android/system'
Other threads[0] reference the following fix, namely adding
Code:
<project name="DonkeyCoyote/proprietary_vendor_samsung" path="vendor/samsung" remote="github" revision="android-5.0" />
in
Code:
.repo/local_manifests/roomservice.xml
Unfortunately this trick didn't work. Upon closer inspection, the required libraries are part of the `omap4-common` subdirectory which is *not* sourced during the build[1]. I was nevertheless able to fix the build with the following change
Code:
% repo diff hardware/ti/omap4/
project hardware/ti/omap4/
diff --git a/pvrsrvinit/Android.mk b/pvrsrvinit/Android.mk
index 97d27c4..cdc6441 100644
--- a/pvrsrvinit/Android.mk
+++ b/pvrsrvinit/Android.mk
@@ -9,9 +9,9 @@ LOCAL_LDLIBS := -lsrv_init_SGX544_112 -lsrv_um_SGX544_112
pvrsrvinit: $(TARGET_OUT_VENDOR)/lib/libsrv_init_SGX544_112.so
pvrsrvinit: $(TARGET_OUT_VENDOR)/lib/libsrv_um_SGX544_112.so
else
-LOCAL_LDLIBS := -lsrv_init_SGX540_120 -lsrv_um_SGX540_120
-pvrsrvinit: $(TARGET_OUT_VENDOR)/lib/libsrv_init_SGX540_120.so
-pvrsrvinit: $(TARGET_OUT_VENDOR)/lib/libsrv_um_SGX540_120.so
+LOCAL_LDLIBS := -lsrv_init -lsrv_um
+pvrsrvinit: $(TARGET_OUT_VENDOR)/lib/libsrv_init.so
+pvrsrvinit: $(TARGET_OUT_VENDOR)/lib/libsrv_um.so
endif
LOCAL_MODULE_PATH := $(TARGET_OUT_EXECUTABLES)
LOCAL_MODULE := pvrsrvinit
Which means that the libraries are definitively extracted by `cd device/samsung/maguro/ && ./extract-files.sh` however, the libraries are merely named differently.
Has anybody encountered such a failure ?
ps: on another side note. how are you suppose to extract all the files from the stock 4.2.1 upstream build ? `system/bin/fRom`, `system/vendor/lib/mediadrm/libwvdrmengine.so` and `system/vendor/lib/libfrsdk.so` are missing from the image...
[0]: http://forum.xda-developers.com/showpost.php?p=59115913&postcount=1372
[1]: confirmed by `inotifywait -m vendor/samsung/omap4-common/*mk`
Btw, I looked at the content of a CM11 nightly[0], there is no trace of `libsrv_init_SGX540_120.so` or `libsrv_um_SGX540_120.so` either...
[0]: cm-11-20151213-NIGHTLY-maguro.zip

boot.img too big error while building TWRP from source

I have a big issue, I'm trying to build TWRP for a non-supported device and I get this error :
Code:
/home/matt/Bureau/TWRP/out/target/product/ac50dis/boot.img maxsize=-28630272 blocksize=18165312 total=7467008 reserve=36330624
error: /home/matt/Bureau/TWRP/out/target/product/ac50dis/boot.img too large (7467008 > [7700352 - 36330624])
build/core/Makefile:570 : la recette pour la cible « /home/matt/Bureau/TWRP/out/target/product/ac50dis/boot.img » a échouée
make: *** [/home/matt/Bureau/TWRP/out/target/product/ac50dis/boot.img] Erreur 1
make: *** Suppression du fichier « /home/matt/Bureau/TWRP/out/target/product/ac50dis/boot.img »
make: *** Attente des tâches non terminées....
#### make failed to build some targets (31 seconds) ####
My BoardConfig.mk :
Code:
USE_CAMERA_STUB := true
# inherit from the proprietary version
-include vendor/archos/ac50dis/BoardConfigVendor.mk
TARGET_ARCH := arm64
TARGET_ARCH_VARIANT := armv8-a
TARGET_CPU_VARIANT := generic
TARGET_CPU_ABI := arm64-v8a
TARGET_2ND_ARCH := arm
TARGET_2ND_ARCH_VARIANT := armv7-a-neon
TARGET_2ND_CPU_VARIANT := cortex-a7
TARGET_2ND_CPU_ABI := armeabi-v7a
TARGET_2ND_CPU_ABI2 := armeabi
TARGET_NO_BOOTLOADER := true
TARGET_BOARD_PLATFORM := mt6753
TARGET_CPU_SMP := true
ARCH_ARM_HAVE_TLS_REGISTER := true
TARGET_BOOTLOADER_BOARD_NAME := ac50dis
BOARD_KERNEL_CMDLINE := bootopt=64S3,32N2,64N2
BOARD_KERNEL_BASE := 0x40078000
BOARD_KERNEL_PAGESIZE := 2048
# fix this up by examining /proc/mtd on a running device
BOARD_BOOTIMAGE_PARTITION_SIZE := 7467008
BOARD_RECOVERYIMAGE_PARTITION_SIZE := 17616077
BOARD_SYSTEMIMAGE_PARTITION_SIZE := 1978662912
BOARD_USERDATAIMAGE_PARTITION_SIZE := 14066017894
BOARD_FLASH_BLOCK_SIZE := 17616077
TARGET_PREBUILT_KERNEL := device/archos/ac50dis/kernel
BOARD_HAS_NO_SELECT_BUTTON := true
TW_THEME := portrait_hdpi
The "BOARD_BOOTIMAGE_PARTITION_SIZE := 7467008" line isn't with the true value of the boot partition size which is usually 17616077 but even if I set this one, it doesn't work at all.
I really neet help so if you have just a clue, tell me .
PS : I'm a 16 years old french guy so if their are some mistakes, don't blame me
TikiMatt said:
I have a big issue, I'm trying to build TWRP for a non-supported device and I get this error:...
Click to expand...
Click to collapse
Your best bet is to post this question within the following thread.
https://forum.xda-developers.com/showthread.php?t=3404024
Good Luck!
~~~~~~~~~~~~~~~
I DO NOT PROVIDE SUPPORT VIA PM UNLESS ASKED/REQUESTED BY MYSELF.
PLEASE KEEP IT IN THE THREADS WHERE EVERYONE CAN SHARE

How to Build Basic TWRP for a Android Device Android 9+

How to Build Basic TWRP for a Android Device Android 9+​​Note​
This is a basic method to build twrp. If twrp has bugs you have to fix it with your self according to your device
In samsung devices decryption/encryption cannot be fix easily and it need to modify kernel to fix mtp. most of time common bugs are mtp and decryption you need can find more info by referring more device trees
Click to expand...
Click to collapse
Prepare Environmet​
Create a github account​
Create a new empty repo​
Then log into gitpod using github account​
Open new workspace in gitpod,​
Select your new repo and selcect class as large​
​Make a device tree using twrpdtgen​
git clone https://github.com/twrpdtgen/twrpdtgen​
cd twrpdtgen​
sudo apt install cpio​
pip3 install twrpdtgen​
drag and drop the stock recovery.img to twrpdtgen folder​
python3 -m twrpdtgen <path to image>​
you will get twrp device tree at the out/manufature/code_name (eg: samsung/m01q)​
then copy manufature folder into root directory (workspace/name_of_your_github_repo)​
​
Install repo and packages​
sudo apt update​
sudo apt install rsync​
​​
repo init --depth=1 --no-repo-verify -u https://github.com/minimal-manifest-twrp/platform_manifest_twrp_aosp.git -b twrp-12.1 -g default,-mips,-darwin,-notdefault​
repo sync -c --no-clone-bundle --no-tags --optimized-fetch --prune --force-sync -j8​
Place device tree​
​move manufature folder (created device tree) to device (EG: workspace/name_of_your_github_repo/device/samsung)​
Modify Device Tree​
open device.mk and add these​​Add support to fastbootd (skip the if your device dosnt have super.img)​Change the value according to shipped android os​
if android 10 = 29​if android 11 = 30​if android 12 = 31​if android 12.1 = 32​if android 13 = 33​
PRODUCT_PACKAGES += \
[email protected] \
fastbootd
PRODUCT_USE_DYNAMIC_PARTITIONS := true
PRODUCT_SHIPPING_API_LEVEL := 29
​Add device code name​​TARGET_OTA_ASSERT_DEVICE := m01q
TARGET_COPY_OUT_VENDOR := vendor
​TWRP FLAGS​​TARGET_RECOVERY_PIXEL_FORMAT := "RGBX_8888"
# TWRP specific build flags
TW_THEME := portrait_hdpi
RECOVERY_SDCARD_ON_DATA := true
TW_EXCLUDE_DEFAULT_USB_INIT := true
TW_EXTRA_LANGUAGES := true
TW_INCLUDE_NTFS_3G := true
TW_USE_TOOLBOX := true
TW_INCLUDE_RESETPROP := true
TW_INPUT_BLACKLIST := "hbtp_vm"
TW_BRIGHTNESS_PATH := "/sys/class/backlight/panel0-backlight/brightness"
TW_DEFAULT_BRIGHTNESS := 1200
TARGET_USES_MKE2FS := true
TW_NO_LEGACY_PROPS := true
TW_USE_NEW_MINADBD := true
TW_NO_BIND_SYSTEM := true
TW_NO_SCREEN_BLANK := true
TW_EXCLUDE_APEX := true
TW_FRAMERATE := 60
​TWRP Name​​TW_DEVICE_VERSION := smiley​​Enable notch​
TW_Y_OFFSET := 70
TW_H_OFFSET := -70
Reboot to odin for samsung​​TW_HAS_DOWNLOAD_MODE := true​​Enable Logcat​​TWRP_INCLUDE_LOGCAT := true[/HEADING]
[HEADING=2]TARGET_USES_LOGD := true​​Add fingerprint​​#Properties
TW_OVERRIDE_SYSTEM_PROPS := \
"ro.build.fingerprint=ro.system.build.fingerprint;ro.build.version.incremental"
Modify fstab​
Open recovery.fstab​
add this to end of line to enable partition backup and flash​
;backup=1;flashimg
add those to enable sdcard and otg​
# Removable storage
/external_sd vfat /dev/block/mmcblk1p1 /dev/block/mmcblk1 flags=storage;wipeingui;removable
/usb-otg auto /dev/block/sda1 /dev/block/sda flags=display="USB-OTG";storage;wipeingui;removable
Open BoradConfig,mk and modify values according to your device (skip if you dont have super.img)​
# Dynamic Partition
BOARD_SUPER_PARTITION_SIZE := 3945791488
BOARD_SUPER_PARTITION_GROUPS := android_dynamic_partitions
BOARD_ANDROID_DYNAMIC_PARTITIONS_SIZE := 3945791488
BOARD_ANDROID_DYNAMIC_PARTITIONS_PARTITION_LIST := system vendor product odm
Open Omni_device_code.mk​
$(call inherit-product, vendor/omni/config/common.mk)
rename omni to twrp​
$(call inherit-product, vendor/twrp/config/common.mk)
Build TWRP​
. build/envstup.sh
lunch (select your device-eng)
make recoveryimage
smiley9000 said:
How to Build Basic TWRP for a Android Device Android 9+​​Note​
Prepare Environmet​
Create a github account​
Create a new empty repo​
Then log into gitpod using github account​
Open new workspace in gitpod,​
Select your new repo and selcect class as large​
​Make a device tree using twrpdtgen​
git clone https://github.com/twrpdtgen/twrpdtgen​
cd twrpdtgen​
sudo apt install cpio​
pip3 install twrpdtgen​
drag and drop the stock recovery.img to twrpdtgen folder​
python3 -m twrpdtgen <path to image>​
you will get twrp device tree at the out/manufature/code_name (eg: samsung/m01q)​
then copy manufature folder into root directory (workspace/name_of_your_github_repo)​
​
Install repo and packages​
sudo apt update​
sudo apt install rsync​
​​
repo init --depth=1 --no-repo-verify -u https://github.com/minimal-manifest-twrp/platform_manifest_twrp_aosp.git -b twrp-12.1 -g default,-mips,-darwin,-notdefault​
repo sync -c --no-clone-bundle --no-tags --optimized-fetch --prune --force-sync -j8​
Place device tree​
​move manufature folder (created device tree) to device (EG: workspace/name_of_your_github_repo/device/samsung)​
Modify Device Tree​
open device.mk and add these​​Add support to fastbootd (skip the if your device dosnt have super.img)​Change the value according to shipped android os​
if android 10 = 29​if android 11 = 30​if android 12 = 31​if android 12.1 = 32​if android 13 = 33​
PRODUCT_PACKAGES += \
[email protected] \
fastbootd
PRODUCT_USE_DYNAMIC_PARTITIONS := true
PRODUCT_SHIPPING_API_LEVEL := 29
​Add device code name​​TARGET_OTA_ASSERT_DEVICE := m01q
TARGET_COPY_OUT_VENDOR := vendor
​TWRP FLAGS​​TARGET_RECOVERY_PIXEL_FORMAT := "RGBX_8888"
# TWRP specific build flags
TW_THEME := portrait_hdpi
RECOVERY_SDCARD_ON_DATA := true
TW_EXCLUDE_DEFAULT_USB_INIT := true
TW_EXTRA_LANGUAGES := true
TW_INCLUDE_NTFS_3G := true
TW_USE_TOOLBOX := true
TW_INCLUDE_RESETPROP := true
TW_INPUT_BLACKLIST := "hbtp_vm"
TW_BRIGHTNESS_PATH := "/sys/class/backlight/panel0-backlight/brightness"
TW_DEFAULT_BRIGHTNESS := 1200
TARGET_USES_MKE2FS := true
TW_NO_LEGACY_PROPS := true
TW_USE_NEW_MINADBD := true
TW_NO_BIND_SYSTEM := true
TW_NO_SCREEN_BLANK := true
TW_EXCLUDE_APEX := true
TW_FRAMERATE := 60
​TWRP Name​​TW_DEVICE_VERSION := smiley​​Enable notch​
TW_Y_OFFSET := 70
TW_H_OFFSET := -70
Reboot to odin for samsung​​TW_HAS_DOWNLOAD_MODE := true​​Enable Logcat​​TWRP_INCLUDE_LOGCAT := true[/HEADING][/HEADING]
[HEADING=2][HEADING=2]TARGET_USES_LOGD := true​​Add fingerprint​​#Properties
TW_OVERRIDE_SYSTEM_PROPS := \
"ro.build.fingerprint=ro.system.build.fingerprint;ro.build.version.incremental"
Modify fstab​
Open recovery.fstab​
add this to end of line to enable partition backup and flash​
;backup=1;flashimg
add those to enable sdcard and otg​
# Removable storage
/external_sd vfat /dev/block/mmcblk1p1 /dev/block/mmcblk1 flags=storage;wipeingui;removable
/usb-otg auto /dev/block/sda1 /dev/block/sda flags=display="USB-OTG";storage;wipeingui;removable
Open BoradConfig,mk and modify values according to your device (skip if you dont have super.img)​
# Dynamic Partition
BOARD_SUPER_PARTITION_SIZE := 3945791488
BOARD_SUPER_PARTITION_GROUPS := android_dynamic_partitions
BOARD_ANDROID_DYNAMIC_PARTITIONS_SIZE := 3945791488
BOARD_ANDROID_DYNAMIC_PARTITIONS_PARTITION_LIST := system vendor product odm
Open Omni_device_code.mk​
$(call inherit-product, vendor/omni/config/common.mk)
rename omni to twrp​
$(call inherit-product, vendor/twrp/config/common.mk)
Build TWRP​
. build/envstup.sh
lunch (select your device-eng)
make recoveryimage
Click to expand...
Click to collapse
After creating a device tree, how does one find the required files that should go into the recovery/root folder to build TWRP
whale0z said:
After creating a device tree, how does one find the required files that should go into the recovery/root folder to build TWRP
Click to expand...
Click to collapse
try to find twrp device tree of similler soc and compare to make most succesfull device tree. but decryption is heavily depend on oem
smiley9000 said:
try to find twrp device tree of similler soc and compare to make most succesfull device tree. but decryption is heavily depend on oem
Click to expand...
Click to collapse
I was able to build for a mediatek device but fastboot boot doesn't seem to work. I was wondering if using fastboot flash would not mess with the normal boot sequence.
whale0z said:
I was able to build for a mediatek device but fastboot boot doesn't seem to work. I was wondering if using fastboot flash would not mess with the normal boot sequence.
Click to expand...
Click to collapse
Some device dosent support fastboot boot for security reasons
smiley9000 said:
How to Build Basic TWRP for a Android Device Android 9+​​Note​
Prepare Environmet​
Create a github account​
Create a new empty repo​
Then log into gitpod using github account​
Open new workspace in gitpod,​
Select your new repo and selcect class as large​
​Make a device tree using twrpdtgen​
git clone https://github.com/twrpdtgen/twrpdtgen​
cd twrpdtgen​
sudo apt install cpio​
pip3 install twrpdtgen​
drag and drop the stock recovery.img to twrpdtgen folder​
python3 -m twrpdtgen <path to image>​
you will get twrp device tree at the out/manufature/code_name (eg: samsung/m01q)​
then copy manufature folder into root directory (workspace/name_of_your_github_repo)​
​
Install repo and packages​
sudo apt update​
sudo apt install rsync​
​​
repo init --depth=1 --no-repo-verify -u https://github.com/minimal-manifest-twrp/platform_manifest_twrp_aosp.git -b twrp-12.1 -g default,-mips,-darwin,-notdefault​
repo sync -c --no-clone-bundle --no-tags --optimized-fetch --prune --force-sync -j8​
Place device tree​
​move manufature folder (created device tree) to device (EG: workspace/name_of_your_github_repo/device/samsung)​
Modify Device Tree​
open device.mk and add these​​Add support to fastbootd (skip the if your device dosnt have super.img)​Change the value according to shipped android os​
if android 10 = 29​if android 11 = 30​if android 12 = 31​if android 12.1 = 32​if android 13 = 33​
PRODUCT_PACKAGES += \
[email protected] \
fastbootd
PRODUCT_USE_DYNAMIC_PARTITIONS := true
PRODUCT_SHIPPING_API_LEVEL := 29
​Add device code name​​TARGET_OTA_ASSERT_DEVICE := m01q
TARGET_COPY_OUT_VENDOR := vendor
​TWRP FLAGS​​TARGET_RECOVERY_PIXEL_FORMAT := "RGBX_8888"
# TWRP specific build flags
TW_THEME := portrait_hdpi
RECOVERY_SDCARD_ON_DATA := true
TW_EXCLUDE_DEFAULT_USB_INIT := true
TW_EXTRA_LANGUAGES := true
TW_INCLUDE_NTFS_3G := true
TW_USE_TOOLBOX := true
TW_INCLUDE_RESETPROP := true
TW_INPUT_BLACKLIST := "hbtp_vm"
TW_BRIGHTNESS_PATH := "/sys/class/backlight/panel0-backlight/brightness"
TW_DEFAULT_BRIGHTNESS := 1200
TARGET_USES_MKE2FS := true
TW_NO_LEGACY_PROPS := true
TW_USE_NEW_MINADBD := true
TW_NO_BIND_SYSTEM := true
TW_NO_SCREEN_BLANK := true
TW_EXCLUDE_APEX := true
TW_FRAMERATE := 60
​TWRP Name​​TW_DEVICE_VERSION := smiley​​Enable notch​
TW_Y_OFFSET := 70
TW_H_OFFSET := -70
Reboot to odin for samsung​​TW_HAS_DOWNLOAD_MODE := true​​Enable Logcat​​TWRP_INCLUDE_LOGCAT := true[/HEADING][/HEADING][/HEADING][/HEADING][/HEADING]
[HEADING=2][HEADING=2][HEADING=2][HEADING=2][HEADING=2]TARGET_USES_LOGD := true​​Add fingerprint​​#Properties
TW_OVERRIDE_SYSTEM_PROPS := \
"ro.build.fingerprint=ro.system.build.fingerprint;ro.build.version.incremental"
Modify fstab​
Open recovery.fstab​
add this to end of line to enable partition backup and flash​
;backup=1;flashimg
add those to enable sdcard and otg​
# Removable storage
/external_sd vfat /dev/block/mmcblk1p1 /dev/block/mmcblk1 flags=storage;wipeingui;removable
/usb-otg auto /dev/block/sda1 /dev/block/sda flags=display="USB-OTG";storage;wipeingui;removable
Open BoradConfig,mk and modify values according to your device (skip if you dont have super.img)​
# Dynamic Partition
BOARD_SUPER_PARTITION_SIZE := 3945791488
BOARD_SUPER_PARTITION_GROUPS := android_dynamic_partitions
BOARD_ANDROID_DYNAMIC_PARTITIONS_SIZE := 3945791488
BOARD_ANDROID_DYNAMIC_PARTITIONS_PARTITION_LIST := system vendor product odm
Open Omni_device_code.mk​
$(call inherit-product, vendor/omni/config/common.mk)
rename omni to twrp​
$(call inherit-product, vendor/twrp/config/common.mk)
Build TWRP​
. build/envstup.sh
lunch (select your device-eng)
make recoveryimage
Click to expand...
Click to collapse
hiya
after enter this command :
" repo sync -c --no-clone-bundle --no-tags --optimized-fetch --prune --force-sync -j8 "​i got this error:
Usage: repo sync [<project>...]
main.py: error: option -j: invalid integer value: '8\u200b'
i think its about java , but java works fine.
================================================================================
gitpod /workspace/Nokia-5.3-twrp-device-tree (main) $ lunch
You're building on Linux
Lunch menu... pick a combo:
1. aosp_arm-eng
2. aosp_arm64-eng
3. aosp_x86-eng
4. aosp_x86_64-eng
5. omni_CAP_sprout-eng
6. omni_CAP_sprout-user
7. omni_CAP_sprout-userdebug
Which would you like? [aosp_arm-eng] 5
In file included from build/make/core/config.mk:313:
In file included from build/make/core/envsetup.mk:312:
In file included from build/make/target/product/telephony_vendor.mk:24:
device/hmd/CAP_sprout/device.mk:24: error: PRODUCT_STATIC_BOOT_CONTROL_HAL is obsolete. Use shared library module instead. See https://android.googlesource.com/platform/build/+/master/Changes.md#PRODUCT_STATIC_BOOT_CONTROL_HAL.
16:01:34 dumpvars failed with: exit status 1
Device CAP_sprout not found. Attempting to retrieve device repository from TeamWin Github (http://github.com/TeamWin).
Repository for CAP_sprout not found in the TeamWin Github repository list.
If this is in error, you may need to manually add it to your .repo/local_manifests/roomservice.xml
In file included from build/make/core/config.mk:313:
In file included from build/make/core/envsetup.mk:312:
In file included from build/make/target/product/telephony_vendor.mk:24:
device/hmd/CAP_sprout/device.mk:24: error: PRODUCT_STATIC_BOOT_CONTROL_HAL is obsolete. Use shared library module instead. See https://android.googlesource.com/platform/build/+/master/Changes.md#PRODUCT_STATIC_BOOT_CONTROL_HAL.
16:01:35 dumpvars failed with: exit status 1
In file included from build/make/core/config.mk:313:
In file included from build/make/core/envsetup.mk:312:
In file included from build/make/target/product/telephony_vendor.mk:24:
device/hmd/CAP_sprout/device.mk:24: error: PRODUCT_STATIC_BOOT_CONTROL_HAL is obsolete. Use shared library module instead. See https://android.googlesource.com/platform/build/+/master/Changes.md#PRODUCT_STATIC_BOOT_CONTROL_HAL.
16:01:35 dumpvars failed with: exit status 1
** Don't have a product spec for: 'omni_CAP_sprout'
** Do you have the right repo manifest?
========================================================================
new error:
device/hmd/CAP_sprout/Android.mk:13: error: cannot assign to readonly variable: PRODUCT_PACKAGES
16:15:14 ckati failed with: exit status 1
how can i fix it??
PRODUCT_PACKAGES += \
[email protected] \
fastbootd
MEYSAMKIA said:
hiya
after enter this command :
" repo sync -c --no-clone-bundle --no-tags --optimized-fetch --prune --force-sync -j8 "​i got this error:
Usage: repo sync [<project>...]
main.py: error: option -j: invalid integer value: '8\u200b'
i think its about java , but java works fine.
================================================================================
gitpod /workspace/Nokia-5.3-twrp-device-tree (main) $ lunch
You're building on Linux
Lunch menu... pick a combo:
1. aosp_arm-eng
2. aosp_arm64-eng
3. aosp_x86-eng
4. aosp_x86_64-eng
5. omni_CAP_sprout-eng
6. omni_CAP_sprout-user
7. omni_CAP_sprout-userdebug
Which would you like? [aosp_arm-eng] 5
In file included from build/make/core/config.mk:313:
In file included from build/make/core/envsetup.mk:312:
In file included from build/make/target/product/telephony_vendor.mk:24:
device/hmd/CAP_sprout/device.mk:24: error: PRODUCT_STATIC_BOOT_CONTROL_HAL is obsolete. Use shared library module instead. See https://android.googlesource.com/platform/build/+/master/Changes.md#PRODUCT_STATIC_BOOT_CONTROL_HAL.
16:01:34 dumpvars failed with: exit status 1
Device CAP_sprout not found. Attempting to retrieve device repository from TeamWin Github (http://github.com/TeamWin).
Repository for CAP_sprout not found in the TeamWin Github repository list.
If this is in error, you may need to manually add it to your .repo/local_manifests/roomservice.xml
In file included from build/make/core/config.mk:313:
In file included from build/make/core/envsetup.mk:312:
In file included from build/make/target/product/telephony_vendor.mk:24:
device/hmd/CAP_sprout/device.mk:24: error: PRODUCT_STATIC_BOOT_CONTROL_HAL is obsolete. Use shared library module instead. See https://android.googlesource.com/platform/build/+/master/Changes.md#PRODUCT_STATIC_BOOT_CONTROL_HAL.
16:01:35 dumpvars failed with: exit status 1
In file included from build/make/core/config.mk:313:
In file included from build/make/core/envsetup.mk:312:
In file included from build/make/target/product/telephony_vendor.mk:24:
device/hmd/CAP_sprout/device.mk:24: error: PRODUCT_STATIC_BOOT_CONTROL_HAL is obsolete. Use shared library module instead. See https://android.googlesource.com/platform/build/+/master/Changes.md#PRODUCT_STATIC_BOOT_CONTROL_HAL.
16:01:35 dumpvars failed with: exit status 1
** Don't have a product spec for: 'omni_CAP_sprout'
** Do you have the right repo manifest?
========================================================================
new error:
device/hmd/CAP_sprout/Android.mk:13: error: cannot assign to readonly variable: PRODUCT_PACKAGES
16:15:14 ckati failed with: exit status 1
how can i fix it??
PRODUCT_PACKAGES += \
[email protected] \
fastbootd
Click to expand...
Click to collapse
Contact in telegram
@samsung_galaxy_m01_a01_m11_a11

Categories

Resources