|
最近学习安装lfs,首先感谢几位翻译者。
我发现安装过程重复性很强,就弄个脚本,如下:
是第五章的内容。原理简单,但轻松不少。
#!/bin/bash
#tar xvf lfs-packages-cvs-20021023-1707.tar
export YJM=/mnt/lfs/static/src/lfs-packages-cvs-20021023-1707
#cd $YJM
#for i in `ls *.tar.bz2`; do tar jxvf $i; done
cd $YJM/bash-2.05a
./configure --enable-static-link \
--prefix=$LFS/static --with-curses &&
make &&
make install
cd $YJM/binutils-2.13
mkdir ../binutils-build &&
cd ../binutils-build &&
../binutils-2.13/configure --prefix=$LFS/static --disable-nls &&
make LDFLAGS=-all-static &&
make install
cd $YJM/bzip2-1.0.2
make CC="gcc -static -s" &&
make PREFIX=$LFS/static install
cd $YJM/diffutils-2.8.1
LDFLAGS=-static CPPFLAGS=-Dre_max_failures=re_max_failures2 \
./configure --prefix=$LFS/static --disable-nls &&
make &&
make install
cd $YJM/fileutils-4.1
#echo patch -Np1 -i ../fileutils-4.1.patch
LDFLAGS=-static \
./configure --disable-nls --prefix=$LFS/static &&
make &&
make install
cd $YJM/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 $YJM/gawk-3.1.1
CPPFLAGS=-Dre_max_failures=re_max_failures2 \
./configure --prefix=$LFS/static --disable-nls &&
make LDFLAGS=-static &&
make install
cd $YJM/gcc-3.2
patch -Np1 -i ../gcc-3.2.patch &&
patch -Np1 -i ../gcc-3.2-nofixincludes-2.patch &&
mkdir ../gcc-build &&
cd ../gcc-build &&
../gcc-3.2/configure --prefix=/static \
--disable-nls --disable-shared &&
echo "#define HAVE_GAS_HIDDEN 1" >> gcc/auto-host.h &&
make BOOT_LDFLAGS=-static bootstrap &&
make prefix=$LFS/static install &&
ln -s gcc $LFS/static/bin/cc
cd $YJM/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 $YJM/gzip-1.2.4a
./configure --prefix=$LFS/static &&
make LDFLAGS=-static &&
make install
cd $YJM/make-3.80
./configure --prefix=$LFS/static --disable-nls &&
make LDFLAGS=-static &&
make install
cd $YJM/patch-2.5.4
CPPFLAGS=-D_GNU_SOURCE \
./configure --prefix=$LFS/static &&
make LDFLAGS=-static &&
make install
cd $YJM/sed-4.0
CPPFLAGS=-Dre_max_failures=re_max_failures2 \
./configure --prefix=$LFS/static &&
make LDFLAGS=-static &&
make install
cd $YJM/sh-utils-2.0
patch -Np1 -i ../sh-utils-2.0.patch
./configure --prefix=$LFS/static \
--disable-nls &&
make LDFLAGS=-static &&
make install
cd $YJM/tar-1.13
patch -Np1 -i ../tar-1.13.patch
./configure --prefix=$LFS/static --disable-nls &&
make LDFLAGS=-static &&
make install
cd $YJM/texinfo-4.2
LDFLAGS=-static ./configure --prefix=$LFS/static \
--disable-nls &&
make &&
make install
cd $YJM/textutils-2.1
CPPFLAGS=-Dre_max_failures=re_max_failures2 \
./configure --prefix=$LFS/static \
--disable-nls &&
make LDFLAGS=-static &&
make install
cd $YJM/util-linux-2.11w
./configure &&
make -C lib &&
make -C mount LDFLAGS=-static mount umount &&
cp mount/{mount,umount} $LFS/static/bin |
|