Skip to content
Snippets Groups Projects
Commit e60078bd authored by jogo's avatar jogo
Browse files

image.mk: add a BuildDTB define


Add a Image/BuildDTB command that takes the path to an dts file and
applies the CPP using the default include directories, then uses dtc
to compile the dts as the specified output file.
Additional CPP and DTC flags can be supplied as additional arguments.

Signed-off-by: default avatarJonas Gorski <jogo@openwrt.org>

git-svn-id: svn://svn.openwrt.org/openwrt/trunk@46389 3c298f89-4303-0410-b956-a3cf2f4a3e73
parent 04b95332
No related branches found
No related tags found
No related merge requests found
......@@ -126,6 +126,22 @@ define Image/BuildKernel/MkFIT
PATH=$(LINUX_DIR)/scripts/dtc:$(PATH) mkimage -f $(KDIR)/fit-$(1).its $(KDIR)/fit-$(1)$(7).itb
endef
# $(1) source dts file
# $(2) target dtb file
# $(3) extra CPP flags
# $(4) extra DTC flags
define Image/BuildDTB
$(CPP) -nostdinc -x assembler-with-cpp \
-I$(LINUX_DIR)/arch/$(ARCH)/boot/dts \
-I$(LINUX_DIR)/arch/$(ARCH)/boot/dts/include \
-undef -D__DTS__ $(3) \
-o $(2).tmp $(1)
$(LINUX_DIR)/scripts/dtc/dtc -O dtb \
-i$(dir $(1)) $(4) \
-o $(2) $(2).tmp
$(RM) $(2).tmp
endef
define Image/mkfs/jffs2/sub
$(STAGING_DIR_HOST)/bin/mkfs.jffs2 $(3) --pad -e $(patsubst %k,%KiB,$(1)) -o $(KDIR)/root.jffs2-$(2) -d $(TARGET_DIR) -v 2>&1 1>/dev/null | awk '/^.+$$$$/'
$(call add_jffs2_mark,$(KDIR)/root.jffs2-$(2))
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment