superna9999 / meta-meson

Upstream Linux Amlogic Meson Yocto/OpenEmbedded Layer
https://github.com/superna9999/meta-meson/wiki
MIT License
100 stars 67 forks source link
amlogic bsp linux open-embedded upstream yocto

Upstream Linux Amlogic Meson Yocto/Openembedded Layer

Now Amlogic SoCs of the Meson family are supported upstream :

This Yocto/Openembedded will help building images for these SoCs using the lastest uptream linux branch.

Build Setup

Create a home repository for the build :

$ mkdir amlogic-bsp

Checkout Yocto/Poky :

$ cd amlogic-bsp
amlogic-bsp$ git clone --depth 1 git://git.yoctoproject.org/poky -b nanbield poky

Checkout meta-meson :

amlogic-bsp$ git clone https://github.com/superna9999/meta-meson.git meta-meson -b nanbield

Initialize environment :

amlogic-bsp$ TEMPLATECONF=../meta-meson/conf/templates/default
amlogic-bsp$ source poky/oe-init-build-env
amlogic-bsp/build$ cp ../poky/meta-poky/conf/local.conf.sample conf/local.conf

or :

amlogic-bsp$ source poky/oe-init-build-env
amlogic-bsp/build$ bitbake-layers add-layer $PWD/../meta-meson/

Selecting Machine to build for

This layer aims to support all mainline supported boards, but some of them have a vendor U-Boot loaded on the eMMC and can only be booted by pressing the "update" button.

The libretech-cc, hardkernel-odroidc2, amlogic-p212 and khadas-vim are fully mainline sdcard images, with mainline U-Boot and mainline Linux with a single ext4 partition. To boot this image the eMMC u-boot must be disabled by erasing the first sectors of the eMMC or removing it for libretech-cc and hardkernel-odroidc2 boards.

Available S805 machines are :

Available S905 machines are :

Available S905D machines are :

Available S905X machines are :

Available S912 machines are :

Available A113d machine :

Available S905X2 machines are :

Available S905Y2 machines are :

Available S922X machines are :

Available A311D machines are :

Available S905X3/D3 machines are :

Available S9xxx machines are :

Selecting Image type

Images types available (in addition of standard Poky/OE images) :

Standard types are :

Building example

Building SD image for all S905 and S905X and S912 machines :

amlogic-bsp/build$ export MACHINE=amlogic-s9xxx
amlogic-bsp/build$ bitbake amlogic-image-sato

A .wic image will be generated in the tmp/deploy/images/$MACHINE/ directory.

This Image contains a FAT32 BOOT partition will the kernel uImage and .dtb, compatible with Amlogic U-Boot already flashed on your device.

For the amlogic-p212, khadas-vim and libretech-cc, Mainline U-Boot is automatically installed in a single ext4 partition .wic image in the tmp/deploy/images/$MACHINE/ directory.

Flash the .wic file with the Etcher tool from https://etcher.io/

Or for the connoisseurs :

You will be able to dd the image onto the raw SDcard like :

sudo dd if=tmp/deploy/images/libretech-cc/core-image-sato-libretech-cc.wic of=/dev/mmcblk0

Build with kas

The kas tool is installed via Python pip. The recommended way is to use an virtual environment for this.

$ python3 -m venv venv
$ source venv/bin/activate
$ pip3 install wheel kas

To start a build we just need to run the command kas build <configuration>.yml

$ source venv/bin/activate
$ DL_DIR=/data/downloads SSTATE_DIR=/data/sstate-cache kas build kas/kas-poky-meson.yml

The environment variable DL_DIR will allow to use a common place for the downloads across different projects. The same applies to the SSTATE_DIR variable.

To build for a specific machine use the environment variable KAS_MACHINE.

Please check the kas manual for more details.