From 3b87f2895add3944bffa430e209446defed57afa Mon Sep 17 00:00:00 2001 From: Michael Wood Date: Mon, 22 Aug 2016 16:42:32 +0100 Subject: [PATCH] bitbake: toaster: Fix oe-core fixture Due to a copy paste error we managed to get some of the wrong information in the oe fixture that provides a suggested default settings for Toaster. This meant it tested correctly when it shouldn't have. Fix: - The use of local bitbake - An incorrect call to realpath which didn't include its parent module. - The field used for the local_dir of an existing openembedded-core (Bitbake rev: d57a9124650e5367919668dfccf6aad4962a77f1) Signed-off-by: Michael Wood Signed-off-by: Elliot Smith Signed-off-by: Richard Purdie --- .../toaster/bldcontrol/localhostbecontroller.py | 10 ++++++---- .../management/commands/checksettings.py | 10 ++++++---- bitbake/lib/toaster/orm/fixtures/oe-core.xml | 16 +++++++++------- bitbake/lib/toaster/orm/fixtures/poky.xml | 6 ++++++ bitbake/lib/toaster/orm/fixtures/settings.xml | 17 +++++++---------- 5 files changed, 34 insertions(+), 25 deletions(-) diff --git a/bitbake/lib/toaster/bldcontrol/localhostbecontroller.py b/bitbake/lib/toaster/bldcontrol/localhostbecontroller.py index 283e154530..fbc5ee9d1d 100644 --- a/bitbake/lib/toaster/bldcontrol/localhostbecontroller.py +++ b/bitbake/lib/toaster/bldcontrol/localhostbecontroller.py @@ -98,8 +98,12 @@ class LocalhostBEController(BuildEnvironmentController): # 1. get a list of repos with branches, and map dirpaths for each layer gitrepos = {} - gitrepos[(bitbake.giturl, bitbake.commit)] = [] - gitrepos[(bitbake.giturl, bitbake.commit)].append( ("bitbake", bitbake.dirpath) ) + # if we're using a remotely fetched version of bitbake add its git + # details to the list of repos to clone + if bitbake.giturl and bitbake.commit: + gitrepos[(bitbake.giturl, bitbake.commit)] = [] + gitrepos[(bitbake.giturl, bitbake.commit)].append( + ("bitbake", bitbake.dirpath)) for layer in layers: # We don't need to git clone the layer for the CustomImageRecipe @@ -142,8 +146,6 @@ class LocalhostBEController(BuildEnvironmentController): logger.info("Using pre-checked out source for layer %s", cached_layers) - - # 3. checkout the repositories for giturl, commit in gitrepos.keys(): localdirname = os.path.join(self.be.sourcedir, self.getGitCloneDirectory(giturl, commit)) diff --git a/bitbake/lib/toaster/bldcontrol/management/commands/checksettings.py b/bitbake/lib/toaster/bldcontrol/management/commands/checksettings.py index 0dc55f63af..28b9945e8a 100644 --- a/bitbake/lib/toaster/bldcontrol/management/commands/checksettings.py +++ b/bitbake/lib/toaster/bldcontrol/management/commands/checksettings.py @@ -84,8 +84,9 @@ class Command(NoArgsCommand): print("Loading OE-Core configuration") call_command("loaddata", "oe-core") if template_conf: - oe_core_path = os.realpath(template_conf + - "/../") + oe_core_path = os.path.realpath( + template_conf + + "/../") else: print("TEMPLATECONF not found. You may have to" " manually configure layer paths") @@ -94,8 +95,9 @@ class Command(NoArgsCommand): "layer: ") # Update the layer instances of openemebedded-core for layer in Layer.objects.filter( - name="openembedded-core"): - layer.local_source_dir = oe_core_path + name="openembedded-core", + local_source_dir="OE-CORE-LAYER-DIR"): + layer.local_path = oe_core_path layer.save() # Import the custom fixture if it's present diff --git a/bitbake/lib/toaster/orm/fixtures/oe-core.xml b/bitbake/lib/toaster/orm/fixtures/oe-core.xml index 9572ef6923..d062de57f6 100644 --- a/bitbake/lib/toaster/orm/fixtures/oe-core.xml +++ b/bitbake/lib/toaster/orm/fixtures/oe-core.xml @@ -1,17 +1,19 @@ + + + DEFCONF_DISTRO + nodistro + + master git://git.openembedded.org/bitbake master - bitbake HEAD - git://git.openembedded.org/bitbake - HEAD - bitbake @@ -43,15 +45,15 @@ openembedded-core - git://git.openembedded.org/openembedded-core 1 - 0 2 + OE-CORE-LAYER-DIR HEAD - HEAD + meta + 0 diff --git a/bitbake/lib/toaster/orm/fixtures/poky.xml b/bitbake/lib/toaster/orm/fixtures/poky.xml index 373e43d81d..75a29168ea 100644 --- a/bitbake/lib/toaster/orm/fixtures/poky.xml +++ b/bitbake/lib/toaster/orm/fixtures/poky.xml @@ -1,5 +1,11 @@ + + + DEFCONF_DISTRO + poky + + master diff --git a/bitbake/lib/toaster/orm/fixtures/settings.xml b/bitbake/lib/toaster/orm/fixtures/settings.xml index 64a26f517b..78c0fdca7f 100644 --- a/bitbake/lib/toaster/orm/fixtures/settings.xml +++ b/bitbake/lib/toaster/orm/fixtures/settings.xml @@ -1,34 +1,31 @@ - + + DEFAULT_RELEASE master - + DEFCONF_PACKAGE_CLASSES package_rpm - + DEFCONF_MACHINE qemux86 - + DEFCONF_SSTATE_DIR ${TOPDIR}/../sstate-cache - + DEFCONF_IMAGE_INSTALL_append - + DEFCONF_IMAGE_FSTYPES ext3 jffs2 tar.bz2 - - DEFCONF_DISTRO - poky - DEFCONF_DL_DIR ${TOPDIR}/../downloads