分类: LINUX
2007-04-23 14:20:06
tar xvf $LFS/linux-libc-headers-2.6.11.2.tar.bz2 cd linux-libc-headers-2.6.11.2 cp -Rv include/asm-i386 /usr/include/asm cp -Rv include/linux /usr/include chown -Rv root:root /usr/include/{asm,linux} find /usr/include/{asm,linux} -type d -exec chmod -v 755 {} \; find /usr/include/{asm,linux} -type f -exec chmod -v 644 {} \; cd .. rm -rf linux-libc-headers-2.6.11.2
tar xvf $LFS/man-pages-2.01.tar.bz2 cd man-pages-2.01 make install cd .. rm -rf man-pages-2.01
tar xvf $LFS/glibc-2.3.4.tar.bz2 cd glibc-2.3.4 tar -xjvf $LFS/glibc-linuxthreads-2.3.4.tar.bz2 patch -Np1 -i $LFS/glibc-2.3.4-rtld_search_dirs-1.patch patch -Np1 -i $LFS/glibc-2.3.4-fix_test-1.patch patch -Np1 -i $LFS/glibc-2.3.4-tls_assert-1.patch mkdir -v ../glibc-build cd ../glibc-build ../glibc-2.3.4/configure --prefix=/usr \ --disable-profile --enable-add-ons \ --enable-kernel=2.6.0 --libexecdir=/usr/lib/glibc make make -k check >glibc-check-log 2>&1 grep Error glibc-check-log touch /etc/ld.so.conf make install make localedata/install-locales make -C ../glibc-2.3.4/linuxthreads/man make -C ../glibc-2.3.4/linuxthreads/man install
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.3.4
cd binutils-build make -C ld INSTALL=/tools/bin/install install cd .. rm -rf binutils-build rm -rf binutils-2.15.94.0.2.2
perl -pi -e 's@ /tools/lib/ld-linux.so.2@ /lib/ld-linux.so.2@g;' \ -e 's@\*startfile_prefix_spec:\n@$_/usr/lib/ @g;' \ $(gcc --print-file specs)
tar xvf $LFS/binutils-2.15.94.0.2.2.tar.bz2 mkdir binutils-build cd binutils-build ../binutils-2.15.94.0.2.2/configure --prefix=/usr --enable-shared make tooldir=/usr
make check
make tooldir=/usr install cp -v ../binutils-2.15.94.0.2.2/include/libiberty.h /usr/include cd .. rm -rf binutils-build rm -rf binutils-2.15.94.0.2.2
tar xvf $LFS/gcc-3.4.3.tar.bz2 cd gcc-3.4.3 patch -Np1 -i $LFS/gcc-3.4.3-no_fixincludes-1.patch patch -Np1 -i $LFS/gcc-3.4.3-linkonce-1.patch sed -i 's/install_to_$(INSTALL_DEST) //' libiberty/Makefile.in mkdir -v ../gcc-build cd ../gcc-build ../gcc-3.4.3/configure --prefix=/usr \ --libexecdir=/usr/lib --enable-shared \ --enable-threads=posix --enable-__cxa_atexit \ --enable-clocale=gnu --enable-languages=c,c++ make
make -k check
make install ln -sv ../usr/bin/cpp /lib ln -sv gcc /usr/bin/cc cd .. rm -rf gcc-build rm -rf gcc-3.4.3
tar xvf $LFS/coreutils-5.2.1.tar.bz2 cd coreutils-5.2.1 patch -Np1 -i $LFS/coreutils-5.2.1-uname-2.patch patch -Np1 -i $LFS/coreutils-5.2.1-suppress_uptime_kill_su-1.patch DEFAULT_POSIX2_VERSION=199209 ./configure --prefix=/usr make
echo "dummy1:x:1000:" >> /etc/group echo "dummy2:x:1001:dummy" >> /etc/group echo "dummy:x:1000:1000:::/bin/bash" >> /etc/passwd make NON_ROOT_USERNAME=dummy check-root src/su dummy -c "make RUN_EXPENSIVE_TESTS=yes check"
sed -i '/dummy/d' /etc/passwd /etc/group
make install mv -v /usr/bin/{cat,chgrp,chmod,chown,cp,date,dd,df,echo} /bin mv -v /usr/bin/{false,hostname,ln,ls,mkdir,mknod,mv,pwd,rm} /bin mv -v /usr/bin/{rmdir,stty,sync,true,uname} /bin mv -v /usr/bin/chroot /usr/sbin mv -v /usr/bin/{head,sleep} /bin cd .. rm -rf coreutils-5.2.1
tar xvf $LFS/zlib-1.2.3.tar.bz2 cd zlib-1.2.3 ./configure --prefix=/usr --shared --libdir=/lib make
make check
make install rm -v /lib/libz.so ln -sfv ../../lib/libz.so.1.2.3 /usr/lib/libz.so make clean ./configure --prefix=/usr make
make check
make install chmod -v 644 /usr/lib/libz.a cd .. rm -rf zlib-1.2.3
tar xvf $LFS/mktemp-1.5.tar.bz2 cd mktemp-1.5 patch -Np1 -i $LFS/mktemp-1.5-add_tempfile-2.patch ./configure --prefix=/usr --with-libc make make install make install-tempfile cd .. rm -rf mktemp-1.5
tar xvf $LFS/iana-etc-1.04.tar.bz2 cd iana-etc-1.04 make make install cd .. rm -rf iana-etc-1.04
tar xvf $LFS/findutils-4.2.23.tar.bz2 cd findutils-4.2.23 ./configure --prefix=/usr --libexecdir=/usr/lib/locate \ --localstatedir=/var/lib/locate make
make check
make install cd .. rm -rf findutils-4.2.23
tar xvf $LFS/gawk-3.1.4.tar.bz2 cd gawk-3.1.4 ./configure --prefix=/usr --libexecdir=/usr/lib make
make check
make install cd .. rm -rf gawk-3.1.4
tar xvf $LFS/ncurses-5.4.tar.bz2 cd ncurses-5.4 ./configure --prefix=/usr --with-shared --without-debug make make install chmod -v 755 /usr/lib/*.5.4 chmod -v 644 /usr/lib/libncurses++.a mv -v /usr/lib/libncurses.so.5* /lib ln -sfv ../../lib/libncurses.so.5 /usr/lib/libncurses.so ln -sfv libncurses.so /usr/lib/libcurses.so cd .. rm -rf ncurses-5.4
tar xvf $LFS/readline-5.0.tar.bz2 cd readline-5.0 patch -Np1 -i $LFS/readline-5.0-fixes-1.patch ./configure --prefix=/usr --libdir=/lib make SHLIB_XLDFLAGS=-lncurses make install chmod -v 755 /lib/lib{readline,history}.so* mv -v /lib/lib{readline,history}.a /usr/lib rm -v /lib/lib{readline,history}.so ln -sfv ../../lib/libreadline.so.5 /usr/lib/libreadline.so ln -sfv ../../lib/libhistory.so.5 /usr/lib/libhistory.so cd .. rm -rf readline-5.0
tar xvf $LFS/vim-6.3.tar.bz2 tar xvf $LFS/vim-6.3-lang.tar.gz cd vim63 echo '#define SYS_VIMRC_FILE "/etc/vimrc"' >> src/feature.h patch -Np1 -i $LFS/vim-6.3-security_fix-2.patch ./configure --prefix=/usr --enable-multibyte make
make test
make install ln -sv vim /usr/bin/vi
cat > /etc/vimrc << "EOF" " Begin /etc/vimrc set nocompatible set backspace=2 syntax on if (&term == "iterm") || (&term == "putty") set background=dark endif " End /etc/vimrc EOF
cd .. rm -rf vim63
tar xvf $LFS/m4-1.4.3.tar.bz2 cd m4-1.4.3 ./configure --prefix=/usr make
make check
make install cd .. rm -rf m4-1.4.3
tar xvf $LFS/bison-2.0.tar.bz2 cd bison-2.0 ./configure --prefix=/usr make
make check
make install cd .. rm -rf bison-2.0
tar xvf $LFS/less-382.tar.bz2 cd less-382 ./configure --prefix=/usr --bindir=/bin --sysconfdir=/etc make make install cd .. rm -rf less-382
tar xvf $LFS/groff-1.19.1.tar.bz2 cd groff-1.19.1 PAGE=A4 ./configure --prefix=/usr make make install ln -sv soelim /usr/bin/zsoelim ln -sv eqn /usr/bin/geqn ln -sv tbl /usr/bin/gtbl cd .. rm -rf groff-1.19.1
tar xvf $LFS/sed-4.1.4.tar.bz2 cd sed-4.1.4 sed -i 's@/doc@&/sed-4.1.4@' doc/Makefile.in ./configure --prefix=/usr --bindir=/bin make
make check
make install cd .. rm -rf sed-4.1.4
tar xvf $LFS/flex-2.5.31.tar.bz2 cd flex-2.5.31 patch -Np1 -i $LFS/flex-2.5.31-debian_fixes-3.patch touch doc/flex.1 ./configure --prefix=/usr make
make check
make install ln -sv libfl.a /usr/lib/libl.a
cat > /usr/bin/lex << "EOF" #!/bin/sh # Begin /usr/bin/lex exec /usr/bin/flex -l "$@" # End /usr/bin/lex EOF chmod -v 755 /usr/bin/lex
cd .. rm -rf flex-2.5.31
tar xvf $LFS/gettext-0.14.3.tar.bz2 cd gettext-0.14.3 ./configure --prefix=/usr make
make check
make install cd .. rm -rf gettext-0.14.3
tar xvf $LFS/inetutils-1.4.2.tar.bz2 cd inetutils-1.4.2 patch -Np1 -i $LFS/inetutils-1.4.2-kernel_headers-1.patch patch -Np1 -i $LFS/inetutils-1.4.2-no_server_man_pages-1.patch ./configure --prefix=/usr --libexecdir=/usr/sbin \ --sysconfdir=/etc --localstatedir=/var \ --disable-logger --disable-syslogd \ --disable-whois --disable-servers make make install mv -v /usr/bin/ping /bin cd .. rm -rf inetutils-1.4.2
tar xvf $LFS/iproute2-2.6.11-050330.tar.bz2 cd iproute2-2.6.11 sed -i '/^TARGETS/s@arpd@@g' misc/Makefile ./configure make SBINDIR=/sbin make SBINDIR=/sbin install cd .. rm -rf iproute2-2.6.11
tar xvf $LFS/perl-5.8.7.tar.bz2 cd perl-5.8.7 ./configure.gnu --prefix=/usr -Dpager="/bin/less -isR" make
echo "127.0.0.1 localhost $(hostname)" > /etc/hosts make test
make install cd .. rm -rf perl-5.8.7
tar xvf $LFS/texinfo-4.8.tar.bz2 cd texinfo-4.8 patch -Np1 -i $LFS/texinfo-4.8-tempfile_fix-1.patch ./configure --prefix=/usr make
make check
make install make TEXMF=/usr/share/texmf install-tex
cd /usr/share/info rm dir for f in * do install-info $f dir 2>/dev/null done
cd /sources rm -rf texinfo-4.8
tar xvf $LFS/autoconf-2.59.tar.bz2 cd autoconf-2.59 ./configure --prefix=/usr make
make check
make install cd .. rm -rf autoconf-2.59
tar xvf $LFS/automake-1.9.5.tar.bz2 cd automake-1.9.5 ./configure --prefix=/usr make
make check
make install cd .. rm -rf automake-1.9.5
tar xvf $LFS/bash-3.0.tar.bz2 cd bash-3.0 tar -xvf $LFS/bash-doc-3.0.tar.bz2 && sed -i "s|htmldir = @htmldir@|htmldir = /usr/share/doc/bash-3.0|" Makefile.in patch -Np1 -i $LFS/bash-3.0-fixes-3.patch patch -Np1 -i $LFS/bash-3.0-avoid_WCONTINUED-1.patch ./configure --prefix=/usr --bindir=/bin --without-bash-malloc --with-installed-readline make
make check
make install cd .. rm -rf bash-3.0
exec /bin/bash --login +h