Skip to contentSkip to conversation

linux: install firmware to staging.

PATCH Superseded Spenser Gilliland 1 participant 2 messages Jul 9, 2013

lore
Share & tools
lore
#0 lore raw

PATCH v2 1/2 linux: install firmware to staging.

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.

Cc Peter Korsgaard <[email protected]>
Cc Yann E. Morin <[email protected]>
Cc Thomas Petazzoni <[email protected]>

---
v1->v2:
- increase comment clarity in Config.in

---
 linux/Config.in |  5 +++++
 linux/linux.mk  | 13 +++++++++++++
 2 files changed, 18 insertions(+)
linux/Config.in +5 -0
index f58e714..b733019 100644
@@ -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"
linux/linux.mk +13 -0
index befef16..88c954d 100644
@@ -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)
Signature · 1 line
1.8.1.2
#1 lore raw

PATCH 2/2 beagle-capes: new package

installs the beaglebone cape dtbos.

Cc Peter Korsgaard <[email protected]>
Cc Yann E. Morin <[email protected]>
Cc Thomas Petazzoni <[email protected]>

---
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
package/Config.in +1 -0
index 4df48ba..d038c2d 100644
@@ -220,6 +220,7 @@ endmenu
 menu "Hardware handling"
 menu "Misc devices firmwares"
 source "package/am33x-cm3/Config.in"
+source "package/beagle-capes/Config.in"
 source "package/b43-firmware/Config.in"
 source "package/linux-firmware/Config.in"
 source "package/rpi-firmware/Config.in"
package/beagle-capes/Config.in new file +13 -0
new file mode 100644
index 0000000..90482ec
@@ -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)
package/beagle-capes/beagle-capes.mk new file +15 -0
new file mode 100644
index 0000000..5b6f121
@@ -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))
Signature · 1 line
1.8.1.2