[Piuparts-commits] [piuparts] 01/06: Create ${ENV}/dev/ptmx path if it doesn't exist

Holger Levsen holger at layer-acht.org
Thu Apr 12 18:21:25 UTC 2018


This is an automated email from the git hooks/post-receive script.

holger pushed a commit to branch develop
in repository piuparts.

commit d67c14baa47cf48c2b3c5b4f5f9576b39906252a
Author: Agustin Henze <tin at aayy.com.ar>
Date:   Tue Apr 10 16:58:55 2018 -0300

    Create ${ENV}/dev/ptmx path if it doesn't exist
    
    Signed-off-by: Agustin Henze <tin at aayy.com.ar>
---
 piuparts.py | 6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)

diff --git a/piuparts.py b/piuparts.py
index 90a2851..11bae67 100644
--- a/piuparts.py
+++ b/piuparts.py
@@ -1752,7 +1752,11 @@ class Chroot:
         if not os.path.lexists(etcmtab):
             os.symlink("../proc/mounts", etcmtab)
         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")):
+        dev_ptmx_rel_path = self.relative("dev/ptmx")
+        if not os.path.islink(dev_ptmx_rel_path):
+            if not os.path.exists(dev_ptmx_rel_path):
+                with open(dev_ptmx_rel_path, 'w'):
+                    pass
             self.mount(self.relative("dev/pts/ptmx"), "/dev/ptmx", opts="bind", no_mkdir=True)
         p = subprocess.Popen(["tty"], stdout=subprocess.PIPE)
         stdout, _ = p.communicate()

-- 
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