Post Reply

[Q] Can anyone help me to Building Kernel[DEV]

OP rajit

27th August 2014, 05:52 AM   |  #1  
rajit's Avatar
OP Senior Member
Flag kolkata
Thanks Meter: 644
 
500 posts
Join Date:Joined: Oct 2012
Donate to Me
More
Hi,

I am trying To build a Custom Kernel But seems there many errors found, specially cant able to find Lianaro toolchain for cortex a7.

cortex a15 giving some error ,like this " you choose the correct path/some time different after figured the path". so if possible link me to the cortex a7 toolchain and help needed as necessary .
@Shivam Kuchhal , @cybojenix , @newhor1z0n , @xperiafan13 , @Falcon G @varun.chitre15





Code:
lino@lino-GA-78LMT-USB3:~$ cd android
lino@lino-GA-78LMT-USB3:~/android$ cd kernel
lino@lino-GA-78LMT-USB3:~/android/kernel$ export ARCH=arm
lino@lino-GA-78LMT-USB3:~/android/kernel$ export CROSS_COMPILE=~/android/toolchains/cortex15/bin/arm-eabi-
lino@lino-GA-78LMT-USB3:~/android/kernel$ make msm8610_defconfig
  HOSTCC  scripts/basic/fixdep
  HOSTCC  scripts/kconfig/conf.o
  SHIPPED scripts/kconfig/zconf.tab.c
  SHIPPED scripts/kconfig/zconf.lex.c
  SHIPPED scripts/kconfig/zconf.hash.c
  HOSTCC  scripts/kconfig/zconf.tab.o
  HOSTLD  scripts/kconfig/conf
#
# configuration written to .config
#
lino@lino-GA-78LMT-USB3:~/android/kernel$ make -j1
scripts/kconfig/conf --silentoldconfig Kconfig
  WRAP    arch/arm/include/generated/asm/auxvec.h
  WRAP    arch/arm/include/generated/asm/bitsperlong.h
  WRAP    arch/arm/include/generated/asm/cputime.h
  WRAP    arch/arm/include/generated/asm/emergency-restart.h
  WRAP    arch/arm/include/generated/asm/errno.h
  WRAP    arch/arm/include/generated/asm/ioctl.h
  WRAP    arch/arm/include/generated/asm/irq_regs.h
  WRAP    arch/arm/include/generated/asm/kdebug.h
  WRAP    arch/arm/include/generated/asm/local.h
  WRAP    arch/arm/include/generated/asm/local64.h
  WRAP    arch/arm/include/generated/asm/percpu.h
  WRAP    arch/arm/include/generated/asm/poll.h
  WRAP    arch/arm/include/generated/asm/resource.h
  WRAP    arch/arm/include/generated/asm/sections.h
  WRAP    arch/arm/include/generated/asm/siginfo.h
  WRAP    arch/arm/include/generated/asm/sizes.h
  CHK     include/linux/version.h
  UPD     include/linux/version.h
  CHK     include/generated/utsrelease.h
  UPD     include/generated/utsrelease.h
  Generating include/generated/mach-types.h
  CC      kernel/bounds.s
/home/lino/android/toolchains/cortex15/bin/arm-eabi-gcc -Wp,-MD,kernel/.bounds.s.d -nostdinc -isystem /home/lino/android/toolchains/cortex15/bin/arm-eabi-gcc -print-file-name=include [Errno 8] Exec format error -I/home/lino/android/kernel/arch/arm/include -Iarch/arm/include/generated -Iinclude -include /home/lino/android/kernel/include/linux/kconfig.h -D__KERNEL__ -mlittle-endian -Iarch/arm/mach-msm/include -Wall -Wundef -Wstrict-prototypes -Wno-trigraphs -fno-strict-aliasing -fno-common -Werror-implicit-function-declaration -Wno-format-security -fno-delete-null-pointer-checks -Os -mabi=aapcs-linux -mno-thumb-interwork -funwind-tables -D__LINUX_ARM_ARCH__=7 -march=armv7-a -msoft-float -Uarm -fomit-frame-pointer -DKBUILD_STR(s)=#s -DKBUILD_BASENAME=KBUILD_STR(bounds) -DKBUILD_MODNAME=KBUILD_STR(bounds) -fverbose-asm -S -o kernel/bounds.s kernel/bounds.c [Errno 8] Exec format error
make[1]: *** [kernel/bounds.s] Error 8
make: *** [prepare0] Error 2



EDIT:- tried with other toolchains, seems same error, so i think i am missing something. please figure it out

Regards,

Rajit Saha
Last edited by rajit; 12th September 2014 at 09:08 AM.
5th September 2014, 02:36 PM   |  #2  
rajit's Avatar
OP Senior Member
Flag kolkata
Thanks Meter: 644
 
500 posts
Join Date:Joined: Oct 2012
Donate to Me
More
No one ..

As expected :thumbup:

Sent from my XT1022 using XDA Free mobile app
5th September 2014, 03:27 PM   |  #3  
TheStrix's Avatar
Senior Member
Flag ⓂⓊⓂⒷⒶⒾ
Thanks Meter: 176
 
422 posts
Join Date:Joined: May 2014
Donate to Me
More
I am too getting same error
7th September 2014, 07:52 AM   |  #4  
rajit's Avatar
OP Senior Member
Flag kolkata
Thanks Meter: 644
 
500 posts
Join Date:Joined: Oct 2012
Donate to Me
More
Quote:
Originally Posted by TheStrix

I am too getting same error

Hmm seems no one cares for us

EDit:- 1st issue fixed.. Use 64bit ubuntu

Now getting this error

Code:
leno@ubuntu:~$ cd android
leno@ubuntu:~/android$ make clean
make: *** No rule to make target `clean'.  Stop.
leno@ubuntu:~/android$ cd kernel
leno@ubuntu:~/android/kernel$ make clean
  CLEAN   .
  CLEAN   kernel
  CLEAN   security/selinux
  CLEAN   usr
  CLEAN   .tmp_versions
leno@ubuntu:~/android/kernel$ export ARCH=arm
leno@ubuntu:~/android/kernel$ export CROSS_COMPILE=~/android/toolchains/bin/arm-eabi-
leno@ubuntu:~/android/kernel$ make -j1
  CHK     include/linux/version.h
  CHK     include/generated/utsrelease.h
  HOSTCC  scripts/basic/fixdep
make[1]: `include/generated/mach-types.h' is up to date.
  CC      kernel/bounds.s
  GEN     include/generated/bounds.h
  CC      arch/arm/kernel/asm-offsets.s
  GEN     include/generated/asm-offsets.h
  CALL    scripts/checksyscalls.sh
  HOSTCC  scripts/dtc/checks.o
  HOSTCC  scripts/dtc/data.o
  HOSTCC  scripts/dtc/dtc-lexer.lex.o
  HOSTCC  scripts/dtc/dtc-parser.tab.o
  HOSTCC  scripts/dtc/dtc.o
  HOSTCC  scripts/dtc/flattree.o
  HOSTCC  scripts/dtc/fstree.o
  HOSTCC  scripts/dtc/livetree.o
  HOSTCC  scripts/dtc/srcpos.o
  HOSTCC  scripts/dtc/treesource.o
  HOSTCC  scripts/dtc/util.o
  HOSTLD  scripts/dtc/dtc
  HOSTCC  scripts/genksyms/genksyms.o
  HOSTCC  scripts/genksyms/lex.lex.o
  HOSTCC  scripts/genksyms/parse.tab.o
  HOSTLD  scripts/genksyms/genksyms
  CC      scripts/mod/empty.o
  HOSTCC  scripts/mod/mk_elfconfig
  MKELF   scripts/mod/elfconfig.h
  HOSTCC  scripts/mod/file2alias.o
  HOSTCC  scripts/mod/modpost.o
  HOSTCC  scripts/mod/sumversion.o
  HOSTLD  scripts/mod/modpost
  HOSTCC  scripts/selinux/genheaders/genheaders
  HOSTCC  scripts/selinux/mdp/mdp
  HOSTCC  scripts/kallsyms
  HOSTCC  scripts/conmakehash
  HOSTCC  scripts/bin2c
  CC      init/main.o
  CHK     include/generated/compile.h
  CC      init/version.o
  CC      init/do_mounts.o
  CC      init/do_mounts_rd.o
  CC      init/do_mounts_initrd.o
  LD      init/mounts.o
  CC      init/initramfs.o
  CC      init/calibrate.o
  LD      init/built-in.o
  HOSTCC  usr/gen_init_cpio
  GEN     usr/initramfs_data.cpio
  AS      usr/initramfs_data.o
  LD      usr/built-in.o
  CC      arch/arm/vfp/vfpmodule.o
  AS      arch/arm/vfp/entry.o
  AS      arch/arm/vfp/vfphw.o
  CC      arch/arm/vfp/vfpsingle.o
  CC      arch/arm/vfp/vfpdouble.o
  LD      arch/arm/vfp/vfp.o
  LD      arch/arm/vfp/built-in.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/opcodes.o
  CC      arch/arm/kernel/process.o
  CC      arch/arm/kernel/ptrace.o
  CC      arch/arm/kernel/return_address.o
arch/arm/kernel/return_address.c:62: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/cpuidle.o
  CC      arch/arm/kernel/armksyms.o
  CC      arch/arm/kernel/module.o
  AS      arch/arm/kernel/sleep.o
  CC      arch/arm/kernel/suspend.o
  CC      arch/arm/kernel/smp.o
  CC      arch/arm/kernel/smp_tlb.o
  CC      arch/arm/kernel/smp_scu.o
  CC      arch/arm/kernel/arch_timer.o
  CC      arch/arm/kernel/kprobes.o
  CC      arch/arm/kernel/kprobes-common.o
  CC      arch/arm/kernel/patch.o
  CC      arch/arm/kernel/kprobes-arm.o
  CC      arch/arm/kernel/unwind.o
  CC      arch/arm/kernel/devtree.o
  CC      arch/arm/kernel/swp_emulate.o
  CC      arch/arm/kernel/hw_breakpoint.o
  CC      arch/arm/kernel/pmu.o
  CC      arch/arm/kernel/perf_event.o
  CC      arch/arm/kernel/topology.o
  CC      arch/arm/kernel/io.o
  LD      arch/arm/kernel/built-in.o
  AS      arch/arm/kernel/head.o
  CC      arch/arm/kernel/init_task.o
  LDS     arch/arm/kernel/vmlinux.lds
  CC      arch/arm/mm/dma-mapping.o
  CC      arch/arm/mm/extable.o
  CC      arch/arm/mm/fault.o
  CC      arch/arm/mm/init.o
  CC      arch/arm/mm/iomap.o
  CC      arch/arm/mm/fault-armv.o
  CC      arch/arm/mm/flush.o
  CC      arch/arm/mm/idmap.o
  CC      arch/arm/mm/ioremap.o
  CC      arch/arm/mm/mmap.o
  CC      arch/arm/mm/pgd.o
  CC      arch/arm/mm/mmu.o
  CC      arch/arm/mm/vmregion.o
  CC      arch/arm/mm/proc-syms.o
  CC      arch/arm/mm/alignment.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/mm/context.o
  AS      arch/arm/mm/tlb-v7.o
  AS      arch/arm/mm/proc-v7.o
  LD      arch/arm/mm/built-in.o
  CC      arch/arm/common/gic.o
  CC      arch/arm/common/cpaccess.o
  LD      arch/arm/common/built-in.o
  LD      arch/arm/net/built-in.o
  CC      arch/arm/mach-msm/io.o
  CC      arch/arm/mach-msm/dma.o
  CC      arch/arm/mach-msm/memory.o
  CC      arch/arm/mach-msm/clock.o
  CC      arch/arm/mach-msm/clock-voter.o
  CC      arch/arm/mach-msm/clock-dummy.o
  CC      arch/arm/mach-msm/clock-generic.o
  CC      arch/arm/mach-msm/modem_notifier.o
  CC      arch/arm/mach-msm/board-dt.o
  CC      arch/arm/mach-msm/acpuclock.o
  CC      arch/arm/mach-msm/clock-a7.o
  CC      arch/arm/mach-msm/perf_trace_counters.o
  AS      arch/arm/mach-msm/headsmp.o
  CC      arch/arm/mach-msm/platsmp.o
  CC      arch/arm/mach-msm/hotplug.o
  AS      arch/arm/mach-msm/idle-v7.o
  CC      arch/arm/mach-msm/smd.o
  CC      arch/arm/mach-msm/smd_debug.o
  CC      arch/arm/mach-msm/remote_spinlock.o
/tmp/ccCzaDZp.s: Assembler messages:
/tmp/ccCzaDZp.s:169: Warning: swp{b} use is deprecated for ARMv6 and ARMv7
/tmp/ccCzaDZp.s:196: Warning: swp{b} use is deprecated for ARMv6 and ARMv7
  CC      arch/arm/mach-msm/smd_private.o
  CC      arch/arm/mach-msm/smem.o
  CC      arch/arm/mach-msm/smd_init_dt.o
arch/arm/mach-msm/smd_init_dt.c:24:25: fatal error: smd_private.h: No such file or directory
 #include <smd_private.h>
                         ^
compilation terminated.
make[1]: *** [arch/arm/mach-msm/smd_init_dt.o] Error 1
make: *** [arch/arm/mach-msm] Error 2
leno@ubuntu:~/android/kernel$



Edit 2:-
Quote:

Code:
  CC      drivers/char/adsprpc.o
  LD      drivers/char/built-in.o
  CC [M]  drivers/char/rdbg.o
  CC      drivers/clk/clkdev.o
  LD      drivers/clk/built-in.o
  LD      drivers/clocksource/built-in.o
  CC      drivers/cpufreq/cpufreq.o
  CC      drivers/cpufreq/cpu-boost.o
  CC      drivers/cpufreq/cpufreq_stats.o
  CC      drivers/cpufreq/cpufreq_performance.o
  CC      drivers/cpufreq/cpufreq_powersave.o
  CC      drivers/cpufreq/cpufreq_userspace.o
  CC      drivers/cpufreq/cpufreq_ondemand.o
  CC      drivers/cpufreq/cpufreq_conservative.o
  CC      drivers/cpufreq/cpufreq_interactive.o
drivers/cpufreq/cpufreq_interactive.c: In function ‘show_target_loads’:
drivers/cpufreq/cpufreq_interactive.c:813:6: warning: operation on ‘ret’ may be undefined [-Wsequence-point]
error, forbidden warning: cpufreq_interactive.c:813
make[2]: *** [drivers/cpufreq/cpufreq_interactive.o] Error 1
make[1]: *** [drivers/cpufreq] Error 2
make: *** [drivers] Error 2



Fixed
Last edited by rajit; 12th September 2014 at 09:07 AM.
8th September 2014, 12:31 PM   |  #5  
rajit's Avatar
OP Senior Member
Flag kolkata
Thanks Meter: 644
 
500 posts
Join Date:Joined: Oct 2012
Donate to Me
More
finally able to make a zImage..

so I put it into boot.img but after flashing Bootup failed
Fastboot reason: Fall-through from normal boot mode. did I missed anything??

plaese help @Shivam Kuchhal , @cybojenix , @newhor1z0n , @xperiafan13 , @Falcon G @savoca @varun.chitre15
Last edited by rajit; 12th September 2014 at 05:25 AM.
8th September 2014, 04:20 PM   |  #6  
Shivam Kuchhal's Avatar
Recognized Contributor
Flag Bijnor, Uttar Pradesh
Thanks Meter: 1,290
 
795 posts
Join Date:Joined: Dec 2012
More
Quote:
Originally Posted by rajit

finally able to make a zImage..

so I put it into boot.img but after flashing Bootup failed
Fastboot reason: Fall-through from normal boot mode. did I missed anything??

plaese help @Shivam Kuchhal , @cybojenix , @newhor1z0n , @xperiafan13 , @Falcon G @varun.chitre15

Wrong packaging/ramdisk it seems.
The Following User Says Thank You to Shivam Kuchhal For This Useful Post: [ View ]
8th September 2014, 06:46 PM   |  #7  
rajit's Avatar
OP Senior Member
Flag kolkata
Thanks Meter: 644
 
500 posts
Join Date:Joined: Oct 2012
Donate to Me
More
Quote:
Originally Posted by Shivam Kuchhal

Wrong packaging/ramdisk it seems.

can you link me any helpful post?

i am using cygwin kitchen to extract and repack kernel. and the wlan module seems huge size.almost 36mb so can can you help me in that?
9th September 2014, 02:43 AM   |  #8  
Shivam Kuchhal's Avatar
Recognized Contributor
Flag Bijnor, Uttar Pradesh
Thanks Meter: 1,290
 
795 posts
Join Date:Joined: Dec 2012
More
Quote:
Originally Posted by rajit

can you link me any helpful post?

i am using cygwin kitchen to extract and repack kernel. and the wlan module seems huge size.almost 36mb so can can you help me in that?

https://github.com/shivamk11/android...r/build-gcc.sh
https://github.com/shivamk11/android...uild-gcc4.7.sh
https://github.com/shivamk11/android...d-linaro4.8.sh
https://github.com/shivamk11/android...d-linaro4.9.sh
These are my build scripts, you can modify any of them to work for you. You just need to change paths for defconfig, kernel directory and toolchain etc. Also change path for packing tools too and put ramdisk folder in kernel directory. It will take a bit of a time to understand but its worth it.
The Following 2 Users Say Thank You to Shivam Kuchhal For This Useful Post: [ View ]
9th September 2014, 06:08 PM   |  #9  
rajit's Avatar
OP Senior Member
Flag kolkata
Thanks Meter: 644
 
500 posts
Join Date:Joined: Oct 2012
Donate to Me
More
Quote:
Originally Posted by Shivam Kuchhal

https://github.com/shivamk11/android...r/build-gcc.sh
https://github.com/shivamk11/android...uild-gcc4.7.sh
https://github.com/shivamk11/android...d-linaro4.8.sh
https://github.com/shivamk11/android...d-linaro4.9.sh
These are my build scripts, you can modify any of them to work for you. You just need to change paths for defconfig, kernel directory and toolchain etc. Also change path for packing tools too and put ramdisk folder in kernel directory. It will take a bit of a time to understand but its worth it.

Thnxz buddy,, actually i am total noob in kernel dev...... can you please elaborate ? i mean what i have to do after getting zimage .. i can cross compile with toolchians and all the path ? and in the config folder there two msm8610 config.. 1st. msm8610_defconfig 2nd msm8610-perf_defconfig .. which one should i choose?
Last edited by rajit; 10th September 2014 at 02:42 PM.
12th September 2014, 05:58 AM   |  #10  
savoca's Avatar
Recognized Developer / Recognized Contributor
Flag Cuyahoga Falls
Thanks Meter: 4,126
 
1,446 posts
Join Date:Joined: Oct 2011
Donate to Me
More
Click 'Dev Resources' to get an idea of how newer qcom kernels are made.

http://forum.xda-developers.com/onep...s-one-t2817651

Correct offsets/values can be found by digging around github.

The Following User Says Thank You to savoca For This Useful Post: [ View ]
Post Reply Subscribe to Thread

Tags
custom kernel, help custom kernel, help kernel, source
Previous Thread Next Thread
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes


Top Threads in Moto E Q&A, Help & Troubleshooting by ThreadRank