Changes to the autobuilder's steps to select auto.conf variables and 'images' values from the force build GUI.
cover Changes to the autobuilder's steps to select auto.conf variables and 'images' values from the force build GUI.
From: Javier B Perez Hernandez <[email protected]>
With these changes in the autobuilders' steps you can select the image, the preferred kernel provider, the type of packages and the target machines of the force build GUI.
It also includes a buildset example to use these properties.
Javier B Perez Hernandez (4):
Added the 'multiple' and 'default' options for the
ChoiceStringParameter.
Added support for the custom_images property of the force build GUI Added support in CreateAutoConf.py for GUI properties 'packages' and
'machine'
Example of buildset to select auto.conf variables and 'images' from
force build GUI.
buildset-config.examples/build-image-machine.conf | 43 ++++++++++++++++++++++ .../site-packages/autobuilder/Autobuilder.py | 13 +++++-- .../autobuilder/buildsteps/BuildImages.py | 2 + .../autobuilder/buildsteps/CreateAutoConf.py | 4 ++ 4 files changed, 59 insertions(+), 3 deletions(-) create mode 100644 buildset-config.examples/build-image-machine.conf
Signature · 1 line
1.9.3
PATCH 2/4 Added support for the custom_images property of the force build GUI
From: Javier B Perez Hernandez <[email protected]>
BuildImages.py: Changed 'start' to support the custom_images property of the force build GUI and set 'images' variable.
--- lib/python2.7/site-packages/autobuilder/buildsteps/BuildImages.py | 2 ++ 1 file changed, 2 insertions(+)
lib/python2.7/site-packages/autobuilder/buildsteps/BuildImages.py +2 -0
@@ -36,6 +36,8 @@ class BuildImages(ShellCommand): self.layerversion_yoctobsp = self.getProperty("layerversion_yoctobsp") self.layerversion_core = self.getProperty("layerversion_core") self.machine = self.getProperty("MACHINE") + if self.getProperty("custom_images") is not None: + self.images = " ".join(self.getProperty("custom_images")) # core-image-basic rename # See: http://git.yoctoproject.org/cgit/cgit.cgi/poky/commit/?id=b7f1cca517bbd4191828c6bae32e0c5041f1ff19 # I hate making people change their configs, so support both.
Signature · 1 line
1.9.3
PATCH 1/4 Added the 'multiple' and 'default' options for the ChoiceStringParameter.
In reply to Javier B. PerezFrom: Javier B Perez Hernandez <[email protected]>
Autobuilder.py: I added the support for the 'multiple' and 'default' values in parseProps and CreateExtraSchedulerParams for the CoiceStringParameter property. The default value for 'multiple' is set as 'false'.
--- lib/python2.7/site-packages/autobuilder/Autobuilder.py | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-)
lib/python2.7/site-packages/autobuilder/Autobuilder.py +10 -3
@@ -128,6 +128,7 @@ class Autobuilder: self.prop_label="" self.prop_required="" self.prop_size="" + self.prop_multiple=None setattr(self, "prop_name", prop) for k, v in props[prop].iteritems(): setattr(self, "prop_"+str(k), v)
@@ -139,7 +140,8 @@ class Autobuilder: label=self.prop_label, required=self.prop_required, scheduler=buildset, - size=self.prop_size) + size=self.prop_size, + multiple=self.prop_multiple) self.schedprops.extend(schedpropstoextend) self.properties.append(self.prop_name)
@@ -284,7 +286,8 @@ class Autobuilder: label=None, required=None, size=None, - scheduler=""): + scheduler="", + multiple=None): supported_prop_types = ["ChoiceStringParameter", "StringParameter", "FixedParameter",
@@ -313,6 +316,8 @@ class Autobuilder: default = "" if prop_type == "ChoiceStringParameter": + if multiple is None: + multiple = False if choices is None: try: raise ABConfigError("your config file has a ChoiceStringParameter declaration that has no choices")
@@ -332,7 +337,9 @@ class Autobuilder: schedprops.append(ChoiceStringParameter(name=propid, label=label, required=required, - choices=choices)) + choices=choices, + default=default, + multiple=multiple)) elif prop_type=="StringParameter": schedprops.append(StringParameter(name=propid, label=label,
Signature · 1 line
1.9.3
PATCH 3/4 Added support in CreateAutoConf.py for GUI properties 'packages' and 'machine'
In reply to Javier B. PerezFrom: Javier B Perez Hernandez <[email protected]>
CreateAutoConf.py: 'start' modified to support the values custom_packages and custom_machine of force build GUI. Set the PACKAGE_CLASSES and MACHINE auto.conf properties accordingly.
--- lib/python2.7/site-packages/autobuilder/buildsteps/CreateAutoConf.py | 4 ++++ 1 file changed, 4 insertions(+)
lib/python2.7/site-packages/autobuilder/buildsteps/CreateAutoConf.py +4 -0
@@ -75,6 +75,8 @@ class CreateAutoConf(ShellCommand): if self.packages: self.classes = [ "package_%s" % p for p in self.packages.split() ] fout = fout + 'PACKAGE_CLASSES = "' + " ".join(self.classes) + '"\n' + elif self.getProperty("custom_packages") is not None: + fout = fout + 'PACKAGE_CLASSES = "' + " ".join([ "package_%s" % p for p in self.getProperty("custom_packages") ]) + '"\n' else: fout = fout + 'PACKAGE_CLASSES = "package_rpm package_deb package_ipk"\n' repo=self.getProperty("repository")
@@ -135,6 +137,8 @@ class CreateAutoConf(ShellCommand): if self.distro == "poky-rt": fout = fout + 'PREFERRED_PROVIDER_virtual/kernel="linux-yocto-rt" \n' machine=self.machine + if not machine and self.getProperty("custom_machine") is not None: + machine = self.getProperty("custom_machine") if layerversion is not None and int(layerversion) > 1: if self.machine == "atom-pc": machine = self.machine.replace("atom-pc", "genericx86")
Signature · 1 line
1.9.3
PATCH 4/4 Example of buildset to select auto.conf variables and 'images' from force build GUI.
In reply to Javier B. PerezFrom: Javier B Perez Hernandez <[email protected]>
build-image-machine.conf: created a new 'buildset' to select 'packages', 'machine' and 'PREFERRED_PROVIDER_virtual/kernel' auto.conf variables for CreateAutoConf step and the 'images' for BuildImages step in the force build GUI.
--- buildset-config.examples/build-image-machine.conf | 43 +++++++++++++++++++++++ 1 file changed, 43 insertions(+) create mode 100644 buildset-config.examples/build-image-machine.conf
buildset-config.examples/build-image-machine.conf new file +43 -0
@@ -0,0 +1,43 @@ +[build-image-machine] +builders: 'example-worker' +repos: [{'poky': + {'repourl':'git://git.yoctoproject.org/poky', + 'layerversion':{'core':'meta', 'yoctobsp':'meta-yocto-bsp'}, + 'branch':'master'}}] +props: [{'images':{'prop_type':'ChoiceStringParameter', + 'choices': ['core-image-base', 'core-image-clutter', + 'core-image-full-cmdline', 'core-image-minimal', + 'core-image-lsb-qt3', 'core-image-minimal', + 'core-image-minimal-dev', + 'core-image-minimal-initramfs', + 'core-image-minimal-mtdutils', + 'core-image-rt', 'core-image-rt-sdk', + 'core-image-sato', 'core-image-sato-dev', + 'core-image-sato-sdk', 'core-image-testmaster', + 'core-image-testmaster-initramfs', + 'core-image-weston', 'core-image-x11'], + 'name': 'images', + 'label':'<h3> Image:</h3>', + 'multiple': True, + 'default':['core-image-base','core-image-minimal','core-image-sato']}}, + {'prefered_kernel':{'prop_type':'ChoiceStringParameter', + 'choices': ['linux-yocto', 'linux-yocto-dev'], + 'name': 'prefered_kernel', + 'label':'<h3> PREFERRED_PROVIDER_virtual/kernel:</h3>'}}, + {'machine':{'prop_type':'ChoiceStringParameter', + 'choices': ['qemuarm', 'qemumips', 'qemuppc', 'qemux86', 'qemux86-64'], + 'name': 'machine', + 'label':'<h3> Machine:</h3>'}}, + {'packages':{'prop_type':'ChoiceStringParameter', + 'choices': ['rpm', 'deb', 'ipk'], + 'name': 'packages', + 'label':'<h3> Package type:</h3>', + 'multiple': True, + 'default':'deb'}}] +steps: [{'SetDest':{}}, + {'CheckOutLayers': {}}, + {'RunPreamble': {}}, + {'GetDistroVersion' : {'distro': 'poky'}}, + {'CreateAutoConf': {'devkernel': False, 'distro': 'poky'}}, + {'CreateBBLayersConf': {'buildprovider' : 'yocto'}}, + {'BuildImages': {}}]
Signature · 1 line
1.9.3