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.inc167
1 files changed, 88 insertions, 79 deletions
diff --git a/meta/recipes-core/busybox/busybox.inc b/meta/recipes-core/busybox/busybox.inc
index 47fcb59302..67a9111e5b 100644
--- a/meta/recipes-core/busybox/busybox.inc
+++ b/meta/recipes-core/busybox/busybox.inc
@@ -7,7 +7,7 @@ DEPENDS += "kern-tools-native virtual/crypt"
7 7
8# bzip2 applet in busybox is based on lightly-modified bzip2-1.0.4 source 8# bzip2 applet in busybox is based on lightly-modified bzip2-1.0.4 source
9# the GPL is version 2 only 9# the GPL is version 2 only
10LICENSE = "GPLv2 & bzip2-1.0.4" 10LICENSE = "GPL-2.0-only & bzip2-1.0.4"
11LIC_FILES_CHKSUM = "file://LICENSE;md5=de10de48642ab74318e893a61105afbb \ 11LIC_FILES_CHKSUM = "file://LICENSE;md5=de10de48642ab74318e893a61105afbb \
12 file://archival/libarchive/bz/LICENSE;md5=28e3301eae987e8cfe19988e98383dae" 12 file://archival/libarchive/bz/LICENSE;md5=28e3301eae987e8cfe19988e98383dae"
13 13
@@ -23,39 +23,40 @@ EXTRA_OEMAKE = "CC='${CC}' LD='${CCLD}' V=1 ARCH=${TARGET_ARCH} CROSS_COMPILE=${
23 23
24PACKAGES =+ "${PN}-httpd ${PN}-udhcpd ${PN}-udhcpc ${PN}-syslog ${PN}-mdev ${PN}-hwclock" 24PACKAGES =+ "${PN}-httpd ${PN}-udhcpd ${PN}-udhcpc ${PN}-syslog ${PN}-mdev ${PN}-hwclock"
25 25
26FILES_${PN}-httpd = "${sysconfdir}/init.d/busybox-httpd /srv/www" 26FILES:${PN}-httpd = "${sysconfdir}/init.d/busybox-httpd /srv/www"
27FILES_${PN}-syslog = "${sysconfdir}/init.d/syslog* ${sysconfdir}/syslog-startup.conf* ${sysconfdir}/syslog.conf* ${systemd_unitdir}/system/syslog.service ${sysconfdir}/default/busybox-syslog" 27FILES:${PN}-syslog = "${sysconfdir}/init.d/syslog* ${sysconfdir}/syslog-startup.conf* ${sysconfdir}/syslog.conf* ${systemd_system_unitdir}/syslog.service ${sysconfdir}/default/busybox-syslog"
28FILES_${PN}-mdev = "${sysconfdir}/init.d/mdev ${sysconfdir}/mdev.conf ${sysconfdir}/mdev/*" 28FILES:${PN}-mdev = "${sysconfdir}/init.d/mdev ${sysconfdir}/mdev.conf ${sysconfdir}/mdev/*"
29FILES_${PN}-udhcpd = "${sysconfdir}/init.d/busybox-udhcpd" 29FILES:${PN}-udhcpd = "${sysconfdir}/init.d/busybox-udhcpd"
30FILES_${PN}-udhcpc = "${sysconfdir}/udhcpc.d ${datadir}/udhcpc" 30FILES:${PN}-udhcpc = "${sysconfdir}/udhcpc.d ${datadir}/udhcpc"
31FILES_${PN}-hwclock = "${sysconfdir}/init.d/hwclock.sh" 31FILES:${PN}-hwclock = "${sysconfdir}/init.d/hwclock.sh"
32 32
33INITSCRIPT_PACKAGES = "${PN}-httpd ${PN}-syslog ${PN}-udhcpd ${PN}-mdev ${PN}-hwclock" 33INITSCRIPT_PACKAGES = "${PN}-httpd ${PN}-syslog ${PN}-udhcpd ${PN}-mdev ${PN}-hwclock"
34 34
35INITSCRIPT_NAME_${PN}-httpd = "busybox-httpd" 35INITSCRIPT_NAME:${PN}-httpd = "busybox-httpd"
36INITSCRIPT_NAME_${PN}-hwclock = "hwclock.sh" 36INITSCRIPT_NAME:${PN}-hwclock = "hwclock.sh"
37INITSCRIPT_NAME_${PN}-mdev = "mdev" 37INITSCRIPT_PARAMS:${PN}-hwclock = "start 40 S . stop 20 0 1 6 ."
38INITSCRIPT_PARAMS_${PN}-mdev = "start 04 S ." 38INITSCRIPT_NAME:${PN}-mdev = "mdev"
39INITSCRIPT_NAME_${PN}-syslog = "syslog" 39INITSCRIPT_PARAMS:${PN}-mdev = "start 04 S ."
40INITSCRIPT_NAME_${PN}-udhcpd = "busybox-udhcpd" 40INITSCRIPT_NAME:${PN}-syslog = "syslog"
41INITSCRIPT_NAME:${PN}-udhcpd = "busybox-udhcpd"
41 42
42SYSTEMD_PACKAGES = "${PN}-syslog" 43SYSTEMD_PACKAGES = "${PN}-syslog"
43SYSTEMD_SERVICE_${PN}-syslog = "${@bb.utils.contains('SRC_URI', 'file://syslog.cfg', 'busybox-syslog.service', '', d)}" 44SYSTEMD_SERVICE:${PN}-syslog = "${@bb.utils.contains('SRC_URI', 'file://syslog.cfg', 'busybox-syslog.service', '', d)}"
44 45
45RDEPENDS_${PN}-syslog = "busybox" 46RDEPENDS:${PN}-syslog = "busybox"
46CONFFILES_${PN}-syslog = "${sysconfdir}/syslog-startup.conf" 47CONFFILES:${PN}-syslog = "${sysconfdir}/syslog-startup.conf"
47RCONFLICTS_${PN}-syslog = "rsyslog sysklogd syslog-ng" 48RCONFLICTS:${PN}-syslog = "rsyslog sysklogd syslog-ng"
48 49
49CONFFILES_${PN}-mdev = "${sysconfdir}/mdev.conf" 50CONFFILES:${PN}-mdev = "${sysconfdir}/mdev.conf"
50 51
51RRECOMMENDS_${PN} = "${PN}-udhcpc" 52RRECOMMENDS:${PN} = "${PN}-udhcpc"
52 53
53RDEPENDS_${PN} = "${@["", "busybox-inittab"][(d.getVar('VIRTUAL-RUNTIME_init_manager') == 'busybox')]}" 54RDEPENDS:${PN} = "${@["", "busybox-inittab"][(d.getVar('VIRTUAL-RUNTIME_init_manager') == 'busybox')]}"
54 55
55inherit cml1 systemd update-rc.d ptest 56inherit cml1 systemd update-rc.d ptest
56 57
57# busybox's unzip test case needs zip command, which busybox itself does not provide 58# busybox's unzip test case needs zip command, which busybox itself does not provide
58RDEPENDS_${PN}-ptest = "zip" 59RDEPENDS:${PN}-ptest = "zip"
59 60
60# internal helper 61# internal helper
61def busybox_cfg(feature, tokens, cnf, rem): 62def busybox_cfg(feature, tokens, cnf, rem):
@@ -97,12 +98,12 @@ DO_IPv6 := "${@bb.utils.contains('DISTRO_FEATURES', 'ipv6', 1, 0, d)}"
97 98
98python () { 99python () {
99 if "${OE_DEL}": 100 if "${OE_DEL}":
100 d.setVar('configmangle_append', "${OE_DEL}" + "\n") 101 d.setVar('configmangle:append', "${OE_DEL}" + "\n")
101 if "${OE_FEATURES}": 102 if "${OE_FEATURES}":
102 d.setVar('configmangle_append', 103 d.setVar('configmangle:append',
103 "/^### DISTRO FEATURES$/a\\\n%s\n\n" % 104 "/^### DISTRO FEATURES$/a\\\n%s\n\n" %
104 ("\\n".join((d.expand("${OE_FEATURES}").split("\n"))))) 105 ("\\n".join((d.expand("${OE_FEATURES}").split("\n")))))
105 d.setVar('configmangle_append', 106 d.setVar('configmangle:append',
106 "/^### CROSS$/a\\\n%s\n" % 107 "/^### CROSS$/a\\\n%s\n" %
107 ("\\n".join(["CONFIG_EXTRA_CFLAGS=\"${CFLAGS} ${HOST_CC_ARCH}\"" 108 ("\\n".join(["CONFIG_EXTRA_CFLAGS=\"${CFLAGS} ${HOST_CC_ARCH}\""
108 ]) 109 ])
@@ -110,11 +111,10 @@ python () {
110} 111}
111 112
112do_prepare_config () { 113do_prepare_config () {
113 if [ "${BUILD_REPRODUCIBLE_BINARIES}" = "1" ]; then 114 export KCONFIG_NOTIMESTAMP=1
114 export KCONFIG_NOTIMESTAMP=1 115
115 fi
116 sed -e '/CONFIG_STATIC/d' \ 116 sed -e '/CONFIG_STATIC/d' \
117 < ${WORKDIR}/defconfig > ${S}/.config 117 < ${UNPACKDIR}/defconfig > ${S}/.config
118 echo "# CONFIG_STATIC is not set" >> .config 118 echo "# CONFIG_STATIC is not set" >> .config
119 for i in 'CROSS' 'DISTRO FEATURES'; do echo "### $i"; done >> \ 119 for i in 'CROSS' 'DISTRO FEATURES'; do echo "### $i"; done >> \
120 ${S}/.config 120 ${S}/.config
@@ -139,20 +139,26 @@ 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() {
145 unset CFLAGS CPPFLAGS CXXFLAGS LDFLAGS 149 unset CFLAGS CPPFLAGS CXXFLAGS LDFLAGS
146 if [ "${BUILD_REPRODUCIBLE_BINARIES}" = "1" ]; then 150 export KCONFIG_NOTIMESTAMP=1
147 export KCONFIG_NOTIMESTAMP=1 151
148 fi 152 # Ensure we start do_compile with the original .config and autoconf.h.
153 # These files should always have matching timestamps.
154 cp .config.orig .config
155 cp include/autoconf.h.orig include/autoconf.h
156
149 if [ "${BUSYBOX_SPLIT_SUID}" = "1" -a x`grep "CONFIG_FEATURE_INDIVIDUAL=y" .config` = x ]; then 157 if [ "${BUSYBOX_SPLIT_SUID}" = "1" -a x`grep "CONFIG_FEATURE_INDIVIDUAL=y" .config` = x ]; then
158 # Guard againt interrupted do_compile: clean temporary files.
159 rm -f .config.app.suid .config.app.nosuid .config.disable.apps .config.nonapps
160
150 # split the .config into two parts, and make two busybox binaries 161 # 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 162 oe_runmake busybox.cfg.suid
157 oe_runmake busybox.cfg.nosuid 163 oe_runmake busybox.cfg.nosuid
158 164
@@ -189,15 +195,18 @@ do_compile() {
189 bbfatal "busybox suid binary incorrectly provides /bin/sh" 195 bbfatal "busybox suid binary incorrectly provides /bin/sh"
190 fi 196 fi
191 197
192 # copy .config.orig back to .config, because the install process may check this file
193 cp .config.orig .config
194 # cleanup 198 # cleanup
195 rm .config.orig .config.app.suid .config.app.nosuid .config.disable.apps .config.nonapps 199 rm .config.app.suid .config.app.nosuid .config.disable.apps .config.nonapps
196 else 200 else
197 oe_runmake busybox_unstripped 201 oe_runmake busybox_unstripped
198 cp busybox_unstripped busybox 202 cp busybox_unstripped busybox
199 oe_runmake busybox.links 203 oe_runmake busybox.links
200 fi 204 fi
205
206 # restore original .config and autoconf.h, because the install process
207 # may check these files
208 cp .config.orig .config
209 cp include/autoconf.h.orig include/autoconf.h
201} 210}
202 211
203do_install () { 212do_install () {
@@ -271,67 +280,67 @@ do_install () {
271 fi 280 fi
272 281
273 if grep -q "CONFIG_SYSLOGD=y" ${B}/.config; then 282 if grep -q "CONFIG_SYSLOGD=y" ${B}/.config; then
274 install -m 0755 ${WORKDIR}/syslog ${D}${sysconfdir}/init.d/syslog 283 install -m 0755 ${UNPACKDIR}/syslog ${D}${sysconfdir}/init.d/syslog
275 install -m 644 ${WORKDIR}/syslog-startup.conf ${D}${sysconfdir}/syslog-startup.conf 284 install -m 644 ${UNPACKDIR}/syslog-startup.conf ${D}${sysconfdir}/syslog-startup.conf
276 install -m 644 ${WORKDIR}/syslog.conf ${D}${sysconfdir}/syslog.conf 285 install -m 644 ${UNPACKDIR}/syslog.conf ${D}${sysconfdir}/syslog.conf
277 fi 286 fi
278 if grep -q "CONFIG_CROND=y" ${B}/.config; then 287 if grep -q "CONFIG_CROND=y" ${B}/.config; then
279 install -m 0755 ${WORKDIR}/busybox-cron ${D}${sysconfdir}/init.d/ 288 install -m 0755 ${UNPACKDIR}/busybox-cron ${D}${sysconfdir}/init.d/
280 fi 289 fi
281 if grep -q "CONFIG_HTTPD=y" ${B}/.config; then 290 if grep -q "CONFIG_HTTPD=y" ${B}/.config; then
282 install -m 0755 ${WORKDIR}/busybox-httpd ${D}${sysconfdir}/init.d/ 291 install -m 0755 ${UNPACKDIR}/busybox-httpd ${D}${sysconfdir}/init.d/
283 install -d ${D}/srv/www 292 install -d ${D}/srv/www
284 fi 293 fi
285 if grep -q "CONFIG_UDHCPD=y" ${B}/.config; then 294 if grep -q "CONFIG_UDHCPD=y" ${B}/.config; then
286 install -m 0755 ${WORKDIR}/busybox-udhcpd ${D}${sysconfdir}/init.d/ 295 install -m 0755 ${UNPACKDIR}/busybox-udhcpd ${D}${sysconfdir}/init.d/
287 fi 296 fi
288 if grep -q "CONFIG_HWCLOCK=y" ${B}/.config; then 297 if grep -q "CONFIG_HWCLOCK=y" ${B}/.config; then
289 install -m 0755 ${WORKDIR}/hwclock.sh ${D}${sysconfdir}/init.d/ 298 install -m 0755 ${UNPACKDIR}/hwclock.sh ${D}${sysconfdir}/init.d/
290 fi 299 fi
291 if grep -q "CONFIG_UDHCPC=y" ${B}/.config; then 300 if grep -q "CONFIG_UDHCPC=y" ${B}/.config; then
292 install -d ${D}${sysconfdir}/udhcpc.d 301 install -d ${D}${sysconfdir}/udhcpc.d
293 install -d ${D}${datadir}/udhcpc 302 install -d ${D}${datadir}/udhcpc
294 install -m 0755 ${WORKDIR}/simple.script ${D}${sysconfdir}/udhcpc.d/50default 303 install -m 0755 ${UNPACKDIR}/simple.script ${D}${sysconfdir}/udhcpc.d/50default
295 sed -i "s:/SBIN_DIR/:${base_sbindir}/:" ${D}${sysconfdir}/udhcpc.d/50default 304 sed -i "s:/SBIN_DIR/:${base_sbindir}/:" ${D}${sysconfdir}/udhcpc.d/50default
296 install -m 0755 ${WORKDIR}/default.script ${D}${datadir}/udhcpc/default.script 305 install -m 0755 ${UNPACKDIR}/default.script ${D}${datadir}/udhcpc/default.script
297 fi 306 fi
298 if grep -q "CONFIG_INETD=y" ${B}/.config; then 307 if grep -q "CONFIG_INETD=y" ${B}/.config; then
299 install -m 0755 ${WORKDIR}/inetd ${D}${sysconfdir}/init.d/inetd.${BPN} 308 install -m 0755 ${UNPACKDIR}/inetd ${D}${sysconfdir}/init.d/inetd.${BPN}
300 sed -i "s:/usr/sbin/:${sbindir}/:" ${D}${sysconfdir}/init.d/inetd.${BPN} 309 sed -i "s:/usr/sbin/:${sbindir}/:" ${D}${sysconfdir}/init.d/inetd.${BPN}
301 install -m 0644 ${WORKDIR}/inetd.conf ${D}${sysconfdir}/ 310 install -m 0644 ${UNPACKDIR}/inetd.conf ${D}${sysconfdir}/
302 fi 311 fi
303 if grep -q "CONFIG_MDEV=y" ${B}/.config; then 312 if grep -q "CONFIG_MDEV=y" ${B}/.config; then
304 install -m 0755 ${WORKDIR}/mdev ${D}${sysconfdir}/init.d/mdev 313 install -m 0755 ${UNPACKDIR}/mdev ${D}${sysconfdir}/init.d/mdev
305 if grep "CONFIG_FEATURE_MDEV_CONF=y" ${B}/.config; then 314 if grep "CONFIG_FEATURE_MDEV_CONF=y" ${B}/.config; then
306 install -m 644 ${WORKDIR}/mdev.conf ${D}${sysconfdir}/mdev.conf 315 install -m 644 ${UNPACKDIR}/mdev.conf ${D}${sysconfdir}/mdev.conf
307 install -d ${D}${sysconfdir}/mdev 316 install -d ${D}${sysconfdir}/mdev
308 install -m 0755 ${WORKDIR}/find-touchscreen.sh ${D}${sysconfdir}/mdev 317 install -m 0755 ${UNPACKDIR}/find-touchscreen.sh ${D}${sysconfdir}/mdev
309 install -m 0755 ${WORKDIR}/mdev-mount.sh ${D}${sysconfdir}/mdev 318 install -m 0755 ${UNPACKDIR}/mdev-mount.sh ${D}${sysconfdir}/mdev
310 fi 319 fi
311 fi 320 fi
312 if grep -q "CONFIG_INIT=y" ${B}/.config && ${@bb.utils.contains('VIRTUAL-RUNTIME_init_manager','busybox','true','false',d)}; then 321 if grep -q "CONFIG_INIT=y" ${B}/.config && ${@bb.utils.contains('VIRTUAL-RUNTIME_init_manager','busybox','true','false',d)}; then
313 install -D -m 0755 ${WORKDIR}/rcS ${D}${sysconfdir}/init.d/rcS 322 install -D -m 0755 ${UNPACKDIR}/rcS ${D}${sysconfdir}/init.d/rcS
314 install -D -m 0755 ${WORKDIR}/rcK ${D}${sysconfdir}/init.d/rcK 323 install -D -m 0755 ${UNPACKDIR}/rcK ${D}${sysconfdir}/init.d/rcK
315 install -D -m 0755 ${WORKDIR}/rcS.default ${D}${sysconfdir}/default/rcS 324 install -D -m 0755 ${UNPACKDIR}/rcS.default ${D}${sysconfdir}/default/rcS
316 fi 325 fi
317 326
318 if ${@bb.utils.contains('DISTRO_FEATURES','systemd','true','false',d)}; then 327 if ${@bb.utils.contains('DISTRO_FEATURES','systemd','true','false',d)}; then
319 if grep -q "CONFIG_KLOGD=y" ${B}/.config; then 328 if grep -q "CONFIG_KLOGD=y" ${B}/.config; then
320 install -d ${D}${systemd_unitdir}/system 329 install -d ${D}${systemd_system_unitdir}
321 sed 's,@base_sbindir@,${base_sbindir},g' < ${WORKDIR}/busybox-klogd.service.in \ 330 sed 's,@base_sbindir@,${base_sbindir},g' < ${UNPACKDIR}/busybox-klogd.service.in \
322 > ${D}${systemd_unitdir}/system/busybox-klogd.service 331 > ${D}${systemd_system_unitdir}/busybox-klogd.service
323 fi 332 fi
324 333
325 if grep -q "CONFIG_SYSLOGD=y" ${B}/.config; then 334 if grep -q "CONFIG_SYSLOGD=y" ${B}/.config; then
326 install -d ${D}${systemd_unitdir}/system 335 install -d ${D}${systemd_system_unitdir}
327 sed 's,@base_sbindir@,${base_sbindir},g' < ${WORKDIR}/busybox-syslog.service.in \ 336 sed 's,@base_sbindir@,${base_sbindir},g' < ${UNPACKDIR}/busybox-syslog.service.in \
328 > ${D}${systemd_unitdir}/system/busybox-syslog.service 337 > ${D}${systemd_system_unitdir}/busybox-syslog.service
329 if [ ! -e ${D}${systemd_unitdir}/system/busybox-klogd.service ] ; then 338 if [ ! -e ${D}${systemd_system_unitdir}/busybox-klogd.service ] ; then
330 sed -i '/klog/d' ${D}${systemd_unitdir}/system/busybox-syslog.service 339 sed -i '/klog/d' ${D}${systemd_system_unitdir}/busybox-syslog.service
331 fi 340 fi
332 if [ -f ${WORKDIR}/busybox-syslog.default ] ; then 341 if [ -f ${UNPACKDIR}/busybox-syslog.default ] ; then
333 install -d ${D}${sysconfdir}/default 342 install -d ${D}${sysconfdir}/default
334 install -m 0644 ${WORKDIR}/busybox-syslog.default ${D}${sysconfdir}/default/busybox-syslog 343 install -m 0644 ${UNPACKDIR}/busybox-syslog.default ${D}${sysconfdir}/default/busybox-syslog
335 fi 344 fi
336 fi 345 fi
337 fi 346 fi
@@ -349,14 +358,14 @@ do_install_ptest () {
349 # These access the internet which is not guaranteed to work on machines running the tests 358 # These access the internet which is not guaranteed to work on machines running the tests
350 rm -rf ${D}${PTEST_PATH}/testsuite/wget 359 rm -rf ${D}${PTEST_PATH}/testsuite/wget
351 sort ${B}/.config > ${D}${PTEST_PATH}/.config 360 sort ${B}/.config > ${D}${PTEST_PATH}/.config
352 ln -s /bin/busybox ${D}${PTEST_PATH}/busybox 361 ln -s ${base_bindir}/busybox ${D}${PTEST_PATH}/busybox
353} 362}
354 363
355inherit update-alternatives 364inherit update-alternatives
356 365
357ALTERNATIVE_PRIORITY = "50" 366ALTERNATIVE_PRIORITY = "50"
358 367
359python do_package_prepend () { 368python do_package:prepend () {
360 # We need to load the full set of busybox provides from the /etc/busybox.links 369 # We need to load the full set of busybox provides from the /etc/busybox.links
361 # Use this to see the update-alternatives with the right information 370 # Use this to see the update-alternatives with the right information
362 371
@@ -373,9 +382,9 @@ python do_package_prepend () {
373 if alt_name == '[': 382 if alt_name == '[':
374 alt_name = 'lbracket' 383 alt_name = 'lbracket'
375 if alt_name == 'klogd' or alt_name == 'syslogd': 384 if alt_name == 'klogd' or alt_name == 'syslogd':
376 d.appendVar('ALTERNATIVE_%s-syslog' % (pn), ' ' + alt_name) 385 d.appendVar('ALTERNATIVE:%s-syslog' % (pn), ' ' + alt_name)
377 else: 386 else:
378 d.appendVar('ALTERNATIVE_%s' % (pn), ' ' + alt_name) 387 d.appendVar('ALTERNATIVE:%s' % (pn), ' ' + alt_name)
379 d.setVarFlag('ALTERNATIVE_LINK_NAME', alt_name, alt_link_name) 388 d.setVarFlag('ALTERNATIVE_LINK_NAME', alt_name, alt_link_name)
380 if os.path.exists('%s%s' % (dvar, target)): 389 if os.path.exists('%s%s' % (dvar, target)):
381 d.setVarFlag('ALTERNATIVE_TARGET', alt_name, target) 390 d.setVarFlag('ALTERNATIVE_TARGET', alt_name, target)
@@ -395,7 +404,7 @@ python do_package_prepend () {
395# These symlinks will later be updated by update-alternatives calls. 404# These symlinks will later be updated by update-alternatives calls.
396# The update-alternatives.bbclass' postinst script runs firstly before other 405# The update-alternatives.bbclass' postinst script runs firstly before other
397# postinst, but this part of code needs run firstly, so add this funtion. 406# postinst, but this part of code needs run firstly, so add this funtion.
398python populate_packages_updatealternatives_append() { 407python populate_packages_updatealternatives:append() {
399 postinst = """ 408 postinst = """
400test -n 2 > /dev/null || alias test='busybox test' 409test -n 2 > /dev/null || alias test='busybox test'
401if test "x$D" = "x"; then 410if test "x$D" = "x"; then
@@ -422,10 +431,10 @@ if grep -q "^${base_bindir}/bash$" $D${sysconfdir}/busybox.links*; then
422fi 431fi
423 432
424""" 433"""
425 d.prependVar('pkg_postinst_%s' % pkg, postinst) 434 d.prependVar('pkg_postinst:%s' % pkg, postinst)
426} 435}
427 436
428pkg_postinst_${PN}_prepend () { 437pkg_postinst:${PN}:prepend () {
429 # Need path to saved utils, but they may have be removed on upgrade of busybox 438 # Need path to saved utils, but they may have be removed on upgrade of busybox
430 # Only use shell to get paths. Also capture if busybox was saved. 439 # Only use shell to get paths. Also capture if busybox was saved.
431 BUSYBOX="" 440 BUSYBOX=""
@@ -441,7 +450,7 @@ pkg_postinst_${PN}_prepend () {
441 fi 450 fi
442} 451}
443 452
444pkg_postinst_${PN}_append () { 453pkg_postinst:${PN}:append () {
445 # If busybox exists in the remove directory it is because it was the only shell left. 454 # If busybox exists in the remove directory it is because it was the only shell left.
446 if [ "x$D" = "x" ] ; then 455 if [ "x$D" = "x" ] ; then
447 if [ "x$BUSYBOX" != "x" ] ; then 456 if [ "x$BUSYBOX" != "x" ] ; then
@@ -451,7 +460,7 @@ pkg_postinst_${PN}_append () {
451 fi 460 fi
452} 461}
453 462
454pkg_prerm_${PN} () { 463pkg_prerm:${PN} () {
455 # This is so you can make busybox commit suicide - removing busybox with no other packages 464 # This is so you can make busybox commit suicide - removing busybox with no other packages
456 # providing its files, this will make update-alternatives work, but the update-rc.d part 465 # providing its files, this will make update-alternatives work, but the update-rc.d part
457 # for syslog, httpd and/or udhcpd will fail if there is no other package providing sh 466 # for syslog, httpd and/or udhcpd will fail if there is no other package providing sh
@@ -481,7 +490,7 @@ pkg_prerm_${PN} () {
481 fi 490 fi
482} 491}
483 492
484pkg_postrm_${PN} () { 493pkg_postrm:${PN} () {
485 # Add path to remove dir in case we removed our only grep 494 # Add path to remove dir in case we removed our only grep
486 if [ "x$D" = "x" ] ; then 495 if [ "x$D" = "x" ] ; then
487 for busybox_rmdir in /tmp/busyboxrm-*; do 496 for busybox_rmdir in /tmp/busyboxrm-*; do
@@ -496,7 +505,7 @@ pkg_postrm_${PN} () {
496 fi 505 fi
497} 506}
498 507
499pkg_prerm_${PN}-syslog () { 508pkg_prerm:${PN}-syslog () {
500 # remove syslog 509 # remove syslog
501 if test "x$D" = "x"; then 510 if test "x$D" = "x"; then
502 if test "$1" = "upgrade" -o "$1" = "remove"; then 511 if test "$1" = "upgrade" -o "$1" = "remove"; then
@@ -505,4 +514,4 @@ pkg_prerm_${PN}-syslog () {
505 fi 514 fi
506} 515}
507 516
508RPROVIDES_${PN} += "${@bb.utils.contains('DISTRO_FEATURES', 'usrmerge', '/bin/sh /bin/ash', '', d)}" 517RPROVIDES:${PN} += "${@bb.utils.contains('DISTRO_FEATURES', 'usrmerge', '/bin/sh /bin/ash', '', d)}"