LinuxSir.cn,穿越时空的Linuxsir!

 找回密码
 注册
搜索
热搜: shell linux mysql
查看: 784|回复: 3

LFS Version20030106 Bootstrap Build scripts

[复制链接]
发表于 2003-1-15 10:05:18 | 显示全部楼层 |阅读模式
闲着没事,写了一个脚本,用于编译static(即Bootstrap),版本是CVS Version 20030106,安装包都是从官方网站下载的,同时在安装前都会对包进行Md5sum效验。现在正在做LFS后继的安装脚本,等把后面的做完后,连同安装包一起传到dooom的FTP上。
现在这个只是用于安装static部分,从安装bash开始,注意,请在建立了lfs用户后再使用该脚本。在脚本启动的时候会显示一个linux的图画,gust for fun.
如果脚本有任何问题请Mail给我:plan9@cqcas.edu.cn          Thanks.

=======Cut Here 指纹文件开始===================
6ad9f744b586b2dad42958f1c0d334d9  MAKEDEV-1.7.bz2
407ea53787ce13f5ca427e9a51e05bc2  autoconf-2.57.tar.bz2
8cfa661dca69271b862bee4f841fcd80  automake-1.7.2.tar.bz2
eeabc3f624861c4a8a687f7701db3d06  bash-2.05a.tar.gz
f4d980fdcf6c56c30c353d64deda56f7  bin86-0.16.3.tar.gz
ddf1399081a5032f0fed92bb7b963213  binutils-2.13.2.1.tar.bz2
b7f8027b249ebd4dd0cc948943a71af0  bison-1.875.tar.bz2
ee76864958d568677f03db8afad92beb  bzip2-1.0.2.tar.gz
44c6394b8e2e8feaf453aeddc8a3ee69  devfsd-v1.3.25.tar.gz
71f9c5ae19b60608f6c7f162da86a428  diffutils-2.8.1.tar.gz
a7ced9d6edaba3a000ccc5200e09b90d  e2fsprogs-1.32.tar.gz
8452d681ec053bc8abf73572d38f189c  ed-0.2.patch
ddd57463774cae9b50e70cd51221281b  ed-0.2.tar.gz
9d5cf1fda3daf54ea9c5f7df113ebf6b  file-3.39.tar.gz
f6b30a724a03afa691d1ad05144cd000  fileutils-4.1.patch
2fa04ceee87e962ddf72f32a2d6b906d  fileutils-4.1.tar.gz
355ba1b5a95e6f3cc7bce9bb88acd7ae  findutils-4.1-segfault.patch
87417a586340ca1c73d10d04e72d0423  findutils-4.1.patch
3ea8fe58ef5386da75f6c707713aa059  findutils-4.1.tar.gz
bd8753d0b22e1f4ec87a553a73021adf  flex-2.5.4a.tar.gz
62208c84dcbae864bf220723aabfac59  gawk-3.1.1-3.patch
47e3754195bf32c8b78ad632bab903cd  gawk-3.1.1.tar.gz
af0992d23c9ef8aa8e0c84917bfdac07  gcc-core-3.2.1.tar.gz
3adf2af211f7e6e21af38eb1c3282e62  gcc-g++-3.2.1.tar.gz
b7c1fe238dc8087da035b071c3b425b4  gettext-0.11.5.tar.gz
35a581ab9e19baa815b2f0e14c2ec583  glibc-2.3.1-libnss.patch
f15b605476ab018019e4b46e2cd1bc64  glibc-2.3.1-root-perl.patch
e8e7ffcb86f921c5b597008bf6f891bd  glibc-2.3.1.tar.gz
73a5b953b89c8ebeb534bf59822dde07  glibc-linuxthreads-2.3.1.tar.gz
5e7bd36e089b637ab3795354ec25dcae  grep-2.5.tar.bz2
4c7a1b478d230696f14743772f31639f  groff-1.18.1.tar.gz
289ed7946dec7ac4eac146b3a5c0c608  grub-0.93.tar.gz
39053e044b18ecd0627f80fbe7cfeaad  gzip-1.2.4a.tar.gz
74b81d7ec67a369e4e782a16d6f65afc  gzip-1.2.4b.patch
f883d30d15dae4a674d5c4c29362019d  kbd-1.08.patch
924e6a05e52715dc0f96385b35f2f680  kbd-1.08.tar.gz
db73e39a2d1a68eafa949f80be5a28c8  less-378.tar.gz
6f10438a366965928026ad66cb8877ea  lfs-bootscripts-1.10.tar.bz2
d11a3c835449d7fa50a025dc9c01ad81  libtool-1.4.3.tar.gz
c0aaef0674a7402d5628861f60f41a48  lilo-22.2.tar.bz2
c439d5c93d7fc9a1480a90842465bb97  linux-2.4.20.tar.bz2
9eb2dd07740b2d2f3c7adb3e8d299bda  m4-1.4.tar.gz
c68540da9302a48068d5cce1f0099477  make-3.80.tar.gz
f6c8dabacdd6685a5a546daae78f3f74  man-1.5k-80cols.patch
63234a8832b65eff44d7d6995fabbabb  man-1.5k-manpath.patch
241842c96c982e123cb98be1ec8468c5  man-1.5k-pager.patch
c678a9ba4b0f3df4ce2915e99490aa19  man-1.5k.tar.gz
15fe33dfe85afd1431d570585b938ec8  man-pages-1.54.tar.bz2
6c5d2a62ae98708f3ad0c57900d63919  modutils-2.4.22.tar.bz2
5dcc9faa93157eafa572494bffed131a  ncurses-5.3.tar.gz
888774accab40217dde927e21979c165  net-tools-1.60.tar.bz2
1f0193358e92559ec0f598b09ccbc0ec  netkit-base-0.17.tar.gz
ee5ae84d115f051d87fcaaef3b4ae782  patch-2.5.4.tar.gz
d9bdb180620306023fd35901a2878b62  perl-5.8.0.tar.gz
27658d0a69040aca05a65b9888599d50  procinfo-18.tar.gz
5b9333baf10b46a4c913a38df165ee2a  procps-3.1.4.patch
d37503aef6c001d9730dd012494a4d9a  procps-3.1.5.tar.gz
0749017f500b171f053d7c1fd72df537  psmisc-21.2.tar.gz
ede56d576aa7be4ed44e2d868616d00d  sed-4.0.5.tar.gz
61940f2467b914651407f94fa434e2f9  sh-utils-2.0-hostname.patch
30d15fd4df34ed971d854ec8b58d6989  sh-utils-2.0.patch
5e78d1d48ca563ca77e96b22406c4aaf  sh-utils-2.0.tar.gz
4fa404ebb4e29828232b3c9a2abddefd  shadow-4.0.3.tar.bz2
873e49fcde0d665e916414722ecb0d72  shadow-4.0.3.tar.gz
d214aa40beabf7bdb0c9b3c64432c774  sysklogd-1.4.1.tar.gz
529925c4f6e2e12967ad78a0836938de  sysvinit-2.84.tar.bz2
a126a68217a1d64257356f5e8ea5fbb9  tar-1.13.patch
402a54bdde58dec411ea844b75cf5804  tar-1.13.tar.gz
b673d7326d44f533bcfdfd56caa9f20d  texinfo-4.3.tar.bz2
47455186d12b65d363adc80e900f8682  textutils-2.1.tar.bz2
9431ced07a1bb2713f4ae9b8b9e208f2  util-linux-2.11y.tar.bz2
0932d318d6fb37a02617b71a91cb5dc3  vim-6.1.patch
7fd0f915adc7c0dab89772884268b030  vim-6.1.tar.bz2
abc405d0bdd3ee22782d7aa20e440f08  zlib-1.1.4.tar.gz
=======Cut Here 指纹文件结束===================

安装脚本:

  1. #========= mkbootstrap.sh ==========================
  2. #!/bin/bash
  3. #
  4. # Linux From Scrach v20030106 Bootstrap build script
  5. # ==================================================
  6. # by plan9  2003.01.12
  7. #
  8. # Any thing please mail to [email]plan9@cqcas.edu.cn[/email], Thanks!
  9. #

  10. # Options Declare Begin
  11. # =====================
  12. #
  13. # If you have Glibc-2.2.3 insatlled please change follow value to YES
  14. #

  15. HAVE_GLIBC233="NO"

  16. # Options Declare End
  17. # ===================
  18. #

  19. # Global Functions and Variables
  20. # ==============================
  21. #
  22. # Color schemes
  23. SUCESS="\e[01;32m"
  24. WARNING="\e[01;33m"
  25. FAILED="\e[01;31m"
  26. NORMAL="\e[00m"
  27. GREEN="\e[01;32m"
  28. BLUE="\e[01;34m"

  29. getparam2()
  30. {
  31.         echo $2
  32. }

  33. COLS=$(stty size)
  34. COLS=$(getparam2 $COLS)
  35. COLS=$[$COLS - 7]
  36. COLS="\e[${COLS}G"

  37. # print linux logo
  38. print_logo()
  39. {
  40.         echo
  41.         echo -e "\e[0;1;37;47m#################################################################\e[0;30;47m#####\e[1;37m#########\e[1;37;40m"
  42.         echo -e "\e[0;1;37;47m################################################################\e[0;30;47m#######\e[1;37m########\e[1;37;40m"
  43.         echo -e "\e[0;1;37;47m###################\e[31m#\e[37m############################################\e[0;30;47m##\e[1;37mO\e[0;30;47m#\e[1;37mO\e[0;30;47m##\e[1;37m########\e[1;37;40m"
  44.         echo -e "\e[0;1;37;47m##\e[0;30;47m######\e[1;37m##########\e[31m##\e[0;30;47m#\e[1;37m###########################################\e[0;30;47m#\e[1;33m#####\e[0;30;47m#\e[1;37m########\e[1;37;40m"
  45.         echo -e "\e[0;1;37;47m####\e[0;30;47m##\e[1;37m#############\e[0;30;47m#\e[1;37m##########################################\e[0;30;47m##\e[1;37m##\e[33m###\e[37m##\e[0;30;47m##\e[1;37m######\e[1;37;40m"
  46.         echo -e "\e[0;1;37;47m####\e[0;30;47m##\e[1;37m#########\e[31m###\e[37m###\e[0;30;47m###\e[1;37m#\e[0;30;47m####\e[1;37m###\e[0;30;47m###\e[1;37m####\e[0;30;47m###\e[1;37m##\e[0;30;47m#####\e[1;37m#\e[0;30;47m######\e[1;37m#####\e[0;30;47m#\e[1;37m##########\e[0;30;47m##\e[1;37m#####\e[1;37;40m"
  47.         echo -e "\e[0;1;37;47m####\e[0;30;47m##\e[1;37m########\e[31m#\e[37m##\e[31m#\e[0;30;47m#\e[1;37m###\e[0;30;47m###\e[1;37m####\e[0;30;47m##\e[1;37m##\e[0;30;47m##\e[1;37m#####\e[0;30;47m##\e[1;37m####\e[0;30;47m##\e[1;37m###\e[0;30;47m##\e[1;37m#######\e[0;30;47m#\e[1;37m############\e[0;30;47m##\e[1;37m####\e[1;37;40m"
  48.         echo -e "\e[0;1;37;47m####\e[0;30;47m##\e[1;37m#######\e[31m#\e[37m###\e[31m#\e[0;30;47m#\e[1;37m###\e[0;30;47m##\e[1;37m#####\e[0;30;47m##\e[1;37m##\e[0;30;47m##\e[1;37m#####\e[0;30;47m##\e[1;37m######\e[0;30;47m###\e[1;37m#########\e[0;30;47m#\e[1;37m############\e[0;30;47m###\e[1;37m###\e[1;37;40m"
  49.         echo -e "\e[0;1;37;47m####\e[0;30;47m##\e[1;37m##########\e[31m##\e[0;30;47m#\e[1;37m###\e[0;30;47m##\e[1;37m#####\e[0;30;47m##\e[1;37m##\e[0;30;47m##\e[1;37m#####\e[0;30;47m##\e[1;37m######\e[0;30;47m###\e[1;37m########\e[33m##\e[0;30;47m#\e[1;37m###########\e[0;30;47m##\e[1;33m#\e[37m###\e[1;37;40m"
  50.         echo -e "\e[0;1;37;47m####\e[0;30;47m##\e[1;37m#######\e[0;30;47m#\e[1;37m#\e[31m##\e[0;30;47m#\e[1;37m####\e[0;30;47m##\e[1;37m#####\e[0;30;47m##\e[1;37m##\e[0;30;47m##\e[1;37m#####\e[0;30;47m##\e[1;37m#####\e[0;30;47m##\e[1;37m#\e[0;30;47m##\e[1;37m#####\e[33m######\e[0;30;47m#\e[1;37m#######\e[30m#\e[33m######\e[37m#\e[1;37;40m"
  51.         echo -e "\e[0;1;37;47m####\e[0;30;47m##\e[1;37m######\e[0;30;47m##\e[1;37m#\e[31m##\e[0;30;47m#\e[1;37m#\e[0;30;47m#\e[1;37m##\e[0;30;47m##\e[1;37m#####\e[0;30;47m##\e[1;37m##\e[0;30;47m###\e[1;37m###\e[0;30;47m###\e[1;37m####\e[0;30;47m##\e[1;37m###\e[0;30;47m##\e[1;37m####\e[33m#######\e[0;30;47m#\e[1;37m#####\e[0;30;47m#\e[1;33m#######\e[37m#\e[1;37;40m"
  52.         echo -e "\e[0;1;37;47m##\e[0;30;47m############\e[1;37m##\e[0;30;47m###\e[1;37m##\e[0;30;47m####\e[1;37m###\e[0;30;47m####\e[1;37m###\e[0;30;47m####\e[1;37m#\e[0;30;47m###\e[1;37m#\e[0;30;47m#####\e[1;37m#\e[0;30;47m######\e[1;37m###\e[33m#####\e[30m#\e[0;30;47m#####\e[1m#\e[33m#####\e[37m###\e[1;37;40m"
  53.         echo
  54.         echo -e "${GREEN}Linux From Scratch bootstrap build scripts; ${BLUE}Version 20030106${NORMAL}"
  55.         echo -e "By ${BLUE}plan9 (plan9@cqcas.edu.cn)${NORMAL}"
  56.         echo -e "\e[40C\e[1;37;40m\e[0m"
  57.         echo -e "\e[0m\e[255D"
  58. }

  59. get_workdir()
  60. {
  61.         WORKDIR="$(pwd)"
  62. }

  63. mkbegin()
  64. {
  65.         echo
  66.         echo -e "${GREEN}>> ${NORMAL}${*}"
  67. }


  68. mkend()
  69. {
  70.         if [ "${1}" = "0" ]
  71.         then
  72.                 echo -e "${COLS}${BLUE}[ ${SUCESS}OK ${BLUE}]${NORMAL}"
  73.         else
  74.                 echo -e "${COLS}${BLUE}[ ${FAILED}!! ${BLUE}]${NORMAL}"
  75.         fi
  76. }

  77. # Checking package's Integrity
  78. checksum()
  79. {
  80.         echo -ne "${GREEN} * ${NORMAL}Checking ${1}'s Integrity... "
  81.         (grep "${1}$" digest | md5sum --status -c) &> /dev/null

  82.         if [ "${?}" != "0" ]
  83.         then
  84.                 echo -e "${COLS}${BLUE}[ ${FAILED}!! ${BLUE}]${NORMAL}"
  85.                 echo -e "${WARNING}Checking data integrity failed, please download ${1} again.${NORMAL}"
  86.                 echo    "Press ENTER to Exit... "
  87.                 read
  88.                 exit
  89.         else
  90.                 echo -e "${COLS}${BLUE}[ ${SUCESS}OK ${BLUE}]${NORMAL}"
  91.         fi
  92. }

  93. # Unpack the source packages
  94. unpack()
  95. {
  96.         echo -ne "${GREEN} * ${NORMAL}Unpacking ${1} ... "
  97.         echo ${1} > .mkUptmp
  98.         grep ".tar.bz2$" .mkUptmp &> /dev/null
  99.         if [ "${?}" = "0" ]
  100.         then
  101.                 tar -jxf ${1} &> /dev/null
  102.         else
  103.                 grep ".tar.gz$" .mkUptmp &> /dev/null
  104.                 if [ "${?}" = "0" ]
  105.                 then
  106.                         tar -zxf ${1} &> /dev/null
  107.                 fi
  108.         fi
  109.         mkend $?
  110.         rm -f .mkUptmp
  111. }

  112. # Set archtecture optimization
  113. optimize()
  114. {
  115.         CHOST="i686-pc-linux-gnu"
  116.         CFLAGS="-march=i686 -mcpu=i686 -O3 -pipe -fomit-frame-pointer"
  117.         CXXFLAGS="${CFLAGS}"

  118.         export CHOST CFLAGS CXXFLAGS
  119. }

  120. # Clear all archtecture optimization
  121. unoptimize()
  122. {
  123.         unset CHOST
  124.         unset CFLAGS
  125.         unset CXXFLAGS
  126. }       

  127. # Packages Install Functions
  128. # ==========================
  129. #
  130. # Bash-2.5a
  131. install_bash()
  132. {
  133.         mkbegin "Installing Bash-2.5a"
  134.         checksum bash-2.05a.tar.gz
  135.         unpack bash-2.05a.tar.gz
  136.         cd bash-2.05a
  137.         optimize

  138.         ./configure --enable-static-link \
  139.         --prefix=$LFS/static --with-curses &&
  140.         make &&
  141.         make install
  142. }

  143. # Binutils-2.13.2.1
  144. install_binutils()
  145. {
  146.         mkbegin "Installing Binutils-2.13.2.1"
  147.         checksum binutils-2.13.2.1.tar.bz2
  148.         unpack binutils-2.13.2.1.tar.bz2
  149.         cd binutils-2.13.2.1
  150.         unoptimize

  151.         mkdir ../binutils-build &&
  152.         cd ../binutils-build &&
  153.         ../binutils-2.13.2.1/configure --prefix=$LFS/static --disable-nls &&
  154.         make LDFLAGS="-all-static" &&
  155.         make install
  156. }

  157. # Bzip2-1.0.2
  158. install_bzip()
  159. {
  160.         mkbegin "Installing Bzip2-1.0.2"
  161.         checksum bzip2-1.0.2.tar.gz
  162.         unpack bzip2-1.0.2.tar.gz
  163.         cd bzip2-1.0.2
  164.         optimize
  165.        
  166.         make CC="gcc -static -s" &&
  167.         make PREFIX=$LFS/static install
  168. }

  169. # Diffutils-2.8.1
  170. install_diffutils()
  171. {
  172.         mkbegin "Installing Diffutils-2.8.1"
  173.         checksum diffutils-2.8.1.tar.gz
  174.         unpack diffutils-2.8.1.tar.gz
  175.         cd diffutils-2.8.1
  176.         optimize

  177.         LDFLAGS="-static" CPPFLAGS=-Dre_max_failures=re_max_failures2 \
  178.         ./configure --prefix=$LFS/static --disable-nls &&
  179.         make &&
  180.         make install
  181. }

  182. # Fileutils-4.1
  183. install_fileutils()
  184. {
  185.         mkbegin "Installing Fileutils-4.1"
  186.         checksum fileutils-4.1.tar.gz
  187.         checksum fileutils-4.1.patch
  188.         unpack fileutils-4.1.tar.gz
  189.         cd fileutils-4.1
  190.         optimize
  191.        
  192.         if [ "${HAVE_GLIBC223}" = "YES" ]
  193.         then
  194.                 patch -Np1 -i ../fileutils-4.1.patch
  195.         fi
  196.        
  197.         LDFLAGS="-static" \
  198.         ./configure --disable-nls --prefix=$LFS/static &&
  199.         make &&
  200.         make install
  201.        
  202.         $LFS/static/bin/ls
  203.         if [ "${?}" != "0" ]
  204.         then
  205.                 echo -e "${WARNING}Fileutils-4.1 test failed(May be Segmentation faults), please change your HAVE_GLIBC223 value in mkbootstrap script, and try again.${NORMAL}"
  206.                 echo -e "Press ENTER to Exit... "
  207.                 read
  208.                 exit
  209.         fi
  210. }

  211. # Findutils-4.1
  212. install_findutils()
  213. {
  214.         mkbegin "Installing Findutils-4.1"
  215.         checksum findutils-4.1.tar.gz
  216.         checksum findutils-4.1.patch
  217.         unpack findutils-4.1.tar.gz
  218.         cd findutils-4.1
  219.         optimize
  220.        
  221.         patch -Np1 -i ../findutils-4.1.patch &&
  222.         CPPFLAGS="-Dre_max_failures=re_max_failures2 -D_GNU_SOURCE"
  223.         LDFLAGS="-static" ./configure --prefix=$LFS/static &&
  224.         make &&
  225.         make install
  226. }

  227. # Gawk-3.1.1
  228. install_gawk()
  229. {
  230.         mkbegin "Installing Gawk-3.1.1"
  231.         checksum gawk-3.1.1.tar.gz
  232.         unpack gawk-3.1.1.tar.gz
  233.         cd gawk-3.1.1
  234.         optimize
  235.        
  236.         CPPFLAGS=-Dre_max_failures=re_max_failures2 \
  237.         LDFLAGS="-static" ./configure --prefix=$LFS/static --disable-nls &&
  238.         make &&
  239.         make install
  240. }

  241. # GCC-3.2.1
  242. install_gcc()
  243. {
  244.         mkbegin "Installing GCC-3.2.1"
  245.         checksum gcc-core-3.2.1.tar.gz
  246.         unpack gcc-core-3.2.1.tar.gz
  247.         cd gcc-3.2.1
  248.         unoptimize

  249.         mkdir ../gcc-build &&
  250.         cd ../gcc-build &&
  251.         ../gcc-3.2.1/configure --prefix=/static \
  252.         --disable-nls --disable-shared \
  253.         --with-as=$LFS/static/bin/as \
  254.         --with-ld=$LFS/static/bin/ld &&
  255.         make BOOT_LDFLAGS="-static" bootstrap &&
  256.         make prefix=$LFS/static install-no-fixedincludes &&
  257.         ln -s gcc $LFS/static/bin/cc
  258. }

  259. # Grep-2.5
  260. install_grep()
  261. {
  262.         mkbegin "Installing Grep-2.5"
  263.         checksum grep-2.5.tar.bz2
  264.         unpack grep-2.5.tar.bz2
  265.         cd grep-2.5
  266.         optimize

  267.         LDFLAGS="-static" CPPFLAGS=-Dre_max_failures=re_max_failures2 \
  268.         ./configure --prefix=$LFS/static --disable-nls \
  269.         --disable-perl-regexp &&
  270.         make &&
  271.         make install
  272. }

  273. # Gzip-1.2.4a
  274. install_gzip()
  275. {
  276.         mkbegin "Installing Gzip-1.2.4a"
  277.         checksum gzip-1.2.4a.tar.gz
  278.         unpack gzip-1.2.4a.tar.gz
  279.         cd gzip-1.2.4a
  280.         optimize

  281.         ./configure --prefix=$LFS/static &&
  282.         make LDFLAGS="-static" &&
  283.         make install
  284. }

  285. # Make-3.80
  286. install_make()
  287. {
  288.         mkbegin "Installing Make-3.80"
  289.         checksum make-3.80.tar.gz
  290.         unpack make-3.80.tar.gz
  291.         cd make-3.80
  292.         optimize

  293.         LDFLAGS="-static" ./configure --prefix=$LFS/static --disable-nls &&
  294.         make &&
  295.         make install
  296. }

  297. # Patch-2.5.4
  298. install_patch()
  299. {
  300.         mkbegin "Installing Patch-2.5.4"
  301.         checksum patch-2.5.4.tar.gz
  302.         unpack patch-2.5.4.tar.gz
  303.         cd patch-2.5.4
  304.         optimize

  305.         CPPFLAGS=-D_GNU_SOURCE \
  306.         LDFLAGS="-static" ./configure --prefix=$LFS/static &&
  307.         make &&
  308.         make install
  309. }

  310. # Sed-4.0.5
  311. install_sed()
  312. {
  313.         mkbegin "Installing Sed-4.0.5"
  314.         checksum sed-4.0.5.tar.gz
  315.         unpack sed-4.0.5.tar.gz
  316.         optimize

  317.         CPPFLAGS=-Dre_max_failures=re_max_failures2 \
  318.         LDFLAGS="-static" ./configure --prefix=$LFS/static --disable-nls &&
  319.         make &&
  320.         make install
  321. }

  322. # Sh-utils-2.0
  323. install_shutils()
  324. {
  325.         mkbegin "Installing Sh-utils-2.0"
  326.         checksum sh-utils-2.0.tar.gz
  327.         checksum sh-utils-2.0.patch
  328.         unpack sh-utils-2.0.tar.gz
  329.         cd sh-utils-2.0
  330.         optimize

  331.         patch -Np1 -i ../sh-utils-2.0.patch
  332.         LDFLAGS="-static" ./configure --prefix=$LFS/static \
  333.         --disable-nls &&
  334.         make &&
  335.         make install
  336. }

  337. # Tar-1.13
  338. install_tar()
  339. {
  340.         mkbegin "Installing Tar-1.13"
  341.         checksum tar-1.13.tar.gz
  342.         checksum tar-1.13.patch
  343.         unpack tar-1.13.tar.gz
  344.         cd tar-1.13
  345.         optimize
  346.        
  347.         patch -Np1 -i ../tar-1.13.patch
  348.         LDFLAGS="-static" ./configure --prefix=$LFS/static --disable-nls &&
  349.         make &&
  350.         make install
  351. }

  352. # Texinfo-4.3
  353. install_texinfo()
  354. {
  355.         mkbegin "Installing Texinfo-4.3"
  356.         checksum texinfo-4.3.tar.bz2
  357.         unpack texinfo-4.3.tar.bz2
  358.         cd texinfo-4.3
  359.         optimize
  360.        
  361.         LDFLAGS="-static" ./configure --prefix=$LFS/static \
  362.         --disable-nls &&
  363.         make &&
  364.         make install
  365. }

  366. # Textutils-2.1
  367. install_textutils()
  368. {
  369.         mkbegin "Installing Textutils-2.1"
  370.         checksum textutils-2.1.tar.bz2
  371.         unpack textutils-2.1.tar.bz2
  372.         cd textutils-2.1
  373.         optimize
  374.        
  375.         CPPFLAGS=-Dre_max_failures=re_max_failures2 \
  376.         LDFLAGS="-static" ./configure --prefix=$LFS/static \
  377.         --disable-nls &&
  378.         make &&
  379.         make install
  380. }

  381. # Util-linux-2.11y
  382. install_utillinux()
  383. {
  384.         mkbegin "Installing Util-linux-2.11y"
  385.         checksum util-linux-2.11y.tar.bz2
  386.         unpack util-linux-2.11y.tar.bz2
  387.         cd util-linux-2.11y
  388.         optimize
  389.        
  390.         LDFLAGS="-static" ./configure &&
  391.         make -C lib &&
  392.         make -C mount mount umount &&
  393.         cp mount/{mount,umount} $LFS/static/bin
  394. }

  395. # ===============================================================
  396. # Main Function
  397. # ===============================================================
  398. #
  399. # Set up environment
  400. umask 022
  401. LFS=/mnt/lfs
  402. LC_ALL=POSIX
  403. CC="gcc -s"
  404. export LFS LC_ALL CC

  405. print_logo

  406. # Prepare  $LFS/static directory
  407. echo -ne "${GREEN}>> ${NORMAL}Preparing ${LFS}/static directory... "
  408. if [ -d ${LFS}/static ]
  409. then
  410.         mkend 0
  411. else
  412.         mkdir -p ${LFS}/static  > /dev/null
  413.         mkend $?
  414. fi

  415. get_workdir
  416.        
  417. # Begin Install Packages
  418. # ======================
  419. #
  420. cd $WORKDIR
  421. install_bash
  422. cd $WORKDIR
  423. install_binutils
  424. cd $WORKDIR
  425. install_bzip
  426. cd $WORKDIR
  427. install_diffutils
  428. cd $WORKDIR
  429. install_fileutils
  430. cd $WORKDIR
  431. install_findutils
  432. cd $WORKDIR
  433. install_gawk
  434. cd $WORKDIR
  435. install_gcc
  436. cd $WORKDIR
  437. install_grep
  438. cd $WORKDIR
  439. install_gzip
  440. cd $WORKDIR
  441. install_make
  442. cd $WORKDIR
  443. install_patch
  444. cd $WORKDIR
  445. install_sed
  446. cd $WORKDIR
  447. install_shutils
  448. cd $WORKDIR
  449. install_tar
  450. cd $WORKDIR
  451. install_texinfo
  452. cd $WORKDIR
  453. install_textutils
  454. cd $WORKDIR
  455. install_utillinux

  456. # LFS Bootstrap build completed
  457. # =============================
  458. # It's use 1 hours on my LFS box.
  459. # Follow is my LFS box's device:
  460. #         Pentium III 733MHz
  461. #         128M PC133 SDRAM
  462. #        QUANTUM FIREBALL ST6.4A ATA DISK
  463. #         768M SWAP
  464. #
  465. echo
  466. echo -e "${GREEN}Congrats, Your Linux From Scratch Bootstrap build completed."
  467. echo -e "Have your fun!${NORMAL}"
  468. echo
  469. #===================================================================
复制代码
发表于 2003-1-15 10:53:22 | 显示全部楼层
hoho...
如果中间出错了怎么办?
知道是哪里出错了吗?
 楼主| 发表于 2003-1-15 11:30:45 | 显示全部楼层
如果是编译的时候出错的话没有检测,其它错误是检测了的,主要是为了偷赖,睡觉前让它自动编译,所以也没有检测那么多,呵呵,正在加强中。
发表于 2003-1-15 13:32:51 | 显示全部楼层
hoho...
支持支持,我也喜欢睡觉的时候开着机器让他自己跑,哈哈..
您需要登录后才可以回帖 登录 | 注册

本版积分规则

快速回复 返回顶部 返回列表