commit:     31d975c10785f4de73cd788285ccf2408aa54a30
Author:     Andreas K. Hüttel <dilfridge <AT> gentoo <DOT> org>
AuthorDate: Sat Aug  3 09:06:29 2024 +0000
Commit:     Andreas K. Hüttel <dilfridge <AT> gentoo <DOT> org>
CommitDate: Sat Aug  3 09:06:29 2024 +0000
URL:        https://gitweb.gentoo.org/proj/catalyst.git/commit/?id=31d975c1

stage1: make sure we bind-mount within the chroot dir, try 3, now with pathlib

Signed-off-by: Andreas K. Hüttel <dilfridge <AT> gentoo.org>

 catalyst/targets/stage1.py | 8 ++++++--
 1 file changed, 6 insertions(+), 2 deletions(-)

diff --git a/catalyst/targets/stage1.py b/catalyst/targets/stage1.py
index ba42d9b8..ae27cd0a 100644
--- a/catalyst/targets/stage1.py
+++ b/catalyst/targets/stage1.py
@@ -31,14 +31,18 @@ class stage1(StageBase):
         #    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'] / 
self.get_repo_location(name),
-                'target': normpath("/tmp/stage1root") / 
self.get_repo_location(name)
+                'source': self.settings['chroot_path'] / 
repo_loc.relative_to('/'),
+                'target': normpath("/tmp/stage1root") / 
repo_loc.relative_to('/')
             }
 
     def set_root_path(self):

Reply via email to