分类: LINUX
2008-12-22 15:39:09
- ubuntu 8.04
- gcc 4.2.3
- arm_v5t_le-gcc 3.4.3
- [ Zlib]
- [ Dropbear]
编译zlib:
wget tar zxvf zlib-1.2.3.tar.gz mkdir zlib cd zlib-1.2.3/ CC=arm_v5t_le-gcc ./configure --prefix=/home/border/work/SMG/build-tools/zlib make make install
编译dropbear:
wget tar zxvf dropbear-0.51.tar.gz mkdir dropbear-build cd dropbear-build/ mkdir build ../dropbear-0.51/configure --prefix=/home/border/work/SMG/build-tools/dropbear-build/build/ \ --with-zlib=/home/border/work/SMG/build-tools/zlib/ CC=arm_v5t_le-gcc --host=arm make make scp sudo make install sudo cp scp build/bin/
其中的scp需要单独编译,然后用把编译好的scp复制到build/bin目录下。
在交叉编译好的程序要使用 file 之类的工具检查一下是否为目标机器的程序:
border@b0rder:~/work/SMG/build-tools/dropbear-build$ file scp scp: ELF 32-bit LSB executable, ARM, version 1 (SYSV), for GNU/Linux 2.4.17, dynamically linked (uses shared libs), not stripped
编译好的文件目录结构为:
border@b0rder:~/work/SMG/build-tools/dropbear-build/build$ tree . |-- bin | |-- dbclient | |-- dropbearconvert | |-- dropbearkey | `-- scp `-- sbin `-- dropbear
生成server key:
cd /etc mkdir dropbear cd dropbear dropbearkey -t rsa -f dropbear_rsa_host_key dropbearkey -t dss -f dropbear_dss_host_key
把build目录拷贝到ARM机器上, 在启动脚步/etc/init.d/rcS中增加:
dropbear
-- EOF --