cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
Highlighted
Contributor
Contributor
426 Views
Registered: ‎10-02-2018

Custom meta-layer petalinux 2017.4

I am looking to run a python flask web application on start up. Forgetting about the creation of the startup script firstly I want to validate that the dependencies for the application exist when booted. I have created my own layer (meta-myLayer) with the conf/ and recipes-core/ directorys.

In my conf/ is the layer.conf. Contents of layer.conf:

# We have a conf and classes directory, add to BBPATH
BBPATH .= ":${LAYERDIR}"

# We have recipes-* directories, add to BBFILES
BBFILES += "${LAYERDIR}/recipes-*/*/*.bb \
	${LAYERDIR}/recipes-*/*/*.bbappend"

BBFILE_COLLECTIONS += "meta-myLayer"
BBFILE_PATTERN_meta-myLayer = "^${LAYERDIR}/"
BBFILE_PRIORITY_meta-myLayer = "7"

In my recipes-core dir I have copied the python-flask_0.11.1.bb and python-flask.inc into it from the meta-python layer:

/opt/petalinux/components/yocto/source/arm/layers/meta-python/recipes-devtools/python

Contents of python-flask_0.11.1.bb:

inherit pypi setuptools
require python-flask.inc

Contents of python-flask.inc:

SUMMARY = "A microframework based on Werkzeug, Jinja2 and good intentions"
DESCRIPTION = "\
Flask is a microframework for Python based on Werkzeug, Jinja 2 and good \
intentions. And before you ask: It’s BSD licensed!"
HOMEPAGE = "https://github.com/mitsuhiko/flask/"
LICENSE = "BSD"
LIC_FILES_CHKSUM = "file://LICENSE;md5=19866b76b054ab30c270c0eb9d7e43d7"

SRC_URI[md5sum] = "d2af95d8fe79cf7da099f062dd122a08"
SRC_URI[sha256sum] = "b4713f2bfb9ebc2966b8a49903ae0d3984781d5c878591cf2f7b484d28756b0e"

PYPI_PACKAGE = "Flask"

RDEPENDS_${PN} = "${PYTHON_PN}-werkzeug ${PYTHON_PN}-jinja2 ${PYTHON_PN}-itsdangerous ${PYTHON_PN}-click ${PYTHON_PN}-certifi ${PYTHON_PN}-chardet ${PYTHON_PN}-Flask-Cors ${PYTHON_PN}-idna ${PYTHON_PN}-MarkupSafe ${PYTHON_PN}-requests ${PYTHON_PN}-six ${PYTHON_PN}-urlib3"

When I boot the system the packages and dependencies dont exist

0 Kudos
1 Reply
Highlighted
393 Views
Registered: ‎03-18-2019

As you create a new user layer, it must be enabled.
You can check if bitbake knows about your layer by calling it in a proper environment:
$ bitbake-layers show-layers

To enable:
First,
$ petalinux-config
    Yocto Settings ->
      user layers ->
        user layer 0 ->
          ${PROOT}/project-spec/meta-mylayername

Second, to build a recipe, add in file
<project-dir>/project-spec/meta-user/conf/petalinuxbsp.conf
some lines for a recipe:

IMAGE_INSTALL_append = " \
    bbexample-lt \ (example recipe, do not add this line)
    myrecipe-version \
"
Also, check this
https://xilinx-wiki.atlassian.net/wiki/spaces/A/pages/18842475/PetaLinux+Yocto+Tips
https://a4z.bitbucket.io/docs/BitBake/guide.html

Since there already is a flask recipe in recipes lib, you can enable it by simply adding it:
IMAGE_INSTALL_append = " \
    python3-flask \
"


0 Kudos