[Android General] AlaskaLinuxUser:
nickrule1896,

First and foremost: Good job! You actually compiled a kernel that did flash and boot. That is really important and not to be overlooked. :good:

Now, I recommend that you watch my videos on kernel compiling. Notice in there that I *HIGHLY* recommend for new users to build within a ROM source code, as it will set many flags for you that will help you SIGNIFICANTLY in success of a build.

That said, building standalone may be harder (which is what you are doing) but it is faster to set up and can be done.

I liked the guides that you were following. All of them had really great information. Let's pick just one to work through, though, so we are on the same web page. Take this one: https://xdaforums.com/chef-central/android/guide-how-to-build-android-kernel-t3654336

Okay. There are a few things you need to know:

A. Kernel versions.

The kernel versions that you are building are not all the same version of kernel. Open the Makefile in each directory of those kernels you are working with, and you will notice at the top, they have different numbers. This means that these kernels have undergone different changes. That's okay, it is just needed so you know that they are not "the same" kernel.

B. Toolchains.

Not every tool chain is the same. I noticed that you downloaded several, which is good. Most likely, they are using the default kernel toolchain in Android, but this is not always the case. Using different toolchains can cause builds to fail, or even cause it to build but not boot. It is okay to use different toolchains, but be aware that you often have to make changes to allow different tool chains to work.

C. exporting flags before the build.

I noticed that you said you " gathered from all these is that I will need to get the kernel source from Samsung's open source website, a toolchain (I downloaded different ones), point the Makefile to the toolchain, perform "make ARCH=arm64" and hope that I get an Image file in the boot folder. " However, in the guide that we are following, you have to set several other flags as well:

1. Clone A Toolchain That Supports Your Device

2. Point the Makefile To Your Compiler (run this from within the toolchain folder!!)

Code:

export CROSS_COMPILE=$(pwd)/bin/<toolchain_prefix>-

Example:

Code:

export CROSS_COMPILE=$(pwd)/bin/aarch64-linux-android-

3. Tell Makefile About The Architecture Of Your Device Using This Command -->>

Code:

export ARCH=<arch> && export SUBARCH=<arch>

Example:

Code:

export ARCH=arm64 && export SUBARCH=arm64

4. Locate Your Proper Defconfig File.Where You Will Found That?

Go To "arch/<arch>/configs" Folder,And There You'll Find A Defconfig File Along With Your Device Codename Like For S7 Edge, Its --> "exynos8890_hero2lte-defconfig"

5. Now Come Back To Main Kernel Source Directory Then Enter These Command To Start Building!

Code:

make clean

make mrproper

make <defconfig_name>

make -s -j$(nproc --all) Or make zImage -j4

6.And You're Done! Where You'll Find The zImage?

When Building Finished,The Terminal Will Show The Directory!

So you need to set a few more flags than you mentioned previously. :D

So a few more questions: What version of Android are you building this kernel for? Is that the kernel for that version of Android? (Since you have all of them to pick from). This will help make it easier.

Have you modified the kernels in any way?

What tool chain are you using?

Now, for the one that boots and then reboots after 10 minutes or so, you should pull a logcat. After it boots, set up ADB, hook it to your computer and run

$ adb logcat |tee myLogFile.txt

You will see the output, and save it to a file on your computer. Then when the phone reboots, you will have captured everything up to that point, so you can see what was going on when it quit. You can also use dmesg as well.

Hope that helps and look forward to hearing back from you. :good:

BTW, I was in SIngapore once while in the Navy. Cool place!