CVS Chapter 6 bash Problem

Gerard Beekmans gerard at
Mon Jul 16 07:20:22 PDT 2001

> 1.  "logout" fails with the message that you must use "exit" as it's not 
> a login shell.

When you entered chroot you probably didn't pass --login. The correct
command would be:
chroot $LFS /usr/bin/env -i HOME=/root \
   TERM=$TERM /bin/bash --login

> 2.  The move succeceeded despite the logout fail.  Obviously not a 
> problem but it just seems strange to not be done immediately after the 
> "make install".  At least to me it seems like exiting the shell should be 
> the last thing done.
> My suggested correction:
> 	./configure --prefix=/usr --with-curses &&
> 	make &&
> 	make install &&
> 	mv /usr/bin/bash /usr/bin/bashbug /bin &&
> 	exit
> Saves a little typing as well for those not using the scripts.

It does, but depending on how much of bash is cached, swapped or
whatever done with in memory this may not work and fail with a "file in
use" or something similar because you will be replacing bash that the
chroot shell is currently using. To make this procedure as safe as
possible we'll just exit chroot and replace $LFS/bin/bash this way.

Gerard Beekmans

-*- If Linux doesn't have the solution, you have the wrong problem -*-
Unsubscribe: send email to lfs-discuss-request at
and put unsubscribe in the subject header of the message

More information about the lfs-dev mailing list