LinuxSir.cn,穿越时空的Linuxsir!

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

也秀一下我的LFS。。。

[复制链接]
发表于 2009-2-21 13:50:49 | 显示全部楼层 |阅读模式
之前做过一下,没怎搞就rm掉了。
这几天翻出来,再装了一下。
刚装上scrot
就截几张图下来
LFS-6.3 + Xorg 7.4 + xfce4-4.4.3
我从没有学过计算机方面的课的,呵呵。
能做到这个地步很不错了,大家给点掌声。。。

本帖子中包含更多资源

您需要 登录 才可以下载或查看,没有帐号?注册

x
发表于 2009-2-21 14:08:52 | 显示全部楼层
想学着做LFS,有畏难情绪,羡慕楼主中
回复 支持 反对

使用道具 举报

 楼主| 发表于 2009-2-21 14:30:33 | 显示全部楼层
说难也不是很难,呵呵。。
反正这里面有这么多高人,有什么不懂的问就是啦。
我也是看着高手们的文章做出来的。
还很多很多不懂呢。
有些地方做得顺利的可能是运气吧,呵呵。
回复 支持 反对

使用道具 举报

发表于 2009-2-21 19:15:49 | 显示全部楼层
不错。要是楼主坚持不删除LFS,进步会更大的。
回复 支持 反对

使用道具 举报

发表于 2009-2-21 19:25:14 | 显示全部楼层
楼主这些软件包的安装要是想升级怎么办?
回复 支持 反对

使用道具 举报

 楼主| 发表于 2009-2-21 21:53:36 | 显示全部楼层
Post by zhongzhaoyong;1950722
楼主这些软件包的安装要是想升级怎么办?


再看看有没有升级的方法,没有的话我就再做一次,反正安装的笔记都在,做一下脚本就行了呗,呵呵。。。
回复 支持 反对

使用道具 举报

 楼主| 发表于 2009-2-21 21:59:30 | 显示全部楼层
Post by zhongzhaoyong;1950722
楼主这些软件包的安装要是想升级怎么办?


再看看有没有升级的方法,没有的话我就再做一次,反正安装的笔记都在,做一下脚本就行了呗,呵呵。。。
回复 支持 反对

使用道具 举报

 楼主| 发表于 2009-2-21 22:02:15 | 显示全部楼层
Post by ti8er;1950715
不错。要是楼主坚持不删除LFS,进步会更大的。


打算就用它了,放着一个DEBIAN应急了,呵呵。
回复 支持 反对

使用道具 举报

 楼主| 发表于 2009-2-22 07:03:57 | 显示全部楼层

把完整的经过写一下。

也可以到我的BLOG去看,呵呵。
一、LFS基本系统的构建
二、安装Xorg
三、安装Xfce4
四、Asla
五、nvidia驱动安装
六、一些软件
一.LFS的构建
    其实LFS6.4也出来了,只不过我电脑里只有6.3的ISO,就懒得下载了,我这里的网速讲缘分的。就用这个来算了。
    我用的宿主机是DEBIAN,要安装几样东西的,忘记是什么了,不过jhalfs好像有提示的,不过一开始不应该就用这个东西来做,还是一步一步,爽一下也说嘛,成不成功没所谓。
    我本身就分好区的,挂载上就可以:

mount /dev/sda8 /mnt/lfs
chmod -v a+wt /mnt/lfs
chown -v user /mnt/lfs

    这里的user就是用我DEBIAN的普通用户而已。

cd jhalfs-2.3.1
nano optimize/opt_config.d/O3pipe_march

    以下是O3pipe_march的内容:

CFLAGS_O3pipe_march=$CFLAGS_O3pipe" -march=pentium4"改成你使用的CPU类型 如我的是amd的则(athlon-xp)
CXXFLAGS_O3pipe_march=$CFLAGS_O3pipe" -march=pentium4"同上
LDFLAGS_O3pipe_march=$LDFLAGS_O3pipe
OTHER_CFLAGS_O3pipe_march=$CFLAGS_O3pipe" -march=pentium4"同上
OTHER_CXXFLAGS_O3pipe_march=$CXXFLAGS_O3pipe" -march=pentium4"同上
OTHER_LDFLAGS_O3pipe_march=$LDFLAGS_O3pipe

    然后开始执行 make或者time make

--- BOOK Settings --->
Use BOOK (Linux From Scratch) --->选择要编译的类型
(X) Linux From Scratch要编译LFS选择这个
( ) Cross-Compiled Linux From Scratch这个是CLFS
( ) Cross-Compiled Linux From Scratch (Sysroot method)也是CLFS不过还在开发
( ) Cross-Compiled Linux From Scratch (Embedded Systems)貌似嵌入系统的CLFS
( ) Hardened Linux From Scratch HLFS这个是用在安全方面的 ( ) Beyond Linux From Scratch BLFS这个大家都知道

Release (Working Copy) ---> 使用哪个版本的BOOK
( ) SVN 最新的BOO,开发中的
(X) Working Copy 稳定版,也是光盘上带的
( ) Branch or stable book 分枝??
(/usr/share/LFS-BOOK-6.3-XML) Loc of working copy (mandatory)选择书的位置,下载回来放在一个地方,记得要下XML的,不是HTML的。

[ ] Add custom tool support

[ ] Add blfs-tool support

--- General Settings --->常规设置

[ ] Change the default user/group for this build 建立LFS的用户和组,可以不选

(/mnt/build_dir) Build Directory 建立的LFS位置,自己按需要改 (这里设置/mnt/lfs)
  • Retrieve source files 源的位置

    (/lfs-sources) Package Archive Directory 我先把光盘MOUNT在一个地方再改这里的,也可以解压到/lfs-sources或者什么地方去。
    (http://ftp.lfs-matrix.net/) FTP mirror 如果需要下载,使用这个地址下
  • Always retrieve kernel package (see help)
  • Run the makefile 退出菜单后直接make

    [ ] Rebuild files

    --- Build Settings --->
  • Run testsuites 运行测试,默认是选上的,建议不要取消

    Tests level (Only final system Glibc, GCC and Binutils testsuites) ---> 可以选择测试的内容默认的就行了

    Flavour (Don't stop on test suite failures) --->

    [ ] Use a custom fstab file 使用fstab文件,需要指定fstab文件位置

    [ ] Build the kernel 要不要自动编译内核,需要指定内核配置文件的位置,一般没有设定好的配置文件不要选择此项,jhalfs执行完毕后自己编译内核
  • Strip Installed Binaries/Libraries 好像是自动清理调试代码
  • Install vim-lang package vim的语言支持补丁,建议加上

    (GMT) TimeZone 时区 我的是(Asia/Shanghai)

    ($LANG) Language 语言设置,你在使用光盘启动的时候选择的语言就是你$LANG的内容 镜镜姐姐推荐en_US.UTF8

    Groff page size (letter) --->

    --- Advanced Features --->高级设置
  • Create SBU and disk usage report

    [ ] Run comparison analysis on final stage
  • Use optimization (see help) 使用优化参数

    Optimization level (Final system only) --->全部默认就行了

    --- Internal Settings (WARNING: for jhalfs developers only) --->

    [ ] Rebuild the Makefile (see help)

    --- Load an Alternate Configuration File

    Save Configuration to an Alternate File

    完成后退出程序开始配置
    余下的过程都是自动化的,耐心等待完成即可,一般不会出现错误!
    其间会用到sudo,会叫输入一下密码的。


    1、 su 进入管理员状态。

    2 、
    1) mount --bind /dev /mnt/lfs/dev (这个非常重要,关系到grub能不能找到设备,这个要在进入chroot环境之前做
    2)加载必要的文件系统
    mount -vt proc proc $LFS/proc
    mount -vt sysfs sysfs $LFS/sys
    mount -vt devpts devpts $LFS/dev/pts
    mount -vt tmpfs shm $LFS/dev/shm
    3)Chroot到目标系统下
    chroot "$LFS" /usr/bin/env -i \
    HOME=/root TERM="$TERM" PS1='\u:\w\$ ' \
    PATH=/bin:/usr/bin:/sbin:/usr/sbin \
    /bin/bash --login

    3 设定root的密码。
    passwd root
    (下面的操作就和《手把手教你如何建立自己的Linux系统 第二版》后面部分的差不多相同了)

    4时间设置(Configuring the setclock Script)
    代码:
    cat > /etc/sysconfig/clock << "EOF"
    # Begin /etc/sysconfig/clock
    UTC=1
    # End /etc/sysconfig/clock
    EOF

    5设置bash下的键盘功能键设置
    代码:
    cat > /etc/inputrc << "EOF"
    set horizontal-scroll-mode Off
    set meta-flag On
    set input-meta On
    set convert-meta Off
    set output-meta On
    set bell-style none
    "\eOd": backward-word
    "\eOc": forward-word
    "\e[1~": beginning-of-line
    "\e[4~": end-of-line
    "\e[5~": beginning-of-history
    "\e[6~": end-of-history
    "\e[3~": delete-char
    "\e[2~": quoted-insert
    "\eOH": beginning-of-line
    "\eOF": end-of-line
    "\e[H": beginning-of-line
    "\e[F": end-of-line
    EOF

    6设置Bash Shell启动文件(The Bash Shell Startup Files)
    代码:
    cat > /etc/profile << "EOF"
    # Begin /etc/profile
    export LANG=zh_CN.UTF-8
    export INPUTRC=/etc/inputrc
    alias ls="ls --color"
    export PS1='\u:\w\$ '
    # End /etc/profile
    EOF

    注:zh_CN.UTF-8有可能乱码的嘛,用en_US.UTF-8吧。

    7设置本地网络名
    代码:
    echo "HOSTNAME=mylinux" > /etc/sysconfig/network

    8设置hosts文件
    代码:
    cat > /etc/hosts << "EOF"
    # Begin /etc/hosts (no network card version)
    127.0.0.1 mylinux localhost
    # End /etc/hosts (no network card version)
    EOF

    9设置网络的静态地址
    代码:
    cd /etc/sysconfig/network-devices &&
    mkdir -v ifconfig.eth0 &&
    cat > ifconfig.eth0/ipv4 << "EOF"
    ONBOOT=yes
    SERVICE=ipv4-static
    IP=192.168.1.123
    GATEWAY=192.168.1.1
    PREFIX=24
    BROADCAST=192.168.1.255
    EOF
    注意:IP、GATEWAY、BROADCAST的地址根据自己的实际情况设置。

    10设置DNS
    代码:
    cat > /etc/resolv.conf << "EOF"

    # Begin /etc/resolv.conf
    nameserver 202.96.128.166
    nameserver 202.96.128.86
    # End /etc/resolv.conf

    11建立fstab文件
    代码:
    cat
    > /etc/fstab << "EOF"
    # Begin /etc/fstab
    # file system mount-point type options dump fsck
    # order
    /dev/sda8 / ext3 defaults 1 1
    /dev/sda1 /boot ext3 defaults 0 2
    /dev/sda5 none swap sw 0 0
    /dev/sda7 /home ext3 defaults 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

    请注意自己硬盘设备号!/boot、/home、swap就用DEBIAN下用的就拉倒了。我这里是。

    12.编译内核
    这个对我来说有点过份了,难呀。 我在DEBIAN下面是有initrd的,拷那个.config过去,编译出来肯定进不了系统。
    但在LFS下面是没有命令来生成initrd的,反正我DEBIAN也还用的,就用DEBIAN的来搞定两个算了。就用DEBIAN下用着的
    2.6.28.5就算了。
    tar xvf linux-2.6.28.5.tar.bz2
    cd linux-2.6.28.5 make
    mrproper
    make menuconfig
    LOAD从DEBIAN搞过来的.config再保存。
    make make
    modules_install
    install -d /usr/share/doc/linux-2.6.22.5
    cp -r Documentation/* /usr/share/doc/linux-2.6.28.5
    后两步不用也可以的。

    13.GRUB就不装了,用DEBIAN的,现在改一下DEBIAN系统下面的。加多下面的东西。
    title LFS 6.3 (on
    /dev/sda8) root (hd0,0)
    kernel /vmlinuz-2.6.28.5 root=/dev/sda8
    initrd
    /initrd.img-2.6.28.5

    14.退出制作环境:
    代码: logout代码

    15.卸载虚拟文件系统:
    umount -v
    $LFS/dev/pts
    umount -v $LFS/dev/shm
    mount -v $LFS/dev
    umount -v
    $LFS/proc
    umount -v $LFS/sys
    卸载 LFS 自己的文件系统:
    umount -v $LFS

    16重启系统
    shutdown -r now
       
    二、安装Xorg


    按照CBLFS的方法来装。。。
    请高手指点,也给像我这样的新手点提示,不要像我一样犯太多错误。。
    谢谢。。
    先下载包包:
    注意最后一步下载的地方:
    #############
    wget -c http://pkgconfig.freedesktop.org/releases/pkg-config-0.23.tar.gz
    wget -c ftp://xmlsoft.org/libxml2/libxml2-2.7.2.tar.gz
    wget -c ftp://ftp.gnu.org/pub/gnu/gperf/gperf-3.0.3.tar.gz
    wget -c ftp://xmlsoft.org/libxml2/libxslt-1.1.24.tar.gz
    wget -c http://xcb.freedesktop.org/dist/xcb-proto-1.2.tar.bz2
    wget -c http://www.python.org/ftp/python/2.5.2/Python-2.5.2.tar.bz2
    wget -c http://svn.cross-lfs.org/svn/rep ... -2.5.2-gdbm-1.patch
    wget -c http://xcb.freedesktop.org/dist/libxcb-1.1.91.tar.bz2
    wget -c http://svn.cross-lfs.org/svn/rep ... sloppy_lock-1.patch
    wget -c http://xcb.freedesktop.org/dist/xcb-util-0.2.tar.bz2
    wget -c http://ftp.gnu.org/pub/gnu/ed/ed-1.2.tar.gz
    wget -c http://downloads.sourceforge.net/expat/expat-2.0.1.tar.gz
    wget -c http://downloads.sourceforge.net/freetype/freetype-2.3.5.tar.bz2
    wget -c http://downloads.sourceforge.net ... e-doc-2.3.5.tar.bz2
    wget -c http://fontconfig.org/release/fontconfig-2.6.0.tar.gz
    wget -c http://cross-lfs.org/~jciccone/drm-20080719.tar.bz2
    wget -c http://downloads.sourceforge.net/mesa3d/MesaLib-7.1.tar.gz
    wget -c http://downloads.sourceforge.net/mesa3d/MesaDemos-7.1.tar.bz2
    wget -c http://downloads.sourceforge.net/mesa3d/MesaGLUT-7.1.tar.bz2
    wget -c http://xorg.freedesktop.org/rele ... tmaps-1.0.1.tar.bz2
    wget -c http://downloads.sourceforge.net/libpng/libpng-1.2.34.tar.bz2
    wget -c http://svn.cross-lfs.org/svn/rep ... 1.2.34-apng-1.patch
    wget -c http://cpan.org/authors/id/M/MS/MSERGEANT/XML-Parser-2.36.tar.gz
    wget -c http://ftp.gnome.org/pub/gnome/s ... tool-0.40.5.tar.bz2
    wget -c http://xorg.freedesktop.org/rele ... hemes-1.0.1.tar.bz2
    wget -c http://xlibs.freedesktop.org/xkbdesc/xkeyboard-config-1.3.tar.bz2
    wget -c http://www.openssl.org/source/openssl-0.9.8j.tar.gz
    wget -c http://svn.cross-lfs.org/svn/rep ... ix_manpages-1.patch
    wget -c http://svn.cross-lfs.org/svn/rep ... j-build_fix-1.patch
    wget -c http://svn.cross-lfs.org/svn/rep ... ips_support-1.patch
    wget -c http://xorg.freedesktop.org/rele ... erver-1.5.0.tar.bz2
    wget -c http://svn.cross-lfs.org/svn/rep ... nt_it_black-1.patch
    wget -c  ftp://invisible-island.net/xterm/xterm-237.tgz
    wget -c  http://prdownloads.sourceforge.net/polyglotman/rman-3.2.tar.gz

    #if there is not a cmd named "makedepend"  down this and install it .
    wget -c  http://xorg.freedesktop.org/rele ... epend-1.0.1.tar.bz2

    #down proto
    wget http://cblfs.cross-lfs.org/index ... Proto-20081023.wget &&
    mkdir -p proto &&
    cd proto &&
    wget -B http://xorg.freedesktop.org/releases/individual/proto/ -i ../Proto-20081023.wget
    cd ..

    #down util
    wget http://cblfs.cross-lfs.org/index ... /Util-20081023.wget &&
    mkdir -p util &&
    cd util &&
    wget -B http://xorg.freedesktop.org/releases/individual/util/ -i ../Util-20081023.wget
    cd ..

    #down lib
    wget http://cblfs.cross-lfs.org/index ... h/Lib-20081023.wget &&
    mkdir -p lib &&
    cd lib &&
    wget -B http://xorg.freedesktop.org/releases/individual/lib/ -i ../Lib-20081023.wget
    cd ..

    #down app
    wget http://cblfs.cross-lfs.org/index ... h/App-20081023.wget &&
    mkdir -p app &&
    cd app &&
    wget -B http://xorg.freedesktop.org/releases/individual/app/ -i ../App-20081023.wget
    cd ..

    #down font
    wget http://cblfs.cross-lfs.org/index ... /Font-20081023.wget &&
    mkdir -p font &&
    cd font &&
    wget -B http://xorg.freedesktop.org/releases/individual/font/ -i ../Font-20081023.wget
    cd ..

    #down driver
    wget http://cblfs.cross-lfs.org/index ... river-20081023.wget
    #Edit Driver-20081023.wget and completely remove the drivers you don't need.
    #I just keep three: xf86-input-mouse  xf86-input-keyboard  xf86-video-nv
    mkdir -p driver &&
    cd driver &&
    wget -B http://xorg.freedesktop.org/archive/individual/driver/ -i ../Driver-20081023.wget
    cd ..
    ##################

    安装过程:



    #check #检查下LFS系统是否有makedepend有这个命令了,没有的话就先安装上,装MesaLib的时候会用得到。。。
    tar xvf makedepend-1.0.1.tar.bz2
    cd makedepend-1.0.1
    ./configure
    make
    cp ./makedepend /bin/makedepend

    ######0 python install. someone need it, if you had installed so skip.

    tar xvf Python-2.5.2.tar.bz2
    cd Python-2.5.2
    sed -i "s@/usr/X11R6@${XORG_PREFIX}@g" setup.py &&
    patch -Np1 -i ../Python-2.5.2-gdbm-1.patch &&
    ./configure --prefix=/usr --enable-shared &&
    make EXTRA_CFLAGS="-fwrapv"
    make install
    cd ..
    rm -rf Python-2.5.2

    #####1 Ready to go.....
    export XORG_PREFIX="/usr/X11R7"
    export XORG_CONFIG=" --prefix=$XORG_PREFIX --sysconfdir=/etc \
    --mandir=$XORG_PREFIX/share/man --localstatedir=/var "

    #add "/usr/X11R7/lib" to "ld.sc.conf"

    cat >> /etc/ld.so.conf << EOF
    # Begin Xorg addition to /etc/ld.so.conf
    ${XORG_PREFIX}/lib
    # End Xorg addition to /etc/ld.so.conf
    EOF

    ######2 pkg-config
    tar xvf pkg-config-0.23.tar.gz
    cd pkg-config-0.23
    ./configure --prefix=/usr
    make
    make install
    cd ..
    rm -rf pkg-config-0.23

    #pkg-config is a tool to help you insert the correct compiler options on the command line when compiling applications and libraries.

    export PKG_CONFIG_PATH=/usr/X11R7/lib:/lib/pkgconfig:/usr/lib/pkgconfig:/usr/X11R7/lib/pkgconfig

    #########3 Xorg7/Protocol Headers
    cd proto
    #do tar first of all.
    for i in *.tar.bz2; do
    tar xvf $i;
    done

    for dir in `find . -maxdepth 1 -mindepth 1 -type d`; do
    cd $dir &&
    PKG_CONFIG_PATH="${PKG_CONFIG_PATH}" ./configure $XORG_CONFIG &&
    make install
    cd ..
    rm -rf $dir
    echo $dir ===========================END
    done 2>&1 | tee -a ../xorg-proto-7.4-compile.log #log the entire loop
    cd ..

    ########4 Xorg7/Utilities
    cd util
    #do tar first of all.
    for i in *.tar.bz2; do
    tar xvf $i;
    done

    #install xorg-cf-files-1.0.2 first
    cd xorg-cf-files-1.0.2
    sed -i "s@/usr/X11R6@$XORG_PREFIX@" X11.tmpl
    PKG_CONFIG_PATH="${PKG_CONFIG_PATH}" \
    ./configure $XORG_CONFIG &&
    make install
    cd ..
    rm -rf xorg-cf-files-1.0.2
    #instll the rest
    for dir in `find . -maxdepth 1 -mindepth 1 -type d`; do
    cd $dir &&
    PKG_CONFIG_PATH="${PKG_CONFIG_PATH}" ./configure $XORG_CONFIG &&
    make
    make install
    cd ..
    rm -rf $dir
    echo $dir ===========================END
    done 2>&1 | tee -a ../xorg-util-7.4-compile.log #log the entire loop
    cd ..

    #从5到16是为了给 Xorg7/Libraries 做准备工作。。
    #######5 LibXML2
    tar xvf libxml2-2.7.2.tar.gz
    cd libxml2-2.7.2
    PKG_CONFIG_PATH="${PKG_CONFIG_PATH}" \
    ./configure --prefix=/usr &&
    make &&
    make install
    cd ..
    rm -rf libxml2-2.7.2

    #######6 Gperf
    tar xvf gperf-3.0.3.tar.gz
    cd gperf-3.0.3
    PKG_CONFIG_PATH="${PKG_CONFIG_PATH}" \
    ./configure --prefix=/usr &&
    make &&
    make install
    cd ..
    rm -rf gperf-3.0.3

    #######7 LibXSLT
    tar xvf libxslt-1.1.24.tar.gz
    cd libxslt-1.1.24
    PKG_CONFIG_PATH="${PKG_CONFIG_PATH}" \
    ./configure --prefix=/usr &&
    make &&
    make install
    cd ..
    rm -rf libxslt-1.1.24

    ########8 Xcb-proto
    tar xvf xcb-proto-1.2.tar.bz2
    cd xcb-proto-1.2
    PKG_CONFIG_PATH="${PKG_CONFIG_PATH}" \
    ./configure $XORG_CONFIG &&
    make &&
    make install
    cd ..
    rm -rf xcb-proto-1.2

    ########9 Libpthread-stubs
    cd lib
    tar xvf libpthread-stubs-0.1.tar.bz2
    cd libpthread-stubs-0.1
    PKG_CONFIG_PATH="${PKG_CONFIG_PATH}" \
    ./configure $XORG_CONFIG &&
    make &&
    make install
    cd ..
    rm -rf libpthread-stubs-0.1
    cd ..

    ########10 libXau
    cd lib
    tar xvf libXau-1.0.4.tar.bz2
    cd libXau-1.0.4
    PKG_CONFIG_PATH="${PKG_CONFIG_PATH}" \
    ./configure $XORG_CONFIG &&
    make &&
    make install
    cd ..
    rm -rf libXau-1.0.4
    cd ..

    # #####11 Libxcb
    tar xvf libxcb-1.1.91.tar.bz2
    cd libxcb-1.1.91
    patch -Np1 -i ../libxcb-1.1.91-sloppy_lock-1.patch &&
    PKG_CONFIG_PATH="${PKG_CONFIG_PATH}" \
    ./configure $XORG_CONFIG &&
    make
    make install
    cd ..
    rm -rf libxcb-1.1.91

    #######12 Xcb-utils
    tar xvf xcb-util-0.2.tar.bz2
    cd xcb-util-0.2
    PKG_CONFIG_PATH="${PKG_CONFIG_PATH}" \
    ./configure $XORG_CONFIG &&
    make &&
    make install
    cd ..
    rm -rf xcb-util-0.2

    #########13 ed
    tar xvf ed-1.2.tar.gz
    cd ed-1.2
    PKG_CONFIG_PATH="${PKG_CONFIG_PATH}" \
    ./configure --prefix=/usr --exec-prefix="" &&
    make
    make install
    cd ..
    rm -rf ed-1.2

    ##########14 Expat
    tar xvf expat-2.0.1.tar.gz
    cd expat-2.0.1
    PKG_CONFIG_PATH="${PKG_CONFIG_PATH}" \
    ./configure --prefix=/usr &&
    make
    make install &&
    install -v -m755 -d /usr/share/doc/expat-2.0.1 &&
    install -v -m644 doc/*.{html,png,css} /usr/share/doc/expat-2.0.1
    cd ..
    rm -rf expat-2.0.1

    #########15 FreeType
    tar xvf freetype-2.3.5.tar.bz2
    cd freetype-2.3.5
    tar xf ../freetype-doc-2.3.5.tar.bz2 --strip-components=2 -C docs
    sed -i -r 's:.*(#.*BYTE.*) .*:\1:' include/freetype/config/ftoption.h
    PKG_CONFIG_PATH="${PKG_CONFIG_PATH}" \
    ./configure --prefix=/usr &&
    make
    make install &&
    install -v -m755 -d /usr/share/doc/freetype-2.3.5 &&
    cp -v -R docs/* /usr/share/doc/freetype-2.3.5
    cd ..
    rm -rf freetype-2.3.5

    ##########16 FontConfig
    tar xvf fontconfig-2.6.0.tar.gz
    cd fontconfig-2.6.0
    PKG_CONFIG_PATH="${PKG_CONFIG_PATH}" \
    ./configure --prefix=/usr --sysconfdir=/etc \
    --disable-docs --localstatedir=/var --without-add-fonts \
    --with-docdir=/usr/share/doc/fontconfig-2.6.0 &&
    make
    make install &&
    install -v -m644 doc/*.3 /usr/share/man/man3 &&
    install -v -m644 doc/*.5 /usr/share/man/man5 &&
    install -v -m755 -d /usr/share/doc/fontconfig-2.6.0/fontconfig-devel &&
    install -v -m644 doc/*.{html,pdf,txt} /usr/share/doc/fontconfig-2.6.0 &&
    install -v -m644 doc/fontconfig-devel/* /usr/share/doc/fontconfig-2.6.0/fontconfig-devel
    cd ..
    rm -rf fontconfig-2.6.0

    # #######17 Xorg7/Libraries
    cd lib
    for package in $(grep -v '^#' ../Lib-20081023.wget)
    do
    packagedir=$(echo $package | sed 's/.tar.bz2//')
    tar -xf $package
    cd $packagedir
    PKG_CONFIG_PATH="${PKG_CONFIG_PATH}" ./configure $XORG_CONFIG &&
    make
    make install
    cd ..
    rm -rf $packagedir
    echo $packagedir ===========================END
    done 2>&1 | tee -a ../xorg-lib-7.4-compile.log #log the entire loop
    cd ..

    #libX11这个包可以使用--enable-loadable-i18n这个参数,它将打开i18n的国际化支持。所以建议打开,你可以单独编译一下这个包。其它的参数可以通过./configure --help来查看。

    cd lib
    tar xvf libX11-1.1.5.tar.bz2
    cd libX11-1.1.5
    PKG_CONFIG_PATH="${PKG_CONFIG_PATH}" ./configure --prefix=$XORG_PREFIX --sysconfdir=/etc --mandir=$XORG_PREFIX/share/man --localstatedir=/var --enable-loadable-i18n &&
    make
    make install
    cd ..
    rm -rf libX11-1.1.5
    cd ..

    #######18 Xorg7/libdrm
    tar xvf drm-20080719.tar.bz2
    cd drm-20080719
    PKG_CONFIG_PATH="${PKG_CONFIG_PATH}" ./configure $XORG_CONFIG &&
    make &&
    make install
    cd ..
    rm -rf drm-20080719

    #####19 Xorg7/MesaLib ##here need a cmd named "makedepend". if u dont have, install it plz .
    tar xvf MesaLib-7.1.tar.gz
    tar xvf MesaDemos-7.1.tar.bz2
    tar xvf MesaGLUT-7.1.tar.bz2
    cd Mesa-7.1
    ln -sf linux-dri configs/current
    echo 'X11_INCLUDES = $(shell pkg-config --cflags-only-I x11)' >> configs/current &&
    echo 'CFLAGS += $(X11_INCLUDES)' >> configs/current &&
    echo 'EXTRA_LIB_PATH = $(shell pkg-config --libs-only-L x11)' >> configs/current &&
    echo "DRI_DRIVER_INSTALL_DIR = ${XORG_PREFIX}/lib/xorg/modules/dri" >> configs/current &&
    echo "INSTALL_DIR = /usr" >> configs/current &&
    echo "LIB_DIR = lib" >> configs/current &&
    echo "DRI_DIRS += swrast" >> configs/current
    echo 'DEFINES += -DUSE_XCB' >> configs/current &&
    echo 'X11_INCLUDES += $(shell pkg-config --cflags-only-I xcb x11-xcb xcb-glx)' >> configs/current &&
    echo 'GL_LIB_DEPS += $(shell pkg-config --libs xcb x11-xcb xcb-glx)' >> configs/current
    make default
    make install
    make -C progs/xdemos glxinfo glxgears &&
    install -m755 -v progs/xdemos/{glxinfo,glxgears} /usr/bin
    cd ..
    #rm -rf Mesa-7.1
    #source is needed by xserver, if del, when configure the xserver should del this cmd: --with-mesa-source="${PWD}/../Mesa-7.1" \
    #here last so ****ing long.

    #######20 Xorg7/xbitmaps
    tar xvf xbitmaps-1.0.1.tar.bz2
    cd xbitmaps-1.0.1
    PKG_CONFIG_PATH="${PKG_CONFIG_PATH}" ./configure $XORG_CONFIG
    make install
    cd ..
    rm -rf xbitmaps-1.0.1

    ########21 Libpng
    ##because Xcursorgen needs it
    tar xvf libpng-1.2.34.tar.bz2
    cd libpng-1.2.34
    patch -Np1 -i ../libpng-1.2.34-apng-1.patch
    PKG_CONFIG_PATH="${PKG_CONFIG_PATH}" ./configure --prefix=/usr &&
    make
    make install &&
    install -v -m755 -d /usr/share/doc/libpng-1.2.34 &&
    install -v -m644 README libpng-1.2.34.txt /usr/share/doc/libpng-1.2.34
    cd ..
    rm -rf libpng-1.2.34


    ######22 Xorg7/Apps
    cd app
    for package in $(grep -v '^#' ../App-20081023.wget)
    do
    packagedir=$(echo $package | sed 's/.tar.bz2//')
    tar -xf $package
    cd $packagedir
    PKG_CONFIG_PATH="${PKG_CONFIG_PATH}" ./configure $XORG_CONFIG &&
    make
    make install
    cd ..
    rm -rf $packagedir
    echo $packagedir ===========================END
    done 2>&1 | tee -a ../xorg-app-7.4-compile.log #log the entire loop
    cd ..

    #####23 Perl Module XML:arser
    #needs Expat. we had installed yet.
    tar xvf XML-Parser-2.36.tar.gz
    cd XML-Parser-2.36
    sed -i 's@<ERL_DESTDIR>@@g' Makefile
    perl Makefile.PL &&
    make &&
    make test
    make install
    cd ..
    rm -rf XML-Parser-2.36

    #####24 Intltool
    tar xvf intltool-0.40.5.tar.bz2
    cd intltool-0.40.5
    PKG_CONFIG_PATH="${PKG_CONFIG_PATH}" ./configure --prefix=/usr &&
    make
    make install &&
    install -v -m644 -D doc/I18N-HOWTO \
    /usr/share/doc/intltool-0.40.5/I18N-HOWTO
    cd ..
    rm -rf intltool-0.40.5

    # ####25 Xorg7/Data : xcursor-themes and xkeyboard-config
    #25.1 xcursor-themes-1.0.1.tar.bz2
    tar xvf xcursor-themes-1.0.1.tar.bz2
    cd xcursor-themes-1.0.1
    PKG_CONFIG_PATH="${PKG_CONFIG_PATH}" ./configure $XORG_CONFIG &&
    make &&
    make install
    cd ..
    rm -rf xcursor-themes-1.0.1
    #25.2xkeyboard-config-1.3.tar.bz2
    tar xvf xkeyboard-config-1.3.tar.bz2
    cd xkeyboard-config-1.3
    PKG_CONFIG_PATH="${PKG_CONFIG_PATH}" ./configure $XORG_CONFIG \
    --with-xkb-base=${XORG_PREFIX}/share/X11/xkb \
    --with-xkb-rules-symlink=xorg --enable-compat-rules &&
    make &&
    make install
    cd ..
    rm -rf xkeyboard-config-1.3

    ##### 26 Xorg7/Fonts
    cd font
    for package in $(grep -v '^#' ../Font-20081023.wget)
    do
    packagedir=$(echo $package | sed 's/.tar.bz2//')
    tar -xf $package
    cd $packagedir
    sed -i 's{libdir}/X11/fonts:/usr/share/fonts:g' configure &&
    PKG_CONFIG_PATH="${PKG_CONFIG_PATH}" ./configure $XORG_CONFIG
    make
    make install
    cd ..
    rm -rf $packagedir
    echo $packagedir ===========================END
    done 2>&1 | tee -a ../xorg-font-7.4-compile.log #log the entire loop
    cd ..


    ######27 OpenSSL
    tar xvf openssl-0.9.8j.tar.gz
    cd openssl-0.9.8j
    patch -Np1 -i ../openssl-0.9.8j-fix_manpages-1.patch &&
    patch -Np1 -i ../openssl-0.9.8j-build_fix-1.patch &&
    patch -Np1 -i ../openssl-0.9.8j-mips_support-1.patch &&
    PKG_CONFIG_PATH="${PKG_CONFIG_PATH}" ./config --openssldir=/etc/ssl --prefix=/usr shared &&
    make MANDIR=/usr/share/man
    make MANDIR=/usr/share/man install &&
    cp -v -r certs /etc/ssl &&
    install -v -d -m755 /usr/share/doc/openssl-0.9.8j &&
    cp -v -r doc/{HOWTO,README,*.{txt,html,gif}} \
    /usr/share/doc/openssl-0.9.8j
    cd ..
    rm -rf openssl-0.9.8j
    #PKG_CONFIG_PATH="${PKG_CONFIG_PATH}" needed here ???

    #######28Xorg7/Xserver
    tar xvf xorg-server-1.5.0.tar.bz2
    cd xorg-server-1.5.0
    patch -Np1 -i ../xorg-server-1.5.0-paint_it_black-1.patch
    sed -i '/xpconfigdir=/s@=.*@=$datadir/X11/xserver@' configure &&
    sed -i '/-DXPRINTDIR/s/libdir/datadir/' hw/xprint/Makefile.in &&
    ./configure $XORG_CONFIG --enable-install-setuid \
    --with-dri-driver-path="${XORG_PREFIX}/lib/xorg/modules/dri" \
    --with-fontdir="/usr/share/fonts" \
    --with-mesa-source="${PWD}/../Mesa-7.1" \
    --disable-dri2
    make
    make install
    cd ..
    rm -rf xorg-server-1.5.0
    #because the mesa had installed , --with-mesa-source="${PWD}/../Mesa-7.1" can be deleted...
    #make sure where the derector your mesa-source is..
    #PKG_CONFIG_PATH="${PKG_CONFIG_PATH}" needed here ????


    ######29Xorg7/Drivers
    #Edit Driver-20081023.wget and completely remove the drivers you don't need.
    #I just keep three: xf86-input-mouse xf86-input-keyboard xf86-video-nv
    cd driver
    for package in $(grep -v '^#' ../Driver-20081023.wget)
    do
    packagedir=$(echo $package | sed 's/.tar.bz2//')
    tar -xf $package
    cd $packagedir
    PKG_CONFIG_PATH="${PKG_CONFIG_PATH}" ./configure ${XORG_CONFIG} &&
    make
    make install
    cd ..
    rm -rf $packagedir
    echo $packagedir ===========================EDN
    done 2>&1 | tee -a ../xorg-font-7.4-compile.log #log the entire loop
    cd ..
    #if you keep xf86-input-magictouch fix to it:
    #sed -i "/#include <xf86_ansic.h>/d" src/xf86MagicTouch.c
    #if you keep xf64-video-cyrix fix to it :
    #sed -i "/#define _CYRIX_H_/a\typedef struct pci_device *pciVideoPtr;" src/cyrix.h


    #########30 Xorg7/xterm You can find another one taht surport Chinrse well.
    tar xvf xterm-237.tgz
    cd xterm-237
    PKG_CONFIG_PATH="${PKG_CONFIG_PATH}" ./configure $XORG_CONFIG --enable-wide-chars \
    --with-app-defaults=${XORG_PREFIX}/share/X11/app-defaults &&
    make
    make install &&
    make install-ti
    cd ..
    rm -rf xterm-237

    #######31 Xorg7/rman
    #rman is a utility to convert manual pages into other formats.
    #But i didnt use it ever. And i dont know what is it .
    tar xvf rman-3.2.tar.gz
    cd rman-3.2
    sed -i -e "s@/opt/local@$XORG_PREFIX@" \
    -e "s@/usr/local@$XORG_PREFIX/share@" \
    -e "s@share/man@man@" Makefile
    make
    make install
    cd ..
    rm rman-3.2

    ########32 Xorg7/Config
    #Configuring the X Window System
    #FHS Symlinks
    ln -sv ${XORG_PREFIX}/bin /usr/bin/X11
    ln -sv ${XORG_PREFIX}/include/X11 /usr/include/X11
    ln -sv ${XORG_PREFIX}/lib/X11 /usr/lib/X11
    #Creating /etc/X11/xorg.conf
    cd ~ &&
    Xorg -configure
    #edit xorg.conf.new
    #test
    X -config ~/xorg.conf.new
    #work?? OK. install to /etc/X11/xorg.conf
    install -v -m755 -D ~/xorg.conf.new /etc/X11/xorg.conf

    ##About the configuring
    cd ~ &&
    Xorg -configure

    This will create a configuration file in root's home directory called xorg.conf.new. You may edit this file to provide specific settings for your system. Some things that are commonly edited.
        * In Section "Files". Change the order of the font paths searched or remove some font directories completely (of course why did you install them if you weren't going to use them?).
        * In Section "Module". If you are going to install nVidia drivers, remove the "Load dri" line.
        * In Section "Device". You may want to set some of the options available for your selected video driver. If you have an nVidia chip, whether using the "nv" or the "nvidia" driver, you may need to edit this section to resolve Xorg bug 3009 involving a missing mouse pointer. Add this line to Section "Device".
          Option      "HWCursor" "off"
        * Xorg-7.3: If you have an Intel chip, the driver auto-detects all device information necessary to initialize the card. The only lines you should need in the "Device" section of your xorg.conf file are:
          Section "Device"
              Identifier "intel"
              Driver     "intel"
          EndSection
    Please refer to the intel(4) manual page for information on configuration options.
        * In Section "Screen". Add a DefaultDepth statement and in the SubSection for your default depth, add a modes line.
    Test the system with
    X -config ~/xorg.conf.new
    You will only see a 'grey' background with black X cursor, but this indicates the X server is working. Exit with Control+Alt+Backspace. If the system does not work, take a look at /var/log/Xorg.0.log to see what went wrong.
    As the root user, create the configuration directory and move the configuration file to the new directory:
    install -v -m755 -D ~/xorg.conf.new /etc/X11/xorg.conf


    ############
    其实也没什么好总结的了
    就是出了几个问题自己好记住以后不再犯而已。。。

    1.关于PATH 。就这一步搞了我很多次呀,快哭死了。
    chroot "$LFS" /usr/bin/env -i \
    HOME=/root TERM="$TERM" PS1='\u:\w\$ ' \
    PATH=/bin:/usr/bin:/sbin:/usr/sbin \
    /bin/bash --login
    一开始我是这样chroot进来装的,结果到了第25步的xcursor-themes的./configure时就说没有找到xcursorgen ,但明明在app的一步时就装了这个东西的了,实在上的确是装了,只不过是装在了/usr/X11R7/bin下面,因为一开始我就写义安装到/usr /X11R7,但这里的PATH没有这个目录,人家./configure就当然找不到啦。。
    后来chroot时这样来搞就行了
    chroot "$LFS" /usr/bin/env -i \
    HOME=/root TERM="$TERM" PS1='\u:\w\$ ' \
    PATH=/bin:/usr/bin:/sbin:/usr/sbin:/usr/X11R7/bin \
    /bin/bash --login
    当然我也在纯LFS下面装过,也是这种问题,现在就改/etc/profile,加入:
    代码:
    if [ "`id -u`" -eq 0 ]; then
    PATH="/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/X11R7/b$
    else
    PATH="/usr/local/bin:/usr/bin:/bin:/usr/X11R7/bin"
    fi
    其实最后一步的
    ln -sv ${XORG_PREFIX}/bin /usr/bin/X11
    ln -sv ${XORG_PREFIX}/include/X11 /usr/include/X11
    ln -sv ${XORG_PREFIX}/lib/X11 /usr/lib/X11
    这三个命令也解决了这个问题。可是当然看到的时候我就不知道重搞了多少次。。我甚至怀疑过是我的LFS太低版本,又或者LFS哪里做得不对,又或者内核编译出问题。呵呵。新手就是这样。


    2.这个命令makedepend,装MesaLib时是要用得上,但我的LFS是没有的,不知道别人兄台的有没有,就只好一开始就装上。。。

    3.有一些包依赖到Python,记得BLFS上面好像,没有,不知道这里为什么会有,呵呵。一开始没装,有一些包就说我没有Python。。

    三、安装Xfce4
    现在我的系统是LFS+XORG7.4,在这个基础上安装XFCE4-4.4.3,这其间包含了GTK+2的安装了。。
    启动XFCE时要用到命令which的,这里先安上吧。。

    wget -c http://www.xs4all.nl/~carlo17/which/which-2.20.tar.gz
    tar xvf which-2.20.tar.gz
    cd which-2.20
    ./configure --prefix=/usr &&
    make
    make install
    cat > /usr/bin/which << "EOF"
    #!/bin/bash
    type -pa "$@" | head -n 1 ; exit ${PIPESTATUS[0]}
    EOF
    chmod -v 755 /usr/bin/which
    chown -v root:root /usr/bin/which
    cd ..
    rm -rf which-2.20

    去官网下载源码包回来,解开里面有23个包,放着。
    还有一些东西要下载的,在安装的过程中讲吧。。
    安装分成三块来讲,按CBLFS的方法,都不去翻译这几个英文了。
    ########XFCE Base System Packages ##############

    1.设定安装目录为/usr:
    cat > /etc/profile.d/30-xfce.sh << "EOF"
    # Begin /etc/profile.d/30-xfce.sh

    export XFCE_PREFIX=/usr

    export XDG_CONFIG_DIRS="${XDG_CONFIG_DIRS}${XDG_CONFIG_DIRS+:}/etc/xfce/xdg"

    # End /etc/profile.d/30-xfce.sh
    EOF
    要保证你的/etc/profile文件有这段代码:
    for script in /etc/profile.d/*.sh
    do
    source $script
    done
    unset script

    没有的话自已加。详细的内容可以见这里:Bash Startup Files。
    好,刷新一下,运行:
    source /etc/profile


    2.Xfce4-Dev-Tools
    tar xvf xfce4-dev-tools-4.4.0.1.tar.bz2
    cd xfce4-dev-tools-4.4.0.1
    ./configure --prefix=${XFCE_PREFIX} &&
    make
    make install
    cd ..
    rm -rf xfce4-dev-tools-4.4.0.1

    3.Glib2
    下一步,第4步的Libxfce4util需要它。。
    下载:wget -c http://ftp.gnome.org/pub/GNOME/s ... glib-2.18.4.tar.bz2
    tar xvf glib-2.18.4.tar.bz2
    cd glib-2.18.4
    ./configure --prefix=/usr &&
    make
    make install
    cd ..
    rm -rf glib-2.18.4

    4.Libxfce4util
    tar xvf libxfce4util-4.4.3.tar.bz2
    cd libxfce4util-4.4.3
    ./configure --prefix=${XFCE_PREFIX} &&
    make
    make install
    cd ..
    rm -rf libxfce4util-4.4.3

    下面几步其实就是在安装Gtk2
    5.Cairo
    wget http://cairographics.org/releases/cairo-1.8.6.tar.gz
    tar xvf cairo-1.8.6.tar.gz
    cd cairo-1.8.6
    ./configure --prefix=/usr &&
    make
    make install
    cd ..
    rm -rf cairo-1.8.6

    6.Pango
    wget http://ftp.gnome.org/pub/gnome/s ... ango-1.22.4.tar.bz2
    tar xvf pango-1.22.4.tar.bz2
    cd pango-1.22.4
    ./configure --prefix=/usr --sysconfdir=/etc &&
    make
    make install
    cd ..
    rm -rf pango-1.22.4

    7.ATK
    wget http://ftp.gnome.org/pub/gnome/s ... /atk-1.24.0.tar.bz2
    tar xvf atk-1.24.0.tar.bz2
    cd atk-1.24.0
    ./configure --prefix=/usr &&
    make
    make install
    cd ..
    rm -rf atk-1.24.0

    8.Gtk2
    官网上是用2.14.6的,我这里新了一点。
    wget http://ftp.gnome.org/pub/gnome/s ... gtk+-2.14.7.tar.bz2
    tar xvf gtk+-2.14.7.tar.bz2
    cd gtk+-2.14.7
    ./configure --prefix=/usr --sysconfdir=/etc &&
    make
    make install &&
    install -v -m755 -d /usr/share/doc/gtk+-2.14.6/{faq,tutorial} &&
    cp -v -R docs/faq/html/* /usr/share/doc/gtk+-2.14.6/faq &&
    cp -v -R docs/tutorial/html/* /usr/share/doc/gtk+-2.14.6/tutorial
    cd ..
    rm -rf gtk+-2.14.7

    9.Libxfcegui4
    tar xvf libxfcegui4-4.4.3.tar.bz2
    cd libxfcegui4-4.4.3
    ./configure --prefix=${XFCE_PREFIX} &&
    make
    make install
    cd ..
    rm -rf libxfcegui4-4.4.3

    10.Libxfce4mcs
    tar xvf libxfce4mcs-4.4.3.tar.bz2
    cd libxfce4mcs-4.4.3
    ./configure --prefix=${XFCE_PREFIX} &&
    make
    make install
    cd ..
    rm -rf libxfce4mcs-4.4.3

    11.Xfce-MCS-Manager
    tar xvf xfce-mcs-manager-4.4.3.tar.bz2
    cd xfce-mcs-manager-4.4.3
    ./configure --prefix=${XFCE_PREFIX} &&
    make
    make install
    cd ..
    rm -rf xfce-mcs-manager-4.4.3

    12.URI
    wget http://search.cpan.org/CPAN/authors/id/G/GA/GAAS/URI-1.37.tar.gz
    tar xvf URI-1.37.tar.gz
    cd URI-1.37
    perl Makefile.PL &&
    make &&
    make test
    make install
    cd ..
    rm -rf URI-1.37

    13.Exo
    tar xvf exo-0.3.4.tar.bz2
    cd exo-0.3.4
    ./configure --prefix=${XFCE_PREFIX} --sysconfdir=/etc/xfce \
    --libexecdir=${XFCE_PREFIX}/lib/xfce4 &&
    make
    make install
    cd ..
    rm -rf exo-0.3.4

    14.Xfce-MCS-Plugin
    tar xvf xfce-mcs-plugins-4.4.3.tar.bz2
    cd xfce-mcs-plugins-4.4.3
    ./configure --prefix=${XFCE_PREFIX} &&
    make
    make install
    cd ..
    rm -rf xfce-mcs-plugins-4.4.3

    15.Xfce-Panel
    tar xvf xfce4-panel-4.4.3.tar.bz2
    cd xfce4-panel-4.4.3
    ./configure --prefix=${XFCE_PREFIX} --sysconfdir=/etc/xfce &&
    make
    make install
    cd ..
    rm -rf xfce4-panel-4.4.3

    16.Shared-MIME-Info
    tar xvf shared-mime-info-0.51.tar.bz2
    cd shared-mime-info-0.51
    ./configure --prefix=/usr &&
    make
    make install
    cd ..
    rm -rf shared-mime-info-0.51

    17.desktop-file-utils
    tar xvf desktop-file-utils-0.15.tar.gz
    cd desktop-file-utils-0.15
    ./configure --prefix=/usr &&
    make
    make install
    cd ..
    rm -rf desktop-file-utils-0.15

    18.Thunar
    tar xvf Thunar-0.9.3.tar.bz2
    cd Thunar-0.9.3
    ./configure --prefix=${XFCE_PREFIX} --sysconfdir=/etc/xfce \
    --disable-gnome-thumbnailers \
    --enable-xml2po \
    --libexecdir=${XFCE_PREFIX}/lib/thunar &&
    make
    make install
    cd ..
    rm -rf Thunar-0.9.3

    19.Xfce4-Session
    tar xvf xfce4-session-4.4.3.tar.bz2
    cd xfce4-session-4.4.3
    ./configure --prefix=${XFCE_PREFIX} --sysconfdir=/etc/xfce \
    --libexecdir=${XFCE_PREFIX}/lib/xfce4 &&
    make
    make install
    cd ..
    rm -rf xfce4-session-4.4.3

    20.XFWM4
    tar xvf xfwm4-4.4.3.tar.bz2
    cd xfwm4-4.4.3
    ./configure --prefix=${XFCE_PREFIX} &&
    make
    make install
    cd ..
    rm -rf xfwm4-4.4.3

    21.XfDesktop
    tar xvf xfdesktop-4.4.3.tar.bz2
    cd xfdesktop-4.4.3
    ./configure --prefix=${XFCE_PREFIX} \
    --sysconfdir=/etc/xfce \
    --libexecdir=${XFCE_PREFIX}/lib/xfdesktop &&
    make
    make install &&
    install -v -m755 -d ${XFCE_PREFIX}/share/doc/xfdesktop &&
    install -v -m644 README doc/README.kiosk \
    ${XFCE_PREFIX}/share/doc/xfdesktop
    cd ..
    rm -rf xfdesktop-4.4.3

    22.Xfce4-Utils
    tar xvf xfce-utils-4.4.3.tar.bz2
    cd xfce-utils-4.4.3
    ./configure --prefix=${XFCE_PREFIX} --sysconfdir=/etc/xfce &&
    make
    make install
    cd ..
    rm -rf xfce-utils-4.4.3

    #############XFCE Desktop Packages #########
    1.Xfce4-Icon-Theme
    tar xvf xfce4-icon-theme-4.4.3.tar.bz2
    cd xfce4-icon-theme-4.4.3
    ./configure --prefix=${XFCE_PREFIX} &&
    make
    make install
    cd ..
    rm -rf xfce4-icon-theme-4.4.3

    2.GTK-Xfce-Engines
    tar xvf gtk-xfce-engine-2.4.3.tar.bz2
    cd gtk-xfce-engine-2.4.3
    ./configure --prefix=/usr --sysconfdir=/etc &&
    make
    make install
    cd ..
    rm -rf gtk-xfce-engine-2.4.3

    3.XFWM4 Themes
    tar xvf xfwm4-themes-4.4.3.tar.bz2
    cd xfwm4-themes-4.4.3
    ./configure --prefix=${XFCE_PREFIX} &&
    make
    make install
    cat >> $HOME/gtkrc-2.0test << "EOF"
    style "titlebar"
    {
    font_name = "Sans 10"
    }

    widget "xfwm" style "titlebar"
    EOF
    cat > $HOME/.xfwm4rc << "EOF"
    theme=${XFCE_PREFIX}/share/xfwm4/themes/xfce
    button_layout=OT|SHMC
    theme=kde
    EOF
    cd ..
    rm -rf xfwm4-themes-4.4.3

    4.Orage
    tar xvf orage-4.4.3.tar.bz2
    cd orage-4.4.3
    ./configure --prefix=${XFCE_PREFIX} --libexecdir=${XFCE_PREFIX}/lib/orage &&
    make
    make install
    cd ..
    rm -rf orage-4.4.3

    ############XFCE Additional Packages ##############3
    1Xfprint
    tar xvf xfprint-4.4.3.tar.bz2
    cd xfprint-4.4.3
    ./configure --prefix="${XFCE_PREFIX}" --enable-cups --enable-bsdlpr --enable-letter
    make
    make install
    cd ..
    rm -rf xfprint-4.4.3


    2.Mousepad
    tar xvf mousepad-0.2.14.tar.bz2
    cd mousepad-0.2.14
    ./configure --prefix=${XFCE_PREFIX} &&
    make
    make install-strip
    cd ..
    rm -rf mousepad-0.2.14

    3.VTE
    1. wget http://ftp.gnome.org/pub/GNOME/sources/vte/0.19/vte-0.19.4.tar.bz2
    2. tar xvf vte-0.19.4.tar.bz2
    3. cd vte-0.19.4
    4. sed -i 's%\\177:%&kh=\\EOH:@7=\\EOF:%' termcaps/xterm &&
    5. ./configure --prefix=/usr --libexecdir=/usr/lib/vte &&
    6. make
    7. make install
    8. cd ..
    9. rm -rf vte-0.19.4
    复制代码
    4.Terminal
    tar xvf Terminal-0.2.8.3.tar.bz2
    cd Terminal-0.2.8.3
    ./configure --prefix=${XFCE_PREFIX} \
    --libexecdir=${XFCE_PREFIX}/lib/terminal &&
    make
    make install
    cd ..
    rm -rf Terminal-0.2.8.3

    5.XArchiver
    wget http://surfnet.dl.sourceforge.ne ... hiver-0.5.2.tar.bz2
    tar xvf xarchiver-0.5.2.tar.bz2
    cd xarchiver-0.5.2
    ./configure --prefix=${XFCE_PREFIX} \
    --libexecdir=${XFCE_PREFIX}/lib/xfarchiver &&
    make
    make install
    cd ..
    rm -rf xarchiver-0.5.2


    6.Xfce4-AppFinder
    tar xvf xfce4-appfinder-4.4.3.tar.bz2
    cd xfce4-appfinder-4.4.3
    ./configure --prefix=${XFCE_PREFIX} &&
    make
    make install
    cd ..
    rm -rf xfce4-appfinder-4.4.3

    还有一些没有装的,不装其实也是可以的再说了。现在有命令可以进XFCE了。
    运行:startxfce4

    想直接用startx,就在~/.xinitrc 里加入
    startxfce4
    就可以了。

    看到可爱的小老鼠了吧。。

    四、Asla
    #ALSA Library
    wget -c http://alsa.cybermirror.org/lib/alsa-lib-1.0.18.tar.bz2
    tar xvf alsa-lib-1.0.18.tar.bz2
    cd alsa-lib-1.0.18
    ./configure
    make
    make install &&
    install -v -m644 -D doc/asoundrc.txt \
        /usr/share/doc/alsa-lib-1.0.18/asoundrc.txt
    cd ..
    rm -rf alsa-lib-1.0.18

    #ALSA Plugins
    wget   http://alsa.cybermirror.org/plugins/alsa-plugins-1.0.18.tar.bz2
    tar xvf alsa-plugins-1.0.18.tar.bz2
    cd alsa-plugins-1.0.18
    ./configure
    make
    make install &&
    install -v -m755 -d /usr/share/doc/alsa-plugins-1.0.18 &&
    install -v -m644 doc/{README*,*.txt} \
                        /usr/share/doc/alsa-plugins-1.0.18
    cd ..
    rm -rf   alsa-plugins-1.0.18


    #ALSA Utilities
    wget   http://alsa.cybermirror.org/utils/alsa-utils-1.0.18.tar.bz2
    tar xvf alsa-utils-1.0.18.tar.bz2
    cd alsa-utils-1.0.18
    sed -i -e 's/^\(man_MANS[ \t]*=[ \t]*\).*$/\1/' alsactl/Makefile.*
    ./configure &&
    make
    make install
    cd ..
    rm -rf alsa-utils-1.0.18

    #ALSA Tools   里面有很多个,一个一个的安装,可以选择性的吧,应是?ld10k1 must be built before qt10k1
    wget   http://alsa.cybermirror.org/tools/alsa-tools-1.0.18.tar.bz2
    tar xvf alsa-tools-1.0.18.tar.bz2
    每个包的安装用:
    ./configure --prefix=/usr &&
    make


    #ALSA Firmware
    wget -c http://alsa.cybermirror.org/firmware/alsa-firmware-1.0.19.tar.bz2
    tar xvf alsa-firmware-1.0.19.tar.bz2
    cd alsa-firmware-1.0.19
    ./configure --prefix=/usr &&
    make
    make install
    cd ..
    rm -rf alsa-firmware-1.0.19

    #ALSA OSS
    wget http://alsa.cybermirror.org/oss-lib/alsa-oss-1.0.17.tar.bz2
    tar xvf alsa-oss-1.0.17.tar.bz2
    cd alsa-oss-1.0.17
    ./configure &&
    make
    make install
    cd ..
    rm -rf alsa-oss-1.0.17

    #ALSA Driver
    wget http://gd.tuwien.ac.at/opsys/lin ... iver-1.0.19.tar.bz2
    tar xvf alsa-driver-1.0.19.tar.bz2
    cd alsa-driver-1.0.19
    ./configure --with-kernel=/lib/modules/$(uname -r)/source  \
        --with-cards=intel8x0    \
        --with-oss=yes \
        --with-isapnp=no
    make &&
    make install
    ./snddevices          #如果这是你第一次安装ALSA驱动,你必须到ALSA驱动的源代码目录,用下面的命令在/dev下创建音频设备.
    cd ..
    rm -rf alsa-driver-1.0.19
    上面红色的intel8x0,是我的机子这样,找出自己是什么的才好哟。。下同。
    配置文件:
    cat >> /etc/modules.conf << "EOF"
    alias char-major-14 soundcore
    alias char-major-116 snd

    alias snd-card-0 snd-intel8x0

    alias sound-slot-0 snd-card-0

    alias sound-service-0-0 snd-mixer-oss
    alias sound-service-0-1 snd-seq-oss
    alias sound-service-0-3 snd-pcm-oss
    alias sound-service-0-8 snd-seq-midi
    EOF

    这个配置文件好像可以由alsaconf自动配置的,但我运行了找不到任何的东西,算了,就手动配置/etc/modules.conf文件。
    其实我在DEBIAN里面的是这样的
    alias snd-card-0 snd-intel8x0
    options snd-intel8x0 index=0


    在编辑完 /etc/modules.conf 文件后,你需要运行 depmod. 如果你是为你目前在运行的内核编译的声卡驱动,那么你只需要运行一下
    depmod
    ,如果你编译的声卡不是为你现在运行的内核版本编译的, 你就要运行以下代码
    depmod -a 2.6.19 -F /boot/System.map-2.6.19

    加载模板:modprobe snd-intel8x0
    注意:有时第一次执行alsa模块加载操作后,会出现一些出错信息,此时可重启一次系统,再加载一次模块看是否能解决问题。

    使用下列命令检验声卡驱动:
    #cat /proc/asound/cards
    我的显示为:
    0 [ICH            ]: NFORCE - Intel ICH
                          Intel ICH with ALC655 at irq 10
    加载成功了。。

    用命令alsamixer来打开声音调节。用M来打开声音,因为默认是静音的。
    我装好了XMMS,再试一下,能听到声音了。
    保存音量配置,执行:alsactl store

    搞定了。

    在DRIVER这一段里,一开始我./configure时说我把声音编译进内核了,You have built-in ALSA in your kernel.不让我make,那个时候alsamixer能运行,应该就可以用,不用装DRIVER都行。
    我一开始也不懂嘛,其实现在也是不懂的。就重新编译过内核,尝试声音部分的都去掉,安了ALSA的DRIVER之后以为就大吉了,结果还是有问题出来,没法加载我的声卡的模块。。把原来SOUND CARD SURPORT是编译进内核的,改成了编成模片,就是Y改成了M了,在make menuconfig下改的,有两个怎么样都是×的,没法变成M。


    补充说一下/etc/modules.conf的东西。关于参数ac97_quirk=6,有时可能会用得上的。
    卸载内核模块
    rmmod snd_intel8x0
    如果提示
    ERROR: Module snd_intel8x0 is in use
    请找关闭所有你正在使用声卡的程序,一个小tip就是你在面板删除那个小喇叭,应该就好了。
    然后再运行上面的命令。
    加载内核模块,这里要加上ac97_quirk=*的参数
    modprobe snd_intel8x0 ac97_quirk=6
    测试有没有声音,如果不行,再把6换成7,重复上面动作。。。到可以为止
    找到ac97_quirk的值后,在/etc/modules.conf 中添加一个选项
    options snd-intel8x0 ac97_quirk=6

    其他几点补充说明
    1.ALSA的安装一般没有什么困难,但如果出现错误,请多执行lsmod,因为alsa是以模块形式加载的,可通过lsmod的输出信息得知alsa的加载情况,从而判断出错原因。
    其中:
    snd为alsa的核心模块,为声卡驱动模块及其它alsa的模块所调用,首先载入。如果没有它,alsa将不能工作。
    soundcore为linux内核声音支持模块。snd需要它。
    2.如果alsa成功编译,模块成功加载,音量调节也没错的话,所以步骤都正确执行却依然无声的话,请参考alsa的文档,看看是否该声卡需要附加特定参数。例如es1988芯片的声卡便可能需要加特定的参数才能发声。笔记本的用户特别需要注意这一点。

    这一篇是写得相当的乱,没办法,不好整理呀。
    可以去LinuxSir.org的硬件版块看置顶文章,里面可以学很多东西。
    我就是对着那里搞定的。
    五、nvidia驱动安装

    这里面也是跟内核有一点的关系。
    我就拷DEBIAN下面的.config过去,但在DEBIAN下面是有initrd的,编译出来肯定进不了系统。
    但按照网上所说编进内核什么的都搞不定,都启动不了
    在LFS下面是又命令来生成initrd的,反正我DEBIAN也还用的,就用DEBIAN的来搞定两个算了。

    改一下DEBIAN系统的GRUB的
    加入:
    title LFS 6.3 (on/dev/sda8) root (hd0,0)
    kernel /vmlinuz-2.6.28.5 root=/dev/sda8
    initrd
    /initrd.img-2.6.28.5

    其中/boot就两个系统都挂,共用。
    这样重启引启,好像也一点问题都没,也很顺利地进入了LFS。
    后来尝试一下,把.config的=m都改成=y,生成的lfskernel-2.6.22.5也只有1.5m,不用initrd,重启能进,算不算成功了呢?

    问题又来了。。
    一开始装那个N卡的驱动时说我的NVIDIA已编译进了内核,那也没错,呵呵,我是把DEBIAN里得来的.config的=m都改成=y
    那好,我把所.config里面带NVIDIA的改成M,结果还真搞定了
    但是在搞那个声卡时再次编过内核,结果就有这样的事了,在驱动N卡的时候。。。。
    Unable to load the kernel modules “nvidia.ko ”
    再用上面这一招改M的,行不通了
    好来狠一点的。
    编译内核时
    Graphics support —> 这个选项里面与Nvidia相关的选项全部去掉后,竟然能够正确安装显卡驱动!具体情况如系统提示,不能引导内核模块,或是模块冲突,导致这种故障。

    六、一些软件


    1.Firefox:
    我是下载这个来自己编译的。
    http://releases.mozilla.org/pub/ ... .0.6-source.tar.bz2

    先安装依赖关系:
    #########D-BUS Core
    wget http://dbus.freedesktop.org/releases/dbus/dbus-1.2.12.tar.gz
    tar xvf dbus-1.2.12.tar.gz
    cd dbus-1.2.12
    groupadd -g 27 messagebus &&
    useradd -c "D-BUS Message Daemon User" -d /dev/null \
    -u 27 -g messagebus -s /bin/false messagebus

    sed -i "1i\#include <syslog.h>" dbus/dbus-sysdeps-util-unix.c &&
    ./configure --prefix=/usr --sysconfdir=/etc \
    --libexecdir=/usr/lib/dbus-1.0 --localstatedir=/var &&
    make

    make install &&
    install -v -m755 -d /usr/share/doc/dbus-1.2.12 &&
    install -v -m644 doc/{TODO,*.{dtd,xml,xsl,txt,c}} \
    /usr/share/doc/dbus-1.2.12

    cd ..
    rm -rf dbus-1.2.12

    #######D-BUS Glib 不要贪新,我就用了dbus-glib-0.80,就怎么搞都过不去。
    wget http://dbus.freedesktop.org/rele ... us-glib-0.76.tar.gz
    tar xvf dbus-glib-0.76.tar.gz
    cd dbus-glib-0.76
    ./configure --prefix=/usr --sysconfdir=/etc --localstatedir=/var &&
    make
    make install
    cd ..
    rm -rf dbus-glib-0.76

    ########libIDL-0.8.12.tar.bz2
    wget http://ftp.gnome.org/pub/gnome/s ... bIDL-0.8.12.tar.bz2
    tar xvf libIDL-0.8.12.tar.bz2
    cd libIDL-0.8.12
    ./configure --prefix=/usr &&
    make
    makeinstall
    cd ..
    rm -rf libIDL-0.8.12

    ########Zip
    wget ftp://tug.ctan.org/tex-archive/t ... p/src/zip232.tar.gz
    tar xvf zip232.tar.gz
    cd zip-2.32
    sed -i -e 's@$(INSTALL) man/zip.1@$(INSTALL_PROGRAM) man/zip.1@' \
    unix/Makefile &&
    make prefix=/usr -f unix/Makefile generic_gcc
    make prefix=/usr -f unix/Makefile install
    cd ..
    rm -rf zip-2.32

    ########curl
    wget http://curl.haxx.se/download/curl-7.19.3.tar.bz2
    tar xvf curl-7.19.3.tar.bz2
    cd curl-7.19.3
    ./configure --prefix=/usr &&
    make
    make install &&
    find docs -name "Makefile*" -o -name "*.1" -o -name "*.3" | xargs rm &&
    install -v -d -m755 /usr/share/doc/curl-7.19.3 &&
    cp -v -R docs/* /usr/share/doc/curl-7.19.3
    cd ..
    rm -rf curl-7.19.3

    依赖条件解决掉,来编译安装。
    tar xvf firefox-3.0.6-source.tar.bz2
    cd mozilla

    设置编译参数,可以根据自己的情况加减。我这里是安装到:/opt/firefox-3.0.6

    cat > .mozconfig << "EOF"
    . $topsrcdir/browser/config/mozconfig
    mk_add_options MOZ_OBJDIR=@TOPSRCDIR@/obj-@CONFIG_GUESS@

    ac_cv_visibility_pragma=no

    ac_add_options --prefix=/opt/firefox-3.0.6

    ac_add_options --with-system-nss
    ac_add_options --with-system-nspr

    ac_add_options --with-system-zlib
    ac_add_options --with-system-png
    ac_add_options --with-system-jpeg
    ac_add_options --enable-system-cairo

    ac_add_options --enable-canvas
    ac_add_options --enable-svg

    ac_add_options --enable-strip
    ac_add_options --disable-tests
    ac_add_options --disable-accessibility
    ac_add_options --disable-installer
    ac_add_options --enable-official-branding
    ac_add_options --enable-ui-locale=zh-CN
    EOF

    编译安装:
    sed -i "/OS_TEST/s/Linuxpowerpc/Linuxppc/" xpcom/reflect/xptcall/src/md/unix/Makefile.in
    make -f client.mk build
    make -f client.mk install

    改一下PATH,这里跟安装XFCE时一开始讲的一样:
    cat > /etc/profile.d/50-firefox.sh << "EOF"
    # Begin /etc/profile.d/50-firefox.sh
    export PATH="${PATH}:/opt/firefox-3.0.5/bin"
    # End /etc/profile.d/50-firefox.sh
    EOF
    当然也可以加到/etc/profile这里面去。

    装好了,不知道为什么我搞出来的是E文版的,没加参数ac_add_options --enable-ui-locale=zh-CN ,我下载了中文包,像装插件一样,以为可以搞定,但还是英文的,听说要进入about:config
    查找general.useragent.locale,把值设置为zh-CN就可以了。

    2.字体,文泉驿的下回来,里面有说怎么装的,很简单。

    3.fcitx输入法。
    下回来./configur --prefix=/usr && make && make install 来安装。
    再在  ~/.xinitrc加入
    XMODIFIERS=@im=fcitx
    #export LC_ALL LANG XMODIFIERS
    fcitx &
    killall fcitx

    到目前为止,我的.xinitrc是这样的
    XMODIFIERS=@im=fcitx
    #export LC_ALL LANG XMODIFIERS
    fcitx &
    startxfce4
    killall fcitx
  • 回复 支持 反对

    使用道具 举报

    发表于 2009-2-22 13:07:59 | 显示全部楼层
    楼主动作真快呀,我昨天才把xorg安装完,不过还没有设置,xfce我还不知道怎么下手,正好参考你的帖子,非常感谢楼主
    firefox怎么是英文的?另外更正你一个错误“其实LFS7.4也出来了,只不过我电脑里只有7.3的ISO”,应该是6.4和6.3吧
    回复 支持 反对

    使用道具 举报

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

    本版积分规则

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