All of lore.kernel.org
 help / color / mirror / Atom feed
From: Saul Wold <sgw@linux.intel.com>
To: Qi.Chen@windriver.com
Cc: qingtao.cao@windriver.com, openembedded-core@lists.openembedded.org
Subject: Re: [PATCH 1/1] busybox: fix to support FEATURE_INDIVIDUAL
Date: Thu, 30 May 2013 21:26:30 +0900	[thread overview]
Message-ID: <51A74576.6020604@linux.intel.com> (raw)
In-Reply-To: <61b6db5766ad5f6690aa059ffd26f0b00834e433.1369895527.git.Qi.Chen@windriver.com>

On 05/30/2013 05:51 PM, Qi.Chen@windriver.com wrote:
> From: Chen Qi <Qi.Chen@windriver.com>
>
> 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'.
>
Does this add size to the image?  In this example does ls.busybox link 
to something else or is it a binary on it's own?

Sau!


> Besides, this patch removes the pkg_postinst part in the busybox recipe,
> because it's redundant.
>
> [YOCTO #4570]
>
> Signed-off-by: Chen Qi <Qi.Chen@windriver.com>
> ---
>   meta/recipes-core/busybox/busybox.inc |   16 +++++-----------
>   1 file changed, 5 insertions(+), 11 deletions(-)
>
> diff --git a/meta/recipes-core/busybox/busybox.inc b/meta/recipes-core/busybox/busybox.inc
> index c8908b0..6abe167 100644
> --- a/meta/recipes-core/busybox/busybox.inc
> +++ b/meta/recipes-core/busybox/busybox.inc
> @@ -171,7 +171,7 @@ do_install () {
>   			install -m 0755 "0_lib/$NAME" "${D}$FILE.${BPN}"
>   		done
>   		# add suid bit where needed
> -		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
> +		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
>   			find ${D} -name $i.${BPN} -exec chmod a+s {} \;
>   		done
>   		install -m 0755 0_lib/libbusybox.so.${PV} ${D}${libdir}/libbusybox.so.${PV}
> @@ -242,14 +242,16 @@ ALTERNATIVE_TARGET[syslog-init] = "${sysconfdir}/init.d/syslog.${BPN}"
>   ALTERNATIVE_LINK_NAME[syslog-startup-conf] = "${sysconfdir}/syslog-startup.conf"
>   ALTERNATIVE_TARGET[syslog-startup-conf] = "${sysconfdir}/syslog-startup.conf.${BPN}"
>
> -ALTERNATIVE_TARGET = "/bin/busybox"
> -
>   python do_package_prepend () {
>       # We need to load the full set of busybox provides from the /etc/busybox.links
>       # Use this to see the update-alternatives with the right information
>
>       dvar = d.getVar('D', True)
>       pn = d.getVar('PN', True)
> +
> +    if os.path.exists('%s/bin/busybox' % (dvar)):
> +        d.setVar('ALTERNATIVE_TARGET', "/bin/busybox")
> +
>       f = open('%s/etc/busybox.links' % (dvar), 'r')
>
>       for alt_link_name in f:
> @@ -265,14 +267,6 @@ python do_package_prepend () {
>       f.close()
>   }
>
> -pkg_postinst_${PN} () {
> -	# If we are not making an image we create links for the utilities that doesn't exist
> -	# so the update-alternatives script will get the utilities it needs
> -	# (update-alternatives have no problem replacing links later anyway)
> -	test -n 2> /dev/null || alias test='busybox test'
> -	if test "x$D" = "x"; then while read link; do if test ! -h "$link"; then case "$link" in /*/*/*) to="../../bin/busybox";; /bin/*) to="busybox";; /*/*) to="../bin/busybox";; esac; busybox ln -s $to $link; fi; done </etc/busybox.links; fi
> -}
> -
>   pkg_prerm_${PN} () {
>   	# This is so you can make busybox commit suicide - removing busybox with no other packages
>   	# providing its files, this will make update-alternatives work, but the update-rc.d part
>


  reply	other threads:[~2013-05-30 12:26 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-05-30  8:51 [PATCH 0/1] busybox: fix to support FEATURE_INDIVIDUAL Qi.Chen
2013-05-30  8:51 ` [PATCH 1/1] " Qi.Chen
2013-05-30 12:26   ` Saul Wold [this message]
2013-06-03  2:19     ` ChenQi
2013-06-03  4:10       ` Saul Wold
2013-06-03  4:34         ` ChenQi

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=51A74576.6020604@linux.intel.com \
    --to=sgw@linux.intel.com \
    --cc=Qi.Chen@windriver.com \
    --cc=openembedded-core@lists.openembedded.org \
    --cc=qingtao.cao@windriver.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.