meta-phosphor: os-release: add indirect for root directory
The `run_git` in phosphor's os-release.bbappend assumes that the
git repository is in `${COREBASE}`, which is the location of the
`meta/` subdirectory. This is true when building exclusively the
`openbmc` tree but may not be the case when external users attempt
to use the `openbmc` tree as a git-submodule. Create an indirection
(`OS_RELEASE_ROOTPATH`) which defaults to `COREBASE`, but allows
an override for those other use-cases.
Signed-off-by: Patrick Williams <patrick@stwcx.xyz>
Change-Id: I4e0171e065379c5030a36ea5be774b5db78bfe34
diff --git a/meta-phosphor/recipes-core/os-release/os-release.bbappend b/meta-phosphor/recipes-core/os-release/os-release.bbappend
index de9a02f..7e90ab3 100644
--- a/meta-phosphor/recipes-core/os-release/os-release.bbappend
+++ b/meta-phosphor/recipes-core/os-release/os-release.bbappend
@@ -5,9 +5,11 @@
# and pasting into another recipe ensure it is understood
# what that means!
+OS_RELEASE_ROOTPATH ?= "${COREBASE}"
+
def run_git(d, cmd):
try:
- oeroot = d.getVar('COREBASE', True)
+ oeroot = d.getVar('OS_RELEASE_ROOTPATH', True)
return bb.process.run(("export PSEUDO_DISABLED=1; " +
"git --work-tree %s --git-dir %s/.git %s")
% (oeroot, oeroot, cmd))[0].strip('\n')