All of lore.kernel.org
 help / color / mirror / Atom feed
* [Buildroot] [PATCH v2 1/2] linux: install firmware to staging.
@ 2013-07-09 17:39 Spenser Gilliland
  2013-07-09 17:39 ` [Buildroot] [PATCH v2 2/2] beagle-capes: new package Spenser Gilliland
                   ` (2 more replies)
  0 siblings, 3 replies; 8+ messages in thread
From: Spenser Gilliland @ 2013-07-09 17:39 UTC (permalink / raw)
  To: buildroot

Install firmware to staging when the hidden option
BR2_LINUX_KERNEL_INSTALL_FIRMWARE is selected.  This allows parts of the
firmware provided by the linux kernel to be installed in the target.

Signed-off-by: Spenser Gilliland <spenser@gillilanding.com>
Cc: Peter Korsgaard <jacmet@uclibc.org>
Cc: Yann E. Morin <yann.morin.1998@free.fr>
Cc: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
---
v1->v2:
  - increase comment clarity in Config.in
---
 linux/Config.in |  7 +++++++
 linux/linux.mk  | 13 +++++++++++++
 2 files changed, 20 insertions(+)

diff --git a/linux/Config.in b/linux/Config.in
index f58e714..f5c4764 100644
--- a/linux/Config.in
+++ b/linux/Config.in
@@ -297,6 +297,13 @@ config BR2_LINUX_KERNEL_INSTALL_TARGET
 	  /boot in the target root filesystem, as is typically done on
 	  x86/x86_64 systems.
 
+# This option can be selected by other packages that require special
+# firmwares bundled in some forks of the Linux kernel (e.g. the BeagleBone
+# Black cape firmwares (.dtbo) as distibuted in the TI Linux Kernel fork.) To
+# install firmware from the mainline kernel please use the
+# linux-firmware package.
+config BR2_LINUX_KERNEL_INSTALL_FIRMWARE
+	bool
 
 # Linux extensions
 source "linux/Config.ext.in"
diff --git a/linux/linux.mk b/linux/linux.mk
index befef16..88c954d 100644
--- a/linux/linux.mk
+++ b/linux/linux.mk
@@ -256,6 +256,15 @@ define LINUX_INSTALL_KERNEL_IMAGE_TO_TARGET
 endef
 endif
 
+ifeq ($(BR2_LINUX_KERNEL_INSTALL_FIRMWARE),y)
+
+LINUX_INSTALL_STAGING = YES
+
+define LINUX_INSTALL_FIRMWARE_TO_STAGING
+	$(TARGET_MAKE_ENV) $(MAKE) $(LINUX_MAKE_FLAGS) -C $(@D) firmware_install \
+		INSTALL_FW_PATH=$(STAGING_DIR)/lib/firmware/
+endef
+endif
 
 define LINUX_INSTALL_HOST_TOOLS
 	# Installing dtc (device tree compiler) as host tool, if selected
@@ -269,6 +278,10 @@ define LINUX_INSTALL_IMAGES_CMDS
 	cp $(LINUX_IMAGE_PATH) $(BINARIES_DIR)
 endef
 
+define LINUX_INSTALL_STAGING_CMDS
+	$(LINUX_INSTALL_FIRMWARE_TO_STAGING)
+endef
+
 define LINUX_INSTALL_TARGET_CMDS
 	$(LINUX_INSTALL_KERNEL_IMAGE_TO_TARGET)
 	$(LINUX_INSTALL_DTB)
-- 
1.8.1.2

^ permalink raw reply related	[flat|nested] 8+ messages in thread

* [Buildroot] [PATCH v2 2/2] beagle-capes: new package
  2013-07-09 17:39 [Buildroot] [PATCH v2 1/2] linux: install firmware to staging Spenser Gilliland
@ 2013-07-09 17:39 ` Spenser Gilliland
  2013-07-09 20:04   ` Yann E. MORIN
  2013-07-09 20:03 ` [Buildroot] [PATCH v2 1/2] linux: install firmware to staging Yann E. MORIN
  2013-07-10  7:11 ` Thomas Petazzoni
  2 siblings, 1 reply; 8+ messages in thread
From: Spenser Gilliland @ 2013-07-09 17:39 UTC (permalink / raw)
  To: buildroot

installs the beaglebone cape dtbos.

Signed-off-by: Spenser Gilliland <spenser@gillilanding.com>
Cc: Peter Korsgaard <jacmet@uclibc.org>
Cc: Yann E. Morin <yann.morin.1998@free.fr>
Cc: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
---
v1->v2:
  - alpha order in ../Config.in
  - clarify Config.in
---
 package/Config.in                    |  1 +
 package/beagle-capes/Config.in       | 13 +++++++++++++
 package/beagle-capes/beagle-capes.mk | 15 +++++++++++++++
 3 files changed, 29 insertions(+)
 create mode 100644 package/beagle-capes/Config.in
 create mode 100644 package/beagle-capes/beagle-capes.mk

diff --git a/package/Config.in b/package/Config.in
index 4df48ba..d17baa9 100644
--- a/package/Config.in
+++ b/package/Config.in
@@ -221,6 +221,7 @@ menu "Hardware handling"
 menu "Misc devices firmwares"
 source "package/am33x-cm3/Config.in"
 source "package/b43-firmware/Config.in"
+source "package/beagle-capes/Config.in"
 source "package/linux-firmware/Config.in"
 source "package/rpi-firmware/Config.in"
 source "package/sunxi-boards/Config.in"
diff --git a/package/beagle-capes/Config.in b/package/beagle-capes/Config.in
new file mode 100644
index 0000000..90482ec
--- /dev/null
+++ b/package/beagle-capes/Config.in
@@ -0,0 +1,13 @@
+config BR2_PACKAGE_BEAGLE_CAPES
+	bool "beagle-capes"
+	depends on BR2_LINUX_KERNEL && BR2_arm
+	select BR2_LINUX_KERNEL_INSTALL_FIRMWARE
+	help
+	  Installs beaglebone capes firmwares.
+
+	  These firmwares are bundled in the TI fork on the Linux kernel for the
+	  BeagleBone; therefore, a kernel with these firmwares must be configured in
+	  the Kernel Configuration section of Buildroot.
+
+comment "beagle-capes requires a Linux kernel"
+	depends on !(BR2_LINUX_KERNEL)
diff --git a/package/beagle-capes/beagle-capes.mk b/package/beagle-capes/beagle-capes.mk
new file mode 100644
index 0000000..5b6f121
--- /dev/null
+++ b/package/beagle-capes/beagle-capes.mk
@@ -0,0 +1,15 @@
+################################################################################
+#
+# beagle-capes 
+#
+################################################################################
+
+BEAGLE_CAPES_SOURCE =
+
+BEAGLE_CAPES_DEPENDENCIES = linux
+
+define BEAGLE_CAPES_INSTALL_TARGET_CMDS
+	$(INSTALL) -m 644 $(STAGING_DIR)/lib/firmware/*.dtbo $(TARGET_DIR)/lib/firmware/
+endef
+
+$(eval $(generic-package))
-- 
1.8.1.2

^ permalink raw reply related	[flat|nested] 8+ messages in thread

* [Buildroot] [PATCH v2 1/2] linux: install firmware to staging.
  2013-07-09 17:39 [Buildroot] [PATCH v2 1/2] linux: install firmware to staging Spenser Gilliland
  2013-07-09 17:39 ` [Buildroot] [PATCH v2 2/2] beagle-capes: new package Spenser Gilliland
@ 2013-07-09 20:03 ` Yann E. MORIN
  2013-07-10  7:11 ` Thomas Petazzoni
  2 siblings, 0 replies; 8+ messages in thread
From: Yann E. MORIN @ 2013-07-09 20:03 UTC (permalink / raw)
  To: buildroot

On 2013-07-09 12:39 -0500, Spenser Gilliland spake thusly:
> Install firmware to staging when the hidden option
> BR2_LINUX_KERNEL_INSTALL_FIRMWARE is selected.  This allows parts of the
> firmware provided by the linux kernel to be installed in the target.
> 
> Signed-off-by: Spenser Gilliland <spenser@gillilanding.com>
> Cc: Peter Korsgaard <jacmet@uclibc.org>
> Cc: Yann E. Morin <yann.morin.1998@free.fr>
> Cc: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>

Acked-by: "Yann E. MORIN" <yann.morin.1998@free.fr>

Since this subject is a bit sensible, and Thomas has valid concerns about
this feature, it would be nice to hold on this until Thomas and Peter,
and others, have fully commented on this.

This is the best-so-far idea that we've discused with Spenser and Peter
on IRC, but is far from ideal. If anyone has a better idea, then do not
hesitate to speak (speak now, or be silent for the rest of Eternity! ;-) )

Regards,
Yann E. MORIN.

-- 
.-----------------.--------------------.------------------.--------------------.
|  Yann E. MORIN  | Real-Time Embedded | /"\ ASCII RIBBON | Erics' conspiracy: |
| +33 662 376 056 | Software  Designer | \ / CAMPAIGN     |  ___               |
| +33 223 225 172 `------------.-------:  X  AGAINST      |  \e/  There is no  |
| http://ymorin.is-a-geek.org/ | _/*\_ | / \ HTML MAIL    |   v   conspiracy.  |
'------------------------------^-------^------------------^--------------------'

^ permalink raw reply	[flat|nested] 8+ messages in thread

* [Buildroot] [PATCH v2 2/2] beagle-capes: new package
  2013-07-09 17:39 ` [Buildroot] [PATCH v2 2/2] beagle-capes: new package Spenser Gilliland
@ 2013-07-09 20:04   ` Yann E. MORIN
  0 siblings, 0 replies; 8+ messages in thread
From: Yann E. MORIN @ 2013-07-09 20:04 UTC (permalink / raw)
  To: buildroot

On 2013-07-09 12:39 -0500, Spenser Gilliland spake thusly:
> installs the beaglebone cape dtbos.
> 
> Signed-off-by: Spenser Gilliland <spenser@gillilanding.com>
> Cc: Peter Korsgaard <jacmet@uclibc.org>
> Cc: Yann E. Morin <yann.morin.1998@free.fr>
> Cc: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>

Acked-by: "Yann E. MORIN" <yann.morin.1998@free.fr>

Ditto the previous patch: may need further discussion if a better idea
pops up.

Regards,
Yann E. MORIN.

-- 
.-----------------.--------------------.------------------.--------------------.
|  Yann E. MORIN  | Real-Time Embedded | /"\ ASCII RIBBON | Erics' conspiracy: |
| +33 662 376 056 | Software  Designer | \ / CAMPAIGN     |  ___               |
| +33 223 225 172 `------------.-------:  X  AGAINST      |  \e/  There is no  |
| http://ymorin.is-a-geek.org/ | _/*\_ | / \ HTML MAIL    |   v   conspiracy.  |
'------------------------------^-------^------------------^--------------------'

^ permalink raw reply	[flat|nested] 8+ messages in thread

* [Buildroot] [PATCH v2 1/2] linux: install firmware to staging.
  2013-07-09 17:39 [Buildroot] [PATCH v2 1/2] linux: install firmware to staging Spenser Gilliland
  2013-07-09 17:39 ` [Buildroot] [PATCH v2 2/2] beagle-capes: new package Spenser Gilliland
  2013-07-09 20:03 ` [Buildroot] [PATCH v2 1/2] linux: install firmware to staging Yann E. MORIN
@ 2013-07-10  7:11 ` Thomas Petazzoni
  2013-07-10 17:12   ` Yann E. MORIN
  2 siblings, 1 reply; 8+ messages in thread
From: Thomas Petazzoni @ 2013-07-10  7:11 UTC (permalink / raw)
  To: buildroot

Dear Spenser Gilliland,

On Tue,  9 Jul 2013 12:39:54 -0500, Spenser Gilliland wrote:
> Install firmware to staging when the hidden option
> BR2_LINUX_KERNEL_INSTALL_FIRMWARE is selected.  This allows parts of the
> firmware provided by the linux kernel to be installed in the target.
> 
> Signed-off-by: Spenser Gilliland <spenser@gillilanding.com>
> Cc: Peter Korsgaard <jacmet@uclibc.org>
> Cc: Yann E. Morin <yann.morin.1998@free.fr>
> Cc: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>

As discussed on IRC, I'm not really happy with the idea that one
package (linux) installs things in staging, and then another package
(beagle-capes) takes what the linux package has installed in staging,
and copies it to the target. Normally, it's the responsibility of a
given to package to install its stuff to the final destination.
Possibly with sub-options in this package to find out what should
actually be installed.

So normally, the situation you have should be solved with a Linux
Kernel package sub-option to select the list of in-kernel firmwares to
install.

Best regards,

Thomas
-- 
Thomas Petazzoni, Free Electrons
Kernel, drivers, real-time and embedded Linux
development, consulting, training and support.
http://free-electrons.com

^ permalink raw reply	[flat|nested] 8+ messages in thread

* [Buildroot] [PATCH v2 1/2] linux: install firmware to staging.
  2013-07-10  7:11 ` Thomas Petazzoni
@ 2013-07-10 17:12   ` Yann E. MORIN
  2013-07-11  8:58     ` Thomas Petazzoni
  0 siblings, 1 reply; 8+ messages in thread
From: Yann E. MORIN @ 2013-07-10 17:12 UTC (permalink / raw)
  To: buildroot

Thomas, Spenser, All,

On 2013-07-10 09:11 +0200, Thomas Petazzoni spake thusly:
> On Tue,  9 Jul 2013 12:39:54 -0500, Spenser Gilliland wrote:
> > Install firmware to staging when the hidden option
> > BR2_LINUX_KERNEL_INSTALL_FIRMWARE is selected.  This allows parts of the
> > firmware provided by the linux kernel to be installed in the target.
> > 
> > Signed-off-by: Spenser Gilliland <spenser@gillilanding.com>
> > Cc: Peter Korsgaard <jacmet@uclibc.org>
> > Cc: Yann E. Morin <yann.morin.1998@free.fr>
> > Cc: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
> 
> As discussed on IRC, I'm not really happy with the idea that one
> package (linux) installs things in staging, and then another package
> (beagle-capes) takes what the linux package has installed in staging,
> and copies it to the target. Normally, it's the responsibility of a
> given to package to install its stuff to the final destination.
> Possibly with sub-options in this package to find out what should
> actually be installed.
> 
> So normally, the situation you have should be solved with a Linux
> Kernel package sub-option to select the list of in-kernel firmwares to
> install.

Altenatively, as I suggested before, this could be delegated to a
post-build script:
  - the package (linux) always install its files in staging
  - a post-build scripts cherry-picks what is relevant

What I don't like with this solution is that the Linux kernel would
always install its firmware files, and that people will start using that
as the source of the firmwares, while we do have linux-firmware for
that.

I really can't think of a better approach, considering that:
  - we want to use linux-firmware to install 'standard' firmwares
  - we want the use to be able to install capes' firmwares
  - we do not want to have cross-package build/install procedures (what
    I suggested and Spenser implemented in this patchset)

Regards,
Yann E. MORIN.

-- 
.-----------------.--------------------.------------------.--------------------.
|  Yann E. MORIN  | Real-Time Embedded | /"\ ASCII RIBBON | Erics' conspiracy: |
| +33 662 376 056 | Software  Designer | \ / CAMPAIGN     |  ___               |
| +33 223 225 172 `------------.-------:  X  AGAINST      |  \e/  There is no  |
| http://ymorin.is-a-geek.org/ | _/*\_ | / \ HTML MAIL    |   v   conspiracy.  |
'------------------------------^-------^------------------^--------------------'

^ permalink raw reply	[flat|nested] 8+ messages in thread

* [Buildroot] [PATCH v2 1/2] linux: install firmware to staging.
  2013-07-10 17:12   ` Yann E. MORIN
@ 2013-07-11  8:58     ` Thomas Petazzoni
  0 siblings, 0 replies; 8+ messages in thread
From: Thomas Petazzoni @ 2013-07-11  8:58 UTC (permalink / raw)
  To: buildroot

Dear Yann E. MORIN,

On Wed, 10 Jul 2013 19:12:18 +0200, Yann E. MORIN wrote:

> Altenatively, as I suggested before, this could be delegated to a
> post-build script:
>   - the package (linux) always install its files in staging
>   - a post-build scripts cherry-picks what is relevant
> 
> What I don't like with this solution is that the Linux kernel would
> always install its firmware files, and that people will start using that
> as the source of the firmwares, while we do have linux-firmware for
> that.

Another solution is, inside the kernel menu:

	[*] Install in-kernel firmwares
		(*.dtbo) List of firmwares to installs

Best regards,

Thomas
-- 
Thomas Petazzoni, Free Electrons
Kernel, drivers, real-time and embedded Linux
development, consulting, training and support.
http://free-electrons.com

^ permalink raw reply	[flat|nested] 8+ messages in thread

* [Buildroot] [PATCH v2 1/2] linux: install firmware to staging.
@ 2013-07-09 17:00 Spenser Gilliland
  0 siblings, 0 replies; 8+ messages in thread
From: Spenser Gilliland @ 2013-07-09 17:00 UTC (permalink / raw)
  To: buildroot

Install firmware to staging when the hidden option
BR2_LINUX_KERNEL_INSTALL_FIRMWARE is selected.  This allows parts of the
firmware provided by the linux kernel to be installed in the target.

Signed-off-by: Spenser Gilliland <spenser@gillilanding.com>
Cc: Peter Korsgaard <jacmet@uclibc.org>
Cc: Yann E. Morin <yann.morin.1998@free.fr>
Cc: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
---
v1->v2:
  - increase comment clarity in Config.in
---
 linux/Config.in |  5 +++++
 linux/linux.mk  | 13 +++++++++++++
 2 files changed, 18 insertions(+)

diff --git a/linux/Config.in b/linux/Config.in
index f58e714..b733019 100644
--- a/linux/Config.in
+++ b/linux/Config.in
@@ -297,6 +297,11 @@ config BR2_LINUX_KERNEL_INSTALL_TARGET
 	  /boot in the target root filesystem, as is typically done on
 	  x86/x86_64 systems.
 
+# This option is used to install firmware to staging. Other packages such as
+# beagle-capes then install the firmware into the target. This avoids
+# installing all linux firmware.
+config BR2_LINUX_KERNEL_INSTALL_FIRMWARE
+	bool
 
 # Linux extensions
 source "linux/Config.ext.in"
diff --git a/linux/linux.mk b/linux/linux.mk
index befef16..88c954d 100644
--- a/linux/linux.mk
+++ b/linux/linux.mk
@@ -256,6 +256,15 @@ define LINUX_INSTALL_KERNEL_IMAGE_TO_TARGET
 endef
 endif
 
+ifeq ($(BR2_LINUX_KERNEL_INSTALL_FIRMWARE),y)
+
+LINUX_INSTALL_STAGING = YES
+
+define LINUX_INSTALL_FIRMWARE_TO_STAGING
+	$(TARGET_MAKE_ENV) $(MAKE) $(LINUX_MAKE_FLAGS) -C $(@D) firmware_install \
+		INSTALL_FW_PATH=$(STAGING_DIR)/lib/firmware/
+endef
+endif
 
 define LINUX_INSTALL_HOST_TOOLS
 	# Installing dtc (device tree compiler) as host tool, if selected
@@ -269,6 +278,10 @@ define LINUX_INSTALL_IMAGES_CMDS
 	cp $(LINUX_IMAGE_PATH) $(BINARIES_DIR)
 endef
 
+define LINUX_INSTALL_STAGING_CMDS
+	$(LINUX_INSTALL_FIRMWARE_TO_STAGING)
+endef
+
 define LINUX_INSTALL_TARGET_CMDS
 	$(LINUX_INSTALL_KERNEL_IMAGE_TO_TARGET)
 	$(LINUX_INSTALL_DTB)
-- 
1.8.1.2

^ permalink raw reply related	[flat|nested] 8+ messages in thread

end of thread, other threads:[~2013-07-11  8:58 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2013-07-09 17:39 [Buildroot] [PATCH v2 1/2] linux: install firmware to staging Spenser Gilliland
2013-07-09 17:39 ` [Buildroot] [PATCH v2 2/2] beagle-capes: new package Spenser Gilliland
2013-07-09 20:04   ` Yann E. MORIN
2013-07-09 20:03 ` [Buildroot] [PATCH v2 1/2] linux: install firmware to staging Yann E. MORIN
2013-07-10  7:11 ` Thomas Petazzoni
2013-07-10 17:12   ` Yann E. MORIN
2013-07-11  8:58     ` Thomas Petazzoni
  -- strict thread matches above, loose matches on Subject: below --
2013-07-09 17:00 Spenser Gilliland

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.