Kernel Profiles
About 983 wordsAbout 3 min
A kernel profile carries the kernel parameters GhostLock and GhostKey need. Entry: Settings → Escalation → Kernel profiles.
Two tabs sit at the top:
| Tab | Content |
|---|---|
| GhostLock | Profile selection and application for GhostLock |
| GhostKey | My profiles and built-in list for GhostKey |
The top-right + opens the import sheet with the current tab's target preselected.
GhostLock tab: three-step wizard
Step 1: choose a profile
Two mutually exclusive sub-tabs:
| Sub-tab | Interaction |
|---|---|
| My profiles | Lists imported documents; tapping a row selects it |
| Built-in | A search box filters by release; 30 entries per batch, with "Show more (N left)" at the bottom |
A separate templates group sits at the end of the built-in list. Templates only show field structure and cannot be applied. Rows matching the local kernel are labelled.
The current active source is preselected when the page opens, so the active row and the selection dot agree. A selection is required to continue.
Step 2: confirm the source
Compares the profile's declared kernel with the device kernel:
| Comparison | Message |
|---|---|
| Match | Matches the device kernel; it can run |
| Mismatch | Differs from the device kernel; a run will be rejected |
Step 3: apply
| Result | Message |
|---|---|
| Applied | Active kernel profile switched |
| Declared kernel differs | The selected profile differs from the device kernel and will not take effect |
After success the bottom bar offers Pick another (back to step 1) and Edit parameters (opens the GhostLock profile editor).
GhostKey tab
My profiles
- Tapping the dot on the left sets that document as the active source.
- A release mismatch shows the same "will not take effect" message, and the runtime rejects it.
- The empty state offers an import entry that opens the same sheet as
+.
Built-in
Read-only, with a note that it ships with the app. It has its own filter and batching, and labels rows matching the local kernel.
When neither source is set, the runtime uses the most recently imported document with the same release, then falls back to an exact built-in match.
Import sheet
Target
A segmented control chooses whether to write into GhostLock or GhostKey. Switching clears the current parse result.
Input
| Option | Notes |
|---|---|
| Local image | img / bin / zip or an OTA package |
| Direct OTA URL | HTTP/HTTPS; "skip certificate validation" is available for self-signed links |
The input area also provides a built-in ROM browser (Pixel and realme catalogs) and a "paste example" button.
Importing an existing document
Import existing configuration (conf / hocon / json / txt, multi-select) writes documents directly into the profile table without parsing:
- With multiple files, documents containing
includeare treated as the main document and the rest as dependencies. - Dependencies are written first so the main document's
includeresolves. - Existing files with the same name ask for overwrite confirmation.
- Only the main document counts as an import; dependency documents have an empty release.
Attachments (GhostLock target only)
Used to fill kernel_phys_load; usually unnecessary:
| Attachment | Purpose |
|---|---|
xbl_config.img | Fills the physical base from FDT or the memory map |
uefi.img | Same |
vendor_boot.img | MediaTek only; fills the DRAM base |
Partitions inside an archive or OTA are extracted on demand, and the result card lists which ones were found. The physical load base can also be typed manually.
Advanced parsing
Collapsed by default; changes require re-parsing:
| Option | Notes |
|---|---|
| kallsyms file | Use an external kallsyms text |
| iomem file | Use an external /proc/iomem dump |
| Route | Auto-recommend or force a route |
| Allow missing symbols | Mirrors upstream --allow_missing; missing symbols become 0 |
| Skip disassembly | Faster, lower accuracy |
Parse
Parse kernel produces output without writing anything. A progress indicator runs during parsing; the result card then shows:
| Block | Content |
|---|---|
| State | Parse complete |
kernel_phys_load | The value, or "not found"; a missing value is written as null and falls back by SoC model at runtime |
| Warnings | "N notes", expandable |
| Route geometry | Missing pieces and how to address them |
| Package partitions | Partitions extracted from the archive or OTA |
| Kernel review report | Opens the full review text |
On failure the error text is copyable and the review report entry remains available.
Write
| Target | Behavior |
|---|---|
| GhostLock | Writes the conf as a user document; a same-name document asks to overwrite |
| GhostKey | Reuses the boot file already extracted, avoiding a second full OTA download |
Success reports the generated profile and release, switches the page to the matching tab, and sets the new document as the active source. Extracted images can be exported during the import.
GhostLock profile editor
Entry: GhostLock tab → Apply → Edit parameters. Three tabs:
| Tab | Content |
|---|---|
| General | Basic fields |
| Route | Race-route fields |
| Advanced | Remaining fields; the tab title shows a red dot when any field is invalid |
Bottom actions:
| Action | Notes |
|---|---|
| Save | Overwrites the current user document |
| Save as my profile | Writes a new document, leaving the original untouched |
| Export to file | Writes a local .conf |
GhostKey parameter editor
Entry: GhostKey tab → My profiles → tap a row. Fields are split into a basic section and a collapsible advanced section.
| Item | Notes |
|---|---|
| Input format | 0x hexadecimal or decimal; 64-bit addresses are shown unsigned |
release | Exact uname -r match key; editing it makes the profile stop matching |
| Save | Overwrites the current user document |
| Save as | Writes a new document, leaving the original untouched |
| Export | Writes a local .conf |
An unapplied document cannot be edited: the editor states that parameters can only be edited after the profile takes effect. Before committing, empty values and bad formats are rejected with the offending field paths listed; with no changes at all the app reports that nothing changed.
About BTF
Some fields are derived from kernel BTF debug information. Third-party ROMs or older devices may not expose it, so parsing leaves fields empty or emits warnings. When required fields are missing, the first escalation stage rejects the profile rather than running with an incomplete route.