-
Notifications
You must be signed in to change notification settings - Fork 3
/
lfs-4.4-lfs.sh
executable file
·41 lines (32 loc) · 1.09 KB
/
lfs-4.4-lfs.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
#!/bin/bash
echo ""
echo "### 4.4. Setting Up the Environment (running as lfs)"
echo "### ================================================"
if [ ! -f ./lfs-include.sh ];then
echo "*** Fatal Error - './lfs-include.sh' not found." ; exit 8 ; fi
source ./lfs-include.sh
echo "*** Validating the environment."
check_user lfs
check_lfs_partition_mounted_and_swap_on
########## Begin LFS Chapter Content ##########
echo '*** Setting Up the Environment (running as lfs)'
cat > ~/.bash_profile << "EOF"
exec env -i HOME=$HOME TERM=$TERM PS1='\u:\w\$ ' /bin/bash
EOF
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
echo ""
echo "########################### End Chapter 4.4 ###########################"
echo "*** The err msg you get below about 'dircolors' is harmless and can be ignored."
echo "*** Run:"
echo "*** --> source ~/.bash_profile "
echo "*** --> ./lfs-5.3-lfs.sh"
### Note: Book has user validate environment here. This is being done in 5.3,
### along with other validatations.