|
懒人的BLFS(X+XFce4)
引言
玩电脑,懒其实是一种美德!
你不要感到奇怪!因为,
如果你象一个泥水匠堆砌墙壁一样,辛苦地输入命令,
等你把命令输好了,LFS/BLFS收工时,春天都过去了!
那么就是电脑在玩你了!你应当让机器自动地为你干更多的累活。
LFS做完了,LINUX只是一个基本系统而已,还不能满足我们的需要。
下面是俺的BLFS工程简单装上X和XFce4的过程。仅当抛砖引玉!
方法:
把下面所有的软件包都下载好了以后,
按照编号写好脚本文件,
将脚本文件和软件包放在一个文件夹里面。
利用LiveCD将所有下载好的软件包和脚本文件加载进入LFS系统。
然后,重新启动电脑进入LFS,
到该文件目录里面,
将所有脚本的属性设置为可执行,例如:
chmod +x 01libpng-1.2.12
./01libpng-1.2.12
机器就自动给你安装软件包了!
俺的LFS是在真实机器里面折腾的。
俺从来不玩虚拟机……
要注意软件包的版本号!
包的安装顺序是排好的。
当然,俺还是喜欢这样做:
./01libpng-1.2.12 && ./02expat-2.0.0 && ./03freetype-2.1.10 && ……
其实这样也可以滴:
./01* && ./02* && ./03* && ……
哈哈,俺就是这样懒D……
俺一直这样做。
下面是需要下载的软件包和相关脚本文件。
01
libpng-1.2.12
http://downloads.sourceforge.net/libpng/libpng-1.2.12.tar.bz2
01libpng-1.2.12(脚本文件)
------------------------------------------------------------------------------------
#!/bin/sh
set -e
tar -xvf libpng-1.2.12.tar.tar
cd libpng-1.2.12
./configure --prefix=/usr &&
make
make install &&
install -v -m755 -d /usr/share/doc/libpng-1.2.12 &&
install -v -m644 README libpng.txt /usr/share/doc/libpng-1.2.12
cd ..
rm -rf libpng-1.2.12
exit
------------------------------------------------------------------------------------
02
expat-2.0.0
http://downloads.sourceforge.net/expat/expat-2.0.0.tar.gz
02expat-2.0.0
------------------------------------------------------------------------------------
#!/bin/sh
set -e
tar -zxvf expat-2.0.0.tar.gz
cd expat-2.0.0
./configure --prefix=/usr &&
make
make install &&
install -v -m755 -d /usr/share/doc/expat-2.0.0 &&
install -v -m644 doc/*.{html,png,css} /usr/share/doc/expat-2.0.0
cd ..
rm -rf expat-2.0.0
exit
------------------------------------------------------------------------------------
03
freetype-2.1.10
http://downloads.sourceforge.net/freetype/freetype-2.1.10.tar.bz2
http://downloads.sourceforge.net ... -doc-2.1.10.tar.bz2
03freetype-2.1.10
------------------------------------------------------------------------------------
#!/bin/sh
set -e
tar -jxvf freetype-2.1.10.tar.bz2
cd freetype-2.1.10
sed -i -r 's:.*(#.*BYTE.*) .*:\1:' \
include/freetype/config/ftoption.h &&
./configure --prefix=/usr &&
make
make install &&
install -v -m755 -d /usr/share/doc/freetype-2.1.10 &&
cp -v -R docs/* /usr/share/doc/freetype-2.1.10
cd ..
rm -rf freetype-2.1.10
exit
------------------------------------------------------------------------------------
04
fontconfig-2.3.2
ftp://ftp.fu-berlin.de/unix/linu ... config-2.3.2.tar.gz
04fontconfig-2.3.2
------------------------------------------------------------------------------------
#!/bin/sh
set -e
tar -zxvf fontconfig-2.3.2.tar.gz
cd fontconfig-2.3.2
./configure --prefix=/usr --sysconfdir=/etc \
--disable-docs --without-add-fonts \
--with-docdir=/usr/share/doc/fontconfig-2.3.2 &&
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.3.2/fontconfig-devel &&
install -v -m644 doc/*.{html,pdf,txt} \
/usr/share/doc/fontconfig-2.3.2 &&
install -v -m644 doc/fontconfig-devel/* \
/usr/share/doc/fontconfig-2.3.2/fontconfig-devel
cd ..
rm -rf fontconfig-2.3.2
exit
------------------------------------------------------------------------------------
05
linux-pam-0.99.4
http://www.kernel.org/pub/linux/ ... AM-0.99.4.0.tar.bz2
http://www.kernel.org/pub/linux/ ... 99.4.0-docs.tar.bz2
05linux-pam-0.99.4
------------------------------------------------------------------------------------
#!/bin/sh
set -e
tar -jxvf Linux-PAM-0.99.4.0.tar.bz2
cd Linux-PAM-0.99.4.0
tar -xf ../Linux-PAM-0.99.4.0-docs.tar.bz2 -C doc
./configure --libdir=/usr/lib \
--sbindir=/lib/security \
--enable-securedir=/lib/security \
--enable-docdir=/usr/share/doc/Linux-PAM-0.99.4.0 \
--enable-read-both-confs &&
make
make install &&
chmod -v 4755 /lib/security/unix_chkpwd &&
mv -v /lib/security/pam_tally /sbin &&
mv -v /usr/lib/libpam*.so.0* /lib &&
ln -v -sf ../../lib/libpam.so.0.81.3 /usr/lib/libpam.so &&
ln -v -sf ../../lib/libpamc.so.0.81.0 /usr/lib/libpamc.so &&
ln -v -sf ../../lib/libpam_misc.so.0.81.2 /usr/lib/libpam_misc.so
for DOCTYPE in html pdf ps txts
do
cp -v -R doc/$DOCTYPE /usr/share/doc/Linux-PAM-0.99.4.0
done
cd ..
rm -rf Linux-PAM-0.99.4.0
exit
------------------------------------------------------------------------------------
06
Xorg-6.9.0
http://xorg.freedesktop.org/rele ... 1R6.9.0-src.tar.bz2
http://www.linuxfromscratch.org/ ... 0-luit_race-1.patch
http://www.linuxfromscratch.org/ ... .0-security-4.patch
0601Xorg-6.9.0 [color="Red"](特别说明,host.def是俺修改过的,建议使用原来的官方文件!)------------------------------------------------------------------------------------
#!/bin/sh
set -e
tar -jxvf X11R6.9.0-src.tar.bz2
cd xc
patch -Np1 -i ../xorg-6.9.0-luit_race-1.patch &&
patch -Np1 -i ../xorg-6.9.0-security-4.patch
sed -i 's@/usr/X11R6@</usr>@' programs/luit/parser.h
sed -i '/^SUBDIRS =/s/ etc$//' programs/Xserver/Xprint/Imakefile
pushd config/util &&
make -f Makefile.ini lndir
popd
mkdir ../xcbuild &&
cd ../xcbuild &&
../xc/config/util/lndir ../xc
cat > config/cf/host.def << "EOF"
/* Begin Xorg host.def file */
/* System Related Information. If you read and configure only one
* section then it should be this one. The Intel architecture defaults
* are set for a i686 and higher. If that happens, try
* building without the DefaultGcc2PpcOpt line. ***********/
/* #define DefaultGcc2i386Opt -O2 -fno-strength-reduce \
-fno-strict-aliasing -march=i686 */
#define HasFreetype2 YES
#define HasFontconfig YES
#define HasExpat YES
#define HasLibpng YES
#define HasZlib YES
/* Uncomment the following define if you'd like
* xdm to use Linux-PAM
#define HasPam YES
*/
/*
* Which drivers to build. When building a static server, each of
* these will be included in it. When building the loadable server
* each of these modules will be built.
*
#define XF86CardDrivers mga glint nv tga vesa vga \
XF86OSCardDrivers XF86ExtraCardDrivers
*/
/*
* Select the XInput devices you want by uncommenting this.
*
#define XInputDrivers mouse keyboard acecad calcomp citron \
digitaledge dmc dynapro elographics \
microtouch mutouch penmount spaceorb \
summa wacom void magictouch aiptek
*/
/* Most installs will only need this */
#define XInputDrivers mouse keyboard
/* Xterm is no longer built by default */
#define BuildXterm YES
/* Disable building Xprint server and clients until we get them figured
* out but build Xprint libraries to allow precompiled binaries such as
* Acrobat Reader to run.
*/
#define XprtServer NO
#define BuildXprintClients NO
/* Uncomment the following define if you would prefer to install X into
* /usr or change it to any other location that you prefer.
* The GL related defines disable compatibility symlinks (the links
* are not needed when X is installed in /usr).
#define ProjectRoot /usr
#define LinkGLToUsrInclude NO
#define LinkGLToUsrLib NO
*/
/* End Xorg host.def file */
EOF
sed -i -e "s@^#include <linux/config.h>@/* & */@" \
`grep -lr linux/config.h *` &&
( make World 2>&1 | tee xorg-compile.log && exit $PIPESTATUS )
make install &&
make install.man
ln -v -s ../X11R6/bin /usr/bin/X11 &&
ln -v -s ../X11R6/lib/X11 /usr/lib/X11 &&
ln -v -s ../X11R6/include/X11 /usr/include/X11
install -v -d -m755 /usr/share/fonts &&
ln -svn /usr/X11R6/lib/X11/fonts/TTF /usr/share/fonts/X11-TTF
cat >> /etc/ld.so.conf << "EOF" &&
/usr/X11R6/lib
EOF
ldconfig &&
cat >> /etc/profile << "EOF" &&
export PATH=$PATH:/usr/X11R6/bin
export PKG_CONFIG_PATH=$PKG_CONFIG_PATH:/usr/X11R6/lib/pkgconfig
EOF
/sbin/ldconfig &&
cd ~ &&
Xorg -configure
exit
------------------------------------------------------------------------------------
测试:
X -config ~/xorg.conf.new
按Ctrl+Alt+backspace退出
0602Xorg-6.9.0
------------------------------------------------------------------------------------
#!/bin/sh
set -e
install -v -m755 -D ~/xorg.conf.new /etc/X11/xorg.conf
cat > ~/.xinitrc << "EOF" &&
# Begin .xinitrc file
xterm -g 80x40+0+0 &
xclock -g 100x100-0+0 &
twm
EOF
cat >> /etc/sysconfig/createfiles << "EOF"
/tmp/.ICE-unix dir 1777 root root
EOF
exit
------------------------------------------------------------------------------------
特别说明:
至此,只要输入命令startx,便可进入X桌面了!
如果你到后面装好XFce4后,这个.xinitrc文件是要重新设置的。
所以,建议你给.xinitrc这个文件做个备份。
补充:
至此,停下来测试你的Xorg是不是可以正常工作了。运行命令:
startx
看到TWM和一个时钟没有?你还可以在TWM里面输入命令:
xcalc &
这样,你还能看到一个计算器!如果你没看到TWM、时钟和计算器,那么青铜镜强烈建议:你一定要好好检查一下,看看哪里出了问题。先把问题解决了再继续进行下去。因为,如果X没装好,那么下面的工作是无意义的。
一般情况下,俺青铜镜的Xorg,conf文件都不是符合显示器的显示效果,又得经过修改过才行。修改以后将它复制到/etc/X11R6/这个文件夹里面。
07
pkg-config-0.19
http://pkgconfig.freedesktop.org/releases/pkg-config-0.19.tar.gz
07pkg-config-0.19
------------------------------------------------------------------------------------
#!/bin/sh
set +e
tar -jxvf pkg-config-0.19.tar.bz2
cd pkg-config-0.19
./configure --prefix=/usr &&
make
make install
cd ..
rm -rf pkg-config-0.19
exit
------------------------------------------------------------------------------------
08
GLib-2.6.4
http://gd.tuwien.ac.at/graphics/gimp/gtk/v2.6/glib-2.6.4.tar.bz2
08GLib-2.6.4
------------------------------------------------------------------------------------
#!/bin/sh
set +e
tar -jxvf glib-2.6.4.tar.bz2
cd glib-2.6.4
./configure --prefix=/usr &&
make
make install
cd ..
rm -rf glib-2.6.4
exit
------------------------------------------------------------------------------------
09
ATK-1.9.1
http://ftp.gnome.org/pub/GNOME/sources/atk/1.9/atk-1.9.1.tar.bz2
09ATK-1.9.1
------------------------------------------------------------------------------------
#!/bin/sh
set +e
tar -jxvf atk-1.9.1.tar.bz2
cd atk-1.9.1
./configure --prefix=/usr &&
make
make install
cd ..
rm -rf atk-1.9.1
exit
------------------------------------------------------------------------------------
10
Pango-1.8.1
http://ftp.gnome.org/pub/GNOME/s ... pango-1.8.1.tar.bz2
10Pango-1.8.1
------------------------------------------------------------------------------------
#!/bin/sh
set +e
tar -jxvf pango-1.8.1.tar.bz2
cd pango-1.8.1
./configure --prefix=/usr --sysconfdir=/etc &&
make
make install
cd ..
rm -rf pango-1.8.1
exit
------------------------------------------------------------------------------------
11
libtiff-3.7.3
ftp://ftp.remotesensing.org/libtiff/tiff-3.7.3.tar.gz
11libtiff-3.7.3
------------------------------------------------------------------------------------
#!/bin/sh
set +e
tar -jxvf tiff-3.7.3.tar.bz2
cd tiff-3.7.3
./configure --prefix=/usr &&
make
make install
cd ..
rm -rf tiff-3.7.3
exit
------------------------------------------------------------------------------------
12
GTK+-2.6.7 [color="Red"](特别说明:这是BLFS-6.1版里面的包,有好几个也都是!)
http://gd.tuwien.ac.at/graphics/gimp/gtk/v2.6/gtk+-2.6.7.tar.bz2
12GTK+-2.6.7
------------------------------------------------------------------------------------
#!/bin/sh
set +e
tar -jxvf gtk+-2.6.7.tar.bz2
cd gtk+-2.6.7
./configure --prefix=/usr --sysconfdir=/etc &&
make
make install &&
install -v -m755 -d /usr/share/doc/gtk+-2.8.20/{faq,tutorial} &&
cp -v -R docs/faq/html/* /usr/share/doc/gtk+-2.8.20/faq &&
cp -v -R docs/tutorial/html/* /usr/share/doc/gtk+-2.8.20/tutorial
cd ..
rm -rf gtk+-2.6.7
exit
------------------------------------------------------------------------------------
13
XFce-4.2.3.2
http://downloads.sourceforge.net/xfce/xfce-4.2.3.2-src.tar.bz2
解压缩后,里面有23个包
安装方法都一样,就是configure时带的参数有点不同,按先后顺序安装便可!
至于脚本文件,各位可以自己照着葫芦画个瓢……
01--09的安装方法:
------------------------------------------------------------------------------------
./configure --prefix=/usr --sysconfdir=/etc &&
make
make install
------------------------------------------------------------------------------------
01 libxfce4util-4.2.3.2.2
02 dbh-1.0.24
03 libxfcegui4-4.2.3.2
04 libxfce4mcs-4.2.3.2
05 xfce-mcs-manager-4.2.3.2
06 xfwm4-4.2.3.2.2
07 xfce4-panel-4.2.3.2
08 xfdesktop-4.2.3.2
09 xfce-utils-4.2.3.2
10--23的安装方法:
------------------------------------------------------------------------------------
./configure --prefix=/usr --sysconfdir=/etc \
--libexecdir=/usr/lib/xfce4 &&
make
make install
mv -vf /usr/share/xfce4/doc /usr/share/doc/xfce4 &&
sed -i 's@xfce4/doc@doc/xfce4@' /usr/bin/xfhelp4
------------------------------------------------------------------------------------
10 gtk-xfce-engine-2.2.8
11 xfcalendar-4.2.3.2
12 xfce-mcs-plugins-4.2.3.2
13 xfce4-appfinder-4.2.3.2
14 xfce4-icon-theme-4.2.3.2
15 xfce4-iconbox-4.2.3.2
16 xfce4-mixer-4.2.3.2
17 xfce4-session-4.2.3.2
18 xfce4-systray-4.2.3.2
19 xfce4-toys-4.2.3.2
20 xfce4-trigger-launcher-4.2.3.2
21 xffm-4.2.3.2
22 xfprint-4.2.3.2
23 xfwm4-themes-4.2.3.2
配置XFce4,使它能够启动:
------------------------------------------------------------------------------------
cat > ~/.xinitrc << "EOF"
xfce-mcs-manager
xfwm4 --daemon
xftaskbar4 &
xfdesktop &
exec xfce4-panel
EOF
------------------------------------------------------------------------------------
至此,
输入命令:
startx
或是:
startxfce4
你就可以看到
XFce4了!
XFce4帅呆了……
哈哈哈,用脚本自动给你干活,爽吧?
俺的XFce4基本上很轻松就装起来了。
进入了桌面,鼠标键盘都好用,
显示也正常。
当然,接下来的活,还是由你自己决定了…… |
|