Creating $LFS/root/.bash_profile

When we have entered the chroot'ed environment in the next section we want to export a couple of environment variables in that shell such as TERM, CFLAGS, CXXFLAGS and others variables you want to have set. For that purpose we'll create the $LFS/root/.bash_profile file and "source" it after we have entered the chroot'ed environment.

Create a new file $LFS/root/.bash_profile containing the following. Replace -mcpu=xxx and -march=yyy with the proper values for your machine:



# Begin /root/.bash_profile

TERM=linux
CFLAGS="-O3 -mcpu=xxx -march=yyy"
CXXFLAGS=$CFLAGS

export TERM CFLAGS CXXFLAGS

# End /root/.bash_profile

You can add more environment variables at your own discretion as you deem them necesarry.