yashsingh1/xdaforums huggingface dataset:
[Android] Luffy.d:
Check the hwdep.h...it has no snd_hwdep_open function

edit : able to pass it but now getting this one

CHK include/generated/compile.h
CC sound/core/pcm.o
sound/core/pcm.c: In function 'snd_pcm_get':
sound/core/pcm.c:52:10: error: 'struct snd_pcm' has no member named 'internal'
if (pcm->internal)
^
sound/core/pcm.c: In function 'snd_pcm_next':
sound/core/pcm.c:65:10: error: 'struct snd_pcm' has no member named 'internal'
if (pcm->internal)
^
make[2]: *** [sound/core/pcm.o] Error 1
make[1]: *** [sound/core] Error 2
[Android] TheStrix:
Can someone guide me to download caf kernel trees for msm8226?

Also the command for syncing kernel tree from codeaurora website. :)
[Android] desalesouche:
check code here if it helps?

https://github.com/Blefish/android_kernel_huawei_msm7x30/blob/cm-12.0/sound/core/pcm.c#L654
[Android] Luffy.d:
thanks bro...

currently doing that only to pass the error...but i want to know how to fix it without removing them

---------- Post added at 12:27 PM ---------- Previous post was at 12:25 PM ----------

download caf kernel of sony m2 dual which msm8226....then apply xaiomi changes

it will boot without any issue but you will get some issue after boot like wifi or cam or not working
[Android] fizbanrapper:
Adding sweep2wake feature and have run into an issue. I'm most of the way there, but the device doesn't actually sleep or wake when I sleep.

It recognizes input from the capacitive buttons when asleep, which I'm hoping was the hard part.

The phone could be properly acknowledging the sweep 2 wake action, but isn't connecting the dots to the power key. On the other hand, it might be connected to the power key just fine, but doesn't know that my gesture is a sweep.

How do I tell the difference between the two? Seems to me that the device would behave the same way in either case.

Any general guidance?
[Android] Rana Fahad Khan:
Hi everyone :)

I hope all of you are fine.

I'm trying to compile this source and getting error 127

How to deal with that ?

Thanks in advance!

Fahad
[Android] kenkit:
Debugging shell scripts isn‘t that hard, look at the error generated, mosltly in the logs(post them here) which also has a line number, go to that line and fix it, look if there is a missing ";" , if u cant fix it remove the line and note braces.If there are any remove and try compiling again, i'll look into it later when am on pc.

Press thanks if I may have helped.
[Android] ashikrobi:
Merge the linux kernel

Friends i need help. I am trying to merge linux 3.4.106 with samsung kernel source. But after doing the merge my base kernel replaces by the linux kernel. Can anyone tell the the actual procedure to merge the linux kernel correctly? Please ?

I did like this:

Created a new branch for linux and checkout the branch.

Then i overwrite kernel directory with the linux kernel and committed

checkout the master branch and merged with git merge linux-3.4.106

Thanks
[Android] 19dragon98:
Can anyone help me... i get this error, i think is the PATH not set correctly. Thanks

gabriele@ubuntu:~/Documents/kernel/grouper/tegra$ make
make: arm-eabi-gcc: Command not found
scripts/kconfig/conf --silentoldconfig Kconfig
make: arm-eabi-gcc: Command not found
CHK include/linux/version.h
CHK include/generated/utsrelease.h
make[1]: 'include/generated/mach-types.h' is up to date.
CC kernel/bounds.s
/bin/sh: 1: arm-eabi-gcc: not found
/home/gabriele/Documents/kernel/grouper/tegra/./Kbuild:35: recipe for target 'kernel/bounds.s' failed
make[1]: *** [kernel/bounds.s] Error 127
Makefile:985: recipe for target 'prepare0' failed
make: *** [prepare0] Error 2
[Android] akhilnarang:
Once I add governors, how do I select them in the menuconfig?
[Android] pec0ra:
There's a key to search in the menuconfig. I think it's /
[Android] akhilnarang:
Yep its /

Thanks a lot
[Android] Nibsalot:
Hi, I'm looking to compile my own kernel based on stock for the n4 and n5 and was wondering if anyone could point me in the right direction for implementing dt2w.

Is there a patch I can include or is it note complicated than that?
[Android] Avani_AR:
A big Thanks..!

Thanks a lot..I don't know how, but it works...!!! :good:
[Android] Joeisgood99:
build error in net/bluetooth/hci_conn

Hi Guys.

Great Tute btw.

Im attempting to build stock HTC m7 kernel from source using Linaro 4.9.3 in Ubuntu Utopic.

I have been getting a few very similar errors ie: " warning: argument to 'sizeof' in 'memcpy' call is the same pointer type"...

Can anyone tell me how to deal with this particular one. ...

[output on terminal when building kernel]

****************************************

"CC net/bluetooth/hci_core.o

CC net/bluetooth/hci_conn.o

net/bluetooth/hci_conn.c: In function 'hci_le_ltk_reply':

net/bluetooth/hci_conn.c:266:28: warning: argument to 'sizeof' in 'memcpy' call is the same pointer type '__u8 *' as the destination; expected '__u8' or an explicit length [-Wsizeof-pointer-memaccess]

error, forbidden warning: hci_conn.c:266

scripts/Makefile.build:307: recipe for target 'net/bluetooth/hci_conn.o' failed

make[2]: *** [net/bluetooth/hci_conn.o] Error 1"

*********************************************************

So I went to the address that the error messagw staated, net/bluetooth/hci_conn.c:266:28

I am looking at this...

***********************************

void hci_le_ltk_reply(struct hci_conn *conn, u8 ltk[16])

{

struct hci_dev *hdev = conn->hdev;

struct hci_cp_le_ltk_reply cp;

BT_DBG("[COLOR="Cyan[COLOR="Magenta"]"[/COLOR]]%p[/COLOR]", conn);

memset(&cp, 0, sizeof(cp));

cp.handle = cpu_to_le16(conn->handle);

memcpy(cp.ltk, ltk, sizeof(ltk));

hci_send_cmd(hdev, HCI_OP_LE_LTK_REPLY, sizeof(cp), &cp);

}

********************************************************

the error is in this line " memcpy(cp.ltk, ltk, sizeof(ltk)); "

Im pretty sure I have to add something to (ltk)); But Im not sure what.

Thanks in advance.
[Android] desalesouche:
https://github.com/Blefish/android_...mmit/2f6182ebdece23e64be55962548a2e3bcb376643

please use pastebin next time. :good:
[Android] Joeisgood99:
Thanks!

1) Sorry, I'll learn how to use paste bin!

2) I got another error (see link below for output)

warning: unwinding may not work because EXIDX input section xx of arch/arm/common/built-in.o is not in EXIDX output section

http://paste.ubuntu.com/10462968/

I did a search on XDA and found a reply on a different thread

xda-developers.com/nexus-4/orig-development/kernel-franco-kernel-r208-t2002782/page3242

...where franciscofranco stated " That warning happens because the config you used has ARM_UNWIND enabled."

If thats the fix to my problem how do i edit my config and to what setting?/what do I change?

The command line i used to get the config was "make m7_defconfig" If thats any help.

Thanks a LOT for your help so far.
[Android] someone755:
The config is the file located in arch/arm/configs (name is, in your case, m7_defconfig). It's where you tell the compiler which features (that are available from Kconfigs around the kernel) you want on/off (if you open it up there's a bunch of lines with =y and =n).

(Find your config and a Kconfig and you'll understand better what I mean.)

As for fixing errors, I'd absolutely recommend you Google it first, but you won't find a lot of fixes that way. Still, Google first, then ask here.
[Android] desalesouche:
real error is that one, the others are warnings that might need to be fixed to.

arm-eabi-ld: error: arch/arm/boot/compressed/piggy.gzip.o: unknown CPU architecture

arm-eabi-ld: error: arch/arm/boot/compressed/lib1funcs.o: unknown CPU architecture

arm-eabi-ld: error: arch/arm/boot/compressed/ashldi3.o: unknown CPU architecture

/home/joe/Desktop/Project/m7ul-3.4.10-g40b189c/arch/arm/boot/compressed/Makefile:185: recipe for target 'arch/arm/boot/compressed/vmlinux' failed

make[2]: *** [arch/arm/boot/compressed/vmlinux] Error 1

and fix is there:

Errors caused by Linaro?

* error: unknown CPU architecture -> https://github.com/JustArchi/android...85174baacecb03 (Keep in mind that this is a sample fix for smdk4412 kernel, you may need to use similar solution in your own case. Also, this error happens only with Linaro toolchain, doesn't happen with Google's GCC)

From this thread : http://xdaforums.com/showthread.php?t=2754997

you will need to use google to find fix for anything.many have been already reported.

don't hesitate to seek after kernel fix or whatever on github
[Android] Joeisgood99:
cc1: some warnings being treated as errors

Compiling M7 kernel in Ubuntu 14 usingg Google gcc 4.8 arm-eabi

Hi Guys

Slowly getting there. I switched tool chains to gcc4.8, downloaded a more developed kernel source (https://github.com/faux123/htc-m7.git) Everything compiling fine, however because Werror is on, its flaging warnings as errors.

Anyone know where or how this setting is changed.

Output

CHK include/generated/compile.h

CHK kernel/config_data.h

CC drivers/i2c/chips/bma250_bosch.o

drivers/i2c/chips/bma250_bosch.c: In function 'bma250_set_enable':

drivers/i2c/chips/bma250_bosch.c:2452:4: error: implicit declaration of function 'keep_sensor_on' [-Werror=implicit-function-declaration]

if (keep_sensor_on() == 0)

************************

There are more errors but thats the first of several identical

How do I set an environment variable? (if that is the fix) ie. export CXXFLAGS="Wno-error"???

If so where do I cd to in terminal to give command or where do I find configure.ac file to change code?

Thanks.
[Android] pec0ra:
You can change it in the main Makefile.

The best is to add only the Wno-implicit-function-declaration

I don't remember the exact place where to put it but if you search in other kernel sources you should find it easily (just search for implicit-function-declaration in the source)

Edit :

Take a look at this commit : https://github.com/pec0ra/abricot/commit/4e9dc2d1ee559b190b999ac313b54eae4d8b476e

At line 373 of the Makefile
[Android] Joeisgood99:
Werror-implicit-function-declaration = cc1: some warnings being treated as errors

Thanks for excellent reply.

I found the function at line 375 of the Makefile in my kernel source. Im a bit confused though as it says what I thought I was going to change it to.

BUILD_CFLAGS := -Wall -Wundef -Wstrict-prototypes -Wno-trigraphs \

-fno-strict-aliasing -fno-common \

-Werror-implicit-function-declaration \

-Wno-format-security \

-fno-delete-null-pointer-checks

How do I change this? (Apart from #-Werror-implicit-function-declaration;) as this is identical to the section of make file in your link to example. ....Or I could just fix every implicit declaration of function error it brings up. Thanks for your patience.
[Android] pec0ra:
Sorry for my confusing answer. I was in the train and haven't really looked at the link I gave. And always thought I had Wno instead of Werror.

So the line in this link is definitely not what will hide your error since it does the opposite.

Now what you can do is, as you said, fix every place you have this error (this is the cleanest way) or just change the Werror to a Wno. The second solution is of course easier but if you know how to fix an implicit declaration (and with the help of Google you know it anyway) you'd better choose the first method. Ignoring the warning probably works and probably will always work... but maybe once you might come across a problem in your code which comes from it.
[Android] Joeisgood99:
How to declare (x_ variable) in_a_Function

fixed!Building faux123/htcm7 kernel with gcc 4.8 on Ubuntu Utopic

Hi Guys.

Is there a limit to how many Qs I can post? Hope not.

Now Im getting a few undeclared (first use in this function) type errors in a row.

Output

[COLOR="Purple"]CC drivers/i2c/chips/r3gd20.o
CC drivers/i2c/chips/bma250_bosch.o
drivers/i2c/chips/bma250_bosch.c: In function 'bma250_setup_interrupt_for_wake':
drivers/i2c/chips/bma250_bosch.c:3578:10: error: 'PICK_WAKE_ENABLED' undeclared (first use in this function)
if (PICK_WAKE_ENABLED == 1) {
^
drivers/i2c/chips/bma250_bosch.c:3578:10: note: each undeclared identifier is reported only once for each function it appears in
drivers/i2c/chips/bma250_bosch.c:3589:62: error: 'FLICK_WAKE_SENSITIVITY' undeclared (first use in this function)
error += bma250_set_slope_threshold(bma250->bma250_client, FLICK_WAKE_SENSITIVITY==0?140:110); // higher threshold to only detect heavy motion through interrupt, less wake
[/COLOR]

This is what drivers/i2c/chips/bma250_bosch.c:3578: 'PICK_WAKE_ENABLED looks like.

View attachment 3195947

So I'm assuming I have to declare that function BEFORE it is called.

Straight up (as if you couldn't tell by my last 5 Qs) I don't know how to code. I have googled how to fix minor code errors thus far but struggling to find an example of this.

Also, a number of rows down in bma250_bosch.c I found this.

View attachment 3195353

Not sure if it helps.

Is it just a matter of incerting <PICK_WAKE_ENABLED=number> at the top of the function

I have looked in many bma250_bosh.c files in githun but no joy, partly coz I dont know what Im looking for.

Any help would be appreciated.:o

https://github.com/faux123/htc-m7/tree/kk_sense_443

Problem Solved!

Thanks again for everyones help. I sorted it out. I didnt learn how to resolve an undeclared function, but I had much better luck with Christophers prebuilt tool chain AND pointing toolchain to kernel source with this command

make ARCH=arm CROSS_COMPILE=arm-cortex_a15-linux-gnueabihf-

instead of having the $PATH saved in .bashrc. Im pretty sure , despite changing path in .bashrc, every time I tried a different tool chain, every time I issued "make" command in kernel source folder, ubuntu reverted to using gcc 4.8 linux-x86- which is saved in root of my directory as a module that came with Ubuntu Utopic.

Thanks again for everyones help!
[Android] desalesouche:
hi all, i would like to know how i can fix those kernel warnings.

http://pastebin.com/2yYMiuxs

https://github.com/G620S-HUAWEI/android_kernel_huawei_g620s/tree/cm-12.0

thanks
[Android] brymaster5000:
What happens when you change those back to boolean?
[Android] desalesouche:
i changed nothing for now , so i can't answer .
[Android] sev3n1985:
Hi all,

this is my first attempt to build a kernel from source. I'm using a linaro 4.9.3 toolchains for a S3 Neo. The compiling stops with this error:

drivers/video/msm/mdss/mdss_s6e8aa0a_hd_dsi_panel.o
drivers/video/msm/mdss/mdss_s6e8aa0a_hd_dsi_panel.c: In function ‘mipi_samsung_disp_acl_show’:
drivers/video/msm/mdss/mdss_s6e8aa0a_hd_dsi_panel.c:2227:35: warning: argument to ‘sizeof’ in ‘snprintf’ call is the same expression as the destination; did you mean to provide an explicit length? [-Wsizeof-pointer-memaccess]
error, forbidden warning: mdss_s6e8aa0a_hd_dsi_panel.c:2227
make[4]: *** [drivers/video/msm/mdss/mdss_s6e8aa0a_hd_dsi_panel.o] Errore 1
make[3]: *** [drivers/video/msm/mdss] Errore 2
make[2]: *** [drivers/video/msm] Errore 2
make[1]: *** [drivers/video] Errore 2
make: *** [drivers] Errore 2

What's wrong? It's the original source from samsung :(

Here is my github with the source code:

https://github.com/sev3n85/android_kernel_samsung_s3ve3g
[Android] Wahaj.47:
Maybe bad or incomplete download of source
[Android] mastero9017:
LD drivers/net/wireless/built-in.o
LD drivers/net/built-in.o
LD drivers/built-in.o
LD vmlinux.o
MODPOST vmlinux.o
GEN .version
CHK include/generated/compile.h
UPD include/generated/compile.h
CC init/version.o
LD init/built-in.o
LD .tmp_vmlinux1
KSYM .tmp_kallsyms1.S
AS .tmp_kallsyms1.o
LD .tmp_vmlinux2
KSYM .tmp_kallsyms2.S
AS .tmp_kallsyms2.o
LD vmlinux
SYSMAP System.map
/media/jarvis/ee56d354-a109-483d-9c4e-0c689505ed44/code_blue/code_blue/scripts/mksysmap: line 44: ~/android/toolchains/arm-cortex_a15-linux-gnueabihf-linaro_4.9.3-2015.03/bin/arm-cortex_a15-linux-gnueabihf-nm: No such file or directory
Makefile: 930: commands for target 'vmlinux' failed
make: *** [vmlinux] Error 1

Any idea about this?

https://github.com/engstk/hammerhead-5.0
[Android] _that:
That code is buggy. The pointer size is not the buffer size. Pass PAGE_SIZE instead of sizeof(buf) to snprintf.

Your toolchain seems to be incompletely installed and is missing the "nm" tool (or it doesn't have the expected name).
[Android] mastero9017:
And the problem is, there is everything and that exact file so i'm confused. I tried also 3 older toolchains and i got same result.
[Android] _that:
Check if the file is a symlink and if it links to the correct binary. Try running it manually and see if it works (it should complain about missing a.out).
[Android] Anik_khan:
Nice:)
[Android] mastero9017:
I'm getting this error when trying to compile UBER-L with latest UBERTC

http://pastebin.com/2JiLbeZZ

http://pastebin.com/zqafggjR

and it won't compile﻿, any idea?
[Android] brymaster5000:
try adding the struct device inside the ( ) before the function

Here is your error:

include/scsi/scsi.h:565:49: warning: 'struct device' declared inside parameter list

struct scsi_disk *scsi_disk_get_from_dev(struct device *dev);

Here is something you might do (if you can paste that file - we can look at the way it's written and give better feedback):

struct device

{

blah blah blah

struct scsi_disk *scsi_disk_get_from_dev(struct device *dev);

Essentially you have to declare your struct before that function.
[Android] zarpanzur:
I'm trying to build a kernel from source and prebuilt toolchains. I have already downloaded the source from the manufacturer but I don't know which toolchain to use. I'm compiling for a Samsung Galaxy S 5 (G900W8) Any ideas?
[Android] mostafaz:
hi

im trying compile a cm12 unofficial kernel and got this

make
/home/dgod/yuga/android_kernel_sony_apq8064-cm-12.0/arch/x86/Makefile:81: stack protector enabled but no compiler support
make[1]: Nothing to be done for `all'.
make[1]: Nothing to be done for `relocs'.
CHK include/linux/version.h
CHK include/generated/utsrelease.h
CC kernel/bounds.s
arm-eabi-gcc: error: unrecognized command line option '-m64'
arm-eabi-gcc: error: unrecognized command line option '-mno-red-zone'
arm-eabi-gcc: error: unrecognized command line option '-mcmodel=kernel'
arm-eabi-gcc: error: unrecognized command line option '-maccumulate-outgoing-args'
make[1]: *** [kernel/bounds.s] Error 1
make: *** [prepare0] Error 2

and now after some other toolchain try out

make
CHK include/linux/version.h
CHK include/generated/utsrelease.h
make[1]: `include/generated/mach-types.h' is up to date.
CC kernel/bounds.s
/home/dgod/yuga/arm-eabi-4.9/bin/../libexec/gcc/arm-linux-gnueabi/4.9.x-sabermod/cc1: error while loading shared libraries: libisl.so.13: cannot open shared object file: No such file or directory
make[1]: *** [kernel/bounds.s] Error 1
make: *** [prepare0] Error 2

any idea ?

please
[Android] zarpanzur:
":warning: override: reassigning to symbol" I get that when generating .config file. Is that bad?
[Android] Wahaj.47:
What abput kernel porting ?
[Android] abhi_qwerty:
Newbie needs help !!!

How can I add sweep2wake in my kernel?

My past experience with kernels -

i. Compiled it from source for my device HTC Explorer.

ii. Added fastcharge support to it.

Stuck at adding sweep2wake, please help me.
[Android] mostafaz:
compile error

hi

these days im strugeling with cm12 kernel compile

learn alot and also when its done i'll share them

what is your opinion about this one

CC sound/soc/msm/apq8064.o
CC sound/soc/msm/msm8930.o
CC sound/soc/msm/mpq8064.o
CC sound/soc/msm/apq8064-i2s.o
make[3]: *** No rule to make target `sound/soc/msm/msm-dai-q6.o', needed by `sound/soc/msm/snd-soc-qdsp6.o'. Stop.
make[2]: *** [sound/soc/msm] Error 2
make[1]: *** [sound/soc] Error 2
make: *** [sound] Error 2

is this something that must enable in config ?:rolleyes:
[Android] Wahaj.47:
Some file is missing
[Android] mostafaz:
see these links-dev added sweep2wake

u can follow them (maybe work:just driver and enable ...)

this and this and this

i think just follow what dev changed and maybe its the sollution

---------- Post added at 01:35 PM ---------- Previous post was at 01:32 PM ----------

thanks - one file that needed by another file is missing-but no file deleted-i think something must be enabled in config or not !!!!!!!
[Android] Wahaj.47:
How to port a kernel ?
[Android] fizbanrapper:
You probably need to add a line in your Makefile at sound/soc/msm that references msm-dai-q6.o.
[Android] Cobra11Murderer:
hI all

first time to build a kernel, but gotten pretty far I think, anyways everything was going good till I did this, btw this is just stock samsung source kernel im trying to compile (SM-G386W), and im using googles ndk

baxter@baxter-Dell-DXP061:~/Android-Kernel/Kernel$ make msm8226-sec_defconfig
sound/soc/codecs/audience/Kconfig:40:warning: type of 'SND_SOC_ES_SLIM' redefined from 'boolean' to 'tristate'
sound/soc/codecs/audience/Kconfig:43:warning: type of 'SND_SOC_ES_I2C' redefined from 'boolean' to 'tristate'
sound/soc/codecs/audience/Kconfig:44:warning: choice value used outside its choice group
sound/soc/codecs/audience/Kconfig:41:warning: choice value used outside its choice group
arch/arm/configs/msm8226-sec_defconfig:322:warning: override: reassigning to symbol MSM_CPP
arch/arm/configs/msm8226-sec_defconfig:485:warning: override: reassigning to symbol SWITCH
arch/arm/configs/msm8226-sec_defconfig:486:warning: override: reassigning to symbol COMPACTION
warning: (SND_SOC_MSM8226) selects DOLBY_DAP which has unmet direct dependencies (SOUND && !M68K && !UML && SND && SND_SOC && SND_SOC_MSM8974)
KCONFIG_SELINUX((null))
KCONFIG_LOG_SELINUX((null))
KCONFIG_TIMA((null))
KCONFIG_VARIANT((null))
***
*** You must specify VARIANT_DEFCONFIG !
***
make[1]: *** [msm8226-sec_defconfig] Error 1
make: *** [msm8226-sec_defconfig] Error 2

any ideas as to why its doing that?
[Android] skulldreamz:
Check out option A and option B in the op of getting the correct xxxxxxxx_defconfig for your device. If you can't pull your devices config file or it doesn't have one as some devices don't then use option B which will be the default OEM defconfig I believe.
[Android] zarpanzur:
Proper source and cross compiler makes everything better. :good:
[Android] :
Guys what if i want to modify the Kernel myself ,, Which programming language should i learn ?!
[Android] fizbanrapper:
C

I haven't seen any others used for android.

You can learn it as you go too. I taught myself what little I know, while creating my own custom kernel. With virtually no skills, I was able to add the following features:

Voltage control (over and under)

Frequency control, also with over and under clocking.

GPU over clock

13 governors, between IO, CPU, & GPU

Sweep2wake

Double tap to wake

Force fast charge

Zram

MP decision

Permissive mode

That's not a complete list, and I don't intend to gloat. I just don't want you to feel like you can't start now.

Let me know if you want help. Good luck!
[Android] :
Thanks :D But what is the difference between Permissive Mode and Enforcing Mode ?

and can i use C++
[Android] hell_lock:
Cpp is not compatible with the Linux kernel that's why you can't use it.

And you don't really need to learn C for kernels unless you want to create something original.
[Android] pec0ra:
As said before, C is used for kernel programming and you can easily make some change without a big C knowledge as long as you use patches or other mod that are already written. I also started to edit kernels without any C knowledge. However, if you have some knowledge, it will help you a lot to debug and understand errors. It is for example very hard to make changes in the code if you don't understand pointers.

About c++, it's not the language used in the kernel. It means you can't use it but if you do know c++, it will help you a lot understand the C code (and errors) since these two languages have a lot in common.

Edit : for permissive and enforcing mode you should search for selinux.

Edit 2 : I'll maybe add the most important thing :

If you do kernel programming, you might need a little C, but what you will need the most is to make good searches. Google, duckduckgo and xda's search function are your friend and you will have to use them A LOT. You won't be able to be lazy and ask some trivial things like "what is selinux". You will have to search, and often it might be hard to find answer, but you will learn a lot if you do it by yourself.