[Piuparts-commits] [piuparts] 03/16: p: use a new instance of devpts inside the chroot
Holger Levsen
holger at layer-acht.org
Thu Apr 13 15:04:51 UTC 2017
This is an automated email from the git hooks/post-receive script.
holger pushed a commit to branch develop
in repository piuparts.
commit 281e5e81a5eee111b127f917376c6f4017fc4b62
Author: Andreas Beckmann <anbe at debian.org>
Date: Mon Apr 10 20:49:25 2017 +0200
p: use a new instance of devpts inside the chroot
inspired by a recent change in pbuilder
Signed-off-by: Andreas Beckmann <anbe at debian.org>
Signed-off-by: Holger Levsen <holger at layer-acht.org>
---
debian/changelog | 2 ++
piuparts.py | 9 ++++++---
2 files changed, 8 insertions(+), 3 deletions(-)
diff --git a/debian/changelog b/debian/changelog
index fad58b1..6d60d57 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -12,6 +12,8 @@ piuparts (0.77) UNRELEASED; urgency=medium
- Keep track of md5sums of the list of available packages in the chroot
to recognize mirror pushes during distupgrade tests and outdated
--end-meta meta-data.
+ - Mount a new devpts instance on /dev/pts and /dev/ptmx inside the chroot
+ for better pty separation from the host. Inspired by pbuilder.
* piupartslib/packagesdb.py:
- Add new state "outdated" to ignore packages if a dependency distro
already has a newer version. (Closes: #856846)
diff --git a/piuparts.py b/piuparts.py
index a57a651..9114307 100644
--- a/piuparts.py
+++ b/piuparts.py
@@ -1640,10 +1640,11 @@ class Chroot:
else:
return '/sys/fs/selinux'
- def mount(self, source, path, fstype=None, opts=None):
+ def mount(self, source, path, fstype=None, opts=None, no_mkdir=False):
"""Mount something into the chroot and remember it for unmount_all()."""
path = canonicalize_path(self.name, path)
- self.mkdir_p(path)
+ if not no_mkdir:
+ self.mkdir_p(path)
fullpath = self.relative(path)
command = ["mount"]
if fstype is not None:
@@ -1673,7 +1674,9 @@ class Chroot:
etcmtab = self.relative("etc/mtab")
if not os.path.lexists(etcmtab):
os.symlink("../proc/mounts", etcmtab)
- self.mount("devpts", "/dev/pts", fstype="devpts", opts="gid=5,mode=620")
+ self.mount("devpts", "/dev/pts", fstype="devpts", opts="newinstance,noexec,nosuid,gid=5,mode=0620,ptmxmode=0666")
+ if not os.path.islink(self.relative("dev/ptmx")):
+ self.mount(self.relative("dev/pts/ptmx"), "/dev/ptmx", opts="bind", no_mkdir=True)
self.mount("tmpfs", "/dev/shm", fstype="tmpfs", opts="size=65536k")
if selinux_enabled():
self.mount("/sys/fs/selinux", self.selinuxfs_path(), opts="bind,ro")
--
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/piuparts/piuparts.git
More information about the Piuparts-commits
mailing list