├── README.md └── default.xml /README.md: -------------------------------------------------------------------------------- 1 | # Minimal Pixel 2 (XL) manifest 2 | 3 | ## Purpose 4 | 5 | Currently, the state of TWRP makes using AnyKernel2 very impractical. Additionally, AOSP can consume a lot of space, even with a `--depth=1` flag. With this manifest, syncing and building are quicker as there are less files for ninja and soong to parse. Win win! 6 | 7 | NOTE: Most of the still tracked repos aren't necessarily for compilation but to make the build start. This could be slimmed down by including a prebuilt recovery ramdisk but I'm not interested in that. 8 | 9 | Size comparison (done with android-8.1.0_r1 using `du -sh`): 10 | 11 | | Manifest | `--clone-depth=1`? | Size | Projects | 12 | | -------- | ------------------ | ---- | -------- | 13 | | AOSP | No | 55GB | 592 | 14 | | AOSP | Yes | 43GB | 592 | 15 | | Minimal | N/A | 22GB | 206 | 16 | 17 | ## Usage 18 | 19 | 1. Sync the manifest 20 | ```bash 21 | repo init -u https://github.com/nathanchance/pixel2-manifest -b 8.1.0 22 | repo sync -j$(nproc --all) 23 | ``` 24 | 25 | 2. Add your kernel binary (Image.lz4-dtb) to the prebuilts location (device/google/wahoo-kernel). Follow the below steps to do this if you don't know how. 26 | 27 | 3. Lunch and build! 28 | 29 | Pixel 2: 30 | ```bash 31 | . build/envsetup.sh 32 | lunch aosp_walleye-user 33 | make -j$(nproc --all) clean 34 | make -j$(nproc --all) bootimage 35 | ``` 36 | 37 | Pixel 2 XL: 38 | ```bash 39 | . build/envsetup.sh 40 | lunch aosp_taimen-user 41 | make -j$(nproc --all) clean 42 | make -j$(nproc --all) bootimage 43 | ``` 44 | 45 | ## Building the kernel image 46 | 47 | The Pixel 2 has two oddities when it comes to building the kernel: Clang and dtbo. Clang is just another compiler like GCC and dtbo stands for device tree blob overlay, which allows Google to keep the kernel source for the two Pixels unified. However, to build it, you need two tools from AOSP (dtc and mkdtimg). Here are the step by step instructions to build the kernel! 48 | 49 | 1. Sync the manifest using step 1 above. 50 | 51 | 2. Generate the dtc and mkdtimg files (these are host tools so lunch isn't necessary) 52 | ```bash 53 | . build/envsetup.sh 54 | make -j$(nproc --all) dtc mkdtimg 55 | export AOSP_FOLDER=$(pwd) 56 | ``` 57 | 58 | 3. Copy these files to somewhere in your path (like /usr/local/bin) or run `export PATH=${AOSP_FOLDER}/out/host/linux-x86/bin:${PATH}` 59 | 60 | 4. Download the kernel source from Google: 61 | ```bash 62 | git clone -b android-msm-wahoo-4.4-oreo-mr1 https://android.googlesource.com/kernel/msm ../wahoo-kernel 63 | ``` 64 | 65 | 5. Start building the kernel! 66 | ```bash 67 | cd ../wahoo-kernel 68 | make -j$(nproc --all) ARCH=arm64 O=out wahoo_defconfig 69 | make -j$(nproc --all) ARCH=arm64 CC=${AOSP_FOLDER}/prebuilts/clang/host/linux-x86/clang-4053586/bin/clang CLANG_TRIPLE=aarch64-linux-gnu- CROSS_COMPILE=${AOSP_FOLDER}/prebuilts/gcc/linux-x86/aarch64/aarch64-linux-android-4.9/bin/aarch64-linux-android- O=out 70 | ``` 71 | 72 | If successful, the kernel will be located at `out/arch/arm64/boot/Image.lz4-dtb`, which you can build and flash using the Usage section above. 73 | -------------------------------------------------------------------------------- /default.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 7 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | 43 | 44 | 45 | 46 | 47 | 48 | 49 | 50 | 51 | 52 | 53 | 54 | 55 | 56 | 57 | 58 | 59 | 60 | 61 | 62 | 63 | 64 | 65 | 66 | 67 | 68 | 69 | 70 | 71 | 72 | 73 | 74 | 75 | 76 | 77 | 78 | 79 | 80 | 81 | 82 | 83 | 84 | 85 | 86 | 87 | 88 | 89 | 90 | 91 | 92 | 93 | 94 | 95 | 96 | 97 | 98 | 99 | 100 | 101 | 102 | 103 | 104 | 105 | 106 | 107 | 108 | 109 | 110 | 111 | 112 | 113 | 114 | 115 | 116 | 117 | 118 | 119 | 120 | 121 | 122 | 123 | 124 | 125 | 126 | 127 | 128 | 129 | 130 | 131 | 132 | 133 | 134 | 135 | 136 | 137 | 138 | 139 | 140 | 141 | 142 | 143 | 144 | 145 | 146 | 147 | 148 | 149 | 150 | 151 | 152 | 153 | 154 | 155 | 156 | 157 | 158 | 159 | 160 | 161 | 162 | 163 | 164 | 165 | 166 | 167 | 168 | 169 | 170 | 171 | 172 | 173 | 174 | 175 | 176 | 177 | 178 | 179 | 180 | 181 | 182 | 183 | 184 | 185 | 186 | 187 | 188 | 189 | 190 | 191 | 192 | 193 | 194 | 195 | 196 | 197 | 198 | 199 | 200 | 201 | 202 | 203 | 204 | 205 | 206 | 207 | 208 | 209 | 210 | 211 | 212 | 213 | 214 | 215 | 216 | 217 | 218 | 219 | 220 | 221 | 222 | 223 | 224 | 225 | 226 | 227 | 228 | 229 | 230 | 231 | --------------------------------------------------------------------------------