Skip to content

Instantly share code, notes, and snippets.

@AngryMane
Last active December 19, 2022 13:30
Show Gist options
  • Save AngryMane/9e0f57dac862b209ae406a729c4fa4e5 to your computer and use it in GitHub Desktop.
Save AngryMane/9e0f57dac862b209ae406a729c4fa4e5 to your computer and use it in GitHub Desktop.
#! /usr/bin/env python3
import os
import sys
import warnings
warnings.simplefilter("default")
bindir = os.path.dirname(__file__)
topdir = os.path.dirname(bindir)
sys.path[0:0] = [os.path.join(topdir, 'lib')]
import bb.tinfoil
from bb.tinfoil import TinfoilConfigParameters
if __name__ == "__main__":
with bb.tinfoil.Tinfoil(tracking=True) as tinfoil:
config_params: TinfoilConfigParameters = TinfoilConfigParameters(
config_only=False, quiet=4
)
config_params.remote_server: str = "localhost:8081"
tinfoil.prepare(quiet=2, config_params=config_params)
# This can work around with just casting return value of server with dict.
ret = tinfoil.run_command("getRProviders")
print(ret)
# This can work around with just casting return value of server with dict.
ret = tinfoil.run_command("getRecipePackages")
print(ret)
# This can work around with just casting return value of server with dict.
ret = tinfoil.run_command("getRecipePackagesDynamic")
print(ret)
# This can work without any tricks.
d = tinfoil.parse_recipe("gcc")
ret = d.getVar("FILE", expand=True)
print(ret)
# This can not work around with just casting return value of server with dict, becuase this will return collections.abc.KeysView object.
ret = d.keys()
print(ret)
# Please copy bitbake-error to bitbake/bin dir before running this script.
# This script can run on poky root dir.
source oe-init-build-env
bitbake --server-only --bind localhost:8081
bitbake-error
bitbake -m
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment