# HD Video Tutorial: Compiling Your Own Android Kernel (RootzWiki Special)



## HeyItsLou (Aug 4, 2011)

*Part 1*​
http://www.youtube.com/watch?v=IV4jhXWc7AE[/media]​
*Part 2*​

[media]http://www.youtube.com/watch?v=gjN8x8Pfcl0
​


> Blog Post with step by step instructions if so desired:
> 
> http://goo.gl/nxJ6O​


----------



## nocoast (Oct 17, 2011)

Haven't watched but this is cool!

Sent from my ADR6400L using Tapatalk


----------



## jdkoreclipse (Jun 16, 2011)

good stuff lou! Kernels (believe it or not) were my weak point in the early days, and this is what budding devs need.


----------



## Adam80460 (Jun 7, 2011)

First of all, I have been waiting for these videos for awhile now.. thanks for dropping it









Second, I tried adding some BFQ/BFS patches and that went well, but when I started compiling I got a error:

[hide='Terminal Output']
[[email protected] linux]$ make -j3 ARCH=arm
scripts/kconfig/conf -s arch/arm/Kconfig
CHK include/linux/version.h
UPD include/linux/version.h
CHK include/generated/utsrelease.h
UPD include/generated/utsrelease.h
CC scripts/mod/empty.o
HOSTCC scripts/kallsyms
HOSTCC scripts/mod/mk_elfconfig
MKELF scripts/mod/elfconfig.h
HOSTCC scripts/mod/file2alias.o
Generating include/generated/mach-types.h
HOSTCC scripts/bin2c
CC kernel/bounds.s
HOSTCC scripts/mod/modpost.o
GEN include/generated/bounds.h
CC arch/arm/kernel/asm-offsets.s
HOSTCC scripts/mod/sumversion.o
GEN include/generated/asm-offsets.h
CALL	scripts/checksyscalls.sh
HOSTLD scripts/mod/modpost
CC init/main.o
CHK include/generated/compile.h
HOSTCC usr/gen_init_cpio
GEN usr/initramfs_data.cpio
AS usr/initramfs_data.o
LD usr/built-in.o
CC arch/arm/kernel/compat.o
CC init/do_mounts.o
CC arch/arm/kernel/elf.o
AS arch/arm/kernel/entry-armv.o
AS arch/arm/kernel/entry-common.o
CC arch/arm/kernel/irq.o
CC arch/arm/kernel/process.o
CC init/do_mounts_initrd.o
CC init/initramfs.o
CC arch/arm/kernel/ptrace.o
CC arch/arm/kernel/return_address.o
CC init/calibrate.o
LD init/mounts.o
CC arch/arm/mm/dma-mapping.o
CC arch/arm/kernel/setup.o
CC arch/arm/mm/extable.o
CC arch/arm/mm/fault.o
CC arch/arm/kernel/signal.o
CC arch/arm/mm/init.o
CC arch/arm/kernel/sys_arm.o
CC arch/arm/kernel/stacktrace.o
CC arch/arm/mm/iomap.o
CC arch/arm/kernel/time.o
CC arch/arm/mm/fault-armv.o
CC arch/arm/kernel/traps.o
CC arch/arm/mm/flush.o
CC arch/arm/mm/ioremap.o
CC arch/arm/kernel/armksyms.o
CC arch/arm/kernel/module.o
CC arch/arm/mm/mmap.o
UPD include/generated/compile.h
CC init/version.o
CC arch/arm/kernel/thumbee.o
CC arch/arm/mm/pgd.o
CC arch/arm/kernel/pmu.o
LD init/built-in.o
CC arch/arm/common/clkdev.o
CC arch/arm/mm/mmu.o
CC arch/arm/kernel/io.o
LD arch/arm/common/built-in.o
AS arch/arm/kernel/head.o
CC arch/arm/kernel/init_task.o
CC arch/arm/mach-msm/io.o
CC arch/arm/mach-msm/dma.o
LDS arch/arm/kernel/vmlinux.lds
LD arch/arm/kernel/built-in.o
CC arch/arm/vfp/vfpmodule.o
CC arch/arm/mm/vmregion.o
AS arch/arm/vfp/entry.o
AS arch/arm/vfp/vfphw.o
CC arch/arm/mach-msm/memory.o
CC arch/arm/vfp/vfpsingle.o
CC arch/arm/mm/proc-syms.o
CC arch/arm/mach-msm/timer.o
CC arch/arm/mm/alignment.o
CC arch/arm/vfp/vfpdouble.o
CC arch/arm/mm/highmem.o
CC arch/arm/mach-msm/clock.o
AS arch/arm/mm/abort-ev7.o
AS arch/arm/mm/pabort-v7.o
AS arch/arm/mm/cache-v7.o
CC arch/arm/mm/copypage-v6.o
CC arch/arm/mach-msm/irq.o
CC arch/arm/mm/context.o
LD arch/arm/vfp/vfp.o
LD arch/arm/vfp/built-in.o
CC kernel/sched.o
AS arch/arm/mm/tlb-v7.o
AS arch/arm/mm/proc-v7.o
LD arch/arm/mm/built-in.o
CC mm/bootmem.o
CC arch/arm/mach-msm/devices.o
In file included from kernel/sched.c:2:
kernel/sched_bfs.c:1960: error: conflicting types for 'calc_global_load'
include/linux/sched.h:153: note: previous declaration of 'calc_global_load' was here
make[1]: *** [kernel/sched.o] Error 1
make: *** [kernel] Error 2
make: *** Waiting for unfinished jobs....
CC arch/arm/mach-msm/pmic.o
CC arch/arm/mach-msm/vreg.o
CC mm/filemap.o
CC arch/arm/mach-msm/pwrtest.o
CC arch/arm/mach-msm/proc_comm.o
CC arch/arm/mach-msm/acpuclock-7x30.o
CC arch/arm/mach-msm/internal_power_rail.o
CC arch/arm/mach-msm/acpuclock_debug.o
CC arch/arm/mach-msm/clock-7x30.o
AS arch/arm/mach-msm/arch-init-7x30.o
CC arch/arm/mach-msm/socinfo.o
CC arch/arm/mach-msm/spm.o
AS arch/arm/mach-msm/idle-v7.o
CC arch/arm/mach-msm/msm_fault_handlers.o
CC mm/mempool.o
CC arch/arm/mach-msm/nand_partitions.o
CC arch/arm/mach-msm/drv_callback.o
CC arch/arm/mach-msm/radio_feedback.o
AS arch/arm/mach-msm/fiq_glue.o
CC arch/arm/mach-msm/htc_port_list_lte.o
CC arch/arm/mach-msm/rpc_hsusb.o
CC mm/oom_kill.o
CC arch/arm/mach-msm/remote_spinlock.o
CC arch/arm/mach-msm/7x30-lte/modem_notifier.o
CC mm/fadvise.o
CC arch/arm/mach-msm/qdsp5v2/afe.o
CC arch/arm/mach-msm/7x30-lte/sdio_al.o
CC mm/maccess.o
CC arch/arm/mach-msm/qdsp5v2/audio_interct.o
CC mm/page_alloc.o
CC arch/arm/mach-msm/qdsp5v2/mi2s.o
CC arch/arm/mach-msm/qdsp5v2/audio_dev_ctl.o
CC arch/arm/mach-msm/qdsp5v2/voice.o
CC arch/arm/mach-msm/7x30-lte/smem_log.o
CC arch/arm/mach-msm/qdsp5v2/snddev_data.o
CC mm/page-writeback.o
CC arch/arm/mach-msm/qdsp5v2/snddev_icodec.o
CC arch/arm/mach-msm/7x30-lte/smd.o
CC mm/readahead.o
CC arch/arm/mach-msm/qdsp5v2/lpa.o
CC arch/arm/mach-msm/qdsp5v2/aux_pcm.o
CC mm/swap.o
CC arch/arm/mach-msm/qdsp5v2/snddev_ecodec.o
CC arch/arm/mach-msm/7x30-lte/smd_debug.o
CC arch/arm/mach-msm/qdsp5v2/audio_out.o
CC mm/truncate.o
CC arch/arm/mach-msm/7x30-lte/smd_tty.o
CC arch/arm/mach-msm/qdsp5v2/audpp.o
CC arch/arm/mach-msm/7x30-lte/smd_qmi.o
CC mm/vmscan.o
CC arch/arm/mach-msm/7x30-lte/rpc_pmapp.o
CC arch/arm/mach-msm/qdsp5v2/snddev_mi2s.o
CC arch/arm/mach-msm/qdsp5v2/audio_mp3.o
CC arch/arm/mach-msm/7x30-lte/smd_rpcrouter.o
CC mm/shmem.o
CC arch/arm/mach-msm/qdsp5v2/audio_lpa.o
CC arch/arm/mach-msm/7x30-lte/smd_rpcrouter_device.o
CC arch/arm/mach-msm/7x30-lte/smd_rpcrouter_servers.o
CC mm/prio_tree.o
CC arch/arm/mach-msm/qdsp5v2/mp3_funcs.o
CC mm/util.o
CC arch/arm/mach-msm/qdsp5v2/pcm_funcs.o
CC arch/arm/mach-msm/7x30-lte/smd_rpcrouter_clients.o
CC arch/arm/mach-msm/qdsp5v2/audpreproc.o
CC mm/mmzone.o
CC mm/vmstat.o
CC arch/arm/mach-msm/qdsp5v2/audio_pcm_in.o
CC arch/arm/mach-msm/7x30-lte/smd_rpcrouter_xdr.o
CC mm/backing-dev.o
CC arch/arm/mach-msm/7x30-lte/rpc_server_dog_keepalive.o
CC arch/arm/mach-msm/qdsp5v2/adsp.o
CC arch/arm/mach-msm/7x30-lte/rpc_server_time_remote.o
CC arch/arm/mach-msm/7x30-lte/rpcrouter_smd_xprt.o
CC mm/page_isolation.o
CC arch/arm/mach-msm/7x30-lte/rpcrouter_sdio_xprt.o
CC mm/mm_init.o
CC arch/arm/mach-msm/qdsp5v2/adsp_driver.o
CC mm/mmu_context.o
CC mm/fremap.o
CC arch/arm/mach-msm/7x30-lte/sdio_ctl.o
CC arch/arm/mach-msm/qdsp5v2/adsp_info.o
CC mm/highmem.o
CC arch/arm/mach-msm/qdsp5v2/audio_acdb.o
CC mm/madvise.o
CC arch/arm/mach-msm/7x30-lte/sdio_diag.o
CC mm/memory.o
CC arch/arm/mach-msm/qdsp5v2/audio_aac.o
CC arch/arm/mach-msm/7x30-lte/smd_nmea.o
CC arch/arm/mach-msm/7x30-lte/smd_pkt.o
CC arch/arm/mach-msm/7x30-lte/smd_rpc_sym.o
LD arch/arm/mach-msm/7x30-lte/built-in.o
CC arch/arm/mach-msm/dal.o
CC arch/arm/mach-msm/qdsp5v2/audio_amrnb_in.o
CC mm/mincore.o
CC arch/arm/mach-msm/dal_axi.o
CC arch/arm/mach-msm/qdsp5v2/audio_evrc_in.o
CC arch/arm/mach-msm/pm.o
CC mm/mlock.o
CC arch/arm/mach-msm/qdsp5v2/audio_qcelp_in.o
CC mm/mmap.o
CC arch/arm/mach-msm/cpufreq.o
CC arch/arm/mach-msm/htc_acoustic_7x30.o
CC arch/arm/mach-msm/qdsp5v2/audio_mvs.o
CC arch/arm/mach-msm/htc_acdb_7x30.o
CC arch/arm/mach-msm/panel-samsungwvga-tl2796a.o
CC mm/mprotect.o
LD arch/arm/mach-msm/qdsp5v2/built-in.o
CC arch/arm/mach-msm/panel-samsungwvga-s6e63m0.o
CC arch/arm/mach-msm/panel-sonywvga-s6d16a0x21-7x30.o
CC mm/mremap.o
CC arch/arm/mach-msm/htc_wifi_nvs.o
CC arch/arm/mach-msm/htc_awb_cal.o
CC mm/msync.o
CC arch/arm/mach-msm/board-mecha.o
CC arch/arm/mach-msm/board-mecha-keypad.o
CC mm/rmap.o
CC arch/arm/mach-msm/board-mecha-microp.o
CC arch/arm/mach-msm/board-mecha-audio.o
CC mm/vmalloc.o
CC arch/arm/mach-msm/board-mecha-mmc.o
CC arch/arm/mach-msm/board-mecha-wifi.o
CC arch/arm/mach-msm/board-mecha-rfkill.o
CC arch/arm/mach-msm/board-mecha-panel.o
CC arch/arm/mach-msm/htc_bluetooth.o
CC arch/arm/mach-msm/msm_vibrator.o
CC arch/arm/mach-msm/devices_htc.o
CC arch/arm/mach-msm/msm_flashlight.o
CC mm/pagewalk.o
CC mm/init-mm.o
CC mm/bounce.o
CC arch/arm/mach-msm/htc_battery.o
CC arch/arm/mach-msm/rmt_storage_client.o
CC mm/page_io.o
CC mm/swap_state.o
CC arch/arm/mach-msm/pmic8058-mpp.o
CC arch/arm/mach-msm/npa.o
CC mm/swapfile.o
CC arch/arm/mach-msm/npa_resources.o
CC arch/arm/mach-msm/msm_pm_qos.o
CC arch/arm/mach-msm/msm_reqs.o
CC arch/arm/mach-msm/atmega_microp_common.o
CC arch/arm/mach-msm/htc_headset_mgr.o
CC arch/arm/mach-msm/htc_headset_gpio.o
CC mm/thrash.o
CC arch/arm/mach-msm/htc_headset_pmic.o
CC mm/dmapool.o
CC arch/arm/mach-msm/gpio.o
CC arch/arm/mach-msm/generic_gpio.o
CC mm/ashmem.o
CC arch/arm/mach-msm/pmu.o
CC arch/arm/mach-msm/ssbi.o
CC mm/slab.o
LD arch/arm/mach-msm/built-in.o
CC mm/percpu_up.o
LD mm/built-in.o
[[email protected] linux]$

[/hide]

The Mecha source is 2.6.35, and the BFS patch I use was 2.6.35.13 Could that have been the problem? It was the closest match I could find unless Im not looking in the right place.


----------



## jdkoreclipse (Jun 16, 2011)

Adam80460 said:


> First of all, I have been waiting for these videos for awhile now.. thanks for dropping it
> 
> 
> 
> ...


That happens with the new mecha source...i'd steer clear of BFS anyway, though.


----------



## Adam80460 (Jun 7, 2011)

Ok that's good to know.. one more question, should I be trying to get a close match as possible to version numbers for patches? What's the rule of thumb? Sorry just really eager to learn this ish ...


----------



## HeyItsLou (Aug 4, 2011)

Adam80460 said:


> Ok that's good to know.. one more question, should I be trying to get a close match as possible to version numbers for patches? What's the rule of thumb? Sorry just really eager to learn this ish ...


Yes, your patches should match in version number if not there may be some porting to get them to work.


----------



## Adam80460 (Jun 7, 2011)

HeyItsLou said:


> Yes, your patches should match in version number if not there may be some porting to get them to work.


Thanks for the response







I'm going to see what i can come up with.


----------



## jdkoreclipse (Jun 16, 2011)

Adam80460 said:


> Ok that's good to know.. one more question, should I be trying to get a close match as possible to version numbers for patches? What's the rule of thumb? Sorry just really eager to learn this ish ...


Generally speaking, patches should be designed for a specofic kernel version, and using it for anything other than that version can cause breakage, which will mean you will have to go and do some dirty work.

However, i (and im sure im speaking for many other kernel devs) tend to cut corners and try to make stuff compatible with all diffrent versions...leave this up to the devs.

Also, your build is breaking because there was a scheduler change in 2.6.35.13.


----------



## Adam80460 (Jun 7, 2011)

yeah going to forget the patches for the first few attempts. I think i was trying to do to much....lol


----------



## Ezekeel (Nov 13, 2011)

Cool video.

Some comments:
- Try the Linaro TC (http://www.linaro.org/downloads/). The gcc in that old NDK TC is probably stone old.
- OC can save battery life due to race-to-idle (http://forum.xda-developers.com/showthread.php?t=1297535).


----------



## vinylfreak89 (Jun 20, 2011)

please keep developer forum for rom/kernel releases only. btw, would you like this pinned?


----------



## 00negative (Jul 25, 2011)

Thanks Lou.

Would hit the thanks button but can't find anymore on tapatalk app.


----------



## HeyItsLou (Aug 4, 2011)

vinylfreak89 said:


> please keep developer forum for rom/kernel releases only. btw, would you like this pinned?


Will do....pinning this would be great, thanks!


----------

