On Mon, Nov 23, 2015 at 3:08 PM, Joseph Hesse <[email protected]> wrote:
> Hello,
>
> I just finished Chapter 5 of the LFS book. In order to shut my computer
> off and do the work over several days, I put a line in my host's fstab file
> to mount my lfs partition on $LFS.
>
> Now that I am about to start Chapter 6 I plan on putting the mount
> commands in sections 6.2.2 and 6.2.3 in the .bash_profile for root on my
> host system.
>
> Since, afaik, the chroot command does not survive a reboot, I also plan on
> putting the chroot command in section 6.4 in the same .bash_profile file.
>
> Did I miss anything in regards to rebooting my computer?
>
> I don't really recommend setting up a user to do that. For instance, in
fstab I have:
/dev/sda6 /mnt/lfs ext4 noauto 1 2
I also have a script, 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
-----------
I also have a parallel umount-virt.sh script.
I do have an alias in ~/.bashrc
alias lfs='sudo /usr/sbin/chroot /mnt/lfs /usr/bin/env -i HOME=/root
TERM="$TERM" PS1="\u:\w\\\\$ " PATH=/bin:/usr/bin:/sbin:/usr/sbin /bin/bash
--login'
but that's for after Chapter 6. It would need to be modified to add
/tools/bin to the PATH and other commands as in Section 6.4 before Chapter
6 is complete.
-- 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