openwrt下加载snmp模块
加snmp模块到openwrt中去
1、下载snmp的解压包文件 net-snmp-5.4.2.1.tar.gz
下载地址为:http://www.net-snmp.org/download.html
2、拷贝到服务器Z:\package 目录下(在目录下创建netsnmp文件)
\\192.168.2.32\home\hbg\openwrt\A3_307\package\netsnmp
3、解压snmp文件
tar zxvf net-snmp-5.4.2.1.tar.gz
4、在netsnmp目录下添加Makefile
5、在make menuconfig时选中“SNMP”选项就可以将代码编译进入bin文件了。
附录:
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)))