[Moto Z2 Force  ROMs, Kernels, Recoveries, & Other ] gokart2:
Anyone compiling there own kernel based on lineage's source? Just have a couple questions. Can't get around an error, believe I know what needs to be done. Just not sure exactly how to do it?

WRAP arch/arm64/include/generated/asm/xor.h
WRAP arch/arm64/include/generated/uapi/asm/kvm_para.h
GEN ./Makefile
GEN ./Makefile
scripts/kconfig/conf --silentoldconfig Kconfig
scripts/kconfig/conf --silentoldconfig Kconfig
CHK include/config/kernel.release
[B][SIZE="4"]UPD include/config/kernel.release
Using .. as source for kernel
.. is not clean, please run 'make mrproper'
in the '..' directory.[/SIZE][/B]
/home/dukhawk/android/lineage/Makefile:1043: recipe for target 'prepare3' failed
make[1]: *** [prepare3] Error 1
make[1]: *** Waiting for unfinished jobs....
make[1]: Leaving directory '/home/dukhawk/android/lineage/out'
Makefile:152: recipe for target 'sub-make' failed
make: *** [sub-make] Error 2

Initially "include/config/kernel.release" file wasn't there in the source. Found it generated in the output directory though. Copied it to the source directory. Seemed to fix that issue, or specifically the previous error not finding the file "include/config/kernel.release".

Now " Using .. as source for kernel

.. is not clean, please run 'make mrproper'

in the '..' directory."

'..' ="$srctree" via below

# Things we need to do before we recursively start building the kernel

# or the modules are listed in "prepare".

# A multi level approach is used. prepareN is processed before prepareN-1.

# archprepare is used in arch Makefiles and when processed asm symlink,

# version.h and scripts_basic is processed / created.

# Listed in dependency order

PHONY += prepare archprepare prepare0 prepare1 prepare2 prepare3

# prepare3 is used to check if we are building in a separate output directory,

# and if so do:

# 1) Check that make has not been executed in the kernel src $(srctree)

prepare3: include/config/kernel.release

ifneq ($(KBUILD_SRC),)

@$(kecho) ' Using $(srctree) as source for kernel'

$(Q)if [ -f $(srctree)/.config -o -d $(srctree)/include/config ]; then \

echo >&2 " $(srctree) is not clean, please run 'make mrproper'"; \

echo >&2 " in the '$(srctree)' directory.";\

/bin/false; \

fi;

endif

For the life of me cannot figure out what directory is considered "$srctree"? Tried running "make mrproper" in a few directories and either get a make: no rule defined, or it takes the command but doesn't help the error? My thought now is that this has something to do with me building from a downloaded zip instead of the git repo, etc? Never had an issue before like this compiling that way.

build script:

#!/bin/sh

#export PATH="/home/dukhawk/android/android-ndk-r17c/toolchains/arm-linux-androideabi-4.9/prebuilt/linux-x86_64/bin/"

export CROSS_COMPILE="/home/dukhawk/android/android-ndk-r17c/toolchains/aarch64-linux-android-4.9/prebuilt/linux-x86_64/bin/aarch64-linux-android-"

export CC="/home/dukhawk/android/android-ndk-r17c/toolchains/aarch64-linux-android-4.9/prebuilt/linux-x86_64/bin/aarch64-linux-android-"

export CROSS_COMPILE_ARM32="/home/dukhawk/android/android-ndk-r17c/toolchains/arm-linux-androideabi-4.9/prebuilt/linux-x86_64/bin/arm-linux-androideabi-"

export ARCH=arm64

export SUBARCH=arm64

mkdir -p out

#cp /home/dukhawk/android/lineage/arch/arm64/boot/dts /home/dukhawk/android/lineage/out

make O=out clean

make O=out mrproper

make O=out lineageos_nash_defconfig

make O=out -j$(nproc --all)

#make O=out zImage -j4

Any help/pointers is greatly appreciated.:good: