4/19/2017 [] 7.1.1 UPDATE [] HTC 10 (msm 8996) [] CPU, VM, RAM, IO "Tune" - HTC 10 ROMs, Kernels, Recoveries, & Other Developm

ORIGINAL THREAD HERE: https://forum.xda-developers.com/axon-7/development/2-15-2017-axon-7-msm-8996-cpu-vm-ram-t3557392
This mod was originally created for the Axon 7, but due to several requests, I've modified a version for the HTC 10, please see below, and post questions or comments in the original thread above. Please state you are a HTC 10 user if you have feedback in that thread, to consolidate user feedback and speed up response time.
Custom tuning for a device is always a necessity. "Canned" settings will get you by, but they are certainly never optimized for a specific device. In fact, Linux typically takes a general approach to find harmonic balance in default settings that will, for the most part, work in an acceptable manner for just about any device. There are a lot of resources available on this device, so we should utilize it in a manner appropriate to squeeze out as much battery life and performance as possible without sacrificing much of those outputs, don't you think? This is going to fix that for you.
Here is what is required of you before you begin:
1. Must be rooted
2. Must have the HTC 10 OR a device running the Snapdragon 820, as this modification is not so much device specific, but hardware specific. The important aspect being the snapdragon 820 and the RAM disk size.
3. Must have write protection disabled. If the HTC 10 requires write protection to be disabled, see the code and instruction below:
Using adb shell:
Code:
adb reboot disemmcwp
Using Linux terminal (from your phone, for example):
Code:
reboot disemmcwp
Let's begin.
Getting right to it, here's what I've done:
- modified parameters of the interactive governor, and quite extensively at that (search some of my threads if you want a little bit of a breakdown of the general approach I take)
- reconfigured input_boost parameters
- reconfigured vm parameters (again, the device has a lot of RAM resource, this will utilize it and give you a far better user experience. Basically, I've adjusted dirty_ratio, dirty_background_ratio, swappiness, and other parameters of the virtual machine.)
- disabled zRAM for 6 GB variants (RAM compression, again, not needed on this device really, this mod will save you CPU cycles and power) this will not apply to HTC 10 users, you will still have zRAM enabled.
- remapped minfree parameters for LMK (low memory killer) again only for 6 GB variants
- Tuned CFQ scheduler for flash storage devices
- Tuned "core_ctl" module (needs kernel support, I recommend freeza's latest version of BeastMode. For those wondering, yes, you can still use this mod with the stock kernel. It won't break anything.) again this will only apply to devices that support core_ctl at the kernel.
In a nutshell, that's what we're looking at here. I can guarantee you this will have a significantly positive impact on your device. Turbo time, homies.
How to install????
Easy. First, the file we are replacing is found in /system/etc... it is the "init.qcom.post_boot.sh" file - this file is basically shell scripts, which are applied at boot via this particular shell file.
All you have to do is download the file to your device, open up a file explorer (must have root capability), navigate to the /system/etc folder with said file explorer, mount your /system as RW (read write), delete your stock "init.qcom.post_boot.sh" file, and replace it with mine.
After you've successfully done this, change the new file's permissions to rw-r--r-- (0644), and then reboot!
Or, if you are brave, you can do it manually via a terminal app and get your fingers wet... if you choose to do that, see below:
Make sure the file is located on the root of your internal sdcard in /sdcard, open your terminal app (again, must have root) and type the following commands, hitting enter after each one (be careful to pay attention to the spacing).
Code:
su
Code:
cd /
Code:
mount -o remount,rw /system
Code:
cd /system/etc
Code:
rm init.qcom.post_boot.sh
Code:
cd /sdcard
Code:
mv init.qcom.post_boot.sh /system/etc
Code:
chmod 0644 /system/etc/init.qcom.post_boot.sh
I don't want credit, don't need you to give or offer donations, this is purely for the community in the spirit of Linux ideology. All I ask is for you to hit the thanks button :good:
That's pretty much it, guys. Enjoy!
DOWNLOAD

warBeard_actual said:
ORIGINAL THREAD HERE: https://forum.xda-developers.com/axon-7/development/2-15-2017-axon-7-msm-8996-cpu-vm-ram-t3557392
Hello everyone, I would like to provide this mod to the HTC 10. If somebody could grab me the STOCK file: init.qcom.post_boot.sh found in /system/etc I will modify it for you guys and post it here with instructions on how to install.
It will provide you a good boost in battery life without sacrificing performance.
Thanks!
Click to expand...
Click to collapse
Thanksss :angel:

I little bit more tuning can't be wrong I guess. Here you go. Just uploaded the respective file needed to do the trick.

5m4r7ph0n36uru said:
I little bit more tuning can't be wrong I guess. Here you go. Just uploaded the respective file needed to do the trick.
Click to expand...
Click to collapse
I'll have this done tomorrow night. Thanks for getting me the file

Hey guys, file is up, with instruction on how to install.
There were actually a lot of typos in the stock file from HTC
I cleaned up the file from redundancy, fixed a few things while adding my modifications to the file. For those wondering, YES the file is supposed to much smaller as a lot of unneeded code was removed that was specific for other SoC's.
Enjoy, feedback is welcome, but I can guarantee your experience will be postive results.

Phone booted, will be testing over the next few days

warBeard_actual said:
Hey guys, file is up, with instruction on how to install.
There were actually a lot of typos in the stock file from HTC
I cleaned up the file from redundancy, fixed a few things while adding my modifications to the file. For those wondering, YES the file is supposed to much smaller as a lot of unneeded code was removed that was specific for other SoC's.
Enjoy, feedback is welcome, but I can guarantee your experience will be postive results.
Click to expand...
Click to collapse
"The file we are replacing is found in /system/etc... it is the "init.qcom.post_boot.sh" file - this file is basically shell scripts, which are applied at boot via this particular shell file" - I could not find this file in /system/etc... Does the type of rom that I'm running matter. currently running ResurrectionRemix 5.8.3 (7.1.2) w/ tabp0le kernel

5m4r7ph0n36uru said:
I little bit more tuning can't be wrong I guess. Here you go. Just uploaded the respective file needed to do the trick.
Click to expand...
Click to collapse
Aloha,
Just to be clear.. So if I download this zip and flash through TWRP I will be on 7.1? I'm currently on stock with Majestic.
Mahalo
Sent from my HTC 10 using XDA-Developers Legacy app

devilman30 said:
Aloha,
Just to be clear.. So if I download this zip and flash through TWRP I will be on 7.1? I'm currently on stock with Majestic.
Mahalo
Sent from my HTC 10 using XDA-Developers Legacy app
Click to expand...
Click to collapse
No
Read the OP

Mike Grace said:
"The file we are replacing is found in /system/etc... it is the "init.qcom.post_boot.sh" file - this file is basically shell scripts, which are applied at boot via this particular shell file" - I could not find this file in /system/etc... Does the type of rom that I'm running matter. currently running ResurrectionRemix 5.8.3 (7.1.2) w/ tabp0le kernel
Click to expand...
Click to collapse
Well, I should have probably told you that CM-based ROMs don't have this file. Lol.
If you are an experienced user, you can add this to init.d

Using this without any problems, on top of ex kernel modifications and using PNP tweak v23. Do all of these play nicely together?
Sent from my HTC 10 using XDA-Developers Legacy app

warBeard_actual said:
Well, I should have probably told you that CM-based ROMs don't have this file. Lol.
If you are an experienced user, you can add this to init.d
Click to expand...
Click to collapse
I'm not an "experienced user" per-say but basically we take your edited init.qcom.post_boot.sh file and move into init.d (I'm on LOS ROM) folder and re-name and set permissions correctly?
I have re-named to 01init.qcom.post_boot
I'll upload a screenshot shortly to show what I have done.
Also, will it matter the kernel and write protection?
I'm assuming that I don't need to bother with it since I was able to move and edit this file?

MrRob0t said:
I'm not an "experienced user" per-say but basically we take your edited init.qcom.post_boot.sh file and move into init.d (I'm on LOS ROM) folder and re-name and set permissions correctly?
I have re-named to 01init.qcom.post_boot
I'll upload a screenshot shortly to show what I have done.
Also, will it matter the kernel and write protection?
I'm assuming that I don't need to bother with it since I was able to move and edit this file?
Click to expand...
Click to collapse
Yep, should be good. Make sure you leave your original stock file in /system/etc however... and line out any conflicting code in that stock file.
init.d loads during boot, as opposed to post boot, so any conflicting code with be overwritten after the .sh file executes (around the time you start seeing your lock screen)

warBeard_actual said:
Yep, should be good. Make sure you leave your original stock file in /system/etc however... and line out any conflicting code in that stock file.
init.d loads during boot, as opposed to post boot, so any conflicting code with be overwritten after the .sh file executes (around the time you start seeing your lock screen)
Click to expand...
Click to collapse
Original stock file. Does that mean the file that you edited or do i need to put the original file that was not edited. Using los based rom so original doesn't exist. Thank you

Mike Grace said:
Original stock file. Does that mean the file that you edited or do i need to put the original file that was not edited. Using los based rom so original doesn't exist. Thank you
Click to expand...
Click to collapse
Using LOS, you're good to go, as the file doesn't exist in /system/etc
Toss it in /system/etc/init.d and remove the .sh extension, good to go.

Delete

Related

Flashing Galaxy S kernel from update.zip : template update.zip

NEWS :
Koush's bmlunlock (a simple IOCTL send to the bml device) is just out and can replace redbend_ua !
http://github.com/CyanogenMod/android_device_samsung_bmlunlock
Hey
Is Flashing from update.zip the new trend ?
'Don't know but here is how you can do it quite easily using this template.
If you target a GT-I9000 on Eclair, you'll need to customize one thing :
In build-update-zip.sh, set DROID_HOME to the source code path for your local Android repository.
If you target another Galaxy S phone or another version of Android, you'll need to adjust ro.hardware and ro.build.id properties accordingly.
This template is done for Linux/Unixes/OSX.
If Linux cost too much for you or your employer, please contribute by sending a .bat equivalent to the .sh
Of course, you also need to put a valid zImage to replace the template's empty zImage
Feel free to adjust to your needs. License is WTFPL
Note : requirement are Java and Android source repo, already build.
Looks awesome!
I have a question though... why do you need to flash the kernel in an update.zip at boot?
As far as I know, the system will read the kernel at boot up time and load it into ram. It won't access the on-disk file again until the next boot. If that is true, then flashing while running should be 100% safe, right?
RyanZA it's an update.zip, not a ramdisk.
The point is getting an easy flashing method, requiring no computer.
And you don't even need to root your phone !
curio, as i see this script is quite simple, so dont u think this all could actually be done on the phone directly? i mean if people cant afford a linux machine...
edit:
sorry for major dumbness, but do you think this could also somehow be used to reflash a nandroid backup?
FadeFx said:
curio, as i see this script is quite simple, so dont u think this all could actually be done on the phone directly? i mean if people cant afford a linux machine...
Click to expand...
Click to collapse
I don't think the signing tool works on android -- maybe it does? Anyway editing scripts on a phone seems a bit silly!
FadeFx said:
curio, as i see this script is quite simple, so dont u think this all could actually be done on the phone directly? i mean if people cant afford a linux machine...
edit:
sorry for major dumbness, but do you think this could also somehow be used to reflash a nandroid backup?
Click to expand...
Click to collapse
Nope actually this is not dumb at all
Yes the flashing part run in updater-script can be started manually.
In the script :
Code:
"redbend_ua", "restore", "zImage", "/dev/block/bml7"
The update.zip presented here mainly targets custom kernel creators in order to give them another way to distribute their work.
This is a working example of how to use redbend_ua programmatically, hopefully it may help new ideas coming. redbend_ua usage is not limited at all to kernel flashing.
PS : you can use this template with windows as well, you'll just need to translate the ulta-basic .sh to a .bat script, or do the signing part manually.
supercurio said:
Hey
If you target a GT-I9000 on Eclair, you'll need to customize one thing :
In build-update-zip.sh, set DROID_HOME to the source code path for your local Android repository.
Click to expand...
Click to collapse
quick question, the build-update-zip.sh is not a must if i only want to flash zImage, rite?
looks like that, I need to modify updater-script (if needed), as well as putting a zImage into ur zip file, and finally remove the build-update-zip.sh from ur zip attached
then, ur zip file can be used for flashing
is it correct?
thx
So this will let people flash any rom from an update.zip (once the ROM makers take this into account) via RomManager without ever having to use Odin to get off stock?
Awesome!
Thanks for the update script curio! this looks great.
One quick question - ive noticed several update.zip scripts for the galaxy S
have update-binary included.
Does anyone know what that does?? where did you get yours?
ive had success in using update.zips without that file at all.
Could anyone post information on what that binary is/does?
supercurio said:
Hey
Is Flashing from update.zip the new trend ?
'Don't know but here is how you can do it quite easily using this template.
If you target a GT-I9000 on Eclair, you'll need to customize one thing :
In build-update-zip.sh, set DROID_HOME to the source code path for your local Android repository.
If you target another Galaxy S phone or another version of Android, you'll need to adjust ro.hardware and ro.build.id properties accordingly.
This template is done for Linux/Unixes/OSX.
If Linux cost too much for you or your employer, please contribute by sending a .bat equivalent to the .sh
Of course, you also need to put a valid zImage to replace the template's empty zImage
Feel free to adjust to your needs. License is BSD anyway.
Note : requirement are Java and Android source repo, already build.
I'll add some documentation later.
Click to expand...
Click to collapse
dseo80 said:
Thanks for the update script curio! this looks great.
One quick question - ive noticed several update.zip scripts for the galaxy S
have update-binary included.
Does anyone know what that does?? where did you get yours?
ive had success in using update.zips without that file at all.
Could anyone post information on what that binary is/does?
Click to expand...
Click to collapse
Thats for the updater-script i believe. In most cases, theres a update-script in the zip's as well and the recovery picks that up in which case it doesn't need the binary and hence works.
Okay !
Answers hour
ykk_five said:
quick question, the build-update-zip.sh is not a must if i only want to flash zImage, rite?
looks like that, I need to modify updater-script (if needed), as well as putting a zImage into ur zip file, and finally remove the build-update-zip.sh from ur zip attached
then, ur zip file can be used for flashing
Click to expand...
Click to collapse
When you run ./build-update-zip.sh,
- it produce a temp zip file containing appropriate files in it.
- then there'is the signature part, building another .zip, ready to be used.
- this "final" update.zip is put in the same current directory and you can use it as it is.
No further complication
Brantyr said:
So this will let people flash any rom from an update.zip (once the ROM makers take this into account) via RomManager without ever having to use Odin to get off stock?
Awesome!
Click to expand...
Click to collapse
Yes, to flash a complete ROM (several partitions) one more thing is needed.
On command line, redbend_ua accept only one command.
In order to run several commands successively (ie flash multiple partition like Odin does), you'll need to write them in a file.
The file /cache/ota/command should do the trick, but it's untested right now.
There may be other method to prevent rebooting after flashing (hacking the redbend_ua binary, finding the appropriate command line option or removing the reboot command temporary)
dseo80 said:
Thanks for the update script curio! this looks great.
One quick question - ive noticed several update.zip scripts for the galaxy S
have update-binary included.
Does anyone know what that does?? where did you get yours?
ive had success in using update.zips without that file at all.
Could anyone post information on what that binary is/does?
Click to expand...
Click to collapse
Right, many update.zip done today are made without knowing anything about how it really works
I studied a bit before creating mine, here is a walk-through this fairly undocumented process :
- recovery mounts /sdcard/
- recovery search for a default file named : META-INF/com/google/android/update-binary in the zip and runs it : see the source in bootable/recovery/install.c
- update-binary is actually updater in sources
- updater looks into the zip file to the script file named updater-script, update-script is obsolete
- updater then runs the commands listed in updater-script : here is the list of commands.
- then reboot
The only documentation I know for this command is the recovery/updater/install.c file itself
supercurio said:
When you run ./build-update-zip.sh,
- it produce a temp zip file containing appropriate files in it.
- then there'is the signature part, building another .zip, ready to be used.
- this "final" update.zip is put in the same current directory and you can use it as it is.
Click to expand...
Click to collapse
ok,thx
but one more thing i want to know is, u said the path must be changed to the android repo, so do u mean the source code for the kernel like linux-xxx-2.xxx dir?
Thx
@ykk_five
Content of build-update-zip.sh v1 :
Code:
#!/bin/sh
DROID_HOME="/home/curio/dev/mydroid"
zip -r /tmp/update.zip META-INF/ redbend_ua zImage
java -jar \
$DROID_HOME/out/host/linux-x86/framework/signapk.jar \
$DROID_HOME/build/target/product/security/testkey.x509.pem \
$DROID_HOME/build/target/product/security/testkey.pk8 \
/tmp/update.zip update.zip
rm /tmp/update.zip
adb push update.zip /sdcard/
DROID_HOME="/home/curio/dev/mydroid" : you set here the directory of your Android AOSP directory.
See : http://source.android.com/source/download.html
Create an empty directory to hold your working files:
$ mkdir mydroid
$ cd mydroid
Run "repo init" to bring down the latest version of Repo with all its most recent bug fixes. You must specify a URL for the manifest:
$ repo init -u git://android.git.kernel.org/platform/manifest.git
* If you would like to check out a branch other than "master", specify it with -b, like:
$ repo init -u git://android.git.kernel.org/platform/manifest.git -b cupcake
Click to expand...
Click to collapse
This is this mydroid directory
The one that contains Android git source home directory, and compiled files in the out/ subdir
many thx for ur detailed explanation, supercurio!
Thanks curio,
very helpful explanation!
Thanks supercurio for the template!
However, there is no need to spend many hours (depending on hardware and bandwidth) pulling down 100s of megabytes of source and compiling it all if all you want is to sign an update.zip with test keys (if you already have the zImage)!
Just google around for "signapk.jar test keys" and you will get there.
BTW: I know that koush, leshak and wesgamer have Samsung Galaxy S trees up at Github but are they fully merged with AOSP yet?
I'm planning to go build my own kernel for this beast to try to solve the mono FM radio mystery, but last time I checked around it was said that the SGS tree required the use of a custom toolchain to get it to work at all.
Any comments on this?
Hey miki4242 !
Good to know that signapk.jar doesn't require hundred of megs of dependencies
About toolchain, you can use the one indicated by Samsung (CodeSourcery) but you'll face the big and ugly WakeLag.
I recommend you crosstool-ng or buildroot to build toolchains, with gcc 4.3.x march=arm mcpu=cortex-a8 mtune=cortex-a8 (no 4.4.x with march=armv7-v)
The building tutorial will be a part of the documentation I'll publish with my lagfix opensource release
Right now these info are too hard to find.
PS : I send you a mail with attached .config for ct-ng !
supercurio said:
Hey miki4242 !
Good to know that signapk.jar doesn't require hundred of megs of dependencies
Click to expand...
Click to collapse
supercurio said:
PS : I send you a mail with attached .config for ct-ng !
Click to expand...
Click to collapse
Thanks for the info !
Sorry for my ignorance, but does this mean someone can package Froyo in an update.zip and we could update it directly on our phone without needing Samsung Kies or Odin?
@supercurio:
Thanks for this well working template.
In updater-script:
Code:
line 17: package_extract_dir("zImage", "zImage");
should be
Code:
package_extract_file("zImage", "zImage");
But it did work with package_extract_dir, for some reason, too.
Btw, could you send me the config for ct-ng ?
I'm also struggling with this wakelag.

[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.

[GUIDE] How to build kernel from source

Overview
Here are the steps to build your own kernel from source. This example does nothing special. It just shows you how to build the stock kernel. It is a good starting point to making your own stuff. Experts, please correct me where I am wrong. This stuff is still new to me also.
These instructions work for both T989 (T-Mobile) and I727 (AT&T) variants of the Samsung Galaxy S2 phones.
Special Thanks
Special thanks to "interloper" and "dtm_stretch" for helping me learn all of this. Couldn't have done it without them.
Requirements
I am using Ubuntu 10.10 32-bit to do all my builds
Instructions
1) Get Samsung Source Code
First you need to get a copy of the kernel source code from Samsung. You can download it from the link below.
For T-Mobile users download the one that says T989:
https://opensource.samsung.com/reception/receptionSub.do?method=search&searchValue=SGH-T989
For AT&T users download the one that says SGH-I727:
https://opensource.samsung.com/reception/receptionSub.do?method=search&searchValue=SGH-I727
2) Unzip Samsung Source Code
Unzip the source code you just download with this command:
For T989:
Code:
unzip SGH-T989_GB_Opensource.zip
For I727:
Code:
unzip SGH-I727_ATT_Opensource.zip
There will be 4 files extracted. The one we are interested in for this exercise is SGH-T989_Kernel.tar.gz for T989 devicees or SGH-I727_ATT_Kernel.tar.gz for I727 devices.
3) Extract Kernel
Next we need to extract the kernel into a directory.
For T989:
Code:
mkdir kernel
tar xzf SGH-T989_Kernel.tar.gz -C kernel
or
For I727:
Code:
mkdir kernel
tar xzf SGH-I727_ATT_Kernel.tar.gz -C kernel
4) Get a Copy of initramfs
Next you need to get a copy of the initramfs for your phone. For T989 users you can get the stock initramfs from bubby323's github here: https://github.com/bubby323/anomaly_kernel_platform_SGH-T989
For I727 users you must use the alternate method below to get the initramfs. T989 users can choose to use the link above or go with the alternate method below.
Alternate method:
You can extract it yourself from an existing boot.img file. I got mine off of my phone using clockworkmod backup (boot.img file) and using the extractboot tool to extract the initramfs. The tool can be downloaded here: http://www.mediafire.com/?lc12eceeh617b97
Extract extractboot.tar.gz
Code:
tar xzf extractboot.tar.gz
Call this to extract your boot.img to get the initramfs folder
Code:
extractboot boot.img
If you get any errors with calling extractboot, make sure "extractboot" and "split_bootimg.pl" are executable first. If not, use "chmod a+x extractboot" (do the same for split_bootimg.pl).
Once extracted, the "out/ramdisk" folder is your extracted initramfs folder.
reference: http://www.freeyourandroid.com/guide/extract-edit-repack-boot-img-windows
5) Download Arm Toolchain
This toolchain will allow you to cross compile for your phone. There are several versions to choose. I currently use the 2010q1 version here: https://sourcery.mentor.com/sgpp/li...1-188-arm-none-eabi-i686-pc-linux-gnu.tar.bz2
Or choose another version if you like (version 2009q3 seems to be popular): https://sourcery.mentor.com/sgpp/lite/arm/portal/subscription3053
6) Extract Toolchain
Code:
tar xjf arm-2010q1-188-arm-none-eabi-i686-pc-linux-gnu.tar.bz2
7) Download mkbootimg Tools
Download mkbootimg tools from here: http://www.mediafire.com/?w06d1m6n1dgo4op
Extract the file with
Code:
tar xzf mkboottools.tar.gz
There will be three files
Code:
mkbootfs
mkbootimg
mkbootimg-sg2x
"mkbootimg" is the original program to make the boot image but is not used for our phone. Our phone requires an edit to the ramdisk address which is why I also included "mkbootimg-sg2x" which we will use instead.
*Extra Info: the default ramdisk offset is 0x01000000 while our phone needs 0x01400000.
Move the three files to somewhere in your system PATH.
8) Compile Script
Now we are ready to compile the kernel. I have provided a script below to automate the process. You will need to change the paths to work with your environment.
*For I727 users only: change "msm8660_celox_usa_tmo_defconfig" to "msm8660_celox_usa_att_defconfig" in the script below.
*Update: Thanks to InstigatorX for his comment:
Also, for ATT the celox make command should be "make msm8660_celox_usa_att_rev02_defconfig" to make the latest 2.3.6 kernel.
Click to expand...
Click to collapse
Code:
INITRAMFSDIR=~/t989/initramfs
export ARCH=arm
export CROSS_COMPILE=~/arm-2010q1/bin/arm-none-eabi-
cd kernel
make clean
make mrproper
make msm8660_celox_usa_tmo_defconfig
make -j4
# copy the freshly compiled modules to the initramfs.
cp crypto/ansi_cprng.ko $INITRAMFSDIR/lib/modules/
cp drivers/bluetooth/bthid/bthid.ko $INITRAMFSDIR/lib/modules/
cp arch/arm/common/cpaccess.ko $INITRAMFSDIR/lib/modules/
cp arch/arm/mach-msm/dal_remotetest.ko $INITRAMFSDIR/lib/modules/
cp drivers/net/wireless/bcm4330/dhd.ko $INITRAMFSDIR/lib/modules/
cp arch/arm/mach-msm/dma_test.ko $INITRAMFSDIR/lib/modules/
cp drivers/input/evbug.ko $INITRAMFSDIR/lib/modules/
cp drivers/media/video/gspca/gspca_main.ko $INITRAMFSDIR/lib/modules/
cp arch/arm/perfmon/ksapi.ko $INITRAMFSDIR/lib/modules/
cp drivers/video/backlight/lcd.ko $INITRAMFSDIR/lib/modules/
cp drivers/net/wireless/libra/librasdioif.ko $INITRAMFSDIR/lib/modules/
cp drivers/misc/msm_tsif.ko $INITRAMFSDIR/lib/modules/
cp arch/arm/oprofile/oprofile.ko $INITRAMFSDIR/lib/modules/
cp drivers/crypto/msm/qcedev.ko $INITRAMFSDIR/lib/modules/
cp drivers/crypto/msm/qce.ko $INITRAMFSDIR/lib/modules/
cp drivers/crypto/msm/qcrypto.ko $INITRAMFSDIR/lib/modules/
cp drivers/scsi/scsi_wait_scan.ko $INITRAMFSDIR/lib/modules/
cp drivers/spi/spidev.ko $INITRAMFSDIR/lib/modules/
cp drivers/misc/tsif_chrdev.ko $INITRAMFSDIR/lib/modules/
cp drivers/misc/vibetonz/vibrator.ko $INITRAMFSDIR/lib/modules/
9) Get Compiled Kernel
The compiled kernel image is in the kernel source folder under "arch/arm/boot/zImage"
Copy the zImage file to a working area, preferably where you keep your initramfs folder.
Here is an example folder structure:
Code:
work
- zImage
- initramfs
10) Make boot.img File
Next we need to merge the kernel and initramfs directory into a boot.img file.
zip up ramdisk
Code:
mkbootfs initramfs | gzip > ramdisk.gz
make boot image
Code:
mkbootimg-sg2x --kernel zImage --ramdisk ramdisk.gz --cmdline "androidboot.hardware=qcom msm_watchdog.appsbark=0 msm_watchdog.enable=1 loglevel=4" -o boot.img --base 0x40400000 --pagesize 2048
11) tar boot.img
Tar your boot.img file so it can be flashed with Odin.
Code:
tar cvf MyKernel.tar boot.img
md5sum -t MyKernel.tar >> MyKernel.tar
mv MyKernel.tar MyKernel.tar.md5
12) Flash with Odin
Flash MyKernel.tar.md5 with odin under PDA. Please follow the flashing guides found in other posts. They do a better job at explaining.
13) Experiment *
Now try to customize your kernel to add in new features and experiment. I am going to learn how to compile the stock platform also. Once I know how I will post up a guide for that also. If someone already has a guide to build the platform please post. Also it would be great if you can post sources for me to read so I can learn how to build the platform. Thanks.
Optional
You might notice that the modules you compiled are significantly bigger than the original stock modules that came with the phone. That is because the stock modules were stripped of all debug info. To do this you need to run the below command at the end to get the "stripped" modules. Change INSTALL_MOD_PATH to point to any folder you like to hold the modules. You then need to copy these modules instead of the ones in the build script above.
Code:
make INSTALL_MOD_STRIP=1 INSTALL_MOD_PATH=~/stripped/modules modules_install
What's Next?
Go here to learn how to start making changes to your ROM: http://forum.xda-developers.com/showthread.php?p=23343879
Good heads up. Thanks for putting this out there.
Once edited this needs to get stuckod
Sent from my SGH-T989 using xda premium
Thanks so much for this! I've been trying to figure this out for months. (Learned alot in that time).
Kernel Built!
Daunting....ill stick to this side of the fence
Thanks though. Must be tough explaining all of that...
Sent from my Phablet. The Purple Phone Tablet.
Great info !! Super !
Some questions: 1. How does one allow for SELECTION of custom boot animation? Is that a kernel thing or some thing else?
2. What about adding things like Voodoo Sound or some mod like that?
Thanks for any info !!
chappatti said:
Great info !! Super !
Some questions: 1. How does one allow for SELECTION of custom boot animation? Is that a kernel thing or some thing else?
2. What about adding things like Voodoo Sound or some mod like that?
Thanks for any info !!
Click to expand...
Click to collapse
I am glad you like it. I wanted to post this guide up so that noobs like me have a good starting point to learn this stuff.
I can take a crack at answering your questions, but do note that I am also a noob:
1) I would think a custom boot animation would be part of the ROM but not sure
2) I do not know what Voodoo Sound is but if it is an application then it would be modifying the ROM. If it is an enhancement to the audio drivers then it is kernel. Either way I would not know what to change. Sorrry.
I know I wasn't much help. But I tried
By the way, I am currently trying to learn how to make my own custom ROM. If you know of any guides that would be great if you can post them here. I will definitely post what I find. Currently I am downloading ROMs from this forum and seeing what they did to learn. One thing I am still confused about is if these guys built these ROM from source or used the binaries from the Stock ROM as base.
Thanks.
Nice Guide man...
datzstr8 said:
I am glad you like it. I wanted to post this guide up so that noobs like me have a good starting point to learn this stuff.
I can take a crack at answering your questions, but do note that I am also a noob:
1) I would think a custom boot animation would be part of the ROM but not sure
2) I do not know what Voodoo Sound is but if it is an application then it would be modifying the ROM. If it is an enhancement to the audio drivers then it is kernel. Either way I would not know what to change. Sorrry.
I know I wasn't much help. But I tried
By the way, I am currently trying to learn how to make my own custom ROM. If you know of any guides that would be great if you can post them here. I will definitely post what I find. Currently I am downloading ROMs from this forum and seeing what they did to learn. One thing I am still confused about is if these guys built these ROM from source or used the binaries from the Stock ROM as base.
Thanks.
Click to expand...
Click to collapse
Roms such as AOKP or CM are compiled from source, otherwise known as AOSP. However, the majority of the roms you'll find here are not. To build a non-source rom a good starting point would be a system dump from your own phone, or find a pre-deodexed, stock base rom. From there, the tool of the trade is 7zip. View all the file via 7zip, pull files and modify. Now obviously, this is only a starting point, couldn't possibly go into advanced development with you. It takes time to learn and it's a lot of trial and error. Another helpful tool to learn is ADB commands and functionality. If you know this, it will save you a lot of time. Good luck!
This guide is a life-saver. I have compiled my own kernel for my desktop literally dozens of times, and have built distributions entirely from scratch two or three times (using Linux From Scratch), but was unable to figure this out myself due to the lack of a guide and things being scattered everywhere and people unwilling to help.
THANK YOU!!!!
I am really looking forward to your guide on how to build an Android system from scratch. I have also been trying to do this as well (Cyanogen), but am running into the same lack of information.
sombionix said:
Roms such as AOKP or CM are compiled from source, otherwise known as AOSP. However, the majority of the roms you'll find here are not. To build a non-source rom a good starting point would be a system dump from your own phone, or find a pre-deodexed, stock base rom. From there, the tool of the trade is 7zip. View all the file via 7zip, pull files and modify. Now obviously, this is only a starting point, couldn't possibly go into advanced development with you. It takes time to learn and it's a lot of trial and error. Another helpful tool to learn is ADB commands and functionality. If you know this, it will save you a lot of time. Good luck!
Click to expand...
Click to collapse
So Som,
When are we going to see another nice Bionix build from you. anything in plan or not really.
An automation script would be a juicy treat and i may have just the thing...will need to be modified for this and tested but tomorrow (today, oh look at the time) i can put it together. Also, try building using make gconfig. Load your default config with the gui and you can see what bits of the kernel can be changed.
Sent from my SPH-D710 using xda premium
Very nice guide! Thanks a lot!
I wondering about what is the difference between Hercules and Skyrocket sources? Is it only this "*For I727 users only: change "msm8660_celox_usa_tmo_defconfig" to "msm8660_celox_usa_att_defconfig" in the script below." ?
erickwill said:
Very nice guide! Thanks a lot!
I wondering about what is the difference between Hercules and Skyrocket sources? Is it only this "*For I727 users only: change "msm8660_celox_usa_tmo_defconfig" to "msm8660_celox_usa_att_defconfig" in the script below." ?
Click to expand...
Click to collapse
You will still need the proper source for i727. Config file just tells the compiler what to build.
:: LOVE MY HATERS :: DARKSIDE ::
These instructions assume the user already has the boot.img tools, bubby's initramfs and source code from the OP
1. Create a directory called t989-kernel
2. Download this package of tool chains and unzip it, making sure it is named "toolchains" toolchains
NOTE: There are many toolchains included in this pack and I have used them all to make kernel for the E4GT and they are all
sufficient for this task. However, should you move on to 3.X kernel I suggest using the Mjolnar or Linaro tools as they
are more suitable for that version.
3. Inside the "t989" directory deposit bubby's initramfs, the kernel source (extracted directory), toolchains and boot.img tools.
4. The names of the directories must be "ramdisk", "kernel" (kernel source), "toolchain", and "bin". Change them accordingly.
5. Put the attached "tmo-build.sh" into the "kernel" directory
6. Edit line 9 to reflect you version number and name. It will be what you see when you look at the phone properties
7. Change line 20 of the script to reflect your machine's name
8. cd into "kernel"
9. Type "./tmo-build.sh" and watch the magic as your kernel is made right before your eyes!
10. Go to "kernel_tmp/out" and get your shiny new homemade kernel complete with custom recovery and all the fixins'
NOTE: You can change line 41 to say "make gconfig" if you have GTK2 installed on your system. This will allow you to launch a GUI
through the script to make changes in a visual manner. If you get any "file not found" or "no such file" etc, make sure the
permissions are set to executable for all directories/files.
I'm still working on the error logging output so I will post an updated script as soon as it's ready. For the i727 users I will post a script for you too, but to make this work for you all you need to do is choose the make gconfig route and load your def_config from /arch/arm/configs/
Enjoy the silence!
interloper, thanks for the great script!!! This will help a lot of people.
afawzi said:
So Som,
When are we going to see another nice Bionix build from you. anything in plan or not really.
Click to expand...
Click to collapse
+1
From a galaxy better than yours.
I am starting another GUIDE post on how to modify your ROM here: http://forum.xda-developers.com/showthread.php?p=23343879
Sweet guide. Worked great. Only thing I had issue with was Haptic feedback and WiFi wouldn't work. Any ideas? I'm on the SkyRocket.
Also, for ATT the celox make command should be "make msm8660_celox_usa_att_rev02_defconfig" to make the latest 2.3.6 kernel.
how do you make it cwm flashable?

FEB-9-15 [] Post_boot tweaks - An *interactive* boost

Drop this file in your /system/etc folder, replacing the stock one. Cleaned up, and modified to work with a stock kernel or lean kernel.
Please open up the file, and read some of the notes I added, so you know what this does and how to change it if you so desire. It is very basic and straightforward.
Also, please remember one thing, if you want to go to the stock kernel, simply change any words in the scripts from "interactiveX" to "interactive".
Recommended lean kernel 3.16 with these scripts.
Designed to work with ALL Galaxy Note 3's running touch wiz 4.4.2 ROMs and running lean kernel or stock kernel. Other kernels are not guaranteed due to the voltages applied.
This will make a huge difference in performance and battery. Been using this (developed by me) for a long time now.
Summary:
*I/O optimization
*tuned interactive parameters
*fixed sysfs permissions for cpu's (root now has full control of sysfs tuneables)
*GPU sysfs identified for user to customize
*screen off frequency set to 1.2 GHz (can be changed by user)
*custom voltage set for bin 2 device. (Read instructions within file to adjust for others bins accordingly)
*custom mpdecision tuning and other relevant instruction regarding mpdecision binary
*general CPU tweaks for better performance, responsiveness and battery life (yes all 3 can be achieved, and are)
Again, open the file with a file explorer (or notepad+ in windows). Read it, understand it, adjust what you want, or leave it be. These settings are very much dialed in for the interactiveX governor of LK. It won't get much better. I'd say take a look at the voltage portion and mpdecision for now (found at the end).
Once more, drop file into the /system/etc directory... Replace the existing one, and reboot.
FILE DOWNLOAD
Updated today... many useful changes, and fixes (set up for stock kernel for now)
https://www.dropbox.com/s/tjlygujptls3lks/init.qcom.post_boot.sh?dl=0
Reserved for any common questions, or general information.
red_can_soda said:
Reserved for any common questions, or general information.
Click to expand...
Click to collapse
Nice bud, I'll have to see if it works on Lollipop TW
Using it in pvs bin 0 lol
So far so good. Make sure to set permissions to 755
i'll have to see if theres a difference between replacing the current file.... or firing it off in init.d
kevp75 said:
i'll have to see if theres a difference between replacing the current file.... or firing it off in init.d
Click to expand...
Click to collapse
Needs to be done post boot, otherwise the stock "post_boot" file does what it does post boot. Make sense?
Init.d executes earlier in the boot sequence. Therefore, some of the parameters will be overridden.
red_can_soda said:
Needs to be done post boot, otherwise the stock "post_boot" file does what it does post boot. Make sense?
Init.d executes earlier in the boot sequence. Therefore, some of the parameters will be overridden.
Click to expand...
Click to collapse
ehh but those if us who need a hack for init.d runparts inside this script (u have it in yours as well)
i have it in my init.d and it appears (notice the appears) to be working.
Im definately noticing a bit more responsiveness... as well I toned down the screen off max freq a bit and am getting pretty decent battery life.
kevp75 said:
ehh but those if us who need a hack for init.d runparts inside this script (u have it in yours as well)
i have it in my init.d and it appears (notice the appears) to be working.
Im definately noticing a bit more responsiveness... as well I toned down the screen off max freq a bit and am getting pretty decent battery life.
Click to expand...
Click to collapse
Forgot I had that there... Lol. Threw that in a while back so init.d would operate with a 100% stock boot.img
@kvp75, can I drop this into Phoenix Rom?
Chefedogg said:
@kvp75, can I drop this into Phoenix Rom?
Click to expand...
Click to collapse
It will work with any galaxy note 3 using Qualcomm hardware.
Chefedogg said:
@kvp75, can I drop this into Phoenix Rom?
Click to expand...
Click to collapse
shuld be able to... but dont really need to. phoenix has cpuntweaking built intobthe settings doesnt it?
sry been workin on DomPop
red_can_soda said:
Drop this file in your /system/etc folder, replacing the stock one.....
Click to expand...
Click to collapse
Lmao....Cob
kevp75 said:
shuld be able to... but dont really need to. phoenix has cpuntweaking built intobthe settings doesnt it?
sry been workin on DomPop
Click to expand...
Click to collapse
All good, I went ahead and did it anyway, it's def making a difference, battery life was not great but now it's better! Thanks for all the hard work guys, keep it up! I'll reflash DomPop again soon, it was unstable for me but Phoenix has been great
This activated all cores and set to performance... when i selected interactive the min value was 422... Am I doing something wrong? Everything stock and rooted 442
Edit. .. Ok I changed from interactivex to interactive and that fixed gov problem but all cores activated and min set to 422... Is that right?
Yes, minimum is 422 MHz because the l2 cache is bumped into action at that speed (as opposed to not being so at 300) and the voltage is the same.
In short, 300 is no5 used because 422 is faster, and without the extra hit on battery
Will this work with 4.4.4 w/o any issues? Been thinking on trying it on but I don't want it to mess anything and re-install stuff.
d-wad,
I cannot give you a definite answer there, as I have not yet looked at anything in 4.4.4.
If you can provide me a copy of the post_boot file for 4.4.4, I can take a look at it and see. I can't imagine why anything would have changed in this file, but you never know. All it takes is one line of code to cause something to go a little wonky for you.
Thanks, and just shoot me a PM.
Just giving you all a heads up.... I think there may have been a few errors in the stock init.qcom.post_boot file (they are human too, remember).
I am testing a few small changes to certain lines in the "factory" script to make sure. A brief explanation of it is that there are certain lines I removed from the one you all are using right now, and I did so because the file paths being called out did not exist!
However, I was going over this again tonight, getting ready for the official LP release and decided to review this odd discrepancy one more time. After doing some digging, I found that the file that some of those values were intended to be written to, were actually somewhere else!
Doh! - Sammy/QC. It is very possible that this location changed from a previous design or fs structure and somebody simply forgot to modify the script. Very interesting indeed.
Anyways, after I run this for a couple of days and do a little bit more investigating, I'll post the updated script for all of you.
Updated file and link... I recommend using this file or implementing these items into your current set up. Many of the changes are critical errors existing in the stock post_boot file, or simple optimization enhancements for our devices.
How to revert?
Sorry... TOTAL NOOB here...Do I just copy the orig file somewhere else, and drop this in place as you instruct? ( may have answered my own Q)
Seems a wise precaution.
I am running effortless rom rev 8 (lovin it too)

Need help compiling sedikernel (or any kernel)

Hello,
In order to debug the bluetooth problem, I'm trying to compile a kernel for the Captivate Glide. I can't get it to boot properly.
@steadfasterX 's SediROM is the highest-version ROM I know of on which bluetooth works so I've got it installed (version 2.1.2) on the phone.
The steps I've taken so far:
1. I have sedikernel from https://github.com/steadfasterX/kernel_samsung_i927 at commit 088aa4109ad144c583f32da5ffba7bac200f0575
2. I copied /proc/config.gz from a running phone, which contains CONFIG_LOCALVERSION="-sediKERNEL-v1.0", ungzipped it and saved it as .config . Haven't changed anything in it yet.
3. I ran `make CROSS_COMPILE=arm-linux-gnueabihf- zImage` (also tried arm-none-eabi- (both from Debian Jessie) as well as ~/Android/Sdk/ndk-bundle/toolchains/arm-linux-androideabi-4.9/prebuilt/linux-x86_64/bin/arm-linux-androideabi- from the NDK)
4. I also made a TWRP backup of the boot partition, and used split_bootimg.pl from William Enck to split it into a kernel and initrd
5. I then ran mkbootimg with the initrd extracted in step 4 and the kernel obtained in step 3 in arch/arm/boot/zImage
6. Finally I flashed this new boot.img onto the phone with odin (Heimdall, specifically)
I see the white "SAMSUNG" logo (which is normal when booting) with a yellow-triangle with an exclamation mark in it. No further boot stage happens (no bootanim from sediROM). If I re-pack the original kernel with bootimg and flash that via odin, then after the next boot the yellow triangle changes into a blue one and sediROM boots correctly.
I'm a bit stuck at the moment, not sure what's going wrong there. Probably the kernel panics for some reason. Is there a way to read the kernel boot messages before android starts? Any help would be greatly appreciated.
Thanks!
Successful!
Thanks to a lot of help from @steadfasterX on IRC I finally managed to compile a working kernel
Here's a list of steps I had to follow in addition to https://github.com/steadfasterX/android_device_samsung_i927/blob/sediROM_CM-ICS/README.md :
1. as discussed on IRC, `repo sync` was not finding a branch. Needed to add
Code:
revision="refs/heads/ics-release"
in .repo/manifests/default.xml in the line with
Code:
CyanogenMod/android_vendor_qcom_opensource_v8
2. I removed the spurious comma in device/samsung/i927/cm.dependencies
3. In device/samsung/i927/, I changed vendorsetup.sh to point to vendorsetup.sh.nopatching rather than .patching (none of the patches could be applied)
4. lunch target was therefore the one with -eng, not -userdebug
5. I installed java 6 manually (didn't have sudo)
6. I installed schedtool
7. I adjusted the path to Java and my toolchain in build_sediROM.sh (taken from https://github.com/steadfasterX/android_buildtools )
8. I downgraded GNU make from 4.0 to 3.81
9. I installed linux-headers and created a symlink from /usr/include/asm-generic to /usr/include/asm
10. I changed the toolchain prefixes in device/samsung/i927/BoardConfig.mk to have 4.4.3 rather than 4.7
11. I built with
Code:
BUILDID=samsung/i927 LOKIFY=0 ../android_buildtools/build_sediROM.sh bootimage
12. I used the original ramdisk I had extracted from sediROM's boot image, rather than the one that was built (we discussed this on IRC too)
This got me a working kernel, yay
uukgoblin said:
Thanks to a lot of help from @steadfasterX on IRC I finally managed to compile a working kernel
Here's a list of steps I had to follow in addition to https://github.com/steadfasterX/android_device_samsung_i927/blob/sediROM_CM-ICS/README.md :
1. as discussed on IRC, `repo sync` was not finding a branch. Needed to add
Code:
revision="refs/heads/ics-release"
in .repo/manifests/default.xml in the line with
Code:
CyanogenMod/android_vendor_qcom_opensource_v8
2. I removed the spurious comma in device/samsung/i927/cm.dependencies
3. In device/samsung/i927/, I changed vendorsetup.sh to point to vendorsetup.sh.nopatching rather than .patching (none of the patches could be applied)
4. lunch target was therefore the one with -eng, not -userdebug
5. I installed java 6 manually (didn't have sudo)
6. I installed schedtool
7. I adjusted the path to Java and my toolchain in build_sediROM.sh (taken from https://github.com/steadfasterX/android_buildtools )
8. I downgraded GNU make from 4.0 to 3.81
9. I installed linux-headers and created a symlink from /usr/include/asm-generic to /usr/include/asm
10. I changed the toolchain prefixes in device/samsung/i927/BoardConfig.mk to have 4.4.3 rather than 4.7
11. I built with
Code:
BUILDID=samsung/i927 LOKIFY=0 ../android_buildtools/build_sediROM.sh bootimage
12. I used the original ramdisk I had extracted from sediROM's boot image, rather than the one that was built (we discussed this on IRC too)
This got me a working kernel, yay
Click to expand...
Click to collapse
its really long guide. You have to replace kernel modules, wifi wouldnt work without modules.
Imho best is compile kernel, modules, replace zImage + modules in this
file and flash from recovery. You dont need to compile whole android just the kernel, you dont need java and other special things, this method is much more faster.
bubor said:
its really long guide. You have to replace kernel modules, wifi wouldnt work without modules.
Imho best is compile kernel, modules, replace zImage + modules in this
file and flash from recovery. You dont need to compile whole android just the kernel, you dont need java and other special things, this method is much more faster.
Click to expand...
Click to collapse
You are right for the kernel but we discussed on IRC to build ram disk too then you need all that stuff but most important he wants to build CM too.
However I'm always a fan of making it right so building a ram disk is the correct way of creating a bootimage. But to start its ok replacing kernel and modules first.
.
Sent from my LG-H815 using XDA Labs
steadfasterX said:
Sent from my LG-H815 using XDA Labs
Click to expand...
Click to collapse
correct way is rebuild whole android, and reflash everything, wipe data/cache
You dont want to make new ramdisk without replace system. System and ramdisk bound together.
I hope you find something, and fix bluetooth or voip audio.
good luck
bubor said:
correct way is rebuild whole android, and reflash everything, wipe data/cache
You dont want to make new ramdisk without replace system. System and ramdisk bound together.
I hope you find something, and fix bluetooth or voip audio.
good luck
Click to expand...
Click to collapse
Well no and yes. I build kernels including ram disk without building system. This is not necessary as long both are compatible.
But you are right that booting fails when system and ram disk are not compatible so the correct way depends
However @uukgoblin I hope you get the fix you want :fingers-crossed:
Sent from my LG-H815 using XDA Labs
steadfasterX said:
Well no and yes. I build kernels including ram disk without building system. This is not necessary as long both are compatible.
But you are right that booting fails when system and ram disk are not compatible so the correct way depends
However @uukgoblin I hope you get the fix you want :fingers-crossed:
Sent from my LG-H815 using XDA Labs
Click to expand...
Click to collapse
would you tell me an example when kernel doesnt compatible with ramdisk but kernel does compatible with system?
bubor said:
would you tell me an example when kernel doesnt compatible with ramdisk but kernel does compatible with system?
Click to expand...
Click to collapse
No no my friend that's not what I said. :cyclops:
I meant if you have CM 9 as system you can build a boot image which includes kernel and a CM9 based ram disk without building cm9 system again. :laugh:
.
Sent from my LG-H815 using XDA Labs

Categories

Resources