diff options
author | Joe Slater <joe.slater@windriver.com> | 2024-04-23 15:54:24 -0700 |
---|---|---|
committer | Richard Purdie <richard.purdie@linuxfoundation.org> | 2024-04-30 22:20:16 +0100 |
commit | a46e374d43748b3fa4a933930ff2feccdca557ef (patch) | |
tree | 0d1c8ec648acc23674e5ea040a5484f3a8b5fda6 | |
parent | 148eda4aeb7c0985c75b297710e262d1adf92c59 (diff) | |
download | poky-a46e374d43748b3fa4a933930ff2feccdca557ef.tar.gz |
oe-debuginfod: add option for data storage
Storing the data files under $HOME can be unreliable if debuginfod
is used for several projects, especially if $HOME is shared
between machines. We provide an option to save files under the
project directory. The default behavior is unchanged.
(From OE-Core rev: e1e0cf82f559077e2a51447baf137086202c0c4a)
Signed-off-by: Joe Slater <joe.slater@windriver.com>
Signed-off-by: Alexandre Belloni <alexandre.belloni@bootlin.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
-rwxr-xr-x | scripts/oe-debuginfod | 17 |
1 files changed, 16 insertions, 1 deletions
diff --git a/scripts/oe-debuginfod b/scripts/oe-debuginfod index b525310225..5e70d37b8b 100755 --- a/scripts/oe-debuginfod +++ b/scripts/oe-debuginfod | |||
@@ -15,14 +15,29 @@ scriptpath.add_bitbake_lib_path() | |||
15 | 15 | ||
16 | import bb.tinfoil | 16 | import bb.tinfoil |
17 | import subprocess | 17 | import subprocess |
18 | import argparse | ||
18 | 19 | ||
19 | if __name__ == "__main__": | 20 | if __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 | |||
20 | with bb.tinfoil.Tinfoil() as tinfoil: | 27 | with bb.tinfoil.Tinfoil() as tinfoil: |
21 | tinfoil.prepare(config_only=True) | 28 | tinfoil.prepare(config_only=True) |
22 | 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() |
23 | feed_dir = tinfoil.config_data.getVar(package_classes_var, expand=True) | 30 | feed_dir = tinfoil.config_data.getVar(package_classes_var, expand=True) |
24 | 31 | ||
32 | opts = [ '--verbose', '-R', '-U', feed_dir ] | ||
33 | |||
34 | if args.d: | ||
35 | fdir = os.path.join(os.getcwd(), 'oedid-files') | ||
36 | os.makedirs(fdir, exist_ok=True) | ||
37 | opts += [ '-d', os.path.join(fdir, 'did.sqlite') ] | ||
38 | |||
25 | subprocess.call(['bitbake', '-c', 'addto_recipe_sysroot', 'elfutils-native']) | 39 | subprocess.call(['bitbake', '-c', 'addto_recipe_sysroot', 'elfutils-native']) |
26 | 40 | ||
27 | subprocess.call(['oe-run-native', 'elfutils-native', 'debuginfod', '--verbose', '-R', '-U', feed_dir]) | 41 | subprocess.call(['oe-run-native', 'elfutils-native', 'debuginfod'] + opts) |
42 | # we should not get here | ||
28 | print("\nTo use the debuginfod server please ensure that this variable PACKAGECONFIG:pn-elfutils-native = \"debuginfod libdebuginfod\" is set in the local.conf") | 43 | print("\nTo use the debuginfod server please ensure that this variable PACKAGECONFIG:pn-elfutils-native = \"debuginfod libdebuginfod\" is set in the local.conf") |