busybox: copy config file from configure iso extract step
authorThomas De Schampheleire <patrickdepinguin@gmail.com>
Thu, 13 Feb 2014 11:34:44 +0000 (12:34 +0100)
committerPeter Korsgaard <peter@korsgaard.com>
Fri, 14 Feb 2014 20:36:37 +0000 (21:36 +0100)
The three typical packages that use .config files in buildroot copy the
config file at different times in the build process:

    busybox copies its .config from the post-extract hook.
    linux copies its .config in the configure_cmds.
    uclibc copies its .config from the post-patch hook.

Copying the .config file from the configure step is the only way to properly
support an OVERRIDE_SRCDIR that does not yet have the .config file, because
the extract and patch steps are skipped in that case.

For example, when setting a BUSYBOX_OVERRIDE_SRCDIR to a cleanly extracted
busybox tarball:

$ make busybox-dirclean busybox
rm -Rf [..]/output/build/busybox-custom
>>> busybox custom Syncing from source dir
>>> /home/tdescham/repo/contrib/busybox-1.21.1
rsync -au --exclude .svn --exclude .git --exclude .hg --exclude .bzr
            --exclude CVS /home/tdescham/repo/contrib/busybox-1.21.1/
            [..]/output/build/busybox-custom
>>> busybox custom Configuring
/bin/sed -i -e "/\\<CONFIG_NOMMU\\>/d"
                            [..]/output/build/busybox-custom/.config
/bin/sed: can't read [..]/output/build/busybox-custom/.config:
                                            No such file or directory
make: *** [[..]/output/build/busybox-custom/.stamp_configured] Error 2

This patch modifies busybox.mk to copy the config file from the configure
step instead, as linux is doing, and fixing the described scenario.

This fixes bug #5030: https://bugs.busybox.net/show_bug.cgi?id=5030

Signed-off-by: Thomas De Schampheleire <thomas.de.schampheleire@gmail.com>
Signed-off-by: Peter Korsgaard <peter@korsgaard.com>
package/busybox/busybox.mk

index 2a8e61646147dbe23675c3ec97bd7e91fc499317..793ffb97aa92ad0ab4801d4245587c3737dde7ac 100644 (file)
@@ -180,10 +180,8 @@ define BUSYBOX_INSTALL_WATCHDOG_SCRIPT
 endef
 endif
 
-# We do this here to avoid busting a modified .config in configure
-BUSYBOX_POST_EXTRACT_HOOKS += BUSYBOX_COPY_CONFIG
-
 define BUSYBOX_CONFIGURE_CMDS
+       $(BUSYBOX_COPY_CONFIG)
        $(BUSYBOX_SET_MMU)
        $(BUSYBOX_SET_LARGEFILE)
        $(BUSYBOX_SET_IPV6)