Skip to contentSkip to conversation

image.bbclass: Add a method for creating a companion debug filesystem

PATCH In review Mark Hatle 2 participants 3 messages Nov 19, 2014 – Apr 20, 2015

lore
Share & tools
lore

Mark Hatle

author
#0 lore raw

PATCH 1/1 image.bbclass: Add a method for creating a companion debug filesystem

The companion debug filesystem contains only the package database and the complementary *-dbg packages for the main filesystem component. This is useful in a production environment to produce a companion filesystem capable of remote system debugging, without requiring corresponding debug symbols or source code on the device.

If dbg pkgs have already been installed to the rootfs image, the installation to companion debug filesystem will fail, because both of image creation make use of the same pm database.

In this situation, try to copy installed dbg files from rootfs image to companion debug filesystem.

---
 meta/classes/image.bbclass |  5 +++-
 meta/lib/oe/image.py       | 63 +++++++++++++++++++++++++++++++---------------
 meta/lib/oe/rootfs.py      | 56 +++++++++++++++++++++++++++++++++++++++++
 3 files changed, 103 insertions(+), 21 deletions(-)
meta/classes/image.bbclass +4 -1
index 940bdb6..6ca76f2 100644
@@ -24,6 +24,9 @@ IMAGE_FEATURES ?= ""
 IMAGE_FEATURES[type] = "list"
 IMAGE_FEATURES[validitems] += "debug-tweaks read-only-rootfs"
 
+# Generate companion debugfs?
+IMAGE_GEN_DEBUGFS ?= "0"
+
 # rootfs bootstrap install
 ROOTFS_BOOTSTRAP_INSTALL = "${@bb.utils.contains("IMAGE_FEATURES", "package-management", "", "${ROOTFS_PKGMANAGE_BOOTSTRAP}",d)}"
 
@@ -95,7 +98,7 @@ def rootfs_variables(d):
                  'SDK_OUTPUT','SDKPATHNATIVE','SDKTARGETSYSROOT','SDK_DIR','SDK_VENDOR','SDKIMAGE_INSTALL_COMPLEMENTARY','SDK_PACKAGE_ARCHS','SDK_OUTPUT','SDKTARGETSYSROOT','MULTILIBRE_ALLOW_REP',
                  'MULTILIB_TEMP_ROOTFS','MULTILIB_VARIANTS','MULTILIBS','ALL_MULTILIB_PACKAGE_ARCHS','MULTILIB_GLOBAL_VARIANTS','BAD_RECOMMENDATIONS','NO_RECOMMENDATIONS','PACKAGE_ARCHS',
                  'PACKAGE_CLASSES','TARGET_VENDOR','TARGET_VENDOR','TARGET_ARCH','TARGET_OS','OVERRIDES','BBEXTENDVARIANT','FEED_DEPLOYDIR_BASE_URI','INTERCEPT_DIR','BUILDNAME','USE_DEVFS',
-                 'STAGING_KERNEL_DIR','COMPRESSIONTYPES']
+                 'STAGING_KERNEL_DIR','COMPRESSIONTYPES','IMAGE_GEN_DEBUGFS']
     variables.extend(command_variables(d))
     variables.extend(variable_depends(d))
     return " ".join(variables)
meta/lib/oe/image.py +43 -20

131 lines not on this page · raw message

meta/lib/oe/rootfs.py +56 -0

80 lines not on this page · raw message

Signature · 1 line
1.9.3
Acked-by on v1 1/1
#1 lore raw
Quoted 16 lines · Mark Hatle

The companion debug filesystem contains only the package database and the complementary *-dbg packages for the main filesystem component. This is useful in a production environment to produce a companion filesystem capable
of remote system debugging, without requiring corresponding debug symbols or
source code on the device.

If dbg pkgs have already been installed to the rootfs image, the installation to companion debug filesystem will fail, because both of image creation make use of the same pm database.

Quoted 7 lines

In this situation, try to copy installed dbg files from rootfs image to companion debug filesystem.

This looks pretty good to me, nicely done.

Signature · 5 lines
Christopher Larson
clarson at kergoth dot com
Founder - BitBake, OpenEmbedded, OpenZaurus
Maintainer - Tslib
Senior Software Engineer, Mentor Graphics
#2 lore raw
Quoted 22 lines · Christopher Larson
Quoted 19 lines · Mark Hatle

The companion debug filesystem contains only the package database and the complementary *-dbg packages for the main filesystem component. This is useful in a production environment to produce a companion filesystem capable
of remote system debugging, without requiring corresponding debug symbols or
source code on the device.

If dbg pkgs have already been installed to the rootfs image, the installation to companion debug filesystem will fail, because both of image creation make use of the same pm database.

In this situation, try to copy installed dbg files from rootfs image to companion debug filesystem.

Quoted 9 lines
Quoted 4 lines

This looks pretty good to me, nicely done.

Following up on this, are there any objections to getting this merged for after fido?

Signature · 5 lines
Christopher Larson
clarson at kergoth dot com
Founder - BitBake, OpenEmbedded, OpenZaurus
Maintainer - Tslib
Senior Software Engineer, Mentor Graphics