summaryrefslogtreecommitdiff
path: root/packages/keepalived/build.py
diff options
context:
space:
mode:
authoraapostoliuk <a.apostoliuk@vyos.io>2023-10-27 15:09:29 +0300
committerMergify <37929162+mergify[bot]@users.noreply.github.com>2023-10-27 16:07:53 +0000
commit9db3647a1fc19ebaa56a641389cc8c75fd0d6acd (patch)
tree680653bbe4af2a94d6a2a34ab3e24cd49088deb1 /packages/keepalived/build.py
parent0e75bd70bf07ed5b9322a94cf6e223a0c5c2859f (diff)
downloadvyos-build-9db3647a1fc19ebaa56a641389cc8c75fd0d6acd.tar.gz
vyos-build-9db3647a1fc19ebaa56a641389cc8c75fd0d6acd.zip
keepalived:T5402:Added patch with arp_ignore to 1 on IPv6 VMACs
Added patch with commit '9ca8688' to pkg-keepalived 1:2.2.7-1 https://github.com/acassen/keepalived/commit/9ca8688c7fe591e1face259f19ee6169e20a3438 Setting arp_ignore to 1 ensures that the VMAC interface does not respond to ARP requests for IPv4 addresses not configured on the VMAC. (cherry picked from commit 86a97880700a42f2416c196ce93853a4e7e18b4d)
Diffstat (limited to 'packages/keepalived/build.py')
-rwxr-xr-xpackages/keepalived/build.py50
1 files changed, 50 insertions, 0 deletions
diff --git a/packages/keepalived/build.py b/packages/keepalived/build.py
new file mode 100755
index 00000000..04f4791b
--- /dev/null
+++ b/packages/keepalived/build.py
@@ -0,0 +1,50 @@
+#!/usr/bin/env python3
+
+from pathlib import Path
+from shutil import copy as copy_file
+from subprocess import run
+
+
+# copy patches
+def apply_deb_patches() -> None:
+ """Apply patches to sources directory
+ """
+ patches_dir = Path('../patches')
+ current_dir: str = Path.cwd().as_posix()
+ if patches_dir.exists():
+ patches_list = list(patches_dir.iterdir())
+ patches_list.sort()
+ Path(f'{current_dir}/debian/patches').mkdir(parents=True, exist_ok=True)
+ series_file = Path(f'{current_dir}/debian/patches/series')
+ series_data = ''
+ for patch_file in patches_list:
+ print(f'Applying patch: {patch_file.name}')
+ copy_file(patch_file, f'{current_dir}/debian/patches/')
+ if series_file.exists():
+ series_data: str = series_file.read_text()
+ series_data = f'{series_data}\n{patch_file.name}'
+ series_file.write_text(series_data)
+
+
+def build_package() -> bool:
+ """Build a package
+
+ Returns:
+ bool: build status
+ """
+ build_cmd: list[str] = ['dpkg-buildpackage', '-uc', '-us', '-tc', '-b']
+ build_status: int = run(build_cmd).returncode
+
+ if build_status:
+ return False
+ return True
+
+
+# build a package
+if __name__ == '__main__':
+ apply_deb_patches()
+
+ if not build_package():
+ exit(1)
+
+ exit()