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
diff --git a/scripts/check-kernels b/scripts/check-kernels
index 34c2dae..a2e15a9 100755
--- a/scripts/check-kernels
+++ b/scripts/check-kernels
@@ -132,12 +132,27 @@ wants_oem_kernel() {
132 fi132 fi
133 return 1133 return 1
134}134}
135wants_nvidia() {
136 test -e /run/ubuntu-drivers.autoinstall || return
137 for pkg in $(cat /run/ubuntu-drivers.autoinstall); do
138 case $pkg in
139 nvidia-driver-*)
140 echo $pkg | sed 's/nvidia-driver-/nvidia-/'
141 break
142 ;;
143 esac
144 done
145}
146nvidia_stem="$(wants_nvidia)"
135147
136if wants_oem_kernel; then148if wants_oem_kernel; then
137 if [ -n "$compatible" ]; then149 if [ -n "$compatible" ]; then
138 incompatible="${incompatible:+$incompatible }$compatible"150 incompatible="${incompatible:+$incompatible }$compatible"
139 compatible=""151 compatible=""
140 fi152 fi
153 if [ "$nvidia_stem" ]; then
154 OEM_KERNEL="${OEM_KERNEL} linux-modules-${nvidia_stem}-${OEM_KERNEL#linux-}"
155 fi
141 install_new="${install_new:+$install_new }${OEM_KERNEL}"156 install_new="${install_new:+$install_new }${OEM_KERNEL}"
142fi157fi
143158
@@ -149,6 +164,9 @@ kernel_image_to_meta () {
149}164}
150kernel_image_to_modules () {165kernel_image_to_modules () {
151 echo "$1" | sed -n 's/^linux-image-/linux-modules-/p' | xargs dpkg-query -W -f'${Package}\n' 2>/dev/null166 echo "$1" | sed -n 's/^linux-image-/linux-modules-/p' | xargs dpkg-query -W -f'${Package}\n' 2>/dev/null
167 if [ "$nvidia_stem" ]; then
168 echo "$1" | sed -n "s/^linux-image-/linux-modules-${nvidia_stem}-/p" | xargs dpkg-query -W -f'${Package}\n' 2>/dev/null
169 fi
152}170}
153171
154if [ -z "$compatible" ] && [ -z "$install_new" ]; then172if [ -z "$compatible" ] && [ -z "$install_new" ]; then

Subscribers

People subscribed via source and target branches