[Piuparts-devel] [Git][debian/piuparts][helmutg/improve-mount_proc] Explain why we bind mount ptmx when it exists

Helmut Grohne (@helmutg) gitlab at salsa.debian.org
Wed Nov 8 13:36:06 GMT 2023



Helmut Grohne pushed to branch helmutg/improve-mount_proc at Debian / piuparts


Commits:
cdd25f5e by Nicolas Dandrimont at 2023-11-08T13:35:20+00:00
Explain why we bind mount ptmx when it exists
- - - - -


1 changed file:

- piuparts.py


Changes:

=====================================
piuparts.py
=====================================
@@ -1800,8 +1800,11 @@ class Chroot:
         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):
+                # /dev/pts/ptmx has been created by the previous self.mount("devpts", ...), we can symlink /dev/ptmx to it.
                 os.symlink("pts/ptmx", dev_ptmx_rel_path)
             else:
+                # /dev/ptmx is an unknown entity. Override it with a safe bind mount of /dev/pts/ptmx.
+                # Unlinking the existing /dev/ptmx could fail, this is safer.
                 self.mount(self.relative("dev/pts/ptmx"), "/dev/ptmx", opts="bind", no_mkdir=True)
         p = subprocess.Popen(["tty"], stdout=subprocess.PIPE,
                              universal_newlines=True)



View it on GitLab: https://salsa.debian.org/debian/piuparts/-/commit/cdd25f5e8cfccedb0d8550451c0bb9bae31e5540

-- 
View it on GitLab: https://salsa.debian.org/debian/piuparts/-/commit/cdd25f5e8cfccedb0d8550451c0bb9bae31e5540
You're receiving this email because of your account on salsa.debian.org.


-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://alioth-lists.debian.net/pipermail/piuparts-devel/attachments/20231108/4230dfab/attachment.htm>


More information about the Piuparts-devel mailing list