Skip to contentSkip to conversation

A tool for boottime image configuration

PATCH In review [email protected] 4 participants 12 messages Aug 28, 2014 – Sep 5, 2014

lore
Share & tools
lore
#0 lore raw

cover A tool for boottime image configuration

From: Nitin A Kamble <[email protected]>

This pull request provides the base recipe for the Image Configurator tool, which provides ability to configure the BSP images for a particular hardware at boot time.

The recipe needs machine configuration files, which are to be provided in
the individual BSP layers. The meta-intel layer will be using this recipe to support multiple machines with common BSPs. There is nothing architecture specific here, and it can also be used by any other layer to consolidate multiple BSPs.

Thanks,
Nitin

The following changes since commit 669c07d6022174d01fe5a95b7b0faa9ef86da1e2:

bitbake: build/data: Write out more complete python run files (2014-08-28 15:12:45 +0100)

are available in the git repository at:

git://git.yoctoproject.org/poky-contrib nitin/misc
http://git.yoctoproject.org/cgit.cgi/poky-contrib/log/?h=nitin/misc

Nitin A Kamble (1):
imageconfigurator: a new recipe for boottime image configuration

 .../imageconfigurator/imageconfigurator_git.bb     | 50 ++++++++++++++++++++++
 1 file changed, 50 insertions(+)
 create mode 100644 meta/recipes-bsp/imageconfigurator/imageconfigurator_git.bb
Signature · 1 line
1.8.1.4
#1 lore raw

PATCH 1/1 imageconfigurator: a new recipe for boottime image configuration

From: Nitin A Kamble <[email protected]>

This recipe adds ability to configure a BSP image for a specific machine or platform at the boot time. The machine configurations are not provided here, and are to be provided in the BSP layers.

---
 .../imageconfigurator/imageconfigurator_git.bb     | 50 ++++++++++++++++++++++
 1 file changed, 50 insertions(+)
 create mode 100644 meta/recipes-bsp/imageconfigurator/imageconfigurator_git.bb
meta/recipes-bsp/imageconfigurator/imageconfigurator_git.bb new file +50 -0
new file mode 100644
index 0000000..7208ad0
@@ -0,0 +1,50 @@
+SUMMARY = "Daemon to configure an image for a specific machine at boot time."
+SECTION = "base"
+LICENSE = "GPLv3"
+LIC_FILES_CHKSUM = "file://COPYING;md5=d32239bcb673463ab874e80d47fae504"
+RDEPENDS_${PN} = "sysvinit sed"
+
+PE = "1"
+PV = "0.1+git${SRCPV}"
+
+SRCREV = "90603bed54f7c033a7b2f92214c21d011459844b"
+
+SRC_URI = "git://git.yoctoproject.org/imageconfigurator.git"
+
+S = "${WORKDIR}/git"
+
+PACKAGE_ARCH = "${MACHINE_ARCH}"
+
+inherit autotools pkgconfig update-rc.d
+
+INITSCRIPT_NAME = "imageconfigurator"
+INITSCRIPT_PARAMS = "start 00 S . stop 20 0 1 6 ."
+
+RRECOMMENDS_${PN} += "kernel-module-uinput"
+
+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)
+}
+
+do_install_append() {
+	{
+	echo SUPPORTED_MACHINES=${SUPPORTED_MACHINES}
+	echo DEFAULT_MACHINE_SELECTION=${DEFAULT_MACHINE_SELECTION}
+	} > ${D}/${sysconfdir}/${BPN}/defaults
+
+	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"
Signature · 1 line
1.8.1.4
#2 lore raw

Re: [PATCH 1/1] imageconfigurator: a new recipe for boottime image configuration

Quoted 18 lines · On 8/28/14, 1:47 PM, [email protected] wrote:

From: Nitin A Kamble <[email protected]>

This recipe adds ability to configure a BSP image for a specific machine or platform at the boot time. The machine configurations are not provided here, and are to be provided in the BSP layers.

---
  .../imageconfigurator/imageconfigurator_git.bb     | 50 ++++++++++++++++++++++
  1 file changed, 50 insertions(+)

create mode 100644 meta/recipes-bsp/imageconfigurator/imageconfigurator_git.bb

meta/recipes-bsp/imageconfigurator/imageconfigurator_git.bb new file +0 -0
new file mode 100644
index 0000000..7208ad0

meta/recipes-bsp/imageconfigurator/imageconfigurator_git.bb line 3

Quoted 3 lines
meta/recipes-bsp/imageconfigurator/imageconfigurator_git.bb new file +3 -0
@@ -0,0 +1,50 @@
+SUMMARY = "Daemon to configure an image for a specific machine at boot time."
+SECTION = "base"
+LICENSE = "GPLv3"

Any specific reason for GPLv3 vs GPLv2+? I have a number of customers who are still locked on GPLv2 images for the time being, and they are interested in this kind of tool.

--Mark

Quoted 48 lines
meta/recipes-bsp/imageconfigurator/imageconfigurator_git.bb new file +47 -0
+LIC_FILES_CHKSUM = "file://COPYING;md5=d32239bcb673463ab874e80d47fae504"
+RDEPENDS_${PN} = "sysvinit sed"
+
+PE = "1"
+PV = "0.1+git${SRCPV}"
+
+SRCREV = "90603bed54f7c033a7b2f92214c21d011459844b"
+
+SRC_URI = "git://git.yoctoproject.org/imageconfigurator.git"
+
+S = "${WORKDIR}/git"
+
+PACKAGE_ARCH = "${MACHINE_ARCH}"
+
+inherit autotools pkgconfig update-rc.d
+
+INITSCRIPT_NAME = "imageconfigurator"
+INITSCRIPT_PARAMS = "start 00 S . stop 20 0 1 6 ."
+
+RRECOMMENDS_${PN} += "kernel-module-uinput"
+
+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)
+}
+
+do_install_append() {
+	{
+	echo SUPPORTED_MACHINES=${SUPPORTED_MACHINES}
+	echo DEFAULT_MACHINE_SELECTION=${DEFAULT_MACHINE_SELECTION}
+	} > ${D}/${sysconfdir}/${BPN}/defaults
+
+	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"
#3 lore raw

Re: [PATCH 1/1] imageconfigurator: a new recipe for boottime image configuration

In reply to [email protected]
Quoted 1 line · On 28 August 2014 19:47, <[email protected]> wrote:

+PE = "1"

No need for an epoch.

Quoted 1 line

+PACKAGE_ARCH = "${MACHINE_ARCH}"

Wouldn't it be simpler to have this as normal architecture, and depend on a machine-specific data package?

Ross

#4 lore raw

Re: [PATCH 1/1] imageconfigurator: a new recipe for boottime image configuration

Thanks for the feedback Ross, My comments below.

Quoted 8 lines

-----Original Message-----
From: Burton, Ross [mailto:[email protected]]
Sent: Thursday, August 28, 2014 1:10 PM
To: Kamble, Nitin A
Cc: Hart, Darren; Purdie, Richard; Wold, Saul; OE-core
Subject: Re: [OE-core] [PATCH 1/1] imageconfigurator: a new recipe for boottime image configuration

Quoted 4 lines
Quoted 1 line · On 28 August 2014 19:47, <[email protected]> wrote:

+PE = "1"

No need for an epoch.

Commit changed on the contrib branch for this.

Quoted 5 lines
Quoted 2 lines

+PACKAGE_ARCH = "${MACHINE_ARCH}"

Wouldn't it be simpler to have this as normal architecture, and depend on a machine-specific data package?

This really need to be machine specific. For every BSP different files will be packaged.

Nitin

Quoted 2 lines

Ross

#5 lore raw

Re: [PATCH 1/1] imageconfigurator: a new recipe for boottime image configuration

Quoted 4 lines · Nitin A
Quoted 2 lines

Wouldn't it be simpler to have this as normal architecture, and depend on a machine-specific data package?

This really need to be machine specific. For every BSP different files will be packaged.

Sure, I was proposing an imageconfigurator that is not machine-specific, and then imageconfigurator-data packages that are per-BSP.

Ross

#6 lore raw

Re: [PATCH 1/1] imageconfigurator: a new recipe for boottime image configuration

Quoted 14 lines

-----Original Message-----
From: Burton, Ross [mailto:[email protected]]
Sent: Thursday, August 28, 2014 1:34 PM
To: Kamble, Nitin A
Cc: Hart, Darren; Purdie, Richard; Wold, Saul; OE-core
Subject: Re: [OE-core] [PATCH 1/1] imageconfigurator: a new recipe for boottime image configuration

Quoted 3 lines · Nitin A
Quoted 2 lines

Wouldn't it be simpler to have this as normal architecture, and depend on a machine-specific data package?

Quoted 7 lines
Quoted 1 line

This really need to be machine specific. For every BSP different files will be

packaged.

Sure, I was proposing an imageconfigurator that is not machine-specific, and then imageconfigurator-data packages that are per-BSP.

Ross

Ohh, That is a good idea. Do you have any example recipe for me to look at which is doing something similar?

Thanks,
Nitin

#7 lore raw

Re: [PATCH 1/1] imageconfigurator: a new recipe for boottime image configuration

Quoted 1 line · Nitin A

Ohh, That is a good idea. Do you have any example recipe for me to look at which is doing something similar?

It will just be a matter of imageconfigurator RRECOMMENDing imageconfigurator-data, and then imageconfigurator-data being machinearch and doing the per-machine magic however it wants.

Ross

#8 lore raw

Re: [PATCH 1/1] imageconfigurator: a new recipe for boottime image configuration

Quoted 6 lines

It will just be a matter of imageconfigurator RRECOMMENDing imageconfigurator-data, and then imageconfigurator-data being machinearch and doing the per-machine magic however it wants.

Ross

I see. That means the recipe will be split into two recipes. It would be cool, if it can be done with a single recipe. But that would need ability to mark different PACKAGE_ARCHS to different packages of the same recipe.

Splitting the recipe into two has other consequences.
1. The non-data recipe is of no use if the data recipe is not present.
2. The data recipe in the oecore layer will be empty, so it can be dropped from the oecore layer.
3. With that the 2 recipes go in two separate layers which need each other, which is an awkward organization of recipes.

Is there any better way to achieve the same without splitting the recipe into 2?

Thanks,
Nitin

#9 lore raw

Re: [PATCH 1/1] imageconfigurator: a new recipe for boottime image configuration

Quoted 6 lines · Nitin A
Quoted 6 lines

It will just be a matter of imageconfigurator RRECOMMENDing imageconfigurator-data, and then imageconfigurator-data being machinearch and doing the per-machine magic however it wants.

Ross

Quoted 8 lines

I see. That means the recipe will be split into two recipes. It would be cool, if it can be done with a single recipe. But that would need ability to mark different PACKAGE_ARCHS to different packages of the same recipe.

Splitting the recipe into two has other consequences.
1. The non-data recipe is of no use if the data recipe is not present.
2. The data recipe in the oecore layer will be empty, so it can be dropped from the oecore layer.
3. With that the 2 recipes go in two separate layers which need each other, which is an awkward organization of recipes.

Is there any better way to achieve the same without splitting the recipe into 2?

I think this recipe is small enough so I don't think adding another one will buy anything...

While on that, can you describe some use-cases you see which this can be used to cover?

Signature · 3 lines
Otavio Salvador                             O.S. Systems
http://www.ossystems.com.br        http://code.ossystems.com.br
Mobile: +55 (53) 9981-7854            Mobile: +1 (347) 903-9750
#10 lore raw

Re: [PATCH 1/1] imageconfigurator: a new recipe for boottime image configuration

Quoted 3 lines

I think this recipe is small enough so I don't think adding another one will buy anything...

Otavio, I agree with you here.

Quoted 3 lines

While on that, can you describe some use-cases you see which this can be used to cover?

We have common BSPs in meta-intel such as intel-corei7-64 and intel-core2-32. These are targeted for multiple platforms, but each platform need it's own configuration settings to make it fully useful. With this Image Configurator tool, one can select the target platform at boot time to get the Image completely configured for that platform. This ability signigicantly cuts down the number BSPs we need to maintain for various platforms. And same can be done with other architecture BSPs.

Thanks,
Nitin

Quoted 5 lines

--
Otavio Salvador O.S. Systems
http://www.ossystems.com.br http://code.ossystems.com.br
Mobile: +55 (53) 9981-7854 Mobile: +1 (347) 903-9750

#11 lore raw
In reply to [email protected]

I have changed name of the "Image Configurator" tool to "Machine Setup Tool". Also we have decided to host the recipe in the meta-intel layer instead of the oecore layer for the upcoming Yocto Project 1.7 release. And after further stabilization the recipe will be migrated to oecore layer before the YP 1.8 release.

Nitin

Quoted 45 lines

-----Original Message-----
From: Kamble, Nitin A
Sent: Thursday, August 28, 2014 11:47 AM
To: Hart, Darren; [email protected]; Wold, Saul; [email protected]
Cc: Kamble, Nitin A
Subject: [PATCH 0/1] A tool for boottime image configuration

From: Nitin A Kamble <[email protected]>

This pull request provides the base recipe for the Image Configurator tool, which provides ability to configure the BSP images for a particular hardware at boot time.

The recipe needs machine configuration files, which are to be provided in
the individual BSP layers. The meta-intel layer will be using this recipe to support multiple machines with common BSPs. There is nothing architecture specific here, and it can also be used by any other layer to consolidate multiple BSPs.

Thanks,
Nitin

The following changes since commit
669c07d6022174d01fe5a95b7b0faa9ef86da1e2:

bitbake: build/data: Write out more complete python run files (2014-08-28
15:12:45 +0100)

are available in the git repository at:

git://git.yoctoproject.org/poky-contrib nitin/misc
http://git.yoctoproject.org/cgit.cgi/poky-contrib/log/?h=nitin/misc

Nitin A Kamble (1):
imageconfigurator: a new recipe for boottime image configuration

 .../imageconfigurator/imageconfigurator_git.bb     | 50
++++++++++++++++++++++
 1 file changed, 50 insertions(+)
 create mode 100644 meta/recipes-

bsp/imageconfigurator/imageconfigurator_git.bb

--
1.8.1.4