mirror of
https://github.com/FRRouting/frr.git
synced 2025-04-30 13:37:17 +02:00
snapcraft: Add FPM module with command to set mode or disable it
- New snap command: frr.set fpm {disable | protobuf | netlink} Signed-off-by: Martin Winter <mwinter@opensourcerouting.org>
This commit is contained in:
parent
80b4df3b08
commit
d851b2fc0d
|
@ -30,6 +30,8 @@ Commands defined by this snap
|
|||
options
|
||||
- `frr.readme`:
|
||||
Returns this document `cat README_usage.md`
|
||||
- `frr.set`:
|
||||
Allows to enable `FPM` module. See FPM section below
|
||||
|
||||
and for debugging defined at this time (May get removed later - do not
|
||||
depend on them). These are mainly intended to debug the Snap
|
||||
|
@ -86,6 +88,20 @@ are named `eth0`, `eth1` and `eth2`, then the additional lines in
|
|||
These settings require either a reboot or a manual configuration with
|
||||
`sysctl` as well.
|
||||
|
||||
FPM Module
|
||||
----------
|
||||
The `frr.set` allows to turn FPM module on or off.
|
||||
|
||||
frr.set fpm {disable|protobuf|netlink}
|
||||
|
||||
Disables FPM or enables FPM with selected mode
|
||||
|
||||
By default, the FPM module is disabled, but installed with netlink and
|
||||
protobuf support. To enable the FPM module, use the `frr.set fpm protobuf`
|
||||
or `frr.set fpm netlink` command. The command will only enable the mode
|
||||
for the next restart of zebra. Please reboot or restart zebra after
|
||||
changing the mode to become effective.
|
||||
|
||||
FAQ
|
||||
---
|
||||
- frr.vtysh displays `--MORE--` on long output. How to suppress this?
|
||||
|
|
|
@ -12,3 +12,4 @@ install:
|
|||
install -D -m 0755 pimd-service $(DESTDIR)/bin/
|
||||
install -D -m 0755 ldpd-service $(DESTDIR)/bin/
|
||||
install -D -m 0755 nhrpd-service $(DESTDIR)/bin/
|
||||
install -D -m 0755 set-options $(DESTDIR)/bin/
|
||||
|
|
40
snapcraft/scripts/set-options
Executable file
40
snapcraft/scripts/set-options
Executable file
|
@ -0,0 +1,40 @@
|
|||
#!/bin/sh
|
||||
|
||||
set -e
|
||||
|
||||
case $1 in
|
||||
fpm)
|
||||
case $2 in
|
||||
disable)
|
||||
rm -f $SNAP_DATA/fpm.conf
|
||||
echo "FPM module disabled. Please restart FRR"
|
||||
;;
|
||||
protobuf)
|
||||
echo "-M fpm:protobuf" > $SNAP_DATA/fpm.conf
|
||||
echo "FPM enabled and set to protobuf mode. Please restart FRR"
|
||||
;;
|
||||
netlink)
|
||||
echo "-M fpm:netlink" > $SNAP_DATA/fpm.conf
|
||||
echo "FPM enabled and set to netlink mode. Please restart FRR"
|
||||
;;
|
||||
*)
|
||||
echo "Usage:"
|
||||
echo " ${SNAP_NAME}.set fpm {disable|protobuf|netlink}"
|
||||
echo ""
|
||||
echo " Disables FPM module or enables it with specified mode"
|
||||
echo " Mode will be saved for next restart of zebra, but zebra"
|
||||
echo " is not automatically restarted"
|
||||
exit 1
|
||||
;;
|
||||
esac
|
||||
;;
|
||||
*)
|
||||
echo "Usage:"
|
||||
echo " ${SNAP_NAME}.set fpm {disable|protobuf|netlink}"
|
||||
echo ""
|
||||
echo " Disables FPM or enables FPM with selected mode"
|
||||
exit 1
|
||||
;;
|
||||
esac
|
||||
|
||||
exit 0
|
|
@ -8,9 +8,13 @@ fi
|
|||
if ! [ -e $SNAP_DATA/vtysh.conf ]; then
|
||||
cp $SNAP/etc/frr/vtysh.conf.default $SNAP_DATA/vtysh.conf
|
||||
fi
|
||||
EXTRA_OPTIONS=""
|
||||
if [ -e $SNAP_DATA/fpm.conf ]; then
|
||||
EXTRA_OPTIONS="`cat $SNAP_DATA/fpm.conf`"
|
||||
fi
|
||||
exec $SNAP/sbin/zebra \
|
||||
-f $SNAP_DATA/zebra.conf \
|
||||
--pid_file $SNAP_DATA/zebra.pid \
|
||||
--socket $SNAP_DATA/zsock \
|
||||
--vty_socket $SNAP_DATA
|
||||
|
||||
--vty_socket $SNAP_DATA \
|
||||
--moduledir $SNAP/lib/frr/modules $EXTRA_OPTIONS
|
||||
|
|
|
@ -90,6 +90,8 @@ apps:
|
|||
- network
|
||||
- network-bind
|
||||
- network-control
|
||||
set:
|
||||
command: bin/set-options
|
||||
zebra-debug:
|
||||
command: sbin/zebra -f $SNAP_DATA/zebra.conf --pid_file $SNAP_DATA/zebra.pid --socket $SNAP_DATA/zsock --vty_socket $SNAP_DATA
|
||||
plugs:
|
||||
|
@ -177,6 +179,7 @@ parts:
|
|||
- bison
|
||||
- flex
|
||||
- python3-dev
|
||||
- protobuf-c-compiler
|
||||
stage-packages:
|
||||
- coreutils
|
||||
- iproute2
|
||||
|
@ -208,6 +211,8 @@ parts:
|
|||
- --enable-group=root
|
||||
- --enable-pimd
|
||||
- --enable-ldpd
|
||||
- --enable-fpm
|
||||
- --enable-protobuf
|
||||
- --enable-configfile-mask=0640
|
||||
- --enable-logfile-mask=0640
|
||||
- --localstatedir=/var/run
|
||||
|
|
Loading…
Reference in a new issue