首页 > 代码库 > OpenWrt 安装sshpass方法

OpenWrt 安装sshpass方法

自己先整个SDK吧,不明的可以再openwrt源码目录直接make menuconfig 看看有没有SDK这个东西,选择了编译。

下面是这样的:

1. 下载sshpass源码

wget http://sourceforge.net/projects/sshpass/files/sshpass/1.05/sshpass-1.05.tar.gz

2. 新建目录package/sshpass/src

3. 把下载下来的源码放到相应目录。

4. 在新建Makefile文件package/sshpass/Makefile

<span style="font-size:14px;">include $(TOPDIR)/rules.mk
#Name and release number of this package
PKG_NAME:=sshpass
PKG_RELEASE:=1.5

PKG_BUILD_DIR :=$(BUILD_DIR)/$(PKG_NAME)

include $(INCLUDE_DIR)/package.mk

define Package/sshpass
        SECTION:=utils
        CATEGORY:=Utilities
        TITLE:=sshpass
endef

define Package/sshpass/description
        Sshpass is a tool for non-interactivly performing password authentication with SSH's
endef

#Specify what needs to be done to prepare for building the package.
define Build/Prepare
        mkdir -p $(PKG_BUILD_DIR)
        $(CP) ./src/* $(PKG_BUILD_DIR)/
endef

#Specify where and how to install the program.
define Package/sshpass/install
        $(INSTALL_DIR) $(1)/bin
        $(INSTALL_BIN) $(PKG_BUILD_DIR)/sshpass $(1)/bin/
endef

#This line executes the necessary commands to compile our program.
$(eval $(call BuildPackage,sshpass))
</span>

5. make V=s 这样就得到了梦寐以求的sshpass了。

OpenWrt 安装sshpass方法