1

I am tring to compile the kernel source provided by the manufacture of my phone(OPPO PCCM00 precisely). Since it's not "well-opensourced", I changed quite a lot to make sure the kernel would compile without any errors. However when I tried to boot the device after fastboot flash boot boot.img, the device only comes to fastboot. I tried pull the dmesg out with TWRP developed by another owner and it goes like this.

<6>[    0.000000]  (0)[0:swapper]Booting Linux on physical CPU 0x0
<5>[    0.000000]  (0)[0:swapper]Linux version 4.14.117-perf+ (root@cp-ubuntu-123-78) (clang version 8.0.12 for Android NDK) #2 SMP PREEMPT Thu Mar 5 03:47:08 CST 2020
<6>[    0.000000]  (0)[0:swapper]Boot CPU: AArch64 Processor [51df805e]
<6>[    0.000000]  (0)[0:swapper]Machine: Qualcomm Technologies, Inc. SM8150 V2 PM8150 MTP
<6>[    0.000000]  (0)[0:swapper]earlycon: msm_geni_serial0 at MMIO 0x0000000000a90000 (options '')
<6>[    0.000000]  (0)[0:swapper]bootconsole [msm_geni_serial0] enabled
<3>[    0.000000]  (0)[0:swapper]OF: reserved mem: OVERLAP DETECTED!
<3>[    0.000000] disp_rdump_region (0x000000009c000000--0x000000009e400000) overlaps with cont_splash_region (0x000000009c000000--0x000000009e400000)
<6>[    0.000000]  (0)[0:swapper]Reserved memory: created CMA memory pool at 0x00000000ff400000, size 8 MiB
<6>[    0.000000]  (0)[0:swapper]OF: reserved mem: initialized node sp_region, compatible id shared-dma-pool
<6>[    0.000000]  (0)[0:swapper]Reserved memory: created CMA memory pool at 0x00000000fe400000, size 16 MiB
<6>[    0.000000]  (0)[0:swapper]OF: reserved mem: initialized node user_contig_region, compatible id shared-dma-pool
<6>[    0.000000]  (0)[0:swapper]Reserved memory: created CMA memory pool at 0x000000027dc00000, size 36 MiB
<6>[    0.000000]  (0)[0:swapper]OF: reserved mem: initialized node mem_dump_region, compatible id shared-dma-pool
<6>[    0.000000]  (0)[0:swapper]Reserved memory: created CMA memory pool at 0x00000000fbc00000, size 40 MiB
<6>[    0.000000]  (0)[0:swapper]OF: reserved mem: initialized node linux,cma, compatible id shared-dma-pool
<6>[    0.000000]  (0)[0:swapper]Reserved memory: created CMA memory pool at 0x00000000f6000000, size 92 MiB
<6>[    0.000000]  (0)[0:swapper]OF: reserved mem: initialized node secure_display_region, compatible id shared-dma-pool
<6>[    0.000000]  (0)[0:swapper]Reserved memory: created CMA memory pool at 0x00000000f5000000, size 16 MiB
<6>[    0.000000]  (0)[0:swapper]OF: reserved mem: initialized node qseecom_ta_region, compatible id shared-dma-pool
<6>[    0.000000]  (0)[0:swapper]Reserved memory: created CMA memory pool at 0x00000000f4000000, size 16 MiB
<6>[    0.000000]  (0)[0:swapper]OF: reserved mem: initialized node adsp_region, compatible id shared-dma-pool
<6>[    0.000000]  (0)[0:swapper]Reserved memory: created CMA memory pool at 0x00000000f3c00000, size 4 MiB
<6>[    0.000000]  (0)[0:swapper]OF: reserved mem: initialized node cdsp_region, compatible id shared-dma-pool
<6>[    0.000000]  (0)[0:swapper]Removed memory: created DMA memory pool at 0x000000008b700000, size 5 MiB
<6>[    0.000000]  (0)[0:swapper]OF: reserved mem: initialized node camera_region, compatible id removed-dma-pool
<6>[    0.000000]  (0)[0:swapper]Removed memory: created DMA memory pool at 0x000000008bc00000, size 1 MiB
<6>[    0.000000]  (0)[0:swapper]OF: reserved mem: initialized node pil_wlan_fw_region, compatible id removed-dma-pool
<6>[    0.000000]  (0)[0:swapper]Removed memory: created DMA memory pool at 0x000000008bd80000, size 0 MiB
<6>[    0.000000]  (0)[0:swapper]OF: reserved mem: initialized node pil_npu_region, compatible id removed-dma-pool
<6>[    0.000000]  (0)[0:swapper]Removed memory: created DMA memory pool at 0x000000008be00000, size 30 MiB
<6>[    0.000000]  (0)[0:swapper]OF: reserved mem: initialized node pil_adsp_region, compatible id removed-dma-pool
<6>[    0.000000]  (0)[0:swapper]Removed memory: created DMA memory pool at 0x000000008dc00000, size 160 MiB
<6>[    0.000000]  (0)[0:swapper]OF: reserved mem: initialized node modem_region, compatible id removed-dma-pool
<6>[    0.000000]  (0)[0:swapper]Removed memory: created DMA memory pool at 0x0000000097c00000, size 5 MiB
<6>[    0.000000]  (0)[0:swapper]OF: reserved mem: initialized node pil_video_region, compatible id removed-dma-pool
<6>[    0.000000]  (0)[0:swapper]Removed memory: created DMA memory pool at 0x0000000098100000, size 20 MiB
<6>[    0.000000]  (0)[0:swapper]OF: reserved mem: initialized node pil_slpi_region, compatible id removed-dma-pool
<6>[    0.000000]  (0)[0:swapper]Removed memory: created DMA memory pool at 0x0000000099500000, size 0 MiB
<6>[    0.000000]  (0)[0:swapper]OF: reserved mem: initialized node pil_ipa_fw_region, compatible id removed-dma-pool
<6>[    0.000000]  (0)[0:swapper]Removed memory: created DMA memory pool at 0x0000000099510000, size 0 MiB
<6>[    0.000000]  (0)[0:swapper]OF: reserved mem: initialized node pil_ipa_gsi_region, compatible id removed-dma-pool
<6>[    0.000000]  (0)[0:swapper]Removed memory: created DMA memory pool at 0x0000000099515000, size 0 MiB
<6>[    0.000000]  (0)[0:swapper]OF: reserved mem: initialized node pil_gpu_region, compatible id removed-dma-pool
<6>[    0.000000]  (0)[0:swapper]Removed memory: created DMA memory pool at 0x0000000099600000, size 1 MiB
<6>[    0.000000]  (0)[0:swapper]OF: reserved mem: initialized node pil_spss_region, compatible id removed-dma-pool
<6>[    0.000000]  (0)[0:swapper]Removed memory: created DMA memory pool at 0x0000000099700000, size 20 MiB
<6>[    0.000000]  (0)[0:swapper]OF: reserved mem: initialized node cdsp_regions, compatible id removed-dma-pool
<6>[    0.000000]  (0)[0:swapper]Reserved memory: created DMA memory pool at 0x000000009e400000, size 20 MiB
<6>[    0.000000]  (0)[0:swapper]OF: reserved mem: initialized node qseecom_region, compatible id shared-dma-pool
<6>[    0.000000]  (0)[0:swapper]Removed memory: created DMA memory pool at 0x00000000a4c00000, size 12 MiB
<6>[    0.000000]  (0)[0:swapper]OF: reserved mem: initialized node cdsp_sec_regions, compatible id removed-dma-pool

I couldn't find any thing useful because it looks so much like the prebuilt kernel extracted from stock firmware, there is no kernel panic and I found and the timestamp in the second line does not seem to be right. My wild guess is that I am not debugging it in the right way, the actual log for my compiled kernel is flushed when it boots to recovery or the system.

So is there any advice for me the to debug the kernel without booting to other environment? I really apperciate your help. the kernel source can be found here

6
  • you can't debug because it is not booting. what you flashed just brings phone to dead, there is no log. TWRP has it's own kernel and dmesg is of no use at all – alecxs Jan 15 at 7:34
  • @alecxs Linux kernel has some options to log not only to the console. Surely it can log into an rs232 port. Maybe it can log even to the network. I don't know, how do they work. Possibly also other options exist. I don't know the details. In the case of the Android, I think it should log into a raw partition which could be later analyzed by twrp. I also do not know if it is possible, but if not, probably it does not need a very complex patch. – peterh Jan 15 at 7:57
  • @peterh-ReinstateMonica if you flash garbage to boot partition then there is no kernel and no log – alecxs Jan 15 at 8:03
  • @alecxs Op can boot twrp, so booting should work. – peterh Jan 15 at 10:40
  • @peterh-ReinstateMonica how is the relation between boot and recovery here? at least on non- system-as-root devices they are completely independent, and it makes absolutely sence because recovery is a separate fallback OS in case boot is broken – alecxs Jan 15 at 10:43