summaryrefslogtreecommitdiff
path: root/scripts/package-build/linux-kernel/common.sh
diff options
context:
space:
mode:
authorChristian Breunig <christian@breunig.cc>2026-08-08 19:46:46 +0000
committerChristian Breunig <christian@breunig.cc>2026-08-08 22:39:56 +0200
commit07a3aa72ea686cbc922a60418500975b83016d80 (patch)
treef8c2cbebf49c17fb7d73d8401c4f592b480d891f /scripts/package-build/linux-kernel/common.sh
parent28b9d9d6bf304586bb4ba3529e5294047f649b73 (diff)
downloadvyos-build-07a3aa72ea686cbc922a60418500975b83016d80.tar.gz
vyos-build-07a3aa72ea686cbc922a60418500975b83016d80.zip
Kernel: T9181: replace fpm with real Debian packaging, drop fpm entirely
Convert build-nat-rtsp.sh, build-ipt-netflow.sh, build-intel-nic.sh, build-intel-qat.sh and build-linux-firmware.sh from fpm to debmake + debuild, matching the jool/realtek packaging style.
Diffstat (limited to 'scripts/package-build/linux-kernel/common.sh')
-rw-r--r--scripts/package-build/linux-kernel/common.sh29
1 files changed, 29 insertions, 0 deletions
diff --git a/scripts/package-build/linux-kernel/common.sh b/scripts/package-build/linux-kernel/common.sh
new file mode 100644
index 00000000..ad9689fa
--- /dev/null
+++ b/scripts/package-build/linux-kernel/common.sh
@@ -0,0 +1,29 @@
+#!/bin/sh
+# Shared helpers for scripts/package-build/linux-kernel/build-*.sh.
+# Source this file (". ${CWD}/common.sh"); it defines functions only.
+
+# require_amd64 <component-name>
+# Soft-exits (status 0) if not running on amd64.
+require_amd64() {
+ if ! dpkg-architecture -iamd64; then
+ echo "${1} is only buildable on amd64 platforms"
+ exit 0
+ fi
+}
+
+# debian_version <raw-version-string>
+# Sanitizes a git-describe-style string (e.g. "5.3-5-g5aeee02") into a
+# version safe for a "3.0 (native)" Debian source package:
+# - hyphens are replaced with "+", since debuild/dpkg-source treat any
+# hyphen as "this needs a separate orig tarball" even for native
+# packages, and reject the build asking for one that doesn't exist.
+# - the result is prefixed with "0~" if it doesn't start with a digit,
+# since Debian versions must start with a digit (a bare abbreviated
+# git hash can start with a letter).
+debian_version() {
+ v=$(echo "$1" | tr -- '-' '+')
+ case "$v" in
+ [0-9]*) echo "$v" ;;
+ *) echo "0~$v" ;;
+ esac
+}