# Script begin
#
if [ ! -f .sync_source -o $SYNC_SOURCE -ne 0 ]; then
- log_info "Syncing FRR source with host..."
- mkdir -p $FRR_BUILD_DIR >/dev/null 2>&1
- rsync -a --info=progress2 --chown root:root $FRR_DIR/. $FRR_BUILD_DIR/
- touch .sync_source
+ log_info "Syncing FRR source with host..."
+ mkdir -p $FRR_BUILD_DIR >/dev/null 2>&1
+ rsync -a --info=progress2 --chown root:root $FRR_DIR/. $FRR_BUILD_DIR/
+ touch .sync_source
fi
log_info "Building FRR..."
cd $FRR_BUILD_DIR || \
- log_fatal "failed to find frr directory"
+ log_fatal "failed to find frr directory"
if [ $CLEAN -ne 0 ]; then
- make distclean >/dev/null 2>&1
- rm -f Makefile configure
+ make distclean >/dev/null 2>&1
+ rm -f Makefile configure
fi
if [ ! -f configure ]; then
- bash bootstrap.sh || \
- log_fatal "failed to bootstrap configuration"
+ bash bootstrap.sh || \
+ log_fatal "failed to bootstrap configuration"
fi
if [ $DOC -ne 0 ]; then
- EXTRA_CONFIGURE+=" --enable-doc "
+ EXTRA_CONFIGURE+=" --enable-doc "
else
- EXTRA_CONFIGURE+=" --disable-doc "
+ EXTRA_CONFIGURE+=" --disable-doc "
fi
if [ ! -f Makefile ]; then
- if [ $SANITIZER -ne 0 ]; then
- export CC="gcc"
- export CFLAGS="-O1 -g -fsanitize=address -fno-omit-frame-pointer"
- export LD="gcc"
- export LDFLAGS="-g -fsanitize=address -ldl"
- EXTRA_CONFIGURE+=" --enable-shared=no "
- touch .address_sanitizer
- else
- rm -f .address_sanitizer
- fi
+ if [ $SANITIZER -ne 0 ]; then
+ export CC="gcc"
+ export CFLAGS="-O1 -g -fsanitize=address -fno-omit-frame-pointer"
+ export LD="gcc"
+ export LDFLAGS="-g -fsanitize=address -ldl"
+ EXTRA_CONFIGURE+=" --enable-shared=no "
+ touch .address_sanitizer
+ else
+ rm -f .address_sanitizer
+ fi
- bash configure >/dev/null \
- --enable-multipath=64 \
- --prefix=/usr \
- --localstatedir=/var/run/frr \
- --sbindir=/usr/lib/frr \
- --sysconfdir=/etc/frr \
- $EXTRA_CONFIGURE \
- --with-pkg-extra-version=-topotests \
- || log_fatal "failed to configure the sources"
+ bash configure >/dev/null \
+ --enable-multipath=64 \
+ --prefix=/usr \
+ --localstatedir=/var/run/frr \
+ --sbindir=/usr/lib/frr \
+ --sysconfdir=/etc/frr \
+ $EXTRA_CONFIGURE \
+ --with-pkg-extra-version=-topotests \
+ || log_fatal "failed to configure the sources"
fi
# if '.address_sanitizer' file exists it means we are using address sanitizer.
if [ -f .address_sanitizer ]; then
- make -C lib CFLAGS="-g -O2" LDFLAGS="-g" clippy
+ make -C lib CFLAGS="-g -O2" LDFLAGS="-g" clippy
fi
if [ $VERBOSE -ne 0 ]; then
- make -j$(cpu_count) || \
- log_fatal "failed to build the sources"
+ make -j$(cpu_count) || \
+ log_fatal "failed to build the sources"
else
- make -j$(cpu_count) >/dev/null || \
- log_fatal "failed to build the sources"
+ make -j$(cpu_count) >/dev/null || \
+ log_fatal "failed to build the sources"
fi
make install >/dev/null || \
- log_fatal "failed to install frr"
+ log_fatal "failed to install frr"
exit 0
# Configure OpenvSwitch so we are able to run mininet
mkdir -p /var/run/openvswitch
ovsdb-tool create /etc/openvswitch/conf.db \
- /usr/share/openvswitch/vswitch.ovsschema
+ /usr/share/openvswitch/vswitch.ovsschema
ovsdb-server /etc/openvswitch/conf.db \
- --remote=punix:/var/run/openvswitch/db.sock \
- --remote=ptcp:6640 --pidfile=ovsdb-server.pid >/dev/null 2>/dev/null & \
- disown
+ --remote=punix:/var/run/openvswitch/db.sock \
+ --remote=ptcp:6640 --pidfile=ovsdb-server.pid >/dev/null 2>/dev/null & \
+ disown
ovs-vswitchd >/dev/null 2>/dev/null & disown
sleep 2
ovs-vsctl --no-wait -- init
ovs_version=$(ovs-vsctl -V | grep ovs-vsctl | awk '{print $4}')
ovs_db_version=$(\
- ovsdb-tool schema-version /usr/share/openvswitch/vswitch.ovsschema)
+ ovsdb-tool schema-version /usr/share/openvswitch/vswitch.ovsschema)
ovs-vsctl --no-wait -- set Open_vSwitch . db-version="${ovs_db_version}"
ovs-vsctl --no-wait -- set Open_vSwitch . ovs-version="${ovs_version}"
ovs-vsctl --no-wait -- set Open_vSwitch . system-type="docker-ovs"
ovs-vsctl --no-wait -- set Open_vSwitch . system-version="0.1"
ovs-vsctl --no-wait -- \
- set Open_vSwitch . external-ids:system-id=`cat /proc/sys/kernel/random/uuid`
+ set Open_vSwitch . external-ids:system-id=`cat /proc/sys/kernel/random/uuid`
ovs-vsctl --no-wait -- set-manager ptcp:6640
ovs-appctl -t ovsdb-server \
- ovsdb-server/add-remote db:Open_vSwitch,Open_vSwitch,manager_options
+ ovsdb-server/add-remote db:Open_vSwitch,Open_vSwitch,manager_options
# Build FRR
env \
- CLEAN=1 \
- VERBOSE=0 \
- bash /opt/topotests/compile_frr.sh
+ CLEAN=1 \
+ VERBOSE=0 \
+ bash /opt/topotests/compile_frr.sh
log_info "Setting permissions on /tmp so we can generate logs"
chmod -v 1777 /tmp