Skip to content

Commit 03c6777

Browse files
authored
Opportunistically use a matching kernel version for building the modules (#1138)
When building the team kernel module (and others), if a matching source kernel version exists, then make sure we use that exact version. This avoids the case where we end up pulling the sources for a newer kernel version when a matching one exists. Signed-off-by: Saikrishna Arcot <sarcot@microsoft.com>
1 parent 41acbf8 commit 03c6777

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

.azure-pipelines/build_and_install_module.sh

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -54,8 +54,10 @@ build_and_install_kmodule()
5454
"can be loaded into the kernel or function correctly. If possible, please update your kernel and reboot " \
5555
"your system so that it's running the matching kernel version." >&2
5656
echo "Continuing with the build anyways" >&2
57+
apt-get source "linux-image-unsigned-${KERNEL_RELEASE}"
58+
else
59+
apt-get source "linux-image-unsigned-${KERNEL_RELEASE}=${KERNEL_PACKAGE_VERSION}"
5760
fi
58-
apt-get source "linux-image-unsigned-${KERNEL_RELEASE}"
5961

6062
# Recover the original apt sources list
6163
cp /etc/apt/sources.list.bk /etc/apt/sources.list

0 commit comments

Comments
 (0)