Platform: Motorola 5272C3 eval board.
Kernel: 2.4.x
Config: vanilla configuration, with the exception of netsnmp added as
a network application and with openssl library built as
per the instructions on ucdot.org (for building openssl and
boa).
Steps:
1. download net-snmp-5.0.8.tar from www.net-snmp.org
2. create a directory uClinux-dist/user/netsnmp and put all the
tar files here (tar -xvf …). I had to copy the files up
a directory level as the tar file creates a -5.0.8 directory.
3. add netsnmp as a configuration option by adding the line
bool ‘net snmpd’ CONFIG_USER_NETSNMP_SNMPD
to config/config.in and altering the user/Makefile as well (it’s
obvious).
4. I ran configure in the netsnmp directory using the following
command:
./configure \
–target=m68k-elf-linux-gnu \
–with-cc=m68k-elf-gcc \
–with-ar=m68k-elf-ar \
–with-endianness=big \
–with-cflags=”-m5307 -DCONFIG_COLDFIRE -Os -g \
-fomit-frame-pointer -Dlinux -D__linux__ \
-Dunix -D__uClinux__ -DEMBED \
-I/home/bob/uClinux-dist/uClibc/include \
-L/home/bob/uClinux-dist/uClibc/lib/ -lm -lcrypt \
-fno-builtin -msep-data -Wl,-elf2flt \
-Wl,-move-rodata \
-nostartfiles /home/bob/uClinux-dist/lib/uClibc/lib/crt0.o \
-lc” \
–enable-mini-agent \
–disable-debugging \
–program-suffix=”" \
–includedir=”/home/bob/uClinux-dist/uClibc/include” \
–without-kmem-usage \
–with-transports=”UDP” \
–with-out-transports=”UDPIPv6 TCPIPv6 TCP Unix Callback
AAL5PVC IPX” \
–with-security-modules=”usm” \
–with-mib-modules=”mibII snmpv3mibs notification target” \
–with-out-mib-modules=”ucd_snmp agent_mibs agentx
utilities”
Its obvious where I’ve got the files, no?
After this runs, I had to do the following:
1. to netsnmp/include/net-snmp/net-snmp-config.h I had to add
two lines:
#define HAVE_STRERROR 1
#define HAVE_SETENV 1
2. to netsnmp/libsnmp/Makefile I had to add
snmpCallbackDomain.c
to the list of files defined for CSRCS
3. in netsnmp/Makefile I changed SUBDIRS and TESTDIRS to
#SUBDIRS = snmplib agent apps local man mibs
SUBDIRS = snmplib agent
#TESTDIRS = testing
TESTDIRS =
4. added romfs to netsnmp/Makefile
romfs:
$(ROMFSINST) agent/snmpd.gdp /bin/snmpd
5. created an snmpd.conf file in romfs/etc
6. fired the bad boy up via
snmpd -c /etc/snmp.conf -f &