]> code.ossystems Code Review - openembedded-core.git/commitdiff
Fix the boot process udev warning
authorYu Ke <ke.yu@intel.com>
Wed, 9 Jun 2010 11:04:51 +0000 (12:04 +0100)
committerJoshua Lock <josh@linux.intel.com>
Wed, 9 Jun 2010 11:04:51 +0000 (12:04 +0100)
Phenomena: there is udev warning in boot process
        tar: can't open '/etc/dev.tar': Read-only file system

The reason is that the init script /etc/rcS.d/S04udev will try to tar the /dev as cache to speed up udev at next boot time. Unfortunately, S04udev is too early and the filesystem is not writable yet.

To fix it, this patch split the cache action to another init script, and register it as /etc/rcS.d/S36, which is after the S35mountall, and the filesystem is already writable.

Signed-off-by: Yu Ke <ke.yu@intel.com>
meta/packages/udev/files/udev-cache [new file with mode: 0644]
meta/packages/udev/udev-115/init
meta/packages/udev/udev-124/init
meta/packages/udev/udev-141/init
meta/packages/udev/udev-145/init
meta/packages/udev/udev.inc
meta/packages/udev/udev_092.bb
meta/packages/udev/udev_115.bb
meta/packages/udev/udev_124.bb
meta/packages/udev/udev_141.bb
meta/packages/udev/udev_145.bb

diff --git a/meta/packages/udev/files/udev-cache b/meta/packages/udev/files/udev-cache
new file mode 100644 (file)
index 0000000..a4e9191
--- /dev/null
@@ -0,0 +1,20 @@
+#!/bin/sh -e
+
+### BEGIN INIT INFO
+# Provides:          udev-cache
+# Required-Start:    mountall
+# Required-Stop:
+# Default-Start:     S
+# Default-Stop:
+# Short-Description: cache /dev to speedup the udev next boot
+### END INIT INFO
+
+[ -d /sys/class ] || exit 1
+[ -r /proc/mounts ] || exit 1
+[ -x /sbin/udevd ] || exit 1
+
+if [ ! -e /etc/dev.tar ]; then
+       (cd /; tar cf /etc/dev.tar /dev)
+fi
+
+exit 0
index 5711d74b40cb2102de3912c3912aaffb2fc93228..c882c75607e7dc8b1b87821bf89ba9266948d5b5 100644 (file)
@@ -42,7 +42,6 @@ kill_udevd > "/dev/null" 2>&1
                else
                        /sbin/udevtrigger
                        /sbin/udevsettle
-                       (cd /; tar cf /etc/dev.tar /dev)
                fi
 
 echo
index b78a07b20f4a08597aae3bb67acb3888965797ee..32ab370aa95cd2ec6300a51613b7236859dad2cc 100644 (file)
@@ -53,7 +53,6 @@ kill_udevd > "/dev/null" 2>&1
                else
                        /sbin/udevadm trigger
                        /sbin/udevadm settle
-                       (cd /; tar cf /etc/dev.tar /dev)
                fi
 
 echo
index f38a0aa36e63b1ac650451d1120b8218c3674e8d..eb5e50758b7186f8818d62c549129afa37359808 100644 (file)
@@ -53,7 +53,6 @@ kill_udevd > "/dev/null" 2>&1
                else
                        /sbin/udevadm trigger
                        /sbin/udevadm settle
-                       (cd /; tar cf /etc/dev.tar /dev)
                fi
 
 echo
index f38a0aa36e63b1ac650451d1120b8218c3674e8d..eb5e50758b7186f8818d62c549129afa37359808 100644 (file)
@@ -53,7 +53,6 @@ kill_udevd > "/dev/null" 2>&1
                else
                        /sbin/udevadm trigger
                        /sbin/udevadm settle
-                       (cd /; tar cf /etc/dev.tar /dev)
                fi
 
 echo
index 58aa118602dd472ed9e847ba59b839110622ef44..0afd817b8f6a7aa5402564f2fdabafd402d89844 100644 (file)
@@ -10,20 +10,25 @@ SRC_URI += " \
           file://mount.sh \
           file://network.sh \
           file://local.rules \
+       file://udev-cache \
            file://init"
 
 UDEV_DEVFS_RULES ?= "0"
 
-PACKAGES =+ "udev-utils libvolume-id"
+PACKAGES =+ "udev-utils libvolume-id udev-cache"
 FILES_udev-utils = "${usrbindir}/udevinfo ${usrbindir}/udevtest"
 FILES_libvolume-id = "${base_libdir}/libvolume_id.so.*"
+FILES_udev-cache = "${sysconfdir}/init.d/udev-cache"
 
-RRECOMMENDS_${PN} = "udev-extraconf"
+RRECOMMENDS_${PN} += "udev-extraconf udev-cache"
 
 inherit update-rc.d autotools pkgconfig
 
-INITSCRIPT_NAME = "udev"
-INITSCRIPT_PARAMS = "start 04 S ."
+INITSCRIPT_PACKAGES = "udev udev-cache"
+INITSCRIPT_NAME_udev = "udev"
+INITSCRIPT_PARAMS_udev = "start 04 S ."
+INITSCRIPT_NAME_udev-cache = "udev-cache"
+INITSCRIPT_PARAMS_udev-cache = "start 36 S ."
 
 export CROSS = "${TARGET_PREFIX}"
 export HOSTCC = "${BUILD_CC}"
@@ -48,6 +53,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}/udev-cache ${D}${sysconfdir}/init.d/udev-cache
 
        install -d ${D}${sysconfdir}/udev/rules.d/
 
index cce65d83daac7014155fbe4d94446a16efe29897..c8669c3e6fcc148266258866f51747daa782053a 100644 (file)
@@ -31,6 +31,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}/udev-cache ${D}${sysconfdir}/init.d/udev-cache
 
        install -d ${D}${sysconfdir}/udev/rules.d/
 
index 6d9eede57c29ddbd908541457c2bbd36d2270250..835d02b379025b05f10db36be916b8a5c4f3f8d5 100644 (file)
@@ -30,6 +30,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}/udev-cache ${D}${sysconfdir}/init.d/udev-cache
 
        install -d ${D}${sysconfdir}/udev/rules.d/
 
index 32f1cd245239676de19e536a28a5aef9a2880ece..dad25f5253ef6fca8b17ef1ca83e5f8ff1f3a2a0 100644 (file)
@@ -31,6 +31,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}/udev-cache ${D}${sysconfdir}/init.d/udev-cache
 
        install -d ${D}${sysconfdir}/udev/rules.d/
 
index 25c6057910850642891d465320adbf1b46b09809..393c9f87780464084e074b67b6315a29973cc1b6 100644 (file)
@@ -16,8 +16,6 @@ PACKAGE_ARCH_h2200 = "h2200"
 
 require udev.inc
 
-INITSCRIPT_PARAMS = "start 03 S ."
-
 FILES_${PN} += "${base_libdir}/udev/*"
 FILES_${PN}-dbg += "${base_libdir}/udev/.debug"
 UDEV_EXTRAS = "extras/firmware/ extras/scsi_id/ extras/volume_id/"
@@ -33,6 +31,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}/udev-cache ${D}${sysconfdir}/init.d/udev-cache
 
        install -d ${D}${sysconfdir}/udev/rules.d/
 
index 1d04be1af082eb5455b3491912a0c36354522899..d6cc9909d93b2f6862bd206d0f472e2fc8204252 100644 (file)
@@ -31,6 +31,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}/udev-cache ${D}${sysconfdir}/init.d/udev-cache
 
        install -d ${D}${sysconfdir}/udev/rules.d/
 
@@ -64,4 +65,4 @@ do_install_append_h2200() {
 
 do_stage () {
        autotools_stage_all
-}
\ No newline at end of file
+}