AxionOS is based on the Android Open Source Project (AOSP) with extra performance and some customization features.
This guide will walk you through downloading the source code, setting up the build environment, and configuring your device tree.
First, initialize the repo:
repo init -u https://github.com/AxionAOSP/android.git -b lineage-23.0 --git-lfsThen sync the source code:
repo syncFollow the LineageOS build guide to install the required packages.
Then configure the build environment:
. build/envsetup.shAxionOS builds on top of LineageOS, so you should start from a LineageOS-compatible device tree.
Add this to your device makefile:
TARGET_DISABLE_EPPE := true
$(call inherit-product, vendor/lineage/config/common_full_phone.mk)Optional flags:
-
Enable blur effects
TARGET_ENABLE_BLUR := true -
Enable ViPER4AndroidFX
TARGET_INCLUDE_VIPERFX := true(Disabled by default. Requires proper drivers and libraries.)
See the ViPER4AndroidFX ReadMe. -
Enable debugging
add in product overrides or set using console: adb shell setprop persist.sys.ax_debug_enabled 1 persist.sys.ax_debug_enabled=1
(Disabled by default. Meant for debugging purposes - bootloop, aidl/hardware dependency by sepolicy failure, etc)
AxionOS supports custom properties for "About phone" and system optimization.
Set these in your device tree:
# Camera information (multiple sensors supported)
AXION_CAMERA_REAR_INFO := 50,48
AXION_CAMERA_FRONT_INFO := 42
# Maintainer name (underscores become spaces in the UI)
AXION_MAINTAINER := rmp_22
# Processor name (underscores become spaces)
AXION_PROCESSOR := Snapdragon_CPU_1These are automatically exported to system properties at build time.
AxionOS added properties and flags to tune the OS for device experience. You can enable or disable them in your device makefile:
# Charging
BYPASS_CHARGE_SUPPORTED ?= false
# CPU governor support
PERF_GOV_SUPPORTED := false
PERF_DEFAULT_GOV := schedutil
PERF_ANIM_OVERRIDE := false
# GPU
GPU_FREQS_PATH := /sys/devices/platform/28000000.mali/available_frequencies
GPU_MIN_FREQ_PATH := /sys/devices/platform/28000000.mali/hint_min_freq
# High Brightness Mode (HBM)
HBM_SUPPORTED := false
HBM_NODE := /sys/class/backlight/panel0-backlight/hbm_mode
# Flashlight strength
TORCH_STR_SUPPORTED := false
# doze fix
# for devices with doze/sensor related issues
TARGET_NEEDS_DOZE_FIX := false
# [experimental] userspace simple lmk trial version
# of https://github.com/kerneltoast/android_kernel_google_gs201/blob/16.0.0-sultan/drivers/android/simple_lmk.c ©kerneltoast
# Targets devices with prebuilt kernels or uslmk support across kernels
TARGET_USES_USLMK := false
# do not enable TARGET_IS_LOW_RAM if your device ram is greater than 4gb
# else OOM will most likely occur on operations where applications and camera can fill heap limit
# e.g uploading video/media on apps with camera preview
# this is a mitigation targets legacy devices 4gb below
# Using quicken is a trade-off: here we trade clean pages for dirty pages,
# extra cpu and battery. That's because the quicken files will be jit-ed in all
# the processes that load of shared apk and the code cache is not shared.
# Some notable apps that will be affected by this are gms and chrome.
TARGET_IS_LOW_RAM ?= false-
Bypass Charging: Allows charging while keeping the battery percentage fixed.
If supported, you must also add a SELinux rule for theinput_suspendnode. -
Governor Support: Allows switching CPU governors if supported by your kernel.
-
High Brightness Mode (HBM): Enable if your panel supports a high brightness toggle.
-
Flashlight strength: Enable if torch supports strength changes.
ScrollOptimizer is an AxionOS feature that optimizes frame pacing and buffer handling during UI scroll and fling operations. It improves touch responsiveness and reduces rendering latency, ported from Linaro’s proprietary implementation.
# Enable or disable ScrollOptimizer globally
persist.sys.perf.scroll_opt = true
# Heavy app handling mode
# 0 - Disable heavy app classification
# 1 - Enable dynamic detection (based on frame duration and buffer load)
# 2 - Treat all apps as heavy for performance
persist.sys.perf.scroll_opt.heavy_app = 2Source: ScrollOptimizer.java
Some devices need SELinux adjustments to allow AxionOS performance tuning.
- If your device uses standard labels, add rules like this to your device tree:
genfscon proc /sys/vm/dirty_writeback_centisecs u:object_r:proc_dirty:s0
genfscon proc /sys/vm/vfs_cache_pressure u:object_r:proc_drop_caches:s0
genfscon proc /sys/vm/dirty_ratio u:object_r:proc_dirty:s0
genfscon proc /sys/kernel/sched_migration_cost_ns u:object_r:proc_sched:s0
- To allow boost framework to access your device gpu nodes, add genfs context for your node and label it as
sysfs_gpu
genfscon sysfs /devices/platform/1c500000.mali/available_frequencies u:object_r:sysfs_gpu:s0
genfscon sysfs /devices/platform/1c500000.mali/hint_min_freq u:object_r:sysfs_gpu:s0
- If your device uses different OEM labels (common on MediaTek or Qualcomm), add
allowrules instead of relabeling.
allow init proc_vm_dirty:file rw_file_perms;
allow init proc_dirty_ratio:file rw_file_perms;You can choose whether to include LineageOS prebuilt apps.
Default is disabled.
TARGET_INCLUDES_LOS_PREBUILTS := true/falseRun once before building:
gk -sTo configure your device build:
axion <device_codename> [variant]Variants:
gms core→ Core Google Mobile Services (default if no variant given)gms pico→ Minimal Google appsva→ Vanilla (no GMS)
Example:
axion panther gms picoTo update your source after the first sync:
axionSyncFinally, compile:
ax -br -j<count>Replace <count> with the number of CPU threads you want to use (e.g. ax -j16).
AxionOS is based on the work of the Android Open Source Project (AOSP) and LineageOS.
Thanks to all contributors for their hard work.