]> code.ossystems Code Review - openembedded-core.git/commitdiff
busybox: Guard against interrupted compiles
authorRichard Purdie <richard.purdie@linuxfoundation.org>
Mon, 23 Jan 2017 11:44:29 +0000 (11:44 +0000)
committerRichard Purdie <richard.purdie@linuxfoundation.org>
Mon, 23 Jan 2017 22:38:43 +0000 (22:38 +0000)
If busybox is interrupted during do_compile, it can corrupt .config with
the suid version, or worse. Typically this leads to files disappearing,
particularly /etc/init.d/* which leads to an empty busybox-hwclock.
That then results in errors at do_rootfs time due to the missing package.

The fix is to use any 'orig' present to restore stat at the start of
compile.

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
meta/recipes-core/busybox/busybox.inc

index 1f4a48c8cf200850e2debccf8e4e7e7ad6979d4e..34f4e254f126c15b31153e8edfa34d3f01d4fd27 100644 (file)
@@ -141,6 +141,10 @@ do_compile() {
        unset CFLAGS CPPFLAGS CXXFLAGS LDFLAGS
        if [ "${BUSYBOX_SPLIT_SUID}" = "1" -a x`grep "CONFIG_FEATURE_INDIVIDUAL=y" .config` = x ]; then
        # split the .config into two parts, and make two busybox binaries
+               if [ -e .config.orig ]; then
+                       # Need to guard again an interrupted do_compile - restore any backup
+                       cp .config.orig .config
+               fi
                cp .config .config.orig
                oe_runmake busybox.cfg.suid
                oe_runmake busybox.cfg.nosuid