summaryrefslogtreecommitdiffstats
path: root/scripts/oe-debuginfod
diff options
context:
space:
mode:
Diffstat (limited to 'scripts/oe-debuginfod')
-rwxr-xr-xscripts/oe-debuginfod30
1 files changed, 21 insertions, 9 deletions
diff --git a/scripts/oe-debuginfod b/scripts/oe-debuginfod
index 967dd5807c..5e70d37b8b 100755
--- a/scripts/oe-debuginfod
+++ b/scripts/oe-debuginfod
@@ -1,5 +1,7 @@
1#!/usr/bin/env python3 1#!/usr/bin/env python3
2# 2#
3# Copyright OpenEmbedded Contributors
4#
3# SPDX-License-Identifier: MIT 5# SPDX-License-Identifier: MIT
4# 6#
5 7
@@ -13,19 +15,29 @@ scriptpath.add_bitbake_lib_path()
13 15
14import bb.tinfoil 16import bb.tinfoil
15import subprocess 17import subprocess
18import argparse
16 19
17if __name__ == "__main__": 20if __name__ == "__main__":
21 p = argparse.ArgumentParser()
22 p.add_argument("-d", action='store_true', \
23 help="store debuginfod files in project sub-directory")
24
25 args = p.parse_args()
26
18 with bb.tinfoil.Tinfoil() as tinfoil: 27 with bb.tinfoil.Tinfoil() as tinfoil:
19 tinfoil.prepare(config_only=True) 28 tinfoil.prepare(config_only=True)
20 package_classes_var = "DEPLOY_DIR_" + tinfoil.config_data.getVar("PACKAGE_CLASSES").split()[0].replace("package_", "").upper() 29 package_classes_var = "DEPLOY_DIR_" + tinfoil.config_data.getVar("PACKAGE_CLASSES").split()[0].replace("package_", "").upper()
21 feed_dir = tinfoil.config_data.getVar(package_classes_var, expand=True) 30 feed_dir = tinfoil.config_data.getVar(package_classes_var, expand=True)
22 31
23 try: 32 opts = [ '--verbose', '-R', '-U', feed_dir ]
24 if package_classes_var == "DEPLOY_DIR_RPM": 33
25 subprocess.check_output(subprocess.run(['oe-run-native', 'elfutils-native', 'debuginfod', '--verbose', '-R', feed_dir])) 34 if args.d:
26 else: 35 fdir = os.path.join(os.getcwd(), 'oedid-files')
27 subprocess.check_output(subprocess.run(['oe-run-native', 'elfutils-native', 'debuginfod', '--verbose', '-U', feed_dir])) 36 os.makedirs(fdir, exist_ok=True)
28 except subprocess.CalledProcessError: 37 opts += [ '-d', os.path.join(fdir, 'did.sqlite') ]
29 print("\nTo use the debuginfod server Please ensure that this variable PACKAGECONFIG_pn-elfutils-native = \"debuginfod libdebuginfod\" is set in the local.conf") 38
30 except KeyboardInterrupt: 39 subprocess.call(['bitbake', '-c', 'addto_recipe_sysroot', 'elfutils-native'])
31 sys.exit(1) 40
41 subprocess.call(['oe-run-native', 'elfutils-native', 'debuginfod'] + opts)
42 # we should not get here
43 print("\nTo use the debuginfod server please ensure that this variable PACKAGECONFIG:pn-elfutils-native = \"debuginfod libdebuginfod\" is set in the local.conf")