blob: 9d95dd0e13ec4bf4ac6d2392c5e6898d4b747a3b [file] [log] [blame]
developer48a07052022-02-10 17:21:25 +08001--- a/include/image.mk
2+++ b/include/image.mk
3@@ -555,6 +557,16 @@ define Device/Build/kernel
4 ifdef CONFIG_IB
5 install: $$(KDIR_KERNEL_IMAGE)
6 endif
7+ ifneq ($$(filter squashfs,$(2)),)
8+ # Force squashfs to be built before generating kernel image
9+ ROOTFS/squashfs/$(1) := \
10+ $(KDIR)/root.squashfs$$(strip \
11+ $$(if $$(FS_OPTIONS/squashfs),+fs=$$(call param_mangle,$$(FS_OPTIONS/squashfs))) \
12+ )$$(strip \
13+ $(if $(TARGET_PER_DEVICE_ROOTFS),+pkg=$$(ROOTFS_ID/$(1))) \
14+ )
15+ $$(KDIR_KERNEL_IMAGE): $$(ROOTFS/squashfs/$(1))
16+ endif
17 $$(KDIR_KERNEL_IMAGE): $(KDIR)/$$(KERNEL_NAME) $(CURDIR)/Makefile $$(KERNEL_DEPENDS) image_prepare
18 @rm -f $$@
19 $$(call concat_cmd,$$(KERNEL))
20@@ -639,7 +651,7 @@ endef
21
22 define Device/Build
23 $(if $(CONFIG_TARGET_ROOTFS_INITRAMFS),$(call Device/Build/initramfs,$(1)))
24- $(call Device/Build/kernel,$(1))
25+ $(call Device/Build/kernel,$(1),$$(filter $(TARGET_FILESYSTEMS),$$(FILESYSTEMS)))
26
27 $$(eval $$(foreach compile,$$(COMPILE), \
28 $$(call Device/Build/compile,$$(compile),$(1))))