romcustomer: a python script to clean and custom an official MIUI room - Xiaomi Redmi 1S

Hi,
I have uploaded to Github a simple script to clean of chinese apps and customize an official ROM. I have used the apns-conf.xml from Cyanogenmod (just I have added one APN for me) and a list of MIUI apps from htcmania forum. The idea original comes from elperroderoke but I want to extend with more functionality.
I have tested with the latest official build: bz_v4.3_armani_JHCMIBH45.0.zip and Linux but it should work fine on Mac. For Windows, you will need a python shell.

releasetools with an 'extras.txt'; pretty much the same concept (we devs use it).
good job :good:, though I am not sure how many people with a python shell we have

thewisenerd said:
releasetools with an 'extras.txt'; pretty much the same concept (we devs use it).
good job :good:, though I am not sure how many people with a python shell we have
Click to expand...
Click to collapse
i do.

Related

Linux cross-compile or ready binaries

Hi, I would put some linux binaries (arm architecture ?) on my phone to support the ADB SHELL activity, to enlarge the busybox capabilities.
For instance, I mean stuff like a bash shell, a complete gtar for backups (the busybox one isn't adeguate), md5deep, and so on.
Could you please give any hint to do that ?
Thanks
Val3r10 said:
Hi, I would put some linux binaries (arm architecture ?) on my phone to support the ADB SHELL activity, to enlarge the busybox capabilities.
For instance, I mean stuff like a bash shell, a complete gtar for backups (the busybox one isn't adeguate), md5deep, and so on.
Could you please give any hint to do that ?
Thanks
Click to expand...
Click to collapse
The first post here: http://forum.xda-developers.com/showthread.php?t=777380 contains a link that actually contains a complete binary arm cross compiler. If you use linux (works with most 32 bit distros, needs multilib on 64 bit distros) you can use that to cross compile your code to arm.
Many thanks for your answer.
I'd static link libraries, I guess...
Btw could I also use normal binaries for 32bit arm architecture ? (i.e. debian distro...)
You can also use some of the binaries of the CyanogenMod for Desire (or any other phone) and use these (bash, nano) http://androidforums.com/evo-4g-all...shell-nano-tab-completion-color-over-ssh.html
Bash 4.1 : http://android.modaco.com/content/software/301932/bash-4-1-native-app-for-android/ (not sure its the one i got but you can give it a try)
Jb boin said:
Bash 4.1 : http://android.modaco.com/content/software/301932/bash-4-1-native-app-for-android/ (not sure its the one i got but you can give it a try)
Click to expand...
Click to collapse
Many thanks.
The bash 4.1 binary could also be found in the Better Terminal Emulator package from market...
Actually I'm looking for a way to get other working stuff for low level backups, as said gtar, zip, ...

[KITCHEN] Minimal kernel building VM with scripts

I added some convenience scripts to the config. Read the new tutorial here
The old one still works:
I put together a small virtualbox vm with a very minimal debian config with which I was able to compile a working kernel. This is for all the people who are running Windows, and want to try modifying kernels/initramfs's. As this is a minimal config there are some drawbacks (like it doesn't have a graphical interface), but you can always install additional packages, if you want to.
The VM includes: debian, build essentials, git, vb guest additions, mc, vim and codesourcery 2010q1 gnu-eabi. (it's larger than the simple eabi version, but can be used to compile non-kernel applications too)
First of all I hate both SunOracle VirtualBox and debian, but VB is free, and debian is lean, so they'll do the job.
To get the image running do the following:
First download and install VirtualBox
Next download the VM image: http://android.sztupy.hu/dl/KernelCompilerVM-1.1.7z and extract it. (it's a large download. If you can please put it up a mirror)
Mirrors: (thanks to the people mirroring it)
- http://www.multiupload.com/THJV19BJ9X
- http://bote.ro/sztupy/KernelCompilerVM-1.1.7z
After this run virtualbox, and import this VM.
Run the VM. The username/passwords are: root/root and kernel/kernel. Login with kernel. (you can always switch to root using sudo)
Next choose what kernel/initramfs you want to compile.
Here are some links to kernels:
The original sources can be found at supercurio's git:
Code:
git://github.com/project-voodoo/linux_gt-i9000.git
froyo-samsung branch
The kernel of the voodoo project can be found at the same place:
Code:
git://github.com/project-voodoo/linux_gt-i9000.git
froyo-voodoo branch
The ULTK kernel can be found at my account:
Code:
git://github.com/sztupy/universal_lagfix_kernel.git
Here are some links to initramfs files:
The original froyo initramfs can be found at supercurio's git page:
Code:
http://github.com/project-voodoo/samsung_ramdisks.git
afaik the voodoo initramfs is build using scripts from these images, so you have to apply them.
The ULTK initramfs can be found here:
Code:
git://github.com/sztupy/universal_lagfix_kernel_initramfs.git
For the rest of the tutorial I'll be showing how to compile ULTK:
First get the kernel sources using git:
Code:
git clone git://github.com/sztupy/universal_lagfix_kernel.git kernel
Unfortunately no copy-paste function is available, so you have to write this manually...
Next get the initramfs using git:
Code:
git clone git://github.com/sztupy/universal_lagfix_kernel_initramfs.git initramfs
If everything goes well you'll have two directoryes, called kernel and initramfs. Next we have to modify some values in the kernel configs.
Nano, mcedit and vim are installed, use the one that suits you best. (mcedit is the most user friendly)
Switch to the kernel directory and edit the Makefile there:
Code:
cd kernel
nano Makefile
Find the row that says
Code:
CROSS_COMPILE ?= some value
Replace it to
Code:
CROSS_COMPILE ?= /home/kernel/arm-2010q1/bin/arm-none-linux-gnueabi-
(if using nano make sure it won't add a line break into the row)
Next load the default config:
Code:
make aries_eur_defconfig
And edit it:
Code:
nano .config
We have to supply the directory of the initramfs. Search for the line:
Code:
CONFIG_INITRAMFS_SOURCE=some value
and replace it to
Code:
CONFIG_INITRAMFS_SOURCE=/home/kernel/initramfs/out
(this is for the ULTK. For voodoo the initramfs locations are "froyo-xxjp6" and "froyo-xxjpm" instead of "out")
if you've managed to do that too, let's compile the kernel:
Code:
make
If everything goes fine after a while you will have your shiny new kernel. Now let's get it to your computer, so it can be flashed:
First, you have to create a shared folder in VirtualBox. Simply create a directory somewhere on your computer, and add it as a shared folder in virtualbox. The name of the shared folder should be simple, for example "shr".
Next, you have to mount that directory inside the VM. To do this enter:
Code:
sudo mount -t vboxsf shr ~/share
After it has been mounted you can copy the fresh kernel to your host OS:
Code:
cp arch/arm/boot/zImage ~/share
If everything goes well you have a zImage ready at the folder you've just shared. TAR it, fire up odin, and flash.
---------------------------------
Now that you've succesfully compiled a working kernel try to modify it. You can use "make menuconfig" in the kernel directory to switch some kernel functions (like filesystem supports) on and off. You can edit .config by hand to add or remove some configuration values. And you can edit the files in the initramfs directory. After modifications you only have to enter "make" in the kernel directory to get your kernel inside the "arch/arm/boot/zImage" dir ready.
You can also copy files from your host OS, to the guest OS, by putting the file inside the shared folder and copying it:
Code:
cp ~/share/thefile ~/initramfs/copyithere
Hope this guide was useful.
Impressive, thanks. Even a noob like me can try this.
Oh god, not only a talented developer, but a community helper!
STICKY!!
Gonna try it laters <3
oh yea, nice!
DocRambone said:
Impressive, thanks. Even a noob like me can try this.
Click to expand...
Click to collapse
If you're a noob, then I'm a baby
Darkyy said:
If you're a noob, then I'm a baby
Click to expand...
Click to collapse
high time you start compiling kernels
tnx
its very usefull
Magnificent!
I just came to take a quick look, but the thread deserves a closer one.
Thank you for sharing knowledge.
Worthy of a sticky.
Hopefully this will solve all those "I want this in a kernel but not that" scenarios.
This is VERY nice for the devs.. but.. i think this will make this forum spammed with 69 diff kernels with just minor changes.. as with the roms
Its better to let other people brick their phone than you brick your own
Just kidding! I for one will try and compile different versions with different lag-schemes to find the fastest combination. Including /system with fastest reading. I think I will add a benchmark to the recovery menu directly. Benchmarking each mount for read and for write speeds. Maybe I can use backup/restore code and just time it without writing (cp to null). Lets get to work
Thanks sztupy!
Sent from my GT-I9000 using XDA App
_JKay_ said:
Its better to let other people brick their phone than you brick your own
Just kidding! I for one will try and compile different versions with different lag-schemes to find the fastest combination. Including /system with fastest reading. I think I will add a benchmark to the recovery menu directly. Benchmarking each mount for read and for write speeds. Maybe I can use backup/restore code and just time it without writing (cp to null). Lets get to work
Thanks sztupy!
Sent from my GT-I9000 using XDA App
Click to expand...
Click to collapse
You cannot brick your phone with a bad kernel
@sztupy
I am impressed how productive master mind and kind person you are sharing all your knowledge and developments with us.
Congratulation, with you contributions you push Android Development forward.
Thank you
this is really cool, if i need minimal GUI, what would you suggest? xfce ? or there is something smaller and lighter? thx again.
avary said:
this is really cool, if i need minimal GUI, what would you suggest? xfce ? or there is something smaller and lighter? thx again.
Click to expand...
Click to collapse
Fluxbox/Openbox. However I don't see the need for one, if you're running the machine just for compiling.
Also, shouldn't gpm+guest additions solve the copy-paste problem?
E: Apparently not. Meh, stupid virtualbox.. sshd+putty then!
Awesome! Thanks for this sztupy! The more people we can get involved in this stuff, the better the end result will be. Always!
aziztcf said:
Fluxbox/Openbox. However I don't see the need for one, if you're running the machine just for compiling.
Also, shouldn't gpm+guest additions solve the copy-paste problem?
E: Apparently not. Meh, stupid virtualbox.. sshd+putty then!
Click to expand...
Click to collapse
actullay i was looking for something light and minimal (with GUI, or at least something like PCman FM and gedit or kedit, im not good with emac, vi ) to play and compile AOSP, for now i do this with Kubuntu dual boot on my laptop. if i put a litghweight desktop on top of szytup's image and use it with VB, that would be great.
thank you !
avary said:
actullay i was looking for something light and minimal (with GUI, or at least something like PCman FM and gedit or kedit, im not good with emac, vi ) to play and compile AOSP, for now i do this with Kubuntu dual boot on my laptop. if i put a litghweight desktop on top of szytup's image and use it with VB, that would be great.
thank you !
Click to expand...
Click to collapse
I'd use a shared folder+IDE/editor/whatever on windows. But that's just because I have so awful experiences about X in VMs, things might be better nowadays
Thanks a lot sztupy, will try it now. Sunday is enough time for testing
Each morning i have a look at XDA and you have brought out a new very helpfully posting, kernel, rom or else!
So let me ask you one question: when do YOU sleep?
avary said:
actullay i was looking for something light and minimal (with GUI, or at least something like PCman FM and gedit or kedit, im not good with emac, vi ) to play and compile AOSP, for now i do this with Kubuntu dual boot on my laptop. if i put a litghweight desktop on top of szytup's image and use it with VB, that would be great.
thank you !
Click to expand...
Click to collapse
The advantage of using X is that afaik guest additions has copy-paste support, that would make modifying easier.
I also plan on making some simple scripts inside the default home directory one can run to communicate with the shared folder. After that we could provide simple scripts that you only have to put inside the shared folder, which will download, modify and run the compilation.

[App] 2BOrange - Install any kernel (Voodoo, SpeedMode, Infusion...) without computer

____________________________________
2BOrange
____________________________________​
Hi everybody,
I have made a free application to install any kernel on your SGS very easily.
The idea is that there is a website where kernel are uploaded with a script and an application to:
- search
- download
- install it on your phone.
The application and the website are not limited to install kernell but I think it is a good way to try it.It can execute any script in the android shell.
So I have made some script for some kernel, there are so much that I have not the time to make one for each of them.
To make a script is very easy, I have attached an example of one I have uploaded on the website. If you need to attach a file, put it in a zip and upload both (the script and the zip) through the upload form on the website,
The address of the website is:
http://www.2borange.com/
A general thread on XDA (not dedicated to kernel on SGS) about the application:
http://forum.xda-developers.com/showthread.php?p=14875954#post14875954
You need to create an account to upload but it is not mandatory to just search, download and install a kernel.
Please keep me informed if everything work or not. I have only test it on my phone.
For the author of the kernels: I am sorry to have not yet informed you of the sharing of your great work, I will do it for sure when I will have done enough test to offer you an interesting way to share your work.
For the user: if you have time, don't hesitate to upload some scripts, it is free and easy to do...
Thank you for everything,
Michael
LIST OF KERNEL AVAILABLE AS OF JUNE, 27:
- Galaxian
- Infusion Kernel Faster Fusion Reaction
- Semaphore Kernel JVH - JVP
- SpeedMod Gingerbread
- TalonDEV
- TEGRAK lagfix- Voodoo kernel installer
- Voodoo kernel JVP
Don't hesitate to upload some new firmware. A model of script is provided below as attachment
niceee something to look foreward to
Neldar's SGS Kernel Flasher
is not locked to any web-site.
Sent from my GT-I9000
O-T said:
Neldar's SGS Kernel Flasher
is not locked to any web-site.
Sent from my GT-I9000
Click to expand...
Click to collapse
This allows you to actually find a kernel, download it and flash it as well. The Kernel Flasher is just for kernels already on your sd card.
O-T said:
Neldar's SGS Kernel Flasher
is not locked to any web-site.
Sent from my GT-I9000
Click to expand...
Click to collapse
Thank you for your message.
I did not know about this application. I have read the description and I can tell you the purpose of mine is totally different.
I have understood that Nedar application is to install a Kernel that you have already downloaded and copy on your SDCARD.
The purpose of my application is to download automatically a script and a zip file, and execute the script.
So there are 2 main differences between these two applications:
- my application get files you need directly from the cloud (Internet), so it is like a deposit of files
- my application is not limited to kernel installation, it is just a usefull example to show people how it works, but it can do more, really lot more tasks.
However, because the application of Nedar is dedicated to one particular task, it has option I have not yet implemented in mine. By example, I have not yet construct a script to backup the kernel in an update.zip file, which could be very usefull.
So they are really very different. I hope I will be able to construct more script, but may be the biggest difference with any dedicated application is that anyone can participate to my project without any knowledge in Java programation.
You just have to know a little bit about shell to be able to share your work with others.
THAT IS THE REAL PURPOSE OF THIS APPLICATION : SHARING!
Amazing concept!
Thumbs up for the foresight for such a nice project. If enough effort is put I can see in next couple of months, the whole, ROM, Kernel, Modem flashing automated.
Right from finding the correct software till installing them and may be some debugging and fault finding as well!
Will definitely donate in case the project takes off the way it should!
Great work Snoopy!
Loving the concept of this!
As omzworld was saying, if this grew into a script that could automatically install your ROM/kernel/modem etc. that would be awesome, especially for people who are new to flashing.
Now, here's another suggestion that may or may not have been thought about already..
Is there any way to make the app look at your phone and use that as a basis for roms, kernels etc. ? If that was possible, anyone and everyone would be using your app to flash because they would know that bricking their phones would be almost impossible.
omzworld said:
Amazing concept!
Thumbs up for the foresight for such a nice project. If enough effort is put I can see in next couple of months, the whole, ROM, Kernel, Modem flashing automated.
Right from finding the correct software till installing them and may be some debugging and fault finding as well!
Will definitely donate in case the project takes off the way it should!
Great work Snoopy!
Click to expand...
Click to collapse
lttldvl said:
Loving the concept of this!
As omzworld was saying, if this grew into a script that could automatically install your ROM/kernel/modem etc. that would be awesome, especially for people who are new to flashing.
Now, here's another suggestion that may or may not have been thought about already..
Is there any way to make the app look at your phone and use that as a basis for roms, kernels etc. ? If that was possible, anyone and everyone would be using your app to flash because they would know that bricking their phones would be almost impossible.
Click to expand...
Click to collapse
Thank you for your interest.
The thing I need now is not money, donation,etc... but report of test and ideas of improvment.
By the way, I only have a samsung phone, and I am wondering if there are possibilities to install kernel in other phone only by using the shell, have you an idea ?
Second question: have you an idea how to proceed to install an entire ROM through the shell ? I suppose the phone has to be rebooted before installation begin and lauche in a recovery mode, but how to make it automatic like in ROM Manager?
Thank you for your help!
omzworld said:
Amazing concept!
Thumbs up for the foresight for such a nice project. If enough effort is put I can see in next couple of months, the whole, ROM, Kernel, Modem flashing automated.
Right from finding the correct software till installing them and may be some debugging and fault finding as well!
Will definitely donate in case the project takes off the way it should!
Great work Snoopy!
Click to expand...
Click to collapse
What is the way it should take for you?
I need ideas
lttldvl said:
Loving the concept of this!
As omzworld was saying, if this grew into a script that could automatically install your ROM/kernel/modem etc. that would be awesome, especially for people who are new to flashing.
Now, here's another suggestion that may or may not have been thought about already..
Is there any way to make the app look at your phone and use that as a basis for roms, kernels etc. ? If that was possible, anyone and everyone would be using your app to flash because they would know that bricking their phones would be almost impossible.
Click to expand...
Click to collapse
I have already included a kind of filter based on brand, model of phone and firmware version plus sdk version, do you think it could be more precise?
Fixed script on server, should work on every phone now
Hey snoopy33, why do you have not yet updated this page?

How do I start developing ROMs?

I've tried out almost every ROM I could find for the VZW Galaxy Nexus. They all have their own pros, but none of them were really perfect for me.
I already know Java, so I know that should help me a lot. But I do have some general questions.
My main questions is, do I compile from source? Or do I use something like JRO03L? What exactly is JRO03L? I noticed a lot of ROMs were based off either AOSP or JRO03L, or some other ROM.
When people say their ROM is based of AOSP, does that mean they edited the source code directly?
What about drivers and stuff? Do phones even have those? How do I get them for my phone?
What percentage of ROM editing is done through source code modifying and what percentage is through Cooking?
Sorry for all the questions, I'm just kinda confused.
jtvd78 said:
I've tried out almost every ROM I could find for the VZW Galaxy Nexus. They all have their own pros, but none of them were really perfect for me.
I already know Java, so I know that should help me a lot. But I do have some general questions.
My main questions is, do I compile from source? Or do I use something like JRO03L? What exactly is JRO03L? I noticed a lot of ROMs were based off either AOSP or JRO03L, or some other ROM.
When people say their ROM is based of AOSP, does that mean they edited the source code directly?
What about drivers and stuff? Do phones even have those? How do I get them for my phone?
What percentage of ROM editing is done through source code modifying and what percentage is through Cooking?
Sorry for all the questions, I'm just kinda confused.
Click to expand...
Click to collapse
compile from source needs linux (mac osx only builds master branch);
aosp = android open source project
JRO03L, JRO03R: release tags. they mark a certain landmark in android development, normally leads to/are (pratically) the same as ota's.
yes, aosp-based roms edit source then build. why would we cook when we can build? makes no sense on a aosp supported device like ours.
on linux, just install android-sdk (includes fastboot and adb) and add it to your $PATH, and create udev rules for android devices (most distros provide this as a package). no need for drivers on linux.
http://forum.xda-developers.com/showthread.php?t=1386615
http://source.android.com/source/initializing.html
sent from my i9250
bk201doesntexist said:
compile from source needs linux (mac osx only builds master branch);
aosp = android open source project
JRO03L, JRO03R: release tags. they mark a certain landmark in android development, normally leads to/are (pratically) the same as ota's.
yes, aosp-based roms edit source then build. why would we cook when we can build? makes no sense on a aosp supported device like ours.
on linux, just install android-sdk (includes fastboot and adb) and add it to your $PATH, and create udev rules for android devices (most distros provide this as a package). no need for drivers on linux.
http://forum.xda-developers.com/showthread.php?t=1386615
http://source.android.com/source/initializing.html
sent from my i9250
Click to expand...
Click to collapse
Thanks for the links
And when I mentioned drivers, I meant for the phone hardware. Like, does android just magically work on all phones? or do some phones need something extra to work with AOSP?
Now, after I set up Ubuntu with the guides above, are there any guides to the basics of source editing? Like what do I need to do to install busybox? root android? theme?
I googled on how android 'worked' , so i can get a better understanding on how it operates, but all the results were pretty vague.
jtvd78 said:
Thanks for the links
And when I mentioned drivers, I meant for the phone hardware. Like, does android just magically work on all phones? or do some phones need something extra to work with AOSP?
Now, after I set up Ubuntu with the guides above, are there any guides to the basics of source editing? Like what do I need to do to install busybox? root android? theme?
I googled on how android 'worked' , so i can get a better understanding on how it operates, but all the results were pretty vague.
Click to expand...
Click to collapse
you need to use the right words in google to find what you need. start here, look under getting started http://source.android.com/source/index.html
simms22 said:
you need to use the right words in google to find what you need. start here, look under getting started http://source.android.com/source/index.html
Click to expand...
Click to collapse
Part of the questions you're asking OP, can be solved with information available on that link simms22 and I posted.
jtvd78 said:
Thanks for the links
And when I mentioned drivers, I meant for the phone hardware. Like, does android just magically work on all phones? or do some phones need something extra to work with AOSP?
Click to expand...
Click to collapse
obviously not, that's why i said "aosp-supported devices". devices that aren't aosp supported, need the same things we need, except in their case there's the matter of proprietary frameworks and drivers (called binaries), which we have available almost from the start.
jtvd78 said:
Now, after I set up Ubuntu with the guides above, are there any guides to the basics of source editing? Like what do I need to do to install busybox? root android? theme?
Click to expand...
Click to collapse
sure, guides @github or at any other repo. there's no better guide than being able to read source code and how the masters do it.
jtvd78 said:
I googled on how android 'worked' , so i can get a better understanding on how it operates, but all the results were pretty vague.
Click to expand...
Click to collapse
@source.android.com.
tip: you'll need to learn how to git. there's plenty of tutorials around the web.
I got everything set up from google's directions, but when I attempt to build from the source, I dont have the option to select toro.
1. full-eng
2. full_x86-eng
3. vbox_x86-eng
4. full_grouper-userdebug
5. mini_armv7a_neon-userdebug
6. mini_armv7a-userdebug
7. full_wingray-userdebug
8. full_crespo-userdebug
9. full_maguro-userdebug
10. full_panda-userdebug
jtvd78 said:
I got everything set up from google's directions, but when I attempt to build from the source, I dont have the option to select toro.
1. full-eng
2. full_x86-eng
3. vbox_x86-eng
4. full_grouper-userdebug
5. mini_armv7a_neon-userdebug
6. mini_armv7a-userdebug
7. full_wingray-userdebug
8. full_crespo-userdebug
9. full_maguro-userdebug
10. full_panda-userdebug
Click to expand...
Click to collapse
instead, do:
Code:
. build/envsetup.sh && lunch full_toro-user && make -j4 otapackage
done.
Thanks! One more question... where exactly is the finished zip?
it tells you where it is when it finishes building..
out/target/device/samsung/toro/
sent from my i9250

[Guide] Compiling your own nightly kernels Quark/Blechd0se & Essential Git commands

[Guide] Compiling your own nightly kernels Quark/Blechd0se & Essential Git commands
Well Hello again another day, another do it yourself guide for the people like me with ORD
Search it up to see what am on about
Today there will be two guides they are very easy I promise - One on how to compile just the kernel image(zImage) and the other on how to use some common git commands.
Kernel Guide
1. Downloading the sources & packages needed :
Before we start we need to make sure you have the necessary packages required for you to compile the kernel.
If you already have an android build environment setup then we are good to go
If not then you can either use my guide and get an android build setup going just incase you want to compile your own nightly later on or you can just download the necessary packages required for compiling the kernel.
Packages needed - git-core, gnupg, flex, bison, gperf, libsdl-dev, libesd0-dev, libwxgtk2.6-dev, build-essential, zip, curl, libncurses5-dev, zlib1g-dev, ia32-libs, lib32z1-dev, lib32ncurses5-dev, gcc-multilib, g++-multilib.
So for ubuntu based system it will be -
$ sudo apt-get install git-core gnupg flex bison gperf libsdl-dev libesd0-dev libwxgtk2.6-dev build-essential zip curl libncurses5-dev zlib1g-dev ia32-libs lib32z1-dev lib32ncurses5-dev gcc-multilib g++-multilib
For arch linux -
$ sudo yaourt git-core gnupg flex bison gperf libsdl-dev libesd0-dev libwxgtk2.6-dev build-essential zip curl libncurses5-dev zlib1g-dev ia32-libs lib32z1-dev lib32ncurses5-dev gcc-multilib g++-multilib
Most of the packages are found in the AUR repository so you need a frontend to AUR like yaourt.
Once you have the packages installed we are going to clone the kernel tree into our computer.
I feel it's best you make a new directory for which you will use to compile kernels.
Once you are in your directory of choice we can now download the kernel sources
For Quarx kernel - $ git clone https://github.com/Quarx2k/jordan-kernel
For Blechd0se kernel - $ git clone https://github.com/Blechd0se/jordan-kernel
One thing to note is after the git clone command you can name the folder in which the sources will be saved to.
For example git clone https://github.com/Blechd0se/jordan-kernel blechd0se. This will renamed the folder to Blechd0se which the kernel sources will be saved to instead of the default name of jordan-kernel.
2. Downloading the toolchain/s
If you have one of the rom sources (CM10, SB, CNA) synced up then you can just point the cross compile to that directory.
$ git clone https://github.com/Quarx2k/platform_prebuilt
Here you have a choice of two toolchains either the default google one (4.4.3) or the recently added linaro toolchain(4.5.4) by Quarx
3. Setting up configuration
Now cd into the kernel folder so for me -
$ cd ~/Kernel/Blech0se
Then run the follwing commands -
$ export ARCH=arm
$ export CROSS_COMPILE=~/<location of toolchain>
- For the linaro toolchain it will be export CROSS_COMPILE=~/Kernel/arm-eabi-4.5.4-linaro/bin/arm-eabi-
- For google's iw will be export CROSS_COMPILE=~/Kernel/arm-eabi-4.4.3/bin/arm-eabi-
make mapphone_defconfig
If you are compiling Blechd0se kernel then you can choose what process schedulers you want BFS or CFS the default is CFS.
To enable BFQ you need to do the following things
make menuconfig this will bring up a menu which you can use to customise the kernel if you know what you are doing this can also be used on Quarx's the difference is you don't have as much choice as in Blechd0se's.
Scroll down and select enable block layer then IO schedulers the scroll down to BFS and type "Y" a star will appear in the checkbox showing it will use BFS now.
Once that's done you can compile own kernel image using the make command
make -jx <maximum number of jobs>
Replace the x with the amount of jobs you want. I usually use -j8 but you can use higher but it can slow down you PC.
Read this post for more info on effectively using make -jx
You kernel will be finished into a couple of minutes to hours depending on the amount of jobs you used and how many cores you have in your processor.
Now we need to package the kernel into a zip to flash recovery.
I recommend you download one of Blechd0se's zips and modify it.
You need to delete the config folder if you don't want your overclock settings getting overwritten and also you can modify the updater script found in META-INF/com/google/android.
Then replace the zImage in the folder system/2ndboot/ with your new one.
You can find your zImage into the arch/arm/boot folder in your kernel source folder.
4. Updating and rebuilding -
To update your sources with the latest changes you can use the git pull origin command from the kernel source folder.
So for me it will be -
$ cd ~/Kernel/Blechd0se
$ git pull origin
Once it's being updated we need to first use
$ make clean
$ export ARCH=arm
$ export CROSS_COMPILE=~/<location of toolchain>
$ make mapphone_defconfig
$ make -j8
Credits & Thanks-
To XDA as always for being an awesome resource and playground
To Google for all they awesomeness
To Blechd0se for being an awesome kernel dev
To Quarx for his amazing work on the kernel so far
To thewadegeek for his guide which I have adapted this from Thank him here ​
Git Commands​
The following git commands are the essential ones are feel that are needed to be able to use git effectively allowing you to help contribute back to the community...... With these commands you can help with things such as rom translation, bug fixes etc......
Commands -
1. git clone
This is used to clone a remote repository like here onto your local drive allowing you to edit/add files.
e.g
$ git clone https://github.com/Quarx2k/android_device_moto_jordan-common
This will clone the repository android_device_moto_jordan-common into a new folder called android_device_moto_jordan-common but if you want the folder to be called something else just add the name after the url like so....
$ git clone https://github.com/Quarx2k/android_device_moto_jordan-common Defy-common
Additionally, you can also specify downloading one branch by using the -b command you can also still has a custom name for the folder by putting the name at the end of the branch name. E.g
$ git clone https://github.com/Quarx2k/android_device_moto_jordan-common -b jb_2ndboot Defy-common
2. git
HAHA again
Last one for a party
I just finished syncing CM10 sources, I'll do this one too now
Thanks, you rock!
mark,thanks
Sent from my MB526 using xda premium
Thank you Kayant for this nice guide Hope to see some additional dev's soon
Maybe you can add how to push a commit
And if you only want to rebuild modified modules you can simply run the "mmm" command, safes time
Btw: BFQ and CFQ are I/O-Scheulders, CFS and BFS are process schedulers
When I used to have defy (good old days) this was something I want to share with everyone but I couldn't because I lost my defy when I have doing some progress in custom kernel. Then I lost track of this great community and stop to make things for defy. It's great to see this kind of tutorials for help other users as well. As always, very thanks kayant!!!
Enviado desde mi MT27i usando Tapatalk 2
Thought I might add. on that make -jx command, x should be your max threads + 1 -- eg, I have a quad core w\o hyper threading so I use 5.
use the "nproc" command to find out how many threads you have
the make jx is different than sync jx, where sync jx is how many files you'll concurrently download. I figure most of us know that, but I figured I'd make the distinction.
number of cores + 1 is recommended on a lot of faqs; your results may vary, but using j5 (my recommend setting) versus not setting it (j4 by default, i think -- needs fact checking) speeds up compile time by 20-30 minutes (Quarx CM 10). using too many threads will slow you down and using too little is inefficient and thus slower.
Thank you very much for your informative guides Kayant always learn something from it and really appreciate it:thumbup:
Sent from my MB526 using xda premium
skeevy420 said:
Thought I might add. on that make -jx command, x should be your max threads + 1 -- eg, I have a quad core w\o hyper threading so I use 5.
use the "nproc" command to find out how many threads you have
the make jx is different than sync jx, where sync jx is how many files you'll concurrently download. I figure most of us know that, but I figured I'd make the distinction.
number of cores + 1 is recommended on a lot of faqs; your results may vary, but using j5 (my recommend setting) versus not setting it (j4 by default, i think -- needs fact checking) speeds up compile time by 20-30 minutes (Quarx CM 10). using too many threads will slow you down and using too little is inefficient and thus slower.
Click to expand...
Click to collapse
Thanks for the infromative post as always
In this situation I feel it doesn't matter too much since it takes minutes to compile just the kernel even on my core 2 duo but I will add your hint your post to the OP. Thanks again ^_^
Kayant said:
Thanks for the infromative post as always
In this situation I feel it doesn't matter too much since it takes minutes to compile just the kernel even on my core 2 duo but I will add your hint your post to the OP. Thanks again ^_^
Click to expand...
Click to collapse
You're completely right about the kernel and time -- but for full rom builds and a Funtoo "emerge -uDNav world" it helps. I just saw that j8 and thought "My dual core Athlon 64 would hate me if I did that".
Great guide as always
That does it.
I'm studying Linux in earnest. Enough of this dabbling around the edges... :cyclops:
renoob said:
That does it.
I'm studying Linux in earnest. Enough of this dabbling around the edges... :cyclops:
Click to expand...
Click to collapse
That's the best thing I ever did. I hated XP, wish it was more like Win2k -- I'd gladly pay for Win8 if it had a 2kPro interface. Win2k was awesome, and the only Windows OS I'll give praise to.
I recommend starting out with Ubuntu or Mint (Mint based on Ubuntu, not Debian). There's better support for Ubuntu and distros based on Ubuntu. After about 4-6 months, once you start learning apt, the command line (bash), and some Linux basics; switch to Pure Debian or Mint Debian -- much better than Ubuntu, but not as user friendly (or AptoSid\Sidux -- they're based on Debian Unstable (Sid) -- which is actually pretty stable, ya just gotta be able to fix it if it breaks). I've found that the easiest way to learn it is to just do it. Reading up on it only goes so far without putting it to practice.
After a year or so, try out Gentoo\Funtoo and you'll learn a lot about Linux -- but those distros are not for the faint hearted and require time and dedication to get a GOOD working environment. Once you have it how you like it, it WILL be the fastest desktop you can use with the fastest compile time -- well, WILL should be shall or can. I'm about to turn my old compile PC into a generic x64 Funtoo box (one of my 64's is AMD, the other Intel). A generic build will allow me to use the same base system on both PC's and allow me to rebuild them to they're specific architecture after its all set up. It took me 3 tries to get a good Gentoo box running -- miss one step in that install guide and you can be up that creek.
11 years on Linux now, 9 years with only maybe 25 boots into Windows -- past 10-15 were to flash an sbf and to reboot back to Linux -- so glad I stumbled across the sbf_flash Linux tool. Last time I booted Windows was after installing Win7 and its drivers....seriously, all I've done is installed it and the drivers and haven't booted it up since. I've used Red Had, Fedora, Ubuntu, Arch, Mint, Debian, Suse, Mandrake, Gentoo, Funtoo, Sabiyon, Aptosid, Sidux -- after using all of them, I find that I prefer Debian\based systems (not Ubuntu\based systems -- I actually don't like Ubuntu, well, since 0910 -- it was a good distro up until then imho). And I like Funtoo for the source based distros -- I've messed around with other source based ones (Sorcerer, Arch) and like Futnoo over Gentoo and the rest in the end.
//You might already know enough Linux, I'm just posting what I think is the easiest way to start using and, therefore, leaning Linux.
///I'm also surprised that there isn't an XDA based Linux distro -- designed by XDA members to make it easier to get into Linux\rom hacking
rom compiling with all the tools we all need an apt-get away.
EDIT
I've been meaning to ask, Do any of you programmers have any good books to recommend? I'm finding myself of the border of power user and programmer and need to start learning some code skills to cross over. I'd like to learn something C, Python3, and Java; but there are a ton of books on them and I'd like a recommendation from someone HERE who knows a bit of programming and what they'd use to learn nowadays. I'm sure I'm not the only one with that question either. Something C and Java for Android, Python3 for Linux (maybe Android if that project has gained some ground). Thanks.
/Bolded that so it sticks out.
@skeevy
I use Arch Linux ATM and a love it but yh I have read about gentoo and how you can build it to your system.... Once I get a new PC in the near future hopefully very soon am going to try that and freebsd... Thanks for the advice
Let's Go ^_^
Kayant said:
@skeevy
I use Arch Linux ATM and a love it but yh I have read about gentoo and how you can build it to your system.... Once I get a new PC in the near future hopefully very soon am going to try that and freebsd... Thanks for the advice
Let's Go ^_^
Click to expand...
Click to collapse
Never tried BSD. Arch was OK, but I started on Debian, jumped around different ones for a few years, stuck with Ubuntu 7.10 for 6 months, hated their update, and been on Debian or Mint Debian ever since; testing or Sid usually -- I transcode my DVD's and stable has older codecs . Arch was a year ago for a month -- if I gave it more of a chance I'd probably like it as much as I do Debian. I've used almost all major distros, desktop environments, window managers, etc; but I always find myself back with Debian\XFCE -- it just works for me.
If you didn't know, Debian has a freeBSD based distro as well. That'll make it easy to try out BSD in an Debian style environment.
Hoped I could say the same. School is a real Linux killer.
Even for software that has a linux port, they only give us the installer/license for the Windows version. :/
PLC and robotics software tend to only run on Windows anyhow. As 3D drawing.
Always have the need to change my partition setup Linux-Windows after installing such an application on my laptop.
I am now using Ubuntu for 3 years. I like the look and don't want to spend time on my PC installation so it's good for me . I can imagine that it's different if you really want to get to know Linux or Unix.
What I hear most for learning to program (me not so much) is just try to do what you plan to do with it(an android application, ...) and searching how to get there. Don't know many that read books. Except for guidelines for memory management and security for example later on.
I've been programming for nearly 20 years. Only had a few classes in the basics. The rest has been trial by fire. Use Google a lot to figure out how to do stuff, but I can't really TALK about code as I don't know what to call some of the things I do. I highly recommend taking formal classes and reading books.
Sent from my SPH-L900 using xda premium
I compiled my own kernels on my phone and it's running
ps:My english is not so good:crying:
labsin said:
Hoped I could say the same. School is a real Linux killer.
Even for software that has a linux port, they only give us the installer/license for the Windows version. :/
PLC and robotics software tend to only run on Windows anyhow. As 3D drawing.
Always have the need to change my partition setup Linux-Windows after installing such an application on my laptop.
I am now using Ubuntu for 3 years. I like the look and don't want to spend time on my PC installation so it's good for me . I can imagine that it's different if you really want to get to know Linux or Unix.
What I hear most for learning to program (me not so much) is just try to do what you plan to do with it(an android application, ...) and searching how to get there. Don't know many that read books. Except for guidelines for memory management and security for example later on.
Click to expand...
Click to collapse
That's what I've been doing up until now, but Google only helps so much -- I can do a search on learning Java and come up with 1000's of faqs, guides, ect -- weather its worth reading or full of it is unknown too me since. A good book can be worth its weight in gold. With a bad internet faq, ya might as well change the faq's a to a u and bend over, cause that's what you're doing to yourself by learning from bad sources.
While I don't know what apps you're using, I know that some apps have a license isn't limited to the platform -- the Win License works on Linux\Mac\Unix as well. Or just use the Lin version and not feel guilty since you have the Win license .
Ubuntu was great until it started getting too bloated for my tastes -- and they're XFCE editions usually use much more resources than doing the same thing with Pure Debian installed from the command line up. On compile\dev boxes you want as little running as possible for obvious reasons. Not to mention the UI can greatly change from release to release with Ubuntu. Buntu was my 2nd Linux to run; Debian first -- Learned more on Ubuntu then went back to Debian. Pure Debian can be daunting if its your first distro.
Malcont3nt said:
I've been programming for nearly 20 years. Only had a few classes in the basics. The rest has been trial by fire. Use Google a lot to figure out how to do stuff, but I can't really TALK about code as I don't know what to call some of the things I do. I highly recommend taking formal classes and reading books.
Sent from my SPH-L900 using xda premium
Click to expand...
Click to collapse
Thanks. I'd be taking classes if I could. I don't qualify for any grants and I don't want to go for a loan because of the uncertainty of being able to pay it off.
Something I'm seriously thinking about doing is this -- free online classes from MIT. That has to be good information.
@All
I'm thinking of starting a generic x64 Funtoo box and get it to where XFCE is working, Nvidia graphics (all I buy is Nvidia Cards ), Android SDK is up and running, and all the required scripts, apps, udev rules, etc are already installed set up (repo, sbf_flash, apktool, etc). Then upload that as a zip so all you'd have to do is extract the zip to a blank partition, edit its fstab, update grub, set the build environment variables to your own, reboot, set users\passwords, and recompile the system.
I'm already going to do all of that except for the upload as a zip part -- I have 2 64 bit pc's -- one amd, one intel -- so I have to build it as a generic 64 in order to use the same system on both boxes. I was just wondering if anyone else would be interested in something like that once its all done.
---------- Post added at 09:22 AM ---------- Previous post was at 08:25 AM ----------
I normally don't post my PM's, but the last half on this one I sent out might be useful to some of you looking for the essential git commands
I have a couple of good sites I use for github reference. Here & here
Typing "man git" in the command line has helped me a lot as well. I've learned most of my Linux knowledge by typing "man name_of_program" and Googling what it said that I didn't fully understand -- especially with video encoding, ffmpeg and mplayer are some long reads, so is git. Git also has a "git help name_of_git_command" program that's helpful as well.
There's also a few threads on the Defy forums dedicated to helping out people trying to do exactly what you're wanting to do. The nightly builds link is a really good place to start with -- contains pretty much all you need to know to be able to compile roms. Kayant's an awesome dude and really helpful. His threads are great for users wanting to learn and\or contribute back.
[Guide] Compile your own nightly builds - AOKP, CM10, CM9, CNA, Slim Bean, P.A.C
[Guide] Compiling your own nightly kernels Quark/Blechd0se & Essential Git commands
I learned git from forums like the ones above, those reference sites and man pages\help program. Took about a week of trial and error before I got the hang of it. I still have a hard time remembering to start a branch before editing crap after the initial sync .
Honestly, the hardest thing to do, in regards to PA, is adding in FM. Almost everything else Defy\Bravo related just cherry picks right in with no\ very little and easy to fix conflicts. The FM commits are old and those files have changed a lot from when Quarx & Maniac did the patches -- especially between Quarx's and PA's current.
Cherry picking is pretty easy, navigate to the base directory -- like frameworks/base -- then its "git cherry-pick a_ton_of_hex" and it'll either pick right in or you have conflicts. If I get conflicts, I use the app "git-cola" ran from command line in the /frameworks/base directory; and its a gui app that'll list what files have conflicts (and a lot more) -- I then open up the conflicting file with tkdiff (or whatever diff you like) and fix the conflicts, "git commit -a" (saves changes), and push to github. If you don't get conflicts, just commit and push. Btw, the ton of hex is all the hex code next to the commit on github.com, review.cyanogen-mod.com.
Making changes on your own is done simply be navigaitng to the base directory -- frameworks/base for the android_frameworks_base repo, device/moto/mb520 for the Bravo repo -- and opening a terminal, starting or pointing to a branch (git checkout -b name_of_new_branch is a good command to run before you do anything -- checkout -b n_o_b creates a new branch and places you on it), then do what ever changes you need to do, then do "git commit -a", enter a description, and push. Once you have different brances going, you can use "git checkout name_of_branch" to switch between them. Read up on branching, cause theres a lot to it.
There's a lot of different ways to do git, and my way might not work for you.
Good luck and have fun reading -- you'll be doing a lot of it :silly:

Categories

Resources