LinuxSir.cn,穿越时空的Linuxsir!

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

CLFS安装记录

[复制链接]
发表于 2006-11-5 01:44:01 | 显示全部楼层 |阅读模式
CLFS SETUP-BY-SETUP
http://chinajz.spaces.live.com/
c_xvidtune@hotmail.com

一、安装环境:
硬件:dell D800,256M 60G
软件:debian sid 当前版本
分区:CLFS用分区
          swap: /dev/hda5   490M(debian和LFS共用)
          /        :/dev/hda8    7G
二、CLFS安装:

首先将debian系统中的awk由mawk变为gawk,这是由于两者在处理上有些语法差别:
apt-get install gawk
mv /usr/bin/{mawk,mawk.orig}
cp /usr/bin/{gawk,mawk}

1.构建简易的关键编译软件版本检查脚本,检查一下主机最基本软件是否符合要求:
cat > version-check.sh << "EOF"
#!/bin/bash

# Simple script to list version numbers of critical development tools

bash --version | head -n1 | cut -d" " -f2-4
echo "Binutils: "; ld --version | head -n1 | cut -d" " -f3-4
bzip2 --version 2>&1 < /dev/null | head -n1 | cut -d" " -f1,6-
echo -n "Coreutils: "; chown --version | head -n1 | cut -d")" -f2
diff --version | head -n1
find --version | head -n1
gawk --version | head -n1
gcc --version | head -n1
/lib/libc.so.6 | head -n1 | cut -d" " -f1-7
grep --version | head -n1
gzip --version | head -n1
make --version | head -n1
patch --version | head -n1
sed --version | head -n1
tar --version | head -n1

EOF
执行一下:
bash version-check.sh
如果不合要求,要安装相关软件。
2.在分区上构建文件系统
2.1.建立分区和交换分区
mkfs.ext3 /dev/hda8
mkswap /dev/hda5 //如果已经建立这步省略
2.2挂载分区和交换分区
export CLFS=/mnt/clfs
mkdir -pv ${CLFS}
mount -v /dev/hda8 ${CLFS}
swapon /dev/hda5
2.3确定源文件存放目录
mkdir -v ${CLFS}/sources
chmod -v a+wt ${CLFS}/sources
3.下载所需的安装文件和补丁:


Autoconf (2.59) - 904 KB:


    Home page: http://www.gnu.org/software/autoconf/

    Download: http://ftp.gnu.org/gnu/autoconf/autoconf-2.59.tar.bz2

    MD5 sum: 1ee40f7a676b3cfdc0e3f7cd81551b5f
Automake (1.9.6) - 748 KB:

    Home page: http://www.gnu.org/software/automake/

    Download: http://ftp.gnu.org/gnu/automake/automake-1.9.6.tar.bz2

    MD5 sum: c11b8100bb311492d8220378fd8bf9e0
Bash (3.1) - 2,475 KB:

    Home page: http://www.gnu.org/software/bash/

    Download: http://ftp.gnu.org/gnu/bash/bash-3.1.tar.gz

    MD5 sum: ef5304c4b22aaa5088972c792ed45d72
Bash Documentation (3.1) - 2,013 KB:

    Download: http://ftp.gnu.org/gnu/bash/bash-doc-3.1.tar.gz

    MD5 sum: a8c517c6a7b21b8b855190399c5935ae
Binutils (2.17) - 13,496 KB:

    Home page: http://sources.redhat.com/binutils/

    Download: http://ftp.gnu.org/gnu/binutils/binutils-2.17.tar.bz2

    MD5 sum: e26e2e06b6e4bf3acf1dc8688a94c0d1
Bison (2.3) - 1,060 KB:

    Home page: http://www.gnu.org/software/bison/

    Download: http://ftp.gnu.org/gnu/bison/bison-2.3.tar.bz2

    MD5 sum: c18640c6ec31a169d351e3117ecce3ec
Bzip2 (1.0.3) - 654 KB:

    Home page: http://www.bzip.org/

    Download: http://www.bzip.org/1.0.3/bzip2-1.0.3.tar.gz

    MD5 sum: 8a716bebecb6e647d2e8a29ea5d8447f
CLFS-Bootscripts (1.0) - 28 KB:

    Download: http://cross-lfs.org/files/packa ... oss-lfs-1.0.tar.bz2

    MD5 sum: 79bff3247411589d7de51fdaea9578bd
Coreutils (5.96) - 4,960 KB:

    Home page: http://www.gnu.org/software/coreutils/

    Download: http://ftp.gnu.org/gnu/coreutils/coreutils-5.96.tar.bz2

    MD5 sum: bf55d069d82128fd754a090ce8b5acff
DejaGNU (1.4.4) - 1,056 KB:

    Home page: http://www.gnu.org/software/dejagnu/

    Download: http://ftp.gnu.org/gnu/dejagnu/dejagnu-1.4.4.tar.gz

    MD5 sum: 053f18fd5d00873de365413cab17a666
Diffutils (2.8.7) - 1,034 KB:

    Home page: http://www.gnu.org/software/diffutils/

    Download: ftp://alpha.gnu.org/gnu/diffutils/diffutils-2.8.7.tar.gz

    MD5 sum: 18d6587cb915e7aa110a5d463d6ed156
E2fsprogs (1.39) - 3,612 KB:

    Home page: http://e2fsprogs.sourceforge.net/

    Download: http://heanet.dl.sourceforge.net ... fsprogs-1.39.tar.gz

    MD5 sum: 06f7806782e357797fad1d34b7ced0c6
Expect (5.43.0) - 514 KB:

    Home page: http://expect.nist.gov

    Download: http://expect.nist.gov/src/expect-5.43.0.tar.gz

    MD5 sum: 43e1dc0e0bc9492cf2e1a6f59f276bc3
File (4.17) - 544 KB:

    Download: ftp://ftp.gw.com/mirrors/pub/unix/file/file-4.17.tar.gz

    MD5 sum: 50919c65e0181423d66bb25d7fe7b0fd
    Note

    File (4.17) may no longer be available at the listed location. The site administrators of the master download location occasionally remove older versions when new ones are released. An alternative download location that may have the correct version available is http://cross-lfs.org/files/packages/1.0.0/.
Findutils (4.2.27) - 1,097 KB:

    Home page: http://www.gnu.org/software/findutils/

    Download: http://ftp.gnu.org/gnu/findutils/findutils-4.2.27.tar.gz

    MD5 sum: f1e0ddf09f28f8102ff3b90f3b5bc920
Flex (2.5.33) - 680 KB:

    Home page: http://flex.sourceforge.net

    Download: http://heanet.dl.sourceforge.net ... flex-2.5.33.tar.bz2

    MD5 sum: 343374a00b38d9e39d1158b71af37150
Gawk (3.1.5) - 1,716 KB:

    Home page: http://www.gnu.org/software/gawk/

    Download: http://ftp.gnu.org/gnu/gawk/gawk-3.1.5.tar.bz2

    MD5 sum: 5703f72d0eea1d463f735aad8222655f
GCC (4.1.1) - 38,300 KB:

    Home page: http://gcc.gnu.org/

    Download: http://ftp.gnu.org/gnu/gcc/gcc-4.1.1/gcc-4.1.1.tar.bz2

    MD5 sum: ad9f97a4d04982ccf4fd67cb464879f3
Gettext (0.14.5) - 6,940 KB:

    Home page: http://www.gnu.org/software/gettext/

    Download: http://ftp.gnu.org/gnu/gettext/gettext-0.14.5.tar.gz

    MD5 sum: e2f6581626a22a0de66dce1d81d00de3
Glibc (2.4) - 14,847 KB:

    Home page: http://www.gnu.org/software/libc/

    Download: http://ftp.gnu.org/gnu/glibc/glibc-2.4.tar.bz2

    MD5 sum: 7e9a88dcd41fbc53801dbe5bdacaf245
Grep (2.5.1a) - 516 KB:

    Home page: http://www.gnu.org/software/grep/

    Download: http://ftp.gnu.org/gnu/grep/grep-2.5.1a.tar.bz2

    MD5 sum: 52202fe462770fa6be1bb667bd6cf30c
Groff (1.19.2) - 2,836 KB:

    Home page: http://www.gnu.org/software/groff/

    Download: http://ftp.gnu.org/gnu/groff/groff-1.19.2.tar.gz

    MD5 sum: f7c9cf2e4b9967d3af167d7c9fadaae4
Gzip (1.3.5) - 324 KB:

    Home page: http://www.gzip.org/

    Download: ftp://alpha.gnu.org/gnu/gzip/gzip-1.3.5.tar.gz

    MD5 sum: 3d6c191dfd2bf307014b421c12dc8469
Iana-Etc (2.10) - 184 KB:

    Home page: http://www.sethwklein.net/projects/iana-etc/

    Download: http://www.sethwklein.net/projec ... na-etc-2.10.tar.bz2

    MD5 sum: 53dea53262b281322143c744ca60ffbb
Inetutils (1.4.2) - 1019 KB:

    Home page: http://www.gnu.org/software/inetutils/

    Download: http://ftp.gnu.org/gnu/inetutils/inetutils-1.4.2.tar.gz

    MD5 sum: df0909a586ddac2b7a0d62795eea4206
IPRoute2 (2.6.16-060323) - 378 KB:

    Home page: http://linux-net.osdl.org/index.php/Iproute2

    Download: http://developer.osdl.org/dev/ip ... .6.16-060323.tar.gz

    MD5 sum: f31d4516b35bbfeaa72c762f5959e97c
Kbd (1.12) - 618 KB:

    Download: http://www.kernel.org/pub/linux/utils/kbd/kbd-1.12.tar.bz2

    MD5 sum: 069d1175b4891343b107a8ac2b4a39f6
Less (394) - 286 KB:

    Home page: http://www.greenwoodsoftware.com/less/

    Download: http://www.greenwoodsoftware.com/less/less-394.tar.gz

    MD5 sum: a9f072ccefa0d315b325f3e9cdbd4b97
Libtool (1.5.22) - 2,854 KB:

    Home page: http://www.gnu.org/software/libtool/

    Download: http://ftp.gnu.org/gnu/libtool/libtool-1.5.22.tar.gz

    MD5 sum: 8e0ac9797b62ba4dcc8a2fb7936412b0
Linux (2.6.17.13) - 40,320 KB:

    Home page: http://www.kernel.org/

    Download: http://www.kernel.org/pub/linux/ ... x-2.6.17.13.tar.bz2

    MD5 sum: 834885b3ad9988b966570bee92459572
Linux-Headers (2.6.17.13-09092006) - 1,576 KB:

    Home page: http://headers.cross-lfs.org/

    Download: http://cross-lfs.org/files/packa ... 13-09092006.tar.bz2

    MD5 sum: bfda0e9440dd76e6e35fdce79c9b0bf6
M4 (1.4.4) - 300 KB:

    Home page: http://www.gnu.org/software/m4/

    Download: http://ftp.gnu.org/gnu/m4/m4-1.4.4.tar.bz2

    MD5 sum: eb93bfbcb12cf00165583302bb31a822
Make (3.81) - 1,125 KB:

    Home page: http://www.gnu.org/software/make/

    Download: http://ftp.gnu.org/gnu/make/make-3.81.tar.bz2

    MD5 sum: 354853e0b2da90c527e35aabb8d6f1e6
Man (1.6d) - 268 KB:

    Home page: http://primates.ximian.com/~flucifredi/man/

    Download: http://primates.ximian.com/~flucifredi/man/man-1.6d.tar.gz

    MD5 sum: 36d3f65bcc10f0754a3234e00d92ad6d
Man-pages (2.33) - 1,752 KB:

    Download: http://www.kernel.org/pub/linux/ ... -pages-2.33.tar.bz2

    MD5 sum: e9f61ec73b5390c582530da173c12b10
Mktemp (1.5) - 69 KB:

    Home page: http://www.mktemp.org/

    Download: ftp://ftp.mktemp.org/pub/mktemp/mktemp-1.5.tar.gz

    MD5 sum: 9a35c59502a228c6ce2be025fc6e3ff2
Module-Init-Tools (3.2.2) - 166 KB:

    Download: http://www.kerneltools.org/pub/d ... tools-3.2.2.tar.bz2

    MD5 sum: a1ad0a09d3231673f70d631f3f5040e9
Ncurses (5.5) - 2,260 KB:

    Home page: http://dickey.his.com/ncurses/

    Download: ftp://invisible-island.net/ncurses/ncurses-5.5.tar.gz

    MD5 sum: e73c1ac10b4bfc46db43b2ddfd6244ef
Patch (2.5.9) - 198 KB:

    Home page: http://www.gnu.org/software/patch/

    Download: ftp://alpha.gnu.org/gnu/diffutils/patch-2.5.9.tar.gz

    MD5 sum: dacfb618082f8d3a2194601193cf8716
Perl (5.8.8) - 9,887 KB:

    Home page: http://www.perl.com/

    Download: http://ftp.funet.fi/pub/CPAN/src/perl-5.8.8.tar.bz2

    MD5 sum: a377c0c67ab43fd96eeec29ce19e8382
Procps (3.2.6) - 273 KB:

    Home page: http://procps.sourceforge.net/

    Download: http://procps.sourceforge.net/procps-3.2.6.tar.gz

    MD5 sum: 7ce39ea27d7b3da0e8ad74dd41d06783
Psmisc (22.2) - 239 KB:

    Home page: http://psmisc.sourceforge.net/

    Download: http://heanet.dl.sourceforge.net ... /psmisc-22.2.tar.gz

    MD5 sum: 77737c817a40ef2c160a7194b5b64337
Readline (5.1) - 1,983 KB:

    Home page: http://cnswww.cns.cwru.edu/php/chet/readline/rltop.html

    Download: http://ftp.gnu.org/gnu/readline/readline-5.1.tar.gz

    MD5 sum: 7ee5a692db88b30ca48927a13fd60e46
Sed (4.1.5) - 781 KB:

    Home page: http://www.gnu.org/software/sed/

    Download: http://ftp.gnu.org/gnu/sed/sed-4.1.5.tar.gz

    MD5 sum: 7a1cbbbb3341287308e140bd4834c3ba
Shadow (4.0.16) - 1,412 KB:

    Download: ftp://ftp.pld.org.pl/software/shadow/shadow-4.0.16.tar.bz2

    MD5 sum: 1d91f7479143d1d705b94180c0d4874b
    Note

    Shadow (4.0.16) may no longer be available at the listed location. The site administrators of the master download location occasionally remove older versions when new ones are released. An alternative download location that may have the correct version available is http://cross-lfs.org/files/packages/1.0.0/.
Sysklogd (1.4.1) - 80 KB:

    Home page: http://www.infodrom.org/projects/sysklogd/

    Download: http://www.infodrom.org/projects ... sklogd-1.4.1.tar.gz

    MD5 sum: d214aa40beabf7bdb0c9b3c64432c774
Sysvinit (2.86) - 97 KB:

    Download: ftp://ftp.cistron.nl/pub/people/ ... ysvinit-2.86.tar.gz

    MD5 sum: 7d5d61c026122ab791ac04c8a84db967
Tar (1.15.1) - 1,574 KB:

    Home page: http://www.gnu.org/software/tar/

    Download: http://ftp.gnu.org/gnu/tar/tar-1.15.1.tar.bz2

    MD5 sum: 57da3c38f8e06589699548a34d5a5d07
Tcl (8.4.12) - 3,419 KB:

    Home page: http://tcl.sourceforge.net/

    Download: http://prdownloads.sourceforge.n ... src.tar.gz?download

    MD5 sum: 7480432d8730263f267952788eb4839b
Texinfo (4.8) - 1,487 KB:

    Home page: http://www.gnu.org/software/texinfo/

    Download: http://ftp.gnu.org/gnu/texinfo/texinfo-4.8.tar.bz2

    MD5 sum: 6ba369bbfe4afaa56122e65b3ee3a68c
Tree (1.5.0) - 26 KB:

    Download: ftp://mama.indstate.edu/linux/tree/tree-1.5.0.tgz

    MD5 sum: e0d090c564e7ea5afa16bac80620c7e0
Udev (096) - 192 KB:

    Home page: http://www.kernel.org/pub/linux/utils/kernel/hotplug/udev.html

    Download: http://www.kernel.org/pub/linux/ ... ug/udev-096.tar.bz2

    MD5 sum: f4effef7807ce1dc91ab581686ef197b
Udev Cross-LFS Rules (1.0-3) - 12 KB:

    Download: http://cross-lfs.org/files/packa ... s-lfs-1.0-3.tar.bz2

    MD5 sum: 0c9b9e24a37b9501bcd4889da71cf313
Util-linux (2.12r) - 1,339 KB:

    Download: http://www.kernel.org/pub/linux/ ... linux-2.12r.tar.bz2

    MD5 sum: af9d9e03038481fbf79ea3ac33f116f9
Vim (7.0) - 6,422 KB:

    Home page: http://www.vim.org

    Download: ftp://ftp.vim.org/pub/vim/unix/vim-7.0.tar.bz2

    MD5 sum: 4ca69757678272f718b1041c810d82d8
Vim (7.0) language files (optional) - 1,153 KB:

    Download: ftp://ftp.vim.org/pub/vim/extra/vim-7.0-lang.tar.gz

    MD5 sum: 6d43efaff570b5c86e76b833ea0c6a04
Zlib (1.2.3) - 485 KB:

    Home page: http://www.zlib.net/

    Download: http://www.zlib.net/zlib-1.2.3.tar.gz

    MD5 sum: debc62758716a169df9f62e6ab2bc634

Total size of these packages: about 180 MB
3.3. Additional Packages for x86

GRUB (0.97) - 950 KB:

    Home page: http://www.gnu.org/software/grub/

    Download: ftp://alpha.gnu.org/gnu/grub/grub-0.97.tar.gz

    MD5 sum: cd3f3eb54446be6003156158d51f4884

Total size of these packages: about 950 KB
3.4. Needed Patches

In addition to the packages, several patches are also required. These patches correct any mistakes in the packages that should be fixed by the maintainer. The patches also make small modifications to make the packages easier to work with. The following patches will be needed to build a CLFS system:

Bash Fixes Patch - 23 KB:

    Download: http://patches.cross-lfs.org/1.0.0/bash-3.1-fixes-8.patch

    MD5 sum: bc337045fa4c5839babf0306cc9df6d0
Binutils Posix Patch - 4.9 KB:

    Download: http://patches.cross-lfs.org/1.0.0/binutils-2.17-posix-1.patch

    MD5 sum: 7e42a8edc0c59246bbc58c428256113c
Bzip2 Documentation Patch - 1.7 KB:

    Download: http://patches.cross-lfs.org/1.0 ... nstall_docs-1.patch

    MD5 sum: 9e5dfbf4814b71ef986b872c9af84488
Bzip2 Bzdiff Remove Tempfile - 1.8 KB:

    Download: http://patches.cross-lfs.org/1.0 ... ve_tempfile-1.patch

    MD5 sum: bcadb0ce282c96af15a86a2ccdac0765
Bzip2 Bzgrep Security Fixes Patch - 1.3 KB:

    Download: http://patches.cross-lfs.org/1.0 ... ep_security-1.patch

    MD5 sum: 4eae50e4fd690498f23d3057dfad7066
Coreutils Suppress Uptime, Kill, Su Patch - 13 KB:

    Download: http://patches.cross-lfs.org/1.0 ... ime_kill_su-1.patch

    MD5 sum: 227d41a6d0f13c31375153eae91e913d
Expect Spawn Patch - 6.9 KB:

    Download: http://patches.cross-lfs.org/1.0.0/expect-5.43.0-spawn-2.patch

    MD5 sum: 7706e1e8238c72eed8dc905d6f3b6aa9
Gawk Segfault Patch - 1.3 KB:

    Download: http://patches.cross-lfs.org/1.0 ... egfault_fix-1.patch

    MD5 sum: 7679530d88bf3eb56c42eb6aba342ddb
GCC Cross Search Paths Patch - 2 KB:

    Download: http://patches.cross-lfs.org/1.0 ... earch_paths-1.patch

    MD5 sum: 541fe39d228ddaa0d8396a35ec3a0ada
GCC PR20425 Patch - 36 KB:

    Download: http://patches.cross-lfs.org/1.0.0/gcc-4.1.1-PR20425-1.patch

    MD5 sum: 95535bda8e4d37d30251db0b121b5374
GCC Posix Patch - 9 KB:

    Download: http://patches.cross-lfs.org/1.0.0/gcc-4.1.1-posix-1.patch

    MD5 sum: 0d88068740a0e00780891f2cb905b808
Glibc iconv Fix - 4 KB:

    Download: http://patches.cross-lfs.org/1.0.0/glibc-2.4-iconv_fix-1.patch

    MD5 sum: 9c8e681226ccf7a1f25c6467674f915e
Glibc Disable linking with libgcc_eh.a - 1 KB:

    Download: http://patches.cross-lfs.org/1.0.0/glibc-2.4-libgcc_eh-1.patch

    MD5 sum: e5122ea7b89a5f22615eaadf8e46b334
Glibc Localedef Segfault - 1.9 KB:

    Download: http://patches.cross-lfs.org/1.0 ... ef_segfault-1.patch

    MD5 sum: 42452abc6196789e0a83afa1ca7e6e4e
Gzip Security Fix Patch - 2 KB:

    Download: http://patches.cross-lfs.org/1.0 ... urity_fixes-1.patch

    MD5 sum: f107844f01fc49446654ae4a8f8a0728
Inetutils inet_addr Patch - 4 KB:

    Download: http://patches.cross-lfs.org/1.0 ... et_addr_fix-1.patch

    MD5 sum: a33267b7a4e0d303a6f8dfeafde7bd8e
Inetutils GCC 4.x Fixes Patch - 4.1 KB:

    Download: http://patches.cross-lfs.org/1.0 ... -gcc4_fixes-3.patch

    MD5 sum: 5204fbc503c9fb6a8e353583818db6b9
Inetutils No-Server-Man-Pages Patch - 1.3 KB:

    Download: http://patches.cross-lfs.org/1.0 ... r_man_pages-1.patch

    MD5 sum: eb477f532bc6d26e7025fcfc4452511d
KBD GCC 4.x Fixes Patch - 1.5 KB:

    Download: http://patches.cross-lfs.org/1.0.0/kbd-1.12-gcc4_fixes-1.patch

    MD5 sum: 615bc1e381ab646f04d8045751ed1f69
Linux Tulip Update Patch - 8 KB:

    Download: http://patches.cross-lfs.org/1.0.0/linux-2.6.17.13-tulip-1.patch

    MD5 sum: 0dd7027a8cb8e59c74c24ff0a8f45f3b
Mktemp Tempfile Patch - 3.6 KB:

    Download: http://patches.cross-lfs.org/1.0 ... dd_tempfile-3.patch

    MD5 sum: 65d73faabe3f637ad79853b460d30a19
Perl Libc Patch - 4 KB:

    Download: http://patches.cross-lfs.org/1.0.0/perl-5.8.8-libc-2.patch

    MD5 sum: 3bf8aef1fb6eb6110405e699e4141f99
Readline Fixes Patch - 2.1 KB:

    Download: http://patches.cross-lfs.org/1.0.0/readline-5.1-fixes-3.patch

    MD5 sum: e30963cd5c6f6a11a23344af36cfa38c
Sysklogd Fixes Patch - 28 KB:

    Download: http://patches.cross-lfs.org/1.0.0/sysklogd-1.4.1-fixes-1.patch

    MD5 sum: 508104f058d1aef26b3bc8059821935f
Tar GCC-4.x Fix Patch - 1.2 KB:

    Download: http://patches.cross-lfs.org/1.0 ... 4_fix_tests-1.patch

    MD5 sum: 8e286a1394e6bcf2907f13801770a72a
Tar Security Fix Patch - 3.9 KB:

    Download: http://patches.cross-lfs.org/1.0 ... urity_fixes-1.patch

    MD5 sum: 19876e726d9cec9ce1508e3af74dc22e
Tar Sparse Fix Patch - 1 KB:

    Download: http://patches.cross-lfs.org/1.0.0/tar-1.15.1-sparse_fix-1.patch

    MD5 sum: 9e3623f7c88d8766878ecb27c980d86a
Texinfo Tempfile Fix Patch - 2.2 KB:

    Download: http://patches.cross-lfs.org/1.0 ... empfile_fix-2.patch

    MD5 sum: 559bda136a2ac7777ecb67511227af85
Util-linux Cramfs Patch - 2.8 KB:

    Download: http://patches.cross-lfs.org/1.0 ... .12r-cramfs-1.patch

    MD5 sum: 1c3f40b30e12738eb7b66a35b7374572
Util-linux GCC 4.x Patch - 1 KB:

    Download: http://patches.cross-lfs.org/1.0 ... -gcc4_fixes-1.patch

    MD5 sum: 6c030921dc9b92daf688f12a4ee6f6e0
Util-linux Missing Header Patch - 1 KB:

    Download: http://patches.cross-lfs.org/1.0 ... sing_header-1.patch

    MD5 sum: 33ccc15d2e92caa6189b044f573fdcda
Vim Fixes Patch - 32 KB:

    Download: http://patches.cross-lfs.org/1.0.0/vim-7.0-fixes-5.patch

    MD5 sum: 6e179cfe811d105de4fd9156a0ef6699
Zlib fPIC Patch - 3.2 KB:

    Download: http://patches.cross-lfs.org/1.0.0/zlib-1.2.3-fPIC-1.patch

    MD5 sum: 545d60b20bfde6f53023de44438cef59

Total size of these patches: about 214.7 KB

In addition to the above required patches, there exist a number of optional patches created by the CLFS community. These optional patches solve minor problems or enable functionality that is not enabled by default. Feel free to peruse the patches database located at http://patches.cross-lfs.org/1.0.0/ and acquire any additional patches to suit the system needs.
3.5. Additional Patches for x86

Coreutils Uname Patch - 4.5 KB:

    Download: http://patches.cross-lfs.org/1.0.0/coreutils-5.96-uname-1.patch

    MD5 sum: c05b735710fbd62239588c07084852a0
GCC Specs Patch - 15 KB:

    Download: http://patches.cross-lfs.org/1.0.0/gcc-4.1.1-specs-1.patch

    MD5 sum: a17be8ccfb978e73f382be5093dd8abd
Grub Various Fixes - 136 KB:

    Download: http://patches.cross-lfs.org/1.0.0/grub-0.97-fixes-1.patch

    MD5 sum: 6f095b98bde1db8d5b1a7ceef96ca351

Total size of these patches: about 155.5 KB

4.建立${CLFS}/tools目录
export CLFS=/mnt/clfs
install -dv ${CLFS}
install -dv ${CLFS}/tools
ln -sfv ${CLFS}/tools /
5.建立${CLFS}/cross-tools目录
install -dv ${CLFS}/cross-tools
ln -sv ${CLFS}/cross-tools /
6建立clfs用户
groupadd clfs
useradd -s /bin/bash -g clfs -m -k /dev/null clfs
chown -v clfs ${CLFS}/tools
chown -v clfs ${CLFS}/cross-tools


chown -v clfs ${CLFS}/sources
su - clfs
7.设置clfs用户环境

cat > ~/.bash_profile << "EOF"
exec env -i HOME=${HOME} TERM=${TERM} PS1='\u:\w\$ ' /bin/bash
EOF


cat > ~/.bashrc << "EOF"
set +h
umask 022
CLFS=/mnt/clfs
LC_ALL=POSIX
PATH=/cross-tools/bin:/bin:/usr/bin
export CLFS LC_ALL PATH
EOF

source ~/.bash_profile

8.改变CFLAGS设置
unset CFLAGS
unset CXXFLAGS
echo unset CFLAGS >> ~/.bashrc
echo unset CXXFLAGS >> ~/.bashrc
9.构建几个变量
export CLFS_HOST="$(echo $MACHTYPE | sed "s/$(echo $MACHTYPE | cut -d- -f2)/cross/")"
export CLFS_TARGET="i686-pc-linux-gnu"
echo export CLFS_HOST=\""${CLFS_HOST}\"" >> ~/.bashrc
echo export CLFS_TARGET=\""${CLFS_TARGET}\"" >> ~/.bashrc

10安装Linux-Headers
install -dv /tools/include

cd $CLFS/sources  &&
tar xfv linux-headers-2.6.17.13-09092006.tar.bz2 &&
cd linux-headers-2.6.17.13 &&
cp -av include/asm-i386 /tools/include/asm &&
cp -av include/{asm-generic,linux} /tools/include/ &&
cd .. &&
rm -vrf linux-headers-2.6.17.13

11.安装Cross Binutils

tar xfv binutils-2.17.tar.bz2 && cd binutils-2.17 &&
patch -Np1 -i ../binutils-2.17-posix-1.patch &&
mkdir -v ../binutils-build &&
cd ../binutils-build

../binutils-2.17/configure --prefix=/cross-tools \
    --host=${CLFS_HOST} --target=${CLFS_TARGET} --with-lib-path=/tools/lib \
    --disable-nls --enable-shared --disable-multilib

make configure-host &&
make &&
make install &&
cp -v ../binutils-2.17/include/libiberty.h /tools/include &&
cd ..

12.安装静态Cross GCC-4.1.1

tar xfv gcc-4.1.1.tar.bz2 &&
cd gcc-4.1.1 &&
patch -Np1 -i ../gcc-4.1.1-specs-1.patch &&
patch -Np1 -i ../gcc-4.1.1-posix-1.patch &&
patch -Np1 -i ../gcc-4.1.1-cross_search_paths-1.patch &&
echo "
#undef STARTFILE_PREFIX_SPEC
#define STARTFILE_PREFIX_SPEC \"/tools/lib/\"" >> gcc/config/linux.h


cp -v gcc/Makefile.in{,.orig}
sed -e "s@\(^CROSS_SYSTEM_HEADER_DIR =\).*@\1 /tools/include@g" \
    gcc/Makefile.in.orig > gcc/Makefile.in


mkdir -v ../gcc-build &&
cd ../gcc-build

../gcc-4.1.1/configure --prefix=/cross-tools \
    --host=${CLFS_HOST} --target=${CLFS_TARGET} --disable-multilib \
    --with-local-prefix=/tools --disable-nls --disable-shared \
    --disable-threads --enable-languages=c

make all-gcc &&
make install-gcc && cd ..
13.安装glibc
tar xfv glibc-2.4.tar.bz2 && cd glibc-2.4 &&
patch -Np1 -i ../glibc-2.4-libgcc_eh-1.patch && patch -Np1 -i ../glibc-2.4-localedef_segfault-1.patch


cp -v nscd/Makefile{,.orig}
sed -e "/nscd_stat.o: sysincludes = # nothing/d" nscd/Makefile.orig > \
    nscd/Makefile

mkdir -v ../glibc-build && cd ../glibc-build &&
echo "libc_cv_forced_unwind=yes" > config.cache && echo "libc_cv_c_cleanup=yes" >> config.cache



BUILD_CC="gcc" CC="${CLFS_TARGET}-gcc" \
    AR="${CLFS_TARGET}-ar" RANLIB="${CLFS_TARGET}-ranlib" \
    ../glibc-2.4/configure --prefix=/tools \
    --host=${CLFS_TARGET} --build=${CLFS_HOST} \
    --disable-profile --enable-add-ons \
    --with-tls --enable-kernel=2.6.0 --with-__thread \
    --with-binutils=/cross-tools/bin --with-headers=/tools/include \
    --cache-file=config.cache


make && make install && cd ..

14.GCC-4.1.1实际交叉编译
rm -rf gcc-build &&
cd gcc-4.1.1 &&
patch -Np1 -i ../gcc-4.1.1-PR20425-1.patch


cp -v configure{,.orig} &&
sed -e  '/FLAGS_FOR_TARGET.*\/lib\//s@-B[^ ]*/lib/@@g' configure.orig >configure

mkdir -v ../gcc-build &&
cd ../gcc-build

../gcc-4.1.1/configure --prefix=/cross-tools \
    --target=${CLFS_TARGET} --host=${CLFS_HOST} --disable-multilib \
    --with-local-prefix=/tools --disable-nls --enable-shared \
    --enable-languages=c,c++ --enable-__cxa_atexit \
    --enable-c99 --enable-long-long --enable-threads=posix


make AS_FOR_TARGET="${CLFS_TARGET}-as" \
    LD_FOR_TARGET="${CLFS_TARGET}-ld"

make install && cd ..

二、构建一个临时系统
1.建立变量

export CC="${CLFS_TARGET}-gcc" &&
export CXX="${CLFS_TARGET}-g++" &&
export AR="${CLFS_TARGET}-ar" &&
export AS="${CLFS_TARGET}-as" &&
export RANLIB="${CLFS_TARGET}-ranlib" &&
export LD="${CLFS_TARGET}-ld" &&
export STRIP="${CLFS_TARGET}-strip"


echo export CC=\""${CC}\"" >> ~/.bashrc &&
echo export CXX=\""${CXX}\"" >> ~/.bashrc &&
echo export AR=\""${AR}\"" >> ~/.bashrc &&
echo export AS=\""${AS}\"" >> ~/.bashrc &&
echo export RANLIB=\""${RANLIB}\"" >> ~/.bashrc &&
echo export LD=\""${LD}\"" >> ~/.bashrc &&
echo export STRIP=\""${STRIP}\"" >> ~/.bashrc

2.安装 Binutils-2.17

tar xfv binutils-2.17.tar.bz2 && cd binutils-2.17 &&
patch -Np1 -i ../binutils-2.17-posix-1.patch &&
mkdir -v ../binutils-build &&
cd ../binutils-build


../binutils-2.17/configure --prefix=/tools \
    --build=${CLFS_HOST} --host=${CLFS_TARGET} --target=${CLFS_TARGET} \
    --disable-nls --enable-shared --disable-multilib

make configure-host &&
make && make install && cd ..
3.安装GCC-4.1.1
tar xfv gcc-4.1.1.tar.bz2 && cd gcc-4.1.1 &&
patch -Np1 -i ../gcc-4.1.1-PR20425-1.patch &&
patch -Np1 -i ../gcc-4.1.1-specs-1.patch &&
patch -Np1 -i ../gcc-4.1.1-posix-1.patch &&
patch -Np1 -i ../gcc-4.1.1-cross_search_paths-1.patch &&
cp -v gcc/cppdefault.c{,.orig} &&
sed -e '/#define STANDARD_INCLUDE_DIR/s@"/usr/include"@0@g' \
    gcc/cppdefault.c.orig > gcc/cppdefault.c

cp -v gcc/Makefile.in{,.orig} &&
sed -e 's@\(^NATIVE_SYSTEM_HEADER_DIR =\).*@\1 /tools/include@g' \
    gcc/Makefile.in.orig > gcc/Makefile.in

mkdir -v ../gcc-build && cd ../gcc-build


../gcc-4.1.1/configure --prefix=/tools \
    --build=${CLFS_HOST} --host=${CLFS_TARGET} --target=${CLFS_TARGET} \
    --with-local-prefix=/tools --enable-long-long --enable-c99 \
    --enable-shared --enable-threads=posix --enable-__cxa_atexit \
    --disable-nls --enable-languages=c,c++ --disable-libstdcxx-pch

make AS_FOR_TARGET="${AS}" \
    LD_FOR_TARGET="${LD}"


如出现错误以下:
      ../../gcc-4.1.1/gcc/config/sparc/sparc.c -o sparc.o
sparc64-unknown-linux-gnu-gcc -c   -g -O2  -DIN_GCC -DCROSS_COMPILE  -W -Wall -Wwrite-strings -Wstrict-prototypes -Wmissing-prototypes -pedantic -Wno-long-long -Wno-variadic-macros -Wold-style-definition -Wmissing-format-attribute    -DHAVE_CONFIG_H -I. -I. -I../../gcc-4.1.1/gcc -I../../gcc-4.1.1/gcc/. -I../../gcc-4.1.1/gcc/../include -I../../gcc-4.1.1/gcc/../libcpp/include     -I. -I. -I../../gcc-4.1.1/gcc -I../../gcc-4.1.1/gcc/. -I../../gcc-4.1.1/gcc/../include -I../../gcc-4.1.1/gcc/../libcpp/include  \
        ../../gcc-4.1.1/gcc/config/host-linux.c
../../gcc-4.1.1/gcc/config/host-linux.c: In function 'linux_gt_pch_use_address':
../../gcc-4.1.1/gcc/config/host-linux.c:208: error: 'SSIZE_MAX' undeclared (first use in this function)
../../gcc-4.1.1/gcc/config/host-linux.c:208: error: (Each undeclared identifier is reported only once
../../gcc-4.1.1/gcc/config/host-linux.c:208: error: for each function it appears in.)
make[2]: *** [host-linux.o] Error 1
make[2]: Leaving directory `/mnt/lfs/sources/gcc-build/gcc'
make[1]: *** [all-gcc] Error 2
make[1]: Leaving directory `/mnt/lfs/sources/gcc-build'
make: *** [all] Error 2

用以下命令查找包含变量的文件:
grep SSIZE_MAX /{usr,tools}/include -Hrn | grep define
在/mnt/clfs/sources/gcc-4.1.1/gcc/config/host-linux.c加入:
#include <bits/posix1_lim.h>


make install && cd ..



4.安装Ncurses-5.5
tar xfv ncurses-5.5.tar.gz && cd ncurses-5.5

./configure --prefix=/tools --with-shared \
    --build=${CLFS_HOST} --host=${CLFS_TARGET} \
    --without-debug --without-ada \
    --enable-overwrite --with-build-cc=gcc

make && make install && cd ..

5.安装bash-3.1
tar xfv bash-3.1.tar.gz && cd bash-3.1

echo "ac_cv_func_setvbuf_reversed=no" >> config.cache &&
echo "bash_cv_sys_named_pipes=yes" >> config.cache

./configure --prefix=/tools \
    --build=${CLFS_HOST} --host=${CLFS_TARGET} \
    --without-bash-malloc --cache-file=config.cache

make && make install && ln -sv bash /tools/bin/sh && cd ..

6.安装bzip2-1.0.3
tar xfv bzip2-1.0.3.tar.gz && cd bzip2-1.0.3

cp -v Makefile{,.orig} &&
sed -e 's@^\(all:.*\) test@\1@g' Makefile.orig > Makefile

make CC="${CC}" AR="${AR}" RANLIB="${RANLIB}" &&
make PREFIX=/tools install && cd ..
7.安装coreutils-5.96
tar xfv coreutils-5.96.tar.bz2 && cd coreutils-5.96 &&
echo "ac_cv_sys_restartable_syscalls=yes" > config.cache &&
echo "ac_cv_func_setvbuf_reversed=yes" >> config.cache &&
echo "utils_cv_sys_open_max=1024" >> config.cache

./configure --prefix=/tools --cache-file=config.cache \
    --build=${CLFS_HOST} --host=${CLFS_TARGET}

make && make install && cd ..

8.安装diffutils-2.8.7

tar xfv diffutils-2.8.7.tar.gz  && cd diffutils-2.8.7

./configure --prefix=/tools \
    --build=${CLFS_HOST} --host=${CLFS_TARGET}


make && make install && cd ..

9.安装findutils-4.2.27
tar xfv findutils-4.2.27.tar.gz && cd findutils-4.2.27 &&
echo "am_cv_func_working_getline=yes" >> config.cache

./configure --prefix=/tools \
    --build=${CLFS_HOST} --host=${CLFS_TARGET} \
    --cache-file=config.cache

make && make install && cd ..

10.安装gawk-3.1.3
tar xfv gawk-3.1.3.tar.bz2  && cd gawk-3.1.3

./configure --prefix=/tools \
    --build=${CLFS_HOST} --host=${CLFS_TARGET}
make && make install && cd ..

11、安装 gettext

tar xfv gettext-0.14.5.tar.gz && cd gettext-0.14.5 &&
cd gettext-tools &&
echo "am_cv_func_working_getline=yes" >> config.cache

./configure --prefix=/tools \
    --build=${CLFS_HOST} --host=${CLFS_TARGET} \
    --disable-shared --cache-file=config.cache

make -C lib &&
make -C src msgfmt &&
cp -v src/msgfmt /tools/bin && cd ../..

12、安装grep-2.5.1a

tar xfv grep-2.5.1a.tar.bz2  && cd grep-2.5.1a

./configure --prefix=/tools \
    --build=${CLFS_HOST} --host=${CLFS_TARGET} \
    --disable-perl-regexp

make && make install && cd ..

13.安装gzip-1.3.5
tar xfv gzip-1.3.5.tar.gz && cd gzip-1.3.5
cp -v configure{,.orig} &&
sed -e "s@nm conftest@${CLFS_TARGET}-&@" configure.orig > configure &&
./configure --prefix=/tools \
    --build=${CLFS_HOST} --host=${CLFS_TARGET} &&
make && make install && cd ..

14、安装make-3.81

tar xfv make-3.81.tar.bz2  && cd make-3.81 &&
./configure --prefix=/tools \
    --build=${CLFS_HOST} --host=${CLFS_TARGET} &&
make && make install && cd ..

15、安装patch-2.5.9
tar xfv patch-2.5.9.tar.gz && cd patch-2.5.9 &&
./configure --prefix=/tools \
    --build=${CLFS_HOST} --host=${CLFS_TARGET} &&
make && make install && cd ..

16安装sed-4.1.5

tar xfv sed-4.1.5.tar.gz && cd sed-4.1.5 &&
./configure --prefix=/tools \
    --build=${CLFS_HOST} --host=${CLFS_TARGET} &&
make && make install && cd ..

17、安装tar-1.15.1
tar xfv tar-1.15.1.tar.bz2 && cd tar-1.15.1 &&
echo "am_cv_func_working_getline=yes" >> config.cache &&
./configure --prefix=/tools \
    --build=${CLFS_HOST} --host=${CLFS_TARGET} \
    --cache-file=config.cache &&
make && make install && cd ..

18、安装texinfo-4.6
tar xfv texinfo-4.6.tar.bz2  && cd texinfo-4.6 &&
./configure --prefix=/tools \
    --build=${CLFS_HOST} --host=${CLFS_TARGET} &&
make && make install && cd ..

=======================================================

1.建立目录:

mkdir -pv ${CLFS}/{bin,boot,dev,{etc/,}opt,home,lib,mnt} &&
mkdir -pv ${CLFS}/{proc,media/{floppy,cdrom},sbin,srv,sys} &&
mkdir -pv ${CLFS}/var/{lock,log,mail,run,spool} &&
mkdir -pv ${CLFS}/var/{opt,cache,lib/{misc,locate},local} &&
install -dv -m 0750 ${CLFS}/root &&
install -dv -m 1777 ${CLFS}{/var,}/tmp &&
mkdir -pv ${CLFS}/usr/{,local/}{bin,include,lib,sbin,src} &&
mkdir -pv ${CLFS}/usr/{,local/}share/{doc,info,locale,man} &&
mkdir -pv ${CLFS}/usr/{,local/}share/{misc,terminfo,zoneinfo} &&
mkdir -pv ${CLFS}/usr/{,local/}share/man/man{1,2,3,4,5,6,7,8} &&
for dir in ${CLFS}/usr{,/local}; do
  ln -sv share/{man,doc,info} $dir
done
2.建立必要的链接
ln -sv /tools/bin/{bash,cat,grep,pwd,stty} ${CLFS}/bin &&
ln -sv /tools/lib/libgcc_s.so{,.1} ${CLFS}/usr/lib &&
ln -sv /tools/lib/libstd* ${CLFS}/usr/lib &&
ln -sv bash ${CLFS}/bin/sh

3 .Installation of Zlib
tar xfv zlib-1.2.3.tar.gz  && cd zlib-1.2.3 &&
./configure --prefix=/tools --shared &&
make && make install && cd .. && rm -rf zlib-1.2.3

4.Installation of E2fsprogs
tar xfv e2fsprogs-1.39.tar.gz && cd e2fsprogs-1.39 &&
mkdir -v build && cd build &&
../configure --prefix=/tools \
    --enable-elf-shlibs --disable-evms \
    --build=${CLFS_HOST} --host=${CLFS_TARGET} &&
make && make DESTDIR=${CLFS} install &&
make install-libs &&
ln -sv /tools/sbin/{fsck.ext2,fsck.ext3,e2fsck} ${CLFS}/sbin &&
cd ../.. &&
rm -rf e2fsprogs-1.39

5.
tar xfv sysvinit-2.86.tar.gz  && cd sysvinit-2.86 &&
cp -v src/Makefile src/Makefile.orig &&
sed -e 's@root@0@g' \
    -e "s@/dev/initctl@${CLFS}&@g" \
    -e 's@\(mknod \)-m \([0-9]* \)\(.* \)p@\1\3p; chmod \2\3@g' \
    -e "s@/usr/lib@/tools/lib@" \
    src/Makefile.orig > src/Makefile &&
make -C src clobber &&
make -C src CC="${CC}" &&
make -C src install INSTALL="install" ROOT="${CLFS}" &&
cd .. && rm -rf sysvinit-2.86

6.Configuring Sysvinit

cat > ${CLFS}/etc/inittab << "EOF"
# Begin /etc/inittab

id:3:initdefault:

si::sysinit:/etc/rc.d/init.d/rc sysinit

l0:0:wait:/etc/rc.d/init.d/rc 0
l1:S1:wait:/etc/rc.d/init.d/rc 1
l2:2:wait:/etc/rc.d/init.d/rc 2
l3:3:wait:/etc/rc.d/init.d/rc 3
l4:4:wait:/etc/rc.d/init.d/rc 4
l5:5:wait:/etc/rc.d/init.d/rc 5
l6:6:wait:/etc/rc.d/init.d/rc 6

ca:12345:ctrlaltdel:/sbin/shutdown -t1 -a -r now

su:S016nce:/sbin/sulogin

1:2345:respawn:/sbin/agetty -I '\033(K' tty1 9600
2:2345:respawn:/sbin/agetty -I '\033(K' tty2 9600
3:2345:respawn:/sbin/agetty -I '\033(K' tty3 9600
4:2345:respawn:/sbin/agetty -I '\033(K' tty4 9600
5:2345:respawn:/sbin/agetty -I '\033(K' tty5 9600
6:2345:respawn:/sbin/agetty -I '\033(K' tty6 9600

# End /etc/inittab
EOF

7. Module-Init-Tools-3.2.2
tar xfv module-init-tools-3.2.2.tar.bz2 && cd module-init-tools-3.2.2 &&
./configure --prefix=/ \
    --build=${CLFS_HOST} --host=${CLFS_TARGET} &&
make && make DESTDIR="${CLFS}" install && cd .. &&
rm -rf module-init-tools-3.2.2

8.
tar xfv util-linux-2.12r.tar.gz && cd util-linux-2.12r &&
patch -Np1 -i ../util-linux-2.12r-cramfs-1.patch &&
patch -Np1 -i ../util-linux-2.12r-gcc4_fixes-1.patch &&
patch -Np1 -i ../util-linux-2.12r-missing_header-1.patch &&
cp -v configure{,.orig} &&
sed -e 's@/usr/include@/tools/include@g' configure.orig > configure &&
cp -v MCONFIG{,.orig} &&
sed -e 's|-o root||' MCONFIG.orig > MCONFIG &&
./configure &&
make HAVE_KILL=yes HAVE_SLN=yes \
    HAVE_SHADOW=no CPUOPT="" ARCH="" \
    CPU="" &&
make HAVE_KILL=yes HAVE_SLN=yes HAVE_SHADOW=no \
    USE_TTY_GROUP=no CPUOPT="" ARCH="" \
    CPU="" DESTDIR=${CLFS} install &&
cd .. && rm -rf util-linux-2.12r

9. Udev-096
tar xfv  udev-096.tar.bz2  && cd udev-096  &&
make CROSS_COMPILE="${CLFS_TARGET}-" CC="${CC}" LD="${CC}" &&
make DESTDIR=${CLFS} install &&
cd .. && rm -rf udev-096
10. Creating the passwd, group, and log Files
10.1
cat > ${CLFS}/etc/passwd << "EOF"
root::0:0:root:/root:/bin/bash
EOF
10.2
cat > ${CLFS}/etc/group << "EOF"
root:x:0:
bin:x:1:
sys:x:2:
kmem:x:3:
tty:x:4:
tape:x:5:
daemon:x:6:
floppy:x:7:
disk:x:8:
lp:x:9:
dialout:x:10:
audio:x:11:
video:x:12:
utmp:x:13:
usb:x:14:
cdrom:x:15:
EOF
10.3
touch ${CLFS}/var/run/utmp ${CLFS}/var/log/{btmp,lastlog,wtmp} &&
chmod -v 664 ${CLFS}/var/run/utmp ${CLFS}/var/log/lastlog &&
chmod -v 600 ${CLFS}/var/log/btmp

11.Linux-2.6.17.13
PATH=/tools/bin:/tools/sbinPATH
tar xfv linux-2.6.17.13.tar.bz2 && cd linux-2.6.17.13
patch -Np1 -i ../linux-2.6.17.13-tulip-1.patch
make mrproper
make ARCH=i386 CROSS_COMPILE=${CLFS_TARGET}- menuconfig
make ARCH=i386 CROSS_COMPILE=${CLFS_TARGET}-
make ARCH=i386 CROSS_COMPILE=${CLFS_TARGET}- \
    INSTALL_MOD_PATH=${CLFS} modules_install
cp -v arch/i386/boot/bzImage ${CLFS}/boot/clfskernel-2.6.17.13
cp -v System.map ${CLFS}/boot/System.map-2.6.17.13
cp -v .config ${CLFS}/boot/config-2.6.17.13
cd ..
12.grub-0.97
tar xfv grub-0.97.tar.gz && cd grub-0.97 &&
patch -Np1 -i ../grub-0.97-fixes-1.patch &&
./configure --prefix=/usr \
   --build=${CLFS_HOST} --host=${CLFS_TARGET} &&
make && make DESTDIR=${CLFS} install &&
mkdir -v ${CLFS}/boot/grub &&
cp -v ${CLFS}/usr/lib/grub/*/stage{1,2} ${CLFS}/boot/grub &&
cd .. && rm -rf grub-0.97

===================================================================
1.Setting Up the Environment

cat > ${CLFS}/root/.bash_profile << "EOF"
set +h
PS1='\u:\w\$ '
LC_ALL=POSIX
PATH=/bin:/usr/bin:/sbin:/usr/sbin:/tools/bin:/tools/sbin
export LC_ALL PATH PS1
EOF

2.Creating the /etc/fstab File

cat > ${CLFS}/etc/fstab << "EOF"
# Begin /etc/fstab

# file system  mount-point  type   options          dump  fsck
#                                                         order

/dev/hda8      /            ext2  defaults         1     1
/dev/had5      swap         swap   pri=1            0     0
proc           /proc        proc   defaults         0     0
sysfs          /sys         sysfs  defaults         0     0
devpts         /dev/pts     devpts gid=4,mode=620   0     0
shm            /dev/shm     tmpfs  defaults         0     0
# End /etc/fstab
EOF

3. Installation of CLFS-Bootscripts

tar xfv bootscripts-cross-lfs-1.0.tar.bz2 && cd bootscripts-cross-lfs
make ETCDIR=${CLFS}/etc minimal
cat > ${CLFS}/etc/sysconfig/clock << "EOF"
# Begin /etc/sysconfig/clock

UTC=1

# End /etc/sysconfig/clock
EOF

4.Populating /dev

exit
export CLFS=/mnt/clfs
mknod -m 600 ${CLFS}/dev/console c 5 1
mknod -m 666 ${CLFS}/dev/null c 1 3
chown -Rv root:root ${CLFS}
5.压缩
tar -jcvf ${CLFS}.tar.bz2 ${CLFS}
到这里目标机系统建立完成。

6.安装Util-linux

cd $CLFS/sources/
tar xfv util-linux-2.12r.tar.gz &&
cd util-linux-2.12r &&
patch -Np1 -i ../util-linux-2.12r-gcc4_fixes-1.patch &&
cp -v configure{,.orig} &&
sed -e 's@/usr/include@/tools/include@g' configure.orig > configure

./configure
make ARCH="" CPU="" -C lib
make ARCH="" CPU="" -C mount mount umount
make ARCH="" CPU="" -C text-utils more

7.再向下安装LFS了
----------------
谢谢版主提醒,标题改了。
发表于 2006-11-5 07:09:55 | 显示全部楼层
貌似是 CLFS 手册的内容,另"再向下安装LFS"是何解?
回复 支持 反对

使用道具 举报

 楼主| 发表于 2006-11-5 09:06:04 | 显示全部楼层
不知楼上做过交叉软件编译没有。比如Embedded uClinux开发。
我的理解是:在本地机系统上(有人叫宿主机)编译另一台机要运行机器(有 人称目标机)的系统或软件叫交叉编译。
本文做到当前才做成能在目标机上启动和运行的临时系统,再向下装一遍能使系统运行的基本系统软件,应该属LFS安装了,当然如果不装系统也是能运行的,和LFS构建系统一样,一般都推荐装一遍。如果不想更方便的安装更多的软件,如架设各种服务、BLFS,从实用面讲似乎没必了。
由于才转到LFS,这里是按手册上的操作步骤,是本人的安装记录,也没整理,见谅。昨天www.linuxfromscratch.org挂了 ... 许有人需要。
还有,按照手册上操作有几处是通不过的,可将本文做个参考。
回复 支持 反对

使用道具 举报

发表于 2006-11-5 14:37:31 | 显示全部楼层
惭愧的说,交叉软件编译开发真的不懂,只做过 CLFS-1.0 x86_64 multilib,由 32_cross_64

还没有仔细看你的手记跟 CLFS 手册的区别,但是"再向下安装LFS"有点不解,其实这也是我对 CLFS-1.0 x86 32bit 不理解之处,为何要以 32_cross_32 的方式来做,而不接以传统方式做 LFS 系统?
回复 支持 反对

使用道具 举报

 楼主| 发表于 2006-11-5 15:10:43 | 显示全部楼层
我是才转到lfs,请多关照。
我用clfs目的是构建在686(P4)平台的系统,理论上肯定比386、486代码运行速度快,事实上的确很快。编译的时候看得出来,但没做测试记录。
更主要的是,clfs可以编出一个在本机上不一定能运行,却能在目标机上运行得很好的软件。我是做个练习。
回复 支持 反对

使用道具 举报

发表于 2006-11-5 15:18:30 | 显示全部楼层
chinajz 兄是否经常做交叉软件编译开发?

请常来指教指教。
回复 支持 反对

使用道具 举报

发表于 2006-11-8 10:11:01 | 显示全部楼层
你做的clfs能boot吗?
不会arm下的也用grub引导吧?
手册上诶有说啊,我 也试过grub,不可以。
飞豹兄和幻想大哥能出来回答下啊?
回复 支持 反对

使用道具 举报

发表于 2006-11-10 21:19:57 | 显示全部楼层
Post by sunbin
你做的clfs能boot吗?
不会arm下的也用grub引导吧?
手册上诶有说啊,我 也试过grub,不可以。
飞豹兄和幻想大哥能出来回答下啊?

grub-0.9x只能引导x86的机器,arm用arm相应的引导程序.
回复 支持 反对

使用道具 举报

发表于 2006-11-13 09:20:44 | 显示全部楼层
Post by youbest
grub-0.9x只能引导x86的机器,arm用arm相应的引导程序.

        arm用arm相应的引导程序,请问能详细点吗?手册说:Assuming the boot loader was set up as outlined earlier, CLFS SVN-2.0.0-2006115 will boot automatically。不解啊!飞豹兄可以帮忙解释下啊?!感激不尽。
回复 支持 反对

使用道具 举报

 楼主| 发表于 2006-11-13 11:25:25 | 显示全部楼层
如果用工控机,有磁盘存储设备,grub是可以引导的,如果是s3c系列(如:44b0x)等主板,首先将u-boot写入bios,设置好与主板的通讯。将编译好的uclinux文件(romfs+linux)写入到指定地址,就能引导系统了。
回复 支持 反对

使用道具 举报

您需要登录后才可以回帖 登录 | 注册

本版积分规则

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