[LG G5 Guides, News, & Discussion] jcadduono:
Hello!

I'm hoping to get custom kernel & rom development up and running quickly for the G5 community, and have created a git repository which provides a kernel source base to start with.

What I've done is taken the v10a release sources and modified them to work with build directories and multiple variants. (should they be unlocked or receive the CodeFire treatment at any time)

Here's where to start: https://github.com/jcadduono/nethunter_kernel_g5/tree/stock-6.0

If you'd like a somewhat updated kernel, the stock-6.0.y branch will be patched from Linux 3.18.y branch at kernel.org, see:

https://github.com/jcadduono/nethunter_kernel_g5/tree/stock-6.0.y

Different from the absolute stock defconfigs, I've made the following changes:

Module signature verification disabled

Unnecessary debugging flags separated into debug_defconfig (use EXTRA_DEFCONFIG=debug_defconfig to enable them)

Flags that were previous set to module (=m) have been set to =y (built-in) in case incompatibilities are unable to load stock modules

Each known variant & target is listed in build.sh comments. The default variant when building with ./build.sh is h850 with debugging disabled.

When using the Makefile, VARIANT_DEFCONFIG=variant_xxx_defconfig adds the additional settings per variant to the target defconfig. (by default stock_defconfig)

build.sh is set up to automatically build a dtb.img after creating the kernel Image.gz based on whichever variant you've built for.

You can use ./menuconfig.sh to modify the stock defconfig, or you can copy the stock_defconfig to another name such as my_defconfig and use TARGET=my ./menuconfig or TARGET=my ./build.sh

It's easier to just set the default target in build.sh/menuconfig.sh - each have their configuration options near the top of the files.

Be sure to edit the config variables in build.sh and menuconfig.sh before using. The VERSION file gets appended to the kernel version shown in `uname` when using build.sh.

The toolchain must be pointed to the correct location before it can build. Be sure to have libncurses5-dev and colordiff packages installed for menuconfig.sh.

For a toolchain, I recommend using the GCC Linaro aarch64 5.3 2016.02 release. You can use basically any aarch64 toolchain though.

Download here: https://releases.linaro.org/compone...o-5.3-2016.02-x86_64_aarch64-linux-gnu.tar.xz

You can start by forking my repository on GitHub and giving it your own name if you like. Extra interesting commits are available in the other branches that you should be able to cherry-pick without issues should you be interested in them.

Looking to test your kernel Image.gz + dtb.img?

Look no further than my LazyFlasher repository!

See here: https://github.com/jcadduono/lazyflasher/tree/kernel-flasher

Simply do:

git clone -b kernel-flasher https://github.com/jcadduono/lazyflasher.git kernel-flasher
cd kernel-flasher
cp /path/to/Image.gz /path/to/dtb.img ./
make

(simply place your kernel Image.gz (optional) and dtb.img (optional) in the root of the repository and type make!)

And you'll have your own dynamic kernel flashing zip for custom recoveries!

The kernel-flasher repository is capable of great things. You can create scripts in patch.d to do anything you like.

Add files to the ramdisk-patch folder and create a script that copies them into the $ramdisk folder and they will be rebuilt into the ramdisk!

By default, no-verity-opt-encrypt is there as an example.

Using setprop in patch.d scripts allows you to set props in default.prop with ease.

Add functions to patch.d-env to make them globally usable across patch.d scripts.

See other branches for more examples, like how to add f2fs lines to the fstab, or patch for system mode SuperSU.

LazyFlasher is the installer used in the Kali NetHunter project. You can also find more examples in the kali-nethunter GitHub!

Good luck, and happy kernel developing!