udev 141: move creation of /etc/dev.tar to after checkroot
authorKoen Kooi <koen@openembedded.org>
Tue, 12 Jan 2010 13:48:59 +0000 (14:48 +0100)
committerKoen Kooi <koen@openembedded.org>
Thu, 14 Jan 2010 13:50:38 +0000 (14:50 +0100)
* / isn't always mounted rw when udev runs, so lets create /etc/dev.tar after checkroot has run

Acked-by: Graeme Gregory <dp@xora.org.uk>
Acked-by: Marcin Juszkiewicz <marcin@juszkiewicz.com.pl>
recipes/udev/udev-141/cache [new file with mode: 0644]
recipes/udev/udev-141/init
recipes/udev/udev_141.bb

diff --git a/recipes/udev/udev-141/cache b/recipes/udev/udev-141/cache
new file mode 100644 (file)
index 0000000..4db1466
--- /dev/null
@@ -0,0 +1,18 @@
+#!/bin/sh -e
+
+export TZ=/etc/localtime
+
+[ -f /etc/default/udev ] && . /etc/default/udev
+
+echo "Caching udev devnodes"
+
+                       if [ "$DEVCACHE" != "" ]; then
+                               echo -n "Populating dev cache"
+                               (cd /; tar cf $DEVCACHE dev)
+                               mv /tmp/uname /etc/udev/saved.uname
+                               mv /tmp/cmdline /etc/udev/saved.cmdline
+                               mv /tmp/atags /etc/udev/saved.atags
+                               echo
+                       fi
+
+exit 0
index a0bdf40..24ca9d8 100644 (file)
@@ -68,14 +68,6 @@ kill_udevd > "/dev/null" 2>&1
                else
                        /sbin/udevadm trigger
                        /sbin/udevadm settle
-                       if [ "$DEVCACHE" != "" ]; then
-                               echo -n "Populating dev cache"
-                               (cd /; tar cf $DEVCACHE dev)
-                               mv /tmp/uname /etc/udev/saved.uname
-                               mv /tmp/cmdline /etc/udev/saved.cmdline
-                               mv /tmp/atags /etc/udev/saved.atags
-                               echo
-                       fi
                fi
 
 exit 0
index 00ba971..df5e346 100644 (file)
@@ -6,7 +6,7 @@ LICENSE = "GPL"
 # Untested
 DEFAULT_PREFERENCE = "-1"
 
-PR = "r19"
+PR = "r20"
 
 # needed for init.d script
 RDEPENDS_${PN} += "udev-utils"
@@ -24,7 +24,9 @@ SRC_URI += " \
        file://network.sh \
        file://local.rules \
        file://default \
-       file://init"
+       file://init \
+       file://cache \
+"
 
 SRC_URI_append_h2200 = " file://50-hostap_cs.rules "
 PACKAGE_ARCH_h2200 = "h2200"
@@ -70,6 +72,7 @@ do_install () {
        oe_runmake 'DESTDIR=${D}' INSTALL=install install
        install -d ${D}${sysconfdir}/init.d
        install -m 0755 ${WORKDIR}/init ${D}${sysconfdir}/init.d/udev
+       install -m 0755 ${WORKDIR}/cache ${D}${sysconfdir}/init.d/udev-cache
 
        install -d ${D}${sysconfdir}/default
        install -m 0755 ${WORKDIR}/default ${D}${sysconfdir}/default/udev
@@ -112,7 +115,10 @@ do_install_append_bug() {
        install -m 0644 ${WORKDIR}/bmi_eventpipe.sh ${D}${sysconfdir}/udev/scripts/bmi_eventpipe.sh
 }
 
+# Create the cache after checkroot has run
 pkg_postinst_${PN}_append() {
+update-rc.d $OPT udev-cache start 12 S .
+
 if [ -d $D/lib/udev/rules.d ] ; then
        echo "$D/lib/udev/rules.d is not a symlink, fixing that"
        mv $D/lib/udev/rules.d/* $D${sysconfdir}/udev/rules.d/