diff --git a/README.md b/README.md index 35bc92f..e06c6fa 100644 --- a/README.md +++ b/README.md @@ -6,5 +6,4 @@ them telling you what you need to edit but you are required to have functional k ## Contents: - [AOSP Building Guide](guides/building_aosp.txt) -- [Building Flash](guides/building_flash.txt) - [Bug Reporting](guides/proper_bug_reporting.txt) diff --git a/guides/building_flash.txt b/guides/building_flash.txt deleted file mode 100644 index 8aab9df..0000000 --- a/guides/building_flash.txt +++ /dev/null @@ -1,251 +0,0 @@ - -##################################### -## ## -## 1. Configure your environment ## -## ## -##################################### - -In order to compile this kernel, you will need a Linux environment. -If you can't dual boot, use Virtual Box to create a virtual machine -(I did it with Mint 18, images below). To get the environment configured, e -ither use Google's own guide (https://source.android.com/source/initializing.html) -or my guide (https://raw.githubusercontent.com/nathanchance/Android-Tools/master/Building_AOSP.txt) - - - -########################## -## ## -## 2. Grab the source ## -## ## -########################## - -1. Grab my Flash source - -Format: -$ mkdir ~/Android -$ cd ~/Android -$ git clone https://github.com/nathanchance/angler.git Flash - -Explanation: --- First command makes a directory named Android in your home folder - (mkdir = make directory). You can change the location if you want - but keep it consistent throughout the guide. --- Second command moves into that directory (change directory) --- Third command pulls the source from my Github into a directory named - Flash (git clone is the format of the command) - - -2. Grab my AnyKernel2 source - -Format: -$ cd ~/Android -$ git clone https://github.com/nathanchance/AnyKernel2.git Flash-AK2 - -Explanation: --- First command moves into that directory (change directory) --- Second command pulls the AnyKernel repo from my Github into a directory named - Flash-AK2 (git clone is the format of the command) - - -3. Grab the toolchain you want to use to compile the kernel - -Format: -$ cd ~/Android -$ git clone -b personal-linaro-7.x https://github.com/nathanchance/gcc-prebuilts aarch64-linaro-linux-gnu - -Explanation: -- In order to compile the kernel, we need to grab a toolchain (bunch of - compilation tools). I currently use my own toolchain, based on Uber. This will - download and checkout the toolchain like above. - - - -########################## -## ## -## 3. Setup the build ## -## ## -########################## - -1. Make sure everything looks right - --- After following the above steps, type: - $ ls - --- You should see something like this: - aarch64-linaro-linux-gnu Flash Flash-AK2 - - -2. Select the correct AnyKernel branch - -Format: -$ cd ~/Android/Flash-AK -$ git checkout - -Example: -$ cd ~/Android/Flash-AK -$ git checkout angler-flash-public-7.1.2 - -Explanation: --- First command will move you into the AnyKernel2 source directory we cloned above. --- Second command will checkout the branch you want to use. You can see the list - of branches by typing git branch -av. - - - -########################## -## ## -## 4. Make the kernel ## -## ## -########################## - -1. Tell the makefile what toolchain and architecture you are building for - - 1. Figure out the full path of your toolchain folder - - Assuming you have done this whole process correctly, you can move - into your toolchain directory and type: - $ cd ~/Android/aarch64-linaro-linux-gnu - $ pwd - - You should get something like this: /home/nathan/Android/aarch64-linaro-linux-gnu - - - 2. Tell the compiler where that toolchain is - - Copy and paste that file location above into this command: - $ export CROSS_COMPILE=/bin/aarch64-linaro-linux-gnu- - - Example: - $ export CROSS_COMPILE=/home/nathan/Android/aarch64-linaro-linux-gnu/bin/aarch64-linaro-linux-gnu- - - - 3. Set the architecture - - Angler is a 64-bit device so we need arm64 - $ export ARCH=arm64 && export SUBARCH=arm64 - - -2. Clean up from a previous compilation and update the source - -$ cd ~/Android/Flash -$ git clean -f -d -x > /dev/null 2>&1 -$ git fetch origin -$ git reset --hard origin/7.1.2-flash - --- The first command moves you into the Flash source directory. --- The second command will clean any untracked or compiled files (this is send - to /dev/null so you do not see it happen). --- The third and fourth command will pull any new kernel changes from me into the source. - - -3. Set up the defconfig - -A defconfig tells the compiler which features you want in the kernel. -This is already set up by me. To set up the defconfig, type the following: -$ cd ~/Android/Flash -$ mkdir out -$ make O=out flash_defconfig - - -4. Make the kernel! - -Format: -$ make O=out -j$( nproc --all ) - - - - -############################### -## ## -## 5. Zip it up and flash! ## -## ## -############################### - -1. Clean the AnyKernel directory - -Format: -$ cd ~/Android/Flash-AK2 -$ git clean -f -d -x > /dev/null 2>&1 -$ git fetch origin -$ git reset --hard origin/ - - -Example: -$ cd ~/Android/Flash-AK2 -$ git clean -f -d -x > /dev/null 2>&1 -$ git fetch origin -$ git reset --hard origin/angler-flash-public-7.1.2 - - --- The first command moves you into the AnyKernel source directory. --- The second command will clean any untracked or compiled files (this is send - to /dev/null so you do not see it happen). --- The third and fourth command will pull any new repo changes from me into the source. - - -2. Copy the zImage to the AnyKernel directory - -Format: -$ cp -v ~/Android/Flash/out/arch/arm64/boot/Image.gz-dtb ~/Android/Flash-AK2 - -Explanation: --- We need to copy the newly compiled kernel (which resides in the - arch/arm64/boot folder) to the AnyKernel directory, while changing its - name to zImage-dtb. --- cp = copy --- -v = verbose (prints the copying) --- ~/Android/Flash/out/arch/arm64/boot/Image.gz-dtb = file to be copied --- ~/Android/Flash-AK2 = destination - -2. Zip it up! - -Format: -$ cd ~/Android/Flash-AK2 -$ zip -r9 flash-kernel.zip * -x README flash-kernel.zip - -Explanation: --- Using the above commands, your newly completed kernel will be - located at ~/Android/Flash-AK2/flash-kernel.zip - - - -################## -## ## -## CONCLUSION ## -## ## -################## - -If you followed all of the above steps successfully, congratulations, you built -the kernel!! Once you have done all five steps, you will just need to follow -steps 4 and 5 to update in the future. Below, I have linked a script that will -do all of this for you (with some variable edits at the top); however, please do -it manually first so you know exactly what you are doing :) enjoy! - -https://raw.githubusercontent.com/nathanchance/Android-Tools/master/Scripts/build-flash.sh - -Below are screenshots of me doing this process in a virtual machine (Arch Linux) -with 2 cores, 4GB of RAM, and 60GB of storage on my MacBook with a 2.5 GHz Intel -Core i5 and 8GB of RAM (fairly average in the world of PC specs I think). -It's totally possible to do this on your own. - -http://i.imgur.com/CwDH96j.png - -If you have any questions, feel free to mention me on XDA (@The Flash) -or contact me on Hangouts (natechancellor@gmail.com) or Telegram (@nathanchance) - - - -# Copyright (C) 2016-2017 Nathan Chancellor -# -# This guide is free software: you can redistribute it and/or modify -# it under the terms of the GNU General Public License as published by -# the Free Software Foundation, either version 3 of the License, or -# (at your option) any later version. -# -# This guide is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -# GNU General Public License for more details. -# -# You should have received a copy of the GNU General Public License -# along with this program. If not, see