On 7/13/06, [EMAIL PROTECTED] <[EMAIL PROTECTED]> wrote:
From: "Dan Nicholson" <[EMAIL PROTECTED]>
>Looks like you're not mounting devpts in /mnt/lfs/dev/pts (or shm).
>You need to mount /proc /sys /dev/shm and /dev/pts in $LFS. These are
>actual filesystems (see your host's fstab).

I thought I was covering that with this from
/mnt/lfs/root/.bash_profile, since the chroot starts a login shell:
#!/bin/bash
#PGR remounts for LFS-6.1.1 Ch6 building
if ! grep /dev/pts /proc/mounts >/dev/null ; then
  mount -vt devpts -o gid=4,mode=620 none /dev/pts
fi

When I got in the chroot and looked at /proc/self/mounts, it looked
like they were already mounted.  You're saying that once I get into the
chroot, I need to mount or umount/mount them all again?  I'm confused
about what the host does and what is done within the chroot--how much
the chroot sees of the hosts environment.  I need mounts inside the
chroot so it uses everything on ITS /proc, /sys, shm & pts without
connection to the host?

OK, this is kind of wrong. I thought you were going to execute those
commands from outside the chroot. The problem is that inside the
chroot, /proc/mounts is going to list devpts twice at /dev/pts. One is
the one on the host, and one is the one in the chroot at
/mnt/lfs/dev/pts, but listed as /dev/pts from within the chroot.  I
suspect you're not actually mounting /mnt/lfs/dev/pts because your
command sees the listsing for the hosts's /dev/pts and returns
successfully.

Here is a listing from inside and outside the chroot on a correctly
setup system (using tmpfs /dev which you aren't using).

Inside the chroot:

[root-in-chroot:/] cat /proc/mounts
rootfs / rootfs rw 0 0
/dev/root / ext3 rw 0 0
proc /proc proc rw,nodiratime 0 0
sysfs /sys sysfs rw 0 0
tmpfs /dev tmpfs rw 0 0
devpts /dev/pts devpts rw 0 0
shm /dev/shm tmpfs rw 0 0
/dev/hda2 / ext3 rw 0 0
tmpfs /dev tmpfs rw 0 0
proc /proc proc rw,nodiratime 0 0
sysfs /sys sysfs rw 0 0
devpts /dev/pts devpts rw 0 0
shm /dev/shm tmpfs rw 0 0

Outside the chroot:

$ cat /proc/mounts
rootfs / rootfs rw 0 0
/dev/root / ext3 rw 0 0
proc /proc proc rw,nodiratime 0 0
sysfs /sys sysfs rw 0 0
tmpfs /dev tmpfs rw 0 0
devpts /dev/pts devpts rw 0 0
shm /dev/shm tmpfs rw 0 0
/dev/hda2 /mnt/lfs ext3 rw 0 0
tmpfs /mnt/lfs/dev tmpfs rw 0 0
proc /mnt/lfs/proc proc rw,nodiratime 0 0
sysfs /mnt/lfs/sys sysfs rw 0 0
devpts /mnt/lfs/dev/pts devpts rw 0 0
shm /mnt/lfs/dev/shm tmpfs rw 0 0

You see that the filesystems inside the chroot directory change
notation whether you're inside or outside the chroot. So you need to
think about that. It would probably be easier to handle all the
mounting outside of the chroot.

As far as remounting things when you exit or re-enter the chroot,
those filesystems will stay there until you either unmount them or
reboot. It can't hurt to check every time, though.

--
Dan
--
http://linuxfromscratch.org/mailman/listinfo/lfs-support
FAQ: http://www.linuxfromscratch.org/lfs/faq.html
Unsubscribe: See the above information page

Reply via email to