developer | 48a0705 | 2022-02-10 17:21:25 +0800 | [diff] [blame^] | 1 | --- 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)))) |