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

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.