Whilst I'll go into a good level of detail, this will not be a hand-holding guide. You are expected to be able to use the Linux command line, and tools such as Git and repo.
This guide is based upon building from the Minimal TWRP sources, which are based upon a subset of Omnirom. At the time of writing, the latest branch is twrp-9.0 (Pie). (If you are reading this some months after I have written this guide, check for later branches.) Follow this link for the repo, and the instructions:
Firstly, create a folder to put this in, e.g. $HOME/twrp-minimal-omni, and change to that directory. Then execute the following for a shallow clone (to save space...):
repo init --depth=1 -u git://github.com/minimal-manifest-twrp/platform_manifest_twrp_omni.git -b twrp-9.0
<?xml version="1.0" encoding="UTF-8"?> <manifest> <project name="android_device_google_marlin" path="device/google/marlin" remote="TeamWin" revision="android-9.0" /> <project path="hardware/qcom/bootctrl" name="platform/hardware/qcom/bootctrl" groups="pdk-qcom" remote="aosp" /> <project path="hardware/qcom/msm8998" name="platform/hardware/qcom/msm8998" groups="qcom_msm8998,pdk-qcom" remote="aosp" /> </manifest>
- android_device_google_marlin - contains the configuration and build instructions for marlin and sailfish
- hardware/qcom/bootctrl - this is part of AOSP, and is required for building TWRP
- hardware/qcom/msm8998 - extra chipset stuff that is required for marlin/sailfish
You can do a repo sync now to download the sources.
Additionally, we will need some driver binaries that are available from Google. Get the Google (Qcom is not necessary) drivers for the latest Pie release here:
Extract the files into the same folder as you created, and execute e.g as follows, and follow the prompts:
You now have all of the source files needed.
Patch to build for Sailfish on Omni
This is no longer required. The patch below has been merged into the official repo.
At the time of writing, the sources only allow building on the lineage branch, and some of the options we want just don't get us a functional build. So I have made appropriate updates to get sailfish on par with marlin.
Copy and paste the following code into a text editor:
From f42e1e866ba2e6892252d0d48099ce6f682bdfbd Mon Sep 17 00:00:00 2001 From: NZedPred <[email protected]> Date: Fri, 3 Jan 2020 20:17:51 +1300 Subject: [PATCH] Enable omni_sailfish Change-Id: I33ad048038d27650dcacaf610e285a6243cb2028 --- AndroidProducts.mk | 1 + device-common.mk | 2 +- omni_sailfish.mk | 39 +++++++++++++++++++++++++++++++++++++++ sailfish/BoardConfig.mk | 6 ++++-- 4 files changed, 45 insertions(+), 3 deletions(-) create mode 100644 omni_sailfish.mk diff --git a/AndroidProducts.mk b/AndroidProducts.mk index 75bae61..1934c32 100644 --- a/AndroidProducts.mk +++ b/AndroidProducts.mk @@ -1,4 +1,5 @@ PRODUCT_MAKEFILES := $(LOCAL_DIR)/omni_marlin.mk + $(LOCAL_DIR)/omni_sailfish.mk $(LOCAL_DIR)/lineage_sailfish.mk $(LOCAL_DIR)/lineage_marlin.mk diff --git a/device-common.mk b/device-common.mk index c98a4a4..c2bd98c 100644 --- a/device-common.mk +++ b/device-common.mk @@ -321,7 +321,7 @@ PRODUCT_PROPERTY_OVERRIDES += # Write Manufacturer & Model information in created media files. # IMPORTANT: ONLY SET THIS PROPERTY TO TRUE FOR PUBLIC DEVICES -ifneq ($(filter aosp_sailfish% sailfish% omni_marlin% lineage_marlin% marlin% lineage_sailfish%, $(TARGET_PRODUCT)),) +ifneq ($(filter omni_sailfish% sailfish% omni_marlin% lineage_marlin% marlin% lineage_sailfish%, $(TARGET_PRODUCT)),) PRODUCT_PROPERTY_OVERRIDES += media.recorder.show_manufacturer_and_model=true else diff --git a/omni_sailfish.mk b/omni_sailfish.mk new file mode 100644 index 0000000..70d4369 --- /dev/null +++ b/omni_sailfish.mk @@ -0,0 +1,39 @@ +# +# Copyright 2015 The Android Open Source Project +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# + +# Sample: This is where we'd set a backup provider if we had one +# $(call inherit-product, device/sample/products/backup_overlay.mk) + +# Inherit from the common Open Source product configuration +$(call inherit-product, $(SRC_TARGET_DIR)/product/core_64_bit.mk) +$(call inherit-product, $(SRC_TARGET_DIR)/product/aosp_base_telephony.mk) + +PRODUCT_NAME := omni_sailfish +PRODUCT_DEVICE := sailfish +PRODUCT_BRAND := Android +PRODUCT_MODEL := AOSP on msm8996 +PRODUCT_MANUFACTURER := Google +PRODUCT_RESTRICT_VENDOR_FILES := false + +PRODUCT_COPY_FILES += device/google/marlin/fstab.common:$(TARGET_COPY_OUT_VENDOR)/etc/fstab.marlin + +$(call inherit-product, device/google/marlin/device-sailfish.mk) +$(call inherit-product-if-exists, vendor/google_devices/marlin/device-vendor-marlin.mk) + +PRODUCT_PACKAGES += + Launcher3QuickStep + WallpaperPicker + diff --git a/sailfish/BoardConfig.mk b/sailfish/BoardConfig.mk index 1c08e81..b0e39f4 100644 --- a/sailfish/BoardConfig.mk +++ b/sailfish/BoardConfig.mk @@ -206,8 +206,10 @@ TW_INPUT_BLACKLIST := "hbtp_vm" TW_DEFAULT_BRIGHTNESS := "80" TW_INCLUDE_CRYPTO := true AB_OTA_UPDATER := true -TWRP_INCLUDE_LOGCAT := true -TARGET_USES_LOGD := true +#TWRP_INCLUDE_LOGCAT := true +#TARGET_USES_LOGD := true +TW_INCLUDE_REPACKTOOLS := true +TW_EXCLUDE_UBSAN := true TW_USE_TOOLBOX := true TW_EXCLUDE_DEFAULT_USB_INIT := true #TARGET_RECOVERY_DEVICE_MODULES += [email protected] [email protected] -- 2.20.1
git am sailfish.patch
Do the build
We then more-or-less follow the instructions as per the original minimal manifest page:
export ALLOW_MISSING_DEPENDENCIES=true . build/envsetup.sh lunch omni_sailfish-eng mka bootimage
Use fastboot boot out/target/product/sailfish/boot.img to test it in fastboot mode on your device.
Hope this helps someone out there!
Building TWRP for Sailfish, Tool/Utility for the Google Pixel
Last Updated 2020-01-16