chroot $LFS /tools/bin/env -i \HOME=/root TERM=$TERM PS1='\u:\w\$ ' \PATH=/bin:/usr/bin:/sbin:/usr/sbin \/tools/bin/bash --login/tools/bin/find /{,usr/}{bin,lib,sbin} -type f \-exec /tools/bin/strip --strip-debug '{}' ';'cd sourcestar xvf lfs-bootscripts-6.3.tar.bz2cd lfs-bootscripts-6.3make installcd ..rm -rf lfs-bootscripts-6.3cat > /etc/sysconfig/clock << "EOF"# Begin /etc/sysconfig/clockUTC=1# End /etc/sysconfig/clockEOFcat > /etc/sysconfig/console << "EOF"# Begin /etc/sysconfig/console# End /etc/sysconfig/consoleEOFcat > /etc/inputrc << "EOF"# Begin /etc/inputrc# Modified by Chris Lynn <roryo@roryo.dynup.net># Allow the command prompt to wrap to the next lineset horizontal-scroll-mode Off# Enable 8bit inputset meta-flag Onset input-meta On# Turns off 8th bit strippingset convert-meta Off# Keep the 8th bit for displayset output-meta On# none, visible or audibleset bell-style none# All of the following map the escape sequence of the value# contained in the 1st argument to the readline specific functions"\eOd": backward-word"\eOc": forward-word# for linux console"\e[1~": beginning-of-line"\e[4~": end-of-line"\e[5~": beginning-of-history"\e[6~": end-of-history"\e[3~": delete-char"\e[2~": quoted-insert# for xterm"\eOH": beginning-of-line"\eOF": end-of-line# for Konsole"\e[H": beginning-of-line"\e[F": end-of-line# End /etc/inputrcEOFcat > /etc/profile << "EOF"# Begin /etc/profileexport INPUTRC=/etc/inputrcsource /etc/bashrcLANG="zh_CN" ; export LANG[ "$TERM" = "linux" ] && LC_ALL=Cexport LC_ALL# End /etc/profileEOFcat > /etc/bashrc << "EOF"# Begin /etc/bashrcalias ls='ls --color=auto'alias ll='ls -l'#eval $(dircolors -b /etc/dircolors)# Setup a red prompt for root and a green one for users.NORMAL="\[\e[0m\]"RED="\[\e[1;31m\]"GREEN="\[\e[1;32m\]"YELLOW="\[\e[1;33m\]"BLUB="\[\e[1;34m\]"if [[ $EUID == 0 ]] ; thenPS1="$RED[\u@$YELLOW\h $BLUB\W$RED]\\$ $NORMAL"elsePS1="$GREEN[\u@$YELLOW\h $BLUB\W$GREEN]\\$ $NORMAL"fiif [ "`locale charmap 2>/dev/null`" = "UTF-8" ]thenstty iutf8fi# End /etc/bashrcEOFecho "HOSTNAME=mylinux" > /etc/sysconfig/networkcat > /etc/hosts << "EOF"# Begin /etc/hosts (network card version)127.0.0.1 mylinux localhost# End /etc/hosts (network card version)EOFcd /etc/sysconfig/network-devicesmkdir -v ifconfig.eth0cat > ifconfig.eth0/ipv4 << "EOF"ONBOOT=yesSERVICE=ipv4-staticIP=192.168.1.9GATEWAY=192.168.1.1PREFIX=24BROADCAST=192.168.1.255EOFcat > /etc/resolv.conf << "EOF"# Begin /etc/resolv.confnameserver 202.106.196.115# End /etc/resolv.confEOFcat > /etc/fstab << "EOF"# Begin /etc/fstab# file system mount-point type options dump fsck# order/dev/hda2 / ext3 defaults 1 1/dev/hda5 swap swap pri=1 0 0proc /proc proc defaults 0 0sysfs /sys sysfs defaults 0 0devpts /dev/pts devpts gid=4,mode=620 0 0shm /dev/shm tmpfs defaults 0 0# End /etc/fstabEOFcd /sourcestar xvf linux-2.6.22.5.tar.bz2cd linux-2.6.22.5make mrpropermake menuconfigmakemake modules_installcp -v arch/i386/boot/bzImage /boot/lfskernel-2.6.22.5cp -v System.map /boot/System.map-2.6.22.5cp -v .config /boot/config-2.6.22.5install -d /usr/share/doc/linux-2.6.22.5cp -r Documentation/* /usr/share/doc/linux-2.6.22.5grubroot (hd0,1)setup (hd0)quitcat > /boot/grub/menu.lst << "EOF"# Begin /boot/grub/menu.lst
# By default boot the first menu entry.
# Allow 30 seconds before booting the default.
timeout 30
# Use prettier colors.
color green/black light-green/black
# The first entry is for LFS.
title LFS 6.3
root (hd0,1)kernel /boot/lfskernel-2.6.22.5 root=/dev/hda2
EOFmkdir -v /etc/grubln -sv /boot/grub/menu.lst /etc/grubecho 6.3 > /etc/lfs-releaselogout