aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndreas K. Hüttel <dilfridge@gentoo.org>2020-07-20 03:24:30 +0300
committerAndreas K. Hüttel <dilfridge@gentoo.org>2020-07-20 03:25:23 +0300
commitb7e588333cbafa3a35a223614a960eed78464b79 (patch)
tree570bc698ddb633b4fb7250aab968461dfb6544a1
parentadd rv64 subarch names (all cflags magic is done in the profiles) (diff)
downloadcatalyst-b7e588333cbafa3a35a223614a960eed78464b79.tar.gz
catalyst-b7e588333cbafa3a35a223614a960eed78464b79.tar.bz2
catalyst-b7e588333cbafa3a35a223614a960eed78464b79.zip
Add "interpreter" parameter for qemu-user build support
Signed-off-by: Andreas K. Hüttel <dilfridge@gentoo.org>
-rw-r--r--catalyst/base/stagebase.py25
1 files changed, 24 insertions, 1 deletions
diff --git a/catalyst/base/stagebase.py b/catalyst/base/stagebase.py
index 776e1a71..0ddd359f 100644
--- a/catalyst/base/stagebase.py
+++ b/catalyst/base/stagebase.py
@@ -41,7 +41,7 @@ class StageBase(TargetBase, ClearBase, GenBase):
"cflags", "cxxflags", "fcflags", "fflags", "ldflags", "asflags",
"common_flags", "cbuild", "hostuse", "catalyst_use",
"distcc_hosts", "makeopts", "pkgcache_path", "kerncache_path",
- "compression_mode", "decompression_mode"])
+ "compression_mode", "decompression_mode", "interpreter"])
self.set_valid_build_kernel_vars(addlargs)
TargetBase.__init__(self, myspec, addlargs)
@@ -1061,6 +1061,22 @@ class StageBase(TargetBase, ClearBase, GenBase):
shutil.copy('/etc/resolv.conf', self.settings['chroot_path'] + '/etc/')
+ # Copy over the binary interpreter (qemu), if applicable; note that it's given
+ # as full path and goes to the same place in the chroot
+ if "interpreter" in self.settings:
+ if not os.path.exists(self.settings["interpreter"]):
+ raise CatalystError(
+ "Can't find interpreter " + self.settings["interpreter"],
+ print_traceback=True)
+
+ log.notice('Copying binary interpreter %s into chroot', self.settings['interpreter'])
+
+ if os.path.exists(self.settings['chroot_path'] + '/' + self.settings['interpreter']):
+ os.rename(self.settings['chroot_path'] + '/' + self.settings['interpreter'], self.settings['chroot_path'] + '/' + self.settings['interpreter'] + '.catalyst')
+
+ shutil.copy(self.settings['interpreter'],
+ self.settings['chroot_path'] + '/' + self.settings['interpreter'])
+
# Copy over the envscript, if applicable
if "envscript" in self.settings:
if not os.path.exists(self.settings["envscript"]):
@@ -1226,6 +1242,13 @@ class StageBase(TargetBase, ClearBase, GenBase):
if os.path.exists(hosts_file + '.catalyst'):
os.rename(hosts_file + '.catalyst', hosts_file)
+ # optionally clean up binary interpreter
+ if "interpreter" in self.settings:
+ if os.path.exists(self.settings['chroot_path'] + '/' + self.settings['interpreter'] + '.catalyst'):
+ os.rename(self.settings['chroot_path'] + '/' + self.settings['interpreter'] + '.catalyst', self.settings['chroot_path'] + '/' + self.settings['interpreter'])
+ else:
+ os.remove(self.settings['chroot_path'] + '/' + self.settings['interpreter'])
+
# optionally clean up portage configs
if ("portage_prefix" in self.settings and
"sticky-config" not in self.settings["options"]):