[GUIDE][DEV][WIP] Compile unofficial CWM Recovery for Tom-Tec 7 excellent. TCC892x - Miscellaneous Android Development

Hello. After reading, reading and more reading i picked one of the most newbe freindly guides on how to make a CWM recovery for a new device.
I my case im going to build CWM recovery for the Tom-Tec 7 excellent.
It hase Android ICS V4.0.3
This guide is alsow to compile cyanogenmod for unsupported device!
I am using Ubuntu 64 bit. (Wy go for less if i dont have to.) But i gues it will work for most linux versions if you got the required packages installend. Even Max OS can be used to build i gues. But thats a bit differant guide..
Step 1:
Install the required packages
Links with info.....
Google’s official guide: http://source.android.com/source/initializing.html
Step 2:
Install java SDK, ADB and?
link adb....
[GUIDE] Lazyman's installation guide to ADB on Ubuntu 10.10 - Now with Ubuntu 11.10: http://forum.xda-developers.com/showthread.php?p=11823740#post11823740
[HOW-TO] Set up SDK/ADB on Ubuntu 11.10 | 32 & 64 bits: http://forum.xda-developers.com/showthread.php?t=1550414
RESERVED SPACE

Step 3:
In you´re ¨home¨ dir make a folder called ICS. (You can give it any name you like.. But i have to start with something right..)
Use the terminal app to cd into ICS folder. (click ¨Dash home¨ icon. from the menu on the left. In the cursor field type perminal to find the app) Just in case you dont know how to cd into the ICS folder. Just type ¨cd ICS¨ in the opend terminal app and you there. (with out the ¨¨)
Step 4:
Now we got to download the Cyanogenmod source files with the terminal app. This can take a very long time. The CWM recovery source comes bundled with the CyanogenMod source.
Pick the version you want to make a recovery for.
I have ICS on my tablet sow im gone use the ICS repo.
Code:
CWM 5 - Gingerbread
repo init -u git://github.com/CyanogenMod/android.git -b gingerbread
CWM 5:
repo init -u git://github.com/CyanogenMod/android.git -b ics
? repo init -u git://github.com/CyanogenMod/android.git -b ics android-4.0.4_r2.1 werkt..
CWM 6 - Jellybean
repo init -u git://github.com/CyanogenMod/android.git -b jellybean
Sow i copy pastle this line in the terminal: ¨repo init -u git://github.com/CyanogenMod/android.git -b ics¨ with out the ¨¨ hit enter.
If asked give a name and email adres. Confirm with Y if its right.
Now type ¨repo sync¨ (with out the ¨¨) in the terminal and hit enter.
Downloading the source will take a very long time.
Step 5:
Now we come to the actuall compiling part. Make sure you have synced the latest source files using the "repo sync" command. Personally i run the ¨repo sync¨ command often to get the newest changes (commits).
Now issue this command :
make -j4 otatools
ore: make otatools
of with log: make otatools 2>&1 | tee tom-tec-OtaTools.log
If it wont work you can try: make CC=gcc CXX=g++ -j4 otatools
If it wont works scroll down to the part about Fix compile problems.
This will run a short time. It will make the tools needed to build the recovery. If everything executed properly a new set of files have been created in ICS/out/host/darwin-x86/bin:
Step 6:
Now we are going to add a not officially supported device. This way we can build CyanogenMod.
Using terminal emulator on your device, issue the command
Code:
dump_image boot /sdcard/boot.img
This will dump the boot image to your sdcard. Transfer it to your home directory.
My Tablet did not have the dump_image file on it..
Sow there are some options open:
Option 1:
place the dump_image file in the bin folder of the tablet. You will need to change the read/write rights of the file ofcource.
I used the root explorer app to do this.
Option 2: Take the boot.img from last official rom.
Link: https://helpdesk.tom-tec.nl/KB/a200/firmware-update-voor-de-tom-tec-atf3657-excellent-7.aspx
Ore here: http://portal.tom-tec.eu/KB/a204/firmware-update-for-the-tom-tec-atf-3657-excellent-7.aspx
ore:
http://portal.tom-tec.eu/KB/a204/firmware-update-for-the-tom-tec-atf-3657-excellent-7.aspx
Option 3: Just dump the boot.img file from the tablet. And dump the
recovery.img to.
Dump boot.img this way: dd if=/dev/block/mtdblock0 of=/mnt/ext_sd/boot.img bs=4096
Dump recovery.img this way: dd if=/dev/block/mtdblock6 of=/mnt/ext_sd/recovery.img bs=4096
You can use ADB terminal from pc ore go download a terminal from Google play store on you´re android device.
To build Android from source for a new device, you need to set up a board config and its makefiles. This is generally a long and tedious process. Luckily, if you are only building recovery, it is a lot easier. From the root of your Android source directory (assuming you've run envsetup.sh), run the following (substituting names appropriately):
Code:
build/tools/device/mkvendor.sh device_manufacturer_name device_name /your/path/to/the/boot.img
For Tom-Tec 7 excellent, the command will go as follows :
Code:
build/tools/device/mkvendor.sh YG m805_892x ~/boot.img
and for the recovery: of: build/tools/device/mkvendor.sh YG m805_892x ~/recovery.img
Please note that m805_892x is the device name..... Only use "~/boot.img" if you have the boot image in your home directory. Or else please specify the correct path.
You will receive the confirmation "Done!" if everything worked. The mkvendor.sh script will also have created the following directory in your Android source tree:
manufacturer_name/device_name
YG/m805_892x
In case of the Tom-Tec 7 excellent you can find the output files here:
/home/youreUsernames/ICS/device/YG/m805_892x
Step 7 :
Now that you have the device config ready, proceed.
Type the following code in your terminal in the source directory.
Code:
. build/envsetup.sh
gives:
including device/ti/panda/vendorsetup.sh
including device/YG/m805_892x/vendorsetup.sh
including vendor/cm/vendorsetup.sh
including sdk/bash_completion/adb.bash
This will setup the build environment for you to work.
Now launch the command
Code:
lunch full_device_name-eng
For Tom-tec 7 excellent it is: lunch full_m805_892x-eng
But seems best to me to use: lunch full_m805_892x-userdebug
This step will be done in a short time.
This will set the build system up to build for your new device. Open up the directory in a file explorer or IDE. You should have the following files: AndroidBoard.mk, AndroidProducts.mk, BoardConfig.mk, device_.mk, kernel, system.prop, recovery.fstab, and vendorsetup.sh.
Now we can go and eddit the files in the directory: /home/..username../ICS/device/YG/m805_892x
The two files you are interested in are recovery.fstab and kernel. The kernel in that directory is the stock one that was extracted from the boot.img that was provided earlier. For the most part, recovery.fstab will work on most devices that have mtd, emmc, or otherwise named partitions. But if not, recovery.fstab will need to be tweaked to support mounts and their mount points. For example, if your /sdcard mount is /dev/block/mmcblk1p1, you would need the following lines in your BoardConfig.mk
/sdcard vfat /dev/block/mmcblk1p1
Once the recovery.fstab has been properly setup, you can proceed to the next step.
Step 8 :
Now we build the recovery.
Code:
make -j4 recoveryimage
Ore with a log file:
make -j4 recoveryimage 2>&1 | tee tom-tec-revovery.log
(Will be checking build tools if clean command is used.)
This command builds the recovery image
You can use the command
Code:
make -j4 recoveryzip
Ore with a log:
make -j4 recoveryzip 2>&1 | tee tom-tec-fashableZip.log
To make a fakeflash recovery i.e. a temporary recovery to test out on the actual device.
Your recovery can then be found at "your_source_directory/OUT/target/product/m805_892x/recovery.img" and the temporary fakeflash zip in the utilities folder at the same location.
If everything works out well, you will have a working recovery.
At the moment i havent been able to make a CWM recovery with all the options working. Sow a nice bit of user feedback will help making it i hope.
Once you have working builds, notify "koush", on Github and he can build official releases and add ROM Manager support!
IF YOU HAVE ALREADY COMPILED THE SOURCE AND YOU MAKE CHANGES TO THE BoardConfig.mk YOU WILL HAVE TO DO THIS FOR YOUR NEXT BUILD
$ cd ICS
$ make clobber
ore make clean
$ . build/envsetup.sh
$ lunch full_m805_892x-eng ore lunch full_m805_892x-userdebug
of lunch en nummer kiezen
$ make -j4 recoveryimage 2>&1 | tee tom-tec-recovery.log
$ make -j4 recoveryzip
$ make -j4 bootimage
$ make -j4 userdataimage
$ make -j4 systemimage
And for building the rom: make -j4 otapackage 2>&1 | tee tom-tec-build.log
Download files:
New 2014:
CWM recover V6.0.12 last: http://www.mediafire.com/view/w40bzdl1ujh60ay/recovery
info:Making a backup and restore works. The best part i think.
Some options dont work jet. Its to late to tell much about.
Everything works except for:
USB mount
Key test close to working.
choose backup format
I made the recovery flashable from stock recovery. Download it here.
cwm recovery V6.x beta flashable:
later again
Recovery FakeFlash update.zip (recoveryzip): http://www.mediafire.com/?r3uhcqol1t55ii5
You can install this from the stock recovery. It wont harm the system! It will give you the option to make a rom backup.
Its not a full cwm recovery but it is a start.
If you install a rom using Recovery FakeFlash update.zip there will be a log file made in: /cach/recovery/
Very usefull to check if you´re rom is not booting
For me with the Tom-tec. If i restore the userdata.img the device wont fully start. It keeps loading the android image.
Dump you recovery. Flashable file.:
http://www.mediafire.com/?jk929dw8vpw1w1f
If you want to go back to the stock recovery use this file:
flashable stock recovery v3e
http://www.mediafire.com/?q8fgeqtwt2iqau8
If you´re not able to build the otatools.
Download Otatools CM9:
http://www.mediafire.com/?job80hd2n1jfnqa
Download the cm9 rom!:
http://forum.xda-developers.com/android/development/dev-unofficial-tom-tec-7-excellent-t2946072
Links:
Compile Tccutils to unpack and repack images: http://forum.xda-developers.com/showthread.php?t=1873041
How to install the SDK: http://wiki.cyanogenmod.com/index.php?title=Howto:_Install_the_Android_SDK
Official build guide by Google. http://source.android.com/source/initializing.html
Official cm guide: http://wiki.cyanogenmod.com/index.php?title=Building_from_source
Android Platform Developer's Guide: http://www.kandroid.org/online-pdk/guide/
Guide by koush: http://www.koushikdutta.com/2010/10/porting-clockwork-recovery-to-new.html
Newbe friendly guide i used: http://forum.xda-developers.com/showthread.php?t=1866545
Compile ICS on Ubuntu: http://forum.xda-developers.com/showthread.php?t=1354865
Android ROM Development From Source To End: http://forum.xda-developers.com/chef-central/android/guide-android-rom-development-t2814763
How To Port CyanogenMod Android To Your Own Device: http://wiki.cyanogenmod.org/w/Doc:_porting_intro
------------------------------------------------------------------------------------------------------------------------------------------------------------------------
Some tips :
If you want to compile CWM 6, sync the jellybean branch using the command :
Code:
repo init -u git://github.com/CyanogenMod/android.git -b jellybean
repo sync
If you want to compile CWM 6 on a 32 bit system, you need to sync THIS source too. Instructions are given in the readme.
Run "make clobber" between builds if you change the BoardConfig.mk, or the change will not get picked up.
Credits :
Koush for this guide. Find 1 of his githubs to see the info he gives in the make files. Helps a lot.

Fix compile problems
Fix problems... This the learning part.. Fun but can be really anoying to.
First i got my self:
make otatools did not work.
-Try make -j4 out/host/linux-x86/bin/unpackbootimg
-put "unpackbootimg" in ~/android/system/out/host/linux-x86/bin then i copy it to ~/usr/bin and set chmod.
Im did see a download if it some place. Google.
-copy unpackbootimg to into /usr/bin If it is there, make it executable.
make executable: sudo chmod a+x /usr/bin/unpackbootimg
-Run make clubber from The ICS folder. Than restart pc might help to.
Problem: unpackbootimg not found. Is your android build environment set up and have the host tools been built?
build/tools/device/mkvendor.sh YG m805_892x ~/recovery.img
gives:
unpackbootimg not found. Is your android build environment set up and have the host tools been built?
fix: make -j4 out/host/linux-x86/bin/unpackbootimg
fix2: permission van de bestanden aanpassen.
fix3: copy unpackbootimg file into /usr/bin (change permissing)
(Look on google for: cp file to usr/bin)
how:
Copy unpackbootimg to you´re home dir.
sudo cp unpackbootimg /usr/bin
Give pasword.
chmod +x unpackbootimg ./unpackbootimg
Probleem . build/envsetup.sh with vendorsetup.sh not found (including device/YG/m805_892x/vendorsetup.sh
):
[email protected]:~/ICS$ . build/envsetup.sh
including device/ti/panda/vendorsetup.sh
including vendor/cm/vendorsetup.sh
including sdk/bash_completion/adb.bash
Make the file vendorsetup.sh in you´re device tree. Look at a nother device tree how it set up! Have a look in my github.
My device tree is in home dir at: / ICS/device/YG/m805_892x
Now run . build/envsetup.sh again it should be there now.
Still not there? Did you run the command from inside the right folder (project folder). I have to do cd ICS.
probleem:
build/core/product_config.mk:199: *** device/YG/m805_892x/full_m805_892x.mk: PRODUCT_NAME must be a valid C identifier, not "full_m805_892x-evm". Stop.
fix make files settings:
PRODUCT_BUILD_PROP_OVERRIDES += BUILD_UTC_DATE=0
#PRODUCT_NAME := full_m805_892x
PRODUCT_NAME := full_m805_892x-evm
PRODUCT_DEVICE := m805_892x
PRODUCT_BRAND := Android
PRODUCT_MODEL := A777
Change to this:
PRODUCT_NAME := full_m805_892x_evm
And yes you have to use _ insted of - i gues.
Make the change in: cm.mk, device_m805_892x.mk and full_m805_892x.mk
Problem building recovery:
out/target/product/K00F/recovery.img total size is 9388032
error: out/target/product/K00F/recovery.img too large (9388032 > [33792 - 8448])
make: *** [out/target/product/K00F/recovery.img] Error 1
make: *** Deleting file `out/target/product/K00F/recovery.img'
Fix use this in boardconfig (Not for the TomTec tablet but for Asus device):
BOARD_BOOTIMAGE_MAX_SIZE := $(call image-size-from-data-size,0x00010000)
BOARD_RECOVERYIMAGE_MAX_SIZE := $(call image-size-from-data-size,0x00020000)
BOARD_SYSTEMIMAGE_MAX_SIZE := $(call image-size-from-data-size,0x000FC000)
#data-size,0x00010000 this and sow on i found in the Asus stock rom.
Nother problem that i did run into trying to make ext4 images:
make_ext4fs -s -l 0x40000000 -a data out/target/product/m805_892x/userdata.img out/target/product/m805_892x/data
Need size of filesystem
make: *** [out/target/product/m805_892x/userdata.img] Error 4
make: *** Waiting for unfinished jobs..
The sizes need to be in bytes it seems.
make_ext4fs does not support hex in the -l argument
DD dump you´re partitions and you see the amount of bytes.
I put this in my BoardConfig.mk like this:
BOARD_USERDATAIMAGE_PARTITION_SIZE := 1073741824
Use this to finisch waiting jobs..:
make_ext4fs -s -l 1073741824 -a data out/target/product/m805_892x/userdata.img out/target/product/m805_892x/data
problem:
[email protected]:~/ICS$ make -j4 recoveryimage
build/core/product_config.mk:196: *** _nic.PRODUCTS.[[device/YG/m805_892x/device_m805_892x.mk]]: "device/YG/m805_892x/m805_892x-vendor-blobs.mk" does not exist. Stop.
The error is somewhare found in this file:
device_m805_892x.mk I used the original file and start adding things again.
Problem:
make: *** No rule to make target `vendor/cm/proprietary/RomManager.apk', needed by `out/target/product/m805_892x/system/app/RomManager.apk'. Stop.
make: *** Waiting for unfinished jobs....
Copy: out/target/product/m805_892x/system/bin/compcache
Copy: out/target/product/m805_892x/system/bin/handle_compcache
[email protected]:~/ICS$
For that use the terminal and cd to:
cd /vendor/cm
run:
./get-prebuilts
This will download the RomManager.apk and bit of other stuff.
Problem:
build/core/config.mk:162: *** TARGET_ARCH not defined by board config: device/
fix:
open ¨BoardConfig.mk¨
and ad: TARGET_ARCH :=arm (I have it under: TARGET_BOARD_PLATFORM)
Problem:
Which would you like? [full-eng] 5
build/core/product_config.mk:209: *** No matches for product "full_m805_892x". Stop.
Device not found. Attempting to retrieve device repository from CyanogenMod Github (http://github.com/CyanogenMod).
Repository for m805_892x not found in the CyanogenMod Github repository list. If this is in error, you may need to manually add it to your local_manifest.xml.
build/core/product_config.mk:209: *** No matches for product "full_m805_892x". Stop.
** Don't have a product spec for: 'full_m805_892x'
** Do you have the right repo manifest?
fix:
What you need to do is to edit your blob to match the PRODUCT_NAME to the file name. For example with mine I have full_m805_892x therefore in this file I need to have PRODUCT_NAME to match it. Whatever error it is looking for you just need to change the PRODUCT_NAME line to match what the error shows. I did have a look in the files: cm.mk, device_m805_892x.mk, full_m805_892x.mk and vendorsetup.sh
probleem building obj/lib/libril.so out:
prebuilt/linux-x86/toolchain/arm-linux-androideabi-4.4.x/bin/../lib/gcc/arm-linux-androideabi/4.4.3/../../../../arm-linux-androideabi/bin/ld: error: out/target/product/K00F/obj/lib/libril.so: unknown mandatory EABI object attribute 44
collect2: ld returned 1 exit status
make: *** [out/target/product/K00F/obj/EXECUTABLES/rild_intermediates/LINKED/rild] Error 1
make: *** Waiting for unfinished jobs....
fix: I did have to change the libril.so settings in BoardConfig.mk I did disable the libril.so settings for now.
I alsow did have to remove the libril.so file in ojb/lib of the project out folder. Than the build will go on.
repo problem:
repo sync gives:
gpg: Signature made do 01 mei 2014 22:34:18 CEST using RSA key ID 692B382C
gpg: Can't check signature: public key not found
error: could not verify the tag 'v1.12.16'
warning: Skipped upgrade to unverified version
Syncing work tree: 100% (255/255), done.
fix:
run: repo selfupdate --no-repo-verify
link: http://forum.xda-developers.com/showthread.php?t=1846651&page=97
known-issues: https://source.android.com/source/known-issues.html
Nandroid errors http://www.droidforums.net/threads/nandroid-error-codes.20546/

Edit make files..
Edit make files..
Edit:
vendorsetup.sh
This file you have to make you self first. Just make a new file in the device tree folder (Lunix OS). Not in Windows OS! Dont use Windows to edit files. Ore use the notpad+ edition if you really have to. You have to donwload it and install it.
I have this in it:
add_lunch_combo device_m805_892x-eng
add_lunch_combo full_m805_892x-eng
add_lunch_combo full_m805_892x-user
add_lunch_combo full_m805_892x-userdebug
add_lunch_combo full_m805_892x_evm-userdebug
The option: add_lunch_combo full_m805_892x_evm-userdebug will be used. Its set in the make files.
full_m805_892x.mk:
Make a nother file full_m805_892x.mk
Look in my device tree to see how its set up.
Most inportant part for now is:
PRODUCT_BUILD_PROP_OVERRIDES += BUILD_UTC_DATE=0
PRODUCT_NAME := PRODUCT_NAME := full_m805_892x_evm
PRODUCT_DEVICE := m805_892x
PRODUCT_BRAND := Android
PRODUCT_MODEL := A777
Make sure that PRODUCT_NAME := PRODUCT_NAME := full_m805_892x_evm uses the name ash used in vendorsetup.sh (and cm.mk and device_m805_892x.mk )
Yes it hase to be PRODUCT_NAME := full_m805_892x_evm
Not full_m805_892x-evm ore m805_892x-evm-userdebug its seems.
Android.mk:
Make this file in you´re device tree.
Put this in the file and save (No enter after it!):
LOCAL_PATH := $(call my-dir)
AndroidProducts.mk
Make this file in you´re device tree. Put this in the file and save:
PRODUCT_MAKEFILES := \
$(LOCAL_DIR)/full_m805_892x.mk
There is no \ behind full_m805_892x.mk. There is no \ after the last product! This file hase 1 product in it as you can see. If there are more products than ad \ after every product. But no \ on the last product listed.
BoardConfig.mk
Lost of things are set in this file.
When i made my device tree i got this line in it. (And others ofcourse)
BOARD_KERNEL_CMDLINE := console=null
I did change it to this:
BOARD_KERNEL_CMDLINE := console=vmalloc=256M
I found the cmdline when i did a search in the device kernel config..
I did look for: cmdline
The is a nother way to get the BOARD_KERNEL_CMDLINE :=
Open a terminal on you´re tablet and run: cat /proc/cmdline
ore cat /proc/cmdline > /ext_sd/cmdline.txt and it will put a text file on you´re sdcard.
I did get: cat /proc/cmdline > /ext_sd/cmdline.txt geeft : vmallc=256M logo_addr_size=0x85600000
I did left out het last part. I dont need a logo.. I need a cm bootanimation.
More someday later...
Some links for now.
Links:
build-options: http://vladnevzorov.com/2011/02/08/android-os-build-options/
Create a device tree for MTD devices: http://forum.xda-developers.com/showthread.php?t=2010281

Flash recovery image to tablet.
Flash recovery image to tablet.....
I used a terminal app on the tablet:
First run su
$ need to change to # (Make sure you´re tablet hase root and adb hase root permission.)
This command if you have put the recovery.img on external sd: dd if=/mnt/ext_sd/recovery.img of=/dev/block/mtdblock6
Ore this of you got the recovery.img on internal sd : dd if=/mnt/sdcard/recovery.img of=/dev/block/mtdblock6
ore use flash_image:
In terminal on the tablet
$ su
# cd /mnt/ext_sd
chmod 777 flash_image
(Yes you have to place the flash_image file on the sdcard)
flash_image recovery /mnt/ext_sd/recovery.img)
Using fastboot:
~$ adb reboot-bootloader
~$ fastboot flash recovery recovery.img
I did install a broken recovery on my tablet. And the current rom did not have root.. Using fastboot worked out great. The screem did stay back wile in fastboot mode.
Notes:
Needs fastboot/fastboot.exe in adb platform folder.
Needs you´re recovery.img file to in adb platform folder.

Build rom.
Build rom.....

Some links..
Links:
Tom-Tec websites:
http://www.kmb-international.com/category.php?id_category=33
Tom-tec: http://www.kmb-international.com/category.php?id_category=4&id_lang=4
http://www.tom-tec.nl/
Website Telechip: http://www.telechips.com/eng/Product/consumer_pro13.asp
Telechip wiki: http://en.wikipedia.org/wiki/Telechips
Telechips info: http://zomobo.net/telechips
QNX Neutrino for ARMv7 Cortex A-8 and A-9 Processors: http://www.qnx.com/developers/docs/...echnotes/QNX_for_ARMv7_Cortex_Processors.html
ARM7: http://review.cyanogenmod.org/#/c/15478/1/core/combo/arch/arm/armv7-a.mk
GPU Mali 400 http://en.wikipedia.org/wiki/Mali_(GPU)
Cortex-A8 http://processors.wiki.ti.com/index.php/Cortex-A8
http://androtab.info/telechips/cyanogenmod/
From Zero to Boot: Porting Android to your ARM platform:
http://blogs.arm.com/software-enablement/498-from-zero-to-boot-porting-android-to-your-arm-platform/
Source telechip site: https://www.telechips.com/technical_support/kor/opensource/opensource_list.asp
Source telechips:
Kernel: https://github.com/cnxsoft/telechips-linux
Android V4 and Hardware https://github.com/cnxsoft/telechips-android
source mali 400: https://github.com/rzk/Mali-400-r3p0-04rel0-X11-drivers
? repo init -u ssh://android.telechip.com/androidce/android/platform/manifest.git
repo sync
download android telechip sdk: ssh://android.telechips.com/androidce.com/
kernel source modded?
https://github.com/olexiyt/telechips-linux
Find kernel source for you´re device: http://forum.xda-developers.com/showthread.php?t=1808167
Some telechip doc´s:
http://wenku.baidu.com/view/6545cb13a216147917112879.html###n
XDA Telechips links:
unofficial CyanogenMod 7/ClockworkMod Recovery 5 for TCC8902/TCC8803 tablets: http://forum.xda-developers.com/showthread.php?t=1101094
Root/Clockwork mod on TCC8803 tablets: http://forum.xda-developers.com/showthread.php?t=1119778
HSG (X5A/X6) & Pandawill G11 rooting/dev thread (SetCPU & Root working!) http://forum.xda-developers.com/showthread.php?t=757992
Telechip forum:
http://www.androidtablets.net/forum/telechips-based/
http://www.androidtablets.net/forum/telechips-tcc8902-tablets/
http://androtab.info/cyanogenmod/telechips/
http://www.cnx-software.com/tag/telechips/
http://www.chinadigitalcomm.com/android-tablet.html
http://www.pandawillforum.com/forumdisplay.php?56-Telechips-Tablets
Cortex A8 not all TCC: http://www.slatedroid.com/forum/14-cortex-a8/
Some links with devices similar to the Tom-Tec 7 excellent:
Coby 8042: http://www.androidtablets.net/forum/coby-generation-3-development/
More links comming.
Usefull links:
Building a kernel: http://forum.xda-developers.com/nexus-4/general/guide-beginners-guide-to-building-t2986686
Uotkitchen v4.0 http://forum.xda-developers.com/showthread.php?t=990829
¨Some advice¨ from cyanogen: http://forum.xda-developers.com/showthread.php?t=667298
BoardConfig.mk for kernel developer and AOSP (platform) developer: http://forum.xda-developers.com/showthread.php?t=1630849
about how to unpack/repack recovery.img and boot.img http://forum.xda-developers.com/showthread.php?t=1494036
About how to unpack/repack recovery.img and boot.img https://www.miniand.com/wiki/Allwinner/Unpacking+and+building+LiveSuit+images
How to download and compile ICS from source: http://forum.xda-developers.com/showthread.php?t=1503093
List of arm 5, 6 and 7 devices: http://forum.xda-developers.com/showthread.php?t=1596800
How do you port Armv7 Roms to an Armv6 Device?: http://forum.xda-developers.com/showthread.php?t=1591878
What info to take from new device to build cwm recovery: http://androidforums.com/getitnowma...new-device-recovery-creation.html#post2714334
Dev basic´s: Source, Compiling, Github & co ~ Day 4: http://forum.xda-developers.com/showthread.php?t=1778984
Compile recovery: http://forum.xda-developers.com/showthread.php?t=1866545
Yaffey - Utility for reading, editing and writing YAFFS2 images: http://forum.xda-developers.com/showthread.php?t=1645412
port guide: http://apcmag.com/port-roms-to-your-android-device.htm
About tablets: http://www.androidtablets.net/forum...verything-you-want-know-get-started-here.html
> working-on-cyanogenmod: http://www.intervigil.net/working-on-cyanogenmod
How To Logcat: http://forum.xda-developers.com/showthread.php?t=1726238
Logcat links and some tools. 17-1-13: http://forum.xda-developers.com/showthread.php?p=36846151#post36846151
[Guide] How to use Github http://forum.xda-developers.com/showthread.php?t=1877040
[HELP/Q&A][SourceBuilding,AllDevices] The Source Building Q&A Help Thread: http://forum.xda-developers.com/showthread.php?t=2059939
Tips for CM7/CM9/CM10/CM10.1 :http://forum.xda-developers.com/showthread.php?t=1621301
[Guide and FAQ] CM9 / Android ICS for Defy:http://forum.xda-developers.com/showthread.php?t=1386680
TCC githubs:
source hardware: https://github.com/cnxsoft/telechips-android/tree/master/hardware/telechips/omx
koush githubs: https://github.com/koush
https://github.com/milaq/android_device_coby_em102
https://github.com/naobsd/cm_device_telechips_tcc8803
Kyros7015 https://github.com/csleex/cm_device_coby_kyros7015
https://github.com/Johnsel/android_device_coby_mid1125
https://github.com/mastermind1024/micromax_a70
https://github.com/abhis3k/Micromax_A70_device_folder/tree/master/a70
https://github.com/teamhacksung/and...tree/9b79b35d1554c20178cbe82fad0c8ab253630acb
Some telechips githubs:
> CX-01 mini PC https://github.com/olexiyt/cm_device_telechips_tcc8920st
common telechip stuff: https://github.com/naobsd/cm_device_telechips_common
https://github.com/naobsd/cm_device_telechips_tcc8902rt
https://github.com/naobsd/cm_device_telechips_tcc8902gb
https://github.com/naobsd/cm_device_telechips_tcc8902
https://github.com/naobsd/cm_device_telechips_tcc8803rt
https://github.com/naobsd/cm_device_telechips_tcc8803
https://github.com/milaq/android_device_coby_em102
https://github.com/Dreamboxuser/android_device_telechips_m801
https://github.com/Dreamboxuser/Vinci_m801_88
https://github.com/simone201/neak_bootable_recovery
Asure:
some prop. files https://github.com/Asure/android_vendor_samsung/blob/master/dropad/
https://github.com/Asure/android_vendor_samsung/tree/master/dropad
>> some kernel stuff: https://github.com/xxxFeLiXxxx/UltimateDropad
https://github.com/Asure/android_device_telechips_tcc8902
https://github.com/
Asure/android_vendor_telechips
Recovery builder: http://builder.clockworkmod.com/
Nice to try! Will give manufacturer and device name to!
Official CM tablets:
Not TCC..
cm_encore: https://github.com/fat-tire/android_device_bn_encore/tree/ics
https://github.com/fat-tire/android_device_bn_encore/blob/ics/device.mk
Lenovo_P700i https://github.com/Nikolas-LFDesigns/cm_device_lenovo_P700i
http://www.cyanogenmod.com/devices/nook-color
githubs nook: https://github.com/nookiedevs
http://www.cyanogenmod.com/devices/viewsonic-g-tablet
http://www.cyanogenmod.com/devices/advent-vega
CyanogenMod githubs:
https://github.com/CyanogenMod
Github by cyanogen: https://github.com/TeamChopsticks/cm_device_samsung_skyrocket

Just for me again. Just in case

Partial success on Ferguson S3 clone of this board
Hello,
using your tutorial I was able to successfully compile the fakeflash in-memory version (recoveryzip) from current ICS tree (v6.0.1.2) - View attachment rec-fakeflash-FergS3-v2.zip for Ferguson S3 device based on the same chipset. The touch variant on ICS tree did not build.
However, I have to note that the boot image does not work (the real fstab is generated incorrectly during bootup so it can't mount anything). But since the fakeflash ZIP image works, it is simple to boot into it without replacing the original recovery.
A few things had to be changed in ICS/device/YG/m805_892x/ directory:
There is no "central button", so the BoardConfig.mk must contain following line (you can just uncomment it):
Code:
BOARD_HAS_NO_SELECT_BUTTON := true
To backup correctly .android_secure and be able to use the external SD card for backups at the same time, the recovery.fstab lines for SD and nand were changed to:
Code:
/external_sd vfat /dev/block/mmcblk0p1 /dev/block/mmcblk0
/sdcard vfat /dev/block/ndda1 /dev/block/ndda
UPDATE: if you plan to use sd-ext partition as well (e.g. ext3 partition for Link2SD), you will also need following line (not included in the attatched zip image):
Code:
/sd-ext auto /dev/block/mmcblk0p2
Or maybe we could extend it just in case (if the internal SD-card is usable for this):
Code:
/sd-ext auto /dev/block/mmcblk0p2 /dev/block/ndda2
I have also added following line to BoardConfig.mk based on the (non-working) on-line builder, but it works even without it, so it might not be necessary
Code:
TARGET_ARCH_VARIANT := armv7-a

I´m happy my thread did help you. I´ll well keep adding new stuff to tis thread over time Im first trying to make a working rom and recovey for my self at the moment.
I see you try builing the for JB. Make files for JB work a bit differnt than from ICS it seems to me after a short try. I havent tryed a touch version my self jet. But if you know a nice github that is for making a touch version let me know.
To fix you´re boot.img i gues you should try and unpack the original and the 1 you build. Compaire them. There is a nice guide with tools + instruction here:
http://forum.xda-developers.com/showthread.php?p=23298690#post23298690
I got my self a working boot.img that way. Hope it will be a bit of help to you. Have a look how others use the make files to putt the right stuff in the boot.img and recovery.img
I to did have to use: BOARD_HAS_NO_SELECT_BUTTON := true
to get the button working. I wanted to add that in my guide when i get my rom working.
I would just keep this part in you´re BoardConfig if it works: TARGET_ARCH_VARIANT := armv7-a
maybe even have to make it like this? armv7-a-neon
if you have the neon feature. I think sow.
Try the android info app.
Thx for you´re nice post. If you make a nice github i would like to check it out

Its songs werry interesting for me... I am too want get building CM9/10 for this tablets (i have one... its clone of you tablet named Enot j101 - CPU=Telechip TCC892X GPU=Mali 400mp Ram=512mb (ddr3 - ?) NAND=4Gb Dafault_build=Android 4.0.3 (suckasway )...
I am builds Roms from source for other device, but here many problems...
P.S. I make screenshot by ADB... LOOK on build date... If be needed (for proprientary - i am make dump of system).
And please say you status on Rom..

Hi,
I have some more info on the device here:
Some device info here:
http://www.androidworld.nl/forum/to...ellent-7-inch-android-4-0-tablet-atf3657.html
http://www.androidworld.nl/forum/tom-tec/34668-tom-tec-7-excellent-adb-terminal-info.html
Its Dutch but you're be able te get the specs.
I almost have a working rom at the moment. Some lib*.so file dont work and about 4 framework files.
The picture is to small for me to see right. sorry.
AntiBillOS said:
Its songs werry interesting for me... I am too want get building CM9/10 for this tablets (i have one... its clone of you tablet named Enot j101 - CPU=Telechip TCC892X GPU=Mali 400mp Ram=512mb (ddr3 - ?) NAND=4Gb Dafault_build=Android 4.0.3 (suckasway )...
I am builds Roms from source for other device, but here many problems...
P.S. I make screenshot by ADB... LOOK on build date... If be needed (for proprientary - i am make dump of system).
And please say you status on Rom..
Click to expand...
Click to collapse

Great! Thank you very much! I'm trying to build mk802 recovery image myself. Your post helps me so much!:good:

XmiData Fail In Odin
Solved

can anyone help me with this error
grep: build/target/board/generic/recovery.fstab: No such file or directory

Can I use kernel built from kernel source of Android 5 to build rom for Android 7?

My device repositories are not available on github, But I got device tree and vendor blobs by making changes in similar device repo. That reference device's kernel's lineageos_defconfig is situated in htc msm8974 kernel repo. So how can I get lineageos_defconfig for my device, and which other my device related kernel files(.dtsi or any other) I have to push in htc msm8974 repo and get those files to make things ready for build?
Please help......

Related

[Tutorial] How to compile a kernel module outside the kernel

I've decided to make a short tutorial and present the way I compile kernel modules (outside the kernel sources).
I've built few kernel modules (governors - ineractive and smartass, cifs, nls, etc) and I started receiving private messages asking how I did it.
For kernel modules that come with the kernel itself - cifs / tun for example - they just work if you compile the kernel and activate correct config parameters.
Some other modules (such as the smartass governor that doesn't come with the kernel) you compile outside the kernel source. However they require changes since kernel does not export the symbols the module needs to use - so you have to know what k_all_syms are needed, grab them from the phone and update the kernel module.
So there will be changes there. However, the main steps are:
a) follow tutorials to get the kernel / android ndk to compile. People seem able to do this.
b) then take the module you want (For example cpufreq_smartass.c from here: http://pastebin.com/rR4QUCrk ) and copy it in a new folder on the disk.
c) create a Makefile like the one below, but with your paths of course:
Code:
KERNEL_DIR=/home/viulian/android_platform/kernel-2.1.A.0.435/kernel
obj-m := cpufreq_smartass.o
PWD := $(shell pwd)
default:
$(MAKE) ARCH=arm CROSS_COMPILE=/home/viulian/android_platform/prebuilt/linux-x86/toolchain/arm-eabi-4.4.3/bin/arm-eabi- -C $(KERNEL_DIR) SUBDIRS=$(PWD) modules
clean:
$(MAKE) -C $(KERNEL_DIR) SUBDIRS=$(PWD) clean
d) execute make
Of course, the module source needs to be adjusted as you need to put in the frequencies, and also update the k_all_syms pointers .. But you can retrieve them from /proc/kallsyms on the device itself - just look for the method name, and use the address you see in the log.
If you still can't get it to compile, try to compile a very basic hello_world kernel module. I used the code below when testing:
Code:
#include <linux/module.h> /* Needed by all modules */
#include <linux/kernel.h> /* Needed for KERN_ALERT */
MODULE_LICENSE("GPL");
MODULE_AUTHOR("viulian, 2011");
MODULE_DESCRIPTION("Demo module for X10i");
int init_module(void)
{
printk("<1>Hello world\n");
// A non 0 return means init_module failed; module can't be loaded.
return 0;
}
void cleanup_module(void)
{
printk(KERN_ALERT "Goodbye world 1.\n");
}
It is not perfect, but if you manage to insmod-it and check dmesg, you will see "Hello world" written there.
One more thing, linux kernel is fussy about the module versions. Even if nothing is changed between two kernel versions related to what a module needs, is enough a small difference in module's modinfo value to make the kernel to refuse the module.
For this, you need to trick your local kernel and adjust EXTRAVERSION value in kernel's main Makefile to have the exact version of the one on the device:
In X10 stock kernel (GB 2.3.3 release), the kernel version is 2.6.29-00054-g5f01537 visible in phone settings.
This means that the kernel on the phone will only accept modules that are compiled for that exact version. But the kernel version is just a string in the module .ko, so is a string comparison - the module might work perfectly, but is not loaded.
There is luck though, the string value comes from a define in kernel's Makefile, which you can change before you compile!
The Makefile in the kernel you are going to use to build the module will have to include these lines at the top:
Code:
VERSION = 2
PATCHLEVEL = 6
SUBLEVEL = 29
EXTRAVERSION = -00054-g5f01537
Other than that, it should work .. Expect phone reboots and difficulty to debug if stuff goes wrong. Android kernel doesn't come with syslog functionality, kernel prints are found in /proc/kmsg. Dmesg works, but you can't execute if if phone reboots.
I usually had to keep another adb shell opening with 'cat /proc/kmsg' which showed as much as possible from the module's outputs.
Happy compiling on your risk!
Good
Sent from my GT-S5570 using Tapatalk
Nice really nice.
Anyone help me.have someone who could compile the linux bluetooth modules please? Iam noob in linux
http://www.multiupload.com/58OPISAYNH
Anyone please can make a video tutorial?
That's really nice of you for sharing this.
Guide to Compiling Custom Kernel Modules in Android
I've spent the better part of today trying to figure out how to compile and load a custom kernel modules in android to aid me in my research. It has been in entirely frustrating experience, as there is almost no documentation on the topic that I can find. Below you will find my attempt at a guide. Hopefully this will help save someone else the hassle.
PREREQUISITES
Disclaimer: This list may be incomplete, since I've not tried it on a fresh install. Please let me know if I've missed anything.
Install the general android prereqs found here .
Download and un(zip|tar) the android NDK found here .
http://developer.android.com/sdk/ndk/index.html
Download and un(zip|tar) the android SDK found here .
http://developer.android.com/sdk/index.html
Download and untar the kernel source for your device. This can usually be found on the website of your device manufacturer or by a quick Google search.
Root your phone. In order to run custom kernel modules, you must have a rooted phone.
Plug your phone into your computer.
PREPARING YOUR KERNEL SOURCE
First we must retrieve and copy the kernel config from our device.
Code:
$ cd /path/to/android-sdk/tools
$ ./adk pull /proc/config.gz
$ gunzip ./config.gz
$ cp config /path/to/kernel/.config
Next we have to prepare our kernel source for our module.
Code:
$ cd /path/to/kernel
$ make ARCH=arm CROSS_COMPILE=/path/to/android-ndk/toolchains/arm-linux-androideabi-4.4.3/prebuilt/linux-x86/bin/arm-linux-androideabi- modules_prepare
PREPARING YOUR MODULE FOR COMPILATION
We need to create a Makefile to cross-compile our kernel module. The contents of your Makefile should be similar to the following:
Code:
obj-m := modulename.o
KDIR := /path/to/kernel
PWD := $(shell pwd)
CCPATH := /path/to/android-ndk/toolchains/arm-linux-androideabi-4.4.3/prebuilt/linux-x86/bin
default:
$(MAKE) ARCH=arm CROSS_COMPILE=$(CCPATH)/arm-linux-androideabi- -C $(KDIR) M=$(PWD) modules
COMPILING AND INSTALLING YOUR MODULE
Code:
$ cd /path/to/module/src
$ make
$ cd /path/to/android-sdk/tools/
$ ./adb push /path/to/module/src/modulename.ko /sdcard/modulename.ko
RUNNING YOUR MODULE
Code:
$ cd /path/to/android-sdk/
$ ./adb shell
$ su
# insmod /sdcard/modulename.ko
---------- Post added at 07:40 PM ---------- Previous post was at 07:37 PM ----------
IMPORNTANT TOO
Preparing a build environment
To build an Android kernel, you need a cross-compiling toolchain. Theoretically, any will do, provided it targets ARM. I just used the one coming in the Android NDK:
$ wget http://dl.google.com/android/ndk/android-ndk-r6b-linux-x86.tar.bz2
$ tar -jxf android-ndk-r6b-linux-x86.tar.bz2
$ export ARCH=arm
$ export CROSS_COMPILE=$(pwd)/android-ndk-r6b/toolchains/arm-linux-androideabi-4.4.3/prebuilt/linux-x86/bin/arm-linux-androideabi-
For the latter, you need to use a directory path containing prefixed versions (such as arm-eabi-gcc orarm-linux-androideabi-gcc), and include the prefix, but not “gcc”.
You will also need the adb tool coming from the Android SDK. You can install it this way:
$ wget http://dl.google.com/android/android-sdk_r12-linux_x86.tgz
$ tar -zxf android-sdk_r12-linux_x86.tgz
$ android-sdk-linux_x86/tools/android update sdk -u -t platform-tool
$ export PATH=$PATH:$(pwd)/android-sdk-linux_x86/platform-tools
not yet ((((
Come on, please make video tuto
that's interesting.
Thanks for sharing
Any takers to do a video status? Come on people it would be good for newbies like me and many that tme around. When teaching the community grows.
hi
i'm traing to compile module for acer a500.
but i have got an error: Nothing to be done for `default'.
my makefile:
Code:
obj-m += hello.o
KDIR := /home/hamster/android
PWD := $(shell pwd)
CCPATH := /home/hamster/android-ndk/toolchains/arm-linux-androideabi-4.4.3/prebuilt/linux-x86/bin
default:
$(MAKE) ARCH=arm CROSS_COMPILE=$(CCPATH)/arm-linux-androideabi- -C $(KDIR) M=$(PWD) modules
acer kernel code is located in /home/hamster/android
could you help me?
thanks
Thanks man. The step "modules_prepare" is what did the trick for me!
Makefile including tabs
hamsterksu said:
hi
i'm traing to compile module for acer a500.
but i have got an error: Nothing to be done for `default'.
my makefile:
Code:
obj-m += hello.o
KDIR := /home/hamster/android
PWD := $(shell pwd)
CCPATH := /home/hamster/android-ndk/toolchains/arm-linux-androideabi-4.4.3/prebuilt/linux-x86/bin
default:
$(MAKE) ARCH=arm CROSS_COMPILE=$(CCPATH)/arm-linux-androideabi- -C $(KDIR) M=$(PWD) modules
acer kernel code is located in /home/hamster/android
could you help me?
thanks
Click to expand...
Click to collapse
This is probably because you need to add a tab in front of your $(MAKE). Without the tab it will not recognize the command.
Help with compiling module
I am trying to compile a module for Galaxy S. I am getting this error.
# insmod hello_world.ko
insmod: init_module 'hello_world.ko' failed (Exec format error)
These are the module related options that I have enabled in the .config
CONFIG_MODULES=y
CONFIG_MODULE_FORCE_LOAD=y
CONFIG_MODULE_UNLOAD=y
CONFIG_MODULE_FORCE_UNLOAD=y
# CONFIG_MODVERSIONS is not set
# CONFIG_MODULE_SRCVERSION_ALL is not set
Further this is the cat /proc/kmsg out put
<3>[53597.457275] hello_world: version magic '2.6.35.7-I900XXJVP-CL264642 preempt mod_unload ARMv7 ' should be '2.6.35.7-I9000XXJVP-CL264642 preempt mod_unload ARMv7 '
Why am I getting this error??
These are the steps I followed,
1. Downloaded the GT-I9000_OpenSource_GB.zip from samsung open source.
2. Change the EXTRAVERSION to EXTRAVERSION = .7-I900XXJVP-CL264642 (kernel version shown on phone is [email protected] #2)
I tried with EXTRAVERSION = [email protected] as well.
3. Added this line to the main make file -
core-y := usr/ TestModule/
5. Place the TestModule/ with the module code on the root directory.
6. Created the TestModule/Makefile and added this entry
obj-m := hello_world.o
4. On the read me of the kernel source it says to install Sourcery G++ Lite 2009q3-68 toolchain for ARM EABI, which I did.
5. Execute 'make aries_eur_defconfig'.
6. Execute make (again this is how the readme in the source says)
I have compiled this module for the emulator and it works fine, What am I doing wrong here?
Thanks in advance.
hamsterksu said:
hi
but i have got an error: Nothing to be done for `default'.
Code:
default:
$(MAKE) ARCH=arm CROSS_COMPILE=$(CCPATH)/arm-linux-androideabi- -C $(KDIR) M=$(PWD) modules
Click to expand...
Click to collapse
be sure to have {tab} not space or other symbol before: $(MAKE) in:
Code:
default:
$(MAKE) ARCH=arm CROSS_COMPILE=$(CCPATH)/arm-linux-androideabi- -C $(KDIR) M=$(PWD) modules
Hello,
I'm trying to load a module in my GS3 but I encounter problems about version. Maybe it's just a mismatch between the kernel i use to compile and the one on my phone.
I have a 3.0.31-742798 kernel version on my GS3, so I put this info in the makefile like viulian said but it didn't work.
I manage to compile and put the module on the phone, but when I want to insmod it, I've got
Code:
insmod: init_module 'hello_world.ko' failed (Exec format error)
and the /proc/kmsg say
Code:
... disagrees about version of symbol module_layout
And there no config.gz on the /proc/ dir like fabricioemmerick suggest to use
EDIT: I try to modify the symbol by copying the one of module from the phone. Have another error.
btw , with modinfo I found that the compilation always add -gc33f1bc-dirty after the subversion. Maybe something in the compilation goes wrong. Still use the stock kernel and the toolchain from the ndk sourcecode
m00gle said:
Hello,
I'm trying to load a module in my GS3 but I encounter problems about version. Maybe it's just a mismatch between the kernel i use to compile and the one on my phone.
I have a 3.0.31-742798 kernel version on my GS3, so I put this info in the makefile like viulian said but it didn't work.
I manage to compile and put the module on the phone, but when I want to insmod it, I've got
Code:
insmod: init_module 'hello_world.ko' failed (Exec format error)
and the /proc/kmsg say
Code:
... disagrees about version of symbol module_layout
And there no config.gz on the /proc/ dir like fabricioemmerick suggest to use
EDIT: I try to modify the symbol by copying the one of module from the phone. Have another error.
btw , with modinfo I found that the compilation always add -gc33f1bc-dirty after the subversion. Maybe something in the compilation goes wrong. Still use the stock kernel and the toolchain from the ndk sourcecode
Click to expand...
Click to collapse
Maybe your kernel source code version and your phone kernel version is different. If both are 3.0.31 but just the subversion is different, you can
try "insmod -f" to load. The -f option will ignore the version.
How can I get a dmesg of a specific kernel module using adb shell or any other way?
ravike14 said:
How can I get a dmesg of a specific kernel module using adb shell or any other way?
Click to expand...
Click to collapse
I'm not sure I understand the question ... you can just dmesg and grep by the module name ? Or some string that the module outputs ? You have full control
viulian said:
I'm not sure I understand the question ... you can just dmesg and grep by the module name ? Or some string that the module outputs ? You have full control
Click to expand...
Click to collapse
That's the part I don't understand, the grep part.. When I enter grep with my commamd I get as it's not a recognized command.. I'm using Windows is that the reason?
I'm using 'adb shell dmesg > dmesg.txt' how do I add the grep part for it and and the module name.. I did alot research but all are Linux kernel specific debugging guides.. What would be the exact command to grep a specific module.ko logs?
Sent from my HTC_Amaze_4G using XDA Premium 4 mobile app
ravike14 said:
I'm using 'adb shell dmesg > dmesg.txt' how do I add the grep part for it and and the module name.. I did alot research but all are Linux kernel specific debugging guides.. What would be the exact command to grep a specific module.ko logs?
Click to expand...
Click to collapse
I think I understand now
The order is this:
a) DroidSSHd from here: http://code.google.com/p/droidsshd/downloads/list
b) Busybox installer from the market.
c) Putty on your windows to connect to the phone
Now you can dmesg + grep once you are connected to the phone (don't forget to su before and allow DroidSSHd root).
You need to be connected to the phone since it is much more easier. Use the phone as your remote Linux machine.

[GUIDE] How to compile kernel for Xperia E3.

This guide is focused on xperia e3 but for other devices process will be simler too.
This guide is not in good shape now i will keep improving it and making it easier and better.
if xperia e3 don,t have too many developers then become one.
Requirements
linux os. -recommended ubuntu 14.04 LTS
(you can install ubuntu on virtualbox or dual boot ubuntu with windows)
cross compiler tool chain -recomended Linaro GCC 4.9.3 optimized for arm-cortex_a7
kernel source code. download it from sony or you can compile my nitrogen kernel only if you have D2212/02 recomended.
unlocked bootloader
tools for building boot.img Download HERE
Sony Kernel
D2202/12 DOWNLOAD
D2203/06/43 DOWNLOAD
Nitrogen Kernel
D2202/12/03/06/43 DOWNLOAD
config for lte varriants is not uploaded but u may find it in your device /proc/config.gz
extarct config from config.gz and rename it to Nitrogen_lte_defconfig and put it in
<kernel source folder>/arch/arm/config/<here>
Setting up Environment in Ubuntu.
boot up ubuntu and open Home directory.
create two new folder.
one with name "toolchain"
one with name "build"
now extract your toolchain to toolchain folder it must contain these folders
Code:
arm-cortex_a7-linux-gnueabihf
bin
include
lib
libexec
share
(depends on toolchain you have)
Extracting Nitrogen source code
if you downloaded zip then extract that zip home dir.
then rename flamingo-kernel folder to kernel
else you can use these commands
Code:
sudo apt-get update
sudo apt-get install git
then
Code:
git clone https://github.com/vinay94185vinay/Flamingo-kernel.git
after that rename flamingo kernel to kernel.
How to extract sony source code
open terminal type
Code:
tar -xjvf
then drag n drop source code file
then hit enter. (it will extract files in home firectory)
open your firmware number folder. eg: 18.5.C.0.19
delete extarnal folder then move/copy "kernel" folder to home dir.
and then extract build tools to build folder.
Compiling.
open an terminal (CTRL+ALT+T) and type
Code:
cd Kernel
(this will change directory to kernel folder.)
then type
Code:
export CROSS_COMPILE=[COLOR="Green"]~/toolchain/bin/[/COLOR][COLOR="Red"]arm-cortex_a7-linux-gnueabihf-[/COLOR]
(red line depend on tool chain and green line on it,s location)
how to find correct red line for toolchain.
open toolchain folder
then bin
in my case it contains files like
arm-cortex_a7-linux-gnueabihf-addr2line
arm-cortex_a7-linux-gnueabihf-ar
arm-cortex_a7-linux-gnueabihf-as
see all files contains that red line.
now you must understood how to know that line.
for sony kernel source code type
For D2202 and D2212
Code:
make [COLOR="Red"]ARCH=arm CROSS_COMPILE=$CROSS_COMPILE[/COLOR] [COLOR="Green"]arima_8226ds_dp_defconfig[/COLOR]
For D2203 and D2206 and D2243
Code:
make [COLOR="Red"]ARCH=arm CROSS_COMPILE=$CROSS_COMPILE[/COLOR] [COLOR="Green"]arima_8926ss_dp_defconfig[/COLOR]
"RED" line make sure that you compile kernel for arm based cpu that is in your android device
if you remove this line you will end up making a kernel for your pc.
"GREEN" is to load an preset default configuration for compiling kernel
it contains what thing,s has to be compiled in this kernel.
for nitrogen kernel source code type
D2202 and D2212
Code:
make ARCH=arm CROSS_COMPILE=$CROSS_COMPILE Nitrogen_defconfig
D2203 and D2206 and D2243
Code:
make ARCH=arm CROSS_COMPILE=$CROSS_COMPILE Nitrogen_lte_defconfig
Now type for dualcore cpu
Code:
make ARCH=arm CROSS_COMPILE=$CROSS_COMPILE [COLOR="red"]-j3[/COLOR]
"red" -j3 tell,s compiler to make 3 job,s which is good for intel dual core cpu.
if you have dual core amd cpu it should be better for you to have 2 job,s mean -j2
and -j4 for quard core.
for quard core cpu
Code:
make ARCH=arm CROSS_COMPILE=$CROSS_COMPILE -j5
(do it like this cores + 1)
now wait for untill your kernel get compiled.
it may take long time. depend on how fast and how many cores your cpu have.
if you don,t get any error then
you have compiled your kernel :good:.
building boot.img
copy zimage from kernel/arch/arm/boot folder.
to build/msm8226_flamingo/<zimage>
now in msm8226_flamingo folder.
open new_stock_files/<according to your device>/
copy ramdisk. and dt.img to msm8226_flamingo folder.
now open terminal (CTRL+ALT+T) and type
Code:
cd build/msm8226_flamingo/
then
Code:
./makeit.sh
(don,t forget dot.)
now you can see boot.img in build/msm8226_flamingo folder.
now you can flash boot.img with fastboot or flashtool.
feel free to ask if you don,t understand or have error in any step.
RESERVED
adding features.
adding your and kernel name in kernel version.
adding kernel name
in kernel folder you will see Makefile open and edit it.
find these lines.
Code:
VERSION = 3
PATCHLEVEL = 4
SUBLEVEL = 0
[COLOR=Red]EXTRAVERSION = [/COLOR]
NAME = Saber-toothed Squirrel
write name of kernel next to extraversion (highlited in red)
like this
Code:
VERSION = 3
PATCHLEVEL = 4
SUBLEVEL = 0
[COLOR=red]EXTRAVERSION = -My_Kernel[/COLOR]
NAME = Saber-toothed Squirrel
adding your name.
open kernel/scripts
edit file called mkcompile_h
find lines like this
Code:
# [All][Main][SI][DMS][44408][akenhsu] Fix the builder and build machine avoiding 'arima' in kernel version 20140926 BEGIN
# LINUX_COMPILE_BY=$(whoami | sed 's/\\/\\\\/')
LINUX_COMPILE_BY=`echo [COLOR=red]build_admin`[/COLOR]
# [All][Main][SI][DMS][44408][akenhsu] 20140926 END
else
LINUX_COMPILE_BY=$KBUILD_BUILD_USER
fi
if test -z "$KBUILD_BUILD_HOST"; then
# [All][Main][SI][DMS][44408][akenhsu] Fix the builder and build machine avoiding 'arima' in kernel version 20140926 BEGIN
# LINUX_COMPILE_HOST=`hostname`
LINUX_COMPILE_HOST=`echo[COLOR=green] ubuntu_builder`[/COLOR]
# [All][Main][SI][DMS][44408][akenhsu] 20140926 END
change red one to your name and green one to your host it will look like this in kernel version.
build_admin@ubuntu_builder
change it like this
Code:
# [All][Main][SI][DMS][44408][akenhsu] Fix the builder and build machine avoiding 'arima' in kernel version 20140926 BEGIN
# LINUX_COMPILE_BY=$(whoami | sed 's/\\/\\\\/')
LINUX_COMPILE_BY=`echo [COLOR=red]my_name`[/COLOR]
# [All][Main][SI][DMS][44408][akenhsu] 20140926 END
else
LINUX_COMPILE_BY=$KBUILD_BUILD_USER
fi
if test -z "$KBUILD_BUILD_HOST"; then
# [All][Main][SI][DMS][44408][akenhsu] Fix the builder and build machine avoiding 'arima' in kernel version 20140926 BEGIN
# LINUX_COMPILE_HOST=`hostname`
LINUX_COMPILE_HOST=`echo[COLOR=red] i_compiled_on[/COLOR]`
# [All][Main][SI][DMS][44408][akenhsu] 20140926 END
adding governors and i/o sheduer
http://xda-university.com/as-a-developer/adding-features-to-your-kernel
fixing error.
#1
if you get error with line
Code:
[-Werror=implicit-function-declaration]
like this one
Code:
CC drivers/video/msm/mdss/mdss_dsi_host.o
CC drivers/video/msm/mdss/mdss_dsi_cmd.o
CC drivers/video/msm/mdss/mdss_dsi_panel.o
drivers/video/msm/mdss/mdss_dsi_panel.c: In function ‘mdss_dsi_panel_reset’:
drivers/video/msm/mdss/mdss_dsi_panel.c:291:3: error: implicit declaration of function ‘mdss_dsi_request_gpios’ [COLOR="Red"][-Werror=implicit-function-declaration][/COLOR]
rc = mdss_dsi_request_gpios(ctrl_pdata);
^
cc1: some warnings being treated as errors
make[4]: *** [drivers/video/msm/mdss/mdss_dsi_panel.o] Error 1
make[3]: *** [drivers/video/msm/mdss] Error 2
make[2]: *** [drivers/video/msm] Error 2
make[1]: *** [drivers/video] Error 2
make: *** [drivers] Error 2
then open makefile in kernel folder and find line
Code:
CFLAGS_KERNEL =
and make it like this
Code:
CFLAGS_KERNEL = -w
then save and exit you will not see that error again.
I will try it
Thanks bro
arpit.j said:
I will try it
Thanks bro
Click to expand...
Click to collapse
export command was incorrect.
i fixed it and added details of it.
hi,
guy,s some info here.
if you compile nitrogen kernel from source code it will give you some extra features that i added in source code after release of Nitrogen 4.1.
nitrogen kernel source code have
- prima wifi drivers
- headset in high performance mode
- zzmove governor
- 30% faster input output
- enhance power efecency with series of NVIDIA patches
- some tweaks for ASoc
- Enabled TCP Congestions like high speed,westwood etc.
if you want these features then compile kernel from source.
i will keep adding features to source code
only D2202 and D2212 is supported.
Don,t forget the poll at top of thread.
any on making any kernel.
Hello
Thank you ver much, Vinay
Today i built my first Android kernel for D2203. Before i had your kernel LTE.7z from this post http://forum.xda-developers.com/xperia-e3/general/simplified-guide-to-root-sony-xperia-e3-t3012248 It was work perfectly. On my new kernel i have no CWM recovery. How to restore recovery?
Thanks
pjk11 said:
Hello
Thank you ver much, Vinay
Today i built my first Android kernel for D2203. Before i had your kernel LTE.7z from this post http://forum.xda-developers.com/xperia-e3/general/simplified-guide-to-root-sony-xperia-e3-t3012248 It was work perfectly. On my new kernel i have no CWM recovery. How to restore recovery?
Thanks
Click to expand...
Click to collapse
for a recovery you need a ramdisk with recovery. Tell me which recovery you want i can give you that ramdisk.
Sent from my Xperia E3 using XDA Free mobile app
vinay said:
for a recovery you need a ramdisk with recovery. Tell me which recovery you want i can give you that ramdisk.
Sent from my Xperia E3 using XDA Free mobile app
Click to expand...
Click to collapse
I have this kernel with cwm:
Code:
[email protected]:/ $ uname -a
Linux localhost [email protected] #2 SMP PREEMPT Wed Mar 25 19:54:11 IST 2015 armv7l GNU/Linux
Where i can download this sources, your config, and ramdisk with cwm?
Thanks.
pjk11 said:
I have this kernel with cwm:
Code:
[email protected]:/ $ uname -a
Linux localhost [email protected] #2 SMP PREEMPT Wed Mar 25 19:54:11 IST 2015 armv7l GNU/Linux
Where i can download this sources, your config, and ramdisk with cwm?
Thanks.
Click to expand...
Click to collapse
use this ramdisk while building boot.img
http://www.mediafire.com/download/w1xt9um1dm95mpp/ramdisk.cpio.gz
extract my config from your device.
/proc/config.gz
vinay said:
use this ramdisk while building boot.img
http://www.mediafire.com/download/w1xt9um1dm95mpp/ramdisk.cpio.gz
extract my config from your device.
/proc/config.gz
Click to expand...
Click to collapse
Thank you very much.
I have a questions. In normal linux complining i copy myconfig to .config and make oldconfig. But i dont how do it in android? And what are these files:
Code:
[[email protected] configs [j0]$>>> ls *arima*
arima_8226ds_ap_defconfig arima_8226ds_pdp2_defconfig arima_8226ss_dp_defconfig arima_8926ds_ap_defconfig arima_8926ds_pdp2_defconfig arima_8926ss_dp_defconfig
arima_8226ds_dp2_defconfig arima_8226ds_sp_defconfig arima_8226ss_pdp1_defconfig arima_8926ds_dp2_defconfig arima_8926ds_sp_defconfig arima_8926ss_pdp1_defconfig
arima_8226ds_dp_defconfig arima_8226ss_ap_defconfig arima_8226ss_pdp2_defconfig arima_8926ds_dp_defconfig arima_8926ss_ap_defconfig arima_8926ss_pdp2_defconfig
arima_8226ds_pdp1_defconfig arima_8226ss_dp2_defconfig arima_8226ss_sp_defconfig arima_8926ds_pdp1_defconfig arima_8926ss_dp2_defconfig arima_8926ss_sp_defconfig
[[email protected] configs [j0]$>>>
Whats is difference of these files?
Regards
pjk11 said:
Thank you very much.
I have a questions. In normal linux complining i copy myconfig to .config and make oldconfig. But i dont how do it in android? And what are these files:
Code:
[[email protected] configs [j0]$>>> ls *arima*
arima_8226ds_ap_defconfig arima_8226ds_pdp2_defconfig arima_8226ss_dp_defconfig arima_8926ds_ap_defconfig arima_8926ds_pdp2_defconfig arima_8926ss_dp_defconfig
arima_8226ds_dp2_defconfig arima_8226ds_sp_defconfig arima_8226ss_pdp1_defconfig arima_8926ds_dp2_defconfig arima_8926ds_sp_defconfig arima_8926ss_pdp1_defconfig
arima_8226ds_dp_defconfig arima_8226ss_ap_defconfig arima_8226ss_pdp2_defconfig arima_8926ds_dp_defconfig arima_8926ss_ap_defconfig arima_8926ss_pdp2_defconfig
arima_8226ds_pdp1_defconfig arima_8226ss_dp2_defconfig arima_8226ss_sp_defconfig arima_8926ds_pdp1_defconfig arima_8926ss_dp2_defconfig arima_8926ss_sp_defconfig
[[email protected] configs [j0]$>>>
Whats is difference of these files?
Regards
Click to expand...
Click to collapse
all are default configrations.
you should put config in /arch/arm/config/<here>
and rename it to something like my_defconfig
then use make ARCH=arm CROSS_COMPILE=$ROSS_COMPILE my_defconfig
because you may have to use make clean&&make mrproper many times which wiill delete .config keeping it in arch/arm/config
will kepp it safe.
and
arima_8226ds_dp_defconfig
is config for xperia e3.
arima (some sort of secret name for xperia e3)
8226 (name of cpu)
ds (d=>dual s=> sim)
dp (i don,t know)
defconfig (default config)
vinay said:
all are default configrations.
you should put config in /arch/arm/config/<here>
and rename it to something like my_defconfig
then use make ARCH=arm CROSS_COMPILE=$ROSS_COMPILE my_defconfig
because you may have to use make clean&&make mrproper many times which wiill delete .config keeping it in arch/arm/config
will kepp it safe.
and
arima_8226ds_dp_defconfig
is config for xperia e3.
arima (some sort of secret name for xperia e3)
8226 (name of cpu)
ds (d=>dual s=> sim)
dp (i don,t know)
defconfig (default config)
Click to expand...
Click to collapse
Thank you very much, Vinay.
Regards
guide updated.
added link to a guide about adding features to your kernel
if you wan,t to learn anything more just ask me..
vinay pls hlp me , nothing happens after adding this ( export CROSS_COMPILE=~/toolchain/bin/arm-cortex_a7-linux-gnueabihf-) line in terminal , do i need to install some xtra apps in ubuntu? because i have install ubuntu for the 1st time through virtualbox, and pls make a video for this guide.
himfa71 said:
vinay pls hlp me , nothing happens after adding this ( export CROSS_COMPILE=~/toolchain/bin/arm-cortex_a7-linux-gnueabihf-) line in terminal , do i need to install some xtra apps in ubuntu? because i have install ubuntu for the 1st time through virtualbox, and pls make a video for this guide.
Click to expand...
Click to collapse
nothing will happen after that command actually it tells terminal $CROSS_COMPILE is equal to home/username/toolchain/bin/arm-cortex_a7-linux-gnueabihf-
vinay pls see this , im getting these error,
Code:
[email protected]:~$ cd kernel
[email protected]:~/kernel$ export CROSS_COMPILE=~/toolchain/bin/arm-cortex_a7-linux-gnueabihf-
[email protected]:~/kernel$ make ARCH=arm CROSS_COMPILE=$CROSS_COMPILE Nitrogen_defconfig
drivers/cpufreq/Kconfig:236:warning: multi-line strings not supported
drivers/cpufreq/Kconfig:288:warning: multi-line strings not supported
drivers/net/wireless/ath/Kconfig:27: can't open file "drivers/net/wireless/ath/carl9170/Kconfig"
make[1]: *** [Nitrogen_defconfig] Error 1
make: *** [Nitrogen_defconfig] Error 2
[email protected]:~/kernel$ make ARCH=arm CROSS_COMPILE=$CROSS_COMPILE -j3
scripts/kconfig/conf --silentoldconfig Kconfig
drivers/cpufreq/Kconfig:236:warning: multi-line strings not supported
drivers/cpufreq/Kconfig:288:warning: multi-line strings not supported
drivers/net/wireless/ath/Kconfig:27: can't open file "drivers/net/wireless/ath/carl9170/Kconfig"
make[2]: *** [silentoldconfig] Error 1
make[1]: *** [silentoldconfig] Error 2
make: *** No rule to make target `include/config/auto.conf', needed by `include/config/kernel.release'. Stop.
[email protected]:~/kernel$
himfa71 said:
vinay pls see this , im getting these error,
Code:
[email protected]:~$ cd kernel
[email protected]:~/kernel$ export CROSS_COMPILE=~/toolchain/bin/arm-cortex_a7-linux-gnueabihf-
[email protected]:~/kernel$ make ARCH=arm CROSS_COMPILE=$CROSS_COMPILE Nitrogen_defconfig
drivers/cpufreq/Kconfig:236:warning: multi-line strings not supported
drivers/cpufreq/Kconfig:288:warning: multi-line strings not supported
drivers/net/wireless/ath/Kconfig:27: can't open file "drivers/net/wireless/ath/carl9170/Kconfig"
make[1]: *** [Nitrogen_defconfig] Error 1
make: *** [Nitrogen_defconfig] Error 2
[email protected]:~/kernel$ make ARCH=arm CROSS_COMPILE=$CROSS_COMPILE -j3
scripts/kconfig/conf --silentoldconfig Kconfig
drivers/cpufreq/Kconfig:236:warning: multi-line strings not supported
drivers/cpufreq/Kconfig:288:warning: multi-line strings not supported
drivers/net/wireless/ath/Kconfig:27: can't open file "drivers/net/wireless/ath/carl9170/Kconfig"
make[2]: *** [silentoldconfig] Error 1
make[1]: *** [silentoldconfig] Error 2
make: *** No rule to make target `include/config/auto.conf', needed by `include/config/kernel.release'. Stop.
[email protected]:~/kernel$
Click to expand...
Click to collapse
did you used git clone or downloaded zip.
TRY
Code:
chmod -R 777 ~/kernel
and ~/kernel is path to folder which contains kernel source code.
i downloaded the zip, and after this "chmod -R 777 ~/kernel" command im still getting same error,
thanks vinay for help, but now im leaving this kernel compiling, thanks.

[Completed] How to create Device tree for Android Rom building

How to create Device tree for Android Rom building
I assume you already downloaded source code
before we start please do following
1. Install unpackbootimg
Go to https://github.com/CoolDevelopment/android_bootimg_tools and download as a zzip or use git clone command.
extract files
cd directory
make
now you will find unpackbootimg and mkbootimg in this directory
2. copy unpackbootimg and mkbootimg to /usr/bin
sudo cp unpackbootimg /usr/bin
sudo cp mkbootimg /usr/bin
Note this is necessary if you are getting error
" "unpackbootimg not found. Is your android build environment set up and have the host tools been built?
3. Extracting boot.img from your device
What we need
1. A rooted phone
2. Enable Usb Debugging in Developer Mode
3. ADB command knowldge
connect your phone via usb cable ensure that usb debugging is enabled
open terminal and type adb devices
if it is showing your device's serial no than we are ready to go
C. type
adb shell
su
ls -l /dev/block/platform/mtk-msdc.0/11230000.msdc0/by-name
please note this command may vary by device to device. What we are doing here we want to know partition scheme of your device.
note down block name of /boot partition
example it will be like boot -> /dev/block/mmcblk0p7
d. type this
dd if=/dev/block/mmcblk0p7 of=/sdcard/boot.img
now boot.img succesfully transfered to your SD card Copy it to your Desktop
now path should be /home/user/Desktop/boot.img or similar but remeber path name alternatively you can type pwd in terminal to know this
creating device/Vendor-Name/Device-codename
cd to your working directory
Syntex: ./build/tools/device/mkvendor.sh Vendor-Name Device-CodeName ~/Path to your/boot.img
Example:
./build/tools/device/mkvendor.sh GIONEE GIONEE_WBL7511 ~/Desktop/boot.img
Now it will create following file in /device/Vender-Name/Device_CodeName
AndroidBoard.mk
cm.mk
recovery.fstab
AndroidProducts.mk
device_GIONEE_WBL7511.mk
system.prop
BoardConfig.mk
kernel
Note1: Please create vendorsetup.mk file in this directory manually. To use source build/envsetup.sh
Note2: Please double check BoardConfig.mk file and ensure every partition size is correct in this file. Also check recovery.fstab showing correct mount point
Note3: Here kernel is prebuilt kernel. If you want to compile kernel as well as download your kernel source in /kernel/Vender-Name/Device_CodeName dirtectory. You will find kernel related config in BoardConfig.mk
Please note it will not create vendorsetup.sh file and following Directory
1./vendor/Vender-Name/Device_CodeName
2. /kernel/Vender-Name/Device_CodeName
Wait for next post for more info
Thank You
http://azodik.com/
Thread closed as Assist is not the place to post guides

How To Compile Rom From Source full guide step by step by Jai Sharma

How To Compile Rom From Source
We need following things to compile ROM from source
A Computer( Linux or Mac)
Java JDK
Some required Package for building Rom
Rules for Accessing USB devices
Choosing a Branch
Installing Java on the Machine
Here i am using Ubuntu(14.04 LTS) as a Linux machine but it should work for other Linux variant
Open a terminal and type following
sudo apt-get purge openjdk-\* icedtea-\* icedtea6-\*
This command will remove other existing openjdk installation
2. Once java is uninstalled use following command for installing correct version of java
sudo apt-get update
sudo apt-get install openjdk-s8-jdk
Check java version by typing following command
java -version
2. Installing some required packages
Type following in terminal to install some required packages
sudo apt-get install git-core gnupg flex bison gperf build-essential \
zip curl zlib1g-dev gcc-multilib g++-multilib libc6-dev-i386 \
lib32ncurses5-dev x11proto-core-dev libx11-dev lib32z-dev ccache \
libgl1-mesa-dev libxml2-utils xsltproc unzip
3. Downloading Repo Tool and setting PATH
mkdir ~/bin
curl http://commondatastorage.googleapis.com/git-repo-downloads/repo > ~/bin/repo
chmod a+x ~/bin/repo
Now open the bashrc file and so we can include the repo tool:
sudo nano ~/.bashrc
Add following in the end of the file
export PATH=~/bin:$PATH
Now we need to reload bash variables to include the new path:
source ~/.bashrc
4. Initializing a Repo client
Now we need to create a directory where our source code will be downloaded. I am creating a directory AOSP here
mkdir AOSP
cd AOSP
In the following command insert your name and email address
git config --global user.name "Your_Name"
git config --global user.email "Your_EMail"
Now care fully select your branch whether you are downloading aosp or Cyanogenmod
repo init -u https://android.googlesource.com/platform/manifest -b android-7.1.0_r7
type your desired branch name after the -b. This also applies to Cyanogenmod
5. Downloading source code
Now start downloading source code by typing following
repo sync
Note: this may take some time depending upon your internet speed and also please make sure you have enough storage
6. Configuring USB Access
type your username in following command and type enter
wget -S -O - http://source.android.com/source/51-android.rules | sed "s/<username>/$USER/" | sudo tee >/dev/null /etc/udev/rules.d/51-android.rules; sudo udevadm control --reload-rules
7. Now building Rom for your device
To build rom we need following
Device tree
Vendor tree
kernel
Finding device tree and Vendor Tree
To find your device tree search on Github or similar sources with your device code name. If you are lucky you will find it there and believe me it is the easiest way to build your rom rather than creating device tree and vendor tree from scratch
Your device tree will go on following location
device/device_manufacturer_name/device_codename
Same for vendor tree
vendor/device_manufacturer_name/device_codename
If you find device tree and vendor tree then how to download it
For device tree
git clone “Github url” -b (branch_tag) device/device_manufacturer_name/device_codename
2. For vendor tree
git clone “Github url” -b (branch_tag) vendor/device_manufacturer_name/device_codename
Note1: You may need to change some files if everything is not working or giving you some error in rom compiling. Look into output to find out error. You can use Google if you can't correct it
Note2: You may be not found your device tree and vendor tree then what to do?. You may need to create them. Please follow my guide
Creating Device tree and vendor tree from scratch
For creating device tree
http://azodik.com/how-to-create-device-tree-for-android-rom-building/
2. For creating Vendor tree
“Coming Soon”
Kernel
For kernel part if you are lucky than you can find your kernel source from Github or similar sources. If not you can use your prebuilt kernel Foolow this to extract your kernel http://azodik.com/how-to-create-device-tree-for-android-rom-building/
Kernel location
/kernel/device_manufacturer_name/device_codename
Downloading your kernel
Manually download it and extract to kernel location or use following command
git clone “Github url” kernel/device_manufacturer_name/device_codename
Note1: You can use your prebuilt kernel. To use your prebuilt kernel edit BoardConfig.mk file in your device tree.
Note2: If you created device tree from scratch following my guide. Use of prebuilt kernel set to default
How to build
Use following command for building your rom
Source build/envsetup.sh
lunch
Now select your device from menu
3. make or mka
I hope you found it usefull. Please follow my website for interesting guide. Please comment here if you face any error.
Thank You
Really a great guide bro!
Can you please post a rom porting guide? easy to understand and effective
sohamsen said:
Really a great guide bro!
Can you please post a rom porting guide? easy to understand and effective
Click to expand...
Click to collapse
Thank you very much. Sure i will post soon.
jai44 said:
Thank you very much. Sure i will post soon.
Click to expand...
Click to collapse
Nice tutor.. But it looks need an enormous data usage to do that. If i wanna porting rom for example slim rom nougat to my device (kenzo) can you give me some info how many data should i provide and how to do that? Thanks
thanks
elanglangit said:
Nice tutor.. But it looks need an enormous data usage to do that. If i wanna porting rom for example slim rom nougat to my device (kenzo) can you give me some info how many data should i provide and how to do that? Thanks
Click to expand...
Click to collapse
You can follow this guide. Read it again and again. I hope soon you will build your own Rom. You can comment here if you face any problem
While compiling pure nexus. I got this error. How to solve thishttp://cloud.tapatalk.com/s/589b479597bc0/tapatalk_1486571095280.jpeg?
@jai44 wow! you make it look so easy! :') I have subscribed to this thread. When I get free time, Ill build my own rom
Thank you so much!
not able to sync rr source...
After i type repo sync it doesnt do anything. I double checked my site direction and it appears to be fine. Any hints??
could you please spare some time and make a post about how to create vendor tree?
can anyone help with this error while porting dotos rom for lenovo a700
/home/ubuntu/android/dotos/out/build-dot_aio_row.ninja is missing, regenerating...
device/lenovo/aio_row/board/ril.mk:4: error: cannot assign to readonly variable: PRODUCT_PROPERTY_OVERRIDES
10:14:07 ckati failed with: exit status 1
and ril.mk script
# RIL
BOARD_PROVIDES_RILD := true
BOARD_RIL_CLASS := ../../../device/lenovo/aio_row/ril
PRODUCT_PROPERTY_OVERRIDES += ro.telephony.sim.count=2
Hy I'm building lineage os 14.1 for SM-J250F
Samsung Galaxy J2 Pro 2018 (SM-J250F) but im not going to giveup .. so I'm started to build roms my self .. fixed some build errors and successfully compiled but it stuck on Samsung logo(no bootanimation) also took pstore logs but it only store recovery logs .. sir can you please help to make it boot? Can u kindly tell me what changes i need to do in sources to make it boot? Or can u fix the issue in my tree? Please I'm hoping your feedback
Source android base : Android 7.1.1
Tried compilation : Lineage OS 14.1
I cant post my tree links due to new account please pm
jai44 said:
How To Compile Rom From Source
We need following things to compile ROM from source
A Computer( Linux or Mac)
Java JDK
Some required Package for building Rom
Rules for Accessing USB devices
Choosing a Branch
Installing Java on the Machine
Here i am using Ubuntu(14.04 LTS) as a Linux machine but it should work for other Linux variant
Open a terminal and type following
sudo apt-get purge openjdk-\* icedtea-\* icedtea6-\*
This command will remove other existing openjdk installation
2. Once java is uninstalled use following command for installing correct version of java
sudo apt-get update
sudo apt-get install openjdk-s8-jdk
Check java version by typing following command
java -version
2. Installing some required packages
Type following in terminal to install some required packages
sudo apt-get install git-core gnupg flex bison gperf build-essential \
zip curl zlib1g-dev gcc-multilib g++-multilib libc6-dev-i386 \
lib32ncurses5-dev x11proto-core-dev libx11-dev lib32z-dev ccache \
libgl1-mesa-dev libxml2-utils xsltproc unzip
3. Downloading Repo Tool and setting PATH
mkdir ~/bin
curl http://commondatastorage.googleapis.com/git-repo-downloads/repo > ~/bin/repo
chmod a+x ~/bin/repo
Now open the bashrc file and so we can include the repo tool:
sudo nano ~/.bashrc
Add following in the end of the file
export PATH=~/bin:$PATH
Now we need to reload bash variables to include the new path:
source ~/.bashrc
4. Initializing a Repo client
Now we need to create a directory where our source code will be downloaded. I am creating a directory AOSP here
mkdir AOSP
cd AOSP
In the following command insert your name and email address
git config --global user.name "Your_Name"
git config --global user.email "Your_EMail"
Now care fully select your branch whether you are downloading aosp or Cyanogenmod
repo init -u https://android.googlesource.com/platform/manifest -b android-7.1.0_r7
type your desired branch name after the -b. This also applies to Cyanogenmod
5. Downloading source code
Now start downloading source code by typing following
repo sync
Note: this may take some time depending upon your internet speed and also please make sure you have enough storage
6. Configuring USB Access
type your username in following command and type enter
wget -S -O - http://source.android.com/source/51-android.rules | sed "s/<username>/$USER/" | sudo tee >/dev/null /etc/udev/rules.d/51-android.rules; sudo udevadm control --reload-rules
7. Now building Rom for your device
To build rom we need following
Device tree
Vendor tree
kernel
Finding device tree and Vendor Tree
To find your device tree search on Github or similar sources with your device code name. If you are lucky you will find it there and believe me it is the easiest way to build your rom rather than creating device tree and vendor tree from scratch
Your device tree will go on following location
device/device_manufacturer_name/device_codename
Same for vendor tree
vendor/device_manufacturer_name/device_codename
If you find device tree and vendor tree then how to download it
For device tree
git clone “Github url” -b (branch_tag) device/device_manufacturer_name/device_codename
2. For vendor tree
git clone “Github url” -b (branch_tag) vendor/device_manufacturer_name/device_codename
Note1: You may need to change some files if everything is not working or giving you some error in rom compiling. Look into output to find out error. You can use Google if you can't correct it
Note2: You may be not found your device tree and vendor tree then what to do?. You may need to create them. Please follow my guide
Creating Device tree and vendor tree from scratch
For creating device tree
http://azodik.com/how-to-create-device-tree-for-android-rom-building/
2. For creating Vendor tree
“Coming Soon”
Kernel
For kernel part if you are lucky than you can find your kernel source from Github or similar sources. If not you can use your prebuilt kernel Foolow this to extract your kernel http://azodik.com/how-to-create-device-tree-for-android-rom-building/
Kernel location
/kernel/device_manufacturer_name/device_codename
Downloading your kernel
Manually download it and extract to kernel location or use following command
git clone “Github url” kernel/device_manufacturer_name/device_codename
Note1: You can use your prebuilt kernel. To use your prebuilt kernel edit BoardConfig.mk file in your device tree.
Note2: If you created device tree from scratch following my guide. Use of prebuilt kernel set to default
How to build
Use following command for building your rom
Source build/envsetup.sh
lunch
Now select your device from menu
3. make or mka
I hope you found it usefull. Please follow my website for interesting guide. Please comment here if you face any error.
Thank You
Click to expand...
Click to collapse
how much storage is used to sync sir?
BryanHafidz said:
how much storage is used to sync sir?
Click to expand...
Click to collapse
depend on rom for me los17 took almost 70gb

[GUIDE]DualBootPatcher Use, Build from Source/using Docker/Travis And Add New Devices

Hi all DualBootPatcher fans, in this thread i'll try to explain all things about DualBootPatcher, so if your user please read this post carefully then continue to other posts, and if you developer you can skip it and go to post #2 directly
Part 0: Introduction & How to use DualBootPatcher?
What is DualBootPatcher?
DualBootPatcher is an open-source app that allows multiple ROMs to be installed on a single Android device. It does its best to work with existing code and does not require explicit support from ROMs. There are currently 270+ supported devices and their variations.
It's originally developed by the amazing developer @chenxiaolong with help of many contributors
Click to expand...
Click to collapse
What does the app do ?:
It patches...
Custom kernels for dual boot support
ROMs so that they can be installed as secondary
Google Apps packages for AOSP-based ROMs
SuperSU so that it can be used in the secondary ROM
Where can i find it?
Website
XDA Main Thread
Github
What's supported ?
Except Toaster and Alarm clocks pretty much everything is supported.
Click to expand...
Click to collapse
How to use the App?
- Download, install and open the app.
- Swipe to the right to open the menu. Click "ROMS". Now if this is the first time you use it, it will ask you if you want to set kernel. Do so!
- After it has finished go to ROM Settings (primary ROM 3 dot menu) and select Update Ramdisk. It will update it and will ask you to reboot. Press Reboot Now, or Reboot later.
- Now Download any ROM you like and open the app again and open the menu and open Patch Zip File from the menu. Ensure that your Device is set to (yourdevicename) and under Partition configuration select secondary/dataslot (will install 2nd ROM in /system) or data slot.
- Click continue and select where to save the patched file.
- You should see the file is being put in "Queue". Just click the confirm button to the upper right.
Note: If you want to go back, just swipe the ROM in queue to right and start over.
- The app will patch the zip. When done, go back to "ROMs".
- Click "Flash zip files" (the big pink button on the lower right). Click the pink plus button to add your previously patched zip file.
- Locate the file you have patched in step 7. Unless you have changed the name there, it should be something like ROM_name_partition_config_ID.zip (like RR-N-v5.8.3-20170707-cheeseburger-Unofficial_dual.zip).
- Click on that file and choose "Keep location". Now confirm the flash with the button on the upper right side.
Note: You can also install the patched zip files in recovery.
- It will now open the terminal and begin flashing the file. This requires some patience. After it has flashed the file you'll see success message in green.
- Now click back and you should see your newly installed ROM along with the Primary ROM.
Note: You can find more options by clicking on the three buttons on each ROM.
- Now reboot and wait till finishing 2nd ROM first boot. install DualBootPatcher apk so you can easily switch ROMs, there is another way to change ROMs: flash DualBootUtilities.zip and switch ROM manually.
Note: Using Bootui:
- Open app then select settings and press install (update) bootui. then Swipe to the right to open the menu. Click "ROMS" again and open secondary ROM Settings) and select Update Ramdisk, Now you can change ROMs simply using boot ui (something like grub bootloader but it works like twrp)
Partitions Configurations:
The patcher offers several locations for installing ROMs:
Primary: This is normally used for installing a zip to the primary ROM. It is not required, but is strongly recommended because it has code to prevent the zip from inadvertently affecting other ROMs.
Dual: Dual/Secondary is the first multiboot installation location. It installs to the system partition. This is a good spot for installing a second ROM because it doesn't take any space away from the internal storage.
Multi-slots: There are 3 multislots: multi-slot-1, multi-slot-2, multi-slot-3. These install to the cache partition. This is specifically for devices, like the Galaxy S4, that have a massive cache partition.
Data-slots: There can be an unlimited number of data slots. These install to the data partition and eat up space on the internal storage. This is useful for devices where the system partition is nearly full and the cache partition is tiny. These slots are named "data-slot-[id]", where "id" is something you provide in the app.
Extsd-slots: There can be an unlimited number of extsd slots. These install to the external SD card, which is useful as it keeps the ROMs off of the internal storage. Note that the ROM's data files are still stored on the data partition.
Apps and Data sharing:
DualBootPatcher very recently got support for sharing apps and their data across ROMs. Maybe sharing is somewhat of a misleading term. The feature actually makes Android load the shared apps and data from a centralized location, /data/multiboot/_appsharing. So you're not sharing apps from one ROM to another per se. The ROMs are just loading the apps from one shared location. Let me make this clearer with an analogy.
Think of the people in a company office as ROMs. You want to share with your coworkers some documents (apps). Instead of telling them to come over to your desk to see those documents (sharing apps from one ROM to another), everyone goes to the conference room to look at the documents together (loading apps from a shared location). That's how app and data sharing is implemented.
Click to expand...
Click to collapse
To use app sharing, follow these steps in every ROM that you want to use app sharing: (doesn't work with JB ROMs)
Install the app you want to share
Open DualBootPatcher and go to "App Sharing" in the navigation drawer
Enable individual app sharing
Tap "Manage shared applications" and enable APK/data sharing for the app
Reboot
When you uninstall an app that's shared, it simply become unshared for the current ROM. That way, other ROMs are not affected. To continue the analogy above, if you quit your job, you won't shred the documents that everybody else was looking at.
If you unshare an app's data, it will go back to using the data it had before it was shared. In other words, you leave the conference room and go back to work on your own documents at your desk.
Click to expand...
Click to collapse
How to Tips:
How to boot to another ROM ?
This is simple ... There is no reboot to primary, secondary or whatever. So all you have to do is:
1) Go to ROMs section of the App.
2) Click on the ROM you want to boot to. You should see "Switching ROM" message. After few seconds, you should see a report message saying that "ROM successfully switched".
3) Now just do a normal reboot of your device. See the magic! It should boot to the ROM you have switched on step 2.
Note: You can find more options by selecting the three buttons on each ROMs (like creating reboot widgets for directly rebooting to specific rom).
You also need to install the App to all of the ROMs you install. Otherwise, you want be able to boot to other ROMs!
Other How to ?
Wipe /cache, /data, /system, or dalvik-cache?
The easiest way is to do it from the app while booted in another ROM. Just go to "Roms" in the navigation drawer, tap the 3 dots options menu for the ROM you want to wipe, and tap "Wipe ROM".
Update the primary ROM?
Patch the zip for primary and flash it. The "primary" installation target is designed so that other ROMs won't be affected when you want to flash something for the primary ROM.
Update a non-primary ROM?
Patch and flash the zip exactly like how you did it the first time.
Flash a mod or custom kernel for the primary ROM?
Patch it for primary before flashing. If the zip does not wipe /cache, it is also safe to flash it directly.
Flash a mod or custom kernel for a non-primary ROM?
Just patch and flash it
Now, You're perfect DualBootPatcher user,so let's enter the main guide !
Guide Index:
Part 1: How to build DualBootPatcher from source manually?
Part 2: How to build DualBootPatcher using docker images?
Part 3: How to build DualBootPatcher using TravisCI?
Part 4: How to add new Devices to DualBootPatcher?
Part 5: How to submit new Devices to official DualBootPatcher support?
Extra: How to share apps (apk) between ROMs? (soon!)
Before we start you should know that DBP is not just android app, there is versions for windows and linux also and in this guide i'll talk about app and linux version only, i don't use windows
Part 1: How to build DualBootPatcher from source?
When you deeply exploring DualBootPatcher repository you'll find all information and guides you need but for some people instructions isn't clear enough, so let me explain it here
- You'll need linux, whichever distribution you use. but i'm sure building works on [Debian-Ubuntu-Fedora-Arch] and all its derivations.
A) Prerequisites:
- You'll need these packages whatever version you want to build:
Android NDK
Currently NDK r15 is required to build, you can get it here
Download, Extract and rename it to "android-ndk"
Code:
wget https://dl.google.com/android/repository/android-ndk-r15-linux-x86_64.zip && unzip android-ndk-r15-linux-x86_64.zip && mv android-ndk-r15 android-ndk
And then export android ndk:
Code:
echo "export ANDROID_NDK=$(pwd)/android-ndk" >> ~/.bashrc
echo "export ANDROID_NDK_HOME=$(pwd)/android-ndk" >> ~/.bashrc
cmake
DBP needs cmake 3.7.2 or higher. you need to download it here
Downloading & Extract command:
Code:
wget https://cmake.org/files/v3.7/cmake-3.7.2.tar.gz && tar xzf cmake-3.7.2.tar.gz
extract to folder and run the following commands in cmake folder
Code:
sed -i 's|cmake_options="-DCMAKE_BOOTSTRAP=1"|cmake_options="-DCMAKE_BOOTSTRAP=1 -DCMAKE_USE_OPENSSL=ON"|' bootstrap
./bootstrap
make
sudo make install
OpenSSL
i'm successfully build using openssl-1.1.0c, download here and extract.
Code:
wget https://www.openssl.org/source/openssl-1.1.0c.tar.gz && tar xzf openssl-1.1.0c.tar.gz
open openssl-1.1.0c folder and install it
Code:
./config shared --prefix=/usr/local/ssl --openssldir=/usr/local/ssl
make
sudo make install
echo 'PATH=${PATH}:/usr/local/ssl' >> ~/.bashrc
gtest
Install on Ubuntu / Debian:
Code:
sudo apt-get install libgtest-dev
On Fedora:
Code:
sudo dnf install gtest-devel
On Archlinux:
Code:
sudo pacman -S gtest
yaml-cpp
Install on Ubuntu / Debian using
Code:
sudo apt-get install libyaml-cpp-dev
On Fedora
Code:
sudo dnf install yaml-cpp-devel
On Archlinux:
Code:
sudo pacman -S yaml-cpp
Other General packages that must be installed: [Skip this if you have android build environment :good: ]
Ubuntu / Debian:
Code:
sudo apt-get install ccache libboost-dev libssl-dev openssl python-minimal build-essential libfontconfig1 findutils git make libprocps-dev unzip zip gcc-multilib g++-multilib lib32ncurses5-dev transifex-client gnupg mesa-common-dev libglu1-mesa-dev
Fedora:
Code:
sudo dnf install ccache findutils gcc-c++ git make procps-ng unzip zip gnupg ncurses-compat-libs transifex-client openssl-devel
Archlinux:
Code:
sudo pacman -S ccache boost openssl lib32-openssl findutils git make procps-ng unzip zip gnupg gcc-multilib ncurses
Code:
sudo pacaur -S transifex-client ncurses5-compat-libs lib32-ncurseslib32-ncurses5-compat-libs
- For building android app you need:
Android SDK
You need to install SDK using android studio ( build-tools 25.0.3, platforms android-25, platform-tools and tools )
or install from terminal:
Code:
mkdir -p android-sdk && cd android-sdk
wget -q https://dl.google.com/android/repository/platform-tools_r25.0.3-linux.zip && unzip -qq platform-tools_r25.0.3-linux.zip
wget -q https://dl.google.com/android/repository/build-tools_r25.0.3-linux.zip && unzip -qq build-tools_r25.0.3-linux.zip
wget -q https://dl.google.com/android/repository/tools_r25.2.3-linux.zip && unzip -qq tools_r25.2.3-linux.zip
Then Export it:
Code:
echo "export ANDROID_HOME=$(pwd)" >> ~/.bashrc
echo "export PATH=${PATH}:${ANDROID_HOME}/tools" >> ~/.bashrc
JDK 1.8
Ubuntu / Debian:
Code:
sudo apt-get install openjdk-8-jdk openjdk-8-jdk-headless
Fedora:
Code:
sudo dnf install java-1.8.0-openjdk-devel java-1.8.0-openjdk-headless
Archlinux:
Code:
sudo pacman -S jdk8-openjdk
Other packages:
Ubuntu / Debian:
Code:
sudo apt-get install lib32stdc++-6-dev
Fedora:
Code:
sudo dnf install glibc.i686 libstdc++.i686
Archlinux:
Code:
sudo pacman -S glibc libstdc++5 lib32-libstdc++5
- And for linux version you need:
qt5
it must be 5.3 or higher
Ubuntu / Debian:
Code:
sudo apt-get install qttools5-dev-tools libqt5core5a
Fedora:
Code:
sudo dnf install qt5-qtbase-devel
Archlinux:
Code:
sudo pacman -S qt5-base
Other packages:
Ubuntu / Debian:
Code:
sudo apt-get install libarchive-dev liblz4-tool liblzma-dev lz4-dev zlib1g-dev lib32z-dev
Fedora:
Code:
sudo dnf install libarchive-devel lz4-devel xz-devel
Archlinux:
Code:
sudo pacman -S libarchive lz4 xz lib32-xz lzip
- Some final touches:
Enable cache:
Code:
echo "export USE_CCACHE=1" >> ~/.bashrc
Reload bash environment:
Code:
source ~/.bashrc
- Cloning the source:
Code:
git clone --recursive https://github.com/chenxiaolong/DualBootPatcher.git
B) Building Android APP:
- Open DualBootPatcher folder and make new folder "build" and open it.
Code:
mkdir build && cd build/
- Now Build the app:
Code:
cmake .. -DMBP_BUILD_TARGET=android -DMBP_BUILD_TYPE=debug
make
cpack -G TXZ
make apk
And you'll find built apk in DualBootPatcher/Android_GUI/build/outputs/apk/Android_GUI-debug.apk
C) Building Utilities Zip:
Utilities Zip is AROMA based zip which enable you to switch ROMs form twrp or wipe ROM when something went wrong.
- In build folder run these commands:
Code:
make android-system_armeabi-v7a
make -C data/devices
./utilities/create.sh
you'll find built utilities.zip in DualBootPatcher/build/utilities/DualBootUtilities-9.2.0.zip
D) Building Linux App:
- In build folder run these commands:
Code:
cmake .. -DMBP_BUILD_TARGET=desktop -DMBP_PORTABLE=ON
make
cpack -G TXZ
or to pack it to zip file:
Code:
cpack -G ZIP
Special Thanks:
@oF2pks For helping me setup build environment on arch
@Ahmed Hady & @androidlover5842 Without their helps i won't be here
Part 2: How to build DualBootPatcher using docker images?
What is docker? [in case you don't know it ]
Docker is the world’s leading software container platform. Developers use Docker to eliminate “works on my machine” problems when collaborating on code with co-workers. Operators use Docker to run and manage apps side-by-side in isolated containers to get better compute density. Enterprises use Docker to build agile software delivery pipelines to ship new features faster, more securely and with confidence for both Linux, Windows Server, and Linux-on-mainframe apps.
Click to expand...
Click to collapse
Firstly, make sure you have docker installed, if not install it
From here you should choose a method you'll follow, Building docker images manually or use pre-built docker images.
A) Building docker images manually:
@chenxiaolong sir has made docker image configuration files here
all you need to do after sync the repo like part 1 is entering the following commands in DualBootPatcher directory:
Code:
./docker/generate.sh
./docker/build.sh
Note that building the docker images will take a long time and consume a lot of bandwidth--multiple gigabytes at the very least. It will download all the dependencies for building DualBootPatcher for all supported targets.
Click to expand...
Click to collapse
B) Using ready-made docker images:
i have made docker images and uploaded them to docker hub
to download "pull" it enter these commands:
Code:
docker pull yshalsager/dualbootpatcher:9.3.0-4-base
docker pull yshalsager/dualbootpatcher:9.3.0-4-android
docker pull yshalsager/dualbootpatcher:9.3.0-4-linux
Building DualBootPatcher using docker:
- To enter docker container and build DualBootPatcher make folder "builder" in DualBootPatcher directory
Code:
cd DualBootPatcher && mkdir -p builder
- Then run this to enter android build container
Code:
docker run --rm -it -e USER_ID=$(id -u) -e GROUP_ID=$(id -g) -v "$(pwd):/builder/DualBootPatcher:rw,z" -v "${HOME}/.android:/builder/.android:rw,z" -v "${HOME}/.ccache:/builder/.ccache:rw,z" -v "${HOME}/.gradle:/builder/.gradle:rw,z" yshalsager/dualbootpatcher:9.3.0-4-android bash
- After this you'll continue like normal building:
Code:
cd DualBootPatcher/builder && cmake .. -DMBP_BUILD_TARGET=android -DMBP_BUILD_TYPE=debug && make -j16 && rm -rf assets && cpack && make apk -j16
make android-system_armeabi-v7a -j16 && make -C data/devices -j16
- Now exit from container and enter linux build one:
Code:
docker run --rm -it -e USER_ID=$(id -u) -e GROUP_ID=$(id -g) -v "$(pwd):/builder/DualBootPatcher:rw,z" -v "${HOME}/.android:/builder/.android:rw,z" -v "${HOME}/.ccache:/builder/.ccache:rw,z" -v "${HOME}/.gradle:/builder/.gradle:rw,z" yshalsager/dualbootpatcher:9.3.0-4-linux bash
- Build utilities ZIP:
Code:
cd DualBootPatcher/builder && ./utilities/create.sh
- And build linux app
Code:
cmake .. -DMBP_BUILD_TARGET=desktop -DMBP_PORTABLE=ON && make -j16 && cpack
- You'll find output files in your local "builder" folder like normal build.
Part 3: How to build DualBootPatcher using TravisCI?
Travis CI is free open-source continues integration service, which simply take your project from GitHub and test / build it for you !
it's amazing solution if you don't have time/free space/mind lol :cyclops: to test your code.
- you'll need to signup Travis account, go here and press signup, enter your GitHub account details then approve Travis needed permissions and done.
- Now Fork DualBootPatcher repository to your account and create .travis.yml file in project root.
- Copy my Travis configuration to your .travis.yml
Code:
sudo: required
services:
- docker
before_install:
# Clone DualBootPatcher Repository
- git clone --recursive https://github.com/yshalsager/DualBootPatcher -b master DualBootPatcher/
# Pull docker images
- docker pull yshalsager/dualbootpatcher:9.3.0-4-base
- docker pull yshalsager/dualbootpatcher:9.3.0-4-android
- docker pull yshalsager/dualbootpatcher:9.3.0-4-linux
script:
# Make work directories
- mkdir $HOME/.android
- mkdir -p ${TRAVIS_BUILD_DIR}/DualBootPatcher/builder/ && cd ${TRAVIS_BUILD_DIR}/DualBootPatcher/
# Build APK
- |
docker run --rm -i -e USER_ID=$(id -u) -e GROUP_ID=$(id -g) -v "$(pwd):/builder/DualBootPatcher:rw,z" -v "${HOME}/.android:/builder/.android:rw,z" yshalsager/dualbootpatcher:9.3.0-4-android bash << EOF
cd DualBootPatcher/builder && cmake .. -DMBP_BUILD_TARGET=android -DMBP_BUILD_TYPE=debug && make -j16 && rm -rf assets && cpack && make apk -j16
make android-system_armeabi-v7a -j16 && make -C data/devices -j16
exit
EOF
- |
docker run --rm -i -e USER_ID=$(id -u) -e GROUP_ID=$(id -g) -v "$(pwd):/builder/DualBootPatcher:rw,z" -v "${HOME}/.android:/builder/.android:rw,z" yshalsager/dualbootpatcher:9.3.0-4-linux bash << EOF
# Build Utilities Zip
cd ~/DualBootPatcher/builder && ./utilities/create.sh
# Build Linux
cmake .. -DMBP_BUILD_TARGET=desktop -DMBP_PORTABLE=ON && make -j16 && cpack
exit
EOF
after_success:
- export TRAVIS_CURRENT_DATE=$(date +"%d%m%y-%Hh%Mm")
# Check output & md5sum
- ls -l ${TRAVIS_BUILD_DIR}/DualBootPatcher/Android_GUI/build/outputs/apk/debug/Android_GUI-debug.apk
- md5sum ${TRAVIS_BUILD_DIR}/DualBootPatcher/Android_GUI/build/outputs/apk/debug/Android_GUI-debug.apk
- ls -l ${TRAVIS_BUILD_DIR}/DualBootPatcher/builder/utilities/DualBootUtilities-9.3.0.zip
- md5sum ${TRAVIS_BUILD_DIR}/DualBootPatcher/builder/utilities/DualBootUtilities-9.3.0.zip
- ls -l ${TRAVIS_BUILD_DIR}/DualBootPatcher/builder/DualBootPatcher-9.3.0-Linux.zip
- md5sum ${TRAVIS_BUILD_DIR}/DualBootPatcher/builder/DualBootPatcher-9.3.0-Linux.zip
# Upload to transfer.sh
- cd ${TRAVIS_BUILD_DIR}/DualBootPatcher/Android_GUI/build/outputs/apk/debug/ && curl --upload-file ./Android_GUI-debug.apk https://transfer.sh/Android_GUI-debug-${TRAVIS_CURRENT_DATE}.apk
- cd ${TRAVIS_BUILD_DIR}//DualBootPatcher/builder/utilities/ && curl --upload-file ./DualBootUtilities-9.3.0.zip https://transfer.sh/DualBootUtilities-9.3.0-${TRAVIS_CURRENT_DATE}.zip
- cd ${TRAVIS_BUILD_DIR}/DualBootPatcher/builder/ && curl --upload-file ./DualBootPatcher-9.3.0-Linux.zip https://transfer.sh/DualBootPatcher-9.3.0-${TRAVIS_CURRENT_DATE}-Linux.zip
- Edit line 8 with your Repository and branch you want to build.
Code:
- git clone --recursive https://github.com/yshalsager/DualBootPatcher -b master DualBootPatcher/
- This simple TravisCI configuration builds both of apk and utilities.zip and deploy them to transfer.sh
- Now open Travis and add your DualBootPatcher fork to projects and start building :good:
- You'll find built apk md5 and links from line at the end Travis log
- Build takes about 25 mins
- When you add new commits to repository Travis will always build new apk for you !
- If you want to change something in configuration, always check its syntax to make sure it's valid YAML using this site
Part 4: How to add new Devices to DualBootPatcher?
To add your/new device to DualBootPatcher you need to get some information first then add it to DualBootPatcher devices:
- Flash GetLogs-20161128-1.zip using recovery [TWRP highly recommended]
- Copy /sdcard/logs/[Date&Time].tar to PC, extract it and let's start.
- This is new device template:
Code:
- name: (Device Name)
id: (device id)
codenames:
- (device codename1)
- (device codename2)
- (device codename3)
architecture: (device architecture)
block_devs:
base_dirs:
- (/dev/block/bootdevice/by-name)
system:
- (/dev/block/bootdevice/by-name/system)
cache:
- (/dev/block/bootdevice/by-name/cache)
data:
- (/dev/block/bootdevice/by-name/userdata)
boot:
- (/dev/block/bootdevice/by-name/boot)
recovery:
- (/dev/block/bootdevice/recovery)
extra:
- (/dev/block/bootdevice/modem)
boot_ui:
supported: true
flags:
- (TW_HAS_DOWNLOAD_MODE)
graphics_backends:
- fbdev
brightness_path: (/sys/class/leds/lcd-backlight/brightness)
max_brightness: (255)
default_brightness: (162)
pixel_format: (RGBX_8888)
theme: portrait_hdpi
- You'll edit all values between brackets.
- open logs/system/build.prop, you'll find:
ro.product.model= is your (Device Name)
ro.product.name= and ro.product.device= is your (device id) and (device codename1), if you know more names for your device add it in (device codename2) / (device codename3)
ro.product.cpu.abi= is your (device architecture)
- open logs/recovery/recovery.fstab, you'll find main device mount points, copy each mount point to it name
- open logs/recovery/recovery.log, you'll find TW_BRIGHTNESS_PATH := /sys/class/leds/lcd-backlight/brightness this is your (brightness_path)
I:Got max brightness 255 is (max_brightness)
setting GGL_PIXEL_FORMAT_RGBA_8888 is (pixel_format)
- Note: you can get these info from BoradConfig.mk in your device twrp tree.
- Now read "Partition Logs:" in recovery.log
it'll tell us second mount point, as example /system | /dev/block/mmcblk0p41
so you should add it like
Code:
system:
- /dev/block/bootdevice/by-name/system
- /dev/block/mmcblk0p41
and so on with other partitions.
- Checking more mounts: (not necessary but i recommend it)
open logs/listings/dev_full and scroll down to /dev/block/platform/soc.0 you'll find another main mount point which contain by-name and by-num folders like /dev/block/platform/soc.0/f9824900.sdhci
from /dev/block/platform/soc.0/f9824900.sdhci/by-name list copy each partition mount point to your device
- Now we're done, you should have something like
Code:
- name: Xiaomi Mi4S
id: aqua
codenames:
- aqua
architecture: arm64-v8a
block_devs:
base_dirs:
- /dev/block/bootdevice/by-name
- /dev/block/platform/soc.0/f9824900.sdhci/by-name
system:
- /dev/block/bootdevice/by-name/system
- /dev/block/platform/soc.0/f9824900.sdhci/by-name/system
- /dev/block/mmcblk0p41
cache:
- /dev/block/bootdevice/by-name/cache
- /dev/block/platform/soc.0/f9824900.sdhci/by-name/cache
- /dev/block/mmcblk0p42
data:
- /dev/block/bootdevice/by-name/userdata
- /dev/block/platform/soc.0/f9824900.sdhci/by-name/userdata
- /dev/block/mmcblk0p44
boot:
- /dev/block/bootdevice/by-name/boot
- /dev/block/platform/soc.0/f9824900.sdhci/by-name/boot
- /dev/block/mmcblk0p37
recovery:
- /dev/block/bootdevice/by-name/recovery
- /dev/block/platform/soc.0/f9824900.sdhci/by-name/recovery
- /dev/block/mmcblk0p38
boot_ui:
supported: true
graphics_backends:
- fbdev
flags:
- TW_QCOM_RTC_FIX
pixel_format: RGBX_8888
brightness_path: /sys/class/leds/lcd-backlight/brightness
max_brightness: 255
default_brightness: 162
theme: portrait_hdpi
- Open DualBootPatcher/data/devices/(your device manufacturer).yml and add your device codes. then Check your code syntax here if everything is right, make commit to add your device to your repository.
- Build apk using any method explained above to test it.
Part 5: How to submit new Devices to official DualBootPatcher support?
Once you checked everything is working, it's time to contribute to DualBootPatcher and add your device to official devices:
- First, Check you made all needed changes to add your device without problems, again check for YAML syntax because if it's wrong build won't work.
- Open DualBootPatcher Repository, press New pull request button.
- Press compare across forks and change the head fork to your username/DualBootPatcher
- Give a name and a description to your pull request, some thing like: "Add (Device Name) support" or "data: Add (device name)
- Now click the "Create pull request" green button
- Wait for your changes to be verified and merged to the project, the developer received your code and he will review, try and add it to the source code. You will be notified when your code merged.
Supported Devices by me
Here is my all contributions to DualBootPatcher:
Nokia X/XL
Nokia X2
Samsung Galaxy Win & Core
Xiaomi Mi 6
Xiaomi Redmi 4A
OnePlus 5
HTC Desire Eye
YU YUREKA BLACK
Xiaomi Mi 4S
Xiaomi Redmi Pro
Samsung Galaxy S8/S8+ [Exynos & Snapdragon]
Zenfone 2 Laser [Z00ED]
Lenovo Vibe K6
Samsung Tab S2
Samsung Galaxy Note 8 (Exynos)
If you can't add your device, you can pm me with logs tar file and i'll add it for you
Hii reserved
---------- Post added at 02:20 AM ---------- Previous post was at 02:20 AM ----------
I will tell u, how to sync apps between roms, without using double storage space for apk and libs.
---------- Post added at 02:25 AM ---------- Previous post was at 02:20 AM ----------
also can be used as multi profile
Support Nokia 6?
Qualcomm s430 Full root...
taicracker said:
Support Nokia 6?
Qualcomm s430 Full root...
Click to expand...
Click to collapse
Flash get logs
And send me
taicracker said:
Support Nokia 6?
Qualcomm s430 Full root...
Click to expand...
Click to collapse
Read this man! https://forum.xda-developers.com/showpost.php?p=73551957&postcount=5
or if you can't do it i can help, just give me the logs tar file
yshalsager said:
Read this man! https://forum.xda-developers.com/showpost.php?p=73551957&postcount=5
or if you can't do it i can help, just give me the logs tar file
Click to expand...
Click to collapse
The file where you say is located on the device. I will upload it to you soon ?
---------- Post added at 05:27 PM ---------- Previous post was at 04:28 PM ----------
yshalsager said:
Read this man! https://forum.xda-developers.com/showpost.php?p=73551957&postcount=5
or if you can't do it i can help, just give me the logs tar file
Click to expand...
Click to collapse
https://drive.google.com/file/d/0B-7MZC8TPIGtTjQyOFVydzNHV1U/view?usp=drivesdk
This is the logs file. (.tar.gz)
I am not on a PC right now. You help me. Do you need the build.prop file on your device?
addy692 said:
Flash get logs
And send me
Click to expand...
Click to collapse
https://drive.google.com/file/d/0B-7MZC8TPIGtTjQyOFVydzNHV1U/view?usp=drivesdk
?
taicracker said:
https://drive.google.com/file/d/0B-7MZC8TPIGtTjQyOFVydzNHV1U/view?usp=drivesdk
This is the logs file. (.tar.gz)
I am not on a PC right now. You help me. Do you need the build.prop file on your device?
Click to expand...
Click to collapse
I got it, apk will be here soon
yshalsager said:
I got it, apk will be here soon
Click to expand...
Click to collapse
Ok. Thanks
taicracker said:
Ok. Thanks
Click to expand...
Click to collapse
@taicracker
Here you are, please test and report me
https://transfer.sh/rqmJs/Android_GUI-debug-290817-12h43m41s.apk
yshalsager said:
@taicracker
Here you are, please test and report me
https://transfer.sh/rqmJs/Android_GU...-12h43m41s.apk
Click to expand...
Click to collapse
link die
taicracker said:
link die
Click to expand...
Click to collapse
Sorry
https://transfer.sh/rqmJs/Android_GUI-debug-290817-12h43m41s.apk
yshalsager said:
Sorry
https://transfer.sh/rqmJs/Android_GUI-debug-290817-12h43m41s.apk
Click to expand...
Click to collapse
Ok Thanks. I'm downloading. Installation is complete and then I do next. My Nokia 6 does not have a compatible room at all
I installed apk file and what do i do next?

Categories

Resources