Openembedded Core Discussions
 help / color / mirror / Atom feed
* [PATCH][oe-core 0/4] Small fixes for sysstat, shadow, coreutils, gconf
@ 2011-12-01 12:01 Martin Jansa
  2011-12-01 12:02 ` [PATCH][oe-core 1/4] sysstat: don't run populate-volatile.sh update in do_rootfs or without populate-volatile.sh Martin Jansa
                   ` (4 more replies)
  0 siblings, 5 replies; 9+ messages in thread
From: Martin Jansa @ 2011-12-01 12:01 UTC (permalink / raw)
  To: openembedded-core

sysstat and gconf are fixed version of previous patches (which were also sent
to ML, resending now just to be clear that they are also in branch and pull-request).

The following changes since commit 6ef79ede361c42e11e78d4afcff11295a3144055:

  pulseaudio 1.1: add filter-apply and filter-heuristics to pulseaudio-server RDEPENDS, it won't start without (2011-12-01 10:53:27 +0000)

are available in the git repository at:
  git://git.openembedded.org/openembedded-core-contrib jansa/pull
  http://cgit.openembedded.org/cgit.cgi/openembedded-core-contrib/log/?h=jansa/pull

Martin Jansa (4):
  sysstat: don't run populate-volatile.sh update in do_rootfs or
    without populate-volatile.sh
  gconf: add polkit to DEPENDS only for target recipe and disable
    default-service for native
  shadow: use u-a for /usr/bin/groups
  coreutils: fix u-a for base64, mktemp and df

 meta/recipes-core/coreutils/coreutils_8.14.bb   |   20 ++++++++++++++------
 meta/recipes-extended/shadow/shadow_4.1.4.3.bb  |    5 +++--
 meta/recipes-extended/sysstat/sysstat.inc       |    7 ++++++-
 meta/recipes-extended/sysstat/sysstat_10.0.2.bb |    2 +-
 meta/recipes-gnome/gnome/gconf_3.2.3.bb         |   10 +++++++---
 5 files changed, 31 insertions(+), 13 deletions(-)

-- 
1.7.8.rc4




^ permalink raw reply	[flat|nested] 9+ messages in thread

* [PATCH][oe-core 1/4] sysstat: don't run populate-volatile.sh update in do_rootfs or without populate-volatile.sh
  2011-12-01 12:01 [PATCH][oe-core 0/4] Small fixes for sysstat, shadow, coreutils, gconf Martin Jansa
@ 2011-12-01 12:02 ` Martin Jansa
  2011-12-01 12:18   ` Richard Purdie
  2011-12-01 12:02 ` [PATCH][oe-core 2/4] gconf: add polkit to DEPENDS only for target recipe and disable default-service for native Martin Jansa
                   ` (3 subsequent siblings)
  4 siblings, 1 reply; 9+ messages in thread
From: Martin Jansa @ 2011-12-01 12:02 UTC (permalink / raw)
  To: openembedded-core

Signed-off-by: Martin Jansa <Martin.Jansa@gmail.com>
---
 meta/recipes-extended/sysstat/sysstat.inc       |    7 ++++++-
 meta/recipes-extended/sysstat/sysstat_10.0.2.bb |    2 +-
 2 files changed, 7 insertions(+), 2 deletions(-)

diff --git a/meta/recipes-extended/sysstat/sysstat.inc b/meta/recipes-extended/sysstat/sysstat.inc
index 2936f96..ca40ab5 100644
--- a/meta/recipes-extended/sysstat/sysstat.inc
+++ b/meta/recipes-extended/sysstat/sysstat.inc
@@ -22,7 +22,12 @@ do_install() {
 }
 
 pkg_postinst_${PN} () {
-        /etc/init.d/populate-volatile.sh update
+        if [ -n "$D" ]; then
+                exit 1
+        fi
+        if [ -e /etc/init.d/populate-volatile.sh ]; then
+                /etc/init.d/populate-volatile.sh update
+        fi
 }
 
 
diff --git a/meta/recipes-extended/sysstat/sysstat_10.0.2.bb b/meta/recipes-extended/sysstat/sysstat_10.0.2.bb
index bd559d8..7b57bc8 100644
--- a/meta/recipes-extended/sysstat/sysstat_10.0.2.bb
+++ b/meta/recipes-extended/sysstat/sysstat_10.0.2.bb
@@ -2,7 +2,7 @@ require sysstat.inc
 
 LIC_FILES_CHKSUM = "file://COPYING;md5=8ca43cbc842c2336e835926c2166c28b"
 
-PR = "r0"
+PR = "r1"
 
 
 
-- 
1.7.8.rc4




^ permalink raw reply related	[flat|nested] 9+ messages in thread

* [PATCH][oe-core 2/4] gconf: add polkit to DEPENDS only for target recipe and disable default-service for native
  2011-12-01 12:01 [PATCH][oe-core 0/4] Small fixes for sysstat, shadow, coreutils, gconf Martin Jansa
  2011-12-01 12:02 ` [PATCH][oe-core 1/4] sysstat: don't run populate-volatile.sh update in do_rootfs or without populate-volatile.sh Martin Jansa
@ 2011-12-01 12:02 ` Martin Jansa
  2011-12-01 12:02 ` [PATCH][oe-core 3/4] shadow: use u-a for /usr/bin/groups Martin Jansa
                   ` (2 subsequent siblings)
  4 siblings, 0 replies; 9+ messages in thread
From: Martin Jansa @ 2011-12-01 12:02 UTC (permalink / raw)
  To: openembedded-core

* gnome-common-native is needed because gnomebase.bbclass does only
  DEPENDS += "gnome-common"

Signed-off-by: Martin Jansa <Martin.Jansa@gmail.com>
---
 meta/recipes-gnome/gnome/gconf_3.2.3.bb |   10 +++++++---
 1 files changed, 7 insertions(+), 3 deletions(-)

diff --git a/meta/recipes-gnome/gnome/gconf_3.2.3.bb b/meta/recipes-gnome/gnome/gconf_3.2.3.bb
index aa9da78..cdc7a35 100644
--- a/meta/recipes-gnome/gnome/gconf_3.2.3.bb
+++ b/meta/recipes-gnome/gnome/gconf_3.2.3.bb
@@ -3,9 +3,10 @@ SECTION = "x11/gnome"
 LICENSE = "LGPLv2+"
 LIC_FILES_CHKSUM = "file://COPYING;md5=55ca817ccb7d5b5b66355690e9abc605"
 
-DEPENDS = "glib-2.0 dbus dbus-glib libxml2 intltool-native"
+DEPENDS = "glib-2.0 dbus dbus-glib libxml2 intltool-native polkit"
+DEPENDS_virtclass-native = "glib-2.0-native dbus-native dbus-glib-native libxml2-native intltool-native gnome-common-native"
 
-PR = "r1"
+PR = "r2"
 
 inherit gnomebase
 
@@ -18,7 +19,10 @@ SRC_URI[archive.sha256sum] = "52008a82a847527877d9e1e549a351c86cc53cada4733b8a70
 
 S = "${WORKDIR}/GConf-${PV}"
 
-EXTRA_OECONF = "--disable-gtk-doc --disable-gtk --enable-shared --disable-static --enable-debug=yes --disable-introspection --disable-orbit --with-openldap=no"
+POLKIT_OECONF = "--enable-defaults-service"
+POLKIT_OECONF_virtclass-native = "--disable-defaults-service"
+EXTRA_OECONF = "--disable-gtk-doc --disable-gtk --enable-shared --disable-static --enable-debug=yes \
+                --disable-introspection --disable-orbit --with-openldap=no ${POLKIT_OECONF}"
 
 do_configure_prepend () {
 	touch gtk-doc.make
-- 
1.7.8.rc4




^ permalink raw reply related	[flat|nested] 9+ messages in thread

* [PATCH][oe-core 3/4] shadow: use u-a for /usr/bin/groups
  2011-12-01 12:01 [PATCH][oe-core 0/4] Small fixes for sysstat, shadow, coreutils, gconf Martin Jansa
  2011-12-01 12:02 ` [PATCH][oe-core 1/4] sysstat: don't run populate-volatile.sh update in do_rootfs or without populate-volatile.sh Martin Jansa
  2011-12-01 12:02 ` [PATCH][oe-core 2/4] gconf: add polkit to DEPENDS only for target recipe and disable default-service for native Martin Jansa
@ 2011-12-01 12:02 ` Martin Jansa
  2011-12-01 12:02 ` [PATCH][oe-core 4/4] coreutils: fix u-a for base64, mktemp and df Martin Jansa
  2011-12-01 12:20 ` [PATCH][oe-core 0/4] Small fixes for sysstat, shadow, coreutils, gconf Richard Purdie
  4 siblings, 0 replies; 9+ messages in thread
From: Martin Jansa @ 2011-12-01 12:02 UTC (permalink / raw)
  To: openembedded-core

* otherwise coreutils upgrade fails with
  update-alternatives: Error: not linking //usr/bin/groups to groups.coreutils since //usr/bin/groups exists and is not a link

Signed-off-by: Martin Jansa <Martin.Jansa@gmail.com>
---
 meta/recipes-extended/shadow/shadow_4.1.4.3.bb |    5 +++--
 1 files changed, 3 insertions(+), 2 deletions(-)

diff --git a/meta/recipes-extended/shadow/shadow_4.1.4.3.bb b/meta/recipes-extended/shadow/shadow_4.1.4.3.bb
index 25330a4..dddac2c 100644
--- a/meta/recipes-extended/shadow/shadow_4.1.4.3.bb
+++ b/meta/recipes-extended/shadow/shadow_4.1.4.3.bb
@@ -9,7 +9,7 @@ LIC_FILES_CHKSUM = "file://COPYING;md5=08c553a87d4e51bbed50b20e0adcaede \
 
 DEPENDS = "${@base_contains('DISTRO_FEATURES', 'pam', 'libpam', '', d)}"
 RDEPENDS_${PN} = "${@base_contains('DISTRO_FEATURES', 'pam', '${PAM_PLUGINS}', '', d)}"
-PR = "r5"
+PR = "r6"
 
 SRC_URI = "http://pkg-shadow.alioth.debian.org/releases/${BPN}-${PV}.tar.bz2 \
            file://login_defs_pam.sed \
@@ -88,7 +88,7 @@ do_install_append() {
 	sed -i '/^CREATE_MAIL_SPOOL/ s:^:#:' ${D}${sysconfdir}/default/useradd
 
 	install -d ${D}${sbindir} ${D}${base_sbindir} ${D}${base_bindir} 
-	for i in passwd chfn newgrp chsh ; do
+	for i in passwd chfn newgrp chsh groups ; do
 		mv ${D}${bindir}/$i ${D}${bindir}/$i.${PN}
 	done
 
@@ -123,6 +123,7 @@ pkg_postinst_${PN} () {
 	update-alternatives --install ${bindir}/chfn chfn chfn.${PN} 200
 	update-alternatives --install ${bindir}/newgrp newgrp newgrp.${PN} 200
 	update-alternatives --install ${bindir}/chsh chsh chsh.${PN} 200
+	update-alternatives --install ${bindir}/groups groups groups.${PN} 200
 	update-alternatives --install ${base_bindir}/login login login.${PN} 200
 	update-alternatives --install ${base_sbindir}/vipw vipw vipw.${PN} 200
 	update-alternatives --install ${base_sbindir}/vigr vigr vigr.${PN} 200
-- 
1.7.8.rc4




^ permalink raw reply related	[flat|nested] 9+ messages in thread

* [PATCH][oe-core 4/4] coreutils: fix u-a for base64, mktemp and df
  2011-12-01 12:01 [PATCH][oe-core 0/4] Small fixes for sysstat, shadow, coreutils, gconf Martin Jansa
                   ` (2 preceding siblings ...)
  2011-12-01 12:02 ` [PATCH][oe-core 3/4] shadow: use u-a for /usr/bin/groups Martin Jansa
@ 2011-12-01 12:02 ` Martin Jansa
  2011-12-01 12:20 ` [PATCH][oe-core 0/4] Small fixes for sysstat, shadow, coreutils, gconf Richard Purdie
  4 siblings, 0 replies; 9+ messages in thread
From: Martin Jansa @ 2011-12-01 12:02 UTC (permalink / raw)
  To: openembedded-core

* busybox installs mktemp and df to base_bindir not bindir
  SHR root@gjama ~ $ ll /bin/df /bin/mktemp /bin/base64
  lrwxrwxrwx 1 root root 7 Nov 10 15:44 /bin/df -> busybox
  lrwxrwxrwx 1 root root 7 Nov 10 15:44 /bin/mktemp -> busybox
  lrwxrwxrwx 1 root root 7 Nov 28 15:48 /bin/base64 -> busybox

* so u-a for coreutils fails:
  update-alternatives: Error: cannot register alternative base64 to /usr/bin/base64 since it is already registered to /bin/base64
  update-alternatives: Error: cannot register alternative mktemp to /usr/bin/mktemp since it is already registered to /bin/mktemp
  update-alternatives: Error: cannot register alternative df to /usr/bin/df since it is already registered to /bin/df

Signed-off-by: Martin Jansa <Martin.Jansa@gmail.com>
---
 meta/recipes-core/coreutils/coreutils_8.14.bb |   20 ++++++++++++++------
 1 files changed, 14 insertions(+), 6 deletions(-)

diff --git a/meta/recipes-core/coreutils/coreutils_8.14.bb b/meta/recipes-core/coreutils/coreutils_8.14.bb
index 01face0..cc05d88 100644
--- a/meta/recipes-core/coreutils/coreutils_8.14.bb
+++ b/meta/recipes-core/coreutils/coreutils_8.14.bb
@@ -7,7 +7,7 @@ BUGTRACKER = "http://debbugs.gnu.org/coreutils"
 LICENSE = "GPLv3+"
 LIC_FILES_CHKSUM = "file://COPYING;md5=d32239bcb673463ab874e80d47fae504\
                     file://src/ls.c;startline=5;endline=16;md5=e1a509558876db58fb6667ba140137ad"
-PR = "r1"
+PR = "r2"
 DEPENDS = "gmp"
 DEPENDS_virtclass-native = ""
 
@@ -21,13 +21,13 @@ SRC_URI[sha256sum] = "0d120817c19292edb19e92ae6b8eac9020e03d51e0af9cb116cf82b65d
 
 EXTRA_OECONF_virtclass-native = "--without-gmp"
 
-# [ gets a special treatment and is not included in this
-bindir_progs = "base64 basename chcon cksum comm csplit cut dir dircolors dirname du \
+# [ df mktemp base64 gets a special treatment and is not included in this
+bindir_progs = "basename chcon cksum comm csplit cut dir dircolors dirname du \
                 env expand expr factor fmt fold groups head hostid id install \
-                join link logname md5sum mkfifo mktemp nice nl nohup nproc od paste pathchk \
+                join link logname md5sum mkfifo nice nl nohup nproc od paste pathchk \
                 pinky pr printenv printf ptx readlink runcon seq sha1sum sha224sum sha256sum \
                 sha384sum sha512sum shred shuf sort split stat stdbuf sum tac tail tee test timeout\
-                tr truncate tsort tty unexpand uniq unlink uptime users vdir wc who whoami yes df"
+                tr truncate tsort tty unexpand uniq unlink uptime users vdir wc who whoami yes"
 
 # hostname gets a special treatment and is not included in this
 base_bindir_progs = "cat chgrp chmod chown cp date dd echo false kill ln ls mkdir \
@@ -36,7 +36,7 @@ base_bindir_progs = "cat chgrp chmod chown cp date dd echo false kill ln ls mkdi
 sbindir_progs= "chroot"
 
 do_install_append() {
-	for i in ${bindir_progs}; do mv ${D}${bindir}/$i ${D}${bindir}/$i.${PN}; done
+	for i in ${bindir_progs} df mktemp base64; do mv ${D}${bindir}/$i ${D}${bindir}/$i.${PN}; done
 
 	install -d ${D}${base_bindir}
 	for i in ${base_bindir_progs}; do mv ${D}${bindir}/$i ${D}${base_bindir}/$i.${PN}; done
@@ -61,6 +61,11 @@ pkg_postinst_${PN} () {
 
 	# Special cases. [ needs to be treated separately.
 	update-alternatives --install '${bindir}/[' '[' 'lbracket.${PN}' 100
+	
+	# Special cases. base64, mktemp and df need to be treated separately, because busybox have them in base_binding not bindir
+	update-alternatives --install ${base_bindir}/base64 base64 ${bindir}/base64.${PN} 100;
+	update-alternatives --install ${base_bindir}/mktemp mktemp ${bindir}/mktemp.${PN} 100;
+	update-alternatives --install ${base_bindir}/df df ${bindir}/df.${PN} 100;
 }
 
 pkg_prerm_${PN} () {
@@ -74,6 +79,9 @@ pkg_prerm_${PN} () {
 	update-alternatives --remove hostname hostname.${PN}
 	update-alternatives --remove uptime uptime.${PN}
 	update-alternatives --remove '[' 'lbracket.${PN}'
+	update-alternatives --remove base64 ${bindir}/base64.${PN}
+	update-alternatives --remove mktemp ${bindir}/mktemp.${PN}
+	update-alternatives --remove df ${bindir}.df.${PN}
 }
 
 BBCLASSEXTEND = "native"
-- 
1.7.8.rc4




^ permalink raw reply related	[flat|nested] 9+ messages in thread

* Re: [PATCH][oe-core 1/4] sysstat: don't run populate-volatile.sh update in do_rootfs or without populate-volatile.sh
  2011-12-01 12:02 ` [PATCH][oe-core 1/4] sysstat: don't run populate-volatile.sh update in do_rootfs or without populate-volatile.sh Martin Jansa
@ 2011-12-01 12:18   ` Richard Purdie
  2011-12-01 12:41     ` Martin Jansa
  0 siblings, 1 reply; 9+ messages in thread
From: Richard Purdie @ 2011-12-01 12:18 UTC (permalink / raw)
  To: Patches and discussions about the oe-core layer

On Thu, 2011-12-01 at 13:02 +0100, Martin Jansa wrote:
> Signed-off-by: Martin Jansa <Martin.Jansa@gmail.com>
> ---
>  meta/recipes-extended/sysstat/sysstat.inc       |    7 ++++++-
>  meta/recipes-extended/sysstat/sysstat_10.0.2.bb |    2 +-
>  2 files changed, 7 insertions(+), 2 deletions(-)
> 
> diff --git a/meta/recipes-extended/sysstat/sysstat.inc b/meta/recipes-extended/sysstat/sysstat.inc
> index 2936f96..ca40ab5 100644
> --- a/meta/recipes-extended/sysstat/sysstat.inc
> +++ b/meta/recipes-extended/sysstat/sysstat.inc
> @@ -22,7 +22,12 @@ do_install() {
>  }
>  
>  pkg_postinst_${PN} () {
> -        /etc/init.d/populate-volatile.sh update
> +        if [ -n "$D" ]; then
> +                exit 1
> +        fi

I'm confused. Can't we exit 0 here since the system will have run
populate-volatile.sh update at rootfs time or first boot as needed so we
don't need to run it again?

See recipes-core/dbus/dbus.inc or pulseaudio for similar examples.

Cheers,

Richard





^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: [PATCH][oe-core 0/4] Small fixes for sysstat, shadow, coreutils, gconf
  2011-12-01 12:01 [PATCH][oe-core 0/4] Small fixes for sysstat, shadow, coreutils, gconf Martin Jansa
                   ` (3 preceding siblings ...)
  2011-12-01 12:02 ` [PATCH][oe-core 4/4] coreutils: fix u-a for base64, mktemp and df Martin Jansa
@ 2011-12-01 12:20 ` Richard Purdie
  4 siblings, 0 replies; 9+ messages in thread
From: Richard Purdie @ 2011-12-01 12:20 UTC (permalink / raw)
  To: Patches and discussions about the oe-core layer

On Thu, 2011-12-01 at 13:01 +0100, Martin Jansa wrote:
> sysstat and gconf are fixed version of previous patches (which were also sent
> to ML, resending now just to be clear that they are also in branch and pull-request).
> 
> The following changes since commit 6ef79ede361c42e11e78d4afcff11295a3144055:
> 
>   pulseaudio 1.1: add filter-apply and filter-heuristics to pulseaudio-server RDEPENDS, it won't start without (2011-12-01 10:53:27 +0000)
> 
> are available in the git repository at:
>   git://git.openembedded.org/openembedded-core-contrib jansa/pull
>   http://cgit.openembedded.org/cgit.cgi/openembedded-core-contrib/log/?h=jansa/pull
> 
> Martin Jansa (4):
>   sysstat: don't run populate-volatile.sh update in do_rootfs or
>     without populate-volatile.sh
>   gconf: add polkit to DEPENDS only for target recipe and disable
>     default-service for native
>   shadow: use u-a for /usr/bin/groups
>   coreutils: fix u-a for base64, mktemp and df

I have a question on the sysstat change, I merged the others, thanks.

Richard




^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: [PATCH][oe-core 1/4] sysstat: don't run populate-volatile.sh update in do_rootfs or without populate-volatile.sh
  2011-12-01 12:18   ` Richard Purdie
@ 2011-12-01 12:41     ` Martin Jansa
  2011-12-02  0:24       ` Martin Jansa
  0 siblings, 1 reply; 9+ messages in thread
From: Martin Jansa @ 2011-12-01 12:41 UTC (permalink / raw)
  To: Patches and discussions about the oe-core layer

[-- Attachment #1: Type: text/plain, Size: 1548 bytes --]

On Thu, Dec 01, 2011 at 12:18:09PM +0000, Richard Purdie wrote:
> On Thu, 2011-12-01 at 13:02 +0100, Martin Jansa wrote:
> > Signed-off-by: Martin Jansa <Martin.Jansa@gmail.com>
> > ---
> >  meta/recipes-extended/sysstat/sysstat.inc       |    7 ++++++-
> >  meta/recipes-extended/sysstat/sysstat_10.0.2.bb |    2 +-
> >  2 files changed, 7 insertions(+), 2 deletions(-)
> > 
> > diff --git a/meta/recipes-extended/sysstat/sysstat.inc b/meta/recipes-extended/sysstat/sysstat.inc
> > index 2936f96..ca40ab5 100644
> > --- a/meta/recipes-extended/sysstat/sysstat.inc
> > +++ b/meta/recipes-extended/sysstat/sysstat.inc
> > @@ -22,7 +22,12 @@ do_install() {
> >  }
> >  
> >  pkg_postinst_${PN} () {
> > -        /etc/init.d/populate-volatile.sh update
> > +        if [ -n "$D" ]; then
> > +                exit 1
> > +        fi
> 
> I'm confused. Can't we exit 0 here since the system will have run
> populate-volatile.sh update at rootfs time or first boot as needed so we
> don't need to run it again?
> 
> See recipes-core/dbus/dbus.inc or pulseaudio for similar examples.

Ah I didn't know about importance of return value in this case and I was
looking at 
meta/classes/module.bbclass
meta/recipes-connectivity/avahi/avahi.inc
for similar examples.

I'll learn how it's changing behavior and why avahi has exit 1 in 2/3
and exit 0 in 1/3 postinst and then I'll send updated patch if needed,
but now I'm 5 hours late to daywork.. :).

Cheers,

-- 
Martin 'JaMa' Jansa     jabber: Martin.Jansa@gmail.com

[-- Attachment #2: Digital signature --]
[-- Type: application/pgp-signature, Size: 205 bytes --]

^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: [PATCH][oe-core 1/4] sysstat: don't run populate-volatile.sh update in do_rootfs or without populate-volatile.sh
  2011-12-01 12:41     ` Martin Jansa
@ 2011-12-02  0:24       ` Martin Jansa
  0 siblings, 0 replies; 9+ messages in thread
From: Martin Jansa @ 2011-12-02  0:24 UTC (permalink / raw)
  To: Patches and discussions about the oe-core layer

[-- Attachment #1: Type: text/plain, Size: 3611 bytes --]

On Thu, Dec 01, 2011 at 01:41:46PM +0100, Martin Jansa wrote:
> On Thu, Dec 01, 2011 at 12:18:09PM +0000, Richard Purdie wrote:
> > On Thu, 2011-12-01 at 13:02 +0100, Martin Jansa wrote:
> > > Signed-off-by: Martin Jansa <Martin.Jansa@gmail.com>
> > > ---
> > >  meta/recipes-extended/sysstat/sysstat.inc       |    7 ++++++-
> > >  meta/recipes-extended/sysstat/sysstat_10.0.2.bb |    2 +-
> > >  2 files changed, 7 insertions(+), 2 deletions(-)
> > > 
> > > diff --git a/meta/recipes-extended/sysstat/sysstat.inc b/meta/recipes-extended/sysstat/sysstat.inc
> > > index 2936f96..ca40ab5 100644
> > > --- a/meta/recipes-extended/sysstat/sysstat.inc
> > > +++ b/meta/recipes-extended/sysstat/sysstat.inc
> > > @@ -22,7 +22,12 @@ do_install() {
> > >  }
> > >  
> > >  pkg_postinst_${PN} () {
> > > -        /etc/init.d/populate-volatile.sh update
> > > +        if [ -n "$D" ]; then
> > > +                exit 1
> > > +        fi
> > 
> > I'm confused. Can't we exit 0 here since the system will have run
> > populate-volatile.sh update at rootfs time or first boot as needed so we
> > don't need to run it again?
> > 
> > See recipes-core/dbus/dbus.inc or pulseaudio for similar examples.
> 
> Ah I didn't know about importance of return value in this case and I was
> looking at 
> meta/classes/module.bbclass
> meta/recipes-connectivity/avahi/avahi.inc
> for similar examples.
> 
> I'll learn how it's changing behavior and why avahi has exit 1 in 2/3
> and exit 0 in 1/3 postinst and then I'll send updated patch if needed,
> but now I'm 5 hours late to daywork.. :).

Now after reading
3.1.6. Post Install Scripts
in manual
http://www.yoctoproject.org/docs/1.1/poky-ref-manual/poky-ref-manual.html#usingpoky-extend-addpkg-postinstalls

I'm confused too and wondering if dbus and pulseaudio are best examples..
dbus:
pkg_postinst_dbus() {
        if [ -z "$D" ] && [ -e /etc/init.d/populate-volatile.sh ] ; then
                /etc/init.d/populate-volatile.sh update
        fi
}

so it this will succeed every time in do_rootfs (even with test expression false), so it will be marked as installed 
and postinst won't be called on first boot, but will be called after every upgrade. Is that what we really want?

pulseaudio:
pkg_postinst_${PN}-server() {
        # can't do this offline
        if [ "x$D" != "x" ]; then
                exit 1
        fi

        if [ -e ${sysconfdir}/init.d/populate-volatile.sh ] ; then
            ${sysconfdir}/init.d/populate-volatile.sh update
        fi
}

this looks the same as my postinst in sysstat (only difference is '"x$D" != "x"' instead of shorter '-n "$D"')
and if I understand it right now, then this is better then what's in dbus.inc, because
during rootfs we maybe have /etc/init.d/populate-volatile.sh in $D but do we want to call 
/etc/init.d/populate-volatile.sh on host? Or does it automagically prepend $D to every path 
when it's executing postinst scripts in do_rootfs or does it some sort of chroot to $D?

Even if we prefix the path with $D in postinst like:
$D${sysconfdir}/init.d/populate-volatile.sh update
the populate-volatile.sh script has hardcoded paths like '/etc/volatile.cache' and '/etc/ld.so.cache'
inside, so it won't work very well when executed on host (without chrooting) and we should postpone it 
to be executed really on target and that's why we need 'exit 1'.

If I'm wrong please correct me and update "3.1.6. Post Install Scripts" to be more clear about this issues.

Cheers,

-- 
Martin 'JaMa' Jansa     jabber: Martin.Jansa@gmail.com

[-- Attachment #2: Digital signature --]
[-- Type: application/pgp-signature, Size: 205 bytes --]

^ permalink raw reply	[flat|nested] 9+ messages in thread

end of thread, other threads:[~2011-12-02  0:31 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2011-12-01 12:01 [PATCH][oe-core 0/4] Small fixes for sysstat, shadow, coreutils, gconf Martin Jansa
2011-12-01 12:02 ` [PATCH][oe-core 1/4] sysstat: don't run populate-volatile.sh update in do_rootfs or without populate-volatile.sh Martin Jansa
2011-12-01 12:18   ` Richard Purdie
2011-12-01 12:41     ` Martin Jansa
2011-12-02  0:24       ` Martin Jansa
2011-12-01 12:02 ` [PATCH][oe-core 2/4] gconf: add polkit to DEPENDS only for target recipe and disable default-service for native Martin Jansa
2011-12-01 12:02 ` [PATCH][oe-core 3/4] shadow: use u-a for /usr/bin/groups Martin Jansa
2011-12-01 12:02 ` [PATCH][oe-core 4/4] coreutils: fix u-a for base64, mktemp and df Martin Jansa
2011-12-01 12:20 ` [PATCH][oe-core 0/4] Small fixes for sysstat, shadow, coreutils, gconf Richard Purdie

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox