60GB
free space - but you really should provide about double that - all this space is needed for the build system itself (about 35GB-45GB, depending on the manifest version), for the device trees, for the actual build (between 8GB to 12GB for each device), and for ccache's cache (if you use ccache).minimum
of 16GB RAM (20GB would be much better). If you are building with the 12.1 manifest, you need a minimum
of 20GB RAM (24GB would be much better).Linux
development system (note: "Linux" - NOT "Windows")."python -V"
; if it is not v2.x, then you need to symlink python to whatever python 2 version is installed on your system)bash
shell (note: "bash", NOT "zsh", or "tcsh", or "ksh", or "csh", or "dash", or any other shell)NOT
build 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
NOTES:
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 12.1 --path ~/fox_12.1
NOTES:
You have to place your device trees, kernels in the proper locations.
For example device/xiaomi/lavender
# These are example commands
cd ~/fox_12.1 # (or whichever directory hosts the synced manifest)
git clone https://gitlab.com/OrangeFox/device/lavender.git device/xiaomi/lavender
cd ~/OrangeFox # (or whichever directory has the synced manifest)
/bin/bash # if your Linux shell isn't bash
export ALLOW_MISSING_DEPENDENCIES=true
export FOX_BUILD_DEVICE=<device>
export LC_ALL="C"
# for all brances
source build/envsetup.sh
# for branches lower than 11.0
lunch omni_<device>-eng && mka recoveryimage
# for branches lower than 11.0, with A/B partitioning
lunch omni_<device>-eng && mka bootimage
# for the 11.0 (or higher) branch
lunch twrp_<device>-eng && mka adbd recoveryimage
# for the 11.0 (or higher) branch, with A/B partitioning
lunch twrp_<device>-eng && mka adbd bootimage
# for the 12.1 (or higher) branch, vendor_boot-as-recovery builds [this is highly experimental and unsupported!]
lunch twrp_<device>-eng && mka adbd vendorbootimage
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 the manifest root directory.
D. If the device that you are building for is not a Xiaomi MIUI device, and/or you don't care about block-based incremental OTA updates, then you should consider adding this to your build process:
export OF_DISABLE_MIUI_SPECIFIC_FEATURES=1
or
export FOX_VANILLA_BUILD=1
E. If the device for which you are building OrangeFox is an A-only 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:
export OF_PATCH_AVB20=1
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:
export FOX_AB_DEVICE=1
G. If you are building with the fox_11.0
(or higher) branch and your device is a recent Virtual A/B ("VAB")
device, then you should add this to your build process if you are getting problems with flashing the OrangeFox zip installer itself, or with things like changing the splash :
export FOX_VIRTUAL_AB_DEVICE=1
H. If you want your subsequent builds to be faster, then use ccache - eg
export USE_CCACHE=1
export CCACHE_EXEC=/usr/bin/ccache
ccache -M 50G
# this sets aside 50GB disk space for the cache
I. If you are using a prebuilt kernel, and you start getting a "NO KERNEL CONFIG" error, try adding export OF_FORCE_PREBUILT_KERNEL=1
to your build process (eg, in vendorsetup.sh)
J. If your OrangeFox build variables are not being processed, ensure that your Linux shell for building is bash
, and that you have run export FOX_BUILD_DEVICE=<device>
before building.
K. If your build is getting stuck on the logo (indicating a decryption problem), you should consider providing a default version number for the keymaster services, using the OF_DEFAULT_KEYMASTER_VERSION
variable (in fact, it is strongly recommended to always do this anyway). This needs to specify the version number of the keymaster services that you have provided in your device tree (ensure that this is correct) - eg, for keymaster version 4.1:
export OF_DEFAULT_KEYMASTER_VERSION=4.1
L. If you enable TW_NO_SCREEN_BLANK
in your device tree, then make sure that you give a correct value for TW_MAX_BRIGHTNESS
- othewise, a default value (1023) will be used - and this may not be what you really want.
If there were no errors during compilation, the final recovery image would be present in out/target/product/[device]/OrangeFox-unofficial-[device].img
must
provide the following:must
be the exact version that you used to build the OrangeFox build that you are reporting problems for;If you do not provide both of these, then your request for help will either be ignored, or it will be deleted.
logcat
(if booting is not successful), or,These logs must be posted to del.dog or pastebin.com or a similar site).
Do NOT post silly messages like "it doesn't boot", or "it doesn't work", or "it fails", or "why this (or that) is happening", or anything along those lines. Such messages are totally useless, because they do not tell anybody what exactly is going on, or what exactly happens when you try to boot, or how exactly you are trying to boot, or anything meaningful that anyone could use to try to help you. We may simply ignore (or delete) such messages.
If your build does not succeed in booting at all, then;
a) You must first ensure that you have correctly followed all the building instructions (especially those relating to build variables
).
b) Secondly, you must also ensure that the kernel
you are using is not problematic.
c) Thirdly, you must satisfy yourself that your device tree
is correct.
If errors occur during the build process, then, you should, in addition to providing a link to your device tree,
a) Tell us which command you used to do the build (eg, "mka bootimage", etc);
b) Capture a full log of the build process (not just extracts of where you think the error occurs) and post it to a site like pastebin.com or a similar site, and
c) Post a link to the build log.
d) You can capture a log of the build process by running a command like: mka recoveryimage | tee build.log
vendorsetup.sh
in 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.adb shell getprop ro.boot.dynamic_partitions
adb shell getprop ro.boot.slot_suffix
fastboot getvar current-slot
orangefox_sync.sh
script, then follow the update instructions provided on the OrangeFox sync pageRead here