From: Gary Thomas <gary@mlbassoc.com>
To: Poky Project <poky@yoctoproject.org>
Subject: [PATCH] Control over when package init scripts are run
Date: Fri, 08 Apr 2011 09:05:07 -0600 [thread overview]
Message-ID: <4D9F2423.7060900@mlbassoc.com> (raw)
[-- 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
next reply other threads:[~2011-04-08 15:05 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2011-04-08 15:05 Gary Thomas [this message]
2011-04-08 15:39 ` [poky] [PATCH] Control over when package init scripts are run 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
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=4D9F2423.7060900@mlbassoc.com \
--to=gary@mlbassoc.com \
--cc=poky@yoctoproject.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
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.