Skip to content

Vendor Module Compatibility

simplehima edited this page Dec 5, 2026 · 1 revision

Why it matters

The A55 is a GKI device. Samsung's drivers ship as about 324 prebuilt kernel modules, built by Samsung against their own kernel:

Location Count Examples
vendor_boot ramdisk 261 tzdev (TEE), display, UFS, PMIC, sensors, camera (fimc_is, pablo_*)
/system_dlkm/lib/modules 60 GKI modules: zram, zsmalloc, Bluetooth, USB gadget
/vendor_dlkm/lib/modules 3 Wi-Fi: scsc_wlan, cfg80211

Thanatos replaces only the kernel Image, so these modules must still load on it. The kernel is built with CONFIG_MODVERSIONS: every exported symbol carries a CRC of its type signature. A module refuses to load if a CRC it was built with differs from the kernel's (disagrees about version of symbol).

If a key module fails, the effects are serious:

  • tzdev fails: no TEE, so data can't be decrypted and the lock screen, keystore and recovery decryption break.
  • Display or UFS modules fail: the phone doesn't boot.

Rules for changes

  • Don't change exported structs or function signatures in core code that vendor modules use (mm, sched, block, fs, net, drm, dma-buf, ...). Fix bugs inside functions; don't change interfaces.
  • Config options that change struct layouts (debug options like KASAN, LOCKDEP, DEBUG_*, changing NR_CPUS, ...) break the KMI. Test them only in a separate build.
  • android/abi_gki_protected_exports_* is deleted in this tree. Samsung's modules are signed with Samsung's key, not with the key of this build. With the list present, the kernel would hide protected symbols from them and they would fail to load.
  • After any change, run thanatos/tools/crcgate.sh (see Building). crc_mismatch must be 0.

How the check works

thanatos/tools/crcgate.sh <out> <module dirs...>:

  1. Reads the kernel's exported symbols and CRCs from out/<variant>/Module.symvers (only those exported by vmlinux).
  2. For each .ko, lists the symbols it imports with their CRCs (modprobe --dump-modversions).
  3. Skips symbols that another module in the set exports (module-to-module dependencies).
  4. Reports a CRC mismatch (CRC sym module want= have=) or a symbol the kernel doesn't export (MISSING).

A MISSING symbol means that module can't load. Check whether it loads on the stock kernel (/proc/modules on stock). If it doesn't load there either, it is fine.

Base tree

Thanatos is based on exynos1480/android_kernel_samsung_a55x (lineage-24.0): Android common kernel 6.1 (android14-6.1) plus Samsung's open source kernel (A556BXXUEDZE4). The protected-exports list is removed. Its history isn't included: the repo starts with one import commit (Import exynos1480/android_kernel_samsung_a55x lineage-24.0 at a12a5903e563), and Thanatos changes come on top of it.

To move to a newer base, import the new tree the same way, then reapply the Thanatos commits on top of it. They are few and small: config fragments, scripts, fixes. Then run the CRC check and the full Testing a Build list.

Clone this wiki locally