嵌入式Linux之移植dropbear


紅字加粗為編譯器不同、路徑不同需要注意修改的地方

一、源碼包下載:

  • zlib官方下載:http://www.zlib.net/
  • dropbear官方下載:https://matt.ucc.asn.au/dropbear/dropbear.html

     本文使用版本:

  zlib-1.2.8

  dropbear-2016.74

  下面鏈接有已上傳的配置好的源碼包

   http://files.cnblogs.com/files/pokerface/dropbear-2016.74.tar.gz

  http://files.cnblogs.com/files/pokerface/libz-1.2.8.tar.gz

二、創建工作目錄

安裝路徑:  /opt/dropbear_ssh/install/

源碼路徑:  /opt/dropbear_ssh/source/

壓縮包路徑: /opt/dropbear_ssh/tmp/

三、編譯安裝zlib

1.修改Makefile :

增加CROSS=arm-hisiv400-linux-

CC=gcc       改為 CC=$(CROSS)gcc

確保 LDSHARED=CC
確保 CPP=CC - E
AR= ar rc      改為 AR=$(CROSS) ar rc

prefix = /opt/dropbear_ssh/install/

2.編譯:

make

3.安裝:
make install 

四、編譯安裝dropbrear

1.配置

./configure --prefix=/opt/dropbear_ssh/install/ --with-zlib=/opt/dropbear_ssh/install/ CC=arm-hisiv400-linux-gcc --host=arm

2.編譯

make PROGRAMS="dropbear dbclient dropbearkey dropbearconvert scp"

3.安裝

make PROGRAMS="dropbear dbclient dropbearkey dropbearconvert scp" install

不加PROGRAMS參數的話,編譯結果里是沒有scp的

那么就需要

make scp

cp scp /usr/local/dropbear/bin/

 

cp /opt/dropbear_ssh/install/bin/* rootfs_download/usr/sbin/

cp /opt/dropbear_ssh/install/sbin/* rootfs_download/usr/sbin/

 

板上:

dropbearkey -t rsa -f dropbear_rsa_host_key

dropbearkey -t dss -f dropbear_dss_host_key

/etc/init.d/rcS中加入

/usr/sbin/dropbear &

 

 

移植錯誤:

 

1 ranlib libtommath.a
2 make[1]: Leaving directory `/home/liuzhengwu/share/front_bsp/APP/dropbear/dropbear-2016.74/libtommath'
3 arm-hisiv500-linux-gcc -I./libtomcrypt/src/headers/ -I. -I. -I /home/liuzhengwu/share/front_bsp/APP/dropbear/dropbear-2016.74/../out/B1/include/ -Os -W -Wall -Wno-pointer-sign -DDROPBEAR_SERVER -DDROPBEAR_CLIENT -I /home/liuzhengwu/share/front_bsp/APP/dropbear/dropbear-2016.74/../out/B1/include/  -c -o dbutil.o dbutil.c
4 In file included from dbutil.c:64:0:
5 includes.h:66:19: fatal error: utmpx.h: No such file or directory
6  #include <utmpx.h>
7                    ^
8 compilation terminated.
9 make: *** [dbutil.o] Error 1

 

屏蔽標紅語句

#ifdef HAVE_UTMPX_H
//#include <utmpx.h>
#endif

 


免責聲明!

本站轉載的文章為個人學習借鑒使用,本站對版權不負任何法律責任。如果侵犯了您的隱私權益,請聯系本站郵箱yoyou2525@163.com刪除。



 
粵ICP備18138465號   © 2018-2025 CODEPRJ.COM