yashsingh1/xdaforums huggingface dataset:
[Android Software/Hacking General [Developers Only]] janjan:
Thank you very much for your hard work [MENTION=6842057]nathanchance[/MENTION].

Is there a way to remove the kernel version.. make it shorter. (5 lines showing The link for the Clang bla bla). I just want kernel version, name and based on LLVM Clang 7... Want to remove Googlesource ....

I did modified through menuconfig but it seems it doesn't work. Thanks in advance
[Android Software/Hacking General [Developers Only]] nathanchance:
Add this: https://github.com/frap129/taimen/commit/0584095bec6288233351657f0dfcfcbfff9a1839

Then export the shell variable before building.
[Android Software/Hacking General [Developers Only]] zainifame:
little help please...?, when i run make clean or make mrproper even make distclean its showing error like this
[Android Software/Hacking General [Developers Only]] jr jimmy:
hello..anyone can tell me what is rkp_cfp_jopp in makefile..?when i delete that line (CC = ($srctree)/tools/prebuilt/././blabla )

and delete about rkp_cfp in defconfig i got this error

"In file included from arch/arm64/crypto/sha1-ce-glue.c:16:0: include/linux/cpufeature.h:47:33: error: 'cpu_feature_match_SHA1' defined but not used [-Werror=unused-const-variable=] static struct cpu_feature const cpu_feature_match_ ## x[] = \ ^ arch/arm64/crypto/sha1-ce-glue.c:113:1: note: in expansion of macro 'module_cpu_feature_match' module_cpu_feature_match(SHA1, sha1_ce_mod_init); ^~~~~~~~~~~~~~~~~~~~~~~~ cc1: all warnings being treated as errors make[1]: *** [arch/arm64/crypto/sha1-ce-glue.o] Error 1 make: *** [arch/arm64/crypto] Error 2"

when i leave it deafult..it succesfully compiled.but in terminal it show using prebuilt toolchain not toolchain that i use..

im trying to compile galaxy note fe exynos8890

thank you..
[Android Software/Hacking General [Developers Only]] jr jimmy:
Fixed..missing -Wno-error=unused-const-variable

thanks [MENTION=6760768]KuranKaname[/MENTION]
[Android Software/Hacking General [Developers Only]] ahmed gamal 1m:
Could anyone tell me where can I find the patches to make my 4.4.4 kernel works for Android 7.1.2 ?

I searched and didn't find anything helpful

Could anyone help me and give me the links
[Android Software/Hacking General [Developers Only]] WaseemAlkurdi:
First of all, thanks for the epic guide!

I know this is stupid, but do I clone (a) inside the directory where the kernel got cloned or (b) next to it?

In other words, which one of these is correct?

(A) kernels/samsung_msm8226-./gcc-4.9.... (toolchain inside kernel)

or

(B) kernels/samsung_msm8226_... (kernel)

kernels/gcc-4.9... (toolchain)

?
[Android Software/Hacking General [Developers Only]] :
Outside.
[Android Software/Hacking General [Developers Only]] Tristan1302:
Hi guys, I'm a noob in kernel compiling and i got this strange error, don't know what am I doing wrong...

thanks
[Android Software/Hacking General [Developers Only]] ThePiGuy:
I doubt I will be able to help you, but I thought I would let you know that (at least for me) I can't see the attached image
[Android Software/Hacking General [Developers Only]] nikstas056:
Hi, everybody. Who can compile a kernel from ready sources ?
[Android Software/Hacking General [Developers Only]] Uzephi:
If you follow OP you should be able to as well.
[Android Software/Hacking General [Developers Only]] Uzephi:
@nathanchance any plan of linking your guide to build a kernel w/ clang that you have on your github? That saved my butt since my Moto Z2 kernel needs to be built with clang for motomods to work on aosp. It was fairly straightforward.

Edit: okay, only when using Clang does this error appear. Everything up to this build fine. When it does the vmlinux part of the build I get the error below. I checked the directory, tried both 4.9 GCC, linaro and GCC 7.x. None of them let it finish building. I thought it was my tree, so I tried building from this source (https://github.com/android-linux-stable/nash/tree/lineage-15.1). Below is the build commands and the error message.

make -j$(nproc --all) O=out ARCH=arm64 SUBARCH=arm64 CC="~/linux-x86/clang-r328903/bin/clang" CLANG_TRIPLE=aarch64-linux-gnu- CROSS_COMPILE="~/kitchen/kernel/bin/aarch64-linux-android-"

........

LD drivers/staging/qcacld-3.0/wlan.o
LD drivers/staging/qcacld-3.0/built-in.o
LD drivers/staging/built-in.o
LD drivers/built-in.o
LINK vmlinux
LD vmlinux.o
../scripts/link-vmlinux.sh: line 44: ~/kitchen/kernel/bin/aarch64-linux-android-ld: No such file or directory
/home/uzephi/Nash_AOSP/Makefile:992: recipe for target 'vmlinux' failed
make[1]: *** [vmlinux] Error 127
make[1]: Leaving directory '/home/uzephi/Nash_AOSP/out'
Makefile:152: recipe for target 'sub-make' failed
make: *** [sub-make] Error 2

Usually file not found is either a permissions error or the file not there. It finds all of the other files in the same directories of the cross compilers I've tried so permissions doesn't seem to be the issue. I triple checked and the file is there.

I searched and couldn't find a similar error. My Google-fu must be rusty.
[Android Software/Hacking General [Developers Only]] attack11:
And if you export the toolchain like:

"CROSS_COMPILE="~/kitchen/kernel/bin/aarch64-linux-androidkernel-"

?
[Android Software/Hacking General [Developers Only]] Uzephi:
It gave the same error. File not found
[Android Software/Hacking General [Developers Only]] nathanchance:
Try using ${HOME} instead of ~
[Android Software/Hacking General [Developers Only]] Uzephi:
I feel so stupid for not trying that. Building with that edit fixed the error. I guess Clang doesn't like ~ to symbolize home dir. Thanks for the quick reply
[Android Software/Hacking General [Developers Only]] StonebridgeGr:
Hey, how I can add extra governors, change the CPU Hertz etc ??
[Android Software/Hacking General [Developers Only]] penglezos:
Hey thanks for your great tutorial!

Currently I'm stuck always here.

LD net/netfilter/built-in.o

LD net/built-in.o

The compile finishes here without any image file exported. What can I do?
[Android Software/Hacking General [Developers Only]] nathanchance:
The error is above that.
[Android Software/Hacking General [Developers Only]] ianmacd:
64 bit or 32 bit kernel?

Thank you for for this excellent resource, [MENTION=6842057]nathanchance[/MENTION]. Forgive me for this question, but I wasn't sure where else to ask.

I'm no stranger to compiling Linux kernels, though it's been many years since I've needed to, and I've never compiled one for Android before.

To gain some familiarity with the practice, I just cross-compiled 4.9.100 for my S9+, inserted it in a boot image, and flashed it with TWRP.

Bingo! The device is up and running and all appears to be well.

The only anomaly is that the popular Phone Info app reports that the kernel is 32 bit. See attachment.

I compiled with Google's 4.9 tool chain (aarch64-linux-android-4.9) with ARCH=arm64 and SUBARCH=arm64 both set. I used the standard exynos9810-star2lte_defconfig with no mods, so with CONFIG_ARM64=y and CONFIG_64BIT=y set.

I don't see how I could possibly have built a 32 bit kernel, but Phone Info is a reliable app, so I have this nagging feeling that something's not quite right.

Any ideas?
[Android Software/Hacking General [Developers Only]] nathanchance:
Type "uname -a" into a terminal emulator or adb shell. If it says "aarch64", the app is lying to you.
[Android Software/Hacking General [Developers Only]] ianmacd:
No, I'm afraid the app is telling the truth: armv8l

But can that even be true? A 32 bit kernel wouldn't even run properly on this architecture, would it?

Assuming for the moment that it is true, I'm baffled. As I said, I haven't compiled a kernel in donkeys' years, so I'm pretty rusty, but CONFIG_ARM64=y and CONFIG_64BIT=y are unambiguous.

I have the proper environment variables exported and I have only 64 bit tools on the system.

If I run strings(1) on the kernel that I built, it's full of arm64 references, so that seems to be sound. But where, then, does the armv8l come from?

Any pointers you can provide will be most gratefully received.
[Android Software/Hacking General [Developers Only]] nathanchance:
Unfortunately, I have no idea. It's entirely possible Samsung did this on purpose because it doesn't look like you did anything wrong. I assume you have the Exynos model, not the Snapdragon one. Here's the output of /proc/cpuinfo on my Pixel 2 XL, maybe that will help clear things up?

taimen:/ # cat /proc/cpuinfo
Processor : AArch64 Processor rev 1 (aarch64)
processor : 0
model name : ARMv8 Processor rev 4 (v8l)
BogoMIPS : 38.40
Features : half thumb fastmult vfp edsp neon vfpv3 tls vfpv4 idiva idivt lpae evtstrm aes pmull sha1 sha2 crc32
CPU implementer : 0x51
CPU architecture: 8
CPU variant : 0xa
CPU part : 0x801
CPU revision : 4

processor : 1
model name : ARMv8 Processor rev 4 (v8l)
BogoMIPS : 38.40
Features : half thumb fastmult vfp edsp neon vfpv3 tls vfpv4 idiva idivt lpae evtstrm aes pmull sha1 sha2 crc32
CPU implementer : 0x51
CPU architecture: 8
CPU variant : 0xa
CPU part : 0x801
CPU revision : 4

processor : 2
model name : ARMv8 Processor rev 4 (v8l)
BogoMIPS : 38.40
Features : half thumb fastmult vfp edsp neon vfpv3 tls vfpv4 idiva idivt lpae evtstrm aes pmull sha1 sha2 crc32
CPU implementer : 0x51
CPU architecture: 8
CPU variant : 0xa
CPU part : 0x801
CPU revision : 4

processor : 3
model name : ARMv8 Processor rev 4 (v8l)
BogoMIPS : 38.40
Features : half thumb fastmult vfp edsp neon vfpv3 tls vfpv4 idiva idivt lpae evtstrm aes pmull sha1 sha2 crc32
CPU implementer : 0x51
CPU architecture: 8
CPU variant : 0xa
CPU part : 0x801
CPU revision : 4

processor : 4
model name : ARMv8 Processor rev 1 (v8l)
BogoMIPS : 38.40
Features : half thumb fastmult vfp edsp neon vfpv3 tls vfpv4 idiva idivt lpae evtstrm aes pmull sha1 sha2 crc32
CPU implementer : 0x51
CPU architecture: 8
CPU variant : 0xa
CPU part : 0x800
CPU revision : 1

processor : 5
model name : ARMv8 Processor rev 1 (v8l)
BogoMIPS : 38.40
Features : half thumb fastmult vfp edsp neon vfpv3 tls vfpv4 idiva idivt lpae evtstrm aes pmull sha1 sha2 crc32
CPU implementer : 0x51
CPU architecture: 8
CPU variant : 0xa
CPU part : 0x800
CPU revision : 1

processor : 6
model name : ARMv8 Processor rev 1 (v8l)
BogoMIPS : 38.40
Features : half thumb fastmult vfp edsp neon vfpv3 tls vfpv4 idiva idivt lpae evtstrm aes pmull sha1 sha2 crc32
CPU implementer : 0x51
CPU architecture: 8
CPU variant : 0xa
CPU part : 0x800
CPU revision : 1

processor : 7
model name : ARMv8 Processor rev 1 (v8l)
BogoMIPS : 38.40
Features : half thumb fastmult vfp edsp neon vfpv3 tls vfpv4 idiva idivt lpae evtstrm aes pmull sha1 sha2 crc32
CPU implementer : 0x51
CPU architecture: 8
CPU variant : 0xa
CPU part : 0x800
CPU revision : 1

Hardware : Qualcomm Technologies, Inc MSM8998
[Android Software/Hacking General [Developers Only]] ianmacd:
Mine looks very similar:

processor : 0
model name : ARMv8 Processor rev 1 (v8l)
BogoMIPS : 52.00
Features : half thumb fastmult vfp edsp neon vfpv3 tls vfpv4 idiva idivt lpae evtstrm aes pmull sha1 sha2 crc32
CPU implementer : 0x41
CPU architecture: 8
CPU variant : 0x0
CPU part : 0xd05
CPU revision : 1

processor : 1
model name : ARMv8 Processor rev 1 (v8l)
BogoMIPS : 52.00
Features : half thumb fastmult vfp edsp neon vfpv3 tls vfpv4 idiva idivt lpae evtstrm aes pmull sha1 sha2 crc32
CPU implementer : 0x41
CPU architecture: 8
CPU variant : 0x0
CPU part : 0xd05
CPU revision : 1

processor : 2
model name : ARMv8 Processor rev 1 (v8l)
BogoMIPS : 52.00
Features : half thumb fastmult vfp edsp neon vfpv3 tls vfpv4 idiva idivt lpae evtstrm aes pmull sha1 sha2 crc32
CPU implementer : 0x41
CPU architecture: 8
CPU variant : 0x0
CPU part : 0xd05
CPU revision : 1

processor : 3
model name : ARMv8 Processor rev 1 (v8l)
BogoMIPS : 52.00
Features : half thumb fastmult vfp edsp neon vfpv3 tls vfpv4 idiva idivt lpae evtstrm aes pmull sha1 sha2 crc32
CPU implementer : 0x41
CPU architecture: 8
CPU variant : 0x0
CPU part : 0xd05
CPU revision : 1

processor : 4
model name : ARMv8 Processor rev 0 (v8l)
BogoMIPS : 52.00
Features : half thumb fastmult vfp edsp neon vfpv3 tls vfpv4 idiva idivt lpae evtstrm aes pmull sha1 sha2 crc32
CPU implementer : 0x53
CPU architecture: 8
CPU variant : 0x1
CPU part : 0x002
CPU revision : 0

processor : 5
model name : ARMv8 Processor rev 0 (v8l)
BogoMIPS : 52.00
Features : half thumb fastmult vfp edsp neon vfpv3 tls vfpv4 idiva idivt lpae evtstrm aes pmull sha1 sha2 crc32
CPU implementer : 0x53
CPU architecture: 8
CPU variant : 0x1
CPU part : 0x002
CPU revision : 0

processor : 6
model name : ARMv8 Processor rev 0 (v8l)
BogoMIPS : 52.00
Features : half thumb fastmult vfp edsp neon vfpv3 tls vfpv4 idiva idivt lpae evtstrm aes pmull sha1 sha2 crc32
CPU implementer : 0x53
CPU architecture: 8
CPU variant : 0x1
CPU part : 0x002
CPU revision : 0

processor : 7
model name : ARMv8 Processor rev 0 (v8l)
BogoMIPS : 52.00
Features : half thumb fastmult vfp edsp neon vfpv3 tls vfpv4 idiva idivt lpae evtstrm aes pmull sha1 sha2 crc32
CPU implementer : 0x53
CPU architecture: 8
CPU variant : 0x1
CPU part : 0x002
CPU revision : 0

It's just missing the header that yours has, where it specifically refers to the aarch64 architecture.

In an effort to gain some insight, I restored the kernel that I was running prior to my own bake today. It's also a custom kernel, but built by someone else for the Renovate ROM. That one, too, is identified as a 32 bit kernel by Phone Info and DevCheck. Hmm. So it's not just me!

That might lead you to think that all kernels on this device are identified this way, but as the screenshot in this otherwise irrelevant article shows, stock Samsung kernels are properly identified as 64 bit.

The mystery remains.
[Android Software/Hacking General [Developers Only]] kevintm78:
I was under the impression that armv8I is a 64 bit kernel. Is it not?
[Android Software/Hacking General [Developers Only]] ianmacd:
No, you're right; it is. Maybe it's not even that detail that is being picked up on by these diagnostic apps to misidentify the kernel as 32 bit, but whatever it is, the stock Samsung kernels don't have the issue.
[Android Software/Hacking General [Developers Only]] jonny789:
Following this guide , I have successfully compiled stock kernel from samsung sources for my galaxy S5 G900H on kali linux.

I am trying to compile some modules. For that I have starred these ::

[*] Enable loadable module support
[*] Forced module loading
[*] Module unloading
[*] Forced module unloading

I have rooted my phone and set selinux permissive mode. But trying to load these modules gives Exec format errors .

/system/bin/insmod asix.ko
insmod: failed to load asix.ko: Exec format error

In dmesg, it is showing ::

[ 5378.629376] [c3] TIMA: lkmauth--launch the tl to check kernel module; module len is 279631
[ 5378.630154] [c3] TIMA: lkmauth--cannot open mobicore session from kernel. 15
[ 5378.630296] [c3] TIMA: lkmauth--unable to load kernel module; module len is 279631.
[Android Software/Hacking General [Developers Only]] psychem:
can this tutorial help move the oneplus kernel from 3.4.x to 4.9.x ?
[Android Software/Hacking General [Developers Only]] Uzephi:
No
[Android Software/Hacking General [Developers Only]] ianmacd:
I just wanted to return to this and tie up the loose end.

The kernel I built is a proper 64 bit kernel, and if I flash the unadulterated boot image containing it to my device, apps like DevCheck and Phone Info correctly identify it as 64 bit.

The reason it was getting reported to me as 32 bit is because after flashing it, I was patching it with the Magisk installer to root it. For some reason, that patching subsequently fools diagnostic apps into believing the kernel is 32 bit.
[Android Software/Hacking General [Developers Only]] nathanchance:
It's probably because Magisk binaries are 32-bit.
[Android Software/Hacking General [Developers Only]] psychem:
Can you hook me up with the relevant tutorials for my purpose?
[Android Software/Hacking General [Developers Only]] Uzephi:
As stated before in this thread and nathanchance's upstream thread: unless you understand what is being changed, you won't be able to. It isn't as simple as cherry picking, or merging already made code. You'll have to rewrite a few of the c and h files in the source to avoid breaking your build and to even have a chance at booting.
[Android Software/Hacking General [Developers Only]] milouk:
Morever the gap you are trying to cover is HUGE it would take many hours to fix the conflicts. i would recommend merging the immediately next version to minimize the conflicts.
[Android Software/Hacking General [Developers Only]] psychem:
https://www.reddit.com/r/LineageOS/...now_have_retpoline_kernels/dvxuou5/?context=0

3.10.x is EOL... so 3.18.x is the next best option as per the article !
[Android Software/Hacking General [Developers Only]] milouk:
You still need ti go through 3.10 though
[Android Software/Hacking General [Developers Only]] psychem:
so it goes like merge 3.4.113 with 3.10.0 then with 3.10.108 directly or with every patch between 0-108 individually? then move to 3.18.0 till 3.18.109 current release.
[Android Software/Hacking General [Developers Only]] milouk:
You can do both. But i recommend the second one as the first one can result into hundreads maybe thousands conflicts. One step at time each individual patch and work your way up
[Android Software/Hacking General [Developers Only]] psychem:
okay any good tutorial for going the second way?
[Android Software/Hacking General [Developers Only]] milouk:
You dont need any tutorials its as simple as

1) you remote add the linux repo to your source code repo

2)you fetch it

3) you merge branches

4) solve conflicts if any

5) repeat from step 3

I think there are some relevant youtube videos as well as nathans guide for upstreaming. But you should bear in mind that to upstrean you need serious coding skills.
[Android Software/Hacking General [Developers Only]] psychem:
easy for you sir! i will need a walkthrough for the steps.
[Android Software/Hacking General [Developers Only]] Uzephi:
If you need a walk through for that, please don't attempt this.
[Android Software/Hacking General [Developers Only]] psychem:
that is always the default option. it would be great if 3.4.x got the critical security patches backported specially the meltdown/spectre patch.
[Android Software/Hacking General [Developers Only]] Uzephi:
There we go. Don't fully update to 4.4.y or 4.9.y. What you should do is just cherry-pick those specific commits by researching commit history (the Linux kernel release team is amazing on how strict they are on keeping records of what x commit does and fixes). Just find the "Kaiser," meltworn/spectre and KPTI commits and pull them to your kernel source. Don't try and take a task as heavy ad getting a whole chipset to go from one revision of the Linux kernel to another. I don't know if anyone with your chipset is running anything but 3.4.y. Some kernel revisions won't work with how the device runs at a chip level where if you don't know anything about how CPUs/GPUs/ etc work, don't try it. Please, you'll have one headache and task ahead of you.

Edit: unless you k ow what is being said in the source code, do NOT try and take the task of converting from one major revision to another. You're not only asking to go from 3.4.y to 3.11.y you're asking to go from 3.x.y to 4.x.y. I do not honestly know if kernel source for your phone would handle 4
[Android Software/Hacking General [Developers Only]] psychem:
many patches for meltdown/spectre show up in search https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/log/?qt=grep&q=meltdown i think only which have "arm" in collapsed view of commit message need to be pulled? which ones are relevant?

device is onyx. [MENTION=4797402]Nachiket.Namjoshi[/MENTION] made a 3.5.0 kernel which worked well. latest is 3.4.113 by [MENTION=7093179]YumeMichi[/MENTION] which is working in oreo los 15.1 rom
[Android Software/Hacking General [Developers Only]] Uzephi:
That's where knowing how to code like we suggested comes in handy. I don't have the hours to go through each patch for something that already works for the devices I run. I no longer have a device on a 3.x.y kernel as I knew it was getting to EOL here shortly.
[Android Software/Hacking General [Developers Only]] psychem:
buying a new device is always an option.
[Android Software/Hacking General [Developers Only]] Uzephi:
You don't have to. I have friends who have devices not patched for meltdown/spectre. Have they run into an issue? Not yet, but their infection won't affect my device. Same can be said about your phone compared to other tiny or full sized PCs it will be around (tablets, your other devices that do have the patches, etc) it's no longer a zero day. We know of a fix. We know it's affects. Just be a little more security and privacy conscious. I still am and I am running the latest patches I can have on my kernel.
[Android Software/Hacking General [Developers Only]] bootslag:
does anyone know whats error: use of undeclared identifier 'RMNET_EGRESS_FORMAT_MAP_CKSUMV3'
[Android Software/Hacking General [Developers Only]] DenZxd:
Hi!

I will be glad to receive any help in compiling the kernel from source. (not newbies ;) ) I have some critical warnings during compile. After flashing new uImage, device not start. All info and logs in that post:

https://xdaforums.com/showpost.php?p=73511338&postcount=1860
[Android Software/Hacking General [Developers Only]] mmsdc_mi:
hi,

I have been trying to compile aosp rom for note 4 snapdragon variant. I have downloaded files from the repo and the required blobs. I started with lunch command after 25% of the compilation process is over and it shows an error.Can anyone please help me?

The screenshots are added below.
[Android Software/Hacking General [Developers Only]] Uzephi:
This is a "how to build kernel" thread. Not ROM. Please find the appropriate thread.
[Android Software/Hacking General [Developers Only]] pokevitek:
Hello, where exactly is specified which drivers and device tree files get included into the kernel? I am looking at the Oneplus 6 kernel source and it contains a lot of drivers and device tree configurations for any existing device but I cannot figure out where it is specified which ones are exactly needed to be compiled and included into the kernel image. I have been looking thru makefiles and even extracted configuration from stock kernel on the device but cannot find anything regarding this.
[Android Software/Hacking General [Developers Only]] ThePiGuy:
The kernel source and the device trees are separate repos. I don't think OnePlus has releases the device trees yet.
[Android Software/Hacking General [Developers Only]] pokevitek:
I probably don´t understant it correctly. I know for every device there are usually 4 main components - kernel, device (tree), vendor (blobs) and aosp based ROM. What I don´t know is the relationship between Linux kernel device tree descriptors (DTS -> DTB) that gets baked into boot.img and the content of the device tree (as in android_device_ repos).

So far I thought that DTS are part of the kernel (for example "arch/arm64/configs" folder) and gets picked up during kernel compilation, converted into binary blob DTB and baked into ROM. I also thought that content of the android_device_ are some device specifig binaries that are not exactly part of kernel. Yet I wondered why are these 2 separate when usually there is a kernel released and modified for each device so it could be part of it.
[Android Software/Hacking General [Developers Only]] ThePiGuy:
Tbh I'm not that great at understanding how the kernel source works (I used this very helpful guide not that long ago to help me build a standalone kernel)

However I've been building roms for a while now.

The kernel repo is only used for the kernel - hence why with the correct toolchain you can build a standalone kernel image that can then be integrated into the boot.img. Also, the kernel contains all the drivers for the device.

The device trees are the configurations for the device (e.g. audio mixer paths etc) and are generally mostly independent of the kernel (e.g. I have used official LOS device trees for my LG G4 and Titan Kernel sources and it worked perfectly).

Unfortunately that's the extent of my knowledge atm :D