|
1 | 1 | # DerpFest 13 — Xiaomi Redmi 4X (santoni) |
2 | 2 |
|
3 | | -Device tree for building [DerpFest](https://github.com/DerpFest-AOSP) Android 13 for Xiaomi Redmi 4X (santoni). |
| 3 | +Unofficial DerpFest Android 13 for Xiaomi Redmi 4X (santoni). |
4 | 4 |
|
5 | | -## Repositories |
| 5 | +Maintained by [ziachi](https://github.com/ziachi). |
6 | 6 |
|
7 | | -| Component | Repository | Branch | |
8 | | -|:----------|:-----------|:-------| |
9 | | -| **Device Tree** | [ziachi/device_xiaomi_santoni_derpfest](https://github.com/ziachi/device_xiaomi_santoni_derpfest) | `derp-13-dev` | |
10 | | -| **Kernel** | [ziachi/kernel_xiaomi_msm8937_derpfest](https://github.com/ziachi/kernel_xiaomi_msm8937_derpfest) | `derp-13-dev` | |
11 | | -| **Vendor** | [ziachi/vendor_xiaomi_santoni_derpfest](https://github.com/ziachi/vendor_xiaomi_santoni_derpfest) | `derp-13-dev` | |
12 | | -| **Frameworks Base** | [ziachi/frameworks_base_derpfest](https://github.com/ziachi/frameworks_base_derpfest/tree/derp-13-dev) | `derp-13-dev` | |
| 7 | +## Repository Map |
13 | 8 |
|
14 | | -## Build Notes |
| 9 | +This build requires DerpFest source + 7 custom repos. All patches are committed to forks — no manual/local patches needed. |
15 | 10 |
|
16 | | -- **Vanilla build** — no GApps included (3GB system partition too small) |
17 | | -- Flash GApps (Pico/Nano/Full) separately via recovery after installing ROM |
18 | | -- Uses AOSP clang `r450784d` for kernel compilation |
19 | | -- SELinux: **Enforcing** |
20 | | -- **Spectrum kernel profiles** — Balance, Performance, Battery, Gaming (QS tile) |
21 | | -- **Setup Wizard** — set to OPTIONAL (auto-provisions when no Setup Wizard present) |
22 | | -- **LiveDisplay** — disabled (MSM8937 has no SDM HAL support) |
| 11 | +| # | Component | Repository | Branch | Path in source tree | |
| 12 | +|:-:|:----------|:-----------|:-------|:--------------------| |
| 13 | +| 1 | **Device Tree** | [ziachi/device_xiaomi_santoni_derpfest](https://github.com/ziachi/device_xiaomi_santoni_derpfest) | `derp-13-dev` | `device/xiaomi/santoni` | |
| 14 | +| 2 | **Kernel** | [ziachi/kernel_xiaomi_msm8937_derpfest](https://github.com/ziachi/kernel_xiaomi_msm8937_derpfest) | `derp-13-dev` | `kernel/xiaomi/msm8937` | |
| 15 | +| 3 | **Vendor (device)** | [ziachi/vendor_xiaomi_santoni_derpfest](https://github.com/ziachi/vendor_xiaomi_santoni_derpfest) | `derp-13-dev` | `vendor/xiaomi/santoni` | |
| 16 | +| 4 | **Frameworks Base** | [ziachi/frameworks_base_derpfest](https://github.com/ziachi/frameworks_base_derpfest) | `derp-13-dev` | `frameworks/base` | |
| 17 | +| 5 | **Settings** | [ziachi/packages_apps_Settings_derpfest](https://github.com/ziachi/packages_apps_Settings_derpfest) | `derp-13-dev` | `packages/apps/Settings` | |
| 18 | +| 6 | **Vendor (DerpFest)** | [ziachi/vendor_derp_derpfest](https://github.com/ziachi/vendor_derp_derpfest) | `derp-13-dev` | `vendor/derp` | |
| 19 | +| 7 | **Calendar** | [ziachi/packages_apps_Calendar_derpfest](https://github.com/ziachi/packages_apps_Calendar_derpfest) | `derp-13-dev` | `packages/apps/Calendar` | |
23 | 20 |
|
24 | | -## Spec Sheet |
| 21 | +## Build Guide |
| 22 | + |
| 23 | +### Prerequisites |
25 | 24 |
|
26 | | -| Feature | Specification | |
27 | | -| :---------------------- | :-------------------------------- | |
28 | | -| CPU | Octa-core 1.4 GHz Cortex-A53 | |
29 | | -| Chipset | Qualcomm MSM8940 Snapdragon 435 | |
30 | | -| GPU | Adreno 505 | |
31 | | -| Memory | 2/3 GB | |
32 | | -| Shipped Android Version | 6.0.1 | |
33 | | -| Storage | 16/32 GB | |
34 | | -| MicroSD | Up to 256 GB | |
35 | | -| Battery | 4100 mAh (non-removable) | |
36 | | -| Dimensions | 139 x 69 x 8.65 mm | |
37 | | -| Display | 720 x 1280 pixels, 5" (~294 PPI) | |
38 | | -| Rear Camera | 13 MP, LED flash | |
39 | | -| Front Camera | 5 MP | |
40 | | -| Release Date | May 2017 | |
41 | | - |
42 | | -## Setup Guide |
43 | | - |
44 | | -### 1. Initialize DerpFest manifest |
| 25 | +- Ubuntu 22.04 (or WSL2) |
| 26 | +- 200+ GB free disk space |
| 27 | +- 16+ GB RAM (32 GB recommended) |
| 28 | +- Fast internet for repo sync (~100 GB download) |
| 29 | + |
| 30 | +### Step 1 — Initialize DerpFest source |
45 | 31 |
|
46 | 32 | ```bash |
| 33 | +mkdir derpfest && cd derpfest |
47 | 34 | repo init -u https://github.com/DerpFest-AOSP/manifest.git -b 13 --git-lfs |
48 | 35 | repo sync -c -j$(nproc --all) --force-sync --no-clone-bundle --no-tags |
49 | 36 | ``` |
50 | 37 |
|
51 | | -### 2. Clone device repos |
| 38 | +### Step 2 — Replace upstream repos with forks |
52 | 39 |
|
53 | 40 | ```bash |
54 | | -# Device tree |
| 41 | +# Remove upstream repos that we replace |
| 42 | +rm -rf device/xiaomi/santoni kernel/xiaomi/msm8937 vendor/xiaomi/santoni \ |
| 43 | + frameworks/base packages/apps/Settings vendor/derp packages/apps/Calendar |
| 44 | + |
| 45 | +# Clone all custom repos |
55 | 46 | git clone -b derp-13-dev https://github.com/ziachi/device_xiaomi_santoni_derpfest.git \ |
56 | 47 | device/xiaomi/santoni |
57 | 48 |
|
58 | | -# Kernel |
59 | 49 | git clone -b derp-13-dev https://github.com/ziachi/kernel_xiaomi_msm8937_derpfest.git \ |
60 | 50 | kernel/xiaomi/msm8937 |
61 | 51 |
|
62 | | -# Vendor |
63 | 52 | git clone -b derp-13-dev https://github.com/ziachi/vendor_xiaomi_santoni_derpfest.git \ |
64 | 53 | vendor/xiaomi/santoni |
| 54 | + |
| 55 | +git clone -b derp-13-dev https://github.com/ziachi/frameworks_base_derpfest.git \ |
| 56 | + frameworks/base |
| 57 | + |
| 58 | +git clone -b derp-13-dev https://github.com/ziachi/packages_apps_Settings_derpfest.git \ |
| 59 | + packages/apps/Settings |
| 60 | + |
| 61 | +git clone -b derp-13-dev https://github.com/ziachi/vendor_derp_derpfest.git \ |
| 62 | + vendor/derp |
| 63 | + |
| 64 | +git clone -b derp-13-dev https://github.com/ziachi/packages_apps_Calendar_derpfest.git \ |
| 65 | + packages/apps/Calendar |
65 | 66 | ``` |
66 | 67 |
|
67 | | -### 3. Build |
| 68 | +### Step 3 — Fix linker symlink |
| 69 | + |
| 70 | +```bash |
| 71 | +ln -sf $(pwd)/prebuilts/clang/host/linux-x86/clang-r450784d/bin/ld.lld \ |
| 72 | + prebuilts/build-tools/path/linux-x86/ld |
| 73 | +``` |
| 74 | + |
| 75 | +> This is a build environment fix — `ld` is missing from AOSP build-tools for kernel compilation. |
| 76 | +
|
| 77 | +### Step 4 — Build |
68 | 78 |
|
69 | 79 | ```bash |
70 | 80 | source build/envsetup.sh |
71 | 81 | lunch derp_santoni-userdebug |
72 | | -mka derp |
| 82 | +mka derp -j$(nproc) |
73 | 83 | ``` |
74 | 84 |
|
75 | | -> **Note:** This is a vanilla build. Flash GApps package after installing the ROM ZIP. |
| 85 | +Build output: `out/target/product/santoni/DerpFest-13-Unofficial-Tango-santoni-*.zip` |
| 86 | + |
| 87 | +### Step 5 — Flash |
76 | 88 |
|
77 | | -## Device Picture |
| 89 | +1. Boot into custom recovery (TWRP / OrangeFox) |
| 90 | +2. Wipe System, Data, Cache, Dalvik |
| 91 | +3. Flash `DerpFest-13-Unofficial-*.zip` |
| 92 | +4. (Optional) Flash GApps ZIP — Pico/Nano recommended (system partition is 3 GB) |
| 93 | +5. Reboot |
| 94 | + |
| 95 | +## Build Notes |
| 96 | + |
| 97 | +- **Vanilla build** — no GApps included (3 GB system partition too small for built-in GApps) |
| 98 | +- Uses AOSP clang `r450784d` for kernel compilation |
| 99 | +- SELinux: **Enforcing** |
| 100 | +- **Spectrum kernel profiles** — Balance / Performance / Battery / Gaming (Quick Settings tile) |
| 101 | +- **Setup Wizard** — set to OPTIONAL (auto-provisions when no Setup Wizard present) |
| 102 | +- **LiveDisplay** — disabled (MSM8937 has no SDM HAL support) |
| 103 | +- **Power HAL** — uses AOSP example HAL (QTI AIDL v3 incompatible with kernel 4.9) |
| 104 | + |
| 105 | +## Custom Patches in Forks |
| 106 | + |
| 107 | +### frameworks_base_derpfest |
| 108 | + |
| 109 | +| Commit | Description | |
| 110 | +|:-------|:------------| |
| 111 | +| `2851d711` | Spectrum QS tile — Quick Settings tile for kernel profile switching | |
| 112 | +| `0faf8796` | SystemUIGoogle privapp permissions — add missing allowlist entries | |
| 113 | +| `a3d667c5` | Reticker crash fix — isAttachedToWindow() guard before createCircularReveal() | |
| 114 | + |
| 115 | +### packages_apps_Settings_derpfest |
| 116 | + |
| 117 | +| Commit | Description | |
| 118 | +|:-------|:------------| |
| 119 | +| `0b559483` | Set maintainer info to ziachi | |
| 120 | + |
| 121 | +### vendor_derp_derpfest |
| 122 | + |
| 123 | +| Commit | Description | |
| 124 | +|:-------|:------------| |
| 125 | +| `24cb349` | Make WITH_GMS conditional — allows vanilla build without GApps | |
| 126 | + |
| 127 | +### packages_apps_Calendar_derpfest |
| 128 | + |
| 129 | +| Commit | Description | |
| 130 | +|:-------|:------------| |
| 131 | +| `95291a1` | Fix FragmentManager crash in GeneralPreferences (vanilla build) | |
| 132 | + |
| 133 | +## For AI Agents |
| 134 | + |
| 135 | +If you're an AI agent building this ROM, here's the quick reference: |
| 136 | + |
| 137 | +```bash |
| 138 | +# Full build sequence (after repo sync + clones + ld symlink) |
| 139 | +cd ~/derpfest |
| 140 | +source build/envsetup.sh |
| 141 | +lunch derp_santoni-userdebug |
| 142 | +mka derp -j$(nproc) |
| 143 | +``` |
| 144 | + |
| 145 | +**Key facts:** |
| 146 | +- Lunch target: `derp_santoni-userdebug` |
| 147 | +- Build command: `mka derp` (NOT `mka bacon`) |
| 148 | +- Vendor inherit: `vendor/derp/config/common_full_phone.mk` |
| 149 | +- Clang version: `r450784d` (NOT `zyc_clang`) |
| 150 | +- `WITH_GMS := false` in `derp_santoni.mk` |
| 151 | +- System partition: 3 GB max — vanilla only |
| 152 | +- SELinux must stay **Enforcing** |
| 153 | +- All patches are in fork repos — clone all 7 repos from the Repository Map |
| 154 | + |
| 155 | +**Common build errors:** |
| 156 | + |
| 157 | +| Error | Fix | |
| 158 | +|:------|:----| |
| 159 | +| `ld` not found in sbox | Symlink `ld → ld.lld` in `prebuilts/build-tools/path/linux-x86/` | |
| 160 | +| System image too large | Ensure `WITH_GMS := false` in `derp_santoni.mk` | |
| 161 | +| Power HAL bootloop | Already fixed — uses `android.hardware.power-service.example` | |
| 162 | + |
| 163 | +## Screenshots |
| 164 | + |
| 165 | +| About Phone | Recents + Play Integrity | |
| 166 | +|:-----------:|:------------------------:| |
| 167 | +|  |  | |
| 168 | + |
| 169 | +## Spec Sheet |
78 | 170 |
|
79 | | - |
| 171 | +| Feature | Specification | |
| 172 | +|:--------|:-------------| |
| 173 | +| CPU | Octa-core 1.4 GHz Cortex-A53 | |
| 174 | +| Chipset | Qualcomm MSM8940 Snapdragon 435 | |
| 175 | +| GPU | Adreno 505 | |
| 176 | +| Memory | 2/3 GB | |
| 177 | +| Shipped Android Version | 6.0.1 | |
| 178 | +| Storage | 16/32 GB | |
| 179 | +| MicroSD | Up to 256 GB | |
| 180 | +| Battery | 4100 mAh (non-removable) | |
| 181 | +| Dimensions | 139 x 69 x 8.65 mm | |
| 182 | +| Display | 720 x 1280 pixels, 5" (~294 PPI) | |
| 183 | +| Rear Camera | 13 MP, LED flash | |
| 184 | +| Front Camera | 5 MP | |
| 185 | +| Release Date | May 2017 | |
80 | 186 |
|
81 | 187 | ## Credits |
82 | 188 |
|
83 | | -- [androidsantoni](https://github.com/androidsantoni) — Original device tree (risingos-13-dev base) |
| 189 | +- [androidsantoni](https://github.com/androidsantoni) — Original device tree (RisingOS 13 base) |
84 | 190 | - [DerpFest-AOSP](https://github.com/DerpFest-AOSP) — ROM source |
85 | 191 |
|
86 | 192 | ## Changelog |
|
0 commit comments