分类: LINUX
2011-08-12 22:50:20
Linux-2.6.22.5
代码:
tar xvf $LFS/linux-2.6.22.5.tar.bz2
cd linux-2.6.22.5
sed -i '/scsi/d' include/Kbuild
make mrproper
make headers_check
make INSTALL_HDR_PATH=dest headers_install
cp -rv dest/include/* /usr/include
cd ..
rm -rf linux-2.6.22.5
Man-pages-2.63
代码:
tar xvf $LFS/man-pages-2.63.tar.bz2
cd man-pages-2.63
make install
cd ..
rm -rf man-pages-2.63
Glibc-2.5.1
在进行之前请检查一下是否glibc-2.5.1和glibc-build这两个目录已经被删除,如果没有删除请删除后在继续。
代码:
tar xvf $LFS/glibc-2.5.1.tar.bz2
cd glibc-2.5.1
tar -xvf $LFS/glibc-libidn-2.5.1.tar.gz
mv glibc-libidn-2.5.1 libidn
sed -i '/vi_VN.TCVN/d' localedata/SUPPORTED
sed -i \
's|libs -o|libs -L/usr/lib -Wl,-dynamic-linker=/lib/ld-linux.so.2 -o|' \
scripts/test-installation.pl
sed -i 's|@BASH@|/bin/bash|' elf/ldd.bash.in
mkdir -v ../glibc-build
cd ../glibc-build
../glibc-2.5.1/configure --prefix=/usr \
--disable-profile --enable-add-ons \
--enable-kernel=2.6.0 --libexecdir=/usr/lib/glibc
make
make -k check 2>&1 | tee glibc-check-log
grep Error glibc-check-log
touch /etc/ld.so.conf
make install
make localedata/install-locales
make localedata/install-locales将安装全部的locale,如果你不想装这么多locale的话就用localedef命令来安装,LFS手册上有例子,如果仅想加入中文的locale,就用
mkdir -pv /usr/lib/locale
localedef -i zh_CN -f GB18030 zh_CN
localedef -i zh_CN -f GBK zh_CN
localedef -i zh_CN -f UTF-8 zh_CN
localedef -i zh_CN -f GB2312 zh_CN
localedef -i zh_HK -f UTF-8 zh_CN
localedef -i zh_HK -f BIG5-HKSCS zh_CN
localedef -i zh_TW -f EUC-TW zh_CN
localedef -i zh_TW -f UTF-8 zh_CN
localedef -i zh_TW -f BIG5 zh_CN
建立几个重要文件:
代码:
cat > /etc/nsswitch.conf << "EOF"
# Begin /etc/nsswitch.conf
passwd: files
group: files
shadow: files
hosts: files dns
networks: files
protocols: files
services: files
ethers: files
rpc: files
# End /etc/nsswitch.conf
EOF
cp -v --remove-destination /usr/share/zoneinfo/Asia/Shanghai /etc/localtime
cat > /etc/ld.so.conf << "EOF"
/usr/local/lib
/opt/lib
EOF
删除编译目录
代码:
cd ..
rm -rf glibc-build
rm -rf glibc-2.5.1