FROM http://zdbr.net.cn/download/Loongson64-2.0.htm
2009年9月20日 :改进制作步骤两处
2009年9月20日 :修改笔误五处
2009年5月29日 :修改笔误七处
2009年5月9日 :修改工具链的制作
2009年5月3日 :v2.0 正式版发布
2008年10月19日 :v2.0-pre2 发布
2008年9月14日 农历八月十五(中秋夜):v2.0-pre1 发布
2008年2月18日:v1.1 正式版发布
2007年2月18日(春节):正式版发布
从第一次拿到带有龙芯2E的机器到现在已经快30个月了,现如今龙芯2也已经发展到了2F系列,之前写过针对龙芯2E的制作纯64位系统,《手把手教你源代码制作龙芯64位系统》 (第一篇针对龙芯制作纯64位系统的文章)和《手把手教你源代码制作龙芯64位系统 v1.1版》 , 当时由于龙芯出现在用户的手中的时间不长,各种重要的GNU软件都还没有正式支持龙芯,现如今包括内核、binutils、gcc都已经开始正式支持龙芯 的产品了,于是我想我也应该努力一下看看能不能用这些新的软件版本来建立一个给龙芯2E和2F优化过的纯64位系统!本文依旧使用sysroot方法建立 一个在龙芯上运行的纯64位系统。
本文力争完成一个完整的制作命令,可以根据本文提供的命令顺序输入就可以完成“龙芯”64位系统的制作了,通常命令表示为
命令
由于篇幅比较长所以难免出现一些错误或者笔误,也有可能加入新内容,因此难免会进行修正或增删一些内容,如果本文被转载可以在本人的Blog中查看最新版本。
我的Blog:http://youbest.cublog.cn
如须转载请注明作者为孙海勇,并提供转载出处。
下面我们就开始制作的旅程,那么在开始前先了解一下我们会接触到的一些知识,这些知识对于理解整个制作过程将非常有帮助。
sysroot、工具链及制作过程原理
请参考我的另一篇文章《CLFS2.0原理分析》,该文将整个交叉过程中的原理进行了描述,建议在开始动手前阅读该文章。
文章地址:
http://youbest.cublog.cn
或者http://www.linuxsir.org/bbs/showthread.php?t=267672
build、host和target
在交叉编译中比较常见的一些参数就是build、host和target了,正确的理解这三者的含义对于交叉编译是非常重要的,下面就此进行解释
--build=编译该软件所使用的平台
--host=该软件将运行的平台
--target=该软件所处理的目标平台
我们以 gcc 为例子来 讲解 这三者的作用
在gcc编译中我们使用
./configure --build=编译平台 --host=运行平台 --target=目标平台 [各种编译参数]
来配置gcc的源代码,以让其编译出我们需要的gcc编译器。
那么在这组配置参数中:
--build:
表示目前我们正在运行的平台名称是什么,如果当前我们是在intel的pentium机器中编译该系统,那么我们的--build就可能 是i686-pc-linux-gnu,当然如果我们在其它种类的机器上编译那么这个build就应该是那个机器所对应的平台名称。
该参数在不指定的情况下将自动常识猜测目前平台的名称。
--host:
表示我们把这个编译好的gcc在什么样的平台下运行,在交叉编译过程中这个需要我们来指定,因为机器自己是不能知道我们心里是怎么想的, 那么我们可以明确的告诉它,我们要做出来的程序是运行在“龙芯”上的,但是目前还不能直接指定“龙芯”,因此我们这里指定为mips64el- unknown-linux-gnu(如果你省点事情那么就用这个名字好了,如果你想用个有个性的名字,那么请你想明白它的含义再动手,并且做好后面的过 程需要多出一些手续的麻烦的心理准备)。
--host也可以不指定,那么host将自动使用build来定义自己,不过那将不再是交叉编译。
注:--build和--host在不同的时候就被配置文件认定为交叉编译方式。
--target:
该参数的目的是让配置程序知道这个软件被编译后使用来处理什么平台上的文件的。
target这个参数只有在为数不多的几个包中有用处,虽然在./configure --help中经常能看到该参数,但实际上绝大多数软件包都是不需要该参数的。
从这个参数的含义来看,说明其处理的目标只有在不同平台下表现为不同的时候才有作用,而这些文件通常都跟目标平台 的指令系统直接或间接有关:比如可执行文件,对于不同平台下使用的可执行文件的编码可以是完全不同的,因此必须使用 对应能处理该编码的程序才能正确处理,而如果错误的使用则可能导致程序错误或者破坏文件,对于这样要处理不同平台下会 出现不同编码的软件,我们就应当对它指定目标平台,以免另其错误处理;而对于文本文件,对于不同的平台同样的内容表达的 含义都是相同的,因此我们不需要专门针对平台来处理,这样的软件我们就可以不必对它指定需要处理的平台了。
我们来总结一下:
build:自动测试在用平台名称,若无法检测出来则需要指定。
host:若无指定,自动使用build的结果。
build和host相同时表示本地编译,若不相同则表示交叉编译。
target:表示需要处理的目标平台名称,若无指定使用host相同名称,gcc、binutils等于平台指令相关软件有此参数,多数软件此参数无用处。
pushd和popd
这是一组用来切换当前目录的实用命令
pushd [目录名]
用来将当前目录压入堆栈中,并设置当前目录为指定的目录
popd
用来从堆栈中取出最后压入的目录,并将当前目录设置为改目录
例如:
当前目录为/usr
pushd /var/log
此时当前目录为/var/log,/usr进入堆栈中
cd /opt
进入到/opt目录下
popd
从堆栈中取出最后加入的目录,此时的结果为/usr,当前目录重新回到/usr下。
灵活使用这组命令将方便的切换目录,后面的制作过程中将使用该组命令来实现目录的切换。
tar的使用
tar可以说是Linux下使用频率非常高的命令,该命令用来将一组文件打包成一个独立的文件,也可以把一个压缩/打包的文件。
还原成原来的一组文件。
新版本的tar可以自动识别文件的后缀名来确认使用何种程序来解压缩,因此可以用tar xvf来解开包括tar/tar.bz2/tar.gz/tar.Z等文件而不需要指定压缩类型,因此本文中将直接使用tar xvf来解开文件。
例如:
tar xvf gcc-4.4.tar.bz2 -C /source
表示将gcc-4.4.tar.bz2展开并存放到/source目录下,-C用来指定目标目录。
tar 的使用方式非常的多,可使用tar --help或者man tar来查看具体应用。
建立分区
cfdisk /dev/hda
创建出一个用于制作系统的分区,如分了一个/dev/hda4来制作系统。
建立用户
groupadd loongson
useradd -s /bin/bash -g loongson -m -k /dev/null loongson
passwd loongson
创建工作目录
export TARGET_DIR="/loongson"
mkdir -pv ${TARGET_DIR}
加载磁盘分区,如刚刚打算用/dev/hda4来制作系统
mount /dev/hda4 ${TARGET_DIR}
创建编译和下载用的目录
mkdir -pv ${TARGET_DIR}/{build,download}
chown -Rv loongson ${TARGET_DIR}
切换用户
su - loongson
设置必要的环境变量
cat > ~/.bash_profile << "EOF"
exec env -i HOME=${HOME} TERM=${TERM} PS1='/u:/w/$ ' /bin/bash
EOF
cat > ~/.bashrc << "EOF"
set +h
umask 022
export TARGET_DIR=/loongson
export LC_ALL=POSIX
export BUILDDIR="${TARGET_DIR}/build"
export DOWNLOADDIR="${TARGET_DIR}/download"
export CROSS_HOST="$(echo $MACHTYPE | sed "s/$(echo $MACHTYPE | cut -d- -f2)/cross/")"
export CROSS_TARGET="mips64el-unknown-linux-gnu"
如果你想制作n32位系统
export MABI="n32"
如果你想制作64位系统
export MABI="64"
如果你想为龙芯2E的机器进行编译,那么设置
export BUILD_ARCH="-march=loongson2e"
如果你想为龙芯2F的机器进行编译,那么设置
export BUILD_ARCH="-march=loongson2f"
export BUILD_MABI="-mabi=${MABI}"
export PATH=${TARGET_DIR}/cross-tools/bin:/bin:/usr/bin
unset CFLAGS
unset CXXFLAGS
EOF
source ~/.bash_profile
以下是执行完上述命令后使用export命令所显示内容的一个例子
declare -x BUILD_ARCH="-march=loongson2f"
declare -x BUILD_MABI="-mabi=64"
declare -x BUILDDIR="/loongson/build"
declare -x CROSS_HOST="i686-cross-linux-gnu"
declare -x CROSS_TARGET="mips64el-unknown-linux-gnu"
declare -x DOWNLOADDIR="/loongson/download"
declare -x HOME="/home/loongson"
declare -x LC_ALL="POSIX"
declare -x MABI="64"
declare -x OLDPWD
declare -x PATH="/loongson/cross-tools/bin:/bin:/usr/bin"
declare -x PS1="//u://w///$ "
declare -x PWD="/home/loongson"
declare -x SHLVL="1"
declare -x TARGET_DIR="/loongson"
declare -x TERM="linux"
Linux-kernel:
http://www.kernel.org/pub/linux/kernel/v2.6/linux-2.6.29.2.tar.bz2
Binutils:
ftp://gcc.gnu.org/pub/binutils/snapshots/binutils-2.19.1.tar.bz2
Glibc:
ftp://sources.redhat.com/pub/glibc/snapshots/glibc-2.9-latest.tar.bz2
Glibc-Ports:
ftp://sources.redhat.com/pub/glibc/snapshots/glibc-2.9-ports-latest.tar.bz2
GCC:
http://ftp.gnu.org/gnu/gcc/gcc-4.4.0/gcc-4.4.0.tar.bz2
File:
ftp://ftp.astron.com/pub/file/file-5.00.tar.gz
Shadow:
ftp://pkg-shadow.alioth.debian.org/pub/pkg-shadow/shadow-4.1.3.tar.bz2
Gmp:
http://ftp.gnu.org/gnu/gmp/gmp-4.3.0.tar.bz2
Mpfr:
http://www.mpfr.org/mpfr-current/mpfr-2.4.1.tar.bz2
Man-Pages:
http://www.kernel.org/pub/linux/docs/manpages/man-pages-3.21.tar.bz2
Sed:
http://ftp.gnu.org/gnu/sed/sed-4.1.5.tar.gz
E2fsprogs:
http://downloads.sourceforge.net/e2fsprogs/e2fsprogs-1.41.5.tar.gz
Coreutils:
http://ftp.gnu.org/gnu/coreutils/coreutils-7.2.tar.gz
Iana-Etc:
http://www.sethwklein.net/projects/iana-etc/downloads/iana-etc-2.30.tar.bz2
M4:
http://ftp.gnu.org/gnu/m4/m4-1.4.13.tar.bz2
Bison:
http://ftp.gnu.org/gnu/bison/bison-2.4.1.tar.bz2
Ncurses:
ftp://ftp.gnu.org/gnu/ncurses/ncurses-5.7.tar.gz
Procps:
http://procps.sourceforge.net/procps-3.2.7.tar.gz
Libtool:
http://ftp.gnu.org/gnu/libtool/libtool-2.2.6a.tar.gz
Readline:
http://ftp.gnu.org/gnu/readline/readline-6.0.tar.gz
Zlib:
http://www.zlib.net/zlib-1.2.3.tar.gz
Autoconf:
http://ftp.gnu.org/gnu/autoconf/autoconf-2.63.tar.bz2
Automake:
http://ftp.gnu.org/gnu/automake/automake-1.10.2.tar.bz2
Bash:
http://ftp.gnu.org/gnu/bash/bash-4.0.tar.gz
Bzip2:
http://www.bzip.org/1.0.5/bzip2-1.0.5.tar.gz
DHCPCD:
http://roy.marples.name/downloads/dhcpcd/dhcpcd-5.0.0.tar.bz2
Diffutils:
ftp://alpha.gnu.org/gnu/diffutils/diffutils-2.8.7.tar.gz
Findutils:
http://ftp.gnu.org/gnu/findutils/findutils-4.4.1.tar.gz
Flex:
http://downloads.sourceforge.net/flex/flex-2.5.35.tar.bz2
Gawk:
http://ftp.gnu.org/gnu/gawk/gawk-3.1.6.tar.bz2
Gettext:
http://ftp.gnu.org/gnu/gettext/gettext-0.17.tar.gz
Grep:
http://ftp.gnu.org/gnu/grep/grep-2.5.4.tar.bz2
Groff:
http://ftp.gnu.org/gnu/groff/groff-1.20.1.tar.gz
Gzip:
http://ftp.gnu.org/gnu/gzip/gzip-1.3.12.tar.gz
Iputils:
http://www.skbuff.net/iputils/iputils-s20071127.tar.bz2
Iproute2:
http://developer.osdl.org/dev/iproute2/download/iproute2-2.6.29-1.tar.bz2
Kbd:
http://www.kernel.org/pub/linux/utils/kbd/kbd-1.15.tar.bz2
Less:
http://www.greenwoodsoftware.com/less/less-429.tar.gz
Make:
http://ftp.gnu.org/gnu/make/make-3.81.tar.bz2
Man:
http://primates.ximian.com/~flucifredi/man/man-1.6f.tar.gz
Module-Init-Tools:
http://www.kernel.org/pub/linux/utils/kernel/module-init-tools/module-init-tools-3.7.tar.bz2
Patch:
ftp://alpha.gnu.org/gnu/diffutils/patch-2.5.9.tar.gz
Psmisc:
http://downloads.sourceforge.net/psmisc/psmisc-22.6.tar.gz
Rsyslog:
http://download.rsyslog.com/rsyslog/rsyslog-3.22.0.tar.gz
Sysvinit:
ftp://ftp.cistron.nl/pub/people/miquels/sysvinit/sysvinit-2.86.tar.gz
Tar:
http://ftp.gnu.org/gnu/tar/tar-1.22.tar.bz2
Texinfo:
http://ftp.gnu.org/gnu/texinfo/texinfo-4.13.tar.gz
Udev:
http://www.kernel.org/pub/linux/utils/kernel/hotplug/udev-141.tar.bz2
Util-Linux:
http://www.kernel.org/pub/linux/utils/util-linux-ng/v2.15/util-linux-ng-2.15.1.tar.bz2
Vim:
ftp://ftp.vim.org/pub/vim/unix/vim-7.2.tar.bz2
ftp://ftp.vim.org/pub/vim/extra/vim-7.2-extra.tar.gz
ftp://ftp.vim.org/pub/vim/extra/vim-7.2-lang.tar.gz
XZ-Utils:
http://zdbr.net.cn/download/xz-4.999.8beta.tar.gz
Bootscripts:
http://zdbr.net.cn/download/bootscripts-cross-lfs-1.2-pre7.tar.bz2
说明:所有文件请下载后保存在${DOWNLOADDIR}(本文中即/loongson/download)目录中。
http://www.zdbr.net.cn/download/patch_and_config-2.0.tar.bz2
说明:下载该文件后可执行以下命令展开到download目录中。
tar xvf patch_and_config-2.0.tar.bz2 -C ${DOWNLOADDIR}
pushd ${TARGET_DIR}
mkdir -pv {bin,boot,dev,{etc/,}opt,home,lib,mnt}
mkdir -pv {proc,media/{floppy,cdrom},sbin,srv,sys}
mkdir -pv var/{lock,log,mail,run,spool}
mkdir -pv var/{opt,cache,lib/{misc,locate},local}
install -dv -m 0750 root
install -dv -m 1777 {var/,}tmp
mkdir -pv usr/{,local/}{bin,include,lib,sbin,src}
mkdir -pv usr/{,local/}share/{doc,info,locale,man}
mkdir -pv usr/{,local/}share/{misc,terminfo,zoneinfo}
mkdir -pv usr/{,local/}share/man/man{1..8}
for dir in usr{,/local}; do
ln -sv share/{man,doc,info} $dir
done
ln -svf lib lib64
ln -svf lib lib32
ln -svf lib usr/lib64
ln -svf lib usr/lib32
cd boot
ln -svf . boot
popd
cat > ${TARGET_DIR}/etc/passwd << "EOF"
root::0:0:root:/root:/bin/bash
EOF
cat > ${TARGET_DIR}/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
touch ${TARGET_DIR}/var/run/utmp ${TARGET_DIR}/var/log/{btmp,lastlog,wtmp}
chmod -v 664 ${TARGET_DIR}/var/run/utmp ${TARGET_DIR}/var/log/lastlog
内核头文件(Linux-Header)
tar xvf ${DOWNLOADDIR}/linux-2.6.29.2.tar.bz2 -C ${BUILDDIR}
pushd ${BUILDDIR}/linux-2.6.29.2
make mrproper
make ARCH=mips headers_check
make ARCH=mips INSTALL_HDR_PATH=dest headers_install
cp -rv dest/include/* ${TARGET_DIR}/usr/include
cd ..
rm -rf linux-2.6.29.2
popd
Binutils交叉工具
tar xvf ${DOWNLOADDIR}/binutils-2.19.1.tar.bz2 -C ${BUILDDIR}
pushd ${BUILDDIR}/binutils-2.19.1
patch -Np1 -i ${DOWNLOADDIR}/binutils-2.19.1-loongson2f-1.patch
mkdir -pv ../binutils-build
cd ../binutils-build
CC="gcc" AR="ar" ../binutils-2.19.1/configure --prefix=${TARGET_DIR}/cross-tools /
--build=${CROSS_HOST} --target=${CROSS_TARGET} --host=${CROSS_HOST} /
--enable-64-bit-bfd --with-sysroot=${TARGET_DIR} /
--disable-nls --enable-shared
make configure-host
make
make install
cp -v ../binutils-2.19.1/include/libiberty.h ${TARGET_DIR}/usr/include
cd ..
rm -rf binutils-build
rm -rf binutils-2.19.1
popd
GCC交叉工具(仅支持C语言)
tar xvf ${DOWNLOADDIR}/gcc-4.4.0.tar.bz2 -C ${BUILDDIR}
pushd ${BUILDDIR}/gcc-4.4.0
tar xvf ${DOWNLOADDIR}/gmp-4.3.0.tar.bz2
mv gmp-4.3.0 gmp
tar xvf ${DOWNLOADDIR}/mpfr-2.4.1.tar.bz2
mv mpfr-2.4.1 mpfr
mkdir -pv ../gcc-build
cd ../gcc-build
../gcc-4.4.0/configure --prefix=${TARGET_DIR}/cross-tools /
--host=${CROSS_HOST} --build=${CROSS_HOST} --target=${CROSS_TARGET} /
--with-sysroot=${TARGET_DIR} /
--disable-multilib --with-newlib /
--disable-nls --disable-shared --disable-threads --enable-languages=c /
--with-abi=${MABI}
make all-gcc
make all-target-libgcc
make install-gcc
make install-target-libgcc
cd ..
rm -r gcc-build
rm -r gcc-4.4.0
popd
目标系统的glibc
tar xvf ${DOWNLOADDIR}/glibc-2.9-latest.tar.bz2 -C ${BUILDDIR}
pushd ${BUILDDIR}/glibc-2.9-*
tar xvf ${DOWNLOADDIR}/glibc-2.9-ports-latest.tar.bz2
mv -v glibc-2.9-ports-* ports
patch -Np1 -i ${DOWNLOADDIR}/glibc-2.9-libgcc_eh-1.patch
patch -Np1 -i ${DOWNLOADDIR}/glibc-2.9-localedef_segfault-1.patch
patch -Np1 -i ${DOWNLOADDIR}/glibc-2.9-cross_hacks-2.patch
touch libidn/configure
echo "" > ports/sysdeps/mips/mips64/n64/Makefile
echo "" > ports/sysdeps/mips/mips64/n32/Makefile
echo "" > ports/sysdeps/mips/mips32/Makefile
sed -i "/default) machine=/s/n32/${MABI}/g" ports/sysdeps/mips/preconfigure
mkdir -pv ../glibc-build
cd ../glibc-build
echo "libc_cv_forced_unwind=yes" > config.cache
echo "libc_cv_c_cleanup=yes" >> config.cache
echo "libc_cv_gnu89_inline=yes" >> config.cache
echo "libc_cv_mips_tls=yes" >> config.cache
echo "libc_cv_slibdir=/lib" >> config.cache
echo "install_root=${TARGET_DIR}" > configparms
echo "libdir=/usr/lib" >> configparms
BUILD_CC="gcc" CC="${CROSS_TARGET}-gcc ${BUILD_ARCH} ${BUILD_MABI}" /
AR="${CROSS_TARGET}-ar" RANLIB="${CROSS_TARGET}-ranlib" /
${BUILDDIR}/glibc-2.9-*/configure --prefix=/usr /
--libexecdir=/usr/lib/glibc --host=${CROSS_TARGET} --build=${CROSS_HOST} /
--disable-profile --enable-add-ons --with-tls --enable-kernel=2.6.26 /
--with-__thread --with-binutils=${TARGET_DIR}/cross-tools/bin /
--with-headers=${TARGET_DIR}/usr/include --cache-file=config.cache
make
make install
make localedata/install-locales
cd ..
rm -rf glibc-build
rm -rf glibc-2.9-*
cat > ${TARGET_DIR}/etc/nsswitch.conf << "EOF"
# Begin /etc/nsswitch.conf
passwd: files
group: files
shadow: files
hosts: files dns
networks: files
protocols: files
services: files
ethers: files
rpc: files
# End /etc/nsswitch.conf
EOF
cp -v --remove-destination ${TARGET_DIR}/usr/share/zoneinfo/Asia/Shanghai /
${TARGET_DIR}/etc/localtime
cat > ${TARGET_DIR}/etc/ld.so.conf << "EOF"
# Begin /etc/ld.so.conf
/usr/local/lib
/opt/lib
# End /etc/ld.so.conf
EOF
popd
GCC交叉工具(支持c和c++语言)
tar xvf ${DOWNLOADDIR}/gcc-4.4.0.tar.bz2 -C ${BUILDDIR}
pushd ${BUILDDIR}/gcc-4.4.0
tar xvf ${DOWNLOADDIR}/gmp-4.3.0.tar.bz2
mv gmp-4.3.0 gmp
tar xvf ${DOWNLOADDIR}/mpfr-2.4.1.tar.bz2
mv mpfr-2.4.1 mpfr
mkdir -v ../gcc-build
cd ../gcc-build
../gcc-4.4.0/configure --prefix=${TARGET_DIR}/cross-tools --host=${CROSS_HOST} /
--build=${CROSS_HOST} --target=${CROSS_TARGET} /
--with-sysroot=${TARGET_DIR} /
--disable-nls --enable-shared --enable-__cxa_atexit /
--disable-multilib --with-abi=${MABI} /
--enable-c99 --enable-long-long --enable-threads=posix /
--enable-languages=c,c++
make
make install
cd ..
rm -rf gcc-build
rm -rf gcc-4.4.0
popd
File软件包
tar xvf ${DOWNLOADDIR}/file-5.00.tar.gz -C ${BUILDDIR}
pushd ${BUILDDIR}/file-5.00
./configure --prefix=${TARGET_DIR}/cross-tools
make
make install
cd ..
rm -rf file-5.00
popd
Groff软件包
tar xvf ${DOWNLOADDIR}/groff-1.20.1.tar.gz -C ${BUILDDIR}
pushd ${BUILDDIR}/groff-1.20.1
PAGE=A4 ./configure --prefix=${TARGET_DIR}/cross-tools --without-x
make
make install
cd ..
rm -rf groff-1.20.1
popd
Shadow软件包
tar xvf ${DOWNLOADDIR}/shadow-4.1.3.tar.bz2 -C ${BUILDDIR}
pushd ${BUILDDIR}/shadow-4.1.3
patch -Np1 -i ${DOWNLOADDIR}/shadow-4.1.3-sysroot_hacks-1.patch
echo "shadow_cv_passwd_dir=${TARGET_DIR}/bin" > config.cache
echo "ac_cv_func_lckpwdf=no" >> config.cache
./configure --prefix=${TARGET_DIR}/cross-tools /
--sbindir=${TARGET_DIR}/cross-tools/bin /
--sysconfdir=${TARGET_DIR}/etc --disable-shared --without-libpam /
--without-audit --without-selinux /
--program-prefix=${CROSS_TARGET}- --cache-file=config.cache
cp config.h{,.orig} &&
sed "/PASSWD_PROGRAM/s/passwd/${CROSS_TARGET}-&/" config.h.orig > config.h
make
make install
cd ..
rm -rf shadow-4.1.3
popd
Ncurses软件包
tar xvf ${DOWNLOADDIR}/ncurses-5.7.tar.gz -C ${BUILDDIR}
pushd ${BUILDDIR}/ncurses-5.7
patch -Np1 -i ${DOWNLOADDIR}/ncurses-5.7-bash_fix-1.patch
./configure --prefix=${TARGET_DIR}/cross-tools /
--without-shared
make -C include
make -C progs tic
install -m755 progs/tic ${TARGET_DIR}/cross-tools/bin
cd ..
rm -rf ncurses-5.7
popd
清理交叉工具链
pushd ${TARGET_DIR}/cross-tools
strip --strip-all bin/*
strip --strip-debug lib/*
popd
注意:不正确的清理参数用于库文件的时候有导致库文件 损坏的可能,因此请注意命令的 参数,如果你不放心也可跳过这部分,并不会影响后面的过程。
环境设置
export CC="${CROSS_TARGET}-gcc ${BUILD_ARCH} ${BUILD_MABI}"
export CXX="${CROSS_TARGET}-g++ ${BUILD_ARCH} ${BUILD_MABI}"
export AR="${CROSS_TARGET}-ar"
export AS="${CROSS_TARGET}-as"
export RANLIB="${CROSS_TARGET}-ranlib"
export LD="${CROSS_TARGET}-ld"
export STRIP="${CROSS_TARGET}-strip"
将环境变量设置到~/.bashrc中,以方便重新进入时自动设置
echo "export CC=/"${CROSS_TARGET}-gcc ${BUILD_ARCH} ${BUILD_MABI}/"" >> ~/.bashrc
echo "export CXX=/"${CROSS_TARGET}-g++ ${BUILD_ARCH} ${BUILD_MABI}/"" >> ~/.bashrc
echo "export AR=/"${CROSS_TARGET}-ar/"" >> ~/.bashrc
echo "export AS=/"${CROSS_TARGET}-as/"" >> ~/.bashrc
echo "export RANLIB=/"${CROSS_TARGET}-ranlib/"" >> ~/.bashrc
echo "export LD=/"${CROSS_TARGET}-ld/"" >> ~/.bashrc
echo "export STRIP=/"${CROSS_TARGET}-strip/"" >> ~/.bashrc
---------man-pages--------------
tar xvf ${DOWNLOADDIR}/man-pages-3.21.tar.bz2 -C ${BUILDDIR}
pushd ${BUILDDIR}/man-pages-3.21
make prefix=${TARGET_DIR}/usr install
cd ..
rm -rf man-pages-3.21
popd
------------Zlib-----------
tar xvf ${DOWNLOADDIR}/zlib-1.2.3.tar.gz -C ${BUILDDIR}
pushd ${BUILDDIR}/zlib-1.2.3
patch -Np1 -i ${DOWNLOADDIR}/zlib-1.2.3-fPIC-1.patch
./configure --prefix=/usr --shared
make AR="${AR} rc"
make prefix=${TARGET_DIR}/usr install
mv -v ${TARGET_DIR}/usr/lib/libz.so.* ${TARGET_DIR}/lib
ln -svf ../../lib/libz.so.1 ${TARGET_DIR}/usr/lib/libz.so
chmod -v 644 ${TARGET_DIR}/usr/lib/libz.a
cd ..
rm -rf zlib-1.2.3
popd
---------Binutils--------
tar xvf ${DOWNLOADDIR}/binutils-2.19.1.tar.bz2 -C ${BUILDDIR}
pushd ${BUILDDIR}/binutils-2.19.1
patch -Np1 -i ${DOWNLOADDIR}/binutils-2.19.1-loongson2f-1.patch
mkdir -pv ../binutils-build
cd ../binutils-build
../binutils-2.19.1/configure --prefix=/usr /
--build=${CROSS_HOST} --host=${CROSS_TARGET} --target=${CROSS_TARGET} /
--enable-64-bit-bfd --enable-shared
make configure-host
make tooldir=/usr
make DESTDIR=${TARGET_DIR} tooldir=/usr install
cp -v ../binutils-2.19.1/include/libiberty.h ${TARGET_DIR}/usr/include
cd ..
rm -rf binutils-build
rm -rf binutils-2.19.1
popd
---------GMP--------
tar xvf ${DOWNLOADDIR}/gmp-4.3.0.tar.bz2 -C ${BUILDDIR}
pushd ${BUILDDIR}/gmp-4.3.0
./configure --host=${CROSS_TARGET} --prefix=/usr /
--enable-cxx --enable-mpbsd
make
make DESTDIR=${TARGET_DIR} install
rm -v ${TARGET_DIR}/usr/lib/lib{gmp,gmpxx,mp}.la
cd ..
rm -rf gmp-4.3.0
popd
---------MPFR--------
tar xvf ${DOWNLOADDIR}/mpfr-2.4.1.tar.bz2 -C ${BUILDDIR}
pushd ${BUILDDIR}/mpfr-2.4.1
patch -Np1 -i ${DOWNLOADDIR}/mpfr-2.4.1-branch_update-1.patch
patch -Np1 -i ${DOWNLOADDIR}/mpfr-2.4.1-mips_gcc4.4-1.patch
./configure --host=${CROSS_TARGET} --prefix=/usr
make
make DESTDIR=${TARGET_DIR} install
rm -v ${TARGET_DIR}/usr/lib/libmpfr.la
cd ..
rm -rf mpfr-2.4.1
popd
-----------GCC------------
tar xvf ${DOWNLOADDIR}/gcc-4.4.0.tar.bz2 -C ${BUILDDIR}
pushd ${BUILDDIR}/gcc-4.4.0
patch -Np1 -i ${DOWNLOADDIR}/gcc-4.4.0-pure64-1.patch
cp libiberty/Makefile.in{,.orig} &&
sed 's/install_to_$(INSTALL_DEST) //' libiberty/Makefile.in.orig /
> libiberty/Makefile.in
cp gcc/gccbug.in{,.orig} &&
sed 's/@have_mktemp_command@/yes/' gcc/gccbug.in.orig > gcc/gccbug.in
cp gcc/Makefile.in{,.orig} &&
sed 's@/./fixinc/.sh@-c true@' gcc/Makefile.in.orig > gcc/Makefile.in
mkdir -v ../gcc-build
cd ../gcc-build
../gcc-4.4.0/configure --prefix=/usr /
--libexecdir=/usr/lib --build=${CROSS_HOST} --host=${CROSS_TARGET} /
--target=${CROSS_TARGET} --enable-shared --enable-threads=posix /
--enable-__cxa_atexit --enable-c99 --enable-long-long /
--disable-multilib --with-abi=${MABI} /
--enable-clocale=gnu --enable-languages=c,c++ --disable-libstdcxx-pch
make
make DESTDIR=${TARGET_DIR} install
ln -sv ../usr/bin/cpp ${TARGET_DIR}/lib
ln -sv gcc ${TARGET_DIR}/usr/bin/cc
cd ..
rm -rf gcc-build
rm -rf gcc-4.4.0
popd
--------Sed-----------
tar xvf ${DOWNLOADDIR}/sed-4.1.5.tar.gz -C ${BUILDDIR}
pushd ${BUILDDIR}/sed-4.1.5
./configure --build=${CROSS_HOST} --host=${CROSS_TARGET} --prefix=/usr /
--bindir=/bin --enable-html
make
make DESTDIR=${TARGET_DIR} install
cd ..
rm -rf sed-4.1.5
popd
--------E2fsprogs--------
tar xvf ${DOWNLOADDIR}/e2fsprogs-1.41.5.tar.gz -C ${BUILDDIR}
pushd ${BUILDDIR}/e2fsprogs-1.41.5
mkdir -v build
cd build
../configure /
--build=${CROSS_HOST} --host=${CROSS_TARGET} /
--prefix=/usr --with-root-prefix="" /
--enable-elf-shlibs --disable-evms
make
make DESTDIR=${TARGET_DIR} install
make DESTDIR=${TARGET_DIR} install-libs
rm -v ${TARGET_DIR}/usr/lib/lib{blkid,com_err,e2p,ext2fs,ss,uuid}.so
ln -sv ../../lib/libblkid.so.1 ${TARGET_DIR}/usr/lib/libblkid.so
ln -sv ../../lib/libcom_err.so.2 ${TARGET_DIR}/usr/lib/libcom_err.so
ln -sv ../../lib/libe2p.so.2 ${TARGET_DIR}/usr/lib/libe2p.so
ln -sv ../../lib/libext2fs.so.2 ${TARGET_DIR}/usr/lib/libext2fs.so
ln -sv ../../lib/libss.so.2 ${TARGET_DIR}/usr/lib/libss.so
ln -sv ../../lib/libuuid.so.1 ${TARGET_DIR}/usr/lib/libuuid.so
cd ../..
rm -rf e2fsprogs-1.41.5
popd
---------Coreutils-----------
tar xvf ${DOWNLOADDIR}/coreutils-7.2.tar.gz -C ${BUILDDIR}
pushd ${BUILDDIR}/coreutils-7.2
patch -Np1 -i ${DOWNLOADDIR}/coreutils-7.2-uname-1.patch
touch man/hostname.1 man/*.1
cp -v src/Makefile.in{,.orig}
sed -e "/binPROGRAMS_INSTALL=/s:./ginstall:install:" src/Makefile.in.orig /
> src/Makefile.in
cat > config.cache << EOF
fu_cv_sys_stat_statfs2_bsize=yes
gl_cv_func_mbrtowc_incomplete_state=yes
gl_cv_func_mbrtowc_nul_retval=yes
gl_cv_func_mbrtowc_null_arg=yes
gl_cv_func_mbrtowc_retval=yes
gl_cv_func_btowc_eof=yes
gl_cv_func_wcrtomb_retval=yes
gl_cv_func_wctob_works=yes
EOF
./configure --build=${CROSS_HOST} --host=${CROSS_TARGET} --prefix=/usr /
--enable-install-program=hostname /
--enable-no-install-program=kill,uptime --cache-file=config.cache
make
make DESTDIR=${TARGET_DIR} install
mv -v ${TARGET_DIR}/usr/bin/{cat,chgrp,chmod,chown,cp,date} ${TARGET_DIR}/bin
mv -v ${TARGET_DIR}/usr/bin/{dd,df,echo,false,hostname,ls,mkdir} ${TARGET_DIR}/bin
mv -v ${TARGET_DIR}/usr/bin/{mv,pwd,rm,rmdir,stty,true,ln,uname} ${TARGET_DIR}/bin
mv -v ${TARGET_DIR}/usr/bin/chroot ${TARGET_DIR}/usr/sbin
mv -v ${TARGET_DIR}/usr/bin/{[,basename,head,install,nice} ${TARGET_DIR}/bin
mv -v ${TARGET_DIR}/usr/bin/{readlink,sleep,sync,test,touch} ${TARGET_DIR}/bin
ln -svf ../../bin/install ${TARGET_DIR}/usr/bin
cd ..
rm -rf coreutils-7.2
popd
---------Iana_Etc--------
tar xvf ${DOWNLOADDIR}/iana-etc-2.30.tar.bz2 -C ${BUILDDIR}
pushd ${BUILDDIR}/iana-etc-2.30
make
make DESTDIR=${TARGET_DIR} install
cd ..
rm -rf iana-etc-2.30
popd
----------M4------------
tar xvf ${DOWNLOADDIR}/m4-1.4.13.tar.bz2 -C ${BUILDDIR}
pushd ${BUILDDIR}/m4-1.4.13
./configure --build=${CROSS_HOST} --host=${CROSS_TARGET} --prefix=/usr
make
make DESTDIR=${TARGET_DIR} install
cd ..
rm -rf m4-1.4.13
popd
---------Bison---------
tar xvf ${DOWNLOADDIR}/bison-2.4.1.tar.bz2 -C ${BUILDDIR}
pushd ${BUILDDIR}/bison-2.4.1
./configure --build=${CROSS_HOST} --host=${CROSS_TARGET} --prefix=/usr
echo '#define YYENABLE_NLS 1' >> config.h
make
make DESTDIR=${TARGET_DIR} install
cd ..
rm -rf bison-2.4.1
popd
--------Ncurses----------
tar xvf ${DOWNLOADDIR}/ncurses-5.7.tar.gz -C ${BUILDDIR}
pushd ${BUILDDIR}/ncurses-5.7
patch -Np1 -i ${DOWNLOADDIR}/ncurses-5.7-branch_update-10.patch
patch -Np1 -i ${DOWNLOADDIR}/ncurses-5.7-bash_fix-1.patch
./configure --build=${CROSS_HOST} --host=${CROSS_TARGET} --prefix=/usr /
--with-shared --enable-widec --without-debug --without-ada /
--with-build-cc="gcc -D_GNU_SOURCE" --libdir=/lib
make
make DESTDIR=${TARGET_DIR} install
mv -v ${TARGET_DIR}/lib/lib{panel,menu,form,ncurses,ncurses++}w.a /
${TARGET_DIR}/usr/lib
rm -v ${TARGET_DIR}/lib/lib{ncurses,menu,panel,form}w.so
ln -svf ../../lib/libncursesw.so.5 ${TARGET_DIR}/usr/lib/libncursesw.so
ln -svf ../../lib/libmenuw.so.5 ${TARGET_DIR}/usr/lib/libmenuw.so
ln -svf ../../lib/libpanelw.so.5 ${TARGET_DIR}/usr/lib/libpanelw.so
ln -svf ../../lib/libformw.so.5 ${TARGET_DIR}/usr/lib/libformw.so
for lib in curses ncurses form panel menu ; do
echo "INPUT(-l${lib}w)" > ${TARGET_DIR}/usr/lib/lib${lib}.so
ln -sfv lib${lib}w.a ${TARGET_DIR}/usr/lib/lib${lib}.a
done
ln -sfv libncursesw.so ${TARGET_DIR}/usr/lib/libcursesw.so
ln -sfv libncursesw.a ${TARGET_DIR}/usr/lib/libcursesw.a
ln -sfv libncurses++w.a ${TARGET_DIR}/usr/lib/libncurses++.a
ln -sfv ncursesw5-config ${TARGET_DIR}/usr/bin/ncurses5-config
ln -sfv ../../usr/share/terminfo ${TARGET_DIR}/usr/lib/terminfo
cd ..
rm -rf ncurses-5.7
popd
-----------Procps------------
tar xvf ${DOWNLOADDIR}/procps-3.2.7.tar.gz -C ${BUILDDIR}
pushd ${BUILDDIR}/procps-3.2.7
patch -Np1 -i ${DOWNLOADDIR}/procps-3.2.7-i18n-1.patch
make CPPFLAGS= lib64=lib
make DESTDIR=${TARGET_DIR} lib64=lib ldconfig= /
install="install -D" install
cd ..
rm -rf procps-3.2.7
popd
-----------Libtool--------------
tar xvf ${DOWNLOADDIR}/libtool-2.2.6a.tar.gz -C ${BUILDDIR}
pushd ${BUILDDIR}/libtool-2.2.6
./configure --build=${CROSS_HOST} --host=${CROSS_TARGET} --prefix=/usr
make
make DESTDIR=${TARGET_DIR} install
cd ..
rm -rf libtool-2.2.6
popd
-----------Readline------------
tar xvf ${DOWNLOADDIR}/readline-6.0.tar.gz -C ${BUILDDIR}
pushd ${BUILDDIR}/readline-6.0
sed -i 's:^SHLIB_LIBS=:SHLIB_LIBS=-lncursesw:' support/shobj-conf
./configure --build=${CROSS_HOST} --host=${CROSS_TARGET} --prefix=/usr /
--libdir=/lib
make
make DESTDIR=${TARGET_DIR} install
make DESTDIR=${TARGET_DIR} install-doc
mv -v ${TARGET_DIR}/lib/lib{readline,history}.a ${TARGET_DIR}/usr/lib
rm -v ${TARGET_DIR}/lib/lib{readline,history}.so
ln -svf ../../lib/libreadline.so.6 ${TARGET_DIR}/usr/lib/libreadline.so
ln -svf ../../lib/libhistory.so.6 ${TARGET_DIR}/usr/lib/libhistory.so
cd ..
rm -rf readline-6.0
popd
-----------Autoconf------------
tar xvf ${DOWNLOADDIR}/autoconf-2.63.tar.bz2 -C ${BUILDDIR}
pushd ${BUILDDIR}/autoconf-2.63
./configure --build=${CROSS_HOST} --host=${CROSS_TARGET} --prefix=/usr
make
make DESTDIR=${TARGET_DIR} install
cd ..
rm -rf autoconf-2.63
popd
-------------Automake-----------
tar xvf ${DOWNLOADDIR}/automake-1.10.2.tar.bz2 -C ${BUILDDIR}
pushd ${BUILDDIR}/automake-1.10.2
./configure --build=${CROSS_HOST} --host=${CROSS_TARGET} --prefix=/usr
make
make DESTDIR=${TARGET_DIR} install
cd ..
rm -rf automake-1.10.2
popd
-------------Bash-----------
tar xvf ${DOWNLOADDIR}/bash-4.0.tar.gz -C ${BUILDDIR}
pushd ${BUILDDIR}/bash-4.0
patch -Np1 -i ${DOWNLOADDIR}/bash-4.0-branch_update-3.patch
cat > config.cache << "EOF"
ac_cv_func_mmap_fixed_mapped=yes
ac_cv_func_strcoll_works=yes
ac_cv_func_working_mktime=yes
bash_cv_func_sigsetjmp=present
bash_cv_getcwd_malloc=yes
bash_cv_job_control_missing=present
bash_cv_printf_a_format=yes
bash_cv_sys_named_pipes=present
bash_cv_ulimit_maxfds=yes
bash_cv_under_sys_siglist=yes
bash_cv_unusable_rtsigs=no
gt_cv_int_divbyzero_sigfpe=yes
EOF
./configure --build=${CROSS_HOST} --host=${CROSS_TARGET} --prefix=/usr /
--bindir=/bin --cache-file=config.cache --without-bash-malloc /
--with-installed-readline
make
make DESTDIR=${TARGET_DIR} htmldir=/usr/share/doc/bash-4.0 install
ln -sv bash ${TARGET_DIR}/bin/sh
cd ..
rm -rf bash-4.0
popd
-------------Bzip2---------------
tar xvf ${DOWNLOADDIR}/bzip2-1.0.5.tar.gz -C ${BUILDDIR}
pushd ${BUILDDIR}/bzip2-1.0.5
cp Makefile{,.orig} &&
sed -e "/^all:/s/ test//" Makefile.orig > Makefile
sed -i -e 's:ln -s -f $(PREFIX)/bin/:ln -s :' Makefile
make -f Makefile-libbz2_so CC="${CC}" AR="${AR}" RANLIB="${RANLIB}"
make clean
make CC="${CC}" AR="${AR}" RANLIB="${RANLIB}"
make PREFIX=${TARGET_DIR}/usr install
cp -v bzip2-shared ${TARGET_DIR}/bin/bzip2
cp -av libbz2.so* ${TARGET_DIR}/lib
ln -sv ../../lib/libbz2.so.1.0 ${TARGET_DIR}/usr/lib/libbz2.so
rm -v ${TARGET_DIR}/usr/bin/{bunzip2,bzcat,bzip2}
ln -sv bzip2 ${TARGET_DIR}/bin/bunzip2
ln -sv bzip2 ${TARGET_DIR}/bin/bzcat
cd ..
rm -rf bzip2-1.0.5
popd
------------DHCPCD-----------
tar xvf ${DOWNLOADDIR}/dhcpcd-5.0.0.tar.bz2 -C ${BUILDDIR}
pushd ${BUILDDIR}/dhcpcd-5.0.0
make PREFIX=/usr BINDIR=/sbin SYSCONFDIR=/etc /
DBDIR=/var/lib/dhcpcd LIBEXECDIR=/usr/lib/dhcpcd
make PREFIX=/usr BINDIR=/sbin SYSCONFDIR=/etc /
DBDIR=/var/lib/dhcpcd LIBEXECDIR=/usr/lib/dhcpcd /
DESTDIR=${TARGET_DIR} install
cd ..
rm -rf dhcpcd-5.0.0
popd
------------Diffutils-----------
tar xvf ${DOWNLOADDIR}/diffutils-2.8.7.tar.gz -C ${BUILDDIR}
pushd ${BUILDDIR}/diffutils-2.8.7
patch -Np1 -i ${DOWNLOADDIR}/diffutils-2.8.7-i18n-1.patch
./configure --build=${CROSS_HOST} --host=${CROSS_TARGET} --prefix=/usr
sed -i 's@/(^#define DEFAULT_EDITOR_PROGRAM /).*@/1"vi"@' config.h
touch man/*.1
make
make DESTDIR=${TARGET_DIR} install
cd ..
rm -rf diffutils-2.8.7
popd
-------------File---------------
tar xvf ${DOWNLOADDIR}/file-5.00.tar.gz -C ${BUILDDIR}
pushd ${BUILDDIR}/file-5.00
patch -Np1 -i ${DOWNLOADDIR}/file-5.00-fixes-2.patch
patch -Np1 -i ${DOWNLOADDIR}/file-5.00-new_compressors-1.patch
patch -Np1 -i ${DOWNLOADDIR}/file-5.00-cross_compile-1.patch
./configure --build=${CROSS_HOST} --host=${CROSS_TARGET} --prefix=/usr
make
make DESTDIR=${TARGET_DIR} install
cd ..
rm -rf file-5.00
popd
--------------Findutils------------
tar xvf ${DOWNLOADDIR}/findutils-4.4.1.tar.gz -C ${BUILDDIR}
pushd ${BUILDDIR}/findutils-4.4.1
cat > config.cache << EOF
gl_cv_func_wcwidth_works=yes
gl_cv_header_working_fcntl_h=yes
ac_cv_func_fnmatch_gnu=yes
EOF
./configure --build=${CROSS_HOST} --host=${CROSS_TARGET} --prefix=/usr /
--libexecdir=/usr/lib/locate --localstatedir=/var/lib/locate /
--cache-file=config.cache
make
make DESTDIR=${TARGET_DIR} install
mv -v ${TARGET_DIR}/usr/bin/find ${TARGET_DIR}/bin
cp ${TARGET_DIR}/usr/bin/updatedb{,.orig}
sed 's@find:=${BINDIR}@find:=/bin@' ${TARGET_DIR}/usr/bin/updatedb.orig /
> ${TARGET_DIR}/usr/bin/updatedb
rm ${TARGET_DIR}/usr/bin/updatedb.orig
cd ..
rm -rf findutils-4.4.1
popd
--------------Flex--------------
tar xvf ${DOWNLOADDIR}/flex-2.5.35.tar.bz2 -C ${BUILDDIR}
pushd ${BUILDDIR}/flex-2.5.35
cp -v Makefile.in{,.orig} &&
sed "s/-I@includedir@//g" Makefile.in.orig > Makefile.in
cat > config.cache << EOF
ac_cv_func_malloc_0_nonnull=yes
ac_cv_func_realloc_0_nonnull=yes
EOF
./configure --build=${CROSS_HOST} --host=${CROSS_TARGET} --prefix=/usr /
--cache-file=config.cache
make CC="${CC} -fPIC" libfl.a
make
make DESTDIR=${TARGET_DIR} install
ln -sv libfl.a ${TARGET_DIR}/usr/lib/libl.a
cd ..
rm -r flex-2.5.35
cat > ${TARGET_DIR}/usr/bin/lex << "EOF"
#!/bin/sh
exec /usr/bin/flex -l "$@"
EOF
chmod -v 755 ${TARGET_DIR}/usr/bin/lex
popd
----------------Gawk------------
tar xvf ${DOWNLOADDIR}/gawk-3.1.6.tar.bz2 -C ${BUILDDIR}
pushd ${BUILDDIR}/gawk-3.1.6
./configure --build=${CROSS_HOST} --host=${CROSS_TARGET} --prefix=/usr /
--libexecdir=/usr/lib
make
make DESTDIR=${TARGET_DIR} install
cd ..
rm -r gawk-3.1.6
popd
--------------Gettext--------------
tar xvf ${DOWNLOADDIR}/gettext-0.17.tar.gz -C ${BUILDDIR}
pushd ${BUILDDIR}/gettext-0.17
patch -Np1 -i ${DOWNLOADDIR}/gettext-0.17-rpath-1.patch
cat > config.cache << EOF
am_cv_func_iconv_works=yes
gl_cv_func_wcwidth_works=yes
gt_cv_func_printf_posix=yes
gt_cv_int_divbyzero_sigfpe=yes
EOF
./configure --build=${CROSS_HOST} --host=${CROSS_TARGET} /
--prefix=/usr --cache-file=config.cache
make
cp gettext-tools/gnulib-lib/.libs/libgettextlib.la{,i}
cp gettext-tools/src/.libs/libgettextsrc.la{,i}
make DESTDIR=${TARGET_DIR} install
rm ${TARGET_DIR}/usr/lib/libasprintf.la
cd ..
rm -rf gettext-0.17
popd
-----------------Grep--------------
tar xvf ${DOWNLOADDIR}/grep-2.5.4.tar.bz2 -C ${BUILDDIR}
pushd ${BUILDDIR}/grep-2.5.4
patch -Np1 -i ${DOWNLOADDIR}/grep-2.5.4-i18n-1.patch
./configure --build=${CROSS_HOST} --host=${CROSS_TARGET} --prefix=/usr /
--bindir=/bin --disable-perl-regexp
make
make DESTDIR=${TARGET_DIR} install
cd ..
rm -rf grep-2.5.4
popd
---------------Groff----------------
tar xvf ${DOWNLOADDIR}/groff-1.20.1.tar.gz -C ${BUILDDIR}
pushd ${BUILDDIR}/groff-1.20.1
PAGE=A4 ./configure --build=${CROSS_HOST} --host=${CROSS_TARGET} --prefix=/usr
make TROFFBIN=troff GROFFBIN=groff GROFF_BIN_PATH=
make prefix=${TARGET_DIR}/usr install
ln -sv soelim ${TARGET_DIR}/usr/bin/zsoelim
ln -sv eqn ${TARGET_DIR}/usr/bin/geqn
ln -sv tbl ${TARGET_DIR}/usr/bin/gtbl
cd ..
rm -rf groff-1.20.1
popd
---------------Gzip--------------------
tar xvf ${DOWNLOADDIR}/gzip-1.3.12.tar.gz -C ${BUILDDIR}
pushd ${BUILDDIR}/gzip-1.3.12
sed -i 's/futimens/gl_&/' gzip.c lib/utimens.{c,h}
./configure --build=${CROSS_HOST} --host=${CROSS_TARGET} --prefix=/usr /
--bindir=/bin
make
make DESTDIR=${TARGET_DIR} install
mv ${TARGET_DIR}/bin/z{egrep,cmp,diff,fgrep,force,grep,less,more,new} /
${TARGET_DIR}/usr/bin
cd ..
rm -rf gzip-1.3.12
popd
--------------IPutils---------------
tar xvf ${DOWNLOADDIR}/iputils-s20071127.tar.bz2 -C ${BUILDDIR}
pushd ${BUILDDIR}/iputils-s20071127
patch -Np1 -i ${DOWNLOADDIR}/iputils-s20071127-fixes-2.patch
patch -Np1 -i ${DOWNLOADDIR}/iputils-s20071127-manpages-2.patch
make CC="${CC}"
install -v -m755 ping{,6} ${TARGET_DIR}/bin
install -v -m755 arping ${TARGET_DIR}/usr/bin
install -v -m755 clockdiff ${TARGET_DIR}/usr/bin
install -v -m755 rdisc ${TARGET_DIR}/usr/bin
install -v -m755 tracepath ${TARGET_DIR}/usr/bin
install -v -m755 trace{path,route}6 ${TARGET_DIR}/usr/bin
cd ..
rm -rf iputils-s20071127
popd
-------------Iproute2------------
tar xvf ${DOWNLOADDIR}/iproute2-2.6.29-1.tar.bz2 -C ${BUILDDIR}
pushd ${BUILDDIR}/iproute2-2.6.29-1
for dir in ip misc tc; do
cp ${dir}/Makefile{,.orig}
sed 's/0755 -s/0755/' ${dir}/Makefile.orig > ${dir}/Makefile
done &&
cp misc/Makefile{,.orig}
sed '/^TARGETS/s@arpd@@g' misc/Makefile.orig > misc/Makefile
make DESTDIR=${TARGET_DIR} CC="${CC}" DOCDIR=/usr/share/doc/iproute2 /
MANDIR=/usr/share/man
make DESTDIR=${TARGET_DIR} DOCDIR=/usr/share/doc/iproute2 /
MANDIR=/usr/share/man install
cd ..
rm -rf iproute2-2.6.29-1
popd
-------------Kbd------------------
tar xvf ${DOWNLOADDIR}/kbd-1.15.tar.bz2 -C ${BUILDDIR}
pushd ${BUILDDIR}/kbd-1.15
cat > config.cache << EOF
ac_cv_func_setpgrp_void=yes
ac_cv_func_malloc_0_nonnull=yes
ac_cv_func_realloc_0_nonnull=yes
EOF
./configure --build=${CROSS_HOST} --host=${CROSS_TARGET} /
--prefix=/usr --cache-file=config.cache
make
make DESTDIR=${TARGET_DIR} install
mv -v ${TARGET_DIR}/usr/bin/{kbd_mode,dumpkeys,loadkeys,openvt,setfont} /
${TARGET_DIR}/bin
cd ..
rm -rf kbd-1.15
popd
-------------Less------------
tar xvf ${DOWNLOADDIR}/less-429.tar.gz -C ${BUILDDIR}
pushd ${BUILDDIR}/less-429
./configure --build=${CROSS_HOST} --host=${CROSS_TARGET} --prefix=/usr /
--sysconfdir=/etc
make
make prefix=${TARGET_DIR}/usr install
mv -v ${TARGET_DIR}/usr/bin/less ${TARGET_DIR}/bin
cd ..
rm -rf less-429
popd
------------Make------------
tar xvf ${DOWNLOADDIR}/make-3.81.tar.bz2 -C ${BUILDDIR}
pushd ${BUILDDIR}/make-3.81
./configure --build=${CROSS_HOST} --host=${CROSS_TARGET} --prefix=/usr
make
make DESTDIR=${TARGET_DIR} install
cd ..
rm -rf make-3.81
popd
--------------Man---------------
tar xvf ${DOWNLOADDIR}/man-1.6f.tar.gz -C ${BUILDDIR}
pushd ${BUILDDIR}/man-1.6f
patch -Np1 -i ${DOWNLOADDIR}/man-1.6f-i18n-1.patch
patch -Np1 -i ${DOWNLOADDIR}/man-1.6f-new_compressors-1.patch
cp configure{,.orig} &&
sed -e "/PREPATH=/s@=.*@=/"$(eval echo ${TARGET_DIR}/{,usr/}{sbin,bin})/"@g" /
-e 's@-is@&R@g' configure.orig > configure
cp src/man.conf.in{,.orig} &&
sed -e 's@MANPATH./usr/man@#&@g' -e 's@MANPATH./usr/local/man@#@g' /
src/man.conf.in.orig > src/man.conf.in
./configure -confdir=/etc
cp conf_script{,.orig} &&
sed "s@${TARGET_DIR}@@" conf_script.orig > conf_script
gcc src/makemsg.c -o src/makemsg
make
make DESTDIR=${TARGET_DIR} install
cd ..
rm -rf man-1.6f
popd
--------Module_Init_Tools------------
tar xvf ${DOWNLOADDIR}/module-init-tools-3.7.tar.bz2 -C ${BUILDDIR}
pushd ${BUILDDIR}/module-init-tools-3.7
patch -Np1 -i ${DOWNLOADDIR}/module-init-tools-3.7-docbook2man-1.patch
./configure --build=${CROSS_HOST} --host=${CROSS_TARGET} --prefix=/usr /
--bindir=/bin --sbindir=/sbin --enable-zlib
make
make DESTDIR=${TARGET_DIR} INSTALL=install install
cd ..
rm -rf module-init-tools-3.7
popd
-------------Patch-----------
tar xvf ${DOWNLOADDIR}/patch-2.5.9.tar.gz -C ${BUILDDIR}
pushd ${BUILDDIR}/patch-2.5.9
cat > config.cache << EOF
ac_cv_path_ed_PROGRAM=ed
EOF
./configure --build=${CROSS_HOST} --host=${CROSS_TARGET} --prefix=/usr /
--cache-file=config.cache
make
make prefix=${TARGET_DIR}/usr install
cd ..
rm -rf patch-2.5.9
popd
-------------Psmisc--------------
tar xvf ${DOWNLOADDIR}/psmisc-22.6.tar.gz -C ${BUILDDIR}
pushd ${BUILDDIR}/psmisc-22.6
cat > config.cache << EOF
ac_cv_func_malloc_0_nonnull=yes
ac_cv_func_realloc_0_nonnull=yes
EOF
./configure --build=${CROSS_HOST} --host=${CROSS_TARGET} --prefix=/usr /
--exec-prefix="" --cache-file=config.cache
make
make DESTDIR=${TARGET_DIR} install
mv -v ${TARGET_DIR}/bin/pstree* ${TARGET_DIR}/usr/bin
ln -sv killall ${TARGET_DIR}/bin/pidof
cd ..
rm -rf psmisc-22.6
popd
-----------Shadow--------------
tar xvf ${DOWNLOADDIR}/shadow-4.1.3.tar.bz2 -C ${BUILDDIR}
pushd ${BUILDDIR}/shadow-4.1.3
echo "ac_cv_func_setpgrp_void=yes" > config.cache
./configure --build=${CROSS_HOST} --host=${CROSS_TARGET} --libdir=/lib /
--sysconfdir=/etc --enable-shared --without-libpam /
--without-audit --without-selinux --cache-file=config.cache
cp src/Makefile{,.orig}
sed 's/groups$(EXEEXT) //' src/Makefile.orig > src/Makefile
for mkf in $(find man -name Makefile)
do
cp ${mkf}{,.orig}
sed -e '/groups.1.xml/d' -e 's/groups.1 //' ${mkf}.orig > ${mkf}
done
make
make DESTDIR=${TARGET_DIR} install
cp ${TARGET_DIR}/etc/login.defs login.defs.orig
sed -e 's@#MD5_CRYPT_ENAB.no@MD5_CRYPT_ENAB yes@' /
-e 's@/var/spool/mail@/var/mail@' /
login.defs.orig > ${TARGET_DIR}/etc/login.defs
mv -v ${TARGET_DIR}/usr/bin/passwd ${TARGET_DIR}/bin
${CROSS_TARGET}-pwconv
${CROSS_TARGET}-grpconv
${CROSS_TARGET}-passwd root
cd ..
rm -rf shadow-4.1.3
popd
-------------Rsyslog-------------
tar xvf ${DOWNLOADDIR}/rsyslog-3.22.0.tar.gz -C ${BUILDDIR}
pushd ${BUILDDIR}/rsyslog-3.22.0
cat > config.cache << EOF
ac_cv_func_malloc_0_nonnull=yes
ac_cv_func_realloc_0_nonnull=yes
EOF
./configure --build=${CROSS_HOST} --host=${CROSS_TARGET} /
--prefix=/usr --sbindir=/sbin /
--cache-file=config.cache
make
make DESTDIR=${TARGET_DIR} install
install -dv ${TARGET_DIR}/etc/rsyslog.d
cd ..
rm -rf rsyslog-3.22.0
cat > ${TARGET_DIR}/etc/rsyslog.conf << "EOF"
$ModLoad imuxsock.so
$ModLoad imklog.so
$ActionFileDefaultTemplate RSYSLOG_TraditionalFileFormat
$FileOwner root
$FileGroup root
$FileCreateMode 0640
$DirCreateMode 0755
$ModLoad imudp
$UDPServerRun 514
$RepeatedMsgReduction on
$IncludeConfig /etc/rsyslog.d/*.conf
auth,authpriv.* /var/log/auth.log
*.*;auth,authpriv.none -/var/log/syslog
daemon.* -/var/log/daemon.log
kern.* -/var/log/kern.log
lpr.* -/var/log/lpr.log
mail.* -/var/log/mail.log
user.* -/var/log/user.log
# Catch All Logs
*.=debug;/
auth,authpriv.none;/
news.none;mail.none -/var/log/debug
*.=info;*.=notice;*.=warn;/
auth,authpriv.none;/
cron,daemon.none;/
mail,news.none -/var/log/messages
# Emergency are shown to everyone
*.emerg *
EOF
popd
-----------Sysvinit-----------
tar xvf ${DOWNLOADDIR}/sysvinit-2.86.tar.gz -C ${BUILDDIR}
pushd ${BUILDDIR}/sysvinit-2.86
patch -Np1 -i ${DOWNLOADDIR}/sysvinit-2.86-fixes-1.patch
cp -v src/Makefile src/Makefile.orig
sed -e 's@/dev/initctl@$(ROOT)&@g' /
-e 's@/(mknod /)-m /([0-9]* /)/(.* /)p@/1/3p; chmod /2/3@g' /
-e '/^ifeq/s/$(ROOT)//' -e 's@/usr/lib@$(ROOT)&@' /
src/Makefile.orig > src/Makefile
make -C src clobber
make -C src ROOT=${TARGET_DIR} CC="${CC}"
make -C src ROOT=${TARGET_DIR} INSTALL="install" install
cd ..
rm -rf sysvinit-2.86
cat > ${TARGET_DIR}/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:S016:once:/sbin/sulogin
1:2345:respawn:/sbin/agetty tty1 9600
2:2345:respawn:/sbin/agetty tty2 9600
3:2345:respawn:/sbin/agetty tty3 9600
4:2345:respawn:/sbin/agetty tty4 9600
5:2345:respawn:/sbin/agetty tty5 9600
6:2345:respawn:/sbin/agetty tty6 9600
c0:12345:respawn:/sbin/agetty 115200 ttyS0 vt100
# End /etc/inittab
EOF
popd
-----------Tar-------------
tar xvf ${DOWNLOADDIR}/tar-1.22.tar.bz2 -C ${BUILDDIR}
pushd ${BUILDDIR}/tar-1.22
patch -Np1 -i ${DOWNLOADDIR}/tar-1.22-man_page-1.patch
patch -Np1 -i ${DOWNLOADDIR}/tar-1.22-new_compressors-1.patch
cat > config.cache << EOF
gl_cv_func_btowc_eof=yes
ac_cv_func_malloc_0_nonnull=yes
ac_cv_func_realloc_0_nonnull=yes
gl_cv_func_mbrtowc_incomplete_state=yes
gl_cv_func_mbrtowc_nul_retval=yes
gl_cv_func_mbrtowc_null_arg=yes
gl_cv_func_mbrtowc_retval=yes
gl_cv_func_wcrtomb_retval=yes
EOF
./configure --build=${CROSS_HOST} --host=${CROSS_TARGET} --prefix=/usr /
--bindir=/bin --libexecdir=/usr/sbin --cache-file=config.cache
make
make DESTDIR=${TARGET_DIR} install
cd ..
rm -rf tar-1.22
popd
------------Texinfo--------------
tar xvf ${DOWNLOADDIR}/texinfo-4.13.tar.gz -C ${BUILDDIR}
pushd ${BUILDDIR}/texinfo-4.13
patch -Np1 -i ${DOWNLOADDIR}/texinfo-4.13-new_compressors-1.patch
./configure --build=${CROSS_HOST} --host=${CROSS_TARGET} --prefix=/usr
make -C tools/gnulib/lib
make -C tools
make
make DESTDIR=${TARGET_DIR} install
cd ..
rm -rf texinfo-4.13
popd
pushd ${TARGET_DIR}/usr/share/info
rm dir
for f in *
do install-info ${f} dir 2>/dev/null
done
popd
-------------Udev-------------
tar xvf ${DOWNLOADDIR}/udev-141.tar.bz2 -C ${BUILDDIR}
pushd ${BUILDDIR}/udev-141
./configure --build=${CROSS_HOST} --host=${CROSS_TARGET} /
--prefix=/usr --exec-prefix= /
--sysconfdir=/etc
make
make DESTDIR=${TARGET_DIR} install
install -v -m644 -D docs/writing_udev_rules/index.html /
${TARGET_DIR}/usr/share/doc/udev-141/index.html
install -dv ${TARGET_DIR}/lib/firmware
cd ..
rm -rf udev-141
popd
------------Util_Linux_ng-----------
tar xvf ${DOWNLOADDIR}/util-linux-ng-2.14.2.tar.bz2 -C ${BUILDDIR}
pushd ${BUILDDIR}/util-linux-ng-2.14.2
cp hwclock/hwclock.c{,.orig} &&
sed 's@etc/adjtime@var/lib/hwclock/adjtime@g' /
hwclock/hwclock.c.orig > hwclock/hwclock.c
mkdir -pv ${TARGET_DIR}/var/lib/hwclock
./configure --build=${CROSS_HOST} --host=${CROSS_TARGET} /
--enable-arch --enable-partx --disable-wall /
--enable-write --disable-makeinstall-chown
make
make DESTDIR=${TARGET_DIR} install
mv -v ${TARGET_DIR}/usr/bin/logger ${TARGET_DIR}/bin
cd ..
rm -r util-linux-ng-2.14.2
popd
-----------Vim-------------
tar xvf ${DOWNLOADDIR}/vim-7.2.tar.bz2 -C ${BUILDDIR}
tar xvf ${DOWNLOADDIR}/vim-7.2-extra.tar.gz -C ${BUILDDIR}
tar xvf ${DOWNLOADDIR}/vim-7.2-lang.tar.gz -C ${BUILDDIR}
pushd ${BUILDDIR}/vim72
patch -Np1 -i ${DOWNLOADDIR}/vim-7.2-branch_update-11.patch
echo '#define SYS_VIMRC_FILE "/etc/vimrc"' >> src/feature.h
cat > src/auto/config.cache << EOF
vim_cv_getcwd_broken=no
vim_cv_memmove_handles_overlap=yes
vim_cv_stat_ignores_slash=no
vim_cv_terminfo=yes
vim_cv_tgent=zero
vim_cv_toupper_broken=no
vim_cv_tty_group=world
EOF
如果是制作n32的系统则使用
echo "ac_cv_sizeof_int=4" >> src/auto/config.cache
如果是制作64的系统则使用
echo "ac_cv_sizeof_int=8" >> src/auto/config.cache
./configure --build=${CROSS_HOST} --host=${CROSS_TARGET} --prefix=/usr /
--enable-multibyte --enable-gui=no --disable-gtktest /
--disable-xim --with-features=normal --disable-gpm --without-x /
--disable-netbeans --with-tlib=ncurses
make
make DESTDIR=${TARGET_DIR} install
ln -sv vim ${TARGET_DIR}/usr/bin/vi
ln -sv ../vim/vim72/doc ${TARGET_DIR}/usr/share/doc/vim-7.2
cd ..
rm -rf vim72
cat > ${TARGET_DIR}/etc/vimrc << "EOF"
" Begin /etc/vimrc
set nocompatible
set backspace=2
syntax on
if (&term == "iterm") || (&term == "putty")
set background=dark
endif
" End /etc/vimrc
EOF
popd
-------------XZ-Utils-------------
tar xvf ${DOWNLOADDIR}/xz-4.999.8beta.tar.gz -C ${BUILDDIR}
pushd ${BUILDDIR}/xz-4.999.8beta
./configure --build=${CROSS_HOST} --host=${CROSS_TARGET} /
--prefix=/usr
make
make DESTDIR=${TARGET_DIR} install
mv -v ${TARGET_DIR}/usr/bin/{xz,lzma,lzcat,unlzma,unxz,xzcat} ${TARGET_DIR}/bin
cd ..
rm -rf xz-4.999.8beta
popd
---------Bootscripts-1.2-pre7--------------
tar xvf ${DOWNLOADDIR}/bootscripts-cross-lfs-1.2-pre7.tar.bz2 -C ${BUILDDIR}
pushd ${BUILDDIR}/bootscripts-cross-lfs
make DESTDIR=${TARGET_DIR} install-bootscripts
make DESTDIR=${TARGET_DIR} install-network
cd ..
rm -rf bootscripts-cross-lfs
popd
tar xvf ${DOWNLOADDIR}/linux-2.6.29.2.tar.bz2 -C ${BUILDDIR}
pushd ${BUILDDIR}/linux-2.6.29.2
make mrproper &&
如果你是为2e福珑盒子编译内核
patch -Np1 -i ${DOWNLOADDIR}/linux-2.6.29-loongson2e-gcc4.4-1.patch
cp arch/mips/configs/fulong_defconfig .config &&
如果你是为2f福珑盒子编译内核
patch -Np1 -i ${DOWNLOADDIR}/linux-2.6.29-loongson2f-1.patch
patch -Np1 -i ${DOWNLOADDIR}/linux-2.6.29-loongson2f-gcc4.4-1.patch
cp ${DOWNLOADDIR}/fuloong2f_defconfig .config &&
如果你是为2f逸珑笔记本编译内核
patch -Np1 -i ${DOWNLOADDIR}/linux-2.6.29-loongson2f-1.patch
patch -Np1 -i ${DOWNLOADDIR}/linux-2.6.29-loongson2f-gcc4.4-1.patch
cp ${DOWNLOADDIR}/yeeloong_defconfig .config &&
make ARCH=mips CROSS_COMPILE=${CROSS_TARGET}- menuconfig &&
make ARCH=mips CROSS_COMPILE=${CROSS_TARGET}- &&
make ARCH=mips CROSS_COMPILE=${CROSS_TARGET}- INSTALL_MOD_PATH=${TARGET_DIR} /
modules_install &&
cp vmlinux ${TARGET_DIR}/boot/loongson2-vmlinux-${MABI}-2.6.29.2 &&
cp System.map ${TARGET_DIR}/boot/loongson2-System.map-${MABI}-2.6.29.2
cd ..
popd
一个建议:内核编译目录可以保留不必删除,因为今后的一些编译有可能需要内核源码
时间设置文件
cat > ${TARGET_DIR}/etc/sysconfig/clock << "EOF"
# Begin /etc/sysconfig/clock
UTC=1
# End /etc/sysconfig/clock
EOF
设置bash下的键盘功能键设置
cat > ${TARGET_DIR}/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
设置Bash Shell启动文件(The Bash Shell Startup Files)
cat > ${TARGET_DIR}/etc/profile << "EOF"
# Begin /etc/profile
export LANG=zh_CN.UTF-8
export INPUTRC=/etc/inputrc
export PS1='/u:/w/$ '
# End /etc/profile
EOF
设置本地网络名
echo "HOSTNAME=loongsonbox" > ${TARGET_DIR}/etc/sysconfig/network
设置hosts文件
cat > ${TARGET_DIR}/etc/hosts << "EOF"
# Begin /etc/hosts (no network card version)
127.0.0.1 loongsonbox localhost
# End /etc/hosts (no network card version)
EOF
设置网络的静态地址
pushd ${TARGET_DIR}/etc/sysconfig/network-devices &&
mkdir -v ifconfig.eth0 &&
cat > ifconfig.eth0/ipv4 << "EOF"
ONBOOT=yes
SERVICE=ipv4-static
IP=192.168.1.1
GATEWAY=192.168.1.2
PREFIX=24
BROADCAST=192.168.1.255
EOF
popd
注意:IP、GATEWAY、BROADCAST的地址根据自己的实际情况设置。
设置DNS
cat > ${TARGET_DIR}/etc/resolv.conf << "EOF"
# Begin /etc/resolv.conf
nameserver 你的首个DNS的地址
nameserver 你的第二DNS的地址
# End /etc/resolv.conf
EOF
建立fstab文件
cat > ${TARGET_DIR}/etc/fstab << "EOF"
# Begin /etc/fstab
# file system mount-point type options dump fsck order
/dev/hda4 / ext3 defaults 1 1
/dev/hda3 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
注意:这里的磁盘名以及文件系统名需要根据实际情况修改。
系统 完成 后可以用
exit
退出loongson用户
重新进入root用户
export TARGET_DIR=/loongson
pushd ${TARGET_DIR}
mknod -m 600 dev/console c 5 1
mknod -m 666 dev/null c 1 3
cp -a dev/{console,null} lib/udev/devices/
chown -R root:root *
打包整个系统,用如下命令
tar -cjf loongson-system-64-2.0.tar.bz2 *
来打包并压缩,以便复制到目标机器上展开。
一些建议 新系统建议展开到一个空白分区中,并且分区的文件系统应是内核支持的文件系统,并且和做好的系统中/etc/fstab中的文件系统描述一致。
在系统正确运行在目标系统上后可以编译Perl
(转载请保持文章的完整性,请注明作者和出处)
作者:孙海勇
Email:[email protected]
2009年5月3日