Kernel 6.2.x on an Intel-system

Kernel 6.2.x on an Intel-system

When I updated my laptop today, I discovered an error-message during the apt upgrade:
W: Possible missing firmware /lib/firmware/i915/skl_guc_ver6.bin for module i915_bpo.
This lead me to a bit of searching around. Most solutions was quite rustic and manual fixing with downloading and copying files in the correct directories and rebuilding a>
But after some frustration and more downdrilling in the search results, I came upon this solution from a post on askubuntu.com. A simple script which handled everything. J>

#!/bin/bash

WARNING_PATTERN='(?<=W: Possible missing firmware /lib/firmware/i915/)[\w.]+.bin(?= for module i915)'
DOWNLOAD_URL='https://git.kernel.org/pub/scm/linux/kernel/git/firmware/linux-firmware.git/tree/i915/{}'
FIRMWARE_DIR='/lib/firmware/i915'

shopt -s nullglob

WORKDIR="$(mktemp -d)"
cd "$WORKDIR" || exit 1
echo "Will check for missing i915 firmware and download blobs in '$WORKDIR'."

sudo update-initramfs -u |&
    grep -Po "$WARNING_PATTERN" |
    xargs -t -I {} curl -O "$DOWNLOAD_URL"

if [[ -n "$(shopt -s nullglob; echo ./*.bin)" ]] ; then
    sudo chown root: ./*.bin
    sudo chmod 644 ./*.bin
    sudo mv ./*.bin "$FIRMWARE_DIR"
    sudo update-initramfs -u
else
    echo 'No missing firmware found/downloaded.'
fi

rmdir "$WORKDIR"`

The script was shamelessly "stolen" from Here