Merge ubiquity:xnox/fix-nvidia-oem into ubiquity:master

Proposed by Dimitri John Ledkov
Status: Merged
Merged at revision: 984e924d961a4dacd164aa4858f1901c777efdf9
Proposed branch: ubiquity:xnox/fix-nvidia-oem
Merge into: ubiquity:master
Diff against target: 42 lines (+18/-0)
1 file modified
scripts/check-kernels (+18/-0)
Reviewer Review Type Date Requested Status
Ubuntu Installer Team Pending
Review via email: mp+382677@code.launchpad.net

Commit message

check-kernels: install the right nvidia modules for the OEM kernel.

LP: #1873867

Description of the change

check-kernels: install the right nvidia modules for the OEM kernel.

LP: #1873867

To post a comment you must log in.

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1diff --git a/scripts/check-kernels b/scripts/check-kernels
2index 34c2dae..a2e15a9 100755
3--- a/scripts/check-kernels
4+++ b/scripts/check-kernels
5@@ -132,12 +132,27 @@ wants_oem_kernel() {
6 fi
7 return 1
8 }
9+wants_nvidia() {
10+ test -e /run/ubuntu-drivers.autoinstall || return
11+ for pkg in $(cat /run/ubuntu-drivers.autoinstall); do
12+ case $pkg in
13+ nvidia-driver-*)
14+ echo $pkg | sed 's/nvidia-driver-/nvidia-/'
15+ break
16+ ;;
17+ esac
18+ done
19+}
20+nvidia_stem="$(wants_nvidia)"
21
22 if wants_oem_kernel; then
23 if [ -n "$compatible" ]; then
24 incompatible="${incompatible:+$incompatible }$compatible"
25 compatible=""
26 fi
27+ if [ "$nvidia_stem" ]; then
28+ OEM_KERNEL="${OEM_KERNEL} linux-modules-${nvidia_stem}-${OEM_KERNEL#linux-}"
29+ fi
30 install_new="${install_new:+$install_new }${OEM_KERNEL}"
31 fi
32
33@@ -149,6 +164,9 @@ kernel_image_to_meta () {
34 }
35 kernel_image_to_modules () {
36 echo "$1" | sed -n 's/^linux-image-/linux-modules-/p' | xargs dpkg-query -W -f'${Package}\n' 2>/dev/null
37+ if [ "$nvidia_stem" ]; then
38+ echo "$1" | sed -n "s/^linux-image-/linux-modules-${nvidia_stem}-/p" | xargs dpkg-query -W -f'${Package}\n' 2>/dev/null
39+ fi
40 }
41
42 if [ -z "$compatible" ] && [ -z "$install_new" ]; then

Subscribers

People subscribed via source and target branches