|
楼主 |
发表于 2003-4-7 19:02:40
|
显示全部楼层
后面的内容,应该属于第六章了,不过在第五章的脚本里。
切换用户为root,看一下$LFS对不对:
echo $LFS
为chroot做准备:
改变$LFS的所有者:
chown -R root:root ${LFS}
创建目录:
mkdir -p ${LFS}/{bin,boot,dev/pts,etc/opt,home,lib,mnt,proc}
mkdir -p ${LFS}/{root,sbin,tmp,usr/local,var,opt}
for dirname in ${LFS}/usr ${LFS}/usr/local
do
# Apparently not FHS compliant but without these LFS breaks (RO)
mkdir -p $dirname/{bin,etc,include,lib,sbin,share,src}
ln -sf share/{man,doc,info} $dirname
# More FHS compliant but breaks LFS builds
#mkdir -p $dirname/{bin,include,lib,sbin,share,src}
mkdir -p $dirname/share/{dict,doc,info,locale,man}
mkdir -p $dirname/share/{nls,misc,terminfo,zoneinfo}
mkdir -p $dirname/share/man/man{1,2,3,4,5,6,7,8}
done
mkdir ${LFS}/usr/local/games
ln -sf share/man ${LFS}/usr/local
mkdir -p ${LFS}/var/{lock,log,mail,run,spool} &&
mkdir -p ${LFS}/var/{tmp,opt,cache,lib/misc,local} &&
mkdir -p ${LFS}/opt/{bin,doc,include,info} &&
mkdir -p ${LFS}/opt/{lib,man/man{1,2,3,4,5,6,7,8}} &&
创建几个空文件:
touch ${LFS}/var/run/utmp ${LFS}/var/log/{btmp,lastlog,wtmp} &&
chmod 644 ${LFS}/var/run/utmp ${LFS}/var/log/{btmp,lastlog,wtmp}
设置目录属性:
chmod 0750 ${LFS}/root &&
chmod 1777 ${LFS}/tmp ${LFS}/var/tmp
创建无数的符号链接:
# setup bash symlinks
ln -sf ../stage1/bin/bash ${LFS}/bin
ln -s bash ${LFS}/bin/sh
# Required for glibc build
# Add pwd symlink
ln -sf ../stage1/bin/pwd ${LFS}/bin
# Add perl symlink
ln -sf ../../stage1/bin/perl ${LFS}/usr/bin
# added for glibc make check
ln -sf ../stage1/bin/cat ${LFS}/bin
# added for binutils ar test
# stty
ln -sf ../stage1/bin/stty ${LFS}/bin
# gettext symlinks
ln -sf ../../stage1/bin/msgfmt ${LFS}/usr/bin
ln -sf ../../stage1/bin/xgettext ${LFS}/usr/bin
ln -sf ../../stage1/bin/msgmerge ${LFS}/usr/bin
# install
ln -sf ../../stage1/bin/install ${LFS}/usr/bin
ln -sf ../usr/bin/install ${LFS}/bin
# Added for ch6 findutils locate tests
# (May have missed some, may be extras)
ln -sf ../stage1/bin/echo ${LFS}/bin
ln -sf ../stage1/bin/sed ${LFS}/bin
ln -sf ../stage1/bin/awk ${LFS}/bin
ln -sf ../stage1/bin/rm ${LFS}/bin
ln -sf ../stage1/bin/mv ${LFS}/bin
ln -sf ../stage1/bin/chmod ${LFS}/bin
ln -sf ../stage1/bin/chgrp ${LFS}/bin |
|