dropbear交叉编译
https://github.com/mkj/dropbear
交叉编译之前,先移植zlib
参考文章:
https://lkmao.blog.csdn.net/article/details/142165736
clone源码:
git clone https://github.com/mkj/dropbear
下载以后的目录结构:因为下面的脚本要根据相对路径计算绝对路径,所以要注意目录位置。
$ ls
dropbear zlib-1.3.1 zlib.tar.gz
编译脚本:
export PATH=/usr/local/arm/gcc-linaro-7.5.0-2019.12-x86_64_arm-linux-gnueabihf/bin:$PATH
install_path=`pwd`/install_arm
echo $install_path
mkdir -p $install_path
path_bak=`pwd`
cd ../zlib-1.3.1/install_arm/
zlib_path=`pwd`echo "zlib_path=$zlib_path"
echo "install_path=$install_path"
cd -
echo "PWD=`pwd`"
#exit 0CC=arm-linux-gnueabihf-gcc \LD=arm-linux-gnueabihf-ld \AD=arm-linux-gnueabihf-as \./configure \--host=arm-linux-gnueabihf \--prefix=$install_path --with-zlib=$zlib_path
make
make install
进入dropbear的子目录install_arm/bin,查看生成的文件dbclient的格式,如果没有这个文件,说明编译失败了。
install_arm/bin$ file dbclient
dbclient: ELF 32-bit LSB shared object, ARM, EABI5 version 1 (SYSV), dynamically linked, interpreter /lib/ld-linux-armhf.so.3, for GNU/Linux 3.2.0, BuildID[sha1]=1b6bc7b6ec404c50065798fea5efb84b910dadd6, with debug_info, not stripped
小结