Pierre Labastie wrote:
On 07/03/2016 05:28, Ken Moffat wrote:
On Mon, Mar 07, 2016 at 12:46:48AM +0000, Ken Moffat wrote:

Eventually, I found a make bug report : /dev/pts needs to be mounted
(well, duh!) with an upstream commit.  I'm sure you will remember
that my bind mounts did not work [ after user ken had su'd to user
lfs for chapter 5, and then su'd ] - that looks as if su in fedora
has been hacked in some way, but I assumed that binding /dev, /proc/
and /sys [ by user ken who had su'd to root ] would suffice - I
forgot about mounting /dev/pts (and anyway, I sort of thought it
would be there from the bind.

So this time, when I get to chroot I will attempt to check that
/dev/pts is mounted.

That might well explain my failures (I'm using -j8, the bug was re
make without any arguments), or it might not.

I'm going to try building gdb and strace in chapter 5, and trying to
turn on core dumps (unlimited ulimit, apparently).

None of that really explains all of the problems that Bruce and
Pierre saw, so perhaps I will still be wasting my time.  The odd
thing is that I'm finding 'dnf' much less unpleasant than rpm or the
apt menagery - but that might just be because I haven't yet tried to
do anything interesting in dnf.

Well, I'm bemused - I haven't attempted to boot this yet (I'm still
building the BLFS packages I build before booting) but it sailed
through chapter 6 (only running tests on toolchain packages, and I
have not looked at the test results for the moment).

So, for me there seem to be two things to remember when building
from fedora:

1. 'su' might not work as expected - when user ken uses 'su', root
can mount /mnt/lfs and bind /dev etc.  But when user ken su's to
user lfs and then su's, that session can chroot (so, that implies it
really is root), but attempts to mount --bind and mount -vt on the
way in to chroot fail.

2. It might be necessary to turn selinux to off.  Not sure, but (I
come from a kernel-tester and occasionally a kernel-hacker
background) disabling selinux on a development system is a good
idea - ask linus!

Thanks to all who have responded, and particularly to Bruce and
Pierre for the pain I have given you in testing this.  And I have no
idea why your systems became broken :-(

Summary: fedora 23 *can* be used to build LFS - but for many people
it will not be the easiest host to use [ but on the other hand, it
uses kbd rather than console-tools, so it will let users find their
preferred console keymap and font (if any) before they try LFS.

ĸen


I'm ashamed I forgot! This was the same issue here. When I started again in
the morning, I forgot to re-mount the virtual kernel filesystems. I have now
restarted with no problem (and selinux enabled).

I've also found another VM with fedora 23 (my VM filesystem directory is a
mess, the name of the file is lfs23...), and compiled the whole LFS (using
jhalfs), with selinux enabled too.

So fedora seems to be usable for LFS, in the end...

I do not understand the problem with jhalfs. Doesn't it automatically mount all the needed virtual file systems?

I will note that I use a couple of scripts to mount or umount needed fs manually when needed. I add /boot and /usr/src to the standard LFS set of virtual fs.

$ cat mount-virt.sh
#!/bin/bash

function mountbind
{
   if ! mountpoint $LFS/$1 >/dev/null; then
     $SUDO mount --bind /$1 $LFS/$1
     echo $LFS/$1 mounted
   else
     echo $LFS/$1 already mounted
   fi
}

function mounttype
{
   if ! mountpoint $LFS/$1 >/dev/null; then
     $SUDO mount -t $2 $3 $4 $5 $LFS/$1
     echo $LFS/$1 mounted
   else
     echo $LFS/$1 already mounted
   fi
}

if [ $EUID -ne 0 ]; then
  SUDO=sudo
else
  SUDO=""
fi

if [ x$LFS == x ]; then
  echo "LFS not set"
  exit 1
fi


mountbind dev
mounttype dev/pts devpts devpts -o gid=5,mode=620
mounttype proc    proc   proc
mounttype sys     sysfs  sysfs
mounttype run     tmpfs  run
mkdir $LFS/run/shm
mountbind usr/src
mountbind boot
===============
$ cat umount-virt.sh
#!/bin/bash

function unmount
{
   if mountpoint $LFS/$1 >/dev/null; then
     $SUDO umount $LFS/$1
     echo $LFS/$1 unmounted
   else
     echo $LFS/$1 was not mounted
   fi
}

if [ $EUID -ne 0 ]; then
  SUDO=sudo
else
  SUDO=""
fi

if [ x$LFS == x ]; then
  echo "LFS not set"
  exit 1
fi

unmount run
unmount sys
unmount proc
unmount dev/pts
unmount dev
unmount usr/src
unmount boot
===============

  -- Bruce



--
http://lists.linuxfromscratch.org/listinfo/lfs-dev
FAQ: http://www.linuxfromscratch.org/faq/
Unsubscribe: See the above information page

Reply via email to