[HowTo] Compile the Kernel Source Code for the HTC One XL - AT&T, Rogers HTC One X, Telstra One XL

Hi guys!
Someone requested a tutorial on how to build the kernel source code, so I thought I might as well do it I'll give you a bit more information too.
Maybe this will kick start kernel development a little bit too. Who knows.
Anyway:
1. Set up your build environment as per this guide by AOSP here: http://source.android.com/source/initializing.html
This guide will be primarily aimed at Ubuntu, but it should be easy enough to do on other Linux PCs. Ubuntu is highly recommended. And don't ask about Windows.
2. Download the toolchains: http://code.google.com/p/rohan-kernel-evita/downloads/detail?name=toolchains.tar.gz&can=2
I've hosted both GCC 4.4 and GCC 4.6 (prebuilt) on my Google Code page. These are for Linux.
Download the toolchain package here: http://code.google.com/p/rohan-kernel-evita/downloads/detail?name=toolchains.tar.gz&can=2
Then un-tar the archive and extract it to your home folder so that the path to the toolchain directories are ~/toolchain/whatever-one-you-want
3. At this point you can decide which kernel source you want to download. There are really two sources.
The first choice is getting it from HTC Dev directly. This is good if you want to build your kernel for a Sense 4 ICS ROM. If you want to build for AOSP/JB, then scroll down below all the following HTC stuff.
------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
To use HTC's source:
Go to HTCdev.com and make an account. Then download the source code for our device (I'd recommend the "One X" source under carrier "AT&T" version "2.20". Let the zip file download and extract it to your home folder (so the path is /home/user/evita-ics..../
To build HTC's source, run these commands:
Code:
cd ~/evita-ics-whatever_the_directory_is_named
export ARCH=arm
make elite_defconfig
Second command is saying what type of architecture we want (we are compiling for ARM processors, so we want ARM)
Third command is saying to make the default config for our device (whose hardware is codenamed "elite")
Then to build the actual kernel:
Code:
make -j# ARCH=arm CROSS_COMPILE=~/toolchain/arm-eabi-4.4.3/bin/arm-eabi-
In the command above, there is "-j#". Replace the "#" with the number of CPUs you have.
Ask me about it if you need help. That should be it! Let the build go and in a few minutes you should have a zImage file located at ~/evita-ics-..../arch/arm/boot. That is the actual kernel.
To test out the zImage (kernel), connect your device via fastboot mode and type:
Code:
fastboot boot /path/to/zImage
Combined with the ramdisk, thats what makes the boot.img file. Eventually if you want to distribute your kernel, you should use an installer that injects the zImage into the boot.img or combine the zImage with a ramdisk to make a boot.img. I can do a tutorial on that later on as well.
------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
To get the "other" source:
This source is based off of HTC's source and includes other devices as well in it (the One S and Evo 4G LTE). Its good if you want to build JB AOSP kernels.
To download this kernel source do this:
Code:
mkdir ~/kernel
cd ~/kernel
git clone https://github.com/CyanogenMod/android_kernel_htc_msm8960.git -b android-msm-evita-3.0
This version also includes a number of optimizations and odd bug fixes present in the HTC version.
To build this second source, run these commands:
Code:
cd ~/kernel/android_kernel_htc_msm8960
export ARCH=arm
make elite_defconfig
Second command is saying what type of architecture we want (we are compiling for ARM processors, so we want ARM)
Third command is saying to make the default config for our device (whose hardware is codenamed "elite")
Then to build the actual kernel:
Code:
make -j# ARCH=arm CROSS_COMPILE=~/toolchain/arm-linux-androideabi-4.6/bin/arm-eabi-
In the command above, there is "-j#". Replace the "#" with the number of CPUs you have.
Ask me about it if you need help. That should be it! Let the build go and in a few minutes you should have a zImage file located at ~/evita-ics-..../arch/arm/boot. That is the actual kernel.
To test out the zImage (kernel), connect your device via fastboot mode and type:
Code:
fastboot boot /path/to/zImage
Combined with the ramdisk, thats what makes the boot.img file. Eventually if you want to distribute your kernel, you should use an installer that injects the zImage into the boot.img or combine the zImage with a ramdisk to make a boot.img. I can do a tutorial on that later on as well.
-----------------------------------------------------------------------------
The second option is also a bit better as it uses the 4.6 toolchain instead of GCC 4.4. HTC's source doesn't work with GCC 4.6 so it can't be used without changes that the second source has.
If you have any questions, feel free to post here, message me on twitter (@rohanXm), chat me on IRC (#HTC-One-XL) or PM me!
If this helped you, please consider hitting the donation link under my username on the left. Donations are never required but always appreciated.

Instead of downloading cm10 the readme inclided with the HTC source has directions for getting a tool chain which will compile the source.
Sent from my HTC One X using Tapatalk 2

Perfect. Now I just have to read.
Sent from my HTC One XL bumping it

rohan32 said:
Code:
repo init -u git://github.com/CyanogenMod/android.git -b jb
Click to expand...
Click to collapse
FYI, It looks like the branch name has changed. When I changed "jb" to "jellybean" the repo init command worked.

Rohan. You are one bad MF'er
Sent from my twin turbo'ed OneXL rocking rezound beats

rohan32 said:
2. You can either try to find a standalone package of the precompiled toolchain, or you are going to need to download a ROMs source. I'd recommend downloading a ROMs source since I've never found a good toolchain that worked for me. If you find one that works, post below
For now we will download CM10 since that seems like the defacto standard.
Click to expand...
Click to collapse
I downloaded the 2.20.502.7 kernel source and when I extracted it there was a file named evita_readme.txt which gave another, possibly more "official", location for downloading a toolchain:
--Please follow below command to download the official android toolchain: (arm-eabi-4.4.3)
git clone https://android.googlesource.com/platform/prebuilt
Click to expand...
Click to collapse
I just performed a build with this toolchain but got this error when I attempted to load zImage via fastboot:
c:\>fastboot flash boot zImage
sending 'boot' (5140 KB)...
OKAY [ 1.044s]
writing 'boot'...
FAILED (remote: image error! (BootMagic check fail))
finished. total time: 1.077s
Click to expand...
Click to collapse
I'm not sure if this is caused by the toolchain or if I screwed something up. Have you ever seen this error before?
EDIT: Ok I see what I did incorrectly. The zImage needs to be "Combined with the ramdisk". You wouldn't know how to perform this operation... would you?

denversc said:
I downloaded the 2.20.502.7 kernel source and when I extracted it there was a file named evita_readme.txt which gave another, possibly more "official", location for downloading a toolchain:
I just performed a build with this toolchain but got this error when I attempted to load zImage via fastboot:
I'm not sure if this is caused by the toolchain or if I screwed something up. Have you ever seen this error before?
EDIT: Ok I see what I did incorrectly. The zImage needs to be "Combined with the ramdisk". You wouldn't know how to perform this operation... would you?
Click to expand...
Click to collapse
You are trying to flash a zImage
To my knowledge, only booting zImages work on this device. For the time being just boot the zImage (use fastboot boot zImage)
I will make a tutorial on how to combine the zImage created with a ramdisk to make a boot.img when I get the chance

denversc said:
FYI, It looks like the branch name has changed. When I changed "jb" to "jellybean" the repo init command worked.
Click to expand...
Click to collapse
Oops, my bad! That was a mistake. AOKP uses -jb and CM uses -jellybean so I got them switched fixed now

Out of any device I've seen more people actually interested in helping and learning to help then any other community. I've watched noobs become less noobish.. I've watched skizz learn how to make themes. Hell I've learned 10 fold what I knew before this phone myself.
That is beautiful, and now such an informed, helpful post such as this.
Have great Sunday you guys! I think I might give this a shot!
Sent from my One X

I'll streamline this process in a bit, so that you don't need to download CM10
Edit: cleaned up post, now I'm uploading just the toolchains. Its a tar.gz archive, around 150mb. Much better than downloading the entire CM10 source

rohan32 said:
You are trying to flash a zImage. To my knowledge, only booting zImages work on this device. For the time being just boot the zImage (use fastboot boot zImage)
Click to expand...
Click to collapse
Thanks for your response, rohan. You are absolutely right: I was incorrectly attempting to flash zImage straight to the boot partition, and the error produced by flashboot was justified. I have since successfully "tested out" my compiled zImage by flashing it via "fastboot boot zImage" and it worked like a charm! I ported the modifications from sbryan's Blackout BeastMode kernel and I am now able to OC to 2106 MHz and UC to 192 MHz. It's been running solid for the past few hours at least
Of course, the kernel reverts back to the one stored in the boot partition after a reboot, and I want my shiny new kernel to "stick". I've done a bit of research on this topic and found some information about combining my zImage with a ramdisk into a "real" boot.img but have not yet been successful in creating a boot.img which does not bootloop after flashing it.
For example, I found an article on xda called Basic Kernel Kitchen for Minor Kernel Tweaking which points to a "kitchen sink" tool for creating a boot.img from a zImage and a ramdisk. My problem is that I don't know where to get or how to make a ramdisk. So I tried using the ramdisk from the boot.img of the ROM that I am currently running (CleanROM 4.5 DE) but just got into a bootloop. I've since been doing some yard work today so haven't gotten back to investigating further.
I also found another program named abootimg which can also produce a boot.img from a zImage abd a ramdisk, but when I tried it an error message about my zImage being "too big" was produced.
If it's not obvious yet, I am kind of fumbling around in the dark as compiling and deploying custom kernels is completely new to me! But this post was the most valuable resource I've come across in getting to this point. Thanks so much for writing it! I eagerly await your next article about creating the boot.img
---------- Post added at 06:05 PM ---------- Previous post was at 05:50 PM ----------
rohan32 said:
cleaned up post
Click to expand...
Click to collapse
Thanks for cleaning up the post rohan. I have a few follow-up questions/comments:
missing toolchains link -- the post says "Download the toolchains:" but there is no link to download anything... did you forget to paste the link?
official toolchain -- That's great that you uploaded the toolschains to save tonnes of bandwidth. The CM10 source was taking a VERY long time for me to grab. However, I imagine some people (like me) would prefer to get the toolchain from an "official" source. In the "evita_readme.txt" file of the kernel sources downloaded from HTC dev it instructs one to use the official sources from "git clone https://android.googlesource.com/platform/prebuilt". This is the toolchain that I used and it successfully built the zImage.
ko files -- I noticed in the ZIP file for Blackout BeastMode, in additional to installing the zImage it also puts a bunch of "ko" (kernel modules I believe) into the /system partition (eg. qce40.ko). Should I also be deploying .ko files from my build to the device?
Thanks!

denversc said:
Thanks for your response, rohan. You are absolutely right: I was incorrectly attempting to flash zImage straight to the boot partition, and the error produced by flashboot was justified. I have since successfully "tested out" my compiled zImage by flashing it via "fastboot boot zImage" and it worked like a charm! I ported the modifications from sbryan's Blackout BeastMode kernel and I am now able to OC to 2106 MHz and UC to 192 MHz. It's been running solid for the past few hours at least
Of course, the kernel reverts back to the one stored in the boot partition after a reboot, and I want my shiny new kernel to "stick". I've done a bit of research on this topic and found some information about combining my zImage with a ramdisk into a "real" boot.img but have not yet been successful in creating a boot.img which does not bootloop after flashing it.
For example, I found an article on xda called Basic Kernel Kitchen for Minor Kernel Tweaking which points to a "kitchen sink" tool for creating a boot.img from a zImage and a ramdisk. My problem is that I don't know where to get or how to make a ramdisk. So I tried using the ramdisk from the boot.img of the ROM that I am currently running (CleanROM 4.5 DE) but just got into a bootloop. I've since been doing some yard work today so haven't gotten back to investigating further.
I also found another program named abootimg which can also produce a boot.img from a zImage abd a ramdisk, but when I tried it an error message about my zImage being "too big" was produced.
If it's not obvious yet, I am kind of fumbling around in the dark as compiling and deploying custom kernels is completely new to me! But this post was the most valuable resource I've come across in getting to this point. Thanks so much for writing it! I eagerly await your next article about creating the boot.img
---------- Post added at 06:05 PM ---------- Previous post was at 05:50 PM ----------
Thanks for cleaning up the post rohan. I have a few follow-up questions/comments:
missing toolchains link -- the post says "Download the toolchains:" but there is no link to download anything... did you forget to paste the link?
official toolchain -- That's great that you uploaded the toolschains to save tonnes of bandwidth. The CM10 source was taking a VERY long time for me to grab. However, I imagine some people (like me) would prefer to get the toolchain from an "official" source. In the "evita_readme.txt" file of the kernel sources downloaded from HTC dev it instructs one to use the official sources from "git clone https://android.googlesource.com/platform/prebuilt". This is the toolchain that I used and it successfully built the zImage.
ko files -- I noticed in the ZIP file for Blackout BeastMode, in additional to installing the zImage it also puts a bunch of "ko" (kernel modules I believe) into the /system partition (eg. qce40.ko). Should I also be deploying .ko files from my build to the device?
Thanks!
Click to expand...
Click to collapse
Hey!
Sorry, set it to upload then got distracted Link posted
The reason why your boot.imgs bootloop is because there is a special ramdisk address that needs to be set when combining the ramdisk with the zImage, and most kitchens don't support this. You also need to set the address after setting the base value.
I will post a guide on how to make it a real boot.img whenever I get the chance.

I'm telling you people, Rohan is a BOSS. Most helpful dev I know.
Sent from my HTC One XL using xda app-developers app

rohan32 said:
Hey!
Sorry, set it to upload then got distracted Link posted
The reason why your boot.imgs bootloop is because there is a special ramdisk address that needs to be set when combining the ramdisk with the zImage, and most kitchens don't support this. You also need to set the address after setting the base value.
I will post a guide on how to make it a real boot.img whenever I get the chance.
Click to expand...
Click to collapse
I have the zImage thanks to your tutorial, but I want to know how to create the kernel zip, whenever you have time will be amazing if you can post a guide, I'm really looking forward to that guide, because i haven't been able to locate a guide that works
Sent from my HTC One XL using xda premium

rohan32 said:
Hi guys!
Second command is saying what type of architecture we want (we are compiling for ARM processors, so we want ARM)
Third command is saying to make the default config for our device (whose hardware is codenamed "elite")
Then to build the actual kernel:
Code:
make -j# ARCH=arm CROSS_COMPILE=~/toolchain/arm-linux-androideabi-4.6/bin/arm-eabi-
Click to expand...
Click to collapse
This is the correct make for "other source" kernel.
Code:
make -j# ARCH=arm CROSS_COMPILE=~/toolchain/arm-linux-androideabi-4.6/bin/[COLOR="Red"]arm-linux-androideabi-[/COLOR]

Can you make a tutorial on how to insert governors into a kernel?

Compiling problem
Hey man,
Please help me I followed your article but when I try copile with:
make -j2 ARCH=arm CROSS_COMPILE=~/toolchain/arm-eabi-4.4.3/bin/arm-eabi
I got something like this:
/home/martin/toolchain/arm-eabi-4.4.3/bin/../lib/gcc/arm-eabi/4.4.3/../../../../arm-eabi/bin/as: error while loading shared libraries: libz.so.1: cannot open shared object file: No such file or directory
Thanks
UPDATE:
now its work
I went deeper and install lib32z1 with "sudo apt-get install lib32z1"... now its work

My device repositories are not available on github, But I got device tree and vendor blobs by making changes in similar device repo. That reference device's kernel's lineageos_defconfig is situated in htc msm8974 kernel repo. So how can I get lineageos_defconfig for my device, and which other my device related kernel files(.dtsi or any other) I have to push in htc msm8974 repo and get those files to make things ready for build?
Please help......

Related

Need help to recompe kernel for the Nordic HTC Magic to support netfilter/iptables

Hi all!
As many of you might already know we have gotten a HTC Magic here in Scandinavia without support for netfilter and iptables. I've been trying to recompile a new version of the kernel on my x86_64 Archlinux box while adding these lines to the .config which I exported from my rooted phone:
Code:
CONFIG_NETFILTER=y
CONFIG_IP_NF_IPTABLES=y
CONFIG_IP_NF_MATCH_STATE=y
CONFIG_IP_NF_FILTER=y
CONFIG_IP_NF_TARGET_REJECT=Y
I am a n00b when it comes to compiling, booting and flashing Android stuff and not really a git wizard either. I've downloaded the source, cross-compiled it with my new .config and tried booting it with fastboot only to stare at the HTC logo for 15 minutes before giving up. I suspect that I have probably failed doing the right thing at more than one step in the process but have troubles finding a full guide for Android kernel hacking and loading on the web. I am not even sure if I really compiled the 2.6.27 version used in the daldroid build I have on the phone instead of the latest version in git.
I will provide the step-by-step details below.
1. Downloading and installing the CodeSourcery Cross-compiler from
HTML:
http://www.codesourcery.com/sgpp/lite/arm/portal/release858
2. Downloading setting up the android source code:
Code:
git clone git://android.git.kernel.org/kernel/msm.git
git checkout --track -b msm_htc origin/android-msm-2.6.27
git checkout -f
(here I noticed that the checkouts did not seem to download any extra code, is that expected?)
3. Setting up the cross compilation in the Makefile.
Code:
CROSS_COMPILE=../arm-2009q1/bin/arm-none-linux-gnueabi-
4. Using my .config when running make like this:
Code:
make zImage ARCH=arm CROSS_COMPILE=arm-none-linux-gnueabi-
(a few additional options not present in the .config-file need to be manually specified before the build starts)
5. Extracting the ramdisk from the nordic daldroid boot.img:
Code:
split_bootimg.pl boot.img
5. Trying the new kernel with the daldroid ramdisk:
Code:
fastboot boot arch/arm/boot/zImage ../../boot.img-ramdisk.daldroid.gz
creating boot image...
creating boot image - 1634304 bytes
downloading 'boot.img'... OKAY
booting... OKAY
6. Fail
I would really appreciate some help to get this going. How can I confirm that 2.6.27 was really used? What other gotchas I have forgotten about?
CONFIG_MACH_SAPPHIRE=y
ridli said:
CONFIG_MACH_SAPPHIRE=y
Click to expand...
Click to collapse
Hmm, unfortunately this option is already set to true.
Perhaps it is mainly a fastboot problem. I dunno.
maybe but why you dont try to make a boot.img and flash it?
did you set the system type to msm? it is important.
copy here your .config, maybe we can try to see if something is wrong or you can do this.
Code:
make ARCH=arm CROSS_COMPILE=../arm-2009q1/bin/arm-none-linux-gnueabi- msm_defconfig
for do a default msm .config.
For what I've seen, you're not making a kernel+ramdisk image, but loading them both splitted. Maybe you're missing the command line parametters?
Also, you can patch the kernel code to make it light up one of the leds so you can know if at least the kernel is actually booting or is getting stucked somewhere. To make this, you can patch, on board-sapphire.c, the init function:
Code:
static void __init sapphire_init(void)
{
int rc;
printk("sapphire_init() revision = 0x%X\n", system_rev);
/*
* Setup common MSM GPIOS
*/
config_gpios();
msm_hw_reset_hook = sapphire_reset;
msm_acpu_clock_init(&sapphire_clock_data);
/* adjust GPIOs based on bootloader request */
printk("sapphire_init: cpld_usb_hw2_sw = %d\n", cpld_usb_h2w_sw);
gpio_set_value(SAPPHIRE_GPIO_USB_H2W_SW, cpld_usb_h2w_sw);
[] INSERT HERE:
gpio_set_value(SAPPHIRE_CPLD_LED_BASE+XX, 1);
Where XX is the led number you want to enable.
Any progresses ?
shwan_3 said:
Any progresses ?
Click to expand...
Click to collapse
Not yet, but the posts above are encouraging. I'll post my .config below.
My .config
I stripped all the '#' commented lines from the file to have it go below the 1000 lines limit.
Code:
CONFIG_ARM=y
CONFIG_SYS_SUPPORTS_APM_EMULATION=y
CONFIG_GENERIC_GPIO=y
CONFIG_GENERIC_TIME=y
CONFIG_GENERIC_CLOCKEVENTS=y
CONFIG_MMU=y
CONFIG_GENERIC_HARDIRQS=y
CONFIG_STACKTRACE_SUPPORT=y
CONFIG_HAVE_LATENCYTOP_SUPPORT=y
CONFIG_LOCKDEP_SUPPORT=y
CONFIG_TRACE_IRQFLAGS_SUPPORT=y
CONFIG_HARDIRQS_SW_RESEND=y
CONFIG_GENERIC_IRQ_PROBE=y
CONFIG_RWSEM_GENERIC_SPINLOCK=y
CONFIG_GENERIC_HWEIGHT=y
CONFIG_GENERIC_CALIBRATE_DELAY=y
CONFIG_ARCH_SUPPORTS_AOUT=y
CONFIG_ZONE_DMA=y
CONFIG_GENERIC_HARDIRQS_NO__DO_IRQ=y
CONFIG_OPROFILE_ARMV6=y
CONFIG_OPROFILE_ARM11_CORE=y
CONFIG_VECTORS_BASE=0xffff0000
CONFIG_DEFCONFIG_LIST="/lib/modules/$UNAME_RELEASE/.config"
CONFIG_EXPERIMENTAL=y
CONFIG_BROKEN_ON_SMP=y
CONFIG_LOCK_KERNEL=y
CONFIG_INIT_ENV_ARG_LIMIT=32
CONFIG_LOCALVERSION=""
CONFIG_LOCALVERSION_AUTO=y
CONFIG_SWAP=y
CONFIG_IKCONFIG=y
CONFIG_IKCONFIG_PROC=y
CONFIG_LOG_BUF_SHIFT=17
CONFIG_BLK_DEV_INITRD=y
CONFIG_INITRAMFS_SOURCE=""
CONFIG_CC_OPTIMIZE_FOR_SIZE=y
CONFIG_SYSCTL=y
CONFIG_PANIC_TIMEOUT=5
CONFIG_EMBEDDED=y
CONFIG_UID16=y
CONFIG_KALLSYMS=y
CONFIG_HOTPLUG=y
CONFIG_PRINTK=y
CONFIG_BUG=y
CONFIG_COMPAT_BRK=y
CONFIG_BASE_FULL=y
CONFIG_FUTEX=y
CONFIG_ANON_INODES=y
CONFIG_EPOLL=y
CONFIG_SIGNALFD=y
CONFIG_TIMERFD=y
CONFIG_EVENTFD=y
CONFIG_SHMEM=y
CONFIG_ASHMEM=y
CONFIG_VM_EVENT_COUNTERS=y
CONFIG_SLAB=y
CONFIG_PROFILING=y
CONFIG_OPROFILE=y
CONFIG_HAVE_OPROFILE=y
CONFIG_HAVE_KPROBES=y
CONFIG_HAVE_KRETPROBES=y
CONFIG_PROC_PAGE_MONITOR=y
CONFIG_HAVE_GENERIC_DMA_COHERENT=y
CONFIG_SLABINFO=y
CONFIG_RT_MUTEXES=y
CONFIG_BASE_SMALL=0
CONFIG_MODULES=y
CONFIG_MODULE_UNLOAD=y
CONFIG_MODULE_FORCE_UNLOAD=y
CONFIG_KMOD=y
CONFIG_BLOCK=y
CONFIG_IOSCHED_NOOP=y
CONFIG_IOSCHED_AS=y
CONFIG_DEFAULT_AS=y
CONFIG_DEFAULT_IOSCHED="anticipatory"
CONFIG_CLASSIC_RCU=y
CONFIG_ARCH_MSM7XXX=y
CONFIG_ARCH_MSM7201A=y
CONFIG_MACH_TROUT=y
CONFIG_MACH_SAPPHIRE=y
CONFIG_HTC_BATTCHG=y
CONFIG_HTC_PWRSINK=y
CONFIG_MSM_AMSS_VERSION=6225
CONFIG_MSM_AMSS_VERSION_6225=y
CONFIG_MSM_AMSS_SUPPORT_256MB_EBI1=y
CONFIG_MSM_DEBUG_UART_NONE=y
CONFIG_MSM7XXX_USE_GP_TIMER=y
CONFIG_MSM7XXX_SLEEP_MODE_POWER_COLLAPSE_SUSPEND=y
CONFIG_MSM7XXX_SLEEP_MODE=0
CONFIG_MSM7XXX_IDLE_SLEEP_MODE_POWER_COLLAPSE=y
CONFIG_MSM7XXX_IDLE_SLEEP_MODE=1
CONFIG_MSM7XXX_IDLE_SLEEP_MIN_TIME=20000000
CONFIG_MSM7XXX_IDLE_SPIN_TIME=80000
CONFIG_MSM_IDLE_STATS=y
CONFIG_MSM_IDLE_STATS_FIRST_BUCKET=62500
CONFIG_MSM_IDLE_STATS_BUCKET_SHIFT=2
CONFIG_MSM_IDLE_STATS_BUCKET_COUNT=10
CONFIG_MSM_FIQ_SUPPORT=y
CONFIG_MSM_SERIAL_DEBUGGER=y
CONFIG_MSM_SMD=y
CONFIG_MSM_ONCRPCROUTER=y
CONFIG_MSM_RPCSERVERS=y
CONFIG_MSM_CPU_FREQ=y
CONFIG_MSM_CPU_FREQ_MSM7K=y
CONFIG_MSM_CPU_FREQ_SCALING_MAX=528000
CONFIG_MSM_CPU_FREQ_SCALING_MIN=384000
CONFIG_MSM_HW3D=y
CONFIG_MSM_ADSP=y
CONFIG_HTC_HEADSET=y
CONFIG_HTC_ACOUSTIC=y
CONFIG_WIFI_CONTROL_FUNC=y
CONFIG_WIFI_MEM_PREALLOC=y
CONFIG_CPU_32=y
CONFIG_CPU_V6=y
CONFIG_CPU_32v6=y
CONFIG_CPU_ABRT_EV6=y
CONFIG_CPU_PABRT_NOIFAR=y
CONFIG_CPU_CACHE_V6=y
CONFIG_CPU_CACHE_VIPT=y
CONFIG_CPU_COPY_V6=y
CONFIG_CPU_TLB_V6=y
CONFIG_CPU_HAS_ASID=y
CONFIG_CPU_CP15=y
CONFIG_CPU_CP15_MMU=y
CONFIG_ARM_THUMB=y
CONFIG_TICK_ONESHOT=y
CONFIG_NO_HZ=y
CONFIG_HIGH_RES_TIMERS=y
CONFIG_GENERIC_CLOCKEVENTS_BUILD=y
CONFIG_PREEMPT=y
CONFIG_HZ=100
CONFIG_AEABI=y
CONFIG_ARCH_FLATMEM_HAS_HOLES=y
CONFIG_SELECT_MEMORY_MODEL=y
CONFIG_FLATMEM_MANUAL=y
CONFIG_FLATMEM=y
CONFIG_FLAT_NODE_MEM_MAP=y
CONFIG_PAGEFLAGS_EXTENDED=y
CONFIG_SPLIT_PTLOCK_CPUS=4
CONFIG_RESOURCES_64BIT=y
CONFIG_ZONE_DMA_FLAG=1
CONFIG_BOUNCE=y
CONFIG_VIRT_TO_BUS=y
CONFIG_ALIGNMENT_TRAP=y
CONFIG_ZBOOT_ROM_TEXT=0x0
CONFIG_ZBOOT_ROM_BSS=0x0
CONFIG_CMDLINE="mem=64M console=ttyMSM,115200n8"
CONFIG_CPU_FREQ=y
CONFIG_CPU_FREQ_TABLE=y
CONFIG_CPU_FREQ_DEFAULT_GOV_MSM7K=y
CONFIG_CPU_FREQ_GOV_PERFORMANCE=y
CONFIG_CPU_FREQ_GOV_USERSPACE=y
CONFIG_CPU_FREQ_GOV_ONDEMAND=y
CONFIG_CPU_FREQ_GOV_MSM7K=y
CONFIG_BINFMT_ELF=y
CONFIG_PM=y
CONFIG_PM_SLEEP=y
CONFIG_SUSPEND=y
CONFIG_SUSPEND_FREEZER=y
CONFIG_HAS_WAKELOCK=y
CONFIG_HAS_EARLYSUSPEND=y
CONFIG_WAKELOCK=y
CONFIG_WAKELOCK_STAT=y
CONFIG_USER_WAKELOCK=y
CONFIG_EARLYSUSPEND=y
CONFIG_FB_EARLYSUSPEND=y
CONFIG_ARCH_SUSPEND_POSSIBLE=y
CONFIG_NET=y
CONFIG_PACKET=y
CONFIG_NETFILTER=y
CONFIG_IP_NF_IPTABLES=y
CONFIG_IP_NF_MATCH_STATE=y
CONFIG_IP_NF_FILTER=y
CONFIG_UNIX=y
CONFIG_INET=y
CONFIG_IP_ADVANCED_ROUTER=y
CONFIG_ASK_IP_FIB_HASH=y
CONFIG_IP_FIB_HASH=y
CONFIG_IP_MULTIPLE_TABLES=y
CONFIG_IP_ROUTE_VERBOSE=y
CONFIG_TCP_CONG_CUBIC=y
CONFIG_DEFAULT_TCP_CONG="cubic"
CONFIG_ANDROID_PARANOID_NETWORK=y
CONFIG_BT=y
CONFIG_BT_L2CAP=y
CONFIG_BT_SCO=y
CONFIG_BT_RFCOMM=y
CONFIG_BT_RFCOMM_TTY=y
CONFIG_BT_BNEP=y
CONFIG_BT_HIDP=y
CONFIG_BT_HCIUART=y
CONFIG_BT_HCIUART_H4=y
CONFIG_BT_HCIUART_LL=y
CONFIG_FIB_RULES=y
CONFIG_RFKILL=y
CONFIG_RFKILL_LEDS=y
CONFIG_UEVENT_HELPER_PATH=""
CONFIG_STANDALONE=y
CONFIG_PREVENT_FIRMWARE_BUILD=y
CONFIG_FW_LOADER=y
CONFIG_EXTRA_FIRMWARE=""
CONFIG_MTD=y
CONFIG_MTD_PARTITIONS=y
CONFIG_MTD_CMDLINE_PARTS=y
CONFIG_MTD_CHAR=y
CONFIG_MTD_BLKDEVS=y
CONFIG_MTD_BLOCK=y
CONFIG_MTD_MAP_BANK_WIDTH_1=y
CONFIG_MTD_MAP_BANK_WIDTH_2=y
CONFIG_MTD_MAP_BANK_WIDTH_4=y
CONFIG_MTD_CFI_I1=y
CONFIG_MTD_CFI_I2=y
CONFIG_MTD_MSM_NAND=y
CONFIG_BLK_DEV=y
CONFIG_MISC_DEVICES=y
CONFIG_ANDROID_PMEM=y
CONFIG_TIMED_OUTPUT=y
CONFIG_TIMED_GPIO=y
CONFIG_BINDER_IPC=y
CONFIG_KERNEL_DEBUGGER_CORE=y
CONFIG_LOW_MEMORY_KILLER=y
CONFIG_LOGGER=y
CONFIG_ANDROID_RAM_CONSOLE=y
CONFIG_ANDROID_RAM_CONSOLE_ENABLE_VERBOSE=y
CONFIG_ANDROID_RAM_CONSOLE_ERROR_CORRECTION=y
CONFIG_ANDROID_RAM_CONSOLE_ERROR_CORRECTION_DATA_SIZE=128
CONFIG_ANDROID_RAM_CONSOLE_ERROR_CORRECTION_ECC_SIZE=16
CONFIG_ANDROID_RAM_CONSOLE_ERROR_CORRECTION_SYMBOL_SIZE=8
CONFIG_ANDROID_RAM_CONSOLE_ERROR_CORRECTION_POLYNOMIAL=0x11d
CONFIG_HAVE_IDE=y
CONFIG_MD=y
CONFIG_BLK_DEV_DM=y
CONFIG_DM_DEBUG=y
CONFIG_DM_CRYPT=y
CONFIG_DM_UEVENT=y
CONFIG_NETDEVICES=y
CONFIG_DUMMY=y
CONFIG_NET_ETHERNET=y
CONFIG_MII=y
CONFIG_SMC91X=y
CONFIG_NETDEV_1000=y
CONFIG_NETDEV_10000=y
CONFIG_PPP=y
CONFIG_PPP_ASYNC=y
CONFIG_PPP_DEFLATE=y
CONFIG_PPP_BSDCOMP=y
CONFIG_SLHC=y
CONFIG_MSM_RMNET=y
CONFIG_INPUT=y
CONFIG_INPUT_EVDEV=y
CONFIG_INPUT_KEYRESET=y
CONFIG_INPUT_TOUCHSCREEN=y
CONFIG_TOUCHSCREEN_ELAN_I2C_8232=y
CONFIG_TOUCHSCREEN_SYNAPTICS_I2C_RMI=y
CONFIG_INPUT_MISC=y
CONFIG_INPUT_UINPUT=y
CONFIG_INPUT_GPIO=y
CONFIG_INPUT_KEYCHORD=y
CONFIG_SERIAL_CORE=y
CONFIG_SERIAL_MSM=y
CONFIG_SERIAL_MSM_CLOCK_CONTROL=y
CONFIG_SERIAL_MSM_RX_WAKEUP=y
CONFIG_SERIAL_MSM_HS=y
CONFIG_UNIX98_PTYS=y
CONFIG_I2C=y
CONFIG_I2C_BOARDINFO=y
CONFIG_I2C_HELPER_AUTO=y
CONFIG_I2C_MSM=y
CONFIG_SENSORS_AKM8976=y
CONFIG_SENSORS_PCA963X=y
CONFIG_SENSORS_MT9T013=y
CONFIG_SENSORS_MT9P012=y
CONFIG_POWER_SUPPLY=y
CONFIG_SSB_POSSIBLE=y
CONFIG_DAB=y
CONFIG_VIDEO_OUTPUT_CONTROL=y
CONFIG_FB=y
CONFIG_FB_CFB_FILLRECT=y
CONFIG_FB_CFB_COPYAREA=y
CONFIG_FB_CFB_IMAGEBLIT=y
CONFIG_FB_MSM=y
CONFIG_FB_MSM_LOGO=y
CONFIG_HID_SUPPORT=y
CONFIG_HID=y
CONFIG_USB_SUPPORT=y
CONFIG_USB_ARCH_HAS_HCD=y
CONFIG_USB_FUNCTION=y
CONFIG_USB_FUNCTION_MSM_HSUSB=y
CONFIG_USB_FUNCTION_ADB=y
CONFIG_USB_FUNCTION_MASS_STORAGE=y
CONFIG_MMC=y
CONFIG_MMC_UNSAFE_RESUME=y
CONFIG_MMC_EMBEDDED_SDIO=y
CONFIG_MMC_PARANOID_SD_INIT=y
CONFIG_MMC_BLOCK=y
CONFIG_MMC_BLOCK_PARANOID_RESUME=y
CONFIG_MMC_MSM7XXX=y
CONFIG_NEW_LEDS=y
CONFIG_LEDS_CLASS=y
CONFIG_LEDS_GPIO=y
CONFIG_LEDS_CPLD=y
CONFIG_LEDS_TRIGGERS=y
CONFIG_LEDS_TRIGGER_TIMER=y
CONFIG_LEDS_TRIGGER_HEARTBEAT=y
CONFIG_LEDS_TRIGGER_SLEEP=y
CONFIG_SWITCH=y
CONFIG_SWITCH_GPIO=y
CONFIG_RTC_LIB=y
CONFIG_RTC_CLASS=y
CONFIG_RTC_HCTOSYS=y
CONFIG_RTC_HCTOSYS_DEVICE="rtc0"
CONFIG_RTC_INTF_ALARM=y
CONFIG_RTC_DRV_MSM7XXX=y
CONFIG_EXT2_FS=y
CONFIG_EXT2_FS_XATTR=y
CONFIG_EXT2_FS_POSIX_ACL=y
CONFIG_EXT2_FS_SECURITY=y
CONFIG_EXT3_FS=y
CONFIG_EXT3_FS_XATTR=y
CONFIG_EXT3_FS_POSIX_ACL=y
CONFIG_EXT3_FS_SECURITY=y
CONFIG_JBD=y
CONFIG_FS_MBCACHE=y
CONFIG_FS_POSIX_ACL=y
CONFIG_INOTIFY=y
CONFIG_INOTIFY_USER=y
CONFIG_FAT_FS=y
CONFIG_VFAT_FS=y
CONFIG_FAT_DEFAULT_CODEPAGE=437
CONFIG_FAT_DEFAULT_IOCHARSET="iso8859-1"
CONFIG_PROC_FS=y
CONFIG_PROC_SYSCTL=y
CONFIG_SYSFS=y
CONFIG_TMPFS=y
CONFIG_YAFFS_FS=y
CONFIG_YAFFS_YAFFS1=y
CONFIG_YAFFS_YAFFS2=y
CONFIG_YAFFS_AUTO_YAFFS2=y
CONFIG_YAFFS_SHORT_NAMES_IN_RAM=y
CONFIG_NETWORK_FILESYSTEMS=y
CONFIG_MSDOS_PARTITION=y
CONFIG_NLS=y
CONFIG_NLS_DEFAULT="iso8859-1"
CONFIG_NLS_CODEPAGE_437=y
CONFIG_NLS_ISO8859_1=y
CONFIG_PRINTK_TIME=y
CONFIG_ENABLE_WARN_DEPRECATED=y
CONFIG_ENABLE_MUST_CHECK=y
CONFIG_FRAME_WARN=1024
CONFIG_MAGIC_SYSRQ=y
CONFIG_DEBUG_FS=y
CONFIG_DEBUG_KERNEL=y
CONFIG_DETECT_SOFTLOCKUP=y
CONFIG_BOOTPARAM_SOFTLOCKUP_PANIC_VALUE=0
CONFIG_SCHED_DEBUG=y
CONFIG_SCHEDSTATS=y
CONFIG_TIMER_STATS=y
CONFIG_DEBUG_PREEMPT=y
CONFIG_DEBUG_MUTEXES=y
CONFIG_DEBUG_SPINLOCK_SLEEP=y
CONFIG_DEBUG_INFO=y
CONFIG_DEBUG_VM=y
CONFIG_DEBUG_SG=y
CONFIG_FRAME_POINTER=y
CONFIG_HAVE_FTRACE=y
CONFIG_HAVE_DYNAMIC_FTRACE=y
CONFIG_HAVE_ARCH_KGDB=y
CONFIG_CRYPTO=y
CONFIG_CRYPTO_ALGAPI=y
CONFIG_CRYPTO_BLKCIPHER=y
CONFIG_CRYPTO_MANAGER=y
CONFIG_CRYPTO_CBC=y
CONFIG_CRYPTO_AES=y
CONFIG_CRYPTO_TWOFISH=y
CONFIG_CRYPTO_TWOFISH_COMMON=y
CONFIG_CRYPTO_HW=y
CONFIG_BITREVERSE=y
CONFIG_CRC_CCITT=y
CONFIG_CRC32=y
CONFIG_ZLIB_INFLATE=y
CONFIG_ZLIB_DEFLATE=y
CONFIG_REED_SOLOMON=y
CONFIG_REED_SOLOMON_ENC8=y
CONFIG_REED_SOLOMON_DEC8=y
CONFIG_PLIST=y
CONFIG_HAS_IOMEM=y
CONFIG_HAS_IOPORT=y
CONFIG_HAS_DMA=y
biktor_gj said:
For what I've seen, you're not making a kernel+ramdisk image, but loading them both splitted. Maybe you're missing the command line parametters?
Where XX is the led number you want to enable.
Click to expand...
Click to collapse
Yeah, that could be a problem. I was under the impression that fastboot built the boot.img itself before transfering the kernel to the phone.
Interesting test with the leds. I'll check it out if I don't solve this.
I'm working on the exact same thing. can you contact me via im? pm for my screen names
I think that HTC patched some things in that are not available in the source tree... So I doubt that you'll be able to get a kernel running build from source. If you do happen to make it run let us know
Amon_RA said:
I think that HTC patched some things in that are not available in the source tree... So I doubt that you'll be able to get a kernel running build from source. If you do happen to make it run let us know
Click to expand...
Click to collapse
I would not be suprised at all if that was the case. However, since the Linux kernel is GPL, such patches, as I understand it, also need to be under the GPL and made available upon request. Is there a public HTC source tree anywhere?
And btw, how can I fix the "recompile" misspelling in the title of this thread? It is driving me insane
This might be a very stupid question, but here it goes:
Shouldn't it be possible to build all the extra netfilter/iptables support for the vanilla 2.6.27 kernel as modules and insmod them when running HTC's kernel? Or will that result in swift and horrible death?
i don't see why it wouldn't. we wouldn't need the source for htc's kernel then, right? just figure out how to build the modules? isn't that kind of how proprietary video drivers work for linux?
EDIT: Modules will work, that is certain. A little googling confirmed that's how wlan and such work (on Android)
EDIT 2: It seems like there is .config for the kernel on the phone that can be used with the standard 2.6.27 kernel source to build the android kernel.
EDIT 3: found the kernel here http://github.com/zhoukejun/android-2.6.27-yf255/tree/master
sammypwns said:
i don't see why it wouldn't. we wouldn't need the source for htc's kernel then, right? just figure out how to build the modules? isn't that kind of how proprietary video drivers work for linux?
EDIT: Modules will work, that is certain. A little googling confirmed that's how wlan and such work (on Android)
EDIT 2: It seems like there is .config for the kernel on the phone that can be used with the standard 2.6.27 kernel source to build the android kernel.
EDIT 3: found the kernel here http://github.com/zhoukejun/android-2.6.27-yf255/tree/master
Click to expand...
Click to collapse
I wonder if access to the kernel can help with the Bluetooth problems in the Hero ROM?
Bump!
Is there any news about iptables on PVT 32A based sapphire?
gboddina said:
Bump!
Is there any news about iptables on PVT 32A based sapphire?
Click to expand...
Click to collapse
Well. The kernels that we successfully have built by cross-compiling refuse to boot. Looking at the config.gz that the phone exports and trying
Code:
make oldconfig
we have learnt that HTC has a lot of parameters specified for code that appears not to be in the standard android 2.6.27 kernel source tree. We would be very very happy if someone around here could point us to the repository holding HTC specific patches and code for the Magic/Sapphire.
Based on http://www.mail-archive.com/[email protected]/msg00442.html , it seems we need to find the source of the android-msm-htc-2.6.27 kernel.
Which don't seems to be public.
gboddina said:
Based on http://www.mail-archive.com/[email protected]/msg00442.html , it seems we need to find the source of the android-msm-htc-2.6.27 kernel.
Which don't seems to be public.
Click to expand...
Click to collapse
But it has to be made public if requested. That is essence of the GPL.
i emailed them a while ago. i also talked to someone who has gotten his own kernels to boot but on the dream dev phone

How to compile and boot custom kernel on linux

Hey, so I'm in a mood to compile and test kernel sources provided by Kali-. However I've used search and googled and seriously didn't find anything that would explain the whole process from downloading crosscompiler to putting it all in phone.
So is there any good tutorial for creating and booting custom kernel?
It shouldn't be important, but I'm on Ubuntu Lucid - debian lenny on other PC no windows available atm.
Any help would be appreciated.
cyanogen's wiki has some info on compiling his kernel. i'd look there first
Yeah I did, but it's different and a bit outdated. My compilation end without error ($? == 0) but still no zImage.
edit: Few make's later zImage magically appeared! I've extracted current kernel and ramdisk. The question is now - how to flash it back ? Not sure if simple cat file.img > /dev/mtd/mtd2 will work.
edit2: Compiled native desire kernel using extracted .config, created image and flashed but still no go - It's my first android so I don't know how to even debug this. I believe i got kernel panic somewhere but still don't know how to fix it - any help? This is a dev forum right?
maybe check #htc-linux on freenode irc. they might be able to help you out in compiling the kernel in general, maybe not so much in desire-specific.

[Q] Compiling CM7 kernel on Incredible

Alright guys. I'm trying to get a custom CM7 kernel running on my Incredible. As background, I am well versed in kernel compilation in general and on embedded devices. I followed the directions on the cyanogen wiki (Building_Kernel_from_source), but skipped the section about compiling CM7 itself, since I'm only interested in the kernel. I pulled the kernel from CM's git repo, and it was checked out to the latest version (2.6.37), which is also what my phone was running. I grabbed the 'prebuilt' ARM cross compiling toolchain. I used the kernel config from my phone (/proc/config.gz). Looking through the options with menuconfig, it seemed that the options were correct. I pulled the boot.img from the latest CM7 install zip, (7.0.3), split out the ramdisk.img with split_bootimg.pl, merged my compiled zImage with the ramdisk.img using mkbootimg, copied the resulting img file to my sdcard, ran adb shell from recovery, zero'd out mtd2 (boot), and flashed my custom boot.img using flash_image.
Whew!
I have tried countless times, and every time I try to boot my device with the new kernel, my phone doesn't get past the "htc Incredible" boot screen. It just hangs there. I am completely at a loss as to where to go from here. Any suggestions would be EXTREMELY appreciated.
Thanks for reading.
I just remembered, I ended up using a different tool to split the ramdisk, since the wiki link to split_bootimg.pl was broken. I just now found split_bootimg.pl using google, extracted the custom boot.img I've been trying to throw at my phone, and the kernel section of it was recognized by 'file' utility as data. I'm going to try doing the ramdisk split using split_bootimg.pl tomorrow and see what the resulting boot.img looks like then. I'll report back my results.
Turns out that when you split the boot.img that comes with cyanogen, the kernel in there is also recognized as data. I am no closer to solving this mystery

Kernels!

Hi all,
I so wish I knew how to develop because I hate to ask, I would much rather do and share. But man Asus has posted the Kernel for JB and I would love for a good tweaked OC'ed Kernel. Sooooo, please!
Sadly there are no kernel developers for the 300t at the moment. Asus had all the kernel sources on the Asus website and i guess nobody tried to build their own.
Sent from my ASUS Transformer Pad TF300T using xda app-developers app
ASUS has removed the proprietary code from the kernel, you can download it
but it wont build until you remove references to the missing code then some
of the tablet hardware does not work. so you are left to reverse engineer the
missing code from the chip spec's and manual probing of the hardware.
EDIT: NVM finely got it to build, time to see what's not working.
untermensch said:
ASUS has removed the proprietary code from the kernel, you can download it
but it wont build until you remove references to the missing code then some
of the tablet hardware does not work. so you are left to reverse engineer the
missing code from the chip spec's and manual probing of the hardware.
Click to expand...
Click to collapse
Really ?
As far as I can tell the V10.4.2.9 kernel source from Asus website builds just fine (with one minor correction).
But perhaps I'm missing your point, sorry in that case.
My biggest problem so far is to successfully flash a custom kernel on JB custom ROM (ASU-JellyBean-Hydro 1.4.6).
This leads me to my actual question:
Anyone managed to successfully flash seanzscreams' modded kernel (Asu-JellyBean-HYDROKernel.zip)
on his excellent ROM ASU-JellyBean-Hydro 1.4.6 ?
As far as I can tell the entire kernel flash process seems to finish successfully (using TWRP 2.2.2.0)
but when checking kernel version in Settings it seems to be the same (stock) version as previously,
3.1.10-00003-g6293ea6 [email protected] #1 SMP PREEMPT Thu Aug 9 15:59:38 CST 2012
Looking forward for any ideas/tips.
(I know question better belongs in the Dev forum, but as I just registered at XDA I'm not allowed to post there.)
I got it to build using, tegra3_android_defconfig was trying the cardhu_defconfig before.
builds but does not boot :-<
untermensch said:
I got it to build using, tegra3_android_defconfig was trying the cardhu_defconfig before.
builds but does not boot :-<
Click to expand...
Click to collapse
OK, this indicates at least you have managed to get your custom kernel to run/load, very interesting.
Do you flash an update.zip using CWM/TWRP or using fastboot method sending blob to boot partition (LNX) ?
Care to share more details how you get from resulting zImage from build to something flashable ?
Something like this...
1. cp arch/arm/boot/zImage kernel.gz
2. repack-bootimg.pl kernel.gz ramdisk boot.blob.lnx
3. blobpack boot.blob LNX boot.blob.lnx
?
I am using the same scripts that I use to build the CWM-Touch.blob, I just replace
the stock kernel with the on I have built, then use fastboot to install the new recovery
it just stalls.
untermensch said:
I am using the same scripts that I use to build the CWM-Touch.blob, I just replace
the stock kernel with the on I have built, then use fastboot to install the new recovery
it just stalls.
Click to expand...
Click to collapse
Thanks, but I'm a bit confused...
How does kernel and recovery (CWM-Touch.blob) relate ?
I was of the impression that a recovery image is to be flashed to the recovery partition (SOS), e.g.,
fastboot.exe -i 0x0B05 flash recovery <blob>
...while kernel+ramdisk to boot partition (LNX), e.g.,
fastboot.exe -i 0x0B05 flash boot <blob>
Are the build scripts you mention publicly available and directions of where to look if that's the case ?
a recovery is just a kernel and ramdisk with the recovery executable.
the stock LNX and SOS kernel have the same md5 sum so it does not matter
which partition I test the kernel on, it was just convenient for me to test it on
the SOS partition.
I got most of the tools to pack a SOS blob here
https://github.com/skirata/android-utils
I had to build a newer version of the blob tools
https://github.com/AndroidRoot/BlobTools
gaze57 said:
Thanks, but I'm a bit confused...
How does kernel and recovery (CWM-Touch.blob) relate ?
I was of the impression that a recovery image is to be flashed to the recovery partition (SOS), e.g.,
fastboot.exe -i 0x0B05 flash recovery <blob>
...while kernel+ramdisk to boot partition (LNX), e.g.,
fastboot.exe -i 0x0B05 flash boot <blob>
Are the build scripts you mention publicly available and directions of where to look if that's the case ?
Click to expand...
Click to collapse
Probably I can answer some of my questions myself...
Obviously both recovery and boot partition each contain a kernel+ramdisk of their own.
The difference is probably that,
- in the recovery partition the ramdisk actually contains the complete filesystem, including
the recovery application (e.g. TWRP) and everything is just meant to run from RAM.
while,
-in the boot partition there is only a minimal ramdisk enabling proper loading of the
system partition (called APP if not mistaken).
Perhaps my problem is just that kernel command line is not correct or simething similar.
Also I just discovered that fastboot.exe has a command called "boot" which actually might
be a much faster way to test custom kernels. Have to try it out...
I tried the fastboot boot commands wont even boot the stock kernel, it kinda seems like ASUS does not
want custom kernels to be run on the tablet.
Has ASUS ever wanted custom kernels running on there stuff? Anyway, the did give us a unlock for the boot loader, so looks to me like they are taking the, can't beat make sure they can return'em approach.
untermensch said:
I tried the fastboot boot commands wont even boot the stock kernel, it kinda seems like ASUS does not
want custom kernels to be run on the tablet.
Click to expand...
Click to collapse
gaze57 said:
Really ?
As far as I can tell the V10.4.2.9 kernel source from Asus website builds just fine (with one minor correction).
But perhaps I'm missing your point, sorry in that case.
My biggest problem so far is to successfully flash a custom kernel on JB custom ROM (ASU-JellyBean-Hydro 1.4.6).
This leads me to my actual question:
Anyone managed to successfully flash seanzscreams' modded kernel (Asu-JellyBean-HYDROKernel.zip)
on his excellent ROM ASU-JellyBean-Hydro 1.4.6 ?
As far as I can tell the entire kernel flash process seems to finish successfully (using TWRP 2.2.2.0)
but when checking kernel version in Settings it seems to be the same (stock) version as previously,
3.1.10-00003-g6293ea6 [email protected] #1 SMP PREEMPT Thu Aug 9 15:59:38 CST 2012
Looking forward for any ideas/tips.
(I know question better belongs in the Dev forum, but as I just registered at XDA I'm not allowed to post there.)
Click to expand...
Click to collapse
I unpacked the Asu-JellyBean-HYDROKernel.zip kernel looks like the stock kernel, any changes
have probably been made to the initrd so the kernel version would not change.
Code:
43538fd617c95623ce71fa39897f4a94 zImage
43538fd617c95623ce71fa39897f4a94 ../boot.blob.lnx-kernel.gz
zImage is the stock kernel I use for the touch recovery and boot.blob.lnx-kernel.gz is
the unpacked Asu-JellyBean-HYDROKernel.zip kernel the md5 sums are the same.
Just for ****s and giggles, I unpacked the stock kernel zImage found the string
Code:
[email protected]
and changed it to
Code:
[email protected]
repacked to a zImage with a md5 sum of
Code:
727525cb198a130dfd532cfbde713d29
made a recovery and flashed via fastboot, and it booted fine. This proves that
the new bootloader is not checking the signature of the kernel against a stored
value so custom kernels are possible and I'm just not smart enough to build
a working kernel form the ASUS source.
That's funny, someone out there is, Man just an OC'ed Kernel would be awesome. Since EzOverclock doesn't work with JB you I can really tell the difference in speed on JB.
untermensch said:
Just for ****s and giggles, I unpacked the stock kernel zImage found the string
Code:
[email protected]
and changed it to
Code:
[email protected]
repacked to a zImage with a md5 sum of
Code:
727525cb198a130dfd532cfbde713d29
made a recovery and flashed via fastboot, and it booted fine. This proves that
the new bootloader is not checking the signature of the kernel against a stored
value so custom kernels are possible and I'm just not smart enough to build
a working kernel form the ASUS source.
Click to expand...
Click to collapse
I pulled the config from my tf300 and and managed to build the zImage
I get warning notices about the one of the mpu sensors
if you get it to flash that might be something that may not work
as for myself, I'll be looking into some UMS features, we'll see how far I get
it appears all the needed code is already included in the kernel download from asus,
just need to configure it
Seems I finally managed to build and flash my own JB kernel for the TF300T ! :good:
This will just be a quick and dirty wrap-up of what I did as my spare time is somewhat limited.
Hope to be able to make it more structured and with proper credits in the near future.
Anyone feel free to compile a better structured how-to with correct references and credits.
Quick credits/thanks:
seanzscreams
untermensch
Stuff needed:
- Asus kernel source (10_4_2_9_kernel.zip)
- Android NDK R8B (I'm using Linux version, android-ndk-r8b-linux-x86.tar.bz2)
- Asu-JellyBean-HYDROKernel.zip (to get a proper update package structure with update binary/script and META-INF directory)
- signing-tools.zip, BlobTools and re/unpack-bootimg.pl (can't remember where I found these will have to update post later...)
Preparations:
- Unpack kernel source, e.g. to $HOME/TF300/stock_kernel
- Unpack Android NDK, e.g. to $HOME/android-ndk-r8b
- Unzip Asu-JellyBean-HYDROKernel.zip, e.g. to $HOME/my_kernel
- Setup/install BlobTools and the other scripts
Step-by-step instructions:
1. Build kernel (zImage)
a) Fix minor issue in kernel source
> cd $HOME/TF300/stock_kernel
Change line 11 in file drivers/ril/ril.c
from,
#include <../../arch/arm/mach-tegra/include/mach/board-cardhu-misc.h>
to,
#include "../../arch/arm/mach-tegra/include/mach/board-cardhu-misc.h"
b) Setup build environment for cross compilation
> export PATH=$HOME/android-ndk-r8b/toolchains/arm-linux-androideabi-4.6/prebuilt/linux-x86/bin:$PATH
> export ARCH=arm
> export CROSS_COMPILE=arm-linux-androideabi-
c) Fetch /proc/config.gz from your TF300 and copy/gunzip to $HOME/TF300/stock_kernel/.config
d) Build
> make
If everything went fine you should have a new kernel under,
$HOME/TF300/stock_kernel/arch/arm/boot/zImage
2. Repack kernel
> cd $HOME/my_kernel
a) Create a 28 byte file using a hex editor for the signblob header (I named the file signblob_magic)
It should have the following contents when checked with hexdump:
> hexdump -C signblob_magic
00000000 2d 53 49 47 4e 45 44 2d 42 59 2d 53 49 47 4e 42 |-SIGNED-BY-SIGNB|
00000010 4c 4f 42 2d 00 00 00 00 00 00 00 00 |LOB-........|
0000001c
b) Unpack the boot.blob from Asu-JellyBean-HYDROKernel.zip (unzipped earlier under Preparations)
This step is just to get a proper blob directory structure and the initramfs.
> blobunpack boot.blob
> unpack-bootimg.pl boot.blob.lnx
c) Pack new kernel
Might as well post the script I made to perform this task, check comments.
#!/bin/sh
SRC_HOME=$HOME/TF300/stock_kernel
KERNEL_NAME=my_kernel
# replace kernel
cp ${SRC_HOME}/arch/arm/boot/zImage boot.blob.lnx-kernel.gz
# repack
repack-bootimg.pl boot.blob.lnx-kernel.gz boot.blob.lnx-ramdisk out.blob.lnx
blobpack out.blob LNX out.blob.lnx
# add signblob header
cat signblob_magic out.blob > boot.blob
# create zip package
zip -9 -r ${KERNEL_NAME}.zip boot.blob META-INF/
# Sign zip package using SignApk
java -Xmx1024m -jar signapk.jar -w testkey.x509.pem testkey.pk8 ${KERNEL_NAME}.zip ${KERNEL_NAME}-signed.zip
3. Flash kernel
From previous steps you should now have a signed kernel called,
my_kernel-signed.zip
Flash it using TWRP and reboot.
If flash was OK a blue status bar should appear during boot and then your TF300 will reboot again.
Confirm you have a custom kernel by checking Kernel-version under Settings once system has completed the bootup.
Confirmed! I have built a working kernel from ASUS source not sure if it was the
NDK or pulling the config from the device.
good work gaze57!
Code:
~ # uname -a
Linux localhost 3.1.10 #2 SMP PREEMPT Sat Sep 15 16:49:52 PDT 2012 armv7l GNU/Linux
link to my recovery build setup with source built kernel
http://www.mediafire.com/?hnstxi9so5970y0
EDIT:
it was the config that was causing my previous attempts to fail, I have an Android build setup
with this as the path
Code:
/home/untermensch/Android/android-4.1.1_r4/prebuilts/gcc/linux-x86/arm/arm-eabi-4.6/bin/
then these exports
Code:
export ARCH=arm
export SUBARCH=armv7-a-neon
export CROSS_COMPILE=arm-eabi-
then pull the config from the tablet and got a working kernel.
EDIT:
I opened a source repository with the fix to ril.c and the device config saved to arch/arm/configs/tf300t_defconfig
https://github.com/untermensch/tf300t_kernel
Linux kernel
Congratulations guys!
Thanks for sharing your work.
Since you've been keeping your hands busy with the kernel for some time now, I was wondering if you have ever tried to build a Linux system (kernel + working environment) for the TF300, and whether you know it's possible or not.
I've downloaded the kernel from Asus and trying to get tegra3_defconfig to build (currently having problems with "make[1]: *** [arch/arm/mach-tegra/board-cardhu-sensors.o] Error 1". Am I using the right defconfig? Is it possible to build an Android kernel but have it boot a GNU/Linux environment.
I appreciate your help
EDIT: Regarding the error message, it was a bad reference. The file was expected to be in another folder. I fixed the reference and it went on building.
Congratulations Could you try to enable to overclock?

Is there a Stock Kernel with Safetynet Patch?

I'm looking for a stock kernel that only patches Safetynet checking. Does this exist? If not, is it easy for me to "make it" myself?
I'm not sure if there's a prebuilt one, but building one yourself isn't too hard. The patch is at https://github.com/sultanxda/androi...bc05b16bbd33521c2fffaf491c5657a94bfcfc5.patch. You just follow the steps at http://source.android.com/source/building-kernels.html as usual with the following notes:
Use "kernel/msm" as the source location
Use "marlin_defconfig" as the build configuration
Apply the patch after running the git checkout command
Use the aarch64 prebuilts, not the arm ones
Cares said:
I'm looking for a stock kernel that only patches Safetynet checking. Does this exist? If not, is it easy for me to "make it" myself?
Click to expand...
Click to collapse
Depending on your motivation for a "stock kernel" you might try franco kernel. He doesn't seem to do anything that MIGHT introduce instability or strays very far from stock.
I can vouch for franco. He does minimal performance-only tweaks by default.
josephcsible said:
I'm not sure if there's a prebuilt one, but building one yourself isn't too hard. The patch is at https://github.com/sultanxda/androi...bc05b16bbd33521c2fffaf491c5657a94bfcfc5.patch. You just follow the steps at http://source.android.com/source/building-kernels.html as usual with the following notes:
Use "kernel/msm" as the source location
Use "marlin_defconfig" as the build configuration
Apply the patch after running the git checkout command
Use the aarch64 prebuilts, not the arm ones
Click to expand...
Click to collapse
Hey thanks for the tip. I went ahead and patched the no safetynet patch to the android-msm-marlin-3.18-nougat-mr1 kernel source and compiled it. I now have a Image.gz-dtb file which I zipped (I also just have a binary file named "Image"). What should I with those now, just flash those like I would one of the other kernels? And which file exactly? The gz file? or the just binary file named "Image"?
So essentially "fastboot flash kernel <file_name>"?
When I was compiling I got two warnings by the way:
drivers/soc/qcom/Kconfig:371:warning choice value used outside its choice group
drivers/soc/qcom/Kconfig:376:warning choice value used outside its choice group
Anything I should be concerned about? I've never done this before, but did a lot of reading before I went ahead and used to do some C coding back in the day, so it's not completely unknown to me.
Essentially, these are the steps I followed, after quickly installing Linux Mint:
Code:
Create a working directory in /home/$USER/ (I created /home/sakete/android)
Enter working directory
Download android kernal source
git clone https://android.googlesource.com/kernel/msm
Download prebuilt toolchain
git clone https://android.googlesource.com/platform/prebuilts/gcc/linux-x86/aarch64/aarch64-linux-android-4.9
cd aarch64-linux-android-4.9
export PATH=$(pwd)/prebuilts/gcc/linux-x86/aarch64/aarch64-linux-android-4.9
export CROSS_COMPILE=$(pwd)/bin/aarch64-linux-android-
export ARCH=arm64
export SUBARCH=arm64
Checkout specific kernel branch for Pixel/PixelXL (be in 'msm' folder)
git checkout android-msm-marlin-3.18-nougat-mr1
Get Safetynet Patch (still be in 'msm' folder)
git fetch https://github.com/sultanxda/android_kernel_oneplus_msm8996 cm-13.0-sultan
git cherry-pick abc05b16bbd33521c2fffaf491c5657a94bfcfc5
Build kernel (still be in 'msm' folder)
make clean
make mrproper
make marlin_defconfig
make -j$(grep -c ^processor /proc/cpuinfo)
I initially got some build errors, but running this command solved it: sudo apt-get install build-essential
This is a useful link for those of you who are interested in doing this as well: http://forum.xda-developers.com/showpost.php?p=69627576&postcount=7108
Hey if you can build it and post it here, that would be awesome. This is exactly what I'm looking for.
It will let me preemptively unlock my Verizon bootloader before flashing the latest OTA, while keeping Android Pay.
Has Google already posted the source for the 7.1.1 update kernel?
The source I pulled (android-msm-marlin-3.18-nougat-mr1) should be what's in the December update. It should be 7.1.1
Sakete said:
Hey thanks for the tip. I went ahead and patched the no safetynet patch to the android-msm-marlin-3.18-nougat-mr1 kernel source and compiled it. I now have a Image.gz-dtb file which I zipped (I also just have a binary file named "Image"). What should I with those now, just flash those like I would one of the other kernels? And which file exactly? The gz file? or the just binary file named "Image"?
Click to expand...
Click to collapse
The Image.gz-dtb file is the one you want.
Sakete said:
So essentially "fastboot flash kernel <file_name>"?
Click to expand...
Click to collapse
I've never done it like that, but that's apparently how Franco's kernel installs, so it's worth a shot I guess. Another way of doing it is to unpack the stock boot image with either pbatard's unmkbootimg or osm0sis's Android Image Kitchen, replace its kernel with your Image.gz-dtb, then repack and flash the new boot.img to the boot partitions.
Sakete said:
When I was compiling I got two warnings by the way:
drivers/soc/qcom/Kconfig:371:warning choice value used outside its choice group
drivers/soc/qcom/Kconfig:376:warning choice value used outside its choice group
Anything I should be concerned about? I've never done this before, but did a lot of reading before I went ahead and used to do some C coding back in the day, so it's not completely unknown to me.
Click to expand...
Click to collapse
Nothing you need to worry about.
josephcsible said:
The Image.gz-dtb file is the one you want.
I've never done it like that, but that's apparently how Franco's kernel installs, so it's worth a shot I guess. Another way of doing it is to unpack the stock boot image with either pbatard's unmkbootimg or osm0sis's Android Image Kitchen, replace its kernel with your Image.gz-dtb, then repack and flash the new boot.img to the boot partitions.
Nothing you need to worry about.
Click to expand...
Click to collapse
Great, thanks, I'll try flashing the kernel tomorrow night and will post it if successful.
Interestingly it seems that Pixel (sailfish) and Pixel XL (marlin) use the same kernel / kernel source? There at least doesn't seem to be a sailfish specific source. Will be interesting to see how it pans out tomorrow.
Sakete said:
Interestingly it seems that Pixel (sailfish) and Pixel XL (marlin) use the same kernel / kernel source? There at least doesn't seem to be a sailfish specific source. Will be interesting to see how it pans out tomorrow.
Click to expand...
Click to collapse
Indeed. The same kernel binary can run on both devices. (The ElementalX and Franco kernels don't even have separate builds for the two.)
Would you mind posting the image you built?
iPwn_ said:
Would you mind posting the image you built?
Click to expand...
Click to collapse
I'm at work now, will post it tonight.
Sent from my Pixel using Tapatalk
Stock Kernel + SafetyNet Patch applied
Well holy crap, it actually worked! Just flashed the kernel, set up android pay no problem! And everything else works just fine too.
Attached is a zip.
Steps to install (make sure you have adb and fastboot set up):
- Download file and unzip
- Reboot into bootloader (power down, hold Power + Volume Down)
- Attach device to computer
- Enter command: fastboot flash kernel <kernel_image>
- Enter command: fastboot reboot
- Disconnect device and wait for it to finish booting. That's it!
You're my hero.
Might be a lot to ask, but it would be dope if you maintained where you update the build every month for Google's latest release.
iPwn_ said:
You're my hero.
Might be a lot to ask, but it would be dope if you maintained where you update the build every month for Google's latest release.
Click to expand...
Click to collapse
I'm creating a thread in the dev section.
Edit: thread is up.
Cares said:
I'm looking for a stock kernel that only patches Safetynet checking. Does this exist? If not, is it easy for me to "make it" myself?
Click to expand...
Click to collapse
A bit late, but just for the record, ElementalX is just like stock with added features. If you don't use those features, you are essentially using the stock kernel.
I am thinking about going this route.. but I am not sure the process to flash a custom kernel on my Pixel.. would anyone be able to walk me through it? thanks!

Categories

Resources