Buildroot Archive on lore.kernel.org
 help / color / mirror / Atom feed
* [Buildroot] linux.mk: custom tarball: re-download if tarball changed
@ 2011-07-20 13:20 Thomas De Schampheleire
  2011-09-14 10:16 ` Thomas De Schampheleire
  0 siblings, 1 reply; 4+ messages in thread
From: Thomas De Schampheleire @ 2011-07-20 13:20 UTC (permalink / raw)
  To: buildroot

Hi,

If you use a vanilla kernel, and you upstep your kernel, buildroot
automatically downloads and compiles the new version, because
LINUX26_DIR changed, and the .stamp_downloaded file is not yet present
in that new directory.

When you specify a LINUX26_TARBALL, the variable LINUX26_VERSION will
be set to the fixed "custom". As a result, LINUX26_DIR remains the
same even though you modified the .config file to specify a different
tarball.  When re-running make, buildroot does not see the change, and
you'll have to force building the new kernel.

How can we make sure that buildroot notices this change in configuration?
One way would be to step away from the fixed 'custom' version string,
and encode the tarball name in some way in LINUX26_DIR.
Another possibility is to let the download step depend on the tarball.
If the tarball changes, then make will initiate the download step.

In buildroot-2011.05, I applied the following (working) patch
implementing the second alternative:

linux: depend on source archive so that updates to custom tarballs are picked up
diff --git a/linux/linux.mk b/linux/linux.mk
--- a/linux/linux.mk
+++ b/linux/linux.mk
@@ -75,9 +75,14 @@ endif
 endif # BR2_LINUX_KERNEL_VMLINUX

 # Download
-$(LINUX26_DIR)/.stamp_downloaded:
+$(DL_DIR)/$(LINUX26_SOURCE):
 	@$(call MESSAGE,"Downloading kernel")
 	$(call DOWNLOAD,$(LINUX26_SITE),$(LINUX26_SOURCE))
+
+# Download patches
+# Explicitly depend on linux download archive so that custom tarballs get
+# redownloaded if the configured file changes.
+$(LINUX26_DIR)/.stamp_downloaded: $(DL_DIR)/$(LINUX26_SOURCE)
 	$(foreach patch,$(filter ftp://% http://%,$(LINUX26_PATCH)),\
 		$(call DOWNLOAD,$(dir $(patch)),$(notdir $(patch)))$(sep))
 	mkdir -p $(@D)


I wanted to submit this to the list, but just noticed that linux is
now using the gentargets infrastructure. To address this problem we
can
a. adapt gentargets, so that the generic .stamp_downloaded rule also
depends on the downloaded archive. Is there any reason why this would
not be good?
b. adapt the version string in linux.mk so that a custom tarball is
automatically picked up.

Comments are very welcome,
Thanks, Thomas

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2011-09-14 11:59 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2011-07-20 13:20 [Buildroot] linux.mk: custom tarball: re-download if tarball changed Thomas De Schampheleire
2011-09-14 10:16 ` Thomas De Schampheleire
2011-09-14 11:49   ` Thomas Petazzoni
2011-09-14 11:59     ` Thomas De Schampheleire

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox