2011-02-25 02:39:40

by Jeff Mahoney

[permalink] [raw]
Subject: [PATCH] firmware: Allow release-specific firmware dir

Every kernel package trying to provide files under /lib/firmware runs
into problems really quickly with multiple kernels installed.

This patch moves them to /lib/firmware/$KERNELRELEASE. udev v127's
firmware.sh looks there first before falling back to /lib/firmware.

Signed-off-by: Jeff Mahoney <[email protected]>
---
Makefile | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)

--- a/Makefile
+++ b/Makefile
@@ -975,7 +975,7 @@ depend dep:

# ---------------------------------------------------------------------------
# Firmware install
-INSTALL_FW_PATH=$(INSTALL_MOD_PATH)/lib/firmware
+INSTALL_FW_PATH=$(INSTALL_MOD_PATH)/lib/firmware/$(KERNELRELEASE)
export INSTALL_FW_PATH

PHONY += firmware_install
--
Jeff Mahoney
SUSE Labs


2011-02-25 05:01:06

by Michael Tokarev

[permalink] [raw]
Subject: Re: [PATCH] firmware: Allow release-specific firmware dir

25.02.2011 05:39, Jeff Mahoney wrote:
> Every kernel package trying to provide files under /lib/firmware runs
> into problems really quickly with multiple kernels installed.

Which problems?

> This patch moves them to /lib/firmware/$KERNELRELEASE. udev v127's
> firmware.sh looks there first before falling back to /lib/firmware.

This was the way it worked before, -- all fw in kernel-specific dir.
Nowadays it moved to a common place, /lib/firmware, since the blobs
there are not kernel-specific but hardware-specific. And now you
propose to move it back. Why?

/mjt

2011-02-25 15:03:12

by Jeff Mahoney

[permalink] [raw]
Subject: Re: [PATCH] firmware: Allow release-specific firmware dir

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

On 02/25/2011 12:01 AM, Michael Tokarev wrote:
> 25.02.2011 05:39, Jeff Mahoney wrote:
>> Every kernel package trying to provide files under /lib/firmware runs
>> into problems really quickly with multiple kernels installed.
>
> Which problems?
>
>> This patch moves them to /lib/firmware/$KERNELRELEASE. udev v127's
>> firmware.sh looks there first before falling back to /lib/firmware.
>
> This was the way it worked before, -- all fw in kernel-specific dir.
> Nowadays it moved to a common place, /lib/firmware, since the blobs
> there are not kernel-specific but hardware-specific. And now you
> propose to move it back. Why?

Because every time you run 'make modules_install', it overwrites
whatever is in /lib/firmware when there is a collision. When you're
working with multiple kernel versions, you can end up with firmware
blobs from older builds, and that may not be what you want. If the right
answer is to always use kernel-firmware, then the firmwares should
probably not be in the kernel tree at all.

As I mentioned in the header, udev looks in /lib/firmware/$(uname -r)
already. Since Aug 2008, in fact.

- -Jeff

- --
Jeff Mahoney
SUSE Labs
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v2.0.16 (GNU/Linux)
Comment: Using GnuPG with SUSE - http://enigmail.mozdev.org/

iEYEARECAAYFAk1nxKYACgkQLPWxlyuTD7KohACfRmDshnoXwVTpSs+xblUfQSKQ
svkAnikK8sk7S6Fd8NKT1Ui2ugaP7IzC
=odyW
-----END PGP SIGNATURE-----

2011-02-25 16:54:54

by David Woodhouse

[permalink] [raw]
Subject: Re: [PATCH] firmware: Allow release-specific firmware dir

On Fri, 2011-02-25 at 10:03 -0500, Jeff Mahoney wrote:
>
> Because every time you run 'make modules_install', it overwrites
> whatever is in /lib/firmware when there is a collision. When you're
> working with multiple kernel versions, you can end up with firmware
> blobs from older builds, and that may not be what you want. If the
> right answer is to always use kernel-firmware, then the firmwares
> should probably not be in the kernel tree at all.

The right answer is to always use kernel-firmware. The firmwares should
not be in the kernel tree at all.

Changing the default behaviour of 'make modules_install' so that it no
longer installs firmware would be the better option. As a stop-gap until
we finally do drop the legacy firmware images from the source tree.

--
dwmw2

2011-03-01 00:49:18

by Andrew Morton

[permalink] [raw]
Subject: Re: [PATCH] firmware: Allow release-specific firmware dir

On Thu, 24 Feb 2011 21:39:35 -0500
Jeff Mahoney <[email protected]> wrote:

> Every kernel package trying to provide files under /lib/firmware runs
> into problems really quickly with multiple kernels installed.
>
> This patch moves them to /lib/firmware/$KERNELRELEASE. udev v127's
> firmware.sh looks there first before falling back to /lib/firmware.
>
> ...
>
> --- a/Makefile
> +++ b/Makefile
> @@ -975,7 +975,7 @@ depend dep:
>
> # ---------------------------------------------------------------------------
> # Firmware install
> -INSTALL_FW_PATH=$(INSTALL_MOD_PATH)/lib/firmware
> +INSTALL_FW_PATH=$(INSTALL_MOD_PATH)/lib/firmware/$(KERNELRELEASE)
> export INSTALL_FW_PATH
>
> PHONY += firmware_install

What happens if the user is running older udev?