参考文章
http://www.111cn.net/sys/linux/54377.htm
编译环境可参照上面原文,亦可参照之前的BLOG配置,此处略
下载sshpass原码并解压到/openwrt/package/sshpass/src:
mkdir -p /openwrt/package/sshpass
wget http://sourceforge.net/projects/sshpass/files/sshpass/1.06/sshpass-1.06.tar.gz
tar zxvf sshpass-1.06.tar.gz
mv sshpass-1.06 /openwrt/package/sshpass/src
主要是下面是新建Makefile内容:
include $(TOPDIR)/rules.mk
# Name and release number of this package
PKG_NAME:=sshpass
PKG_RELEASE:=1.06
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
TARGET_LDFLAGS+= -L$(TOOLCHAIN_DIR)/usr/lib -L$(TOOLCHAIN_DIR)/lib -Wl,-rpath=$(TOOLCHAIN_DIR)/lib
# 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))
然后编译
如果之前编译过整体环境,可以用make package/sshpass/compile -j 1 V=s
如果之前未编译过整体环境,那就make menuconfig起一步步来