Development workflow

From OpenELEC
Jump to: navigation, search
20px   Development workflow

After compiling OpenELEC you may want to know how to make changes to the build system. This allows you to make patches and submit pull requests (PR's).

Customizing

The build system will check in two places for custom options. This makes it so you don't have to touch the stock options.

You can use multiple options files, and they will over ride each other. So you can have a overall options file and project specific options files.

~/.openelec/options
~/.openelec/PROJECT/options

PROJECT being one of the available projects in the projects directory in the source tree.

Scripts

Here is a description of scripts that you will you while making a patch

This will build a specific package in the build tree

PROJECT=Generic ARCH=x86_64 ./scripts/build kodi

This will clean (remove) a specific package from the build tree

PROJECT=Generic ARCH=x86_64 ./scripts/clean kodi

This will unpack a specific package into the build tree

PROJECT=Generic ARCH=x86_64 ./scripts/unpack kodi

This will pull the source from git/svn and package it for you. This is useful if you want to use a specific version or branch.

./tools/mkpkg/mkpkg_kodi

This will clean all build folders

make clean

This will make a release tarball that can be use to update OpenELEC easily

PROJECT=Generic ARCH=x86_64 make release

This will make an image that can be written directly to a disk

PROJECT=Generic ARCH=x86_64 make image


Creating A Patch

Here is the workflow to create a patch

PROJECT=Generic ARCH=x86_64 ./scripts/clean kodi
PROJECT=Generic ARCH=x86_64 ./scripts/unpack kodi
cd build.OpenELEC-Generic.i386-devel
cp -r kodi-14-b5dbdb5 kodi-14-b5dbdb5.orig

Make some changes to the kodi-14-b5dbdb5 package, then check the diff

diff -Naur kodi-14-b5dbdb5.orig kodi-14-b5dbdb5

If everything looks good,

diff -Naur kodi-14-b5dbdb5.orig kodi-14-b5dbdb5 > ../packages/mediacenter/kodi/patches/kodi-201-very-descriptive-name.patch
cd ..

Build it!

PROJECT=Generic ARCH=x86_64 ./scripts/clean kodi
PROJECT=Generic ARCH=x86_64 ./scripts/build kodi

Patch Notes

  • Patches must follow the same naming convention, however, sometimes different amounts of digits are used. Look at other patches to decide
  • Try and make the name descriptive without it being too long


Kernel Config

Adjusting the kernel config is best done by using the tools in the package, not by editing the kernel config directly

PROJECT=Generic ARCH=x86_64 ./scripts/clean linux
PROJECT=Generic ARCH=x86_64 ./scripts/unpack linux
cd build.OpenELEC-Generic.i386-devel/linux-3.19.0
cp ../../projects/Generic/linux/linux.x86_64.conf .config
make menuconfig

or

make xconfig

or

make qconfig

Make the changes you would like. Save them and exit the config utility

cp .config ../../projects/Generic/linux/linux.x86_64.conf
cd ../..

Then build it

PROJECT=Generic ARCH=x86_64 ./scripts/clean linux
PROJECT=Generic ARCH=x86_64 ./scripts/build linux