#!/bin/sh # ###################################################### # Build script for Core 11.0 # # # # See .info for details # ###################################################### ###################################################### # Configure extension creation parameters # ###################################################### export EXTNAM=frr VERSION="6.0.2" SRCNAM=$EXTNAM-$VERSION.tar.gz WRKDIR=$EXTNAM-$EXTNAM-$VERSION TMPDIR=/tmp/$EXTNAM DESTDIR=/tmp/frrouting/package TODAY=`date +%Y/%m/%d` DESCRIPTION="FRRouting is a routing software suite" DOCDESCRIPTION="Documentation part of the FRRouting routing software suite" DEVDESCRIPTION="Development files part of the FRRouting routing software suite" AUTHORS="See Original-site" HOMEPAGE="https://frrouting.org/" LICENSE="LGPL" ME="rhermsen" TAGS="frr zebra routing quagga" DOCTAGS="man pages frr zebra routing quagga" DEVTAGS="development frr zebra routing quagga" ###################################################### # Prepare extension creation # ###################################################### # Load extensions needed for compiling Frr # Compile tools: tce-load -wi compiletc.tcz tce-load -wi squashfs-tools.tcz tce-load -wi autoconf.tcz tce-load -wi automake.tcz tce-load -wi libtool.tcz tce-load -wi libltdl.tcz tce-load -wi pkg-config.tcz tce-load -wi intltool.tcz tce-load -wi libtool-dev.tcz # Configure dependancy tce-load -wi json-c-dev.tcz tce-load -wi readline-dev.tcz tce-load -wi libxml2.tcz #tce-load -wi libxml2-dev.tcz #tce-load -wi XML-NamespaceSupport.tcz tce-load -wi perl_XML-SAX-Base.tcz tce-load -wi perl_XML-SAX.tcz tce-load -wi perl_XML-LibXML.tcz tce-load -wi libcares-dev.tcz tce-load -wi texinfo.tcz # new 4.0 Configure dependancy #tce-load -wi python.tcz tce-load -wi python-dev.tcz # new 5.0 Configure dependancies tce-load -wi python-sphinx.tcz tce-load -wi python-setuptools.tcz # new 6.0 Configure dependancies tce-load -wi python-docutils.tcz # Other tce-load -wi ipv6-netfilter-KERNEL.tcz # Remove dirs and files left from previous creation rm -r -f $WRKDIR 2>/dev/null sudo rm -r -f $TMPDIR 2>/dev/null sudo rm -r -f $TMPDIR-doc 2>/dev/null ###################################################### # Compile extension # ###################################################### # Export variables needed for compilation export CFLAGS="-Os -pipe -march=i486 -mtune=i686" export CXXFLAGS="-Os -pipe -fno-exceptions -fno-rtti -march=i486 -mtune=i686" #export PKG_CONFIG_PATH=/usr/local/lib/pkgconfig:/usr/lib/pkgconfig # Unpack source in current directory tar -xf $SRCNAM # Autoconfig cd $WRKDIR ./bootstrap.sh # Configure it ./configure --prefix=/usr/local \ --sysconfdir=/usr/local/etc/$EXTNAM \ --localstatedir=/var/$EXTNAM \ --enable-user=tc \ --enable-group=staff \ --enable-vty-group=staff \ --enable-ldpd \ --enable-pimd \ --enable-multipath=2 \ --enable-rtadv #--disable-doc # Compile make mkdir -p $DESTDIR make DESTDIR=$DESTDIR install # Install in base temp dir mkdir -p $TMPDIR/usr/local/bin mkdir -p $TMPDIR/usr/local/sbin mkdir -p $TMPDIR/usr/local/lib/frr/modules mkdir -p $TMPDIR/usr/local/etc/init.d mkdir -p $TMPDIR/usr/local/etc/$EXTNAM #mkdir -p $TMPDIR/usr/local/var/$EXTNAM mkdir -p $TMPDIR/usr/local/tce.installed mv /tmp/frrouting/package/usr/local/bin/* $TMPDIR/usr/local/bin mv /tmp/frrouting/package/usr/local/etc/$EXTNAM/* $TMPDIR/usr/local/etc/$EXTNAM mv /tmp/frrouting/package/usr/local/lib/lib*so* $TMPDIR/usr/local/lib mv /tmp/frrouting/package/usr/local/lib/frr/modules/*.so $TMPDIR/usr/local/lib/frr/modules mv /tmp/frrouting/package/usr/local/sbin/* $TMPDIR/usr/local/sbin ################################################## # daemons file # ################################################## mv /tmp/frrouting/frr-frr-$VERSION/redhat/daemons $TMPDIR/usr/local/etc/frr/daemons.sample sed -i 's/\/etc\/init.d\/frr/\/usr\/local\/etc\/init.d\/frr/g' $TMPDIR/usr/local/etc/frr/daemons.sample sed -i 's/user and group "frr"/user "tc" and group "staff"/g' $TMPDIR/usr/local/etc/frr/daemons.sample sed -i 's/^# group "frrvty"/# group "staff"/g' $TMPDIR/usr/local/etc/frr/daemons.sample #sed -i 's/watchfrr_options/# watchfrr_options/g' $TMPDIR/usr/local/etc/frr/daemons.sample #sed -i '/watchfrr_options.*$/a watchfrr_options=\("-b_" "-r\/usr\/local\/etc\/init.d\/frr_restart_%s" "-s\/usr\/local\/etc\/init.d\/frr_start_%s" "-k\/usr\/local\/etc\/init.d\/frr_stop_%s" -p$P_PATH\/watchfrr.pid)' $TMPDIR/usr/local/etc/frr/daemons.sample sed -i '/^ospfd=no/a # ospfd_instances="1,2"' $TMPDIR/usr/local/etc/frr/daemons.sample sed -i '/the daemons/a # the \\\$pidfile string will be replaced by the actual pidfile and path by the \/usr\/local\/etc\/init.d\/frr script.' $TMPDIR/usr/local/etc/frr/daemons.sample sed -i 's/"-A 127.0.0.1")/"-A 127.0.0.1 --pid_file=\\\$pidfile -u tc -g staff")/g' $TMPDIR/usr/local/etc/frr/daemons.sample sed -i 's/"-A ::1")/"-A ::1 --pid_file=\\\$pidfile -u tc -g staff")/g' $TMPDIR/usr/local/etc/frr/daemons.sample #sed -i 's/watchfrr_enable=yes/watchfrr_enable=no/g' $TMPDIR/usr/local/etc/frr/daemons.sample sed -i "s/\/usr\/lib\/frr\/frr/\/usr\/local\/etc\/init.d\/frr/g" $TMPDIR/usr/local/etc/frr/daemons.sample sed -i "s/frr stop %s'/frr stop %s' -p '\$P_PATH\/watchfrr.pid'/g" $TMPDIR/usr/local/etc/frr/daemons.sample ################################################## # init file # ################################################## #mv /tmp/frrouting/frr-frr-$VERSION/tools/frr-reload.py $TMPDIR/usr/local/sbin/ #mv /tmp/frrouting/frr-frr-$VERSION/tools/frr-reload $TMPDIR/usr/local/sbin/ #mv /tmp/frrouting/frr-frr-$VERSION/tools/frr $TMPDIR/usr/local/etc/init.d/ mv $TMPDIR/usr/local/sbin/frr $TMPDIR/usr/local/etc/init.d/ sed -i '/^PATH=.*sbin$/d' $TMPDIR/usr/local/etc/init.d/frr #sed -i 's/D_PATH=\/usr\/lib\/frr/D_PATH=\/usr\/local\/sbin/g' $TMPDIR/usr/local/etc/init.d/frr #sed -i 's/C_PATH=\/etc\/frr/C_PATH=\/usr\/local\/etc\/frr/g' $TMPDIR/usr/local/etc/init.d/frr #sed -i 's/V_PATH=\/var\/run\/frr/V_PATH=\/var\/frr/g' $TMPDIR/usr/local/etc/init.d/frr sed -i '/V_PATH="\/var\/frr"/a P_PATH=\/var\/run' $TMPDIR/usr/local/etc/init.d/frr sed -i '/# See \/usr\/share\/doc\/frr\/README.Debian.gz.*$/d' $TMPDIR/usr/local/etc/init.d/frr #sed -i 's/RELOAD_SCRIPT=\/usr\/lib\/frr\/frr-reload.py/RELOAD_SCRIPT=\/usr\/local\/sbin\/frr-reload.py/g' $TMPDIR/usr/local/etc/init.d/frr sed -i 's/\[ -f $D_PATH\/ssd \]/\[ -x $D_PATH\/ssd \]/g' $TMPDIR/usr/local/etc/init.d/frr #sed -i 's/\/usr\/lib\/frr\/ssd/$D_PATH\/ssd/g' $TMPDIR/usr/local/etc/init.d/frr sed -i 's/echo "\SV_PATH\/\$1\.pid\"/echo "\$P_PATH\/\$1\.pid\"/g' $TMPDIR/usr/local/etc/init.d/frr sed -i '/.*\[ \! -e `pidfile \$1` \] \&\& return 3/d' $TMPDIR/usr/local/etc/init.d/frr sed -i '/.*if \[ -n "\$2" \] \&\& \[ "\$2" == "log" \]; then/d' $TMPDIR/usr/local/etc/init.d/frr sed -i '/.*status_of_proc -p `pidfile \$1` \$1 \$1 \&\&.*$/d' $TMPDIR/usr/local/etc/init.d/frr sed -i '0,/^ else$/{/^ else$/d}' $TMPDIR/usr/local/etc/init.d/frr sed -i '0,/^ fi/{/^ fi/d}' $TMPDIR/usr/local/etc/init.d/frr sed -i '0,/^ kill -0 `cat \\`pidfile/s/^ kill -0 `cat \\`pidfile.*$/ \[ -e "\$P_PATH\/\$1.pid" \] \&\& kill -0 `cat "\$P_PATH\/\$1.pid"` 2\> \/dev\/null \&\& return 0/g' $TMPDIR/usr/local/etc/init.d/frr sed -i '0,/^ return 0$/s/^ return 0$/ return 1/g' $TMPDIR/usr/local/etc/init.d/frr sed -i '/# Rember, that all.*$/d' $TMPDIR/usr/local/etc/init.d/frr sed -i 's/= 2 -a/= "yes" ] \&\& \[/g' $TMPDIR/usr/local/etc/init.d/frr #sed -i 's/\/usr\/bin\/vtysh -b -n$/\/usr\/local\/bin\/vtysh -b -n/g' $TMPDIR/usr/local/etc/init.d/frr sed -i 's/if \[ -r "\$C_PATH\/frr.conf" \]; then/if \[ "\$vtysh_enable" = "yes" \] \&\& \[ -r "\$C_PATH\/frr.conf" \]; then/g' $TMPDIR/usr/local/etc/init.d/frr sed -i 's/if \[ \$1 \!\= "watchfrr" -a/if \[ \$1 \!\= "watchfrr" \] \&\& \[/g' $TMPDIR/usr/local/etc/init.d/frr #sed -i 's/chown frr:frr/chown tc:staff/g' $TMPDIR/usr/local/etc/init.d/frr sed -i '/ulimit -n \$MAX_FDS/d' $TMPDIR/usr/local/etc/init.d/frr #sed -i 's/\/var\/run\/frr/$V_PATH/g' $TMPDIR/usr/local/etc/init.d/frr sed -i 's/--start/-S/g' $TMPDIR/usr/local/etc/init.d/frr #sed -i 's/\_options\[@\]}"/\_options\[@\]}" \&/g' $TMPDIR/usr/local/etc/init.d/frr sed -i 's/"$@"/"$@" -d/g' $TMPDIR/usr/local/etc/init.d/frr sed -i '153i \ pidfile=`pidfile \$dmn-\$inst`' $TMPDIR/usr/local/etc/init.d/frr sed -i '154i \ pidfile=\${pidfile\/\/\\\/\/\\\\\/}' $TMPDIR/usr/local/etc/init.d/frr sed -i '155i \ daemon_options=`eval echo "\$""\$dmn""_options"`' $TMPDIR/usr/local/etc/init.d/frr sed -i "156i \ daemon_options=\`echo \$daemon_options \| sed 's\/\$pidfile\/'replaceme'\/g'\`" $TMPDIR/usr/local/etc/init.d/frr sed -i 's/replaceme/"\${pidfile}"/g' $TMPDIR/usr/local/etc/init.d/frr sed -i 's/^ *`eval echo "\$""\$dmn""_options"`\(.*$\)/\ \$daemon_options \1 \&/g' $TMPDIR/usr/local/etc/init.d/frr sed -i '170i \ pidfile=`pidfile \$dmn`' $TMPDIR/usr/local/etc/init.d/frr sed -i '171i \ pidfile=\${pidfile\/\/\\\/\/\\\\\/}' $TMPDIR/usr/local/etc/init.d/frr sed -i '172i \ daemon_options=`eval echo "\$""\$dmn""_options"`' $TMPDIR/usr/local/etc/init.d/frr sed -i "173i \ daemon_options=\`echo \$daemon_options \| sed 's\/\$pidfile\/'replaceme'\/g'\`" $TMPDIR/usr/local/etc/init.d/frr sed -i 's/replaceme/"\${pidfile}"/g' $TMPDIR/usr/local/etc/init.d/frr sed -i 's/\(^ \+\)\(--exec "\$D_PATH\/\$dmn" \\\)/\1\2\n\1--quiet \\/g' $TMPDIR/usr/local/etc/init.d/frr sed -i 's/`eval echo "\$"staticd"_options"`/\$daemon_options -d/g' $TMPDIR/usr/local/etc/init.d/frr sed -i 's/--stop/-K/g' $TMPDIR/usr/local/etc/init.d/frr sed -i 's/\/etc\/frr\/daemons/\/usr\/local\/etc\/frr\/daemons/g' $TMPDIR/usr/local/etc/init.d/frr sed -i 's/\$DAEMONS zebra vtysh_enable/\$DAEMONS/g' $TMPDIR/usr/local/etc/init.d/frr sed -i 's/eval value=\\\${\${name}:0:3}/eval value=\\\$\$name/g' $TMPDIR/usr/local/etc/init.d/frr sed -i 's/" -o "/" \] \|\| \[ "/g' $TMPDIR/usr/local/etc/init.d/frr sed -i 's/" -o "/" \] \|\| \[ "/g' $TMPDIR/usr/local/etc/init.d/frr sed -i 's/" -a "/" \] \&\& \[ "/g' $TMPDIR/usr/local/etc/init.d/frr sed -i 's/"zebra=yes"/"zebra=1" or "zebra=0"/g' $TMPDIR/usr/local/etc/init.d/frr #sed -i 's/\/etc\/frr\/debian.cnf/\/usr\/local\/etc\/frr\/daemons/g' $TMPDIR/usr/local/etc/init.d/frr sed -i 's/Stopps/Stops/g' $TMPDIR/usr/local/etc/init.d/frr sed -i 's/eval "file_list_suffix="\$V_PATH"\/"\$daemon\*""/file_list_suffix=`ls \$\{V_PATH\}\/\$\{daemon\}\*.vty 2>>\/dev\/null \| replaceme`/g' $TMPDIR/usr/local/etc/init.d/frr sed -i "s/replaceme/sed 's\/\\\\\/var\\\\\/frr\\\\\/\\\(\.\*\\\)\.vty\/\\\1\/g'/g" $TMPDIR/usr/local/etc/init.d/frr sed -i 's/eval "file_list_suffix="\$V_PATH\/\*""/file_list_suffix=`ls \$\{V_PATH\}\/*.vty 2>>\/dev\/null \| replaceme`/g' $TMPDIR/usr/local/etc/init.d/frr sed -i "s/replaceme/sed 's\/\\\\\/var\\\\\/frr\\\\\/\\\(\.\*\\\)\.vty\/\\\1\/g'/g" $TMPDIR/usr/local/etc/init.d/frr sed -i 's/for pidfile in \$file_list_suffix\.pid; do/for pidfile in \$file_list_suffix; do/g' $TMPDIR/usr/local/etc/init.d/frr sed -i '/for pidfile in \$file_list_suffix; do/a\ pidfile=\${P_PATH}\/\$pidfile\.pid' $TMPDIR/usr/local/etc/init.d/frr sed -i 's/for vtyfile in \$file_list_suffix\.vty; do/for vtyfile in \$file_list_suffix; do/g' $TMPDIR/usr/local/etc/init.d/frr sed -i '/for vtyfile in \$file_list_suffix; do/a\ vtyfile=\${V_PATH}\/\$vtyfile\.vty' $TMPDIR/usr/local/etc/init.d/frr sed -i 's/\# single instance to MI version/\# MI to a single instance version/g' $TMPDIR/usr/local/etc/init.d/frr sed -i 's/eval "file_list_suffix="\$V_PATH"\/"\$daemon_name-\*""/file_list_suffix=`ls \$\{V_PATH\}\/\$\{daemon_name\}-\*.vty 2>>\/dev\/null \| replaceme`/g' $TMPDIR/usr/local/etc/init.d/frr sed -i "s/replaceme/sed 's\/\\\\\/var\\\\\/frr\\\\\/\\\(\.\*\\\)\.vty\/\\\1\/g'/g" $TMPDIR/usr/local/etc/init.d/frr sed -i '/# Which daemons have been started?/a\ echo -n "Running Frr daemons:"' $TMPDIR/usr/local/etc/init.d/frr sed -i 's/\(started .*\) "log"/\1/g' $TMPDIR/usr/local/etc/init.d/frr sed -i 's/\(^ \+\)started "\(\$.\+\) || \(failed_status=\$?\)/\1if started "\2 ; then \n\1 echo -n " \2\n\1else\n\1 \3\n\1fi/g' $TMPDIR/usr/local/etc/init.d/frr sed -i '/# All daemons that need to have been started are up and running/a\ echo "."' $TMPDIR/usr/local/etc/init.d/frr sed -i '/. "\$C_PATH\/daemons.conf"/d' $TMPDIR/usr/local/etc/init.d/frr sed -i 's/\/etc\/default\/frr/\/usr\/local\/etc\/default\/frr/g' $TMPDIR/usr/local/etc/init.d/frr sed -i "s/'yes' to '0'/'yes' to '1'/g" $TMPDIR/usr/local/etc/init.d/frr #sed -i '/^convert_daemon_prios$/a\\nsudo -u tc tce-load -wi sed.tcz >\/dev\/null 2>\&1 \nsudo -u tc tce-load -wi iproute2.tcz >\/dev\/null 2>\&1' $TMPDIR/usr/local/etc/init.d/frr sed -i '/^convert_daemon_prios$/a [ ! -f /usr/local/tce.installed/iproute2 ] && sudo -u tc tce-load -i iproute2.tcz' $TMPDIR/usr/local/etc/init.d/frr sed -i '/^convert_daemon_prios$/a [ ! -e "$TCEDIR"/iproute2.tcz ] && sudo -u tc tce-load -wi iproute2.tcz' $TMPDIR/usr/local/etc/init.d/frr sed -i "/^convert_daemon_prios$/G" $TMPDIR/usr/local/etc/init.d/frr sed -i '/^convert_daemon_prios$/a [ ! -f /usr/local/tce.installed/sed ] && sudo -u tc tce-load -i sed.tcz' $TMPDIR/usr/local/etc/init.d/frr sed -i '/^convert_daemon_prios$/a [ ! -e "$TCEDIR"/sed.tcz ] && sudo -u tc tce-load -wi sed.tcz' $TMPDIR/usr/local/etc/init.d/frr sed -i "/^convert_daemon_prios$/G" $TMPDIR/usr/local/etc/init.d/frr sed -i "/^convert_daemon_prios$/a TCEDIR=\`readlink \/etc\/sysconfig\/tcedir\`\/optional" $TMPDIR/usr/local/etc/init.d/frr sed -i "/^convert_daemon_prios$/G" $TMPDIR/usr/local/etc/init.d/frr sed -i '/echo "Loading capability module if not yet done."/d' $TMPDIR/usr/local/etc/init.d/frr sed -i '196i \ pidfile=`pidfile staticd`' $TMPDIR/usr/local/etc/init.d/frr sed -i '197i \ pidfile=\${pidfile\/\/\\\/\/\\\\\/}' $TMPDIR/usr/local/etc/init.d/frr sed -i '198i \ daemon_options=`eval echo "\$""staticd_options"`' $TMPDIR/usr/local/etc/init.d/frr sed -i "199i \ daemon_options=\`echo \$daemon_options \| sed 's\/\$pidfile\/'replaceme'\/g'\`" $TMPDIR/usr/local/etc/init.d/frr sed -i 's/replaceme/"${pidfile}"/g' $TMPDIR/usr/local/etc/init.d/frr #sed -i 's/\/etc\/frr\/frr.conf/\$C_PATH\/frr.conf/g' $TMPDIR/usr/local/etc/init.d/frr sed -i 's/reload|restart|force-reload|} \[daemon\]/reload|restart|force-reload|} \[daemon\] \[instance\]/g' $TMPDIR/usr/local/etc/init.d/frr sed -i 's/\/etc\/init.d\/frr/\/usr\/local\/etc\/init.d\/frr/g' $TMPDIR/usr/local/etc/init.d/frr #sed -i '/^ *echo " *reload.*."$/d' $TMPDIR/usr/local/etc/init.d/frr sed -i '/^ *echo " *Read \/usr\/share\/doc\/frr\/README.Debian.*$/d' $TMPDIR/usr/local/etc/init.d/frr #sed -i '/^ *reload)/a\ # The reload option is currently not working due to missing Python modules.\n\ # See https://github.com/FRRouting/frr/pull/1689 for additional information.' $TMPDIR/usr/local/etc/init.d/frr sed -i '/^ *reload)/a\ [ ! -f /usr/local/tce.installed/python-ipaddr ] && sudo -u tc tce-load -i python-ipaddr.tcz' $TMPDIR/usr/local/etc/init.d/frr sed -i '/^ *reload)/a\ [ ! -e "$TCEDIR"/python-ipaddr.tcz ] && sudo -u tc tce-load -wi python-ipaddr.tcz' $TMPDIR/usr/local/etc/init.d/frr sed -i '/### \(BEGIN\|END\) INIT INFO/d' $TMPDIR/usr/local/etc/init.d/frr sed -i '/# Required-S.*$/d' $TMPDIR/usr/local/etc/init.d/frr sed -i '/# Default-S.*$/d' $TMPDIR/usr/local/etc/init.d/frr sed -i 's/Provides: frr/2019-02-24: Adapted Debian frr script for Frr 6.0, to work with TCL./g' $TMPDIR/usr/local/etc/init.d/frr sed -i '/\&\& exit 0$/G' $TMPDIR/usr/local/etc/init.d/frr sed -i '/\&\& exit 0$/a fi' $TMPDIR/usr/local/etc/init.d/frr sed -i '/\&\& exit 0$/a \ exit 1' $TMPDIR/usr/local/etc/init.d/frr sed -i '/\&\& exit 0$/a \ echo "This script must be run by root \(sudo\)" >\&2' $TMPDIR/usr/local/etc/init.d/frr sed -i '/\&\& exit 0$/a if \[ "$\(id -u\)" -ne 0 \]; then' $TMPDIR/usr/local/etc/init.d/frr sed -i '/\&\& exit 0$/G' $TMPDIR/usr/local/etc/init.d/frr sed -i 's/[ ]&$/ -d/g' $TMPDIR/usr/local/etc/init.d/frr ################################################## # frr-reload.py file # ################################################## sudo sed -i 's/#!\/usr\/bin\/python/#!\/usr\/local\/bin\/python/g' $TMPDIR/usr/local/sbin/frr-reload.py sudo sed -i 's/\/usr\/bin\/vtysh/\/usr\/local\/bin\/vtysh/g' $TMPDIR/usr/local/sbin/frr-reload.py sudo sed -i 's/\/var\/run\/frr/\/var\/run/g' $TMPDIR/usr/local/sbin/frr-reload.py sudo sed -i 's/\/etc\/frr\/frr.conf/\/usr\/local\/etc\/frr\/frr.conf/g' $TMPDIR/usr/local/sbin/frr-reload.py ################################################### # Create info file # ################################################### cat < /tmp/frrouting/${EXTNAM}.tcz.info Title: ${EXTNAM}.tcz Description: ${DESCRIPTION} Version: ${VERSION} Author: ${AUTHORS} Original-site: ${HOMEPAGE} Copying-policy: ${LICENSE} Size: ${size} Extension_by: ${ME} Tags: ${TAGS} Comments: Frr is a routing software package that provides TCP/IP based routing services with routing protocols support such as RIPv1, RIPv2, RIPng, OSPFv2, OSPFv3, IS-IS, BGP-4, and BGP-4+. Frr also supports special BGP Route Reflector and Route Server behavior. In addition to traditional IPv4 routing protocols, Frr also supports IPv6 routing protocols. With SNMP daemon which supports SMUX and AgentX protocol, Frr provides routing protocol MIBs. The IPv6 kernel modules are not automatically installed. If IPv6 is desired, install ipv6-netfilter-x.x.x-tinycore.tcz via the Apps GUI, or cli (tce-load -wi ipv6-netfilter-KERNEL). A startup script is included at /usr/local/etc/init.d/frr. To use this script cp /usr/local/etc/frr/daemons.sample to /usr/local/etc/frr/daemons. Configure the daemons you want to start with yes or a priority. Use the script with "sudo /usr/local/etc/init.d/frr" . This script also includes a reload option, to reload a configuration file. The reload option requires python-ipaddr.tcz to be intalled (tce-load -wi python-ipaddr.tcz). The install script can help to do the basic setup of FRR. By default it will setup FRR to use vtysh (one configuration for all daemons). If you don't want the install script to do the basic setup for you, you can disable it with creating a file NOSETUPHELP in /tmp (touch /tmp/NOSETUPHELP) before installation. Watchfrr, a daemon monitoring connectivity with routing daemons, is now enabled by default. This can be disabled via /usr/local/etc/frr/daemons. Change-log: 2018/01/23 First Version, 3.0.3 2018/02/25 adapted frr script to work with TCL, 3.0.3 2018/04/20 New major version, 4.0 2019/02/10 New major version, 5.0.2 2019/02/24 fixed script issues, watchfrr support, 5.0.2 ${TODAY} New major version, ${VERSION} Current: ${TODAY} New major version, ${VERSION} EOF ################################################### # Create .dep file # ################################################### cat < /tmp/frrouting/${EXTNAM}.tcz.dep json-c.tcz readline.tcz libcares.tcz bash.tcz EOF ################################################### # Create install script file # ################################################### cat < $TMPDIR/usr/local/tce.installed/${EXTNAM} if [ -r /usr/local/etc/frr/daemons ]; then echo "Verify if /usr/local/etc/frr/daemons requires changes." echo "See /usr/local/etc/frr/daemons.sample for the example." else sudo -u tc cp /usr/local/etc/frr/daemons.sample /usr/local/etc/frr/daemons sudo -u tc mkdir /var/frr TCEDIR=\`readlink /etc/sysconfig/tcedir\`/optional if [ -r /tmp/NOSETUPHELP ]; then SETUPHELP="no" else SETUPHELP="yes" fi if [ \$SETUPHELP = "yes" ]; then if [ ! -e "\$TCEDIR"/iana-etc.tcz ] && [ -n \$TCEDIR ]; then sudo -u tc tce-load -wi iana-etc.tcz fi if [ ! -f /usr/local/tce.installed/iana-etc ] && [ -n \$TCEDIR ]; then sudo -u tc tce-load -i iana-etc.tcz fi if [ ! -r /usr/local/etc/frr/frr.conf ]; then touch /usr/local/etc/frr/frr.conf fi [ ! -f /usr/local/etc/frr/vtysh.conf ] && echo "username admin nopassword" > /usr/local/etc/frr/vtysh.conf chown tc:staff /usr/local/etc/frr/*.conf echo "usr/local/etc/frr/daemons" >> /opt/.filetool.lst echo "etc/services" >> /opt/.filetool.lst echo "usr/local/etc/frr/vtysh.conf" >> /opt/.filetool.lst echo "usr/local/etc/frr/frr.conf" >> /opt/.filetool.lst sed -i 's/^hpstgmgr.*2600\/udp/#hpstgmgr 2600\/udp/g' /etc/services sed -i 's/^hpstgmgr.*2600\/tcp.*$/zebrasrv 2600\/tcp # zebra service, replacing hpstgmgr/g' /etc/services sed -i 's/^discp-client.*2601\/udp/#discp-client 2601\/udp/g' /etc/services sed -i 's/^discp-client.*2601\/tcp.*$/zebra 2601\/tcp # zebra vty, replacing discp-client/g' /etc/services sed -i 's/^discp-server.*2602\/udp/#discp-server 2602\/udp/g' /etc/services sed -i 's/^discp-server.*2602\/tcp.*$/ripd 2602\/tcp # RIPd vty, replacing discp-server/g' /etc/services sed -i 's/^servicemeter.*2603\/udp/#servicemeter 2603\/udp/g' /etc/services sed -i 's/^servicemeter.*2603\/tcp.*$/ripngd 2603\/tcp # RIPngd vty, replacing servicemeter/g' /etc/services sed -i 's/^nsc-ccs.*2604\/udp/#nsc-ccs 2604\/udp/g' /etc/services sed -i 's/^nsc-ccs.*2604\/tcp.*$/ospfd 2604\/tcp # OSPFd vty, replacing nsc-ccs/g' /etc/services sed -i 's/^nsc-posa.*2605\/udp/#nsc-posa 2605\/udp/g' /etc/services sed -i 's/^nsc-posa.*2605\/tcp.*$/bgpd 2605\/tcp # BGPd vty, replacing nsc-posa/g' /etc/services sed -i 's/^netmon.*2606\/udp/#netmon 2606\/udp/g' /etc/services sed -i 's/^netmon.*2606\/tcp.*$/ospf6d 2606\/tcp # OSPF6d vty, replacing netmon/g' /etc/services sed -i 's/^connection.*2607\/udp/#connection 2607\/udp/g' /etc/services sed -i 's/^connection.*2607\/tcp.*$/ospfapi 2607\/tcp # ospfapi, replacing connection/g' /etc/services sed -i 's/^wag-service.*2608\/udp/#wag-service 2608\/udp/g' /etc/services sed -i 's/^wag-service.*2608\/tcp.*$/isisd 2608\/tcp # ISISd vty, replacing wag-service/g' /etc/services sed -i 's/^system-monitor.*2609\/udp/#system-monitor 2609\/udp/g' /etc/services sed -i 's/^system-monitor.*2609\/tcp.*$/babeld 2609\/tcp # BABELd vty, replacing system-monitor/g' /etc/services sed -i 's/^versa-tek.*2610\/udp/#versa-tek 2610\/udp/g' /etc/services sed -i 's/^versa-tek.*2610\/tcp.*$/nhrpd 2610\/tcp # nhrpd vty, replacing versa-tek/g' /etc/services sed -i 's/^lionhead.*2611\/udp/#lionhead 2611\/udp/g' /etc/services sed -i 's/^lionhead.*2611\/tcp.*$/pimd 2611\/tcp # PIMd vty, replacing lionhead/g' /etc/services sed -i 's/^qpasa-agent.*2612\/udp/#qpasa-agent 2612\/udp/g' /etc/services sed -i 's/^qpasa-agent.*2612\/tcp.*$/ldpd 2612\/tcp # LDPd vty, replacing qpasa-agent/g' /etc/services sed -i 's/^smntubootstrap.*2613\/udp/#smntubootstrap 2613\/udp/g' /etc/services sed -i 's/^smntubootstrap.*2613\/tcp.*$/eigprd 2613\/tcp # EIGRPd vty, replacing smntubootstrap/g' /etc/services sed -i 's/^cmadmin.*2617\/udp/#cmadmin 2617\/udp/g' /etc/services sed -i 's/^cmadmin.*2617\/tcp.*$/bfdd 2617\/tcp # bfdd vty, replacing cmadmin/g' /etc/services sed -i 's/^priority-e-com.*2618\/udp/#priority-e-com 2618\/udp/g' /etc/services sed -i 's/^priority-e-com.*2618\/tcp.*$/fabricd 2618\/tcp # fabricd vty, replacing priority-e-com/g' /etc/services fi fi EOF # Delete compilation work directory cd .. #rm -r -f $WRKDIR # Adjust directory access rigths find $TMPDIR/ -type d | xargs chmod -v 755; # Strip executables find $TMPDIR | xargs file | grep ELF | cut -f 1 -d : | xargs strip --strip-unneeded # Move files to doc extension mkdir -p $TMPDIR-doc/usr/local/share/man/man1 mkdir -p $TMPDIR-doc/usr/local/share/man/man8 mkdir -p $TMPDIR-doc/usr/local/share/info mv /tmp/frrouting/package/usr/local/share/man/man1/* $TMPDIR-doc/usr/local/share/man/man1 mv /tmp/frrouting/package/usr/local/share/man/man8/* $TMPDIR-doc/usr/local/share/man/man8 mv /tmp/frrouting/package/usr/local/share/info/* $TMPDIR-doc/usr/local/share/info ################################################### # Create info file # ################################################### cat < /tmp/frrouting/${EXTNAM}-doc.tcz.info Title: ${EXTNAM}-doc.tcz Description: ${DOCDESCRIPTION} Version: ${VERSION} Author: ${AUTHORS} Original-site: ${HOMEPAGE} Copying-policy: ${LICENSE} Size: ${size} Extension_by: ${ME} Tags: ${DOCTAGS} Comments: Frr is a routing software package that provides TCP/IP based routing services with routing protocols support such as RIPv1, RIPv2, RIPng, OSPFv2, OSPFv3, IS-IS, BGP-4, and BGP-4+. Frr also supports special BGP Route Reflector and Route Server behavior. In addition to traditional IPv4 routing protocols, Frr also supports IPv6 routing protocols. With SNMP daemon which supports SMUX and AgentX protocol, Frr provides routing protocol MIBs. Change-log: 2018/01/23 First Version, 3.0.3 2018/04/20 New major version, 4.0 2019/02/10 New major version, 5.0.2 2019/02/24 fixed script issues, watchfrr support, 5.0.2 ${TODAY} New major version, ${VERSION} Current: ${TODAY} New major version, ${VERSION} EOF mkdir -p $TMPDIR-dev/usr/local/lib/frr/modules mkdir -p $TMPDIR-dev/usr/local/include/frr mv /tmp/frrouting/package/usr/local/lib/lib*a* $TMPDIR-dev/usr/local/lib mv /tmp/frrouting/package/usr/local/lib/frr/modules/*.*a $TMPDIR-dev/usr/local/lib/frr/modules mv /tmp/frrouting/package/usr/local/include/frr/* $TMPDIR-dev/usr/local/include/frr/ ################################################### # Create info file # ################################################### cat < /tmp/frrouting/${EXTNAM}-dev.tcz.info Title: ${EXTNAM}-dev.tcz Description: ${DEVDESCRIPTION} Version: ${VERSION} Author: ${AUTHORS} Original-site: ${HOMEPAGE} Copying-policy: ${LICENSE} Size: ${size} Extension_by: ${ME} Tags: ${DEVTAGS} Comments: Frr is a routing software package that provides TCP/IP based routing services with routing protocols support such as RIPv1, RIPv2, RIPng, OSPFv2, OSPFv3, IS-IS, BGP-4, and BGP-4+. Frr also supports special BGP Route Reflector and Route Server behavior. In addition to traditional IPv4 routing protocols, Frr also supports IPv6 routing protocols. With SNMP daemon which supports SMUX and AgentX protocol, Frr provides routing protocol MIBs. Change-log: 2018/01/23 First Version, 3.0.3 ${TODAY} New major version, ${VERSION} 2018/04/20 New major version, 4.0 2019/02/10 New major version, 5.0.2 2019/02/24 fixed script issues, watchfrr support, 5.0.2 ${TODAY} New major version, ${VERSION} Current: ${TODAY} New major version, ${VERSION} EOF ################################################### # Create .dep file # ################################################### cat < /tmp/frrouting/${EXTNAM}-dev.tcz.dep ipv6-netfilter-KERNEL.tcz frr.tcz json-c-dev.tcz readline-dev.tcz libcares-dev.tcz EOF ################################################### # Create base extension in temp dir # ################################################### cd $TMPDIR find $TMPDIR -perm 777 -exec chmod 755 {} \; find $TMPDIR -perm 555 -exec chmod 755 {} \; find $TMPDIR -perm 444 -exec chmod 644 {} \; find $TMPDIR -perm 666 -exec chmod 644 {} \; find $TMPDIR -perm 664 -exec chmod 644 {} \; sudo chown -R root:root $TMPDIR sudo chown -R root:staff $TMPDIR/usr/local/tce.installed sudo chmod -R 775 $TMPDIR/usr/local/tce.installed #sudo chown tc:staff $TMPDIR/usr/local/var/frr sudo chown -R tc:staff $TMPDIR/usr/local/etc/frr cd .. mksquashfs $TMPDIR $EXTNAM.tcz cd $TMPDIR sudo sh -c "find usr -not -type d > $EXTNAM.tcz.list" sudo mv ../$EXTNAM.tcz . sudo mv /tmp/frrouting/${EXTNAM}.tcz.info . sudo mv /tmp/frrouting/${EXTNAM}.tcz.dep . # Create md5 file sudo sh -c "md5sum $EXTNAM.tcz > $EXTNAM.tcz.md5.txt" # Cleanup temp directory sudo rm -r -f usr ################################################### # Create doc extension in temp dir # ################################################### cd $TMPDIR-doc find $TMPDIR-doc -perm 777 -exec chmod 755 {} \; find $TMPDIR-doc -perm 555 -exec chmod 755 {} \; find $TMPDIR-doc -perm 444 -exec chmod 644 {} \; find $TMPDIR-doc -perm 666 -exec chmod 644 {} \; find $TMPDIR-doc -perm 664 -exec chmod 644 {} \; sudo chown -R root:root $TMPDIR-doc cd .. mksquashfs $TMPDIR-doc $EXTNAM-doc.tcz cd $TMPDIR-doc sudo sh -c "find usr -not -type d > $EXTNAM-doc.tcz.list" sudo mv ../$EXTNAM-doc.tcz . sudo mv /tmp/frrouting/${EXTNAM}-doc.tcz.info . # Create md5 file sudo sh -c "md5sum $EXTNAM-doc.tcz > $EXTNAM-doc.tcz.md5.txt" # Cleanup temp directory sudo rm -r -f usr ################################################### # Create dev extension in temp dir # ################################################### cd $TMPDIR-dev find $TMPDIR-dev -perm 777 -exec chmod 755 {} \; find $TMPDIR-dev -perm 555 -exec chmod 755 {} \; find $TMPDIR-dev -perm 444 -exec chmod 644 {} \; find $TMPDIR-dev -perm 666 -exec chmod 644 {} \; find $TMPDIR-dev -perm 664 -exec chmod 644 {} \; sudo chown -R root:root $TMPDIR-dev cd .. mksquashfs $TMPDIR-dev $EXTNAM-dev.tcz cd $TMPDIR-dev sudo sh -c "find usr -not -type d > $EXTNAM-dev.tcz.list" sudo mv ../$EXTNAM-dev.tcz . sudo mv /tmp/frrouting/${EXTNAM}-dev.tcz.info . sudo mv /tmp/frrouting/${EXTNAM}-dev.tcz.dep . # Create md5 file sudo sh -c "md5sum $EXTNAM-dev.tcz > $EXTNAM-dev.tcz.md5.txt" # Cleanup temp directory sudo rm -r -f usr