From fec537aab749769a3fd83bf919cc54b35e611c0c Mon Sep 17 00:00:00 2001 From: Christian Poessinger Date: Sun, 25 Nov 2018 13:28:02 +0100 Subject: T1042: Update Linux Kernel from 4.19 to 4.19.4 --- scripts/live-build-config | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'scripts') diff --git a/scripts/live-build-config b/scripts/live-build-config index 8c843bcb..2fc87d45 100755 --- a/scripts/live-build-config +++ b/scripts/live-build-config @@ -37,7 +37,7 @@ lb config noauto \ --architectures {{architecture}} \ --bootappend-live "boot=live components hostname=vyos username=live nopersistence noautologin nonetworking union=overlay" \ --linux-flavours {{architecture}}-vyos \ - --linux-packages linux-image-4.19.0 \ + --linux-packages linux-image-4.19.4 \ --bootloader syslinux,grub-efi \ --binary-images iso-hybrid \ --debian-installer false \ -- cgit v1.2.3 From efaec8e4546a0e105ba717cd72cbed00e7b6202d Mon Sep 17 00:00:00 2001 From: Kim Hagen Date: Sun, 16 Dec 2018 20:30:52 +0100 Subject: add rootdelay=300 to kernel command --- scripts/build-azure-image | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'scripts') diff --git a/scripts/build-azure-image b/scripts/build-azure-image index d47b4351..b31c9fce 100755 --- a/scripts/build-azure-image +++ b/scripts/build-azure-image @@ -127,12 +127,12 @@ set timeout=5 set default=0 menuentry "VyOS $version (Serial console)" { - linux /boot/"$version"/vmlinuz boot=live quiet vyos-union=/boot/"$version" console=tty0 console=ttyS0,115200n8 earlyprintk=ttyS0,115200 consoleblank=0 systemd.show_status=true + linux /boot/"$version"/vmlinuz boot=live quiet vyos-union=/boot/"$version" console=tty0 console=ttyS0,115200n8 earlyprintk=ttyS0,115200 rootdelay=300 consoleblank=0 systemd.show_status=true initrd /boot/"$version"/initrd.img } menuentry "Lost password change $version (Serial console)" { - linux /boot/"$version"/vmlinuz boot=live quiet vyos-union=/boot/"$version" console=tty0 console=ttyS0,115200n8 earlyprintk=ttyS0,115200 consoleblank=0 systemd.show_status=true init=/opt/vyatta/sbin/standalone_root_pw_reset + linux /boot/"$version"/vmlinuz boot=live quiet vyos-union=/boot/"$version" console=tty0 console=ttyS0,115200n8 earlyprintk=ttyS0,115200 rootdelay=300 consoleblank=0 systemd.show_status=true init=/opt/vyatta/sbin/standalone_root_pw_reset initrd /boot/"$version"/initrd.img } EOF -- cgit v1.2.3 From 618e31b565ee4bee247c69c28710ab37c1f92c8a Mon Sep 17 00:00:00 2001 From: Kim Hagen Date: Mon, 17 Dec 2018 21:03:39 +0100 Subject: Revert "add rootdelay=300 to kernel command" This reverts commit 6cec49aa7c8d9b6aaa041b93b30ca9b260a843b5. --- scripts/build-azure-image | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'scripts') diff --git a/scripts/build-azure-image b/scripts/build-azure-image index b31c9fce..d47b4351 100755 --- a/scripts/build-azure-image +++ b/scripts/build-azure-image @@ -127,12 +127,12 @@ set timeout=5 set default=0 menuentry "VyOS $version (Serial console)" { - linux /boot/"$version"/vmlinuz boot=live quiet vyos-union=/boot/"$version" console=tty0 console=ttyS0,115200n8 earlyprintk=ttyS0,115200 rootdelay=300 consoleblank=0 systemd.show_status=true + linux /boot/"$version"/vmlinuz boot=live quiet vyos-union=/boot/"$version" console=tty0 console=ttyS0,115200n8 earlyprintk=ttyS0,115200 consoleblank=0 systemd.show_status=true initrd /boot/"$version"/initrd.img } menuentry "Lost password change $version (Serial console)" { - linux /boot/"$version"/vmlinuz boot=live quiet vyos-union=/boot/"$version" console=tty0 console=ttyS0,115200n8 earlyprintk=ttyS0,115200 rootdelay=300 consoleblank=0 systemd.show_status=true init=/opt/vyatta/sbin/standalone_root_pw_reset + linux /boot/"$version"/vmlinuz boot=live quiet vyos-union=/boot/"$version" console=tty0 console=ttyS0,115200n8 earlyprintk=ttyS0,115200 consoleblank=0 systemd.show_status=true init=/opt/vyatta/sbin/standalone_root_pw_reset initrd /boot/"$version"/initrd.img } EOF -- cgit v1.2.3 From de19301f236df04e461efcdf6158ada020eeb1e3 Mon Sep 17 00:00:00 2001 From: Runar Borge Date: Mon, 24 Dec 2018 00:06:08 +0100 Subject: Added script and instructions for building most packages from source. Using the vyos-builder docker container. Also added examples on doing builds. --- Dockerfile | 23 ++++++++++++++ README.md | 52 +++++++++++++++++++++++++------ scripts/build-docker-subpackages | 66 ++++++++++++++++++++++++++++++++++++++++ 3 files changed, 132 insertions(+), 9 deletions(-) create mode 100755 scripts/build-docker-subpackages (limited to 'scripts') diff --git a/Dockerfile b/Dockerfile index 17864402..b862cda4 100644 --- a/Dockerfile +++ b/Dockerfile @@ -65,6 +65,29 @@ RUN apt-get install -y -t jessie-backports \ libxml2-dev \ pkg-config +# Package needed for mdns-repeater +RUN apt-get install -y -t jessie-backports \ + dh-systemd + +# Packages needed for vyatta-bash +RUN apt-get install -y \ + libncurses5-dev \ + locales + +# Packages needed for vyatta-cfg +RUN apt-get install -y \ + libboost-filesystem-dev + +# Packages needed for vyatta-iproute +RUN apt-get install -y \ + libatm1-dev \ + libdb-dev + +# Packages needed for vyatta-webgui +RUN apt-get install -y \ + libexpat1-dev \ + subversion + # Update live-build RUN echo 'deb http://ftp.debian.org/debian stretch main' | tee -a /etc/apt/sources.list.d/stretch.list &&\ apt-get update &&\ diff --git a/README.md b/README.md index 8388015b..405b1b2a 100644 --- a/README.md +++ b/README.md @@ -154,19 +154,53 @@ inside the container and follow up the bellow instructions in order to build the VyOS ISO image ## Building subpackages inside Docker -### Strongswan +Prior to building packages you need to checkout and update the submodules you want to compile +```bash +git submodule update --init packages/PACKAGENAME +cd packages/PACKAGENAME +git checkout BRANCH +``` +`PACKAGENAME` is the name of the package you want to compile +`BRANCH` is for Crux(1.2) `crux`, for latest rolling use `current` -Prior to executing this you need to checkout and update the packages/vyos-strongswan submodule -Building the strongswan package is for now only doable on a Linux system because tests fail when running on windows and OSX systems -`/HOST_PATH/` is the path to your vyos_build directory. if youre in the vyos-build directory it can me replaced with `$(pwd)` -`--sysctl net.ipv6.conf.lo.disable_ipv6=0` is needed to enable ipv6 inside the container. tests will fail if you don't have it. +### Pulling all packages +Use this with caution, only run this on a unmodified newly cloned repository +```bash +for dir in packages/*; do + git submodule update --init $dir + pushd $dir + git checkout current + popd +done +``` +### Building packages +Most packages can be built by using the vyos-builder docker container with the same parameters, the vyos-builder container should include all dependencies for compiling supported packages. +The script `./scripts/build-docker-subpackages` is created to automate the process of building packages, just execute it in the root of vyos-build to start compilation on all supported packages that are checked out. + +NOTE: Prior to executing this script you need to create/build the `vyos-builder` container and checkout all packages you want to compile. +### Building one package +the script above runs a docker container for every build it does. this is also possible to do by hand using: +Ecevuted from the root directory of vyos-build ```bash -$ docker run -it -v /HOST_PATH/:/vyos --sysctl net.ipv6.conf.lo.disable_ipv6=0 vyos-builder \ - bash -c '\ - cd /vyos/packages/vyos-strongswan &&\ - dpkg-buildpackage -uc -us -tc -b' +$ docker run --rm -it -v $(pwd):/vyos -w /vyos/packages/PACKAGENAME --sysctl net.ipv6.conf.lo.disable_ipv6=0 vyos-builder dpkg-buildpackage -uc -us -tc -b +``` +NOTE: `--sysctl net.ipv6.conf.lo.disable_ipv6=0` is only needed when building vyos-strongswan and can be ignored on other packages +NOTE: Prior to executing this you need to checkout and update the submodules you want to recompile +NOTE: vyos-strongswan will only compile on a linux system, running on osx or windows migth result in a unittest lockup. (it never exits) + +Packages that are known to not build using this procedure: +``` +pmacct - Unmet build dependencies: libpcap-dev libpq-dev libmysqlclient-dev libgeoip-dev librabbitmq-dev libjansson-dev librdkafka-dev libnetfilter-log-dev +vyatta-util - dh_clean: mv -Tf debian/.debhelper/bucket/files/47da33933b3825049bbc04871747a9598ce90fd45a438b6a8a58b74bf6d73a4d.tmp config/config.guess returned exit code 1 +vyos-keepalived - Unmet build dependencies: libnl-3-dev libnl-genl-3-dev libpopt-dev libsnmp-dev + +vyatta-quagga - Not needed anymore +vyos-1x - Unmet build dependencies: whois libvyosconfig0 +vyos-frr - Alott of requirements, scary stuff... +vyos-kernel - Need special build instructions +vyos-wireguard - Needs special build instructions ``` diff --git a/scripts/build-docker-subpackages b/scripts/build-docker-subpackages new file mode 100755 index 00000000..7798b5fc --- /dev/null +++ b/scripts/build-docker-subpackages @@ -0,0 +1,66 @@ +#!/bin/bash +#set -x +if [ ! -d "packages" ]; then + echo "This script needs to be executed inside the top root of vyos-build" + exit 1 +fi + +echo "Cleaning up buildfiles..." +rm -rf packages/*.deb +rm -rf packages/*.changes +echo "-----------------------------------------------------" + +for PKG in mdns-repeater \ + pmacct \ + udp-broadcast-relay \ + vyatta-bash \ + vyatta-cfg \ + vyatta-cfg-firewall \ + vyatta-cfg-op-pppoe \ + vyatta-cfg-qos \ + vyatta-cfg-quagga \ + vyatta-cfg-system \ + vyatta-cfg-vpn \ + vyatta-cluster \ + vyatta-config-mgmt \ + vyatta-config-migrate \ + vyatta-conntrack \ + vyatta-conntrack-sync \ + vyatta-eventwatch \ + vyatta-iproute \ + vyatta-ipv6-rtradv \ + vyatta-lldp \ + vyatta-nat \ + vyatta-netflow \ + vyatta-op \ + vyatta-op-dhcp-server \ + vyatta-op-firewall \ + vyatta-op-qos \ + vyatta-op-quagga \ + vyatta-op-vpn \ + vyatta-openvpn \ + vyatta-ravpn \ + vyatta-util \ + vyatta-vrrp \ + vyatta-wanloadbalance \ + vyatta-webgui \ + vyatta-webproxy \ + vyatta-wireless \ + vyatta-wirelessmodem \ + vyatta-zone \ + vyos-keepalived \ + vyos-nhrp \ + vyos-pppoe-server \ + vyos-strongswan \ + vyos-world \ + ; do + 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 + if [ $? -ne 0 ]; then + echo "FAILED to build package $PKG, look in $PKG.buildlog to examine the fault" + fi + else + echo "Did not find source for: $PKG" + fi +done -- cgit v1.2.3 From 53b5c34b5b5e994c3f8c5c94e939f98fa5329167 Mon Sep 17 00:00:00 2001 From: Runar Borge Date: Tue, 25 Dec 2018 00:31:55 +0100 Subject: Remove vyatta-util and upate list of packages failing docker build --- README.md | 5 +---- scripts/build-docker-subpackages | 1 - 2 files changed, 1 insertion(+), 5 deletions(-) (limited to 'scripts') diff --git a/README.md b/README.md index bc35df73..cda94ded 100644 --- a/README.md +++ b/README.md @@ -195,10 +195,7 @@ NOTE: vyos-strongswan will only compile on a linux system, running on osx or win Packages that are known to not build using this procedure: ``` -pmacct - Unmet build dependencies: libpcap-dev libpq-dev libmysqlclient-dev libgeoip-dev librabbitmq-dev libjansson-dev librdkafka-dev libnetfilter-log-dev -vyatta-util - dh_clean: mv -Tf debian/.debhelper/bucket/files/47da33933b3825049bbc04871747a9598ce90fd45a438b6a8a58b74bf6d73a4d.tmp config/config.guess returned exit code 1 -vyos-keepalived - Unmet build dependencies: libnl-3-dev libnl-genl-3-dev libpopt-dev libsnmp-dev - +vyatta-util - Not needed anymore vyatta-quagga - Not needed anymore vyos-1x - Unmet build dependencies: whois libvyosconfig0 vyos-frr - Alott of requirements, scary stuff... diff --git a/scripts/build-docker-subpackages b/scripts/build-docker-subpackages index 7798b5fc..148e5a56 100755 --- a/scripts/build-docker-subpackages +++ b/scripts/build-docker-subpackages @@ -40,7 +40,6 @@ for PKG in mdns-repeater \ vyatta-op-vpn \ vyatta-openvpn \ vyatta-ravpn \ - vyatta-util \ vyatta-vrrp \ vyatta-wanloadbalance \ vyatta-webgui \ -- cgit v1.2.3 From 90ec7b2e2558dce37fecdc115bc3aa52236c132b Mon Sep 17 00:00:00 2001 From: Runar Borge Date: Wed, 26 Dec 2018 00:19:18 +0100 Subject: Added compilation of the kernel and wireguard submodule. Also refactored some UI code for easyer reading --- Dockerfile | 8 +++++ scripts/build-docker-subpackages | 76 +++++++++++++++++++++++++++++++++++++--- 2 files changed, 79 insertions(+), 5 deletions(-) (limited to 'scripts') diff --git a/Dockerfile b/Dockerfile index 4c7dcd90..988bcc36 100644 --- a/Dockerfile +++ b/Dockerfile @@ -106,6 +106,14 @@ RUN apt-get install -y \ libpopt-dev \ libsnmp-dev +# Pavkages needed for wireguard +RUN apt-get install -y \ + libmnl-dev + +# Packages needed for kernel +RuN apt-get install -y \ + libelf-dev + # Update live-build RUN echo 'deb http://ftp.debian.org/debian stretch main' | tee -a /etc/apt/sources.list.d/stretch.list &&\ apt-get update &&\ 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 -- cgit v1.2.3 From 54949cd223185f1e589bd76f391e90efc4abce6c Mon Sep 17 00:00:00 2001 From: Runar Borge Date: Wed, 26 Dec 2018 00:25:34 +0100 Subject: Remove bug that breaks all package compilations --- scripts/build-docker-subpackages | 1 - 1 file changed, 1 deletion(-) (limited to 'scripts') diff --git a/scripts/build-docker-subpackages b/scripts/build-docker-subpackages index f3aa2e6d..5f149183 100755 --- a/scripts/build-docker-subpackages +++ b/scripts/build-docker-subpackages @@ -73,7 +73,6 @@ for PKG in mdns-repeater \ vyos-strongswan \ vyos-world \ ; do - break; if [ -d "packages/$PKG/debian" ]; then status_start "Building package: $PKG" docker run --rm -it -v $(pwd):/vyos -w /vyos/packages/$PKG \ -- cgit v1.2.3 From 39948ad83881fe7ac9fb967bc1ae83b3ddecbe5d Mon Sep 17 00:00:00 2001 From: Runar Borge Date: Thu, 27 Dec 2018 00:22:58 +0100 Subject: Added better support for compiling kernel and wireguard. Automatically correct kernel options in libe-build-config and wierguard install --- scripts/build-docker-subpackages | 50 ++++++++++++++++++++++++++-------------- 1 file changed, 33 insertions(+), 17 deletions(-) (limited to 'scripts') diff --git a/scripts/build-docker-subpackages b/scripts/build-docker-subpackages index 5f149183..84e5333c 100755 --- a/scripts/build-docker-subpackages +++ b/scripts/build-docker-subpackages @@ -97,33 +97,49 @@ if [ -f "packages/vyos-kernel/Makefile" ]; then --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 + 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 + VERSION=$(grep "^VERSION" packages/vyos-kernel/Makefile | grep -Eo '[0-9]{1,4}') + PATCHLEVEL=$(grep "^PATCHLEVEL" packages/vyos-kernel/Makefile | grep -Eo '[0-9]{1,4}') + SUBLEVEL=$(grep "^SUBLEVEL" packages/vyos-kernel/Makefile | grep -Eo '[0-9]{1,4}') + ARCH=$(dpkg --print-architecture) + sed -i.bak "s/--linux-packages .* \\\/--linux-packages linux-image-$VERSION\.$PATCHLEVEL\.$SUBLEVEL \\\/" scripts/live-build-config + 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" + status_start "Building package: vyos-wireguard" + if grep -q "KBUILD_OUTPUT" packages/vyos-kernel/Makefile; then + VERSION=$(grep "^VERSION" packages/vyos-kernel/Makefile | grep -Eo '[0-9]{1,4}') + PATCHLEVEL=$(grep "^PATCHLEVEL" packages/vyos-kernel/Makefile | grep -Eo '[0-9]{1,4}') + SUBLEVEL=$(grep "^SUBLEVEL" packages/vyos-kernel/Makefile | grep -Eo '[0-9]{1,4}') + ARCH=$(dpkg --print-architecture) + echo "src/wireguard.ko /lib/modules/$VERSION.$PATCHLEVEL.$SUBLEVEL-$ARCH-vyos/extra" > packages/vyos-wireguard/debian/wireguard-modules.install + 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_ok + status_fail + error_msg "Failed to build package vyos-wireguard, no kernel source found\n" fi else - status_fail - error_msg "Failed to build package vyos-wireguard, no kernel source found\n" + seeor_msg "Something wrong with the kernel module?" fi else status_skip "No source for: vyos-wireguard" -- cgit v1.2.3 From cb0d629d4f48fc3ae9f268f83f5019af4b38c7da Mon Sep 17 00:00:00 2001 From: Christian Poessinger Date: Thu, 27 Dec 2018 12:46:45 +0100 Subject: T1139: Upgrade Kernel to 4.19.12 --- scripts/live-build-config | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'scripts') diff --git a/scripts/live-build-config b/scripts/live-build-config index 2fc87d45..9dc03c32 100755 --- a/scripts/live-build-config +++ b/scripts/live-build-config @@ -37,7 +37,7 @@ lb config noauto \ --architectures {{architecture}} \ --bootappend-live "boot=live components hostname=vyos username=live nopersistence noautologin nonetworking union=overlay" \ --linux-flavours {{architecture}}-vyos \ - --linux-packages linux-image-4.19.4 \ + --linux-packages linux-image-4.19.12 \ --bootloader syslinux,grub-efi \ --binary-images iso-hybrid \ --debian-installer false \ -- cgit v1.2.3 From 396501bbbfc1a49337b812acd66b7a89fc40a0b8 Mon Sep 17 00:00:00 2001 From: Runar Borge Date: Fri, 28 Dec 2018 23:21:44 +0100 Subject: Rename build script to build-submodules and removed docker from the build process. The script was originally named `build-docker-subpackages` and executed docker for every package built. This has now changed so that the user could choose to do a docker or native build. The readme is aldo updated to reflect this change. --- README.md | 16 +++- scripts/build-docker-subpackages | 146 ----------------------------------- scripts/build-submodules | 159 +++++++++++++++++++++++++++++++++++++++ 3 files changed, 171 insertions(+), 150 deletions(-) delete mode 100755 scripts/build-docker-subpackages create mode 100755 scripts/build-submodules (limited to 'scripts') diff --git a/README.md b/README.md index cda94ded..c6460aff 100644 --- a/README.md +++ b/README.md @@ -175,14 +175,22 @@ for dir in packages/*; do done ``` ### Building packages -Most packages can be built by using the vyos-builder docker container with the same parameters, the vyos-builder container should include all dependencies for compiling supported packages. -The script `./scripts/build-docker-subpackages` is created to automate the process of building packages, just execute it in the root of vyos-build to start compilation on all supported packages that are checked out. +The script `./scripts/build-submodules` is created to automate the process of building packages, execute it in the root of `vyos-build` to start compilation on all supported packages that are checked out. + +The easiest way to compile is with the `vyos-builder` docker container, it includes all dependencies for compiling supported packages. + +```bash +$ docker run --rm -it -v $(pwd):/vyos -w /vyos \ + --sysctl net.ipv6.conf.lo.disable_ipv6=0 \ + vyos-builder \ + ./scripts/build-submodules +``` NOTE: Prior to executing this script you need to create/build the `vyos-builder` container and checkout all packages you want to compile. ### Building one package -the script above runs a docker container for every build it does. this is also possible to do by hand using: -Ecevuted from the root directory of vyos-build +the script above runs all package build inside a docker container, this is also possible to do by hand using: +Executed from the root directory of vyos-build ```bash $ docker run --rm -it -v $(pwd):/vyos -w /vyos/packages/PACKAGENAME \ --sysctl net.ipv6.conf.lo.disable_ipv6=0 \ diff --git a/scripts/build-docker-subpackages b/scripts/build-docker-subpackages deleted file mode 100755 index 84e5333c..00000000 --- a/scripts/build-docker-subpackages +++ /dev/null @@ -1,146 +0,0 @@ -#!/bin/bash -#set -x -if [ ! -d "packages" ]; then - echo "This script needs to be executed inside the top root of vyos-build" - 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 \ - vyatta-bash \ - vyatta-cfg \ - vyatta-cfg-firewall \ - vyatta-cfg-op-pppoe \ - vyatta-cfg-qos \ - vyatta-cfg-quagga \ - vyatta-cfg-system \ - vyatta-cfg-vpn \ - vyatta-cluster \ - vyatta-config-mgmt \ - vyatta-config-migrate \ - vyatta-conntrack \ - vyatta-conntrack-sync \ - vyatta-eventwatch \ - vyatta-iproute \ - vyatta-ipv6-rtradv \ - vyatta-lldp \ - vyatta-nat \ - vyatta-netflow \ - vyatta-op \ - vyatta-op-dhcp-server \ - vyatta-op-firewall \ - vyatta-op-qos \ - vyatta-op-quagga \ - vyatta-op-vpn \ - vyatta-openvpn \ - vyatta-ravpn \ - vyatta-vrrp \ - vyatta-wanloadbalance \ - vyatta-webgui \ - vyatta-webproxy \ - vyatta-wireless \ - vyatta-wirelessmodem \ - vyatta-zone \ - vyos-keepalived \ - vyos-nhrp \ - vyos-pppoe-server \ - vyos-strongswan \ - vyos-world \ - ; do - if [ -d "packages/$PKG/debian" ]; then - 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 - status_fail - error_msg "Failed to build package $PKG, look in $PKG.buildlog to examine the fault\n" - else - status_ok - fi - else - 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 - VERSION=$(grep "^VERSION" packages/vyos-kernel/Makefile | grep -Eo '[0-9]{1,4}') - PATCHLEVEL=$(grep "^PATCHLEVEL" packages/vyos-kernel/Makefile | grep -Eo '[0-9]{1,4}') - SUBLEVEL=$(grep "^SUBLEVEL" packages/vyos-kernel/Makefile | grep -Eo '[0-9]{1,4}') - ARCH=$(dpkg --print-architecture) - sed -i.bak "s/--linux-packages .* \\\/--linux-packages linux-image-$VERSION\.$PATCHLEVEL\.$SUBLEVEL \\\/" scripts/live-build-config - status_ok - fi -else - status_skip "No source for: vyos-kernel" -fi - - - -# WIREGUARD -if [ -d "packages/vyos-wireguard/debian" ]; then - if [ -f "packages/vyos-kernel/Makefile" ]; then - status_start "Building package: vyos-wireguard" - if grep -q "KBUILD_OUTPUT" packages/vyos-kernel/Makefile; then - VERSION=$(grep "^VERSION" packages/vyos-kernel/Makefile | grep -Eo '[0-9]{1,4}') - PATCHLEVEL=$(grep "^PATCHLEVEL" packages/vyos-kernel/Makefile | grep -Eo '[0-9]{1,4}') - SUBLEVEL=$(grep "^SUBLEVEL" packages/vyos-kernel/Makefile | grep -Eo '[0-9]{1,4}') - ARCH=$(dpkg --print-architecture) - echo "src/wireguard.ko /lib/modules/$VERSION.$PATCHLEVEL.$SUBLEVEL-$ARCH-vyos/extra" > packages/vyos-wireguard/debian/wireguard-modules.install - 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 - seeor_msg "Something wrong with the kernel module?" - fi -else - status_skip "No source for: vyos-wireguard" -fi diff --git a/scripts/build-submodules b/scripts/build-submodules new file mode 100755 index 00000000..1981759f --- /dev/null +++ b/scripts/build-submodules @@ -0,0 +1,159 @@ +#!/bin/bash +#set -x +if [ ! -d "packages" ]; then + echo "This script needs to be executed inside the top root of vyos-build" + exit 1 +fi + +if [ "$1" == "-h" ] || [ "$1" == "--help" ]; then + echo "Script for building all subpackages to vyos" + echo "Execute this sctipt from the root of the vyos-build directory" + echo "" + echo "This script could be executed from a Debian Jessie installation with all dependencies" + echo "or from the vyos-builder docker container" + echo "docker instructions" + echo "Build the container:" + echo " docker build -t vyos-builder ." + echo "Compile packages:" + echo " docker run --rm -it -v $(pwd):/vyos -w /vyos --sysctl net.ipv6.conf.lo.disable_ipv6=0 vyos-builder scripts/build-docker-subpaclages" +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" +} +ROOTDIR="$(pwd)" +PKGDIR="$(pwd)/packages" + +echo "Cleaning up buildfiles..." +rm -rf $PKGDIR/*.deb +rm -rf $PKGDIR/*.changes +rm -rf $PKGDIR/*.buildlog +echo "-----------------------------------------------------" +echo "Starting build process for all packages" +echo "" +for PKG in mdns-repeater \ + pmacct \ + udp-broadcast-relay \ + vyatta-bash \ + vyatta-cfg \ + vyatta-cfg-firewall \ + vyatta-cfg-op-pppoe \ + vyatta-cfg-qos \ + vyatta-cfg-quagga \ + vyatta-cfg-system \ + vyatta-cfg-vpn \ + vyatta-cluster \ + vyatta-config-mgmt \ + vyatta-config-migrate \ + vyatta-conntrack \ + vyatta-conntrack-sync \ + vyatta-eventwatch \ + vyatta-iproute \ + vyatta-ipv6-rtradv \ + vyatta-lldp \ + vyatta-nat \ + vyatta-netflow \ + vyatta-op \ + vyatta-op-dhcp-server \ + vyatta-op-firewall \ + vyatta-op-qos \ + vyatta-op-quagga \ + vyatta-op-vpn \ + vyatta-openvpn \ + vyatta-ravpn \ + vyatta-vrrp \ + vyatta-wanloadbalance \ + vyatta-webgui \ + vyatta-webproxy \ + vyatta-wireless \ + vyatta-wirelessmodem \ + vyatta-zone \ + vyos-keepalived \ + vyos-nhrp \ + vyos-pppoe-server \ + vyos-strongswan \ + vyos-world \ + ; do + if [ -d "packages/$PKG/debian" ]; then + status_start "Building package: $PKG" + pushd $PKGDIR/$PKG > /dev/null + dpkg-buildpackage -uc -us -tc -b >$PKGDIR/$PKG.buildlog 2>&1 + if [ $? -ne 0 ]; then + status_fail + error_msg "Failed to build package $PKG, look in $PKG.buildlog to examine the fault\n" + else + status_ok + fi + popd > /dev/null + else + status_skip "No source for: $PKG" + fi +done + +# KERNEL +if [ -f "packages/vyos-kernel/Makefile" ]; then + status_start "Building-package: vyos-kernel" + pushd packages/vyos-kernel > /dev/null + bash -c '../../scripts/build-kernel' >$PKGDIR/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 + 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}') + ARCH=$(dpkg --print-architecture) + sed -i.bak "s/--linux-packages .* \\\/--linux-packages linux-image-$VERSION\.$PATCHLEVEL\.$SUBLEVEL \\\/" $ROOTDIR/scripts/live-build-config + status_ok + fi + popd > /dev/null +else + status_skip "No source for: vyos-kernel" +fi + + + +# WIREGUARD +if [ -d "packages/vyos-wireguard/debian" ]; then + if [ -f "packages/vyos-kernel/Makefile" ]; then + status_start "Building package: vyos-wireguard" + if grep -q "KBUILD_OUTPUT" packages/vyos-kernel/Makefile; then + VERSION=$(grep "^VERSION" packages/vyos-kernel/Makefile | grep -Eo '[0-9]{1,4}') + PATCHLEVEL=$(grep "^PATCHLEVEL" packages/vyos-kernel/Makefile | grep -Eo '[0-9]{1,4}') + SUBLEVEL=$(grep "^SUBLEVEL" packages/vyos-kernel/Makefile | grep -Eo '[0-9]{1,4}') + ARCH=$(dpkg --print-architecture) + pushd packages/vyos-wireguard > /dev/null + echo "src/wireguard.ko /lib/modules/$VERSION.$PATCHLEVEL.$SUBLEVEL-$ARCH-vyos/extra" > debian/wireguard-modules.install + bash -c 'KERNELDIR=/vyos/packages/vyos-kernel dpkg-buildpackage -uc -us -tc -b' >$PKGDIR/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 + popd > /dev/null + else + status_fail + error_msg "Failed to build package vyos-wireguard, no kernel source found\n" + fi + else + seeor_msg "Something wrong with the kernel module?" + fi +else + status_skip "No source for: vyos-wireguard" +fi -- cgit v1.2.3