yashsingh1/xdaforums huggingface dataset:
[Android Software/Hacking General [Developers Only]] xenonism:
These few simple instructions from the readme file enable you to build a working kernel (at least in a Linux environment):

How to Build

kernel
======
1. Get the prebuilt cross compiler from AOSP website:
$ git clone https://android.googlesource.com/platform/prebuilts/gcc/linux-x86/arm/arm-eabi-4.6

2. Add required cross compiler to PATH:
$ export PATH=/YOUR_TOOLCHAIN_PATH/arm-eabi-4.6/bin:$PATH
$ export CROSS_COMPILE=arm-eabi-
3. Then use the following commands to build the kernel:
$ ./makeMtk k01q_e new k

make menuconfig can be made to work, but you need to set some parameters and I can't look into it right now. :(

You previously asked something about the custom partition, I need some guidance there as I am not familiar with the IMEI issue.
[Android Software/Hacking General [Developers Only]] HypoTurtle:
Yea wasn't sure about menuconfig as mtk uses projectconfig rather than def_configs.

In the custom partition there are files like /custom/etc/firmware/modem.img etc. When messing with a Flyme port it was these files (and possible conflicts in /system) that caused an IMEI:nul.

FYI I opened the custom partitions on windows using an ext viewer after running the imgs through sgs2toext4.
[Android Software/Hacking General [Developers Only]] bigrammy:
Kernel building Mediatek

Not sure if you guys have seen or read this but it's a pretty comprehensive guide to building the mediatek kernel by [MENTION=5321417]MasterAwesome[/MENTION] and should really be compulsary for all kernel related things thread here http://xdaforums.com/showthread.php?t=2754513

[MENTION=4056517]HypoTurtle[/MENTION]

Regarding the custom partition this is or could be a problem for us now and in the future and may require further investigation. The cm sprout branch has the modem.img in the (normal place /system/etc/firmware) but as you say ours is in the custom partition which is probably to protect it from bad /system flashes :confused:

Thing is I see no normal type link to it in the /system/etc/firmware so it must be linked some other way which may explain why all my port attempts failed as none of them used a custom partition :confused: (Asus_X002)

Maybe we will have to repartition the emmc to a standard config and alter the kernel (if the links are set via the kernel that is) for cm and other ports to work smoothly as I am unsure just how everything is linked up. :eek:

I have not had much experience with custom partitions so someone one know's of a good info source please link it. :good:

Hopefully Master [MENTION=5480061]Santhosh M[/MENTION] can figure out what's going on with the custom partition :fingers-crossed:
[Android Software/Hacking General [Developers Only]] HypoTurtle:
The partition is symlinked from .../by-name/custom (which is symlinked by the kernel from dev/block/mmcblk0p12) to /dev/customimg which is mouned after an e2fsck to /custom. /custom isn't linked to /system, it's just added to the global environment (init.environ.rc), will need to check on the environ, I'm on flyme and it has /custom/lib added to the library path (which doesn't exist).
[Android Software/Hacking General [Developers Only]] bigrammy:
Haha thanks that explains a lot of weird things perfectly. :good:
[Android Software/Hacking General [Developers Only]] Santhosh M:
What's the problem or what is the issue here.

Mediatek compiling guide ( by masterawesome ) that you have linked to is not actually practically this mtk kernel is done and is just way too complicatedly explained.

There is no defconfig stuff or pulling config.gz from phone in mtk. In this new source its just simple. Set up your toolchain path. Execute the makeMtk followed by the project no u want. Get zImage and patch it for mtk header and merge it with stock ramdisk. For this newer mtk chipsets repack has an extra stuff where u have to be careful of kernel command line parameters.

That's it the kernel stuff in mtk
[Android Software/Hacking General [Developers Only]] MasterAwesome:
^^This. I've switched over to a qualcomm device and I haven't had any time to try the newer kernel sources neither have I any method to get a mediatek mobile.
[Android Software/Hacking General [Developers Only]] :
Hmm... If there's only some way to turn the MTK Android emulator into a testing device?

http://labs.mediatek.com/
[Android Software/Hacking General [Developers Only]] yuweng:
i don't think i can contribute much as i can only build from source but suck at C/C++ . . . :p

As for the recovery Touch problem, all i can advice is to those that have P6000 in hand & can build from source to hang out here from 9am onwards & ask Master Shifu Dees_Troy to look into the Touch code, i'm sure he'll be able to solve it . . . :fingers-crossed: Or you can also checkout with Master Shifu Carliv too . . . :cowboy:
[Android Software/Hacking General [Developers Only]] Santhosh M:
Carliv and myself already tried some days back by making changes to touchpanel driver coding and using that compiled kernel. Unfortunately it didn't help for recovery.
[Android Software/Hacking General [Developers Only]] bigrammy:
Hi bro,

Thanks for dropping by :D

I linked the guide for reference only and not as an actual guide to building our Kernel but there is some useful information in the thread for noobs me included to get a general understanding of kernel itself. :o

I also link the mt6577 thread for the same reason :o

Maybe some of the guys overlooked the repackage method and [MENTION=5186178]carliv[/MENTION] has explained this in his thread Here which I already linked although you need to use the latest boot/recovery tools as older versions dont take account of the newer .img's. ;)

Luckily [MENTION=5186178]carliv[/MENTION] has also released his new boot/recovery tools Kitchen Here which will simplify things a little for noobs so thanks to him for that. :good:

I have not done anything with the kernel yet as I am still trying to workout the best way to port cm I hope your having more luck than me :crying: :laugh:

Not sure but think it's only for app's full info is here although you need to be registered to get it. http://labs.mediatek.com/site/global/developer_tools/mediatek_android/mediatek_sdk_android/index.gsp

Does the standard android emulator not work :confused:

I thought the mtk one was just for testing the dual sim stuff in apps. :confused:

[MENTION=4478781]yuweng[/MENTION] [MENTION=5186178]carliv[/MENTION]

I found this info regarding the touch which may be relevant to our problem too Please see Here
[Android Software/Hacking General [Developers Only]] :
Well, something in there could just work? I have an account, actually, and before source code all I got was some useless app building stuff.
[Android Software/Hacking General [Developers Only]] bigrammy:
Yes as said its a small sdk for building and testing mediatek Dual Sim type app's not for running the full system.

The normal Android SDK Emulator should still run your build but you can't test stuff regarding dual sim function such as sim switching etc

Maybe someone very clever maybe able to integrate the two :laugh:

Well thats my understanding anyway although I could be wrong as I often am :laugh:
[Android Software/Hacking General [Developers Only]] yuweng:
For the first time, a MTK source that builds out-of-the-box . . . :eek: :laugh:

As the ReadME file says . . .

git clone https://android.googlesource.com/platform/prebuilts/gcc/linux-x86/arm/arm-eabi-4.6 $home/arm-eabi-4.6
mkdir -p $home/P6000
cd $home/P6000 [COLOR="Red"]#[/COLOR] Extract the content of [COLOR="Blue"]P6000_sourcecode.tar.gz[/COLOR] to this folder
export PATH=$home/arm-eabi-4.6/bin:$PATH
export CROSS_COMPILE=arm-eabi-
perl makeMtk k01q_e new k

You may need to change ownership of P6000 folder. On my BuildBox where i already have cm-11.0 source synced, takes around 11 minutes to complete . . .

cd $home/P6000
export PATH=$home/[COLOR="Blue"]cm[/COLOR]/prebuilts/gcc/linux-x86/arm/arm-eabi-4.6/bin:$PATH [COLOR="red"]#[/COLOR] Path of your [COLOR="blue"]cm-11.0[/COLOR] source
export CROSS_COMPILE=arm-eabi-
perl makeMtk k01q_e new k

View attachment 3185818

Note : Source extract error but will build . . . However, [MENTION=4830320]BachMinuetInG[/MENTION] your source at github doesn't . . . :o

i've deleted all other drivers except GT9XX . . . :cowboy:

Steps

Use Master Shifu Carliv's tool here to unpack your custom recovery.

Extract kernel_k01q_e.7z to replace existing, repack & see if Touch works while at recovery . . . :fingers-crossed:
[Android Software/Hacking General [Developers Only]] Santhosh M:
Doesn't work. Checked it :)

Removing them won't help why because even though u have deleted touchpanel drivers under mediatek/custom/common they are not compiled actually. What compiles is what u have defined in ur projectconfig and if that file if it has any dependencies it takes from common folder. Other than that those are just for the common chipset. Any other similar chip device using any other touch panel driver and if that has any dependency it will take from that common folder.
[Android Software/Hacking General [Developers Only]] :
That's odd... I directly committed my source to GitHub. Maybe I'll put up the link again.

Did you try to build while renaming the cloned directory to P6000 like in the readme? If not I'll do a commit on the ReadME on my GitHub to tell users to.

EDIT: Just realized the sources didn't build because of the ~/mt6732 folder was used instead of the ~/P6000. I've added a readme file on my GitHub that tells users to first rename the folder. Thanks for the note!

By the way, do you all want a Hangouts group conversation where we can all discuss this quicker? Doing it on XDA (without a proper XDA app) is pretty inconvenient.
[Android Software/Hacking General [Developers Only]] yuweng:
Based on bigrammy's link it says ft5xxx interferes with GT9xx & i thought by removing all other non relevant drivers will work then after replying then only i realize that it actually builds ONLY GT9xx so i guess someone with the knowledge of C/C++ need to look at the whole source code thingy, this is beyond my expertise . . . :o

i actually tried few times, first was downloaded the zip then git clone then changing folder name, only source from your google drive builds, i guess that explained why so many previous MTK source that i synced from github doesn't build . . . :cowboy:

Updates

Hmm, the following command builds with source from your github . . . :o

cd ~/mediatek/mt6592
export PATH=~/arm-eabi-4.6/bin:$PATH
export CROSS_COMPILE=arm-eabi-
perl makeMtk bird92_cwet_a_kk new k

OR

perl makeMtk bird92_cwet_a_td new k

While the below works for the source code in tar.gz . . .

perl makeMtk k01q_e new k
perl makeMtk k01q_h new k
perl makeMtk nb6752_lwt_cu new k
perl makeMtk nb6752_lwt_kk new k

perl makeMtk -help

Above command will tell you all the commands which will also tell you that this source is just the kernel source only, you can't build preloader, lk, cache, systemimage & etc, Elephone why it is not full source . . . :rolleyes:
[Android Software/Hacking General [Developers Only]] HypoTurtle:
Has anyone poked around the preloader/lk code? Could the touch issue arise from there?

[MENTION=4830320]BachMinuetInG[/MENTION] perhaps an IRC (perhaps #P6K on freenode) would be a better idea than hangouts??
[Android Software/Hacking General [Developers Only]] bigrammy:
Hi All,

In the thread there is another link that was posted and in that the guy goes into more detail (direct link HERE) although the device is not MTK it gives good insite into how he fixed the touch for that device. :good: You may need to scroll down a little ;)

I think before we dig too deep it could be just a simple INSMOD as suggested there :fingers-crossed:

Edit: The above is not relevant to our Android version so thanks to [MENTION=5480061]Santhosh M[/MENTION] for pointing this out :good:

Or like the other guy said the goodix debug running during startup which would explain why it works when fully booted :eek: (Debug Stopped)

Again I would recommend this article HERE which explains things and is easy to understand.

I highly recommended anyone with an interest to view it. :good:
[Android Software/Hacking General [Developers Only]] Santhosh M:
I just did a quick glance on that link. In case you are speaking on insmoding any module, after jelly bean ( 3.4.5 ) mediatek builds modules within the kernel ( the 3.4.67 kk and the 3.10 kk newer kernels ) and hence you can't insmod any module in init.rc or init.project.rc because now modules are no longer available externally. So you already comment them out if u had observed in stock init
[Android Software/Hacking General [Developers Only]] :
Hmm IRC requires a server? Maybe you can help set up, since I really don't use IRC that much (most of the time I'm just on Facebook and G+)

Also I don't think the preloader affects the touch, as the preloader simply allows the device to boot. (Without preloader binaries the phone will just be dead, literally. It won't even flash)

It's best to leave the preloader untouched.
[Android Software/Hacking General [Developers Only]] HypoTurtle:
For IRC download AndroIRC (I don't use irc much myself), freenode would be the server of choice, could register a channel I suppose (#P6k or #MT6732 ???)

Yea preloader was just a thought - lk could have an influence? Thinking more in regard to [MENTION=5186178]carliv[/MENTION]'s comments on the touch being turned off in recovery and the kernel being the same for boot/recovery - so the touchscreen hardware isn't being exposed for the kernel/modules to latch onto it.
[Android Software/Hacking General [Developers Only]] bigrammy:
Thank for the info bro I edited my post accordingly :eek:

Sorry if this got answered last time around but did we find what m_alsps_input (input4) actually does I can't seem to make it respond in getevent and when I check it against the mtk-tpd (input5) it looks very similar in structure but with 0's in most of it's capabilities. :confused:

Input4 remains while in recovery but input5 is gone /sys/class/input/

Also for info: cat /sys/class/i2c-adapter/i2c-0/0-005d/modalias (output in recovery mode is i2c:gt9xx) :confused:

i2c0 also gives us an interrupt in recovery mode

116: 7 - 11007000.I2C0

all very strange why it's not loading :laugh:
[Android Software/Hacking General [Developers Only]] :
IRC node

IRC node information:

Server: Freenode (EN), via AndroIRC

Channel: #P6kDev

Discussions can be made there! :good::laugh:
[Android Software/Hacking General [Developers Only]] greekfragma:
Hello guys. I am reading all stuff here and I would like to express my gratitude for your efforts till now. Too bad I can't follow the IRC talking. It would be nice to post here any updates. Is the saucery complete for experiments with Lollipop ART ?

I have explained to bigrammy through PM's that I have an extra potato free for testing purposes and I can beta test anything you would like to. Feel free to contact me in case there is something to contribute with. Cheers and keep your efforts high. :good:
[Android Software/Hacking General [Developers Only]] :
GitHub

I've put up the kernel source code to another repository for the Elephone P6000 so that you can better fix bugs and communicate source code with the community.

Check this link for details:

http://alldroidreviews.blogspot.sg/2015/03/elephone-p6000-github-repository.html

Please do communicate and interact with the community! I believe that only by doing that we can successfully build ROMs for the device :)
[Android Software/Hacking General [Developers Only]] bigrammy:
Hi bro,

Thanks for this :good:

Speaking for myself I am a total noob to compiling from source, Git and Semi Noob to Linux in general so anything to simplify things a little is most welcome :highfive:

It's been a little quiet here lately so I can only assume people are busy compiling :eek:

Thanks again. :cool:
[Android Software/Hacking General [Developers Only]] HypoTurtle:
Might be better to rename it to android_kernel_elephone_p6000, just saying.

To pool together all we have (as well as the aforementioned):

Recovery Device Tree

Vendor Files

ALPS kernel building powerpoint (perhaps from MTK)

Something to look at:

MIUI Patchrom

I'm not set up for any compiling atm. and I'm in no way versed in C/C++.

Currently in the process of recovering as much as I can from my external hard-drive after I tried to move a partition; it crashed at 90%
[Android Software/Hacking General [Developers Only]] :
I've renamed the repository, but GitHub wants to verify that I'm a human, so my profile has been temporarily taken offline. You can still check my blog for any updates, and the original archive link is still there! (Do remember to commit when the repo is online again)
[Android Software/Hacking General [Developers Only]] HypoTurtle:
http://blog.sina.com.cn/s/blog_89f592f501014axl.html

Relevant for touch recovery?
[Android Software/Hacking General [Developers Only]] :
Could be used, but it's for Android 4.1. Some things may need to be changed?
[Android Software/Hacking General [Developers Only]] :
http://bbs.elephone.hk/thread-3015-1-1.html#.VQATA0dzl-8

Ay, how's progress? Elephone is looking for developers!
[Android Software/Hacking General [Developers Only]] bigrammy:
Very quiet here :(

I guess building ROM's ain't too easy after all even with the source code :rolleyes:

I am still trying to educate myself on the building of ROM's from source thing so I can't see much happening from me :laugh:

PS: I will not be applying for the job :laugh: :laugh: :silly:
[Android Software/Hacking General [Developers Only]] Santhosh M:
CM11 on P6000

Cm11 screenies on p6000 :)
[Android Software/Hacking General [Developers Only]] :
Hi guys, thanks to Elephone I'll be getting a P6000 soon :) so I'll be joining in testing anything you all have built. I'll also try to see if I can help in building anything!

Built from source?
[Android Software/Hacking General [Developers Only]] HypoTurtle:
TWRP Build environment

Omni5.1

local_manifest

<?xml version="1.0" encoding="UTF-8"?>
<manifest>

<remote name="xda"
fetch=".." />

<remote name="github"
fetch="https://github.com/" />

<remote name="aosp"
fetch="https://android.googlesource.com"
review="android-review.googlesource.com" />

<remote name="omnirom"
review="gerrit.omnirom.org"
fetch="https://github.com/omnirom" />

<remove-project name="platform/prebuilts/clang/darwin-x86/3.1" />
<remove-project name="platform/prebuilts/clang/darwin-x86/3.2" />
<remove-project name="platform/prebuilts/clang/darwin-x86/arm/3.3" />
<remove-project name="platform/prebuilts/clang/darwin-x86/host/3.4" />
<remove-project name="platform/prebuilts/clang/darwin-x86/host/3.5" />
<remove-project name="platform/prebuilts/clang/darwin-x86/mips/3.3" />
<remove-project name="platform/prebuilts/clang/darwin-x86/x86/3.3" />
<remove-project name="android_prebuilts_gcc_darwin-x86_arm_arm-eabi-4.4.3" />
<remove-project name="platform/prebuilts/gcc/darwin-x86/host/headers" />
<remove-project name="platform/prebuilts/gcc/darwin-x86/host/i686-apple-darwin-4.2.1" />
<remove-project name="platform/prebuilts/gcc/darwin-x86/mips/mips64el-linux-android-4.9" />
<remove-project name="platform/prebuilts/gcc/darwin-x86/mips/mipsel-linux-android-4.8" />
<remove-project name="platform/prebuilts/gcc/darwin-x86/mips/mips64el-linux-android-4.8" />
<remove-project name="platform/prebuilts/gcc/darwin-x86/x86/x86_64-linux-android-4.8" />
<remove-project name="platform/prebuilts/gcc/darwin-x86/x86/x86_64-linux-android-4.9" />
<remove-project name="platform/prebuilts/python/darwin-x86/2.7.5" />
<project path="device/elephone/p6000" name="carliv/device_elephone_p6000" remote="github" revision="master" />
<project path="vendor/elephone/p6000" name="kashifmin/android_vendor_elephone_p6000" remote="github" revision="cm-12.0" />
</manifest>

device_elephone_p6000 diff

Replaced ../../recovery/root with those from stock L recovery (might need to look/modify sepolicy stuff - but think adding seenforce=0 to init.rc turns it off anyway, and added some lines from the omni graphics (from 5.0) that allowed it to fully build. Currently not booting though...

I can compile TWRP in about 15-20mins so any suggestions feel free...

I'll need to look at the custom graphics.c (and compare to omni5.1 source) and custom init.rc; not sure why cortex-a53 isn't supported if it worked previously ...

[MENTION=5186178]carliv[/MENTION] any guidance/direction to look at - can you post the original graphics.c you based the custom graphics.twrp.c on? Just so I'm not removing/changing a needed modification.

Kernel side would I be right in thinking that to update to the current latest kernel (3.10.61+); which is only a minor increase from 3.10.58+ we patch the kernel folder with patches from kernel.org and make/determine adequate adjustments to the mediatek folder? Or is this wishful thinking...
[Android Software/Hacking General [Developers Only]] bigrammy:
Thanks for all your effort bro lets hope you can get a little help regarding the compiling :fingers-crossed:

I am lost when it comes to compiling if I am honest :silly:

Maybe [MENTION=5480061]Santhosh M[/MENTION] will come back with something :fingers-crossed:
[Android Software/Hacking General [Developers Only]] bigrammy:
[MENTION=4056517]HypoTurtle[/MENTION]

Hi bro,

I have been on TWRP freenode to try get some help/advice and I got a little.

<bigrammy> @_that log here https://drive.google.com/file/d/0B0cCH4xowzhTeUZPQnRUNm43NTg/view?usp=sharing
[21:24] <@_that> hmm... it dumps properties and then restarts
[21:24] <@_that> and it fails to mount the emulated sdcard
<bigrammy> we are have difficulties building it http://xdaforums.com/android/software-hacking/theory-everything-building-mtk-saucery-t3040116/page5
[21:32] <bigrammy> cortex a53 support
[21:33] <CaptainThrowback> The M9 has a cortex a53, but I don't build using that flag, bigrammy
[21:35] <bigrammy> what environment do you build in can we use cm11.0 captain
[21:36] <CaptainThrowback> I build in Omni android-5.1 bigrammy
[21:37] <bigrammy> we dont have the 5.0 kernel source is it possible to build it with 4.4.4 source
[21:38] <@_that> twrp from android-5.1 should build in 4.4 to 5.1 trees
[21:39] <CaptainThrowback> I don't use kernel source to build it bigrammy
[21:39] <CaptainThrowback> I use a prebuilt kernel
[21:39] <CaptainThrowback> Kernel shouldn't be an issue if you already have one that works
[21:40] <CaptainThrowback> I guess I don't understand why you think the kernel is a problem
[21:40] <CaptainThrowback> My Supersonic uses a JellyBean kernel
[21:40] <bigrammy> might need our hands holding on this can you visit us on the above thread
[21:40] <CaptainThrowback> I cannot
[21:43] <bigrammy> Ok thanks anyway captain

So according to these guys TWRP for Lp should build in 4.4 to 5.1 and we can use the 4.4.4 kernel :confused:
[Android Software/Hacking General [Developers Only]] Santhosh M:
I guess it needs to be built as 64 bit and i can build it in cm12 branch. Recently i built twrp for a53 64bit qcom device and it works very fine. Guess that can work here too. You guys open a freenode channel and inform me the channel. I will join and i will make a build when i get free time. We will discuss this over freenode