osbuid: introduce libdir

Run stages and the runner from a libdir, which is either $prefix/lib or
the current directory.
This commit is contained in:
Lars Karlitski 2019-06-13 19:30:19 +02:00
parent 48f8a7fc2a
commit e7b8f757d4

10
osbuild
View file

@ -8,6 +8,12 @@ import sys
import tempfile
if os.path.dirname(__file__) == f"{sys.prefix}/bin":
libdir = f"{sys.prefix}/lib"
else:
libdir = os.path.abspath(".")
RESET = "\033[0m"
BOLD = "\033[1m"
RED = "\033[31m"
@ -69,8 +75,8 @@ class BuildRoot:
}
binds = [
(f"{os.getcwd()}/run-stage", "/tmp/run-stage"),
(f"{os.getcwd()}/stages/{stage}", "/tmp/stage"),
(f"{libdir}/run-stage", "/tmp/run-stage"),
(f"{libdir}/stages/{stage}", "/tmp/stage"),
("/etc/pki", "/etc/pki")
]