Skip to content
This repository was archived by the owner on Nov 5, 2024. It is now read-only.

Commit 3db592f

Browse files
authored
Enable automated builds and releases
* Allow use of custom toolchain * Add ci * Cleanup
1 parent 2bd1849 commit 3db592f

File tree

3 files changed

+169
-63
lines changed

3 files changed

+169
-63
lines changed

.circleci/build-sdklt.sh

Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
#!/bin/bash
2+
3+
set -e
4+
set -x
5+
6+
export YAML=/usr
7+
export YAML_LIBDIR=$YAML/src/.libs
8+
9+
export KDIR=$HOME/linux-4.14.49-OpenNetworkLinux
10+
11+
export TOOLCHAIN_DIR=/usr
12+
export TARGET_ARCHITECTURE=""
13+
export CROSS_COMPILE=""
14+
15+
export SDKLT=$HOME/project
16+
export SDK=$SDKLT/src
17+
18+
19+
# Add your flags here
20+
# export CC=clang-3.9
21+
# export LD=lld-3.9
22+
# export ADD_CFLAGS="-g -fno-omit-frame-pointer -O0"
23+
24+
cd $SDK/appl/demo
25+
make TARGET_PLATFORM=xlr_linux clean -j
26+
make TARGET_PLATFORM=xlr_linux -j 4
27+
28+
tar czf $HOME/sdklt-4.14.49.tgz \
29+
-C $SDKLT/src/appl/linux/build/xlr_linux/lkm/knet/ linux_ngknet.ko \
30+
-C $SDKLT/src/appl/linux/build/xlr_linux/lkm/bde/ linux_ngbde.ko \
31+
-C $SDKLT/src/appl/demo/build/xlr_linux/ sdklt \
32+
-C $SDKLT/src/appl/sdklib/build/xlr_linux/ include/sdklt \
33+
-C $SDKLT/src/appl/sdklib/build/xlr_linux/ lib/libsdklt.a lib/libsdklt.so

.circleci/config.yml

Lines changed: 73 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,73 @@
1+
#
2+
# Copyright 2019-present Open Networking Foundation
3+
#
4+
# Licensed under the Apache License, Version 2.0 (the "License");
5+
# you may not use this file except in compliance with the License.
6+
# You may obtain a copy of the License at
7+
#
8+
# http://www.apache.org/licenses/LICENSE-2.0
9+
#
10+
# Unless required by applicable law or agreed to in writing, software
11+
# distributed under the License is distributed on an "AS IS" BASIS,
12+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13+
# See the License for the specific language governing permissions and
14+
# limitations under the License.
15+
#
16+
17+
version: 2.1
18+
19+
jobs:
20+
build:
21+
docker:
22+
- image: debian:testing
23+
steps:
24+
- run:
25+
name: Setup build environment
26+
command: |
27+
apt update
28+
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
29+
update-alternatives --install /usr/bin/gcc gcc /usr/bin/gcc-9 10
30+
update-alternatives --install /usr/bin/clang clang /usr/bin/clang-8 10
31+
update-alternatives --install /usr/bin/cc cc /usr/bin/clang 10
32+
pip install pyyaml
33+
- run:
34+
name: Get Kernel sources
35+
command: |
36+
pushd $HOME
37+
wget https://github.com/opennetworkinglab/OpenNetworkLinux/releases/download/onlpv2-dev-1.0.1/linux-4.14.49-OpenNetworkLinux.tar.xz
38+
tar xf linux-4.14.49-OpenNetworkLinux.tar.xz
39+
rm linux-4.14.49-OpenNetworkLinux.tar.xz
40+
popd
41+
- checkout
42+
- run:
43+
name: Build SDKLT
44+
command: .circleci/build-sdklt.sh
45+
- persist_to_workspace:
46+
root: ~/
47+
paths:
48+
- sdklt-4.14.49.tgz
49+
50+
publish-github-release:
51+
docker:
52+
- image: circleci/golang:1.10
53+
steps:
54+
- attach_workspace:
55+
at: ./artifacts
56+
- run:
57+
name: "Publish Release on GitHub"
58+
command: |
59+
go get -u github.com/tcnksm/ghr
60+
ghr -t ${GITHUB_TOKEN} -u ${CIRCLE_PROJECT_USERNAME} -r ${CIRCLE_PROJECT_REPONAME} -c ${CIRCLE_SHA1} -delete r${CIRCLE_BUILD_NUM} ./artifacts/
61+
62+
63+
workflows:
64+
version: 2
65+
sdklt:
66+
jobs:
67+
- build
68+
- publish-github-release:
69+
requires:
70+
- build
71+
filters:
72+
branches:
73+
only: master

src/appl/make/xlr_linux.mk

Lines changed: 63 additions & 63 deletions
Original file line numberDiff line numberDiff line change
@@ -1,90 +1,90 @@
11
#
2-
# Copyright: (c) 2018 Broadcom. All Rights Reserved. "Broadcom" refers to
2+
# Copyright: (c) 2018 Broadcom. All Rights Reserved. "Broadcom" refers to
33
# Broadcom Limited and/or its subsidiaries.
4-
#
4+
#
55
# Broadcom Switch Software License
6-
#
7-
# This license governs the use of the accompanying Broadcom software. Your
8-
# use of the software indicates your acceptance of the terms and conditions
9-
# of this license. If you do not agree to the terms and conditions of this
6+
#
7+
# This license governs the use of the accompanying Broadcom software. Your
8+
# use of the software indicates your acceptance of the terms and conditions
9+
# of this license. If you do not agree to the terms and conditions of this
1010
# license, do not use the software.
1111
# 1. Definitions
1212
# "Licensor" means any person or entity that distributes its Work.
13-
# "Software" means the original work of authorship made available under
13+
# "Software" means the original work of authorship made available under
1414
# this license.
15-
# "Work" means the Software and any additions to or derivative works of
15+
# "Work" means the Software and any additions to or derivative works of
1616
# the Software that are made available under this license.
17-
# The terms "reproduce," "reproduction," "derivative works," and
17+
# The terms "reproduce," "reproduction," "derivative works," and
1818
# "distribution" have the meaning as provided under U.S. copyright law.
19-
# Works, including the Software, are "made available" under this license
20-
# by including in or with the Work either (a) a copyright notice
21-
# referencing the applicability of this license to the Work, or (b) a copy
19+
# Works, including the Software, are "made available" under this license
20+
# by including in or with the Work either (a) a copyright notice
21+
# referencing the applicability of this license to the Work, or (b) a copy
2222
# of this license.
2323
# 2. Grant of Copyright License
24-
# Subject to the terms and conditions of this license, each Licensor
25-
# grants to you a perpetual, worldwide, non-exclusive, and royalty-free
26-
# copyright license to reproduce, prepare derivative works of, publicly
27-
# display, publicly perform, sublicense and distribute its Work and any
24+
# Subject to the terms and conditions of this license, each Licensor
25+
# grants to you a perpetual, worldwide, non-exclusive, and royalty-free
26+
# copyright license to reproduce, prepare derivative works of, publicly
27+
# display, publicly perform, sublicense and distribute its Work and any
2828
# resulting derivative works in any form.
2929
# 3. Grant of Patent License
30-
# Subject to the terms and conditions of this license, each Licensor
31-
# grants to you a perpetual, worldwide, non-exclusive, and royalty-free
32-
# patent license to make, have made, use, offer to sell, sell, import, and
33-
# otherwise transfer its Work, in whole or in part. This patent license
34-
# applies only to the patent claims licensable by Licensor that would be
35-
# infringed by Licensor's Work (or portion thereof) individually and
30+
# Subject to the terms and conditions of this license, each Licensor
31+
# grants to you a perpetual, worldwide, non-exclusive, and royalty-free
32+
# patent license to make, have made, use, offer to sell, sell, import, and
33+
# otherwise transfer its Work, in whole or in part. This patent license
34+
# applies only to the patent claims licensable by Licensor that would be
35+
# infringed by Licensor's Work (or portion thereof) individually and
3636
# excluding any combinations with any other materials or technology.
37-
# If you institute patent litigation against any Licensor (including a
38-
# cross-claim or counterclaim in a lawsuit) to enforce any patents that
39-
# you allege are infringed by any Work, then your patent license from such
40-
# Licensor to the Work shall terminate as of the date such litigation is
37+
# If you institute patent litigation against any Licensor (including a
38+
# cross-claim or counterclaim in a lawsuit) to enforce any patents that
39+
# you allege are infringed by any Work, then your patent license from such
40+
# Licensor to the Work shall terminate as of the date such litigation is
4141
# filed.
4242
# 4. Redistribution
43-
# You may reproduce or distribute the Work only if (a) you do so under
44-
# this License, (b) you include a complete copy of this License with your
45-
# distribution, and (c) you retain without modification any copyright,
43+
# You may reproduce or distribute the Work only if (a) you do so under
44+
# this License, (b) you include a complete copy of this License with your
45+
# distribution, and (c) you retain without modification any copyright,
4646
# patent, trademark, or attribution notices that are present in the Work.
4747
# 5. Derivative Works
48-
# You may specify that additional or different terms apply to the use,
49-
# reproduction, and distribution of your derivative works of the Work
50-
# ("Your Terms") only if (a) Your Terms provide that the limitations of
51-
# Section 7 apply to your derivative works, and (b) you identify the
52-
# specific derivative works that are subject to Your Terms.
53-
# Notwithstanding Your Terms, this license (including the redistribution
48+
# You may specify that additional or different terms apply to the use,
49+
# reproduction, and distribution of your derivative works of the Work
50+
# ("Your Terms") only if (a) Your Terms provide that the limitations of
51+
# Section 7 apply to your derivative works, and (b) you identify the
52+
# specific derivative works that are subject to Your Terms.
53+
# Notwithstanding Your Terms, this license (including the redistribution
5454
# requirements in Section 4) will continue to apply to the Work itself.
5555
# 6. Trademarks
56-
# This license does not grant any rights to use any Licensor's or its
57-
# affiliates' names, logos, or trademarks, except as necessary to
56+
# This license does not grant any rights to use any Licensor's or its
57+
# affiliates' names, logos, or trademarks, except as necessary to
5858
# reproduce the notices described in this license.
5959
# 7. Limitations
60-
# Platform. The Work and any derivative works thereof may only be used, or
60+
# Platform. The Work and any derivative works thereof may only be used, or
6161
# intended for use, with a Broadcom switch integrated circuit.
62-
# No Reverse Engineering. You will not use the Work to disassemble,
63-
# reverse engineer, decompile, or attempt to ascertain the underlying
62+
# No Reverse Engineering. You will not use the Work to disassemble,
63+
# reverse engineer, decompile, or attempt to ascertain the underlying
6464
# technology of a Broadcom switch integrated circuit.
6565
# 8. Termination
66-
# If you violate any term of this license, then your rights under this
67-
# license (including the license grants of Sections 2 and 3) will
66+
# If you violate any term of this license, then your rights under this
67+
# license (including the license grants of Sections 2 and 3) will
6868
# terminate immediately.
6969
# 9. Disclaimer of Warranty
70-
# THE WORK IS PROVIDED "AS IS" WITHOUT WARRANTIES OR CONDITIONS OF ANY
71-
# KIND, EITHER EXPRESS OR IMPLIED, INCLUDING WARRANTIES OR CONDITIONS OF
72-
# MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, TITLE OR
73-
# NON-INFRINGEMENT. YOU BEAR THE RISK OF UNDERTAKING ANY ACTIVITIES UNDER
74-
# THIS LICENSE. SOME STATES' CONSUMER LAWS DO NOT ALLOW EXCLUSION OF AN
70+
# THE WORK IS PROVIDED "AS IS" WITHOUT WARRANTIES OR CONDITIONS OF ANY
71+
# KIND, EITHER EXPRESS OR IMPLIED, INCLUDING WARRANTIES OR CONDITIONS OF
72+
# MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, TITLE OR
73+
# NON-INFRINGEMENT. YOU BEAR THE RISK OF UNDERTAKING ANY ACTIVITIES UNDER
74+
# THIS LICENSE. SOME STATES' CONSUMER LAWS DO NOT ALLOW EXCLUSION OF AN
7575
# IMPLIED WARRANTY, SO THIS DISCLAIMER MAY NOT APPLY TO YOU.
7676
# 10. Limitation of Liability
77-
# EXCEPT AS PROHIBITED BY APPLICABLE LAW, IN NO EVENT AND UNDER NO LEGAL
78-
# THEORY, WHETHER IN TORT (INCLUDING NEGLIGENCE), CONTRACT, OR OTHERWISE
79-
# SHALL ANY LICENSOR BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY DIRECT,
80-
# INDIRECT, SPECIAL, INCIDENTAL, OR CONSEQUENTIAL DAMAGES ARISING OUT OF
81-
# OR RELATED TO THIS LICENSE, THE USE OR INABILITY TO USE THE WORK
82-
# (INCLUDING BUT NOT LIMITED TO LOSS OF GOODWILL, BUSINESS INTERRUPTION,
83-
# LOST PROFITS OR DATA, COMPUTER FAILURE OR MALFUNCTION, OR ANY OTHER
84-
# COMMERCIAL DAMAGES OR LOSSES), EVEN IF THE LICENSOR HAS BEEN ADVISED OF
77+
# EXCEPT AS PROHIBITED BY APPLICABLE LAW, IN NO EVENT AND UNDER NO LEGAL
78+
# THEORY, WHETHER IN TORT (INCLUDING NEGLIGENCE), CONTRACT, OR OTHERWISE
79+
# SHALL ANY LICENSOR BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY DIRECT,
80+
# INDIRECT, SPECIAL, INCIDENTAL, OR CONSEQUENTIAL DAMAGES ARISING OUT OF
81+
# OR RELATED TO THIS LICENSE, THE USE OR INABILITY TO USE THE WORK
82+
# (INCLUDING BUT NOT LIMITED TO LOSS OF GOODWILL, BUSINESS INTERRUPTION,
83+
# LOST PROFITS OR DATA, COMPUTER FAILURE OR MALFUNCTION, OR ANY OTHER
84+
# COMMERCIAL DAMAGES OR LOSSES), EVEN IF THE LICENSOR HAS BEEN ADVISED OF
8585
# THE POSSIBILITY OF SUCH DAMAGES.
86-
#
87-
#
86+
#
87+
#
8888
#
8989
# Tool chain and platform settings for cross-compiling the SDK for the
9090
# Broadcom XLR CPU board.
@@ -99,10 +99,10 @@
9999
# Broadcom settings for TOOLCHAIN_DIR and KDIR
100100
-include $(SDK)/INTERNAL/appl/make/xlr_linux_broadcom.mk
101101

102-
# Too chain directories
102+
# Tool chain directories
103103
TOOLCHAIN_BIN_DIR = $(TOOLCHAIN_DIR)/bin
104104
LIBRARY_PATH = $(TOOLCHAIN_DIR)/lib:$(TOOLCHAIN_DIR)/lib64
105-
TARGET_ARCHITECTURE = x86_64-fedora-linux-gnu
105+
TARGET_ARCHITECTURE ?= x86_64-fedora-linux-gnu
106106

107107
# Add tools to system PATH
108108
TOOL_PATH := $(TOOLCHAIN_BIN_DIR):$(TOOL_PATH)
@@ -112,12 +112,12 @@ override PATH := $(TOOL_PATH):$(PATH)
112112
export TOOLCHAIN_BIN_DIR LIBRARY_PATH
113113

114114
# Tools prefix
115-
CROSS_COMPILE = $(TARGET_ARCHITECTURE)-
115+
CROSS_COMPILE ?= $(TARGET_ARCHITECTURE)-
116116

117117
# Build tools
118-
CC = $(CROSS_COMPILE)gcc
119-
LD = $(CROSS_COMPILE)ld
120-
AR = $(CROSS_COMPILE)ar
118+
CC ?= $(CROSS_COMPILE)gcc
119+
LD ?= $(CROSS_COMPILE)ld
120+
AR ?= $(CROSS_COMPILE)ar
121121

122122
# Architecture is required for building kernel modules
123123
export ARCH=x86_64

0 commit comments

Comments
 (0)