Openembedded Core Discussions
 help / color / mirror / Atom feed
* [PATCH 0/2] extensible sdk fixes
@ 2016-05-02  0:13 Randy Witt
  2016-05-02  0:13 ` [PATCH 1/2] populate_sdk_ext: Change lockedsigs task mismatch to a warning Randy Witt
  2016-05-02  0:13 ` [PATCH 2/2] devtool: Fix build-sdk when pn doesn't match filename Randy Witt
  0 siblings, 2 replies; 5+ messages in thread
From: Randy Witt @ 2016-05-02  0:13 UTC (permalink / raw)
  To: openembedded-core

Fixes for the building a derivative sdk from the extensible sdk.

The following changes since commit f7b520878babbaa7527151f22c031ae160512753:

  poky: Switch to post release name/version (2016-04-29 07:58:46 +0100)

are available in the git repository at:

  git://git.yoctoproject.org/poky-contrib rewitt/esdk-fixes
  http://git.yoctoproject.org/cgit.cgi/poky-contrib/log/?h=rewitt/esdk-fixes

Randy Witt (2):
  populate_sdk_ext: Change lockedsigs task mismatch to a warning
  devtool: Fix build-sdk when pn doesn't match filename

 meta/classes/populate_sdk_ext.bbclass |  2 +-
 scripts/devtool                       |  3 +++
 scripts/lib/devtool/build_image.py    | 16 ++++++++++++----
 3 files changed, 16 insertions(+), 5 deletions(-)

-- 
2.5.5



^ permalink raw reply	[flat|nested] 5+ messages in thread

* [PATCH 1/2] populate_sdk_ext: Change lockedsigs task mismatch to a warning
  2016-05-02  0:13 [PATCH 0/2] extensible sdk fixes Randy Witt
@ 2016-05-02  0:13 ` Randy Witt
  2016-05-02  0:13 ` [PATCH 2/2] devtool: Fix build-sdk when pn doesn't match filename Randy Witt
  1 sibling, 0 replies; 5+ messages in thread
From: Randy Witt @ 2016-05-02  0:13 UTC (permalink / raw)
  To: openembedded-core

It has been determined that it is highly likely that users might get
signatures that don't match in an extensible sdk. This doesn't
necessarily happen with oe-core, so we can set the mismatch to an error
during testing if we like.

However, for the case where users are creating their own sdks, we don't
need an error halting their progress. locked-sigs will still function as
it should.

Signed-off-by: Randy Witt <randy.e.witt@linux.intel.com>
---
 meta/classes/populate_sdk_ext.bbclass | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/meta/classes/populate_sdk_ext.bbclass b/meta/classes/populate_sdk_ext.bbclass
index 87518d1..935d4e5 100644
--- a/meta/classes/populate_sdk_ext.bbclass
+++ b/meta/classes/populate_sdk_ext.bbclass
@@ -221,7 +221,7 @@ python copy_buildsystem () {
 
             # Error if the sigs in the locked-signature file don't match
             # the sig computed from the metadata.
-            f.write('SIGGEN_LOCKEDSIGS_TASKSIG_CHECK = "error"\n\n')
+            f.write('SIGGEN_LOCKEDSIGS_TASKSIG_CHECK = "warn"\n\n')
 
             # Hide the config information from bitbake output (since it's fixed within the SDK)
             f.write('BUILDCFG_HEADER = ""\n')
-- 
2.5.5



^ permalink raw reply related	[flat|nested] 5+ messages in thread

* [PATCH 2/2] devtool: Fix build-sdk when pn doesn't match filename
  2016-05-02  0:13 [PATCH 0/2] extensible sdk fixes Randy Witt
  2016-05-02  0:13 ` [PATCH 1/2] populate_sdk_ext: Change lockedsigs task mismatch to a warning Randy Witt
@ 2016-05-02  0:13 ` Randy Witt
  2016-05-02  1:34   ` [PATCH v2] " Paul Eggleton
  1 sibling, 1 reply; 5+ messages in thread
From: Randy Witt @ 2016-05-02  0:13 UTC (permalink / raw)
  To: openembedded-core

If an image with the filename foo.bb could be built using the name "bar"
instead, then build-sdk would fail to create the derivative sdk.

This was because the code assumed that the file name matched the target,
which is not necessarily the case.

Signed-off-by: Randy Witt <randy.e.witt@linux.intel.com>
---
 scripts/devtool                    |  3 +++
 scripts/lib/devtool/build_image.py | 16 ++++++++++++----
 2 files changed, 15 insertions(+), 4 deletions(-)

diff --git a/scripts/devtool b/scripts/devtool
index 4780390..f090427 100755
--- a/scripts/devtool
+++ b/scripts/devtool
@@ -86,6 +86,9 @@ class ConfigHandler(object):
         with open(self.config_file, 'w') as f:
             self.config_obj.write(f)
 
+    def set(self, section, option, value):
+        self.config_obj.set(section, option, value)
+
 class Context:
     def __init__(self, **kwargs):
         self.__dict__.update(kwargs)
diff --git a/scripts/lib/devtool/build_image.py b/scripts/lib/devtool/build_image.py
index e51d766..0f8ca93 100644
--- a/scripts/lib/devtool/build_image.py
+++ b/scripts/lib/devtool/build_image.py
@@ -72,12 +72,12 @@ def build_image(args, config, basepath, workspace):
     return result
 
 def build_image_task(config, basepath, workspace, image, add_packages=None, task=None, extra_append=None):
-    appendfile = os.path.join(config.workspace_path, 'appends',
-                              '%s.bbappend' % image)
-
     # remove <image>.bbappend to make sure setup_tinfoil doesn't
     # break because of it
-    if os.path.isfile(appendfile):
+    target_basename = config.get('SDK', 'target_basename', '')
+    if target_basename:
+        appendfile = os.path.join(config.workspace_path, 'appends',
+                                  '%s.bbappend' % target_basename)
         os.unlink(appendfile)
 
     tinfoil = setup_tinfoil(basepath=basepath)
@@ -88,6 +88,14 @@ def build_image_task(config, basepath, workspace, image, add_packages=None, task
     if not bb.data.inherits_class('image', rd):
         raise TargetNotImageError()
 
+    # Get the actual filename used and strip the .bb and full path
+    target_basename = rd.getVar('FILE', True)
+    target_basename = os.path.basename(target_basename).rsplit('.', 1)[0]
+    config.set('SDK', 'target_basename', target_basename)
+
+    appendfile = os.path.join(config.workspace_path, 'appends',
+                              '%s.bbappend' % target_basename)
+
     outputdir = None
     try:
         if workspace or add_packages:
-- 
2.5.5



^ permalink raw reply related	[flat|nested] 5+ messages in thread

* [PATCH v2] devtool: Fix build-sdk when pn doesn't match filename
  2016-05-02  0:13 ` [PATCH 2/2] devtool: Fix build-sdk when pn doesn't match filename Randy Witt
@ 2016-05-02  1:34   ` Paul Eggleton
  2016-05-09 22:46     ` [PATCH v3] " Paul Eggleton
  0 siblings, 1 reply; 5+ messages in thread
From: Paul Eggleton @ 2016-05-02  1:34 UTC (permalink / raw)
  To: openembedded-core

From: Randy Witt <randy.e.witt@linux.intel.com>

If an image with the filename foo.bb could be built using the name "bar"
instead, then build-sdk would fail to create the derivative sdk.

This was because the code assumed that the file name matched the target,
which is not necessarily the case.

Signed-off-by: Randy Witt <randy.e.witt@linux.intel.com>
Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com>
---

Changes since v1:
 * Ignore bbappend not existing when attempting to delete it, since
   that will be the case if devtool build-sdk is run a second time
 * Call config.write() so setting gets written out at the right time
 * Use os.path.splitext() rather than rsplit() - no difference in
   operation but if there's a function to do this we should use it

 scripts/devtool                    |  3 +++
 scripts/lib/devtool/build_image.py | 24 +++++++++++++++++++-----
 2 files changed, 22 insertions(+), 5 deletions(-)

diff --git a/scripts/devtool b/scripts/devtool
index 4780390..f090427 100755
--- a/scripts/devtool
+++ b/scripts/devtool
@@ -86,6 +86,9 @@ class ConfigHandler(object):
         with open(self.config_file, 'w') as f:
             self.config_obj.write(f)
 
+    def set(self, section, option, value):
+        self.config_obj.set(section, option, value)
+
 class Context:
     def __init__(self, **kwargs):
         self.__dict__.update(kwargs)
diff --git a/scripts/lib/devtool/build_image.py b/scripts/lib/devtool/build_image.py
index e51d766..1e5d09b 100644
--- a/scripts/lib/devtool/build_image.py
+++ b/scripts/lib/devtool/build_image.py
@@ -18,6 +18,7 @@
 """Devtool plugin containing the build-image subcommand."""
 
 import os
+import errno
 import logging
 
 from bb.process import ExecutionError
@@ -72,13 +73,17 @@ def build_image(args, config, basepath, workspace):
     return result
 
 def build_image_task(config, basepath, workspace, image, add_packages=None, task=None, extra_append=None):
-    appendfile = os.path.join(config.workspace_path, 'appends',
-                              '%s.bbappend' % image)
-
     # remove <image>.bbappend to make sure setup_tinfoil doesn't
     # break because of it
-    if os.path.isfile(appendfile):
-        os.unlink(appendfile)
+    target_basename = config.get('SDK', 'target_basename', '')
+    if target_basename:
+        appendfile = os.path.join(config.workspace_path, 'appends',
+                                  '%s.bbappend' % target_basename)
+        try:
+            os.unlink(appendfile)
+        except OSError as exc:
+            if exc.errno != errno.ENOENT:
+                raise
 
     tinfoil = setup_tinfoil(basepath=basepath)
     rd = parse_recipe(config, tinfoil, image, True)
@@ -88,6 +93,15 @@ def build_image_task(config, basepath, workspace, image, add_packages=None, task
     if not bb.data.inherits_class('image', rd):
         raise TargetNotImageError()
 
+    # Get the actual filename used and strip the .bb and full path
+    target_basename = rd.getVar('FILE', True)
+    target_basename = os.path.splitext(os.path.basename(target_basename))[0]
+    config.set('SDK', 'target_basename', target_basename)
+    config.write()
+
+    appendfile = os.path.join(config.workspace_path, 'appends',
+                              '%s.bbappend' % target_basename)
+
     outputdir = None
     try:
         if workspace or add_packages:
-- 
2.5.5



^ permalink raw reply related	[flat|nested] 5+ messages in thread

* [PATCH v3] devtool: Fix build-sdk when pn doesn't match filename
  2016-05-02  1:34   ` [PATCH v2] " Paul Eggleton
@ 2016-05-09 22:46     ` Paul Eggleton
  0 siblings, 0 replies; 5+ messages in thread
From: Paul Eggleton @ 2016-05-09 22:46 UTC (permalink / raw)
  To: openembedded-core

From: Randy Witt <randy.e.witt@linux.intel.com>

If an image with the filename foo.bb could be built using the name "bar"
instead, then build-sdk would fail to create the derivative sdk.

This was because the code assumed that the file name matched the target,
which is not necessarily the case.

Signed-off-by: Randy Witt <randy.e.witt@linux.intel.com>
Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com>
---

Changes since v2:
 * Ensure we create the config section in ConfigHandler.set() if it
   doesn't already exist

 scripts/devtool                    |  5 +++++
 scripts/lib/devtool/build_image.py | 24 +++++++++++++++++++-----
 2 files changed, 24 insertions(+), 5 deletions(-)

diff --git a/scripts/devtool b/scripts/devtool
index 4780390..9ac6e79 100755
--- a/scripts/devtool
+++ b/scripts/devtool
@@ -86,6 +86,11 @@ class ConfigHandler(object):
         with open(self.config_file, 'w') as f:
             self.config_obj.write(f)
 
+    def set(self, section, option, value):
+        if not self.config_obj.has_section(section):
+            self.config_obj.add_section(section)
+        self.config_obj.set(section, option, value)
+
 class Context:
     def __init__(self, **kwargs):
         self.__dict__.update(kwargs)
diff --git a/scripts/lib/devtool/build_image.py b/scripts/lib/devtool/build_image.py
index e51d766..1e5d09b 100644
--- a/scripts/lib/devtool/build_image.py
+++ b/scripts/lib/devtool/build_image.py
@@ -18,6 +18,7 @@
 """Devtool plugin containing the build-image subcommand."""
 
 import os
+import errno
 import logging
 
 from bb.process import ExecutionError
@@ -72,13 +73,17 @@ def build_image(args, config, basepath, workspace):
     return result
 
 def build_image_task(config, basepath, workspace, image, add_packages=None, task=None, extra_append=None):
-    appendfile = os.path.join(config.workspace_path, 'appends',
-                              '%s.bbappend' % image)
-
     # remove <image>.bbappend to make sure setup_tinfoil doesn't
     # break because of it
-    if os.path.isfile(appendfile):
-        os.unlink(appendfile)
+    target_basename = config.get('SDK', 'target_basename', '')
+    if target_basename:
+        appendfile = os.path.join(config.workspace_path, 'appends',
+                                  '%s.bbappend' % target_basename)
+        try:
+            os.unlink(appendfile)
+        except OSError as exc:
+            if exc.errno != errno.ENOENT:
+                raise
 
     tinfoil = setup_tinfoil(basepath=basepath)
     rd = parse_recipe(config, tinfoil, image, True)
@@ -88,6 +93,15 @@ def build_image_task(config, basepath, workspace, image, add_packages=None, task
     if not bb.data.inherits_class('image', rd):
         raise TargetNotImageError()
 
+    # Get the actual filename used and strip the .bb and full path
+    target_basename = rd.getVar('FILE', True)
+    target_basename = os.path.splitext(os.path.basename(target_basename))[0]
+    config.set('SDK', 'target_basename', target_basename)
+    config.write()
+
+    appendfile = os.path.join(config.workspace_path, 'appends',
+                              '%s.bbappend' % target_basename)
+
     outputdir = None
     try:
         if workspace or add_packages:
-- 
2.5.5



^ permalink raw reply related	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2016-05-09 22:47 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2016-05-02  0:13 [PATCH 0/2] extensible sdk fixes Randy Witt
2016-05-02  0:13 ` [PATCH 1/2] populate_sdk_ext: Change lockedsigs task mismatch to a warning Randy Witt
2016-05-02  0:13 ` [PATCH 2/2] devtool: Fix build-sdk when pn doesn't match filename Randy Witt
2016-05-02  1:34   ` [PATCH v2] " Paul Eggleton
2016-05-09 22:46     ` [PATCH v3] " Paul Eggleton

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox