|

楼主 |
发表于 2004-2-23 10:07:21
|
显示全部楼层
补充,我把做的每一步写出来,请帮我看看。
rh8.0 + lfs4.0
rh8.0为完全安装,lfs分区的文件系统为ext3,。
#export LFS=/mnt/lfs
#mkdir -p $LFS
#mount /dev/hda5 $LFS
#cp lfs-packages-cvs-20021023-1707.tar /mnt/lfs
#tar xvf lfs*
#mv lfs-packages-cvs-20021021707 src
#mkdir $LFS/static
#mv src $LFS/static
#useradd -s /bin/bash -m lfs
#passwd lfs
#chown -R lfs $LFS/static
#exit
用lfs登陆
$cat > ~LFS/.bash_profile << "EOF"
>umask 022
>LFS=/mnt/lfs
>LC_ALL=POSIX
>CC='gcc -s'
export LFS LC_ALL CC
EOF
$source ~/.bash_profile
$cd /mnt/lfs/static/src
$tar jxvf bash*
$cd bash*
$./configure --enable-static-link --prefix=$LFS/static --with-curses
$make
$make install
// 做完这一步后用root登陆,用ldd测试bash ,结果为:
// #ldd $LFS/static/bin/bash
// not a dynamic executable
$cd ..
$tar jxvf binutils-2.13.tar.bz2
$mv binutils-2.13 binutils-build
$cd binutils-build
$./configure --prefix=$LFS/static --disable-nls
$make LDFLAGS=-all-static
$make install
$d ..
$tar jxvf bzip*
$cd bzip2*
$make CC="gcc -static -s"
$make PREFIX=$LFS/static install
$cd ..
$tar jxvf diffutils-2.8.1.tar.bz2
$cd diffutils-2.8.1
$LDFLAGS=-static CPPFLAGS=-Dre_max_failures=re_max_failures2 ./configure --prefix=$LFS/static --disable-nls
$make
$make install
$cd ..
$tar jxvf fileutils-4.1.tar.bz2
$cd fileutils-4.1
$patch -Np1 -i ../fileutils-4.1.patch
$LDFLAGS=-static ./configure --disable-nls --prefix=$LFS/static
$make
$make install
$cd ..
$tar jxvf findutils-4.1.tar.bz2
$cd findutils-4。1
$patch -Np1 -i ../findutils-4.1.patch
CPPFLAGS=-Dre_max_failures=re_max_failures2 ./configure --prefix=$LFS/static
$make LDFLAGS=-static
$make install
$cd ..
$tar jxvf gawk-3.1.1.tar.bz2
$cd gawk-3.1.1
$CPPFLAGS=-Dre_max_failures=re_max_failures2 ./configure --prefix=$LFS/static --disable-nls
$make LDFLAGS=-static
$make install
$cd ..
$tar jxvf gcc-core-3.2.tar.bz2
$mv gcc-3.2 gcc-build
$cd gcc-build
$patch -Np1 -i ../gcc-3.2.patch
$patch -Np1 -i ../gcc-3.2-nofixincludes-2.patch
$./configure --prefix=/static --disable-nls --disable-shared
$echo "#define HAVE_GAS_HIDDEN 1" >> gcc/auto-host.h // 此处为数字1
$make BOOT_LDFLAGS=-static bootstrap
$make prefix=$LFS/static install
$ln -s gcc $LFS/static/bin/cc
$cd ..
$tar jxvf grep-2.5.tar.bz2
$cd grep-2.5
$LDFLAGS=-static CPPFLAGS=-Dre_max_failures=re_max_failures2 ./configure --prefix=$LFS/static --disable-nls --disable-perl-regexp
$make
$make install
$cd ..
$tar jxvf gzip-1.2.4a.tar.bz2
$cd gzip-1.2.4a
$./configure --prefix=$LFS/static
$make LDFLAGS=-static
$make install
$cd ..
$tar jxvf make*
$cd make*
$./configure --prefix=$LFS/static --disable-nls
$make LDFLAGS=-static
$make install
$cd ..
$tar jxvf patch*
$cd patch*
$CPPFLAGS=-D_GNU_SOURCE ./configure --prefix=$LFS/static
$make LDFLAGS=-static
$make install
$cd ..
$tar jxvf sed*
$cd sed*
$CPPFLAGS=-Dre_max_failures=re_max_failures2 ./configure --prefix=$LFS/static
$make LDFLAGS=-static
$make install
$cd ..
$tar jxvf sh-utils-2.0.tar.bz2
$cd sh-utils-2.0
$patch -Np1 -i ../sh-utils-2.0.patch
$./configure --prefix=$LFS/static --disable-nls
$make LDFLAGS=-static
$make install
$cd ..
$tar jxvf tar-1.13.tar.bz2
$cd tar-1.13
$patch -Np1 -i ../tar-13.patch
$./configure --prefix=$LFS/static --disable-nls
$make LDFLAGS=-static
$make install
$cd ..
$tar jxvf texinfo-4.2.tar.bz2
$cd texinfo-4.2
$LDFLAGS=-static ./configure --prefix=$LFS/static --disable-nls
$make
$make install
$cd ..
$tar jxvf textutils-2.1.tar.bz2
$cd textutils-2.1
$CPPFLAGS=-Dre_max_failures=re_max_failures2 ./configure --prefix=$LFS/static --disable-nls
$make LDFLAGS=-static
$make install
$cd ..
$tar jxvf util-linux*
$cd util-linux*
$./configure
$make -C lib
$make -C mount LDFLAGS=-static mount umount
$cp mount/{mount,umount} $LFS/static/bin |
|