[PATCH] UBUNTU: [Packaging] Do not allow update-version-dkms to be run on a derivative kernel

Tim Gardner tim.gardner at canonical.com
Thu Mar 4 14:34:01 UTC 2021


It is too easy to run this script when drifting through the cranky cheat sheet
without really thinking about what you're doing while cranking a derivative
kernel.

Signed-off-by: Tim Gardner <tim.gardner at canonical.com>
---
 update-version-dkms | 5 +++++
 1 file changed, 5 insertions(+)

diff --git a/update-version-dkms b/update-version-dkms
index d90ce2c85f65..2057f7986fba 100755
--- a/update-version-dkms
+++ b/update-version-dkms
@@ -4,6 +4,11 @@ if [ "$#" -ne 1 ]; then
 	echo "Usage: $0 <pocket>" 1>&2
 	exit 1
 fi
+if ! grep -q master debian/debian.env; then
+	echo "Do not run this script on a derivative."
+	exit 1
+fi
+
 pocket="$1"
 
 case "$pocket" in
-- 
2.17.1




More information about the kernel-team mailing list