Note, the SDK required for a specific command will be expressed as follows:
-
HOST:
[HOST]
-
PLATFORM_SDK:
[PLATFORM]
-
HABUILD_SDK:
[HABUILD]
cd
curl -O https://raw.githubusercontent.com/sailfish-oneplus6/sf-enchilada/master/files/.hadk.env
curl -O https://raw.githubusercontent.com/sailfish-oneplus6/sf-enchilada/master/files/.mersdk.profile
curl -O https://raw.githubusercontent.com/sailfish-oneplus6/sf-enchilada/master/files/.mersdkubu.profile
- Modify your
.bashrc
to contain the following:
export PATH=$HOME/bin:$PATH
export PLATFORM_SDK_ROOT="/srv/mer"
export ANDROID_ROOT="$HOME/Sailfish/src"
alias sfossdk="$PLATFORM_SDK_ROOT/sdks/sfossdk/mer-sdk-chroot"
Download and install repo
[HOST]
mkdir ~/bin
curl https://storage.googleapis.com/git-repo-downloads/repo > ~/bin/repo
chmod +x ~/bin/repo
Now follow the OnePlus 5 initial building guide from setup the platform sdk
, it's safe to ignore all OnePlus 5 specific information. NOTE: where it says habuild
you can use the alias ubu
instead.
Thanks @deathmist ;)
[HOST]
cd $ANDROID_ROOT
repo init -u git://github.com/mer-hybris/android.git -b hybris-16.0 --depth 1
git clone https://github.com/sailfish-oneplus6/local_manifests .repo/local_manifests
[HABUILD]
repo sync -c -j`nproc` --fetch-submodules --no-clone-bundle --no-tags
# Hybris-16.0 specific patches, not in the HADK yet
hybris-patches/apply-patches.sh --mb
git clone --recurse-submodules https://github.com/mer-hybris/libhybris hybris/mw/libhybris
[HABUILD]
. build/envsetup.sh
breakfast $DEVICE
mka hybris-hal
[HABUILD]
echo "MINIMEDIA_AUDIOPOLICYSERVICE_ENABLE := 1" > external/droidmedia/env.mk
sed "s/Werror/Werror -Wno-unused-parameter/" -i frameworks/av/services/camera/libcameraservice/Android.mk
mka droidmedia audioflingerglue
[PLATFORM]
bp
Build android parts (boot image + device parts)
[HABUILD]
mka hybris-hal
Copy the fstab to out so that mount units for /system and /vendor get generated properly
cp device/oneplus/sdm845-common/rootdir/etc/fstab.qcom out/target/product/*/root/
Build Sailfish packages and generate a rootfs
[PLATFORM]
bp
If you get an error like No tags describe HEAD, will not fix package version
when building rpm/
[PLATFORM]
sb2 -t $VENDOR-$DEVICE-$PORT_ARCH -m sdk-install -R zypper in droid-config-$DEVICE
If only modifying sparse files it is safe to only run:
bp -cvi
This builds droid-configs-$DEVICE
, droid-version-$DEVICE
and then generates a new image.
If modifying fstab or any .rc
files, run
bp -dvi
This builds droid-hal-$DEVICE
, droid-version-$DEVICE
and then generates a new image.