#!/bin/sh # ###################################################### # Build script for Core 9.0 # # # # See .info for details # ###################################################### ###################################################### # Configure extension creation parameters # ###################################################### export EXTNAM=frr VERSION="4.0" 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 # Other tce-load -wi ipv6-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="-O2 -pipe -march=i486 -mtune=i686" export CXXFLAGS="-O2 -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 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/sbin/* $TMPDIR/usr/local/sbin ################################################## # daemons file # ################################################## mv /tmp/frrouting/frr-frr-4.0/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\/lib\/frr\/frr_restart_%s")' $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.01 --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 ################################################## # init file # ################################################## #mv /tmp/frrouting/frr-frr-4.0/tools/frr-reload.py $TMPDIR/usr/local/sbin/ #mv /tmp/frrouting/frr-frr-4.0/tools/frr-reload $TMPDIR/usr/local/sbin/ #mv /tmp/frrouting/frr-frr-4.0/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 '/^\. \/lib\/lsb\/init-functions$/d' $TMPDIR/usr/local/etc/init.d/frr sed -i 's/\[ -f \/usr\/lib\/frr\/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 '133i \ pidfile=`pidfile \$1-\$2`' $TMPDIR/usr/local/etc/init.d/frr sed -i '134i \ pidfile=\${pidfile\/\/\\\/\/\\\\\/}' $TMPDIR/usr/local/etc/init.d/frr sed -i '135i \ daemon_options=`eval echo "\$""\$1""_options"`' $TMPDIR/usr/local/etc/init.d/frr sed -i "136i \ 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 "\$""\$1""_options"`\(.*$\)/\ \$daemon_options \1 \&/g' $TMPDIR/usr/local/etc/init.d/frr sed -i '150i \ pidfile=`pidfile \$1`' $TMPDIR/usr/local/etc/init.d/frr sed -i '151i \ pidfile=\${pidfile\/\/\\\/\/\\\\\/}' $TMPDIR/usr/local/etc/init.d/frr sed -i '152i \ daemon_options=`eval echo "\$""\$1""_options"`' $TMPDIR/usr/local/etc/init.d/frr sed -i "153i \ 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\/\$1" \\\)/\1\2\n\1--quiet \\/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 '/echo "Loading capability module if not yet done."/d' $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\]/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 '/### \(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/2018-04-20: Adapted Debian frr script for Frr 4.0, to work with TCL./g' $TMPDIR/usr/local/etc/init.d/frr ################################################### # 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-4.x.x-tinycore.tcz via the Apps GUI, or cli (tce-load -wi ipv6-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" . Change-log: 2018/01/23 First Version, 3.0.3 2018/02/25 adapted frr script to work with TCL, 3.0.3 ${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} sudo -u tc mkdir /var/frr if [ -r /usr/local/etc/frr/daemons ]; then echo "Verify if /usr/local/etc/frr/daemons requires changes." echo "See /usr/local/bin/etc/frr/daemons.sample for the example." else sudo -u tc cp /usr/local/etc/frr/daemons.sample /usr/local/etc/frr/daemons 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 ${TODAY} New major version, ${VERSION} Current: ${TODAY} New major version, ${VERSION} EOF mkdir -p $TMPDIR-dev/usr/local/lib 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/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} Current: ${TODAY} New major version, ${VERSION} EOF ################################################### # Create .dep file # ################################################### cat < /tmp/frrouting/${EXTNAM}-dev.tcz.dep ipv6-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