[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: Mounts / fstab on buildds



On 04.07.20 02:21, Scott Talbert wrote:
> On Fri, 3 Jul 2020, Philipp Kern wrote:
> 
>>> I'm trying to make sure my local sbuild chroot matches the buildd's as
>>> closely as possible.  Can someone tell me what the fstab looks like on
>>> the official buildd's?  I'm looking on barriere at the chroots there
>>> and it *appears* that the one in use is /etc/schroot/dsa/fstab, which
>>> contains:
>>>
>>> # fstab: static file system information for chroots.
>>> # Note that the mount point will be prefixed by the chroot path
>>> # (CHROOT_PATH)
>>> #
>>> # <file system>    <mount point>    <type>    <options>    <dump> <pass>
>>>
>>> # Linux version
>>> /proc        /proc        none    rw,bind        0    0
>>> /sys        /sys        none    rw,bind        0    0
>>> /dev        /dev        none    rw,bind        0    0
>>> /dev/pts    /dev/pts    none    rw,bind        0    0
>>> /home        /home        none    rw,bind        0    0
>>> /tmp        /tmp        none    rw,bind        0    0
>>> tmpfs-shm    /dev/shm    tmpfs    defaults,size=64m    0 0
>>>
>>> Can someone confirm that this is the fstab used on the buildd's?
>>
>> Are you sure you actually care about the fstab vs. the filesystem the
>> build is running under? The latter is what is odd, as builds happen
>> within tmpfs, which has slightly different semantics than other
>> filesystems.
> 
> Well, what I'm actually wondering about is the permissions on /dev/ptmx.
> On my local schroot, it is a symlink to /dev/pts/ptmx with root-only
> permissions:
> 
> (unstable-amd64-sbuild)talbert@debian-unstable:/$ ls -l /dev/ptmx
> lrwxrwxrwx 1 root root 8 Feb  5  2016 /dev/ptmx -> pts/ptmx
> (unstable-amd64-sbuild)talbert@debian-unstable:/$ ls -l /dev/pts/ptmx
> c--------- 1 root root 5, 2 Jun 17 19:13 /dev/pts/ptmx
> 
> On barriere, for example, it is not a symlink and has more open
> permissions:
> (sid_amd64-dchroot)swt2c@barriere:~$ ls -l /dev/ptmx
> crw-rw-rw- 1 root tty 5, 2 Jul  4  2020 /dev/ptmx
> 
> That's what let me to the fstab question, as it seems that barriere has
> /dev mounted, whereas my local schroot does not:
> udev on /dev type devtmpfs
> (rw,nosuid,relatime,size=4068732k,nr_inodes=1017183,mode=755)

/dev is not mounted, so it inherits the static bundle - which, to be
fair, is not the worst thing because that means it is clear which
devices exist. /dev/pts is mounted. However, as you found, /dev/ptmx is
thus a character device in itself and not a symlink to /dev/pts/ptmx.

The current, relevant fstab file is part of Puppet because it is
templated. It's available on [1].

Kind regards
Philipp Kern

[1]
https://salsa.debian.org/dsa-team/mirror/dsa-puppet/-/blob/master/modules/schroot/templates/schroot-buildd/fstab.erb


Reply to: