summaryrefslogtreecommitdiff
path: root/scripts
diff options
context:
space:
mode:
authorRunar Borge <runar@borge.nu>2018-12-26 00:19:18 +0100
committerRunar Borge <runar@borge.nu>2018-12-26 00:19:18 +0100
commit90ec7b2e2558dce37fecdc115bc3aa52236c132b (patch)
treefcc5affb3568a50501b581860b24b778cd7406c2 /scripts
parent53b5c34b5b5e994c3f8c5c94e939f98fa5329167 (diff)
downloadvyos-build-90ec7b2e2558dce37fecdc115bc3aa52236c132b.tar.gz
vyos-build-90ec7b2e2558dce37fecdc115bc3aa52236c132b.zip
Added compilation of the kernel and wireguard submodule.
Also refactored some UI code for easyer reading
Diffstat (limited to 'scripts')
-rwxr-xr-xscripts/build-docker-subpackages76
1 files changed, 71 insertions, 5 deletions
diff --git a/scripts/build-docker-subpackages b/scripts/build-docker-subpackages
index 148e5a56..f3aa2e6d 100755
--- a/scripts/build-docker-subpackages
+++ b/scripts/build-docker-subpackages
@@ -5,11 +5,31 @@ if [ ! -d "packages" ]; then
exit 1
fi
+status_start() {
+echo -ne "[ ] $1"
+}
+status_ok() {
+echo -ne "\r[\e[32m OK \e[39m]\n"
+}
+
+status_fail() {
+echo -ne "\r[\e[31mFAIL\e[39m]\n"
+}
+
+status_skip() {
+echo -ne "\r[SKIP] $1\n"
+}
+
+error_msg() {
+echo -ne " $1\n"
+}
+
echo "Cleaning up buildfiles..."
rm -rf packages/*.deb
rm -rf packages/*.changes
echo "-----------------------------------------------------"
-
+echo "Starting build process for all packages"
+echo ""
for PKG in mdns-repeater \
pmacct \
udp-broadcast-relay \
@@ -53,13 +73,59 @@ for PKG in mdns-repeater \
vyos-strongswan \
vyos-world \
; do
+ break;
if [ -d "packages/$PKG/debian" ]; then
- echo "Building package: $PKG"
- docker run --rm -it -v $(pwd):/vyos -w /vyos/packages/$PKG --sysctl net.ipv6.conf.lo.disable_ipv6=0 vyos-builder dpkg-buildpackage -uc -us -tc -b >packages/$PKG.buildlog 2>&1
+ status_start "Building package: $PKG"
+ docker run --rm -it -v $(pwd):/vyos -w /vyos/packages/$PKG \
+ --sysctl net.ipv6.conf.lo.disable_ipv6=0 \
+ vyos-builder \
+ dpkg-buildpackage -uc -us -tc -b >packages/$PKG.buildlog 2>&1
if [ $? -ne 0 ]; then
- echo "FAILED to build package $PKG, look in $PKG.buildlog to examine the fault"
+ status_fail
+ error_msg "Failed to build package $PKG, look in $PKG.buildlog to examine the fault\n"
+ else
+ status_ok
fi
else
- echo "Did not find source for: $PKG"
+ status_skip "No source for: $PKG"
fi
done
+
+# KERNEL
+if [ -f "packages/vyos-kernel/Makefile" ]; then
+ status_start "Building-package: vyos-kernel"
+ docker run --rm -it -v $(pwd):/vyos -w /vyos/packages/vyos-kernel \
+ --sysctl net.ipv6.conf.lo.disable_ipv6=0 \
+ vyos-builder \
+ bash -c '../../scripts/build-kernel' >packages/vyos-kernel.buildlog 2>&1
+ if [ $? -ne 0 ]; then
+ status_fail
+ error_msg "Failed to build package vyos-kernel, look in vyos-kernel.buildlog to examine the fault\n"
+ else
+ status_ok
+ fi
+else
+ status_skip "No source for: vyos-kernel"
+fi
+
+# WIREGUARD
+if [ -d "packages/vyos-wireguard/debian" ]; then
+ status_start "Building package: vyos-wireguard"
+ if [ -f "packages/vyos-kernel/Makefile" ]; then
+ docker run --rm -it -v $(pwd):/vyos -w /vyos/packages/vyos-wireguard \
+ --sysctl net.ipv6.conf.lo.disable_ipv6=0 \
+ vyos-builder \
+ bash -c 'KERNELDIR=/vyos/packages/vyos-kernel dpkg-buildpackage -uc -us -tc -b' >packages/vyos-wireguard.buildlog 2>&1
+ if [ $? -ne 0 ]; then
+ status_fail
+ error_msg "Failed to build package vyos-wireguard, look in vyos-wireguard.buildlog to examine the fault\n"
+ else
+ status_ok
+ fi
+ else
+ status_fail
+ error_msg "Failed to build package vyos-wireguard, no kernel source found\n"
+ fi
+else
+ status_skip "No source for: vyos-wireguard"
+fi