Skip to content

Instantly share code, notes, and snippets.

@Herrie82
Last active March 4, 2021 07:44
Show Gist options
  • Save Herrie82/dfedabe4ebb497063fec48ef97d76861 to your computer and use it in GitHub Desktop.
Save Herrie82/dfedabe4ebb497063fec48ef97d76861 to your computer and use it in GitHub Desktop.
Halium 7.1/9.0 LuneOS build instruction
Short description on how to build LuneOS with Halium 7.1/9.0:
1. Build Halium as per guide on:
http://docs.halium.org/en/latest/
Basically the parts "Get Halium Source": https://docs.halium.org/en/latest/porting/get-sources.html
And https://docs.halium.org/en/latest/porting/build-sources.html#initialize
In general LuneOS only needs the system.img (and vendor.img for Halium 9.0 where available) created and archived, so the following commands will suffice:
For Halium 7.1:
breakfast devicename
mka systemimage
tar cvjf halium-luneos-7.1-20YYMMDD-1-devicename.tar.bz2 system.img
md5sum halium-luneos-7.1-20YYMMDD-1-devicename.tar.bz2 > halium-luneos-7.1-20YYMMDD-1-devicename.tar.bz2.md5sum
sha256sum halium-luneos-7.1-20YYMMDD-1-devicename.tar.bz2 > halium-luneos-7.1-20YYMMDD-1-devicename.tar.bz2.sha256sum
For Halium 9.0:
breakfast devicename
mka systemimage vendorimage
tar cvjf halium-luneos-9.0-20YYMMDD-1-devicename.tar.bz2 system.img vendor.img
md5sum halium-luneos-9.0-20YYMMDD-1-devicename.tar.bz2 > halium-luneos-9.0-20YYMMDD-1-devicename.tar.bz2.md5sum
sha256sum halium-luneos-9.0-20YYMMDD-1-devicename.tar.bz2 > halium-luneos-9.0-20YYMMDD-1-devicename.tar.bz2.sha256sum
You can now to start settin up your LuneOS build environment as per:
https://webos-ports.org/wiki/Build_for_Mido
Before the actual build ($ MACHINE=devicename bb luneos-dev-package) add the files for your target device similar to below to your build directory:
Changes to meta-smartphone, some examples (setup for Halium 7.1/9.0 are similar, just different "PREFERRED_VERSION_android-headers-halium" value (7.1/9.0) in your {mydevice}.conf. Some examples of required configurations:
https://github.com/Herrie82/meta-smartphone/commit/6ee40e06a0c832756f6abd90842eedb8cde71bc4
https://github.com/Tofee/meta-smartphone-1/commit/04efa43c6522bd46b0627981f10f111906d74405
In the "android-system-image-{mydevice}.bb" you add the halium image and md5/sha256 sum created above.
For Kernel config, you can use a defconfig for Mer/SFOS, that will work for LuneOS too in general since we're both using systemd, in addition LuneOS uses LXC as well.
LuneOS currently doesn't require any specific additional kernel flags. LuneOS uses new GCC (coming from Yocto project, currently GCC 10),
therefore older kernels might need some patches to get it to work with newer GCC.
With 3.18 kernels it are only a few:
https://github.com/shr-distribution/linux/commit/b0c57c510e57732291ae2a2c159cf9dfcb2ed1ba
https://github.com/shr-distribution/linux/commit/e1ca249e49d0f3371d94dd9dbe28a58e3eae3c6d
With 3.4 kernels more patches are needed to keep systemd happy as well:
https://github.com/shr-distribution/linux/commits/hammerhead/3.4/cm-12.1
Changes to meta-webos-ports, similar to these:
https://github.com/Tofee/meta-webos-ports/pull/2/files
The addition of ${MEMNOTIFY_RDEPENDS} to "meta-luneos/recipes-core/packagegroups/packagegroup-luneos-extended.bb":
RDEPENDS_${PN}_append_yggdrasil = " ${LIBHYBRIS_RDEPENDS} ${MEMNOTIFY_RDEPENDS}"
Assumes that you have made the following change to your kernel: https://github.com/shr-distribution/linux/commit/154357bba583889378648ebd096d7973c8ae96d3
In case you haven't you can simply suffice with leaving the "${MEMNOTIFY_RDEPENDS}" out, so: RDEPENDS_${PN}_append_yggdrasil = " ${LIBHYBRIS_RDEPENDS}"
Afterwards you should be able to build an image for your device with: $ MACHINE=devicename bb luneos-dev-package
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment