yashsingh1/xdaforums huggingface dataset:
[Android Software/Hacking General [Developers Only]] Noah Allen:
Could You Please Guide Me? I used proton clang to compile the kernel.But I got the same error. I didn't add anything yet. As I don't know how to do. I'm sorry to ask for help but please help me.
[Android Software/Hacking General [Developers Only]] bksvc:
i have downloaded this package and i created Image file

after created image i repacked my boot.img

am i doing something wrong ?
[Android Software/Hacking General [Developers Only]] nalas:
If you use the same rom EULF so is good. If another so wrong. If good so you have to copy manually all firmware files from samsung firmware folder.
[Android Software/Hacking General [Developers Only]] Noah Allen:
@nalas I'm sorry to tag you but no one replies my message except you. Couldn't you please help me to solve this problem?
[Android Software/Hacking General [Developers Only]] nalas:
Hi, ofc.

You have to add some commit like for e.g. from my github : Makefile history .

LIke this via : git cherry-pick

..as You see there is LTO commits so You have to make research for on my github or another - best the same device You have.... and add this commit s for clang higher then 8.0 and up.
[Android Software/Hacking General [Developers Only]] Noah Allen:
Hello Thank You For This. I have successfully fixed that problem. But now, I'm getting a new one. Could You Please Check It?

Hastebin

Hastebin is a free web-based pastebin service for storing and sharing text and code snippets with anyone. Get started now.

hastebin.com
[Android Software/Hacking General [Developers Only]] nalas:
Try to look in makefile history for commits which make silence errors and warnnings in clang... I have this commits too.

Or you missed US declaration... so you can look on github in similars kernels for declare this US...

It can be not in mtp file but in include/linux/... so you have to do some research....
[Android Software/Hacking General [Developers Only]] erpilsG:
Hello... is somebody here in XDA compiling for samsung galaxy note10 lite (sm-n770f) soc=exynos9810? thanks
[Android Software/Hacking General [Developers Only]] BigChungus321:
Greetings, I'm trying to compile kernel for Redmi Note 10 Pro (sweet) and I'm wondering if anyone could help resolve some issues.

Firstly, here is the kernel source I used:

GitHub - MiCode/Xiaomi_Kernel_OpenSource at sweet-r-oss

Xiaomi Mobile Phone Kernel OpenSource. Contribute to MiCode/Xiaomi_Kernel_OpenSource development by creating an account on GitHub.

github.com

And I have used git clone -b sweet-r-oss <SOURCE> sweet as instructed.

And, as recommended by some kernel maintainers for my device, I used to Proton Clang as a toolchain and cloned it as git clone https://github.com/kdrag0n/proton-clang.git

I began to start the process of compiling by following the instructions presented like export ARCH=arm64 && export SUBARCH=arm64 && export DTC_EXT=dtc

and added the toolchain path to the kernel using export PATH="~/protonclang/proton-clang/bin:$PATH" as instructed in the Proton Clang github

Finally, I begin the compilation by making the out folder mkdir out and started make O=out sweet_user_defconfig

Everything was ok, and I was also able to run make menuconfig and started tweaking, primarily finding a way to enable kprobes

Then, when I start compiling by running make -j$(nproc -all) O=out, the error I got was:

make[1]: Entering directory '/home/caspey/attempt6/sweet/kernel/out'
arch/arm64/Makefile:57: Detected assembler with broken .inst; disassembly will be unreliable
../scripts/gcc-version.sh: line 26: python: command not found
../scripts/gcc-version.sh: line 27: python: command not found
make[1]: python: No such file or directory
make[1]: python: No such file or directory
CHK include/config/kernel.release
make[1]: python: No such file or directory
Cannot use CONFIG_CC_STACKPROTECTOR_STRONG: -fstack-protector-strong not supported by compiler
make[1]: python: No such file or directory
make[1]: *** [/home/caspey/attempt6/sweet/kernel/Makefile:1305: prepare-compiler-check] Error 1
make[1]: Leaving directory '/home/caspey/attempt6/sweet/kernel/out'
make: *** [Makefile:146: sub-make] Error 2

Could anyone help in figuring out what I missed in the process? Sorry for the bother.

PS: Linux Environment is Ubuntu 22.04.2 LTS grabbed from Microsoft Store, running as VM
[Android Software/Hacking General [Developers Only]] bksvc:
I couldn't install the camera driver on the newly compiled kernel. Where can I find the camera driver in my samsung device?
[Android Software/Hacking General [Developers Only]] Compileit:
what should i do

arch/arm64/Makefile:27: ld does not support --fix-cortex-a53-843419; kernel may be susceptible to erratum arch/arm64/Makefile:67: *** CROSS_COMPILE_ARM32 not defined or empty, the compat vDSO will not be built. Stop. make[1]: *** [Makefile:152: sub-make] Error 2 make: *** [Makefile:24: __sub-make] Error 2
[Android Software/Hacking General [Developers Only]] seledreams:
Hi,

I am a C++ developer (mostly into game dev usually) who was interested in building and updating the android kernel of my device. An alldocube iPlay 40, running at the moment Android 10.

I found the kernel source of its SoC here http://gitlab.rosoperator.com/SPRD-stuff/kernel-4.14 and was able to get the kernel built, it uses the exact same version and codename as my device's files indicate (version 4.14.133 and sharkl5Pro kernel config)

however, it seems like simply replacing the kernel file from the boot.img leads to a freeze on boot, what would be the steps to take in order to diagnose the issue ? As adb won't be able to enable logging at this step of the boot process

I did do a comparison of the stock kernel versus my built one at some point

the stock one is at the left and the built one at the right

I did notice that several DTB files got built as well as a .ko file, but i don't really know what to do with those

for instance, when extracting the boot.img, there is a single DTB that seems to get extracted, but when building the kernel there are tons of dtb files, i don't know what to do with those, there also are some DTBO files generated

Edit : it does seem like it was DTB related, after replacing the dtb from the boot.img as well, it does seem to not freeze and boots into android, although with no display

I was able to confirm it booted into android as adb devices does return my device
[Android Software/Hacking General [Developers Only]] rishav518:
i think you need to find JTAG pins on your device mainboard and then solder or somehow attach 4 wires on that 4 pins and then buy and attach JTAG to usb converter to those wire, it will give you early bootloader and kernel log and even shell to interact with
[Android Software/Hacking General [Developers Only]] seledreams:
i did consider it but this tablet is a pain to open

thankfully though it seems like the issue was that the built kernel doesn't work well with the prebuilt DTB, so i have to use the SoC source's DTB

it does work but some driver like the LCD panel don't work because they aren't in the device tree, i can at least get the dmesg logs since USB does work and i can access adb as android boots fine
[Android Software/Hacking General [Developers Only]] seledreams:
interestingly, i did add the driver of the display to the linux source and it properly built it, however it seems like the driver is not even getting loaded as when i check the dmesg, the log of the display driver's startup isn't even printed
[Android Software/Hacking General [Developers Only]] lolvatveo:
merge these to dtb.img and add in boot.img?
[Android Software/Hacking General [Developers Only]] lolvatveo:
please help, I overclocked sd410 and reached the limit of long integer value, please how to compile kernel with value greater than 2.14billion? yes and my overclock limit is also 2.14GHz
[Android Software/Hacking General [Developers Only]] lemongrass1717:
Is this guide still valid? I tried to clone google toolchain from the link but there is empty folder.
[Android Software/Hacking General [Developers Only]] Rocky7842:
Hi, thank you for the guide, really useful.

I'm compiling the kernel of Asus ROG Phone 1 using the official source, but it comes up with these errors. Can anyone give some advice on this? I've uploaded the source downloaded from Asus to a github repo, in case someone wants to take a look.

ERROR (phandle_references): Reference to non-existent node or label "key_vol_up_default"

ERROR (phandle_references): Reference to non-existent node or label "key_cam_snapshot_default"

ERROR (phandle_references): Reference to non-existent node or label "key_cam_focus_default"

ERROR (phandle_references): Reference to non-existent node or label "pm8998_gpios"

ERROR (phandle_references): Reference to non-existent node or label "pm8998_gpios"

ERROR (phandle_references): Reference to non-existent node or label "pm8998_gpios"

ERROR: Input tree has errors, aborting (use -f to force output)
scripts/Makefile.lib:319: recipe for target 'arch/arm64/boot/dts/qcom/sdm845-interposer-sdm670-mtp.dtb' failed
[Android Software/Hacking General [Developers Only]] oatMeal22:
This helped me build an SM-T290 kernel, thanks!

WiFi isn't working yet, but I'm sure I'll get that worked out.
[Android Software/Hacking General [Developers Only]] oatMeal22:
Google has moved Android to Clang, and deleted the GCC files for some reason. I had to get the GCC files from here
[Android Software/Hacking General [Developers Only]] ezzony:
I am trying to mod a driver for the lg V50, the dac driver. The driver is named audio_es9218.ko size 148kb in the stock kernel directory /vendor/lib/modules. My compiled kernel driver is built as es9218_dlkm.ko size 512kb. This is obviously all wrong and have no clue what's happening. Any idea what's going on here?
[Android Software/Hacking General [Developers Only]] ezzony:
I noticed the imag-gz-dtb output is 10MB larger than the stock image so this is part of the problem.

I get all these warning at the end of the build concerning 'size'. Something about DTC too which is a binary that was required to build as per LG instructions....

v50 kernel build size error - Pastebin.com

Pastebin.com is the number one paste tool since 2002. Pastebin is a website where you can store text online for a set period of time.

pastebin.com
[Android Software/Hacking General [Developers Only]] lolvatveo:
[INFO] ANDROID DEVICE PARTITIONS and FILESYSTEMS

NOTE: I'm not a developer or something even near to that. I'm a newbie and will be, seems so. All information provided here is copied and compiled from different internet sources like this and many others. This information is according to best of...

xdaforums.com
[Android Software/Hacking General [Developers Only]] lolvatveo:
add cflag for driver to make it compile smaller driver .ko file
[Android Software/Hacking General [Developers Only]] naterz:
Going through tough times getting my redbull kernel to compile after adding in Wireguard. It's in the stock kernel source but not enabled by default. Once enabled via make menuconfig, build_redbull-gki.sh complains about the kernel source not being clean. Basic compilation without changes works perfectly for me. These vanilla steps worked for me.

1. repo init -u https://android.googlesource.com/kernel/manifest -b android-msm-redbull-4.19-android13-qpr3

2. repo sync

3. ./build_redbull-gki.sh (succeeds)

4. fastboot boot boot.img (succeeds) - I am hoping to build the boot.img in the end rather than manually dealing with mkbootimg/AK3 device specific offsets/cmds and whatnot)

There's something I'm missing and I've spent hours upon hours trying to figure it out. Anyone have success using the supplied build*.sh scripts while making changes to the kernel? Have they intentionally been coded that way to prevent build issues?
[Android Software/Hacking General [Developers Only]] lolvatveo:
is it the problem eg failed to execute: no such file or directory. I have dtbtool in stock source code but can't use it to merge dtb to dt.img, I have to download qualcomm dtb merging tool from outside. crazy I can't use what's already there. I also hate some developers who are knowledgeable but they won't answer and care about NOOBs, they are ONLY INTERESTED IN THEIR PROJECTS AND WORK WITH THE DEVELOPMENTS WITH THEM so I'm sure I didn't take the time for answers but I'm very sure many people will know the answer. I had a hard time creating my own kernel, I had to mostly educate myself about the c source code and how to compile the kernel and fix bugs, along with a few good developers who supported me but couldn't help me much as they were less experienced with most of the problems I had, so sad but very respect them. Finally I successfully overclocked my J5(6) 1.19GHz phone up to 2.13GHz, no heat issues and the phone exploded. It's all bull**** warning, I even lowered the voltage to 1.15volt from stock 1.35volt. Yes I overclocked Snapdragon 410, because of Qualcomm they intentionally put extremely high voltage on it to make it hot and low end cpu, like intel. Let's look at a snapdragon cpu of the same manufactured on 28nm, which will come in 1.19ghz or 2.8ghz variant. What is that? they intentionally set the parameters to make processors seem "hot or weak" or high end all setting is BESTEST. now I was able to turn low end phones into high end, that's what custom kernel gives. I wish to have a community of people willing to cooperate to help, get rid of the selfish and arrogant people!
[Android Software/Hacking General [Developers Only]] Hargriv:
Hi all I'm trying to build the kernel for my Samsung Note 20Ultra SM-N986B OneUI5.1 Android 13 N986BXXU6HWCC kernel base downloaded from official Samsung sources The error occurs when I add a driver for kernelSU to the kernel source code taken from https://github.com/tiann/KernelSU/releases

console output

AR drivers/built-in.a

GEN .version

CHK include/generated/compile.h

AR built-in.a

MODPOST vmlinux.o

WARNING: vmlinux: 'fpsensor_goto_suspend' exported twice. Previous export was in vmlinux

WARNING: vmlinux: 'fpsensor_goto_suspend' exported twice. Previous export was in vmlinux

WARNING: modpost: Found 2 section mismatch(es).

To see full details build your kernel with:

'make CONFIG_DEBUG_SECTION_MISMATCH=y'

fs/open.o: In function `do_faccessat':

/home/hargriv/Note-20/kernel-986b/fs/open.c:374: undefined reference to `ksu_handle_faccessat'

fs/read_write.o: In function `vfs_read':

/home/hargriv/Note-20/kernel-986b/fs/read_write.c:453: undefined reference to `ksu_handle_vfs_read'

fs/stat.o: In function `vfs_statx':

/home/hargriv/Note-20/kernel-986b/fs/stat.c:176: undefined reference to `ksu_handle_stat'

fs/exec.o: In function `__do_execve_file':

/home/hargriv/Note-20/kernel-986b/fs/exec.c:1894: undefined reference to `ksu_handle_execveat'

make: *** [Makefile:1128: vmlinux] Error 1

Please help me understand and fix this problem
[Android Software/Hacking General [Developers Only]] alecxs:
I assume you have googled this before, please go through it.

https://github.com/tiann/KernelSU/issues/669
[Android Software/Hacking General [Developers Only]] ABC00012345:
Thanks. Still 2023
[Android Software/Hacking General [Developers Only]] wantowan2:
Hi, I;ve been trying to compile a kernel from samsung source. Its preconfiguered for SM-T500 Tab A 2020. I get the error:

The code in walt.h is:

I can see that the %llu is the problem but im stuck.

Any ideas?
[Android Software/Hacking General [Developers Only]] Daniel_47:
Hey There, So I did manage to compile an Android kernel but there's an issue I believe. It only generated Image and Image.gz. Will that be enough for my device? My device is Nothing Phone 1 and the kernel version is v5.4.210

Additionally I compiled with Clang v11.0.2 with the default make parameters
[Android Software/Hacking General [Developers Only]] winxuser:
ummmm what, please help :(

s9 kernel source and android 10 release toolchain, no matter what toolchain i use it says it cannot find the file, even though as you can see its pointed into the right folder, unless i am doing something wrong
[Android Software/Hacking General [Developers Only]] lolvatveo:
prefer to stock build_kernel.sh. don't change that much, just follow samsung and you will don't have much error. install enough build kernel tool and library, but I don't know to write some right now. if your os miss necesary library file it can't read some kind of file. I know someone know it but don't help you, so I help you as much I can. The world need kind and good people, don't selfish and only know themself, if you do good to pelple you can receive good, god is following you. you can become poor no luck come to you and people hate, stupid or smart rich many luck because of your action good or bad. today you have too much pain because in past life you don't do good thing enough, you do bad too much. In current life just do good, you belive in god so must become good people, maybe in your next life you born in a wealth family, you have tall DNA or come to heaven etc... 😂😂😂
[Android Software/Hacking General [Developers Only]] Shoaib712:
Bro finish whole syllabus in one Night like Engineering exam haha....
[Android Software/Hacking General [Developers Only]] Riyad_:
when i unpack my boot image using Android Image Kitchen. there is no zimage file. I don't know why. I m using xiaomi k20 pro[Raphael]. any help ?
[Android Software/Hacking General [Developers Only]] Asakura hatsuyuki:
I have a question. My device’s latest official kernel version is 3.18. Can I use the existing kernel source to build a newer kernel?
[Android Software/Hacking General [Developers Only]] lolvatveo:
you can build kernel from source for your device
[Android Software/Hacking General [Developers Only]] Asakura hatsuyuki:
How can I compile a 5.x kernel using the 3.18 source? My device doesn’t have newer source.
[Android Software/Hacking General [Developers Only]] lolvatveo:
sorry I haven't tried, I'm also newbie. I will try first and may tell you if success
[Android Software/Hacking General [Developers Only]] Sebichao:
Edit :

https://xdaforums.com/t/reference-how-to-compile-an-android-kernel.3627297/post-89492573 for the solution

Hi everyone!!! I've successfully compiled kernels before, but I've changed computer, with a fresh installation of Linux, and no matter how much I rack my brain, I can't understand why my make command isn't picking up the files from my toolchain....

~/kernelHIDSupport$ make O=output mrproper
make[1]: Entering directory '~/kernelHIDSupport/output'
make[1]: ~/gcc_google/bin/aarch64-linux-android-gcc: No such file or directory
make[1]: ~/gcc_google/bin/aarch64-linux-android-gcc: No such file or directory
I removed the end.

~/kernelHIDSupport$ cd ~/gcc_google/bin/
~/gcc_google/bin$ ls
921d9846-a815-11e9-84ea-ff8bce1b90b6 aarch64-linux-androidkernel-elfedit
aarch64-linux-android-addr2line aarch64-linux-androidkernel-gcc
aarch64-linux-android-ar aarch64-linux-androidkernel-ld
aarch64-linux-android-as aarch64-linux-androidkernel-nm
aarch64-linux-android-c++ aarch64-linux-androidkernel-objcopy
aarch64-linux-android-c++filt aarch64-linux-androidkernel-objdump
aarch64-linux-android-cpp aarch64-linux-androidkernel-readelf
aarch64-linux-android-dwp aarch64-linux-androidkernel-size
aarch64-linux-android-elfedit aarch64-linux-androidkernel-strip
aarch64-linux-android-g++ aarch64-linux-android-ld
aarch64-linux-android-gcc aarch64-linux-android-ld.bfd
aarch64-linux-android-gcc-4.9 aarch64-linux-android-ld.gold
aarch64-linux-android-gcc-4.9.x aarch64-linux-android-nm
aarch64-linux-android-gcc-ar aarch64-linux-android-objcopy
aarch64-linux-android-gcc-nm aarch64-linux-android-objdump
aarch64-linux-android-gcc-ranlib aarch64-linux-android-ranlib
aarch64-linux-android-gcov aarch64-linux-android-readelf
aarch64-linux-android-gcov-tool aarch64-linux-android-size
aarch64-linux-android-gprof aarch64-linux-android-strings
aarch64-linux-androidkernel-ar aarch64-linux-android-strip
aarch64-linux-androidkernel-as db96eedc-a815-11e9-a708-d79346614c9b
aarch64-linux-androidkernel-cpp

~/gcc_google/bin$ ls aarch64-linux-android-gcc -l
-rwxr-xr-x 1 XXXX XXXX 2203 May 4 17:14 aarch64-linux-android-gcc

Because, based on my knowledge of Linux, if I can see the files, shouldn't the command I'm running also be able to see them?

Thanks !
[Android Software/Hacking General [Developers Only]] DiamondJohn:
Who is the owner of the files compared to under which user you are running the compile under.
[Android Software/Hacking General [Developers Only]] papitoonichan:
tI have the same problem damn
[Android Software/Hacking General [Developers Only]] lolvatveo:
install enough library file and make can read these files
[Android Software/Hacking General [Developers Only]] Sebichao:
I found the solution !

My issue was simply with the shebang line #!/usr/bin/python at the beginning of the script. Since I only have Python 3 installed on my machine, I need to modify this line to #!/usr/bin/python3!
[Android Software/Hacking General [Developers Only]] DiamondJohn:
When faced with things like that, I normally create a symlink from what is expect to what I have. That way ALL scripts sort themselves out and there are less surprises (ie missing a script), and just a single change to track / manage, especially if the scripts are updated by someone else.
[Android Software/Hacking General [Developers Only]] Sebichao:
Brilliant! It's definitely a better solution because editing all the files isn't very tidy haha! Thanks!
[Android Software/Hacking General [Developers Only]] luscadias:
Hello everyone.

Im having a problem when trying to build a Kernel for my Zenfone 5 ZE620KL. Basically, it gives me some warning and erros, but continues normally. Then it simply stops building without giving me a IMAGE file into my output folder. Theres no /boot inside /output/arch/arm64.

This is the full building:

https://pastebin.com/7L7jvyah

Kernel Source:

https://github.com/crdroidandroid/android_kernel_asus_X00QD/
[Android Software/Hacking General [Developers Only]] ZawZaw:
Hello...Sir [MENTION=6842057]nathanchance[/MENTION]

I have a question.

Please, help me.

I compiled a Kernel for Google Pixel Device from AOSP msm kernel source. ( Oreo latest branch )

For kernel compilation, I used Google's AOSP aarch64 Toolchain.

I got this errors, please show on my screenshot.

Why Sir?

I really need your help.

Thank You Sir.

•••
[Android Software/Hacking General [Developers Only]] nathanchance:
Do you own a Pixel or does someone close to you own one? If not, why are you building a kernel for it? Building kernels blind creates a terrible user experience.

As for your error, you need to do what it says, build with the CONFIG option after the make command to see the mismatches.
[Android Software/Hacking General [Developers Only]] ZawZaw:
Thank You very Much Sir for help,

Google Pixel is my Myanmar friend's Phone.

This kernel build for my friend, it is not for me.

•••
[Android Software/Hacking General [Developers Only]] Professor Woland:
One question about kernel and ramdisk compression, is that compression dictated by bootloader or hardware, or I can edit kernel defconfig file and build it with some other compression I like and I can flash it and it will work?

Also is it necessary (I guess it is but just to be sure) that ramdisk and kernel compressions match eg I can't use kernel compressed in lz4 with gzip compressed ramdisk?
[Android Software/Hacking General [Developers Only]] nathanchance:
I have not messed with changing kernel image compression much. I tried to switch over to an lz4 compressed image and it wouldn't boot on my 6P.

Ramdisk and kernel image compressions don't depend on each other.
[Android Software/Hacking General [Developers Only]] Professor Woland:
So you can say that compression is dictated by hardware or something else you can't just choose whatever compression you want.

Well that strange because on my recovery it won't boot with ramdisk in gzip, it's probably something else that was off there.