Patchwork [09/12] busybox: provide postrm for package mdev

login
register
mail settings
Submitter Bernhard Reutner-Fischer
Date Jan. 3, 2011, 8:02 p.m.
Message ID <1294084926-3115-9-git-send-email-rep.dot.nop@gmail.com>
Download mbox | patch
Permalink /patch/162/
State Accepted
Headers show

Comments

Bernhard Reutner-Fischer - Jan. 3, 2011, 8:02 p.m.
Remove the mdev runlevel entry on package removal.

Signed-off-by: Bernhard Reutner-Fischer <rep.dot.nop@gmail.com>
---
 recipes/busybox/busybox.inc |   18 +++++++++---------
 1 files changed, 9 insertions(+), 9 deletions(-)
Roman Khimov - Jan. 3, 2011, 8:54 p.m.
? ????????? ?? ??????????? 03 ?????? 2011 23:02:03 ????? Bernhard Reutner-
Fischer ???????:
> -if test "x$D" != "x"; then
> -	OPT="-r $D"
> -else
> -	OPT="-s"
> -fi
> +	[ -n "$D" ] && OPT="-r $D" || OPT="-s"

Looks good except for this part (see other mail).
Wolfgang Hauser - Jan. 4, 2011, 11:58 a.m.
Keep it simple and stupid!
So I vote for the long, readable and less error prone version.

Regards
Wolfgang Hauser

Roman I Khimov schrieb:
> ? ????????? ?? ??????????? 03 ?????? 2011 23:02:03 ????? Bernhard Reutner-
> Fischer ???????:
>> -if test "x$D" != "x"; then
>> -	OPT="-r $D"
>> -else
>> -	OPT="-s"
>> -fi
>> +	[ -n "$D" ] && OPT="-r $D" || OPT="-s"
> 
> Looks good except for this part (see other mail).
> 
> 
> 
> 
> _______________________________________________
> Openembedded-devel mailing list
> Openembedded-devel@lists.openembedded.org
> http://lists.linuxtogo.org/cgi-bin/mailman/listinfo/openembedded-devel
Otavio Salvador - Jan. 4, 2011, 12:22 p.m.
On Tue, Jan 4, 2011 at 09:58, Wolfgang Hauser <wohauser@gmx.de> wrote:
> Keep it simple and stupid!
> So I vote for the long, readable and less error prone version.

I usually prefer the KISS however on this specific case I disagree.

The new code avoid using test and a fork. This allows for "test"
applet removal if desired.

I prefer the ugly but more "embedded like" code.
Wolfgang Hauser - Jan. 4, 2011, 12:54 p.m.
I agree for the test statement, but that may be solved by using ´the
brackets in the long statement.

Otavio Salvador schrieb:
> On Tue, Jan 4, 2011 at 09:58, Wolfgang Hauser <wohauser@gmx.de> wrote:
>> Keep it simple and stupid!
>> So I vote for the long, readable and less error prone version.
> 
> I usually prefer the KISS however on this specific case I disagree.
> 
> The new code avoid using test and a fork. This allows for "test"
> applet removal if desired.
> 
> I prefer the ugly but more "embedded like" code.
>
Bernhard Reutner-Fischer - Jan. 11, 2011, 7:41 p.m.
On Tue, Jan 04, 2011 at 01:54:04PM +0100, Wolfgang Hauser wrote:
>I agree for the test statement, but that may be solved by using ´the
>brackets in the long statement.
>
>Otavio Salvador schrieb:
>> On Tue, Jan 4, 2011 at 09:58, Wolfgang Hauser <wohauser@gmx.de> wrote:
>>> Keep it simple and stupid!
>>> So I vote for the long, readable and less error prone version.
>> 
>> I usually prefer the KISS however on this specific case I disagree.
>> 
>> The new code avoid using test and a fork. This allows for "test"
>> applet removal if desired.
>> 
>> I prefer the ugly but more "embedded like" code.

remember that this stuff potentially ends up on the target, so KISS
(byte-wise) is always the preferred way. And yes, update-rc.d and the
required inode itself is bloat, but heck, if you want online
pkg-management you have to take that penalty, FWIW.

So.. Can i please have an explicit ACK for that space-saver?
Otavio Salvador - Jan. 12, 2011, 11:07 a.m.
On Tue, Jan 11, 2011 at 17:41, Bernhard Reutner-Fischer
<rep.dot.nop@gmail.com> wrote:
> On Tue, Jan 04, 2011 at 01:54:04PM +0100, Wolfgang Hauser wrote:
>>I agree for the test statement, but that may be solved by using ´the
>>brackets in the long statement.
>>
>>Otavio Salvador schrieb:
>>> On Tue, Jan 4, 2011 at 09:58, Wolfgang Hauser <wohauser@gmx.de> wrote:
>>>> Keep it simple and stupid!
>>>> So I vote for the long, readable and less error prone version.
>>>
>>> I usually prefer the KISS however on this specific case I disagree.
>>>
>>> The new code avoid using test and a fork. This allows for "test"
>>> applet removal if desired.
>>>
>>> I prefer the ugly but more "embedded like" code.
>
> remember that this stuff potentially ends up on the target, so KISS
> (byte-wise) is always the preferred way. And yes, update-rc.d and the
> required inode itself is bloat, but heck, if you want online
> pkg-management you have to take that penalty, FWIW.
>
> So.. Can i please have an explicit ACK for that space-saver?

Acked-by: Otavio Salvador <otavio@ossystems.com.br>

Patch

diff --git a/recipes/busybox/busybox.inc b/recipes/busybox/busybox.inc
index 97d6f78..59653e0 100644
--- a/recipes/busybox/busybox.inc
+++ b/recipes/busybox/busybox.inc
@@ -361,16 +361,16 @@  PACKAGES =+ "${PN}-mdev"
 FILES_${PN}-mdev = "${sysconfdir}/mdev ${sysconfdir}/mdev.conf ${sysconfdir}/init.d/mdev"
 RDEPENDS_${PN}-mdev += "${PN}"
 
-PACKAGES =+ "${PN}-linuxrc"
-FILES_${PN}-linuxrc = "linuxrc"
-RDEPENDS_${PN}-linuxrc += "${PN}"
-
 pkg_postinst_${PN}-mdev() {
-if test "x$D" != "x"; then
-	OPT="-r $D"
-else
-	OPT="-s"
-fi
+	[ -n "$D" ] && OPT="-r $D" || OPT="-s"
 	update-rc.d $OPT mdev start 06 S .
 }
+pkg_postrm_${PN}-mdev() {
+	[ -n "$D" ] && OPT="-r $D" || OPT="-s"
+	update-rc.d $OPT -f mdev remove
+}
+
+PACKAGES =+ "${PN}-linuxrc"
+FILES_${PN}-linuxrc = "linuxrc"
+RDEPENDS_${PN}-linuxrc += "${PN}"