Skip to content

Commit

Permalink
GUIDES: Small fixes, libhybris patch for audio & custom manifest
Browse files Browse the repository at this point in the history
  • Loading branch information
JamiKettunen committed Nov 24, 2019
1 parent d5c5df1 commit c51dc05
Show file tree
Hide file tree
Showing 3 changed files with 27 additions and 12 deletions.
18 changes: 13 additions & 5 deletions BUILDING.md
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ PLATFORM_SDK $

At this point the process of downloading source code for LineageOS and libhybris will start. This will also be done when updating source code repos.

At first this may take a while depending on your internet connection speed (with 200 mbit/s it'll take ~10 mins for reference):
At first this may take a while depending on your internet connection speed (with 200 mbit/s it'll take ~8 mins for reference):
```
HA_BUILD $ repo sync -c -j`nproc` --fetch-submodules --no-clone-bundle --no-tags
```
Expand All @@ -42,7 +42,17 @@ If this is your first time building, execute the following line to finalize the
HA_BUILD $ hybris-patches/apply-patches.sh --mb && . build/envsetup.sh && breakfast $DEVICE && export USE_CCACHE=1
```

It's possible and **required before syncing again** to use `repo sync -l` to reset your cloned repos to their pre-patch states, however at the cost of losing **any and all** local-only changes!
Next up apply the following `libhybris` patch to get working audio on the port:
```
HA_BUILD $
cd external/libhybris/libhybris/
git remote add krnlyng https://github.com/krnlyng/libhybris
git fetch krnlyng
git cherry-pick 19829c0e2fcc60220ef5111cd4cda12a74c9f4d5; cd -
```

**NOTE:** It's possible and **required before syncing again** to use `repo sync -l` to reset your cloned repos to their pre-patch states, however at the cost of losing **any and all** local-only changes!

## Building HAL parts

Expand All @@ -66,15 +76,13 @@ HA_BUILD $ mka hybris-boot

## Building SFOS packages & rootfs<a name="building-sfos-packages-rootfs"></a>

To start (re)building all locally required SFOS packages & the rootfs, run the following command (full build takes ~20 minutes for me):
To pull updates and start (re)building all locally required SFOS packages & the rootfs, run the following command (full build takes ~20 minutes for me):
```
PLATFORM_SDK $ build_all_packages
```

As the rootfs `mic` build command line is now included in `build_packages.sh` steps, this is all you need to get a rather tiny (~340 MB) flashable SFOS zip file! Look into the [flashing guide](FLASHING.md) on how to proceed afterwards.

If instead you'd like to refresh your existing local copies by pulling updates and rebuilding, you can simply use the `-p` flag e.g. use `build_all_packages -p` to update & rebuild everything.

When just droid configs have been modified, `build_device_configs` will be enough. Same goes for droid HAL stuff with `build_droid_hal` instead. Building with these commands instead will be substantially faster than rebuilding everything (which is unnecessary 99% of the time anyways).

The rootfs build can still be triggered manually too if required via `run_mic_build`. This makes sense if you've just modified `droid-configs` for example and have no need to rebuild all packages for no reason again :)
10 changes: 5 additions & 5 deletions INITIAL-BUILDING.md
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ HOST $
mkdir ~/bin
curl https://storage.googleapis.com/git-repo-downloads/repo > ~/bin/repo
chmod a+x ~/bin/repo
chmod +x ~/bin/repo
```

## Setup the Platform SDK
Expand Down Expand Up @@ -66,8 +66,8 @@ When gaining control of the prompt we need to fetch the HADK Android tools for u
```
PLATFORM_SDK $
sudo zypper ref
sudo zypper --non-interactive in android-tools-hadk bc
sudo zypper ref -f
sudo zypper --non-interactive in bc pigz atruncate android-tools-hadk
```
**NOTE:** Repository errors for `adaptation0` can be safely ignored here and in the future.

Expand Down Expand Up @@ -116,7 +116,7 @@ git config --global user.email "your@email.com"

Once you can enter both PLATFORM_SDK and HA_BUILD environments, you can safely delete the leftover chroot filesystem archives from your home directory:
```
HA_BUILD $ cd && rm Jolla-latest-SailfishOS_Platform_SDK_Chroot-i486.tar.bz2 ubuntu-trusty-*-android-rootfs.tar.bz2
HA_BUILD $ cd && rm Jolla-latest-SailfishOS_Platform_SDK_Chroot-i486.tar.bz2 ubuntu-*-android-rootfs.tar.bz2
```

## Initializing local repo
Expand All @@ -126,7 +126,7 @@ When everything is ready to go we can finally init the local source repository:
HA_BUILD $
cd $ANDROID_ROOT
repo init -u git://github.com/mer-hybris/android.git -b hybris-16.0 --depth 1
repo init -u git://github.com/sailfishos-oneplus5/android.git -b hybris-16.0 --depth 1
git clone https://github.com/sailfishos-oneplus5/local_manifests -b hybris-16.0 .repo/local_manifests/
```

Expand Down
11 changes: 9 additions & 2 deletions files/.mersdk.profile
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,13 @@ alias do_mic_build="run_mic_build"
alias mic_build="run_mic_build"
alias build_sfos="run_mic_build"
alias build_sailfish="run_mic_build"
alias build_img="run_mic_build"
alias build_image="run_mic_build"
alias reset_droid_repos="sudo rm -rf $ANDROID_ROOT/rpm/ $ANDROID_ROOT/hybris/droid-{configs,hal-version-cheeseburger}* $ANDROID_ROOT/droid-hal-cheeseburger.log $ANDROID_ROOT/.last_device; choose_target"
alias reset_repos="reset_droid_repos"
alias choose_device="choose_target"
alias switch_target="choose_target"
alias switch_device="choose_target"

hadk() {
echo
Expand All @@ -32,7 +39,7 @@ clone_src() {
}

update_src() {
cd "$ANDROID_ROOT/$1/" && git fetch &> /dev/null && git pull &> /dev/null
cd "$ANDROID_ROOT/$1/" && git fetch &> /dev/null && git pull --recurse-submodules &> /dev/null
}

choose_target() {
Expand Down Expand Up @@ -120,7 +127,7 @@ run_mic_build() {
if (( $res == 0 )); then
# TODO Check if installed tooling is latest available from http://releases.sailfishos.org/sdk/targets/

# Only use latest tooling if it's actually newer
# Only use "latest version" if it's actually newer
vercomp "$LATEST_RELEASE" "$RELEASE"
res=$?
if (( $res == 2 )); then
Expand Down

0 comments on commit c51dc05

Please sign in to comment.