* [gentoo-commits] proj/catalyst:master commit in: doc/, catalyst/base/, catalyst/
2021-01-28 1:54 [gentoo-commits] proj/catalyst:pending/mattst88 commit in: catalyst/base/, doc/, catalyst/ Matt Turner
@ 2021-01-23 16:22 ` Matt Turner
2021-01-29 23:50 ` [gentoo-commits] proj/catalyst:wip/mattst88 commit in: catalyst/, catalyst/base/, doc/ Matt Turner
1 sibling, 0 replies; 3+ messages in thread
From: Matt Turner @ 2021-01-23 16:22 UTC (permalink / raw
To: gentoo-commits
commit: 87b0588ab4f77e413c250a4a3e357624ec41c374
Author: Matt Turner <mattst88 <AT> gentoo <DOT> org>
AuthorDate: Mon Jan 18 16:52:20 2021 +0000
Commit: Matt Turner <mattst88 <AT> gentoo <DOT> org>
CommitDate: Sat Jan 23 16:22:22 2021 +0000
URL: https://gitweb.gentoo.org/proj/catalyst.git/commit/?id=87b0588a
catalyst: Add option to enter the chroot before building
With --enter-chroot, after the mounts and environment are set up,
catalyst will drop you into a shell inside the chroot. Useful for
hacking or debugging.
Signed-off-by: Matt Turner <mattst88 <AT> gentoo.org>
catalyst/base/stagebase.py | 16 +++++++++++++++-
catalyst/main.py | 4 ++++
doc/catalyst.1.txt | 3 +++
3 files changed, 22 insertions(+), 1 deletion(-)
diff --git a/catalyst/base/stagebase.py b/catalyst/base/stagebase.py
index 40b60af3..676206ff 100644
--- a/catalyst/base/stagebase.py
+++ b/catalyst/base/stagebase.py
@@ -20,7 +20,7 @@ from catalyst import log
from catalyst.context import namespace
from catalyst.defaults import (confdefaults, MOUNT_DEFAULTS, PORT_LOGDIR_CLEAN)
from catalyst.support import (CatalystError, file_locate, normpath,
- cmd, read_makeconf, get_repo_name, ismount,
+ cmd, command, read_makeconf, get_repo_name,
file_check, sanitize_name)
from catalyst.base.targetbase import TargetBase
from catalyst.base.clearbase import ClearBase
@@ -95,6 +95,9 @@ class StageBase(TargetBase, ClearBase, GenBase):
self.chroot_setup,
self.setup_environment,
]
+ if 'enter-chroot' in self.settings['options']:
+ self.build_sequence.append(self.enter_chroot)
+
self.finish_sequence = []
self.set_valid_build_kernel_vars(addlargs)
@@ -1326,6 +1329,17 @@ class StageBase(TargetBase, ClearBase, GenBase):
log.debug('setup_environment(); env = %r', self.env)
+ def enter_chroot(self):
+ chroot = command('chroot')
+ bash = command('bash')
+
+ log.notice("Entering chroot")
+ try:
+ cmd([chroot, self.settings['chroot_path'], bash, '-l'],
+ env=self.env)
+ except CatalystError:
+ pass
+
def run(self):
self.chroot_lock.write_lock()
diff --git a/catalyst/main.py b/catalyst/main.py
index 48daf004..b0d9015f 100644
--- a/catalyst/main.py
+++ b/catalyst/main.py
@@ -120,6 +120,8 @@ def get_parser():
parser.add_argument('-V', '--version',
action='version', version=get_version(),
help='display version information')
+ parser.add_argument('--enter-chroot', default=False, action='store_true',
+ help='Enter chroot before starting the build')
group = parser.add_argument_group('Program output options')
group.add_argument('-d', '--debug',
@@ -293,6 +295,8 @@ def _main(parser, opts):
options.append('purgetmponly')
if opts.clear_autoresume:
options.append('clear-autoresume')
+ if opts.enter_chroot:
+ options.append('enter-chroot')
# Make sure we have some work before moving further.
if not myspecfile and not mycmdline:
diff --git a/doc/catalyst.1.txt b/doc/catalyst.1.txt
index 90d5a24b..217fc86a 100644
--- a/doc/catalyst.1.txt
+++ b/doc/catalyst.1.txt
@@ -39,6 +39,9 @@ configuration file is installed at '/etc/catalyst/catalyst.conf'.
*-d*::
Enable debugging mode
+*--enter-chroot*::
+Enter the chroot before starting the build.
+
*--fetchonly*::
*-F*::
This tells *catalyst* to only fetch distfiles for the given packages without
^ permalink raw reply related [flat|nested] 3+ messages in thread
* [gentoo-commits] proj/catalyst:pending/mattst88 commit in: catalyst/base/, doc/, catalyst/
@ 2021-01-28 1:54 Matt Turner
2021-01-23 16:22 ` [gentoo-commits] proj/catalyst:master commit in: doc/, catalyst/base/, catalyst/ Matt Turner
2021-01-29 23:50 ` [gentoo-commits] proj/catalyst:wip/mattst88 commit in: catalyst/, catalyst/base/, doc/ Matt Turner
0 siblings, 2 replies; 3+ messages in thread
From: Matt Turner @ 2021-01-28 1:54 UTC (permalink / raw
To: gentoo-commits
commit: 87b0588ab4f77e413c250a4a3e357624ec41c374
Author: Matt Turner <mattst88 <AT> gentoo <DOT> org>
AuthorDate: Mon Jan 18 16:52:20 2021 +0000
Commit: Matt Turner <mattst88 <AT> gentoo <DOT> org>
CommitDate: Sat Jan 23 16:22:22 2021 +0000
URL: https://gitweb.gentoo.org/proj/catalyst.git/commit/?id=87b0588a
catalyst: Add option to enter the chroot before building
With --enter-chroot, after the mounts and environment are set up,
catalyst will drop you into a shell inside the chroot. Useful for
hacking or debugging.
Signed-off-by: Matt Turner <mattst88 <AT> gentoo.org>
catalyst/base/stagebase.py | 16 +++++++++++++++-
catalyst/main.py | 4 ++++
doc/catalyst.1.txt | 3 +++
3 files changed, 22 insertions(+), 1 deletion(-)
diff --git a/catalyst/base/stagebase.py b/catalyst/base/stagebase.py
index 40b60af3..676206ff 100644
--- a/catalyst/base/stagebase.py
+++ b/catalyst/base/stagebase.py
@@ -20,7 +20,7 @@ from catalyst import log
from catalyst.context import namespace
from catalyst.defaults import (confdefaults, MOUNT_DEFAULTS, PORT_LOGDIR_CLEAN)
from catalyst.support import (CatalystError, file_locate, normpath,
- cmd, read_makeconf, get_repo_name, ismount,
+ cmd, command, read_makeconf, get_repo_name,
file_check, sanitize_name)
from catalyst.base.targetbase import TargetBase
from catalyst.base.clearbase import ClearBase
@@ -95,6 +95,9 @@ class StageBase(TargetBase, ClearBase, GenBase):
self.chroot_setup,
self.setup_environment,
]
+ if 'enter-chroot' in self.settings['options']:
+ self.build_sequence.append(self.enter_chroot)
+
self.finish_sequence = []
self.set_valid_build_kernel_vars(addlargs)
@@ -1326,6 +1329,17 @@ class StageBase(TargetBase, ClearBase, GenBase):
log.debug('setup_environment(); env = %r', self.env)
+ def enter_chroot(self):
+ chroot = command('chroot')
+ bash = command('bash')
+
+ log.notice("Entering chroot")
+ try:
+ cmd([chroot, self.settings['chroot_path'], bash, '-l'],
+ env=self.env)
+ except CatalystError:
+ pass
+
def run(self):
self.chroot_lock.write_lock()
diff --git a/catalyst/main.py b/catalyst/main.py
index 48daf004..b0d9015f 100644
--- a/catalyst/main.py
+++ b/catalyst/main.py
@@ -120,6 +120,8 @@ def get_parser():
parser.add_argument('-V', '--version',
action='version', version=get_version(),
help='display version information')
+ parser.add_argument('--enter-chroot', default=False, action='store_true',
+ help='Enter chroot before starting the build')
group = parser.add_argument_group('Program output options')
group.add_argument('-d', '--debug',
@@ -293,6 +295,8 @@ def _main(parser, opts):
options.append('purgetmponly')
if opts.clear_autoresume:
options.append('clear-autoresume')
+ if opts.enter_chroot:
+ options.append('enter-chroot')
# Make sure we have some work before moving further.
if not myspecfile and not mycmdline:
diff --git a/doc/catalyst.1.txt b/doc/catalyst.1.txt
index 90d5a24b..217fc86a 100644
--- a/doc/catalyst.1.txt
+++ b/doc/catalyst.1.txt
@@ -39,6 +39,9 @@ configuration file is installed at '/etc/catalyst/catalyst.conf'.
*-d*::
Enable debugging mode
+*--enter-chroot*::
+Enter the chroot before starting the build.
+
*--fetchonly*::
*-F*::
This tells *catalyst* to only fetch distfiles for the given packages without
^ permalink raw reply related [flat|nested] 3+ messages in thread
* [gentoo-commits] proj/catalyst:wip/mattst88 commit in: catalyst/, catalyst/base/, doc/
2021-01-28 1:54 [gentoo-commits] proj/catalyst:pending/mattst88 commit in: catalyst/base/, doc/, catalyst/ Matt Turner
2021-01-23 16:22 ` [gentoo-commits] proj/catalyst:master commit in: doc/, catalyst/base/, catalyst/ Matt Turner
@ 2021-01-29 23:50 ` Matt Turner
1 sibling, 0 replies; 3+ messages in thread
From: Matt Turner @ 2021-01-29 23:50 UTC (permalink / raw
To: gentoo-commits
commit: 87b0588ab4f77e413c250a4a3e357624ec41c374
Author: Matt Turner <mattst88 <AT> gentoo <DOT> org>
AuthorDate: Mon Jan 18 16:52:20 2021 +0000
Commit: Matt Turner <mattst88 <AT> gentoo <DOT> org>
CommitDate: Sat Jan 23 16:22:22 2021 +0000
URL: https://gitweb.gentoo.org/proj/catalyst.git/commit/?id=87b0588a
catalyst: Add option to enter the chroot before building
With --enter-chroot, after the mounts and environment are set up,
catalyst will drop you into a shell inside the chroot. Useful for
hacking or debugging.
Signed-off-by: Matt Turner <mattst88 <AT> gentoo.org>
catalyst/base/stagebase.py | 16 +++++++++++++++-
catalyst/main.py | 4 ++++
doc/catalyst.1.txt | 3 +++
3 files changed, 22 insertions(+), 1 deletion(-)
diff --git a/catalyst/base/stagebase.py b/catalyst/base/stagebase.py
index 40b60af3..676206ff 100644
--- a/catalyst/base/stagebase.py
+++ b/catalyst/base/stagebase.py
@@ -20,7 +20,7 @@ from catalyst import log
from catalyst.context import namespace
from catalyst.defaults import (confdefaults, MOUNT_DEFAULTS, PORT_LOGDIR_CLEAN)
from catalyst.support import (CatalystError, file_locate, normpath,
- cmd, read_makeconf, get_repo_name, ismount,
+ cmd, command, read_makeconf, get_repo_name,
file_check, sanitize_name)
from catalyst.base.targetbase import TargetBase
from catalyst.base.clearbase import ClearBase
@@ -95,6 +95,9 @@ class StageBase(TargetBase, ClearBase, GenBase):
self.chroot_setup,
self.setup_environment,
]
+ if 'enter-chroot' in self.settings['options']:
+ self.build_sequence.append(self.enter_chroot)
+
self.finish_sequence = []
self.set_valid_build_kernel_vars(addlargs)
@@ -1326,6 +1329,17 @@ class StageBase(TargetBase, ClearBase, GenBase):
log.debug('setup_environment(); env = %r', self.env)
+ def enter_chroot(self):
+ chroot = command('chroot')
+ bash = command('bash')
+
+ log.notice("Entering chroot")
+ try:
+ cmd([chroot, self.settings['chroot_path'], bash, '-l'],
+ env=self.env)
+ except CatalystError:
+ pass
+
def run(self):
self.chroot_lock.write_lock()
diff --git a/catalyst/main.py b/catalyst/main.py
index 48daf004..b0d9015f 100644
--- a/catalyst/main.py
+++ b/catalyst/main.py
@@ -120,6 +120,8 @@ def get_parser():
parser.add_argument('-V', '--version',
action='version', version=get_version(),
help='display version information')
+ parser.add_argument('--enter-chroot', default=False, action='store_true',
+ help='Enter chroot before starting the build')
group = parser.add_argument_group('Program output options')
group.add_argument('-d', '--debug',
@@ -293,6 +295,8 @@ def _main(parser, opts):
options.append('purgetmponly')
if opts.clear_autoresume:
options.append('clear-autoresume')
+ if opts.enter_chroot:
+ options.append('enter-chroot')
# Make sure we have some work before moving further.
if not myspecfile and not mycmdline:
diff --git a/doc/catalyst.1.txt b/doc/catalyst.1.txt
index 90d5a24b..217fc86a 100644
--- a/doc/catalyst.1.txt
+++ b/doc/catalyst.1.txt
@@ -39,6 +39,9 @@ configuration file is installed at '/etc/catalyst/catalyst.conf'.
*-d*::
Enable debugging mode
+*--enter-chroot*::
+Enter the chroot before starting the build.
+
*--fetchonly*::
*-F*::
This tells *catalyst* to only fetch distfiles for the given packages without
^ permalink raw reply related [flat|nested] 3+ messages in thread
end of thread, other threads:[~2021-01-29 23:50 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2021-01-28 1:54 [gentoo-commits] proj/catalyst:pending/mattst88 commit in: catalyst/base/, doc/, catalyst/ Matt Turner
2021-01-23 16:22 ` [gentoo-commits] proj/catalyst:master commit in: doc/, catalyst/base/, catalyst/ Matt Turner
2021-01-29 23:50 ` [gentoo-commits] proj/catalyst:wip/mattst88 commit in: catalyst/, catalyst/base/, doc/ Matt Turner
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox