[One (M9) Original Android Development] l**u:
Great work @Claymore1297, ROM working flawlessly.

I'm trying to compile the kernel myself, got it to compile from the kernel source linked in the post with a few minor changes (might be due to environment setup). But then after flashing it my phone is stuck in a bootloop. Flashing the original boot.img back makes it boot again.

Some environment context:

- Phone is S-ON, OS version 4.20.631, OPJA110 variant

- Kernel compiled on Termux -> ubuntu-in-termux (aarch64), maybe that may be a cause of it not working, was having trouble with the cross-compile environment on x86_64

- gcc version: gcc (Ubuntu 11.3.0-1ubuntu1~22.4) 11.3.0

- make version: GNU Make 4.3 Built for aarch64-unknown-linux-gnu

- using AIK to repack boot.img

- using the provided hima_defconfig, git diff the generated .config and used scripts/extract-ikconfig to make sure both the provided kernel and mine had the same config.

Things I had to change to get it to compile:

- Replace the qcom symlink in kernel/arch/arm64/boot/dts for a copy of what it was symlinked to (kernel/arch/arm/boot/dts/qcom)

- Copy over the kernel/arch/arm64/boot/dts/skeleton64.dtsi file to arm64

- Change the relative include path in drivers/platform/msm/qpnp-power-on.c to a absolute path and added the resolution path

Things I tried:

- Tried to flash the kernel both with Lineage OS 19.1 and AICP 17.1 installed to see if it would make a difference, it did not.

- Tried unpacking/repacking the boot.img packaged with AICP and it still worked after (to rule out AIK breaking it)

- Tried using osm0sis' AnyKernel3 to create a zip

- Tried changing the boot.img in the AICP zip installer for one I packaged with AIK

- Tried wiping cache before/after/both flashing

- After a few tries, it got in a bootloop even when flashing AICP's boot.img, but it was fixed by re-installing AICP.

Inluding logs I was able to find, some probably only apply to booting to bootloader -> recovery but just in case.

/sys/fs/pstore/

console-ramoops

dmesg-ramoops-0

dmesg-ramoops-1

/data/media/0/

dmesg.log

recovery.log

logcat

adb/fastboot

getprop

fastboot getvar all

In some it looks like the error that happens before the kernel panic is located in "smp2p" related files, but can't seem to find a clear reason in the source.

[ 0.912316] c0 0 Process swapper/0 (pid: 1, stack limit = 0xffffffc00fbc0058)
[ 0.912324] c0 0 Context switch saved registers(0xffffffc00fbb8430 to 0xffffffc00fbb8498)
[ 0.912332] c0 0 8420: 0fbbf0c0 ffffffc0 0fbb8000 ffffffc0
[ 0.912341] c0 0 8440: 0fbbf0c0 ffffffc0 0fbc0000 ffffffc0 018af9c0 ffffffc0 01ad9ab8 ffffffc0
[ 0.912351] c0 0 8460: 018af9c0 ffffffc0 018adcc0 ffffffc0 00000000 00000000 018dd6f0 ffffffc0
[ 0.912359] c0 0 8480: 0fbc3960 ffffffc0 0fbc3960 ffffffc0 002051e0 ffffffc0
[ 0.912365] c0 0 Call trace:
[ 0.912374] c0 0 [<ffffffc00063a214>] smp2p_init_header+0x24/0x34
[ 0.912382] c0 0 [<ffffffc00063a9f8>] smp2p_out_create_v0+0x60/0x118
[ 0.912390] c0 0 [<ffffffc00063ac30>] msm_smp2p_out_open+0x180/0x2d8
[ 0.912398] c0 0 [<ffffffc00063c368>] msm_smp2p_init_rmt_lpb.constprop.0+0x68/0x150
[ 0.912409] c0 0 [<ffffffc00162a894>] smp2p_remote_mock_init+0xfc/0x110
[ 0.912419] c0 0 [<ffffffc0016009cc>] do_one_initcall+0x134/0x13c
[ 0.912427] c0 0 [<ffffffc001600be0>] kernel_init_freeable+0x20c/0x210
[ 0.912438] c0 0 [<ffffffc000cc9c00>] kernel_init+0x10/0xc8
[ 0.912446] c0 0 Code: b9000802 2a032023 d2800201 29000c05 (f800c001)
[ 0.912454] c0 0 ---[ end trace 29ddd1b18aed8fa1 ]---
[ 0.916296] c0 0 note: swapper/0[1] exited with preempt_count 1
[ 0.916326] c0 0 Kernel panic - not syncing: Attempted to kill init! exitcode=0x0000000b

Since all the things I had to change could have to do with versions/arch and it's more common to cross-compile from x86_64, the next things I'll try is fixing my environment to try that. Posting in case there is something I'm missing that would explain this.

Also if anyone else has compiled it and can give me an insight to their env that would be helpful, I think this is probably the problem.