zoukankan      html  css  js  c++  java
  • 嵌入式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

  • 相关阅读:
    161012、JAVA读写文件,如何避免中文乱码
    161011、oracle批量插入数据
    161010、在大型项目中组织CSS
    160930、Javascript的垃圾回收机制与内存管理
    160929、各数据库连接配置与maven依赖安装
    Selenium学习(8) Cookie处理
    Selenium学习(7) 文件上传
    Selenium学习(6) 控制浏览器操作
    Selenium学习(5) 元素等待
    Selenium学习(4) 键盘操作
  • 原文地址:https://www.cnblogs.com/pokerface/p/6748103.html
Copyright © 2011-2022 走看看