]> code.ossystems Code Review - openembedded-core.git/commitdiff
Control over when package init scripts are run
authorGary Thomas <gary@mlbassoc.com>
Mon, 18 Apr 2011 14:23:27 +0000 (08:23 -0600)
committerSaul Wold <sgw@linux.intel.com>
Sat, 23 Apr 2011 05:03:56 +0000 (22:03 -0700)
When a package is built, some installation scripts must be
performed on the target.  In the case of a complete image,
these scripts are run by a separate step at init time, but
only during the first boot (other package install scripts
can just be run when the package is installed on the target).

This patch lets the distribution (or user) decide when these
postponed install scripts should run.  The default is normally
near the end of init, but there may be times when it's beneficial
to run them earlier so the "when" can be overridden.

Signed-off-by: Gary Thomas <gary@mlbassoc.com>
Signed-off-by: Saul Wold <sgw@linux.intel.com>
meta/classes/rootfs_rpm.bbclass
meta/recipes-devtools/opkg/opkg.inc
meta/recipes-devtools/opkg/opkg_0.1.8.bb
meta/recipes-devtools/opkg/opkg_svn.bb

index aa1b3395502ce23feb6643da20bfc8f424e51d1f..3a11858cd02b4e91be2d58f522ba5b0531197ff9 100644 (file)
@@ -26,6 +26,11 @@ RPM_POSTPROCESS_COMMANDS = ""
 #
 #IMAGE_LOCALES="en-gb"
 
+# 
+# Allow distributions to alter when [postponed] package install scripts are run
+#
+POSTINSTALL_INITPOSITION ?= "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${POSTINSTALL_INITPOSITION}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${POSTINSTALL_INITPOSITION}configure
 EOF
-       chmod 0755 ${IMAGE_ROOTFS}${sysconfdir}/rcS.d/S98configure
+       chmod 0755 ${IMAGE_ROOTFS}${sysconfdir}/rcS.d/S${POSTINSTALL_INITPOSITION}configure
 
        install -d ${IMAGE_ROOTFS}/${sysconfdir}
        echo ${BUILDNAME} > ${IMAGE_ROOTFS}/${sysconfdir}/version
index c3174917a56e2896ea31377a4a263520c4428cd9..50f1afc1fe803745633badd66117b1c12a19fed3 100644 (file)
@@ -34,3 +34,7 @@ BBCLASSEXTEND = "native nativesdk"
 
 PKGSUFFIX = ""
 PKGSUFFIX_virtclass-nativesdk = "-nativesdk"
+
+# Define a variable to allow distros to run configure earlier.
+# (for example, to enable loading of ethernet kernel modules before networking starts)
+POSTINSTALL_INITPOSITION ?= "98"
index 681547420747b3adb00faabd25321b8ecc1116df..18cf0428cee7db6c4d5998f0d5d4f059b91a20ef 100644 (file)
@@ -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}"
 
@@ -26,11 +26,6 @@ do_install_append() {
        install -d ${D}${localstatedir}/lib/opkg
 }
 
-# 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"
-
 pkg_postinst_${PN} () {
 #!/bin/sh
 if [ "x$D" != "x" ]; then
@@ -38,9 +33,9 @@ if [ "x$D" != "x" ]; then
        # this happens at S98 where our good 'ole packages script used to run
        echo "#!/bin/sh
 opkg-cl configure
-rm -f /${sysconfdir}/rcS.d/S${OPKG_INIT_POSITION}configure
-" > $D${sysconfdir}/rcS.d/S${OPKG_INIT_POSITION}configure
-       chmod 0755 $D${sysconfdir}/rcS.d/S${OPKG_INIT_POSITION}configure
+rm -f /${sysconfdir}/rcS.d/S${POSTINSTALL_INITPOSITION}configure
+" > $D${sysconfdir}/rcS.d/S${POSTINSTALL_INITPOSITION}configure
+       chmod 0755 $D${sysconfdir}/rcS.d/S${POSTINSTALL_INITPOSITION}configure
 fi
 
 update-alternatives --install ${bindir}/opkg opkg ${bindir}/opkg-cl 100
index 76ec838875303bb69e4bcf7333b46d76a7eb5b5c..d8af823c7c172251bd2b53631a2eb82f304377ae 100644 (file)
@@ -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}"
 
@@ -29,11 +29,6 @@ do_install_append() {
        install -d ${D}${localstatedir}/lib/opkg
 }
 
-# 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"
-
 pkg_postinst_${PN} () {
 #!/bin/sh
 if [ "x$D" != "x" ]; then
@@ -41,9 +36,9 @@ if [ "x$D" != "x" ]; then
        # this happens at S98 where our good 'ole packages script used to run
        echo "#!/bin/sh
 opkg-cl configure
-rm -f /${sysconfdir}/rcS.d/S${OPKG_INIT_POSITION}configure
-" > $D${sysconfdir}/rcS.d/S${OPKG_INIT_POSITION}configure
-       chmod 0755 $D${sysconfdir}/rcS.d/S${OPKG_INIT_POSITION}configure
+rm -f /${sysconfdir}/rcS.d/S${POSTINSTALL_INITPOSITION}configure
+" > $D${sysconfdir}/rcS.d/S${POSTINSTALL_INITPOSITION}configure
+       chmod 0755 $D${sysconfdir}/rcS.d/S${POSTINSTALL_INITPOSITION}configure
 fi
 
 update-alternatives --install ${bindir}/opkg opkg ${bindir}/opkg-cl 100