Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- cat > ~/.bash_profile << "EOF"
- exec env -i HOME=$HOME TERM=$TERM PS1='\u:\w\$ ' /bin/bash
- EOF
- Linux From Scratch - Version 6.7
- 28
- When logged on as user lfs, the initial shell is usually a login shell which reads the / etc/ profile of the
- host (probably containing some settings and environment variables) and then . bash_ profile. The exec env
- -i.../bin/bash command in the . bash_ profile file replaces the running shell with a new one with a completely
- empty environment, except for the HOME, TERM, and PS1 variables. This ensures that no unwanted and potentially
- hazardous environment variables from the host system leak into the build environment. The technique used here
- achieves the goal of ensuring a clean environment.
- The new instance of the shell is a non-login shell, which does not read the / etc/ profile or . bash_ profile
- files, but rather reads the . bashrc file instead. Create the . bashrc file now:
- cat > ~/.bashrc << "EOF"
- set +h
- umask 022
- LFS=/mnt/lfs
- LC_ALL=POSIX
- LFS_TGT=$(uname -m)-lfs-linux-gnu
- PATH=/tools/bin:/bin:/usr/bin
- export LFS LC_ALL LFS_TGT PATH
- EOF
- The se
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement