2024-11-19 17:52:09 +00:00
|
|
|
From 9834ff87ee93495982c223bea78206bda5955e89 Mon Sep 17 00:00:00 2001
|
2024-09-21 08:42:12 +00:00
|
|
|
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 +
|
2024-11-19 17:52:09 +00:00
|
|
|
scripts/Makefile.dtbinst | 12 +++++++++++-
|
2024-09-21 08:42:12 +00:00
|
|
|
scripts/Makefile.lib | 12 +++++++++++-
|
2024-11-19 17:52:09 +00:00
|
|
|
3 files changed, 23 insertions(+), 2 deletions(-)
|
2024-09-21 08:42:12 +00:00
|
|
|
|
|
|
|
diff --git a/.gitignore b/.gitignore
|
2024-11-12 16:41:37 +00:00
|
|
|
index 58fdbb35e2f1..0d683e66d33b 100644
|
2024-09-21 08:42:12 +00:00
|
|
|
--- 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
|
2024-11-19 17:52:09 +00:00
|
|
|
index 9d920419a62c..d0703c2148cf 100644
|
2024-09-21 08:42:12 +00:00
|
|
|
--- a/scripts/Makefile.dtbinst
|
|
|
|
+++ b/scripts/Makefile.dtbinst
|
2024-11-12 16:41:37 +00:00
|
|
|
@@ -23,6 +23,11 @@ $(dst)/%: $(obj)/%
|
2024-09-21 08:42:12 +00:00
|
|
|
$(call cmd,dtb_install)
|
|
|
|
|
|
|
|
dtbs := $(patsubst $(obj)/%,%,$(call read-file, $(obj)/dtbs-list))
|
2024-11-12 16:41:37 +00:00
|
|
|
+vendor := $(sort $(dir $(filter %.dtb, $(dtbs))))
|
|
|
|
+subdir := $(sort $(dir $(filter %.dtbo, $(dtbs))))
|
|
|
|
+
|
|
|
|
+dtbs += $(patsubst $(obj)/%,%,$(if $(subdir), $(shell cd $(srctree)/$(obj) && find $(subdir) -name '*.scr')))
|
|
|
|
+dtbs += $(patsubst $(obj)/%,%,$(if $(subdir), $(shell cd $(srctree)/$(obj) && find $(subdir) -name 'README.*-overlays')))
|
2024-09-21 08:42:12 +00:00
|
|
|
|
|
|
|
ifdef CONFIG_ARCH_WANT_FLAT_DTB_INSTALL
|
|
|
|
|
2024-11-19 17:52:09 +00:00
|
|
|
@@ -33,7 +38,12 @@ endef
|
2024-09-21 08:42:12 +00:00
|
|
|
|
2024-11-12 16:41:37 +00:00
|
|
|
$(foreach d, $(sort $(dir $(dtbs))), $(eval $(call gen_install_rules,$(d))))
|
|
|
|
|
|
|
|
-dtbs := $(notdir $(dtbs))
|
2024-11-19 17:52:09 +00:00
|
|
|
+# Armbian uses subdirectories <overlay> for arm
|
|
|
|
+# and <allwinner/overlay> for arm64.
|
|
|
|
+# delete the vendor's directory if the target architecture is an arm.
|
|
|
|
+ifdef CONFIG_ARM
|
2024-11-12 16:41:37 +00:00
|
|
|
+dtbs := $(patsubst $(vendor)%,%,$(dtbs))
|
2024-11-19 17:52:09 +00:00
|
|
|
+endif
|
2024-09-21 08:42:12 +00:00
|
|
|
|
2024-11-12 16:41:37 +00:00
|
|
|
endif # CONFIG_ARCH_WANT_FLAT_DTB_INSTALL
|
2024-09-21 08:42:12 +00:00
|
|
|
|
|
|
|
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
|
|
|
|
|