mailarchive of the ptxdist mailing list
 help / color / mirror / Atom feed
From: Michael Olbrich <m.olbrich@pengutronix.de>
To: ptxdist@pengutronix.de, Jon Ringle <jon@ringle.org>
Cc: Michael Olbrich <m.olbrich@pengutronix.de>
Subject: [ptxdist] [PATCH] kernel: rework prepare stage
Date: Fri, 22 Feb 2019 09:11:56 +0100	[thread overview]
Message-ID: <20190222081156.12582-1-m.olbrich@pengutronix.de> (raw)
In-Reply-To: <CAMwGMjwmVM-wC3F-6GSWYN0m-Yt-eRgtszTFtfsYUqZN7B2OjQ@mail.gmail.com>

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>
---

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	other threads:[~2019-02-22  8:11 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-02-18 16:11 [ptxdist] Problems building kernel image with initramfs with no tty Jon Ringle
2019-02-22  8:11 ` Michael Olbrich [this message]
2019-02-22 17:23   ` [ptxdist] [PATCH] kernel: rework prepare stage Jon Ringle

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20190222081156.12582-1-m.olbrich@pengutronix.de \
    --to=m.olbrich@pengutronix.de \
    --cc=jon@ringle.org \
    --cc=ptxdist@pengutronix.de \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox