Hi Pierre and Bruce, thanks for the reply.

Let me compare some of the listings to try to pinpoint the differences.

On Debian 9, I get:
> # ls -l /dev/{,pts/}ptmx
> lrwxrwxrwx 1 root root    8 May 26 05:55 /dev/ptmx -> pts/ptmx
> crw-rw-rw- 1 root root 5, 2 May 26 06:23 /dev/pts/ptmx

And if I create a new dev folder as in the LFS book, I get
> # mkdir -pv /new_dev
> mkdir: created directory '/new_dev'
> # mount -v --bind /dev /new_dev
> mount: /dev bound on /new_dev.
> # ls -l /new_dev/ptmx
> lrwxrwxrwx 1 root root 8 May 26 06:40 /new_dev/ptmx -> pts/ptmx
> # ls -l /new_dev/pts
> total 0
> # mount -vt devpts devpts /new_dev/pts -o gid=5,mode=620
> mount: devpts mounted on /new_dev/pts.
> # ls -l /new_dev/pts
> total 0
> c--------- 1 root root 5, 2 May 26 06:43 ptmx

I can see points of interest: the /dev/ptmx file is not symlinked in your
listing, unlike in mine. Furthermore, the default /dev/pts/ptmx file in my
distro has the permissions 0666, whereas a freshly mounted devpts
filesystem has a ptmx file with zero permissions.

Btw. these listings are from Debian 9 on Docker on MacOS. I think that
from how the Docker on non-Linux systems works, the kernel is provided
by the Docker runtime.
> uname -a
> Linux 7a69bd692285 4.9.125-linuxkit #1 SMP Fri Sep 7 08:20:28
> UTC 2018 x86_64 GNU/Linux

I wonder if this brings any light into the situation.
Do I understand correctly that an automatized LFS CI system is able
to run the GCC tests on user nobody even when the ptmx file on the
newly mounted devpts has zero permissions?

If it helps to see the steps I'm taking in detail, I have a work-in-progress
repo that contains a Docker container and scripts that perform all steps
I'm taking here:

https://gitlab.com/golddranks/lfs_docker

All the best,
Pyry Kontio


2019年5月14日(火) 0:54 Bruce Dubbs via lfs-dev <lfs-dev@lists.linuxfromscratch.org>:
>
> On 5/13/19 10:05 AM, Pierre Labastie via lfs-dev wrote:
> > On 13/05/2019 15:50, Pyry Kontio via lfs-dev wrote:
> >> Hi, and thanks for the wonderful book.
> >>
> >> I'm trying to follow the standard LFS track, but I ran problems with
> >> the GCC test suite in Chapter 6
> >> (http://www.linuxfromscratch.org/lfs/view/stable/chapter06/gcc.html)
> >> -- I get a massive amount of failed results.
> >>
> >> I tried to report a bug using your tracker system, but even after
> >> creating an account, I'm unable to create new tickets, so I'm sending
> >> the report to this mailing list. Pardon me if it's the wrong one for
> >> these kinds of reports.
> >>
> >> Looking into it a bit, the problem seems to be that the book suggests
> >> running the test suite as user nobody:
> >>
> >>> su nobody -s /bin/bash -c "PATH=$PATH make -k check"
> >> The problem becomes clear when running some failing test suite in
> >> verbose mode:
> >>
> >>> runtest -v --tool gcc gcc.c-torture/compile/compile.exp
> >> It can't create ptys. Double-checking:
> >>
> >>> expect -c "spawn ls"
> >> ...fails although it succeeded when originally ran when building
> >> Binutils.
> >>
> >> The problem seems to be that the file /dev/pts/ptmx that was created
> >> when mounting devpts filesystem in 6.2
> >> (http://www.linuxfromscratch.org/lfs/view/stable/chapter06/kernfs.html)
> >> and is symlinked from /dev/ptmx on modern systems, has zero
> >> permissions by default. This makes creating ptys with non-root
> >> permissions fail. Some distros like Debian 9 set the system default
> >> /dev/pts/ptmx to have permissions 0666. Indeed, setting it to have
> >> those permissions will allow the nobody user to run the GCC test suite
> >> successfully.
> >>
> >> Maybe an additional step could be added to chapter 6.2 to ensure that
> >> /dev/pts/ptmx is set to have sensible permissions?
> >
> > Hi,
> > You used the right list. I think you have to wait for approval from
> > Bruce Dubbs for being able to report a bug.
>
> Correct.  Needed to prevent spam.  Better here or lfs-support.  Most
> reports (but not all) like this are invalid as we test by automating
> builds by extracting the instructions from the book.
>
> > What is your distribution? On both debian 9 and debian unstable, they have:
> > $ ls -l /dev/{,pts/}ptmx
> > crw-rw-rw- 1 root tty  5, 2 mai   13 16:42 /dev/ptmx
> > c--------- 1 root root 5, 2 mai   11 16:10 /dev/pts/ptmx
> >
> > and same on openSUSE Tumbleweed (20190402)
> > On these two distros, the gcc tests have no problem when run as per the
> > book.
>
> And for LFS.
>
> Note that /dev and all its contents are created by the kernel.  It would
> be highly unusual for those permissions to be changed by a distro.  LFS
> does not create any of those files or directories, but merely
> bind-mounts /dev into the chroot environment.
>
>    -- Bruce
> --
> http://lists.linuxfromscratch.org/listinfo/lfs-dev
> FAQ: http://www.linuxfromscratch.org/faq/
> Unsubscribe: See the above information page
-- 
http://lists.linuxfromscratch.org/listinfo/lfs-dev
FAQ: http://www.linuxfromscratch.org/faq/
Unsubscribe: See the above information page

Reply via email to