summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMichael Olbrich <m.olbrich@pengutronix.de>2019-02-22 07:54:32 +0100
committerMichael Olbrich <m.olbrich@pengutronix.de>2019-02-23 08:32:39 +0100
commiteb60e68ab20fb8d6c14ab113f9fa5f5dc8294478 (patch)
tree32abaa0365c572f9ec40ada7417e1718f4faeff5
parent0a20fd872d60cbc7b0865a0c0b33ac2c5b163f86 (diff)
downloadptxdist-eb60e68ab20fb8d6c14ab113f9fa5f5dc8294478.tar.gz
ptxdist-eb60e68ab20fb8d6c14ab113f9fa5f5dc8294478.tar.xz
kernel: rework prepare stage
The old implementation is broken, when a initramfs is used. Changing the kconfig symbol back to '# Automatically set by PTXDist' is broken because '$(<)' is not the kernel config any more (Broken since cd920ab716bab0c190666e0273c10b19c7cdaeec "barebox/kernel: drop explicit dependency"). Also, world/kconfig-sync compares .config and KERNEL_CONFIG and this does not work because CONFIG_INITRAMFS_SOURCE in .config has been modified. Instead, make sure that KERNEL_CONFIG contains the path independent dummy text before copying it to .config. Then run the default prepare stage that checks or updates the config. Insert the path for the empty initramfs after all checks are done. Signed-off-by: Michael Olbrich <m.olbrich@pengutronix.de> Tested-by: Jon Ringle <jringle@gridpoint.com>
-rw-r--r--rules/kernel.make31
1 files changed, 16 insertions, 15 deletions
diff --git a/rules/kernel.make b/rules/kernel.make
index 99ad37b85..6a9666df1 100644
--- a/rules/kernel.make
+++ b/rules/kernel.make
@@ -105,30 +105,31 @@ KERNEL_INITRAMFS_SOURCE_$(PTXCONF_IMAGE_KERNEL_INITRAMFS) += $(STATEDIR)/empty.c
$(STATEDIR)/kernel.prepare:
@$(call targetinfo)
-
- @$(call world/kconfig-setup, KERNEL)
+#
+# Make sure there is a non empty INITRAMFS_SOURCE in $(KERNEL_CONFIG), but
+# not the real expanded path because it contains local workdir path which
+# is not relevant to other developers.
+#
+ifdef KERNEL_INITRAMFS_SOURCE_y
+ @sed -i -e 's,^CONFIG_INITRAMFS_SOURCE.*$$,CONFIG_INITRAMFS_SOURCE=\"# Automatically set by PTXDist\",g' \
+ "$(KERNEL_CONFIG)"
+endif
ifdef PTXCONF_KERNEL_IMAGE_SIMPLE
cp $(PTXCONF_KERNEL_IMAGE_SIMPLE_DTS) \
$(KERNEL_DIR)/arch/$(PTXCONF_KERNEL_ARCH_STRING)/boot/dts/$(PTXCONF_KERNEL_IMAGE_SIMPLE_TARGET).dts
endif
-ifdef KERNEL_INITRAMFS_SOURCE_y
- @touch "$(KERNEL_INITRAMFS_SOURCE_y)"
- @sed -i -e 's,^CONFIG_INITRAMFS_SOURCE.*$$,CONFIG_INITRAMFS_SOURCE=\"$(KERNEL_INITRAMFS_SOURCE_y)\",g' \
- "$(KERNEL_DIR)/.config"
-endif
-
- @$(call ptx/oldconfig, KERNEL)
- @$(call world/kconfig-sync, KERNEL)
+ @$(call world/prepare, KERNEL)
#
-# Don't keep the expanded path to INITRAMS_SOURCE in $(KERNEL_CONFIG),
-# because it contains local workdir path which is not relevant to
-# other developers.
+# Use a existing dummy INITRAMFS_SOURCE for the fist 'make' call. The
+# kernel image will be rebuilt in the image-kernel package with the real
+# initramfs.
#
ifdef KERNEL_INITRAMFS_SOURCE_y
- @sed -i -e 's,^CONFIG_INITRAMFS_SOURCE.*$$,CONFIG_INITRAMFS_SOURCE=\"# Automatically set by PTXDist\",g' \
- "$(<)"
+ @touch "$(KERNEL_INITRAMFS_SOURCE_y)"
+ @sed -i -e 's,^CONFIG_INITRAMFS_SOURCE.*$$,CONFIG_INITRAMFS_SOURCE=\"$(KERNEL_INITRAMFS_SOURCE_y)\",g' \
+ "$(KERNEL_DIR)/.config"
endif
@$(call touch)