天天看點

How to recover after rebooting the LFS procession

1. Reboot the PC -> Boot from the LFS LiveCD.

2. Mount the Partition:

  export LFS=/mnt/lfs
  mkdir -pv $LFS
  mount /dev/hda2 $LFS
           

3. Moun the Swap (You can skip this step if you don't wan't to use the Swap or you haven't the Swap):

  swapon /dev/hda1
           

4. Build the Toolchain:

  ln -sv $LFS/tools /
           

5. Creat the user lfs:

  groupadd lfs
  useradd -s /bin/bash -g lfs -m -k /dev/null lfs
  passwd lfs
  chown -v lfs $LFS/tools 
  chown -v lfs $LFS/sources 
   su - lfs
           

6. Create the Environment of user 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
  PATH=/tools/bin:/bin:/usr/bin
  export LFS LC_ALL PATH
  EOF
  source ~/.bash_profile
           

7. Using the command "export" to take a check, the result should be:

  declare -x HOME="/home/lfs"
  declare -x LC_ALL="POSIX"
  declare -x LFS="/mnt/lfs"
  declare -x OLDPWD
  declare -x PATH="/tools/bin:/bin:/usr/bin"
  declare -x PS1="\\u:\\w\\\$ "
  declare -x PWD="/home/lfs"
  declare -x SHLVL="1"
  declare -x TERM="linux"
           

8. Enter the compile directory, and the recover work is finished.

  cd $LFS/sources
           

繼續閱讀