Нужна инструкция по снятию логов ядра после прошивки new-boot.img

Open
#138 2 comments 0 reactions 0 assignees View on GitHub

Maintainers usually reply within 4 days

Nobody has claimed this yet.

Assessment

Difficulty
4/5
Estimated time
3-5 days
Newbie friendliness
25/100
Issue type
Documentation
Clarity
Needs clarification
Activity status
Stale
Tech stack
android, linux

Research direction

Start with the supplied kptools and magiskboot output, the flashing steps, and the linked APatch issue. Document a reproducible way to collect kernel logs for this boot failure and explain what information contributors should provide; done means another user can follow the instructions and produce actionable debugging data.

Written by the indexing model from the issue text.

Description

Имею на руках новый аппарат с разблокированным загрузчиком.
mt6878, Android 14, linux 6.1.75

Пробовал 0.10.7, 0.11.1-dev и самый свежак из dev ветки (собирал сам).

Похожая проблема: https://github.com/bmax121/APatch/issues/688

Мои логи (свежак из dev):

> ./kptools -p --image ./kernel.img --skey "*********" --kpimg ./kernel/kpimg --out kernel2.img
[+] kernel image_size: 0x02128a00
[+] kernel uefi header: true
[+] kernel load_offset: 0x00000000
[+] kernel kernel_size: 0x021d0000
[+] kernel page_shift: 12
[+] new kernel image ...
[+] linux_banner 1: Linux version 6.1.75-android14-11-g03016a181dee-ab11856646 (build-user@build-host) (Android (10087095, +pgo, +bolt, +lto, -mlgo, based on r487747c) clang version 17.0.2 (https://android.googlesource.com/toolchain/llvm-project d9f89f4d16663d5012e5c09495f3b30ece3d2362), LLD 17.0.2) #1 SMP PREEMPT Fri May 17 10:24:48 UTC 2024
[+] linux_banner offset: 0xff0108
[+] linux_banner 2: Linux version 6.1.75-android14-11-g03016a181dee-ab11856646 (build-user@build-host) (Android (10087095, +pgo, +bolt, +lto, -mlgo, based on r487747c) clang version 17.0.2 (https://android.googlesource.com/toolchain/llvm-project d9f89f4d16663d5012e5c09495f3b30ece3d2362), LLD 17.0.2) #1 SMP PREEMPT Fri May 17 10:24:48 UTC 2024
[+] linux_banner offset: 0x1263f88
[+] kernel version major: 6, minor: 1, patch: 75
[+] kallsyms_token_table offset: 0x01459160
[+] endian: little
[+] kallsyms_token_index offset: 0x014594e8
[+] arm64 relocation kernel_va: 0xffffffffffffffff
[?] can't find arm64 relocation table
[+] kallsyms_markers range: [0x01410048, 0x0141065c), count: 0x00000184
[+] approximate kallsyms_offsets range: [0x012640d0, 0x012c4f7c) count: 0x000183ab
[+] kallsyms_names offset: 0x012c4f90
[?] can't find kallsyms_num_syms, try: 0x000183a1
[+] names table linux_banner index: 0x0000f6ee
[+] linux_banner index: 1
[+] kallsyms_offsets offset: 0x012640d0
[+] pid_vnr: type: T, offset: 0x000df914
[+] pid_vnr verfied sp_el0, insn: 0xd5384108
[+] layout kimg: 0x0,0x2128a00, kpimg: 0x2129000,0x2c110, extra: 0x2155110,0x80, end: 0x2155190, start: 0x21d0000
[+] kpimg version: b01
[+] kpimg compile time: 07:17:03 Nov  3 2024
[+] kpimg config: android, release
[+] tcp_init_sock: type: T, offset: 0x00e0ef74
[+] map_start: 0xe0ef80, max_size: 0x800
[+] kallsyms_lookup_name: type: T, offset: 0x001a6810
[?] no symbol: printk
[+] _printk: type: T, offset: 0x00fb1394
[+] memblock_reserve: type: T, offset: 0x00337ad4
[+] memblock_free: type: T, offset: 0x003378f0
[+] memblock_mark_nomap: type: T, offset: 0x00337dc8
[+] memblock_phys_alloc_try_nid: type: T, offset: 0x01b4fe78
[?] no symbol: memblock_virt_alloc_try_nid
[+] memblock_alloc_try_nid: type: T, offset: 0x01b50114
[+] panic: type: T, offset: 0x00fb100c
[+] rest_init: type: T, offset: 0x00fba60c
[+] kernel_init: type: t, offset: 0x00fba6f0
[+] report_cfi_failure: type: T, offset: 0x0029357c
[?] no symbol: __cfi_slowpath_diag
[?] no symbol: __cfi_slowpath
[+] copy_process: type: t, offset: 0x000acf28
[+] avc_denied: type: t, offset: 0x005f2700
[+] slow_avc_audit: type: T, offset: 0x005f1520
[+] input_handle_event: type: T, offset: 0x00a4ccf0
[+] superkey: **************
[+] paging_init: type: T, offset: 0x01b3af64
[+] patch done: new-boot.img

C:\android\apatch>magiskboot.exe repack boot.img
Parsing image: [boot.img]
HEADER_VER      [4]
KERNEL_SZ       [16254232]
RAMDISK_SZ      [0]
PAGESIZE        [4096]
CMDLINE         []
KERNEL_FMT      [lz4_legacy]
VBMETA
Repack to image: [new-boot.img]
HEADER_VER      [4]
KERNEL_SZ       [16314049]
RAMDISK_SZ      [0]
PAGESIZE        [4096]
CMDLINE         []

Далее стандартно:

adb reboot bootloader
fastboot flash boot boot.img
fastboot reboot

Результат: девайс не стартует.

Примечание: Если в kernel.img самому изменить 1 байтик (в тексте сообщения) и собрать из него new-boot.img, то после прошивки всё работает. Т.е. проблема не в перепаковке.

И вот теперь хочу вам помочь (даже сам могу в коде что то подправить или добавить доп. дебаг инфу), но вот затрудняюсь со снятием логов ядра.
Подскажите как отлаживать.

Dominant language
C
Stars
1.6k
Forks
401
Avg merge
2d 14h
Merged PRs (30d)
4

Getting set up

This project ships no dev container, Dockerfile or contributing guide, so setting up is up to you: start from its README, and see our first-contribution guide for the general steps.

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from bmax121/KernelPatch

All issues in bmax121/KernelPatch

Similar issues

More C issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.