yashsingh1/xdaforums huggingface dataset:
[Android Software Development] Psilocelium:
I was hoping to get a little help too.

I got everything set up and ran the first command for CROSS_COMPILE and got this...

clint@Y700-MATE:~/android/Kernel$ ARCH=arm CROSS_COMPILE=~/linaro-7.2.1/bin/arm-eabi- make apq8084_sec_trlte_spr_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
In file included from scripts/kconfig/zconf.tab.c:2503:0:
scripts/kconfig/menu.c: In function ‘get_symbol_str’:
scripts/kconfig/menu.c:567:18: warning: ‘jump’ may be used uninitialized in this function [-Wmaybe-uninitialized]
jump->offset = r->len - 1;
~~~~~~~~~~~~~^~~~~~~~~~~~
scripts/kconfig/menu.c:528:19: note: ‘jump’ was declared here
struct jump_key *jump;
^~~~
HOSTLD scripts/kconfig/conf
arch/arm/configs/apq8084_sec_trlte_spr_defconfig:115:warning: override: reassigning to symbol LEDS_MAX77828
warning: (MODULES) selects TIMA_LKMAUTH which has unmet direct dependencies (ARCH_MSM)
KCONFIG_SELINUX((null))
KCONFIG_LOG_SELINUX((null))
KCONFIG_TIMA((null))
KCONFIG_DMVERITY((null))
KCONFIG_VARIANT((null))
***
*** You must specify VARIANT_DEFCONFIG !
***
/home/clint/android/Kernel/scripts/kconfig/Makefile:130: recipe for target 'apq8084_sec_trlte_spr_defconfig' failed
make[1]: *** [apq8084_sec_trlte_spr_defconfig] Error 1
Makefile:513: recipe for target 'apq8084_sec_trlte_spr_defconfig' failed
make: *** [apq8084_sec_trlte_spr_defconfig] Error 2

Any help would be greatly appreciated. I've never tried compiling a kernel before.
[Android Software Development] kevintm78:
I have the same device as you and instead of using the commands in the Op, I think it's easier to use the build-kernel.sh script that's included in the source code.

#!/bin/bash

export ARCH=arm
export CROSS_COMPILE=$(pwd)/../PLATFORM/prebuilts/gcc/linux-x86/arm/arm-eabi-4.8/bin/arm-eabi-
mkdir output

make -C $(pwd) O=output apq8084_sec_defconfig VARIANT_DEFCONFIG=apq8084_sec_trlte_eur_defconfig SELINUX_DEFCONFIG=selinux_defconfig
make -C $(pwd) O=output

cp output/arch/arm/boot/Image $(pwd)/arch/arm/boot/zImage

You'll notice that it already has the variant defconfig already set. The only things you have to change is your path to the toolchain. By the way, you may have a tough time compiling with a 7.1 toolchain if this is your first time. The 4.8 or 4.9 toolchain will compile without any changes made to the source though.

You also have to change the permission on the script. Right click on the file, go to properties, and check the box that says "allow this to ran as script", that may not be exactly verbatim but you'll see the box I'm talking about when you go to that setting. Then just run this command

, /build-kernel.sh

It should build just fine after that.
[Android Software Development] Psilocelium:
Thanks for the advice and the code. I'm downloading Linaro 4.9 right now to try again with the method you described.

[/COLOR]This Plasma kernel I'm trying to compile seems to have a custom buildKernel.sh. Here's the first part of the script with variables defined.

#!/bin/sh

# Copyright (C) 2011 Twisted Playground
# Copyright (C) 2013 LoungeKatt

# This script is designed by Twisted Playground / LoungeKatt for use on MacOSX 10.7 but can be modified for other distributions of Mac and Linux

KERNELDIR=`pwd`
HANDLE=LoungeKatt
KERNELREPO=$DROPBOX_SERVER/TwistedServer/StarKissed/kernels
TOOLCHAIN_PREFIX=/Volumes/android/android-toolchain-eabi-4.7/bin/arm-eabi-
#TOOLCHAIN_PREFIX=/Volumes/android/linaro-toolchain-eabi-4.8/bin/arm-none-linux-gnueabi-
PUNCHCARD=`date "+%m-%d-%Y_%H.%M"`

buildKernel () {

PROPER=`echo "$TYPE" | sed 's/\([a-z]\)\([a-zA-Z0-9]*\)/\u\1\2/g'`
RAMDISKOUT=buildimg/boot."$TYPE"-ramdisk
MODULEOUT=skrecovery/"$TYPE"/system
MEGASERVER=mega:/trltesku/
KERNELHOST=public_html/trltesku
GOOSERVER=upload.goo.im:$KERNELHOST
KERNELZIP="StarKissed-"$PUNCHCARD"-trlte"$TYPE".zip"

# CPU_JOB_NUM=`grep processor /proc/cpuinfo|wc -l`
CORES=`sysctl -a | grep machdep.cpu | grep core_count | awk '{print $2}'`
THREADS=`sysctl -a | grep machdep.cpu | grep thread_count | awk '{print $2}'`
CPU_JOB_NUM=$((($CORES * $THREADS) / 2))

Could you tell me what I should do with this?
[Android Software Development] kevintm78:
Oh, I see. That's a fairly advanced script to use and I might be able to help you out with some of it, but if I were you I would go with the simpler script and then just manually move your zImage and upload the file (if you want). It appears your script does all of that and may require more than just a few changes. It says it's designed for MacOSX though, so if you're building on a MacOSX it could be more beneficial to use that one.

Just to be sure, it looks like that kernel is forked from another kernel that's built using a KK source. Is that the version you're wanting to build for? I haven't really looked through source so it may have been updated, I just wanted to make you aware of that.

If you want to use the following script, the 2 changes in red is all you'll have to make. The new zImage will be in output/arch/arm/boot/zImage

#!/bin/bash

export ARCH=arm
export CROSS_COMPILE=$(pwd)[COLOR="red"]/toolchain/path[/COLOR]
mkdir output

make -C $(pwd) O=output VARIANT_DEFCONFIG=apq8084_sec_trlte_[COLOR="red"]yourvariant[/COLOR]_defconfig apq8084_sec_defconfig SELINUX_DEFCONFIG=selinux_defconfig
make -C $(pwd) O=output

cp output/arch/arm/boot/Image $(pwd)/arch/arm/boot/zImage
[Android Software Development] Psilocelium:
I'm running Linux to compile and usually run Win 10. I don't have a Mac so that was another reason I was wondering how to compile this kernel. Also, the Plasma kernel was downloaded from GitHub and says it's for Marshmallow but the OP had several updates for it.

Here's the original thread... https://xdaforums.com/note-4-sprint/orig-development/kernel-plasma-kernel-note4-1-00-t3138069

The developer has downloads available for KitKat, Lolipop, and Marshmallow except the Marshmallow TouchWiz update. He did post a link to his GitHub source code though so I was hoping I could take a crack at compiling it myself for my Note 4. I'm stuck using the stock TouchWiz ROM cuz I have TextNow for a service provider and custom ROMs break their services. If I could figure out how to get TextNow to work with the Emotion OS I was running I would be ecstatic but for now I am stuck using custom kernels instead for some semblance of customization.

Thank you for all your advice. I appreciate it!!
[Android Software Development] kevintm78:
Oh okay. I took a look at his github page and found this repo for his MM plasma kernel. Have you had any luck with the compilation?
[Android Software Development] kevintm78:
It looks like it's not finding your toolchain. Do you have the toolchain folder inside of the plasma folder? I usually put my toolchain folder inside my kernel root folder but there seems to be differing opinions as to where it should go. I feel like it doesn't really matter as long as its found by the command.

The make mrproper and make clean errors can be fixed with this commit.

Also, the added benefit of building using an "out" folder is that you can also just delete that folder to clean as long as there hasn't been an attempt to build without an "out" folder first.

I was going to answer your pm but I'll also go ahead and post here. The error you get when trying to use the script can be solved by checking the "allow this file to run as a program". Right click on the script and go to the permissions tab and set like this:

Sorry for the sideways pic. :silly:
[Android Software Development] Psilocelium:
Yeah, I'm familiar with setting file permissions to run as executable and I've been making sure to doublecheck that before running.

The toolchain is in my user folder but I'll put it in the kernel folder and try again.
[Android Software Development] Wyneg:
Hi! I used this guide and I destroyed system, xD Anyway, how I know what is the kernel source branch? I want to create a kernel for xiaomi vince 8.1 and I don't see in this guide any mention of android versions... I overlooked something?

Thanks!

Edit: My bad, don't worry ;)
[Android Software Development] thezinq:
When I enter "make -j8" it gives me this error. Can anyone help me with this.
[Android Software Development] dandyfarid:
Thanks for guide adding governors in kernel :)
[Android Software Development] LinuxPanda:
You can find it in github. I think its arch independent.
[Android Software Development] lolvatveo:
please anyone point me where i can learn/study about android kernel. i know how to download the source code but don't know these files in it and how to edit to overclock, add governor, features...
[Android Software Development] Travisholt92:
https://m.youtube.com/results?sp=mAEA&search_query=Compile+custom+android+kernel
[Android Software Development] lolvatveo:
hello sir I just find out the new reason why my phone doesn't apply new kernel feature I added. That is I don't update dt.img into boot.img for phones, most modern phones need custom dt.img when using custom kernel. The dtb files are compiled at the same time as the kernel is compiled, I need to create, merge the dtb files to dt.img, but the important thing is I need to do it successfully. And it's a big mistake that most kernel compilation forums don't mention dtb and how to make dt.img or the tool to do it! sir how to merge dtb files and create dt.img?
[Android Software Development] Motoepower:
So basically I was trying to add driver support for CH341,I tried to add command in kernel config as CONFIG_USB_SERIAL_CH341=y and when i try to compile its giving me erros Please check image-
[Android Software Development] zparallax:
Pack zImage

Hi everyone:

I'm compiling my kernel... I downloaded the cm12 branch for KLTE (Galaxy S5). I have compiled it and now I have got my zImage.

Then following the tutorial I try to pack my zImage to a recovery ZIP but then happens two things...

1.- A flash error in recovery

2.- My kernel wont boot and I goes directly to Download Mode.

Anyone that can guide me about what I have to do.

Thanks :good:
[Android Software Development] mohit310:
You need to convert your zImage and dts into bootimage. I'm also stuck at this point. If you know how to do it, please share the info.
[Android Software Development] savoca:
Use unpackbootimg on your stock boot.img to pull things like your cmdline, offsets, ramdisk, etc... Then use mkbootimg to create an image using your kernel and dtb.
[Android Software Development] Joeisgood99:
Hi all.

Attempting to build stock kernel for HTC M7 on Ubuntu 14, I'm using Linaro tool chain 4.9

I have installed dependencies ect.

When I cd to /M7_kernel_folder in terminal and enter command [make zImage]

Or [make all] I get this error after about 45mins.

[drivers/video/msn/mipi_novatek. C: failed

Barrier make [3]. drivers/video/msn 0 Error 1

Reciept for drivers/video/msn/ error 2]

It goes on, but wondering if anyone knows how I can begin to problem solving this or what

Would cause this error?

Thanks.

---------- Post added at 03:46 AM ---------- Previous post was at 03:01 AM ----------
[Android Software Development] Baskhara:
Hello guys

I'm new to linux and I'm interesting to build a kernel for my phone. But there is a little problem when I'm trying to install kernel-package . Did you guys know how to solve this issue? cuz I don't really understand about linux yet. Anyway I'm using Ubuntu 14.10. Thx :)

Edit: I did solved the issue
[Android Software Development] yogi77:
I'm also trying to build my kernel, which doesn't work unfortunately. If I use the parameter from stock kernel does it still fit, if I use it for a changed kernel (other offsets etc?)?
[Android Software Development] jbliz:
Stopped receive toolchains

Sir.

I tried to install toolchains. After couple minutes, my internet connection is lost but not to long. I'm wait while open facebook on other website to make sure the connection good, yes of course connection is normal but progress just hang on 92%.

Can it resume later if I close terminal? or I begin download from first
[Android Software Development] skulldreamz:
You can type "su" enter and then "cat proc/cmdline" to get your devices necessary info quickly and/or use this guide to unpack/repack

http://xdaforums.com/showthread.php?t=3052453
[Android Software Development] kaiiori:
I presented the following problem with the tutorial

caps

Note:

Replace Device Name with the configuration file found at:

Source/arch/arm/configs

It's written in this way something_DeviceCodename_user_defconfig

A menu like this will appear

Choose the features you want.

I have understood that to do that it needs a file located on the route /proc/config.gz something in my kernel 4.4.4 no such file exists and set up my environment helps :rolleyes:
[Android Software Development] zarpanzur:
+1, I have the same problem. Any help is appreciated. I do get the message " :warning: override: reassigning to symbol " when making .config file.
[Android Software Development] zparallax:
Hi my friend:

I've compiled my kernel and now it's working... There are few things why the kernel doesn't boot.

1. Bad ramdisk, look for a existing kernel or extract them from a ROM

2. A bad kernel configuration... A bad implementation of something (a tweak or another code that's messing)

3. An incorrect kernel .config

When you have that message means only that you are overwriting a rule, it not always is bad.

Best!
[Android Software Development] Tomoms:
Good morning, I followed another guide which is just alike this one, the only difference in the compiling process is that the other guide doesn't tell me to run "make menuconfig". I'm trying to build CyanogenMod 12.1's kernel. Anyway, the building process ended without errors. These are the last lines of the terminal output:

CC kernel/time.o
CHK kernel/config_data.h
UPD kernel/config_data.h
CC kernel/configs.o
LD kernel/built-in.o
tfonda@R530:~/linux/android_kernel_sony_msm8x60$

The strange fact is that there is no output! No *.elf file, no zImage in <source-path>/arch/arm/boot...

What went wrong?

P.S.

I have built the kernel with Linaro GCC4.9 toolchain.

I don't know if this is important: in the <source-path>/arch/arm/configs folder there are 2 defconfigs for my device, one is cm_DEVICENAME the other is DEVICENAME. I used cm_DEVICENAME, anyway the difference between the 2 files is only one line of code. In the configs folder there are also 2 defconfigs named with my CPU's name: msm8960_defconfig and msm8960-perf_defconfig.

Can you help me?

EDIT: I resolved. There were hidden errors in the building process. I used make -j1 instead of make -j2 and the errors showed up. I fixed them and now, using make -j1, the build completed successfully.
[Android Software Development] zarpanzur:
How would I know if I have a proper/good kernel .config? I've tried so many toolchains and the android ndk and just nothing works.
[Android Software Development] ayazm.140895:
is this tutorial applicable to linux mint 17?
[Android Software Development] rockydracer:
So after compilation of kernel how to add it to aosp .or how to make boot IMG??

How To build for mediatek??
[Android Software Development] naitik2012:
Can any 1 help me out here ?

root@naitik-desktop:/home/naitik/kernel# make -j3

scripts/kconfig/conf --silentoldconfig Kconfig

include/config/auto.conf:180:warning: symbol value 'elf32-i386' invalid for OUTPUT_FORMAT

include/config/auto.conf:261:warning: symbol value 'arch/x86/configs/i386_defconfig' invalid for ARCH_DEFCONFIG

include/config/auto.conf:615:warning: symbol value '-fcall-saved-ecx -fcall-saved-edx' invalid for ARCH_HWEIGHT_CFLAGS

CHK include/linux/version.h

UPD include/linux/version.h

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/generated/utsrelease.h

UPD include/generated/utsrelease.h

HOSTCC scripts/dtc/checks.o

HOSTCC scripts/genksyms/genksyms.o

SHIPPED scripts/genksyms/lex.lex.c

SHIPPED scripts/genksyms/keywords.hash.c

SHIPPED scripts/genksyms/parse.tab.h

SHIPPED scripts/genksyms/parse.tab.c

HOSTCC scripts/dtc/data.o

CC scripts/mod/empty.o

gcc: error: unrecognized argument in option ‘-mabi=aapcs-linux’

gcc: note: valid arguments to ‘-mabi=’ are: ms sysv

gcc: error: unrecognized command line option ‘-mlittle-endian’

gcc: error: unrecognized command line option ‘-mno-thumb-interwork’

make[2]: *** [scripts/mod/empty.o] Error 1

make[1]: *** [scripts/mod] Error 2

make[1]: *** Waiting for unfinished jobs....

Building CM12.1 kernel for Sirius (Xperia Z2) using arm-cortex_a15-linux-gnueabihf-linaro_4.9.1

Thanks :)
[Android Software Development] Kizoky:
Will this work with Sony's MSM8610 kernel?

(Xperia E1) Because E1 does not have AOSP support
[Android Software Development] denseye:
hello

first : thank you for this great tutorial that helped me compiling my first kernel :)

I have a little question :

I've compiled a first version, using kernel sources that I downloaded and extracted locally.

I then made some modifications and commited on github.

Now, htc released new update of sources for my kernel, and I downloaded it.

How can I properly update my project with new sources + keeping my existing commits ok ?

thank you
[Android Software Development] csendre:
I am getting an error message at this step: No rule to make target 'Device Name'. Of course, under device name I used the name of the actual defconfig file as directed. Any suggestions?
[Android Software Development] igoryan94:
My Android kernel: Bug after successful boot

Hello! Please, can someone help me?

I have successfully compiled and booted my own kernel (for Lollipop), all is great and I am happy, but:

when screen locks, android is freezing and only reboot helps :(

I've tryed many builds of Linaro and two variants of clean sources of the kernel, the bug is not changed :(

What do I do wrong?(

Help me please!
[Android Software Development] sanchit0403:
getting this error please help

sanchit@sanchit-pc:~/and/kernel$ make -j4

scripts/kconfig/conf --silentoldconfig Kconfig

drivers/usb/gadget/Kconfig:881:warning: defaults for choice values not supported

warning: (SND_SOC_MSM8226) selects DOLBY_DAP which has unmet direct dependencies (SOUND && !M68K && !UML && SND && SND_SOC && SND_SOC_MSM8974)

warning: (SND_SOC_MSM8226) selects DOLBY_DAP which has unmet direct dependencies (SOUND && !M68K && !UML && SND && SND_SOC && SND_SOC_MSM8974)

CHK include/linux/version.h

CHK include/generated/utsrelease.h

CC scripts/mod/empty.o

HOSTCC scripts/selinux/genheaders/genheaders

/home/sanchit/home/sanchit/and/arm-eabi-4.9/bin/arm-eabi-gcc: No such file or directory

Is your PATH set correctly?

make[2]: *** [scripts/mod/empty.o] Error 2

make[1]: *** [scripts/mod] Error 2

make[1]: *** Waiting for unfinished jobs....

/home/sanchit/and/kernel/scripts/gcc-version.sh: line 25: /home/sanchit/home/sanchit/and/arm-eabi-4.9/bin/arm-eabi-gcc: No such file or directory

/home/sanchit/and/kernel/scripts/gcc-version.sh: line 26: /home/sanchit/home/sanchit/and/arm-eabi-4.9/bin/arm-eabi-gcc: No such file or directory

/home/sanchit/and/kernel/scripts/gcc-version.sh: line 25: /home/sanchit/home/sanchit/and/arm-eabi-4.9/bin/arm-eabi-gcc: No such file or directory

/home/sanchit/and/kernel/scripts/gcc-version.sh: line 26: /home/sanchit/home/sanchit/and/arm-eabi-4.9/bin/arm-eabi-gcc: No such file or directory

HOSTCC scripts/selinux/mdp/mdp

make[1]: `include/generated/mach-types.h' is up to date.

make: *** [scripts] Error 2

make: *** Waiting for unfinished jobs....

CC kernel/bounds.s

/home/sanchit/home/sanchit/and/arm-eabi-4.9/bin/arm-eabi-gcc: No such file or directory

Is your PATH set correctly?

make[1]: *** [kernel/bounds.s] Error 2

make: *** [prepare0] Error 2
[Android Software Development] Ciuffy:
What environmental variables are you setting?

(Path, Cross Compile, Arch?)
[Android Software Development] sanchit0403:
cross compile
[Android Software Development] Ciuffy:
How are you setting it?

Try

PATH=&PATH:/arm-eabi-4.4.3/bin/

CROSS_COMPILE=arm-eabi-
[Android Software Development] _heisenberg:
There's something wrong with the guide. The guide refers to a 32bit toolchain. You can't run a 32bit toolchain (or 32bit programs in general) in Ubuntu without install the packages:

lib32z1 lib32ncurses5 lib32bz2-1.0

do this with the command:

sudo apt-get install lib32z1 lib32ncurses5 lib32bz2-1.0

This solved it for me, I had the same issues.

I would recommend it to the Thread Starter to add this to his guide. [MENTION=5373435]Eliminator79[/MENTION]
[Android Software Development] MEGAX91:
i'm trying to update kernel version to upstream latest version!

i download the patch-3.10.41-42.xz from :

https://www.kernel.org/pub/linux/kernel/v3.0/incr/

but when i try to apply the patch to my source , im facing this error :

guyver@nagatobimaru:~$ cd android/G
guyver@nagatobimaru:~/android/G$ patch -p1 <patch-3.10.40-41
patching file Makefile
can't find file to patch at input line 17
Perhaps you used the wrong -p or --strip option?
The text leading up to this was:
--------------------------
|diff --git a/arch/arm/configs/multi_v7_defconfig b/arch/arm/configs/multi_v7_defconfig
|index 2e67a272df70..9ce8ba1a1433 100644
|--- a/arch/arm/configs/multi_v7_defconfig
|+++ b/arch/arm/configs/multi_v7_defconfig
--------------------------
File to patch:

http://s5.iranxm.com/up/2709600f60cc.png

http://s9.iranxm.com/up/f8229696f7a3.png
[Android Software Development] viking666:
Try using the "-p0" flag instead of the "-p1". Patch can be very picky about which directory you are working in.
[Android Software Development] SumanthBv:
I am not getting one thing.

I'm using OnePlus One(bacon) and my phone's kernel source is of .zip file instead of .tar.bz

I'm not sure if I can run the same commands as you've shown in post#2

Help needed!
[Android Software Development] neonkat:
instead of that command,simply extract the zip in the *kernel source folder*.:D
[Android Software Development] Nonta72:
What does aarch64-android-linux-gcc not found error mean ?

(This file is well present in /bin folder of the toolchain)

---------- Post added at 11:05 AM ---------- Previous post was at 11:04 AM ----------

What does aarch64-android-linux-gcc not found error mean ?

(This file is well present in /bin folder of the toolchain)
[Android Software Development] Aashish:
wow nice tutorial !!
[Android Software Development] matteo0026:
When i write in terminal and after execute this command

make ARCH=arm CROSS_COMPILE=~/arm-eabi-4.4.3/bin/arm-eabi- menuconfig

it closes terminal without a sense. Why this? I have ubuntu 14.04 lts
[Android Software Development] Avinash kodidasu:
Help me please on finding config file

@Eliminator79

Please help me on finding config file....

My device was wiko highway and nor able to find any config file because it has no device code and there is no config file consists of highway name..so please help me
[Android Software Development] neonkat:
do you have any idea what you linked?
[Android Software Development] Avinash kodidasu:
please see attachments and help me
[Android Software Development] neonkat:
which device?codename?(need a detailed model info)

and btw,

which os??
[Android Software Development] Avinash kodidasu:
I want to add s2w and double tap features to my kernel

I already told my model name again repeating that my model name is wiko highway and in settings also it was shows highway only...so please help me on finding config file

Mt6592 soc

And first i want to build kernel and adding features

I have full source code i think so