Skip to contentSkip to conversation

package.bbclass: fix image_debugfs symlinks

PATCH In review William Hauser 2 participants 2 messages Nov 4, 2020 – Nov 8, 2020

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 package.bbclass: fix image_debugfs symlinks

Allow symlinks to be made in the debugfs by removing an incorrect check that would always prevent symlinks from being transferred over.

The comment in this code indicates that the code is meant to ensure symlinks are only copied to the debugfs if their target has already been copied, but instead checks for the existence of the symlink that has yet to be created. As a result this check always fails.

This check is safe to get rid of since we will only attempt to copy a symlink to the debugfs if it's original target exists and is an ELF. It is, however, still possible for a dead symlink to end up in the debugfs if its original target was stripped.

---
 meta/classes/package.bbclass | 8 --------
 1 file changed, 8 deletions(-)
meta/classes/package.bbclass +0 -8
index e6236c0bb2..47f3df2e13 100644
@@ -1258,14 +1258,6 @@ python split_and_strip_files () {
             src = file[len(dvar):]
             dest = debuglibdir + os.path.dirname(src) + debugdir + "/" + os.path.basename(src) + debugappend
             fpath = dvar + dest
-            # Skip it if the target doesn't exist
-            try:
-                s = os.stat(fpath)
-            except OSError as e:
-                (err, strerror) = e.args
-                if err != errno.ENOENT:
-                    raise
-                continue
 
             ltarget = symlinks[file]
             lpath = os.path.dirname(ltarget)
Signature · 1 line
2.15.1
#1 lore raw
Quoted 19 lines · William Hauser via lists.openembedded.org

Allow symlinks to be made in the debugfs by removing an incorrect check that
would always prevent symlinks from being transferred over.

The comment in this code indicates that the code is meant to ensure symlinks
are only copied to the debugfs if their target has already been copied, but
instead checks for the existence of the symlink that has yet to be created.
As a result this check always fails.

This check is safe to get rid of since we will only attempt to copy a symlink to the debugfs if it's original target exists and is an ELF. It
is, however, still possible for a dead symlink to end up in the debugfs
if its original target was stripped.

Quoted 4 lines
---
 meta/classes/package.bbclass | 8 --------
 1 file changed, 8 deletions(-)

Unfortunately this patch did show failures in testing:

https://autobuilder.yoctoproject.org/typhoon/#/builders/79/builds/1536

(and the other selftests failed the same way).

oe-selftest -r imagefeatures.ImageFeatures.test_image_gen_debugfs

is how to run that test.

Cheers,

Richard