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)
commiteedfc7121cf5b9a8dee8546c85b3bd36e9a743a4
tree20e0d01cd764b56df87c0c3f6bd4248ec97a983c
parent4ea812ea481db6abdba9d703bd81d96e975f6eef
busybox: copy config file from configure iso extract step

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