summaryrefslogtreecommitdiff
path: root/scripts
diff options
context:
space:
mode:
authorChristian Poessinger <christian@poessinger.com>2019-01-06 17:52:52 +0100
committerChristian Poessinger <christian@poessinger.com>2019-01-06 17:52:52 +0100
commit88c8b3440bd4e4a31ca86cd5d6e8d23bbc0684e7 (patch)
treeaf5ffc81821fc80d963e5fe58a89141518c5da61 /scripts
parent21becfd719541206c22be2459dd10448172d6c37 (diff)
downloadvyos-build-88c8b3440bd4e4a31ca86cd5d6e8d23bbc0684e7.tar.gz
vyos-build-88c8b3440bd4e4a31ca86cd5d6e8d23bbc0684e7.zip
CI/CD: add verbose output option to for 'build-submodules' script
Diffstat (limited to 'scripts')
-rwxr-xr-xscripts/build-submodules27
1 files changed, 19 insertions, 8 deletions
diff --git a/scripts/build-submodules b/scripts/build-submodules
index 3a7ea3a5..ae9d131c 100755
--- a/scripts/build-submodules
+++ b/scripts/build-submodules
@@ -5,7 +5,6 @@ if [ ! -d "packages" ]; then
exit 1
fi
-
print_help() {
echo "Script for building all subpackages to vyos"
echo "Execute this sctipt from the root of the vyos-build directory"
@@ -20,6 +19,7 @@ print_help() {
echo ""
echo "Parameters:"
echo " --init-packages - Initiate all subpackages before building"
+ echo " --verbose|-v - Enable verbose output"
}
while test $# -gt 0
@@ -32,6 +32,9 @@ do
--init-packages)
INIT_PACKAGES=1
;;
+ --verbose|-v)
+ VERBOSE=1
+ ;;
*)
(>&2 echo "Error: Argument $1 is not valid")
echo ""
@@ -42,24 +45,23 @@ do
shift
done
-
status_start() {
-echo -ne "[ ] $1"
+ echo -ne "[ ] $1"
}
status_ok() {
-echo -ne "\r[\e[32m OK \e[39m]\n"
+ echo -ne "\r[\e[32m OK \e[39m]\n"
}
status_fail() {
-echo -ne "\r[\e[31mFAIL\e[39m]\n"
+ echo -ne "\r[\e[31mFAIL\e[39m]\n"
}
status_skip() {
-echo -ne "\r[SKIP] $1\n"
+ echo -ne "\r[SKIP] $1\n"
}
error_msg() {
-echo -ne " $1\n"
+ echo -ne " $1\n"
}
ROOTDIR="$(pwd)"
PKGDIR="$(pwd)/packages"
@@ -170,9 +172,13 @@ build_kernel() {
)
if [ $? -ne 0 ]; then
status_fail
+ if [ $VERBOSE ]; then
+ cat $PKGDIR/vyos-kernel.buildlog
+ fi
error_msg "Failed to build package vyos-kernel, look in vyos-kernel.buildlog to examine the fault\n"
return 1
fi
+
VERSION=$(grep "^VERSION" Makefile | grep -Eo '[0-9]{1,4}')
PATCHLEVEL=$(grep "^PATCHLEVEL" Makefile | grep -Eo '[0-9]{1,4}')
SUBLEVEL=$(grep "^SUBLEVEL" Makefile | grep -Eo '[0-9]{1,4}')
@@ -216,6 +222,9 @@ build_wireguard() {
)
if [ $? -ne 0 ]; then
status_fail
+ if [ $VERBOSE ]; then
+ cat $PKGDIR/vyos-wireguard.buildlog
+ fi
error_msg "Failed to build package vyos-wireguard, look in vyos-wireguard.buildlog to examine the fault\n"
return 2
fi
@@ -249,13 +258,15 @@ build_accel-ppp() {
( set -e
pushd packages/vyos-accel-ppp > /dev/null
- #echo "src/wireguard.ko /lib/modules/$VERSION.$PATCHLEVEL.$SUBLEVEL-$ARCH-vyos/extra" > debian/wireguard-modules.install
echo "lib/modules/$VERSION.$PATCHLEVEL.$SUBLEVEL-$ARCH-vyos/extra/*.ko" > debian/vyos-accel-ppp-ipoe-kmod.install
sed -i "s#[0-9].[0-9][0-9].[0-9]-amd64-vyos#$VERSION.$PATCHLEVEL.$SUBLEVEL-$ARCH-vyos#g" debian/rules
KERNELDIR=$PKGDIR/vyos-kernel dpkg-buildpackage -uc -us -tc -b >$PKGDIR/vyos-accel-ppp.buildlog 2>&1
)
if [ $? -ne 0 ]; then
status_fail
+ if [ $VERBOSE ]; then
+ cat $PKGDIR/vyos-accel-ppp.buildlog
+ fi
error_msg "Failed to build package vyos-accel-ppp, look in vyos-accel-ppp.buildlog to examine the fault\n"
return 1
fi