aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndreas K. Hüttel <dilfridge@gentoo.org>2022-11-12 21:42:03 +0100
committerAndreas K. Hüttel <dilfridge@gentoo.org>2022-11-13 03:17:29 +0100
commit64d2993d8ca38cefd76df7a69a44accd60284cd4 (patch)
tree0c8fa7a4989015511cc389cc54ae2b6c9417b4e3
parenttargets: build initial baselayout with USE=build (diff)
downloadcatalyst-64d2993d8ca38cefd76df7a69a44accd60284cd4.tar.gz
catalyst-64d2993d8ca38cefd76df7a69a44accd60284cd4.tar.bz2
catalyst-64d2993d8ca38cefd76df7a69a44accd60284cd4.zip
Allow "interpreter" parameter as space-separated list of files
I added this feature to the 3.0 branch long ago and forgot about it. Needed for multilib emulation, e.g., qemu-mips qemu-mipsn32 qemu-mips64 Tested on demeter "in production" Signed-off-by: Andreas K. Hüttel <dilfridge@gentoo.org>
-rw-r--r--catalyst/base/stagebase.py48
1 files changed, 24 insertions, 24 deletions
diff --git a/catalyst/base/stagebase.py b/catalyst/base/stagebase.py
index eb869c70..bcf596ae 100644
--- a/catalyst/base/stagebase.py
+++ b/catalyst/base/stagebase.py
@@ -1036,26 +1036,24 @@ 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
+ # Copy over the binary interpreter(s) (qemu), if applicable; note that they are given
+ # as space-separated list of full paths and go 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)
+ if isinstance(self.settings["interpreter"], str):
+ myints = [self.settings["interpreter"]]
+ else:
+ myints = self.settings["interpreter"]
- log.notice('Copying binary interpreter %s into chroot',
- self.settings['interpreter'])
+ for myi in myints:
+ if not os.path.exists(myi):
+ raise CatalystError("Can't find interpreter " + myi, print_traceback=True)
- 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')
+ log.notice('Copying binary interpreter %s into chroot', myi)
- shutil.copy(self.settings['interpreter'],
- self.settings['chroot_path'] + '/' + self.settings['interpreter'])
+ if os.path.exists(self.settings['chroot_path'] + '/' + myi):
+ os.rename(self.settings['chroot_path'] + '/' + myi, self.settings['chroot_path'] + '/' + myi + '.catalyst')
+
+ shutil.copy(myi, self.settings['chroot_path'] + '/' + myi)
# Copy over the envscript, if applicable
if "envscript" in self.settings:
@@ -1214,16 +1212,18 @@ class StageBase(TargetBase, ClearBase, GenBase):
if os.path.exists(hosts_file + '.catalyst'):
os.rename(hosts_file + '.catalyst', hosts_file)
- # optionally clean up binary interpreter
+ # optionally clean up binary interpreter(s)
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'])
+ if isinstance(self.settings["interpreter"], str):
+ myints = [self.settings["interpreter"]]
else:
- os.remove(
- self.settings['chroot_path'] + '/' + self.settings['interpreter'])
+ myints = self.settings["interpreter"]
+
+ for myi in myints:
+ if os.path.exists(self.settings['chroot_path'] + '/' + myi + '.catalyst'):
+ os.rename(self.settings['chroot_path'] + '/' + myi + '.catalyst', self.settings['chroot_path'] + '/' + myi)
+ else:
+ os.remove(self.settings['chroot_path'] + '/' + myi)
# optionally clean up portage configs
if ("portage_prefix" in self.settings and