minimumof 16GB RAM (20GB would be much better))
Linuxenvironment (note: "Linux" - NOT "Windows").
NOTbuild as root
cd ~ sudo apt install git aria2 -y git clone https://gitlab.com/OrangeFox/misc/scripts cd scripts sudo bash setup/android_build_env.sh sudo bash setup/install_android_sdk.sh
mkdir ~/OrangeFox_10 cd ~/OrangeFox_10 rsync rsync://sources.orangefox.download/sources/fox_10.0 . --progress -a
NOTE: this alternative method requires familiarity with shell scripts; you should only use it if you know what you are doing - the "rsync" method is preferred:
mkdir ~/OrangeFox_sync cd ~/OrangeFox_sync git clone https://gitlab.com/OrangeFox/sync.git (or, using ssh, "git clone [email protected]:OrangeFox/sync.git") cd ~/OrangeFox_sync/sync/ ./orangefox_sync.sh --branch 11.0 --path ~/fox_11.0
deprecated; only use this, if you
reallymust, for the fox_9.0 branch - but there will be no support)
mkdir ~/OrangeFox_9 cd ~/OrangeFox_9 repo init -u https://gitlab.com/OrangeFox/Manifest.git -b fox_9.0 repo sync -j8 --force-sync
repo init --depth=1 -u https://gitlab.com/OrangeFox/Manifest.git -b fox_9.0 to initialize a shallow clone to save disk space
Tip2: The version number of the build manifest is a very different thing from the OrangeFox release version numbers. So, do NOT come and ask for "R11 sources". If you have synced as shown above, then you already have the sources for the latest OrangeFox Stable releases (whether R9, or R10, or R11, or R55, or whatever).
You have to place your device trees, kernels in the proper locations.
# These are example commands cd ~/OrangeFox # (or whichever directory hosts the synced manifest) git clone https://gitlab.com/OrangeFox/device/mido.git device/xiaomi/mido
cd ~/OrangeFox # (or whichever directory has the synced manifest) source build/envsetup.sh export ALLOW_MISSING_DEPENDENCIES=true export FOX_USE_TWRP_RECOVERY_IMAGE_BUILDER=1 export LC_ALL="C" # for branches lower than 11.0 lunch omni_<device>-eng && mka recoveryimage # or, for the 11.0 (or higher) branch lunch twrp_<device>-eng && mka recoveryimage
A. If you get any errors relating to anything with a ".py" extension or anything containing "py2",etc, then it means you need to install Python 2.x. Run "python --version" to see which version is being used as default - and, if it is not Python 2.7.x (eg, if it is Python 3.x) then you will have issues, and you will need to install v2.x
B. Indeed, you should always make sure that your default python for building is python 2.x
C. If you get build errors relating to "ui.xml for TW_THEME: portrait_hdpi", "Set TARGET_SCREEN_WIDTH and TARGET_SCREEN_HEIGHT to automatically select an appropriate theme", or "set TW_THEME to one of the following", etc, then it is possible that the bootable/recovery/gui/theme/ directory has not been properly synced. In that case, you might need to run a command like:
git clone https://gitlab.com/OrangeFox/misc/theme.git bootable/recovery/gui/theme from manifest root directory.
D. If the device that you are building for is not a Xiaomi MIUI device, and you don't care about block-based incremental OTA updates, then you should consider adding this to your build process:
E. If the device for which you are building OrangeFox is a Xiaomi MIUI device, then you probably want to add this to your build process, to prevent the MIUI recovery from overwriting OrangeFox when you boot into the MIUI ROM:
F. If you are building for an A/B device (you must be sure of this!), then you should add this to your build process:
G. If you want your subsequent builds to be faster, then use ccache - eg
ccache -M 50G # this sets aside 50GB disk space for the cache
H. If you discover that your build does not include busybox and you would prefer to have busybox, then look for a line in your BoardConfig.mk that says "TW_USE_TOOLBOX := true" and remove that line. Note that this does not apply to the fox_10.0 or fox_11.0 build systems.
If there were no errors during compilation, the final recovery image would be present in out/target/product/[device]/OrangeFox-unofficial-[device].img
mustprovide a link (on gitlab or github) to your device tree - this
mustbe the exact version that you used to build the OrangeFox build that you are reporting problems for. You
mustalso provide a link (on a site like https://del.dog or https://pastebin.com) to a full log of your entire build process - do NOT just post screenshots or excerpts from the build logs.
logcat(if booting is not successful), or, if booting is successful but the recovery is not behaving correctly, then you must post the recovery logs ("Menu->Copy Log to SD", including the kernel log). These must be posted to del.dog or pastebin.com or a similar site).
build variables). Secondly, you must ensure that the
kernelyou are using is not problematic. Thirdly, you must satisfy yourself that your
device treeis correct.
mka recoveryimage | tee build.log
vendorsetup.shin your own device tree. For a detailed example, have a look at this. Note - this is just an example of appropriate settings for one device. Obviously, you will need to amend this example in order to tailor it for your own device.