[Galaxy Note 4 Unified Development] twistedumbrella:
This thread is NOT for general Q & A about using the kernel or configuring a specific version.

This thread IS for sharing source code or attempting to apply debugging to code changes.

In English: This is what a development thread really looks like. No downloads, No user manual.

Note to Mods: OT is welcome, so long as it is relevant to the kernel developer experience

[youtube]YV4oYkIeGJc[/youtube]
​

Building the kernel 101:

A clean branch with only the build tools, ramdisks, and MacOS updates is at:

https://github.com/StarKissed/starkissed-kernel-trlte/tree/master

The stockish branch adds Linux patches, mainline updates, and SELinux mods

The deported branch is the customized version described in the OP feature list

You are going to need a few things, especially if building this kernel for MacOS.

GCC 4.7 (This is the version Samsung's documentation listed)

An updated mkbootimg (Must have DTS support)

A dtbtool (Included in the source, but only for Linux)

Insomnia (Not a requirement, but it will help you in the long run)

For MacOS, the tools are available from the following repositories:

https://github.com/StarKissed/android-toolchain-eabi-4.7

https://github.com/StarKissed/starkissed-build-tools

Let's jump ahead a moment for those of you who have built kernels and notice your boot.img is only around 11 MB while the versions you see listed here are all roughly 14 MB. This is where the new mkbootimg and dtbtool are necessary.

Attempting to retrieve the commandline arguments from the boot.img will not tell you one important piece:

./dtbtool -o dt.img -s 4096 -p ../scripts/dtc/ ../arch/arm/boot/dts/
chmod a+r dt.img
mkbootfs (ramdisk creation)
mkbootimg (mkbootimg params) --dt dt.img

This takes the DTSI that was built into a dtb as one of the first steps in the compile process and turns it into an image that is appended to the end of the boot.img. The dt.img just happens to be about 3 MB. (11 MB + 3 MB = 14 MB)

If you grabbed the original Samsung kernel source, you may notice that their default compile script directs the build to an "out" folder in the root of the kernel directory.

The obvious advantage to this is that their clean command runs into some errors, so the clean process is simply deleting the "out" folder and making a new one.

This doesn't work for a lot of the custom components you may want to add to your kernel, though. Some modifications, such as intelli-thermal, rely on a subdirectory that is referenced in the Makefile.

Building to this out folder will result in an error because it cannot find the output of that component, but building in the tree, or actual source, will also result in an error. The lesser of two evils is to fix in-tree builds.

Instructions for TRACE_INCLUDE_FILE in include/trace/define_trace.h say
"the path is relative to define_trace.h, not the file including it".
Fix in-tree compilation by making the path relative to define_trace.h.

What this means is that when you have a line that refers to the TRACE_INCLUDE_PATH or an include reference to a file that uses a relative location instead of a global, these need to be updated

The only two files that currently require updates in the stock source code are

drivers/scsi/ufs/ufs_test.c
#include -> #include "../sd.h"

and

drivers/video/msm/mdss/mdss_mdp_trace.h
#define TRACE_INCLUDE_PATH . -> #define TRACE_INCLUDE_PATH ../../drivers/video/msm/mdss/

If you want to be able to debug your kernel, you will need to enable last_kmsg.

Open up the arch/arm/configs/apq8084_sec_defconfig and add

CONFIG_SEC_DEBUG_NOCACHE_LOG_IN_LEVEL_LOW=y
CONFIG_PRINTK_PROCESS=y
CONFIG_SEC_DEBUG_LOW_LOG=y

More to come soon...