From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from lists.gentoo.org (pigeon.gentoo.org [208.92.234.80]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by finch.gentoo.org (Postfix) with ESMTPS id B2194138359 for ; Mon, 20 Jul 2020 20:40:35 +0000 (UTC) Received: from pigeon.gentoo.org (localhost [127.0.0.1]) by pigeon.gentoo.org (Postfix) with SMTP id A0FEDE08BF; Mon, 20 Jul 2020 20:40:34 +0000 (UTC) Received: from smtp.gentoo.org (dev.gentoo.org [IPv6:2001:470:ea4a:1:5054:ff:fec7:86e4]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by pigeon.gentoo.org (Postfix) with ESMTPS id 8B860E08AD for ; Mon, 20 Jul 2020 20:40:34 +0000 (UTC) Received: from oystercatcher.gentoo.org (unknown [IPv6:2a01:4f8:202:4333:225:90ff:fed9:fc84]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.gentoo.org (Postfix) with ESMTPS id A82FA34F0B1 for ; Mon, 20 Jul 2020 20:40:33 +0000 (UTC) Received: from localhost.localdomain (localhost [IPv6:::1]) by oystercatcher.gentoo.org (Postfix) with ESMTP id 031392ED for ; Mon, 20 Jul 2020 20:40:20 +0000 (UTC) From: "Andreas K. Hüttel" To: gentoo-commits@lists.gentoo.org Content-Transfer-Encoding: 8bit Content-type: text/plain; charset=UTF-8 Reply-To: gentoo-dev@lists.gentoo.org, "Andreas K. Hüttel" Message-ID: <1595277593.22f59e6d758b3c4801a984ea6a3b4574407143c6.dilfridge@gentoo> Subject: [gentoo-commits] proj/catalyst:master commit in: catalyst/base/ X-VCS-Repository: proj/catalyst X-VCS-Files: catalyst/base/stagebase.py X-VCS-Directories: catalyst/base/ X-VCS-Committer: dilfridge X-VCS-Committer-Name: Andreas K. Hüttel X-VCS-Revision: 22f59e6d758b3c4801a984ea6a3b4574407143c6 X-VCS-Branch: master Date: Mon, 20 Jul 2020 20:40:20 +0000 (UTC) Precedence: bulk List-Post: List-Help: List-Unsubscribe: List-Subscribe: List-Id: Gentoo Linux mail X-BeenThere: gentoo-commits@lists.gentoo.org X-Auto-Response-Suppress: DR, RN, NRN, OOF, AutoReply X-Archives-Salt: ec162d73-cc21-4491-81b0-259cfdf83637 X-Archives-Hash: 2308d47d639e75936df3d2a7a84e7c3c commit: 22f59e6d758b3c4801a984ea6a3b4574407143c6 Author: Andreas K. Hüttel gentoo org> AuthorDate: Mon Jul 20 20:39:53 2020 +0000 Commit: Andreas K. Hüttel gentoo org> CommitDate: Mon Jul 20 20:39:53 2020 +0000 URL: https://gitweb.gentoo.org/proj/catalyst.git/commit/?id=22f59e6d Add "interpreter" parameter for qemu-user build support Signed-off-by: Andreas K. Hüttel gentoo.org> catalyst/base/stagebase.py | 28 ++++++++++++++++++++++++++++ 1 file changed, 28 insertions(+) diff --git a/catalyst/base/stagebase.py b/catalyst/base/stagebase.py index c2cc2c3e..0d3a418b 100644 --- a/catalyst/base/stagebase.py +++ b/catalyst/base/stagebase.py @@ -55,6 +55,7 @@ class StageBase(TargetBase, ClearBase, GenBase): "fflags", "hostuse", "install_mask", + "interpreter", "kerncache_path", "ldflags", "makeopts", @@ -938,6 +939,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 + 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"]): @@ -1105,6 +1124,15 @@ 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"]):