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.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits)) (No client certificate requested) by finch.gentoo.org (Postfix) with ESMTPS id 95CDF159C9B for ; Sat, 3 Aug 2024 10:53:23 +0000 (UTC) Received: from pigeon.gentoo.org (localhost [127.0.0.1]) by pigeon.gentoo.org (Postfix) with SMTP id AECA7E2A2C; Sat, 3 Aug 2024 10:53:22 +0000 (UTC) Received: from smtp.gentoo.org (smtp.gentoo.org [IPv6:2001:470:ea4a:1:5054:ff:fec7:86e4]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by pigeon.gentoo.org (Postfix) with ESMTPS id 93EB9E2A2C for ; Sat, 3 Aug 2024 10:53:22 +0000 (UTC) Received: from oystercatcher.gentoo.org (oystercatcher.gentoo.org [148.251.78.52]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by smtp.gentoo.org (Postfix) with ESMTPS id B8F1E340441 for ; Sat, 3 Aug 2024 10:53:21 +0000 (UTC) Received: from localhost.localdomain (localhost [IPv6:::1]) by oystercatcher.gentoo.org (Postfix) with ESMTP id 1D3B61DCC for ; Sat, 3 Aug 2024 10:53: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: <1722682358.d4903c231ad2b338e1cb2e2ef9d8585b68e737df.dilfridge@gentoo> Subject: [gentoo-commits] proj/catalyst:master commit in: catalyst/base/, catalyst/targets/ X-VCS-Repository: proj/catalyst X-VCS-Files: catalyst/base/stagebase.py catalyst/targets/stage1.py X-VCS-Directories: catalyst/targets/ catalyst/base/ X-VCS-Committer: dilfridge X-VCS-Committer-Name: Andreas K. Hüttel X-VCS-Revision: d4903c231ad2b338e1cb2e2ef9d8585b68e737df X-VCS-Branch: master Date: Sat, 3 Aug 2024 10:53: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: c4a2edcc-782b-4edb-8b79-93192eee098f X-Archives-Hash: 3743508388cf2cf84fb0c727434d208e commit: d4903c231ad2b338e1cb2e2ef9d8585b68e737df Author: Andreas K. Hüttel gentoo org> AuthorDate: Sat Aug 3 10:52:38 2024 +0000 Commit: Andreas K. Hüttel gentoo org> CommitDate: Sat Aug 3 10:52:38 2024 +0000 URL: https://gitweb.gentoo.org/proj/catalyst.git/commit/?id=d4903c23 stagebase: Move ROOT repo bind mount logic to stagebase instead of stage1 Signed-off-by: Andreas K. Hüttel gentoo.org> catalyst/base/stagebase.py | 21 ++++++++++++++++++++- catalyst/targets/stage1.py | 21 --------------------- 2 files changed, 20 insertions(+), 22 deletions(-) diff --git a/catalyst/base/stagebase.py b/catalyst/base/stagebase.py index 2975236e..a23b1d90 100644 --- a/catalyst/base/stagebase.py +++ b/catalyst/base/stagebase.py @@ -223,13 +223,32 @@ class StageBase(TargetBase, ClearBase, GenBase): for path, name, _ in self.repos: name = get_repo_name(path) mount_id = f'repo_{name}' + root_mount_id = f'root_repo_{name}' + repo_loc = self.get_repo_location(name) self.mount[mount_id] = { 'enable': True, 'source': path, - 'target': self.get_repo_location(name) + 'target': repo_loc } + # In e.g. the stage1 build we need to make sure that the ebuild repositories are + # accessible within $ROOT too... otherwise relative symlinks may point nowhere + # and, e.g., portageq may malfunction due to missing profile. + # In the meantime we specifically fixed make.profile to point outside ROOT, so + # this may not be necessary at the moment anymore. Having it can prevent future + # surprises though. + # Create a second, bind mount entry for each repository. We need to + # take as source not the original source but the original target, since + # otherwise we may end up trying to mount the same squashfs twice instead + # of a bind mount + if self.settings['root_path'] != "/": + self.mount[root_mount_id] = { + 'enable': True, + 'source': self.settings['chroot_path'] / repo_loc.relative_to('/'), + 'target': self.settings['root_path'] / repo_loc.relative_to('/') + } + self.mount['distdir']['source'] = self.settings['distdir'] self.mount["distdir"]['target'] = self.settings['target_distdir'] diff --git a/catalyst/targets/stage1.py b/catalyst/targets/stage1.py index ae27cd0a..66f21a9c 100644 --- a/catalyst/targets/stage1.py +++ b/catalyst/targets/stage1.py @@ -23,27 +23,6 @@ class stage1(StageBase): def __init__(self, spec, addlargs): StageBase.__init__(self, spec, addlargs) - # In the stage1 build we need to make sure that the ebuild repositories are - # accessible within $ROOT too... otherwise relative symlinks may point nowhere - # and, e.g., portageq may malfunction due to missing profile. - # Create a second, bind mount entry for each repository. We need to - # * take as source not the original source but the original target, since - # otherwise we may end up trying to mount the same squashfs twice instead - # of a bind mount - # * take the directory inside the chroot as source, not the host directory - # In the meantime we fixed make.profile to point outside ROOT, so this may not - # be necessary at the moment anymore. Having it can prevent future surprises - # though. - self.set_chroot_path() - for path, name, _ in self.repos: - name = get_repo_name(path) - mount_id = f'root_repo_{name}' - repo_loc = self.get_repo_location(name) - self.mount[mount_id] = { - 'enable': True, - 'source': self.settings['chroot_path'] / repo_loc.relative_to('/'), - 'target': normpath("/tmp/stage1root") / repo_loc.relative_to('/') - } def set_root_path(self): # sets the root path, relative to 'chroot_path', of the stage1 root 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.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits)) (No client certificate requested) by finch.gentoo.org (Postfix) with ESMTPS id 62573159C9B for ; Fri, 9 Aug 2024 19:34:18 +0000 (UTC) Received: from pigeon.gentoo.org (localhost [127.0.0.1]) by pigeon.gentoo.org (Postfix) with SMTP id CCF622BC131; Fri, 9 Aug 2024 19:34:12 +0000 (UTC) Received: from smtp.gentoo.org (mail.gentoo.org [IPv6:2001:470:ea4a:1:5054:ff:fec7:86e4]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits)) (No client certificate requested) by pigeon.gentoo.org (Postfix) with ESMTPS id 540C02BC131 for ; Fri, 9 Aug 2024 19:34:12 +0000 (UTC) Received: from oystercatcher.gentoo.org (oystercatcher.gentoo.org [148.251.78.52]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits)) (No client certificate requested) by smtp.gentoo.org (Postfix) with ESMTPS id 7D4E93430F1 for ; Fri, 9 Aug 2024 19:34:11 +0000 (UTC) Received: from localhost.localdomain (localhost [IPv6:::1]) by oystercatcher.gentoo.org (Postfix) with ESMTP id 63FDE174C for ; Fri, 9 Aug 2024 19:34:08 +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: <1722682358.d4903c231ad2b338e1cb2e2ef9d8585b68e737df.dilfridge@gentoo> Subject: [gentoo-commits] proj/catalyst:dilfridge/qcow2 commit in: catalyst/base/, catalyst/targets/ X-VCS-Repository: proj/catalyst X-VCS-Files: catalyst/base/stagebase.py catalyst/targets/stage1.py X-VCS-Directories: catalyst/base/ catalyst/targets/ X-VCS-Committer: dilfridge X-VCS-Committer-Name: Andreas K. Hüttel X-VCS-Revision: d4903c231ad2b338e1cb2e2ef9d8585b68e737df X-VCS-Branch: dilfridge/qcow2 Date: Fri, 9 Aug 2024 19:34:08 +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: e8a990fa-837d-4fcb-b211-5440012542fb X-Archives-Hash: 78bb74f3fdc6addac9e064cf0718f6a5 Message-ID: <20240809193408.S4HKn7NICqt1qdERZet9G4wod6fS5wVgtlEIF6BzMCg@z> commit: d4903c231ad2b338e1cb2e2ef9d8585b68e737df Author: Andreas K. Hüttel gentoo org> AuthorDate: Sat Aug 3 10:52:38 2024 +0000 Commit: Andreas K. Hüttel gentoo org> CommitDate: Sat Aug 3 10:52:38 2024 +0000 URL: https://gitweb.gentoo.org/proj/catalyst.git/commit/?id=d4903c23 stagebase: Move ROOT repo bind mount logic to stagebase instead of stage1 Signed-off-by: Andreas K. Hüttel gentoo.org> catalyst/base/stagebase.py | 21 ++++++++++++++++++++- catalyst/targets/stage1.py | 21 --------------------- 2 files changed, 20 insertions(+), 22 deletions(-) diff --git a/catalyst/base/stagebase.py b/catalyst/base/stagebase.py index 2975236e..a23b1d90 100644 --- a/catalyst/base/stagebase.py +++ b/catalyst/base/stagebase.py @@ -223,13 +223,32 @@ class StageBase(TargetBase, ClearBase, GenBase): for path, name, _ in self.repos: name = get_repo_name(path) mount_id = f'repo_{name}' + root_mount_id = f'root_repo_{name}' + repo_loc = self.get_repo_location(name) self.mount[mount_id] = { 'enable': True, 'source': path, - 'target': self.get_repo_location(name) + 'target': repo_loc } + # In e.g. the stage1 build we need to make sure that the ebuild repositories are + # accessible within $ROOT too... otherwise relative symlinks may point nowhere + # and, e.g., portageq may malfunction due to missing profile. + # In the meantime we specifically fixed make.profile to point outside ROOT, so + # this may not be necessary at the moment anymore. Having it can prevent future + # surprises though. + # Create a second, bind mount entry for each repository. We need to + # take as source not the original source but the original target, since + # otherwise we may end up trying to mount the same squashfs twice instead + # of a bind mount + if self.settings['root_path'] != "/": + self.mount[root_mount_id] = { + 'enable': True, + 'source': self.settings['chroot_path'] / repo_loc.relative_to('/'), + 'target': self.settings['root_path'] / repo_loc.relative_to('/') + } + self.mount['distdir']['source'] = self.settings['distdir'] self.mount["distdir"]['target'] = self.settings['target_distdir'] diff --git a/catalyst/targets/stage1.py b/catalyst/targets/stage1.py index ae27cd0a..66f21a9c 100644 --- a/catalyst/targets/stage1.py +++ b/catalyst/targets/stage1.py @@ -23,27 +23,6 @@ class stage1(StageBase): def __init__(self, spec, addlargs): StageBase.__init__(self, spec, addlargs) - # In the stage1 build we need to make sure that the ebuild repositories are - # accessible within $ROOT too... otherwise relative symlinks may point nowhere - # and, e.g., portageq may malfunction due to missing profile. - # Create a second, bind mount entry for each repository. We need to - # * take as source not the original source but the original target, since - # otherwise we may end up trying to mount the same squashfs twice instead - # of a bind mount - # * take the directory inside the chroot as source, not the host directory - # In the meantime we fixed make.profile to point outside ROOT, so this may not - # be necessary at the moment anymore. Having it can prevent future surprises - # though. - self.set_chroot_path() - for path, name, _ in self.repos: - name = get_repo_name(path) - mount_id = f'root_repo_{name}' - repo_loc = self.get_repo_location(name) - self.mount[mount_id] = { - 'enable': True, - 'source': self.settings['chroot_path'] / repo_loc.relative_to('/'), - 'target': normpath("/tmp/stage1root") / repo_loc.relative_to('/') - } def set_root_path(self): # sets the root path, relative to 'chroot_path', of the stage1 root