A noob tries his hand at ROM development for the MiA1 tissot - Xiaomi Mi A1 Guides, News, & Discussion

The problem with reading the articles on XDA is that eventually you want to try out some of the things described in these pages. I am no exception. After reading the superb article https://forum.xda-developers.com/mi-a1/how-to/guide-build-rom-source-tissot-t3754723 I decided to try my hand at developing the ROM for the Xiaomi MiA1. This is my daily driver and that in itself was a strong reason for motivation.
I tried replicating the steps given in the article on my Dell Inspiron and immediately ran into issues. The basic requirements mentioned are a linux or Mac computer. So to start with I formatted my laptop. Removed windows 10 and installed Ubuntu's latest 18.04 LTS.
I believed I had the next set of requirements for custom ROM development which were
• A basic understanding of Linux based OS specifically Ubuntu.
• Ability to type and use the command line. Write or copy paste commands in the Ubuntu konsole.
• A basic understanding of programming concepts, read and update XML files, understand error messages.
• Fast internet access.
• Steady electricity supply.
• Lots and lots of patience.
This still did not solve my problem. The build would crash repeatedly. Then I read the https://source.android.com/setup/. A whole new set of requirement came up. The article said that ideally the build system should exceed these conditions
• 64 bit environment
• 100 GB of free hard disk space
• 16 GB RAM / swap space.
At home my son was about to buy a new PC and this made his old PC available. I upgrade the RAM and added a new hard disk. Now my hardware configuration was as under :
• Intel i5 processor
• 16 GB RAM
• 1 TB hard disk.
With a new hard disk I had to create a boot-able USB drive. This I achieved with Rufus. My old laptop which again had its Windows 10 installation was used to install Rufus based on the instructions i got from https://rufus.akeo.ie/
The latest version of Ubuntu I downloaded from https://www.ubuntu.com/download/desktop
Setting Ubuntu from scratch for someone used to the world of windows is not exactly easy. I found the tutorial at https://tutorials.ubuntu.com/tutorial/tutorial-install-ubuntu-desktop#0 extremely helpful.
I wrote down the steps I took in reaching the final goal of a Lineage ROM for my Mi A1.
Step 1: Setup Ubuntu - already completed
I chose the default settings as recommended in the setup.
Step 2: Installation of Java Development Kit
Once Ubuntu was up and running I opened a konsole window and typed the following commands
PHP:
sudo apt-get update
sudo apt-get install openjdk-8-jdk
Ubuntu did all the installing as I looked on.
Step 3: Installing required packages
PHP:
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 libgl1-mesa-dev libxml2-utils xsltproc unzip
Step 4: Configure your smart phone access
I next installed the tools required to access the phone. This access would be required to later flash the phone or access its internals with ADB.
PHP:
sudo apt-get install android-tools-adb
sudo apt-get install fastboot
Step 5: To creating the work directories i typed the following commands. I was following the instructions from the above two articles alternately.
PHP:
mkdir -p ~/bin
mkdir -p ~//lineage
Step 6: Installing repo
I was informed that the Android source tree is located in a Git repository which is hosted by Google. The Git repository includes metadata for the Android source. Repo is a tool that makes it easier to work with Git .
PHP:
curl [url]https://storage.googleapis.com/git-repo-downloads/repo[/url] > ~/bin/repo
Once the repo was downloaded I had to make it executable
PHP:
chmod a+x ~/bin/repo
Step 7: The next step was to initialize the lineage source
This required to change to the directory created in step number 5 above. As someone coming from the world of windows I preferred to use the GUI and open the lineage folder created by using the mouse click. There right click brings up the option of ' Open in Terminal' . Those who prefer to type commands can use the below command
PHP:
cd ~//lineage
Once I had made sure that I was in the newly created lineage folder I moved ahead.
Step 8: Now i was required to configure my Git user
PHP:
git config --global user.name "Your Name"
git config --global user.email "[email protected]"
I replaced the text within the " " with my creadentials, which I had created on https://github.com/
Step 9: Now we moved on to initializing the repo
PHP:
repo init -u [url]https://github.com/LineageOS/android.git[/url] -b lineage-15.1
A successful initialization showed a message stating that Repo is initialized in your working directory. The lineage directory now contain a .repo folder. To check hidden folder I used control + H key.
Step 8: Download the source code
This is the step where you will realize the importance of having a fast internet connection. The source code size is about 30 – 35 GB. I have a 10 mbps line and at times the download speed shoots up to 20- 25 mbps!!!* Yet it takes me anything from 4 – 10 hours to download the entire code!
My suggestion is check the time when your local ISP download speeds are at its best. For me it is during the night. I set the download up at night and go to sleep!
The command to get the source code is :
PHP:
repo sync -c -f --force-sync --no-clone-bundle --no-tags --optimized-fetch –prune
Optional Step 8 a: Making a backup of your source code
I copied the entire folder and kept a copy on an external device. This is just in case there is any need for me to format my hard disk. While copying I do not copy the .Repo and .Cache folders on to my backup. To check hidden folders press control + H keys.
Step 9: Get the source code for your specific device.
This is where I was stuck numerous times. As I understood the code which was downloaded is generic in nature. For your particular device you would need to get files which are specific to your device.
The source for all these files is github. You are targeting three sets of folders – Device, Kernel and vendor.
The git clone commands given below are for the tissot or Xiaomi MiA1 phone. Similarly other phones have their locations on GitHub from where you can get files specific to them.
PHP:
git clone [url]https://github.com/TheScarastic/andr...msm8953-common[/url] -b lineage-15.1 device/xiaomi/msm8953
git clone [url]https://github.com/TheScarastic/andr..._xiaomi_tissot[/url] -b lineage-15.1 device/xiaomi/tissot
git clone [url]https://github.com/TheScarastic/prop..._vendor_xiaomi[/url] -b lineage-15.1 vendor/xiaomi
git clone [url]https://github.com/Tissot-Developmen..._xiaomi_tissot[/url] -b 8.1 kernel/xiaomi/msm8953
Step 10: Modify Caching to speed up the build process.
PHP:
export CCACHE_DIR=./.ccache
ccache -C
export USE_CCACHE=1
export CCACHE_COMPRESS=1
prebuilts/misc/linux-x86/ccache/ccache -M 50G
Step 11: Configure JACK
JACK is the java compiler and can cause crashes – believe me! A simple fix is this command which you type next
PHP:
export _JACK_VM_ARGS="-Dfile.encoding=UTF-8 -XX:+TieredCompilation -Xmx4G"
Step 12: Cleaning up the build folder
PHP:
make clean
Step 13: Initializing the build
PHP:
source build/envsetup.sh
Step 14: Starting the build
PHP:
croot
brunch tissot
Watching the build on the screen is an interesting phase. It can get a bit tedious. In my case it took about 3 hours to complete the build. There were numerous errors that were thrown up. Files were declared as missing. After a couple of failures I realized I could search for them and then paste the file in the appropriate folders.
The one good thing about the build errors is googling for them usually gets you the right help. There would definitely be someone in some part of the world who would have run into a similar issue.
Finally after a 3 hour wait I got my zip file which when i flashed through TWRP on my MiA1. The sheer joy of having a ROM you created on your phone is indeed beyond words. It took me about a week of sitting for about ten to fifteen hours to get the various combination right, but believe me when I tell you the results are worth it.
My thanks to arunassain https://forum.xda-developers.com/member.php?u=6768248 from whose article I was able to understand the basics. He helped me with responses to my queries when I was stuck.
I further picked up from the excellent articles under the title Establishing a build Environment at https://source.android.com/setup/build/initializing
A great video that helped me was available on the topic How to build your own custom Android ROM at https://www.androidauthority.com/build-custom-android-rom-720453/
To check out the ROM's built for the MiA1 please click here
Now coming to the question if I have understood everything that is to learn about ROM development, well the answer is no. This was just the first build by a noob of a ROM which somehow worked. I have been using the ROM on my daily driver for the past one day and it is working perfectly. Having said that I still need to understand more of what happens behind the scenes in this wonder world of Custom ROM development.

Don't tell me you thought that you could build a rom on x86 processor/OS

Give him a break, he admitted that he is new to this building ROM world, I can understand that some people can think that if a proc is powerful enough they can use it to build no matter if it's a x64 or x86.
Thanks for you story mate! And don't hesitate to ask dev on telegrams or G+ to explain you some what you don't understand :good: I'm pretty sure that would love to finally have someone like you, who is truly interested in this whole world

Related

[GUIDE] Get Android 2.2 source for n00bs

I did this in Ubuntu 10.4 linux that i installed on a 14gig partition of my laptop.
You can do this in VMware or make a partition of your HDD and download wubi.exe to install linux on your partition... its easier than installing windows. You can use this to help develop if you know anything, or as i have done, used it to get the uncompiled .9.png's to edit for themeing, bypassing the draw9patch step cause the guides are already there ready to go through eclipse IDE.
INSTALL ALL LINUX UPDATES THAT WILL POPUP WITH AUTO-UPDATER BEFORE GETTING SOURCE.
on to the good stuff.... open up the terminal and run the following commands
Code:
sudo nano /etc/apt/sources.list
Then add the following to the bottom by scrolling down with your arrow keys and pasting by right clicking, CTRL-V WONT WORK.

Code:
deb http://cz.archive.ubuntu.com/ubuntu jaunty-updates main multiverse
Hit CTRL O and ENTER to save and CTRL X to return to the command line. Now lets get the repo packages cached onto your box using the following command.
Code:
sudo apt-get update
install Java 5 SDK and all the other little packages needed to build Android with this command.
32-bit x86
Code:
sudo apt-get install git-core gnupg sun-java5-jdk flex bison gperf libsdl-dev libesd0-dev libwxgtk2.6-dev build-essential zip curl libncurses5-dev zlib1g-dev valgrind
64-bit x86
Code:
sudo apt-get install git-core gnupg flex bison gperf build-essential zip curl sun-java5-jdk zlib1g-dev gcc-multilib g++-multilib libc6-dev-i386 lib32ncurses5-dev ia32-libs x11proto-core-dev libx11-dev lib32readline5-dev lib32z-dev
Code:
sudo update-java-alternatives -s java-1.5.0-sun
Code:
sudo ln -s /usr/lib32/libX11.so.6 /usr/lib32/libX11.so
moving on
INSTALLING REPO
You can install repo tool any place in your path. We choose a bin directory in our home folder:
Code:
$cd ~
$mkdir bin
$export PATH=$PATH:~/bin
$curl https://android.git.kernel.org/repo >~/bin/repo
$chmod a+x ~/bin/repo
DOWNLOADING ANDROID SOURCE CODE:
Create an empty directory to hold your working files:
Code:
$mkdir mydroid
$cd mydroid
# Run repo init to bring down the latest version of Android with all its most recent bug fixes. You must specify a URL for the manifest:
Code:
$repo init -u git://android.git.kernel.org/platform/manifest.git
NOTE: using -b option we can choose which android version to install:
Code:
$repo init -u git://android.git.kernel.org/platform/manifest.git -b froyo
To pull down files to your working directory from the repositories as specified in the default manifest, run
Code:
$repo sync
NOTE: mydroid directory size grows up to 3.6G.
BUILDING ANDROID
Simply on top of your android directory execute make command:
Code:
$cd mydroid
$make
After some time it will finish.
We get the installed file list in this file:
out/target/product/generic/installed-files.txt
Also some images are created in the same directory: (system.img userdata.img ramdisk.img)
mydroid$ ls out/target/product/generic/
android-info.txt data obj ramdisk.img symbols system.img
clean_steps.mk installed-files.txt previous_build_config.mk root system userdata.img
We have built android source code but now we want to test it:
run the Android Emulator, which comes within the Android SDK
http://developer.android.com/guide/developing/tools/emulator.html
Download Android SDK
http://developer.android.com/sdk/index.html
Install Android SDK
http://developer.android.com/sdk/installing.html
ill post the location of the framework-res.apk drawables and stock app apks to edit for those of you interested in theming.
I appreciate the effort but isn't this almost the same from android central by gbhil?
Sent from my HERO200
Wouldnt know. Die hard xda member. Im sure im not the only one that checks this site only. Im just trying to do my part. We need devs and themers with creative ideas. This is the one of the first few steps toward those interested in learning.
Sent from my Hero CDMA using XDA App
Thank You!!!!!!!
WELL DONE SIR!!!!! Thank you for posting a good repo link for froyo!!!!!
riggsandroid said:
I appreciate the effort but isn't this almost the same from android central by gbhil?
Sent from my HERO200
Click to expand...
Click to collapse
Isn't android central a different website?
myth_mn said:
Isn't android central a different website?
Click to expand...
Click to collapse
Yes, I was thinking if he took it from there to give credit. But the effort is appreciated and not trying to start a problem.
Sent from my HERO200
Made this because of all the errors i ran into and gathered all my sources of research of linux commands like changing your $PATH and installing java after my machine wouldnt find it in the repository, or not being able to get repo installed. Im just trying to help. I would have sourced gbhil if i took it from there. And this isnt a college essay, work cited pages arent necessary, its a courtesy out of respect. Besides... my sources where from blogs and most didnt have anything to do with android. Just throwin that out there. ©
epitaphromance said:
Made this because of all the errors i ran into and gathered all my sources of research of linux commands like changing your $PATH and installing java after my machine wouldnt find it in the repository, or not being able to get repo installed. Im just trying to help. I would have sourced gbhil if i took it from there. And this isnt a college essay, work cited pages arent necessary, its a courtesy out of respect. Besides... my sources where from blogs and most didnt have anything to do with android. Just throwin that out there. ©
Click to expand...
Click to collapse
no problem. i appreciate the work, I'm gonna give it a shot at some piont when I get some time to install ubuntu.
not doubting you didn't do the work, it was only fresh in my mind because i literally looked at it yesterday. thanks again for the info gathering.
Welcome
Sent from my Hero CDMA using XDA App
Just hope your patient between builds... or at least the first build unless you have a real killer machine. Tried it on my laptop (1.8ghz dual core amd)... 2hrs and had to ctrl+c cause I had to go to bed...
Just wanted to say that this also works on linux mint kde 8 (also known as user friendly linux) it is taking forever though as posted good write-up. oh by the f ubuntu. just saying
Hello,
Not sure if you follow this thread or not anymore but I get an error I was hoping someone could help me with? When I run the last "make" commange I get this error:
Checking build tools versions...
************************************************************
You are attempting to build with the incorrect version
of java.
Your version is: java version "1.6.0_20".
The correct version is: 1.5.
Please follow the machine setup instructions at
http://source.android.com/download
************************************************************
build/core/main.mk:117: *** stop. Stop.
Any ideas?
Thanks
jschill31 said:
Hello,
Not sure if you follow this thread or not anymore but I get an error I was hoping someone could help me with? When I run the last "make" commange I get this error:
Checking build tools versions...
************************************************************
You are attempting to build with the incorrect version
of java.
Your version is: java version "1.6.0_20".
The correct version is: 1.5.
Please follow the machine setup instructions at
http://source.android.com/download
************************************************************
build/core/main.mk:117: *** stop. Stop.
Any ideas?
Thanks
Click to expand...
Click to collapse
Assuming you've installed an openjdk-6-jdk package, you can override the normal build restriction of Java 5 by editing the file build/core/main.mk and changing the Java version test to match against "1.6" instead of "1.5". You'll need to do it in two places, once for java and once for javac. I never had to do this to build Cyanogenmod, but you may need to for AOSP.
Decad3nce said:
Assuming you've installed an openjdk-6-jdk package, you can override the normal build restriction of Java 5 by editing the file build/core/main.mk and changing the Java version test to match against "1.6" instead of "1.5". You'll need to do it in two places, once for java and once for javac. I never had to do this to build Cyanogenmod, but you may need to for AOSP.
Click to expand...
Click to collapse
Decad3nce, thanks for posting so fast. The funny thing is I figured it out within 5 minutes of posting but got sucked in to finalizing my source code that I am now just getting back to the post. There are several here in this forum that really help out and you are one of them. I am just now getting brave enough to start cooking but catch on fast. Can't wait to see what you, nfinite and beezy do to the wildfire port!

[TUTORIAL/DEV]Build AOSP Android 2.3.7 for Allwinner A10 tablets (Teclast P76Ti)

Hi!
I haven't really found any kind of guides on how to build a complete AOSP android build from source (kernel and software) for Allwinner A10 tablets like the Ainol Novo 7 Advanced or the Teclast P76Ti.
I have a Teclast P76TI (rev4), and the following guide is only tested on such a device. As it's mostly based on the source drop of the Ainol Novo 7 Advanced, it should also work on that too.
Part 1
Part 1: Preparations
A: Preconditions
For building and creating a LiveSuite flashable package you will need the following:
For building the kernel and android you will need a 64 bit Linux machine. Ubuntu 10.04 64 bit is preferred for Gingerbread builds
For creating the LiveSuite flashable images, and actually flashing you will need a Windows machine. Windows 7 x64 works fine, as should Windows XP 32 bit too.
You will also need a working LiveSuite image file, for your tablet. Make sure that you can flash it to your device without problems!
Virtual machines are fine, if you have enough memory available. To build Android in a VM, you should give it at least 2GB of RAM. Alternatively if you're using Linux, you can create a Windows VM for the image creation or flashing part.
For the rest of the tutorial I will assume you are using a Linux Virtual Machine on a Windows box.
For building the kernel and AOSP you will need at least 35GB of free space in your linux machine (the more the better). To create the images you will need an additional 2GB of space on your Windows machine.
B: Getting the kernel and AOSP sources
First initialize your Linux machine according to this page: http://source.android.com/source/initializing.html
Here are the most important commands:
Code:
$ sudo add-apt-repository "deb http://archive.canonical.com/ lucid partner"
$ sudo apt-get update
$ sudo apt-get install sun-java6-jdk
$ sudo apt-get install git-core gnupg flex bison gperf build-essential \
zip curl zlib1g-dev libc6-dev lib32ncurses5-dev ia32-libs \
x11proto-core-dev libx11-dev lib32readline5-dev lib32z-dev \
libgl1-mesa-dev g++-multilib mingw32 tofrodos python-markdown \
libxml2-utils xsltproc
$ mkdir ~/bin
$ PATH=~/bin:$PATH
$ curl https://dl-ssl.google.com/dl/googlesource/git-repo/repo > ~/bin/repo
$ chmod a+x ~/bin/repo
// Additonal commands for Ubuntu 10.10:
$ sudo ln -s /usr/lib32/mesa/libGL.so.1 /usr/lib32/mesa/libGL.so
// Additonal commands for Ubuntu 11.10:
$ sudo apt-get install libx11-dev:i386
Now create a directory on your linux machine. The path should contain no spaces in it. Inside this directory first pull the kernel source from the allwinner github page:
Code:
$ git clone https://github.com/allwinner/linux-2.6.36 lichee
Make sure that the kernel resides in the lichee directory
Now download AOSP Android. We will use Gingerbread version 2.3.7:
Code:
$ mkdir android
$ cd android
$ repo init -u https://android.googlesource.com/platform/manifest -b android-2.3.7_r1
$ repo sync
Allwinner uses a special init, which has a few additional commands that you have to download too:
Code:
$ cd system/core
$ git pull git://github.com/sztupy/allwinner_android_system_core.git
$ cd ../..
You will also need the device descriptors for the tablets:
Code:
$ cd device
$ git clone git://github.com/sztupy/android_device_softwinner.git softwinner
$ cd ..
C: ARM compiler
You might simply use a compiler that is supplied for AOSP, they are inside the android/prebuilt/linux-x86/toolchain/arm-eabi-4.4.3/ directory. Alternatively you can also download the ARM compiler of CodeSourcery. Get the arm-2009q3 / arm-none-linux-gnueabi version, and unpack it inside a directory.
If ready, go on to next step: building the kernel
Part 2: Building the kernel
Change to the directory of the kernel. Now edit the file scripts/build_sun4i_crane.sh
Change the line "export CROSS_COMPILE=" to point to the ARM compiler. For example if you extracted the CodeSourcery files to /opt then use:
Code:
export CROSS_COMPILE=/opt/arm-2009q3/bin/arm-none-linux-gnueabi-
The default .config file is more or less the same that is supplied with your tablet. On the Teclast P76TI you can actually extract the .config file used from /proc using "adb pull /proc/config.gz" Not sure about other vendors.
Now you have to compile. Issue the command:
Code:
./build.sh -p sun4i_crane
This will build the kernel and modules inside the the "output" directory.
Next step is to compile Android
Part3
Part 3: Building Android
Go to the android directory. Now setup android using:
Code:
$ source build/envsetup.sh
$ lunch
You will get simething like this:
Code:
You're building on Linux
Lunch menu... pick a combo:
1. generic-eng
2. simulator
3. full_passion-userdebug
4. full_crespo4g-userdebug
5. full_crespo-userdebug
6. crane_Ainol_Novo7A-eng
7. crane_Teclast_P76TI_REV4-eng
Which would you like? [generic-eng]
Here select your device (option 6 or 7 depending on your tablet)
After you have selected it issue a make command:
Code:
$ make
This will take a while. If you're using ubuntu 11.10 make might fail, but you can fix it using these fixes: http://groups.google.com/group/android-building/browse_thread/thread/3484e7797909d014
After the building is complete you have to create the image files. Run the following command:
Code:
$ ./device/softwinner/crane-tcp76ti_r4/mkfs.sh
(substitute tcp76ti_r4 with ainovo7a if you're using the other tablet)
The image files will be ready in the directory "out/target/product/crane-tcp76ti_r4/images/" or "out/target/product/crane-ainovo7a/images/"
Copy the three files from here (root.img, recovery.img, system.img), and the "bImage" file from the "output" directory of the kernel to your Windows machine.
The next step is creating the flashable image, and flashing your build
Part 4: Flashing
A: Initialize kitchen
First download my A10 flash kitchen from this site: http://android.sztupy.hu/dl/a10/a10_flash_kitchen_v1.zip
This is based on the ainol novo 7 soruce drop, but only contains the nescessary files, and has a few batch scripts to automate the process.
There is also a v2, wich also supports ICS firmwares: http://android.sztupy.hu/dl/a10/a10_flash_kitchen_v2.zip
First unzip the files to a directory. You will see a few directories and to commands here: extract_image.bat and create_image.bat
First we have to extract an official image for your tablet. Simply comply the image file to this directory, and rename it to "original.img". If done, run extract_image.bat. This command should extract your image to the _extract directory.
Next you need to extract the bootfs inside the _bootfs directory. You have multiple options on how to do this:
1. Get the bootfs from your device on-line using adb:
Code:
> cd _bootfs
> adb shell
$ cd /
$ mount -o remount,rw -t ext4 /dev/root /
$ mkdir bootfs
$ mount -t vfat /dev/block/nanda /bootfs
(Control-C: exit adb shell)
> adb pull /bootfs
2. Get the bootfs from the extracted image file using Linux:
A. Copy the RFSFAT16_BOOTFS_000000000.fex file to linux
B.
Code:
$ mkdir bootfs
$ sudo mount -o loop RFSFAT16_BOOTFS_000000000.fex bootfs
$ cp -a bootfs b2
$ sudo umount bootfs
C. Copy the contents of the b2 directory to Windows, inside the _bootfs directory of the kitchen
B: Create image
If you have initialized the kitchen, you have to copy the four files from linux (system.img, root.img, recovery.img and bImage) inside the _input directory. You will also need to rename the .img files to .fex (so they should be system.fex, root.fex, recovery.fex).
If you are done with this, then run create_image.bat. It will create an output.img file, that can be flashed to the device using LiveSuite.
Additional information for developers:
1. Difference between AOSP 2.3.4 and Novo7 android 2.3.4
Download the diff file from here: http://android.sztupy.hu/dl/a10/diff_ainovo_aosp.gz
Filelist of differences: http://android.sztupy.hu/dl/a10/diff_ainovo_aosp_filelist.txt
sztupy, did you figure out why eDragonEx and FSBuild have an apparently unused Lua library next to each? I was interested by it, as it might be possible that some parts of the apps are actually written in Lua (would it be possible? Lua in a native DLL?), what would help reversing it.
fonix232 said:
sztupy, did you figure out why eDragonEx and FSBuild have an apparently unused Lua library next to each? I was interested by it, as it might be possible that some parts of the apps are actually written in Lua (would it be possible? Lua in a native DLL?), what would help reversing it.
Click to expand...
Click to collapse
Yeah, saw that. Also their build script used "convert" on the image.cfg, but that file wasn't in lua anyway (except for the image parts part which seems to be a lua hash).
There are also a lot of compiled files that are compiled inside the image file and which are neither the bootfs nor android or the kernel. I don't yet know what they are for, but I think they are used by LiveSuite during the flashing.
sztupy said:
Yeah, saw that. Also their build script used "convert" on the image.cfg, but that file wasn't in lua anyway (except for the image parts part which seems to be a lua hash).
There are also a lot of compiled files that are compiled inside the image file and which are neither the bootfs nor android or the kernel. I don't yet know what they are for, but I think they are used by LiveSuite during the flashing.
Click to expand...
Click to collapse
I know most of the files from the flashing, they are the following:
- SYS_CONFIG is used as a command bunch for LiveSuite. It tells the app how to flash, what to flash, where, and it configures the device too (screen size, ram info, cpu info, etc)
- Boot0 and Boot1 bins are NAND bootloaders
- FED FES and FET tools are NAND flashing utilities, checksums, hardware scanner, and other tools used during flashing.
- '12345678' files are bootloaders, config files, and tools for SDMMC flashing, if there's a device with SDMMC internal instead of NAND, these are used
- Split seems to be some kind of ID string, I had no luck retrieving it's usage and meaning.
So you say, that the actual Lua parts are the image encryption parts of eDragonEx? Interesting, maybe I've missed that spot with my tool...
Might I ask if you have tried disassembling (and decompiling) unimg.exe? I had several problems with it, but that would greatly help understanding how the images are created. I've got a C# framework, with image config parser, etcetera etcetera, to be able to read and create images in a much more advanced environment (filtering user errors, having tools for everything (bootfs modding, script.bin reversal, etcetera), and creating a working image as a final result), and it only needs the image file format (and some of my work, to create a parser).
The problems with unimg were all about positive sp values, and as I'm not a big assembly programmer, I couldn't make out anything from that. Maybe you understand it a bit more
Illetve beszélhetünk egy kicsit magyarul is. Tabletrepublic-on írtam hogy vegyél fel MSNre és részletezem a különböző Crane SDK elemek funkcióit, működését, egyebeket, amit eddig sikerült kiderítenem az egészről.
Sajnos elég zavaros, mivel vagy négyféle csomagoló rendszer készíti a fileokat, és ezek közül csak egy működött rendesen (crane_pack.exe). Jó lenne megérteni ezt a file formátumot, hogy egy kicsit normálisabb módon hozhassam létre, különféle vacakolások nélkül.
fonix232 said:
I know most of the files from the flashing, they are the following:
- SYS_CONFIG is used as a command bunch for LiveSuite. It tells the app how to flash, what to flash, where, and it configures the device too (screen size, ram info, cpu info, etc)
- Boot0 and Boot1 bins are NAND bootloaders
- FED FES and FET tools are NAND flashing utilities, checksums, hardware scanner, and other tools used during flashing.
- '12345678' files are bootloaders, config files, and tools for SDMMC flashing, if there's a device with SDMMC internal instead of NAND, these are used
- Split seems to be some kind of ID string, I had no luck retrieving it's usage and meaning.
Click to expand...
Click to collapse
Thanks for these. Seems I was mostly right
So you say, that the actual Lua parts are the image encryption parts of eDragonEx? Interesting, maybe I've missed that spot with my tool...
Click to expand...
Click to collapse
I think lua is not really used anymore. It probably had more relevance back in the past.
Might I ask if you have tried disassembling (and decompiling) unimg.exe? I had several problems with it, but that would greatly help understanding how the images are created. I've got a C# framework, with image config parser, etcetera etcetera, to be able to read and create images in a much more advanced environment (filtering user errors, having tools for everything (bootfs modding, script.bin reversal, etcetera), and creating a working image as a final result), and it only needs the image file format (and some of my work, to create a parser).
The problems with unimg were all about positive sp values, and as I'm not a big assembly programmer, I couldn't make out anything from that. Maybe you understand it a bit more
Click to expand...
Click to collapse
No, haven't tried disassembling it yet. I was very glad that it worked, and that I could create a whole working build just from the sources. I know there are a lot of quirks, like if the extension of the file is not .fex, then it will encrypt(?) it, etc. I might try it, but currently I'm more interested in getting a working AOSP ICS on my tablet. Besides for disassembly I need to be in a special mood, which I'm not really in now
Illetve beszélhetünk egy kicsit magyarul is. Tabletrepublic-on írtam hogy vegyél fel MSNre és részletezem a különböző Crane SDK elemek funkcióit, működését, egyebeket, amit eddig sikerült kiderítenem az egészről.
Sajnos elég zavaros, mivel vagy négyféle csomagoló rendszer készíti a fileokat, és ezek közül csak egy működött rendesen (crane_pack.exe). Jó lenne megérteni ezt a file formátumot, hogy egy kicsit normálisabb módon hozhassam létre, különféle vacakolások nélkül.
Click to expand...
Click to collapse
Már egy jó ideje nem használok MSN-t. Skype/GTalk/email viszont van. Ha nem használsz olyanokat, akkor azért majd felrakom.
Made a diff between AOSP android 2.3.4 and the Novo 7 2.3.4 source drop. The list can be found at post 6: http://forum.xda-developers.com/showpost.php?p=22397984&postcount=6
Nice tutorial! Do you mind if I fork your Github repo and add the device tree for the Bmorn V11 to the lunch list?
sztupy said:
Made a diff between AOSP android 2.3.4 and the Novo 7 2.3.4 source drop. The list can be found at post 6: http://forum.xda-developers.com/showpost.php?p=22397984&postcount=6
Click to expand...
Click to collapse
Most of the things changed aren't even needed for the device - ril can be replaced with a local one (and suggested by Google to do so), just like recovery changes, in ICS we already have USB BT support enabler, so BT changes can be dropped, just like framework changes (they are for the softbuttons on the notification bar), camera and mediaplayer changes should be local too (in the device tree), so 99% of changes can be dropped.
Additions are different, some can be totally erased, and some are needed. From your github, I see that you've already began making a cleaned up, generic A10 tree, but I miss a few things - libsensor for one, stagefright, camera, and audio. The AOSP stock ALSA should work, if the proper audio config is placed in a ROM, but I have bad feelings about the missing libsensors source, and camera. Stagefright has a chance too to work, but camera definitely won't, and the used sensors aren't the common ones to be included.
Használok GTalk-ot is, ott is ugyanez a nicknevem, gmail utótaggal, szóval a szokásos
FezzFest said:
Nice tutorial! Do you mind if I fork your Github repo and add the device tree for the Bmorn V11 to the lunch list?
Click to expand...
Click to collapse
That's what github is for
fonix232 said:
Most of the things changed aren't even needed for the device - ril can be replaced with a local one (and suggested by Google to do so), just like recovery changes, in ICS we already have USB BT support enabler, so BT changes can be dropped, just like framework changes (they are for the softbuttons on the notification bar), camera and mediaplayer changes should be local too (in the device tree), so 99% of changes can be dropped.
Additions are different, some can be totally erased, and some are needed. From your github, I see that you've already began making a cleaned up, generic A10 tree, but I miss a few things - libsensor for one, stagefright, camera, and audio. The AOSP stock ALSA should work, if the proper audio config is placed in a ROM, but I have bad feelings about the missing libsensors source, and camera. Stagefright has a chance too to work, but camera definitely won't, and the used sensors aren't the common ones to be included.
Használok GTalk-ot is, ott is ugyanez a nicknevem, gmail utótaggal, szóval a szokásos
Click to expand...
Click to collapse
libsensor and stagefright are still there, as I could manage them to get compiled. Not that they work though. For the libcamera it depends on CedarX, which I couldn't manage to compile, that's why I removed it (for now). Besides CedarX unfortunately not "open-source", so in theory we couldn't use it either (well... not that I actually care about licence violations).
I'm still compiling ICS. Will put back libcamera and try to get the other hardware libs to work after I managed to get ICS to boot.
sztupy said:
libsensor and stagefright are still there, as I could manage them to get compiled. Not that they work though. For the libcamera it depends on CedarX, which I couldn't manage to compile, that's why I removed it (for now). Besides CedarX unfortunately not "open-source", so in theory we couldn't use it either (well... not that I actually care about licence violations).
I'm still compiling ICS. Will put back libcamera and try to get the other hardware libs to work after I managed to get ICS to boot.
Click to expand...
Click to collapse
Please be noted that ICS requires new stagefright, camera HAL, new GPU drivers, and so on.
ICS also should have some differences in the build tree, make a new branch for sure (as an example, it requires a device.mk and device_base.mk, both being the base containers without target definition, full_[devicename].mk for the actual full target, and cm.mk for CyanogenMod, what I'd suggest you to build).
I couldn't find any of the sources, but must have overlooked something. Will check it further.
hi, I'm the author of unimg(esxgx).
and your unimg is not up-to-date(the version still have bugs to lead to fail the packing process.
Here is the latest version (fix bugs but no virus alarm[compared with the former version]), and you can use it in the same way.
please update your file.
PS. yes, the unimg can unpack and pack all allwinner's firewares without diffculty, good luck.
sorry for my english.
fonix232 said:
Might I ask if you have tried disassembling (and decompiling) unimg.exe? I had several problems with it, but that would greatly help understanding how the images are created. I've got a C# framework, with image config parser, etcetera etcetera, to be able to read and create images in a much more advanced environment (filtering user errors, having tools for everything (bootfs modding, script.bin reversal, etcetera), and creating a working image as a final result), and it only needs the image file format (and some of my work, to create a parser).
The problems with unimg were all about positive sp values, and as I'm not a big assembly programmer, I couldn't make out anything from that. Maybe you understand it a bit more
Click to expand...
Click to collapse
I think you should use unimg.exe.
unimg is the only tool to unpack it correctly.
you know, allwinner didn't want me to release the tool in public last year(the tool is for sc9800[the former chip]). for some commercial reason, the offical toolchain of a10 only contains pack_tool.
so I released the tool with other tools(rootcr, rootpk,etc..) in a small group.
but some person posted it on the internet. so....
I developed the analysis tools in the form of many files(unimg, rootcr, rootpk, unimg2), because I want to keep each of the packing stages simple.
you can use a "bat" file / a GUI shell to communicate with each other, and that is what I expected.
I can't smoothly speak english, so I modified several times.
Thank you very much!
If I may ask, would it be possible to release the source code too?
fonix232 said:
Thank you very much!
If I may ask, would it be possible to release the source code too?
Click to expand...
Click to collapse
I cannot released yet, but I will release it in a proper time on github (I have been touching with allwinner company, so I have to consider many factors).

[GUIDE] Building Pure Nexus

Introduction
Hello everyone, this is a guide to get you up and running with your own build of Pure Nexus for the Nexus 5X. In this thread, you will learn how to get your computer set up to build and the commands you will need to run. Please read the entire guide and the FAQ. Additionally, this is a developer's thread, there should be no off topic discussion.
Compilation Guide
This is available on my Github, where it may be a little more up to date.
0. Getting started
In this guide, I will go over how to build Pure Nexus on your Linux machine. This particular tutorial will focus on Ubuntu 16.04 as that is what I use (Mint 18 is also good) but this should work with any version of Linux; it does need to be 64-bit however. I will leave the installation of that up to you, Google is a wonderful resource. If you don't have a good computer but still want to build, check out this thread on XDA: http://forum.xda-developers.com/chef-central/android/guide-how-to-build-rom-google-cloud-t3360430
1. Set up your environment
1. Automatically
Code:
sudo apt-get install git-core
git clone https://github.com/akhilnarang/scripts
cd scripts
ls
bash <script-name>
<script-name> should be one of the scripts in the folder for your particular architecture.
2. Manually
1. Install Java 8
Code:
sudo apt-get update
sudo apt-get install openjdk-8-jdk
sudo apt-get install openjdk-8-jre
2. Install other build tools
Code:
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
2. Configure repo and git
If you have any problems with the below commands, try running as root:
Code:
sudo -s
Git is an open source version control system which is incredibly robust for tracking changes across repositories. Repo is Google's tool for working with Git in the context of Android. More reading if you are interested: https://source.android.com/source/developing.html
Run these commands to get repo working (only do this if you did the manual set up method above:
Code:
mkdir ~/bin
PATH=~/bin:$PATH
curl https://storage.googleapis.com/git-repo-downloads/repo > ~/bin/repo
chmod a+x ~/bin/repo
Run these commands to get git working:
Code:
git config --global user.name "Your Name"
git config --global user.email "[email protected]"
3. Download the source
First, before downloading the source, create a folder for the source and move into it.
Code:
mkdir ~/<foldername> (eg. mkdir ~/PN or ~/PureNexus)
cd ~/<foldername>
Then, we need to grab the manifest and sync down the repositories. Here are the commands to do this for Pure Nexus for Nougat (make sure you are in the source folder you made above):
Code:
repo init -u https://github.com/PureNexusProject/manifest.git -b n
repo sync --force-sync
Here is the process generally for other ROMs:
When you go to build a ROM, you must download its source. All, if not most, ROMs will have their source code available on Github. To properly download the source, follow these steps:
Go to your ROM's Github (e.g. http://github.com/PureNexusProject)
Search for a manifest (usually called manifest or android_manifest).
Go into the repo and make sure you are in the right branch (located right under the Commits tab).
Go into the README and search for a repo init command. If one exists, copy and paste it into the terminal and hit enter.
If one does not exist, you can make one with this formula:
Code:
repo init -u <url_of_manifest_repo>.git -b <branch_you_want_to_build>
For example:
Code:
repo init -u http://github.com/PureNexusProject/manifest.git -b n
After the repo has been initialized, run this command to download the source:
Code:
repo sync --force-sync
This process can take a while depending on your internet connection.
4. Build it!
At this point, it'd be a good idea to set up ccache. ccache is a compiler cache, it stores previously compiled files in a directory and pulls from that instead of recompiling if nothing has changed. This speeds up compilation a LOT. If you want to use it, follow the below steps:
Open up your .bashrc file in your home directory using a text editor or nano and append this to the end of it:
Code:
export USE_CCACHE=1
Then type:
Code:
source ~/.bashrc
After that, run one of the below command (replacing the # with how many GBs of ccache you want, 50 is recommended)
Use this one if you used the manual method of set up in section 1:
Code:
prebuilts/misc/linux-x86/ccache/ccache -M #G
Use this one if you used the automatic method of set up in section 1:
Code:
ccache -M #G
After that, it's time to build!
Code:
. build/envsetup.sh
breakfast bullhead
mka bacon
After that, your computer will build the flashable zip file and if you see something that says make completed, you've done it!
Any time that you want to rebuild, type the following commands:
Code:
repo sync --force-sync
. build/envsetup.sh
breakfast bullhead
mka clobber
mka bacon
I also have a script to do this on my Github here
Frequently Asked Questions
1.1 Q: I got an error, what do I do??
1.1 A: Well to start, if it is anything with Ninja, I would go ahead and disable it. You can add this to your .bashrc file:
Code:
export USE_NINJA=false
Then type this
Code:
source ~/.bashrc
. build/envsetup.sh
breakfast bullhead
mka clobber
mka bacon
If it is saying you ran out of memory, follow this post.
If it isn't Ninja related, check out @AzraelsKiss's post here, where he has documented a few common issues. If none of those apply, post here with a detailed list of what you have done and we will do our best to help you.
1.2 Q: Can you guys share your personal builds?
1.2 A: No, personal builds are just that: personal. Beans releases whenever he feels that the release is ready for the masses and if a bunch of personal builds are floating around, that tarnishes the Pure Nexus name. We are more than happy to help get you up and running but we will not be sharing our builds. Thanks for understanding!
this wont work on Windows, right?
RonnellTapawan said:
this wont work on Windows, right?
Click to expand...
Click to collapse
I have heard people try to use Bash for Windows but I don't think it will work. Linux or bust.
nathanchance said:
I have heard people try to use Bash for Windows but I don't think it will work. Linux or bust.
Click to expand...
Click to collapse
I tried on bash for windows but it can't build android roms
Dude you should seriously get a XDA medallion or some sort of metal for all you do all over XDA. I see you everywhere. Thanks for building for us and also for this write up. :good: @ nathan
SM210 said:
Dude you should seriously get a XDA medallion or some sort of metal for all you do all over XDA. I see you everywhere. Thanks for building for us and also for this write up. :good: @ nathan
Click to expand...
Click to collapse
Talk to my superiors :silly: thanks for the kind words
Edited.......
Sent from my Nexus 5X using Tapatalk
myawan said:
Anybody wanna share home made build?
Sent from my Nexus 5X using Tapatalk
Click to expand...
Click to collapse
If you read at the end of the OP, it says:
"1.2 Q: Can you guys share your personal builds?
1.2 A: No, personal builds are just that: personal. Beans releases whenever he feels that the release is ready for the masses and if a bunch of personal builds are floating around, that tarnishes the Pure Nexus name. We are more than happy to help get you up and running but we will not be sharing our builds. Thanks for understanding!"
Reason being, because if we start compiling these and handing it out like it's no ones business, we're going to run Pure Nexus into the ground and people will start uploading them on AFH and it'll be one big mess. My guess is, this is just a courtesy by the original poster to those of us who can't wait.
My two cents.:laugh::highfive:
i'm on it!!!!! thank you very much!!! download is taking forever ugh
Building it right now! Thanks
I think this would work in Cygwin. I used to compile stuff for the PS3 way back. I'd have a lot of reading to do if I wanted to build this for my phone.
Which gapps to use with this?
Open Gapps micro are working fine.
Gesendet von meinem Nexus 5X mit Tapatalk
So WE can't share our build either? Or what, i didn't get it.
CreasingMass Dev said:
So WE can't share our build either? Or what, i didn't get it.
Click to expand...
Click to collapse
Don't distribute personal builds. Flash them yourself and that is it.
4 hours of download :crying:
OOH MAN!!!!!! no more space in my device!!! how can i resume that???
Code:
Checking out files: 100% (1717/1717), done.
error: unable to write file current/platforms/android-21/arch-x86_64/usr/lib/libz.a
error: unable to write file current/platforms/android-21/arch-x86_64/usr/lib/libz.so
fatal: cannot create directory at 'current/platforms/android-21/arch-x86_64/usr/lib64': Spazio esaurito sul device
Traceback (most recent call last):
File "/home/matteo/Scaricati/PureNexus/.repo/repo/main.py", line 531, in <module>
_Main(sys.argv[1:])
File "/home/matteo/Scaricati/PureNexus/.repo/repo/main.py", line 507, in _Main
result = repo._Run(argv) or 0
File "/home/matteo/Scaricati/PureNexus/.repo/repo/main.py", line 180, in _Run
result = cmd.Execute(copts, cargs)
File "/home/matteo/Scaricati/PureNexus/.repo/repo/subcmds/sync.py", line 769, in Execute
project.Sync_LocalHalf(syncbuf, force_sync=opt.force_sync)
File "/home/matteo/Scaricati/PureNexus/.repo/repo/project.py", line 1325, in Sync_LocalHalf
self._InitWorkTree(force_sync=force_sync)
File "/home/matteo/Scaricati/PureNexus/.repo/repo/project.py", line 2482, in _InitWorkTree
raise GitError("cannot initialize work tree")
error.GitError: cannot initialize work tree
can i move the PureNexus folder in an external drive and resume??? please
MatteXperiaU said:
4 hours of download :crying:
OOH MAN!!!!!! no more space in my device!!! how can i resume that???
can i move the PureNexus folder in an external drive and resume??? please
Click to expand...
Click to collapse
You can try. Your build times will be much slower though.
Sent from my Nexus 6P using XDA Labs
nathanchance said:
You can try. Your build times will be much slower though.
Sent from my Nexus 6P using XDA Labs
Click to expand...
Click to collapse
i have another partition in the same HD (300GB).. i can use that :fingers-crossed:
which command i need to resume?
sorry for the questions man, you're too kind
TPMJB said:
I think this would work in Cygwin. I used to compile stuff for the PS3 way back. I'd have a lot of reading to do if I wanted to build this for my phone.
Click to expand...
Click to collapse
No promises...
http://www.howtogeek.com/249966/how-to-install-and-use-the-linux-bash-shell-on-windows-10/
Out of curiosity, realistically how much disk space would be required to download everything and compile with a 50GB cache? I got everything downloaded and the compile ran but threw some warnings (most of which may have been benign). When the compile terminated with an error, I had about 40MB left on my Linux Mint 18 partition so I assume it ran out of space I started with about 70GB free space
I deleted everything and decided to try again if and when I have a larger partition to play with..... I am currently dual booting on a Windows machine and didn't think to allocate that much space to Mint.
Paul

Guide: Compile /system/bin binaries for your device from AOSP source code

Now tested up to downloading AOSP and make toolbox you should be all set
Please give thanks to this thread: https://forum.xda-developers.com/newreply.php?do=newreply&p=43622764
Warning: I hacked my way through this stuff a few weeks ago I am not an expert!
How to compile Android Open Source Code modules​
I don't compile C code on Windows machines I have no idea about that.
Notice
This guide is a quick and dirty how to make a module. It will not cover finalizing setting up the source codes for your device. It is only my goal to enable you to compile binaries such as grep, toolbox, dumpstate, dalvikvm, jack and etc.
===>] Setup Ubuntu 64bit [<===​Unplug that Windows drive, plug in a fresh hard drive and install Ubuntu latest/greatest. Ignore the recommendation to downgrade gnu make!, for now.
Open a terminal and issue these commands (warning ppa repository for OpenJDK 7 is said to have a security issue?, isn't being updated?.. whatevs it works)
Code:
sudo apt-get update
sudo apt-get upgrade
sudo add-apt-repository ppa:openjdk-r/ppa
sudo apt-get install openjdk-7-jdk
sudo apt-get install openjdk-8-jdk
sudo apt-get install libc6:i386 libncurses5:i386 libstdc++6:i386 lib32z1 libbz2-1.0:i386
sudo apt-get install git ccache automake lzop bison gperf build-essential zip curl zlib1g-dev zlib1g-dev:i386 g++-multilib python-networkx libxml2-utils bzip2 libbz2-dev libbz2-1.0 libghc-bzlib-dev squashfs-tools pngcrush schedtool dpkg-dev liblz4-tool make optipng
(choose Java 1.7 in the following way)
Code:
sudo update-alternatives --config java
(let me know if I missed anything please)
"Tried the Android SDK only it is missing too many things we need as a developer"
===>] Setup Android Studio SDK & NDK [<===​Installation Paths:
*** I install to /home/username/Android and /home/username/Android/Sdk and /home/username/Android/Sdk/ndk-bundle ***
NOTE: from here forward username will == droidvoider
Note: Android Studio IDE isn't necessary only the SDK & NDK are needed to compile AOSP.
Install Android Studio Proper: (don't worry about setting up paths we will cover that, just install it)
https://developer.android.com/studio/install.html
or
SDK Only:
Typically we install these things manually by creating the directory then just unzipping the files there.
https://developer.android.com/studio/index.html#linux-bundle (scroll down for sdk only)
Code:
mkdir /home/droidvoider/Android
mkdir /home/droidvoider/Android/Sdk
(then unzip the sdk zip to that directory. I recommend the file explorer copy/paste right click uncompress and done.)
https://dl.google.com/android/repository/tools_r25.2.3-linux.zip
Install NDK through the SDK Manger:
(from terminal 'studio.sh' and then configure, and then sdk manger --- if this is hard to figure out tell me I will elaborate)
or
Manually Install Native Development Kit -- 'c programming support'
Download the Native Development Kit from Google: https://developer.android.com/ndk/downloads/index.html
Code:
mkdir /home/droidvoider/Android/Sdk/ndk-bundle
Then just unzip the ndk files into the directory we created above.
===>] Setup your toolchain [<===​** This example is arm64-v8a aarch64 **
1. Navigate to /home/droidvoider/Android/Sdk/ndk-bundle/build/tools and then open a terminal "right click open area"
2. mkdir /home/droidvoider/toolchains
3. ./make_standalone_toolchain.py --arch arm64 --api 23 --stl=libc++ --install-dir /home/mm/toolchains/aarch64-linux-android-4.9
4. cd /home/droidvoider
5. gedit .bashrc and morph this in at the bottom.. (AND edit or replace the existing PATH variable)
DON'T just PASTE IN *my* $PATH export!! I included my entire path statements to show you.
Code:
export PATH=$PATH:/usr/local/android-studio/bin:/home/droidvoider/Android/Sdk/platform-tools:/home/droidvoider/Android/Sdk/ndk-bundle:/home/droidvoider/Android/Sdk/tools
I feel this is human readable, for example change Android_Build_Out to be on your desktop instead if you want.
Code:
export PATH=$PATH:/home/droidvoider/toolchains/aarch64-linux-android-4.9
export NDK=/home/droidvoider/Android/Sdk/ndk-bundle
export SYSROOT=$NDK/platforms/android-23/arch-arm64
export TARGET=aarch64-linux-android
export HOST=$TARGET
export BUILD=x86_64-linux
export ANDROID_NDK_BIN=/home/droidvoider/toolchains/aarch64-linux-android-4.9/bin
export CC=$ANDROID_NDK_BIN/aarch64-linux-android-gcc-4.9
export CPP=$ANDROID_NDK_BIN/aarch64-linux-android-g++
export AR=$ANDROID_NDK_BIN/aarch64-linux-android-ar
export OUT_DIR_COMMON_BASE=/home/droidvoider/Android_Build_Out
Note: You might want to setup an alternate toolchain also but this is all of the puzzle pieces.
===>] Google's version of this How To -- Just for reference [<===​https://source.android.com/source/requirements.html
https://source.android.com/source/initializing.html
===>] Install the repo tool [<===​https://source.android.com/source/downloading.html
(don't type repo init or repo sync --- I will be taking back over from there on the next page)
Added Repair Notes -- Not part of the install!
Have you accidentally installed or removed something you shouldn't have? (welcome to development, here try this before reinstall)
sudo apt-get clean
sudo apt-get update
sudo apt-get install -f
sudo dpkg -a --configure
sudo apt-get dist-upgrade
sudo apt-get install -f
sudo dpkg -a --configure
Selecting the correct AOSP branch and downloading it.
Tested up to downloading AOSP and make toolbox -- you should be all set
===>] Match your build number to it's AOSP sources [<===​preface: You can get this from your device if you're on the same build id as your the available source code from your vendor for your device. Otherwise you need to open the AP file from the firmware that matches those available sources to extract the system.img, to extract build.prop. I explain how to open a system.img file below under retrieving your hardware drivers. build.prop is in the main directory of system.img
(Many times the build number is the same. For me I believe all of MM builds are using this number.)
Assumes sources match current device, worked out true in my case
1. Plug in your device and get it connected. (DEVELOPER OPTIONS|USB DEBUGGING) and select allow on device
2. Retrieve the build number that matches the available sources for your device.
From your ubuntu terminal retrieve the build id using this command:
Code:
adb shell getprop | grep 'ro.build.id'
Yields something similar to this: [ro.build.id]: [MMB29K]
3. Match it up to the Nexus build numbers (This info is for AT&T Note 5 Marshmallow MMB29K, get your specific build number!)
https://source.android.com/source/build-numbers.html#source-code-tags-and-builds
MMB29K android-6.0.1_r1 Marshmallow Nexus 5, Nexus 5X, Nexus 6, Nexus 7 (flo/deb), Nexus 9 (volantis/volantisg)
===>] Bring down a specific AOSP source branch [<===​
4. Make a directory for the source code.
Code:
mkdir /home/droidvoider/Desktop/AOSP_Android_6.01_r1
5.
Code:
cd /home/droidvoider/Desktop/AOSP_Android_6.01_r1
6. Bring down the sources, this one is approximately 13 gigabytes
Code:
repo init --depth=1 -u https://android.googlesource.com/platform/manifest -b android-6.0.1_r1
repo sync
===>] I'm not sure the rest of this is needed [<===​For compiling toolbox the remainder wasn't needed.. But I have a large list of things to do so I can't test each item. If you can't compile a specific module continue reading.
===>] Merge Vendor sources & AOSP sources [<===​
7. Download the available sources for your device. In this example I downloaded PE6 Marshmallow sources for AT&T Note 5:
http://opensource.samsung.com/reception/receptionSub.do?method=sub&sub=F&searchValue=SM-N920A
8. Read the readme file from the sources platform zip to understand how to merge them into the AOSP sources. For the 2 Samsungs I've worked with the idea is to replace any directory that already exists. But if there is just one file such as core.mk only replace the one file. Then edit the .mk files as described in your readme. (and/or take info from cyanogen/lineagos) -- <I can help more, ask>
note: you probably don't need to take the configs from LineageOS and put them into your .mk files. However, if you do need to get more configs then you should get a big fat message when you type make 'modulename'. At first only edit .mk files as described by vendor device source readme file.
===>] Merge in Hardware drivers and etc [<===​possibly unnecessary depends what you're doing
9. Obtain a copy of the firmware for your device that matches the version of the source code you are able to download from your vendor.
for me that was Build Number: MMB29K.N920AUCU2BPE6 but your mileage will almost certainly vary!
10. Download https://github.com/anestisb/android-simg2img
11. Unzip it right in your download folder, open the folder and then 'open in terminal'
12. Make it and then move it a directory in your path. Warning: My command puts in in the Ubuntu default /bin folder.
Code:
make
sudo mv append2simg img2simg simg2img simg2simg simg_dump.py /bin
13. Uncompress the AP file from the matching firmware and extract the system.img into it's own directory
then select that folder, right click, open in terminal
Code:
simg2img system.img sys.raw
mkdir sys
sudo mount -t ext4 -o loop sys.raw sys/
14. A drive mounted, look on your task bar it should've wiggled too. Copy the etc and vendor folders into the main folder of the sources we are merging
===>] Listing and building modules [<===​Navigate to the folder where you download the sources "/home/droidvoider/Desktop/AOSP_Android_6.01_r1" and open in terminal.
Code:
make modules -- list the available modules
make <module name> -- builds a specific module
example: make dumpstate
description: Will build everything needed for dumpstate and place it in the folder we specified in our export (above step). The final build line will read install and detail the final output folder
Example successful output:
[CODE]
Install: /home/droidvoider/Android_Build_Out/Android_6.01_r1/target/product/generic/system/bin/dumpstate
===>] Android Build System, basic intro [<===​Notice: I built this how to to answer the same question from 3 people regarding working with toolbox and the dirtycow exploit. So I decided to give a direct example of using toolbox.c from farm-root
#ifdef
Our makefile is Android.mk and that's where we link things together. If you look at the Android.mk file for farm-root you will notice bridge.c is used 3 different times called different 'module' names. bridge_pull, bridge_push, bridge_pull_boot. Each of these will be binaries of those names.
Inside bridge.c you will see #ifdef FARM_PULL and then you will see #else and further you will see #endif which you may have noticed matches inside the Android.mk file for the bridge modules -DFARM_PULL -DFARM_BOOT <== Notice the double define on bridge_pull_boot
toolbox.c
toolbox.c is going to be the same way. You will need to copy shared.h and shared.c into the directory where toolbox.c resides. Then edit the Android.mk, in our example:
1. Navigate to this directory and open: system/core/toolbox/Android.mk
2. CTRL + F and search for "LOCAL_MODULE := toolbox"
3. Add: LOCAL_CFLAGS += -DFARM_PULL -DFARM_BOOT (in this example add one, both or even new ones you created)
4. Navigate to the main directory of the sources, you should see a Makefile and a build_64bit.sh
5. from terminal: make toolbox
Note: I think from here you can Google it out in a few minutes if that is not the case please let me know.
Working with C cross platform​Ubuntu is Linux based just like Android and this makes testing blocks of code extremely easy. You of course can't use Android headers and in some rare cases you can't test the code on Ubuntu at all but in most cases you can. When I want to design something for Android I open gedit and save it as a .c file. Then I compile it using gcc -o mycode mycode.c There's plenty of examples on using gcc with linux but just understand you can do it all. Then before too much work test it on Android. (helpful commands at end of post)
My advice really is to build out your small blocks of code on your linux box but then paste them into your Android program folder, edit your Android.mk, add it to your Makefile including your 'push' section so that you can simply type make push to test it.
I am in fact trying to encourage you to learn C and not so much trying to encourage you to hack things. But I know that interest/passion is what teaches, not my words and not someone else's curriculum. So in that spirit I will do my best to give examples to help you with 'whatever' it is you are passionate about. Let me know what's missing.
Don't forget to compile for Android first
Before you can test your code you will have compiled it using the cross compiler for Android. ndk-build, or the correct gcc cross compiler. (Personally I put the .c file into a directory with Android.mk and a Makefile then just type make to build it to Android)
see examples section I will add a couple examples.
Android Developer Bridge -- a developers tool
adb is included with the Android SDK along with some other tools. Some of those tools are fastboot for unlocking bootloaders and another way of flashing. There is monitor which is a cool tool for remotely viewing processes, logcat, memory dumps and etc.
But pointedly what we will use the most is simply adb.
Using adb to test your code on locked down Android systems
Shell has fairly high privileges, you may not be aware but you can execute binaries and bash scripts. We use /data/local/tmp/ for these things. You can create a directory, add or remove files, execute your binaries and even execute shell scripts using sh script.sh
ndk-build places the binary in libs/(arch type) .. For a quick test you can just open a terminal in that directory then:
Code:
adb push mybinary /data/local/tmp/
adb shell
cd data/local/tmp
chmod 777 mybinary
./mybinary
Added:
Examples of basic make files for Android.
happy coding
If you get an error​Please reissue the command but pipe the output to a file.
make toolbox > /home/droidvoider/Desktop/build_toolbox-output.txt
zip that up with your source code, including your customized header files and attach it to this thread.
puzzles are fun but I like all the pieces
droidvoider said:
Tested up to downloading AOSP and make toolbox -- you should be all set
===>] Match your build number to it's AOSP sources [<===​preface: You can get this from your device if you're on the same build id as your the available source code from your vendor for your device. Otherwise you need to open the AP file from the firmware that matches those available sources to extract the system.img, to extract build.prop. I explain how to open a system.img file below under retrieving your hardware drivers. build.prop is in the main directory of system.img
(Many times the build number is the same. For me I believe all of MM builds are using this number.)
Assumes sources match current device, worked out true in my case
1. Plug in your device and get it connected. (DEVELOPER OPTIONS|USB DEBUGGING) and select allow on device
2. Retrieve the build number that matches the available sources for your device.
From your ubuntu terminal retrieve the build id using this command:
Code:
adb shell getprop | grep 'ro.build.id'
Yields something similar to this: [ro.build.id]: [MMB29K]
3. Match it up to the Nexus build numbers (This info is for AT&T Note 5 Marshmallow MMB29K, get your specific build number!)
https://source.android.com/source/build-numbers.html#source-code-tags-and-builds
MMB29K android-6.0.1_r1 Marshmallow Nexus 5, Nexus 5X, Nexus 6, Nexus 7 (flo/deb), Nexus 9 (volantis/volantisg)
===>] Bring down a specific AOSP source branch [<===​
4. Make a directory for the source code.
Code:
mkdir /home/droidvoider/Desktop/AOSP_Android_6.01_r1
5.
Code:
cd /home/droidvoider/Desktop/AOSP_Android_6.01_r1
6. Bring down the sources, this one is approximately 13 gigabytes
Code:
repo init --depth=1 -u https://android.googlesource.com/platform/manifest -b android-6.0.1_r1
repo sync
===>] I'm not sure the rest of this is needed [<===​For compiling toolbox the remainder wasn't needed.. But I have a large list of things to do so I can't test each item. If you can't compile a specific module continue reading.
===>] Merge Vendor sources & AOSP sources [<===​
7. Download the available sources for your device. In this example I downloaded PE6 Marshmallow sources for AT&T Note 5:
http://opensource.samsung.com/reception/receptionSub.do?method=sub&sub=F&searchValue=SM-N920A
8. Read the readme file from the sources platform zip to understand how to merge them into the AOSP sources. For the 2 Samsungs I've worked with the idea is to replace any directory that already exists. But if there is just one file such as core.mk only replace the one file. Then edit the .mk files as described in your readme. (and/or take info from cyanogen/lineagos) -- <I can help more, ask>
note: you probably don't need to take the configs from LineageOS and put them into your .mk files. However, if you do need to get more configs then you should get a big fat message when you type make 'modulename'. At first only edit .mk files as described by vendor device source readme file.
===>] Merge in Hardware drivers and etc [<===​possibly unnecessary depends what you're doing
9. Obtain a copy of the firmware for your device that matches the version of the source code you are able to download from your vendor.
for me that was Build Number: MMB29K.N920AUCU2BPE6 but your mileage will almost certainly vary!
10. Download https://github.com/anestisb/android-simg2img
11. Unzip it right in your download folder, open the folder and then 'open in terminal'
12. Make it and then move it a directory in your path. Warning: My command puts in in the Ubuntu default /bin folder.
Code:
make
sudo mv append2simg img2simg simg2img simg2simg simg_dump.py /bin
13. Uncompress the AP file from the matching firmware and extract the system.img into it's own directory
then select that folder, right click, open in terminal
Code:
simg2img system.img sys.raw
mkdir sys
sudo mount -t ext4 -o loop sys.raw sys/
14. A drive mounted, look on your task bar it should've wiggled too. Copy the etc and vendor folders into the main folder of the sources we are merging
Click to expand...
Click to collapse
And where is exactly the main folder? Sorry, Im just confused
DigitalDoraemon said:
And where is exactly the main folder? Sorry, Im just confused
Click to expand...
Click to collapse
it's no problem this stuff isn't easy to just figure out on your own. remember to substitute droidvoider for your ubuntu user name
In this example my sources are on my desktop in a folder named Android_6.01_r1
Sources for toolbox for example:
/home/droidvoider/Desktop/Android_6.01_r1/system/core/toolbox/<sources will be here including Android.mk>
Script for modules, including toolbox
/home/droidvoider/Desktop/Android_6.01_r1/Makefile <--- this is our modules script, if you will
<open a terminal in the above folder then use that Makefile like so>
make toolbox <---- this will compile only what is needed to compile the module 'toolbox' (this takes a minute)
Out export folder we decided in ./home/droidvoider/bashrc
/home/droidvoider/Android_Build_Out/Android_6.01_r1/target/product/generic/system/bin
Anybody, please compile grep utility for arm and x86... Minimum Platform Version Android 4.0.3, API Level - 15
Thanks
Great & useful .

[GUIDE] Build Rom from Source For Tissot

What is ?
Android is the open-source operating system used for smartphones. Full Freedom for people using it
What is Source Code?
Android is an open-source software stack created for a wide array of devices with different form factors. The primary purposes of are to create an open software platform available for carriers, OEMs, and to make their innovative ideas a reality and to introduce a successful, real-world product that improves the mobile experience for users.The result is a full, production-quality consumer product with source code open for customization and porting.
So basically Allows to customize the things you like and make new things without any Restrictions. Cool isn’t it?
What is ROM ?
The ROM is the operating system. This is the User interface (Sense UI in HTC phones) and the file system for maintaining contacts etc. It is composed of a Linux kernel and various add-ons to achieve specific functionality.
What does a Rom Contain ?
Basically a Rom Contains following main things :
· Kernel
· Bootloader
· Recovery
· Radio
· Framework
· Apps
· core
· -runtime,Etc
Some Basics About Above Terms
Kernel :
A kernel is critical component of the and all operating systems. It can be seen as a sort of bridge between the applications and the actual hardware of a device. devices use the Linux kernel, but it's not the exact same kernel other Linux-based operating systems use. There's a lot of specific code built in, and Google's kernel maintainers have their work cut out for them. OEMs have to contribute as well, because they need to develop hardware drivers for the parts they're using for the kernel version they're using. This is why it takes a while for independent and hackers to port new versions to older devices and get everything working. Drivers written to work with the Gingerbread kernel on a phone won't necessarily work with the Ice Cream Sandwich kernel. And that's important, because one of the kernel's main functions is to control the hardware. It's a whole lot of source code, with more options while building it than you can imagine, but in the end it's just the intermediary between the hardware and the software. So basically if any instruction is given to mobile it first gives the command to kernel for the particular task execution.
Bootloader :
The bootloader is code that is executed before any Operating System starts to run. Bootloaders basically package the instructions to boot operating system kernel and most of them also have their own debugging or modification environment. Think of the bootloader as a security checkpoint for all those partitions. Because if you’re able to swap out what’s on those partitions, you’re able to break things if you don’t know what you’re doing. So basically it commands the kernel of your device to Boot the Device properly without any issues. So careful with bootloader since it can mess things very badly.
Recovery :
Recovery is defined in simple terms as a source of backup. Whenever your phone firmware is corrupted, the recovery does the job in helping you to restore or repair your faulty or buggy firmware into working condition. It is also used for flashing the Rom’s , kernel and many more things.
Radio
The lowest part of software layer is the radio: this is the very first thing that runs, just before the bootloader. It control all wireless communication like GSM Antenna, GPS etc.
What you’ll need
A relatively recent 64-bit computer (Linux, OS X, or Windows)(Virtual Machine will work as well) with a reasonable amount of RAM and about 100 GB of free storage (more if you enable ccache or build for multiple devices). The less RAM you have, the longer the build will take (aim for 8 GB or more). Using SSDs results in considerably faster build times than traditional hard drives.
A decent internet connection & reliable electricity
Some familiarity with basic operation and terminology. It would help if you’ve installed custom roms on other devices and are familiar with recovery. It may also be useful to know some basic command line concepts such as cd for “change directory”, the concept of directory hierarchies, that in Linux they are separated by /, etc.
Install the SDK
If you haven’t previously installed adb and fastboot, you can download them from Google. Extract it running:
Code:
unzip platform-tools-latest-linux.zip -d ~
Now you have to add adb and fastboot to your PATH. Open ~/.profile and add the following:
Code:
# add SDK platform tools to path
if [ -d "$HOME/platform-tools" ] ; then
PATH="$HOME/platform-tools:$PATH"
fi
Then, run source ~/.profile to update yur environment.
Install the build packages
Several packages are needed to build LineageOS. You can install these using your distribution’s package manager.
To build LineageOS, you’ll need:
bc bison build-essential curl flex g++-multilib gcc-multilib git gnupg gperf imagemagick lib32ncurses5-dev lib32readline-dev lib32z1-dev libesd0-dev liblz4-tool libncurses5-dev libsdl1.2-dev libssl-dev libwxgtk3.0-dev libxml2 libxml2-utils lzop pngcrush rsync schedtool squashfs-tools xsltproc zip zlib1g-dev
For Ubuntu versions older than 16.04 (xenial), substitute:
libwxgtk3.0-dev → libwxgtk2.8-dev
Java
Different versions of LineageOS require different JDK (Java Development Kit) versions.
LineageOS 14.1: OpenJDK 1.8 (install openjdk-8-jdk)
LineageOS 11.0-13.0: OpenJDK 1.7 (install openjdk-7-jdk)*
https://askubuntu.com/questions/761127/how-do-i-install-openjdk-7-on-ubuntu-16-04-or-higher
Create the directories
You’ll need to set up some directories in your build environment.
To create them:
Code:
mkdir -p ~/bin
mkdir -p ~//lineage
Install the repo command
Enter the following to download the repo binary and make it executable (runnable):
Code:
curl [url]https://storage.googleapis.com/git-repo-downloads/repo[/url] > ~/bin/repo
chmod a+x ~/bin/repo
Put the ~/bin directory in your path of execution
In recent versions of Ubuntu, ~/bin should already be in your PATH. You can check this by opening ~/.profile with a text editor and verifying the following code exists (add it if it is missing):
Code:
# set PATH so it includes user's private bin if it exists
if [ -d "$HOME/bin" ] ; then
PATH="$HOME/bin:$PATH"
fi
Then, run source ~/.profile to update your environment.
Initialize the LineageOS source repository
Code:
cd ~//lineage
repo init -u [url]https://github.com/LineageOS/.git[/url] -b lineage-15.1
Download the source code
Code:
repo sync -c -f --force-sync --no-clone-bundle --no-tags --optimized-fetch --prune
Prepare the device-specific code
Code:
git clone [url]https://github.com/TheScarastic/android_device_xiaomi_msm8953-common[/url] -b lineage-15.1 device/xiaomi/msm8953
git clone [url]https://github.com/TheScarastic/android_device_xiaomi_tissot[/url] -b lineage-15.1 device/xiaomi/tissot
git clone [url]https://github.com/TheScarastic/proprietary_vendor_xiaomi[/url] -b lineage-15.1 vendor/xiaomi
git clone [url]https://github.com/Tissot-Development/android_kernel_xiaomi_tissot[/url] -b 8.1 kernel/xiaomi/msm8953
Turn on caching to speed up build
Code:
export CCACHE_DIR=./.ccache
ccache -C
export USE_CCACHE=1
export CCACHE_COMPRESS=1
prebuilts/misc/linux-x86/ccache/ccache -M 50G
Configure jack
Jack is the new Java compiler used when building LineageOS 14.1. It is known to run out of memory - a simple fix is to run this command:
Code:
export _JACK_VM_ARGS="-Dfile.encoding=UTF-8 -XX:+TieredCompilation -Xmx4G"
Make Clean Build
Code:
make clean
Initialize the build command
Code:
source build/envsetup.sh
Start Build
Code:
croot
brunch tissot
For More info:
https://source..com/source/requirements
https://wiki.lineageos.org/devices/cheeseburger/build
Thanks bro..
DGEEEK said:
Thanks bro..
Click to expand...
Click to collapse
Thany you for this guide! Will try this!
saski4711 said:
Thany you for this guide! Will try this!
Click to expand...
Click to collapse
:good:
Thanks for guide, btw what's the size of source code ?
prabhjot-singh said:
Thanks for guide, btw what's the size of source code ?
Click to expand...
Click to collapse
Around 20-25GB I think
Followed the above steps to the letter but I get an error right at the beginning:
Code:
ninja: error: 'kernel/xiaomi/msm8953/arch/arm64/configs/lineage_tissot_defconfig', needed by '/home/rossi/android/lineage/out/target/product/tissot/obj/KERNEL_OBJ/.config', missing and no known rule to make it
build/core/ninja.mk:151: recipe for target 'ninja_wrapper' failed
make: *** [ninja_wrapper] Error 1
make: Leaving directory '/home/rossi/android/lineage'
Current git broken? Any idea?
saski4711 said:
Followed the above steps to the letter but I get an error right at the beginning:
Code:
ninja: error: 'kernel/xiaomi/msm8953/arch/arm64/configs/lineage_tissot_defconfig', needed by '/home/rossi/android/lineage/out/target/product/tissot/obj/KERNEL_OBJ/.config', missing and no known rule to make it
build/core/ninja.mk:151: recipe for target 'ninja_wrapper' failed
make: *** [ninja_wrapper] Error 1
make: Leaving directory '/home/rossi/android/lineage'
Current git broken? Any idea?
Click to expand...
Click to collapse
Hello,
Don't use that kernel, as actually don't work properly in Xiaomi Mi A1. This error is caused because the file "lineage_tissot_defconfig" it's not named like that, exactly it's name is "tissot_defconfig", for your first build with lineage I recommend you to use the following sources, because are adapt for Lineage. Don't forget to use superuser privileges to compile, it avoids a lot of possible errors with normal user.
Device tree
Vendor
Kernel
Give thanks to user @ghpranav for sources :good:
Regards
black_arashi said:
Hello,
Don't use that kernel, as actually don't work properly in Xiaomi Mi A1. This error is caused because the file "lineage_tissot_defconfig" it's not named like that, exactly it's name is "tissot_defconfig", for your first build with lineage I recommend you to use the following sources, because are adapt for Lineage. Don't forget to use superuser privileges to compile, it avoids a lot of possible errors with normal user.
Device tree
Vendor
Kernel
Give thanks to user @ghpranav for sources :good:
Regards
Click to expand...
Click to collapse
Thanks for the info. I'm now past the error. Will take some time though since I'm building on my laptop :cyclops:
saski4711 said:
Thanks for the info. I'm now past the error. Will take some time though since I'm building on my laptop :cyclops:
Click to expand...
Click to collapse
Between 3 to 5h in modern pc, probably you will need between 7 to 10h in a laptop, depends on Nº of Cores and RAM, anyway, good luck in your first compilation :good:
black_arashi said:
Between 3 to 5h in modern pc, probably you will need between 7 to 10h in a laptop, depends on Nº of Cores and RAM, anyway, good luck in your first compilation :good:
Click to expand...
Click to collapse
Thx m8. Still no error. Compiling over night on single core to avoid throttling / overheating. :highfive:
saski4711 said:
Thx m8. Still no error. Compiling over night on single core to avoid throttling / overheating. :highfive:
Click to expand...
Click to collapse
Probably you will se a lot of "warning" don't apologice, it's normal, these warning issues is being solved during the compilation. Some info just in case
saski4711 said:
Followed the above steps to the letter but I get an error right at the beginning:
Current git broken? Any idea?
Click to expand...
Click to collapse
Rename tissot_defconfig to lineage_tissot_defconfig in arch/arm64/configs
Nice share brotherr :good:
Keep mia1 like the sky full of stars, so many custom rom :highfive::laugh:
Sent from my Xiaomi Mi A1 using XDA Labs
-Rhoby|™-Bugs said:
Nice share brotherr :good:
Keep mia1 like the sky full of stars, so many custom rom :highfive::laugh:
Click to expand...
Click to collapse
Thanks
Hello and thanks for the guide.
I am trying to build Dirty Unicorns 7.1.2 for tissot. I have downloaded kernel, vendor and device and repo synced DU n7x branch. I have also downloaded device_qcom_sepolicy and changed some files in device/xiaomi/tissot folder in order for the build to start normally. After 1.30 minutes of building i get this error
Code:
ninja: error: '/home/manoskav/du-tissot/out/target/product/tissot/obj/STATIC_LIBRARIES/bootctrl.msm8953_intermediates/export_includes', needed by '/home/manoskav/du-tissot/out/target/product/tissot/obj/EXECUTABLES/update_engine_sideload_intermediates/import_includes', missing and no known rule to make it
make: *** [build/core/ninja.mk:167: ninja_wrapper] Error 1
Maybe should i try n7x-caf branch or n7x is ok for tissot? Can anyone help me with the building process?
Thanks in advance.
mparmpas122321 said:
Hello and thanks for the guide.
I am trying to build Dirty Unicorns 7.1.2 for tissot. I have downloaded kernel, vendor and device and repo synced DU n7x branch. I have also downloaded device_qcom_sepolicy and changed some files in device/xiaomi/tissot folder in order for the build to start normally. After 1.30 minutes of building i get this error
Maybe should i try n7x-caf branch or n7x is ok for tissot? Can anyone help me with the building process?
Thanks in advance.
Click to expand...
Click to collapse
Hmm but seriously it's tougher bro because its bootctrl it need more configuration
I tried building for Tissot but I'm having this issue.
[email protected]:~/dos$ . build/envsetup.sh
including device/generic/car/vendorsetup.sh
including device/generic/mini-emulator-arm64/vendorsetup.sh
including device/generic/mini-emulator-armv7-a-neon/vendorsetup.sh
including device/generic/mini-emulator-x86_64/vendorsetup.sh
including device/generic/mini-emulator-x86/vendorsetup.sh
including vendor/discovery/vendorsetup.sh
[email protected]:~/dos$ brunch tissot
including vendor/discovery/vendorsetup.sh
build/core/product_config.mk:236: *** Can not locate config makefile for product "tissot". Stop.
build/core/product_config.mk:236: *** Can not locate config makefile for product "tissot". Stop.
No such item in brunch menu. Try 'breakfast'
[email protected]:~/dos$
Click to expand...
Click to collapse
Can anyone please help me out?
black_arashi said:
Hello,
Don't use that kernel, as actually don't work properly in Xiaomi Mi A1. This error is caused because the file "lineage_tissot_defconfig" it's not named like that, exactly it's name is "tissot_defconfig", for your first build with lineage I recommend you to use the following sources, because are adapt for Lineage. Don't forget to use superuser privileges to compile, it avoids a lot of possible errors with normal user.
Device tree
Vendor
Kernel
Give thanks to user @ghpranav for sources :good:
Regards
Click to expand...
Click to collapse
@black_arashi
Oh so ghpranav's repo has LOS source added into it? If so is there any Android Stock for all these?
Thanks

Categories

Resources