加snmp模塊到openwrt中去html
一、下載snmp的解壓包文件 net-snmp-5.4.2.1.tar.gz服務器
下載地址爲:http://www.net-snmp.org/download.htmlui
二、拷貝到服務器Z:\package 目錄下(在目錄下建立netsnmp文件)spa
\\192.168.2.32\home\hbg\openwrt\A3_307\package\netsnmp.net
三、解壓snmp文件htm
tar zxvf net-snmp-5.4.2.1.tar.gzip
四、在netsnmp目錄下添加Makefileio
五、在make menuconfig時選中「SNMP」選項就能夠將代碼編譯進入bin文件了。編譯
附錄:file
Makefile文件內容以下:
include $(TOPDIR)/rules.mk
PKG_NAME:=SNMP PKG_VERSION:=5.4.2.1 PKG_BASE_NAME:=SNMP PKG_RELEASE:=1 PKG_BUILD_DIR:=$(BUILD_DIR)/$(PKG_BASE_NAME)-$(PKG_VERSION)
include $(INCLUDE_DIR)/package.mk
define Package/$(PKG_NAME) SECTION:=SNMP CATEGORY:=SNMP TITLE:=netsnmp agent for TVWS MAINTAINER:=Hbg DEPENDS:= MENU:=1 endef
define Package/$(PKG_NAME)/description net-snmp-5.4.2.1 endef
define Build/Compile endef
CONFIGURE_ARGS +=
ifeq ($(CONFIG_mips),y) CONFIGURE_ARGS += --enable-add_drv_cflags="-fno-pic -mno-abicalls -mlong-calls -G 0" endif
define Build/Prepare $(CP) ./net-snmp-5.4.2.1/* $(PKG_BUILD_DIR)/ endef
define Build/Clean @- rm -Rf $(PKG_BUILD_DIR)/ipkg* @- [ -e $(PKG_BUILD_DIR)/Makefile ] && $(MAKE) -C $(PKG_BUILD_DIR) clean $(call Build/Clean/Default) endef
define Package/$(PKG_NAME)/install $(INSTALL_DIR) $(1)/$(PKG_BIN_DIR) endef
$(eval $(call BuildPackage,$(PKG_NAME)))