Skip to content

Commit

Permalink
Added FRR template, modified patches for vyos to correctly patch root…
Browse files Browse the repository at this point in the history
…fs files
  • Loading branch information
ngardiner committed May 1, 2017
1 parent 3d0468d commit 8081d2b
Show file tree
Hide file tree
Showing 9 changed files with 163 additions and 8 deletions.
6 changes: 6 additions & 0 deletions frr/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
config
custom
info
logfile
rootfs
ubuntu-16.04-frr_16.04-1_amd64.tar.gz
43 changes: 43 additions & 0 deletions frr/Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@

BASEDIR:=$(shell dab basedir)
include ../Makefile.global

.PHONY: bootstrap global finalize
all: info/init_ok bootstrap global finalize

bootstrap:
dab bootstrap

# These are known packaged dependancies
dab install autoconf automake libtool make gawk libreadline-dev git
dab install texinfo dejagnu pkg-config libpam0g-dev libjson-c-dev bison
dab install python-pytest libc-ares-dev python3-dev

# See custom.sh for build and configuration scripts for frr

install -m 0700 runonce.sh ${BASEDIR}/etc/init.d/firstboot
dab exec update-rc.d firstboot defaults
install -m 0700 custom.sh ${BASEDIR}/tmp
dab exec /bin/bash /tmp/custom.sh
dab exec rm -f /tmp/custom.sh

finalize:
dab finalize

info/init_ok: dab.conf
dab init
touch $@

.PHONY: template
template:
cp ubuntu-16.04-frr_16.04-1_amd64.tar.gz /var/lib/vz/template/cache

.PHONY: clean
clean:
dab clean
rm -f *~

.PHONY: dist-clean
dist-clean:
dab dist-clean
rm -f *~
29 changes: 29 additions & 0 deletions frr/custom.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
#!/bin/bash

cd /usr/src
git clone https://github.com/frrouting/frr.git frr

cd frr
./bootstrap.sh
./configure \
--prefix=/usr \
--enable-exampledir=/usr/share/doc/frr/examples/ \
--localstatedir=/var/run/frr \
--sbindir=/usr/lib/frr \
--sysconfdir=/etc/frr \
--enable-pimd \
--enable-watchfrr \
--enable-ospfclient=yes \
--enable-ospfapi=yes \
--enable-multipath=64 \
--enable-user=frr \
--enable-group=frr \
--enable-vty-group=frrvty \
--enable-configfile-mask=0640 \
--enable-logfile-mask=0640 \
--enable-rtadv \
--enable-tcp-zebra \
--enable-fpm \
--with-pkg-git-version

exit 0
15 changes: 15 additions & 0 deletions frr/dab.conf
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
Suite: xenial
CacheDir: ../cache
Source: http://archive.ubuntu.com/ubuntu SUITE main restricted universe multiverse
Source: http://archive.ubuntu.com/ubuntu SUITE-updates main restricted universe multiverse
Source: http://archive.ubuntu.com/ubuntu SUITE-security main restricted universe multiverse
Architecture: amd64
Name: frr
Version: 16.04-1
Section: system
Maintainer: Nathan Gardiner <[email protected]>
Infopage: https://github.com/FRRouting/frr
Description: Free-Range Routing (FRR)
FRRouting is free software that manages various IPv4 and IPv6 routing
protocols.
Currently FRRouting supports BGP4, BGP4+, OSPFv2, OSPFv3, RIPv1, RIPv2, RIPng, PIM-SM/MSDP and LDP as well as very early support for IS-IS.
44 changes: 44 additions & 0 deletions frr/runonce.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
#!/bin/bash
### BEGIN INIT INFO
# Provides: firstboot
# Required-Start: $local_fs
# Required-Stop:
# Should-Start: $network $portmap nfs-common udev-mtab
# Default-Start: S
# Default-Stop:
# Short-Description: First-boot system customization routines
# Description: Provides first-boot system customization for
# proxmox container templates.
# Removes itself entirely when done.
### END INIT INFO

case "$1" in
start)

# Put first boot routines here

# Create FRR user/group
groupadd -g 92 frr
groupadd -r -g 85 frrvty
adduser --system --ingroup frr --home /var/run/frr/ --gecos "FRR suite" --shell /sbin/nologin frr
usermod -a -G frrvty frr

# Once the script has completed execution, delete ourselves
update-rc.d firstboot disable
rm $0
;;
stop)
echo "Not Implemented"
;;
status)
echo "Not Implemented"
;;
restart|force-reload)
echo "Not Implemented"
;;
*)
echo "Usage: /etc/init.d/$NAME {start}" >&2
exit 1
;;
esac

15 changes: 15 additions & 0 deletions vyos/.gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,26 @@ info
logfile
rootfs
ubuntu-16.04-vyos_16.04-1_amd64.tar.gz
conntrack-tools/
igmpproxy/
ipset/
iptables/
libcap/
libmnl/
pmacct/
ppp/
vyatta-bash/
vyatta-biosdevname/
vyatta-busybox/
vyatta-cfg/
vyatta-cfg-quagga/
vyatta-iproute/
vyatta-openvpn/
vyatta-quagga/
vyatta-util/
vyatta-vrrp/
vyatta-webgui/
vyatta-webproxy/
vyatta-zone/
vyos-nhrp/
vyos-opennhrp/
11 changes: 7 additions & 4 deletions vyos/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ GC=git clone https://github.com/vyos/
IP=igmpproxy
IR=vyatta-iproute
IS=ipset
ISC=./configure --with-ksource=/usr --with-kbuild=/usr/src/build
PA=pmacct
PC=libcap
PP=ppp
Expand Down Expand Up @@ -48,7 +49,7 @@ bootstrap:
dab install libnfnetlink-dev libmnl-dev libnetfilter-conntrack-dev
dab install libnetfilter-cttimeout-dev libnetfilter-cthelper0-dev
dab install libboost-filesystem-dev libglib2.0-dev libc-ares-dev
dab install libnetfilter-queue-dev libdb-dev
dab install libnetfilter-queue-dev libdb-dev linux-headers-generic

# Clone git repos from vyos
$(GC)$(BA) -b $(RELEASE)
Expand Down Expand Up @@ -101,7 +102,7 @@ bootstrap:
rsync -a $(WP) ${BASEDIR}/tmp/

# Apply patches prior to compile
cat patch/* | patch -p0
cat patch/* | patch -fp0

# Build Vyatta bash
$(DE) "$(CD)$(BA) && ./configure > /tmp/$(BA).configure.log 2>&1"
Expand All @@ -125,7 +126,7 @@ bootstrap:
$(DE) "$(CD)$(CF) && $(AM) > /tmp/$(CF).automake.log 2>&1"
$(DE) "$(CD)$(CF) && autoconf > /tmp/$(CF).autoconf.log 2>&1"
$(DE) "$(CD)$(CF) && ./configure > /tmp/$(CF).configure.log 2>&1"
cp rootfs/usr/lib/x86_64-linux-gnu/glib-2.0/include/glibconfig.h rootfs/usr/include/glibconfig.h
cp ${BASEDIR}/usr/lib/x86_64-linux-gnu/glib-2.0/include/glibconfig.h ${BASEDIR}/usr/include/glibconfig.h
-$(DE) "$(CD)$(CF) && make > /tmp/$(CF).make.log 2>&1"
-$(DE) "$(CD)$(CF) && make install > /tmp/$(CF).makeinstall.log 2>&1"

Expand Down Expand Up @@ -212,7 +213,9 @@ bootstrap:
$(DE) "$(CD)$(IS) && $(AR) > /tmp/$(IS).autoreconf.log 2>&1"
$(DE) "$(CD)$(IS) && $(AM) > /tmp/$(IS).automake.log 2>&1"
$(DE) "$(CD)$(IS) && autoconf > /tmp/$(IS).autoconf.log 2>&1"
$(DE) "$(CD)$(IS) && ./configure > /tmp/$(IS).configure.log 2>&1"
mkdir -p ${BASEDIR}/usr/src/build
touch ${BASEDIR}/usr/src/build/.config
$(DE) "$(CD)$(IS) && $(ISC) > /tmp/$(IS).configure.log 2>&1"
$(DE) "$(CD)$(IS) && make > /tmp/$(IS).make.log 2>&1"
$(DE) "$(CD)$(IS) && make install > /tmp/$(IS).makeinstall.log 2>&1"

Expand Down
4 changes: 2 additions & 2 deletions vyos/patch/conntrack-tools.patch
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
--- conntrack-tools/src/parse.c.orig 2017-04-30 21:16:12.608493642 +1000
+++ conntrack-tools/src/parse.c 2017-04-30 21:16:24.520604432 +1000
--- rootfs/tmp/conntrack-tools/src/parse.c.orig 2017-04-30 21:16:12.608493642 +1000
+++ rootfs/tmp/conntrack-tools/src/parse.c 2017-04-30 21:16:24.520604432 +1000
@@ -18,6 +18,7 @@
*/

Expand Down
4 changes: 2 additions & 2 deletions vyos/patch/vyatta-busybox.patch
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
--- vyatta-busybox/include/libbb.h.orig 2017-04-30 21:30:09.708787259 +1000
+++ vyatta-busybox/include/libbb.h 2017-04-30 21:30:52.629228527 +1000
--- rootfs/tmp/vyatta-busybox/include/libbb.h.orig 2017-04-30 21:30:09.708787259 +1000
+++ rootfs/tmp/vyatta-busybox/include/libbb.h 2017-04-30 21:30:52.629228527 +1000
@@ -29,6 +29,7 @@
#include <sys/poll.h>
#include <sys/ioctl.h>
Expand Down

0 comments on commit 8081d2b

Please sign in to comment.