Below are some guides on how to build your very own ROMs and Kernels for the Samsung Galaxy Note Edge gsm versions.
XDA is a great community that has taught me so much that I want to share what little I know with you, so you may also build roms and kernels on your own. As a long time follower of XDA, last year I decided to gen an account so I could start contributing and also so I could start thanking people for thier great work.
I started out on the Motorola Flipside, and quickly moved on to the Samsung Captivate Glide, where guys like @bubor and @steadfasterX were not only doing great work, but were willing to share thier knowledge. By God's grace, I made some roms and kernels for the Samsung Galaxy S4, and now for the Note Edge.
All of my work can also be seen in more detail at https://thealaskalinuxuser.wordpress.com/
These guides are specifically built for the Note Edge, but in principle are applicable in any phone/rom/kernel.
In this guide, I am using Ubuntu 14.04. You can use virtual box, virtual machine, or any other method, but I used it installed on the computer.
Post #1. Introduction and table of contents.
Post #2. Rom - How to build AOKP 6.0 for the Galaxy Note Edge (TBLTEXX).
Post #3. Rom - How to add apps to your rom.
Post #4. Rom - How to change the default background in your source.
Post #5. kernel - How to build just a kernel from a rom source.
Post #6. kernel - How to build just a kernel stand alone.
Post #7. Kernel - How to break down and make boot images.
Post #8. kernel - How to add CPU/GPU Governors.
Post #9. kernel - How to Overclock/Undervolt.
Post #10. kernel - "How to" on special projects like sound mods.
Post #2. Rom - How to build AOKP 6.0 for the Galaxy Note Edge (TBLTEXX).
Post #2. Rom - How to build AOKP 6.0 for the Galaxy Note Edge (TBLTEXX).
Step by step instructions for building AOKP 6.0 for the international variant of the Samsung Galaxy Note Edge
This is adapted from my previous writeup on building AOKP 6.0 for the T-Mobile variant of the Samsung Galaxy S4:
http://forum.xda-developers.com/gal...uide-step-step-instructions-building-t3402637
I have noticed that the build instructions on the AOKP website are a bit outdated. They date back to JellyBean. I would like to encourage other users to build more custom roms, and I thought that it would help if I show how to build one of the roms wich compiled successfully for me (Praise God!). It is my hope that these instructions are clear and easy to follow. Hey, if I can do it, anybody can do it!
<<<<< Step 1: Setup your system. >>>>>
To be honest, this can be the most daunting part, because if you do not set this up properly, it just will not work. I use Ubuntu 14.04 on a HP Compaq 6715b laptop. I know, not a very ideal compiler, but it is what I've got. Here are the suggested packages, just open a terminal and paste this in:
Code:
$ sudo apt-get install bison build-essential bzip2 curl dpkg-dev flex g++-multilib git git-review gnupg gperf lib32ncurses5-dev lib32readline-gplv2-dev lib32z1-dev openjdk-7-jdk libbz2-1.0 libbz2-dev libc6-dev libghc-bzlib-dev libgl1-mesa-dev libgl1-mesa-glx:i386 libncurses5-dev libreadline6-dev libreadline6-dev:i386 libx11-dev:i386 libxml2-utils lzop maven pngcrush pngquant python-markdown schedtool squashfs-tools tofrodos x11proto-core-dev xsltproc zip zlib1g-dev zlib1g-dev:i386
This will take a while. Once it is done, do this:
Code:
$ mkdir ~/bin && curl http://commondatastorage.googleapis.com/git-repo-downloads/repo > ~/bin/repo && chmod a+x ~/bin/repo
$ gedit ~/.bashrc
Now you should see gedit open up your .bashrc file, to which you should add this at the very end, and save it:
Code:
export PATH=~/bin:$PATH
Now you need to close your terminal and open a new one to get the PATH variables to stick. Actually, it wouldn't hurt to reboot your system after installing all of those programs we just installed. Your computer should now be primed and ready to go.
<<<<< Step 2: Download the source. >>>>>
Here is a very short project for you that takes the computer a long time to complete. Open a terminal and start typing:
Code:
$ cd ~
$ mkdir aokp6
$ cd aokp6
$ repo init -u https://github.com/AOKP/platform_manifest.git -b mm
$ repo sync
You can now go outside, play with the kids, phone a friend, and then go to bed. When you awake the next morning, this might be done, depending on your internet connection!
<<<<< Step 3: Adding the device, kernel, and vendor trees. >>>>>
In some cases, you can simply type the command
Code:
$ breakfast
and just choose your device, but at this time, the AOKP repository did not include a current device tree for the TBLTEXX phone, so we need to download one. Later, perhaps we can learn about adding them as dependencies or in your manifests, but for now, here are the links to download them, which will help you understand how this works, follow the link, and click the download button to download the zips. Yes some of these are from AOKP for other files you need. Be sure to grap the MM branch for this guide. There are now newer Nougat branches, which works the same as well, but this guide was written from MM.
https://github.com/alaskalinuxuser/device_samsung_tbltexx
https://github.com/alaskalinuxuser/kernel_samsung_tblte
https://github.com/alaskalinuxuser/device_samsung_tblte-common
https://github.com/alaskalinuxuser/device_samsung_qcom-common
https://github.com/AOKP/device_qcom_common
https://github.com/alaskalinuxuser/tblte_vendor_samsung
Once you have downloaded them, unzip each one and rename them:
aokp_device_samsung_tbltexx --> "tbltexx" (Place in aokp/device/samsung/ )
aokp_device_samsung_tblte-common --> "tblte-common" (Place in aokp/device/samsung/ )
aokp_device_samsung_qcom-common --> "qcom-common" (Place in aokp/device/samsung/ )
device_qcom_common --> "common" (Place in aokp/device/qcom/ )
tblte_vendor_samsung --> "samsung" (Place in aokp/device/samsung/ )
kernel_samsung_tblte --> "tblte" (Place in aokp/kernel/samsung/ )
You may have to make the folders that they go into.
Now you should probably take a break before going on to the next step!
<<<<< Step 4: Editing the device, kernel, and vendor trees. >>>>>
Now, go to the device/samsung/tblte-common folder and make any edits you want. It should work just the way that it is currently. This is where you could add apps, change features of your phone, etc. See the following posts for guides on doing that.
Note: Because repositories are constantly updated, I can only garuntee that this will work based on the files as they were the day of this writing. However, with all of this in place, if you follow this guide, it should work realatively the same as it did for me.
Now that all of the hard work is done, it is time to actually build something!
<<<<< Step 5: Start your build! >>>>>
Phew! You have invested a lot of hours into this project, now it is time to actually put those files and time to use! Open up a terminal in your aokp6 folder and start typing:
Code:
$ . build/envsetup.sh
Which will output something like this:
Code:
including vendor/aokp/vendorsetup.sh
including sdk/bash_completion/adb.bash
including vendor/aokp/bash_completion/git.bash
including vendor/aokp/bash_completion/repo.bash
Now type:
Code:
$ brunch tbltexx
Which will start the long build process, it will output this:
Code:
including vendor/aokp/vendorsetup.sh
Got local manifest
Got local manifest
Checked dependency tree over :
NO_DEPS: device/*/tbltexx
============================================
PLATFORM_VERSION_CODENAME = REL
PLATFORM_VERSION = 6.0.1
AOKP_VERSION = aokp_tbltexx_mm_unofficial_2016-10-27_1015
TARGET_PRODUCT = aokp_tbltexx
TARGET_BUILD_VARIANT = userdebug
TARGET_BUILD_TYPE = release
TARGET_BUILD_APPS =
TARGET_ARCH = arm
TARGET_ARCH_VARIANT = armv7-a-neon
TARGET_CPU_VARIANT = krait
TARGET_2ND_ARCH =
TARGET_2ND_ARCH_VARIANT =
TARGET_2ND_CPU_VARIANT =
HOST_ARCH = x86_64
HOST_OS = linux
HOST_OS_EXTRA = Linux-3.16.0-73-generic-x86_64-with-Ubuntu-14.04-trusty
HOST_BUILD_TYPE = release
BUILD_ID = MOB30J
OUT_DIR = /home/alaskalinuxuser/Documents/projects/phones/compile/aokp6/out
============================================
And this:
Code:
.....edited for space.....
Import includes file: /home/alaskalinuxuser/Documents/projects/phones/compile/aokp6/out/host/linux-x86/obj/EXECUTABLES/acp_intermediates/import_includes
host C: libhost <= build/libs/host/CopyFile.c
build/libs/host/CopyFile.c:86:43: warning: unused parameter 'pSrcStat' [-Wunused-parameter]
static bool isSameFile(const struct stat* pSrcStat, const struct stat* pDstStat)
^
build/libs/host/CopyFile.c:86:72: warning: unused parameter 'pDstStat' [-Wunused-parameter]
static bool isSameFile(const struct stat* pSrcStat, const struct stat* pDstStat)
^
build/libs/host/CopyFile.c:104:42: warning: unused parameter 'src' [-Wunused-parameter]
static void printNotNewerMsg(const char* src, const char* dst, unsigned int options)
^
build/libs/host/CopyFile.c:531:69: warning: unused parameter 'isCmdLine' [-Wunused-parameter]
static int copyFileRecursive(const char* src, const char* dst, bool isCmdLine, unsigned int options)
.....edited for space..... Stuff like this will scroll by .....
Copy: /home/alaskalinuxuser/Documents/projects/phones/compile/aokp6/out/target/product/tbltexx/obj/STATIC_LIBRARIES/libext4_intermediates/libipt_LOG.c
Copy: /home/alaskalinuxuser/Documents/projects/phones/compile/aokp6/out/target/product/tbltexx/obj/STATIC_LIBRARIES/libext4_intermediates/libipt_MASQUERADE.c
Copy: /home/alaskalinuxuser/Documents/projects/phones/compile/aokp6/out/target/product/tbltexx/obj/STATIC_LIBRARIES/libext4_intermediates/libipt_MIRROR.c
Copy: /home/alaskalinuxuser/Documents/projects/phones/compile/aokp6/out/target/product/tbltexx/obj/STATIC_LIBRARIES/libext4_intermediates/libipt_NETMAP.c
target StaticLib: libip4tc (/home/alaskalinuxuser/Documents/projects/phones/compile/aokp6/out/target/product/tbltexx/obj/STATIC_LIBRARIES/libip4tc_intermediates/libip4tc.a)
target thumb C++: keystore <= system/security/keystore/keystore.cpp
target thumb C++: keystore <= system/security/keystore/keyblob_utils.cpp
target thumb C++: keystore <= system/security/keystore/operation.cpp
.....edited for space.....
Notice that there were some "warning" flags in there. Warnings are not all bad, but they can be. In this case it works out okay. Hopefully, after many hours, you should see this:
Code:
______ _____ __ __ _____
/\ _ \/\ __`\/\ \/\ \ /\ _ `\
\ \ \L\ \ \ \/\ \ \ \/'/'\ \ \L\ \
\ \ __ \ \ \ \ \ \ , < \ \ ,__/
\ \ \/\ \ \ \_\ \ \ \\`\ \ \ \/
\ \_\ \_\ \_____\ \_\ \_\\ \_\
\/_/\/_/\/_____/\/_/\/_/ \/_/
===========-Package complete-===========
zip: /home/alaskalinuxuser/Documents/projects/phones/compile/aokp6/out/target/product/tbltexx/aokp_tbltexx_mm_unofficial_2016-10-27_0149.zip
md5: 46bc18249c61988e75aba813464692a3
size: 324M
========================================
Success! Praise God! Now you can put this on your phone and test it out! Hopefully everything will be working! For future use, now you can start making changes or edits, from backgrounds to kernels! Have fun and make lots of backups. Remember, sometimes it is really hard to undo a change that you make.
Hopefully we learned how to set up our system, get the source, add devices and kernels that are not in the source, and run the compiler. Like I said, this works on my machine, as of this writing. You may notice, that if you make this build, it will not be identical to the one that I have posted on XDA. That is because I have made a few edits, additions, and/or subtractions here and there. That is the great thing about Android and open source! It is now up to you to make it better, to make it unique, or to make it you. Good luck with those builds, and be sure to share and help the next guy or gal with their projects too!
Post #3. Rom - How to add apps to your rom.
Post #3. Rom - How to add apps to your rom.
Here is the commit for when I did this to aokp_device_samsung_tblte-common:
https://github.com/alaskalinuxuser/...mmit/1ee34d6a1d5323a5ffb83eeeae7a87625f0eb130
I like to add the Kernel Adiutor app to my TBLTE (Samsung Galaxy Note Edge) builds. I used to put it in the vendor directory. What I realized though, is that I can simply add it to my tblte-common repository under the devices. For my device, I have a tbltexx repository, which essentially sets a few flags and passes the buck to the tblte-common repository for building. So, I actually added the app to my tblte-common repository. Now, when I sync, it updates my tblte-common directory, and keeps my prebuilt app!
Here is what I did.
Added some folders:
In my tblte-common repository (dev/samsung/tblte-common) I added a directory called "prebuilt". In keeping with Android's common structures, I then created these two folders: "common" and in that folder, one called "app".
When you are done making directories, it should have a path like this:
Code:
tblte-common/prebuilt/common/app
Now, in the "app" folder, I placed my prebuilt app, the Kernel Adiutor app, which I named "ka.apk". I then made an Android.mk file in the "prebuilt" folder that looks like this:
Code:
# Copyright (C) 2012 The Android Open Source Project
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
LOCAL_PATH := $(call my-dir)
#
# Prebuilt APKs
#
include $(CLEAR_VARS)
LOCAL_MODULE := ka
LOCAL_MODULE_OWNER := aokp
LOCAL_SRC_FILES := common/app/$(LOCAL_MODULE).apk
LOCAL_MODULE_TAGS := optional
LOCAL_MODULE_SUFFIX := .apk
LOCAL_MODULE_CLASS := APPS
LOCAL_CERTIFICATE := PRESIGNED
include $(BUILD_PREBUILT)
You can add as many prebuilt apps as you want this way, just make the above block for each app. Then you simply add them to your tblte.mk file in the tblte-common directory. You can substitute your device name here, it should work the same. Notice that the lines which have more than one app have the "" denoting that there are more files to add. Then the last app line does not have a "". Pretty simple, right?
Code:
# WJH adding kernel adiutor apk and selinux plugin apk.
# These are found in tblte-common/prebuilt/common/app
PRODUCT_PACKAGES += \
ka \
selinuxplugin
Now, when you run your build, it will include the apps that you have added to the list and placed in your folder!
Post #4. Rom - How to change the default background in your source.
Post #4. Rom - How to change the default background in your source.
Sometimes you just want to change the background. So, download a custom background and edit the jpg until it was the right shape and size. I typically use Gimp for that. Then:
After making the jpg into a 1920x1280 jpg file, I then used my home built script to make all of the "default_wallpaper.jpg" files. Here is the script:
Code:
#!/bin/bash
echo "Changing name of jpg file."
mv *.jpg 1920x1280.jpg
echo "Converting to 1080x960"
convert -resize 1080x960 1920x1280.jpg 1080x960.jpg
echo "Converting to 960x800"
convert -resize 960x800 1920x1280.jpg 960x800.jpg
echo "Converting to 1440x1280"
convert -resize 1440x1280 1920x1280.jpg 1440x1280.jpg
echo "Converting to 2160x1920"
convert -resize 2160x1920 1920x1280.jpg 2160x1920.jpg
echo "Converting to 2880x2560"
convert -resize 2880x2560 1920x1280.jpg 2880x2560.jpg
echo "making folders"
mkdir ./drawable-hdpi
mkdir ./drawable-nodpi
mkdir ./drawable-sw600dp-nodpi
mkdir ./drawable-sw720dp-nodpi
mkdir ./drawable-xhdpi
mkdir ./drawable-xxhdpi
mkdir ./drawable-xxxhdpi
echo "copying and renaming pictures"
cp ./1080x960.jpg ./drawable-hdpi/default_wallpaper.jpg
cp ./960x800.jpg ./drawable-nodpi/default_wallpaper.jpg
cp ./1920x1280.jpg ./drawable-sw600dp-nodpi/default_wallpaper.jpg
cp ./1920x1280.jpg ./drawable-sw720dp-nodpi/default_wallpaper.jpg
cp ./1440x1280.jpg ./drawable-xhdpi/default_wallpaper.jpg
cp ./2160x1920.jpg ./drawable-xxhdpi/default_wallpaper.jpg
cp ./2880x2560.jpg ./drawable-xxxhdpi/default_wallpaper.jpg
echo "Complete."
echo "Move the drawable* folders to 'vendor/pac/overlay/common/frameworks/base/core/res/res' folder."
You have to have imagemagic installed on your machine to use this script. Then, simply place your jpg file in a folder by itself, and then put this script into the folder, and run it! Here is the output:
Code:
[email protected]:~/Documents/projects/phones/wallpapers/aokp/images$ ls
aokp.jpg picscriptphones.sh
[email protected]:~/Documents/projects/phones/wallpapers/aokp/images$ ./picscriptphones.sh
Changing name of jpg file.
Converting to 1080x960
Converting to 960x800
Converting to 1440x1280
Converting to 2160x1920
Converting to 2880x2560
making folders
copying and renaming pictures
Complete.
Move the drawable* folders to 'vendor/aokp/overlay/common/frameworks/base/core/res/res' folder.
[email protected]:~/Documents/projects/phones/wallpapers/aokp/images$ ls
1080x960.jpg 2160x1920.jpg drawable-hdpi drawable-sw720dp-nodpi drawable-xxxhdpi
1440x1280.jpg 2880x2560.jpg drawable-nodpi drawable-xhdpi picscriptphones.sh
1920x1280.jpg 960x800.jpg drawable-sw600dp-nodpi drawable-xxhdpi
[email protected]:~/Documents/projects/phones/wallpapers/aokp/images$ ls drawable-hdpi/
default_wallpaper.jpg
[email protected]:~/Documents/projects/phones/wallpapers/aokp/images$
Once I moved the drawable folders to the vendor/aokp/overlay/common/frameworks/base/core/res/res folder mentioned above, I simply re-ran the compiler. Viola! Changed default background!
Post #5. kernel - How to build just a kernel from a rom source.
Post #5. kernel - How to build just a kernel from a rom source.
This is the easiest way to build a kernel for your roms, as it will create the bootimage file for you after making the kernel.
Make the kernel and boot image:
If you followed Post #2 to download all of the source, and even built a rom from it, you can now build just the kernel very quickly with only a few commands.
You can go to the aokp/kernel/samsung/tblte/arch/arm/config folder and edit your defconfig, in this case apq8084_sec_defconfig and apq8084_sec_tblte_eur_defconfig to make changes if needed.
Then, go to your aokp folder and open a terminal:
Code:
$ . build/envsetup
$ breakfast tbltexx
$ make clean
$ mka bootimage
Each one of those commands will create a lot of output, but the mka bootimage command will run the compiler, make your kernel, and your boot image. Now they are in the aokp/out/target/product/tbltexx/ folder as kernel and boot.img.
Make it a flashable zip:
Make a new folder and put this file in it:
http://www.mediafire.com/file/x3cn41c1ucjs33x/makekernelzip.zip
Unzip that file and you will have everything you need. Simply put your boot.img file in this folder, and follow the included instructions to run zip.sh and make your boot.img flashable on any tblte phone.
Post #6. kernel - How to build just a kernel stand alone.
Post #6. kernel - How to build just a kernel stand alone, without Rom source...
For the record, I do not recommend building kernels this way, I recommend that you build them within your ROM source. This method will work, but is far more labor intensive.
Part 1 - The setup:
Go to
Code:
$ sudo apt-get install -y build-essential kernel-package libncurses5-dev bzip2 git make -y
This will take a while. Then:
Code:
$ cd ~
$ mkdir playground
$ cd playground/
$ mkdir toolchain
$ cd toolchain
Now type this for 4.9:
Code:
$ git clone https://android.googlesource.com/platform/prebuilts/gcc/linux-x86/arm/arm-linux-androideabi-4.9
OR this for 4.8, but for this I recommend 4.8.
Code:
$ git clone https://android.googlesource.com/platform/prebuilts/gcc/linux-x86/arm/arm-linux-androideabi-4.8
The output either way should look like this:
Code:
Cloning into 'arm-linux-androideabi-4.8'...
remote: Sending approximately 170.26 MiB ...
remote: Counting objects: 124, done
remote: Finding sources: 100% (124/124)
.........EDITED FOR SPACE..................
Resolving deltas: 100% (652/652), done.
Checking connectivity... done.
That will take a few minutes. Then:
Code:
$ mkdir kernel
$ cd kernel
$ git clone https://github.com/alaskalinuxuser/kernel_samsung_tblte.git
Cloning into 'kernel_samsung_tblte'...
remote: Counting objects: 49082, done.
remote: Compressing objects: 100% (32/32), done.
.........EDITED FOR SPACE..................
Checking connectivity... done.
Checking out files: 100% (46422/46422), done.
This will take another few minutes, maybe longer, depending on your internet connection.
Part 2 - The kernel modifications
Before going further, this is when you can edit the files of the kernel, add things, remove things from the kernel itself. See the other posts here for how to do that. When you are ready, you can move onto the build.
Part 3 - The build
Open ~/playground/toolchain/kernel/kernel_samsung_tblte/Makefile, and go to line 195, it should say ARCH, edit it as such:
Code:
ARCH =arm
CROSS_COMPILE =/home/{YOURUSERNAME}/playground/toolchain/arm-linux-androideabi-4.8/bin/arm-linux-androideabi-
Code:
$ cd ~/playground/toolchain/kernel/kernel_samsung_tblte/
$ make clean
$ make mrproper
You will likely see an error about TARGET, that is okay, just ignore it.
Code:
$ make menuconfig apq8084_sec_defconfig
OR
Code:
$ make menuconfig apq8084_sec_tblte_eur_defconfig
After some scrolling text, you will see a menu option. Use the arrow keys and the space bar to make selections. Make any changes you want. Remember, not all changes are good. With this setup, you will need to make changes to make this function.
Once you are done, select exit. Then select yes to save your config.
Now that you are back at the command line, all you have to do is type one more command:
Code:
$ make
You will see a lot of scrolling text, like this:
Code:
arch/arm/kernel/return_address.c:63:2: warning: #warning "TODO: return_address should use unwind tables" [-Wcpp]
#warning "TODO: return_address should use unwind tables"
^
CC arch/arm/kernel/sched_clock.o
CC arch/arm/kernel/setup.o
CC arch/arm/kernel/signal.o
CC arch/arm/kernel/stacktrace.o
CC arch/arm/kernel/sys_arm.o
CC arch/arm/kernel/time.o
CC arch/arm/kernel/traps.o
CC arch/arm/kernel/atags_parse.o
CC arch/arm/kernel/cpuidle.o
This is good. Make is making your kernel.
If you are good, or lucky, then it will compile successfully, if not, it will error. Check your changes and use Google to search for errors if you need help. Again, I recommend to build kernels within the backdrop of ROM source, as I mentioned in the other post, it is much, much easier. This method will work, but you may have to add or change a lot of options in your config to make it happen.
Good luck!
Make it a flashable zip:
You will need to follow Post #7 and break down another boot image, insert your kernel, then re-pack that boot image with all of the proper arguments. This is the main reason I do not recommend building a kernel for Android outside of rom source.
Post #7. Kernel - How to break down and make boot images.
Post #7. Kernel - How to break down and make boot images.
Breaking down a boot image:
Okay, so first things first, STEP 1: downloads!
Download these things:
http://www.mediafire.com/download/zl80gh0t310trla/unpack-bootimg.pl
http://www.mediafire.com/download/xdmd278n17gm58h/unmkbootimg
http://www.mediafire.com/download/byf0tw4ga2mqtw0/repack-bootimg.pl
http://www.mediafire.com/download/7cmi548pzetc6c4/mkbootimg
And download your boot image that you want to break down, if you have not already.
I am using Linux, Ubuntu 14.04. I did this previously from Debian Wheezy, so any Linux should work. You can also use a VM, virtualbox, etc. if you are on a Windows computer.
STEP 2: Unzip!
Go ahead and unzip the zipfile if you are breaking down a flashable kernel zip that you downloaded. Preferably in its very own folder. For my work, I made a folder called "playground" in my home directory to play around in. I will reference the "playground" meaning the main folder with everything in it. Now, in the playground, make a new folder called "bootimage". In the playground folder, copy the boot.img file to the bootimage folder.
STEP 3: Tools setup!
Copy the downloaded above tools into a new folder called "tools" in the playground folder. Open a terminal here and give these files executable permissions and copy them again to the bootimage folder:
Code:
$ cd ~/playground/tools
$ chmod 777 ./*
$ cp ./ ../bootimage
We copy this twice so we have backups of the tools in case we delete them accidentally.
STEP 4: Unpack the boot image!
Open a terminal and go to the bootimage folder, and start typing:
Code:
$ cd ~/playground/boot.img
$ ./unmkbootimg ./boot.img
You will see some output in the terminal that looks *kind of* like this:
Code:
$ ./unmkbootimg ./boot.img
unmkbootimg version 1.2 - Mikael Q Kuisma <[email protected]>
Kernel size 2992704
Kernel address 0x10008000
Ramdisk size 2196028
Ramdisk address 0x11000000
Secondary size 0
Secondary address 0x10f00000
Kernel tags address 0x10000100
Flash page size 2048
Board name is ""
Command line ""
This image is built using standard mkbootimg
Extracting kernel to file zImage ...
Extracting root filesystem to file initramfs.cpio.gz ...
All done.
---------------
To recompile this image, use:
mkbootimg --kernel zImage --ramdisk initramfs.cpio.gz -o new_boot.img
---------------
Whatever it says, copy and paste it, hand type it, screenshot, whatever it takes, write the output down, because this is the key to re-making your boot image!
Then, you can unpack it like so:
Code:
$ ./unpack-bootimg.pl ./boot.img
You should see something *like* this:
Code:
$ ./unpack-bootimg.pl ./boot.img
kernel written to ./boot.img-kernel.gz
ramdisk written to ./boot.img-ramdisk.cpio.gz
7607 blocks
extracted ramdisk contents to directory ./boot.img-ramdisk/
You will now have folders and files to play with!
Make changes to your boot image:
Now is the time to change any files you want, such as delete the kernel and put yours in instead, etc. I can not tell you much about this, since I don't know what you are doing in your boot image. Here is an example of me turning a Captivate glide cell phone into a Debian "laptop":
http://forum.xda-developers.com/cap...msung-captivate-glide-debian-chatter-t3233807
Re-pack the boot.img:
Okay, so you have made your changes, now it is time to put it back together. Go back to your playground folder.
Code:
$ cd ~/playground/bootimage
$ rm initramfs.cpio.gz
$ cd ./boot.img-ramdisk/
$ sudo su
<enter your password>
# find . | cpio --quiet -H newc -o | gzip > ../initramfs.cpio.gz
# cd ..
# mkbootimg --kernel zImage --ramdisk initramfs.cpio.gz --base 0x0 --cmdline 'console=ttyS1,115200n8 androidboot.selinux=permissive' -o new_boot.img
Note that the last part, "mkbootimg" needs to be all the stuff I told you to write down when you broke down your boot image, or it needs to be the new command line you want your boot image to use. The new_boot.img is your newly created boot image file, which you should rename boot.img, after you remove your old boot.img file from the folder.
-With heimdall, heimdall-frontend, or Odin, flash the new_boot.img to the boot partition of your phone, or make it flashable per Post #5 or Post #6.
Post #8. kernel - How to add CPU/GPU Governors.
Post #8. kernel - How to add CPU/GPU Governors.
Where to get CPU and GPU governors:
That is a really great question. Essentially, for CPU governors, you can pull them from any kernel by searching github. However, I recommend you pull from a kernel from either the same phone and/or kernel version. If you are using 3.10.40, but you pull from a kernel that is 3.10.84, there may be dependencies that are missing from your older kernel. In the case of the Nightmare example, I had to edit the governor itself to make it work with the kernel I was using.
For sure, if you follow this guide, you can always borrow mine
https://github.com/alaskalinuxuser/kernel_samsung_tblte
They will come from the drivers/cpufreq/ folder, and should be named cpufreq_{governor_name.c}. So, if you are looking for Nightmare, you can search github for cpufreq_nightmare.c, or use Google with "github cpufreq_nightmare.c".
GPU governors are a bit more complicated, see below for how to implement one, and then you can better see where to get one.
The non-technical guide to understanding CPU/GPU governors:
http://forum.xda-developers.com/gal...technical-guide-to-understanding-cpu-t3440156
Adding CPU Governors:
Adding a kernel governor can be a Nightmare!
You can read the commit here: https://github.com/alaskalinuxuser/...mmit/19ba1b4f94d04877a5a783843a01c2494ecb1d5c
Okay, so a little play on words, especially since I am adding the Nightmare governor to the kernel, but it did turn out to be a bit of a problem child, fortunately, it was quickly corrected. As you can see, I did the standard additions, as well as adding the cpufreq_nightmare.c file: https://github.com/alaskalinuxuser/...94ecb1d5c/drivers/cpufreq/cpufreq_nightmare.c You can download it there.
The CPU Governor files are in the drivers/cpufreq/ folder, and all start with cpufreq_{DRIVERNAME}.
Added to drivers/cpufreq/Makefile, where the other cpufreq_*'s are:
Code:
.............EDITED FOR SPACE.......................
obj-$(CONFIG_CPU_FREQ_GOV_NIGHTMARE) += cpufreq_nightmare.o
.............EDITED FOR SPACE.......................
Added to drivers/cpufreq/Kconfig, where the other CPU_FREQ_DEFAULT_GOV_*'s are:
Code:
.............EDITED FOR SPACE.......................
config CPU_FREQ_DEFAULT_GOV_NIGHTMARE
bool "nightmare"
select CPU_FREQ_GOV_NIGHTMARE
help
Use the CPUFreq governor 'nightmare' as default. -WJH
Also added to drivers/cpufreq/Kconfig, where the other CPU_FREQ_GOV_*'s are:
Code:
.............EDITED FOR SPACE.......................
config CPU_FREQ_GOV_NIGHTMARE
tristate "'nightmare' cpufreq policy governor"
help
'nightmare' - This driver is a modified PegasusQ.
To compile this driver as a module, choose M here: the
module will be called cpufreq_nightmare.
For details, take a look at linux/Documentation/cpu-freq.
If in doubt, say N. -WJH
.............EDITED FOR SPACE.......................
Added to include/linux/cpufreq.h, right where the other CONFIG_CPU_FREQ_DEFAULT_GOV_*'s were :
Code:
.............EDITED FOR SPACE.......................
#elif defined(CONFIG_CPU_FREQ_DEFAULT_GOV_NIGHTMARE)
extern struct cpufreq_governor cpufreq_gov_nightmare;
#define CPUFREQ_DEFAULT_GOVERNOR (&cpufreq_gov_nightmare)
.............EDITED FOR SPACE.......................
Added to arch/arm/configs/apq8084_sec_defconfig, right under "CONFIG_CPU_FREQ_GOV_POWERSAVE":
Code:
.............EDITED FOR SPACE.......................
CONFIG_CPU_FREQ_GOV_NIGHTMARE=y
.............EDITED FOR SPACE.......................
Adding GPU governors:
Comming soon.
Post #9. kernel - How to Overclock/Undervolt.
Post #9. kernel - How to Overclock/Undervolt.
Overclock an apq8084 Samsung Galaxy Note Edge!
You can see the commit on github here:
https://github.com/alaskalinuxuser/...mmit/9bb23d0d9cc805bf7e1b8e3fe829fcbb0542af31
In my continuing quest to make a better kernel for the Samsung Galaxy Note Edge (TBLTE, N915T), I decided to tackle overclocking the kernel. There are already some overclocked kernels out there, but I decided to do something slightly different with mine. The distinguishing feature of my overclocked kernel is that it doesn't use any more power than it did before, and to God be the glory, it worked!
I also feel that when you overclock a chip, you are increasing the rate of failure, and the induced heat load. So I like to keep my overclocking light, less than 10% of the overall capacity that the chip was designed for. It is my hope that this will reduce wear and tear on the device while still providing superior performance.
Editing the tables for this chip was a lot simpler than for other chips I have worked on.
It all took place within the kernel/samsung/tblte/arch/arm/boot/dts/qcom/apq8084.dtsi file. Here is how it used to look:
Code:
.............EDITED FOR SPACE................
/* 2.7GHz RC1 */
qcom,speed2-pvs0-bin-v1 =
< 0 0 0 >,
< 300000000 810000 76 >,
< 345600000 820000 88 >,
.............EDITED FOR SPACE................
< 2496000000 1120000 813 >,
< 2572800000 1135000 849 >,
< 2649600000 1150000 886 >;
And here was my change, from 2649600000 to 2688000000:
Code:
.............EDITED FOR SPACE................
/* 2.7GHz RC1 */
qcom,speed2-pvs0-bin-v1 =
< 0 0 0 >,
< 300000000 810000 76 >,
< 345600000 820000 88 >,
.............EDITED FOR SPACE................
< 2496000000 1120000 813 >,
< 2572800000 1135000 849 >,
< 2688000000 1150000 886 >;
That's right, I only made a 39MHz change. I feel this was appropriate to keep the device cool and continue to use the same voltages. So it is essentially a 39MHz boost with no noticable consequences. Of course, I had to do the above to each speed and pvs table in that file.
Then, I needed to edit this portion:
Code:
.............EDITED FOR SPACE................
qcom,[email protected] {
reg = <0 4>;
compatible = "qcom,msm-cpufreq";
qcom,cpu-mem-ports = <1 512>;
qcom,cpufreq-table =
< 300000 300000 1144 800 >,
< 422400 422400 2288 800 >,
.............EDITED FOR SPACE................
< 2572800 1728000 16250 10101 >,
< 2649600 1728000 16250 10101 >;
.............EDITED FOR SPACE................
To this:
Code:
.............EDITED FOR SPACE................
qcom,[email protected] {
reg = <0 4>;
compatible = "qcom,msm-cpufreq";
qcom,cpu-mem-ports = <1 512>;
qcom,cpufreq-table =
< 300000 300000 1144 800 >,
< 422400 422400 2288 800 >,
.............EDITED FOR SPACE................
< 2572800 1728000 16250 10101 >,
< 2688000 1728000 16250 10101 >;
.............EDITED FOR SPACE................
It actually was the only time I have overclocked a kernel on the second try. Don't think too highly of me, though, I spent hours reviewing kernel edits for overclocking by various other kernel developers on GitHub. If you are looking to do the same, you should spend some time looking at working code for others, and then make your own tables.
If you try this on your own, you may have multiple tries where the phone will not even boot, or crashes while you use it, so be careful, make small changes, and be courageous, because this is usually not a simple one stop process.
If you were to compare my tables with everyone elses, you would see that I have done it differently than my contemporaries, even though we reached similar, or in some cases, identical results. I like to keep the code clean, short, and sweet. Often when overclocking, most kernel developers will add more lines to the tables. I have found that while that may be the best to maximize use, my method is much simpler and easy to implement, as well as follow, and that is what Linux should be all about, keeping it simple. It also makes it easier for "stock" kernel hot-plug controllers like MPDecision.
Under-volt a Samsung Galaxy Note Edge:
So, back to our ealier example of the overclocked chip, now we want to change the voltage. Doing that is easy, getting viable, stable, working results is much harder. Consider our code from the kernel/samsung/tblte/arch/arm/boot/dts/qcom/apq8084.dtsi file:
Code:
.............EDITED FOR SPACE................
/* 2.7GHz RC1 */
qcom,speed2-pvs0-bin-v1 =
< 0 0 0 >,
< 300000000 810000 76 >,
< 345600000 820000 88 >,
.............EDITED FOR SPACE................
< 2496000000 1120000 813 >,
< 2572800000 1135000 849 >,
< 2649600000 1150000 886 >;
To change the voltage, one only has to edit these multiple pvs trees.
Consider this line:
Code:
< 2572800000 1135000 849 >
It means:
Code:
< Frequency Voltage Amperage (? or cycles) >
So, in the above table, the 2572 MHz frequency uses 113.5 mv.
And, in the above table, the 2649 MHz frequency uses 115 mv.
So, to under-volt you could edit it like so:
Code:
< 2572800000 1120000 849 >,
< 2649600000 1135000 886 >;
This would cut down the voltage used on each of these frequencies. The problem is, however, if you go too low, you may cause the kernel to crash. Notice that in my overclocked kernel, I under-volted it to the same as the 2649 MHz frequency, even though I am using it at 2688 MHz. So, use with caution, and have fun making adjustments! I recommend only small changes or even only one change at a time.
Post #10. kernel - "How to" on special projects like sound mods and I/O schedulers.
Post #10. kernel - "How to" on special projects like sound mods and I/O schedulers.
How to add an I/O Scheduler to your kernel:
Praise God, another great addition to the TBLTE kernel was that of adding the FIOPS I/O scheduler to the kernel. What is an I/O scheduler? Well it is the part of the kernel that handles, or schedules, input and output. Particularly, this has to do with writing and reading to and from media, like your hard drive, flash drive, etc.
So, how do we do that? How do we add I/O schedulers to our kernel?
Well, for the TBLTE kernel, I will show you what I did, and you can add to your kernel similarly.
Go to the block folder in your kernel source. The first thing that you need to do is add the fiops-iosched.c file. Whatever I/O scheduler you want to add will be named like this: {NAME-iosched.c} you can search Google or github for them, or take them from my source if you would like.
Once you put your fiops-iosched.c file in your kernel's ./block/ folder, you can now edit two other files in that folder. You need to add the new scheduler to the make file, so it knows to make it, you can do that like so:
Open ./block/Makefile and add this line after the other *-iosched.o lines:
Code:
obj-$(CONFIG_IOSCHED_FIOPS) += fiops-iosched.o
Notice that it just uses the name of the iosched file, but with an ".o" extension instead of a ".c" extension. The ".c" file you added earlier will create a ".o" (object) file that the Kernel needs to use to "make" the kernel.
Now edit the ./block/Kconfig.iosched file like so:
Code:
config IOSCHED_FIOPS
tristate "FIOPS I/O scheduler"
default y
---help---
The FIOPS I/O scheduler. WJH.
This way, when you are moddifying your configuration, you can select to build it. Notice that it is a "default y", essentially, I am telling the config file creator to allways assume I want to build this, unless I choose not to. You can also eddit the "---help---" portion to say anything you want. I put my initials in there so I can find it easily with the search tool.
Now open your configuration file. For the stock builds, that would be ./arch/arm/configs/ap88084_sec_defconfig, and add this line:
Code:
CONFIG_IOSCHED_FIOPS=y
Note that you could also do this through
Code:
$ make menuconfig
.
You may also note, since we gave it a "default y" in the Kconfig.iosched file, we don't actually need to add this to our configs, as it will be built by default, but I like to declare what I am building in my configs so I remember what I am doing.
There you go! Now when you build your kernel again, the FIOPS I/O scheduler will be added in. It is remarkably simple, just the way I like it. You can read the commit here: https://github.com/alaskalinuxuser/...mmit/f80320a895612bd1379ca789f88f1d6dfd6e68f9
@DaKillaz98
I will teach you to build Nougat roms here also, if you are interested.
@AlaskaLinuxUser
I appreciate the help with teaching me what I need to do with our Note Edge. As far as I know, I need Linux, latest OpenJDK for building with Nougat and beyond. I have read up some basics, but I don't know all the particulars that go into the Note Edge.
---------- Post added at 07:18 PM ---------- Previous post was at 07:12 PM ----------
[/COLOR @AlaskaLinuxUser
I would also like to ask, you mentioned earlier in the guide that you had an HP Compaq 6715b. How long were compile times? I have an HP Elitebook 8540w with an Intel i5 520m, so I am assuming that compile would probably take about 6 hours?
DaKillaz98 said:
I appreciate the help with teaching me what I need to do with our Note Edge. As far as I know, I need Linux, latest OpenJDK for building with Nougat and beyond. I have read up some basics, but I don't know all the particulars that go into the Note Edge.
I would also like to ask, you mentioned earlier in the guide that you had an HP Compaq 6715b. How long were compile times? I have an HP Elitebook 8540w with an Intel i5 520m, so I am assuming that compile would probably take about 6 hours?
Click to expand...
Click to collapse
No problem.
Your laptop should work. It took me 11 hours to compile on my old laptop. Now I use a server with 24 GB of ram, 8 cores (2x4 core 2.0 GHz) and it takes 3 hours to compile. I can only guess, but it will likely take 6 hours on your machine. The great thing is, starting with Nougat, the builds now use Ninja, so you can see the progress in percentage. Before, in MM and down, we just had to wait, without knowing how far along it was. We could guess by looking at the files, but it is not always built in the same order.
Okay, to get started. If that laptop is your machine, you can't set up a virtual box, because you need all 8 GB of ram (unless you have more than that). So, I recommend installing Ubuntu 14.04, 64 bit. 14.04 is still Google's preferred OS for building Android, but you can do it on other systems. I recommend for now that you do install 14.04 or 16.04 as your build environment. Once you get good at the builds, then you can experiment with other OS' for the builds.
After you install that, follow post #2, with these changes for Nougat:
I am only listing the changes, otherwise, follow the steps as is.
<<<<< Step 1: Setup your system. >>>>>
Code:
sudo apt-get install git-core gnupg flex bison gperf build-essential zip curl zlib1g-dev gcc-multilib g++-multilib libc6-dev-i386 lib32ncurses5-dev x11proto-core-dev libx11-dev lib32z-dev ccache libgl1-mesa-dev libxml2-utils xsltproc unzip bzip2 dpkg-dev git git-review lib32readline-gplv2-dev lib32z1-dev libbz2-1.0 libbz2-dev libghc-bzlib-dev libncurses5-dev libreadline6-dev lzop maven pngcrush pngquant python-markdown schedtool squashfs-tools tofrodos
After you install that, but before you install the "curl repo" part, install openjdk-8-jdk per here:
https://source.android.com/source/initializing#installing-the-jdk
Now continue by curling the repo per the instructions.
<<<<< Step 2: Download the source. >>>>>
Code:
$ cd ~
$ mkdir aokp7
$ cd aokp7
$ repo init -u https://github.com/AOKP/platform_manifest.git -b nougat
$ repo sync
<<<<< Step 3: Adding the device, kernel, and vendor trees. >>>>>
For each of these download links (t-mobile added and links updated):
https://github.com/alaskalinuxuser/device_samsung_tbltexx/tree/AOKP_N
https://github.com/alaskalinuxuser/kernel_samsung_tblte/tree/NOUGAT
https://github.com/alaskalinuxuser/device_samsung_tblte-common/tree/AOKP_N
https://github.com/alaskalinuxuser/device_samsung_qcom-common/tree/AOKP_N
https://github.com/AOKP/device_qcom_common --> Yes, this is a little old, but so is your phone.
https://github.com/alaskalinuxuser/tblte_vendor_samsung/tree/Nougat
https://github.com/alaskalinuxuser/device_samsung_tbltetmo/tree/AOKP_N
And the only change for renaming:
aokp_device_samsung_tbltetmo --> "tbltetmo" (Place in aokp7/device/samsung/ )
<<<<< Step 4: Editing the device, kernel, and vendor trees. >>>>>
No changes.
<<<<< Step 5: Start your build! >>>>>
No changes. But....
Not required, but if you want the capacitive buttons to work correctly, before you compile, do this from the aokp7 directory:
$ sh device/samsung/tblte-common/run_before_compiling.sh
It runs a little script that overwrites the generic keyboard layout.
Now you can continue with the
$ . build/envsetup.sh
When you get to brunch tbltexx:
$ brunch tbltexx
-- OR --
$ brunch tbltetmo
To build for the international or T-mobile versions.
Okay, that should get you started. I will gladly assist once you get rolling.
I guess I should have asked: Are you planning to build MM or Nougat? I figured Nougat, so do the above to build Nougat. For learning purposes, you could follow the guide as written to build MM instead.
@AlaskaLinuxUser
For some reason, my post didn't go through. Anyways, I tried to mention I am building Nougat, and waiting until I go up to my Grandparents where they have an HP Workstation with an Intel Core 2 Quad q9600 and 6gb ram, their computer is more dedicated for the job. But for bow, I have been running new LineageOS builds with Micky387's RR kernel and his Key Layout files, so I may build kernels only on my laptop. If will probably post up a zip including the keylayout files and my own built lineageos kernel for now so people can have new builds until I start building explicitly for the Note Edge.
DaKillaz98 said:
@AlaskaLinuxUser
For some reason, my post didn't go through. Anyways, I tried to mention I am building Nougat, and waiting until I go up to my Grandparents where they have an HP Workstation with an Intel Core 2 Quad q9600 and 6gb ram, their computer is more dedicated for the job. But for bow, I have been running new LineageOS builds with Micky387's RR kernel and his Key Layout files, so I may build kernels only on my laptop. If will probably post up a zip including the keylayout files and my own built lineageos kernel for now so people can have new builds until I start building explicitly for the Note Edge.
Click to expand...
Click to collapse
Sure. Good luck.
Sent from my LG-H811 using XDA-Developers Legacy app
@AlaskaLinuxUser
Thanks for the help and support on this. It is highly appreciated.
AlaskaLinuxUser said:
Sure. Good luck.
Sent from my LG-H811 using XDA-Developers Legacy app
Click to expand...
Click to collapse
Sorry about my large absence from this ROM build. My computer had broken down, so I worked on fixing it, also found a cheap PC on eBay which will serve builds much better. Intel i5 2400 with 8gb ram and 500gb hdd, so I should have a lot more room and power for builds. I had also started my own TouchWiz project called Slaughtered ROM and was busy with that, I will soon set up the build environment and get that going, thank you again for the guide and sorry for how long I had been busy.
I will start with AOKP, but probably push towards Resurrection Remix and possibly seeing if I can build AOSP O on the Edge.
DaKillaz98 said:
Sorry about my large absence from this ROM build. My computer had broken down, so I worked on fixing it, also found a cheap PC on eBay which will serve builds much better. Intel i5 2400 with 8gb ram and 500gb hdd, so I should have a lot more room and power for builds. I had also started my own TouchWiz project called Slaughtered ROM and was busy with that, I will soon set up the build environment and get that going, thank you again for the guide and sorry for how long I had been busy.
I will start with AOKP, but probably push towards Resurrection Remix and possibly seeing if I can build AOSP O on the Edge.
Click to expand...
Click to collapse
No problem, I hope the guide will help you as you get started. I can't answer every question, but if you have problems let me know, I'd be glad to help if I can.
Sent from my LG-H811 using XDA-Developers Legacy app
AlaskaLinuxUser said:
No problem, I hope the guide will help you as you get started. I can't answer every question, but if you have problems let me know, I'd be glad to help if I can.
Sent from my LG-H811 using XDA-Developers Legacy app
Click to expand...
Click to collapse
Thanks for your help! I have synced RR repo's, I wanted to try building RR, and am in the process of setting it up with the device-specific stuff, afterwards I will start building.
Related
Project Developer IV
Welcome
This is a guide for all those who want to build for their Xperia 2011 Devices but do not neccesasarily have the knowledge or experience.
This is an unofficial guide for the building of custom ROMs and other mods for the Xperia 2011 Devices. This is a work in progress, with additions being made as often as possible. This thread has already grown with the help of the devs established in this forum. BMP777 began this project a year ago when I was using a Samsung GS II Skyrocket. BMP777 started another alike thread called PR II in the LGOG forum a while back as well. I have since moved on to a ONE, but both threads remain to this day. The point is this: everyone who uses this site has a desire for modding, customizing, and/or otherwise altering their device. Unfortunately, many have no idea how to go about doing these things for themselves. As such, there is a lot of dissatisfaction among developers about receiving constant demands, suggestions, and requests for updates. This thread is meant to give those who want to step up and build for themselves the means to do so. It is an ever-changing thread, with all assistance welcomed.
READ ME:
On one hand, it should go without saying that if you have no knowledge and/or experience with building, java, C++, and various other tools, you probably shouldn't begin here. At the same time, it is possible to learn to build, provided you can read, follow directions, and aren't too lazy to RESEARCH.
OH YEAH, and you better have patience. This isn't easy. It will be work. The quickest way to get flamed is to show yourself to be lazy. If you think that with a couple clicks, you can have your own flashy ROM, forget it. But, if you do want to learn, this is a good place to get started. I have no ego about this; I started the same way and just want to help everyone learn to build their own ROM. But, everyone will struggle to get to a successful point, and lazy, unmotivated people just irritate those who have had to learn from scratch too. Tutorials will be posted for any new thing learned and built as time and space allow. ALL ARE WELCOME AND ALL QUESTIONS ARE TOO. But, seriously, if it's a really ridiculous one, I/we reserve the right to screw with you about it.
ALWAYS REMEMBER:
{
"lightbox_close": "Close",
"lightbox_next": "Next",
"lightbox_previous": "Previous",
"lightbox_error": "The requested content cannot be loaded. Please try again later.",
"lightbox_start_slideshow": "Start slideshow",
"lightbox_stop_slideshow": "Stop slideshow",
"lightbox_full_screen": "Full screen",
"lightbox_thumbnails": "Thumbnails",
"lightbox_download": "Download",
"lightbox_share": "Share",
"lightbox_zoom": "Zoom",
"lightbox_new_window": "New window",
"lightbox_toggle_sidebar": "Toggle sidebar"
}
Thread Disclaimer:
The instructions and extras posted here are to be used at your own risk. I am working hard to provide good, workable tutorials that will make successful building much easier. Nevertheless, I am not responsible if you lose your files, brick your device, or inadvertently cause a nuclear war. If you are seeking absolute perfection, RUN NOW WHILE YOU STILL CAN!!
Thread Navigation :
# 2 > Setting Up Build enviorment
# 3 > Building instructions & How To Build Using Linaro 4.8 Toolchain
# 4 > Necessary Fixes for Xperia 2011 Line UP
# 5 > Kernel building and CCACHE
# 6 > reserved for future
XDA:DevDB Information
Project Developer, a Tool/Utility for the Sony Ericsson Xperia Arc
Contributors
officiallysonyrebel, car vs driver , BMP777, Mikeioannina and My buddys vishal_android_freak , saki3d , besttt and YOU
Version Information
Status: Testing
Created 2013-11-29
Last Updated 2013-12-03
Build Enviorment Set up :
This is a combination of the steps offered in the threads 'Compile JB on Ubuntu' and TeamChopsticks CyanogenMod.
Special thanks to dastin1015 and TeamChopsticks.
Tip: Allocate at least 75 gigs of space for the building of ONE ROM. If you install ccache, you will want 90. A complete build directory can use as much as 100 gigs, so make sure you have plenty of room. One of the ways to fail out a build is too use all of your partition before acquiring all the necessary files.
Here are the steps from those 2 tutorials in correct order:
0.1 ))
Install Gedit
Code:
# gedit
sudo apt-get install gedit
1) You need the following:
-JDK 6 if you wish to build Jellybean.
Code:
[COLOR="Black"]$ sudo apt-get oracle-java7-installer
-Python 2.4 -- 2.7, which you can download from python.org.[/COLOR]
Or:
Code:
[COLOR="black"]$ sudo apt-get install python
-Git 1.7 or newer. You can find it at git-scm.com.[/COLOR]
Or:
Code:
[COLOR="black"]$ sudo apt-get install git-core[/COLOR]
-Android SDK:
Download the SDK here: http://developer.android.com/sdk/index.html
Extract the SDK and place it in your home directory.
I renamed my SDK to android-sdk to make it easier to navigate to – this tutorial assumes you've done that as well.
Go to your home folder, press Ctrl+H to show hidden files, and open up your .bashrc file.
Add these lines at the bottom of the file:
Code:
[COLOR="black"]# Android tools
export PATH=${PATH}:~/android-sdk/tools
export PATH=${PATH}:~/android-sdk/platform-tools
export PATH=${PATH}:~/bin[/COLOR]
Find your .profile file and add this at the bottom of the file:
Code:
[COLOR="black"]PATH="$HOME/android-sdk/tools:$HOME/android-sdk/platform-tools:$PATH"
You have now successfully installed the Android SDK.[/COLOR]
To check for updates issue this into your terminal:
Code:
[COLOR="black"]$ android[/COLOR]
2) Install required packages. 64-bit (recommended)
Code:
[COLOR="black"]$ sudo apt-get install git-core gnupg flex bison gperf build-essential
zip curl zlib1g-dev libc6-dev lib32ncurses5-dev ia32-libs
x11proto-core-dev libx11-dev lib32readline-gplv2-dev lib32z-dev
libgl1-mesa-dev g++-multilib mingw32 tofrodos python-markdown
libxml2-utils lzop schedtool[/COLOR]
On newer versions of Ubuntu such as 11.10 you may need to do the following:
Code:
[COLOR="black"]$ sudo ln -s /usr/lib/i386-linux-gnu/libX11.so.6 /usr/lib/i386-linux-gnu/libX11.so[/COLOR]
Code:
[COLOR="black"]$ sudo apt-get install git-core gnupg flex bison gperf build-essential
zip curl libc6-dev libncurses5-dev:i386 x11proto-core-dev
libx11-dev:i386 libreadline6-dev:i386 libgl1-mesa-glx:i386
libgl1-mesa-dev g++-multilib mingw32 openjdk-6-jdk tofrodos
python-markdown libxml2-utils xsltproc zlib1g-dev:i386
$ sudo ln -s /usr/lib/i386-linux-gnu/mesa/libGL.so.1 /usr/lib/i386-linux-gnu/libGL.so[/COLOR]
3) Configure your USB.
Code:
[COLOR="black"]$ gksudo gedit /etc/udev/rules.d/51-android.rules[/COLOR]
Inside of this blank text file insert:
Code:
[COLOR="black"]#Acer
SUBSYSTEM=="usb", ATTR{idVendor}=="0502", MODE="0666"
#ASUS
SUBSYSTEM=="usb", ATTR{idVendor}=="0b05", MODE="0666"
#Dell
SUBSYSTEM=="usb", ATTR{idVendor}=="413c", MODE="0666"
#Foxconn
SUBSYSTEM=="usb", ATTR{idVendor}=="0489", MODE="0666"
#Garmin-Asus
SUBSYSTEM=="usb", ATTR{idVendor}=="091E", MODE="0666"
#Google
SUBSYSTEM=="usb", ATTR{idVendor}=="18d1", MODE="0666"
#HTC
SUBSYSTEM=="usb", ATTR{idVendor}=="0bb4", MODE="0666"
#Huawei
SUBSYSTEM=="usb", ATTR{idVendor}=="12d1", MODE="0666"
#K-Touch
SUBSYSTEM=="usb", ATTR{idVendor}=="24e3", MODE="0666"
#KT Tech
SUBSYSTEM=="usb", ATTR{idVendor}=="2116", MODE="0666"
#Kyocera
SUBSYSTEM=="usb", ATTR{idVendor}=="0482", MODE="0666"
#Lenevo
SUBSYSTEM=="usb", ATTR{idVendor}=="17EF", MODE="0666"
#LG
SUBSYSTEM=="usb", ATTR{idVendor}=="1004", MODE="0666"
#Motorola
SUBSYSTEM=="usb", ATTR{idVendor}=="22b8", MODE="0666"
#NEC
SUBSYSTEM=="usb", ATTR{idVendor}=="0409", MODE="0666"
#Nook
SUBSYSTEM=="usb", ATTR{idVendor}=="2080", MODE="0666"
#Nvidia
SUBSYSTEM=="usb", ATTR{idVendor}=="0955", MODE="0666"
#OTGV
SUBSYSTEM=="usb", ATTR{idVendor}=="2257", MODE="0666"
#Pantech
SUBSYSTEM=="usb", ATTR{idVendor}=="10A9", MODE="0666"
#Philips
SUBSYSTEM=="usb", ATTR{idVendor}=="0471", MODE="0666"
#PMC-Sierra
SUBSYSTEM=="usb", ATTR{idVendor}=="04da", MODE="0666"
#Qualcomm
SUBSYSTEM=="usb", ATTR{idVendor}=="05c6", MODE="0666"
#SK Telesys
SUBSYSTEM=="usb", ATTR{idVendor}=="1f53", MODE="0666"
#Samsung
SUBSYSTEM=="usb", ATTR{idVendor}=="04e8", MODE="0666"
#Sharp
SUBSYSTEM=="usb", ATTR{idVendor}=="04dd", MODE="0666"
#Sony Ericsson
SUBSYSTEM=="usb", ATTR{idVendor}=="0fce", MODE="0666"
#Toshiba
SUBSYSTEM=="usb", ATTR{idVendor}=="0930", MODE="0666"
#ZTE
SUBSYSTEM=="usb", ATTR{idVendor}=="19D2", MODE="0666"[/COLOR]
4) Save the file and close it and then issue this command:
Code:
[COLOR="black"]$ sudo chmod a+r /etc/udev/rules.d/51-android.rules[/COLOR]
5) Install the repo:
Code:
[COLOR="black"]$ mkdir ~/bin
$ PATH=~/bin:$PATH
$ curl https://dl-ssl.google.com/dl/googlesource/git-repo/repo > ~/bin/repo
$ chmod a+x ~/bin/repo[/COLOR]
Create your work directory:
Code:
[COLOR="black"]mkdir ~/"your directory name here" For example: mkdir ~/cm10
cd ~/cm10[/COLOR]
Setup local manifest:
Code:
[COLOR="Black"]mkdir .repo/local_manifests
touch .repo/local_manifests/semc.xml
gedit .repo/local_manifests/semc.xml[/COLOR]
Necessary Files for Xperia 2011 :
Tip :For Building any Rom for Xperia 2011 devices u need these specific device files
1 . first is "semc.xml"
2. second is "patches"
you can find correct SEMC.xml here : [thanks to @mikeioannina for maintaining our device Sources
===================================================================================
===================================================================================
For KitKat 4.4.x
* Patch #1 Fix semc camera preview
Code:
git fetch http://review.cyanogenmod.org/CyanogenMod/android_frameworks_av refs/changes/82/54582/1 && git cherry-pick FETCH_HEAD
* Patch #2 Allow devices to disable fence sync
Code:
git fetch http://review.cyanogenmod.org/CyanogenMod/android_frameworks_native refs/changes/94/52994/3 && git cherry-pick FETCH_HEAD
* Patch #3 Backwards compatibility with old EGL
Code:
git fetch http://review.cyanogenmod.org/CyanogenMod/android_frameworks_native refs/changes/57/54257/4 && git cherry-pick FETCH_HEAD
* Patch #4 Bring back support for mHeap-based screenshots
Code:
git fetch http://review.cyanogenmod.org/CyanogenMod/android_frameworks_native refs/changes/62/53162/5 && git cherry-pick FETCH_HEAD
*Patch No. 5 # SoftapControllerTI: update parameters for setSoftap
Code:
git fetch http://review.cyanogenmod.org/CyanogenMod/android_system_netd refs/changes/05/55805/1 && git cherry-pick FETCH_HEAD
====================== DO NOT USE IT - I M WARNING or u will get ERRORS ==========================
Aditonal Patch #5 Use AOSP version of wpa_supplicant_lib
Code:
git fetch http://review.cyanogenmod.org/CyanogenMod/android_hardware_ti_wlan refs/changes/89/54289/2 && git cherry-pick FETCH_HEAD
====================================================
Building Instructions : For CyanogenMod :: AOKP :: Carbon roms :: Beanstalk
Unofficial
thanks mikeioannia for initial CM guide
To get started with Android/CyanogenMod, you'll need to get familiar with Git and Repo.
To initialize your local repository using the CyanogenMod trees, use a command like this:
first create folder named " cm "
Code:
mkdir cm
enter into cm
Code:
cd ~/cm
For CM - 11.0 kitkat 4.4.x
Code:
[COLOR="black"]repo init -u git://github.com/CyanogenMod/android.git -b cm-11.0[/COLOR]
Then to sync up:
Code:
[COLOR="black"]repo sync[/COLOR]
Please see the CyanogenMod Wiki for building instructions.
For more information on this Github Organization and how it is structured, please read the wiki article.
Create and edit semc.xml in .repo:
Code:
[COLOR="black"]gedit .repo/local_manifests/semc.xml[/COLOR]
Add this to the semc.xml:
For CM 11.0 KitKat 4.4.x
copy paste semc.xml for kikat 4.4 from here : https://raw.github.com/LegacyXperia/local_manifests/cm-11.0/semc.xml
then
Code:
[COLOR="Black"]repo sync[/COLOR]
For 4.4 apply patches from 4.4
1.
Code:
cd ~/cm/frameworks/av
-> copy paste patch #1 press enter
2.
Code:
cd ~/cm/frameworks/native
-> copy paste patch #2 press enter
-> copy paste patch #3 press enter
-> copy paste patch #4 press enter
3.
Code:
cd ~/cm/system/netd
-> copy paste patch #5 press enter
Code:
[COLOR="black"]. build/envsetup.sh (notice the period and space)
vendor/cm/get-prebuilts
[/COLOR]
then
Code:
brunch <device>
Special thanks to scott.hart.bti for his hard work -
From terminal
1. type
Code:
[COLOR="black"]cd[/COLOR]
.
This will bring you to your root folder.
2. type
Code:
[COLOR="black"]mkdir beanstalk[/COLOR]
.
This will create a folder named beanstalk.
3. type
Code:
[COLOR="black"]cd beanstalk[/COLOR]
.
This will take you to the beanstalk directory created from previous step
4. type
Code:
[COLOR="black"]repo init -u git://github.com/scotthartbti/android.git -b kk44[/COLOR]
.
This will setup the folders to be synced.
5. For Beanstalk KitKat 4.4.x
copy paste semc.xml for kikat 4.4 from here : https://raw.github.com/LegacyXperia/local_manifests/cm-11.0/semc.xml
then
Code:
[COLOR="Black"]repo sync[/COLOR]
apply patches for 4.4
1.
Code:
cd ~/beanstalk/frameworks/av
-> copy paste patch #1 press enter
2.
Code:
cd ~/beanstalk/frameworks/native
-> copy paste patch #2 press enter
-> copy paste patch #3 press enter
-> copy paste patch #4 press enter
2.
Code:
cd ~/beanstalk/system/netd
-> copy paste patch #5 press enter
9. Outside of terminal, navigate to beanstalk/vendor/cm. Double click on the get-prebuilts file and select run in terminal. This will fetch necessary files needed to build and place them where they need to be.
10. Type
Code:
[COLOR="Black"]. build/envsetup.sh && brunch <device>[/COLOR]
11. Previous step will start building beanstalk for your device. The process takes anywhere from 1 - 3 hours depending on your computer.
12. Once completed, it will say package complete and you will have a beanstalk named zip file in your out folder.
Unofficial
Special thanks to spleef and ktempleman for laying this out
This set of instructions is unverified. If you build successfully or have build issues, please post here so we can confirm or fix what isn't working
First:
Code:
[COLOR="Black"]mkdir aokp[/COLOR]
then
Code:
[COLOR="black"]cd aokp[/COLOR]
then
Code:
[COLOR="black"]repo init -u https://github.com/AOKP/platform_manifest.git -b kitkat[/COLOR]
after it does its thing
Code:
[COLOR="black"]mkdir .repo/local_manifests
touch .repo/local_manifests/semc.xml
gedit .repo/local_manifests/semc.xml[/COLOR]
copy paste semc.xml for kikat 4.4 from here : https://raw.github.com/LegacyXperia/local_manifests/cm-11.0/semc.xml
save and exit then
Code:
[COLOR="black"]repo sync[/COLOR]
after everything syncs
apply patches for 4.4
1.
Code:
cd ~/aokp/frameworks/av
-> copy paste patch #1 press enter
2.
Code:
cd ~/aokp/frameworks/native
-> copy paste patch #2 press enter
-> copy paste patch #3 press enter
-> copy paste patch #4 press enter
2.
Code:
cd ~/aokp/system/netd
-> copy paste patch #5 press enter
Code:
[COLOR="black"]gedit vendor/aokp/vendorsetup.sh[/COLOR]
and add this to the bottom:
Code:
[COLOR="black"]add_lunch_combo aokp_device-userdebug[/COLOR]
save and exit.. then
Code:
[COLOR="black"]. build/envsetup.sh[/COLOR]
Code:
[COLOR="black"]brunch device[/COLOR]
For more on AOKP building, try here: http://aokp.co/learn/so-you-want-to-build-aokp-jb-ubuntu-1204
And Here: https://github.com/AOKP
Unofficial
Getting Started
To get started with the Carbon-Dev sources, you'll need to get familiar with Git and Repo.
Create the Directories
You will need to set up some directories in your build environment.
To create them run:
Code:
[COLOR="black"]mkdir -p ~/carbon[/COLOR]
Install the Repository
You may need to reboot for these changes to take effect. Now enter the following to initialize the repository:
Code:
[COLOR="black"]cd ~/carbon[/COLOR]
Repositories:
Before you continue --> run this in the terminal
Code:
[COLOR="black"]repo init -u https://github.com/CarbonDev/android.git -b kk[/COLOR]
after it does its thing
Code:
[COLOR="black"]mkdir .repo/local_manifests
touch .repo/local_manifests/semc.xml
gedit .repo/local_manifests/semc.xml[/COLOR]
copy paste semc.xml for kikat 4.4 from here : https://raw.github.com/LegacyXperia/local_manifests/cm-11.0/semc.xml
save and exit then
Code:
[COLOR="black"]repo sync[/COLOR]
after everything syncs
apply patches for 4.4
1.
Code:
cd ~/carbon/frameworks/av
-> copy paste patch #1 press enter
2.
Code:
cd ~/carbon/frameworks/native
-> copy paste patch #2 press enter
-> copy paste patch #3 press enter
-> copy paste patch #4 press enter
3.
Code:
cd ~/carbon/system/netd
-> copy paste patch #5 press enter
Code:
[COLOR="black"]gedit vendor/carbon/vendorsetup.sh[/COLOR]
and add this to the bottom:
Code:
[COLOR="black"]add_lunch_combo carbon_device-userdebug[/COLOR]
save and exit.. then
Code:
[COLOR="black"]. build/envsetup.sh[/COLOR]
Code:
[COLOR="black"]brunch device[/COLOR]
To get started with AORP, you'll need to get familiar with Git and Repo.
To initialize your local repository using the AORP trees, use a command like this:
first create folder named " AORP "
Code:
mkdir AORP
enter into AORP
Code:
cd ~/AORP
For kitkat 4.4.x
Code:
[COLOR="black"]repo init -u git://github.com/AORP/android.git -b kk[/COLOR]
Then to sync up:
Code:
[COLOR="black"]repo sync[/COLOR]
Please see the CyanogenMod Wiki for building instructions.
For more information on this Github Organization and how it is structured, please read the wiki article.
Create and edit semc.xml in .repo:
Code:
[COLOR="black"]gedit .repo/local_manifests/semc.xml[/COLOR]
Add this to the semc.xml:
For CM 11.0 KitKat 4.4.x
copy paste semc.xml for kikat 4.4 from here : https://raw.github.com/LegacyXperia/local_manifests/cm-11.0/semc.xml
then
Code:
[COLOR="Black"]repo sync[/COLOR]
For 4.4 apply patches from 4.4
1.
Code:
cd ~/AORP/frameworks/av
-> copy paste patch #1 press enter
2.
Code:
cd ~/AORP/frameworks/native
-> copy paste patch #2 press enter
-> copy paste patch #3 press enter
-> copy paste patch #4 press enter
3.
Code:
cd ~/AORP/system/netd
-> copy paste patch #5 press enter
Code:
[COLOR="black"]. build/envsetup.sh (notice the period and space)
vendor/cm/get-prebuilts
[/COLOR]
then
Code:
brunch <device>
Next Tutorial is Strictly Not for beginners
Building with Linaro 4.8 toolchain
Checkout these toolchains customised for arm v7 and scorpion Cpu here http://forum.xda-developers.com/showthread.php?t=2098133
thanks @Christopher83
Go into Terminal and navigate to the root folder of your source tree, then:
Code:
[COLOR="Black"]prebuilts/gcc/linux-x86/arm/[/COLOR]
Run:
Code:
[COLOR="black"]wget http://releases.linaro.org/13.06/components/toolchain/gcc-linaro/4.8/gcc-linaro-4.8-2013.06.tar.bz2[/COLOR]
Run:
Code:
[COLOR="black"]bunzip2 *.tar.bz2[/COLOR]
Run:
Code:
[COLOR="black"]tar -xvf *.tar[/COLOR]
Using your file manager, navigate to the root folder of your source tree again.
Navigate To "/build", in your root folder.
Run:
Code:
[COLOR="black"]gksudo gedit envsetup.sh[/COLOR]
change the line in bold, to look exactly like this one:
Code:
[COLOR="black"]case $ARCH in
x86) toolchaindir=x86/i686-linux-android-4.6/bin
;;
[B]arm) toolchaindir=arm/gcc-linaro-4.8-2013.06[/B] [COLOR="Red"]<--------[/COLOR]
;;
mips) toolchaindir=mips/mipsel-linux-android-4.6/bin
;;
*)
echo "Can't find toolchain for unknown architecture: $ARCH"
toolchaindir=xxxxxxxxx
;;
esac
[/COLOR]
Exit out and open new. Initialize and build. That's it! Makes you wonder why you never did it before, right?
Not so fast. You may have build issues, you may not. I had a few lengthy sets of errors in gsm calltracker and another .java file that was solved by using Meld and making it look exactly like a successful build's file. More as I learn.......
Thanks to infected_ for this tut; his post can be found here: [/COLOR]
http://forum.xda-developers.com/showpost.php?p=42976693&postcount=12
This is a work in progress. Many more pieces of information will be added and this is meant to be an ever-changing thread. If you see something that is outdated or incorrect, please let me know ASAP, so I can make the correction. Also, make sure that any info offered can be and has been confirmed as functional.
Thanks to:
CyanogenMod
scott.hart.bti
Team Carbon
david279
MallardDuck
ktempleton
AdhvanIt
matthew0776
spleef
M4570D0N
car vs driver
mikeioannina
BMP777
Kernel Building and Ccache
Building your first kernel
(this is non-device-specific; tweaks will be required to produce an M7SPR kernel) :
This is a set of steps to get you building your first kernel. Special thanks to thewadegeek for putting this tutorial together. His thread can be found here: http://forum.xda-developers.com/showthread.php?t=1748297
Step 1. Build Environment
A. Install Ubuntu 12.04(Not holding your hand here, if you can't do this you shouldn't be messing with kernels)
B. Required packages: 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, and Adb.
C. Open a terminal
D. Type
Code:
[COLOR="black"]mkdir android[/COLOR]
E. Type
Code:
[COLOR="black"]cd android[/COLOR]
G.Type
Code:
[COLOR="black"]mkdir kernel[/COLOR]
Step 2. Your Source
A. Open your Terminal Prompt
B. Type
Code:
[COLOR="black"]cd android/kernel[/COLOR]
C. Type
Code:
[COLOR="black"]git clone git://github.com/DooMLoRD/android_prebuilt_toolchains.git toolchains[/COLOR]
D. Now comes the tricky part, you need to have some-type of source for your kernel. Check the following two sites for your device as appropriate. Once you have it download it is extracted/cloned into a folder in your kernel directory.
http://developer.sonymobile.com/wpor...ads/opensource
Step 3. Modifications
This is the part people are curious about, they want to make modifications to the kernel to make it "special". Start all these from the root directory of your kernel source.
Mod 1. Applying a patch
A. Download the patch you wish to apply, in this case this one should work.
B. Save that file as "kernelPatch" in your kernel directory.
C. Open a Terminal
D. Move into the root directory of the kernel you wish to patch.
E. Type
Code:
[COLOR="black"]patch -p1 < ../kernelPatch[/COLOR]
Mod 2. Adding a Governor Alone
A. Open "drivers/cpufreq/Kconfig"
B. Add the following lines in appropriate spot amongst the other govenor's
Code:
[COLOR="Black"]config CPU_FREQ_DEFAULT_GOV_SMARTASS
bool "smartass"
select CPU_FREQ_GOV_SMARTASS
select CPU_FREQ_GOV_PERFORMANCE
help
Use the CPUFreq governor 'smartass' as default.
[/COLOR]
Code:
[COLOR="Black"]config CPU_FREQ_GOV_SMARTASS
tristate "'smartass' cpufreq governor"
depends on CPU_FREQ
help
smartass' - a "smart" optimized governor!
If in doubt, say N.[/COLOR]
C. Open "drivers/cpufreq/Makefile"
D. Add the following line in the appropriate spot.
Code:
[COLOR="Black"] obj-$(CONFIG_CPU_FREQ_GOV_SMARTASS) += cpufreq_smartass.o[/COLOR]
E. Create a file called "drivers/cpufreq/cpufreq_smartass.c"
F. Put the following code in that file.
http://pastebin.com/f0Bk9kVZ
G. open "include/linux/cpufreq.h"
H. Under the "Cpufreq Default" section add
Code:
[COLOR="Black"]#elif defined(CONFIG_CPU_FREQ_DEFAULT_GOV_SMARTASS)
extern struct cpufreq_governor cpufreq_gov_smartass;
#define CPUFREQ_DEFAULT_GOVERNOR (&cpufreq_gov_smartass)[/COLOR]
Ok there is a governor added, do the exact same steps for any other one's you would like to add.
Step 4. Getting a Config file
Option A. Pulling a config file from a kernel.
A. Hook up a device that is using a kernel similar to one you are using as your base.
B. Open a terminal
C. Change to your root kernel directory
D. Type
Code:
[COLOR="black"]adb pull /proc/config.gz[/COLOR]
E. Type
Code:
[COLOR="black"]gunzip config.gz[/COLOR]
F. Type
Code:
[COLOR="black"]mv config arch/arm/configs/<your_config_name>_defconfig[/COLOR]
Option B. Using the manufacturers config.
Unfortunately as stated above, not all kernels support the "/proc/config.gz" method. You can typically find a manufacturer's configuration file in "arch/arm/configs". I believe the one for my HTC Flyer was called "flyer_hc_defconfig", so look for a layout similar to that one. Also read the README to get a better idea of how to modify it. I would personally make a copy of it called "<your_config_name>_defconfig" and use that as my base.
Step 5. Building
Time to start the real "build" section of this tutorial.
Part A. Pre-build Steps
A. Open terminal and change to the root of your kernel directory
B. Type
Code:
[COLOR="black"]export ARCH=arm[/COLOR]
C. Type
Code:
[COLOR="black"]export CROSS_COMPILE=~/android/kernel/toolchains/arm-eabi-linaro-4.6.2/bin/arm-eabi-[/COLOR]
Part B. The First Build
A. Type
Code:
[COLOR="black"]make <your_config_name>_defconfig[/COLOR]
B. Type
Code:
[COLOR="black"]make menuconfig[/COLOR]
and make the required changes to use any modules you added or similar changes.
C. Type
Code:
[COLOR="black"]make -j<maximum number of jobs>[/COLOR]
Part C. Re-Builds
A. Type
Code:
[COLOR="black"]make clean[/COLOR]
B. Type
Code:
[COLOR="black"]make oldconfig[/COLOR]
C. Type
Code:
[COLOR="black"]make -j<maximum number of jobs>[/COLOR]
Part D. Building Modules
You have two options:
A. Type
Code:
[COLOR="black"]make modules[/COLOR]
B. Type
Code:
[COLOR="black"]make path/to/your/module.ko[/COLOR]
The above steps explained:
Part A.(These steps are required every time you close your terminal and re-open it to build again.)
A. Ok shouldn’t need to explain this.
B. This command sets your target architecture.
C. Defines the path to the toolchain we are going to use to compile our kernel. You can change this to point towards whatever toolchain you have downloaded or feel like using, the way it is currently configured it will use the Linaro toolchain that we downloaded above.
Part B.(These only need to be run the first time you build a kernel.)
A. Load's your configuration file from earlier.
B. Open up a menu to configure your kernel. It will use the config file you loaded in the previous step as a base.
C. Viola start the build. I typically allow 1 job per core, so on my quad core machine I put "make -j4". Just raising that number will not make your build faster, your processor needs to be able to support the number of jobs you are assigning it.
Part C. (Use the command's when you are building any-time outside of the first)
A. This command gets rid of any old/outdated binaries or modules you compiled before, and let's start fresh. I like to run it every I build unless my changes are really small and localized.
B. A very awesome command, it parses through what has changed and only prompts you about new options.
C. See the explanation for the above "Part C.".
Part D.(Use these for just building kernel modules.)
A. This will re-build all modules.
B. Will rebuild just the module you need. Very useful when you need to rebuild a WiFi module.
Step 6. Now what
Ok we have now started our build and we are waiting for it to finish, so there are two possible outcomes:
Outcome A. Build Succeeds
W00t!! You have a kernel built by your self from source. There are a couple things you need in-order to use this kernel on your device any ".ko" modules and the zImage binary. If you pay attention to the output of your compiler then you will see the location of those objects. However the following commands will make your life a bit easier(Thanks Recognized Developer Hacre):
A. Open a terminal
B. Change to your root kernel directory
C. Type
Code:
[COLOR="black"]mkdir ../<your_kernel>_output[/COLOR]
D. Type
Code:
[COLOR="black"]cp arch/arm/boot/zImage ../<your_kernel>_output/zImage[/COLOR]
E. Type
Code:
[COLOR="black"]find . -name "*.ko" -exec cp {} ../<your_kernel>_output \;[/COLOR]
The above steps explained:
A-C. Self-Explanatory
D. Move our kernel binary into our output folder
E. This handy bit of magic finds all ".ko" modules and also copies them into your output file.
You will also need to assemble a kernel image containing a initramfs for your device, along with the kernel binary and such. That however is beyond the scope of this tutorial. To get started though try searching the following phrases.
Code:
[COLOR="Black"]building android kernel image
xda build kernel image
xda unpack boot.img[/COLOR]
Outcome B. Build Fails
Oh dear. It failed. Well guess what...this is going to happen..a LOT. Get used to it, and get used to googling and experimenting with different solutions. The following are some tips that will help you with debugging your issues.
Running a "Clean" build
A. Backup your config file - Type
Code:
[COLOR="black"]cp .config ../backupConfig[/COLOR]
B. Re-run the build process using just your defconfig from earlier.
Limiting Output(Thanks Hacre.)
A. Another good tip is to run "make -j1" to get the error, as it will limit the amount of text you need to scroll through.[/COLOR]
[/CENTER]
Building TWRP recovery - http://forum.xda-developers.com/showthread.php?t=1943625
Building CWM recovery - http://forum.xda-developers.com/showthread.php?t=1866545
Tutorial for CM-11.0 custom kernel coming Soon
CCACHE
Here is a brief tutorial on the installation of Ccache, which can shorten build times drastically :
If you have room on your build system you can speed
your builds up considerably by using ccache. ccache is a compiler
cache. It speeds up re-compilation of C/C++ code by caching
previous compiles and detecting when the same compile is
being done again.
Install it with apt-get:
Code:
[COLOR="Black"]sudo apt-get install ccache[/COLOR]
Set environment vars for Android use:
(I put these exports in my .bashrc)
Code:
[COLOR="Black"]export USE_CCACHE=1
export NDK_CCACHE=ccache[/COLOR]
Set a cache size of 10G for optimal results:
Code:
[COLOR="black"]ccache -M 10G[/COLOR]
Check the status of your cache with the command:
Code:
[COLOR="black"]ccache -s [/COLOR]
Returns:
Code:
[COLOR="black"]
cache directory /home/jocala/.ccache
cache hit 106673
cache miss 18379
called for link 3758
preprocessor error 5
not a C/C++ file 4425
unsupported compiler option 678
no input file 4565
files in cache 36758
cache size 3.2 Gbytes
max cache size 10.0 Gbytes[/COLOR]
[/QUOTE]
Really Useful things
Here are some relevant topics/tutorials/sites:
Download | Ubuntu - www.ubuntu.com/download
Official Ubuntu Documentation: Help for all versions. - https://help.ubuntu.com/
How To Windows Dual Boot: - https://help.ubuntu.com/community/WindowsDualBoot
How To Use The Terminal: Commandline stuff. - https://help.ubuntu.com/community/UsingTheTerminal/
[HOW TO] Beginners Guide to Android ROM Development - http://forum.xda-developers.com/showthread.php?t=1272270 (courtesy of isidromxz)
[Tutorial] Compile JB on Ubuntu - http://forum.xda-developers.com/showthread.php?t=1762641 (courtesy of dastin1015)
[CM10] [PPA] Cyanogenmod Compiler v0.6 - http://forum.xda-developers.com/showthread.php?t=1789190 (courtesy of lithid-cm)
[Wiki] How to: Gerrit - http://wiki.cyanogenmod.com/wiki/Howto:_Gerrit
[Wiki] How to: Git - http://wiki.cyanogenmod.com/wiki/Howto:_Git
[Wiki] How to: Connect to device with SSH - http://wiki.cyanogenmod.com/wiki/Howto:_Connect_to_Device_with_SSH
Here is an easy-to-use page on common Linux commands: - http://www.pixelbeat.org/cmdline.html
Linux Newbie Guide : - http://www.unixguide.net/linux/linuxshortcuts.shtml
Also, Team Chopsticks has a good page with some useful tips as well, located here:
http://www.teamchopsticks.org/p/contributing.html (thanks to bdusmc for the tip)
Here is a link to LIFEHACKER's command line tutorials. Very good stuff!! : http://lifehacker.com/5743814/become-a-command-line-ninja-with-these-time+saving-shortcuts
CyanogenMod git : - https://github.com/CyanogenMod
LegacyXperia git : - https://github.com/LegacyXperia
Original Beanstalk thread : - http://forum.xda-developers.com/showthread.php?t=2091900
Beanstalk git : - https://github.com/scotthartbti?tab=repositories
The Muppets git : - https://github.com/TheMuppets
[/FONT][/CENTER]
Seven
I want you to lock this thread once you have reserved all the posts needed before anyone posts.. We can open it once all tuts are ready
Regards,
vishal_android freak
Thread ready
officiallysonyrebel said:
Building with Linaro 4.8 toolchain
Go into Terminal and navigate to the root folder of your source tree, then:
Code:
[COLOR="Black"]prebuilts/gcc/linux-x86/arm/[/COLOR]
Run:
Code:
[COLOR="black"]wget http://releases.linaro.org/13.06/components/toolchain/gcc-linaro/4.8/gcc-linaro-4.8-2013.06.tar.bz2[/COLOR]
Run:
Code:
[COLOR="black"]bunzip2 *.tar.bz2[/COLOR]
Run:
Code:
[COLOR="black"]tar -xvf *.tar[/COLOR]
Using your file manager, navigate to the root folder of your source tree again.
Navigate To "/build", in your root folder.
Run:
Code:
[COLOR="black"]gksudo gedit envsetup.sh[/COLOR]
change the line in bold, to look exactly like this one:
Code:
[COLOR="black"]case $ARCH in
x86) toolchaindir=x86/i686-linux-android-4.6/bin
;;
[B]arm) toolchaindir=arm/gcc-linaro-4.8-2013.06[/B] [COLOR="Red"]<--------[/COLOR]
;;
mips) toolchaindir=mips/mipsel-linux-android-4.6/bin
;;
*)
echo "Can't find toolchain for unknown architecture: $ARCH"
toolchaindir=xxxxxxxxx
;;
esac
[/COLOR]
Exit out and open new. Initialize and build. That's it! Makes you wonder why you never did it before, right?
Not so fast. You may have build issues, you may not. I had a few lengthy sets of errors in gsm calltracker and another .java file that was solved by using Meld and making it look exactly like a successful build's file. More as I learn.......
Thanks to infected_ for this tut; his post can be found here: [/COLOR]
http://forum.xda-developers.com/showpost.php?p=42976693&postcount=12
Click to expand...
Click to collapse
Building with Linaro 4.8 toolchain doesn't work, gcc-linaro-4.8-2013.06.tar.bz2 is source file, I also tried the following file
Code:
http://releases.linaro.org/13.06/components/android/toolchain/4.8/android-toolchain-eabi-4.8-2013.06-x86.tar.bz2
and modified envsetup.sh but still doesn't work.
SquallATF said:
Building with Linaro 4.8 toolchain doesn't work, gcc-linaro-4.8-2013.06.tar.bz2 is source file, I also tried the following file
Code:
http://releases.linaro.org/13.06/components/android/toolchain/4.8/android-toolchain-eabi-4.8-2013.06-x86.tar.bz2
and modified envsetup.sh but still doesn't work.
Click to expand...
Click to collapse
what error u are getting ..? and have u done everything correctly .?
officiallysonyrebel said:
what error u are getting ..? and have u done everything correctly .?
Click to expand...
Click to collapse
no error,but I see is still used the original compiler via 'ps -x' command, I‘m not sure which setp will use ANDROID_EABI_TOOLCHAIN, and I see another post http://forum.xda-developers.com/showthread.php?t=2330970 about Compile Xperia Z ROM with Linaro, it replaced ndk
SquallATF said:
no error,but I see is still used the original compiler via 'ps -x' command, I‘m not sure which setp will use ANDROID_EABI_TOOLCHAIN, and I see another post http://forum.xda-developers.com/showthread.php?t=2330970 about Compile Xperia Z ROM with Linaro, it replaced ndk
Click to expand...
Click to collapse
try new link which i added in OP for building instructions with Linaro
SquallATF said:
no error,but I see is still used the original compiler via 'ps -x' command, I‘m not sure which setp will use ANDROID_EABI_TOOLCHAIN, and I see another post http://forum.xda-developers.com/showthread.php?t=2330970 about Compile Xperia Z ROM with Linaro, it replaced ndk
Click to expand...
Click to collapse
if you want linaro you have to make some additional commits on kernel
you can look for that commits in here
https://github.com/SlimXperia/msm7x30-3.4.x-nAa
AWSM...!!!
AWSM job OP.....its a dream come true thread for any n00b..was looking for something like this specifically for our SX2011 devices...will try out building roms using this guide...thank u vry much OP:good::laugh::highfive:
Good post, for first I can turn into a bit of development instead of modding\cook. I will do something after my Arc turn into EOL!
Cheers
Enviado desde mi HUAWEI Y300-0100 mediante Tapatalk
SquallATF said:
Building with Linaro 4.8 toolchain doesn't work, gcc-linaro-4.8-2013.06.tar.bz2 is source file, I also tried the following file
Code:
http://releases.linaro.org/13.06/components/android/toolchain/4.8/android-toolchain-eabi-4.8-2013.06-x86.tar.bz2
and modified envsetup.sh but still doesn't work.
Click to expand...
Click to collapse
nice tutor bro...
Patches updated to Latest .. :good: updated build instructions "SlimKat" and "AORP" tutorial SOON
officiallysonyrebel said:
Patches updated to Latest .. :good: updated build instructions "SlimKat" and "AORP" tutorial SOON
Click to expand...
Click to collapse
i PM u bro
try to patch PAC
one more thing while try to use patch 2/3/4 get error
but if u applied just patch 2 its patched without error
Any help?
[email protected]:~/pac/system$ cd ~/pac/system/frameworks/native
[email protected]:~/pac/system/frameworks/native$ git fetch http://review.cyanogenmod.org/CyanogenMod/android_frameworks_native refs/changes/57/54257/4 && git cherry-pick FETCH_HEAD
From http://review.cyanogenmod.org/CyanogenMod/android_frameworks_native
* branch refs/changes/57/54257/4 -> FETCH_HEAD
error: could not apply 1af87c2... DisplayDevice: Backwards compatibility with old EGL
hint: after resolving the conflicts, mark the corrected paths
hint: with 'git add <paths>' or 'git rm <paths>'
hint: and commit the result with 'git commit'
[email protected]:~/pac/system/frameworks/native$ git fetch http://review.cyanogenmod.org/CyanogenMod/android_frameworks_native refs/changes/62/53162/5 && git cherry-pick FETCH_HEAD
From http://review.cyanogenmod.org/CyanogenMod/android_frameworks_native
* branch refs/changes/62/53162/5 -> FETCH_HEAD
error: 'cherry-pick' is not possible because you have unmerged files.
hint: Fix them up in the work tree,
hint: and then use 'git add/rm <file>' as
hint: appropriate to mark resolution and make a commit,
hint: or use 'git commit -a'.
fatal: cherry-pick failed
[email protected]:~/pac/system/frameworks/native$ git fetch http://review.cyanogenmod.org/CyanogenMod/android_frameworks_native refs/changes/94/52994/3 && git cherry-pick FETCH_HEAD
From http://review.cyanogenmod.org/CyanogenMod/android_frameworks_native
* branch refs/changes/94/52994/3 -> FETCH_HEAD
error: 'cherry-pick' is not possible because you have unmerged files.
hint: Fix them up in the work tree,
hint: and then use 'git add/rm <file>' as
hint: appropriate to mark resolution and make a commit,
hint: or use 'git commit -a'.
fatal: cherry-pick failed
Click to expand...
Click to collapse
3andala said:
i PM u bro
try to patch PAC
one more thing while try to use patch 2/3/4 get error
but if u applied just patch 2 its patched without error
Any help?
Click to expand...
Click to collapse
there are some conflicts with patches and PAC sources u need to resolve these conflicts
first apply patch when it shows error
type
Code:
git commit -a
and got to pathced files
and fined these symabols
Code:
>>>>>> or ======
delete it..!!
it is easy method
and in someplaces u need to see which code should be kept and which should be deleted but these lines
Code:
>>>>>> or ======
should be deleted ..
best of luck!
keep devloping
Here are the steps to build your own kernel from source. This guide is showing you how to build your first the stock kernel on your own..... It is kick start for making things on your own way....
This guide applies to i9082/i9082L and general devices also.:laugh:
This guide assumes you have basic knowledge of linux and linux system configuration.
Prerequisites
1. Ubuntu 13.10
2. patience...lots and lots of patience.
Click to expand...
Click to collapse
Here starts the fun:-
1. Installing ubuntu 13.10.
This can be done in 3 ways and I am not gonna cover it all.
- along with windows ,i.e dual boot
- in virtualbox within windows
- as a windows application installation with "wubi" installer
For starting user i think second option, i.e installing in virtualbox is best.
here's starting tutorials
http://www.youtube.com/watch?v=tDDRFiwHujg
NOTE - you should have atleast 100 Gb partion for virtualbox.
Click to expand...
Click to collapse
2. Getting the kernel source.
Download source from http://opensource.samsung.com/
Type i9082 in search box and download "GT-I9082_SEA_JB_Opensource_Update1.zip"
After download unzip the source into new folder in home directory.
Type in terminal from you kernel directory.
Code:
unzip GT-I9082_SEA_JB_Opensource_Update1.zip
Then extract tar.
Code:
mkdir kernel
tar xzf kernel.tar.gz -C kernel
Click to expand...
Click to collapse
3. Setting up building environment.
Copied from http://soupdawg.wordpress.com/
All credits goes to
mysteriously inconspicuous
Click to expand...
Click to collapse
Initializing a fresh Android Build Environment in Ubuntu 13.10 sucks, right? The instructions at the AOSP page are outdated and inaccurate. Near as I can tell, they try to have you install 2 JDKs, the first one not even being the correct link for Saucy Salamander, and the second being OpenJDK. Which might work. But I dunno about all that, I’d rather have Oracle’s official stamp when it comes to building for Android.
Currently most of the guides are up to 12.04 LTS, which is fine and dandy, but being on the cutting edge is nice too.
This guide applies to all variations of Ubuntu 13.10 Saucy Salamander 64 bit. Do not use the 32 Bit version. Also, PAY CLOSE ATTENTION when to use “sudo” and when to not. It can make things funky if you do something as root that you shouldn’t.
Much thanks goes out to Google, ProTekk, Canonical, and everyone else that I read a random paragraph here and snippet there.
First, let’s set up the correct JDK.
Many of you probably have some kind of wrong Java installed unless you’re starting with a fresh Ubuntu base, and even then maybe.
Let’s get rid of that. Copy and paste this into a Terminal window:
Code:
sudo apt-get purge openjdk-\* icedtea-\* icedtea6-\*
Follow the instructions to remove OpenJDK.
If you must keep it, it’s possible. But I’m not going to tell you how to do it here. I don’t want any chance of confusion or mistake.
Now copy and paste the following into the Terminal:
Code:
sudo add-apt-repository ppa:webupd8team/java
This will add the correct PPA to your system for updated builds of Java 6 JDK that are compatible with 13.10.
No more unrecognized Java version errors! And it will update automatically with the rest of your system.
Next, we actually need to install the package. More copy-paste:
Code:
sudo apt-get update && sudo apt-get install oracle-java6-installer
Follow the on-screen instructions. You have to Accept the Licensing Agreement to complete the install. Hopefully no human centipede clauses.
Let’s make sure the correct version of Java is activated, run the following Terminal command:
Code:
java -version
You should see something like the following:
Code:
java version “1.6.0_45″
Java(TM) SE Runtime Environment (build 1.6.0_45-b06)
Java HotSpot(TM) 64-Bit Server VM (build 20.12-b01, mixed mode)
Ok, back to a fresh Terminal prompt. Time for installing the guts to build stuff in Ubuntu:
Code:
sudo apt-get install git-core gnupg ccache lzop flex bison gperf build-essential zip curl zlib1g-dev zlib1g-dev:i386 libc6-dev lib32ncurses5 lib32z1 lib32bz2-1.0 lib32ncurses5-dev x11proto-core-dev libx11-dev:i386 libreadline6-dev:i386 lib32z-dev libgl1-mesa-glx:i386 libgl1-mesa-dev g++-multilib mingw32 tofrodos python-markdown libxml2-utils xsltproc readline-common libreadline6-dev libreadline6 lib32readline-gplv2-dev libncurses5-dev lib32readline5 lib32readline6 libreadline-dev libreadline6-dev:i386 libreadline6:i386 bzip2 libbz2-dev libbz2-1.0 libghc-bzlib-dev lib32bz2-dev libsdl1.2-dev libesd0-dev squashfs-tools pngcrush schedtool libwxgtk2.8-dev python
When that is done installing, run the following command in your Terminal window:
Code:
sudo ln -s /usr/lib/i386-linux-gnu/mesa/libGL.so.1 /usr/lib/i386-linux-gnu/libGL.so
That’s it on the package side of things.
You guessed it, time for more Terminal. This really is the easiest way, seriously. And it’s totally worth it when you’re basking in the glory of a bunch of people on XDA.
The binary for a program called “repo” will let you talk to git servers and download all that precious source code. That second part after the && allows it to be executable:
Code:
mkdir ~/bin && curl http://commondatastorage.googleapis.com/git-repo-downloads/repo ~/bin/repo && chmod a+x ~/bin/repo
Use your favorite text editor to open ~/.bashrc
I like nano:
Code:
sudo nano ~/.bashrc
At the very bottom, add the following line:
Code:
export PATH=~/bin:$PATH
Save it. In nano that would be Ctrl-O and then Enter. Then Ctrl-X to exit back to a prompt. Restart bash:
Code:
source ~/.bashrc
That should be everything. Now you’re ready to build Android the right way. Luck!
4. Installing toolchain
Anyway, first order of the day is to get the official arm toolchain, which I'm going to install in /usr/local/share/ since I plan to keep using it for some time:
Code:
# cd /usr/local/share/
# git clone https://android.googlesource.com/platform/prebuilts/gcc/linux-x86/arm/arm-eabi-4.6
Cloning into 'arm-eabi-4.6'...
remote: Sending approximately 124.64 MiB ...
remote: Counting objects: 33, done
remote: Finding sources: 100% (33/33)
remote: Total 580 (delta 146), reused 580 (delta 146)
Receiving objects: 100% (580/580), 124.64 MiB | 715 KiB/s, done.
Resolving deltas: 100% (146/146), done.
Now, let's add that arm toolchain to our path:
Code:
# export PATH=$PATH:/usr/local/share/arm-eabi-4.6/bin
# arm-eabi-gcc --version
arm-eabi-gcc (GCC) 4.6.x-google 20120106 (prerelease)
Copyright (C) 2011 Free Software Foundation, Inc.
This is free software; see the source for copying conditions. There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
5. Compiling kernel
Now we need to set the variables that will tell the OS that we're cross compiling (again, something that you may want to do in your .profile using something like alias cross='export ARCH="arm";export SUBARCH="arm";export CROSS_COMPILE="arm-eabi-"'):
Code:
# export ARCH=arm
# export SUBARCH=arm
# export CROSS_COMPILE=arm-eabi-
Finally, we can initialize our default config and get going:
Prepare source for new compilation
Code:
make bcm28155_capri_ss_baffin_rev05_defconfig
HOSTCC scripts/basic/fixdep
HOSTCC scripts/kconfig/conf.o
SHIPPED scripts/kconfig/zconf.tab.c
SHIPPED scripts/kconfig/lex.zconf.c
SHIPPED scripts/kconfig/zconf.hash.c
HOSTCC scripts/kconfig/zconf.tab.o
HOSTLD scripts/kconfig/conf
arch/arm/mach-capri/custom_boards/Kconfig:19:warning: defaults for choice values not supported
arch/arm/mach-capri/custom_boards/Kconfig:25:warning: defaults for choice values not supported
arch/arm/mach-capri/custom_boards/Kconfig:31:warning: defaults for choice values not supported
arch/arm/mach-capri/custom_boards/Kconfig:37:warning: defaults for choice values not supported
#
# configuration written to .config
#
Code:
# make -j*
(...)
OBJCOPY arch/arm/boot/zImage
Kernel: arch/arm/boot/zImage is ready
* stands for number of cpus your computer has.like my has 4 so I will make it j4
* bcm28155_capri_ss_baffin_rev05_defconfig is stock config, for cm11 you will have diffrent config and for some cutom kernel something else.
6. Crafting an Android boot.img
The format of this Android boot images can be found in the bootimg.h of the mkbootimg tool from the android platform/system/core source. I guess we have to start somewhere, and we'll need to produce our own images, so let's start by fetching and recompiling mkbootimg then.
Code:
# git clone https://android.googlesource.com/platform/system/core bootimg-tools
Cloning into 'bootimg-tools'...
remote: Counting objects: 92, done
remote: Finding sources: 100% (92/92)
remote: Total 19302 (delta 11674), reused 19302 (delta 11674)
Receiving objects: 100% (19302/19302), 5.87 MiB | 655 KiB/s, done.
Resolving deltas: 100% (11674/11674), done.
# cd bootimg-tools/libmincrypt/
# gcc -c *.c -I../include
# ar rcs libmincrypt.a *.o
# cd ../mkbootimg
# gcc mkbootimg.c -o mkbootimg -I../include ../libmincrypt/libmincrypt.a
mkbootimg.c: In function 'main':
mkbootimg.c:245:9: warning: assignment discards 'const' qualifier from pointer target type [enabled by default]
# cp mkbootimg /usr/local/bin/
# cd ../cpio
# gcc mkbootfs.c -o mkbootfs -I../include
# cp mkbootfs /usr/local/bin/
New improved bootimg-tools can be found at.
Code:
# wget https://github.com/pbatard/bootimg-tools/archive/master.zip
lets compile from there
Code:
# cd /usr/src/android/bootimg-tools/mkbootimg/
# wget https://raw.github.com/pbatard/bootimg-tools/master/mkbootimg/unmkbootimg.c
# gcc -o unmkbootimg unmkbootimg.c
# cp unmkbootimg /usr/local/bin/
Now at last, you have the minimum of unmkbootimg, mkbootimg and mkbootfs installed in your path, and we can get going with our testing of the kernel.
I'll assume that you have a /usr/src/android/boot where you copied your boot.img, so let's get going....
Code:
# cd /usr/src/android/boot/
# ls
boot.img
# unmkbootimg -i boot.img
kernel written to 'kernel' (4738320 bytes)
ramdisk written to 'ramdisk.cpio.gz' (516287 bytes)
To rebuild this boot image, you can use the command:
mkbootimg --base 0 --pagesize 4096 --kernel_offset 0xa2008000 --ramdisk_offset 0xa3000000 --second_offset 0xa2f00000 --tags_offset 0xa2000100 --cmdline 'console=ttyS0,115200n8 [email protected] androidboot.console=ttyS0 vc-cma-mem=0/[email protected]' --kernel kernel --ramdisk ramdisk.cpio.gz -o boot.img
Code:
# ls
boot.img kernel ramdisk.cpio.gz
As an aside that you don't need to run, but since it should be elementary that this is the basic functionality you want from a proper boot image unpack tool, we can confirm that the data provided by the unpack tool will produce a boot.img that is binary identical to the original one-
Code:
# mkbootimg --base 0 --pagesize 4096 --kernel_offset 0xa2008000 --ramdisk_offset 0xa3000000 --second_offset 0xa2f00000 --tags_offset 0xa2000100 --cmdline 'console=ttyS0,115200n8 [email protected] androidboot.console=ttyS0 vc-cma-mem=0/[email protected]' --kernel kernel --ramdisk ramdisk.cpio.gz -o myboot.img
Code:
# ls
boot.img kernel myboot.img ramdisk.cpio.gz
# cmp -l boot.img myboot.img
#
Moving on. Since we just want to test a kernel, we shouldn't really have to touch the cpio image (ramdisk), but then again, my goal here is to give you as many pointers as I can, so we might as well see how we craft our own ramdisk while we're at it. What we're going to do here, as an academical exercise, is add an it_works file at the root of the filesystem, which we'll look for after we booted, to confirm that can use our modified stuff all the way through.
Code:
# mkdir ramdisk
# cd ramdisk
# gunzip -c ../ramdisk.cpio.gz | cpio -iu
1841 blocks
# ls
charger init.superuser.rc
data init.trace.rc
default.prop init.usb.rc
dev lpm.rc
file_contexts proc
fstab.capri_ss_baffin property_contexts
fstab.goldfish res
init sbin
init.bcm281x5.usb.rc seapp_contexts
init.capri_ss_baffin.rc sepolicy
init.cm.rc sys
init.environ.rc system
init.goldfish.rc ueventd.capri_ss_baffin.rc
init.log.rc ueventd.goldfish.rc
init.rc ueventd.rc
init.recovery.capri_ss_baffin.rc
# touch it-works
# ls
charger init.superuser.rc
data init.trace.rc
default.prop init.usb.rc
dev it-works
file_contexts lpm.rc
fstab.capri_ss_baffin proc
fstab.goldfish property_contexts
init res
init.bcm281x5.usb.rc sbin
init.capri_ss_baffin.rc seapp_contexts
init.cm.rc sepolicy
init.environ.rc sys
init.goldfish.rc system
init.log.rc ueventd.capri_ss_baffin.rc
init.rc ueventd.goldfish.rc
init.recovery.capri_ss_baffin.rc ueventd.rc
# find . | cpio -o -H newc | gzip > ../myramdisk.cpio.gz
1850 blocks
# cd ..
# ls
boot.img kernel myramdisk.cpio.gz ramdisk/ ramdisk.cpio.gz
We're finally set for the last part, where we copy the kernel we compiled earlier, and invoke mkbootimg with the set of parameters we got from unmkbootimg, and use both our modified kernel and cpio image:
Code:
# cp ~/kernel/arch/arm/boot/zImage .
# ls
boot.img kernel myramdisk.cpio.gz ramdisk/ ramdisk.cpio.gz zImage*
# mkbootimg --base 0 --pagesize 4096 --kernel_offset 0xa2008000 --ramdisk_offset 0xa3000000 --second_offset 0xa2f00000 --tags_offset 0xa2000100 --cmdline 'console=ttyS0,115200n8 [email protected] androidboot.console=ttyS0 vc-cma-mem=0/[email protected]' --kernel zImage --ramdisk myramdisk.cpio.gz -o myboot.img
# ls
boot.img kernel myboot.img myramdisk.cpio.gz ramdisk/ ramdisk.cpio.gz zImage*
7. testing new boot.img
Finally, a custom boot.img we can test. Let's press on by copying this myboot.img file into the directory we have adb and fastboot installed and run the following ser of commands which, unlike what many other guides seem to advise (what the heck, guys?), is NOT going to flash the kernel/boot.img but simply run it from memory. This means that, in case there's any mishap, you can simply power the "grand" off and you'll be good as new:
Code:
# ./adb start-server
* daemon not running. starting it now on port 5037 *
* daemon started successfully *
# ./adb reboot bootloader
# ./fastboot boot myboot.img
downloading 'boot.img'...
OKAY [ 0.223s]
booting...
OKAY [ 0.023s]
finished. total time: 0.246s
All in all, this looks fairly good. And a quick look to the root filesystem (through adb shell or through ssh) will also confirm that our it_works file is there, so we can also add whatever we want on the initial filesystem. Neat!
From there on, you can go ahead and tweak your kernel and initial filesystem exactly as you see fit. And after you have tested that everything works as it should, you can go ahead and flash the boot partition with your shiny custom boot.img, using:
ODIN or cwm flashable zip
This is last part...
8. making flashable files
Tar your boot.img file so it can be flashed with Odin.
tar cvf mynewkernel.tar boot.img
md5sum -t mynewkernel.tar >> mynewkernel.tar
mv mynewkernel.tar mynewkernel.tar.md5
Click to expand...
Click to collapse
Note:- myboot.img is renamed to boot.img
9.Flashing kernel through ODIN
Flash mynewkernel.tar.md5 with odin under PDA. Please follow the flashing guides found in other posts.
Hope i help few of you...
Please HIT thanks if you find this helpful.:laugh:
Thankyou k2wl for this tutorial and pls also tell how to get pawitp source code for rom and kernel from his repositries : https://github.com/pawitp/android_device_samsung_i9082
https://github.com/pawitp/android_kernel_samsung_i9082
Repo tool is not working because there is no android manifest file in his repository
Pls help me
mr.phantom said:
Thankyou k2wl for this tutorial and pls also tell how to get pawitp source code for rom and kernel from his repositries : https://github.com/pawitp/android_device_samsung_i9082
https://github.com/pawitp/android_kernel_samsung_i9082
Repo tool is not working because there is no android manifest file in his repository
Pls help me
Click to expand...
Click to collapse
run the following in terminal
$git clone https://github.com/pawitp/android_device_samsung_i9082.git
and
$ git clone https://github.com/pawitp/android_kernel_samsung_i9082.git
k2wl said:
run the following in terminal
$git clone https://github.com/pawitp/android_device_samsung_i9082.git
and
$ git clone https://github.com/pawitp/android_kernel_samsung_i9082.git
Click to expand...
Click to collapse
well i already have done that cloning for cm11 but it had only downloaded files around 200KB and i dont think so that cm11 source code would be that much small
hi
mr.phantom said:
well i already have done that cloning for cm11 but it had only downloaded files around 200KB and i dont think so that cm11 source code would be that much small
Click to expand...
Click to collapse
That's not cm11 source. For that u need another tutorial.
Meanwhile try wiki.CyanogenMod.org
It has instructions for Building for new device
Code:
unmkbootimg.c:25:21: fatal error: bootimg.h: No such file or directory
#include "bootimg.h"
^
compilation terminated.
Getting this while compiling unmkbootimg
i actually am surprises that there are many unofficial CMs in high ends with HALO IN IT.. though our developers try to make rom as close to real one as possible...what if the users want halo integration (as developers only know it :/)
help..
akiratoriyama said:
Code:
unmkbootimg.c:25:21: fatal error: bootimg.h: No such file or directory
#include "bootimg.h"
^
compilation terminated.
Getting this while compiling unmkbootimg
Click to expand...
Click to collapse
try compiling as a root.
k2wl said:
try compiling as a root.
Click to expand...
Click to collapse
How to convert zImage to boot.img
Or do I have to directly copy it ?
Sent from my GT-I9082 using Tapatalk
raghavsharmaxda said:
i actually am surprises that there are many unofficial CMs in high ends with HALO IN IT.. though our developers try to make rom as close to real one as possible...what if the users want halo integration (as developers only know it :/)
help..
Click to expand...
Click to collapse
k2wl said:
try compiling as a root.
Click to expand...
Click to collapse
akiratoriyama said:
How to convert zImage to boot.img
Or do I have to directly copy it ?
Sent from my GT-I9082 using Tapatalk
Click to expand...
Click to collapse
read the last section of post, it covers the conversion of zimage to boot.img...
seems you compiled successfully.
congrats.:victory:
But what about boot.img ?
We need a boot.img in /android/boot ?
Now at last, you have the minimum of unmkbootimg, mkbootimg and mkbootfs installed in your path, and we can get going with our testing of the kernel.
I'll assume that you have a /usr/src/android/boot where you copied your boot.img, so let's get going....
Click to expand...
Click to collapse
Hi @k2wl.For the part "make -j8",if you don't mind putting a sign for others to only compile at the amount of their CPU have otherwise it will caused some error for others who are compiling
1 CPU= make -j1 with least error
Sent from my iPad using Tapatalk
Really nice guide especially about packing the initramfs with the zimage to make boot.img.
Sent from my GT-I9082 using Tapatalk
akiratoriyama said:
But what about boot.img ?
We need a boot.img in /android/boot ?
Click to expand...
Click to collapse
take one from my stock kernel zip....
Techix18 said:
Hi @k2wl.For the part "make -j8",if you don't mind putting a sign for others to only compile at the amount of their CPU have otherwise it will caused some error for others who are compiling
1 CPU= make -j1 with least error
Sent from my iPad using Tapatalk
Click to expand...
Click to collapse
thanks for suggestion.
skullface said:
Really nice guide especially about packing the initramfs with the zimage to make boot.img.
Sent from my GT-I9082 using Tapatalk
Click to expand...
Click to collapse
thanks....will modify more..
k2wl said:
That's not cm11 source. For that u need another tutorial.
Meanwhile try wiki.CyanogenMod.org
It has instructions for Building for new device
Click to expand...
Click to collapse
ok will check it out and will you make a guide for that also??
mr.phantom said:
ok will check it out and will you make a guide for that also??
Click to expand...
Click to collapse
if people wanted it, will make cm11 compilation from source tutorial for it.
Thanks to ya k2wl
{
"lightbox_close": "Close",
"lightbox_next": "Next",
"lightbox_previous": "Previous",
"lightbox_error": "The requested content cannot be loaded. Please try again later.",
"lightbox_start_slideshow": "Start slideshow",
"lightbox_stop_slideshow": "Stop slideshow",
"lightbox_full_screen": "Full screen",
"lightbox_thumbnails": "Thumbnails",
"lightbox_download": "Download",
"lightbox_share": "Share",
"lightbox_zoom": "Zoom",
"lightbox_new_window": "New window",
"lightbox_toggle_sidebar": "Toggle sidebar"
}
Sent from my GT-I9082 using Tapatalk
happy developing.....glad i helped you...
keep trying for learning new features...
k2wl said:
if people wanted it, will make cm11 compilation from source tutorial for it.
Click to expand...
Click to collapse
Pls k2wl make a new tutorial which include cm11 compilation for grand from source and its kernel also
Hey @k2wl
Just wanted to say thank you for this comprehensive guide. Very detailed.
I never had any interest in tweaking a kernel. I am more of a java guy. But after reading your guide, I thought, why not?!
So I started working on it. Now I have a fully functional kernel compiled separately from the ROMs that I compile.
I even named it. Nebula Kernel.
Learning alot about kernels since I started working on it. As I am tweaking nebula for myself and i'll use this kernel as my daily driver so i'll add tweaks and governors according to me, the ones which I'll use. I like keeping things light and simple! I'll use your github for reference and help. If I face any problems, I'll ask you.
Thank you for the guide!
Building AOSP for the Nexus 6!
I want to give thanks to @sykopompos and @GROGG88. This was pretty much a concerted effort between all of us!
Preface
This is to help you learn to build, for other developers to share knowledge, for you to ask questions, etc. The main focus is not the ROM but it is in post #2 if you want to check out out!
I built this guide do to lack of 100% clear / easy resources I could not find on the net. The Google AOSP page made it seem much more difficult than it needed to be.
The intent of this guide is to streamline the process of setting up for and building AOSP!
Feel free to ask any questions about the build process. Please do not ask questions about Ubuntu / Linux!
Check out some basic edits to source in Post #2
This guide assumes the following
Have Ubuntu 14.04 setup, fully operation, and up to date. Hard Machine or Virtual, makes no difference. Must meet the minimum specs for compiling. Info from Google HERE
Understand terminal command line entry as this is all command line processes.
You are not here to ask for help with Linux, only the Android build process!
If you want to try the ROM then I have the latest build of Lollipop in this thread HERE!
Lets Begin!
Add Java
Code:
sudo apt-get install openjdk-7-jdk
Add Build tools (Adds the required packages at the time of this posting)
Code:
sudo apt-get install git-core gnupg flex bison gperf build-essential \
zip curl zlib1g-dev gcc-multilib g++-multilib libc6-dev-i386 \
lib32ncurses5-dev x11proto-core-dev libx11-dev lib32z-dev ccache \
libgl1-mesa-dev libxml2-utils xsltproc unzip
Add Repo command (Syncs Google Repository with your local machine)
Code:
mkdir ~/bin && curl http://commondatastorage.googleapis.com/git-repo-downloads/repo > ~/bin/repo && chmod a+x ~/bin/repo
Add bin folder to path for repo command (After you do this close Terminal and re-open to institute changes (easy way))
Code:
sudo gedit .bashrc
export PATH=~/bin:$PATH <-(add to end of bashrc)
Identify Yourself to the Repo (One day you may make commits so think about that when choosing your info!)
Code:
git config --global user.email "[email protected]"
git config --global user.name "yourpreferredusername"
Sync Repo (Download source... Sit back and grab a pop and a sandwich...)
Code:
mkdir ~/AOSP
cd ~/AOSP
repo init -u https://android.googlesource.com/platform/manifest -b android-6.0.1_r10
repo sync
Note: I use AOSP as my directory name. You can use what you want. You could use "aosp" or "Source" or "android" or "whateveryoulike"
Set up ccache (this makes subsequent compiling much faster!)
First: Close then re-open the terminal so you are in the home root
Code:
sudo gedit .bashrc
export USE_CCACHE=1 <-Append that line to .bashrc then save and close
cd AOSP
prebuilts/misc/linux-x86/ccache/ccache -M 25G <-I use 25 gigs but you can change that value to any size you feel appropriate)
Install proprietary binaries (Needed for things like GPS and Bluetooth, they are not Open Source like Android) (Install proprietary binaries from here in the root of AOSP folder (or whatever you called yours))
Code:
[url]https://developers.google.com/android/nexus/drivers[/url]
Run envsetup.sh
Code:
source build/envsetup.sh
Choose Device
Code:
lunch
Build it!
Code:
make -j16 otapackage
Note: using -j16 means 16 worker threads. This is fine if you have 8 logical CPU's so you may need to adjust that to a smaller or larger number if you have more or less Logical CPU's. Example: I have an i7 K edition Haswell so I have 8 logical cores; so I build with -j16. If you have an i5 quad core CPU which is 4 logical cores then you may want to consider -j8 as the set number of worker threads. Oddly enough Google actually recommends 3 to 4 times the number of logical CPU's. When I do that I have nothing but build crashes. You may need to experiment to get the right blend of performance and stability during build!
Find it
Should be located here: /home/yourusername/AOSP/out/target/product/shamu
Congrats!
Your know among the elite enthusiast that can build from source! Pat yourself on the back!
Change Log
1/10/2016
Updated guide to reflect Android 6.0.1 repository
Updated list of tools to install
3/19/2015
Updated guide to reflect Android 5.1.0 repository
Fixed Youtube, Net flix DRM play back issue. Thanks to @sykopompos for pointing me to @ayysir git hub for the fix by @BeansTown106
1/17/2015
Added ccache instructions
Listed changes for AOSP Browser to not F/C on settings
12/14/2014
Initial Release
Congrats on building but you need to make some edits to make the ROM more "useable"
Note: Attached is a complete diff from pure AOSP to the changes made / noted in this post.
With AOSP defaults you to
Reload the stock recovery on boot
Doesn't utilize all Google Location services (all the way?)
Browser settings crash
Cant Play Youtube or Netflix, etc.
The following is a list of code changes to negate all that. Ignore the Flo and Deb specific files mentioned in there as I also build for those devices too! This is sorta hard to read but once you get it the first time it will make sense. Feel free to ask questions on how to read! I have attached a copy of the "ota_from_target_files" as it is modified in this guide.
My Changes
Code:
project build/
diff --git a/tools/releasetools/ota_from_target_files b/tools/releasetools/ota_from_target_files
index 755e5c2..620f5c6 100755
--- a/tools/releasetools/ota_from_target_files
+++ b/tools/releasetools/ota_from_target_files
@@ -522,8 +522,8 @@ def WriteFullOTAPackage(input_zip, output_zip):
# set up system to update recovery partition on first boot
# complete script normally (allow recovery to mark itself finished and reboot)
- recovery_img = common.GetBootableImage("recovery.img", "recovery.img",
- OPTIONS.input_tmp, "RECOVERY")
+# recovery_img = common.GetBootableImage("recovery.img", "recovery.img",
+# OPTIONS.input_tmp, "RECOVERY")
if OPTIONS.two_step:
if not OPTIONS.info_dict.get("multistage_support", None):
assert False, "two-step packages not supported by this build"
@@ -582,11 +582,11 @@ else if get_stage("%(bcb_dev)s") == "3/3" then
if not block_based:
def output_sink(fn, data):
- common.ZipWriteStr(output_zip, "recovery/" + fn, data)
+# common.ZipWriteStr(output_zip, "recovery/" + fn, data)
system_items.Get("system/" + fn, dir=False)
- common.MakeRecoveryPatch(OPTIONS.input_tmp, output_sink,
- recovery_img, boot_img)
+# common.MakeRecoveryPatch(OPTIONS.input_tmp, output_sink,
+# recovery_img, boot_img)
system_items.GetMetadata(input_zip)
system_items.Get("system").SetPermissions(script)
@@ -730,12 +730,12 @@ def WriteBlockIncrementalOTAPackage(target_zip, source_zip, output_zip):
updating_boot = (not OPTIONS.two_step and
(source_boot.data != target_boot.data))
- source_recovery = common.GetBootableImage(
- "/tmp/recovery.img", "recovery.img", OPTIONS.source_tmp, "RECOVERY",
- OPTIONS.source_info_dict)
- target_recovery = common.GetBootableImage(
- "/tmp/recovery.img", "recovery.img", OPTIONS.target_tmp, "RECOVERY")
- updating_recovery = (source_recovery.data != target_recovery.data)
+# source_recovery = common.GetBootableImage(
+# "/tmp/recovery.img", "recovery.img", OPTIONS.source_tmp, "RECOVERY",
+# OPTIONS.source_info_dict)
+# target_recovery = common.GetBootableImage(
+# "/tmp/recovery.img", "recovery.img", OPTIONS.target_tmp, "RECOVERY")
+# updating_recovery = (source_recovery.data != target_recovery.data)
system_src = GetImage("system", OPTIONS.source_tmp, OPTIONS.source_info_dict)
system_tgt = GetImage("system", OPTIONS.target_tmp, OPTIONS.target_info_dict)
@@ -1104,12 +1104,12 @@ def WriteIncrementalOTAPackage(target_zip, source_zip, output_zip):
updating_boot = (not OPTIONS.two_step and
(source_boot.data != target_boot.data))
- source_recovery = common.GetBootableImage(
- "/tmp/recovery.img", "recovery.img", OPTIONS.source_tmp, "RECOVERY",
- OPTIONS.source_info_dict)
- target_recovery = common.GetBootableImage(
- "/tmp/recovery.img", "recovery.img", OPTIONS.target_tmp, "RECOVERY")
- updating_recovery = (source_recovery.data != target_recovery.data)
+# source_recovery = common.GetBootableImage(
+# "/tmp/recovery.img", "recovery.img", OPTIONS.source_tmp, "RECOVERY",
+# OPTIONS.source_info_dict)
+# target_recovery = common.GetBootableImage(
+# "/tmp/recovery.img", "recovery.img", OPTIONS.target_tmp, "RECOVERY")
+# updating_recovery = (source_recovery.data != target_recovery.data)
# Here's how we divide up the progress bar:
# 0.1 for verifying the start state (PatchCheck calls)
@@ -1313,9 +1313,9 @@ else
script.Print("Unpacking new vendor files...")
script.UnpackPackageDir("vendor", "/vendor")
- if updating_recovery and not target_has_recovery_patch:
- script.Print("Unpacking new recovery...")
- script.UnpackPackageDir("recovery", "/system")
+# if updating_recovery and not target_has_recovery_patch:
+# script.Print("Unpacking new recovery...")
+# script.UnpackPackageDir("recovery", "/system")
system_diff.EmitRenames(script)
if vendor_diff:
project device/asus/flo/
diff --git a/aosp_flo.mk b/aosp_flo.mk
index 6f1ad0c..c1c99fb 100644
--- a/aosp_flo.mk
+++ b/aosp_flo.mk
@@ -24,7 +24,7 @@ $(call inherit-product, $(SRC_TARGET_DIR)/product/aosp_base.mk)
PRODUCT_NAME := aosp_flo
PRODUCT_DEVICE := flo
PRODUCT_BRAND := Android
-PRODUCT_MODEL := AOSP on Flo
+PRODUCT_MODEL := Nexus 7
PRODUCT_MANUFACTURER := ASUS
PRODUCT_RESTRICT_VENDOR_FILES := true
diff --git a/system.prop b/system.prop
index 937fbb7..dc3a07f 100644
--- a/system.prop
+++ b/system.prop
@@ -3,3 +3,4 @@
#LTE, GSM, WCDMA(9)
#
ro.telephony.default_network=9
+persist.sys.usb.config=mtp,adb
project device/moto/shamu/
diff --git a/aosp_shamu.mk b/aosp_shamu.mk
index e5fa301..ef53d06 100644
--- a/aosp_shamu.mk
+++ b/aosp_shamu.mk
@@ -26,7 +26,7 @@ $(call inherit-product, $(SRC_TARGET_DIR)/product/aosp_base_telephony.mk)
PRODUCT_NAME := aosp_shamu
PRODUCT_DEVICE := shamu
PRODUCT_BRAND := Android
-PRODUCT_MODEL := AOSP on Shamu
+PRODUCT_MODEL := Nexus 6
PRODUCT_MANUFACTURER := motorola
PRODUCT_RESTRICT_VENDOR_FILES := true
project frameworks/base/
diff --git a/core/res/res/drawable-sw600dp-nodpi/default_wallpaper.jpg b/core/res/res/drawable-sw600dp-nodpi/default_wallpaper.jpg
index 03a14c0..9ab8944 100644
Binary files a/core/res/res/drawable-sw600dp-nodpi/default_wallpaper.jpg and b/core/res/res/drawable-sw600dp-nodpi/default_wallpaper.jpg differ
diff --git a/core/res/res/values/config.xml b/core/res/res/values/config.xml
index 8006659..cfd55b1 100644
--- a/core/res/res/values/config.xml
+++ b/core/res/res/values/config.xml
@@ -946,6 +946,7 @@
-->
<string-array name="config_locationProviderPackageNames" translatable="false">
<!-- The standard AOSP fused location provider -->
+ <item>com.google.android.gms</item>
<item>com.android.location.fused</item>
</string-array>
project packages/apps/Browser/
diff --git a/src/com/android/browser/BrowserPreferencesPage.java b/src/com/android/browser/BrowserPreferencesPage.java
index 6e6da17..cd91f11 100644
--- a/src/com/android/browser/BrowserPreferencesPage.java
+++ b/src/com/android/browser/BrowserPreferencesPage.java
@@ -43,6 +43,12 @@ public class BrowserPreferencesPage extends PreferenceActivity {
}
}
+ @Override
+ protected boolean isValidFragment(String fragmentName) {
+ return true;
+ }
+
+
/**
* Populate the activity with the top-level headers.
*/
@@ -82,8 +88,7 @@ public class BrowserPreferencesPage extends PreferenceActivity {
} else {
finish();
}
- return true;
- }
+ return true; }
return false;
}
@@ -98,4 +103,5 @@ public class BrowserPreferencesPage extends PreferenceActivity {
return intent;
}
+
}
project system/core/
diff --git a/rootdir/init.rc b/rootdir/init.rc
index 8ba7c10..e5120f1 100644
--- a/rootdir/init.rc
+++ b/rootdir/init.rc
@@ -594,9 +594,8 @@ service installd /system/bin/installd
class main
socket installd stream 600 system system
-service flash_recovery /system/bin/install-recovery.sh
+service flash_recovery /system/etc/install-recovery.sh
class main
- seclabel u:r:install_recovery:s0
oneshot
service racoon /system/bin/racoon
Now to fix Youtube and Netflix, etc...
You will need to add the following changes from Ayysir's git hub Here: Add QCOM targert-specific cong & helper macros
Are we going to get a shamu clean rom? Glad to see you here @scrosler!
Sent from my Nexus 6
housry23 said:
Are we going to get a shamu clean rom? Glad to see you here @scrosler!
Sent from my Nexus 6
Click to expand...
Click to collapse
For sure!
I am just still playing with it. I had it barely over 24hrs... So far I am crazy impressed with it!
That's the best news I've heard so far! After running tons of different roms I always end up coming back to cleanrom, and I use it on all of my touchwiz devices.
xlemonhed1 said:
That's the best news I've heard so far! After running tons of different roms I always end up coming back to cleanrom, and I use it on all of my touchwiz devices.
Click to expand...
Click to collapse
Very cool. Dont know when I will get started but I hope this weekend.
I am going to make it identical to my Nexus 7 ROM.
They seem to like it :highfive:
scrosler said:
For sure!
I am just still playing with it. I had it barely over 24hrs... So far I am crazy impressed with it!
Click to expand...
Click to collapse
Nice! I ran Cleanrom on my nexus 7 and loved it. Thanks in advance. I'll be watching for it. It is an impressive device. Enjoy!
Sent from my Nexus 6
Well, congrats on the new device! I was window shopping them a week ago, and couldn't justify it yet. I'm sure you'll enjoy!
**edit**
Also, the patched source files in the Nexus 7 thread will work to a degree. I do have Shamu binaries added in, but some of the features I've added are device specific and have not been applied to Shamu. The last build I made for Shamu was on 11/23 and I decided not to continue with it.
Yes, I was window shopping too and could NOT resist!
They make it so tempting with these "Next" and "Edge" programs!
reported to moderator (with a request to make it sticky)
Wow amazing! I'm going to give this a try when I get home from work! Just two questions.. How to compile with another tool chain such as sabermod or linaro? And how to compile it with a different kernel?
Xileforce said:
Wow amazing! I'm going to give this a try when I get home from work! Just two questions.. How to compile with another tool chain such as sabermod or linaro? And how to compile it with a different kernel?
Click to expand...
Click to collapse
I am not an expert by any means but you will need to change the make files that point to the tool chain. It should not be that hard.
Same for the kernel.
IM sure another, more experienced AOSP developer will explain in greater detail (cough @GROGG88) :good:
scrosler said:
I am not an expert by any means but you will need to change the make files that point to the tool chain. It should not be that hard.
Same for the kernel.
IM sure another, more experienced AOSP developer will explain in greater detail (cough @GROGG88) :good:
Click to expand...
Click to collapse
Thanks man! I'm sure between this and Google I'll be able to figure it out!
For your code changes in the tutorial for building AOSP for the Nexus 6. Are there multiple files I need to change the code in or is it a single .mk file or different extension? I haven't been able to locate a file with similar code. If you could just let me know which files that is all I am asking, I can figure out the rest I think!
If anyone knows what files need to be edited feel free to reply!
Xileforce said:
And how to compile it with a different kernel?
Click to expand...
Click to collapse
It depends. To compile with another (prebuilt) kernel, you can just overwrite the prebuilt kernel in.. I think it's in ./device/moto/shamu-kernel. (If you rename the kernel image to match the existing file, that's all you have to do.)
On the other hand, if you want to compile a new kernel while building the rest of AOSP, there are several changes that you'll have to make (even for the stock kernel.) Here's a link to a page that might get you started: http://nosemaj.org/howto-build-android-kitkat-nexus-5 (The instructions are for kitkat on a nexus5, but they should be good enough to give you an idea of what you need to do.)
Take care
gary
EmptyGODFATHER said:
For your code changes in the tutorial for building AOSP for the Nexus 6. Are there multiple files I need to change the code in or is it a single .mk file or different extension? I haven't been able to locate a file with similar code. If you could just let me know which files that is all I am asking, I can figure out the rest I think!
If anyone knows what files need to be edited feel free to reply!
Click to expand...
Click to collapse
There are multiple files. Most of them pertain to the Nexus 7 and can be skipped. The Repo Diff command can be hard to read but I will tty to break it down a little bit so you can understand how to read that file....
I will use the "remove recovery" commit we found I think from @simpleaOSP.
Ex:
Project -> project build/ (So this means we ill make edits in the build folder)
diff --git a (Shows where the difference start)/tools/releasetools/ota_from_target_files b/tools/releasetools/ota_from_target_files (Name of file we will be modifying)
index 755e5c2..1951e95 100755
--- a/tools/releasetools/ota_from_target_files
+++ b/tools/releasetools/ota_from_target_files
(Prefaced lines to help you find your place in the file)
@@ -522,8 +522,8 @@ def WriteFullOTAPackage(input_zip, output_zip):
# set up system to update recovery partition on first boot
# complete script normally (allow recovery to mark itself finished and reboot)
Actual Changes...
- = Remove line
+ = Add line....
In this example: I put "#" to comment out building the recovery image.
Original
- recovery_img = common.GetBootableImage("recovery.img", "recovery.img",
- OPTIONS.input_tmp, "RECOVERY")
Modded
+# recovery_img = common.GetBootableImage("recovery.img", "recovery.img",
+# OPTIONS.input_tmp, "RECOVERY")
(More Prefaced lines to help you find your place in the file)
if OPTIONS.two_step:
if not OPTIONS.info_dict.get("multistage_support", None):
assert False, "two-step packages not supported by this build"
@@ -582,11 +582,11 @@ else if get_stage("%(bcb_dev)s") == "3/3" then
Click to expand...
Click to collapse
Now thare are more changes in that file and more files in the Diff. IM not savvy enough with git to post it all to a git but using tha tfile and taking the time to look at and search for the file locations will get you the same results.
I also know this is not a "great" explanation of the repo diff changes so if anyone can explain it better than me I will NOT be offended.
For @Xileforce
scrosler said:
IM sure another, more experienced AOSP developer will explain in greater detail (cough @GROGG88) :good:
Click to expand...
Click to collapse
Damnit Jim! I'm a Doctor, not a Shamu owner... Heck, I'm not even a "Developer". I"m a "Contributor"
garyd9 said:
It depends. To compile with another (prebuilt) kernel, you can just overwrite the prebuilt kernel in.. I think it's in ./device/moto/shamu-kernel. (If you rename the kernel image to match the existing file, that's all you have to do.)
On the other hand, if you want to compile a new kernel while building the rest of AOSP, there are several changes that you'll have to make (even for the stock kernel.) Here's a link to a page that might get you started: http://nosemaj.org/howto-build-android-kitkat-nexus-5 (The instructions are for kitkat on a nexus5, but they should be good enough to give you an idea of what you need to do.)
Take care
gary
Click to expand...
Click to collapse
Yes, those instructions work well! I fought for a little bit to get the Nexus 7 kernel to compile with the 4.8 toolchain. As a result I had things setup to compile the kernel before the firmware and using the output as my prebuilt directory specified in the device-common.mk which should be 'device.mk' for shamu. I have scripts setup for the 3 devices I'm building for that take care of cleaning and building everything. I have since modified my scripts to run the 4.8 toolchain within the AOSP tree instead of an external 4.6 toolchain... It's basically outlined here:
GROGG88 said:
AOSP PATCHES:
DOWNLOAD
(these are built into the firmware above)
**Patch/Build instruction**
Make sure your source tree is located in ~/AOSP
Clone kernel sources and checkout for devices using:
Code:
cd ~/AOSP
git clone https://android.googlesource.com/kernel/msm.git hh-kernel/kernel
git clone https://android.googlesource.com/kernel/msm.git flo-kernel/kernel
cd hh-kernel/kernel
git checkout 88fbc66
cd ../../flo-kernel/kernel
git checkout 154bef4
Download and copy my patches to ~/AOSP
Commit flo kernel changes if desired
Code:
cd ~/AOSP/flo-kernel/kernel
git commit -a
Enter a description, ctrl+x and then enter to commit.
You can now use the included scripts to build 1/3 devices:
Code:
$cd ~/AOSP
./build-hammerhead.sh
or
./build-flo.sh
or
./build-deb.sh
That's it!! Grab your custom firmware and FLASH!
Click to expand...
Click to collapse
It's turning it into a two step process, but the result is the same. As far as compiling with a different toolchain is concerned, I have yet to try. I shy away from many of the "optimizations" and really just target physical features that I feel are missing from stock AOSP.
Hahahaha! Your the man Dude!
We need DLMontage over here too. I hope he gets a Nex6.
You need to get one!
Thanks guys! I'll be giving the things you guys said a shot.. I'm sure I'll figure it out. This is my first try every compiling a rom,, so it should be interesting lol.. Though I'm sure it will be significantly easier after the first time.
Xileforce said:
Thanks guys! I'll be giving the things you guys said a shot.. I'm sure I'll figure it out. This is my first try every compiling a rom,, so it should be interesting lol.. Though I'm sure it will be significantly easier after the first time.
Click to expand...
Click to collapse
It does get easier each time... Or more frustrating depending on what changes you make, lol
EDIT:I've haven't had the need to setup a recovery build environment in sometime now, as such, I'd no longer maintaining this, beginners and novice users are recommended to follow standard setup, while advanced users can probably adopt this to work for them.
So lately I broke my CM11 base which i use for kernel/recovery compiling,
trying nearly everything to fix it failed, So i took the lazy route, deleted it and started a new base,
So for the moment, I left it sync'ing and went to watch the TV, knowing it takes around 3 hours for a full sync,
came back few hours later and sync was complete and before anything I scrolled he terminal backup and realised there is alot of 'junk' that is of no use to kernel/recovery compiling, so I asked around and i was told Helicopter88 had a minimal setup just for that, but it's out of date,
and from one thing into another I came up with this.
This is a stripped down version of CM11 that allows you to compile recoveries from,
It's main feature is that all(most) of the 'junk' which isn't used in recovery build is removed not only saving you time in downloading but also space,
Sync'ing this setup took me 1 hour and 4 minutes and saved me alot of space and download bandwidth.
(for a bit of transparency, I'm running a slightly modified setup, so there can be some discrepancies in the steps, if that’s the case, post about it and hopefully I'll fix it, though looking through, everything seems correct, I'll also describe my setup in a new post below if you're interested)
1) setup your packages
For linux based systems (32bit & 64bit)
Code:
sudo apt-get install bison build-essential curl flex git gnupg gperf libesd0-dev liblz4-tool libncurses5-dev libsdl1.2-dev libwxgtk2.8-dev libxml2 libxml2-utils lzop openjdk-6-jdk openjdk-6-jre pngcrush schedtool squashfs-tools xsltproc zip zlib1g-dev
For Linux based System (64bits ONLY)
Code:
sudo apt-get install g++-multilib gcc-multilib lib32ncurses5-dev lib32readline-gplv2-dev lib32z1-dev
2) Setup Repo
Change droid_root to whatever directory you prefer
Code:
mkdir -p ~/bin
PATH="$HOME/bin:$PATH"
curl https://storage.googleapis.com/git-repo-downloads/repo > ~/bin/repo
chmod a+x ~/bin/repo
droid_root="~/android/cm11"
mkdir -p ~/$droid_root
cd [I]droid_root[/I]
repo init -u https://github.com/Thunder07/minimal_android.git -b cm-11.0_min
3) Setup Up Environment
Now, you're almost done, just wait for the sync to finish and run these commands,
Which will setup your environment and download your device tree if required.
remove the {} and replace the content with actual device code name
Do also keep in-mind that you'd need to run these 2 lines every-time you start a new shell when building the recovery.
and that you're cd into your droid_root.
Note: calling breakfast the 1st time will through few error, call it again should throw a dependency error, which we will fix in the next step
Code:
source build/envsetup.sh
breakfast {DEVICE_CODE_NAME}
I'm using an htc one x, so my commands would look like this
DONT RUN THIS CODE, ITS FOR HTC ONE X ONLY
Code:
source build/envsetup.sh
breakfast endeavouru
4) Removing Android Build Requirements
the error should look something like this
Code:
build/core/product_config.mk:239: *** _nic.PRODUCTS.[[device/BRAND/DEVICE/cm.mk]]: "[B]hardware[/B]/ti/wlan/mac80211/wl128x-wlan-products.mk" does not exist. Stop.
and as you might have guessed from the word hardware, the build (CM) is expecting files assoicated with hardware, which are not required by the recovery.
Open $droid_root/device/BRAND/DEVICE/ preferably in file manager
Note: that DEVICE & BRAND refer to you device name and brand and not a directory called BRAND/DEVICE
open cm.mk and change this
Code:
# Inherit some common CM stuff.
$(call inherit-product, vendor/cm/config/common_full_phone.mk)
# Enhanced NFC
$(call inherit-product, vendor/cm/config/nfc_enhanced.mk)
# Inherit device configuration
$(call inherit-product, device/htc/endeavoru/full_endeavoru.mk)
To look like this.
Don't copy and paste as these file contains reference to my device (htc/endeavoru)
as you can see the highlighted bit is the changes you need to make.
Code:
# Inherit some common CM stuff.
$(call inherit-product, vendor/cm/config/[B][COLOR="Green"]common.mk[/COLOR][/B])
# Enhanced NFC
[B][COLOR="Green"]#[/COLOR][/B]$(call inherit-product, vendor/cm/config/nfc_enhanced.mk)
# Inherit device configuration
[B][COLOR="Green"]#[/COLOR][/B]$(call inherit-product, device/htc/endeavoru/full_endeavoru.mk)
Now, onto DEVICE.mk
is a bit more messy to desribe so i paste a diff to illustrate: http://pastebin.com/jNDGhSPe
Note you can probably get away with leaving PRODUCT_COPY_FILES alone and just removing the hardware related $(call inherit-product, hardware/*.mk)
but just as well, you've got no use for them in this current setup
5) Build
Bofore you start Building, make sure you're building the recovery you want TWRP/CWM/CWM_Phil/CM simple Recovery cloned into $droid_root/bootable/recovery/
Now for the building part itself, this will build the kernel & recovery and create a flashable image
Note:Make sure you're cd'ed to $droid_root and remember to do step 3 EVERYTIME you open a new shell
Code:
mka recoveryimage
Reserve: advance setup
To speed up the building process I've taken the process a step further, instead of building the kernel with the recovery,
I'd build both seperately and use the zImage as a prebuilt image, that way whenever I can "mka recoveryimage", I dont have to go through the process of building the zImage, even though it might already be built and fast enough, I'd rather just skip it all,
if you want to do the same, follow this.
For this part I'm assuming you know how to build a kernel, so i wont go through it.
so open $droid_root/device/BRAND/DEVICE/Boardconfig.mk
Code:
TARGET_KERNEL_SOURCE := kernel/BRAND/DEVICE
TARGET_KERNEL_CONFIG := cyanogenmod_endeavoru_defconfig
replace it with this
Code:
TARGET_PREBUILT_KERNEL := LOCATION_TO_PREBUILT_ZIMAGE
TARGET_PREBUILT_RECOVERY_KERNEL := LOCATION_TO_PREBUILT_ZIMAGE
open AndroidBoard.mk
Note: your AndroidBoard.mk may already have this, so be sure to check before replacing anything.
Code:
ALL_PREBUILT += $(INSTALLED_KERNEL_TARGET)
Replace With
Code:
file := $(INSTALLED_KERNEL_TARGET)
ALL_PREBUILT += $(file)
$(file): $(TARGET_PREBUILT_KERNEL) | $(ACP)
$(transform-prebuilt-to-target)
and you're done,
Now whenever you run "mka recoveryimage", a prebuilt zImage will be used,
and whenever you rebuild your kernel, "mka recoveryimage" would use that image.
reserve... just incase
Can I use Minimal set up for cm12.0 for building CWM recovery?
Thunder07 said:
reserve... just incase
Click to expand...
Click to collapse
Can I follow this guide for making a CWM recovery for compiling a CWM recovery for my android mobile(Celkon Q 500, android 4.4.2, Broadcom chip based), by replacing cm11.0 with cm 12.0? Please guide.
Eversmile23 said:
Can I follow this guide for making a CWM recovery for compiling a CWM recovery for my android mobile(Celkon Q 500, android 4.4.2, Broadcom chip based), by replacing cm11.0 with cm 12.0? Please guide.
Click to expand...
Click to collapse
Hi, sorry for the late reply, I'm buzy these days,
but I just updated the repo to allow for that.
though I didn't/dont have the time to test the changes myself.
Can youexplain a bit furher>
Thunder07 said:
Hi, sorry for the late reply, I'm buzy these days,
but I just updated the repo to allow for that.
though I didn't/dont have the time to test the changes myself.
Click to expand...
Click to collapse
As I am new to this 'building from source', I could not understand your statement ' I just updated the repo to allow for that'. What exactly, I will have to do to achieve my goal as I stated previously?
Eversmile23 said:
As I am new to this 'building from source', I could not understand your statement ' I just updated the repo to allow for that'. What exactly, I will have to do to achieve my goal as I stated previously?
Click to expand...
Click to collapse
You asked if you can use cm12 for the recovery building, before yesterday the answer was no, but I've updated the repo to use cm12 code... If you change cm11 to cm12 that is.
Also, if you're new to this, I'll avoid this particular guide as I won't be able to guide you through it if it doesn't work, as I'm busy for the next 2 weeks.
Sent from my A0001 using XDA Free mobile app
Good job
Gửi từ SM-G906K của tôi bằng cách sử dụng Tapatalk
Please help. I do not undertstand why 'repo sync' always fails at a particular stage, though I have 30+ GB of disk space available in my working folder named 'cm12'. Following is the last screen message :
Fetching project platform/external/ant-glob
Fetching projects: 8% (40/495) Receiving objects: 86% (2389/2771), 26.68 MiBerror: RPC failed; result=56, HTTP code = 200iB | 124.00 KiB/s
fatal: The remote end hung up unexpectedly
fatal: early EOF
fatal: index-pack failed
remote: Sending approximately 1.94 GiB ...
remote: Counting objects: 85, done
remote: Finding sources: 100% (85/85)
error: RPC failed; result=56, HTTP code = 200iB | 88.00 KiB/s
fatal: The remote end hung up unexpectedly
Now should I run 'repo sync' again or should I use 'repo sync -j1' ?
topic no support good
Gửi từ MX4 Pro của tôi bằng cách sử dụng Tapatalk
Eversmile23 said:
Please help. I do not undertstand why 'repo sync' always fails at a particular stage, though I have 30+ GB of disk space available in my working folder named 'cm12'. Following is the last screen message :
Fetching project platform/external/ant-glob
Fetching projects: 8% (40/495) Receiving objects: 86% (2389/2771), 26.68 MiBerror: RPC failed; result=56, HTTP code = 200iB | 124.00 KiB/s
fatal: The remote end hung up unexpectedly
fatal: early EOF
fatal: index-pack failed
remote: Sending approximately 1.94 GiB ...
remote: Counting objects: 85, done
remote: Finding sources: 100% (85/85)
error: RPC failed; result=56, HTTP code = 200iB | 88.00 KiB/s
fatal: The remote end hung up unexpectedly
Now should I run 'repo sync' again or should I use 'repo sync -j1' ?
Click to expand...
Click to collapse
No point in using j1, try sync, if it fails you might have to start fresh.
But the error at it reads is an error in the host and not your problem.
29y6145 said:
topic no support good
Gửi từ MX4 Pro của tôi bằng cách sử dụng Tapatalk
Click to expand...
Click to collapse
Sent from my A0001 using XDA Free mobile app
Thunder07 said:
So lately I broke my CM11 base which i use for kernel/recovery compiling,
trying nearly everything to fix it failed, So i took the lazy route, deleted it and started a new base,
So for the moment, I left it sync'ing and went to watch the TV, knowing it takes around 3 hours for a full sync,
came back few hours later and sync was complete and before anything I scrolled he terminal backup and realised there is alot of 'junk' that is of no use to kernel/recovery compiling, so I asked around and i was told Helicopter88 had a minimal setup just for that, but it's out of date,
and from one thing into another I came up with this.
This is a stripped down version of CM11 that allows you to compile recoveries from,
It's main feature is that all(most) of the 'junk' which isn't used in recovery build is removed not only saving you time in downloading but also space,
Sync'ing this setup took me 1 hour and 4 minutes and saved me alot of space and download bandwidth.
(for a bit of transparency, I'm running a slightly modified setup, so there can be some discrepancies in the steps, if that’s the case, post about it and hopefully I'll fix it, though looking through, everything seems correct, I'll also describe my setup in a new post below if you're interested)
1) setup your packages
For linux based systems (32bit & 64bit)
Code:
sudo apt-get install bison build-essential curl flex git gnupg gperf libesd0-dev liblz4-tool libncurses5-dev libsdl1.2-dev libwxgtk2.8-dev libxml2 libxml2-utils lzop openjdk-6-jdk openjdk-6-jre pngcrush schedtool squashfs-tools xsltproc zip zlib1g-dev
For Linux based System (64bits ONLY)
Code:
sudo apt-get install g++-multilib gcc-multilib lib32ncurses5-dev lib32readline-gplv2-dev lib32z1-dev
2) Setup Repo
Change droid_root to whatever directory you prefer
Code:
mkdir -p ~/bin
PATH="$HOME/bin:$PATH"
curl https://storage.googleapis.com/git-repo-downloads/repo > ~/bin/repo
chmod a+x ~/bin/repo
droid_root="~/android/cm11"
mkdir -p ~/$droid_root
cd [I]droid_root[/I]
repo init -u https://github.com/Thunder07/minimal_android.git -b cm-11.0_min
3) Setup Up Environment
Now, you're almost done, just wait for the sync to finish and run these commands,
Which will setup your environment and download your device tree if required.
remove the {} and replace the content with actual device code name
Do also keep in-mind that you'd need to run these 2 lines every-time you start a new shell when building the recovery.
and that you're cd into your droid_root.
Note: calling breakfast the 1st time will through few error, call it again should throw a dependency error, which we will fix in the next step
Code:
source build/envsetup.sh
breakfast {DEVICE_CODE_NAME}
I'm using an htc one x, so my commands would look like this
DONT RUN THIS CODE, ITS FOR HTC ONE X ONLY
Code:
source build/envsetup.sh
breakfast endeavouru
4) Removing Android Build Requirements
the error should look something like this
Code:
build/core/product_config.mk:239: *** _nic.PRODUCTS.[[device/BRAND/DEVICE/cm.mk]]: "[B]hardware[/B]/ti/wlan/mac80211/wl128x-wlan-products.mk" does not exist. Stop.
and as you might have guessed from the word hardware, the build (CM) is expecting files assoicated with hardware, which are not required by the recovery.
Open $droid_root/device/BRAND/DEVICE/ preferably in file manager
Note: that DEVICE & BRAND refer to you device name and brand and not a directory called BRAND/DEVICE
open cm.mk and change this
Code:
# Inherit some common CM stuff.
$(call inherit-product, vendor/cm/config/common_full_phone.mk)
# Enhanced NFC
$(call inherit-product, vendor/cm/config/nfc_enhanced.mk)
# Inherit device configuration
$(call inherit-product, device/htc/endeavoru/full_endeavoru.mk)
To look like this.
Don't copy and paste as these file contains reference to my device (htc/endeavoru)
as you can see the highlighted bit is the changes you need to make.
Code:
# Inherit some common CM stuff.
$(call inherit-product, vendor/cm/config/[B][COLOR="Green"]common.mk[/COLOR][/B])
# Enhanced NFC
[B][COLOR="Green"]#[/COLOR][/B]$(call inherit-product, vendor/cm/config/nfc_enhanced.mk)
# Inherit device configuration
[B][COLOR="Green"]#[/COLOR][/B]$(call inherit-product, device/htc/endeavoru/full_endeavoru.mk)
Now, onto DEVICE.mk
is a bit more messy to desribe so i paste a diff to illustrate: http://pastebin.com/jNDGhSPe
Note you can probably get away with leaving PRODUCT_COPY_FILES alone and just removing the hardware related $(call inherit-product, hardware/*.mk)
but just as well, you've got no use for them in this current setup
5) Build
Bofore you start Building, make sure you're building the recovery you want TWRP/CWM/CWM_Phil/CM simple Recovery cloned into $droid_root/bootable/recovery/
Now for the building part itself, this will build the kernel & recovery and create a flashable image
Note:Make sure you're cd'ed to $droid_root and remember to do step 3 EVERYTIME you open a new shell
Code:
mka recoveryimage
Click to expand...
Click to collapse
i need to change endevoru to my device name and htc to n=my brand name everywhere.. right??
jackey31 said:
i need to change endevoru to my device name and htc to n=my brand name everywhere.. right??
Click to expand...
Click to collapse
basically, but each device tree is different, so this tutorial is to explain how and why to do it.
you probably need some basic knowledge of how to build the recovery using the proper way, before attempting this.
can you port for me??? please
Thunder07 said:
basically, but each device tree is different, so this tutorial is to explain how and why to do it.
you probably need some basic knowledge of how to build the recovery using the proper way, before attempting this.
Click to expand...
Click to collapse
thanks for writing such a great guide for compiling cwm..
but i can't do this bcause i don't know much abt it ..
i don't have linux based os..
very slow and limited internet connection, would probably take a week to download 4gb source.. ..
so can you port for my device.. i will upload..
recovery.img
boot.img
build.prop
and i have extracted recovery.fstab so know the mount points..
thanking you in advance..
syncing repo..
Thunder07 said:
basically, but each device tree is different, so this tutorial is to explain how and why to do it.
you probably need some basic knowledge of how to build the recovery using the proper way, before attempting this.
Click to expand...
Click to collapse
i installed linux mint in virtual box.. currently syncing repo...
my net gets disconnected after 40 minutes i don't know why... so i have run repo sync again every time i got disconnected.
has it started syncing from the begining?? or just picked up from the last point when my net got disconnected??
will i ever be able to sync it??..
jackey31 said:
i installed linux mint in virtual box.. currently syncing repo...
my net gets disconnected after 40 minutes i don't know why... so i have run repo sync again every time i got disconnected.
has it started syncing from the begining?? or just picked up from the last point when my net got disconnected??
will i ever be able to sync it??..
Click to expand...
Click to collapse
if you run "repo sync" after you're disconnected it will continue from where it left off.
can't sync
Thunder07 said:
if you run "repo sync" after you're disconnected it will continue from where it left off.
Click to expand...
Click to collapse
i can never sync this repo.. my connection drops after 400 mb so stuck at 70 % project 80/114 platform/prebuilts/tools 445mb..
i have run repo sync several time it starts downloading this project from the beginning.. :crying::crying:
i does not actually resume it restarts the project which was not completely downloaded.
This is My first guide on XDA
From the day I owned Le2 I always wished to compile my own kernel. I searched on the web for compiling 64bit android kernel but didn't get satisfying results. So I did some research and asked some android developers, I got help from some developers but some of the developer refused may be due to their attitude or may be they didn't want to share their ideas / knowledge. So i saw some kind devs trying things out for our device.Then we created a team ,and i met really kind and expert developers there.Later leeco released the kernel sources.People claimed it was not working.But our team worked too hard to get it work.
What will you need :
1. Ubuntu 64 Bit OS
2. Good Internet Connection.
3. Basic Knowledge of Linux.
4.A little common sense
Lets Start
First we need to get some important stuff / tools / software .
1. Open Ubuntu Software center and install JDK 7 or JDK 8
2. Open terminal and run the following command
Code:
sudo apt-get install libncurses5-dev
Code:
sudo apt-get install git-core gnupg flex bison gperf build-essential zip curl libc6-dev libncurses5-dev:i386 x11proto-core-dev libx11-dev:i386 libreadline6-dev:i386 libgl1-mesa-glx:i386 libgl1-mesa-dev g++-multilib tofrodos python-markdown libxml2-utils xsltproc zlib1g-dev:i386
Code:
sudo ln -s /usr/lib/i386-linux-gnu/mesa/libGL.so.1 /usr/lib/i386-linux-gnu/libGL.so
Code:
sudo apt-get install -y ccache &&echo 'export PATH="/usr/lib/ccache:$PATH"' | tee -a ~/.bashrc &&source ~/.bashrc && echo $PATH
Code:
export USE_CCACHE=1
Code:
mkdir ~/bin
Code:
export PATH=~/bin:$PATH
Code:
curl https://dl-ssl.google.com/dl/googlesource/git-repo/repo > ~/bin/repo
Code:
chmod a+x ~/bin/repo
Now ur'r Linux machine is all set to compile kernel.
3. Now you need to download a toolchain.Use any 64 bit compatible toolchain .In my case i am using uber toolchain "aarch-linux-android-4.9"
create a folder kernel
now
type
Code:
cd kernel
Code:
git clone https://bitbucket.org/UBERTC/aarch64-linux-android-4.9.git
4. Time to download Kernel sources. For this tutorial I am using our team's kernel source. Here is the link for our sources > h t t p s ://github.com/s2-devs/android_kernel_leeco_msm8976
.Select branch as stock-6.0 from left and press download on the right.
5. place both this zip in "kernel" directory which we made in previous step.
6. Extract the zip in the "kernel". Now you will have two folders one of toolchain and other of kernel source.
7. Open the kernel source folder and type the following code.
9. Run the following command to point the variable to toolchains path :
in my case:
Code:
export CROSS_COMPILE=/home/Bh-singhal/kernel/aarch64-linux-android-4.9/bin/aarch64-linux-android-
If you followed along with me you will just have to change the name of the user ( replace <Bh-singhal> with <ur's username> )
10. Time to Compile your kernel :
Code:
export ARCH=arm64
Code:
make s2-perf_defconfig
The name of defconfig file may be different in future check it in "kernel/le2skernelsource/arch/arm64/defconfig/"
Now the final command make. It takes a parameter -jn. Where ( n = # of threads per core + 1 )
I have a Dual core processor with 2 thread per processor so for me it is " make -j3 ".
Code:
make -j3
Now sit back and relax.......let the kernel compile
Got a compilation error ?
Post it here.
NOW FINAL STEP
DUE TO WHICH MANY PEOPLE DID NOT GET KERNEL BOOTING
3. Open "kernel/le2kernelsource/arch/arm64/boot/".
4. Copy "Image.gz-dtb".
5. now take a stock boot.img of current firmware that u r using.
6. unpack the stock boot.img,search on google for that
7. after unpacking you will see various unpacked files of stock boot.img
delete the file named kernel.gz
and paste Image.gz-dtb there.
8.rename Image.gz-dtb to kernel.gz
9.Repack the kernel
10.u will have a newer boot.img
Edit: For those who do not get Image.gz in their unpacked Stock Boot.img, use the Unpacker Tool in the Downloads Section
Click to expand...
Click to collapse
11. Flash it using twrp or fastboot
Code:
fastboot flash boot kernelfilename.img
all done
12.Clap for yourself and a salute from me
13.READ the next post for more things
Credits:
Our Team:
Brawn_Sg
Rishabh Rao
13THWARRIOR
Testers:
Lakshay Taneja (@Lakku)
Jignesh Jain (jhakjhuk1853)
Have Fun!
XDA:DevDB Information
Kernel compiling guide for le 2, Kernel for the LeEco Le 2
Contributors
Brawn_Sg, Rishabh Rao, 13THWARRIOR, sadiqdev, jhakjhuk1853 and Lakku
Source Code: https://github.com/s2-devs/android_kernel_leeco_msm8976
Kernel Special Features:
Version Information
Status: Stable
Created 2016-12-04
Last Updated 2016-12-05
Reserved
guys tell me if you get any problem or error
i and our team will help
do share your progress on this thread
and whenever you use our kernel source do give us credits
ADDITIONAL THANKS to @TeamMex (My inspiration) for helping me everytime i got any error and teaching we how to develop things.
Reserved
Awesome work bro.. Really appreciate your hard work!!!??
Great
Sent from my Le X526 using XDA-Developers mobile app
Great work fella!!
Really nice to see development going on for Le-2.
Questions ->
- Isn't our device octacore
- for the command 'make -jn', shouldn't 'n' be 'no. of cores *2'; like for dual core 'n' should be 4
---------- Post added at 12:47 AM ---------- Previous post was at 12:36 AM ----------
How you got the kernel source working?
This guide is still pending.
Good job mate
Appreciate your knowledge and hardwork. Thank you very much .
[email protected] said:
Great work fella!!
Really nice to see development going on for Le-2.
Questions ->
- Isn't our device octacore
- for the command 'make -jn', shouldn't 'n' be 'no. of cores *2'; like for dual core 'n' should be 4
---------- Post added at 12:47 AM ---------- Previous post was at 12:36 AM ----------
How you got the kernel source working?
This guide is still pending.
Click to expand...
Click to collapse
Thanks from Brawn_Sg and our Team.
1. Our Device is octacore but while building/compiling u dont give no. of cores in phone, that make -j"n" is the number of cores in pc's processor +1 or 2.
2. We Got the kernel working by our hard work and its fully tested now.
3. This Guide is fully completed and working. It is not pending......:good::good::good:
---------- Post added at 11:21 PM ---------- Previous post was at 10:48 PM ----------
Check out the TWRP made from these Kernel Sources Here: http://forum.xda-developers.com/le-2/development/twrp-3-0-2-0-s2-built-source-custom-t3512723
Brawn_Sg said:
This is My first guide on XDA [emoji14]
From the day I owned Le2 I always wished to compile my own kernel. I searched on the web for compiling 64bit android kernel but didn't get satisfying results. So I did some research and asked some android developers, I got help from some developers but some of the developer refused may be due to their attitude or may be they didn't want to share their ideas / knowledge. So i saw some kind devs trying things out for our device.Then we created a team ,and i met really kind and expert developers there.Later leeco released the kernel sources.People claimed it was not working.But our team worked too hard to get it work.
What will you need :
1. Ubuntu 64 Bit OS
2. Good Internet Connection.
3. Basic Knowledge of Linux.
4.A little common sense
Lets Start
First we need to get some important stuff / tools / software .
1. Open Ubuntu Software center and install JDK 7 or JDK 8
2. Open terminal and run the following command
Code:
sudo apt-get install libncurses5-dev
Code:
sudo apt-get install git-core gnupg flex bison gperf build-essential zip curl libc6-dev libncurses5-dev:i386 x11proto-core-dev libx11-dev:i386 libreadline6-dev:i386 libgl1-mesa-glx:i386 libgl1-mesa-dev g++-multilib tofrodos python-markdown libxml2-utils xsltproc zlib1g-dev:i386
Code:
sudo ln -s /usr/lib/i386-linux-gnu/mesa/libGL.so.1 /usr/lib/i386-linux-gnu/libGL.so
Code:
sudo apt-get install -y ccache &&echo 'export PATH="/usr/lib/ccache:$PATH"' | tee -a ~/.bashrc &&source ~/.bashrc && echo $PATH
Code:
export USE_CCACHE=1
Code:
mkdir ~/bin
Code:
export PATH=~/bin:$PATH
Code:
curl https://dl-ssl.google.com/dl/googlesource/git-repo/repo > ~/bin/repo
Code:
chmod a+x ~/bin/repo
Now ur'r Linux machine is all set to compile kernel.
3. Now you need to download a toolchain.Use any 64 bit compatible toolchain .In my case i am using uber toolchain "aarch-linux-android-4.9"
create a folder kernel
now
type
Code:
cd kernel
Code:
git clone https://bitbucket.org/UBERTC/aarch64-linux-android-4.9.git
4. Time to download Kernel sources. For this tutorial I am using our team's kernel source. Here is the link for our sources > h t t p s ://github.com/s2-devs/android_kernel_leeco_msm8976
.Select branch as stock-6.0 from left and press download on the right.
5. place both this zip in "kernel" directory which we made in previous step.
6. Extract the zip in the "kernel". Now you will have two folders one of toolchain and other of kernel source.
7. Open the kernel source folder and type the following code.
9. Run the following command to point the variable to toolchains path :
in my case:
Code:
export CROSS_COMPILE=/home/Bh-singhal/kernel/aarch64-linux-android-4.9/bin/aarch64-linux-android-
If you followed along with me you will just have to change the name of the user ( replace <Bh-singhal> with <ur's username> )
10. Time to Compile your kernel :
Code:
export ARCH=arm64
Code:
make s2-perf_defconfig
The name of defconfig file may be different in future check it in "kernel/le2skernelsource/arch/arm64/defconfig/"
Now the final command make. It takes a parameter -jn. Where ( n = # of threads per core + 1 )
I have a Dual core processor with 2 thread per processor so for me it is " make -j3 ".
Code:
make -j3
Now sit back and relax.......let the kernel compile
Got a compilation error ?
Post it here.
NOW FINAL STEP
DUE TO WHICH MANY PEOPLE DID NOT GET KERNEL BOOTING
3. Open "kernel/le2kernelsource/arch/arm64/boot/".
4. Copy "Image.gz-dtb".
5. now take a stock boot.img of current firmware that u r using.
6. unpack the stock boot.img,search on google for that
7. after unpacking you will see various unpacked files of stock boot.img
delete the file named kernel.gz
and paste Image.gz-dtb there.
8.rename Image.gz-dtb to kernel.gz
9.Repack the kernel
10.u will have a newer boot.img
11. Flash it using twrp or fastboot
Code:
fastboot flash boot kernelfilename.img
all done
12.Clap for yourself and a salute from me [emoji14]
13.READ the next post for more things
Credits:
Our Team:
Brawn_Sg
Rishabh Rao
13THWARRIOR
Testers:
Lakshay Taneja (@Lakku)
Jignesh Jain (jhakjhuk1853)
Have Fun!
XDA:DevDB Information
Kernel compiling guide for le 2, Kernel for the LeEco Le 2
Contributors
Brawn_Sg, Rishabh Rao, 13THWARRIOR, sadiqdev, jhakjhuk1853 and Lakku
Source Code: https://github.com/s2-devs/android_kernel_leeco_msm8976
Kernel Special Features:
Version Information
Status: Stable
Created 2016-12-04
Last Updated 2016-12-05
Click to expand...
Click to collapse
I really appreciate your work bro ....
But no news for letv 1S
Sent from my Le X507 using Tapatalk
So Are you Working on Any Rom??? if Yes which then which one?? AOSP or CM??
Rishabh Rao said:
Thanks from Brawn_Sg and our Team.
1. Our Device is octacore but while building/compiling u dont give no. of cores in phone, that make -j"n" is the number of cores in pc's processor +1 or 2.
2. We Got the kernel working by our hard work and its fully tested now.
3. This Guide is fully completed and working. It is not pending......
[/COLOR]Check out the TWRP made from these Kernel Sources Here: http://forum.xda-developers.com/le-2/development/twrp-3-0-2-0-s2-built-source-custom-t3512723
Click to expand...
Click to collapse
Wanted to know what was the problem with kernel sources provided by LeEco and how you solved it to make working kernel source.
Something is missing over here i Think so ! AFTER 7TH STEP ? DIRECT 9 ? MAY BE TYPING MISTAKE OR SOMETHING MISSING PLEASE CLEAR IT OUT
why this error ?
mF^ said:
why this error ?
Click to expand...
Click to collapse
hey
i m assuming that u have followed all my steps properly
in kernel folder u also have the le s2 kernel source floder
being cd in kernel folder
cd to s2 kernel source folder
and then type the commands
which u typed and were getting error
thanks
.......press thanks if i helped............
Can you tell the amount of data we have to download?
Sent from my Redmi Note 3 using Tapatalk
boot.img
how to pull boot.img form mobile devices
First of all great job bro...
Bro I am stuck at boot loop .. please help ... I followed all the steps strictly... And also tried many times on Ubuntu:amd64 and Kali Linux : amd64 .... I compiled successfully but stuck at boot loop .. I extracted boot IMG from latest full update zip file of 5.8.019s eui ... Pls help I also tried other toolchains... But no help
Not getting working kernel i think anything is missing ;(
Awesome work @Brawn_Sg, @rishav Rao
I was wondering whether my Le 2 will have developer community support as my Mi3W, waiting for Roms.