[General Questions and Answers] rebelviversel:
Hello, im trying to compile a custom kernel to have a working nethunter on my armor 6 ulefone, i love this phone but I cant run a full fledged nethunter

installation on it bcus it needs a custom kernel, and this phone its kernel is not made available to the public :(

I tried emailing ulefone if they could provide me with the kernel source of this phone the armor 6, but they answered me saying they cant do that

So, cus i desperatly want a nethunter kernel for this phone, I started learning about kernel compiling and I looked for kernels of all phones having this chipset

mt6771, which is not alot, of sources but some

I took the nokia 5+ source code from github and tried to compile it with the defconfig I extracted from my phones /proc/config.gz file

I know this going to be a tricky task to really get one compiled with the defconfig from my phone, but if im gonna compile one , ofcourse i want it to actually work on my phone, so I started the process, but now im a litle stuck,.. ive faced alot of errors

mainly the camcal imagesensor drivers were not the same of the armor6, so I downloaded diffrent kernel sources from diffrent phones containing these source files

of my phones drivers and sensors, and copied and pasted them on the directories I would get from these error messages

so far so good, i copied and compiled till i would get a little further and further but now the problem i get on the next error but this one doesnt give me a direction of

where its going wrong and how i should fix it, .... im compiling wih clang/llvm toolchain i downloaded from github, its the latest

here is my build script im using to build the kernel :

#! /usr/bin/bash

if [[ -d "out" ]]

then

cd out && make clean && make distclean && make mrproper && cd ..

else

mkdir -p out

fi

make O=out ARCH=arm64 sandroMOD_defconfig

PATH="<~/CLANG>/bin:</usr/lib/gcc>:bin${PATH}" \

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

ARCH=arm64 \

CLANG_TRIPLE=aarch64-linux-gnu- \

CROSS_COMPILE=aarch64-linux-android-

and this is my error im a bit clueless about how to go about it next

../drivers/md/Makefile:9: system partition dm verity enable

..

..

..

..

..

DEVAPC platform code exists...

************ drivers/trusty/mtee-kree mk ************

TCORE_UT_FWK_SUPPORT = n

TCORE_PROFILING_SUPPORT = n

TCORE_PROFILING_AUTO_DUMP = n

PMEM_MOCK_OBJECT_SUPPORT = n

TCORE_MEMORY_LEAK_DETECTION_SUPPORT = n

../drivers/md/Makefile:9: system partition dm verity enable

..

..

..

..

..

DEVAPC platform code exists...

************ drivers/trusty/mtee-kree mk ************

TCORE_UT_FWK_SUPPORT = n

TCORE_PROFILING_SUPPORT = n

TCORE_PROFILING_AUTO_DUMP = n

PMEM_MOCK_OBJECT_SUPPORT = n

TCORE_MEMORY_LEAK_DETECTION_SUPPORT = n

CLEAN scripts/basic

CLEAN scripts/kconfig

CLEAN .config

../drivers/md/Makefile:9: system partition dm verity enable

..

..

..

..

..

DEVAPC platform code exists...

************ drivers/trusty/mtee-kree mk ************

TCORE_UT_FWK_SUPPORT = n

TCORE_PROFILING_SUPPORT = n

TCORE_PROFILING_AUTO_DUMP = n

PMEM_MOCK_OBJECT_SUPPORT = n

TCORE_MEMORY_LEAK_DETECTION_SUPPORT = n

make[1]: Entering directory '/root/sources/armor6mod/out'

HOSTCC scripts/basic/fixdep

GEN ./Makefile

HOSTCC scripts/kconfig/conf.o

SHIPPED scripts/kconfig/zconf.tab.c

SHIPPED scripts/kconfig/zconf.lex.c

SHIPPED scripts/kconfig/zconf.hash.c

HOSTCC scripts/kconfig/zconf.tab.o

HOSTLD scripts/kconfig/conf

drivers/nfc/samsung/Kconfig:24:warning: choice value used outside its choice group

drivers/nfc/samsung/Kconfig:26:warning: choice value used outside its choice group

drivers/nfc/samsung/Kconfig:33:warning: choice value used outside its choice group

drivers/nfc/samsung/Kconfig:35:warning: choice value used outside its choice group

drivers/nfc/samsung/Kconfig:37:warning: choice value used outside its choice group

arch/arm64/configs/sandroMOD_defconfig:4488:warning: override: reassigning to symbol SYSVIPC

arch/arm64/configs/sandroMOD_defconfig:4489:warning: override: reassigning to symbol MODULES

arch/arm64/configs/sandroMOD_defconfig:4490:warning: override: reassigning to symbol MODULE_UNLOAD

arch/arm64/configs/sandroMOD_defconfig:4491:warning: override: reassigning to symbol MODULE_FORCE_UNLOAD

arch/arm64/configs/sandroMOD_defconfig:4492:warning: override: reassigning to symbol MODVERSIONS

arch/arm64/configs/sandroMOD_defconfig:4493:warning: override: reassigning to symbol BUILD_ARM64_APPENDED_DTB_IMAGE

arch/arm64/configs/sandroMOD_defconfig:4494:warning: unexpected data

arch/arm64/configs/sandroMOD_defconfig:4504:warning: override: reassigning to symbol ANDROID_BINDER_IPC

arch/arm64/configs/sandroMOD_defconfig:4505:warning: override: reassigning to symbol CFG80211_WEXT

arch/arm64/configs/sandroMOD_defconfig:4506:warning: override: reassigning to symbol MAC80211

arch/arm64/configs/sandroMOD_defconfig:4508:warning: override: reassigning to symbol USB_RTL8150

arch/arm64/configs/sandroMOD_defconfig:4509:warning: override: reassigning to symbol USB_RTL8152

arch/arm64/configs/sandroMOD_defconfig:4519:warning: override: reassigning to symbol RT2X00

arch/arm64/configs/sandroMOD_defconfig:4534:warning: override: reassigning to symbol USB_ZD1201

arch/arm64/configs/sandroMOD_defconfig:4536:warning: override: reassigning to symbol USB_NET_RNDIS_WLAN

arch/arm64/configs/sandroMOD_defconfig:4541:warning: unexpected data

arch/arm64/configs/sandroMOD_defconfig:4548:warning: override: reassigning to symbol USB_ACM

arch/arm64/configs/sandroMOD_defconfig:4549:warning: override: reassigning to symbol USB_CONFIGFS_SERIAL

arch/arm64/configs/sandroMOD_defconfig:4550:warning: override: reassigning to symbol USB_CONFIGFS_ACM

arch/arm64/configs/sandroMOD_defconfig:4551:warning: override: reassigning to symbol USB_CONFIGFS_OBEX

arch/arm64/configs/sandroMOD_defconfig:4552:warning: override: reassigning to symbol USB_CONFIGFS_NCM

arch/arm64/configs/sandroMOD_defconfig:4553:warning: override: reassigning to symbol USB_CONFIGFS_ECM

arch/arm64/configs/sandroMOD_defconfig:4554:warning: override: reassigning to symbol USB_CONFIGFS_ECM_SUBSET

arch/arm64/configs/sandroMOD_defconfig:4555:warning: override: reassigning to symbol USB_CONFIGFS_RNDIS

arch/arm64/configs/sandroMOD_defconfig:4557:warning: unexpected data

#

# configuration written to .config

#

make[1]: Leaving directory '/root/sources/armor6mod/out'

make[1]: Entering directory '/root/sources/armor6mod/out'

make[1]: aarch64-linux-android-gcc: No such file or directory

GEN ./Makefile

scripts/kconfig/conf --silentoldconfig Kconfig

drivers/nfc/samsung/Kconfig:24:warning: choice value used outside its choice group

drivers/nfc/samsung/Kconfig:26:warning: choice value used outside its choice group

drivers/nfc/samsung/Kconfig:33:warning: choice value used outside its choice group

drivers/nfc/samsung/Kconfig:35:warning: choice value used outside its choice group

drivers/nfc/samsung/Kconfig:37:warning: choice value used outside its choice group

/root/sources/armor6mod/Makefile:691: Cannot use CONFIG_CC_STACKPROTECTOR_STRONG: -fstack-protector-strong not supported by compiler

make[1]: aarch64-linux-android-gcc: No such file or directory

for i in ../arch/arm64/boot/dts/mediatek/k71v1_64_bsp.dts; do \

base_prj=`grep -m 1 "#include [<\"].*\/cust\.dtsi[>\"]" $i | sed 's/#include [<"]//g' | sed 's/\/cust\.dtsi[>"]//g'`;\

prj_path=./arch/arm64/boot/dts/$base_prj ;\

dws_path=../drivers/misc/mediatek/dws/mt6771/$base_prj.dws ;\

if [ -f $dws_path ] ; then \

mkdir -p $prj_path ;\

../tools/dct/DrvGen.py $dws_path $prj_path $prj_path cust_dtsi;\

fi \

done

CHK include/config/kernel.release

GEN ./Makefile

WRAP arch/arm64/include/generated/asm/bug.h

WRAP arch/arm64/include/generated/asm/bugs.h

WRAP arch/arm64/include/generated/asm/checksum.h

WRAP arch/arm64/include/generated/asm/clkdev.h

WRAP arch/arm64/include/generated/asm/cputime.h

WRAP arch/arm64/include/generated/asm/current.h

WRAP arch/arm64/include/generated/asm/delay.h

CHK include/generated/uapi/linux/version.h

WRAP arch/arm64/include/generated/asm/div64.h

WRAP arch/arm64/include/generated/asm/dma.h

UPD include/config/kernel.release

WRAP arch/arm64/include/generated/asm/dma-contiguous.h

UPD include/generated/uapi/linux/version.h

WRAP arch/arm64/include/generated/asm/early_ioremap.h

WRAP arch/arm64/include/generated/asm/emergency-restart.h

WRAP arch/arm64/include/generated/asm/errno.h

WRAP arch/arm64/include/generated/asm/ftrace.h

WRAP arch/arm64/include/generated/asm/hw_irq.h

WRAP arch/arm64/include/generated/asm/ioctl.h

WRAP arch/arm64/include/generated/asm/ioctls.h

WRAP arch/arm64/include/generated/asm/ipcbuf.h

WRAP arch/arm64/include/generated/asm/irq_regs.h

WRAP arch/arm64/include/generated/asm/kdebug.h

WRAP arch/arm64/include/generated/asm/kmap_types.h

WRAP arch/arm64/include/generated/asm/kvm_para.h

WRAP arch/arm64/include/generated/asm/local.h

WRAP arch/arm64/include/generated/asm/local64.h

WRAP arch/arm64/include/generated/asm/mcs_spinlock.h

WRAP arch/arm64/include/generated/asm/mm-arch-hooks.h

WRAP arch/arm64/include/generated/asm/mman.h

WRAP arch/arm64/include/generated/asm/msgbuf.h

WRAP arch/arm64/include/generated/asm/msi.h

WRAP arch/arm64/include/generated/asm/mutex.h

WRAP arch/arm64/include/generated/asm/pci.h

WRAP arch/arm64/include/generated/asm/pci-bridge.h

WRAP arch/arm64/include/generated/asm/poll.h

WRAP arch/arm64/include/generated/asm/preempt.h

WRAP arch/arm64/include/generated/asm/resource.h

WRAP arch/arm64/include/generated/asm/rwsem.h

WRAP arch/arm64/include/generated/asm/sections.h

WRAP arch/arm64/include/generated/asm/segment.h

WRAP arch/arm64/include/generated/asm/sembuf.h

WRAP arch/arm64/include/generated/asm/serial.h

HOSTCC scripts/basic/fixdep

WRAP arch/arm64/include/generated/asm/shmbuf.h

WRAP arch/arm64/include/generated/asm/simd.h

WRAP arch/arm64/include/generated/asm/sizes.h

WRAP arch/arm64/include/generated/asm/socket.h

WRAP arch/arm64/include/generated/asm/sockios.h

WRAP arch/arm64/include/generated/asm/swab.h

WRAP arch/arm64/include/generated/asm/switch_to.h

WRAP arch/arm64/include/generated/asm/termbits.h

WRAP arch/arm64/include/generated/asm/termios.h

WRAP arch/arm64/include/generated/asm/topology.h

WRAP arch/arm64/include/generated/asm/trace_clock.h

WRAP arch/arm64/include/generated/asm/types.h

WRAP arch/arm64/include/generated/asm/unaligned.h

WRAP arch/arm64/include/generated/asm/user.h

WRAP arch/arm64/include/generated/asm/vga.h

WRAP arch/arm64/include/generated/asm/xor.h

WRAP arch/arm64/include/generated/uapi/asm/kvm_para.h

[DCT_INFO]: DWS file path is /root/sources/armor6mod/drivers/misc/mediatek/dws/mt6771/k71v1_64_bsp.dws

[DCT_INFO]: Gen files path is /root/sources/armor6mod/out/arch/arm64/boot/dts/k71v1_64_bsp

[DCT_INFO]: Log files path is /root/sources/armor6mod/out/arch/arm64/boot/dts/k71v1_64_bsp

[DCT_INFO]: Parameter is cust_dtsi

[DCT_INFO]: chip id: MT6771

[DCT_INFO]: Chip ID : MT6771

[DCT_INFO]: Project Info: Sylvia

HOSTCC scripts/basic/bin2c

Using .. as source for kernel

CHK include/generated/utsrelease.h

UPD include/generated/utsrelease.h

[DCT_INFO]: Start to generate cust_dtsi file...

[DCT_INFO]: Generate cust_dtsi file successfully!

HOSTCC scripts/dtc/dtc.o

HOSTCC scripts/dtc/flattree.o

CC kernel/bounds.s

/bin/sh: 1: aarch64-linux-android-gcc: not found

make[2]: *** [.././Kbuild:45: kernel/bounds.s] Error 127

make[1]: *** [/root/sources/armor6mod/Makefile:1020: prepare0] Error 2

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

HOSTCC scripts/genksyms/genksyms.o

CC scripts/mod/empty.o

/bin/sh: 1: aarch64-linux-android-gcc: not found

make[3]: *** [../scripts/Makefile.build:259: scripts/mod/empty.o] Error 127

make[2]: *** [../scripts/Makefile.build:403: scripts/mod] Error 2

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

SHIPPED scripts/genksyms/parse.tab.c

SHIPPED scripts/genksyms/lex.lex.c

SHIPPED scripts/genksyms/keywords.hash.c

SHIPPED scripts/genksyms/parse.tab.h

../drivers/md/Makefile:9: system partition dm verity enable

HOSTCC scripts/dtc/fstree.o

HOSTCC scripts/genksyms/parse.tab.o

HOSTCC scripts/dtc/data.o

HOSTCC scripts/dtc/livetree.o

HOSTCC scripts/dtc/treesource.o

..

..

FDVT: Drv use 4.0 folder

..

..

..

..

HOSTCC scripts/dtc/srcpos.o

HOSTCC scripts/genksyms/lex.lex.o

HOSTCC scripts/dtc/checks.o

HOSTCC scripts/dtc/util.o

SHIPPED scripts/dtc/dtc-lexer.lex.c

SHIPPED scripts/dtc/dtc-parser.tab.h

SHIPPED scripts/dtc/dtc-parser.tab.c

HOSTCC scripts/dtc/dtc-lexer.lex.o

HOSTCC scripts/dtc/dtc-parser.tab.o

DEVAPC platform code exists...

*MTK_GPU_VERSION 2 = bifrost

*MTK_GPU_VERSION 3 = r9p0

mali MTK evironment, building r8p0 DDK

mtk-Kbuild CONFIG_MALI_PLATFORM_THIRDPARTY := y

mtk-Kbuild CONFIG_MALI_PLATFORM_THIRDPARTY_NAME := "mt6771"

*GPU defined ENABLE_MTK_DEBUG

mali MTK evironment, building r8p0 DDK

mtk-Kbuild CONFIG_MALI_PLATFORM_THIRDPARTY := y

mtk-Kbuild CONFIG_MALI_PLATFORM_THIRDPARTY_NAME := "mt6771"

*GPU defined ENABLE_MTK_DEBUG

mali MTK evironment, building r8p0 DDK

mtk-Kbuild CONFIG_MALI_PLATFORM_THIRDPARTY := y

mtk-Kbuild CONFIG_MALI_PLATFORM_THIRDPARTY_NAME := "mt6771"

*GPU defined ENABLE_MTK_DEBUG

imgsensor drv by common ../common/v1_1/s5k3p8sx_mipi_raw/

imgsensor drv by platform s5k3p9sx_mipi_raw/ s5k4h7yx_mipi_raw/ imx134_mipi_raw/ gc8034_mipi_raw/

imgsensor drv by platform

HOSTLD scripts/dtc/dtc

HOSTLD scripts/genksyms/genksyms

make[1]: *** [/root/sources/armor6mod/Makefile:557: scripts] Error 2

make[1]: Leaving directory '/root/sources/armor6mod/out'

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

thats the latest output, i cant see any errors of any mismatched drivers or missing directories or make files, it just gives me this now

can someone please guide me in the right direction as how im going to fix this

i really want a custom kernel on this phone, ive been busy learning to compile kernels and looking for info on this phone and similar mt6771 phones for

about alsmost 2 months now.

would really be awesome if i was able to pull it off and build a kernel without a kernel source just by using similar kernel sources and throwing them together and making it work

please tell me what to do