armbian_build/patch/kernel/archive/meson64-6.9/general-add-overlay-compilation-support.patch
Igor f5575f64ac
Bump meson and meson64 EDGE kernel to 6.9.y (#6669)
* Bump meson and meson64 EDGE kernel to 6.9.y
* Rename patch folders
* Adjust broken patches, one remaining
* Add overlay support
* meson64: rename overlays to dtso, update makefile
* Update meson-gx-socinfo-sm driver patchset for meson64-6.9:
* add SoC ID patches for S905L, A113X
* fix memory double free in driver
* update dt bindings
---------
Signed-off-by: Patrick Yavitz <pyavitz@armbian.com>
Signed-off-by: Patrick Yavitz <pyavitz@xxxxx.com>
Signed-off-by: Viacheslav Bocharov <adeep@lexina.in>
Co-authored-by: Patrick Yavitz <pyavitz@xxxxx.com>
Co-authored-by: Paolo Sabatino <paolo.sabatino@gmail.com>
Co-authored-by: Viacheslav Bocharov <adeep@lexina.in>
2024-06-05 22:20:35 +02:00

70 lines
2.3 KiB
Diff

From 088e1cd9b9dd113f0a5e9e19a7f31c37532e002a Mon Sep 17 00:00:00 2001
From: Paolo Sabatino <paolo.sabatino@gmail.com>
Date: Sun, 2 Jun 2024 21:53:01 +0200
Subject: [PATCH] compile .scr and install overlays in right path
---
scripts/Makefile.dtbinst | 2 +-
scripts/Makefile.lib | 8 +++++++-
2 files changed, 8 insertions(+), 2 deletions(-)
diff --git a/scripts/Makefile.dtbinst b/scripts/Makefile.dtbinst
index 67956f6496a5..151687728a60 100644
--- a/scripts/Makefile.dtbinst
+++ b/scripts/Makefile.dtbinst
@@ -33,7 +33,18 @@ endef
$(foreach d, $(sort $(dir $(dtbs))), $(eval $(call gen_install_rules,$(d))))
-dtbs := $(notdir $(dtbs))
+# Very convoluted way to flatten all the device tree
+# directories, but keep the "/overlay/" directory
+
+# topmost directory (ie: from rockchip/overlay/rk322x-emmc.dtbo extracts rockchip)
+topmost_dir = $(firstword $(subst /, ,$(dtbs)))
+# collect dtbs entries which starts with "$topmost_dir/overlay/", then remove "$topmost_dir"
+dtbs_overlays = $(subst $(topmost_dir)/,,$(filter $(topmost_dir)/overlay/%, $(dtbs)))
+# collect the non-overlay dtbs
+dtbs_regular = $(filter-out $(topmost_dir)/overlay/%, $(dtbs))
+# compose the dtbs variable flattening all the non-overlays entries
+# and appending the overlays entries
+dtbs := $(notdir $(dtbs_regular)) $(dtbs_overlays)
endif # CONFIG_ARCH_WANT_FLAT_DTB_INSTALL
diff --git a/scripts/Makefile.lib b/scripts/Makefile.lib
index 3179747cbd2c..59925208734a 100644
--- a/scripts/Makefile.lib
+++ b/scripts/Makefile.lib
@@ -398,7 +398,7 @@ $(obj)/%.dtbo.S: $(obj)/%.dtbo FORCE
quiet_cmd_dtc = DTC $@
cmd_dtc = $(HOSTCC) -E $(dtc_cpp_flags) -x assembler-with-cpp -o $(dtc-tmp) $< ; \
- $(DTC) -o $@ -b 0 \
+ $(DTC) -@ -o $@ -b 0 \
$(addprefix -i,$(dir $<) $(DTC_INCLUDE)) $(DTC_FLAGS) \
-d $(depfile).dtc.tmp $(dtc-tmp) ; \
cat $(depfile).pre.tmp $(depfile).dtc.tmp > $(depfile)
@@ -423,12 +423,18 @@ quiet_cmd_dtb = $(quiet_cmd_dtc)
cmd_dtb = $(cmd_dtc)
endif
+quiet_cmd_scr = MKIMAGE $@
+cmd_scr = mkimage -C none -A $(ARCH) -T script -d $< $@
+
$(obj)/%.dtb: $(src)/%.dts $(DTC) $(DT_TMP_SCHEMA) FORCE
$(call if_changed_dep,dtb)
$(obj)/%.dtbo: $(src)/%.dtso $(DTC) FORCE
$(call if_changed_dep,dtc)
+$(obj)/%.scr: $(src)/%.scr-cmd FORCE
+ $(call if_changed,scr)
+
dtc-tmp = $(subst $(comma),_,$(dot-target).dts.tmp)
# Bzip2
--
2.34.1