[Realme 2 pro Questions & Answers] gilius2k15:
I am attempting to recompile the Realme 2 pro kernel to enable Virtualization and KVM, using Ubuntu 18.04 (on an i7-8700K).

https://github.com/realme-kernel-opensource/Realme2Pro-kernel-source/tree/master/

Presumably, the correct defconfig file is sdm660_defconfig or sdm660-perf_defconfig? See here for the choices: (however, they all seem to be crashing in similar places)

https://github.com/realme-kernel-opensource/Realme2Pro-kernel-source/tree/master/arch/arm64/configs

The toolchain I am using is the penultimate release because of some of some errors with the latest:

https://android.googlesource.com/pl....9/+/e54105c9f893a376232e0fc539c0e7c01c829b1e

Steps taken

1. Open Terminal as root (sudo -i) and install various packages:

apt-get install -y build-essential kernel-package libncurses5-dev bzip2
apt-get install flex bison
apt-get install libelf-dev

2. Unzip kernel source to "real" and toolchain to "tool" on the desktop, respectively, and create environment variables:

export CROSS_COMPILE=/home/gilius/Desktop/tool/bin/aarch64-linux-android-
export ARCH=arm64

3. Clean "real" directory (only if compiling multiple times; not for the first compile):

make clean && make mrproper

4. Create .config file for chosen defconfig:

make sdm660_defconfig

Note: this step results in some warnings:

@@ 111 OPPO_BUILD_CUSTOMIZE is

HOSTCC scripts/basic/fixdep

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

'rivers/input/touchscreen/oppo_touchscreen/Kconfig:32:warning: ignoring unsupported character '

'rivers/input/touchscreen/oppo_touchscreen/Kconfig:32:warning: ignoring unsupported character '

'rivers/input/touchscreen/oppo_touchscreen/Kconfig:32:warning: ignoring unsupported character '

'rivers/input/touchscreen/oppo_touchscreen/Kconfig:32:warning: ignoring unsupported character '

'rivers/input/touchscreen/oppo_touchscreen/Kconfig:35:warning: ignoring unsupported character '

'rivers/input/touchscreen/oppo_touchscreen/Kconfig:35:warning: ignoring unsupported character '

'rivers/input/touchscreen/oppo_touchscreen/Novatek/Kconfig:3:warning: ignoring unsupported character '

'rivers/input/touchscreen/oppo_touchscreen/Novatek/Kconfig:3:warning: ignoring unsupported character '

'rivers/input/touchscreen/oppo_touchscreen/Novatek/Kconfig:3:warning: ignoring unsupported character '

'rivers/input/touchscreen/oppo_touchscreen/Novatek/NT36672_noflash/Kconfig:5:warning: ignoring unsupported character '

'rivers/input/touchscreen/oppo_touchscreen/Novatek/NT36672_noflash/Kconfig:7:warning: ignoring unsupported character '

'rivers/input/touchscreen/oppo_touchscreen/Novatek/NT36672_noflash/Kconfig:8:warning: ignoring unsupported character '

'rivers/input/touchscreen/oppo_touchscreen/Novatek/NT36672_noflash/Kconfig:8:warning: ignoring unsupported character '

'rivers/input/touchscreen/oppo_touchscreen/Novatek/NT36672_noflash/Kconfig:8:warning: ignoring unsupported character '

'rivers/input/touchscreen/oppo_touchscreen/Novatek/NT36672_noflash/Kconfig:13:warning: ignoring unsupported character '

'rivers/input/touchscreen/oppo_touchscreen/Novatek/NT36672_noflash/Kconfig:15:warning: ignoring unsupported character '

'rivers/input/touchscreen/oppo_touchscreen/Novatek/NT36672_noflash/Kconfig:16:warning: ignoring unsupported character '

'rivers/input/touchscreen/oppo_touchscreen/Novatek/NT36672_noflash/Kconfig:16:warning: ignoring unsupported character '

'rivers/input/touchscreen/oppo_touchscreen/Novatek/NT36672_noflash/Kconfig:16:warning: ignoring unsupported character '

'rivers/input/touchscreen/oppo_touchscreen/Himax/Kconfig:3:warning: ignoring unsupported character '

'rivers/input/touchscreen/oppo_touchscreen/Himax/Kconfig:3:warning: ignoring unsupported character '

'rivers/input/touchscreen/oppo_touchscreen/Himax/hx83112a_noflash/Kconfig:5:warning: ignoring unsupported character '

'rivers/input/touchscreen/oppo_touchscreen/Himax/hx83112a_noflash/Kconfig:7:warning: ignoring unsupported character '

'rivers/input/touchscreen/oppo_touchscreen/Himax/hx83112a_noflash/Kconfig:8:warning: ignoring unsupported character '

'rivers/input/touchscreen/oppo_touchscreen/Himax/hx83112a_noflash/Kconfig:8:warning: ignoring unsupported character '

'rivers/input/touchscreen/oppo_touchscreen/Himax/hx83112a_noflash/Kconfig:8:warning: ignoring unsupported character '

arch/arm64/configs/sdm660_defconfig:297:warning: override: reassigning to symbol BLK_DEV_MD

arch/arm64/configs/sdm660_defconfig:298:warning: override: reassigning to symbol MD_LINEAR

arch/arm64/configs/sdm660_defconfig:303:warning: override: reassigning to symbol DM_VERITY

arch/arm64/configs/sdm660_defconfig:858:warning: override: reassigning to symbol INPUT_JOYSTICK

arch/arm64/configs/sdm660_defconfig:864:warning: override: reassigning to symbol REGMAP_ALLOW_WRITE_DEBUGFS

arch/arm64/configs/sdm660_defconfig:876:warning: symbol value '1245' invalid for OPPO_FINGERPRINT_CHIP

#

# configuration written to .config

#

5. Enable Virtualization and KVM inside the .config file

make menuconfig

Note: this step ommited for the time being till I can get a successful build.

6. Start compiling the kernel

make -j4

Note: I use make -j10 because I have a fast x64 processor.

This last stage is where the main issues seem to occur with several errors reported and no Image file outputted by the compiler (ends prematurely):

root@gilius-Z370M-DS3H:/home/gilius/Desktop/real# make -j10 [MENTION=5839521 [MENTION=1065870 [MENTION=1879310]@@@[/MENTION][/MENTION][/MENTION] 111 OPPO_BUILD_CUSTOMIZE is [MENTION=5839521 [MENTION=1065870 [MENTION=1879310]@@@[/MENTION][/MENTION][/MENTION] 111 OPPO_BUILD_CUSTOMIZE is

scripts/kconfig/conf --silentoldconfig Kconfig

'rivers/input/touchscreen/oppo_touchscreen/Kconfig:32:warning: ignoring unsupported character '

'rivers/input/touchscreen/oppo_touchscreen/Kconfig:32:warning: ignoring unsupported character '

'rivers/input/touchscreen/oppo_touchscreen/Kconfig:32:warning: ignoring unsupported character '

'rivers/input/touchscreen/oppo_touchscreen/Kconfig:32:warning: ignoring unsupported character '

'rivers/input/touchscreen/oppo_touchscreen/Kconfig:35:warning: ignoring unsupported character '

'rivers/input/touchscreen/oppo_touchscreen/Kconfig:35:warning: ignoring unsupported character '

'rivers/input/touchscreen/oppo_touchscreen/Novatek/Kconfig:3:warning: ignoring unsupported character '

'rivers/input/touchscreen/oppo_touchscreen/Novatek/Kconfig:3:warning: ignoring unsupported character '

'rivers/input/touchscreen/oppo_touchscreen/Novatek/Kconfig:3:warning: ignoring unsupported character '

'rivers/input/touchscreen/oppo_touchscreen/Novatek/NT36672_noflash/Kconfig:5:warning: ignoring unsupported character '

'rivers/input/touchscreen/oppo_touchscreen/Novatek/NT36672_noflash/Kconfig:7:warning: ignoring unsupported character '

'rivers/input/touchscreen/oppo_touchscreen/Novatek/NT36672_noflash/Kconfig:8:warning: ignoring unsupported character '

'rivers/input/touchscreen/oppo_touchscreen/Novatek/NT36672_noflash/Kconfig:8:warning: ignoring unsupported character '

'rivers/input/touchscreen/oppo_touchscreen/Novatek/NT36672_noflash/Kconfig:8:warning: ignoring unsupported character '

'rivers/input/touchscreen/oppo_touchscreen/Novatek/NT36672_noflash/Kconfig:13:warning: ignoring unsupported character '

'rivers/input/touchscreen/oppo_touchscreen/Novatek/NT36672_noflash/Kconfig:15:warning: ignoring unsupported character '

'rivers/input/touchscreen/oppo_touchscreen/Novatek/NT36672_noflash/Kconfig:16:warning: ignoring unsupported character '

'rivers/input/touchscreen/oppo_touchscreen/Novatek/NT36672_noflash/Kconfig:16:warning: ignoring unsupported character '

'rivers/input/touchscreen/oppo_touchscreen/Novatek/NT36672_noflash/Kconfig:16:warning: ignoring unsupported character '

'rivers/input/touchscreen/oppo_touchscreen/Himax/Kconfig:3:warning: ignoring unsupported character '

'rivers/input/touchscreen/oppo_touchscreen/Himax/Kconfig:3:warning: ignoring unsupported character '

'rivers/input/touchscreen/oppo_touchscreen/Himax/hx83112a_noflash/Kconfig:5:warning: ignoring unsupported character '

'rivers/input/touchscreen/oppo_touchscreen/Himax/hx83112a_noflash/Kconfig:7:warning: ignoring unsupported character '

'rivers/input/touchscreen/oppo_touchscreen/Himax/hx83112a_noflash/Kconfig:8:warning: ignoring unsupported character '

'rivers/input/touchscreen/oppo_touchscreen/Himax/hx83112a_noflash/Kconfig:8:warning: ignoring unsupported character '

'rivers/input/touchscreen/oppo_touchscreen/Himax/hx83112a_noflash/Kconfig:8:warning: ignoring unsupported character '

@@ 111 OPPO_BUILD_CUSTOMIZE is

CHK include/config/kernel.release

...

CC net/core/link_watch.o

drivers/bluetooth/btfm_slim.c:26:23: fatal error: btfm_slim.h: No such file or directory

#include <btfm_slim.h>

^

compilation terminated.

scripts/Makefile.build:263: recipe for target 'drivers/bluetooth/btfm_slim.o' failed

make[2]: *** [drivers/bluetooth/btfm_slim.o] Error 1

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

CC drivers/acpi/acpica/rsinfo.o

CC kernel/time/tick-oneshot.o

drivers/bluetooth/btfm_slim_codec.c:27:23: fatal error: btfm_slim.h: No such file or directory

#include <btfm_slim.h>

^

compilation terminated.

scripts/Makefile.build:263: recipe for target 'drivers/bluetooth/btfm_slim_codec.o' failed

make[2]: *** [drivers/bluetooth/btfm_slim_codec.o] Error 1

scripts/Makefile.build:408: recipe for target 'drivers/bluetooth' failed

make[1]: *** [drivers/bluetooth] Error 2

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

CC sound/soc/codecs/audio-ext-clk-up.o

...

CC lib/xz/xz_dec_bcj.o

Makefile:1086: recipe for target 'drivers' failed

make: *** [drivers] Error 2

make: *** Waiting for unfinished jobs....

CC net/ipv6/addrconf.o

...

CC net/ipv6/esp6.o

sound/soc/msm/msm8998.c:36:26: fatal error: device_event.h: No such file or directory

#include <device_event.h>

^

compilation terminated.

scripts/Makefile.build:263: recipe for target 'sound/soc/msm/msm8998.o' failed

make[3]: *** [sound/soc/msm/msm8998.o] Error 1

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

LD sound/soc/qcom/built-in.o

...

CC net/netfilter/nf_conntrack_seqadj.o

scripts/Makefile.build:408: recipe for target 'sound/soc/msm' failed

make[2]: *** [sound/soc/msm] Error 2

scripts/Makefile.build:408: recipe for target 'sound/soc' failed

make[1]: *** [sound/soc] Error 2

Makefile:1086: recipe for target 'sound' failed

make: *** [sound] Error 2

CC net/netfilter/nf_connt

...

LD net/built-in.o

root@gilius-Z370M-DS3H:/home/gilius/Desktop/real#

Any help would be much appreciated! Incidentally, does anyone know of a custom ROM with a KVM already enabled in the kernel, i.e. the presence of /dev/kvm under, say, the Terminal Emulator app?