Hi,

On Wed, 13 Nov 2024 15:05:58 +0100 Chris Hofstaedtler <z...@debian.org> wrote:
> util-linux' upstream test suite tests very specific behaviours that
> involve the kernel and the underlying filesystem. To avoid broken
> tests, the testcases check for the filesystem they run on and skip
> tests if they are not prepared to run on a specific filesystem.
> 
> The most problematic filesystem appears to be tmpfs, which is also
> the filesystem employed the Debian buildds.
> 
> util-linux' test suite employs findmnt -T $PWD to check the
> filesystem. Unfortunately, in sbuild+unshare, this returns nothing.
> Apparently, this is because /proc/mounts has no entry for the
> directory in which the build runs.
> 
> It would be good if we could a) not duplicate work done already
> upstream (f.e. by hunting for these test failures and disabling them
> in Debian), and b) not introduce strange cases into the upstream
> test suite (building in a directory that has no mount point in
> /proc/mounts is certainly "strange").
> 
> Please see what can be done about this. I'll note that in schroot
> this "just works".
> 
> This bug report was triggered by an IRC discussion in #debian-buildd
> involving aurel32, josch, jochensp and me. The specific instance
> started as https://github.com/util-linux/util-linux/issues/3266
> aka Debian bug #1086706. A previous instance of this is the
> "fadvise/count" test, which I've previously marked as known-failing
> in unshare, without realizing what the problem was - but it's the
> same problem really.

it seems that util-linux worked around this issue in 
https://github.com/util-linux/util-linux/pull/3282

Nevertheless, the situation is less than ideal. This is how findmnt output
looks like inside sbuild unshare:

TARGET               SOURCE         FSTYPE     OPTIONS
/dev/null            udev[/null]    devtmpfs   
rw,nosuid,relatime,size=1780476k,nr_inodes=445119,mode=755,inod
/dev/zero            udev[/zero]    devtmpfs   
rw,nosuid,relatime,size=1780476k,nr_inodes=445119,mode=755,inod
/dev/full            udev[/full]    devtmpfs   
rw,nosuid,relatime,size=1780476k,nr_inodes=445119,mode=755,inod
/dev/random          udev[/random]  devtmpfs   
rw,nosuid,relatime,size=1780476k,nr_inodes=445119,mode=755,inod
/dev/urandom         udev[/urandom] devtmpfs   
rw,nosuid,relatime,size=1780476k,nr_inodes=445119,mode=755,inod
/dev/tty             udev[/tty]     devtmpfs   
rw,nosuid,relatime,size=1780476k,nr_inodes=445119,mode=755,inod
/dev/console         udev[/console] devtmpfs   
rw,nosuid,relatime,size=1780476k,nr_inodes=445119,mode=755,inod
/dev/pts             none           devpts     
rw,nosuid,noexec,relatime,gid=100005,mode=620,ptmxmode=666
/dev/shm             tmpfs          tmpfs      
rw,relatime,uid=100000,gid=100000,inode64
/sys                 sysfs          sysfs      rw,nosuid,nodev,noexec,relatime
├─/sys/kernel/security
│                    securityfs     securityfs rw,nosuid,nodev,noexec,relatime
├─/sys/fs/cgroup     cgroup2        cgroup2    rw,nosuid,nodev,noexec,relatime
├─/sys/fs/pstore     pstore         pstore     rw,nosuid,nodev,noexec,relatime
├─/sys/fs/bpf        bpf            bpf        
rw,nosuid,nodev,noexec,relatime,mode=700
├─/sys/kernel/debug  debugfs        debugfs    rw,nosuid,nodev,noexec,relatime
├─/sys/kernel/tracing
│                    tracefs        tracefs    rw,nosuid,nodev,noexec,relatime
├─/sys/kernel/config configfs       configfs   rw,nosuid,nodev,noexec,relatime
├─/sys/fs/fuse/connections
│                    fusectl        fusectl    rw,nosuid,nodev,noexec,relatime
└─/sys/kernel        tmpfs          tmpfs      
ro,relatime,size=4k,mode=000,uid=100000,gid=100000,inode64
/proc                proc           proc       rw,relatime


And this is how it looks like in mmdebstrap in unshare mode:

TARGET        SOURCE           FSTYPE   OPTIONS
/             tmpfs[/mmdebstrap.CihrYkXMBA]
│                              tmpfs    
rw,nosuid,nodev,relatime,size=8388608k,inode64
├─/dev/console
│             udev[/console]   devtmpfs 
rw,nosuid,relatime,size=1780476k,nr_inodes=445119,mode=755,inode64
├─/dev/full   udev[/full]      devtmpfs 
rw,nosuid,relatime,size=1780476k,nr_inodes=445119,mode=755,inode64
├─/dev/null   udev[/null]      devtmpfs 
rw,nosuid,relatime,size=1780476k,nr_inodes=445119,mode=755,inode64
├─/dev/pts    none             devpts   
rw,nosuid,noexec,relatime,uid=100005,mode=620,ptmxmode=666
├─/dev/random udev[/random]    devtmpfs 
rw,nosuid,relatime,size=1780476k,nr_inodes=445119,mode=755,inode64
├─/dev/shm    tmpfs            tmpfs    rw,nosuid,nodev,inode64
├─/dev/tty    udev[/tty]       devtmpfs 
rw,nosuid,relatime,size=1780476k,nr_inodes=445119,mode=755,inode64
├─/dev/urandom
│             udev[/urandom]   devtmpfs 
rw,nosuid,relatime,size=1780476k,nr_inodes=445119,mode=755,inode64
├─/dev/zero   udev[/zero]      devtmpfs 
rw,nosuid,relatime,size=1780476k,nr_inodes=445119,mode=755,inode64
└─/proc       proc             proc     rw,relatime

It is very suboptimal that in sbuild, the root does not show up in
/proc/mounts. I do not understand why there is a difference. Both
implementations, mmdebstrap as well as sbuild, call this command to mount proc:

mount -t proc proc $ROOTFS/proc

I do not yet understand what these two implementations do different such that
the root mount point is missing in sbuild but present in mmdebstrap...

Thanks!

cheers, josch

Attachment: signature.asc
Description: signature

Reply via email to