zoukankan      html  css  js  c++  java
  • 《海思移植rsync和openssh-server》

    1.移植rsync

      因为要使用rsync把板卡已经配置好环境的文件系统备份出来。但是使用apt-get不能下载rsync,因此就自己下载rsync的软件包。

      下载地址:https://download.samba.org/pub/rsync/src/

    tar -zxvf   rsync-3.1.3.tar.gz
    cd rysnc-3.1.3
    ./configure --host=arm-hisiv400-linux --prefix=/usr/local/rsync
    make && make install
    

      然后会在/usr/local/rsync中生成一个rsync的可执行程序。

      将这个rsync可执行程序放在开发板上就行了。

    2.移植openssh-server

    http://blog.sina.com.cn/s/blog_5587f9270101cy90.html

    https://blog.csdn.net/david_xtd/article/details/11734225

      移植openssh-server需要分别移植openssh、openssl、zlib

    2.1下载地址

    openssh http://www.openssh.com/portable.html
    
    openssl http://www.openssl.org/source
    
    zlib    http://www.zlib.net/ 
    

      

    2.2 编译安装zlib

    #进入到zlib的目录
    #./configure  --prefix=/home/3520/software/openssh-server/package

    修改Makefile
    CC=arm-hisiv400-linux-gcc
    AR=arm-hisiv400-linux-ar
    CPP =arm-hisiv400-linux-gcc -E
    LDSHARED=arm-hisiv400-linux-gcc

    make
    make install

      

    2.3 编译安装openssl

      首先看一下openssl中的INSTALL,里面有详细的安装步骤,别看着网上的内容就一顿操作猛如虎,然后发现不太对。因为我就是这样的,要学会看INSTALL和README。

    #./config no-asm --prefix=/home/3520/software/openssh-server/package --cross-compile-prefix=arm-hisiv400-linux-
    no-asm 在交叉编译过程中不使用汇编代码代码加速编译过程。
    no-shared  生成静态链接库。
    --prefix 指定生成lib include bin目录的路径,不修改此项则默认为OPENSSLDIR目录。
    -cross-compile-prefix指定编译器
    #make
    #make install

      报错:

      如果编译报错,并提示"m64"字样报错信息,多半是交叉编译器不支持m64选项。解决办法:
      修改Makefile ,若有-m32或-m64 字段,直接删除即可

    2.4 编译安装openssh

      先开一下INSTALL文档。

    #./configure --host=arm-hisiv400-linux --with-libs --with-zlib=/home/3520/software/openssh-server/package 
      --with-ssl-dir=/home/3520/software/openssh=server/package --disable-etc-default-login CC=arm-hisiv400-linux-gcc AR=arm-hisiv400-linux-ar
    #make

      这里不需要安装,因为我们是需要部署到开发板上面。

      运行到这一步,就可以在openssh文件夹中找到移植需要的“scp ,sftp ,ssh,sshd,ssh-add,ssh-agent,ssh-keygen,ssh-keyscan”文件。

      生成key文件:

    进入openssh目录:cd openssh-5.6p1
    生成ssh_host_rsa_key文件:ssh-keygen -t rsa -f ssh_host_rsa_key -N “”
    生成ssh_host_dsa_key文件:ssh-keygen -t dsa -f ssh_host_dsa_key -N “”
    生成ssh_host_ecdsa_key文件:ssh-keygen -t ecdsa -f ssh_host_ecdsa_key -N “”
    生成ssh_host_ed25519_key文件:ssh-keygen -t dsa -f ssh_host_ed25519_key -N “”
    

      

    3.在板卡上部署

      在开发板上新建“/usr/libexec“,“/usr/local/etc ”,“/usr/local/bin ”三个目录:mkdir -p /usr/libexec /usr/local/etc /usr/local/bin

      将openssh生成的“scp ,sftp ,ssh,sshd,ssh-add,ssh-agent,ssh-keygen,ssh-keyscan”文件拷贝到开发板中的 /usr/local/bin中

      将openssh目录下的“ssh_host_rsa_key,ssh_host_dsa_key,ssh_host_ecdsa_key,ssh_host_ed25519_key,moduli,ssh_config,sshd_config”拷贝到开发板的“/usr/local/etc”目录

      将“ssh_host_rsa_key,ssh_host_dsa_key,ssh_host_ecdsa_key,ssh_host_ed25519_key”权限改为600(不改权限后面运行不了)

      将“sftp-server、ssh-keysign”拷贝到开发的“/usr/libexec”目录

    https://blog.csdn.net/yangxuan12580/article/details/95207961?utm_medium=distribute.pc_relevant.none-task-blog-baidujs-1

      因为板卡Flash的空间不足,因此不能进行移植。靠 

  • 相关阅读:
    我的第一个MFC小项目(2)之 初涉位图
    MFC中托盘(TRAYICON)实现
    基于顺序表哈夫曼树
    对《VC中添加WM_DEVICECHANGE消息(经典)》的补充
    C++对析构函数的误解
    我的第一个MFC小项目(4)之 位图转换(续)
    (堆的应用)Huffman赫夫曼树的建立
    一个母亲一生撒的8个谎言
    线裎里面传递参数问题解决方案
    Validating user inputs using Regular Expressions
  • 原文地址:https://www.cnblogs.com/zhuangquan/p/13158094.html
Copyright © 2011-2022 走看看