aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorEli Schwartz <eschwartz93@gmail.com>2024-02-22 15:40:26 -0500
committerAndreas K. Hüttel <dilfridge@gentoo.org>2024-03-03 19:50:45 +0100
commit1314c345cacfce8a5cd6036d66da0b5ab65c6adb (patch)
treeba4e9f28b962d4e4cd055b1ea17e681b5352b6c1
parentlivecd/files/README.txt: adjust nox -> nogui (diff)
downloadcatalyst-1314c345cacfce8a5cd6036d66da0b5ab65c6adb.tar.gz
catalyst-1314c345cacfce8a5cd6036d66da0b5ab65c6adb.tar.bz2
catalyst-1314c345cacfce8a5cd6036d66da0b5ab65c6adb.zip
avoid chrooting and running the $PATH to bash from outside the chroot
The API filename for bash is /bin/bash and that is where it is guaranteed to be. On merged-usr systems, `shutil.which('bash')` will search PATH and maybe find /usr/bin/bash first, since it is resolved as a symlink, but that path will then fail in the chroot if the chroot is not merged-usr. Even on merged-usr systems, app-shells/bash always, always, always installs to /bin/bash and lets portage handle the symlink. Signed-off-by: Eli Schwartz <eschwartz93@gmail.com> Signed-off-by: Andreas K. Hüttel <dilfridge@gentoo.org>
-rw-r--r--catalyst/base/stagebase.py5
1 files changed, 3 insertions, 2 deletions
diff --git a/catalyst/base/stagebase.py b/catalyst/base/stagebase.py
index dd00af45..4bcab30c 100644
--- a/catalyst/base/stagebase.py
+++ b/catalyst/base/stagebase.py
@@ -1458,11 +1458,12 @@ class StageBase(TargetBase, ClearBase, GenBase):
def enter_chroot(self):
chroot = command('chroot')
- bash = command('bash')
+ # verify existence only
+ command(os.path.join(self.settings['chroot_path'], '/bin/bash'))
log.notice("Entering chroot")
try:
- cmd([chroot, self.settings['chroot_path'], bash, '-l'],
+ cmd([chroot, self.settings['chroot_path'], '/bin/bash', '-l'],
env=self.env)
except CatalystError:
pass