On Sun, Sep 7, 2014 at 11:06 AM, Bruce Dubbs <[email protected]> wrote:
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
>
>
Thanks for sharing your technique with us. I don't understand it...I mean
are the partitions automatically mounted with your script? I don't really
want that.
--
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