From 6c0f85151a0cd0fc4c885ec7bfe7e546204f31d4 Mon Sep 17 00:00:00 2001 From: pudelkoM Date: Thu, 6 Feb 2020 19:15:39 -0800 Subject: [PATCH 1/4] build more versions --- .circleci/build-sdklt.sh | 7 +++--- .circleci/config.yml | 52 +++++++++++++++++++++++++++------------- 2 files changed, 40 insertions(+), 19 deletions(-) diff --git a/.circleci/build-sdklt.sh b/.circleci/build-sdklt.sh index 6d760536..b40e8d70 100755 --- a/.circleci/build-sdklt.sh +++ b/.circleci/build-sdklt.sh @@ -6,7 +6,8 @@ set -x export YAML=/usr export YAML_LIBDIR=$YAML/src/.libs -export KDIR=$HOME/linux-4.14.49-OpenNetworkLinux +KERNEL_VERSION=${KERNEL_VERSION:-4.14.49} +export KDIR=$HOME/linux-${KERNEL_VERSION}-OpenNetworkLinux export TOOLCHAIN_DIR=/usr export TARGET_ARCHITECTURE="" @@ -24,9 +25,9 @@ export SDK=$SDKLT/src cd $SDK/appl/demo make TARGET_PLATFORM=xlr_linux clean -j -make TARGET_PLATFORM=xlr_linux -j 4 +make TARGET_PLATFORM=xlr_linux -j 2 -tar czf $HOME/sdklt-4.14.49.tgz \ +tar czf $HOME/sdklt-${KERNEL_VERSION}.tgz \ -C $SDKLT/src/appl/linux/build/xlr_linux/lkm/knet/ linux_ngknet.ko \ -C $SDKLT/src/appl/linux/build/xlr_linux/lkm/bde/ linux_ngbde.ko \ -C $SDKLT/src/appl/demo/build/xlr_linux/ sdklt \ diff --git a/.circleci/config.yml b/.circleci/config.yml index 68471624..cb50e9fb 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -16,10 +16,12 @@ version: 2.1 -jobs: - build: - docker: - - image: debian:testing +commands: + build-sdklt: + description: "Build SDKLT for a given Kernel version" + parameters: + kernel_version: + type: string steps: - run: name: Setup build environment @@ -34,9 +36,9 @@ jobs: name: Get Kernel sources command: | pushd $HOME - wget https://github.com/opennetworkinglab/OpenNetworkLinux/releases/download/onlpv2-dev-1.0.1/linux-4.14.49-OpenNetworkLinux.tar.xz - tar xf linux-4.14.49-OpenNetworkLinux.tar.xz - rm linux-4.14.49-OpenNetworkLinux.tar.xz + wget https://github.com/opennetworkinglab/OpenNetworkLinux/releases/download/onlpv2-dev-1.0.1/linux-<< parameters.kernel_version >>-OpenNetworkLinux.tar.xz + tar xf linux-<< parameters.kernel_version >>-OpenNetworkLinux.tar.xz + rm linux-<< parameters.kernel_version >>-OpenNetworkLinux.tar.xz popd - checkout - run: @@ -46,20 +48,35 @@ jobs: name: Build SDKLT command: | export ADD_CFLAGS="-fomit-frame-pointer -O3" - .circleci/build-sdklt.sh - mv ~/sdklt-4.14.49.tgz ~/build/sdklt-4.14.49.tgz + KERNEL_VERSION=<< parameters.kernel_version >> .circleci/build-sdklt.sh + mv ~/sdklt-<< parameters.kernel_version >>.tgz ~/build/sdklt-<< parameters.kernel_version >>.tgz - run: name: Build SDKLT debug command: | export ADD_CFLAGS="-g -fno-omit-frame-pointer -O0 -fsanitize=address" export ADD_LDFLAGS="-fsanitize=address" - .circleci/build-sdklt.sh - mv ~/sdklt-4.14.49.tgz ~/build/sdklt-debug-4.14.49.tgz + KERNEL_VERSION=<< parameters.kernel_version >> .circleci/build-sdklt.sh + mv ~/sdklt-<< parameters.kernel_version >>.tgz ~/build/sdklt-debug-<< parameters.kernel_version >>.tgz - persist_to_workspace: root: ~/build/ paths: - - sdklt-4.14.49.tgz - - sdklt-debug-4.14.49.tgz + - sdklt-<< parameters.kernel_version >>.tgz + - sdklt-debug-<< parameters.kernel_version >>.tgz + +jobs: + build-4-14-49: + docker: + - image: debian:testing + steps: + - build-sdklt: + kernel_version: "4.14.49" + + build-3-16-56: + docker: + - image: debian:testing + steps: + - build-sdklt: + kernel_version: "3.16.56" publish-github-release: docker: @@ -89,16 +106,19 @@ workflows: version: 2 sdklt: jobs: - - build + - build-4-14-49 + - build-3-16-56 - publish-github-release: requires: - - build + - build-4-14-49 + - build-3-16-56 filters: branches: only: master - publish-github-pre-release: requires: - - build + - build-4-14-49 + - build-3-16-56 filters: branches: ignore: master From f0585108cfaf570a4c96df8c7afe636bb31445a8 Mon Sep 17 00:00:00 2001 From: pudelkoM Date: Fri, 7 Feb 2020 11:25:09 -0800 Subject: [PATCH 2/4] Use debian stretch for 3.16 builds --- .circleci/config.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index cb50e9fb..29da2e46 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -73,7 +73,7 @@ jobs: build-3-16-56: docker: - - image: debian:testing + - image: debian:buster steps: - build-sdklt: kernel_version: "3.16.56" From bd7a7f4674a3704b446e444ef0c5816e68df683b Mon Sep 17 00:00:00 2001 From: pudelkoM Date: Fri, 7 Feb 2020 11:25:39 -0800 Subject: [PATCH 3/4] Release tarball now contains a folder --- .circleci/build-sdklt.sh | 17 +++++++++++------ 1 file changed, 11 insertions(+), 6 deletions(-) diff --git a/.circleci/build-sdklt.sh b/.circleci/build-sdklt.sh index b40e8d70..e22b6ced 100755 --- a/.circleci/build-sdklt.sh +++ b/.circleci/build-sdklt.sh @@ -27,9 +27,14 @@ cd $SDK/appl/demo make TARGET_PLATFORM=xlr_linux clean -j make TARGET_PLATFORM=xlr_linux -j 2 -tar czf $HOME/sdklt-${KERNEL_VERSION}.tgz \ - -C $SDKLT/src/appl/linux/build/xlr_linux/lkm/knet/ linux_ngknet.ko \ - -C $SDKLT/src/appl/linux/build/xlr_linux/lkm/bde/ linux_ngbde.ko \ - -C $SDKLT/src/appl/demo/build/xlr_linux/ sdklt \ - -C $SDKLT/src/appl/sdklib/build/xlr_linux/ include/sdklt \ - -C $SDKLT/src/appl/sdklib/build/xlr_linux/ lib/libsdklt.a lib/libsdklt.so +TARFOLDER=mktemp -d + +cp $SDKLT/src/appl/linux/build/xlr_linux/lkm/knet/linux_ngknet.ko \ + $SDKLT/src/appl/linux/build/xlr_linux/lkm/bde/linux_ngbde.ko \ + $SDKLT/src/appl/demo/build/xlr_linux/sdklt \ + $SDKLT/src/appl/sdklib/build/xlr_linux/include/sdklt \ + $SDKLT/src/appl/sdklib/build/xlr_linux/lib/libsdklt.a \ + $SDKLT/src/appl/sdklib/build/xlr_linux/lib/libsdklt.so \ + ${TARFOLDER} + +tar czf $HOME/sdklt-${KERNEL_VERSION}.tgz ${TARFOLDER} From 72b587adc7425f130285bae243aa61ad8fba1ea4 Mon Sep 17 00:00:00 2001 From: pudelkoM Date: Fri, 7 Feb 2020 11:32:45 -0800 Subject: [PATCH 4/4] Downgrade compilers for old debian --- .circleci/build-sdklt.sh | 23 ++++++++++++----------- .circleci/config.yml | 33 +++++++++++++++++++++++---------- 2 files changed, 35 insertions(+), 21 deletions(-) diff --git a/.circleci/build-sdklt.sh b/.circleci/build-sdklt.sh index e22b6ced..4698c1a7 100755 --- a/.circleci/build-sdklt.sh +++ b/.circleci/build-sdklt.sh @@ -27,14 +27,15 @@ cd $SDK/appl/demo make TARGET_PLATFORM=xlr_linux clean -j make TARGET_PLATFORM=xlr_linux -j 2 -TARFOLDER=mktemp -d - -cp $SDKLT/src/appl/linux/build/xlr_linux/lkm/knet/linux_ngknet.ko \ - $SDKLT/src/appl/linux/build/xlr_linux/lkm/bde/linux_ngbde.ko \ - $SDKLT/src/appl/demo/build/xlr_linux/sdklt \ - $SDKLT/src/appl/sdklib/build/xlr_linux/include/sdklt \ - $SDKLT/src/appl/sdklib/build/xlr_linux/lib/libsdklt.a \ - $SDKLT/src/appl/sdklib/build/xlr_linux/lib/libsdklt.so \ - ${TARFOLDER} - -tar czf $HOME/sdklt-${KERNEL_VERSION}.tgz ${TARFOLDER} +TAR_FOLDER=/tmp/sdklt-${KERNEL_VERSION} +mkdir -p ${TAR_FOLDER} + +cp -r $SDKLT/src/appl/linux/build/xlr_linux/lkm/knet/linux_ngknet.ko \ + $SDKLT/src/appl/linux/build/xlr_linux/lkm/bde/linux_ngbde.ko \ + $SDKLT/src/appl/demo/build/xlr_linux/sdklt \ + $SDKLT/src/appl/sdklib/build/xlr_linux/include \ + $SDKLT/src/appl/sdklib/build/xlr_linux/lib \ + ${TAR_FOLDER} + +tar czf $HOME/sdklt-${KERNEL_VERSION}.tgz \ + -C /tmp sdklt-${KERNEL_VERSION} diff --git a/.circleci/config.yml b/.circleci/config.yml index 29da2e46..e39655b3 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -27,10 +27,7 @@ commands: name: Setup build environment command: | apt update - apt install -y --no-install-recommends libyaml-dev python python-pip python-setuptools libelf-dev wget clang-8 gcc-9 make git ca-certificates ssh - update-alternatives --install /usr/bin/gcc gcc /usr/bin/gcc-9 10 - update-alternatives --install /usr/bin/clang clang /usr/bin/clang-8 10 - update-alternatives --install /usr/bin/cc cc /usr/bin/clang 10 + apt install -y --no-install-recommends libyaml-dev python python-pip python-setuptools libelf-dev wget make git ca-certificates ssh pip install pyyaml - run: name: Get Kernel sources @@ -42,23 +39,23 @@ commands: popd - checkout - run: - name: Create build directory - command: mkdir -p ~/build + name: Create staging directory + command: mkdir -p ~/staging - run: name: Build SDKLT command: | export ADD_CFLAGS="-fomit-frame-pointer -O3" KERNEL_VERSION=<< parameters.kernel_version >> .circleci/build-sdklt.sh - mv ~/sdklt-<< parameters.kernel_version >>.tgz ~/build/sdklt-<< parameters.kernel_version >>.tgz + mv ~/sdklt-<< parameters.kernel_version >>.tgz ~/staging/sdklt-<< parameters.kernel_version >>.tgz - run: name: Build SDKLT debug command: | export ADD_CFLAGS="-g -fno-omit-frame-pointer -O0 -fsanitize=address" export ADD_LDFLAGS="-fsanitize=address" KERNEL_VERSION=<< parameters.kernel_version >> .circleci/build-sdklt.sh - mv ~/sdklt-<< parameters.kernel_version >>.tgz ~/build/sdklt-debug-<< parameters.kernel_version >>.tgz + mv ~/sdklt-<< parameters.kernel_version >>.tgz ~/staging/sdklt-debug-<< parameters.kernel_version >>.tgz - persist_to_workspace: - root: ~/build/ + root: ~/staging/ paths: - sdklt-<< parameters.kernel_version >>.tgz - sdklt-debug-<< parameters.kernel_version >>.tgz @@ -68,13 +65,29 @@ jobs: docker: - image: debian:testing steps: + - run: + name: Setup compiler + command: | + apt update + apt install -y --no-install-recommends clang-8 gcc-9 + update-alternatives --install /usr/bin/gcc gcc /usr/bin/gcc-9 10 + update-alternatives --install /usr/bin/clang clang /usr/bin/clang-8 10 + update-alternatives --install /usr/bin/cc cc /usr/bin/clang 10 - build-sdklt: kernel_version: "4.14.49" build-3-16-56: docker: - - image: debian:buster + - image: debian:stretch steps: + - run: + name: Setup compiler + command: | + apt update + apt install -y --no-install-recommends clang-4.0 gcc-6 + update-alternatives --install /usr/bin/gcc gcc /usr/bin/gcc-6 10 + update-alternatives --install /usr/bin/clang clang /usr/bin/clang-4.0 10 + update-alternatives --install /usr/bin/cc cc /usr/bin/clang 10 - build-sdklt: kernel_version: "3.16.56"