- 论坛徽章:
- 0
|
#!/bin/sh
##http://cross-lfs.org/view/clfs-sysroot/arm/index.html
export SRCDIR=/porting/GTK/src/toolchain
export LC_ALL=POSIX
unset CFLAGS
unset CXXFLAGS
export CLFS=/usr/local/arm-eabi
export PATH=${CLFS}/cross-tools/bin:${PATH}
export CLFS_HOST="$(echo $MACHTYPE | \
sed "s/$(echo $MACHTYPE | cut -d- -f2)/cross/")"
export CLFS_TARGET="arm-none-linux-gnueabi" #"arm-unknown-linux-gnu"
mkdir -p /usr/local/arm-eabi/usr/include
#############################################################################################
#Installation of Linux-Headers
cd ${SRCDIR}
tar jxf linux-2.6.29.6.tar.bz2
cd linux-2.6.29.6
make mrproper
make ARCH=arm headers_check
make ARCH=arm INSTALL_HDR_PATH=dest headers_install
cp -rv dest/include/* ${CLFS}/usr/include
find ${CLFS}/usr/include -name .install -or -name ..install.cmd | xargs rm -fv
#############################################################################################
#Installation of GMP for PC host [if your pc isnot install it; gcc will use it to compile gcc]
cd ${SRCDIR}
tar jxf gmp-4.3.1.tar.bz2
cd gmp-4.3.1/
CPPFLAGS=-fexceptions ./configure \
--prefix=${CLFS}/cross-tools --enable-cxx
make; make install;
#############################################################################################
#Installation of MPFR for PC host
cd ${SRCDIR}
tar jxf mpfr-2.4.1.tar.bz2
cd mpfr-2.4.1/
patch -Np1 -i ../mpfr-2.4.1-branch_update-2.patch
LDFLAGS="-Wl,-rpath,${CLFS}/cross-tools/lib" \
./configure --prefix=${CLFS}/cross-tools \
--enable-shared --with-gmp=${CLFS}/cross-tools
make; make install;
#############################################################################################
#Installation of PPL for PC host
cd ${SRCDIR}
tar jxf ppl-0.10.2.tar.bz2
cd ppl-0.10.2
LDFLAGS="-Wl,-rpath,${CLFS}/cross-tools/lib" \
./configure --prefix=${CLFS}/cross-tools --enable-shared \
--enable-interfaces="c,cxx" --disable-optimization \
--with-libgmp-prefix=${CLFS}/cross-tools \
--with-libgmpxx-prefix=${CLFS}/cross-tools
make; make install;
#############################################################################################
#Installation of CLooG-PPL for PC host
cd ${SRCDIR}
tar zxf cloog-ppl-0.15.3.tar.gz
cd cloog-ppl/
LDFLAGS="-Wl,-rpath,${CLFS}/cross-tools/lib" \
./configure --prefix=${CLFS}/cross-tools --enable-shared --with-bits=gmp \
--with-gmp=${CLFS}/cross-tools --with-ppl=${CLFS}/cross-tools
make; make install;
#############################################################################################
#Installation of Cross Binutils
cd ${SRCDIR}
tar jxf binutils-2.19.1.tar.bz2
cd binutils-2.19.1
patch -Np1 -i ../binutils-2.19.1-branch_update-5.patch
mkdir -v ../binutils-build
cd ../binutils-build
AR=ar AS=as ../binutils-2.19.1/configure --prefix=${CLFS}/cross-tools \
--host=${CLFS_HOST} --target=${CLFS_TARGET} --with-sysroot=${CLFS} \
--disable-nls --enable-shared --disable-multilib
make configure-host
make && make install
cp -v ../binutils-2.19.1/include/libiberty.h ${CLFS}/usr/include
#############################################################################################
#Installation of Cross GCC Compiler with Static libgcc and no Threads
cd ${SRCDIR}
tar jxf gcc-4.4.1.tar.bz2
cd gcc-4.4.1
patch -Np1 -i ../gcc-4.4.1-branch_update-1.patch
mkdir -v ../gcc-build-static
cd ../gcc-build-static
AR=ar LDFLAGS="-Wl,-rpath,${CLFS}/cross-tools/lib" \
../gcc-4.4.1/configure --prefix=${CLFS}/cross-tools \
--build=${CLFS_HOST} --host=${CLFS_HOST} --target=${CLFS_TARGET} \
--disable-multilib --with-sysroot=${CLFS} --disable-nls \
--without-headers --with-newlib --disable-decimal-float \
--disable-libgomp --disable-libmudflap --disable-libssp \
--with-mpfr=${CLFS}/cross-tools --with-gmp=${CLFS}/cross-tools \
--with-ppl=${CLFS}/cross-tools --with-cloog=${CLFS}/cross-tools \
--disable-shared --disable-threads --enable-languages=c \
--with-float=soft --with-cpu=arm920t --with-tune=arm9tdmi
make all-gcc all-target-libgcc
make install-gcc install-target-libgcc
#############################################################################################
#Installation of EGLIBC
cd ${SRCDIR}
tar jxf eglibc-2.10.1-20090726-r8632.tar.bz2
cd eglibc-2.10.1/
tar -jxvf ../eglibc-ports-2.10.1-20090726-r8632.tar.bz2
patch -Np1 -i ../eglibc-2.10.1-fixes-2.patch
cp -v Makeconfig{,.orig}
sed -e 's/-lgcc_eh//g' Makeconfig.orig > Makeconfig
mkdir -v ../eglibc-build
cd ../eglibc-build
cat > config.cache configparms
# Use the ARM EABI to compile the kernel
# Allow old ABI binaries to run with this kernel
#busybox 采用 static 编译方式。
#make CROSS_COMPILE=arm-none-linux-gnueabi- install
#cp -fra _install/* /nfsroot/xroot
#cp -fra examples/bootfloppy/etc /nfsroot/xroot
#拷贝基本的可用库
#cp -fra /usr/local/arm-eabi/lib/* /nfsroot/xroot/lib
#cp -fra /usr/local/arm-eabi/cross-tools/arm-none-linux-gnueabi/lib/* /nfsroot/xroot/lib
#cp -fra /usr/local/arm-eabi/usr/lib/* /nfsroot/xroot/lib
#配置基本可用环境
#mkdir dev etc mnt proc sys root tmp var
#ln -s / xroot
#设备节点
######################################################################################################
ln -s /proc/kcore core
mknod console c 5 1
mknod full c 1 7
mknod kmem c 1 2
mknod mem c 1 1
mknod null c 1 3
mknod port c 1 4
mknod random c 1 8
mknod urandom c 1 9
mknod zero c 1 5
mknod hda b 3 0
mknod hdb b 3 64
mknod hdc b 22 0
mknod hdd b 22 64
mknod ttyS0 c 4 64
mknod ttyS1 c 4 65
mknod ttyS2 c 4 66
# loop devs
for i in `seq 0 7`; do
mknod loop$i b 7 $i
done
# ram devs
for i in `seq 0 9`; do
mknod ram$i b 1 $i
done
ln -s ram1 ram
# ttys
mknod tty c 5 0
for i in `seq 0 9`; do
mknod tty$i c 4 $i
done
# virtual console screen devs
for i in `seq 0 9`; do
mknod vcs$i b 7 $i
done
ln -s vcs0 vcs
# virtual console screen w/ attributes devs
for i in `seq 0 9`; do
mknod vcsa$i b 7 $((128 + i))
done
ln -s vcsa0 vcsa
######################################################################################################
# etc目录制作
#init.d/rcS
######################################################################################################
#! /bin/sh
set -e
exec /etc/rc.local
######################################################################################################
#inittab
#startup the system
null::sysinit:/bin/mount -o remount,rw /
null::sysinit:/bin/mount -t proc proc /proc
null::sysinit:/bin/mount -t sysfs sysfs /sys
null::sysinit:/bin/mount -t devpts devpts /dev/pts
null::sysinit:/bin/mount -a
null::sysinit:/bin/hostname -F /etc/hostname
null::sysinit:/sbin/ifconfig lo 127.0.0.1 up
null::sysinit:/sbin/route add -net 127.0.0.0 netmask 255.0.0.0 lo
#now run any rc scripts and then login
::sysinit:/etc/init.d/rcS
#set up a couple of getty's
#tty1::respawn:/sbin/getty 38400 tty1
#tty2::respawn:/sbin/getty 38400 tty2
#put a getty on the serial port
#ttyS0::respawn:/sbin/getty -L ttyS0 115200 vt100
#ttyS2::respawn:/sbin/getty -L ttyS2 115200 vt100
#logging junk
null::sysinit:/bin/touch /var/log/message
#null::respawn:/sbin/syslogd -n -m 0
#null::respawn:/sbin/klogd -n
::respawn:-/bin/sh
::restart:/sbin/init
#stuff to do for the 3-finger salute
::ctrlaltdel:/sbin/reboot
#stuff to do beore rebooting
null::shutdown:/usr/bin/killall klogd
null::shutdown:/usr/bin/killall syslogd
null::shutdown:/bin/umount -a -r
null::shutdown:/sbin/swapoff -a
######################################################################################################
#rc.local
#!/bin/sh
. /etc/profile
mdev -s
#system initialing task
#Xfbdev -mouse tslib,,,device=/dev/event0 &
#scim -d
#matchbox-window-manager &
#matchbox-panel &
#matchbox-keyboard &
#matchbox-desktop &
echo "**************************************************"
echo "********** welcome *******************************"
echo "**************************************************"
#startup userspace applications
######################################################################################################
#profile
#!/bin/sh
umask 022
ulimit -c 2048
export PATH=/bin:/sbin:/usr/bin:/usr/sbin:/usr/lib:/lib/bin:/usr/lib/bin
export runlevel=S
export prevlevel=N
export XDG_CONFIG_DIRS=/share:/usr/share:/xroot/share:/xroot/usr/share
export XDG_DATA_DIRS=/share:/usr/share:/xroot/share:/xroot/usr/share
export LC_ALL=C
export DISPLAY=:0.0
export LD_LIBRARY_PATH=/lib:/usr/lib:/usr/local/lib
export TSLIB_TSDEVICE=/dev/event0
export TSLIB_CALIBFILE=/etc/pointercal
export TSLIB_CONFFILE=/etc/ts.conf
export TSLIB_PLUGINDIR=/lib/ts
export TSLIB_CONSOLEDEVICE=none
export TSLIB_FBDEVICE=/dev/fb0
export XIM=SCIM
export XIM_PROGRAM=SCIM
export LANG="zh_CN"
export XMODIFIERS="@im=SCIM"
export GTK_IM_MODULE="scim-bridge"
######################################################################################################
# echo taner > etc/hostname
# cp /etc/resolv.conf etc
######################################################################################################
#fstab
proc /proc proc defaults 0 0
sysfs /sys sysfs defaults 0 0
tmpfs /dev/shm tmpfs defaults 0 0
devpts /dev/pts devpts defaults 0 0
本文来自ChinaUnix博客,如果查看原文请点:http://blog.chinaunix.net/u3/90973/showart_2014555.html |
|