Linux Archive

Linux Archive (
-   Ubuntu Kernel Team (
-   -   UBUNTU: add support for generating binary device trees and install them in /lib/firmware (

Andy Whitcroft 07-30-2012 04:42 PM

UBUNTU: add support for generating binary device trees and install them in /lib/firmware
Add support for generating a device tree binary for this flavour and
installing it in /lib/firmware. This is useful for QEMU for some flavours
and likely will be useful later for systems which need to include a device
tree when flashing the kernel (this is the overall vision for device tree
with generic ARM kernels).

Adds flavour specific configuration for the name of the dtb_file.
Currently this only supports one dtb file per flavour but it is possible
there could be more than one when flavours can support more than one SOC,
so futureproof by including the hardware name in the dtb path.

Based on a patch by Dann Frazier.

Signed-off-by: Andy Whitcroft <>
debian/rules.d/ | 10 +++++++++-
1 file changed, 9 insertions(+), 1 deletion(-)

diff --git a/debian/rules.d/ b/debian/rules.d/
index 75caf91..b665191 100644
--- a/debian/rules.d/
+++ b/debian/rules.d/
@@ -33,9 +33,10 @@ build-%: $(stampdir)/stamp-build-%

# Do the actual build, including image and modules
$(stampdir)/stamp-build-%: target_flavour = $*
+$(stampdir)/stamp-build-%: dtb_target = $(notdir $(dtb_file_$*))
$(stampdir)/stamp-build-%: $(stampdir)/stamp-prepare-%
@echo "Building $*..."
- $(build_cd) $(kmake) $(build_O) $(conc_level) $(build_image) modules
+ $(build_cd) $(kmake) $(build_O) $(conc_level) $(build_image) modules $(dtb_target)
@touch $@

# Install the finished build
@@ -46,6 +47,8 @@ install-%: dbgpkgdir = $(CURDIR)/debian/$(bin_pkg_name)-$*-dbgsym
install-%: basepkg = $(hdrs_pkg_name)
install-%: hdrdir = $(CURDIR)/debian/$(basepkg)-$*/usr/src/$(basepkg)-$*
install-%: target_flavour = $*
+install-%: dtb_file=$(dtb_file_$*)
+install-%: dtb_target=$(notdir $(dtb_file_$*))
install-%: checks-%
@@ -72,6 +75,11 @@ endif
install -m600 $(builddir)/build-$*/
+ if [ "$(dtb_target)" ]; then
+ install -d $(pkgdir)/lib/firmware/$(abi_release)-$*/device-tree;
+ install -m644 $(builddir)/build-$*/$(dtb_file)
+ $(pkgdir)/lib/firmware/$(abi_release)-$*/device-tree/$(dtb_target);
+ fi
ifeq ($(no_dumpfile),)
makedumpfile -g $(pkgdir)/boot/vmcoreinfo-$(abi_release)-$*
-x $(builddir)/build-$*/vmlinux

kernel-team mailing list

All times are GMT. The time now is 12:06 PM.

VBulletin, Copyright ©2000 - 2014, Jelsoft Enterprises Ltd.
Content Relevant URLs by vBSEO ©2007, Crawlability, Inc.