Fix kernel download script to get actual kernel package

Co-authored-by: johndoe6345789 <224850594+johndoe6345789@users.noreply.github.com>
This commit is contained in:
copilot-swe-agent[bot]
2025-12-29 19:41:29 +00:00
parent dfa5b2f414
commit 37ebd5fdfa

View File

@@ -6,5 +6,11 @@ set -e
mkdir -p /kernel
apt-get update
apt-get download linux-image-generic
dpkg -x linux-image-*.deb /kernel
# The linux-image-generic is a metapackage, we need to get the actual kernel
KERNEL_VERSION=$(apt-cache depends linux-image-generic | grep Depends | grep linux-image | head -1 | awk '{print $2}')
apt-get download $KERNEL_VERSION
# Extract the actual kernel package (not the metapackage)
dpkg -x ${KERNEL_VERSION}*.deb /kernel
rm -rf /var/lib/apt/lists/* linux-image-*.deb