Patchwork [V2,1/9] busybox: remove the postinst part of the recipe

login
register
mail settings
Submitter Qi.Chen@windriver.com
Date June 17, 2013, 5:49 a.m.
Message ID <4caf51c1d2225dc66aeef8326ba0616d97f7c691.1371447869.git.Qi.Chen@windriver.com>
Download mbox | patch
Permalink /patch/51775/
State New
Headers show

Comments

Qi.Chen@windriver.com - June 17, 2013, 5:49 a.m.
From: Chen Qi <Qi.Chen@windriver.com>

Remove the pkg_postinst_${PN} from this recipe, as it's redundant.
It basically wants to do the same thing as the update-alternatives
does. But it doesn't do it well.

Signed-off-by: Chen Qi <Qi.Chen@windriver.com>
---
 meta/recipes-core/busybox/busybox.inc |    8 --------
 1 file changed, 8 deletions(-)
Otavio Salvador - June 17, 2013, 5:52 p.m.
On Mon, Jun 17, 2013 at 2:49 AM,  <Qi.Chen@windriver.com> wrote:
> From: Chen Qi <Qi.Chen@windriver.com>
>
> Remove the pkg_postinst_${PN} from this recipe, as it's redundant.
> It basically wants to do the same thing as the update-alternatives
> does. But it doesn't do it well.
>
> Signed-off-by: Chen Qi <Qi.Chen@windriver.com>

Most of patch 1 and 2 should be merged; here you should drop the
postinst and convert these to the update-alternative way so we don't
have the tree broken after this patch and allow for bisect  to be
used.

--
Otavio Salvador                             O.S. Systems
http://www.ossystems.com.br        http://projetos.ossystems.com.br
Mobile: +55 (53) 9981-7854            Mobile: +1 (347) 903-9750
Qi.Chen@windriver.com - June 18, 2013, 1:37 a.m.
On 06/18/2013 01:52 AM, Otavio Salvador wrote:
> On Mon, Jun 17, 2013 at 2:49 AM,  <Qi.Chen@windriver.com> wrote:
>> From: Chen Qi <Qi.Chen@windriver.com>
>>
>> Remove the pkg_postinst_${PN} from this recipe, as it's redundant.
>> It basically wants to do the same thing as the update-alternatives
>> does. But it doesn't do it well.
>>
>> Signed-off-by: Chen Qi <Qi.Chen@windriver.com>
> Most of patch 1 and 2 should be merged; here you should drop the
> postinst and convert these to the update-alternative way so we don't
> have the tree broken after this patch and allow for bisect  to be
> used.
Hi Otavio,

Maybe there's some misunderstanding here.
To be clear, patch 1 and patch 2 do two different things.
Patch 1 removes postinst, it has nothing to do with patch 2, which fix 
busybox.inc to support the FEATURE_INDIVIDUAL.
And after this patch (patch 1), the tree is not broken. The busybox 
still works as it has been working so far.

[
And I just did a simple test to confirm this. On the lastest master, I 
removed the postinst part of busybox.inc, and built a 
core-image-minimal, it worked out well. Here's some output.
root@qemuarm:~# ls -l /bin/ | grep busybox
lrwxrwxrwx    1 root     root            12 Jun 18 01:31 ash -> /bin/busybox
-rwsr-xr-x    1 root     root        556824 Jun 18 01:27 busybox
lrwxrwxrwx    1 root     root            12 Jun 18 01:31 cat -> /bin/busybox
lrwxrwxrwx    1 root     root            12 Jun 18 01:31 chattr -> 
/bin/busybox
lrwxrwxrwx    1 root     root            12 Jun 18 01:31 chgrp -> 
/bin/busybox
lrwxrwxrwx    1 root     root            12 Jun 18 01:31 chmod -> 
/bin/busybox
lrwxrwxrwx    1 root     root            12 Jun 18 01:31 chown -> 
/bin/busybox
lrwxrwxrwx    1 root     root            12 Jun 18 01:31 cp -> /bin/busybox
....
]

Best Regards,
Chen Qi

> --
> Otavio Salvador                             O.S. Systems
> http://www.ossystems.com.br        http://projetos.ossystems.com.br
> Mobile: +55 (53) 9981-7854            Mobile: +1 (347) 903-9750
>
>
Otavio Salvador - June 18, 2013, 12:06 p.m.
On Mon, Jun 17, 2013 at 10:37 PM, ChenQi <Qi.Chen@windriver.com> wrote:
> On 06/18/2013 01:52 AM, Otavio Salvador wrote:
>>
>> On Mon, Jun 17, 2013 at 2:49 AM,  <Qi.Chen@windriver.com> wrote:
>>>
>>> From: Chen Qi <Qi.Chen@windriver.com>
>>>
>>> Remove the pkg_postinst_${PN} from this recipe, as it's redundant.
>>> It basically wants to do the same thing as the update-alternatives
>>> does. But it doesn't do it well.
>>>
>>> Signed-off-by: Chen Qi <Qi.Chen@windriver.com>
>>
>> Most of patch 1 and 2 should be merged; here you should drop the
>> postinst and convert these to the update-alternative way so we don't
>> have the tree broken after this patch and allow for bisect  to be
>> used.
>
> Hi Otavio,
>
> Maybe there's some misunderstanding here.
> To be clear, patch 1 and patch 2 do two different things.
> Patch 1 removes postinst, it has nothing to do with patch 2, which fix
> busybox.inc to support the FEATURE_INDIVIDUAL.
> And after this patch (patch 1), the tree is not broken. The busybox still
> works as it has been working so far.
>
> [
> And I just did a simple test to confirm this. On the lastest master, I
> removed the postinst part of busybox.inc, and built a core-image-minimal, it
> worked out well. Here's some output.
> root@qemuarm:~# ls -l /bin/ | grep busybox
> lrwxrwxrwx    1 root     root            12 Jun 18 01:31 ash -> /bin/busybox
> -rwsr-xr-x    1 root     root        556824 Jun 18 01:27 busybox
> lrwxrwxrwx    1 root     root            12 Jun 18 01:31 cat -> /bin/busybox
> lrwxrwxrwx    1 root     root            12 Jun 18 01:31 chattr ->
> /bin/busybox
> lrwxrwxrwx    1 root     root            12 Jun 18 01:31 chgrp ->
> /bin/busybox
> lrwxrwxrwx    1 root     root            12 Jun 18 01:31 chmod ->
> /bin/busybox
> lrwxrwxrwx    1 root     root            12 Jun 18 01:31 chown ->
> /bin/busybox
> lrwxrwxrwx    1 root     root            12 Jun 18 01:31 cp -> /bin/busybox
> ....
> ]

Oh I see.

So I have no objection for the patch :-)

Thanks by letting me know.

--
Otavio Salvador                             O.S. Systems
http://www.ossystems.com.br        http://projetos.ossystems.com.br
Mobile: +55 (53) 9981-7854            Mobile: +1 (347) 903-9750

Patch

diff --git a/meta/recipes-core/busybox/busybox.inc b/meta/recipes-core/busybox/busybox.inc
index c8908b0..f4efeb8 100644
--- a/meta/recipes-core/busybox/busybox.inc
+++ b/meta/recipes-core/busybox/busybox.inc
@@ -265,14 +265,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