Need to revise .bashrc

Bryan Kadzban bryan at
Fri Jan 9 04:06:11 PST 2004

John Green wrote:
> In Chapter 5, 'Setting up the environment', .bashrc is created
> containing PATH=/tools/bin:/bin:/usr/bin

For the user lfs, on the host system, yeah...

> Shouldn't $PATH in .bashrc be modified to include {,usr}/sbin
> after the first chroot, and again when chroot is revised to exclude
> /tools?

At that point, you're root.  The book doesn't create a $LFS/root/.bashrc
(or a $LFS/root/.bash_profile, for that matter).  PATH gets set during
chroot, and doesn't get modified after that.

> Also, the initial .bashrc sets $LFS to a value which is meaningless
> after chroot.

You're root, not lfs, after chroot.  ;-)  $LFS is not set as root (plus
the env -i clears out all old environment variables, so if you su to do
the chroot instead of "su -", $LFS still won't get carried over except
into the pre-chroot shell).

It may be the case that we should create a skeleton $LFS/root/.bashrc
and/or $LFS/root/.bash_profile (and I'm pretty sure previous book
versions did that).  It does seem to work this way, however...

More information about the lfs-dev mailing list