mirror of https://github.com/armbian/build.git
93 lines
2.5 KiB
Diff
93 lines
2.5 KiB
Diff
|
From 957db0e834df1fbb8b32a0fa5620c5375c56f390 Mon Sep 17 00:00:00 2001
|
||
|
From: The-going <48602507+The-going@users.noreply.github.com>
|
||
|
Date: Tue, 1 Feb 2022 21:04:08 +0300
|
||
|
Subject: scripts: add overlay compilation support
|
||
|
|
||
|
---
|
||
|
.gitignore | 1 +
|
||
|
scripts/Makefile.dtbinst | 10 +++++++++-
|
||
|
scripts/Makefile.lib | 12 +++++++++++-
|
||
|
3 files changed, 21 insertions(+), 2 deletions(-)
|
||
|
|
||
|
diff --git a/.gitignore b/.gitignore
|
||
|
index 7902adf4f7f1..167871780657 100644
|
||
|
--- a/.gitignore
|
||
|
+++ b/.gitignore
|
||
|
@@ -42,6 +42,7 @@
|
||
|
*.rpm
|
||
|
*.rsi
|
||
|
*.s
|
||
|
+*.scr
|
||
|
*.so
|
||
|
*.so.dbg
|
||
|
*.su
|
||
|
diff --git a/scripts/Makefile.dtbinst b/scripts/Makefile.dtbinst
|
||
|
index 9d920419a62c..0b674435f63a 100644
|
||
|
--- a/scripts/Makefile.dtbinst
|
||
|
+++ b/scripts/Makefile.dtbinst
|
||
|
@@ -22,7 +22,15 @@ quiet_cmd_dtb_install = INSTALL $@
|
||
|
$(dst)/%: $(obj)/%
|
||
|
$(call cmd,dtb_install)
|
||
|
|
||
|
+$(dst)/%.scr: $(obj)/%.scr
|
||
|
+ $(call cmd,dtb_install)
|
||
|
+
|
||
|
+$(dst)/README.%-overlays: $(obj)/README.%-overlays
|
||
|
+ $(call cmd,dtb_install)
|
||
|
+
|
||
|
dtbs := $(patsubst $(obj)/%,%,$(call read-file, $(obj)/dtbs-list))
|
||
|
+script-files := $(addprefix $(dst)/, $(scr-y))
|
||
|
+readme-files := $(addprefix $(dst)/, $(dtbotxt-y))
|
||
|
|
||
|
ifdef CONFIG_ARCH_WANT_FLAT_DTB_INSTALL
|
||
|
|
||
|
@@ -37,7 +45,7 @@ dtbs := $(notdir $(dtbs))
|
||
|
|
||
|
endif # CONFIG_ARCH_WANT_FLAT_DTB_INSTALL
|
||
|
|
||
|
-__dtbs_install: $(addprefix $(dst)/, $(dtbs))
|
||
|
+__dtbs_install: $(addprefix $(dst)/, $(dtbs)) $(script-files) $(readme-files)
|
||
|
@:
|
||
|
|
||
|
.PHONY: $(PHONY)
|
||
|
diff --git a/scripts/Makefile.lib b/scripts/Makefile.lib
|
||
|
index 207325eaf1d1..870cfa0ea443 100644
|
||
|
--- a/scripts/Makefile.lib
|
||
|
+++ b/scripts/Makefile.lib
|
||
|
@@ -93,6 +93,9 @@ base-dtb-y := $(filter %.dtb, $(call real-search, $(multi-dtb-y), .dtb, -dtbs))
|
||
|
|
||
|
always-y += $(dtb-y)
|
||
|
|
||
|
+# Overlay Fixup script targets
|
||
|
+extra-y += $(scr-y) $(dtbotxt-y)
|
||
|
+
|
||
|
# Add subdir path
|
||
|
|
||
|
ifneq ($(obj),.)
|
||
|
@@ -374,7 +377,8 @@ DTC_FLAGS += -Wnode_name_chars_strict \
|
||
|
-Wunique_unit_address
|
||
|
endif
|
||
|
|
||
|
-DTC_FLAGS += $(DTC_FLAGS_$(target-stem))
|
||
|
+DTC_FLAGS += $(DTC_FLAGS_$(target-stem)) \
|
||
|
+ -@
|
||
|
|
||
|
# Set -@ if the target is a base DTB that overlay is applied onto
|
||
|
DTC_FLAGS += $(if $(filter $(patsubst $(obj)/%,%,$@), $(base-dtb-y)), -@)
|
||
|
@@ -436,6 +440,12 @@ $(obj)/%.dtb: $(obj)/%.dts $(DTC) $(DT_TMP_SCHEMA) FORCE
|
||
|
$(obj)/%.dtbo: $(src)/%.dtso $(DTC) FORCE
|
||
|
$(call if_changed_dep,dtc)
|
||
|
|
||
|
+quiet_cmd_scr = MKIMAGE $@
|
||
|
+ cmd_scr = mkimage -C none -A $(ARCH) -T script -d $< $@
|
||
|
+
|
||
|
+$(obj)/%.scr: $(src)/%.scr-cmd FORCE
|
||
|
+ $(call if_changed,scr)
|
||
|
+
|
||
|
dtc-tmp = $(subst $(comma),_,$(dot-target).dts.tmp)
|
||
|
|
||
|
# Bzip2
|
||
|
--
|
||
|
2.35.3
|
||
|
|