xref: /OK3568_Linux_fs/yocto/poky/scripts/oe-debuginfod (revision 4882a59341e53eb6f0b4789bf948001014eff981)
1*4882a593Smuzhiyun#!/usr/bin/env python3
2*4882a593Smuzhiyun#
3*4882a593Smuzhiyun# SPDX-License-Identifier: MIT
4*4882a593Smuzhiyun#
5*4882a593Smuzhiyun
6*4882a593Smuzhiyunimport os
7*4882a593Smuzhiyunimport sys
8*4882a593Smuzhiyunscripts_path = os.path.dirname(os.path.realpath(__file__))
9*4882a593Smuzhiyunlib_path = scripts_path + "/lib"
10*4882a593Smuzhiyunsys.path.insert(0, lib_path)
11*4882a593Smuzhiyunimport scriptpath
12*4882a593Smuzhiyunscriptpath.add_bitbake_lib_path()
13*4882a593Smuzhiyun
14*4882a593Smuzhiyunimport bb.tinfoil
15*4882a593Smuzhiyunimport subprocess
16*4882a593Smuzhiyun
17*4882a593Smuzhiyunif __name__ == "__main__":
18*4882a593Smuzhiyun    with bb.tinfoil.Tinfoil() as tinfoil:
19*4882a593Smuzhiyun        tinfoil.prepare(config_only=True)
20*4882a593Smuzhiyun        package_classes_var = "DEPLOY_DIR_" + tinfoil.config_data.getVar("PACKAGE_CLASSES").split()[0].replace("package_", "").upper()
21*4882a593Smuzhiyun        feed_dir = tinfoil.config_data.getVar(package_classes_var, expand=True)
22*4882a593Smuzhiyun
23*4882a593Smuzhiyun    subprocess.call(['bitbake', '-c', 'addto_recipe_sysroot', 'elfutils-native'])
24*4882a593Smuzhiyun
25*4882a593Smuzhiyun    subprocess.call(['oe-run-native', 'elfutils-native', 'debuginfod', '--verbose', '-R', '-U', feed_dir])
26*4882a593Smuzhiyun    print("\nTo use the debuginfod server please ensure that this variable PACKAGECONFIG:pn-elfutils-native = \"debuginfod libdebuginfod\" is set in the local.conf")
27