一步一步打造自己的Linux--LFS6.3安装过程(五)
恢复MBR,用boot.ini启动Linux

一步一步打造自己的Linux--LFS6.3安装过程(六)

獨立的圓 posted @ 2008年2月11日 19:57 in Linux with tags LFS , 7330 阅读

 本站文章已轉移,敬請移步:http://www.xxb.me/ ,謝謝!

目录:

Berkeley DB
Sed
E2fsprogs
Coreutils
Iana-Etc
M4
Bison
Ncurses
Procps
Libtool
Perl
Readline
Zlib
Autoconf
Automake
Bash
运行新的bash

 Berkeley DB   (10分钟)

  1. $ tar xvf $LFS/db-4.5.20.tar.gz
  2. $ cd db-4.5.20
  3. $ patch -Np1 -i $LFS/db-4.5.20-fixes-1.patch
  4. $ cd build_unix
  5. $ ../dist/configure --prefix=/usr --enable-compat185 --enable-cxx
  6. $ make
  7. $ make docdir=/usr/share/doc/db-4.5.20 install
  8. $ chown -Rv root:root /usr/share/doc/db-4.5.20
  9. $ cd ../..
  10. $ rm -rf db-4.5.20

Sed   (5分钟)

  1. $ tar xvf $LFS/sed-4.1.5.tar.gz
  2. $ cd sed-4.1.5
  3. $ ./configure --prefix=/usr --bindir=/bin --enable-html
  4. $ make
  5. $ make install
  6. $ cd ..
  7. $ rm -rf sed-4.1.5

e2fsprogs   (5分钟)

  1. $ tar xvf $LFS/e2fsprogs-1.40.2.tar.gz
  2. $ cd e2fsprogs-1.40.2
  3. $ sed -i -e 's@/bin/rm@/tools&@' lib/blkid/test_probe.in
  4. $ mkdir -v build
  5. $ cd build
  6. $ ../configure --prefix=/usr --with-root-prefix="" \
        --enable-elf-shlibs
  7. $ make
  8. $ make install
  9. $ make install-libs
  10. $ cd ../..
  11. $ rm -rf e2fsprogs-1.40.2

coreutils   (10分钟)

  1. $ tar xvf $LFS/coreutils-6.9.tar.bz2
  2. $ cd coreutils-6.9
  3. $ patch -Np1 -i $LFS/coreutils-6.9-uname-1.patch
  4. $ patch -Np1 -i $LFS/coreutils-6.9-suppress_uptime_kill_su-1.patch
  5. $ patch -Np1 -i $LFS/coreutils-6.9-i18n-1.patch
  6. $ chmod +x tests/sort/sort-mb-tests
  7. $ ./configure --prefix=/usr
  8. $ make
  9. $ make NON_ROOT_USERNAME=nobody check-root
  10. $ echo "dummy:x:1000:nobody" >> /etc/group
  11. $ su-tools nobody -s /bin/bash -c "make RUN_EXPENSIVE_TESTS=yes check"
  12. $ sed -i '/dummy/d' /etc/group
  13. $ make install
  14. $ mv -v /usr/bin/{cat,chgrp,chmod,chown,cp,date,dd,df,echo} /bin
  15. $ mv -v /usr/bin/{false,hostname,ln,ls,mkdir,mknod,mv,pwd,readlink,rm} /bin
  16. $ mv -v /usr/bin/{rmdir,stty,sync,true,uname} /bin
  17. $ mv -v /usr/bin/chroot /usr/sbin
  18. $ mv -v /usr/bin/{head,sleep,nice} /bin
  19. $ cd ..
  20. $ rm -rf coreutils-6.9

iana-etc   (1分钟)

  1. $ tar xvf $LFS/iana-etc-2.20.tar.bz2
  2. $ cd iana-etc-2.20
  3. $ make
  4. $ make install
  5. $ cd ..
  6. $ rm -rf iana-etc-2.20

m4   (5分钟)

  1. $ tar xvf $LFS/m4-1.4.10.tar.bz2
  2. $ cd m4-1.4.10
  3. $ ./configure --prefix=/usr
  4. $ make
  5. $ make install
  6. $ cd ..
  7. $ rm -rf m4-1.4.10

bison   (5分钟)

  1. $ tar xvf $LFS/bison-2.3.tar.bz2
  2. $ cd bison-2.3
  3. $ ./configure --prefix=/usr
  4. $ echo '#define YYENABLE_NLS 1' >> config.h
  5. $ make
  6. $ make install
  7. $ cd ..
  8. $ rm -rf bison-2.3

ncurses   (10分钟)

  1. $ tar xvf $LFS/ncurses-5.6.tar.gz
  2. $ cd ncurses-5.6
  3. $ patch -Np1 -i $LFS/ncurses-5.6-coverity_fixes-1.patch
  4. $ ./configure --prefix=/usr --with-shared --without-debug --enable-widec
  5. $ make
  6. $ make install
  7. $ chmod -v 644 /usr/lib/libncurses++w.a
  8. $ mv -v /usr/lib/libncursesw.so.5* /lib
  9. $ ln -sfv ../../lib/libncursesw.so.5 /usr/lib/libncursesw.so
  10.  
  11. $ for lib in curses ncurses form panel menu ; do \
        rm -vf /usr/lib/lib${lib}.so ; \
        echo "INPUT(-l${lib}w)" >/usr/lib/lib${lib}.so ; \
        ln -sfv lib${lib}w.a /usr/lib/lib${lib}.a ; \
    done
  12. $ ln -sfv libncurses++w.a /usr/lib/libncurses++.a
  13.  
  14. $ rm -vf /usr/lib/libcursesw.so
  15. $ echo "INPUT(-lncursesw)" >/usr/lib/libcursesw.so
  16. $ ln -sfv libncurses.so /usr/lib/libcurses.so
  17. $ ln -sfv libncursesw.a /usr/lib/libcursesw.a
  18. $ ln -sfv libncurses.a /usr/lib/libcurses.a
  19.  
  20. $ make distclean
  21. $ ./configure --prefix=/usr --with-shared --without-normal \
      --without-debug --without-cxx-binding
  22. $ make sources libs
  23. $ cp -av lib/lib*.so.5* /usr/lib
  24.  
  25. $ cd ..
  26. $ rm -rf ncurses-5.6

procps   (5分钟)

  1. $ tar xvf $LFS/procps-3.2.7.tar.gz
  2. $ cd procps-3.2.7
  3. $ make
  4. $ make install
  5. $ cd ..
  6. $ rm -rf procps-3.2.7

libtool   (5分钟)

  1. $ tar xvf $LFS/libtool-1.5.24.tar.gz
  2. $ cd libtool-1.5.24
  3. $ ./configure --prefix=/usr
  4. $ make
  5. $ make install
  6. $ cd ..
  7. $ rm -rf libtool-1.5.24

perl   (10分钟)

  1. $ tar xvf $LFS/perl-5.8.8.tar.bz2
  2. $ cd perl-5.8.8
  3. $ echo "127.0.0.1 localhost $(hostname)" > /etc/hosts
  4. $ ./configure.gnu --prefix=/usr \
        -Dman1dir=/usr/share/man/man1 \
        -Dman3dir=/usr/share/man/man3 \
        -Dpager="/usr/bin/less -isR"
  5. $ make
  6. $ make install
  7. $ cd ..
  8. $ rm -rf perl-5.8.8 

readline   (5分钟)

  1. $ tar xvf $LFS/readline-5.2.tar.gz
  2. $ cd readline-5.2
  3. $ sed -i '/MV.*old/d' Makefile.in
  4. $ sed -i '/{OLDSUFF}/c:' support/shlib-install
  5. $ patch -Np1 -i $LFS/readline-5.2-fixes-3.patch
  6. $ ./configure --prefix=/usr --libdir=/lib
  7. $ make SHLIB_LIBS=-lncurses
  8. $ make install
  9. $ mv -v /lib/lib{readline,history}.a /usr/lib
  10. $ rm -v /lib/lib{readline,history}.so
  11. $ ln -sfv ../../lib/libreadline.so.5 /usr/lib/libreadline.so
  12. $ ln -sfv ../../lib/libhistory.so.5 /usr/lib/libhistory.so
  13. $ cd ..
  14. $ rm -rf readline-5.2

zlib   (5分钟)

  1. $ tar xvf $LFS/zlib-1.2.3.tar.gz
  2. $ cd zlib-1.2.3
  3. $ ./configure --prefix=/usr --shared --libdir=/lib
  4. $ make
  5. $ make install
  6. $ rm -v /lib/libz.so
  7. $ ln -sfv ../../lib/libz.so.1.2.3 /usr/lib/libz.so
  8. $ make clean
  9. $ ./configure --prefix=/usr
  10. $ make
  11. $ make install
  12. $ chmod -v 644 /usr/lib/libz.a
  13. $ cd ..
  14. $ rm -rf zlib-1.2.3

autoconf   (5分钟)

  1. $ tar xvf $LFS/autoconf-2.61.tar.bz2
  2. $ cd autoconf-2.61
  3. $ ./configure --prefix=/usr
  4. $ make
  5. $ make install
  6. $ cd ..
  7. $ rm -rf autoconf-2.61

automake   (5分钟)

  1. $ tar xvf $LFS/automake-1.10.tar.bz2
  2. $ cd automake-1.10
  3. $ ./configure --prefix=/usr
  4. $ make
  5. $ make install
  6. $ cd ..
  7. $ rm -rf automake-1.10

bash   (10分钟)

  1. $ tar xvf $LFS/bash-3.2.tar.gz
  2. $ cd bash-3.2
  3. $ tar -xvf $LFS/bash-doc-3.2.tar.gz
  4. $ sed -i "s|htmldir = @htmldir@|htmldir = /usr/share/doc/bash-3.2|" \
        Makefile.in
  5. $ patch -Np1 -i $LFS/bash-3.2-fixes-5.patch
  6. $ ./configure --prefix=/usr --bindir=/bin \
        --without-bash-malloc --with-installed-readline
  7. $ make
  8. $ sed -i 's/LANG/LC_ALL/' tests/intl.tests
  9. $ sed -i 's@tests@& </dev/tty@' tests/run-test
  10. $ chown -Rv nobody ./
  11. $ su-tools nobody -s /bin/bash -c "make tests"
  12. $ make install
  13. $ cd ..
  14. $ rm -rf bash-3.2

运行新编译的 bash 程序来替换正在执行的这一个:

  1. $ exec /bin/bash --login +h

(未完待续--我有误上贼船的感觉 ^_^)


登录 *


loading captcha image...
(输入验证码)
or Ctrl+Enter