summaryrefslogtreecommitdiffstats
path: root/meta/recipes-core/busybox/busybox.inc
diff options
context:
space:
mode:
Diffstat (limited to 'meta/recipes-core/busybox/busybox.inc')
-rw-r--r--meta/recipes-core/busybox/busybox.inc29
1 files changed, 20 insertions, 9 deletions
diff --git a/meta/recipes-core/busybox/busybox.inc b/meta/recipes-core/busybox/busybox.inc
index e0522be729..f0c5666f47 100644
--- a/meta/recipes-core/busybox/busybox.inc
+++ b/meta/recipes-core/busybox/busybox.inc
@@ -139,6 +139,10 @@ do_configure () {
139 do_prepare_config 139 do_prepare_config
140 merge_config.sh -m .config ${@" ".join(find_cfgs(d))} 140 merge_config.sh -m .config ${@" ".join(find_cfgs(d))}
141 cml1_do_configure 141 cml1_do_configure
142
143 # Save a copy of .config and autoconf.h.
144 cp .config .config.orig
145 cp include/autoconf.h include/autoconf.h.orig
142} 146}
143 147
144do_compile() { 148do_compile() {
@@ -146,13 +150,17 @@ do_compile() {
146 if [ "${BUILD_REPRODUCIBLE_BINARIES}" = "1" ]; then 150 if [ "${BUILD_REPRODUCIBLE_BINARIES}" = "1" ]; then
147 export KCONFIG_NOTIMESTAMP=1 151 export KCONFIG_NOTIMESTAMP=1
148 fi 152 fi
153
154 # Ensure we start do_compile with the original .config and autoconf.h.
155 # These files should always have matching timestamps.
156 cp .config.orig .config
157 cp include/autoconf.h.orig include/autoconf.h
158
149 if [ "${BUSYBOX_SPLIT_SUID}" = "1" -a x`grep "CONFIG_FEATURE_INDIVIDUAL=y" .config` = x ]; then 159 if [ "${BUSYBOX_SPLIT_SUID}" = "1" -a x`grep "CONFIG_FEATURE_INDIVIDUAL=y" .config` = x ]; then
160 # Guard againt interrupted do_compile: clean temporary files.
161 rm -f .config.app.suid .config.app.nosuid .config.disable.apps .config.nonapps
162
150 # split the .config into two parts, and make two busybox binaries 163 # split the .config into two parts, and make two busybox binaries
151 if [ -e .config.orig ]; then
152 # Need to guard again an interrupted do_compile - restore any backup
153 cp .config.orig .config
154 fi
155 cp .config .config.orig
156 oe_runmake busybox.cfg.suid 164 oe_runmake busybox.cfg.suid
157 oe_runmake busybox.cfg.nosuid 165 oe_runmake busybox.cfg.nosuid
158 166
@@ -189,15 +197,18 @@ do_compile() {
189 bbfatal "busybox suid binary incorrectly provides /bin/sh" 197 bbfatal "busybox suid binary incorrectly provides /bin/sh"
190 fi 198 fi
191 199
192 # copy .config.orig back to .config, because the install process may check this file
193 cp .config.orig .config
194 # cleanup 200 # cleanup
195 rm .config.orig .config.app.suid .config.app.nosuid .config.disable.apps .config.nonapps 201 rm .config.app.suid .config.app.nosuid .config.disable.apps .config.nonapps
196 else 202 else
197 oe_runmake busybox_unstripped 203 oe_runmake busybox_unstripped
198 cp busybox_unstripped busybox 204 cp busybox_unstripped busybox
199 oe_runmake busybox.links 205 oe_runmake busybox.links
200 fi 206 fi
207
208 # restore original .config and autoconf.h, because the install process
209 # may check these files
210 cp .config.orig .config
211 cp include/autoconf.h.orig include/autoconf.h
201} 212}
202 213
203do_install () { 214do_install () {
@@ -348,7 +359,7 @@ do_install_ptest () {
348 # These access the internet which is not guaranteed to work on machines running the tests 359 # These access the internet which is not guaranteed to work on machines running the tests
349 rm -rf ${D}${PTEST_PATH}/testsuite/wget 360 rm -rf ${D}${PTEST_PATH}/testsuite/wget
350 sort ${B}/.config > ${D}${PTEST_PATH}/.config 361 sort ${B}/.config > ${D}${PTEST_PATH}/.config
351 ln -s /bin/busybox ${D}${PTEST_PATH}/busybox 362 ln -s ${base_bindir}/busybox ${D}${PTEST_PATH}/busybox
352} 363}
353 364
354inherit update-alternatives 365inherit update-alternatives