mirror of
https://git.yoctoproject.org/poky
synced 2026-05-30 12:29:55 +00:00
busybox: Guard against interrupted compiles
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. (From OE-Core rev: 601abb497531823a73bdec3baf56952086e5b4f4) Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
This commit is contained in:
@@ -141,6 +141,10 @@ do_compile() {
|
|||||||
unset CFLAGS CPPFLAGS CXXFLAGS LDFLAGS
|
unset CFLAGS CPPFLAGS CXXFLAGS LDFLAGS
|
||||||
if [ "${BUSYBOX_SPLIT_SUID}" = "1" -a x`grep "CONFIG_FEATURE_INDIVIDUAL=y" .config` = x ]; then
|
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
|
# 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
|
cp .config .config.orig
|
||||||
oe_runmake busybox.cfg.suid
|
oe_runmake busybox.cfg.suid
|
||||||
oe_runmake busybox.cfg.nosuid
|
oe_runmake busybox.cfg.nosuid
|
||||||
|
|||||||
Reference in New Issue
Block a user