[meta-intel] [PATCH 21/31] machinesetuptool: a new recipe for setup of a machine

Tom Zanussi tom.zanussi at intel.com
Mon Sep 22 11:25:03 PDT 2014


On Mon, 2014-09-22 at 12:23 -0500, Kamble, Nitin A wrote:
> 
> On 9/22/14, 6:48 AM, "Zanussi, Tom" <tom.zanussi at intel.com> wrote:
> 
> >On Fri, 2014-09-19 at 17:35 -0700, Darren Hart wrote:
> >> On Thu, Sep 18, 2014 at 05:35:41PM -0700, nitin.a.kamble at intel.com
> >>wrote:
> >> > From: Nitin A Kamble <nitin.a.kamble at intel.com>
> >> > 
> >> > This recipe adds 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, and the required machine configuration files are
> >> > to be provided in the BSP layers.
> >> > 
> >> > This recipe is currently split in 2 files for ease of future
> >>migration of
> >> > the base recipe to the oecore layer.
> >> > 
> >> > Signed-off-by: Nitin A Kamble <nitin.a.kamble at intel.com>
> >> > ---
> >> >  .../machinesetuptool/machinesetuptool_git.bb       | 49
> >>++++++++++++++++++++++
> >> >  1 file changed, 49 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
> >> > new file mode 100644
> >> > index 0000000..0dfe242
> >> > --- /dev/null
> >> > +++ b/common/recipes-bsp/machinesetuptool/machinesetuptool_git.bb
> >> > @@ -0,0 +1,49 @@
> >> > +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 = "4cb28ca5de3385f6e16a1e3f69b1a8a79b75ace4"
> >> > +
> >> > +SRC_URI = "git://git.yoctoproject.org/machinesetuptool.git"
> >> > +
> >> > +S = "${WORKDIR}/git"
> >> > +
> >> > +PACKAGE_ARCH = "${MACHINE_ARCH}"
> >> > +
> >> > +inherit autotools pkgconfig update-rc.d
> >> > +
> >> > +INITSCRIPT_NAME = "machinesetuptool"
> >> > +INITSCRIPT_PARAMS = "start 00 S . stop 20 0 1 6 ."
> >> 
> >> Are these deliberate, or possibly copied from something else?
> >> 
> >> > +
> >> > +RRECOMMENDS_${PN} += "kernel-module-uinput"
> >> > +
> >> 
> >> Why does the machinesetuptool recommend a specific kernel module?
> >> 
> >> > +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)
> >> > +}
> >> 
> >> Hrm, does this dynamic SRC_URI creation play nice with all the bitbake
> >>hashing
> >> of recipes and such?
> >> 
> >> > +
> >> > +do_install_append() {
> >> > +	{
> >> > +	echo SUPPORTED_MACHINES=\"${SUPPORTED_MACHINES}\"
> >> > +	echo DEFAULT_MACHINE_SELECTION=${DEFAULT_MACHINE_SELECTION}
> >> 
> >> One quoted, one not.. should probably be consistent...
> >> 
> >> > +	} > ${D}/${sysconfdir}/${BPN}/defaults
> >> 
> >> I'd suggest a HERE document here.
> >> 
> >> http://tldp.org/LDP/abs/html/here-docs.html
> >> 
> >> (cat << EOF
> >> SUPPORTED_MACHINE="${SUPPORTED_MACHINES"
> >> DEFAULT_MACHINE_SELECTION="${DEFAULT_MACHINE_SELECTION}"
> >> EOF
> >> ) > ${D}/${sysconfdir}/${BPN}/defaults
> >> 
> >> Tested with bash and dash
> >> 
> >> > +
> >> > +	for file in ${MACHINE_CONFIG_FILES}
> >> > +	do
> >> > +		install -m 0644 ${S}/../${file} ${D}/${sysconfdir}/${BPN}/config/
> >> > +	done
> >> > +}
> >> > +
> >> > +# 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"
> >> 
> >> I'd move these above where they are used, and I'd assign them with ?=
> >>instead of
> >> =.
> >> 
> >> Before including this feature, I would also like to review the
> >>machinesetuptool
> >> itself.
> >> 
> >
> >And for that matter, why is it in a separate repo at all?  It doesn't
> >have any use outside of oe-core, correct?  Why not move it
> >into /scripts?
> 
> It needs the build support files as well. Like the configure, makefile
> etc. Will all these additional files can be populated in the script
> directory ?
> 

It seems most of the functionality is in machinetool/scripts anyway:

-rwxrwxr-x. 1 trz trz   17 Sep 19 13:07 detect-machine
-rwxrwxr-x. 1 trz trz 1403 Sep 19 13:07 machine-selection-menu
-rwxrwxr-x. 1 trz trz  547 Sep 19 13:07 machinesetuptool.in
-rw-rw-r--. 1 trz trz  173 Sep 19 13:07 Makefile.am

and all the config/Makefile/etc don't seem like they really do much.

Anyway, maybe it is needed, I don't know, my main point was that it
seems strange to have a separate repo for what amounts to a few lines of
shell script.  Or maybe doesn't belong in scripts/, maybe it could be
written as something to go into /classes.

Just some high-level questions noticed as I start taking a look at
things, with nothing else to orient me..

Tom

> Nitin
> 
> >
> >Tom
> >
> >> --
> >> Darren Hart
> >> Intel Open Source Technology Center
> >
> >
> 




More information about the meta-intel mailing list