mailarchive of the ptxdist mailing list
 help / color / mirror / Atom feed
From: Alexander Dahl <post@lespocky.de>
To: ptxdist@pengutronix.de
Subject: [ptxdist] [PATCH 6/8] net-snmp: let user choose MIB files to install
Date: Fri, 20 Sep 2013 15:59:33 +0200	[thread overview]
Message-ID: <1379685575-11135-7-git-send-email-post@lespocky.de> (raw)
In-Reply-To: <1379685575-11135-1-git-send-email-post@lespocky.de>


Signed-off-by: Alexander Dahl <post@lespocky.de>
---
 rules/net-snmp.in   |   85 +++++++++++++++++++++++++++++++++++++++++++++++++--
 rules/net-snmp.make |   80 ++++++++++++++++++++++++++++++++----------------
 2 files changed, 137 insertions(+), 28 deletions(-)

diff --git a/rules/net-snmp.in b/rules/net-snmp.in
index a36a915..6346711 100644
--- a/rules/net-snmp.in
+++ b/rules/net-snmp.in
@@ -27,9 +27,90 @@ config NET_SNMP_SCRIPTS
 	bool
 	prompt "scripts (mib2c, ...)"
 
-config NET_SNMP_MIBS
+menuconfig NET_SNMP_MIBS
 	bool
-	prompt "mib files"
+	prompt "mib files                     "
+
+if NET_SNMP_MIBS
+
+config NET_SNMP_V1MIBS
+	bool
+	prompt "v1 MIBS"
+	default y
+	help
+	  RFC1155-SMI, RFC1213-MIB, RFC-1215
+
+config NET_SNMP_V2MIBS
+	bool
+	prompt "v2 MIBS"
+	default y
+	help
+	  SNMPv2-CONF, SNMPv2-SMI, SNMPv2-TC, SNMPv2-TM, SNMPv2-MIB
+
+config NET_SNMP_V3MIBS
+	bool
+	prompt "v3 MIBS"
+	default y
+	help
+	  SNMP-FRAMEWORK-MIB, SNMP-MPD-MIB, SNMP-TARGET-MIB,
+	  SNMP-NOTIFICATION-MIB, SNMP-PROXY-MIB, SNMP-USER-BASED-SM-MIB,
+	  SNMP-VIEW-BASED-ACM-MIB, SNMP-COMMUNITY-MIB, TRANSPORT-ADDRESS-MIB
+
+config NET_SNMP_AGENTMIBS
+	bool
+	prompt "agent MIBS"
+	default y
+	help
+	  AGENTX-MIB, SMUX-MIB
+
+config NET_SNMP_IANAMIBS
+	bool
+	prompt "IANA MIBS"
+	default y
+	help
+	  IANAifType-MIB, IANA-LANGUAGE-MIB, IANA-ADDRESS-FAMILY-NUMBERS-MIB
+
+config NET_SNMP_RFCMIBS
+	bool
+	prompt "RFC MIBS"
+	default y
+	help
+	  IF-MIB, IF-INVERTED-STACK-MIB, EtherLike-MIB, IP-MIB,
+	  IP-FORWARD-MIB, IANA-RTPROTO-MIB, TCP-MIB, UDP-MIB,
+	  INET-ADDRESS-MIB, HCNUM-TC, HOST-RESOURCES-MIB,
+	  HOST-RESOURCES-TYPES, RMON-MIB, IPV6-TC, IPV6-MIB, IPV6-ICMP-MIB,
+	  IPV6-TCP-MIB, IPV6-UDP-MIB, DISMAN-EVENT-MIB, DISMAN-SCRIPT-MIB,
+	  DISMAN-SCHEDULE-MIB, NOTIFICATION-LOG-MIB, SNMP-USM-AES-MIB,
+	  SNMP-USM-DH-OBJECTS-MIB
+
+config NET_SNMP_NETSNMPMIBS
+	bool
+	prompt "Net-SNMP MIBS"
+	default y
+	help
+	  NET-SNMP-TC, NET-SNMP-MIB, NET-SNMP-AGENT-MIB,
+	  NET-SNMP-EXAMPLES-MIB, NET-SNMP-EXTEND-MIB, NET-SNMP-PASS-MIB
+
+config NET_SNMP_UCDMIBS
+	bool
+	prompt "UCD MIBS"
+	default y
+	help
+	  UCD-SNMP-MIB, UCD-DEMO-MIB, UCD-IPFWACC-MIB, UCD-DLMOD-MIB,
+	  UCD-DISKIO-MIB
+
+config NET_SNMP_LMSENSORS_MIB
+	bool "lm-sensors MIBS" if NET_SNMP_MIB_MODULES_LM_SENSORS
+	help
+	  LM-SENSORS-MIB
+
+config NET_SNMP_OTHERMIBS
+	bool
+	prompt "other MIBS"
+	help
+	  BRIDGE-MIB, IPV6-FLOW-LABEL-MIB, SCTP-MIB, TUNNEL-MIB
+
+endif
 
 config NET_SNMP_MIB_LOADING
 	bool
diff --git a/rules/net-snmp.make b/rules/net-snmp.make
index e0415e8..c0cc786 100644
--- a/rules/net-snmp.make
+++ b/rules/net-snmp.make
@@ -2,6 +2,7 @@
 #
 # Copyright (C) 2006 by Randall Loomis <rloomis@solectek.com>
 #               2010 Michael Olbrich <m.olbrich@pengutronix.de>
+#               2013 Alexander Dahl <post@lespocky.de>
 #
 # See CREDITS for details about who has contributed to this project.
 #
@@ -165,44 +166,73 @@ NET_SNMP_MAKE_PAR := NO
 # Target-Install
 # ----------------------------------------------------------------------------
 
+NET_SNMP_MIBS :=
 
-NET_SNMP_V1MIBS := RFC1155-SMI.txt RFC1213-MIB.txt RFC-1215.txt
+ifdef PTXCONF_NET_SNMP_MIBS
+
+ifdef PTXCONF_NET_SNMP_V1MIBS
+NET_SNMP_MIBS += RFC1155-SMI.txt RFC1213-MIB.txt RFC-1215.txt
+endif
 
-NET_SNMP_V2MIBS := SNMPv2-CONF.txt SNMPv2-SMI.txt SNMPv2-TC.txt SNMPv2-TM.txt SNMPv2-MIB.txt
+ifdef PTXCONF_NET_SNMP_V2MIBS
+NET_SNMP_MIBS += SNMPv2-CONF.txt SNMPv2-SMI.txt SNMPv2-TC.txt \
+			SNMPv2-TM.txt SNMPv2-MIB.txt
+endif
 
-NET_SNMP_V3MIBS := SNMP-FRAMEWORK-MIB.txt SNMP-MPD-MIB.txt SNMP-TARGET-MIB.txt \
-			SNMP-NOTIFICATION-MIB.txt SNMP-PROXY-MIB.txt \
-			SNMP-USER-BASED-SM-MIB.txt SNMP-VIEW-BASED-ACM-MIB.txt \
+ifdef PTXCONF_NET_SNMP_V3MIBS
+NET_SNMP_MIBS += SNMP-FRAMEWORK-MIB.txt SNMP-MPD-MIB.txt \
+			SNMP-TARGET-MIB.txt SNMP-NOTIFICATION-MIB.txt \
+			SNMP-PROXY-MIB.txt SNMP-USER-BASED-SM-MIB.txt \
+			SNMP-VIEW-BASED-ACM-MIB.txt \
 			SNMP-COMMUNITY-MIB.txt TRANSPORT-ADDRESS-MIB.txt
+endif
 
-NET_SNMP_AGENTMIBS := AGENTX-MIB.txt SMUX-MIB.txt
+ifdef PTXCONF_NET_SNMP_AGENTMIBS
+NET_SNMP_MIBS += AGENTX-MIB.txt SMUX-MIB.txt
+endif
 
-NET_SNMP_IANAMIBS := IANAifType-MIB.txt IANA-LANGUAGE-MIB.txt \
+ifdef PTXCONF_NET_SNMP_IANAMIBS
+NET_SNMP_MIBS += IANAifType-MIB.txt IANA-LANGUAGE-MIB.txt \
 			IANA-ADDRESS-FAMILY-NUMBERS-MIB.txt
+endif
 
-NET_SNMP_RFCMIBS := IF-MIB.txt IF-INVERTED-STACK-MIB.txt \
-			EtherLike-MIB.txt \
-			IP-MIB.txt IP-FORWARD-MIB.txt IANA-RTPROTO-MIB.txt \
-			TCP-MIB.txt UDP-MIB.txt \
-			INET-ADDRESS-MIB.txt HCNUM-TC.txt \
-			HOST-RESOURCES-MIB.txt HOST-RESOURCES-TYPES.txt \
-			RMON-MIB.txt \
-			IPV6-TC.txt IPV6-MIB.txt IPV6-ICMP-MIB.txt IPV6-TCP-MIB.txt \
-			IPV6-UDP-MIB.txt \
-			DISMAN-EVENT-MIB.txt DISMAN-SCRIPT-MIB.txt DISMAN-SCHEDULE-MIB.txt \
+ifdef PTXCONF_NET_SNMP_RFCMIBS
+NET_SNMP_MIBS += IF-MIB.txt IF-INVERTED-STACK-MIB.txt \
+			EtherLike-MIB.txt IP-MIB.txt \
+			IP-FORWARD-MIB.txt IANA-RTPROTO-MIB.txt \
+			TCP-MIB.txt UDP-MIB.txt INET-ADDRESS-MIB.txt \
+			HCNUM-TC.txt HOST-RESOURCES-MIB.txt \
+			HOST-RESOURCES-TYPES.txt RMON-MIB.txt \
+			IPV6-TC.txt IPV6-MIB.txt IPV6-ICMP-MIB.txt \
+			IPV6-TCP-MIB.txt IPV6-UDP-MIB.txt \
+			DISMAN-EVENT-MIB.txt DISMAN-SCRIPT-MIB.txt \
+			DISMAN-SCHEDULE-MIB.txt \
 			NOTIFICATION-LOG-MIB.txt SNMP-USM-AES-MIB.txt \
 			SNMP-USM-DH-OBJECTS-MIB.txt
+endif
 
-NET_SNMP_NETSNMPMIBS := NET-SNMP-TC.txt NET-SNMP-MIB.txt NET-SNMP-AGENT-MIB.txt \
-			NET-SNMP-EXAMPLES-MIB.txt NET-SNMP-EXTEND-MIB.txt \
-			NET-SNMP-PASS-MIB.txt
+ifdef PTXCONF_NET_SNMP_NETSNMPMIBS
+NET_SNMP_MIBS += NET-SNMP-TC.txt NET-SNMP-MIB.txt \
+			NET-SNMP-AGENT-MIB.txt \
+			NET-SNMP-EXAMPLES-MIB.txt \
+			NET-SNMP-EXTEND-MIB.txt NET-SNMP-PASS-MIB.txt
+endif
 
-NET_SNMP_UCDMIBS := UCD-SNMP-MIB.txt UCD-DEMO-MIB.txt UCD-IPFWACC-MIB.txt \
+ifdef PTXCONF_NET_SNMP_UCDMIBS
+NET_SNMP_MIBS += UCD-SNMP-MIB.txt UCD-DEMO-MIB.txt UCD-IPFWACC-MIB.txt \
 			UCD-DLMOD-MIB.txt UCD-DISKIO-MIB.txt
+endif
+
+ifdef PTXCONF_NET_SNMP_LMSENSORS_MIB
+NET_SNMP_MIBS += LM-SENSORS-MIB.txt
+endif
 
-## FIXME:  for now, you need to manually edit this list to represent what mibs to install on target.
-NET_SNMP_MIBS := $(NET_SNMP_V1MIBS) $(NET_SNMP_V2MIBS) $(NET_SNMP_V3MIBS) \
-	$(NET_SNMP_AGENTMIBS) $(NET_SNMP_IANAMIBS) $(NET_SNMP_RFCMIBS) $(NET_SNMP_NETSNMPMIBS) $(NET_SNMP_UCDMIBS)
+ifdef PTXCONF_NET_SNMP_OTHERMIBS
+NET_SNMP_MIBS += BRIDGE-MIB.txt IPV6-FLOW-LABEL-MIB.txt SCTP-MIB.txt \
+			TUNNEL-MIB.txt
+endif
+
+endif
 
 $(STATEDIR)/net-snmp.targetinstall:
 	@$(call targetinfo)
@@ -263,9 +293,7 @@ endif
 # snmplib
 	@$(call install_lib, net-snmp, 0, 0, 0644, libnetsnmp)
 
-# MIB files <TODO: install specified set of mib files>
 ifdef PTXCONF_NET_SNMP_MIBS
-
 	@for i in $(NET_SNMP_MIBS); do \
 		$(call install_copy, net-snmp, 0, 0, 0644, -, \
 		$(call remove_quotes,$(PTXCONF_NET_SNMP_MIB_INSTALL_DIR))/$$i, n) ; \
-- 
1.7.10.4


-- 
ptxdist mailing list
ptxdist@pengutronix.de

  parent reply	other threads:[~2013-09-20 14:02 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-09-20 13:59 [ptxdist] net-snmp: patch series again Alexander Dahl
2013-09-20 13:59 ` [ptxdist] [PATCH 1/8] net-snmp: improve menu help texts Alexander Dahl
2013-09-20 13:59 ` [ptxdist] [PATCH 2/8] net-snmp: check mib config by default Alexander Dahl
2013-09-20 13:59 ` [ptxdist] [PATCH 3/8] net-snmp: enable rewritten mib modules " Alexander Dahl
2013-09-20 13:59 ` [ptxdist] [PATCH 4/8] net-snmp: added extra menu entries for mib modules Alexander Dahl
2013-09-20 13:59 ` [ptxdist] [PATCH 5/8] net-snmp: remove no longer used/needed stuff Alexander Dahl
2013-09-20 13:59 ` Alexander Dahl [this message]
2013-09-20 13:59 ` [ptxdist] [PATCH 7/8] net-snmp: reorder menu entries (menus on top) Alexander Dahl
2013-09-20 13:59 ` [ptxdist] [PATCH 8/8] net-snmp: fix vim mode lines Alexander Dahl

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1379685575-11135-7-git-send-email-post@lespocky.de \
    --to=post@lespocky.de \
    --cc=ptxdist@pengutronix.de \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox