diff options
author | Christian Poessinger <christian@poessinger.com> | 2020-02-29 07:27:23 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-02-29 07:27:23 +0100 |
commit | 6488edf0a3145f0b76a607446de9ad79e6b5ee55 (patch) | |
tree | be527b3ec8888350b76458953fff1b276d7bb508 | |
parent | 7b316a128576a3da862ff28c8616da9804bc6f39 (diff) | |
parent | c6864ed0eb479ea9116724cbc62e823e487fcf2d (diff) | |
download | vyos-build-6488edf0a3145f0b76a607446de9ad79e6b5ee55.tar.gz vyos-build-6488edf0a3145f0b76a607446de9ad79e6b5ee55.zip |
Merge pull request #84 from jjakob/current
T2085: package building fixes
-rw-r--r-- | docker/Dockerfile | 24 | ||||
-rwxr-xr-x | scripts/build-packages | 28 |
2 files changed, 30 insertions, 22 deletions
diff --git a/docker/Dockerfile b/docker/Dockerfile index b4c60a50..ea3f3d9c 100644 --- a/docker/Dockerfile +++ b/docker/Dockerfile @@ -218,13 +218,6 @@ RUN apt-get update && apt-get install -y \ python3-pytest \ texinfo -# Packages needed for conntrack-tools -RUN apt-get update && apt-get install -y \ - libnetfilter-conntrack-dev \ - libnetfilter-cthelper0-dev \ - libnetfilter-cttimeout-dev \ - libnetfilter-queue-dev - # Packages needed for hvinfo RUN apt-get update && apt-get install -y \ gnat \ @@ -280,14 +273,21 @@ RUN apt-get update && apt-get install -y \ # Packages needed for keepalived RUN apt-get update && apt-get install -y \ - libnl-3-200 \ + autoconf \ + debhelper \ + libglib2.0-dev \ + libjson-c-dev \ libnl-3-dev \ - libnl-nf-3-200 \ + libnl-genl-3-dev \ + libpopt-dev \ + libsnmp-dev \ + libssl-dev \ libnl-nf-3-dev \ + libnfnetlink-dev \ libipset-dev \ - libnl-genl-3-200 \ - libnl-genl-3-dev \ - libpopt-dev + iptables-dev \ + linux-libc-dev \ + pkg-config # Packages needed for Qemu test-suite # This is for now only supported on i386 and amd64 platforms diff --git a/scripts/build-packages b/scripts/build-packages index 94c299f5..7329a845 100755 --- a/scripts/build-packages +++ b/scripts/build-packages @@ -11,7 +11,7 @@ current_working_directory = os.getcwd() repo_root = subprocess.check_output('git rev-parse --show-toplevel', shell=True, universal_newlines=True).rstrip('\n') repo_sha = subprocess.check_output('git rev-parse --short=12 HEAD', shell=True, universal_newlines=True).rstrip('\n') -def add_package(name, url=None, commit='HEAD', branch='current', tag=None, custombuild_cmd=None): +def add_package(name, url=None, commit='HEAD', branch='current', tag=None, shallow=True, custombuild_cmd=None): """ Build up source package with URL and build commands executed during the later called build_package step. @@ -32,6 +32,7 @@ def add_package(name, url=None, commit='HEAD', branch='current', tag=None, custo 'commit': commit, 'tag': tag, 'branch': branch, + 'shallow': shallow, 'path': repo_root + '/packages/' + name, 'custombuild_cmd': custombuild_cmd } @@ -98,7 +99,7 @@ def clone_package(pkg, log): First cleanup any possible leftovers from previous builds """ - if args.keep: + if args.keep and os.path.isdir(pkg['path']): log.debug("Keep possibly modified package '{}'".format(pkg['path'])) return False elif args.clean: @@ -114,14 +115,25 @@ def clone_package(pkg, log): bashCommand = 'git clean -d -x --force && git reset --hard ' + pkg['commit'] return call(bashCommand, log) - # resolve given tag to commit id to use shallow clone + if pkg['commit'] and pkg['shallow']: + log.debug("Package '{}' has both commit and shallow set, unsetting shallow to do a full clone.".format(pkg['name'])) + pkg['shallow']=False + bashCommand = 'git clone ' + pkg['url'] + + if pkg['shallow']: + bashCommand += ' --depth 1' + if pkg['tag']: bashCommand += ' --branch ' + pkg['tag'] elif pkg['branch']: - bashCommand += ' --depth 1 --branch ' + pkg['branch'] + bashCommand += ' --branch ' + pkg['branch'] bashCommand += ' ' + pkg['path'] + + if pkg['commit']: + bashCommand += ' && cd ' + pkg['path'] + ' && git reset --hard ' + pkg['commit'] + return call(bashCommand, log) @@ -183,8 +195,7 @@ vyos_packages = ['vyatta-bash', 'vyos-xe-guest-utilities', 'vyos-netplug', 'ddclient', - 'live-boot', - 'conntrack-tools'] + 'live-boot'] # Special packages mean packages which are located no in the VyOS namespace # or require fancy build instructions @@ -221,10 +232,7 @@ pkg_special.append( add_package('frr', url='https://github.com/FRRouting/frr.git # # We use keepalived from Debian Buster # -keepalived_build_cmd = "sed -i 's/debhelper (>= 11)/debhelper (>= 9)/' debian/control && " \ - "echo 9 > debian/compat && " \ - "dpkg-buildpackage -b -us -uc -tc -j$(getconf _NPROCESSORS_ONLN)" -pkg_special.append( add_package('keepalived', url='https://salsa.debian.org/ipvs-team/pkg-keepalived.git', branch='master', commit='eae91c81', custombuild_cmd=keepalived_build_cmd) ) +pkg_special.append( add_package('keepalived', url='https://salsa.debian.org/ipvs-team/pkg-keepalived.git', branch='master', commit='eae91c81')) # # Linux (VyOS) Kernel |