diff mbox series

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

Message ID 20210304143401.16129-2-tim.gardner@canonical.com
State New
Headers show
Series Do not allow update-version-dkms to be run on a derivative kernel | expand

Commit Message

Tim Gardner March 4, 2021, 2:34 p.m. UTC
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@canonical.com>
---
 update-version-dkms | 5 +++++
 1 file changed, 5 insertions(+)

Comments

Thadeu Lima de Souza Cascardo March 4, 2021, 2:44 p.m. UTC | #1
On Thu, Mar 04, 2021 at 07:34:01AM -0700, Tim Gardner wrote:
> 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@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
> +

Some derivatives do not have a parent and should have their dkms updated.

Maybe look at $DEBIAN/etc/update.conf?

Cascardo.

>  pocket="$1"
>  
>  case "$pocket" in
> -- 
> 2.17.1
> 
> 
> -- 
> kernel-team mailing list
> kernel-team@lists.ubuntu.com
> https://lists.ubuntu.com/mailman/listinfo/kernel-team
diff mbox series

Patch

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