Skip to content

Commit 2f2bfb5

Browse files
T7666: Add script to build accel-ppp-ng binaries (#1002)
* T7666: Add vpp-sflow src patches and accel-ppp-ng to gitignore * T7666: Add script to build accel-ppp-ng binaries * Update scripts/package-build/linux-kernel/build-accel-ppp-ng.sh --------- Co-authored-by: Daniil Baturin <daniil@baturin.org>
1 parent 43fdd70 commit 2f2bfb5

5 files changed

Lines changed: 88 additions & 0 deletions

File tree

scripts/package-build/linux-kernel/.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22
/wireguard
33
/wireguard-linux-compat
44
/accel-ppp
5+
/accel-ppp-ng
56
/intel-qat
67
/linux-firmware
78
/vyos-drivers-intel*
Lines changed: 69 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,69 @@
1+
#!/bin/sh
2+
3+
CWD=$(pwd)
4+
KERNEL_VAR_FILE=${CWD}/kernel-vars
5+
VPP_INCLUDE_PATH="${CWD}/../vpp/vpp/src/vpp-api:${CWD}/../vpp/vpp/src:${CWD}/../vpp/vpp/build-root/build-vpp-native/vpp/CMakeFiles/vpp-api"
6+
VPP_LIBRARY_PATH="${CWD}/../vpp/vpp/build-root/build-vpp-native/vpp/CMakeFiles/debian/libvppinfra/usr/lib/x86_64-linux-gnu/:${CWD}/../vpp/vpp/build-root/install-vpp-native/vpp/lib/x86_64-linux-gnu/"
7+
VPP_LIB_CHECK_PATH="${CWD}/../vpp/vpp/build-root/build-vpp-native/vpp/CMakeFiles/debian/libvppinfra/usr/lib/x86_64-linux-gnu/"
8+
9+
ACCEL_SRC=${CWD}/accel-ppp-ng
10+
11+
# Build VPP as we need VPP libraries
12+
cd ../vpp/
13+
./build.py
14+
cd ${CWD}
15+
16+
if [ ! -d ${VPP_LIB_CHECK_PATH} ]; then
17+
echo "VPP source libraries not found"
18+
exit 1
19+
fi
20+
21+
if [ ! -d ${ACCEL_SRC} ]; then
22+
echo "Accel-PPP source not found"
23+
exit 1
24+
fi
25+
26+
if [ ! -f ${KERNEL_VAR_FILE} ]; then
27+
echo "Kernel variable file '${KERNEL_VAR_FILE}' does not exist, run ./build_kernel.sh first"
28+
exit 1
29+
fi
30+
31+
cd ${ACCEL_SRC}
32+
git reset --hard HEAD
33+
git clean --force -d -x
34+
35+
PATCH_DIR=${CWD}/patches/accel-ppp-ng
36+
if [ -d $PATCH_DIR ]; then
37+
cd ${ACCEL_SRC}
38+
for patch in $(ls ${PATCH_DIR})
39+
do
40+
echo "I: Apply patch: ${PATCH_DIR}/${patch}"
41+
patch -p1 < ${PATCH_DIR}/${patch}
42+
done
43+
fi
44+
45+
. ${KERNEL_VAR_FILE}
46+
mkdir -p ${ACCEL_SRC}/build
47+
cd ${ACCEL_SRC}/build
48+
49+
echo "I: Build Accel-PPP Debian package"
50+
cmake -DBUILD_IPOE_DRIVER=TRUE \
51+
-DBUILD_VLAN_MON_DRIVER=TRUE \
52+
-DCMAKE_INSTALL_PREFIX=/usr \
53+
-DKDIR=${KERNEL_DIR} \
54+
-DLUA=5.3 \
55+
-DMODULES_KDIR=${KERNEL_VERSION}${KERNEL_SUFFIX} \
56+
-DHAVE_VPP=1 \
57+
-DCPACK_TYPE=Debian12 ..
58+
CPATH="${VPP_INCLUDE_PATH}" LIBRARY_PATH="${VPP_LIBRARY_PATH}" make
59+
60+
# Sign generated Kernel modules
61+
${CWD}/sign-modules.sh .
62+
63+
cpack -G DEB
64+
65+
# rename resulting Debian package according git description
66+
mv accel-ppp*.deb ${CWD}/accel-ppp-ng_$(git describe --always --tags)_$(dpkg --print-architecture).deb
67+
68+
# move VPP binaries to linux-kernel dir, CI will get VPP .deb here
69+
cp ${CWD}/../vpp/*.deb ${CWD}

scripts/package-build/linux-kernel/build.py

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -132,6 +132,9 @@ def build_package(package: dict, dependencies: list) -> None:
132132
elif package['build_cmd'] == 'build_accel_ppp':
133133
build_accel_ppp(package['commit_id'], package['scm_url'])
134134
create_tarball(f'{package["name"]}-{package["commit_id"]}', f'{package["name"]}')
135+
elif package['build_cmd'] == 'build_accel_ppp_ng':
136+
build_accel_ppp_ng(package['commit_id'], package['scm_url'])
137+
create_tarball(f'{package["name"]}-{package["commit_id"]}', f'{package["name"]}')
135138
elif package['build_cmd'] == 'build_intel_qat':
136139
build_intel_qat()
137140
elif package['build_cmd'] == 'build_intel_igb':
@@ -217,6 +220,13 @@ def build_accel_ppp(commit_id, scm_url):
217220
run(['./build-accel-ppp.sh'], check=True)
218221

219222

223+
def build_accel_ppp_ng(commit_id, scm_url):
224+
"""Build accel-ppp-ng"""
225+
repo_dir = Path('accel-ppp-ng')
226+
clone_or_update_repo(repo_dir, scm_url, commit_id)
227+
run(['./build-accel-ppp-ng.sh'], check=True)
228+
229+
220230
def build_intel_qat():
221231
"""Build Intel QAT"""
222232
run(['./build-intel-qat.sh'], check=True)

scripts/package-build/linux-kernel/package.toml

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,12 @@ commit_id = "1.13.0"
2222
scm_url = "https://github.com/accel-ppp/accel-ppp.git"
2323
build_cmd = "build_accel_ppp"
2424

25+
[[packages]]
26+
name = "accel-ppp-ng"
27+
commit_id = "5bcc6dd"
28+
scm_url = "https://github.com/accel-ppp/accel-ppp-ng.git"
29+
build_cmd = "build_accel_ppp_ng"
30+
2531
[[packages]]
2632
name = "ovpn-dco"
2733
commit_id = "v0.2.20231117"
Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,4 @@
11
/vpp/
22
/vyos-vpp-patches/
3+
/patches/
4+
/vpp-sflow/

0 commit comments

Comments
 (0)