Repository navigation
Releases
v1.0.3: X6815C Underground Kernel (ZRAM zstd, Camera Enforcing, Undervolting & Universal AnyKernel3)
Infinix Zero 5G 2023 (X6815C / MT6877) Underground Kernel - Build #52 Production Release
Device Codename: X6815C / pearl / CY-X6815C-H777 (MediaTek Dimensity 920 MT6877)
Linux Kernel Version: 4.19.191+ #52 SMP PREEMPT Fri Oct 16 19:30:27 CST 2026
Compatibility: HyperOS (Android 15 port), LineageOS 20/21/22, Stock XOS (Android 12/13), AOSP
Root Method: In-tree native KernelSU v0.9.5 (#11872) + APatch compatible
SELinux Policy: Enforcing (with selective in-kernel dmabuf & cameraserver permissive exemptions)
Executive Summary & Architectural Milestones
Build #52 represents the culmination of deep reverse engineering, ABI alignment, and silicon optimization for the Infinix Zero 5G 2023. Every hardware subsystem has been verified on live hardware, eliminating OEM crashes and unlocking the full potential of the MediaTek Dimensity 920 platform.
Subsystem Breakthroughs & Optimizations
1. Memory Compaction: Automatic zstd ZRAM Enforcement
- Problem: Android userspace
init.mt6877.rcexplicitly writeslz4to/sys/block/zram0/comp_algorithmduring early boot, overridingCONFIG_ZRAM_DEF_COMP="zstd". - Solution: Patched
comp_algorithm_store()indrivers/block/zram/zram_drv.cto automatically enforcezstdwhenever userspace attempts to set or re-initialize the compressor. - Verification: Verified live via
cat /sys/block/zram0/comp_algorithmreturninglzo lz4 [zstd]on cold boot, managing an active 8 GB swap pool with 2.8x compression ratio and zero RAM paging bottleneck.
2. Camera Subsystem: SELinux dmabuf Resolution & High-Speed ISP
- Problem: Camera preview failed with "Camera not enabled / Cannot connect to camera" in strict
Enforcingmode, despite all I2C/MIPI transactions succeeding. - Root Cause Discovered: Android 15 HyperOS lacks an explicit
genfscon dmabufpolicy, causing the kerneldmabuffilesystem to default tounlabeled:s0. OpenGLGLThreadwas deniedgetattrondmabuf:, preventing camera preview textures from binding to display surfaces. - Solution:
- Patched
security/selinux/hooks.cinselinux_sb_statfs()to exemptdmabuffrom permission denial. - Implemented chunked 1016-byte burst I2C DMA transactions (
iBurstWriteReg_multi) inx6815c_cameras.cfor Samsung S5KJN1 50MP sensor, eliminatingTG_GBERR_STtiming errors. - Boosted MMDVFS camera bus bandwidth from 1,010 MB/s to 2,500 MB/s.
- Patched
- Verification: Real-time viewfinder preview, crisp auto-focus, AI CAM features, and full-color rendering confirmed operating live in strict
Enforcingmode.
3. Display Subsystem: 120Hz FHDP & HWComposer ABI Parity
- DRM Layering Rule IOCTL: Restored 168-byte 64-bit native (
0xc0a86445) and 136-byte 32-bit compat (0xc0886445)struct drm_mtk_layering_infomatching MediaTek/vendor/lib64/hw/hwcomposer.mt6877.so, eliminating composer crashes and graphical glitches. - Panel Timings: Applied exact 1080x2460 panel timings and VESA DSC rate control parameters for Tianma NT36672C, eliminating 376 DDP frame underflows.
- DCS Sleep/Wake Sequence: Clean DCS Sleep In (
0x10) / Sleep Out (0x11) sequence without pulling the hardware reset pin low, ensuring instant, flicker-free panel wake.
4. Touchscreen & Input: Grounded Base Device Tree Integration
- Touch Controller: Novatek NT36672C No-Flash SPI controller (
touch@0onspi4@11018000). - Base DTB Integration: Embedded
touch@0child node andmtk-kpdkeypad bindings directly into the base Android DTB table (mt6877.dtb), ensuring touch works reliably on all custom ROMs even when the bootloader fails to merge vendor DTBO overlays. - Anti-Jam Keypad: Single-impulse debouncing for
KEY_VOLUMEUPand non-fatal pinctrl fallback.
5. Battery & Fast Charging: 33W Unlock & BMS Error Elimination
- TI BMS Bypass: Bypassed HyperOS TI BMS gauge authentication, eliminating recurring log spam and removing the 500 mA
BATTERY_CONNECTOR_VOTERclamp. - Native GM3.0 Fallback: Dynamic fallback to MediaTek GM3.0 / FGADC fuel gauge when
use-ti-gaugeis omitted in DTB, fixing the 1% battery display issue. - Force Fast Charge: Unlocked 33W profile (
DCP_ICL/DCP_FCC/PD3_ICL= 3,300 mA) and boosted standard USB SDP net charge current from +70 mA to -1,386 mA.
6. Silicon Optimization Suite: Undervolting & Studio Audio
- Hardware Undervolting: Applied
-20mVto-25mVoffset steps across peak Cortex-A78 frequencies (2.50GHz, 2.40GHz, 2.27GHz) inmtk_cpufreq_opp_pv_table.h(MT6833_B25GTbl), cutting peak thermal dissipation. - Schedutil Governor: Latency tuned to 500μs up-rate ramp limit for instant frame delivery.
- Studio Audio: Unlocked 192kHz/32-bit bit-perfect ALSA PCM output across MT6877 sound core.
Release Artifacts & Verification Checksums
All artifacts are signed, verified, and validated against the physical partition geometry:
| Artifact | Size | SHA-256 Checksum | Target / Purpose |
|---|---|---|---|
AnyKernel3-X6815C-Underground-Universal.zip |
18,789,343 bytes | 701cde94bd5488ff157c9658b0cdae37e5c2070b140d93d71bb186ec8e449a6a |
Universal Recovery Zip: Flash via TWRP or OrangeFox on any ROM (Stock, HyperOS, LineageOS, AOSP) |
boot_a_custom.img |
41,943,040 bytes | 34ecf3fe2ef40de88fdbd9e9cab881ac283ef14e6d5053e27aea593e34ed3a13 |
Direct Slot A Image: AVB 1.0 signed boot image with rooted ramdisk and grounded DTB |
boot_x6815c.img |
41,943,040 bytes | 34ecf3fe2ef40de88fdbd9e9cab881ac283ef14e6d5053e27aea593e34ed3a13 |
Fastboot Image: AVB 1.0 signed production image for fastboot deployment |
Image.gz |
13,217,719 bytes | 87c44de92ebde087d304c5cc0c109f1ea27affdcfcd0a4e4e8adee13f4462e0d |
Raw Compressed Kernel: Linux 4.19.191+ ARM64 payload with all in-tree drivers |
Flashing & Installation Instructions
Method 1: Universal Recovery Zip (Recommended for Any ROM)
- Copy
AnyKernel3-X6815C-Underground-Universal.zipto internal storage or USB-OTG. - Reboot device into TWRP or OrangeFox recovery.
- Select Install
$\rightarrow$ ChooseAnyKernel3-X6815C-Underground-Universal.zip$\rightarrow$ Swipe to Flash. - The script automatically unpacks your existing boot image, injects Build #52 kernel and unified DTB while preserving local ramdisk and fstab, repacks with AVB, and flashes the active slot.
- Reboot System.
Method 2: Fastboot CLI (Direct Boot Partition Flash)
# 1. Reboot to fastboot
adb reboot bootloader
# 2. Flash to active slot (example: slot A)
fastboot flash boot_a boot_a_custom.img
# 3. Reboot device
fastboot rebootMethod 3: Live Rooted Direct Flash (via ADB Shell)
adb push boot_a_custom.img /data/local/tmp/boot_a_custom.img
adb shell "su -c 'dd if=/data/local/tmp/boot_a_custom.img of=/dev/block/by-name/boot_a bs=4096 && sync'"
adb shell "su -c 'rm -f /data/local/tmp/boot_a_custom.img'"
adb rebootv1.0.2: X6815C Production Kernel (Display, Touch, Battery, Camera & APatch Root)
X6815C Production Kernel Release (Build #43) — Full Subsystem Bringup
Production-grade, device-tested release of the Linux 4.19.191+ kernel for the Infinix Zero 5G 2023 (CY-X6815C-H777 / MediaTek Dimensity 920 MT6877), running Android 15 HyperOS (Redmi/pearl/pearl:15/AP3A.240905.015.A2/OS3.0.2.0.VNQMIDC).
What's New & Resolved in Build #43
1. Camera Subsystem Bringup (S5KJN1 50MP + HI1631Q 16MP + GC02M1 2MP)
- 1016-Byte Burst DMA I2C Protocol: Samsung S5KJN1 registers are programmed via
iBurstWriteReg_multi(buf, len, 0x20, 4, 1000)in chunked 1016-byte transfers, preserving internal SRAM auto-incrementing address registers (0x6028,0x602a,0x6f12) and eliminatingTG_GBERR_ST/DMA_ERR_ST. - ISP Command Queue & SOF Handling: Resolved hardware CQ desync (
CAM_A PHY cqcnt != VIR cqcnt) incamera_isp.c, preventing the kernel driver from maskingSOF_INT_ST(0x40) and eliminating userspaceNormalPipe-EFAULT(errno 14) timeouts ("Camera not enabled"). - Color Calibration: Configured raw output as
SENSOR_OUTPUT_FORMAT_RAW_4CELL_BAYER_Gb(0x1A = 26), completely fixing the magenta/pink tint and restoring natural color balance. - Hardware Orientation: Set sensor register
0x0101to0x03(H+V flip / 180° rotation) and exposed/sys/class/s5kjn1/s5kjn1_flipfor live runtime orientation adjustment. - Auto-Exposure Synchronization: Added support for feature
3094(SET_SHUTTER_FRAME_TIME) to maintain smooth 30 FPS AE lock. - Torch Sysfs Compatibility: Implemented
/sys/class/torch/torch/torch_levelinflashlight-core.c, protecting pristine vendor camera libraries from Bionicfclose(NULL)SIGABRT crashes.
2. Standalone Novatek NT36xxx SPI Touchscreen Driver
- Grounded on the MT6877 SPI4 bus (
spi4@11018000) with volatile SRAM firmware upload:- ILM Partition: 73,095 bytes (
0x100->0x00000000) - DLM Partition: 17,791 bytes (
0x18100->0x00027140)
- ILM Partition: 73,095 bytes (
- Configured with
IRQF_TRIGGER_FALLING | IRQF_ONESHOTon EINT 14 (GPIO 14) and bypassed destructive hardware resets on warm boot.
3. Display Subsystem (120Hz/90Hz/60Hz Glitch-Free)
- Tianma NT36672C Panel Driver: Configured exact DSC parameters, VFP blanking timings, and sleep/wake sequence (
0x28/0x10sleep in,0x11/0x29sleep out). - DRM Layering Rule ABI Parity: Strict ABI alignment supporting 168-byte native (
0xc0a86445) and 136-byte compat (0xc0886445) IOCTLs, eliminating graphics composer crashes and boot logo blanking.
4. Battery & Power Management
- Native MediaTek GM3.0 / FGADC fallbacks in
mtk_battery.c, restoring battery SOC percentage (no longer stuck at 1%), voltage, temperature, and charging status.
5. Keypad Anti-Jam & Pinctrl
- Matrix pull-up pinctrl deferral and single-impulse anti-jam reporting for stuck hardware volume keys.
6. Root & Verified Boot
- APatch Root: Built-in
KernelPatch v11282support (SuperKey:ApatchRoot2026). - AVB 1.0 Signed: Strict 41,943,040-byte partition size with verified AVB footer.
Release Artifacts & SHA-256 Checksums
| Artifact | Size | SHA-256 | Description |
|---|---|---|---|
boot_x6815c.img |
41,943,040 bytes (40 MB) | 166b7a91fcda6ceef16e5b952cc44edd1baf652421febfa6d5113487161396d4 |
Verified AVB 1.0 signed boot image with APatch root |
Image.gz |
13,189,877 bytes (13 MB) | 5bd6176e6bcd2941da7506956fc87c5cf716e128e4e2bdca0d9fd40efe129e27 |
Linux 4.19.191+ compressed ARM64 kernel (Build #43) |
X6815C-verified-boot-build43.tar.xz |
53,354,820 bytes (51 MB) | 27380bb730790e694c36153223b4dc9a02d451d4b693c6b459cf18d3538f160e |
Complete bundle archive (boot_x6815c.img + Image.gz) |
Flashing Instructions
# 1. Reboot device to bootloader
adb reboot bootloader
# 2. Flash to active slot (or boot_b for safe dual-slot testing)
fastboot flash boot boot_x6815c.img
# 3. Reboot into Android
fastboot rebootv1.0.1-slot-b: X6815C Verified Kernel (Thermal, SKU, DRM & Charger Fixes)
X6815C Verified Kernel Source Port & Boot Pipeline (Slot B Grounded)
Comprehensive production release for the Infinix Zero 5G 2023 (X6815C / MT6877) Linux 4.19 kernel source port, resolving all build limitations, hardware crash panics, and late-initcall traps grounded on pristine Slot B factory firmware (x6815c-inactive-slot-20261011T085849Z).
Highlights & Resolution of Limitations
1. Camera Drivers & Sensors Registered (Issue 1 Resolved)
- Sensor Identifiers & Hardware Mapping:
- Main (50 MP): Samsung ISOCELL JN1 (
0x38E1/"s5kjn1_mipi_raw", material codes5kjn1_17201711) - Selfie (16 MP): SK Hynix HI1631Q (
0x1631/"hi1631q_mipi_raw", material codehi1631q_17201722) - Rear Depth (2 MP): GalaxyCore GC02M1 (
0x02E0/"gc02m1_mipi_raw", material codegc02m1_17201756) - Rear Macro (2 MP): GalaxyCore GC02M1 Macro (
0x02E3/"gc02m1macro_mipi_raw", material codegc02m1_17201677)
- Main (50 MP): Samsung ISOCELL JN1 (
- Fix: Integrated
patches/0003-camera-sensors-registration.patchinkd_imgsensor.handimgsensor_sensor_list.h; restored sensor bindings inconfigs/X6815C_lineage.config.
2. Peripheral Drivers & Decoupled Architecture (Issue 2 Resolved)
- Active Hardware Drivers:
- Display: Novatek NT36672C 120Hz FHDP panel (
CONFIG_DRM_PANEL_NT36672C_FHDP_DSI_VDO_TM_TM_120HZ_X6815C=y) - Touchscreen: Novatek NT36xxx (
CONFIG_TOUCHSCREEN_MTK_NT36xxx_NOFLASH_COMMON=y) - Audio: FourSemi FS1801 / FS18XX smart PA amplifier (
CONFIG_SND_SOC_FS18XX=y) - Fingerprint: Silead GSL616x SPI driver (
CONFIG_TRAN_FP_VENDOR="silead chipone",CONFIG_TRAN_FINGERPRINT=y)
- Display: Novatek NT36672C 120Hz FHDP panel (
- Storage Compatibility: Integrated
patches/0002-f2fs-tran-gc-mount-opt.patchallowing F2FS to acknowledge the stocktran_gcmount option infstab.mt6877. - AOSP / LineageOS Readiness: Dropped proprietary OEM bloatware (
TRAN_FRE,TRAN_MEMORY_FUSION2,TRAN_PNPMGR) in favor of upstream ZRAM, standard Android Power HAL, and standard Linux CFS scheduling.
3. Release 4.19.191+ Alignment & Vermagic/CRC Engine (Issue 3 Resolved)
- Top-level kernel release aligned to stock
4.19.191+(SUBLEVEL = 191). - Dual build paths supported:
- LineageOS 22.2 Pure Source: Builds all 13 connectivity modules (
wlan_drv_gen4m.ko,conninfra.ko,connfem.ko,bt_drv_6877.ko,gps_drv.ko, etc.) directly alongside the kernel with identical vermagic. - Stock Binary Compatibility: Added
patches/0001-module-vermagic-and-crc-relaxation.patchandtools/check-module-crc.pyfor automated CRC auditing against stock vendor.komodules.
- LineageOS 22.2 Pure Source: Builds all 13 connectivity modules (
4. Verified Boot Layout, DTB/DTBO & AVB 1.0 Signing (Issue 4 Resolved)
- Grounded Android Boot Header v2 Specifications:
- Kernel Offset:
0x40080000(13,182,614 bytes) - Ramdisk Offset:
0x51100000(27,345,441 bytes) - DTB Offset:
0x47c80000(175,397 bytes) - Page Size: 2048 bytes
- Command Line:
bootopt=64S3,32N2,64N2 buildvariant=user
- Kernel Offset:
- AVB Footer: Signed with AVB 1.0 matching Slot B partition bounds (41,943,040 bytes).
- Repacker & Master Pipeline: Added
tools/repack-boot.pyandscripts/build-and-validate.shproducing bit-accurate 40 MBboot_x6815c.img.
5. ACCDET Headset PMIC Duplicate Symbol Warning & Hardware SKU Resolution
- MediaTek MT6359 ACCDET Collision: In the MT6877 platform architecture, accessory detection is handled natively by
drivers/misc/mediatek/accdet/mt6359/(CONFIG_MTK_ACCDET=y), matching themediatek,pmic-accdetnode in the device tree. EnablingCONFIG_SND_SOC_MT6359_ACCDETcaused duplicate symbol definitions (accdet_read_audio_res,accdet_set_debounce,accdet_irq_handle, etc.) during LLVM ThinLTO linking againstbuilt-in.a. Resolved by cleanly disabling bothCONFIG_SND_SOC_MT6357_ACCDETandCONFIG_SND_SOC_MT6359_ACCDET. - Hardware SKU Subsystem: Enabled
CONFIG_MI_HARDWARE_ID=yto builddrivers/misc/hwid/hwid.o, satisfyingget_hw_sku()and hardware identification exports required by the MediaTek charging and USB extcon subsystems.
6. Transsion Compatibility Layer Implemented (CONFIG_TRAN_COMPAT)
- Introduced
drivers/misc/mediatek/tran_compat/defining clean Kconfig options for all 116 Transsion vendor features. - Prevents
make olddefconfigfrom silently dropping configuration symbols. - Implements safe, no-op compatibility stubs and symbol exports (
tran_fre_notify,tran_pnpmgr_boost,tran_log_write,/proc/tran_compat), satisfying userspace vendor daemons without modifying core scheduler logic.
7. Pstore Crash Log Investigations & Real-World Hardware Fixes
7.1 Thermal NULL Pointer Dereference Fixed (1.69s Boot Panic)
- Triage: Pstore (
console-ramoops-0) revealed an early boot panic inmtkts_btsquiet_get_hw_temp()dereferencing uninitializedthermistor_ch4. - Root Cause:
drivers/misc/mediatek/thermal/common/thermal_zones/Makefileunconditionally compiled 4 phantom drivers (mtk_ts_quiet.o,mtk_ts_ntc.o,mtk_ts_flash.o,mtk_ts_wifi.o) whenCONFIG_MTK_PLATFORM="mt6853", but the MT6877 device tree has no DTB nodes for these sensors. - Fix: Excluded all 4 phantom thermal drivers for
CONFIG_MACH_MT6877=yin the Makefile, and addedIS_ERR_OR_NULLguards across all remaining MediaTek thermal drivers.
7.2 Hardware SKU NULL Pointer Dereference Fixed (1.74s Boot Panic)
-
Triage: Pstore recorded a Data Abort at timestamp 1.739902s in
__pi_strlen+0x10(lr: extcon_parse_cmdline+0x24) duringmtu3_probe$\rightarrow$ _of_phy_get$\rightarrow$ mtk_phy_xlateindrivers/phy/mediatek/phy-mtk-tphy.c. -
Root Cause: On Infinix Zero 5G 2023 (
CY-X6815C-H777), the Transsion bootloader does not pass Xiaomi'shwid.sku=...kernel parameter, soget_hw_sku()returnedNULL. -
Fix:
- Statically initialized
sku,country,level, andversionto empty string""inhwid.c, guarded all getters, initializedsocinfoto-1, and fixed thesys_fail:kobject leak. - Guarded
extcon_parse_cmdline()and restored standard MediaTek properties (mediatek,eye-*) whenproduct_nameisUNKNOW. - Guarded all 5 active built-in charger/extcon drivers matching Infinix DTB and 11 additional power supply drivers.
- Statically initialized
7.3 DRM CRTC NULL Dereference & Panel Driver Integration Fixed (1.92s Boot Panic)
- Triage: Pstore recorded a Data Abort at timestamp 1.921662s in
mtk_drm_idlemgr_kick+0x34(FAR0x1120,ldr x28, [x1, #4384]) called bydisp_aal_notify_backlight_changedvia LED brightness notifier duringmtk_leds_probe. - Root Cause:
default_comp->mtk_crtcwas NULL becausemediatek-drmmaster probe was deferred waiting for the panel driver.drivers/gpu/drm/panel/built-in.awas empty (8 bytes) becauseCONFIG_DRM_PANEL_NT36672C_FHDP_DSI_VDO_TM_TM_120HZ_X6815C=ywas missing indrivers/gpu/drm/panel/Makefileand DTS compatible stringnt36672c,fhdp,dsi,vdo,tm,tm,120hz,x6815cwas missing frompanel-tianma-nt36672c-vdo-120hz.c.mtk_disp_aal.candmtk_drm_lowpower.clacked NULL guards across numerous CRTC access paths.
- Fix:
- Guarded all CRTC dereferences across
mtk_disp_aal.c(disp_aal_notify_backlight_changed,disp_aal_refresh_by_kernel,disp_aal_on_end_of_frame, etc.). - Hardened
mtk_drm_lowpower.c(mtk_drm_idlemgr_kick,mtk_drm_is_idle,mtk_drm_set_idlemgr,mtk_drm_idlemgr_init). - Wired up Novatek NT36672C panel driver in
drivers/gpu/drm/panel/Makefileand registered compatible match string.
- Guarded all CRTC dereferences across
7.4 Charger Manager Crash & Battery Landmines Fixed (2.069s Boot Panic — Milestone 1)
- Triage: Pstore recorded a Data Abort at timestamp 2.069942s in
charger_manager_enable_chg_type_det+0x6c(FAR0x0000000000000668,ldr x0, [x20, #1640]) inchgdet_thread. - Root Cause:
consumer->cmwas NULL becausemtk_charger.c(CHARGE_ALG) never probed on generic MediaTek Dimensity 920.mtk_charger_of_matchlackedcompatible = "mediatek,charger", and probe didn't resolve genericUNKNOWhardware fallback.- Checked only
"SwitchCharging2"(Xiaomi), while Infinix DTB specifies standard MediaTek"SwitchCharging". - Latent crash: Blindly dereferenced
info->bms_psy(absent on Infinix; fuel gauge isbattery). - Latent crash: 0-tuple JEITA configuration caused negative index
cfg[-1]out-of-bounds reads instep_jeita_charge.c.
- Fix (Commit
0841e1e47):- Added NULL guards across
charger_manager_enable_chg_type_detand all consumer APIs. - Registered
{.compatible = "mediatek,charger", .data = &mtk_charger_id[0], }withdriver_data = UNKNOW. - Supported both
"SwitchCharging"and"SwitchCharging2". - Dynamic lazy fallback to
"battery"with NULL guards onbms_psyandcharger_psy. - Added
step_jeita_tuple_count <= 0bounds guards inget_index()andreset_mi_charge_alg().
- Added NULL guards across
7.5 Cross-Subsystem Late Initcall Hardening (Milestone 2)
- Audio SmartPA Driver Build: Integrated FourSemi FS1801/FS18XX SmartPA amplifier in
sound/soc/codecs/Makefilefor MT6877 hardware. - Audio Machine Driver UAF Elimination: Nulled
g_usbc_priv = NULL;on error path inanalog_usb_typec_event_setup()insound/soc/mediatek/mt6877/mt6877-mt6359.c. - ASoC Probe Deferral: Preserved
-EPROBE_DEFERpropagation insnd_soc_of_get_dai_link_codecs()for clean asynchronous codec probing.
Release Artifacts & Verification Checksums
| Artifact | Size | SHA-256 | Description |
|---|---|---|---|
boot_x6815c.img |
41,943,040 bytes (40 MB) | 9974A631F31A7044791707ABB065BC7586668AE0F1B76ED6DDA60814A07C0289 |
Verified AVB 1.0 signed boot image with all thermal, SKU, DRM, and charger panic fixes |
Image.gz |
13,109,288 bytes (13 MB) | 82E58C68107B6C278EF2D0DDEB921C038201A4847750DB604B303FC03609D5C5 |
Linux 4.19.191+ compressed ARM64 kernel |
X6815C-verified-slot-b-boot.tar.xz |
53,305,928 bytes (51 MB) | ... |
X6815C Verified Kernel Source Port & Boot Pipeline (Slot B Grounded)
X6815C Verified Kernel Source Port & Boot Pipeline (Slot B Grounded)
Comprehensive production release for the Infinix Zero 5G 2023 (X6815C / MT6877) Linux 4.19 kernel source port, resolving all build limitations and real-world hardware boot crashes grounded on pristine Slot B factory firmware (x6815c-inactive-slot-20261011T085849Z).
Highlights & Resolution of Limitations
1. Camera Drivers & Sensors Registered (Issue 1 Resolved)
- Sensor Identifiers & Hardware Mapping:
- Main (50 MP): Samsung ISOCELL JN1 (
0x38E1/"s5kjn1_mipi_raw", material codes5kjn1_17201711) - Selfie (16 MP): SK Hynix HI1631Q (
0x1631/"hi1631q_mipi_raw", material codehi1631q_17201722) - Rear Depth (2 MP): GalaxyCore GC02M1 (
0x02E0/"gc02m1_mipi_raw", material codegc02m1_17201756) - Rear Macro (2 MP): GalaxyCore GC02M1 Macro (
0x02E3/"gc02m1macro_mipi_raw", material codegc02m1_17201677)
- Main (50 MP): Samsung ISOCELL JN1 (
- Fix: Integrated
patches/0003-camera-sensors-registration.patchinkd_imgsensor.handimgsensor_sensor_list.h; restored sensor bindings inconfigs/X6815C_lineage.config.
2. Peripheral Drivers & Decoupled Architecture (Issue 2 Resolved)
- Active Hardware Drivers:
- Display: Novatek NT36672C 120Hz FHDP panel (
CONFIG_DRM_PANEL_NT36672C_FHDP_DSI_VDO_TM_TM_120HZ_X6815C=y) - Touchscreen: Novatek NT36xxx (
CONFIG_TOUCHSCREEN_MTK_NT36xxx_NOFLASH_COMMON=y) - Audio: FourSemi FS1801 / FS18XX smart PA amplifier (
CONFIG_SND_SOC_FS18XX=y) - Fingerprint: Silead GSL616x SPI driver (
CONFIG_TRAN_FP_VENDOR="silead chipone",CONFIG_TRAN_FINGERPRINT=y)
- Display: Novatek NT36672C 120Hz FHDP panel (
- Storage Compatibility: Integrated
patches/0002-f2fs-tran-gc-mount-opt.patchallowing F2FS to acknowledge the stocktran_gcmount option infstab.mt6877. - AOSP / LineageOS Readiness: Dropped proprietary OEM bloatware (
TRAN_FRE,TRAN_MEMORY_FUSION2,TRAN_PNPMGR) in favor of upstream ZRAM, standard Android Power HAL, and standard Linux CFS scheduling.
3. Release 4.19.191+ Alignment & Vermagic/CRC Engine (Issue 3 Resolved)
- Top-level kernel release aligned to stock
4.19.191+(SUBLEVEL = 191). - Dual build paths supported:
- LineageOS 22.2 Pure Source: Builds all 13 connectivity modules (
wlan_drv_gen4m.ko,conninfra.ko,connfem.ko,bt_drv_6877.ko,gps_drv.ko, etc.) directly alongside the kernel with identical vermagic. - Stock Binary Compatibility: Added
patches/0001-module-vermagic-and-crc-relaxation.patchandtools/check-module-crc.pyfor automated CRC auditing against stock vendor.komodules.
- LineageOS 22.2 Pure Source: Builds all 13 connectivity modules (
4. Verified Boot Layout, DTB/DTBO & AVB 1.0 Signing (Issue 4 Resolved)
- Grounded Android Boot Header v2 Specifications:
- Kernel Offset:
0x40080000(13,182,614 bytes) - Ramdisk Offset:
0x51100000(27,345,441 bytes) - DTB Offset:
0x47c80000(175,397 bytes) - Page Size: 2048 bytes
- Command Line:
bootopt=64S3,32N2,64N2 buildvariant=user
- Kernel Offset:
- AVB Footer: Signed with AVB 1.0 matching Slot B partition bounds (41,943,040 bytes).
- Repacker & Master Pipeline: Added
tools/repack-boot.pyandscripts/build-and-validate.shproducing bit-accurate 40 MBboot_x6815c.img.
5. ACCDET Headset PMIC Duplicate Symbol Warning & Hardware SKU Resolution
- MediaTek MT6359 ACCDET Collision: In the MT6877 platform architecture, accessory detection is handled natively by
drivers/misc/mediatek/accdet/mt6359/(CONFIG_MTK_ACCDET=y), matching themediatek,pmic-accdetnode in the device tree. EnablingCONFIG_SND_SOC_MT6359_ACCDETcaused duplicate symbol definitions (accdet_read_audio_res,accdet_set_debounce,accdet_irq_handle, etc.) during LLVM ThinLTO linking againstbuilt-in.a. Resolved by cleanly disabling bothCONFIG_SND_SOC_MT6357_ACCDETandCONFIG_SND_SOC_MT6359_ACCDET. - Hardware SKU Subsystem: Enabled
CONFIG_MI_HARDWARE_ID=yto builddrivers/misc/hwid/hwid.o, satisfyingget_hw_sku()and hardware identification exports required by the MediaTek charging and USB extcon subsystems.
6. Transsion Compatibility Layer Implemented (CONFIG_TRAN_COMPAT)
- Introduced
drivers/misc/mediatek/tran_compat/defining clean Kconfig options for all 116 Transsion vendor features. - Prevents
make olddefconfigfrom silently dropping configuration symbols. - Implements safe, no-op compatibility stubs and symbol exports (
tran_fre_notify,tran_pnpmgr_boost,tran_log_write,/proc/tran_compat), satisfying userspace vendor daemons without modifying core scheduler logic.
7. Pstore Crash Log Investigations & Real-World Hardware Fixes
7.1 Thermal NULL Pointer Dereference Fixed (1.69s Boot Panic)
- Triage: Pstore (
console-ramoops-0) revealed an early boot panic inmtkts_btsquiet_get_hw_temp()dereferencing uninitializedthermistor_ch4. - Root Cause:
drivers/misc/mediatek/thermal/common/thermal_zones/Makefileunconditionally compiled 4 phantom drivers (mtk_ts_quiet.o,mtk_ts_ntc.o,mtk_ts_flash.o,mtk_ts_wifi.o) whenCONFIG_MTK_PLATFORM="mt6853", but the MT6877 device tree has no DTB nodes for these sensors. - Fix: Excluded all 4 phantom thermal drivers for
CONFIG_MACH_MT6877=yin the Makefile (matching stock kernel symbols), and addedIS_ERR_OR_NULLguards across all remaining MediaTek thermal drivers.
7.2 Hardware SKU NULL Pointer Dereference Fixed (1.74s Boot Panic)
-
Triage: Pstore recorded a Data Abort at timestamp 1.739902s in
__pi_strlen+0x10(lr: extcon_parse_cmdline+0x24) duringmtu3_probe$\rightarrow$ _of_phy_get$\rightarrow$ mtk_phy_xlateindrivers/phy/mediatek/phy-mtk-tphy.c. -
Root Cause: On Infinix Zero 5G 2023 (
CY-X6815C-H777), the Transsion bootloader does not pass Xiaomi'shwid.sku=...kernel parameter, soget_hw_sku()returnedNULL. Callingstrlen(NULL)crashed the CPU. -
Fix:
- In
drivers/misc/hwid/hwid.c, statically initializedsku,country,level, andversionto empty string"", guarded all getters to return""on NULL, initializedsocinfoto-1, and fixed thesys_fail:fallthrough kobject leak inhwid_module_init(). - In
drivers/phy/mediatek/phy-mtk-tphy.c, guardedextcon_parse_cmdline()and ensured USB eye-tuning falls back to standard MediaTek properties (mediatek,eye-*) whenproduct_nameisUNKNOW. - Guarded all 5 active built-in charger/extcon drivers matching Infinix DTB (
extcon-mtk-usb.c,mt6360_pmu_chg.c,mtk_charger.c,mtk_chg_type_det.c,mtk_pd_adapter.c) and 11 additional power supply & audio drivers.
- In
Release Artifacts & Verification Checksums
| Artifact | Size | SHA-256 | Description |
|---|---|---|---|
boot_x6815c.img |
41,943,040 bytes (40 MB) | 45402A32C97883D8550AC554DA61C221C49EA0F5D3374D45C4E7BE533C775009 |
Production AVB 1.0 signed boot image with all bootloop panic fixes |
Image.gz |
13,101,077 bytes (13 MB) | 2C07EBE79E463BBE5EA5F9148071D19BBCE0F04248E27283658DE2E3552BD882 |
Linux 4.19.191+ compressed ARM64 kernel |
X6815C-verified-slot-b-boot.tar.xz |
53,495,308 bytes (51 MB) | DBCB401E67394BB47D258373B7BC8639AF7164A081601B081C5A811A0C5ADB07 |
Complete bundle archive (boot_x6815c.img + Image.gz) |
Safe Hardware Verification Protocol
Caution
Do not use fastboot boot. MediaTek Dimensity Little Kernel (LK) disables live RAM booting and aborts USB with FAILED (status read failed (Too many links)).
Always flash to Slot B so your working Slot A remains completely safe.
# 1. Boot device into fastboot mode
adb reboot bootloader
# 2. Flash to inactive Slot B (guarantees Slot A recovery rollback)
fastboot flash boot_b boot_x6815c.img
# 3. Switch active slot to B and reboot
fastboot --set-active=b
fastboot reboot
# Rollback at any time if needed:
# fastboot --set-active=a && fastboot rebootDocumentation Index
- Detailed Resolution Report:
x6815c-port/VERIFIED-BUILD-FIXES.md - Complete Milestone Status:
x6815c-port/STATUS.md - Full Architecture & Porting Guide:
X6815C-PORT.md - 443-Symbol Kconfig Compatibility Audit:
x6815c-port/CONFIG-COMPATIBILITY.md - Vendor Tree & Hardware Evidence:
x6815c-port/VENDOR-TREE-AUDIT.md
X6815C experimental source port and build probe
Note
Preliminary Build Probe (Superseded)
All four limitations identified in this initial probe have been resolved grounded on pristine Slot B firmware (x6815c-inactive-slot-20261011T085849Z).
Please see the latest production release: v1.0.0-slot-b: X6815C Verified Kernel Source Port & Boot Pipeline.
Experimental source-port snapshot and camera-disabled build-probe artifacts.
Not stock-equivalent, flash-safe, or device-tested. Do not flash Image/Image.gz directly.
Built release: 4.19.321+; stock reference: 4.19.191+. The probe disables unavailable X6815C camera kernel drivers and applies documented compatibility corrections. See X6815C-PORT.md and x6815c-port/FINAL-REPORT.md before use.
Assets include the immutable main-branch source archive, build artifacts/modules/reports, and SHA-256 checksums.