[GUIDE] Build Your Own Android Kernel{Easiest and Fastest Way] [Using The NDK] - Android Software Development

This is the quickest and easiest way to build your own Kernel using the Android NDK
Note:I will be reffering to the following
yourusername=the username that you are logged in to
devicecode=The codename for the device you are building a kernel for(Google it on what is the code name
Click to expand...
Click to collapse
Note:I am only showing you how to make it to be flashed via CWM. If you wan't a tuttorial on how to make a boot.img comment and i will make it.
What you will need
Ubuntu 12.04 or newer
A lot of patience
Click to expand...
Click to collapse
Step 1:Installing the required files
Open a terminal and type the following (copy-paste)
Code:
sudo apt-get install -y build-essential kernel-package libncurses5-dev bzip2
This will install the packages you need
Download the kernel source code for your device (This is important. We are going to build the kernel from this)
For HTC http://htcdev.com
For Samsung http://opensource.samsung.com/
Click to expand...
Click to collapse
Find your device and click Download
Download The NDK
Move the NDK and your device Kernel source code in your home folder
Extract both the NDK and your kernel source code
Rename the folder were you have the NDK installed to NDK. And rename the folder where you have the kernel installed to Kernel
Now we are ready to build.
Step 2:Tweaking the kernel
Navigate to the kernel folder
Code:
cd /home/[COLOR="red"]yourusername[/COLOR]/Kernel
Next we need to point the NDK tools to the kernel folder
Code:
export CROSS_COMPILE=/home/[COLOR="red"]yourusername[/COLOR]/NDK/toolchains/arm-linux-androideabi-4.4.3/prebuilt/linux-x86/bin/arm-linux-androideabi-
We've pointed the NDK tolls and now we can use the NDK to tweak the kernel
Next we need to clean the previous work just incase:
Code:
make clean && make mrproper
If everything goes well you are good to go. If you have an Error(s) then something is wrong.
Now we are ready.
Next we need to add the kernel features to the NDK so we can modife them
Firs open your kernel source code folder go to arch/arm/configs
Here you will all the configs.
We need only one. Find that. It is called:Yourdevicecode_somethingbalblabla.defconfig
Rename it to maker.defconfig
Now type this in your terminal
Code:
make maker.defconfig
Now we need to tweak those configs.
Code:
make menuconfig
A user interface will pop out showing you all the tweaks you can do. I am not going to show you whow to use it. Google it(Sorry don't have that enough space)
When you are ready close the UI and click SAVE
Step 3 Building
So we tweaked the Kernel and we are ready to build.
make -j# ARCH=arm
Click to expand...
Click to collapse
Note:The # means the number of CPU cores +1. For example my device has a quad core CPU and I will type
Code:
make -j5 ARCH=arm
This will build the Kernel. It will take about 10 minutes.
Step 4: Finalizing
Now that kernel is ready you will need to find a kernel flashable zip for your device(Just google it)
Download the zip file and leave it in your home folder.
Now got to your kernel source and go to arch/arm/boot and copy zImage
Paste your Zimage to the zip file and replace it.
Now we need the WI-FI modules otherwise your WI-FI will not be working
Go to the Kernel source code folder and go to driver/net/wireless/bcm4329_204 and copy bcm4329.ko
Got the zip file go to the System folder and replace it's bcm4329.ko with your bcm4329.ko
You are ready all you need to do is flash it.

mmm..interesting...i always build without the ndk,but simpy sdk.what's the advantages?
and i usually do the git clone to download all the sources,in my case nexus7 and maguro.
thanks for this!

Well i am just waiting for Samsung to release JB sources for N7000 to start learning on how to create my own kernel
This is a pretty good base! Thanks

Sorry if this is a stupid question but do we need 64 bit like we do for ROM compiling, or will this work fine for 32 bit (I'm running Ubuntu 12.10 32 bit). Also, roughly how much is there to download? Thanks

:good: Thanks! I'm use Ubuntu 10.04 64 bit don't know if can?

HTCDreamOn said:
Sorry if this is a stupid question but do we need 64 bit like we do for ROM compiling, or will this work fine for 32 bit (I'm running Ubuntu 12.10 32 bit). Also, roughly how much is there to download? Thanks
Click to expand...
Click to collapse
I am not sure. I think you can on 32 bit try it the download takes all together about 500 MB

TheWizardOfROMs said:
I am not sure. I think you can on 32 bit try it the download takes all together about 500 MB
Click to expand...
Click to collapse
Thanks, do you know how large all the files are once installed on the system (you might have guessed I'm slightly short of space atm)

HTCDreamOn said:
Thanks, do you know how large all the files are once installed on the system (you might have guessed I'm slightly short of space atm)
Click to expand...
Click to collapse
About 700 MB

sert00 said:
mmm..interesting...i always build without the ndk,but simpy sdk.what's the advantages?
and i usually do the git clone to download all the sources,in my case nexus7 and maguro.
thanks for this!
Click to expand...
Click to collapse
What are you building? If a whole ROM like AOSP,AOKP,PA or CM then they typically bundle the toolchain/kernel with the source, making this totally unneeded.
---------- Post added at 12:18 PM ---------- Previous post was at 12:17 PM ----------
HTCDreamOn said:
Sorry if this is a stupid question but do we need 64 bit like we do for ROM compiling, or will this work fine for 32 bit (I'm running Ubuntu 12.10 32 bit). Also, roughly how much is there to download? Thanks
Click to expand...
Click to collapse
No 32-bit is fine, just install the right libraries. I actually believe that you can compile a ROM on 32-bit as well.
Self-Plug http://forum.xda-developers.com/showthread.php?t=1748297

Also just to warn users, the above defconfig convention is just that, a convention. The author of a kernel can name the defconfig whatever they want, so it is something to keep in mind.
Sent from my SCH-R950 using Tapatalk 2

thewadegeek said:
What are you building? If a whole ROM like AOSP,AOKP,PA or CM then they typically bundle the toolchain/kernel with the source, making this totally unneeded.
---------- Post added at 12:18 PM ---------- Previous post was at 12:17 PM ----------
No 32-bit is fine, just install the right libraries. I actually believe that you can compile a ROM on 32-bit as well.
Self-Plug http://forum.xda-developers.com/showthread.php?t=1748297
Click to expand...
Click to collapse
i builded some kang rom for personal use,but lately only kernels (for my nexus devices and 2 emebedded system board like in my sig.

Thanks for the guide, but unfortunately I am getting errors during compilation:
Code:
make -j3 ARCH=arm
CHK include/linux/version.h
CHK include/generated/utsrelease.h
HOSTCC scripts/kallsyms
HOSTCC scripts/bin2c
CC scripts/mod/empty.o
arm-eabi-gcc: No such file or directory
Is your PATH set correctly?
make[2]: *** [scripts/mod/empty.o] Error 2
make[1]: *** [scripts/mod] Error 2
make[1]: *** Waiting for unfinished jobs....
make: *** [scripts] Error 2
I am trying to compile the Andromadus 3.0 kernel for HTC Vision, I'd really appreciate some help. I'm using Ubuntu 12.10 32 bit and the Android NDK.

TheWizardOfROMs said:
This is the quickest and easiest way to build your own Kernel using the Android NDK
Note:I will be reffering to the following
Note:I am only showing you how to make it to be flashed via CWM. If you wan't a tuttorial on how to make a boot.img comment and i will make it.
What you will need
Step 1:Installing the required files
Open a terminal and type the following (copy-paste)
Code:
sudo apt-get install -y build-essential kernel-package libncurses5-dev bzip2
This will install the packages you need
Download the kernel source code for your device (This is important. We are going to build the kernel from this)
Find your device and click Download
Download The NDK
Move the NDK and your device Kernel source code in your home folder
Extract both the NDK and your kernel source code
Rename the folder were you have the NDK installed to NDK. And rename the folder where you have the kernel installed to Kernel
Now we are ready to build.
Step 2:Tweaking the kernel
Navigate to the kernel folder
Code:
cd /home/yourusername/Kernel
Next we need to point the NDK tools to the kernel folder
Code:
export CROSS_COMPILE=/home/yourusername/NDK/toolchains/arm-linux-androideabi-4.4.3/prebuilt/linux-x86/bin/arm-linux-androideabi-
We've pointed the NDK tolls and now we can use the NDK to tweak the kernel
Next we need to clean the previous work just incase:
Code:
make clean && make mrproper
If everything goes well you are good to go. If you have an Error(s) then something is wrong.
Now we are ready.
Next we need to add the kernel features to the NDK so we can modife them
Firs open your kernel source code folder go to arch/arm/configs
Here you will all the configs.
We need only one. Find that. It is called:Yourdevicecode_somethingbalblabla.defconfig
Rename it to maker.defconfig
Now type this in your terminal
Code:
make maker.defconfig
Now we need to tweak those configs.
Code:
make menuconfig
A user interface will pop out showing you all the tweaks you can do. I am not going to show you whow to use it. Google it(Sorry don't have that enough space)
When you are ready close the UI and click SAVE
Step 3 Building
So we tweaked the Kernel and we are ready to build.
Note:The # means the number of CPU cores +1. For example my device has a quad core CPU and I will type
Code:
make -j5 ARCH=arm
This will build the Kernel. It will take about 10 minutes.
Step 4: Finalizing
Now that kernel is ready you will need to find a kernel flashable zip for your device(Just google it)
Download the zip file and leave it in your home folder.
Now got to your kernel source and go to arch/arm/boot and copy zImage
Paste your Zimage to the zip file and replace it.
Now we need the WI-FI modules otherwise your WI-FI will not be working
Go to the Kernel source code folder and go to driver/net/wireless/bcm4329_204 and copy bcm4329.ko
Got the zip file go to the System folder and replace it's bcm4329.ko with your bcm4329.ko
You are ready all you need to do is flash it.
Click to expand...
Click to collapse
will work with an ics device like amazon kindle fire?
Sent from my KFTT using xda app-developers app

HTCDreamOn said:
Thanks for the guide, but unfortunately I am getting errors during compilation:
Code:
make -j3 ARCH=arm
CHK include/linux/version.h
CHK include/generated/utsrelease.h
HOSTCC scripts/kallsyms
HOSTCC scripts/bin2c
CC scripts/mod/empty.o
arm-eabi-gcc: No such file or directory
Is your PATH set correctly?
make[2]: *** [scripts/mod/empty.o] Error 2
make[1]: *** [scripts/mod] Error 2
make[1]: *** Waiting for unfinished jobs....
make: *** [scripts] Error 2
I am trying to compile the Andromadus 3.0 kernel for HTC Vision, I'd really appreciate some help. I'm using Ubuntu 12.10 32 bit and the Android NDK.
Click to expand...
Click to collapse
Check your toolchain definition, looks like your path is wrong.

thewadegeek said:
Check your toolchain definition, looks like your path is wrong.
Click to expand...
Click to collapse
Thanks, you're right my path was wrong, but now I have fixed all the problems and it appears to compile successfully however there is no zImage in arch/arm/bin. Any suggestions? Thanks

HTCDreamOn said:
Thanks, you're right my path was wrong, but now I have fixed all the problems and it appears to compile successfully however there is no zImage in arch/arm/bin. Any suggestions? Thanks
Click to expand...
Click to collapse
Try building it again. Be sure to clean the source folder before you start

TheWizardOfROMs said:
Try building it again. Be sure to clean the source folder before you start
Click to expand...
Click to collapse
Thanks very much, I'd been recommended using Linaro tool chain instead and it works perfectly now, booting and WiFi and all. If I can learn some more advanced modding stuff to do to it then I'll release it in the Vision forums and I'll make sure to link to this guide

I installed Ubuntu on my windows laptop.my computer stars are 3Gigs of memory with 140 Gigs of available free space.Do I have enough space and is my laptop good enough to build kernels on.and I do use Ubuntu 12.04 to build kernels correct.I'm sorry I'm all new to this I just would like to be able to build a kernel for my sensation and HTC one which I will have next week.thanks very much for your time and expertise.
Sent from my HTC Sensation using xda app-developers app

rp56 said:
I installed Ubuntu on my windows laptop.my computer stars are 3Gigs of memory with 140 Gigs of available free space.Do I have enough space and is my laptop good enough to build kernels on.and I do use Ubuntu 12.04 to build kernels correct.I'm sorry I'm all new to this I just would like to be able to build a kernel for my sensation and HTC one which I will have next week.thanks very much for your time and expertise.
Sent from my HTC Sensation using xda app-developers app
Click to expand...
Click to collapse
I compiled with Ubuntu 12.10 and only 2 GB of RAM, and only 30GB free space. The tool chain and kernel really doesn't use up much room at all. As long as you don't go OTT on the -jx bit (I do -j3 as I've got a lowly core 2 duo) you should be fine. By the way if you get errors and you're path is definitely correct, then try with the Linaro tool chain instead.

got an error something like, "make ** [vm.virtual], waiting for unfinished jobs..." then stops, going to try new defconfig and new toolchain

Related

[REF] How to compile your own kernel and initrd for HTC Leo

Kernel compile :
Do it on user not root :
1. Make sure you have an appropriate environment to get the source (git) and to compile the kernel. Install git, gcc, make and libncurses5-dev at least. For Ubuntu based distributions.
apt-get install git-core build-essential libncurses5-dev
2. Create a directory to hold the kernel sources
mkdir ~/htcleo
3. Download the kernel source
cd ~/htcleo
git clone git://git.linuxtogo.org/home/groups/mobile-linux/kernel.git
cd kernel
git checkout -b htc-qsd8k-2.6.29 origin/htc-qsd8k-2.6.29
4. Download and decompress the arm toolchain (64mb)
cd ~/htcleo
wget http://www.codesourcery.com/gnu_too...-none-linux-gnueabi-i686-pc-linux-gnu.tar.bz2
tar xjf arm-2008q1-126-arm-none-linux-gnueabi-i686-pc-linux-gnu.tar.bz2
5. Generate the default .config for the kernel(ARCH is case sensitive)
cd kernel
make htcleo_defconfig ARCH=arm
6. Compile
export PATH=~/htcleo/arm-2008q1/bin:$PATH
make Image ARCH=arm CROSS_COMPILE=arm-none-linux-gnueabi-
Find your kernel Image in /htcleo/kernel/arch/arm/boot/
Now you can configure your proper kernel :
mousepad (Xfce) or gedit (Gnome) ~/htcleo/kernel/arch/arm/configs/htcleo_defconfig
cd ~/htcleo/kernel
make mrproper
make htcleo_defconfig ARCH=arm
export PATH=~/htcleo/arm-2008q1/bin:$PATH (must need once time)
make Image ARCH=arm CROSS_COMPILE=arm-none-linux-gnueabi-
Use git pull in ~/htcleo/kernel to update file and recompile to have the last modified on development
Initrd compile :
Need to be root !
1. Download initrd.gz from other HTC compiled
mkdir initrd (or anything else in propely folder nothing else on)
cd initrd (put your initrd.gz here)
gzip -dc initrd.gz | cpio -id
Now you have all file and folder you can touch and modified
Use mousepad or gedit on root
2. Recompile proper
rm initrd.gz (before do a copy for other instance)
find (all name of folder and file) | cpio --create --format='newc' > initrd
Compile source for Arm :
(root user)
On source folder :
#export ARCH=arm CROSS_COMPILE=arm-none-linux-gnueabi- PATH=(your path)/arm-2008q1/bin:$PATH
#CC=arm-none-linux-gnueabi-gcc ./configure --host=arm-none-linux-gnueabi --target=arm-none-linux-gnueabi
# make
For who want to take time to test and finaly make Android works on HTC Leo.
I thinks all members hav's HTC Leo !!
hey guys..
i really want to use android on my new HD2!
i'm a little-medium (^^) n00b, but spent a lot of time in android on my kaiser.. so i'm not a totally noob, i think.
i can help testing files for you.
so, what do the dev's think, how long did it take to use android on our phones?
greetings
Thanks for the tip, will try it tomorrow and report what I see
wget http://www.codesourcery.com/gnu_tool...ux-gnu.tar.bz2 -O arm-2008q1-126-arm-none-linux-gnueabi-i686-pc-linux-gnu.tar.bz2
Click to expand...
Click to collapse
On the wget command supplied you have to right click and copy link location and paste that as the wget url or it wont work, the forum has truncated the text with ... in the middle . use the -O afterwards as shown
1. Download initrd.gz from other HTC compiled
Click to expand...
Click to collapse
Im also not quite understanding this, what is other HTC compiled ? Another set of sources with Android?
Thread Edit
You can take any one initrd.gz and modified script on it.
HTC Vogue initrd.gz its the better.
Tigrouzen said:
Thread Edit
You can take any one initrd.gz and modified script on it.
HTC Vogue initrd.gz its the better.
Click to expand...
Click to collapse
Thanks for fixing the wget ..
Cool so i already have another initrd and i hang at the freeing 104k init error .. Are you able to get past this ?
Nice job writing that up.
Personally I use a different toolchain, but if the toolchain you mention works without a problem, then all is well When I used a toolchain from codesourcery I somehow got compile errors as there was no VFP support (maybe I just took the wrong binary).
The toolchain i'm using is in this git repo: http://android.git.kernel.org/?p=platform/prebuilt.git;a=summary and under linux-x86/toolchain/arm-eabi-4.4.0
NetRipper said:
Nice job writing that up.
Personally I use a different toolchain, but if the toolchain you mention works without a problem, then all is well When I used a toolchain from codesourcery I somehow got compile errors as there was no VFP support (maybe I just took the wrong binary).
The toolchain i'm using is in this git repo: http://android.git.kernel.org/?p=platform/prebuilt.git;a=summary and under linux-x86/toolchain/arm-eabi-4.4.0
Click to expand...
Click to collapse
This toolchain works, compiles fine but fails on boot at the 104k error for me .. Not sure how to progress this without further info / debug ..
NetRipper said:
Nice job writing that up.
Personally I use a different toolchain, but if the toolchain you mention works without a problem, then all is well When I used a toolchain from codesourcery I somehow got compile errors as there was no VFP support (maybe I just took the wrong binary).
The toolchain i'm using is in this git repo: http://android.git.kernel.org/?p=platform/prebuilt.git;a=summary and under linux-x86/toolchain/arm-eabi-4.4.0
Click to expand...
Click to collapse
Yes cause you use 2009q3 arm-eabi not contain VFP support maybe not important.. i try with your toolchain and 2008q1 binary
This is one worked with 2008q1 binary
Nice work! When do you think Android will be avaible on HD2?
How should I format the micro SD Card ?
Do I have to create two partitions (one eith FAT to boot and another ext3 to filesystem ?)
Does anyone have a tutorial to configure the sd card ?
My experience format SD card make some mistake and brick some SD card on linux. For now dont do that cause no way and ist not ready to work.
But Android porting hardware its now everything ok, just wait some moment maybe one or two month to see it on HD2.
This test just need put haret, default.txt based on Leo, initrd.gz and Image on sdcard root and executed haret
If you have drivers to every piece of hardware then tell me how did you managed to detect the SD card reader. Because I simply can't.
The developer find right interrupt for hardware on Leo but we dont have definitively realized driver, this is a problem to communicate right with Leo hardware.
If we have main console work then its ok!!
Now just have boot working and freez.
We need wait.
You can maybe look in this thread Martijn Stolk works, 38hours ago he add some instruction on kernel, then its signified we advanced to make Android works.
http://git.linuxtogo.org/?p=groups/mobile-linux/kernel.git;a=shortlog;h=refs/heads/htc-qsd8k-2.6.29
I think 2 months later if everything ok.
Now you dont need formating your sd card just put file on root.
What's about other non-Leo QSD8x50 devices? I tried some of previous NetRipper's kernels, but they didn't work... As I'm completely next to nothing in ARM kernel development, I take someone should port IRQ and GPIO map (If I remember correctly) of respective devices (e.g. neoTouch, Expo, TG01 etc), isn't it?
Or is the kernel universal?
I thinks HTC take's other hardware way and this hardware doesn't have any driver on linux.
HTC just make's driver for Windows mobile and then have realy code source to ported on linux and android.
Or maybe system locked protection !! Like's Archos 5 IT code secure implentation !!
Maybe HTC do it protection hardware cause Microsoft ask him to not porting it on Android !!!
Or marketing way not arrenged HTC to sell HTC Supersonic simillar hardware with Android !!
I hope its not this way, cause no way to ported Android or linux on Leo..
Last issue if there no protection just wait for HTC Supersonic and porting in Leo.
Tigrouzen said:
Last issue if there no protection just wait for HTC Supersonic and porting in Leo.
Click to expand...
Click to collapse
Would love it, with DualBoot in more
I'll donate for Android, I am really excited to get it on our device !
Thank you to all developpers who take time for us !
See you.
Edit : Use "git pull" to update automatically file modified on development
Thanks for developers.
Edit : compile source for Arm

[PRO] ToshDroid Linux Kernel (Developers)

Warning From TheRomMistress:
8. Donations.
We appreciate all donations to xda-developers.com, it keeps our forum online and well maintained. As a user you're allowed to ask for donations in your signature as a thank you for your hard work. However donations up front are not allowed, this forum is about sharing, not about getting paid to do something, that's what your job is for.
Hello guys !!!
So I am endrix and I am trying to port the linux kernel to our Toshiba TG01. I am an h.264 developer who loves linux. Many of you may hate the phone (I do a little too) because of the crappy windows mobile operating system that Toshiba has offered us. Beside the resistive touch screen our phones have a strong processor that is used almost in each smartphone (ok Samsung and Apple are not using snapdragon but is still Cortex A8).
So to the main point!
Firstly is not an easy task and I do not somebody to write in this thread when Android will work with our phones, I truly do not know if I will (or we will) achieve this! Secondly think to contribute as you can to this project, I am here to guide you if you have any questions about how to compile the kernel and if you have any other problem just send me a message or write it in this thread!
My git repository of the TG01 kernel is this one
github.com/endrix/kernel_common
System compilers and libraries:
I used the one given by source.android.com
apt-get install git-core gnupg flex bison gperf build-essential zip curl zlib1g-dev gcc-multilib g++-multilib libc6-dev-i386 lib32ncurses5-dev ia32-libs x11proto-core-dev libx11-dev lib32readline5-dev lib32z-dev.
certainly you do not need all of them but is ok to have it
So how can you compile the kernel?
Steps:
Use an Ubuntu Linux distribution or virtualise it with Virtualbox
I am using this cross tools: arm-2009q1-203-arm-none-linux-gnueabi-i686-pc-linux-gnu.tar.bz2"
in my system I have created a directory in my /opt folder, to that just do "sudo mkdir /opt/cross"
Now go to the directory with "cd /opt/cross"
now rember where you have download the tar archieve and execute the following command, in this command i have downloaded my tar in /home/endrix/Download: so for my directory I do " tar xjvf /home/endrix/Downloads/gnueabi-i686-pc-linux-gnu.tar.bz2"
Now that we have our cross tools installed in our system is it good to create an eviromental varibale to easy our task of ceoss compiling. do this command "gedit ~/.bashrc" and at the end of the file put this line: export CROSS_TOOLS=/opt/cross/arm-2009q1/bin/arm-none-linux-gnueabi-
now execute this command "source ~/.bashrc" so that you command can be activated for the current command, the next time that you will open another console or reboot the varibale $CROSS_TOOLS will work
This is all for the cross tools
Next step Compile the linux kernel:
Create a directory for example "Projects" in your main directory(home), "mkdir ~/Projects"
Clone the repository of my git address: "git clone github.com/endrix/kernel_common.git"
Now you wait, take a coffe or eat a fruit
now you execute this command in the "kernel_common" directory, "make ARCH=arm htcleo_defconfig"
and then to compile the kernel" make ARCH=arm CROSS_COMPILE=$CROSS_TOOLS Image"
To make the process even faster if you have a multicore system, put -j4 (for 2 cores) or -j16 (if you have an intel iCore7 with 4 cores double threaded), that means, "make -j4 ARCH=arm CROSS_COMPILE=$CROSS_TOOLS Image"
After a while depending you system you will get the kernel image file in the arch/arm/boot directory
So now you have the kernel compiled
Next step test the kernel with Haret:
1) Create the file default.txt with :
set mtype 2675
set ramaddr 0x11800000
set ramsize 0x18C00000
set kernel Image
boot
2)Download My modified version of Haret with TG01 support!
Haret for TG01
3)Create a folder in your sd card --> "ToshDroid and put the Image the haret.exe and the default.txt in it.
4) Finally execute the haret.ext and clik on run!
That's all folks! Now I am focusing in the Memory Map...
PS: sorry for links, As a junior member i cannot give a full url
I will update also my blog too for TG01
endri-bezati.blogspot.com
Hi endrix and welcome to xda-developers
I very much appreciate your work.. i've the same device.. it's a beautiful phone.. with a powerful hardware.. but windows mobile is not worthy of the hardware it runs on.. so we look forward for a release of android!
BTW.. i'd know what do you need to do your work.. can you make a list of thing that you need to accelerate your work? the first thing is compile android kernel.. but next? need you we post results? how we can fix the errors?
Sorry for my english but i'm italian.. and thank you.. hoping to see soon a first version of android..
Image Compiled without errors..
running haret it stops to "Jumping to kernel(custom). and freeze..
isikil87 : Ok! forgot something!
Do
1) make clean
2) git checkout android-msm-2.6.32-tg01
3) make ARCH=arm htcleo_defconfig
4) make -j4 ARCH=arm CROSS_COMPILE=$CROSS_TOOLS Image
actually I am working on the android-msm-2.6.32-tg01 branch
compiled successfully...
boot ok.
jump to image ok.
linux pic visible.ok.
now we need the right address to write memory.
Cool !
isikil87 said:
compiled successfully...
boot ok.
jump to image ok.
linux pic visible.ok.
now we need the right address to write memory.
Click to expand...
Click to collapse
Exactly, the framebuffer is wrong too i think the addresse in the msm_iomap is not correct
#define MSM_RAM_CONSOLE_BASE IOMEM(0xF8010000)
have you dump the memory???
dump ?
isikil87 said:
have you dump the memory???
Click to expand...
Click to collapse
I have run haret with "dump mmu" but is not easy to understand everything, I am really a beginner in this domain I am currently searching for documentation!
I am beginer too. How can I help?
Can you share with us that Image file?
The image file
TruckyBN said:
I am beginer too. How can I help?
Can you share with us that Image file?
Click to expand...
Click to collapse
It will not help you a lot but here is the compiled kernel
megaupload.com/?d=W027CS8P
this is interesting
http://htc-linux.org/wiki/index.php?title=Talk:Tg01
About the code
isikil87 said:
this is interesting
http://htc-linux.org/wiki/index.php?title=Talk:Tg01
Click to expand...
Click to collapse
Actually if you compare my modified code for the tg01 branch you will see that I have done the same modification (I was inspired by this pages too)!
endrix said:
It will not help you a lot but here is the compiled kernel
megaupload.com/?d=W027CS8P
Click to expand...
Click to collapse
Thanks for share.
I already to boot up. But error is (teminating haret due to unhandled exception pc=00017254)
please tell me how to config and boot it. thank so much.
best regard !
nhattuong said:
Thanks for share.
I already to boot up. But error is (teminating haret due to unhandled exception pc=00017254)
please tell me how to config and boot it. thank so much.
best regard !
Click to expand...
Click to collapse
have you downloaded the latest version of haret?
check it http://netripper.com/leo/haret-pre-0.5.3-20100914_124354.exe
isikil87 said:
have you downloaded the latest version of haret?
check it http://netripper.com/leo/haret-pre-0.5.3-20100914_124354.exe
Click to expand...
Click to collapse
Thanks for share.
It is already to boot. But after 10 sec...auto reset.
Then hit HaRet App again...after 10 sec...device reset...
Please teach me more ! thank you very much !
P/S : Wich one Android Version you use ?
Best Regard !
nhattuong said:
Thanks for share.
It is already to boot. But after 10 sec...auto reset.
Then hit HaRet App again...after 10 sec...device reset...
Please teach me more ! thank you very much !
P/S : Wich one Android Version you use ?
Best Regard !
Click to expand...
Click to collapse
that is only an alpha version. it doesn't boot up untill we have the right addresses of nand iomap ram ecc of the device.
regards
isikil87 said:
that is only an alpha version. it doesn't boot up untill we have the right addresses of nand iomap ram ecc of the device.
regards
Click to expand...
Click to collapse
oops ! I understand. Thanks.
Best Regard,
No questions about Android please, this thread is only for the kernel!!!
nhattuong said:
Thanks for share.
It is already to boot. But after 10 sec...auto reset.
Then hit HaRet App again...after 10 sec...device reset...
Please teach me more ! thank you very much !
P/S : Wich one Android Version you use ?
Best Regard !
Click to expand...
Click to collapse
For the moment the kernel has a problem because I have not figured out all the memory addresses and the reset is normal. Now you have to wait for a long time till we achieve to find the memory values. For android is another story if the kernel does not work correctly android will not work!
endrix said:
For the moment the kernel has a problem because I have not figured out all the memory addresses
Click to expand...
Click to collapse
how can we help in reading memory addresses? maybe there is a way that we all could divide work on many tg01 users?
endrix said:
For the moment the kernel has a problem because I have not figured out all the memory addresses and the reset is normal. Now you have to wait for a long time till we achieve to find the memory values. For android is another story if the kernel does not work correctly android will not work!
Click to expand...
Click to collapse
yeap ! i see. Thanks for your great works.

[HOW-TO] Build CM9 Kernel w/o Building ROM!

For those of you with lower powered computers like me (My computer right now is 2gb RAM, Core 2 Duo) its a hassle every time you build ICS. For me it takes around 10 hours, and half the time the build crashes.
So since I wanted to just get my feet wet with the development going on here as far as the actual ROM, I decided I wanted to go the kernel route.
The actual compilation guides around the internet are just for compiling the kernel and then adding it into the ROM's build directory so that it gets build along with the ROM. The thing is though that if you don't compile the build kernel with the ROM, then it lacks the ramdisk and doesn't boot.
So thanks to the help of jcsullins, we now have a guide for building CM9 without the ROM building It is below. Many parts of this guide were taken from here: https://www.evernote.com/shard/s102...6dfbf53e0fe5/ba173394b43ed99ae6a90a4d1c51210f (by danabw) and from here: http://code.google.com/p/moboot/issues/detail?id=20
This guide assumes you havent build android before on your system. The build requires some extra programs which are explained in the steps below as well.
Where ever there is multiple lines of code, run the code lines one at a time. Also, I am not responsible for anything that happens as a result of this guide, though it works perfectly for me on Ubuntu 10.04 and the CM9 Nightlies.
Without further ado, here it is:
Prerequisites:
-Touchpad (d'oh)
-PC running Ubuntu 10.04 or higher (I recommend 10.04 for the best stability as far as android builds go including this one)
-Run these lines of code to install most of the prerequisites you need for building android (approx 103 mb)
sudo add-apt-repository ppa:ferramroberto/java
sudo apt-get update
sudo apt-get install sun-java6-bin
sudo apt-get install sun-java6-jdk
sudo apt-get install git-core gnupg flex bison gperf libsdl1.2-dev libesd0-dev libwxgtk2.6-dev squashfs-tools build-essential zip curl libncurses5-dev zlib1g-dev sun-java6-jdk pngcrush schedtool
Click to expand...
Click to collapse
1. Create the kernel build directory
mkdir -p ~/android/kernel/
Click to expand...
Click to collapse
2. Get the kernel source.
cd ~/android/kernel/
git clone git://github.com/CyanogenMod/hp-kernel-tenderloin.git -b ics
Click to expand...
Click to collapse
3. Download & install uboot-mkimage and set the PATH to it:
sudo apt-get install uboot-mkimage
PATH=${PATH}:~/usr/bin
Click to expand...
Click to collapse
4. Download & install CodeSourcery for the ARM Toolchain
Click on the link here: https://sourcery.mentor.com/sgpp/lite/arm/portal/release1802
Click "IA32 GNU/Linux Installer"
Let the package download
After done, go to terminal and navigate to your download directory (mine is /home/rohan/Download)
Type these commands:
chmod +x arm-2011.03-42-arm-none-eabi.bin
./arm-2011.03-42-arm-none-eabi.bin
Click to expand...
Click to collapse
Follow the directions it gives you. If it comes up with an error about reconfiguring dpkg, do what the message in the terminal says about turning off a settings. You can reenable this later if you want by doing the same command and choosing yes instead of no.
5. Configure the configuration file
Close out of that terminal and open a new one.
Navigate to the kernel's build folder (the one whose path ends in the folder hp-kernel-tenderloin)
Then type:
make ARCH=arm tenderloin_android_defconfig
Click to expand...
Click to collapse
6. Build the kernel
Type the following into terminal:
make ARCH=arm -j8 CROSS_COMPILE=~/CodeSourcery/Sourcery_G++_Lite/bin/arm-none-eabi- uImage
Click to expand...
Click to collapse
Where it says "-j8" above, replace with the number of CPU/cores on your system. On a dual core system that should be -j8, but -j3 worked fine on my dual core system as well.
This took my system around 7 minutes.
7. Ready the uimage-extractor tool
Go up one directory in your terminal and then do the following commands:
git clone https://code.google.com/p/moboot
cd moboot/tools
gcc -lz uimage-extract.c -o uimage-extract
Click to expand...
Click to collapse
Now grab the uImage.CyanogenMod you have in your Touchpad's /boot folder (via a file manager with root access or adb) and put the uImage in the moboot/tools directory (where the terminal currently is in)
8. Decompile the existing uImage
Type the following:
./uimage-extract uImage.CyanogenMod
Click to expand...
Click to collapse
9. Grab the built uImage and put it in the extracted folder
Type the following:
cp <location to the hp-kernel-tenderloin folder here>/arch/arm/boot/uImage <location to the moboot/tools folder here>/uImage
Click to expand...
Click to collapse
10. Build the new kernel using the old ramdisk and your new built uImage
Type the following:
mkimage -A arm -O linux -T ramdisk -C none -a 0x60000000 -e 0x60000000 -n "Image" -d ramdisk.img uRamdisk
mkimage -A arm -O linux -T multi -a 0x40208000 -e 0x40208000 -C none -n "multi image" -d uImage:uRamdisk uImage.CyanogenMod.new
Click to expand...
Click to collapse
Thats it!
Your new kernel should now be in the moboot/tools directory under the name "uImage.CyanogenMod.new"
Transfer it to the /boot folder of your device and watch your hard work pay off
Again, HUGE thanks to jcsullins for all his work, along with the entire CM Team. It is truly awesome what they have put together!
Nice job man. While I haven't worked on the kernel side of things much, may have to give it more thought now.
Sent from my PG86100 using Tapatalk
Win7
OP,
Is there a similar guide for Win7 aside from Ubuntu? The above process looks manageable and TC in my experience is semi-unbrickable.
austin_dreq said:
OP,
Is there a similar guide for Win7 aside from Ubuntu? The above process looks manageable and TC in my experience is semi-unbrickable.
Click to expand...
Click to collapse
No. </10char>
For ubuntu users:
Instead of the CodeSourcery compilers you could also use the package gcc-arm-linux-gnueabi which has everything you need. Aside from not installing the CodeSourcery compilers the only thing in the guide that needs to be changed is the compile operation:
From
Code:
make ARCH=arm -j8 CROSS_COMPILE=~/CodeSourcery/Sourcery_G++_Lite/bin/arm-none-eabi- uImage
To
Code:
make ARCH=arm -j8 CROSS_COMPILE=arm-linux-gnueabi- uImage
austin_dreq said:
OP,
Is there a similar guide for Win7 aside from Ubuntu? The above process looks manageable and TC in my experience is semi-unbrickable.
Click to expand...
Click to collapse
Over on RootzWiki there is a similar guide for building the kernel that is incorporated into the ROM, using Oracle VM on Win7. It is very clear and wish I would had this when I started building projects and kernels. I believe that is what Rohan was referring to in his OP. So you can follow those steps, including setting up the VM. The main difference then is the last few steps in terms of making the kernel with the ramdisk.
As an aside, my computer system is not very special, an older quad core amd with 8GB memory and I can typically build the ROM in a VM environment, depending on how many new commits there are, in ~30 minutes. But I do tend to build every day to keep up with the commits and thus keep my build time down. In terms of the kernel, as mentioned, I can usually build in only a few minutes. There are many fewer commits to the kernel, so that is pretty static unless you are doing a lot of development yourself.
O.a.T. said:
Over on RootzWiki there is a similar guide for building the kernel that is incorporated into the ROM, using Oracle VM on Win7. It is very clear and wish I would had this when I started building projects and kernels. I believe that is what Rohan was referring to in his OP. So you can follow those steps, including setting up the VM. The main difference then is the last few steps in terms of making the kernel with the ramdisk.
As an aside, my computer system is not very special, an older quad core amd with 8GB memory and I can typically build the ROM in a VM environment, depending on how many new commits there are, in ~30 minutes. But I do tend to build every day to keep up with the commits and thus keep my build time down. In terms of the kernel, as mentioned, I can usually build in only a few minutes. There are many fewer commits to the kernel, so that is pretty static unless you are doing a lot of development yourself.
Click to expand...
Click to collapse
Yeah I want to develop kernels mainly because I've never done it before for Android. I've developed for a Symbian device before since thats my current phone. The Touchpad is my first Android device, and I really hope to get a GNex soon as soon as it is brought to AT&T. If not, I'll probably either switch to VZ since AT&T is getting really annoying.
As for the non-installation of Code Sourcery, thanks! I never knew that package existed! Seems a lot less bloated than the Code Sourcery version.
And also for the developing on Windows, I'd just set up a VM for Ubuntu 10.04. Or you could install wubi, which is a dual boot solution to your Windows predicament. I'm currently running wubi since my only machine right now is old and aging. I need to migrate over to a full dual boot soon though.
This guide can be used on other phones?
sahibunlimited said:
This guide can be used on other phones?
Click to expand...
Click to collapse
If they use the same uImage format then yes. However, I'm not sure if other devices allow you to boot from the uImage, you may need to further compile a boot.img from this. The Touchpad allows this since it needs the uImage for moboot.
rohan32 said:
Yeah I want to develop kernels mainly because I've never done it before for Android. I've developed for a Symbian device before since thats my current phone. The Touchpad is my first Android device, and I really hope to get a GNex soon as soon as it is brought to AT&T. If not, I'll probably either switch to VZ since AT&T is getting really annoying.
Click to expand...
Click to collapse
HTC ONE X<Should have been the Nexus instead of Samsung version.

GUIDE - Compile latest Dzo's 3.0.8 kernel (Aurora)

Ok, in this guide, we'll build our development environment so we can start compiling aurora's kernel (3.0.8) in ubuntu.
NOTES:
- Every command is to be used in the terminal (Applications-Accessories-Terminal).
- There are scripts you can use to automate stuff, I'll post them in the second post on this thread.
- Sorry, I won't guide you on how to install Ubuntu or Android SDK, there are guides on the web all over the place.
1 - First things first, here's what we need:
a) Ubuntu 10.04 LTS x64 (this is recommended by google, it might work in other ubuntu versions, but I didn't tried it). To download it, go to:
http://releases.ubuntu.com/lucid/
And select the 64-bit PC (AMD64) desktop CD version. Your processor must support 64bits (most modern ones support it, else, use the x86 iso, not tested though).
Install ubuntu, you can use dual-boot with windows. I won't post a guide to this, as it's very easy and there are guides all over the net.
b) Install android sdk, to use adb (this is optional, but you really should if you use adb).
Follow this guide:
http://forum.xda-developers.com/showthread.php?t=921169
Note: Eclipse is not needed
c) Install some tools that are needed, like git, compiler stuff etc (this is a single command, copy and paste everythin):
Code:
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 abootimg
NOTE: If abootimg doesn't install (It didn't for me, for some reason) go in here, download and install the deb package.
d) Install the toolchain (it's a set of tools used to compile the kernel, I think. This takes a while):
Code:
git clone https://android.googlesource.com/platform/prebuilt
e) Download dzo's kernel from git and set the git branch to "master":
Code:
git clone https://github.com/dzo/kernel_huawei.git
git checkout master
2 - Getting to the fun stuff...
a) First, copy the boot.img attached to this post to your /home/kernel_huawei folder.
b) Set up the environment. Do this, in the terminal (must be done for each compilation session, I'll post scripts in the end, to automate this stuff):
Code:
cd kernel_huawei
export ARCH=arm
export CROSS_COMPILE=/home/username/prebuilt/linux-x86/toolchain/arm-eabi-4.4.3/bin/arm-eabi-
make u8800_defconfig
Note, replace /username/ in the third command with your username.
c) Compile. This takes like 10 minutes, depending on your pc:
Code:
make
TIP - Speedup compilation (thanks to Unrealized)
You can use
Code:
make -jx
to speed up the compilation.
ie, if you have 2 cores, use
Code:
make -j3
for 4
Code:
use -j5
3 - Create the boot.img. If you aren't already in the kernel_huawei folder, do this:
Code:
cd kernel_huawei
Then:
Code:
abootimg -u boot.img -k arch/arm/boot/zImage
After this, the boot.img in your kernel_huawei folder is updated. You can copy that to your phone.
_________________________________________
That's it. In the second post, I'll tell you how to check for latest version, check changelogs and scripts to automate stuff.
If you find any errors, please let me know.
ADDITIONAL STUFF
CHECK FOR UPDATES AND CHANGELOG's
In the terminal:
Code:
cd kernel_huawei
git pull
git log
SCRIPTS
To create a script, create an empty document (no extension), copy the commands and save it. Then right click it, go to "Properties-Permissions" and set it to execute.
To run the script, use the therminal and do:
Code:
cd /path/to/script/file/
./scriptfilename
OR, you can create a shortcut to the script in the panel, for example:
- Right click on the panel and select "Add to panel - Custom application launcher"
- Then, in type, select "Application in terminal"; give it any name, and then browse to the script file.
To run the script just click in the icon in the panel.
a) Automatically download the latest updated files and see what has changed, without compiling:
Code:
cd ~/kernel_huawei
git pull
git log
$SHELL
b) Automatically download the latest updated files, immediately compile and create a new boot.img in the kernel_huawei folder:
Code:
cd ~/kernel_huawei
git pull
export ARCH=arm
export CROSS_COMPILE=/home/username/prebuilt/linux-x86/toolchain/arm-eabi-4.4.3/bin/arm-eabi-
make u8800_defconfig
make
abootimg -u boot.img -k arch/arm/boot/zImage
$SHELL
In this script, you must change the /username/ in the 4th command to your username.
Installing the kernel on the phone
a) Use adb to put the boot.img, (assuming it is on the kernel_huawei folder) in the phone and reboot the phone:
Code:
cd kernel_huawei
adb shell mount -o rw,remount /dev/block/mmcblk0p1 /.cust_backup
adb push boot.img /.cust_backup/image/boot.img
adb shell mount -o ro,remount /dev/block/mmcblk0p1 /.cust_backup
adb reboot
c) Manual installation:
- Copy the updated boot.img to your sdcard.
- Use root explorer (make sure it is set to show hidden files) and copy the boot.img to ./cust_backup/image, replace the original and reboot.
Thank you for this! gonna try it!
whats about pro?
well i dont get any of that... :\
can we use your upload with any rom?
thanks in advance for your replies..
birginioss said:
well i dont get any of that... :\
can we use your upload with any rom?
thanks in advance for your replies..
Click to expand...
Click to collapse
What do you mean? There's no upload here for any ROM... the files here are just for compiling Dzo kernel to use in Aurora... I suggest you ignore this thread if you don't know what this is all about
Sent from my U8800
Matoxas said:
whats about pro?
Click to expand...
Click to collapse
Sorry, this is only for Dzo kernel for Aurora, I know nothing about U8800 pro...
Sent from my U8800
Can you post latest 3.0.8 kernel so we can flash it over cwm. Thx
Sent from my U8800 using Tapatalk 2 Beta-5
boss_y said:
Can you post latest 3.0.8 kernel so we can flash it over cwm. Thx
Sent from my U8800 using Tapatalk 2 Beta-5
Click to expand...
Click to collapse
It's in Aurora's thread, search posts by Dzo, it's 3.0.8 v2...
Sent from my U8800
Thanks
Good Work!
fjsferreira said:
It's in Aurora's thread, search posts by Dzo, it's 3.0.8 v2...
Sent from my U8800
Click to expand...
Click to collapse
so there is a Zip that we can flash?
what are the adventages of this kernel?
Sent from my U8800 using XDA
Great stuff, thanks heaps for this. Finally understand how to compile kernels for this phone now.
levibuko said:
so there is a Zip that we can flash?
what are the adventages of this kernel?
Sent from my U8800 using XDA
Click to expand...
Click to collapse
Yes, Dzo posted the zip already. I suggest you search Aurora's thread and read about what 3,0 kernel does... 1 hint: you'll be amazed
Sent from my U8800
Matoxas said:
whats about pro?
Click to expand...
Click to collapse
just want to explain about the pro version. every kernel needs a defconfig, it's like a configuration while compiling a kernel. but, the pro version have a different defconfig so you must pull it first, the file is /proc/config.gz
about the source, we all know the kernel source of .35 kernel for u8800 and pro version are the same but the defconfig is different. so as fjsferreira said, this source isn't compatible for pro version. unless someone port the 3.0.8 source into the pro version. i don't know how to port the kernel, i just want to tell you what is needed to build a kernel
sorry for my bad english
fjsferreira said:
Yes, Dzo posted the zip already. I suggest you search Aurora's thread and read about what 3,0 kernel does... 1 hint: you'll be amazed
Sent from my U8800
Click to expand...
Click to collapse
i searched for a half hour but didnt find sth....
edit: found the zip
Sent from my U8800 using XDA
levibuko said:
i searched for a half hour but didnt find sth....
edit: found the zip
Sent from my U8800 using XDA
Click to expand...
Click to collapse
Make sure to use v2 with fixed USB storage...
Sent from my U8800
Here, kernel from today, changelog is "Make button backlight even brighter", pretty self explanatory... Again, don't go to aurora thread posting bugs regarding this kernel as it wasn't an "official" dzo release, please...
fjsferreira said:
Here, kernel from today, changelog is "Make button backlight even brighter", pretty self explanatory... Again, don't go to aurora thread posting bugs regarding this kernel as it wasn't an "official" dzo release, please...
Click to expand...
Click to collapse
Should we put this boot.img file while on pink screen.
I read the first page.But i can't see that ,where is the place of boot.img.
Sorry about this silly question
Thank you fjsferreira.
Mr.Moriarty said:
Should we put this boot.img file while on pink screen.
I read the first page.But i can't see that ,where is the place of boot.img.
Sorry about this silly question
Thank you fjsferreira.
Click to expand...
Click to collapse
Yes, if you have usb storage access in pink mode, you can put it in the "image" folder, or you can copy it directly with root explorer to ./cust_backup/image/ and then reboot. If you can't see that folder with root explorer, go to options and make sure it's set to show invisible files. It's in the root of filesystem, where /system/ and /etc/ folders are with all the others
Of course, in both cases, replace the original boot.img.
i have tryed the new kernel "Make button backlight even brighter" and the lights to turn on must change to autobright, but backlight are brighter...

Debian Buster WSL2 Kernel / ROM Builder [replaces VM]

Okay I don't have enough time to update this whole description, no one volunteered to host the VM so now I only have a Debian Buster WSL2 (Windows 10 latest) build environment. You can make kernels and ROMs from it. It has a built in XFCE4 and all the features listed below. It will build kernels for you from source and place them in AnyKernel3 zip files ready for flashing in the ~/ directory. Build scripts are provided for Op8T 5G custom and GPUOC RadioActive Kernels from my GitHub (modded for performance + battery). You can use this guide and get full audio and a GUI and all you need to build.
Try out this build for Debian Buster for WSL2:
First you need to ensure you are on a recent build of Windows, go to windows Updates in settings and download the latest.
Next open a Powershell Command Prompt in Admin mode. Type:
dism.exe /online /enable-feature /featurename:Microsoft-Windows-Subsystem-Linux /all /norestart
Enable-WindowsOptionalFeature -Online -FeatureName VirtualMachinePlatform -NoRestart
Restart your PC, then get back into an Admin Powershell prompt and type:
wsl --set-default-version 2
Next you can download this tar.gz distribution, it's quite big (6GB zipped -> 14GB unzipped). Apparently you can import a tar.gz directly, so I changed it from a .zip file to .gz: https://mega.nz/file/DkARXIjD#hGu8TjxaA__YrRsfqfWJw9-2ViyyntyK5U8JdClor6A
Easily move WSL distributions between Windows 10 machines with import and export!
wsl --import <DistributionName> <InstallLocation> <Full path to .tar/.tar.gz FileName>
After import, you should type: login: user password: user (also the sudo password) change the Global Git settings to your own email and username.
Open the command line.
Set your username: git config --global user.name "FIRST_NAME LAST_NAME"
Set your email address: git config --global user.email "[email protected]"
Then if you want to set up SSH between your WSL2 instance and NoMachine, download NoMachine here for your host PC: https://www.nomachine.com/download/download&id=8 then follow the steps to generate an SSH key, which will be located at ~/.ssh.
ssh-keygen -m PEM -t rsa -b 4096
Use the directory default ~/.ssh/
Then copy this file: ~/.ssh/id_rsa.pub to ~/.nx/config/authorized.crt
In the NoMachine GUI, you should select Configuration, Use a key based authentication key which you provide, then provide the path to the private key \\wsl$\debian\home\user\.ssh\id_rsa and check the box Import the key to the connection file.
To get to the XFCE4 GUI, you should type login: user password: user, then run /.nomachine.sh
It will post the IPV6 address you need to enter into the configuration into NoMachine on Windows 10. It changes every time you open it (WSL2 problem).
Now you should be able to connect to the GUI and use all the dev tools built in. Or you can just use the command line if you're more comfortable there. You'll probably need to do some more Googling to get everything setup the way you like. There are 2 examples in this file for an Op8T RadioActive modded kernel from my GitHub repos with a ./Build-Clang12.sh script you can use to see how to build a kernel. It it fully automatic. It will generate the zip specified in that file in the ~/ directory which can be flashed to a device via EX Kernel Manager or FK Kernel Manager. Best of luck!
Great job mate. I hope this is the kick off and boost up kernel development on the MI9 ??
Now THAT is what XDA is all about.
I'd like to get in to this type of development but simply don't have the personal time right now.
Hope this helps boost community support a bit.
This must've taken some time. Hats off to you sir.
kickassdave said:
Now THAT is what XDA is all about.
I'd like to get in to this type of development but simply don't have the personal time right now.
Hope this helps boost community support a bit.
This must've taken some time. Hats off to you sir.
Click to expand...
Click to collapse
Thanks Dave - this is the absolute easiest way to build a kernel. Yes it took forever to get working, a lot had to do with bad Xiaomi source code and Android 9 package requirements for building kernels. You can simply download, install, click Goto Build, click on QClang8_Build, copy/paste it's text from Geany into the open terminal, sit back and wait for the build to finish. Then once it completes, you click on Built Kernels and you have your image ready. A few more steps obviously outlined in the post to transfer to the host machine (cp Image-dtb /media/sf_VMxfer) and pack via Android Image Kitchen, copy to the device, and flash via TWRP. Most features require Magisk patching as well to enable altering in a kernel manager. The mentioned repo (mrslezak) has Fsync toggle, 830GPU overclock, and F2FS file system support (Mauro TWRP has just enabled it, so I'm using it now). I should note as well that this kernel has only been tested on MIUI and Xiaomi.eu builds thus far (anything based on Xiaomi MIUI should work - MIUI Global Dev, China Dev, Xiaomi.eu, MiGlobe, RevolutionOS, etc. as long as it is Android Pie).
I'm waiting on others to jump on board!!!! Hopefully it happens
Excellent guide, will work for almost all pie devices!
Great work OP :highfive:
Regards,
acervenky
Hi, @mslezak @acervenky Can you help me to build kernel for Stock Miui 10 for K20/Mi9t . I followed your guide setup all requirement i just changed the device code name from cepheus to davinci everything went well kernel complied and also created the boot.img with AIK but after flash it is through back me to recovery.
Can you Please help me with this.
@acervenky fixed that by applying the patch in the Desktop Mi9_Build_Tools/Required_Patches_to_Compile_Xiaomi_Source/cosmin_kernel-module.c copy that to /kernel/module.c, he can chime in here. Or check out his repo he has one on Github that compiles already QUAX kernel I believe with a bunch of stuff added already over stock.
Good job. Compiled a kernel for mi9t pro (raphael) with your detailed guide.
Can you help with "make modules" command?
I need to make xt_HL.ko module, but it not compiling ((
Not needed anymore, made it successfully.
Can you compile q kernels with this?
asgardpark said:
Can you compile q kernels with this?
Click to expand...
Click to collapse
Yes! Just don't replace .dtsi and module.c files for now.
Regards,
acervenky
New Q build VM coming soon. GCC10 x64 and Arter97 GCC9 x32 toolchain.
Just a notice here I have a VM almost ready to upload that can build Mi9 source. It's a ton of patches to stock code but I'll setup a repo with them already applied.
Can i use anykernel to make a flashable zip? Or do i have to use a diffrent approach?
https://mega.nz/#!voJEGIRC!r4FcV6zUlVbFExcidhL9JmgVZlu3IscYH-S5XlnTUJI Android Q VM - expands to 40gb on your hard drive so you don't run out of space. Builds a GCC10 patched version of Xiaomi Cepheus and Raphael kernels from my repo, forked from Xiaomi and commits outlining every step needed to get it to build. https://github.com/mrslezak/Cepheus-Raphael-Q-GCC10
Yes AnyKernel3 is the easiest
asgardpark said:
Can i use anykernel to make a flashable zip? Or do i have to use a diffrent approach?
Click to expand...
Click to collapse
Sure AnyKernel3 is easy, take someone's kernel zip, insert your Image-gz.dtb or Image-dtb into the root of the zip, delete the other kernel, and you should be able to flash it.
got some compile errors today when i tried your wm
/home/user/toolchains/aarch64-linux-elf/bin/aarch64-linux-elf-ar: kernel/resource.o: No such file or directory
I'd first try a: make clean; and: make mrproper;....
But here's more info:
Double click the GoTo Build icon, a terminal will open in the source directory. Then in the terminal: cp /home/user/Desktop/Build GCC10 Cepheus.sh .; chmod +x "Build GCC10 Cepheus.sh"; ./"Build GCC10 Cepheus.sh"; Once done the kernel will be in /home/user/Cepheus-Raphael-Q-GCC10/out/arch/arm64/boot/Image.gz-dtb. /out9TP/ for Raphael, just substitute the build script you need.
If it then still won't build, you'll have to grab the repo again. Type: git pull
Or the safest is a complete re-download: cd ..; rm -rf Cepheus-Raphael-Q-GCC10; git clone --depth=1 https://github.com/mrslezak/Cepheus-Raphael-Q-GCC10.git and repeat the prior copying of the build script to the source directory.
I tested this last night and it worked. If I tried to just drag the script into a terminal window it failed. There could be some dirty files in there not sure how that happened, but deleting and cloning again definitely works. I built both Cepheus and Raphael kernels last night in the VM off a fresh clone of the repo. I'd update I but it literally takes 6hrs + since the files are huge and take forever to compress and upload to Mega. And I have to delete so much off my VM and SSD just to do it. This way you learn something too
I first drag n dropped the file when i got the error, then i remembered when i compiled kernels for my raspberry pi's it also failed if i draged n dropped my build script so i did it the proper way and it worked
Thanks for your WM it's working great
mslezak said:
https://mega.nz/#!voJEGIRC!r4FcV6zUlVbFExcidhL9JmgVZlu3IscYH-S5XlnTUJI Android Q VM - expands to 40gb on your hard drive so you don't run out of space. Builds a GCC10 patched version of Xiaomi Cepheus and Raphael kernels from my repo, forked from Xiaomi and commits outlining every step needed to get it to build. https://github.com/mrslezak/Cepheus-Raphael-Q-GCC10
Click to expand...
Click to collapse
Could you upload the VM to Google Driver? Thank you!
q659503934 said:
Could you upload the VM to Google Driver? Thank you!
Click to expand...
Click to collapse
Yeah if you buy me Google drive space I'd be more than happy to upload to Google Drive. I'm out of space man. If you run Windows 10 Preview WSL2 I have a 3.2GB build that kills everything else out there.
mslezak said:
Yeah if you buy me Google drive space I'd be more than happy to upload to Google Drive. I'm out of space man. If you run Windows 10 Preview WSL2 I have a 3.2GB build that kills everything else out there.
Click to expand...
Click to collapse
Do you have WSL2 tar file that can build Kernel?

Categories

Resources