New package: linux-firmware
PATCH v3 1/1 New package: linux-firmware
From: Yegor Yefremov <[email protected]>
add infrastructure for closed binary blobs
---
Changes:
v3:
typo fix (Michael S. Zick)
v2:
change package name from firmware to linux-firmware (Gustavo Zacarias) create more granular options (Gustavo Zacarias)
package/Config.in | 1 + package/linux-firmware/Config.in | 46 +++++++++++++++++ package/linux-firmware/linux-firmware.mk | 79 ++++++++++++++++++++++++++++++ 3 files changed, 126 insertions(+), 0 deletions(-) create mode 100644 package/linux-firmware/Config.in create mode 100644 package/linux-firmware/linux-firmware.mk
package/Config.in +1 -0
@@ -185,6 +185,7 @@ source "package/input-tools/Config.in" source "package/iostat/Config.in" source "package/irda-utils/Config.in" source "package/kbd/Config.in" +source "package/linux-firmware/Config.in" source "package/lm-sensors/Config.in" source "package/lsuio/Config.in" source "package/lvm2/Config.in"
package/linux-firmware/Config.in new file +46 -0
46 lines not on this page · raw message
package/linux-firmware/linux-firmware.mk new file +79 -0
79 lines not on this page · raw message
Signature · 1 line
1.7.1.1
PATCH v3 1/1 New package: linux-firmware
Quoted 3 lines · yegorslists at googlemail.com
Changes:
v3:
typo fix (Michael S. Zick)
v4: alpha sort menu options? (Ralink before TI even if we prefer TI hehe)
Quoted 12 lines
package/linux-firmware/linux-firmware.mk new file +12
-0+# rt73 +ifeq ($(BR2_PACKAGE_LINUX_FIRMWARE_RALINK_RT2XX),y) +define FIRMWARE_RALINK_RT2XX_INSTALL_TO_TARGET + $(INSTALL) -m 0644 -D $(@D)/rt2860.bin \ + $(TARGET_DIR)/lib/firmware + $(INSTALL) -m 0644 -D $(@D)/rt2870.bin \ + $(TARGET_DIR)/lib/firmware + $(INSTALL) -m 0644 -D $(@D)/rt3071.bin \ + $(TARGET_DIR)/lib/firmware + cp -rf $(@D)/rt30* $(TARGET_DIR)/lib/firmware + $(INSTALL) -m 0644 -D $(@D)/LICENCE.ralink-firmware.txt \ + $(TARGET_DIR)/lib/firmware
package/linux-firmware/linux-firmware.mk line 77
Quoted 10 lines
package/linux-firmware/linux-firmware.mk new file +10
-0+endef +endif + +define LINUX_FIRMWARE_INSTALL_TARGET_CMDS + $(FIRMWARE_TI_WL127X_INSTALL_TO_TARGET) + $(FIRMWARE_TI_WL128X_INSTALL_TO_TARGET) + $(FIRMWARE_RALINK_RT61_INSTALL_TO_TARGET) + $(FIRMWARE_RALINK_RT73_INSTALL_TO_TARGET) + $(FIRMWARE_RALINK_RT2XX_INSTALL_TO_TARGET) +endef
These constructs can get too long too fast, why not something like...
ifeq ($(BR2_PACKAGE_LINUX_FIRMWARE_RALINK_RT2XXX),y)
LINUX_FIRMWARE_FILES += rt2860.bin rt2870.bin rt30*.bin
LICENCE.ralink-firmware.txt
endif
define LINUX_FIRMWARE_INSTALL_TARGET_CMDS
cp -af $(addprefix $(@D)/, $(LINUX_FIRMWARE_FILES))
$(TARGET_DIR)/lib/firmware
endef
Will be nicer when other people add their wanted firmware to the package.
Regards.
PATCH v3 1/1 New package: linux-firmware
Le Thu, 26 Jan 2012 09:00:47 -0300,
Gustavo Zacarias <[email protected]> a ?crit :
Quoted 7 lines
These constructs can get too long too fast, why not something like...
ifeq ($(BR2_PACKAGE_LINUX_FIRMWARE_RALINK_RT2XXX),y)
LINUX_FIRMWARE_FILES += rt2860.bin rt2870.bin rt30*.binLICENCE.ralink-firmware.txt
endif
Quoted 7 lines
define
LINUX_FIRMWARE_INSTALL_TARGET_CMDScp -af $(addprefix $(@D)/, $(LINUX_FIRMWARE_FILES))$(TARGET_DIR)/lib/firmware
endefWill be nicer when other people add their wanted firmware to the package.
I was also going to propose something like this, so I fully agree with Gustavo here.
Thomas
Signature · 4 lines
Thomas Petazzoni, Free Electrons Kernel, drivers, real-time and embedded Linux development, consulting, training and support. http://free-electrons.com
PATCH v3 1/1 New package: linux-firmware
In reply to Gustavo ZacariasQuoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line
"Gustavo" == Gustavo Zacarias <[email protected]> writes:
Hi,
Gustavo> These constructs can get too long too fast, why not something Gustavo> like...
Gustavo> ifeq ($(BR2_PACKAGE_LINUX_FIRMWARE_RALINK_RT2XXX),y)
Gustavo> LINUX_FIRMWARE_FILES += rt2860.bin rt2870.bin rt30*.bin
Gustavo> LICENCE.ralink-firmware.txt
Gustavo> endif
Gustavo> define LINUX_FIRMWARE_INSTALL_TARGET_CMDS
Gustavo> cp -af $(addprefix $(@D)/, $(LINUX_FIRMWARE_FILES))
Gustavo> $(TARGET_DIR)/lib/firmware Gustavo> endef
Agreed, except you should use a loop and install -D, so subdirs are supported.
E.G.
for i in $(LINUX_FIRMWARE_FILES); do \
$i(INSTALL) -m 0644 -D $(@D)/$$i $(TARGET_DIR)/lib/firmware/$$i; \
doneSignature · 1 line
Bye, Peter Korsgaard
PATCH v3 1/1 New package: linux-firmware
Quoted 9 lines · Peter Korsgaard
Agreed, except you should use a loop and install -D, so subdirs are supported.
E.G.
for i in $(LINUX_FIRMWARE_FILES); do \ $i(INSTALL) -m 0644 -D $(@D)/$$i$(TARGET_DIR)/lib/firmware/$$i; \
done
Also LINUX_FIRMWARE_FILES_$(CONFIG_FIRMWARE_XXXX) += file1 file2 could be used with $(LINUX_FIRMWARE_FILES_y) to make it even shorter. While at it, should we go for a /lib/firmware skeleton? Regards.
PATCH v3 1/1 New package: linux-firmware
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line
"Gustavo" == Gustavo Zacarias <[email protected]> writes:
Hi,
Quoted 9 lines
Quoted 9 lines
Agreed, except you should use a loop and install -D, so subdirs are supported.
E.G.
for i in $(LINUX_FIRMWARE_FILES); do \
$i(INSTALL) -m 0644 -D $(@D)/$$i
$(TARGET_DIR)/lib/firmware/$$i; \
done
Gustavo> Also LINUX_FIRMWARE_FILES_$(CONFIG_FIRMWARE_XXXX) += file1 file2 could Gustavo> be used with $(LINUX_FIRMWARE_FILES_y) to make it even shorter.
Agreed.
Gustavo> While at it, should we go for a /lib/firmware skeleton?
What is the advantage to adding an empty dir in the default skeleton? We want this work with custom skeletons where it might not exist.
Signature · 1 line
Bye, Peter Korsgaard
PATCH v3 1/1 New package: linux-firmware
Quoted 5 lines · Peter Korsgaard
Gustavo> While at it, should we go for a
/lib/firmwareskeleton?What is the advantage to adding an empty dir in the default skeleton? We
want this work with custom skeletons where it might not exist.
Then $(INSTALL) -D should do it :)
Regards.
PATCH v3 1/1 New package: linux-firmware
In reply to Gustavo ZacariasAm 26.01.2012 13:47, schrieb Gustavo Zacarias:
Quoted 5 lines · Peter Korsgaard
Quoted 4 lines
Agreed, except you should use a loop and install -D, so subdirs are supported.
Quoted 7 lines
Quoted 5 lines
E.G.
for i in $(LINUX_FIRMWARE_FILES); do \ $i(INSTALL) -m 0644 -D $(@D)/$$i $(TARGET_DIR)/lib/firmware/$$i; \ doneAlso LINUX_FIRMWARE_FILES_$(CONFIG_FIRMWARE_XXXX) += file1 file2 could be used with $(LINUX_FIRMWARE_FILES_y) to make it even shorter.
How can I use it exactly? Can provide an example?
Yegor
PATCH v3 1/1 New package: linux-firmware
Quoted 3 lines
Quoted 3 lines
Quoted 1 line
Quoted 1 line
Quoted 1 line
"Yegor" == Yegor Yefremov <[email protected]> writes:
Also LINUX_FIRMWARE_FILES_$(CONFIG_FIRMWARE_XXXX) += file1 file2 could be used with $(LINUX_FIRMWARE_FILES_y) to make it even shorter.
Yegor> How can I use it exactly? Can provide an example?
Just like that. BR2_ Kconfig option expands to 'y' if enabled, and to the empty string otherwise. See package/mtd/mtd.mk for an example.
Signature · 1 line
Bye, Peter Korsgaard
PATCH v3 1/1 New package: linux-firmware
In reply to Yegor YefremovQuoted 13 lines · Yegor Yefremov
Am 26.01.2012 13:47, schrieb Gustavo Zacarias:
Quoted 12 lines · Peter Korsgaard
Quoted 10 lines
Agreed, except you should use a loop and install -D, so subdirs are supported.
E.G.
for i in $(LINUX_FIRMWARE_FILES); do \ $i(INSTALL) -m 0644 -D $(@D)/$$i$(TARGET_DIR)/lib/firmware/$$i; \
done
Quoted 5 lines
Quoted 2 lines
Also LINUX_FIRMWARE_FILES_$(CONFIG_FIRMWARE_XXXX) += file1 file2 could be used with $(LINUX_FIRMWARE_FILES_y) to make it even shorter.
How can I use it exactly? Can provide an example?
Yegor
Something like...
LINUX_FIRMWARE_FILES_$(BR2_PACKAGE_LINUX_FIRMWARE_TI_WL127X) += ti-connectivity/TIInit_7.2.31.bts LINUX_FIRMWARE_FILES_$(BR2_PACKAGE_LINUX_FIRMWARE_TI_WL128X) += ti-connectivity/TIInit_7.2.31.bts
define LINUX_FIRMWARE_INSTALL_TARGET_CMDS
for i in $(LINUX_FIRMWARE_FILES_y); do \
$(INSTALL) -m 0644 -D $(@D)/$$i $(TARGET_DIR)/lib/firmware/$$i; \ done
endef
Since LINUX_FIRMWARE_FILES_$(CONFIG_OPTION) evals to LINUX_FIRMWARE_FILES_y if it's set and just LINUX_FIRMWARE_FILES_ if not so it get filled up pretty nicely. Look at the lm-sensors package for an example.
Regards.
PATCH v3 1/1 New package: linux-firmware
Am 26.01.2012 14:55, schrieb Gustavo Zacarias:
Quoted 23 lines · Yegor Yefremov
Quoted 8 lines
Am 26.01.2012 13:47, schrieb Gustavo Zacarias:
Quoted 7 lines · Peter Korsgaard
Quoted 6 lines
Agreed, except you should use a loop and install -D, so subdirs are supported.
E.G.
Quoted 8 lines
Quoted 5 lines
Quoted 3 lines
for i in $(LINUX_FIRMWARE_FILES); do \ $i(INSTALL) -m 0644 -D $(@D)/$$i $(TARGET_DIR)/lib/firmware/$$i; \ doneAlso LINUX_FIRMWARE_FILES_$(CONFIG_FIRMWARE_XXXX) += file1 file2 could be used with $(LINUX_FIRMWARE_FILES_y) to make it even shorter.
How can I use it exactly? Can provide an example?
Yegor
Something like...
LINUX_FIRMWARE_FILES_$(BR2_PACKAGE_LINUX_FIRMWARE_TI_WL127X) += ti-connectivity/TIInit_7.2.31.bts LINUX_FIRMWARE_FILES_$(BR2_PACKAGE_LINUX_FIRMWARE_TI_WL128X) += ti-connectivity/TIInit_7.2.31.bts
Quoted 7 lines
define
LINUX_FIRMWARE_INSTALL_TARGET_CMDSfor i in $(LINUX_FIRMWARE_FILES_y); do \ $(INSTALL) -m 0644 -D $(@D)/$$i $(TARGET_DIR)/lib/firmware/$$i; \done
endefSince LINUX_FIRMWARE_FILES_$(CONFIG_OPTION) evals to
LINUX_FIRMWARE_FILES_yif it's set and justLINUX_FIRMWARE_FILES_if not so it get filled up pretty nicely. Look at the lm-sensors package for an example.
Thanks. I understand now.
Another question: what to do with symlinks?
rt3070.bin -> rt2870.bin
rt3090.bin -> rt2860.bin
Yegor
PATCH v3 1/1 New package: linux-firmware
Quoted 8 lines · Yegor Yefremov
Thanks. I understand now.
Another question: what to do with symlinks?
rt3070.bin -> rt2870.bin
rt3090.bin -> rt2860.binYegor
Keep them as symlinks, that's the reason i originally used cp rather than install, to keep them so.
There's no guarantee that the target filesystems dedups. Regards.