yashsingh1/xdaforums huggingface dataset:
[Android Software/Hacking General [Developers Only]] sumit17:
You have to run it as root.

Sudo su

Type password if asking.

I faced the same issue like permission denied.
[Android Software/Hacking General [Developers Only]] Saltmango:
need help getting this error

"

../scripts/mkmakefile: line 6: $'\r': command not found

../scripts/mkmakefile: line 12: $'\r': command not found

../scripts/mkmakefile: line 13: $'\r': command not found

../scripts/mkmakefile: line 53: warning: here-document at line 25 delimited by end-of-file (wanted `EOF')

../scripts/mkmakefile: line 54: syntax error: unexpected end of file

make[1]: *** [/home/srene/Desktop/kernel/violet_try2/Makefile:486: outputmakefile] Error 2

make[1]: Leaving directory '/home/srene/Desktop/kernel/violet_try2/out'

make: *** [Makefile:146: sub-make] Error 2

"
[Android Software/Hacking General [Developers Only]] MrMeeseeks:
Why would you compile a kernel as root? Check permissions first.
[Android Software/Hacking General [Developers Only]] sumit17:
how to solve permission denied without running root?because somehow he had installed build environment running as root.anyway , i am stuck at compiling kernel on .dtb file ,error
[Android Software/Hacking General [Developers Only]] sumit17:
i am facing this error and can not resolve the problem.

property '#gpio-cells' in node /soc/msm_cdc_pinctrl_us_euro_sw or bad phandle (referred from /soc/sound:qcom,cdc-us-eu-gpios[0])

arch/arm64/boot/dts/qcom/msm8953-pmi8937.dtb: Warning (gpios_property): Missing property '#gpio-cells' in node /soc/cdc_comp_pinctrl or bad phandle (referred from /soc/sound:qcom,cdc-comp-gpios[0])

arch/arm64/boot/dts/qcom/msm8953-pmi8937.dtb: Warning (gpios_property): Missing property '#gpio-cells' in node /soc/msm_cdc_pinctrl_pri or bad phandle (referred from /soc/sound:qcom,pri-mi2s-gpios[0])

arch/arm64/boot/dts/qcom/msm8953-pmi8937.dtb: Warning (gpios_property): Missing property '#gpio-cells' in node /soc/msm_cdc_pinctrl_quin or bad phandle (referred from /soc/sound:qcom,quin-mi2s-gpios[0])

arch/arm64/boot/dts/qcom/msm8953-pmi8937.dtb: Warning (gpios_property): Missing property '#gpio-cells' in node /soc/msm_cdc_pinctrl_us_euro_sw or bad phandle (referred from /soc/sound-9335:qcom,cdc-us-eu-gpios[0])

arch/arm64/boot/dts/qcom/msm8953-pmi8937.dtb: Warning (gpios_property): Missing property '#gpio-cells' in node /soc/msm_cdc_pinctrl_quin or bad phandle (referred from /soc/sound-9335:qcom,quin-mi2s-gpios[0])

arch/arm64/boot/dts/qcom/msm8953-pmi8937.dtb: Warning (interrupts_property): interrupts size is (12), expected multiple of 8 in /soc/pinctrl@1000000

CC lib/mpi/generic_mpih-lshift.o

DTC arch/arm64/boot/dts/qcom/msm8953-ext-codec-rcm-overlay.dtbo

Error: ../arch/arm64/boot/dts/qcom/msm8953-audio-cdp.dtsi:14.1-11 syntax error

FATAL ERROR: Unable to parse input tree

scripts/Makefile.dtbo:24: recipe for target 'arch/arm64/boot/dts/qcom/msm8953-ext-codec-rcm-overlay.dtbo' failed

make[3]: *** [arch/arm64/boot/dts/qcom/msm8953-ext-codec-rcm-overlay.dtbo] Error 1

../scripts/Makefile.build:653: recipe for target 'arch/arm64/boot/dts/qcom' failed

make[2]: *** [arch/arm64/boot/dts/qcom] Error 2

arch/arm64/Makefile:194: recipe for target 'dtbs' failed

make[1]: *** [dtbs] Error 2

make[1]: *** Waiting for unfinished jobs..
[Android Software/Hacking General [Developers Only]] :
Read the error. It says "Android GCC has been deprecated in favor of Clang". So you should use the instructions for building with Clang, that is also in the OP !
[Android Software/Hacking General [Developers Only]] starbucks2010:
Hello good people,

I'm trying to compile a kernel for S10+ (SM-G975F) using GCC4.9 and this clang. The kernel source is 4.14.85 Android Pie 9.0.

In the Makefile I used the clang-4691093 as path to CC and CLANG_TRIPLE.

My problem is that the kernel is not booting and I wonder if I use the right version of clang or if there are any commits that I should add on top of my clang or toolchain.

Thank you for your guidance and support.
[Android Software/Hacking General [Developers Only]] Flashaholic:
Hello, first of all thanks Nathan for this awesome guide.

i followed the instructions to create a kernel for my OP 7 Pro but if i actually wanna build make the kernel it fails. idk why maybe because i still use gcc ?

maybe somebody could help me with this, thanks in advance

1. git clone : https://github.com/OnePlusOSS/android_kernel_oneplus_sm8150.git

2. git clone https://android.googlesource.com/platform/prebuilts/gcc/linux-x86/aarch64/aarch64-linux-android-4.9 in too sm8150/toolchains

3.1. export CROSS_COMPILE=$(pwd)/bin/aarch64-linux-android- (inside the /toolchain folder)

3.2. export ARCH=arm64 && export SUBARCH=arm64

3.3. copy the config.gz from my own OP 7 Pro from /proc - edit it = CONFIG_LOCALVERSION="-OOS"

the problem now is when i run " make O=out -j$(nproc --all) " i get these errors linked below

https://pastebin.com/u8Dww42g
[Android Software/Hacking General [Developers Only]] DiamondJohn:
Check your permission on the source; mostly for info and to check its not something else. Then run something like the following from the root of your source, with the appropriate values in the placeholders:

chown -R [new-owner]:[new-group] [directory-name-or-path]

I had the same issue on the very first time I built an environment to compile a whole rom. chown fixed it. I think I ran all my mkdir and git commands as root, and hence all the resulting structure and files were assigned to root as the owner:o
[Android Software/Hacking General [Developers Only]] cristihan:
I want to compile the kernel for my Redmi 3S (land) device because I need the old DIAG_CHAR driver from MiCode. Can anyone tell me if I need to use msmcortex_defconfig or which defconfig file to use from Havoc android_kernel_xiaomi_msm8937 Kernel source to compile. Thanks !
[Android Software/Hacking General [Developers Only]] palmbeach05:
I'm trying to build the kernel for a twrp project, so the process is similar. I get stuck at executing lunch, which ends up defaulting to an aosp-eng, but does not put out the usual compiled files. I can see the actual file i'm trying to run from

palmbeach05@palmbeach05-VirtualBox:~/twrp$ . build/envsetup.sh

including vendor/omni/vendorsetup.sh

including sdk/bash_completion/adb.bash

palmbeach05@palmbeach05-VirtualBox:~/twrp$ lunch

You're building on Linux

Lunch menu... pick a combo:

1. aosp_arm-eng

2. aosp_arm64-eng

3. aosp_mips-eng

4. aosp_mips64-eng

5. aosp_x86-eng

6. aosp_x86_64-eng

7. omni_emulator-userdebug

8. msm8916_sec_defconfig-userdebug

Which would you like? [aosp_arm-eng] 8

build/make/core/product_config.mk:234: error: Can not locate config makefile for product "msm8916_sec_defconfig".

05:52:29 dumpvars failed with: exit status 1

Your device can't be found in device sources..

Traceback (most recent call last):

File "vendor/omni/build/tools/roomservice.py", line 405, in <module>

fetch_device(device)

File "vendor/omni/build/tools/roomservice.py", line 373, in fetch_device

git_data = search_gerrit_for_device(device)

File "vendor/omni/build/tools/roomservice.py", line 81, in search_gerrit_for_device

device_data = check_repo_exists(git_data, device)

File "vendor/omni/build/tools/roomservice.py", line 58, in check_repo_exists

"exiting roomservice".format(device=device))

Exception: sec_defconfig not found,exiting roomservice

build/make/core/product_config.mk:234: error: Can not locate config makefile for product "msm8916_sec_defconfig".

05:52:34 dumpvars failed with: exit status 1

** Don't have a product spec for: 'msm8916_sec_defconfig'

** Do you have the right repo manifest?

palmbeach05@palmbeach05-VirtualBox:~/twrp$
[Android Software/Hacking General [Developers Only]] DSA:
Not fully relevant, but what device tree are you using? And how have you set you roomservice up?
[Android Software/Hacking General [Developers Only]] palmbeach05:
Kernel

https://github.com/latvianguy18/kernel_samsung_msm8916

Device

https://github.com/latvianguy18/device_samsung_msm8916-common

Room service?
[Android Software/Hacking General [Developers Only]] DSA:
Room service is your local manifest, eg:

https://gist.github.com/jgcaap/7ea3cfd535ae03464799

How have you got it set up?
[Android Software/Hacking General [Developers Only]] D1stRU3T0R:
That build-in.o is the problem?
[Android Software/Hacking General [Developers Only]] zhaozihanzzh:
I don't think so. Maybe it is something like this:

For example, error is in fs/ext3/dir.c, in line 141.
[Android Software/Hacking General [Developers Only]] Mizan96:
Help

Trying to compile samsung a7 2016 arm64 kernel. And facing this problem. Using prebuilt aarch64-linux-android-4.9.
[Android Software/Hacking General [Developers Only]] roman.mandeleil:
[MENTION=6842057]The Flash[/MENTION] , building kernel for my new devices:

what nuances of this particular device should I

consider?

(HuaWei M3 Phablet)
[Android Software/Hacking General [Developers Only]] furkaan28:
[MENTION=6842057]The Flash[/MENTION] can u look at this ?

https://hastebin.com/ubedoyuzoy.vbs
[Android Software/Hacking General [Developers Only]] Nirman Bhullar:
It seems you are not root please run sudo -s before doing angthing ?
[Android Software/Hacking General [Developers Only]] Professor Woland:
Ok, maybe I will go to offtopic a little bit. So my phone uses lz4 instead of gzip (curses)

So I'm trying to build TWRP for my device it builds fine but uses gzip so how do I point to it to use lz4, I think it should be done in boardconfig.mk with other flags for kernel and ramdisk see line https://github.com/ProfessorWoland/...11f74dc5407c11ee186f6e720b/BoardConfig.mk#L44

Halp please :)
[Android Software/Hacking General [Developers Only]] Minions_Army:
Thanks a lot for tutorial
[Android Software/Hacking General [Developers Only]] nathanchance:
Hmmm I'm not sure I understand what you mean... what exactly uses lz4? The kernel image's compression or the recovery/boot image's compression? Does it actually matter for recovery?
[Android Software/Hacking General [Developers Only]] Professor Woland:
Well, I think it uses lz4 for everything kernel, images, ramdisk. Also I'm not quite sure it matter for recovery I have trouble with it and I don't know what else could be wrong than this. I see this isn't your field of knowledge sorry to bother.
[Android Software/Hacking General [Developers Only]] Raj.S:
Help! Looks like something wrong wuth my headers!

on the very very attempt i got this....... please help me!:confused::crying:
[Android Software/Hacking General [Developers Only]] nathanchance:
Don't build as root.
[Android Software/Hacking General [Developers Only]] Raj.S:
I've now any other user how can I do....

Edit:

I've created a new user and log in and run the command again it shows the same error!

I'm trying to make arm kernel but in the first line of error output it's has something like x86?
[Android Software/Hacking General [Developers Only]] adekboreanaz:
-----------------------
[Android Software/Hacking General [Developers Only]] adekboreanaz:
---------------------------
[Android Software/Hacking General [Developers Only]] zurik:
----------------------
[Android Software/Hacking General [Developers Only]] Uzephi:
I built the Motorola Z2 Force (Nash) kernel from source. After fixing bad links (turning <> to " " or vice versa) and fixed undefined errors. Used Google's 4.9 compiler. My zimage was roughly 4 Megs smaller but unzipped my kernel image was roughly half a Meg larger. It obviously won't boot. Is it because Motorola might be using a different compiler? Missing source? This is msm8996 chipset.

Source: GitHub.com/Uzephi/Nash_Kernel
[Android Software/Hacking General [Developers Only]] nathanchance:
What I would do is revert all of the changes you have done so far and try just using the note in the OP regarding adding an out folder to your make commands. Newer CAF kernels refuse to compile without that and even if you fix all the compilation errors separately, the dts files often get missed making booting impossible.
[Android Software/Hacking General [Developers Only]] AhmAdDev99:
Hi it's me again, After LOOOONG of time :(

Could you help me please.

Tried specifying out folder, Building in home, different gcc, different kernel source, different linux/s... etc

But still no LUCK

Could you please tell what i do?

When i try 'out folder'

i get this

GEN usr/initramfs_data.cpio

File ../../ramdisk.cpio could not be opened for reading

line 32

File ../../ramdisk-recovery.cpio could not be opened for reading

line 33

/Kernel/android_kernel_samsung_t1-android-4.4/usr/Makefile:67: recipe for target 'usr/initramfs_data.cpio' failed

make[2]: *** [usr/initramfs_data.cpio] Error 255

/Kernel/android_kernel_samsung_t1-android-4.4/Makefile:945: recipe for target 'usr' failed

make[1]: *** [usr] Error 2

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

I can't find any of those files

ramdisk-recovery.cpio / ramdisk.cpio

------

Without 'out folder i get this

/home/a7a/t1/android_kernel_samsung_t1-cm-11.0/scripts/gen_initramfs_list.sh: Cannot open 'source/usr/i9100g_initramfs.list'

/home/a7a/t1/android_kernel_samsung_t1-cm-11.0/usr/Makefile:67: recipe for target 'usr/initramfs_data.cpio' failed

make[1]: *** [usr/initramfs_data.cpio] Error 1

Makefile:945: recipe for target 'usr' failed

make: *** [usr] Error 2

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

_____

The only way that i don't get errors is by Commenting this line in configs

CONFIG_INITRAMFS_SOURCE="source/usr/i9100g_initramfs.list"

to this

CONFIG_INITRAMFS_SOURCE=""

So is i flash this it will boot?

Thanks For ur time :good:
[Android Software/Hacking General [Developers Only]] palmbeach05:
I see, i always called it local manifest, but i'll have to get back to you on that, i'm away from my laptop for a few hrs, will let you know when i get back to it.
[Android Software/Hacking General [Developers Only]] KaMyKaSii:
I also had this problem and if I am not mistaken the solution was to use the last tarball before the addition of the deprecation notice. You can try it

https://android.googlesource.com/pl...c0ace0eb9ba47c11df56971e7f63f2ebaa9fbd.tar.gz

---------- Post added at 08:05 PM ---------- Previous post was at 07:59 PM ----------

Have you checked if your kernel has a working dtb? See my post below:

https://xdaforums.com/android/softw...-compile-android-kernel-t3627297/post78999546
[Android Software/Hacking General [Developers Only]] FSadino:
Need help to build stock op3 kernel (branch 9.0) with clang

Didn't modified anything, just trying to build full stock.

If you need more info just ping me ;)

Thanks in advance
[Android Software/Hacking General [Developers Only]] attack11:
You need to add clang support first, check this:

https://github.com/nathanchance/android-kernel-clang
[Android Software/Hacking General [Developers Only]] palmbeach05:
i do not have that set up. i don't know if its needed, i ended up downloading the specific branch i needed rather than everything for all repositories that i needed
[Android Software/Hacking General [Developers Only]] cristihan:
My solution was to change to Linaro compiler.
[Android Software/Hacking General [Developers Only]] DSA:
It is needed. I genuinely suggest reading a lot more before attempting this. It's too much for me to write in this post
[Android Software/Hacking General [Developers Only]] FSadino:
I'm missing the clang pathset part... I will read about it later.

Thanks for your help
[Android Software/Hacking General [Developers Only]] debil2281:
pp.userapi. com/c855032/v855032728/8b5cf/HAZb157m6yo.jpg

good
[Android Software/Hacking General [Developers Only]] chmuhammadsohaib:
I can't boot into system. I followed all the instructions accordingly and replaced the binary file of boot.img-zImage with the archive obtained after compiling kernel(image.gz-dtb). I flashed it but my phone is looping over and over in bootloader but not booting into system. The reason I compiled kernel was to upgrade my phone from 32 bit rom to 64 bit (as the processor was capable of so). Thus, I wanted a 64 bit kernel rather than 32 bit preinstalled but now I can't go in my system. My phone is Xiaomi Redmi S2 (ysl). The kernel I compiled: https://github.com/LineageOS/android_kernel_xiaomi_msm8953 . The ROM I wanted to boot was Phusson's arm64 AOSP GSI.

Help me save my phone.
[Android Software/Hacking General [Developers Only]] FSadino:
Connect device through adb and type adb -d logcat before booting your device
[Android Software/Hacking General [Developers Only]] chmuhammadsohaib:
It'snot booting up. Just looping over and over in bootloader.
[Android Software/Hacking General [Developers Only]] palmbeach05:
Ok and did you setup adb logcat?
[Android Software/Hacking General [Developers Only]] chmuhammadsohaib:
Yes I did.
[Android Software/Hacking General [Developers Only]] nathanchance:
Sounds like you need this: https://github.com/kenny3fcb/nethun...mmit/5aced38f07dedf13a42eed0965750724bb605036

I haven't added it to my msm-3.18 patch as I never needed it, leading me to believe it is environment related.
[Android Software/Hacking General [Developers Only]] FSadino:
Thank you Nathan, I will try when I get home. :good:
[Android Software/Hacking General [Developers Only]] nathanchance:
You will need https://github.com/nathanchance/marlin/commit/8d6c215f5e84454790e4d43d9819b8e23b904aff for vdso32 support on 3.18.
[Android Software/Hacking General [Developers Only]] nathanchance:
Revert this commit: https://github.com/FSadino/android_...mmit/9af64df256276978ad8d8539b4109effa422bee6

You have the toggable one: https://github.com/FSadino/android_...mmit/b1f51dc25045f13ed049ecf04ea66ef74c3d8112

I would recommend fixing those warnings when you can so that you can turn -Werror back on but it's not critical to do so.

I just realized that you have a OnePlus 3. For whatever reason, I don't know anyone who has been able to get the OnePlus 3 kernel to boot with clang. Don't know why, it must be some OnePlus specific driver because other msm8998 devices can do it just fine. Not sure if anyone has tried it recently or succeeded, I haven't paid much attention to the Android kernel scene in a bit.
[Android Software/Hacking General [Developers Only]] saurabhs935:
Drivers in Wahoo kernel

Yeah I understood that we've converted modules to kernel object. But the

device stucked in google LOGO.
[Android Software/Hacking General [Developers Only]] FSadino:
I had to fix qcacld-2.0 errors with other [MENTION=7395699]kenny3fcb[/MENTION] commits and build finished, but as you said, it doesn't boot :(

Tried to adb -d logcat &> log.txt but without sucess, log.txt is empty! Is there any other way to take log from boot?

EDIT: Forget this Nathan, this is to much for me... Thank you very much for your support! :good:
[Android Software/Hacking General [Developers Only]] mastakillah576:
??

i have both a image and image.gz in the boot folder. Both same size, well the image in the zip in the same size as the image file. Did i do something wrong or can i use either? thx for this guide

---------- Post added at 02:59 AM ---------- Previous post was at 02:31 AM ----------

im sry i just saw the quote you statement. i have both a image and image.gz in the boot folder. Both same size, well the image in the zip in the same size as the image file. Did i do something wrong or can i use either? thx for this guide
[Android Software/Hacking General [Developers Only]] v1da:
I compiled my first kernel successfully. AFter that,

I want to modify 'make menuconfig' step.

From what step do I have to go? to modify menuconfig? in the kernel source

I just want to add wlan support/configuration in menuconfig, and then recompile new kernel again

I used this command when I compiled the kernel

make clean && make mrproper
mkdir ../out
make O=../out mido_defconfig
make O=../out -j4
[Android Software/Hacking General [Developers Only]] nathanchance:
No, the Image.gz is most likely the one you want to use (gzip compressed Image). I don't know of a device off the top of my head that uses a decompressed kernel image.

You'll want to run:

make O=../out menuconfig

after make O=../out mido_defconfig.
[Android Software/Hacking General [Developers Only]] Petermaxil:
How can add message encryption feature in Kernel
[Android Software/Hacking General [Developers Only]] v1da:
thanks sir,

Another problem I found is like I said before, I build successfully and it boot successfully on my android device

When I look at in the build messages, I found out this:

Building modules, stage 2.
[B]MODPOST 0 modules[/B]
GZIP arch/arm64/boot/Image.gz
CAT arch/arm64/boot/Image.gz-dtb

The modules are not build with MODPOST 0 modules

How can I solve this, I compiled many times, but still doesn't built modules

I search on Google, I cannot find the solutions related with android kernel

toolchain: https://android.googlesource.com/platform/prebuilts/gcc/linux-x86/aarch64/aarch64-linux-android-4.9 -b pie-release toolchain64
[Android Software/Hacking General [Developers Only]] darkidz555:
Hey guys anyone here success OC msm8998 big core more than 2592mhz ?? If anyone have any idea I would love to learn.

For now currently I only able to OC GPU to max 850mhz but for CPU is kinda tricky I don't know how what is the 0x0004044c and 0x0660006c

Would appreciate if anyone will help gracias
[Android Software/Hacking General [Developers Only]] nathanchance:
Do you have any modules enabled in your config?
[Android Software/Hacking General [Developers Only]] v1da:
I did:

--- [*] Enable loadablemodule support --->

[*] Forced module loading

[*] Module unloading

[*] Forced Module unloading

<*> Generic IEEE 802.11 Networking Stack (mac80211)

<*> Ralink rt27xx/rt28xx/rt30xx (USB) support

[*] rt2800usb – include support for rt35xx devices

[*] Realtek RTL8192CU/RTL8188CU USB Wireless Network Adapter

With those options, after compiling the kernel, there is no modules built

When giving M without *, the modules are built outside

The device is mido (PIE)

Sources I tried: https://github.com/andersonmendess/android_kernel_xiaomi_mido

https://github.com/penglezos/android_kernel_xiaomi_msm8953

My friend also tried to compile including modules, he still got MODPOST 0 MODULES
[Android Software/Hacking General [Developers Only]] nathanchance:
You don't seem to be describing a problem... the regular * means that the drivers are built in, M means they are built as modules.
[Android Software/Hacking General [Developers Only]] tripLr:
General Android question

What does make O= mean

And is the above command making and Android menuconfg rather than a x86 menuconfg ?

In general my question is

Is if I have an xyz chipset in Arch arm.

And there is a specific deconfig

Is there a way to make menuconfg for that chipset ? Thanks
[Android Software/Hacking General [Developers Only]] v1da:
I meant, giving * means that the drivers are built in, but I thought MODPOST 0 MODULES means the modules are not built in.

and the building message should show MODPOST 5 MODULES even if the modules are built in, not MODPOST 0 MODULES?

sorry for NOOB
[Android Software/Hacking General [Developers Only]] nathanchance:
No, you have it backwards; MODPOST 0 MODULES means that all drivers are built in. MODPOST # MODULES means that there are .ko (kernel module) files that needs to be gathered up and flashed to have access to the drivers.

It means build the object files in a separate directory rather than

It depends on what the value of ARCH is and the config being specified to make.

$ make ARCH=<arch> O=out <config> menuconfig

is the command that you are looking for, with <arch> replaced with your actual architecture (like arm or arm64) and <config> replaced with the actual name of the config file in arch/<arch>/configs. Hope that helps!
[Android Software/Hacking General [Developers Only]] v1da:
OMG. :victory: I got it now.

Thank YOU :o
[Android Software/Hacking General [Developers Only]] palmbeach05:
Use dog.del or pastebin to attach all that next tine