mirror of
https://github.com/vyos/vyos-build.git
synced 2025-10-01 20:28:40 +02:00
Merge pull request #924 from c-po/ipt-netflow
Kernel: T6230: add ipt_NETFLOW out-of-tree module
This commit is contained in:
commit
03f73ec571
@ -7,6 +7,7 @@ packages = [
|
||||
"vyos-intel-qat",
|
||||
"vyos-intel-ixgbe",
|
||||
"vyos-intel-ixgbevf",
|
||||
"vyos-ipt-netflow",
|
||||
]
|
||||
|
||||
[additional_repositories.salt]
|
||||
|
||||
@ -9,6 +9,7 @@
|
||||
/ovpn-dco
|
||||
/nat-rtsp*
|
||||
/jool*
|
||||
/ipt-netflow*
|
||||
/qat*
|
||||
/QAT*
|
||||
*.tar.gz
|
||||
|
||||
65
scripts/package-build/linux-kernel/build-ipt-netflow.sh
Executable file
65
scripts/package-build/linux-kernel/build-ipt-netflow.sh
Executable file
@ -0,0 +1,65 @@
|
||||
#!/bin/sh
|
||||
CWD=$(pwd)
|
||||
KERNEL_VAR_FILE=${CWD}/kernel-vars
|
||||
|
||||
IPT_NETFLOW_SRC=${CWD}/ipt-netflow
|
||||
if [ ! -d ${IPT_NETFLOW_SRC} ]; then
|
||||
echo "ipt_NETFLOW source not found"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
if [ ! -f ${KERNEL_VAR_FILE} ]; then
|
||||
echo "Kernel variable file '${KERNEL_VAR_FILE}' does not exist, run ./build_kernel.sh first"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
cd ${IPT_NETFLOW_SRC}
|
||||
if [ -d .git ]; then
|
||||
git reset --hard HEAD
|
||||
git clean --force -d -x
|
||||
fi
|
||||
|
||||
. ${KERNEL_VAR_FILE}
|
||||
|
||||
DRIVER_VERSION=$(git describe | sed s/^v//)
|
||||
|
||||
# Build up Debian related variables required for packaging
|
||||
DEBIAN_ARCH=$(dpkg --print-architecture)
|
||||
DEBIAN_DIR="tmp/lib/modules/${KERNEL_VERSION}${KERNEL_SUFFIX}/extra"
|
||||
DEBIAN_CONTROL="${DEBIAN_DIR}/DEBIAN/control"
|
||||
DEBIAN_POSTINST="${CWD}/vyos-ipt-netflow.postinst"
|
||||
|
||||
./configure --enable-aggregation --kdir=${KERNEL_DIR}
|
||||
make all
|
||||
|
||||
if [ "x$?" != "x0" ]; then
|
||||
exit 1
|
||||
fi
|
||||
|
||||
if [ -f ${DEBIAN_DIR}.deb ]; then
|
||||
rm ${DEBIAN_DIR}.deb
|
||||
fi
|
||||
|
||||
if [ ! -d ${DEBIAN_DIR} ]; then
|
||||
mkdir -p ${DEBIAN_DIR}
|
||||
fi
|
||||
|
||||
# build Debian package
|
||||
echo "I: Building Debian package vyos-ipt-netflow"
|
||||
cp ipt_NETFLOW.ko ${DEBIAN_DIR}
|
||||
|
||||
# Sign generated Kernel modules
|
||||
${CWD}/sign-modules.sh ${DEBIAN_DIR}
|
||||
|
||||
echo "#!/bin/sh" > ${DEBIAN_POSTINST}
|
||||
echo "/sbin/depmod -a ${KERNEL_VERSION}${KERNEL_SUFFIX}" >> ${DEBIAN_POSTINST}
|
||||
|
||||
cd ${CWD}
|
||||
|
||||
fpm --input-type dir --output-type deb --name vyos-ipt-netflow \
|
||||
--version ${DRIVER_VERSION} --deb-compression gz \
|
||||
--maintainer "VyOS Package Maintainers <maintainers@vyos.net>" \
|
||||
--description "ipt_NETFLOW module" \
|
||||
--depends linux-image-${KERNEL_VERSION}${KERNEL_SUFFIX} \
|
||||
--license "GPL2" -C ${IPT_NETFLOW_SRC}/tmp --after-install ${DEBIAN_POSTINST}
|
||||
|
||||
@ -143,6 +143,8 @@ def build_package(package: dict, dependencies: list) -> None:
|
||||
build_realtek_r8152()
|
||||
elif package['build_cmd'] == 'build_jool':
|
||||
build_jool()
|
||||
elif package['build_cmd'] == 'build_ipt_netflow':
|
||||
build_ipt_netflow(package['commit_id'], package['scm_url'])
|
||||
elif package['build_cmd'] == 'build_openvpn_dco':
|
||||
build_openvpn_dco(package['commit_id'], package['scm_url'])
|
||||
create_tarball(f'{package["name"]}-{package["commit_id"]}', f'{package["name"]}')
|
||||
@ -238,6 +240,11 @@ def build_jool():
|
||||
"""Build Jool"""
|
||||
run(['echo y | ./build-jool.py'], check=True, shell=True)
|
||||
|
||||
def build_ipt_netflow(commit_id, scm_url):
|
||||
"""Build ipt_NETFLOW"""
|
||||
repo_dir = Path('ipt-netflow')
|
||||
clone_or_update_repo(repo_dir, scm_url, commit_id)
|
||||
run(['./build-ipt-netflow.sh'], check=True, shell=True)
|
||||
|
||||
def build_openvpn_dco(commit_id, scm_url):
|
||||
"""Build OpenVPN DCO"""
|
||||
|
||||
@ -22,7 +22,6 @@ commit_id = "1.13.0"
|
||||
scm_url = "https://github.com/accel-ppp/accel-ppp.git"
|
||||
build_cmd = "build_accel_ppp"
|
||||
|
||||
|
||||
[[packages]]
|
||||
name = "ovpn-dco"
|
||||
commit_id = "v0.2.20231117"
|
||||
@ -35,7 +34,6 @@ commit_id = "475af0a"
|
||||
scm_url = "https://github.com/maru-sama/rtsp-linux.git"
|
||||
build_cmd = "build_nat_rtsp"
|
||||
|
||||
|
||||
[[packages]]
|
||||
name = "qat"
|
||||
commit_id = ""
|
||||
@ -77,3 +75,9 @@ name = "realtek-r8152"
|
||||
commit_id = ""
|
||||
scm_url = ""
|
||||
build_cmd = "build_realtek_r8152"
|
||||
|
||||
[[packages]]
|
||||
name = "ipt-netflow"
|
||||
commit_id = "0eb2092e93"
|
||||
scm_url = "https://github.com/aabc/ipt-netflow"
|
||||
build_cmd = "build_ipt_netflow"
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user