Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?

Setup your SDK

.hadk.env

export MER_ROOT="$HOME/mer"
export ANDROID_ROOT="$MER_ROOT/android/droid"
export VENDOR="OnePlus"
export DEVICE="onyx"
export PORT_ARCH="armv7hl"

After setting up sdk

Enter the build engine

ubu-chroot -r $MER_ROOT/sdks/ubuntu

HABUILD_SDK

hadk

Prepare android root

sudo mkdir -p $ANDROID_ROOT
sudo chown -R $USER $ANDROID_ROOT
cd $ANDROID_ROOT
repo init -u git://github.com/mer-hybris/android.git -b hybris-12.1

Fetch local manifest

mkdir $ANDROID_ROOT/.repo/local_manifests
cd $ANDROID_ROOT/.repo/local_manifests
curl -O https://raw.githubusercontent.com/mer-hybris/local_manifests/hybris-12.1/onyx.xml

Sync sources (this takes a while)

cd $ANDROID_ROOT
repo sync --fetch-submodules

Remove duplicate configpanel and keyhandler

cd $ANDROID_ROOT
rm -rI device/oppo/common/configpanel/
rm -rI device/oppo/common/keyhandler/

Build hybris-hal. This is the reusable part

Note: copypaste make commands one by one

hadk
cd $ANDROID_ROOT
source build/envsetup.sh
export USE_CCACHE=1
breakfast $DEVICE

make -j4 clean

make -j4 hybris-hal

make -j4 libwcnss_qmi

MER_SDK

hadk

Build packages

cd $ANDROID_ROOT
rpm/dhd/helpers/build_packages.sh

Patterns

cd $ANDROID_ROOT
hybris/droid-configs/droid-configs-device/helpers/process_patterns.sh

Get the kickstart file

RELEASE=2.0.1.11
EXTRA_NAME=beta-1
cd $ANDROID_ROOT/tmp
curl -O http://images.devaamo.fi/sfa/onyx/$EXTRA_NAME/Jolla-$RELEASE-$DEVICE-armv7hl.ks

EXTRA_NAME=-$EXTRA_NAME

Edit kickstart for your own local repo

uncomment and modify the first repo line in .ks to use your freshly built packages instead of OBS built.

username and $ANDROID_ROOT path

Build rootfs

cd $ANDROID_ROOT
sudo mic create fs --arch $PORT_ARCH \
--tokenmap=ARCH:$PORT_ARCH,RELEASE:$RELEASE,EXTRA_NAME:$EXTRA_NAME \
--record-pkgs=name,url \
--outdir=sfe-$DEVICE-$RELEASE$EXTRA_NAME \
--pack-to=sfe-$DEVICE-$RELEASE$EXTRA_NAME.tar.bz2 \
$ANDROID_ROOT/tmp/Jolla-$RELEASE-$DEVICE-armv7hl.ks

The flashable image zip is

$ANDROID_ROOT/sfe-$DEVICE-$RELEASE$EXTRA_NAME/sailfishos-$DEVICE-release-$RELEASE$EXTRA_NAME.zip
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.