NACK: [Patch 1/1] [kernel-snaps-uc22/main] Include Atheros firmware files
Juerg Haefliger
juerg.haefliger at canonical.com
Wed Oct 4 15:03:17 UTC 2023
On Wed, 4 Oct 2023 13:16:16 +0200
Sergio Costas Rodriguez <sergio.costas at canonical.com> wrote:
> When using the Ubuntu Core 22 kernel in an Asus Zenbook UX22,
> this error is shown in journalctl:
>
> usb 1-1-1: Direct firmware load for ar3k/AthrBT_0x01020200.dfu failed with error -2
> Bluetooth: Patch file not found ar3k/AthrBT_0x01020200.dfu
> Bluetooth: Loading patch file failed
> ath3k: probe of 1-1.1:1.0 failed with error -2
>
> and, of course, bluetooth doesn't work.
>
> This patch adds the missing files, and makes bluetooth work.
>
> Fix https://bugs.launchpad.net/ubuntu/+bug/2025054
This needs to be exactly in this form:
BugLink: https://bugs.launchpad.net/bugs/2025054
>
> Signed-off-by: Sergio Costas Rodriguez <sergio.costas at canonical.com>
> ---
> trim-firmware | 18 ++++++++++++++++++
> 1 file changed, 18 insertions(+)
>
> diff --git a/trim-firmware b/trim-firmware
> index 148c964..e2fe269 100755
> --- a/trim-firmware
> +++ b/trim-firmware
> @@ -68,6 +68,24 @@ if [ -e "${DESTDIR}"/firmware/regulatory.db ] ; then
> cp "${DESTDIR}"/firmware/regulatory.* "${DESTDIR}"/firmware.new
> fi
>
> +# Copy all AthrBT files, because they are needed for some devices
> +# like the original Asus Zenbook, but only if the module ath3k.ko
> +# is compiled
> +if [[ -n `find "${DESTDIR}"/modules -name ath3k.ko` ]] ; then
This bombs out if find returns nothing due to lack of quoting. Also, no
double brackets necessary and ticks '`' are deprecated syntax. And make it
future proof to handle compressed modules:
if [ -n "$(find "${DESTDIR}"/modules -name 'ath3k.ko*')" ] ; then
> + if [ -d "${DESTDIR}"/firmware/ar3k ] ; then
This check isn't really necessary. The script uses 'set -e' so will fail if any of
the commands fail. Just assume the files exist and copy them and if that
fails, the build will fail.
> + mkdir -p "${DESTDIR}"/firmware.new/ar3k
> + cp -a "${DESTDIR}"/firmware/ar3k/AthrBT_0x*.dfu "${DESTDIR}"/firmware.new/ar3k/
> + # the "ramps_" files are refered in the source code of the driver, so
> + # we must add them too.
> + cp -a "${DESTDIR}"/firmware/ar3k/ramps_0x*.dfu "${DESTDIR}"/firmware.new/ar3k/
What about ath3k-1.fw?
$ modinfo ath3k | grep ^firmware
firmware: ath3k-1.fw
> + else
> + # fail if the folder doesn't exist, because that means that this
> + # script requires a rework
> + echo "The firmware folder for the Atheros Bluetoot firmware doesn't exist".
> + exit 1
> + fi
> +fi
> +
> # Move kernel firmware files to the new firmware directory
> for d in "${DESTDIR}"/modules/* ; do
> if [ -d "${DESTDIR}"/firmware/"${d##*/}" ] ; then
...Juerg
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 833 bytes
Desc: OpenPGP digital signature
URL: <https://lists.ubuntu.com/archives/kernel-team/attachments/20231004/5409b79c/attachment.sig>
More information about the kernel-team
mailing list