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.olbr...@pengutronix.de>
---

Hi Jon,

The initramfs handling is completely broken :-/. Can you try this patch?
That should fix your problem. I've queued this for master, but I'm still
waiting for some test results before pushing this.

Michael

 rules/kernel.make | 31 ++++++++++++++++---------------
 1 file changed, 16 insertions(+), 15 deletions(-)

diff --git a/rules/kernel.make b/rules/kernel.make
index 99ad37b85ea7..6a9666df196b 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)
 
-- 
2.20.1


_______________________________________________
ptxdist mailing list
ptxdist@pengutronix.de

Reply via email to