Merge ~rbalint/shim/+git/shim-signed:nvidia-rename-ok into ~ubuntu-core-dev/shim/+git/shim-signed:master

Proposed by Balint Reczey
Status: Merged
Approved by: Mathieu Trudel-Lapierre
Approved revision: eb73ff22d22b90137e98046e8af4e495f8ff3fc7
Merged at revision: eb73ff22d22b90137e98046e8af4e495f8ff3fc7
Proposed branch: ~rbalint/shim/+git/shim-signed:nvidia-rename-ok
Merge into: ~ubuntu-core-dev/shim/+git/shim-signed:master
Diff against target: 38 lines (+19/-1)
1 file modified
update-secureboot-policy (+19/-1)
Reviewer Review Type Date Requested Status
Mathieu Trudel-Lapierre Approve
Review via email: mp+356440@code.launchpad.net
To post a comment you must log in.
Revision history for this message
Mathieu Trudel-Lapierre (cyphermox) :
review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1diff --git a/update-secureboot-policy b/update-secureboot-policy
2index e9aeb25..0c53443 100755
3--- a/update-secureboot-policy
4+++ b/update-secureboot-policy
5@@ -55,6 +55,23 @@ clear_new_dkms_list()
6 rm "$NEW_DKMS_LIST"
7 }
8
9+new_dkms_module()
10+{
11+ # handle nvidia module specially because it changed path
12+ if ! grep -q "/var/lib/dkms/nvidia" "$OLD_DKMS_LIST" && grep -q "/var/lib/dkms/nvidia" "$NEW_DKMS_LIST" ; then
13+ # nvidia module is newly added
14+ return 0
15+ fi
16+
17+ # return 0 if there is any other new module
18+ env LC_ALL=C comm -1 -3 $OLD_DKMS_LIST $NEW_DKMS_LIST | grep -q -v "/var/lib/dkms/nvidia"
19+}
20+
21+show_dkms_list_changes()
22+{
23+ diff -u $OLD_DKMS_LIST $NEW_DKMS_LIST >&2
24+}
25+
26 validate_password()
27 {
28 db_capb
29@@ -146,7 +163,8 @@ do_it()
30 if [ -z "$key$again" ] && echo "$seen_key" | grep -q ^30; then
31 echo "Running in non-interactive mode, doing nothing." >&2
32
33- if ! diff -u $OLD_DKMS_LIST $NEW_DKMS_LIST; then
34+ if new_dkms_module; then
35+ show_dkms_list_changes
36 clear_new_dkms_list
37 exit 1
38 else

Subscribers

People subscribed via source and target branches