博客
关于我
强烈建议你试试无所不能的chatGPT,快点击我
LFS6.3安装全过程(五)
阅读量:5796 次
发布时间:2019-06-18

本文共 3798 字,大约阅读时间需要 12 分钟。

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 sources
tar xvf lfs-bootscripts-6.3.tar.bz2
cd lfs-bootscripts-6.3
make install
cd ..
rm -rf lfs-bootscripts-6.3
cat > /etc/sysconfig/clock << "EOF"
# Begin /etc/sysconfig/clock
UTC=1
# End /etc/sysconfig/clock
EOF
cat > /etc/sysconfig/console << "EOF"
# Begin /etc/sysconfig/console
# End /etc/sysconfig/console
EOF
cat > /etc/inputrc << "EOF"
# Begin /etc/inputrc
# Modified by Chris Lynn <roryo@roryo.dynup.net>
# Allow the command prompt to wrap to the next line
set horizontal-scroll-mode Off
# Enable 8bit input
set meta-flag On
set input-meta On
# Turns off 8th bit stripping
set convert-meta Off
# Keep the 8th bit for display
set output-meta On
# none, visible or audible
set 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/inputrc
EOF
cat > /etc/profile << "EOF"
# Begin /etc/profile
export INPUTRC=/etc/inputrc
source /etc/bashrc
LANG="zh_CN" ; export LANG
[ "$TERM" = "linux" ] && LC_ALL=C
export LC_ALL
# End /etc/profile
EOF
cat > /etc/bashrc << "EOF"
# Begin /etc/bashrc
alias 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 ]] ; then
PS1="$RED[\u@$YELLOW\h $BLUB\W$RED]\\$ $NORMAL"
else
PS1="$GREEN[\u@$YELLOW\h $BLUB\W$GREEN]\\$ $NORMAL"
fi
if [ "`locale charmap 2>/dev/null`" = "UTF-8" ]
then
stty iutf8
fi
# End /etc/bashrc
EOF
echo "HOSTNAME=mylinux" > /etc/sysconfig/network
cat > /etc/hosts << "EOF"
# Begin /etc/hosts (network card version)
127.0.0.1 mylinux localhost
# End /etc/hosts (network card version)
EOF
cd /etc/sysconfig/network-devices
mkdir -v ifconfig.eth0
cat > ifconfig.eth0/ipv4 << "EOF"
ONBOOT=yes
SERVICE=ipv4-static
IP=192.168.1.9
GATEWAY=192.168.1.1
PREFIX=24
BROADCAST=192.168.1.255
EOF
cat > /etc/resolv.conf << "EOF"
# Begin /etc/resolv.conf
nameserver 202.106.196.115
# End /etc/resolv.conf
EOF
cat > /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 0
proc /proc proc defaults 0 0
sysfs /sys sysfs defaults 0 0
devpts /dev/pts devpts gid=4,mode=620 0 0
shm /dev/shm tmpfs defaults 0 0
# End /etc/fstab
EOF
cd /sources
tar xvf linux-2.6.22.5.tar.bz2
cd linux-2.6.22.5
make mrproper
make menuconfig
make
make modules_install
cp -v arch/i386/boot/bzImage /boot/lfskernel-2.6.22.5
cp -v System.map /boot/System.map-2.6.22.5
cp -v .config /boot/config-2.6.22.5
install -d /usr/share/doc/linux-2.6.22.5
cp -r Documentation/* /usr/share/doc/linux-2.6.22.5
grub
root (hd0,1)
setup (hd0)
quit
cat > /boot/grub/menu.lst << "EOF"
# Begin /boot/grub/menu.lst
# By default boot the first menu entry.
default 0
# 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
EOF
mkdir -v /etc/grub
ln -sv /boot/grub/menu.lst /etc/grub
echo 6.3 > /etc/lfs-release
logout

转载于:https://www.cnblogs.com/snailrun/archive/2012/08/17/2644842.html

你可能感兴趣的文章
linux软件包管理之三(源代码安装)
查看>>
数据库三范式是什么?
查看>>
[转载]设置Ubuntu自动连接无线,无须再输入密钥环和无线密码
查看>>
SQL Server 2014 许可证(三)各版本的许可证
查看>>
九叔Xen App测试报告
查看>>
Apache配置
查看>>
Ext gridPanel 单元格数据的渲染
查看>>
Android SDK 的下载代理
查看>>
Method Swizzling对Method的要求
查看>>
佛祖保佑,永不宕机
查看>>
四、配置开机自动启动Nginx + PHP【LNMP安装 】
查看>>
LNMP一键安装
查看>>
SQL Server数据库概述
查看>>
Linux 目录结构及内容详解
查看>>
startx命令--Linux命令应用大词典729个命令解读
查看>>
华为3026c交换机配置tftp备份命令
查看>>
Oracle命令导入dmp文件
查看>>
OCP读书笔记(24) - 题库(ExamD)
查看>>
Http、TCP/IP协议与Socket之间的区别(转载)
查看>>
解决Unable to load R3 module ...VBoxDD.dll (VBoxDD):GetLastError=1790
查看>>