Michael Havens wrote:
On Sat, Sep 6, 2014 at 2:25 PM, akhiezer <[email protected]> wrote:
Bear in mind too that your lfs build environment is inside a chroot, and
so won't see all of the host-os filesystem. You (basically) need to get
the 'lynx2.8.8rel.2.tar.bz2' file into a directory that can be seen from
within the chroot.
Isn't that what 'mount --bind ...' is for?
Yes, but there are different techniques for using it. I have
/mnt/lfs/sources that contains all the LFS packages. For BLFS, I keep
sources on a separate partition mounted as /usr/src. I then bind mount
/mnt/lfs/usr/src to /usr/src for access within chroot.
You can, of course, come up with your own technique, but here is mine:
$ 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
====
You have to be careful though if you are wiping out /mnt/lfs for a new
build. You don't want to delete /usr/src. From experience, I now use
umount-virt.sh first:
$ 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
============
-- Bruce
--
http://lists.linuxfromscratch.org/listinfo/lfs-support
FAQ: http://www.linuxfromscratch.org/blfs/faq.html
Unsubscribe: See the above information page
Do not top post on this list.
A: Because it messes up the order in which people normally read text.
Q: Why is top-posting such a bad thing?
A: Top-posting.
Q: What is the most annoying thing in e-mail?
http://en.wikipedia.org/wiki/Posting_style