mirror of
https://git.yoctoproject.org/poky
synced 2026-04-07 05:02:22 +02:00
Fix the boot process udev warning
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>
This commit is contained in:
20
meta/packages/udev/files/udev-cache
Normal file
20
meta/packages/udev/files/udev-cache
Normal file
@@ -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
|
||||
@@ -42,7 +42,6 @@ kill_udevd > "/dev/null" 2>&1
|
||||
else
|
||||
/sbin/udevtrigger
|
||||
/sbin/udevsettle
|
||||
(cd /; tar cf /etc/dev.tar /dev)
|
||||
fi
|
||||
|
||||
echo
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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/
|
||||
|
||||
|
||||
@@ -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/
|
||||
|
||||
|
||||
@@ -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/
|
||||
|
||||
|
||||
@@ -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/
|
||||
|
||||
|
||||
@@ -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/
|
||||
|
||||
|
||||
@@ -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
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user