From 8332c013c923cf12723291c12d946ed1585f5943 Mon Sep 17 00:00:00 2001 From: Ola Redell Date: Fri, 10 Nov 2017 17:01:32 +0100 Subject: added jailhouse-dirs.inc and updated the jailhouse setup with the CELL variable to automatically add DEPENDS and RDEPENDS to the referred cells from the jailhouse recipe --- classes/jailhouse-cell.bbclass | 8 +++---- recipes-jailhouse/jailhouse/jailhouse-dirs.inc | 4 ++++ recipes-jailhouse/jailhouse/jailhouse.inc | 32 ++++++++------------------ recipes-jailhouse/jailhouse/jailhouse_0.6.bb | 2 ++ 4 files changed, 19 insertions(+), 27 deletions(-) create mode 100644 recipes-jailhouse/jailhouse/jailhouse-dirs.inc diff --git a/classes/jailhouse-cell.bbclass b/classes/jailhouse-cell.bbclass index 63a4cbc..f1cd6a0 100644 --- a/classes/jailhouse-cell.bbclass +++ b/classes/jailhouse-cell.bbclass @@ -1,12 +1,11 @@ +require recipes-jailhouse/jailhouse/jailhouse-dirs.inc + INMATE ?= "" CELLCONFIG ?= "" INMATE_TARGET ?= "${INMATE}" CELLCONFIG_TARGET ?= "${CELLCONFIG}" -INMATES_DIR ?= "${datadir}/jailhouse/inmates" -CELLCONF_DIR ?= "${datadir}/jailhouse/configs" - do_install() { if [ -n "${CELLCONFIG}" ] then @@ -21,4 +20,5 @@ do_install() { fi } -FILES_${PN} += "${INMATES_DIR} ${CELLCONF_DIR}" +FILES_${PN}-dev += "${CELLCONF_DIR}" +FILES_${PN} += "${INMATES_DIR}" diff --git a/recipes-jailhouse/jailhouse/jailhouse-dirs.inc b/recipes-jailhouse/jailhouse/jailhouse-dirs.inc new file mode 100644 index 0000000..df39d40 --- /dev/null +++ b/recipes-jailhouse/jailhouse/jailhouse-dirs.inc @@ -0,0 +1,4 @@ +JH_DATADIR ?= "${datadir}/jailhouse" +CELL_DIR ?= "${JH_DATADIR}/cells" +CELLCONF_DIR ?= "${JH_DATADIR}/configs" +INMATES_DIR ?= "${JH_DATADIR}/inmates" diff --git a/recipes-jailhouse/jailhouse/jailhouse.inc b/recipes-jailhouse/jailhouse/jailhouse.inc index 2c30725..3965fd1 100644 --- a/recipes-jailhouse/jailhouse/jailhouse.inc +++ b/recipes-jailhouse/jailhouse/jailhouse.inc @@ -14,23 +14,11 @@ DEPENDS = "virtual/kernel make-native python-mako-native dtc-native python-mako" S ="${WORKDIR}/git" -JH_DATADIR="${datadir}/jailhouse" -CELL_DIR ?= "${JH_DATADIR}/cells" -CELLCONF_DIR ?= "${JH_DATADIR}/configs" -INMATES_DIR ?= "${JH_DATADIR}/inmates" - -export PACKAGECONFIG_CONFARGS - +require jailhouse-dirs.inc inherit module pythonnative bash-completion do_configure() { - # Copy all cell configs included through PACKAGECONFIG - for arg in $(echo $PACKAGECONFIG_CONFARGS); do - if conf=$(echo $arg | grep -o "with-.*$"); - then - cp "${STAGING_DIR_HOST}/${CELLCONF_DIR}/${conf#with-}.c" ${S}/configs/ - fi - done + cp "${STAGING_DIR_HOST}/${CELLCONF_DIR}/"*.c ${S}/configs/ } USER_SPACE_CFLAGS = '${CFLAGS} -DLIBEXECDIR=\\\"${libexecdir}\\\" \ @@ -71,12 +59,10 @@ do_install() { PACKAGE_BEFORE_PN = "kernel-module-jailhouse" FILES_${PN} = "${base_libdir}/firmware ${libexecdir} ${sbindir} ${JH_DATADIR}" -PACKAGECONFIG ??= "freertos-cell freertos-demo1-cell freertos-demo3-cell freertos-ivshmem-demo" -PACKAGECONFIG[freertos-cell] = \ - "--with-freertos-cell,,freertos-cell,freertos-cell" -PACKAGECONFIG[freertos-demo1-cell] = \ - "--with-freertos-demo1-cell,,freertos-demo1-cell,freertos-demo1-cell" -PACKAGECONFIG[freertos-demo3-cell] = \ - "--with-freertos-demo3-cell,,freertos-demo3-cell,freertos-demo3-cell" -PACKAGECONFIG[freertos-ivshmem-demo] = \ - "--with-freertos-ivshmem-demo,,freertos-ivshmem-demo,freertos-ivshmem-demo" +python __anonymous () { + # Setup DEPENDS and RDEPENDS to included cells" + cells = d.getVar('CELLS', True) or "" + for cell in cells.split(): + d.appendVar('DEPENDS', ' ' + cell) + d.appendVar('RDEPENDS_${PN}', ' ' + cell) +} diff --git a/recipes-jailhouse/jailhouse/jailhouse_0.6.bb b/recipes-jailhouse/jailhouse/jailhouse_0.6.bb index 6c752f7..d0fc7f9 100644 --- a/recipes-jailhouse/jailhouse/jailhouse_0.6.bb +++ b/recipes-jailhouse/jailhouse/jailhouse_0.6.bb @@ -7,3 +7,5 @@ SRC_URI = "git://github.com/siemens/jailhouse.git;protocol=git \ " SRCREV = "81528e48763c8dfc10851c49968eb3d053d4b85c" + +CELLS = "freertos-cell freertos-demo1-cell freertos-demo3-cell freertos-ivshmem-demo" -- cgit v1.2.3-54-g00ecf