All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] Control over when package init scripts are run
@ 2011-04-08 15:05 Gary Thomas
  2011-04-08 15:39 ` [poky] " Koen Kooi
  2011-04-18 13:49 ` Gary Thomas
  0 siblings, 2 replies; 7+ messages in thread
From: Gary Thomas @ 2011-04-08 15:05 UTC (permalink / raw)
  To: Poky Project

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

The script /etc/rcS.d/S98configure is run on the first boot only
to process any postponed package post-install scripts.  The default
position of this (98 == last) can be wrong, so let the distribution
set this (just a matter of ?= assignment).  This patch also removes
some slugos stuff and extends the flexibility to systems which use
RPM packaging as well.

Tested on my PowerPC router, running as S00configure - works a treat.

-- 
------------------------------------------------------------
Gary Thomas                 |  Consulting for the
MLB Associates              |    Embedded world
------------------------------------------------------------

[-- Attachment #2: 0001-Allow-target-distribution-to-specify-when-to-run-pac.patch --]
[-- Type: text/x-patch, Size: 3472 bytes --]

From cec0432ca3e02a05519d22042434f0c6fc285f37 Mon Sep 17 00:00:00 2001
From: Gary Thomas <gary@mlbassoc.com>
Date: Fri, 8 Apr 2011 08:59:18 -0600
Subject: [PATCH] Allow target/distribution to specify when to run package init scripts (first boot only)

Signed-off-by: Gary Thomas <gary@mlbassoc.com>
---
 meta/classes/rootfs_rpm.bbclass          |   11 ++++++++---
 meta/recipes-devtools/opkg/opkg_0.1.8.bb |    5 ++---
 meta/recipes-devtools/opkg/opkg_svn.bb   |    5 ++---
 3 files changed, 12 insertions(+), 9 deletions(-)

diff --git a/meta/classes/rootfs_rpm.bbclass b/meta/classes/rootfs_rpm.bbclass
index 04ccabd..073bb84 100644
--- a/meta/classes/rootfs_rpm.bbclass
+++ b/meta/classes/rootfs_rpm.bbclass
@@ -26,6 +26,11 @@ RPM_POSTPROCESS_COMMANDS = ""
 #
 #IMAGE_LOCALES="en-gb"
 
+# 
+# Allow distributions to alter when [postponed] package install scripts are run
+#
+RPM_INIT_POSITION ?= "98"
+
 rpmlibdir = "/var/lib/rpm"
 opkglibdir = "${localstatedir}/lib/opkg"
 
@@ -116,7 +121,7 @@ EOF
 	install -d ${IMAGE_ROOTFS}/${sysconfdir}/rcS.d
 	# Stop $i getting expanded below...
 	i=\$i
-	cat > ${IMAGE_ROOTFS}${sysconfdir}/rcS.d/S98configure << EOF
+	cat > ${IMAGE_ROOTFS}${sysconfdir}/rcS.d/S${RPM_INIT_POSITION}configure << EOF
 #!/bin/sh
 for i in /etc/rpm-postinsts/*.sh; do
 	echo "Running postinst $i..."
@@ -127,9 +132,9 @@ for i in /etc/rpm-postinsts/*.sh; do
 		echo "ERROR: postinst $i failed."
 	fi
 done
-rm -f ${sysconfdir}/rcS.d/S98configure
+rm -f ${sysconfdir}/rcS.d/S${RPM_INIT_POSITION}configure
 EOF
-	chmod 0755 ${IMAGE_ROOTFS}${sysconfdir}/rcS.d/S98configure
+	chmod 0755 ${IMAGE_ROOTFS}${sysconfdir}/rcS.d/S${RPM_INIT_POSITION}configure
 
 	install -d ${IMAGE_ROOTFS}/${sysconfdir}
 	echo ${BUILDNAME} > ${IMAGE_ROOTFS}/${sysconfdir}/version
diff --git a/meta/recipes-devtools/opkg/opkg_0.1.8.bb b/meta/recipes-devtools/opkg/opkg_0.1.8.bb
index 6815474..a732def 100644
--- a/meta/recipes-devtools/opkg/opkg_0.1.8.bb
+++ b/meta/recipes-devtools/opkg/opkg_0.1.8.bb
@@ -13,7 +13,7 @@ SRC_URI = "http://opkg.googlecode.com/files/opkg-${PV}.tar.gz \
            file://headerfix.patch \
 "
 
-PR = "r3"
+PR = "r4"
 
 PACKAGES =+ "libopkg${PKGSUFFIX}-dev libopkg${PKGSUFFIX} update-alternatives-cworth${PKGSUFFIX}"
 
@@ -28,8 +28,7 @@ do_install_append() {
 
 # Define a variable to allow distros to run configure earlier.
 # (for example, to enable loading of ethernet kernel modules before networking starts)
-OPKG_INIT_POSITION = "98"
-OPKG_INIT_POSITION_slugos = "41"
+OPKG_INIT_POSITION ?= "98"
 
 pkg_postinst_${PN} () {
 #!/bin/sh
diff --git a/meta/recipes-devtools/opkg/opkg_svn.bb b/meta/recipes-devtools/opkg/opkg_svn.bb
index 76ec838..8bc9793 100644
--- a/meta/recipes-devtools/opkg/opkg_svn.bb
+++ b/meta/recipes-devtools/opkg/opkg_svn.bb
@@ -16,7 +16,7 @@ SRC_URI = "svn://opkg.googlecode.com/svn;module=trunk;proto=http \
 S = "${WORKDIR}/trunk"
 
 PV = "0.1.8+svnr${SRCPV}"
-PR = "r1"
+PR = "r2"
 
 PACKAGES =+ "libopkg${PKGSUFFIX}-dev libopkg${PKGSUFFIX} update-alternatives-cworth${PKGSUFFIX}"
 
@@ -31,8 +31,7 @@ do_install_append() {
 
 # Define a variable to allow distros to run configure earlier.
 # (for example, to enable loading of ethernet kernel modules before networking starts)
-OPKG_INIT_POSITION = "98"
-OPKG_INIT_POSITION_slugos = "41"
+OPKG_INIT_POSITION ?= "98"
 
 pkg_postinst_${PN} () {
 #!/bin/sh
-- 
1.7.3.4


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

* Re: [poky] [PATCH] Control over when package init scripts are run
  2011-04-08 15:05 [PATCH] Control over when package init scripts are run Gary Thomas
@ 2011-04-08 15:39 ` Koen Kooi
  2011-04-08 16:08     ` [OE-core] " Gary Thomas
  2011-04-18 13:49 ` Gary Thomas
  1 sibling, 1 reply; 7+ messages in thread
From: Koen Kooi @ 2011-04-08 15:39 UTC (permalink / raw)
  To: openembedded-core oe-core layer

Something like this would be better:

http://cgit.openembedded.org/cgit.cgi/openembedded/commit/?id=e124d03f532aad2ee22c60fda6824a8a1f2ef88f

Op 8 apr 2011, om 17:05 heeft Gary Thomas het volgende geschreven:

> The script /etc/rcS.d/S98configure is run on the first boot only
> to process any postponed package post-install scripts.  The default
> position of this (98 == last) can be wrong, so let the distribution
> set this (just a matter of ?= assignment).  This patch also removes
> some slugos stuff and extends the flexibility to systems which use
> RPM packaging as well.
> 
> Tested on my PowerPC router, running as S00configure - works a treat.
> 
> -- 
> ------------------------------------------------------------
> Gary Thomas                 |  Consulting for the
> MLB Associates              |    Embedded world
> ------------------------------------------------------------
> <0001-Allow-target-distribution-to-specify-when-to-run-pac.patch>_______________________________________________
> poky mailing list
> poky@yoctoproject.org
> https://lists.yoctoproject.org/listinfo/poky




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

* Re: [poky] [PATCH] Control over when package init scripts are run
  2011-04-08 15:39 ` [poky] " Koen Kooi
@ 2011-04-08 16:08     ` Gary Thomas
  0 siblings, 0 replies; 7+ messages in thread
From: Gary Thomas @ 2011-04-08 16:08 UTC (permalink / raw)
  To: Patches and discussions about the oe-core layer; +Cc: Koen Kooi, Poky Project

On 04/08/2011 09:39 AM, Koen Kooi wrote:
> Something like this would be better:
>
> http://cgit.openembedded.org/cgit.cgi/openembedded/commit/?id=e124d03f532aad2ee22c60fda6824a8a1f2ef88f

Possibly, except for the fact that I posted this to the Poky list which
have different recipes (the one mentioned above does not apply)

> Op 8 apr 2011, om 17:05 heeft Gary Thomas het volgende geschreven:
>
>> The script /etc/rcS.d/S98configure is run on the first boot only
>> to process any postponed package post-install scripts.  The default
>> position of this (98 == last) can be wrong, so let the distribution
>> set this (just a matter of ?= assignment).  This patch also removes
>> some slugos stuff and extends the flexibility to systems which use
>> RPM packaging as well.
>>
>> Tested on my PowerPC router, running as S00configure - works a treat.


-- 
------------------------------------------------------------
Gary Thomas                 |  Consulting for the
MLB Associates              |    Embedded world
------------------------------------------------------------



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

* Re: [OE-core] [PATCH] Control over when package init scripts are run
@ 2011-04-08 16:08     ` Gary Thomas
  0 siblings, 0 replies; 7+ messages in thread
From: Gary Thomas @ 2011-04-08 16:08 UTC (permalink / raw)
  To: Patches and discussions about the oe-core layer; +Cc: Poky Project

On 04/08/2011 09:39 AM, Koen Kooi wrote:
> Something like this would be better:
>
> http://cgit.openembedded.org/cgit.cgi/openembedded/commit/?id=e124d03f532aad2ee22c60fda6824a8a1f2ef88f

Possibly, except for the fact that I posted this to the Poky list which
have different recipes (the one mentioned above does not apply)

> Op 8 apr 2011, om 17:05 heeft Gary Thomas het volgende geschreven:
>
>> The script /etc/rcS.d/S98configure is run on the first boot only
>> to process any postponed package post-install scripts.  The default
>> position of this (98 == last) can be wrong, so let the distribution
>> set this (just a matter of ?= assignment).  This patch also removes
>> some slugos stuff and extends the flexibility to systems which use
>> RPM packaging as well.
>>
>> Tested on my PowerPC router, running as S00configure - works a treat.


-- 
------------------------------------------------------------
Gary Thomas                 |  Consulting for the
MLB Associates              |    Embedded world
------------------------------------------------------------


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

* Re: [PATCH] Control over when package init scripts are run
  2011-04-08 15:05 [PATCH] Control over when package init scripts are run Gary Thomas
  2011-04-08 15:39 ` [poky] " Koen Kooi
@ 2011-04-18 13:49 ` Gary Thomas
  2011-04-18 14:04   ` Richard Purdie
  1 sibling, 1 reply; 7+ messages in thread
From: Gary Thomas @ 2011-04-18 13:49 UTC (permalink / raw)
  To: Poky Project

On 04/08/2011 09:05 AM, Gary Thomas wrote:
> The script /etc/rcS.d/S98configure is run on the first boot only
> to process any postponed package post-install scripts. The default
> position of this (98 == last) can be wrong, so let the distribution
> set this (just a matter of ?= assignment). This patch also removes
> some slugos stuff and extends the flexibility to systems which use
> RPM packaging as well.
>
> Tested on my PowerPC router, running as S00configure - works a treat.
>

What about this patch?  It's been 10 days - no discussion.

Note: the patch has no effect on normal operation, it just lets a user
or distribution control when the package init scripts are run (and then
this is only on the initial boot)

Note 2: this is a case where I can't override this behaviour in my local
layers, so a core change is required.

Thanks

-- 
------------------------------------------------------------
Gary Thomas                 |  Consulting for the
MLB Associates              |    Embedded world
------------------------------------------------------------


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

* Re: [PATCH] Control over when package init scripts are run
  2011-04-18 13:49 ` Gary Thomas
@ 2011-04-18 14:04   ` Richard Purdie
  2011-04-18 14:10     ` Gary Thomas
  0 siblings, 1 reply; 7+ messages in thread
From: Richard Purdie @ 2011-04-18 14:04 UTC (permalink / raw)
  To: Gary Thomas; +Cc: Poky Project

On Mon, 2011-04-18 at 07:49 -0600, Gary Thomas wrote:
> On 04/08/2011 09:05 AM, Gary Thomas wrote:
> > The script /etc/rcS.d/S98configure is run on the first boot only
> > to process any postponed package post-install scripts. The default
> > position of this (98 == last) can be wrong, so let the distribution
> > set this (just a matter of ?= assignment). This patch also removes
> > some slugos stuff and extends the flexibility to systems which use
> > RPM packaging as well.
> >
> > Tested on my PowerPC router, running as S00configure - works a treat.
> >
> 
> What about this patch?  It's been 10 days - no discussion.

Sorry, many of us were travelling for Collab/ELC and it was the Yocto
1.0 launch there. I'm trying to get through my backlog now :)

> Note: the patch has no effect on normal operation, it just lets a user
> or distribution control when the package init scripts are run (and then
> this is only on the initial boot)
> 
> Note 2: this is a case where I can't override this behaviour in my local
> layers, so a core change is required.

I'm ok with the patch but could you rename the variable to something
generic like POSTINSTALL_INITPOSITION please?

Cheers,

Richard



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

* Re: [PATCH] Control over when package init scripts are run
  2011-04-18 14:04   ` Richard Purdie
@ 2011-04-18 14:10     ` Gary Thomas
  0 siblings, 0 replies; 7+ messages in thread
From: Gary Thomas @ 2011-04-18 14:10 UTC (permalink / raw)
  To: Richard Purdie; +Cc: Poky Project

On 04/18/2011 08:04 AM, Richard Purdie wrote:
> On Mon, 2011-04-18 at 07:49 -0600, Gary Thomas wrote:
>> On 04/08/2011 09:05 AM, Gary Thomas wrote:
>>> The script /etc/rcS.d/S98configure is run on the first boot only
>>> to process any postponed package post-install scripts. The default
>>> position of this (98 == last) can be wrong, so let the distribution
>>> set this (just a matter of ?= assignment). This patch also removes
>>> some slugos stuff and extends the flexibility to systems which use
>>> RPM packaging as well.
>>>
>>> Tested on my PowerPC router, running as S00configure - works a treat.
>>>
>>
>> What about this patch?  It's been 10 days - no discussion.
>
> Sorry, many of us were travelling for Collab/ELC and it was the Yocto
> 1.0 launch there. I'm trying to get through my backlog now :)

I knew that, so I was just bringing it back to the surface :-)  [Would have been
at ELC myself, but I have horses to feed...]

>
>> Note: the patch has no effect on normal operation, it just lets a user
>> or distribution control when the package init scripts are run (and then
>> this is only on the initial boot)
>>
>> Note 2: this is a case where I can't override this behaviour in my local
>> layers, so a core change is required.
>
> I'm ok with the patch but could you rename the variable to something
> generic like POSTINSTALL_INITPOSITION please?

Sure - I was just following the opkg version as a guide.  I'll set both
modes (opkg/rpm) to use the same variable name.

-- 
------------------------------------------------------------
Gary Thomas                 |  Consulting for the
MLB Associates              |    Embedded world
------------------------------------------------------------


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

end of thread, other threads:[~2011-04-18 14:10 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2011-04-08 15:05 [PATCH] Control over when package init scripts are run Gary Thomas
2011-04-08 15:39 ` [poky] " Koen Kooi
2011-04-08 16:08   ` Gary Thomas
2011-04-08 16:08     ` [OE-core] " Gary Thomas
2011-04-18 13:49 ` Gary Thomas
2011-04-18 14:04   ` Richard Purdie
2011-04-18 14:10     ` Gary Thomas

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.