On 10/8/14, 5:32, "[email protected]" <[email protected]>
wrote:

>From: Nitin A Kamble <[email protected]>
>
>a new recipe which recipe provides the ability to setup a BSP image for a
>specific machine or platform at the boot time. The base recipe does not
>provide any machine configuration files, those are provided by individual
>BSP layer.
>
>Signed-off-by: Nitin A Kamble <[email protected]>
>---
> .../machinesetuptool/machinesetuptool_git.bb       | 48
>++++++++++++++++++++++
> 1 file changed, 48 insertions(+)
> create mode 100644
>common/recipes-bsp/machinesetuptool/machinesetuptool_git.bb
>
>diff --git a/common/recipes-bsp/machinesetuptool/machinesetuptool_git.bb
>b/common/recipes-bsp/machinesetuptool/machinesetuptool_git.bb

Hrm, what was the policy on _git.bb again? Iirc we are trying to do away
with them and use the PV there?

>new file mode 100644
>index 0000000..8101526
>--- /dev/null
>+++ b/common/recipes-bsp/machinesetuptool/machinesetuptool_git.bb
>@@ -0,0 +1,48 @@
>+SUMMARY = "Daemon to setup an image for a specific machine at boot time."
>+SECTION = "base"
>+LICENSE = "GPLv3"
>+LIC_FILES_CHKSUM = "file://COPYING;md5=d32239bcb673463ab874e80d47fae504"
>+RDEPENDS_${PN} = "sysvinit sed"
>+
>+PV = "1.0+git${SRCPV}"
>+
>+SRCREV = "07f7c30b9ed5509087ad591ba4cb2543df9f08e2"
>+
>+SRC_URI = "git://git.yoctoproject.org/machinesetuptool.git"
>+
>+S = "${WORKDIR}/git"
>+
>+PACKAGE_ARCH = "${MACHINE_ARCH}"


Heh... I *think* that's right... MACHINE_ARCH.... Yup

Kinda messes with your head a little bit doesn't it? :-)

>+
>+inherit autotools pkgconfig update-rc.d
>+
>+INITSCRIPT_NAME = "machinesetuptool"
>+INITSCRIPT_PARAMS = "start 00 S . stop 20 0 1 6 ."
>+
>+# following variables are initialized to empty values now.
>+# These need to be populated with the desired machine configurations
>+# for each BSP in it's own layer.
>+MACHINE_CONFIG_FILES ?= ""
>+SUPPORTED_MACHINES ?= ""
>+DEFAULT_MACHINE_SELECTION ?= "none"
>+
>+python __anonymous () {
>+    src_uri = d.getVar('SRC_URI', True)
>+    machine_config_files = (d.getVar('MACHINE_CONFIG_FILES', True) or "")
>+    for file in machine_config_files.split():
>+         src_uri += " file://" + file
>+    d.setVar('SRC_URI', src_uri)

OK.... Why not just do this in the bbappend? Is it just so much shorter
this way and less to maintain?

There is a tradeoff here between easily debuggable explicit meta-data, and
cleaner optimization like this. It appears as though there are a lot of
files, which probably tips us toward this solution, but I wanted to raise
the question.

>+}
>+
>+do_install_append() {
>+      (cat << EOF
>+SUPPORTED_MACHINES="${SUPPORTED_MACHINES}"
>+DEFAULT_MACHINE_SELECTION="${DEFAULT_MACHINE_SELECTION}"
>+EOF
>+      ) > ${D}/${sysconfdir}/${BPN}/defaults
>+
>+      for file in ${MACHINE_CONFIG_FILES}
>+      do
>+              install -m 0644 ${S}/../${file} 
>${D}/${sysconfdir}/${BPN}/config/

Seems as though it would makes sense to have this broken out into MACHINE
subdirectories.

Where is the ${BPN}/config directory created? We typically see that in the
install I believe.

>+      done
>+}
>-- 
>1.8.1.4

-- 
Darren Hart
Intel Open Source Technology Center



-- 
_______________________________________________
meta-intel mailing list
[email protected]
https://lists.yoctoproject.org/listinfo/meta-intel

Reply via email to