FORUMS
Remove All Ads from XDA

[REFERENCE] How to compile an Android kernel

13,717 posts
Thanks Meter: 50,715
 
By nathanchance, Recognized Developer / Recognized Contributor on 26th June 2017, 04:38 AM
Post Reply Email Thread
5th July 2017, 04:26 PM |#11  
Member
Flag Hawler
Thanks Meter: 20
 
More
So here i'am what should i do to fix the initramfs problem?
I tried "chmod -R a+x kernel" but i still get the same problem.
 
 
5th July 2017, 04:31 PM |#12  
nathanchance's Avatar
OP Recognized Developer / Recognized Contributor
Flag Mesa, AZ
Thanks Meter: 50,715
 
More
Quote:
Originally Posted by AhmAdDev99

So here i'am what should i do to fix the initramfs problem?
I tried "chmod -R a+x kernel" but i still get the same problem.

Why aren't you compiling in your home folder?
The Following User Says Thank You to nathanchance For This Useful Post: [ View ]
5th July 2017, 04:52 PM |#13  
Member
Flag Hawler
Thanks Meter: 20
 
More
Quote:
Originally Posted by The Flash

Why aren't you compiling in your home folder?

Moved both kernel source and gcc to /home but still the same problem
5th July 2017, 04:56 PM |#14  
nathanchance's Avatar
OP Recognized Developer / Recognized Contributor
Flag Mesa, AZ
Thanks Meter: 50,715
 
More
Quote:
Originally Posted by AhmAdDev99

Moved both kernel source and gcc to /home but still the same problem

Have you tried the bit about specifying an out folder?
The Following User Says Thank You to nathanchance For This Useful Post: [ View ]
5th July 2017, 05:02 PM |#15  
Member
Flag Hawler
Thanks Meter: 20
 
More
Quote:
Originally Posted by The Flash

Have you tried the bit about specifying an out folder?

Yes , And this is exactly what i get

GEN /Kernel/android_kernel_samsung_t1-android-4.4/out/Makefile
scripts/kconfig/conf --silentoldconfig Kconfig
GEN /Kernel/android_kernel_samsung_t1-android-4.4/out/Makefile
CHK include/linux/version.h
UPD include/linux/version.h
CHK include/generated/utsrelease.h
UPD include/generated/utsrelease.h
Using /Kernel/android_kernel_samsung_t1-android-4.4 as source for kernel
HOSTCC scripts/genksyms/genksyms.o
Generating include/generated/mach-types.h
CC kernel/bounds.s
GEN include/generated/bounds.h
CC arch/arm/kernel/asm-offsets.s
SHIPPED scripts/genksyms/lex.c
SHIPPED scripts/genksyms/parse.h
SHIPPED scripts/genksyms/keywords.c
SHIPPED scripts/genksyms/parse.c
HOSTCC scripts/genksyms/lex.o
CC scripts/mod/empty.o
HOSTCC scripts/mod/mk_elfconfig
GEN include/generated/asm-offsets.h
CALL /Kernel/android_kernel_samsung_t1-android-4.4/scripts/checksyscalls.sh
HOSTCC scripts/genksyms/parse.o
HOSTCC scripts/selinux/genheaders/genheaders
MKELF scripts/mod/elfconfig.h
HOSTCC scripts/mod/file2alias.o
HOSTCC scripts/selinux/mdp/mdp
HOSTCC scripts/mod/modpost.o
HOSTCC scripts/kallsyms
HOSTLD scripts/genksyms/genksyms
HOSTCC scripts/conmakehash
HOSTCC scripts/recordmcount
HOSTCC scripts/mod/sumversion.o
HOSTLD scripts/mod/modpost
CHK include/generated/compile.h
CC init/main.o
HOSTCC usr/gen_init_cpio
CC arch/arm/vfp/vfpmodule.o
UPD include/generated/compile.h
CC init/do_mounts.o
GEN usr/initramfs_data.cpio
File ../../ramdisk.cpio could not be opened for reading
line 32
File ../../ramdisk-recovery.cpio could not be opened for reading
line 33
/Kernel/android_kernel_samsung_t1-android-4.4/usr/Makefile:67: recipe for target 'usr/initramfs_data.cpio' failed
make[2]: *** [usr/initramfs_data.cpio] Error 255
/Kernel/android_kernel_samsung_t1-android-4.4/Makefile:945: recipe for target 'usr' failed
make[1]: *** [usr] Error 2
make[1]: *** Waiting for unfinished jobs....
AS arch/arm/vfp/entry.o
AS arch/arm/vfp/vfphw.o
CC arch/arm/vfp/vfpsingle.o
CC arch/arm/vfp/vfpdouble.o
CC init/do_mounts_rd.o
CC init/do_mounts_initrd.o
CC init/initramfs.o
CC init/calibrate.o
CC init/version.o
LD arch/arm/vfp/vfp.o
LD arch/arm/vfp/built-in.o
LD init/mounts.o
LD init/built-in.o
Makefile:130: recipe for target 'sub-make' failed
make: *** [sub-make] Error 2
15th July 2017, 05:23 AM |#16  
Senior Member
Thanks Meter: 2,241
 
Donate to Me
More
I've been working a little more on my Pixel XL kernel. Question...

I do:

Code:
make clean && make mrproper
make marlin_defconfig
make menuconfig
I go through several options, save, and exit. But when I do "git status", it thinks nothing has changed? I'm not sure if that's true, or if it just doesn't track whatever files were modified by menuconfig (of which I have no idea which ones they are).
15th July 2017, 06:10 AM |#17  
nathanchance's Avatar
OP Recognized Developer / Recognized Contributor
Flag Mesa, AZ
Thanks Meter: 50,715
 
More
Quote:
Originally Posted by chevycam94

I've been working a little more on my Pixel XL kernel. Question...

I do:

Code:
make clean && make mrproper
make marlin_defconfig
make menuconfig
I go through several options, save, and exit. But when I do "git status", it thinks nothing has changed? I'm not sure if that's true, or if it just doesn't track whatever files were modified by menuconfig (of which I have no idea which ones they are).

I'm sorry I forgot to reply to your message, I looked at it then left my computer. make menuconfig saves the changes to the .config file in the kernel source. You need to copy that file to your arch/arm64/configs/<defconfig_name>.
The Following User Says Thank You to nathanchance For This Useful Post: [ View ]
15th July 2017, 06:31 AM |#18  
Senior Member
Thanks Meter: 2,241
 
Donate to Me
More
Quote:
Originally Posted by The Flash

I'm sorry I forgot to reply to your message, I looked at it then left my computer. make menuconfig saves the changes to the .config file in the kernel source. You need to copy that file to your arch/arm64/configs/<defconfig_name>.

No problem. I'm not in a huge rush. It builds, and runs better than any kernel I have tried yet. Not joking. :P

So you're saying I need to copy the contents of the .config file INTO the "marlin_defconfig" file? Just append those lines to the end of the file?

Also, did I mention my little headache with my 9 "section_mismatch" errors? Doesn't seem to affect anything, but on this same build VM, I can build any other kernel source without any issues at all. So strange.
15th July 2017, 07:39 AM |#19  
nathanchance's Avatar
OP Recognized Developer / Recognized Contributor
Flag Mesa, AZ
Thanks Meter: 50,715
 
More
Quote:
Originally Posted by chevycam94

No problem. I'm not in a huge rush. It builds, and runs better than any kernel I have tried yet. Not joking. :P

So you're saying I need to copy the contents of the .config file INTO the "marlin_defconfig" file? Just append those lines to the end of the file?

Also, did I mention my little headache with my 9 "section_mismatch" errors? Doesn't seem to affect anything, but on this same build VM, I can build any other kernel source without any issues at all. So strange.

You should just be able to copy the whole file (cp .config arch/arm64/configs/marlin_defconfig).

You could run a git bisect on your kernel source and see if there is a commit causing those mismatch errors. Very rarely is that a result of a toolchain or environment configuration.
The Following User Says Thank You to nathanchance For This Useful Post: [ View ]
16th July 2017, 01:13 PM |#20  
ZawZaw's Avatar
Recognized Developer
Flag Pyay, Myanmar.
Thanks Meter: 3,060
 
More
Hi..Sir Flash,

I want to ask a question for ARM Device. ( Nexus 6 )

This is right method for ARM?

example:

- - - - -
export CROSS_COMPILE=${HOME}/Kernel/Toolchain/bin/arm-eabi-

export ARCH=arm && export SUBARCH=arm

make clean && make mrproper

make shamu_defconfig

make -j$(nproc --all)
- - - - -

I want to know this about.
If this method is wronged, Please teach me Sir.

Thanks.

•••

Sent from my Google Nexus 5X using XDA Labs
16th July 2017, 05:15 PM |#21  
nathanchance's Avatar
OP Recognized Developer / Recognized Contributor
Flag Mesa, AZ
Thanks Meter: 50,715
 
More
Quote:
Originally Posted by ZawZaw

Hi..Sir Flash,

I want to ask a question for ARM Device. ( Nexus 6 )

This is right method for ARM?

example:

- - - - -
export CROSS_COMPILE=${HOME}/Kernel/Toolchain/bin/arm-eabi-

export ARCH=arm && export SUBARCH=arm

make clean && make mrproper

make shamu_defconfig

make -j$(nproc --all)
- - - - -

I want to know this about.
If this method is wronged, Please teach me Sir.

Thanks.

•••

That's correct.
The Following User Says Thank You to nathanchance For This Useful Post: [ View ]
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