FORUMS
Remove All Ads from XDA

[REFERENCE] How to compile an Android kernel

13,732 posts
Thanks Meter: 50,790
 
By nathanchance, Recognized Developer / Recognized Contributor on 26th June 2017, 05:38 AM
Post Reply Email Thread
31st July 2017, 08:24 AM |#41  
D1stRU3T0R's Avatar
Senior Member
Thanks Meter: 1,584
 
More
Quote:
Originally Posted by zhaozihanzzh

It seems that there are errors, so you can check the information and find errors which cause sub-make failed. Sorry, I am a noob.

That build-in.o is the problem?
31st July 2017, 11:25 AM |#42  
zhaozihanzzh's Avatar
Senior Member
Flag Zibo City,Shandong province in China
Thanks Meter: 203
 
More
Quote:
Originally Posted by D1stRU3T0R

That build-in.o is the problem?

I don't think so. Maybe it is something like this:

For example, error is in fs/ext3/dir.c, in line 141.
Attached Thumbnails
Click image for larger version

Name:	IMG_20170730_103900.jpg
Views:	860
Size:	248.5 KB
ID:	4228558  
The Following User Says Thank You to zhaozihanzzh For This Useful Post: [ View ] Gift zhaozihanzzh Ad-Free
19th August 2017, 01:42 PM |#43  
Junior Member
Thanks Meter: 0
 
More
Help
Trying to compile samsung a7 2016 arm64 kernel. And facing this problem. Using prebuilt aarch64-linux-android-4.9.
Attached Thumbnails
Click image for larger version

Name:	20170817_182808.jpg
Views:	530
Size:	205.6 KB
ID:	4246150   Click image for larger version

Name:	20170819_160217.jpg
Views:	542
Size:	192.2 KB
ID:	4246151  
2nd September 2017, 05:27 PM |#44  
Member
Flag Chennai
Thanks Meter: 21
 
More
I tried to compile the kernel using the given steps but ended up with unkown makefile error.

Code:
[email protected]:~/oreo/kernel/bacon$ ./b_build.sh 
/home/cleoz/oreo/kernel/bacon/scripts/gcc-version.sh: line 25: /home/cleoz/oreo/arm-linux-androideabi-4.9: Is a directory
/home/cleoz/oreo/kernel/bacon/scripts/gcc-version.sh: line 26: /home/cleoz/oreo/arm-linux-androideabi-4.9: Is a directory
/home/cleoz/oreo/kernel/bacon/scripts/gcc-version.sh: line 25: /home/cleoz/oreo/arm-linux-androideabi-4.9: Is a directory
/home/cleoz/oreo/kernel/bacon/scripts/gcc-version.sh: line 26: /home/cleoz/oreo/arm-linux-androideabi-4.9: Is a directory
/home/cleoz/oreo/kernel/bacon/scripts/gcc-version.sh: line 25: /home/cleoz/oreo/arm-linux-androideabi-4.9: Is a directory
/home/cleoz/oreo/kernel/bacon/scripts/gcc-version.sh: line 26: /home/cleoz/oreo/arm-linux-androideabi-4.9: Is a directory
/home/cleoz/oreo/kernel/bacon/scripts/gcc-version.sh: line 25: /home/cleoz/oreo/arm-linux-androideabi-4.9: Is a directory
/home/cleoz/oreo/kernel/bacon/scripts/gcc-version.sh: line 26: /home/cleoz/oreo/arm-linux-androideabi-4.9: Is a directory
  CLEAN   scripts/basic
  CLEAN   scripts/dtc
  CLEAN   scripts/kconfig
  CLEAN   scripts/selinux/genheaders
  CLEAN   scripts/selinux/mdp
  CLEAN   include/config include/generated arch/arm/include/generated
  CLEAN   .config include/linux/version.h
  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
#
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
  CHK     include/linux/version.h
  WRAP    arch/arm/include/generated/asm/ioctl.h
  UPD     include/linux/version.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/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/simd.h
  WRAP    arch/arm/include/generated/asm/sizes.h
  CC      scripts/mod/empty.o
  HOSTCC  scripts/dtc/checks.o
  HOSTCC  scripts/selinux/genheaders/genheaders
/home/cleoz/oreo/arm-linux-androideabi-4.9 [Errno 13] Permission denied
scripts/Makefile.build:307: recipe for target 'scripts/mod/empty.o' failed
make[2]: *** [scripts/mod/empty.o] Error 13
scripts/Makefile.build:443: recipe for target 'scripts/mod' failed
make[1]: *** [scripts/mod] Error 2
make[1]: *** Waiting for unfinished jobs....
  HOSTCC  scripts/dtc/data.o
  HOSTCC  scripts/selinux/mdp/mdp
  SHIPPED scripts/dtc/dtc-lexer.lex.c
  SHIPPED scripts/dtc/dtc-parser.tab.h
  SHIPPED scripts/dtc/dtc-parser.tab.c
  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
  HOSTCC  scripts/dtc/dtc-lexer.lex.o
  HOSTCC  scripts/dtc/dtc-parser.tab.o
  HOSTLD  scripts/dtc/dtc
Makefile:510: recipe for target 'scripts' failed
make: *** [scripts] Error 2
make: *** Waiting for unfinished jobs....
Device: One plus one
Kernel tree used : https://github.com/LineageOS/android...neplus_msm8974 cm-14.1 branch
I have tried changing toolchain and also re-clone the kernel tree.Any assistance is much appreciated.
Vishal
6th September 2017, 09:27 PM |#45  
Junior Member
Thanks Meter: 1
 
More
@The Flash , building kernel for my new devices:
what nuances of this particular device should I
consider?

(HuaWei M3 Phablet)
16th September 2017, 09:28 PM |#46  
furkaan28's Avatar
Senior Member
Thanks Meter: 1,050
 
Donate to Me
More
@The Flash can u look at this ?
https://hastebin.com/ubedoyuzoy.vbs
16th September 2017, 10:31 PM |#47  
Junior Member
Thanks Meter: 0
 
More
Quote:
Originally Posted by vish97

I tried to compile the kernel using the given steps but ended up with unkown makefile error.

Code:
[email protected]:~/oreo/kernel/bacon$ ./b_build.sh 
/home/cleoz/oreo/kernel/bacon/scripts/gcc-version.sh: line 25: /home/cleoz/oreo/arm-linux-androideabi-4.9: Is a directory
/home/cleoz/oreo/kernel/bacon/scripts/gcc-version.sh: line 26: /home/cleoz/oreo/arm-linux-androideabi-4.9: Is a directory
/home/cleoz/oreo/kernel/bacon/scripts/gcc-version.sh: line 25: /home/cleoz/oreo/arm-linux-androideabi-4.9: Is a directory
/home/cleoz/oreo/kernel/bacon/scripts/gcc-version.sh: line 26: /home/cleoz/oreo/arm-linux-androideabi-4.9: Is a directory
/home/cleoz/oreo/kernel/bacon/scripts/gcc-version.sh: line 25: /home/cleoz/oreo/arm-linux-androideabi-4.9: Is a directory
/home/cleoz/oreo/kernel/bacon/scripts/gcc-version.sh: line 26: /home/cleoz/oreo/arm-linux-androideabi-4.9: Is a directory
/home/cleoz/oreo/kernel/bacon/scripts/gcc-version.sh: line 25: /home/cleoz/oreo/arm-linux-androideabi-4.9: Is a directory
/home/cleoz/oreo/kernel/bacon/scripts/gcc-version.sh: line 26: /home/cleoz/oreo/arm-linux-androideabi-4.9: Is a directory
  CLEAN   scripts/basic
  CLEAN   scripts/dtc
  CLEAN   scripts/kconfig
  CLEAN   scripts/selinux/genheaders
  CLEAN   scripts/selinux/mdp
  CLEAN   include/config include/generated arch/arm/include/generated
  CLEAN   .config include/linux/version.h
  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
#
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
  CHK     include/linux/version.h
  WRAP    arch/arm/include/generated/asm/ioctl.h
  UPD     include/linux/version.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/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/simd.h
  WRAP    arch/arm/include/generated/asm/sizes.h
  CC      scripts/mod/empty.o
  HOSTCC  scripts/dtc/checks.o
  HOSTCC  scripts/selinux/genheaders/genheaders
/home/cleoz/oreo/arm-linux-androideabi-4.9 [Errno 13] Permission denied
scripts/Makefile.build:307: recipe for target 'scripts/mod/empty.o' failed
make[2]: *** [scripts/mod/empty.o] Error 13
scripts/Makefile.build:443: recipe for target 'scripts/mod' failed
make[1]: *** [scripts/mod] Error 2
make[1]: *** Waiting for unfinished jobs....
  HOSTCC  scripts/dtc/data.o
  HOSTCC  scripts/selinux/mdp/mdp
  SHIPPED scripts/dtc/dtc-lexer.lex.c
  SHIPPED scripts/dtc/dtc-parser.tab.h
  SHIPPED scripts/dtc/dtc-parser.tab.c
  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
  HOSTCC  scripts/dtc/dtc-lexer.lex.o
  HOSTCC  scripts/dtc/dtc-parser.tab.o
  HOSTLD  scripts/dtc/dtc
Makefile:510: recipe for target 'scripts' failed
make: *** [scripts] Error 2
make: *** Waiting for unfinished jobs....
Device: One plus one
Kernel tree used : https://github.com/LineageOS/android...neplus_msm8974 cm-14.1 branch
I have tried changing toolchain and also re-clone the kernel tree.Any assistance is much appreciated.
Vishal

It seems you are not root please run sudo -s before doing angthing 🤗
23rd September 2017, 01:10 AM |#48  
Senior Member
Thanks Meter: 50
 
More
Ok, maybe I will go to offtopic a little bit. So my phone uses lz4 instead of gzip (curses)
So I'm trying to build TWRP for my device it builds fine but uses gzip so how do I point to it to use lz4, I think it should be done in boardconfig.mk with other flags for kernel and ramdisk see line https://github.com/ProfessorWoland/a...dConfig.mk#L44
Halp please
24th September 2017, 05:39 AM |#50  
nathanchance's Avatar
OP Recognized Developer / Recognized Contributor
Flag Mesa, AZ
Thanks Meter: 50,790
 
More
Quote:
Originally Posted by Professor Woland

Ok, maybe I will go to offtopic a little bit. So my phone uses lz4 instead of gzip (curses)
So I'm trying to build TWRP for my device it builds fine but uses gzip so how do I point to it to use lz4, I think it should be done in boardconfig.mk with other flags for kernel and ramdisk see line https://github.com/ProfessorWoland/a...dConfig.mk#L44
Halp please

Hmmm I'm not sure I understand what you mean... what exactly uses lz4? The kernel image's compression or the recovery/boot image's compression? Does it actually matter for recovery?
24th September 2017, 01:17 PM |#51  
Senior Member
Thanks Meter: 50
 
More
Quote:
Originally Posted by nathanchance

Hmmm I'm not sure I understand what you mean... what exactly uses lz4? The kernel image's compression or the recovery/boot image's compression? Does it actually matter for recovery?

Well, I think it uses lz4 for everything kernel, images, ramdisk. Also I'm not quite sure it matter for recovery I have trouble with it and I don't know what else could be wrong than this. I see this isn't your field of knowledge sorry to bother.
Post Reply Subscribe to Thread

Guest Quick Reply (no urls or BBcode)
Message:
Previous Thread Next Thread
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes