Skip to content
43 changes: 43 additions & 0 deletions device/xiaomi-sagit/env.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
# sfbootstrap env for xiaomi-sagit
VENDOR=xiaomi
DEVICE=sagit
VENDOR_PRETTY="Xiaomi"
DEVICE_PRETTY="Mi 6"
PORT_ARCH=aarch64
SOC=qcom
PORT_TYPE=hybris
HYBRIS_VER=17.1
HAL_MAKE_TARGETS=(hybris-hal droidmedia libbiometry_fp_api)
RELEASE=4.4.0.58
#TOOLING_RELEASE=$RELEASE
#SDK_RELEASE=3.9.6
REPOS_COMMON=(
# Xiaomi MI 6 common HAL
'https://github.com/SailfishOS-sagit/android_device_xiaomi_msm8998-common.git' device/xiaomi/msm8998-common "hybris-$HYBRIS_VER" 1
'https://github.com/SailfishOS-sagit/android_kernel_xiaomi_msm8998.git' kernel/xiaomi/msm8998 "hybris-$HYBRIS_VER" 1
'https://github.com/SailfishOS-sagit/android_vendor_xiaomi.git' vendor/xiaomi "hybris-$HYBRIS_VER" 1
# SFOS misc
'https://github.com/SailfishOS-sagit/prebuilts_clang_host_linux-x86_clang-r407598.git' prebuilts/clang/host/linux-x86/clang-r407598 "11" 1
'https://github.com/mer-hybris/libhybris.git' external/libhybris '' 0
'https://github.com/sailfishos-sagit/hybris-boot.git' hybris/hybris-boot '' 1
'https://github.com/sailfishos-sagit/hybris-installer.git' hybris/hybris-installer '' 1
'https://github.com/sailfishos-open/sailfish-fpd-community.git' hybris/mw/sailfish-fpd-community '' 1
)
REPOS=(
# Shared between sagit
"${REPOS_COMMON[@]}"
# Xiaomi MI 6 HAL
'https://github.com/SailfishOS-sagit/android_device_xiaomi_sagit.git' device/xiaomi/sagit "lineage-$HYBRIS_VER" 1
# SFOS adaptation
'https://github.com/sailfishos-sagit/droid-hal-sagit.git' rpm "hybris-$HYBRIS_VER" 0
'https://github.com/sailfishos-sagit/droid-config-sagit.git' hybris/droid-configs "hybris-$HYBRIS_VER" 0
'https://github.com/sailfishos-sagit/droid-hal-version-sagit.git' hybris/droid-hal-version-sagit '' 0
)
REPO_OVERRIDES=(
# This project's path is already cloned to above
'mer-hybris/hybris-boot'
)
LINKS=(
'Sources' 'https://github.com/sailfishos-sagit'
)
export VENDOR DEVICE PORT_ARCH RELEASE
2 changes: 2 additions & 0 deletions device/xiaomi-sagit/post-build-mw.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
# Additional MW for extra functionality on Xiaomi MI 6 devices
sfb_build_packages --mw=sailfish-fpd-community --spec=rpm/droid-biometry-fp.spec --spec=rpm/sailfish-fpd-community.spec
2 changes: 2 additions & 0 deletions device/xiaomi-sagit/pre-build-hal.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
# Avoid pointless install of ImageMagick in HA build chroot
rm -rf "$ANDROID_ROOT/vendor/lineage/bootanimation"
5 changes: 5 additions & 0 deletions device/xiaomi-sagit/pre-build-packages.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
# Attempt to utilize more than one CPU thread for builds
util="$ANDROID_ROOT/rpm/dhd/helpers/util.sh"
if ! grep -q 'build -j' "$util"; then
sed 's/build >>/build -j $(nproc) >>/' -i "$util"
fi
6 changes: 4 additions & 2 deletions sfbootstrap.sh
Original file line number Diff line number Diff line change
Expand Up @@ -186,7 +186,7 @@ sfb_device_env() {
if sfb_chroot_exists_sfossdk && ! sfb_chroot_exists_sb2_target; then
sfb_chroot_sb2_setup
fi
sfb_sync_extra_repos
sfb_sync_extra_repos --clone-only
trap - EXIT
else
save_lastdevice
Expand Down Expand Up @@ -317,6 +317,8 @@ sfb_checkhost() {
local hostkern="$(uname -s)" hostarch="$(uname -m)"
if [ "$hostkern" != "Linux" ]; then
sfb_error "Your host kernel $hostkern isn't supported (only Linux is)!"
elif grep -qi 'microsoft' /proc/version; then
sfb_error "WSL is not a supported build environment, please setup a VM or dual-boot!"
elif [ "$hostarch" != "x86_64" ]; then
sfb_error "Your host CPU architecture $hostarch isn't supported (only x86_64 is)!"
fi
Expand Down Expand Up @@ -369,7 +371,7 @@ sfb_load_modules() {
f1="$(declare -F)"
. "$SFB_ROOT/modules/$module"
f2="$(declare -F)"
funcs=$(comm -13 <(echo "$f1" ) <(echo "$f2") | wc -l)
funcs=$(comm -13 <(echo "$f1" ) <(echo "$f2") 2>/dev/null | wc -l)
[ -z "$module_name" ] && module_name="${module%.sh}"
setup_usage="sfb_${module_name}_setup_usage"
if declare -F "$setup_usage" >/dev/null; then
Expand Down