Skip to contentSkip to conversation

how to create debugfs while ruthlessly stripping image contents?

DISCUSSION Robert P. J. Day 2 participants 3 messages May 18, 2021

lore
Share & tools
lore
#0 lore raw

muh colleague just presented me with the following ... until
recently, build was properly producing bootable image while simultaneously creating companion debugfs. so far, so good.

then enough packages were added so that image didn't fit in target
eMMC, so decision was made to strip bins and libs in ${D} image/ directory via sneaking the following into do_install_append():

  ${STRIP} -p --strip-unneeded ${D}${bindir}/*
  ${STRIP} -p --strip-unneeded ${D}${libdir}/*

as soon as this kicked in, the complaint was that numerous objects were now missing from the debugfs, and i *suspect* (working to confirm) that, having stripped all those binaries and libraries before the packaging step kicks in, a lot of stuff that would have ended up in the debugfs is now bypassed since it lacks the appropriate debugging info anymore.

i'm looking at the various variables to see what would support:

1) stripping image-bound bins and libs, while
2) retaining debugging info to build debugfs

a stack overflow page suggests something like:

INHIBIT_PACKAGE_DEBUG_SPLIT = "1"
INHIBIT_PACKAGE_STRIP = "1"
DEBUG_BUILD = "1"
EXTRA_IMAGE_FEATURES_append = " dbg-pkgs"

but i'm open to what to set to get the desired effect.

rday

#1 lore raw
Quoted 10 lines · Robert P. J. Day

muh colleague just presented me with the following ... until
recently, build was properly producing bootable image while simultaneously creating companion debugfs. so far, so good.

then enough packages were added so that image didn't fit in target
eMMC, so decision was made to strip bins and libs in ${D} image/ directory via sneaking the following into do_install_append():

  ${STRIP} -p --strip-unneeded ${D}${bindir}/*
  ${STRIP} -p --strip-unneeded ${D}${libdir}/*

Did that actually help with the image size?

Quoted 6 lines

as soon as this kicked in, the complaint was that numerous objects were now missing from the debugfs, and i *suspect* (working to confirm) that, having stripped all those binaries and libraries before the packaging step kicks in, a lot of stuff that would have ended up in the debugfs is now bypassed since it lacks the appropriate debugging info anymore.

Yes, if you remove debug symbols before packaging then they won't be available to put in the -dbg packages.

Quoted 4 lines

i'm looking at the various variables to see what would support:

1) stripping image-bound bins and libs, while
2) retaining debugging info to build debugfs

Isn't that what happens by default?

Quoted 6 lines

a stack overflow page suggests something like:

INHIBIT_PACKAGE_DEBUG_SPLIT = "1"
INHIBIT_PACKAGE_STRIP = "1"
DEBUG_BUILD = "1"
EXTRA_IMAGE_FEATURES_append = " dbg-pkgs"

This came up on the list a few months ago. Enabling every possible option somehow related to debug as advised by stack overflow probably isn't the best approach. You need to decide if you want to have unstripped binaries in the image (in which case there's no need to install separate -dbg packages in the image too), if you want stripped binaries and -dbg packages in the image (in which case there's no point trying to disable splitting of debug symbols during packaging) or if you want debug symbols in a separate image / tar file (in which case you don't need to change packaging or the contents of the main image at all).

#2 lore raw
Quoted 10 lines · Andre McCurdy
Quoted 9 lines · Robert P. J. Day

muh colleague just presented me with the following ... until
recently, build was properly producing bootable image while simultaneously creating companion debugfs. so far, so good.

then enough packages were added so that image didn't fit in
target eMMC, so decision was made to strip bins and libs in ${D} image/ directory via sneaking the following into do_install_append():

Quoted 4 lines
Quoted 2 lines
  ${STRIP} -p --strip-unneeded ${D}${bindir}/*
  ${STRIP} -p --strip-unneeded ${D}${libdir}/*

Did that actually help with the image size?

reportedly, it did, but the installation process being used in this
case is decidedly non-standard and does some interesting end runs around normal YP processing so i'm not putting much stock in that.

Quoted 9 lines
Quoted 6 lines

as soon as this kicked in, the complaint was that numerous objects were now missing from the debugfs, and i *suspect* (working to confirm) that, having stripped all those binaries and libraries before the packaging step kicks in, a lot of stuff that would have ended up in the debugfs is now bypassed since it lacks the appropriate debugging info anymore.

Yes, if you remove debug symbols before packaging then they won't be available to put in the -dbg packages.

which is exactly what i suspected ... i'm poking around the code
right now to understand it better.

Quoted 6 lines
Quoted 4 lines

i'm looking at the various variables to see what would support:

1) stripping image-bound bins and libs, while
2) retaining debugging info to build debugfs

Isn't that what happens by default?

that's what i've come to understand but, again, the installation and
packaging process here is a little unusual and could be bypassing all sorts of normal YP processing.

Quoted 10 lines
Quoted 6 lines

a stack overflow page suggests something like:

INHIBIT_PACKAGE_DEBUG_SPLIT = "1"
INHIBIT_PACKAGE_STRIP = "1"
DEBUG_BUILD = "1"
EXTRA_IMAGE_FEATURES_append = " dbg-pkgs"

This came up on the list a few months ago. Enabling every possible option somehow related to debug as advised by stack overflow probably isn't the best approach.

i already figured out that the above was simply an example of one
approach, and not the one i wanted. but i think i'm converging on a solution.

rday