1 |
commit: 16155aaa9b09112a7a49d0c833b19be3399e746a |
2 |
Author: Yuta SATOH <nigoro.dev <AT> gmail <DOT> com> |
3 |
AuthorDate: Fri Dec 29 01:02:02 2017 +0000 |
4 |
Commit: Brian Dolbec <dolsen <AT> gentoo <DOT> org> |
5 |
CommitDate: Fri Dec 29 02:01:27 2017 +0000 |
6 |
URL: https://gitweb.gentoo.org/proj/catalyst.git/commit/?id=16155aaa |
7 |
|
8 |
main.py: Disable snakeoil's namespace module on Gentoo/FreeBSD #363557 |
9 |
|
10 |
Some code improvement by: Patrice Clement <monsieurp <AT> gentoo.org> |
11 |
Bug url: https://bugs.gentoo.org/363577 |
12 |
|
13 |
catalyst/main.py | 17 ++++++++++------- |
14 |
1 file changed, 10 insertions(+), 7 deletions(-) |
15 |
|
16 |
diff --git a/catalyst/main.py b/catalyst/main.py |
17 |
index 4c55a415..2d2faada 100644 |
18 |
--- a/catalyst/main.py |
19 |
+++ b/catalyst/main.py |
20 |
@@ -430,13 +430,16 @@ def _main(parser, opts): |
21 |
# catalyst cannot be run as a normal user due to chroots, mounts, etc |
22 |
log.critical('This script requires root privileges to operate') |
23 |
|
24 |
- # Start off by creating unique namespaces to run in. Would be nice to |
25 |
- # use pid & user namespaces, but snakeoil's namespace module has signal |
26 |
- # transfer issues (CTRL+C doesn't propagate), and user namespaces need |
27 |
- # more work due to Gentoo build process (uses sudo/root/portage). |
28 |
- namespaces.simple_unshare( |
29 |
- mount=True, uts=True, ipc=True, pid=False, net=False, user=False, |
30 |
- hostname='catalyst') |
31 |
+ # Namespaces aren't supported on *BSDs at the moment. So let's check |
32 |
+ # whether we're on Linux. |
33 |
+ if os.uname().sysname in ["Linux", "linux"]: |
34 |
+ # Start off by creating unique namespaces to run in. Would be nice to |
35 |
+ # use pid & user namespaces, but snakeoil's namespace module has signal |
36 |
+ # transfer issues (CTRL+C doesn't propagate), and user namespaces need |
37 |
+ # more work due to Gentoo build process (uses sudo/root/portage). |
38 |
+ namespaces.simple_unshare( |
39 |
+ mount=True, uts=True, ipc=True, pid=False, net=False, user=False, |
40 |
+ hostname='catalyst') |
41 |
|
42 |
# everything is setup, so the build is a go |
43 |
try: |