summaryrefslogtreecommitdiffstats
path: root/meta/recipes-core/busybox
diff options
context:
space:
mode:
authorChen Qi <Qi.Chen@windriver.com>2013-06-06 13:59:23 +0800
committerRichard Purdie <richard.purdie@linuxfoundation.org>2013-06-25 17:44:51 +0100
commit726483741a69861a2b4adc3186a39de227a353a1 (patch)
tree9815ad3679f2568510ec7c1b26ad6f0cc151f6d7 /meta/recipes-core/busybox
parent6984890b2eef1da8d901f9f5b916f8762f6bd050 (diff)
downloadpoky-726483741a69861a2b4adc3186a39de227a353a1.tar.gz
busybox: add support for CONFIG_FEATURE_INDIVIDUAL
Previously, if CONFIG_FEATURE_INDIVIDUAL was enabled for busybox, yocto-based systems could start correctly. This is because if busybox is built as individual apps, '/bin/busybox' may not be present, so setting the default ALTERNATIVE_TARGET to '/bin/busybox' is not appropriate and could lead to errors. This patch fixes this problem by checking the existence of '/bin/busybox' before setting the ALTERNATIVE_TARGET to '/bin/busybox'. After this change, if busybox is built as individual apps, we'll have links like '/bin/ls -> /bin/ls.busybox', otherwise, we'll have links like '/bin/ls -> /bin/busybox'. Note there's a grep expression change in this patch. The old expression doesn't work well, it has an unwanted underscore, so I changed it to make it work. [YOCTO #4570] (From OE-Core rev: 87efa83191f0b4f4cec3a821b6dfe425c781c077) Signed-off-by: Chen Qi <Qi.Chen@windriver.com> Signed-off-by: Saul Wold <sgw@linux.intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'meta/recipes-core/busybox')
-rw-r--r--meta/recipes-core/busybox/busybox.inc7
1 files changed, 4 insertions, 3 deletions
diff --git a/meta/recipes-core/busybox/busybox.inc b/meta/recipes-core/busybox/busybox.inc
index f4efeb8323..99d4e997b1 100644
--- a/meta/recipes-core/busybox/busybox.inc
+++ b/meta/recipes-core/busybox/busybox.inc
@@ -171,7 +171,7 @@ do_install () {
171 install -m 0755 "0_lib/$NAME" "${D}$FILE.${BPN}" 171 install -m 0755 "0_lib/$NAME" "${D}$FILE.${BPN}"
172 done 172 done
173 # add suid bit where needed 173 # add suid bit where needed
174 for i in `grep -E "APPLET.*_BB_SUID_((MAYBE|REQUIRE))" include/applets.h | grep -v _BB_SUID_DROP | cut -f 3 -d '(' | cut -f 1 -d ','`; do 174 for i in `grep -E "APPLET.*BB_SUID_((MAYBE|REQUIRE))" include/applets.h | grep -v _BB_SUID_DROP | cut -f 3 -d '(' | cut -f 1 -d ','`; do
175 find ${D} -name $i.${BPN} -exec chmod a+s {} \; 175 find ${D} -name $i.${BPN} -exec chmod a+s {} \;
176 done 176 done
177 install -m 0755 0_lib/libbusybox.so.${PV} ${D}${libdir}/libbusybox.so.${PV} 177 install -m 0755 0_lib/libbusybox.so.${PV} ${D}${libdir}/libbusybox.so.${PV}
@@ -242,8 +242,6 @@ ALTERNATIVE_TARGET[syslog-init] = "${sysconfdir}/init.d/syslog.${BPN}"
242ALTERNATIVE_LINK_NAME[syslog-startup-conf] = "${sysconfdir}/syslog-startup.conf" 242ALTERNATIVE_LINK_NAME[syslog-startup-conf] = "${sysconfdir}/syslog-startup.conf"
243ALTERNATIVE_TARGET[syslog-startup-conf] = "${sysconfdir}/syslog-startup.conf.${BPN}" 243ALTERNATIVE_TARGET[syslog-startup-conf] = "${sysconfdir}/syslog-startup.conf.${BPN}"
244 244
245ALTERNATIVE_TARGET = "/bin/busybox"
246
247python do_package_prepend () { 245python do_package_prepend () {
248 # We need to load the full set of busybox provides from the /etc/busybox.links 246 # We need to load the full set of busybox provides from the /etc/busybox.links
249 # Use this to see the update-alternatives with the right information 247 # Use this to see the update-alternatives with the right information
@@ -252,6 +250,9 @@ python do_package_prepend () {
252 pn = d.getVar('PN', True) 250 pn = d.getVar('PN', True)
253 f = open('%s/etc/busybox.links' % (dvar), 'r') 251 f = open('%s/etc/busybox.links' % (dvar), 'r')
254 252
253 if os.path.exists('%s/bin/busybox' % (dvar)):
254 d.setVar('ALTERNATIVE_TARGET', "/bin/busybox")
255
255 for alt_link_name in f: 256 for alt_link_name in f:
256 alt_link_name = alt_link_name.strip() 257 alt_link_name = alt_link_name.strip()
257 alt_name = os.path.basename(alt_link_name) 258 alt_name = os.path.basename(alt_link_name)