Build Lineage on my own - Moto G7 Power Questions & Answers

Hello, can someone give me a hint, howto build Lineage (based on the work of @SyberHexen) on my own?
I think the most work is done, but I wan't to dig a bit deeper into it.
I know there are several guides, specific to one device but I don't know how to include the sources of SyberHexen.
Thanks!

Setup your build environment with Java and all the required packages. Setup repo and grab the source code. Clone the device, kernel and vendor trees. Go through the steps to initialize your build system then build the ROM.

Related

how to checkout specific kernel from android git branch?

Hi all,
I'm having trouble trying to check out a version of the android source code from the git repository, with a known build.
For example, my Droid 1 is running:
2.6.32.9-g68eeef5
[email protected] #1
frg83d
I first figured that g68eeef5 referred to the git hash, but using gitk it appears that this is not a valid hash.
Does anyone know how I might be able to grab the kernel code for this build?
Thanks!
George
You could check out this guide http://stackoverflow.com/questions/315911/git-for-beginners-the-definitive-practical-guide#316055, in case you haven't already. It's got info on checking out branches - you'll need to know its name - and a lot more.
It seems g68eeef5 is kernel-specific - it might correspond to a revision/version of the kernel only (as opposed to the android system). That would not correspond to a branch though - kernel or android - rather to a revision inside a branch I'd think.
right, i'm trying to find the exact kernel branch or revision. g68eeef5 can't be a hash, since it has a 'g' in it, so i'm not sure what it corresponds to exactly.

[FAQ/HOWTO] An introduction to how-to-build a kernel for MT6589

Hi guys,
I was working on this since some time and here it is
Please read FAQ first
FAQ :
Can I compile a MT6589 kernel for every phone ?
As you know, a MT6589 kernel won't fit in every MT6589 smartphone because of specific configs/files in the kernel source tree.
So, if you compile my kernel which is expected to work on a Faea F2S don't expect it to work on a Acer Liquid E3 for example.
Conclusion : You have to get the kernel source for your phone​
How can I check my kernel source ?
Of course, this is not enough to see "source code for ZTE N986", you have to check if it's full or not and if it works.
Most people don't know what is working kernel source. You just have to read the GPL guidelines that every manufacturer have to complain with :
“ The source code for a work means the preferred form of the work for making modifications to it. For an executable work, complete source code means all the source code for all modules it contains, plus any associated interface definition files, plus the scripts used to control compilation and installation of the executable. ”
The part which has not to be included is the toolchain but there should reference to it (which toolchain to use)
For MT6589 kernel, the toolchains arm-eabi-4.6 and arm-linux-androideabi-4.6 should be used. (mtk used arm-linux-androideabi-4.6 for kernel but it should be arm-eabi-4.6)
So now you know which toolchain to grab and then for kernel source you have to check this minimal structure :
bionic
kernel
mediatek
build
config
custom
kernel
platform​README​
If I have kernel source, can I build it for my device ?
Erm... Sometimes the structure is here but the kernel source is messy... Why ?
Because you were not provided the matching source of the kernel used on your smartphone and the reasons are multiple (I won't give details).
So, the idea is to run a first build. If you get errors, then check the step above about toolchain and structure.
The next step for fixing errors is to play with source. Good luck for that.​
What are the benefits of a custom kernel for MT6589 ?
First big benefit is to introduce kitkat compatibility because there was an issue on android binder driver in mtk kernel source.
Next benefit is to be able to remove some stuff from mtk which is useless on user side and waste ressources (a lot of debug for example).
Others benefits will be in optimizations or new features (see frandom for example)​
HOWTO :
Build from my repo (specific devices supported) - It's not for compiling your kernel source but to understand how kernel build works​I explain how to build from my repo first because it can help you to understand how you should build kernel source
Prerequisites : A build environment (actually Ubuntu Saucy x64 with build-essentials, ccache, repo, java, perl v5.14+ and openssl) and I won't explain how to get one as there is multiple howto on the net.
For repo, the idea is to create a bin directory in your $HOME (usually /home/accountname/), copy repo binary inside it and then add this bin to $PATH var.
BE CAREFULL TO WHAT YOU DO WITH $PATH VAR ! I always see people doing :
Code:
export PATH=/home/foo/bin
this is erasing $PATH var, just check before and after with echo $PATH
So the idea is to introduce your path AFTER the actual $PATH var
This is easy...
Code:
export PATH=[COLOR="red"]$PATH:[/COLOR]/home/foo/bin
And of course, $PATH is reset once you close terminal and I won't explain how to set $PATH automatically.
Once you got this, everything should be working and it will be easy
Code:
mkdir workdir
cd workdir
repo init -u https://github.com/Dr-Shadow/android_kernel_mt6589_manifest.git -b master
repo sync
Then you should get this in your workdir :
kernel
manifest
mtk-tools
out
ramdisk
scripts
toolchain​Just do :
Code:
cd kernel
./certificates.sh
./build.sh
./certificates.sh is needed only once (it's for signing flashable zip and it will setup some keys for it, just reply to questions and don't add passphrase)
And of course, the build.sh contains most things you need to know on steps for building kernel (which commands to use) and you need to know how it works ​Build from your own kernel source​
I'm building the doc... I have to remind which vars need to be overriden
Reserved
Reserved #2
Thanks for making this thread brother it will help us to learn... Subscribed
Looking forward to the how-to to build with your own kernel source.
Dr-Shadow said:
Hi guys,
I was working on this since some time and here it is
Click to expand...
Click to collapse
Thank you Dr-Shadow! This is very cool. I'm going to try it out!
Great
It's always nice to see further development on MTK Based Devices.
Regards
I'll chip in and say thanks too. Finally getting around to trying to compile Alcatel's OneTouch Hero (aka TCL Y910) provided sources.
I might be in as well with A820, but I'm relatively new to Android and have only done porting of 4.1 and 4.2 so far.
Haven't built anything although I have some knowledge about the source code and SDK, which I've only used for reference purposes and the tools from it.
Will try to compile the stock kernel this weekend, but I'm not quite sure if something else is needed, even if the kernel source seems complete to me.
I'm a quick learner and have a lot of programming experience in other technologies, even thought I'm more of a front-end developer these days.

Stuck Forking device’s proprietary vendor files

I have been following the XDA Guide on porting roms found here: http://xda-university.com/as-a-developer/porting-aosp-roms-using-source-code
I am stuck at the point where I am supposed to fork the device's proprietary vendor files.
What I am trying to do is Port Omnirom for the international S3 to the US (d2lte).
This is my first attempt at a port. I can not find the the proprietary vendor files on the CM github as labelled in this guide. Have they changed the format or am I missing something now that there are unified builds?
Any help appreciated as I am clueless how to proceed without being able to fork the proprietary vendor files.
Thanks
TheMuppets is the place to look:
https://github.com/themuppets

Cm13 Question D850

Can someone explain why no Cm13 for d850 but for every other carrier? Use to be ATT always gets updates first.
Link to download
https://www.androidfilehost.com/?a=show&w=files&flid=42910
Link to thread
http://forum.xda-developers.com/lg-g3/general/cm13-lg-g3-test-builds-t3245744
underscorenorm said:
Link to download
https://www.androidfilehost.com/?a=show&w=files&flid=42910
Link to thread
http://forum.xda-developers.com/lg-g3/general/cm13-lg-g3-test-builds-t3245744
Click to expand...
Click to collapse
is it reliable ?
I need the external SD card, and Marshmallow is kinda weird with formatting as internal right now, so I didn't use it long, -I didn't any improvements to battery life either, so I wouldn't say it's great right now, but there are a few ROMs out there based on cm13.
FawkiDied said:
is it reliable ?
Click to expand...
Click to collapse
It's not that difficult...
Update:
Have built and posted CM13 ROM for d850 with working GPS. See this thread.
It's not terribly difficult to build your own "unofficial" CM13 ROM image for the d850. I did it this morning (12/19). I was surprised that most everything works, more or less, except for GPS which is still dead as a doornail.
The only difficult part of building CM yourself is the initial setup of a build environment. After that, any time you want the latest-and-greatest you just sync the environment to the latest changes, which takes maybe a minute, and then start the build – which can take a couple/few hours. Best done last thing before you go to bed. Cyanogenmod has good instructions here: https://wiki.cyanogenmod.org/w/Build_for_d850. When you follow the instructions to build CM-12.1 just substitute CM-13.0.
A few hints:
Your version of java
The CM13 build will fail with anything other than Oracle Java 1.7.xxx. No, it will not build with 1.8. No, it will not build with 1.6. No, it will not build with open openjdk or icedtea anything. I had to uninstall Oracle Java 1.8 to prevent its being used by default even though I had manually specified to use Oracle Java 1.7.
The vendor blobs
The instructions will say at one point to extract the vendor proprietary blobs from your current version of CM13. Huh? Not too helpful there. Use the blobs that TheMuppets has pulled together on github. https://github.com/TheMuppets/proprietary_vendor_lge/tree/cm-13.0. Additional hint: It's a whole lot easier to download the zip than it is to set up a proper git environment to retrieve them. Using git is like taking a howitzer out to hunt rabbits, in this case.
Installing
Copy the newly created .zip image from $OUT to your phone storage by your favorite means. Also copy over a version of gapps for CM13 (Android 6). First, manually wipe system. Then flash your new CM13 image and a CM13 compatible version of gapps at the same time. If you don't then the upgrade from 12.1 to 13 will fail when CM13 starts. Apparently Google Play Store is launched, and if it is not CM13 (Android 6) compatible it will repeatedly abort during the upgrade process. You can find several configurations of gapps for CM13 here: http://opengapps.org/. The "mini" for Android 6 works great for me. If you do this then it seems possible to do the upgrade "dirty"; that is, wiping cache and delvik but not apps and data. That saves a whole lot of time not having to restore that stuff. (Yeah, I can hear the incoming rounds now.)
Rebuilding after first build
I didn't use ccache at first, hoping to avoid additional complexity the first few builds. However, it works great, reducing rebuild time to just over ten minutes on subsequent builds after its first use. Use ccache.
Also, I created a super-simple shell script to initiate a rebuild. It's run from android/system/
Code:
#!/bin/bash
# sync with repository and initiate rebuild using ccache
# see https://wiki.cyanogenmod.org/w/Build_for_d850
repo sync
source build/envsetup.sh
breakfast d850
export USE_CCACHE=1
prebuilts/misc/linux-x86/ccache/ccache -M 50G
croot
brunch d850
echo "end of rebuild script"
Good luck, and let's hope a maintainer for cm13 d850 shows up soon!

can anyone offer help to a newbie plz.

I know that this source is not Lineage but I would think the basic principles for building for an supported device under Lineage would also be applicable to any other source repository.
All of the guides I have found only tell you how to build for a supported device and not any help for an unsupported one. I figured out how to sync a suitable device tree and kernel etc but since the rom source repository does not support my device I can't go any further. I can't get it to build from my sync'd local sources it keeps trying to pull stuff from the original source repository so builds fail at the start.
I have setup a local manifest for this project that sync's the device tree and a kernel and the proprietary blobs and this sync completes without error. next I ran - source build/envsetup.sh and then brunch hlte (not a supported device I know) but that throws up this error -
build/core/product_config.mk:248: * Can not locate config makefile for product "gzosp_hlte". Stop.
Device hlte not found. Attempting to retrieve device repository from GZOSP-Devices Github (http://github.com/GZOSP-Devices).
Repository for hlte not found in the GZOSP-Devices Github repository list.
If this is in error, you may need to manually add it to your .repo/local_manifests/gzosp_manifest.xml
build/core/product_config.mk:248: * Can not locate config makefile for product "gzosp_hlte". Stop.
So I think that the error basically means that github.com/GZOSP-Devices does not have the hlte device listed so can anyone tell me how to make the build point to my local repository after I have sync'd so that it at least starts to build ?
I am a newbie to rom building and have much to learn but I would really appreciate any help you guys could give.
Thanks in advance for any an all help offered.

Categories

Resources