yashsingh1/xdaforums huggingface dataset:
[Android Software Development] NepoRood:
Some Tips/Tricks...

Being a Windows user most of my life, I've adapted (and picked up from others) some stuff to Linux, it saves a lot of typing in a terminal :p

1)

Right Click, Create New Folder

Just as quick as the "mkdir" command, but more Windowsy (<-- I made a new word) and you see immediate results

2)

Right Click, Open In Terminal

Click your way through folders, when you get where you want to be, simply right click on an open space, and choose open in terminal. No need to cd ~/all/the/folder/names/to/your/device

Works in the "out" directory too, when pushing your new recovery to the device. No need to type path to recovery, as you're already there ;)

3)

Drag and Drop a Bash Script

On your desktop, create a new file, name it "build_recovery", set permissions to make it exacuteable, then use this example inside the file:

#!/usr/bin/env bash

make clean

. build/envsetup.sh

lunch cm_X10-eng

mka recoveryimage

Simply drop it on your terminal window and hit enter :good: (can also be used to "mka bacon")

4)

Clone Directly into Folder

Using "Tip 2", go to empty folder (folder must be empty), open your terminal then put a . (<-- that's a dot) at the end of your clone URL, example:

path: /nepo/android/cm12.1/device/TabletExpress/X10
# Open terminal and type/paste:
git clone https://github.com/neporood/device_TabletExpress_X10.git .

This will clone everything from the repo into the empty folder, no need to download and change names

5)

Use a Local Manifest

A great guide, full of information, can be found here

NOTE: if using one of the "minimal" manifests in the OP, there's no need for a local manifest

6)

Ramdisk Customization

Sometimes when compiling TWRP, you will need some custom and/or stock recovery files in the ramdisk, such as: init.rc, twrp.fstab, and/or some kernel modules (ko files), just to name a few. This is easily done by creating a "recovery/root" directory in your device folder, everything in "root" will be added when you compile.

Example:

path: /nepo/android/cm12.1/device/TabletExpress/X10/recovery/root/etc/twrp.fstab

When you compile, the twrp.fstab file will be inside the "etc" folder of your ramdisk :cool:

Hope this helps other newbies like myself,

Nepo
[Android Software Development] Hacker432:
Good addition, thanks :)
[Android Software Development] Pavlex4:
I am trying to make recoveryimage for multirom.I have problem TW_THEME is not valid: https://postimg.org/image/m33wfg6nb/
[Android Software Development] Hacker432:
[MENTION=6049290]Pavlex4[/MENTION] can you give me source links?
[Android Software Development] Pavlex4:
Source for what?
[Android Software Development] Hacker432:
Your device what else?
[Android Software Development] Pavlex4:
https://github.com/MSM8226-Samsung/android_device_samsung_s3ve3g

https://github.com/MSM8226-Samsung/android_kernel_samsung_s3ve3g/tree/cm-13.0

https://github.com/TheMuppets/proprietary_vendor_samsung/tree/cm-13.0/s3ve3g

https://github.com/CyanogenMod/android_device_samsung_qcom-common

https://github.com/MSM8226-Samsung/android_device_samsung_msm8226-common
[Android Software Development] Hacker432:
Try use this value in Boardconfig

Because you're device tree is not adapted for TWRP

Where are TWRP's flags?

Where is the twrp.fstab? TWRP uses its own fstab format

Also, regarding Multirom, I don't see the device name, are you sure you did again source/blabla lunch(enter) then device number?

NOTICE: https://github.com/TeamWin/android_device_samsung_s3ve3g/blob/android-5.1

This could help you a lot
[Android Software Development] Pavlex4:
I have twrp flags inside boardconfig.

I added now twrp.fstab inside recovery folder.

Do I need to change something inside boardconfig?
[Android Software Development] Hacker432:
The line I suggested regarding Recovery Partition

Try that value instead of the size
[Android Software Development] Pavlex4:
I cannot access site!!!
[Android Software Development] M.A.P:
Here it is:https://pastebin.com/WDvEpWi2
[Android Software Development] kirito9:
............
[Android Software Development] M.A.P:
I'm getting this error when I did that: "fatal: bad object 6bac0a9fedc711a7dfacd6865ec4923dd332182b"
[Android Software Development] M.A.P:
This time I used the original device tree with sepolicy folder but this time there is no error regarding sepolicy but there is an error regarding healthd. Here is the pastebin: https://pastebin.com/XxhiYJ5J
[Android Software Development] M.A.P:
I successfully compiled twrp using the device tree by ahmed hady by removing se policy but my phone just reboots and reboots but doesn't boot into recovery.
[Android Software Development] kirito9:
I'll make a tree for you.

---------- Post added at 02:31 PM ---------- Previous post was at 02:30 PM ----------

It tells you what to do... Read the second part of the message.

---------- Post added at 02:32 PM ---------- Previous post was at 02:31 PM ----------

Easiest way if you're gonna continue using the current twrp. Copy all the files from the old backup to the new one or whichever you want yo restore.

Build a twrp next time and you won't run into this problem.
[Android Software Development] robterza:
It is a pity. All works 100% less than for the wrong folder name. Sure they are no tools to decompily "recovery.img" and fix this wrong folder name? :(
[Android Software Development] kirito9:
Try using carliv image kitchen and unpacking the recovery and changing the names you see in the default.prop of the recovery with the one you want it to be detected as. This might mean unpacking both images.
[Android Software Development] M.A.P:
Thanks man. What information of my device I should provide?
[Android Software Development] kirito9:
Stock recovery.img and boot.img and dumchar_info. Get your dumchar_info by running the following command.

adb shell

cat /proc/dumchar_info

Copy and paste to a text file and attach it to XDA.
[Android Software Development] DiamondJohn:
...delete... forgot to lunch. Different error now.:o

====================

After sorting through the messages and basically copying missing files froom my ROM source, I got excited because it started to do something. But eventually failed:(. It doesn't say what is obvious to me, what to do next. Does the following give any clues? or will I need the full log?

[COLOR="dimgray"]...snip...[/COLOR]
INSTALL drivers/video/backlight/lcd.ko
INSTALL net/ipv4/tcp_westwood.ko
INSTALL net/wireless/cfg80211.ko
DEPMOD 3.0.101-gb262fbb
Warning: you may need to install module-init-tools
See http://www.codemonkey.org.uk/docs/post-halloween-2.6.txt
make: Leaving directory `/home/ubuntu/android/twrp_lineage/kernel/motorola/msm8960-common'
[ 94% 4771/5046] target thumb C++: libguitwrp <= bootable/recovery/gui/gui.cpp
In file included from bootable/recovery/gui/gui.cpp:46:
In file included from bootable/recovery/gui/objects.hpp:34:
bootable/recovery/gui/resources.hpp:61:31: warning: 'this' pointer cannot be null in well-defined C++ code; pointer may be assumed to always convert to true [-Wundefined-bool-conversion]
void* GetResource() { return this ? mFont : NULL; }
^~~~ ~
[COLOR="DimGray"]...snip...[/COLOR]

bootable/recovery/gui/resources.hpp:102:41: warning: 'this' pointer cannot be null in well-defined C++ code; pointer may be assumed to always convert to true [-Wundefined-bool-conversion]
int GetHeight() { return gr_get_height(this ? GetResource() : NULL); }
^~~~ ~
9 warnings generated.
ninja: build stopped: subcommand failed.
make: *** [ninja_wrapper] Error 1
make: Leaving directory `/home/ubuntu/android/twrp_lineage'

[COLOR="Red"]#### make failed to build some targets (08:41 (mm:ss)) ####[/COLOR]

On a side note, how long (roughly or relatively to a ROM) does it take to build TWRP?
[Android Software Development] M.A.P:
recovery and boot images are attached.

Here is the dumchar info

Part_Name	Size	StartAddr	Type	MapTo	Region

preloader 0x0000000000040000 0x0000000000000000 2 /dev/misc-sd BOOT_1

mbr 0x0000000000080000 0x0000000000000000 2 /dev/block/mmcblk0 USER

ebr1 0x0000000000080000 0x0000000000080000 2 /dev/block/mmcblk0p1 USER

pro_info 0x0000000000300000 0x0000000000100000 2 /dev/block/mmcblk0 USER

nvram 0x0000000000500000 0x0000000000400000 2 /dev/block/mmcblk0 USER

protect_f 0x0000000000a00000 0x0000000000900000 2 /dev/block/mmcblk0p2 USER

protect_s 0x0000000000a00000 0x0000000001300000 2 /dev/block/mmcblk0p3 USER

seccfg 0x0000000000040000 0x0000000001d00000 2 /dev/block/mmcblk0 USER

uboot 0x0000000000060000 0x0000000001d40000 2 /dev/block/mmcblk0 USER

bootimg 0x0000000000a00000 0x0000000001da0000 2 /dev/block/mmcblk0 USER

recovery 0x0000000000a00000 0x00000000027a0000 2 /dev/block/mmcblk0 USER

sec_ro 0x0000000000600000 0x00000000031a0000 2 /dev/block/mmcblk0p4 USER

misc 0x0000000000080000 0x00000000037a0000 2 /dev/block/mmcblk0 USER

logo 0x0000000000800000 0x0000000003820000 2 /dev/block/mmcblk0 USER

ebr2 0x0000000000080000 0x0000000004020000 2 /dev/block/mmcblk0 USER

cota 0x0000000003200000 0x00000000040a0000 2 /dev/block/mmcblk0p5 USER

expdb 0x0000000000d60000 0x00000000072a0000 2 /dev/block/mmcblk0 USER

android 0x0000000080000000 0x0000000008000000 2 /dev/block/mmcblk0p6 USER

cache 0x000000002c000000 0x0000000088000000 2 /dev/block/mmcblk0p7 USER

usrdata 0x000000011db00000 0x00000000b4000000 2 /dev/block/mmcblk0p8 USER

bmtpool 0x0000000001500000 0x00000000ffff00a8 2 /dev/block/mmcblk0 USER

Part_Name:Partition name you should open;

Size:size of partition

StartAddr:Start Address of partition;

Type:Type of partition(MTD=1,EMMC=2)

MapTo:actual device you operate
[Android Software Development] kirito9:
Here is your device tree ; https://github.com/AndroidMediatekRecoveryDevelopment/android_device_htc_desire_620g

Built with CM11. The recovery is still compiling finished but you can always make it for yourself to test the tree.

If you do not have CM11 just clone into CM12 but you may have to change somethings.
[Android Software Development] M.A.P:
Thanks a lot for the device tree but you added wrong res into .mk files mine is 720x1280 and portrait_hdpi, you mentioned 400x800 and portrait_mdpi, I can edit it but just wanted to mention it.
[Android Software Development] kirito9:
My bad, I'll update it.
[Android Software Development] M.A.P:
No problem at all. You made a whole device tree for my device. Thanks a lot.

---------- Post added at 06:45 PM ---------- Previous post was at 06:12 PM ----------

Thanks a lot man. I thought that your compiled recovery might boot but it didn't:(. It just keeps rebooting and tries to boot into recovery but doesn't, just reboots. The same problem I faced with my compiled recovery too.
[Android Software Development] kirito9:
Have you ever tried porting a recovery? Do they boot?
[Android Software Development] M.A.P:
CWM based recoveries work excellent but if I port twrp it boots but touch doesn't work. Even right now I'm using Philz recovery. Carliv and cwm works too but liked philz so using it. I like twrp but not available so I use philz.
[Android Software Development] kirito9:
Ahh, so why did you try building twrp in the first place (the omni tree only allows twrp builds)?

I'll make a ctr/cwm build. It could be something wrong with the paths to the fstab, hence the bootloop.
[Android Software Development] M.A.P:
I tried building twrp first because thats the only one which is not working when I ported it.

I think that should answer the bootloop. I got ported versions of cwm, ctr and philz by the way. You can have a look at them for troubleshooting if needed.
[Android Software Development] kirito9:
But if the touch doesn't work then are you going to use an OTG cable with USB mouse?
[Android Software Development] M.A.P:
I can but it is a workaround and not a fix. And also I cannot have a mouse and and otg cable near me all the time.
[Android Software Development] kirito9:
So then, we're not building twrp anymore but those other recoveries you mentioned? The device tree I made is already setup to build those.
[Android Software Development] M.A.P:
I can't understand why because it should atleast boot. If the device tree works for cwm based recoveries why it is not working for twrp. Yeah I noticed that recovery variant for carliv and cwm are #ed and I just need to remove that and need to # recovery variant twrp. I'm wondering why it doesn't work as Ahmed hady built twrp for 816g using that tree and my device is very similar to that. If I need to port roms from 816g to my device I only need to edit boot.img and build.prop(changing product names thats it, works without changing too).
[Android Software Development] kirito9:
I don't have any omni sources to try Ahmed's tree but I'm guessing it should work with only little editing. Try building again from his omni tree only changing the resolution and kernel.
[Android Software Development] M.A.P:
Ahmed hady tree is for cm. There are both 12.1 and cm 13.0 trees. Even screen res is same.
[Android Software Development] kirito9:
Did you share his tree before? I have CM12 & 13 source, maybe I can build.
[Android Software Development] DiamondJohn:
I am trying to compile TWRP from lineage sources. I have gotten to the point where it is now failing on the below, and was hopping maybe someone here knows how / what I need to do to fix it.

...snip...
build/core/base_rules.mk:320: warning: ignoring old commands for target `/home/ubuntu/android/twrp_lineage/out/target/product/xt897/system/bin/aplogd'
Starting build with ninja
ninja: Entering directory `.'
ninja: error: '/home/ubuntu/android/twrp_lineage/out/host/linux-x86/obj/STATIC_LIBRARIES/libexpat_intermediates/export_includes', needed by '/home/ubuntu/android/twrp_lineage/out/host/linux-x86/obj/EXECUTABLES/aapt_intermediates/import_includes', missing and no known rule to make it
make: *** [ninja_wrapper] Error 1
make: Leaving directory `/home/ubuntu/android/twrp_lineage'

[COLOR="Red"]#### make failed to build some targets (18 seconds) ####[/COLOR]

It appears so close...
[Android Software Development] M.A.P:
Try adding those to lines in boardconfig.mk. I mean write command to make that particular directory and in next line write the command that links both directories. I did that once. Can't remember the commands but are linux terminal commands. Don't forget to use $ symbol before writing command.

---------- Post added at 11:48 AM ---------- Previous post was at 11:44 AM ----------

Here is the link for is tree in github: https://github.com/Ahmed-Hady/android_device_htc_htc816g There are both cm 12.1 and cm 13 branches. You'll be surprised that even block sizes are same even though 816g is having 16gb memory whereas 620g is only having 8. Mount points are same too. Vendor files are same too. His tree should work for me with few edits like kernel and rc files.
[Android Software Development] DiamondJohn:
I tried adding the following to the top of the BoardConfig.mak, but it didn't work.

$( mkdir -p /home/ubuntu/android/twrp_lineage/out/host/linux-x86/obj/STATIC_LIBRARIES/libexpat_intermediates/export_include )
$( mkdir -p /home/ubuntu/android/twrp_lineage/out/host/linux-x86/obj/EXECUTABLES/aapt_intermediates/import_includes )

Is that what you meant?

its now asking for what I guess is the compiled file it would place in that directory

'/home/ubuntu/android/twrp_lineage/out/host/linux-x86/obj/STATIC_LIBRARIES/libexpat_intermediates/libexpat.a

I had no idea what you meant by "linking" the directories. Were you suggesting a symlink?
[Android Software Development] M.A.P:
Yep symlink them. make this directory : /home/ubuntu/android/twrp_lineage/out/host/linux-x86/obj/STATIC_LIBRARIES/libexpat_intermediates/export_includes and symlink it with /home/ubuntu/android/twrp_lineage/out/host/linux-x86/obj/EXECUTABLES/aapt_intermediates/import_includes
[Android Software Development] DiamondJohn:
I added the following lines to the board config,

$( mkdir -p /home/ubuntu/android/twrp_lineage/out/host/linux-x86/obj/STATIC_LIBRARIES/libexpat_intermediates )
$( mkdir -p /home/ubuntu/android/twrp_lineage/out/host/linux-x86/obj/EXECUTABLES/aapt_intermediates/import_includes )
$( ln -s /home/ubuntu/android/twrp_lineage/out/host/linux-x86/obj/EXECUTABLES/aapt_intermediates/import_includes /home/ubuntu/android/twrp_lineage/out/host/linux-x86/obj/STATIC_LIBRARIES/libexpat_intermediates/export_includes )

but I still get the following

ninja: error: '/home/ubuntu/android/twrp_lineage/out/host/linux-x86/obj/STATIC_LIBRARIES/libexpat_intermediates/libexpat.a', needed by '/home/ubuntu/android/twrp_lineage/out/host/linux-x86/obj/EXECUTABLES/aapt_intermediates/aapt', missing and no known rule to make it

I also tried executing the commands before running brunch, and it still behaved the same. also, the source directory is empty. So I don't see how it would help.

If I remove the directories and symlink and simply rely on the make file commands (as above). The directories and symlink don't get created, and I am back to the missing directory error.

Actually, so, the make commands added didn't help (so I guess they are ineffective and wrong is that the correct syntax?), but manually running before hand just takes it one step further, but no cigar.
[Android Software Development] M.A.P:
No need to make this directory: /home/ubuntu/android/twrp_lineage/out/host/linux-x86/obj/EXECUTABLES/aapt_intermediates/import_includes

as it is already there. The other directory is required by this one and that is directory is missing so just make that other directory and then symlink.
[Android Software Development] M.A.P:
What tree are you using? Sometimes the problem might be with device tree so try another tree if possible.
[Android Software Development] DiamondJohn:
I am using the xt897 device from Lineage. ie http://github.com/minimal-manifest-twrp/platform_manifest_twrp_lineageos.git (I think) I also had to copy over some device specific files over from my ROM building directories, when the build failed because of something missing.
[Android Software Development] M.A.P:
Sometimes this happens due to minimal sources but with full device tree. Try using minimal device tree or download full source and use full device tree.
[Android Software Development] aburezk:
About 30-40 GB
[Android Software Development] adifbbk1:
Is there any better lightweight alternative than ubuntu?(Installer is 1gb, more ram usage)

---------- Post added at 02:32 PM ---------- Previous post was at 02:30 PM ----------

Who will download 30-40 gb for compiling twrp into 5-10mb lol?:laugh::laugh::laugh:
[Android Software Development] aburezk:
Use BBQlinux it's 2.8GB but it has everything for Android development and minimal source is about 5 GB
[Android Software Development] sai2698:
i want to make twrp for my redmi note 4

i just did like this using the tutorial

repo init -u git://github.com/minimal-manifest-twrp/platform_manifest_twrp_omni.git -b twrp-7.1

repo sync -j2

after that .......

/twrp/device/xiaomi/mido in this i copied device tree

/twrp/kernel/xiaomi/msm8593 in this i copied kernel source

/twrp/vendor/xiaomi/mido in this i copied vendor source

#errors i got

****when i use lunch command***

Your device can't be found in device sources..

Traceback (most recent call last):

File "build/tools/roomservice.py", line 354, in <module>

fetch_dependencies(device)

File "build/tools/roomservice.py", line 303, in fetch_dependencies

raise Exception("ERROR: could not find your device "

Exception: ERROR: could not find your device folder location, bailing out

*****when i use mka recoveryimage command***

Could not find ui.xml for TW_THEME:

Set TARGET_SCREEN_WIDTH and TARGET_SCREEN_HEIGHT to automatically select

an appropriate theme, or set TW_THEME to one of the following:

landscape_hdpi landscape_mdpi portrait_hdpi portrait_mdpi watch_mdpi

****************************************************************************

bootable/recovery/gui/Android.mk:163: *** Theme selection failed; exiting.

build/core/ninja.mk:172: recipe for target '/home/sainaveen/hellotwrp/out/build-aosp_arm64.ninja' failed

make: *** [/home/sainaveen/hellotwrp/out/build-aosp_arm64.ninja] Error 1

please help me anyone ..........:crying::crying:
[Android Software Development] NepoRood:
1) Your device tree is off somewhere, probably a typo or you missed a line in one of the make files (upload to Github, and provide a link)

2) For ui.xml, it tells you what to do...

TW_THEME := portrait_hdpi #most likely what you need
[Android Software Development] M.A.P:
After a long time and some knowledge gained from you and others I finally was able to boot twrp on my device :) Thanks a lot! But still touch didn't work then I've seen a issue in other htc devices and the problem is with the kernel, HTC made a rule to disable touch in recovery:( But I saw the solution fo captain throwback and here it is it is for other htc device but I think the process it same https://xdaforums.com/desire-530/help/root-s-off-desire-530-guide-to-root-t3410015/post70697756#post70697756 Here is the link. Can you please help me as I can't understand that thing please and because of you now I'm able to compile twrp recovery and boot it but failed compiling full rom but still I can compile recoveries:) Here is my device tree https://github.com/Maanush2004/android_device_htc_htc620g-cm12.1

Thanks in advance.
[Android Software Development] DiamondJohn:
I have managed to compile and boot and it all appears to be working using LineageOS Minimal source. However, themeing does not work:confused: is that by any chance because I used "Minimal Source"? I think I used the "minimal source"...
[Android Software Development] NepoRood:
Did you place your theme correctly? The path should be as follows

/data/media/0/TWRP/theme/ui.zip
[Android Software Development] DiamondJohn:
yeah, i put it there, and within TWRP I hit the "reload theme" button. After a while I deleted the folder, since it appeared to be ignored. Then, a few hours later I was doing a backup and I noticed in the log window in red, that it said something like "cannot find theme /data/media/0/TWRP/theme/ui.zip" hmmm it seems that it is trying to load it. I will put it back and actually check/read the log to see if it gives any more hints as to what is wrong.
[Android Software Development] DiamondJohn:
OK, so I read the log and it said my UI theme was the wrong version.But I downloaded a 3.1.1 theme (https://www.androidfilehost.com/?w=...5842c9f3a45db64bf90b0a21fd77daed7b3c72e7eac34). Next I installed the TWRP Theme manager from the Play store. However, when that booted it asked me for my resolution, but did not have the option of 540x960. I chose the next level down (320x480 I think) and installed a theme using the app. I then found the theme in /sdcard/TWRPThemes/downloads (or something like that). I took the zip, copied it to /sdcard/TWRP/theme and renamed it to ui.zip.

In TWRP there was no errors, but the theme was not applied :confused: Do I need to find a 3.1.1 theme that is specifically 540x960? I searched the internet and couldn't find one :(
[Android Software Development] inmist:
Where can I find files?(device tree, vendor file)

I am currently building twrp on Samsung devices. I copied the kernel files, but I can not find any of the following files:

1. device tree /twrp/device/samsung/hero2ltekor/ )

2. vendor files ( /twrp/vendor/samsung/hero2ltekor/ )

Where can I find this? Can it be extracted?
[Android Software Development] DiamondJohn:
For device tree,search github

https://github.com/search?utf8=✓&q=hero2ltekor&type=

and then maybe search for vendor references in that

https://github.com/jcadduono/android_device_samsung_hero2ltekor/search?utf8=✓&q=vendor&type=
[Android Software Development] inmist:
More detailed question.

Yes. I found the device tree via Github and copied it to twrp/device/samsung/hero2lteko/

But I don't know what to do with the vendor files. The link you gave me seems to be device tree files. Do I have to manually create vendor files?
[Android Software Development] NepoRood:
Vendor files are "Device Tree like", however, you really don't need vendor to build TWRP. They are just proprietary files necessary to make a ROM run properly.
[Android Software Development] DiamondJohn:
the second link had the line"vendor/omni/config/common.mk", so I would maybe search github for "vendor_omni" as a starting point