[openwrt/openwrt] image: move mkits.sh outside lock section

LEDE Commits lede-commits at lists.infradead.org
Thu Oct 23 09:14:11 PDT 2025


ansuel pushed a commit to openwrt/openwrt.git, branch main:
https://git.openwrt.org/5a42ed1138ae0244aff79560fe77cfab8aff6e7f

commit 5a42ed1138ae0244aff79560fe77cfab8aff6e7f
Author: Christian Marangi <ansuelsmth at gmail.com>
AuthorDate: Wed Oct 22 02:45:50 2025 +0200

    image: move mkits.sh outside lock section
    
    As mkits.sh only generates the relevant DTS for mkimage and is
    specific for the building image, we can move it outside the locked
    section as it doesn't do any operation that can be used concurrently by
    others.
    
    This won't have any real impact but clean the code making it clear what
    needs to be protected and what can be executed concurrently.
    
    Link: https://github.com/openwrt/openwrt/pull/20492
    Signed-off-by: Christian Marangi <ansuelsmth at gmail.com>
---
 include/image-commands.mk | 42 +++++++++++++++++++++---------------------
 1 file changed, 21 insertions(+), 21 deletions(-)

diff --git a/include/image-commands.mk b/include/image-commands.mk
index 9ceec323b7..a9a3d13241 100644
--- a/include/image-commands.mk
+++ b/include/image-commands.mk
@@ -431,27 +431,27 @@ define Build/initrd_compression
 endef
 
 define Build/fit
-	$(call locked, { \
-		$(if $(findstring with-rootfs,$(word 3,$(1))),dd if=$(IMAGE_ROOTFS) of=$(IMAGE_ROOTFS).pagesync bs=4096 conv=sync;) \
-		$(TOPDIR)/scripts/mkits.sh \
-			-D $(DEVICE_NAME) -o $@.its -k $@ \
-			-C $(word 1,$(1)) \
-			$(if $(word 2,$(1)),\
-				$(if $(findstring 11,$(if $(DEVICE_DTS_OVERLAY),1)$(if $(findstring $(KERNEL_BUILD_DIR)/image-,$(word 2,$(1))),,1)), \
-					-d $(KERNEL_BUILD_DIR)/image-$$(basename $(word 2,$(1))), \
-					-d $(word 2,$(1)))) \
-			$(if $(findstring with-rootfs,$(word 3,$(1))),-r $(IMAGE_ROOTFS)) \
-			$(if $(findstring with-initrd,$(word 3,$(1))), \
-				$(if $(CONFIG_TARGET_ROOTFS_INITRAMFS_SEPARATE), \
-					-i $(KERNEL_BUILD_DIR)/initrd$(if $(TARGET_PER_DEVICE_ROOTFS),.$(ROOTFS_ID/$(DEVICE_NAME))).cpio$(strip $(call Build/initrd_compression)))) \
-			-a $(KERNEL_LOADADDR) -e $(if $(KERNEL_ENTRY),$(KERNEL_ENTRY),$(KERNEL_LOADADDR)) \
-			$(if $(DEVICE_FDT_NUM),-n $(DEVICE_FDT_NUM)) \
-			$(if $(DEVICE_DTS_DELIMITER),-l $(DEVICE_DTS_DELIMITER)) \
-			$(if $(DEVICE_DTS_LOADADDR),-s $(DEVICE_DTS_LOADADDR)) \
-			$(if $(DEVICE_DTS_OVERLAY),$(foreach dtso,$(DEVICE_DTS_OVERLAY), -O $(dtso):$(KERNEL_BUILD_DIR)/image-$(dtso).dtbo)) \
-			-c $(if $(DEVICE_DTS_CONFIG),$(DEVICE_DTS_CONFIG),"config-1") \
-			-A $(LINUX_KARCH) -v $(LINUX_VERSION) \
-	}, gen-cpio$(if $(TARGET_PER_DEVICE_ROOTFS),.$(ROOTFS_ID/$(DEVICE_NAME))))
+	$(if $(findstring with-rootfs,$(word 3,$(1))), \
+		$(call locked,dd if=$(IMAGE_ROOTFS) of=$(IMAGE_ROOTFS).pagesync bs=4096 conv=sync, \
+		  gen-cpio$(if $(TARGET_PER_DEVICE_ROOTFS),.$(ROOTFS_ID/$(DEVICE_NAME)))))
+	$(TOPDIR)/scripts/mkits.sh \
+		-D $(DEVICE_NAME) -o $@.its -k $@ \
+		-C $(word 1,$(1)) \
+		$(if $(word 2,$(1)),\
+			$(if $(findstring 11,$(if $(DEVICE_DTS_OVERLAY),1)$(if $(findstring $(KERNEL_BUILD_DIR)/image-,$(word 2,$(1))),,1)), \
+				-d $(KERNEL_BUILD_DIR)/image-$$(basename $(word 2,$(1))), \
+				-d $(word 2,$(1)))) \
+		$(if $(findstring with-rootfs,$(word 3,$(1))),-r $(IMAGE_ROOTFS)) \
+		$(if $(findstring with-initrd,$(word 3,$(1))), \
+			$(if $(CONFIG_TARGET_ROOTFS_INITRAMFS_SEPARATE), \
+				-i $(KERNEL_BUILD_DIR)/initrd$(if $(TARGET_PER_DEVICE_ROOTFS),.$(ROOTFS_ID/$(DEVICE_NAME))).cpio$(strip $(call Build/initrd_compression)))) \
+		-a $(KERNEL_LOADADDR) -e $(if $(KERNEL_ENTRY),$(KERNEL_ENTRY),$(KERNEL_LOADADDR)) \
+		$(if $(DEVICE_FDT_NUM),-n $(DEVICE_FDT_NUM)) \
+		$(if $(DEVICE_DTS_DELIMITER),-l $(DEVICE_DTS_DELIMITER)) \
+		$(if $(DEVICE_DTS_LOADADDR),-s $(DEVICE_DTS_LOADADDR)) \
+		$(if $(DEVICE_DTS_OVERLAY),$(foreach dtso,$(DEVICE_DTS_OVERLAY), -O $(dtso):$(KERNEL_BUILD_DIR)/image-$(dtso).dtbo)) \
+		-c $(if $(DEVICE_DTS_CONFIG),$(DEVICE_DTS_CONFIG),"config-1") \
+		-A $(LINUX_KARCH) -v $(LINUX_VERSION)
 	$(call locked,PATH=$(LINUX_DIR)/scripts/dtc:$(PATH) mkimage $(if $(findstring external,$(word 3,$(1))),\
 		-E -B 0x1000 $(if $(findstring static,$(word 3,$(1))),-p 0x1000)) -f $@.its $@.new, \
 	  gen-cpio$(if $(TARGET_PER_DEVICE_ROOTFS),.$(ROOTFS_ID/$(DEVICE_NAME))))




More information about the lede-commits mailing list