diff mbox series

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

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

Commit Message

Tim Gardner March 4, 2021, 8 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 | 8 ++++++++
 1 file changed, 8 insertions(+)

Comments

Thadeu Lima de Souza Cascardo March 4, 2021, 9:30 p.m. UTC | #1
On Thu, Mar 04, 2021 at 01:00:08PM -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>

Acked-by: Thadeu Lima de Souza Cascardo <cascardo@canonical.com>

> ---
>  update-version-dkms | 8 ++++++++
>  1 file changed, 8 insertions(+)
> 
> diff --git a/update-version-dkms b/update-version-dkms
> index d90ce2c85f65..cfff38531275 100755
> --- a/update-version-dkms
> +++ b/update-version-dkms
> @@ -19,6 +19,14 @@ esac
>  # find our changelog.
>  debian=$(awk -F= '($1 == "DEBIAN") { print $2 }' <debian/debian.env)
>  
> +# Make sure this isn't a derivative kernel
> +uconf=$debian/etc/update.conf
> +if [ -f $uconf ]
> +then
> +	echo "Do not run this script on a derivative kernel."
> +	exit 1
> +fi
> +
>  # identify the current series
>  series=$(dpkg-parsechangelog -l"$debian/changelog" -SDistribution)
>  if [ "$series" = "UNRELEASED" ]; then
> -- 
> 2.17.1
> 
> 
> -- 
> kernel-team mailing list
> kernel-team@lists.ubuntu.com
> https://lists.ubuntu.com/mailman/listinfo/kernel-team
Stefan Bader March 5, 2021, 6:50 a.m. UTC | #2
On 04.03.21 21:00, 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>
> ---

This does not work for hirsute forward-ports where the script must be run for 
all derivatives. Also this is not how changes should be rolled out.

-Stefan

>   update-version-dkms | 8 ++++++++
>   1 file changed, 8 insertions(+)
> 
> diff --git a/update-version-dkms b/update-version-dkms
> index d90ce2c85f65..cfff38531275 100755
> --- a/update-version-dkms
> +++ b/update-version-dkms
> @@ -19,6 +19,14 @@ esac
>   # find our changelog.
>   debian=$(awk -F= '($1 == "DEBIAN") { print $2 }' <debian/debian.env)
>   
> +# Make sure this isn't a derivative kernel
> +uconf=$debian/etc/update.conf
> +if [ -f $uconf ]
> +then
> +	echo "Do not run this script on a derivative kernel."
> +	exit 1
> +fi
> +
>   # identify the current series
>   series=$(dpkg-parsechangelog -l"$debian/changelog" -SDistribution)
>   if [ "$series" = "UNRELEASED" ]; then
>
Tim Gardner March 5, 2021, 12:36 p.m. UTC | #3
On 3/4/21 11:50 PM, Stefan Bader wrote:
> On 04.03.21 21:00, 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>
>> ---
> 
> This does not work for hirsute forward-ports where the script must be 
> run for all derivatives. 
> 

How about an example ? Surely there must be a programmatic way to 
determine when this script shouldn't be run.

 > Also this is not how changes should be rolled out.

If not via patches, then how ?

rtg

> -Stefan
> 
>>   update-version-dkms | 8 ++++++++
>>   1 file changed, 8 insertions(+)
>>
>> diff --git a/update-version-dkms b/update-version-dkms
>> index d90ce2c85f65..cfff38531275 100755
>> --- a/update-version-dkms
>> +++ b/update-version-dkms
>> @@ -19,6 +19,14 @@ esac
>>   # find our changelog.
>>   debian=$(awk -F= '($1 == "DEBIAN") { print $2 }' <debian/debian.env)
>> +# Make sure this isn't a derivative kernel
>> +uconf=$debian/etc/update.conf
>> +if [ -f $uconf ]
>> +then
>> +    echo "Do not run this script on a derivative kernel."
>> +    exit 1
>> +fi
>> +
>>   # identify the current series
>>   series=$(dpkg-parsechangelog -l"$debian/changelog" -SDistribution)
>>   if [ "$series" = "UNRELEASED" ]; then
>>
> 
>
Stefan Bader March 5, 2021, 1:48 p.m. UTC | #4
On 05.03.21 13:36, Tim Gardner wrote:
> 
> 
> On 3/4/21 11:50 PM, Stefan Bader wrote:
>> On 04.03.21 21:00, 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>
>>> ---
>>
>> This does not work for hirsute forward-ports where the script must be run for 
>> all derivatives.
> 
> How about an example ? Surely there must be a programmatic way to determine when 
> this script shouldn't be run.
> 
>  > Also this is not how changes should be rolled out.
> 
> If not via patches, then how ?

I would pretty much prefer "not at all" right now. It is complicated right now 
with those forward-ports. So it needs thinking (or maybe it can be avoided once 
we have external module signing). And not having to prevent people from changing 
the brittle working state would help to make progress with that.

For your daily work the rule is pretty simple: don't run it unless it is said 
so. The primary kernels are the only places you normally run it beside of the 
forward ports and those are usually done by someone else. And for the forward 
ports (and we all hope those will stop being needed for hirsute soon) we try to 
hint the cards.

-Stefan

> 
> rtg
> 
>> -Stefan
>>
>>>   update-version-dkms | 8 ++++++++
>>>   1 file changed, 8 insertions(+)
>>>
>>> diff --git a/update-version-dkms b/update-version-dkms
>>> index d90ce2c85f65..cfff38531275 100755
>>> --- a/update-version-dkms
>>> +++ b/update-version-dkms
>>> @@ -19,6 +19,14 @@ esac
>>>   # find our changelog.
>>>   debian=$(awk -F= '($1 == "DEBIAN") { print $2 }' <debian/debian.env)
>>> +# Make sure this isn't a derivative kernel
>>> +uconf=$debian/etc/update.conf
>>> +if [ -f $uconf ]
>>> +then
>>> +    echo "Do not run this script on a derivative kernel."
>>> +    exit 1
>>> +fi
>>> +
>>>   # identify the current series
>>>   series=$(dpkg-parsechangelog -l"$debian/changelog" -SDistribution)
>>>   if [ "$series" = "UNRELEASED" ]; then
>>>
>>
>>
>
diff mbox series

Patch

diff --git a/update-version-dkms b/update-version-dkms
index d90ce2c85f65..cfff38531275 100755
--- a/update-version-dkms
+++ b/update-version-dkms
@@ -19,6 +19,14 @@  esac
 # find our changelog.
 debian=$(awk -F= '($1 == "DEBIAN") { print $2 }' <debian/debian.env)
 
+# Make sure this isn't a derivative kernel
+uconf=$debian/etc/update.conf
+if [ -f $uconf ]
+then
+	echo "Do not run this script on a derivative kernel."
+	exit 1
+fi
+
 # identify the current series
 series=$(dpkg-parsechangelog -l"$debian/changelog" -SDistribution)
 if [ "$series" = "UNRELEASED" ]; then