summaryrefslogtreecommitdiffstats
path: root/meta/recipes-core/udev/eudev/init
diff options
context:
space:
mode:
authorOliver Stäbler <oliver.staebler@bytesatwork.ch>2017-08-02 11:37:10 +0200
committerRichard Purdie <richard.purdie@linuxfoundation.org>2017-08-13 09:27:37 +0100
commit44f550f392e231b7fbd1e29da3f59d6c9dd7f472 (patch)
tree5cd55ec74c35b3f1f75ef866143a2ed7a55b39cb /meta/recipes-core/udev/eudev/init
parentc3e2ad0695a3ca348dd6867d5429d1cdb1dad885 (diff)
downloadpoky-44f550f392e231b7fbd1e29da3f59d6c9dd7f472.tar.gz
eudev: Remove udev-cache
As eudev requires devtmpfs it is not necessary to keep a cache anymore as the kernel handles entries in /dev itself. (From OE-Core rev: 048f4149b8438c521e8b65a3c96d850a9b4a3e5b) Signed-off-by: Oliver Stäbler <oliver.staebler@bytesatwork.ch> Signed-off-by: Ross Burton <ross.burton@intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'meta/recipes-core/udev/eudev/init')
-rw-r--r--meta/recipes-core/udev/eudev/init49
1 files changed, 0 insertions, 49 deletions
diff --git a/meta/recipes-core/udev/eudev/init b/meta/recipes-core/udev/eudev/init
index 0ab028b391..0455ade258 100644
--- a/meta/recipes-core/udev/eudev/init
+++ b/meta/recipes-core/udev/eudev/init
@@ -14,25 +14,7 @@ export TZ=/etc/localtime
14[ -d /sys/class ] || exit 1 14[ -d /sys/class ] || exit 1
15[ -r /proc/mounts ] || exit 1 15[ -r /proc/mounts ] || exit 1
16[ -x @UDEVD@ ] || exit 1 16[ -x @UDEVD@ ] || exit 1
17SYSCONF_CACHED="/etc/udev/cache.data"
18SYSCONF_TMP="/dev/shm/udev.cache"
19DEVCACHE_REGEN="/dev/shm/udev-regen" # create to request cache regen
20 17
21# A list of files which are used as a criteria to judge whether the udev cache could be reused.
22CMP_FILE_LIST="/proc/version /proc/cmdline /proc/devices"
23[ -f /proc/atags ] && CMP_FILE_LIST="$CMP_FILE_LIST /proc/atags"
24
25# List of files whose metadata (size/mtime/name) will be included in cached
26# system state.
27META_FILE_LIST="lib/udev/rules.d/* etc/udev/rules.d/*"
28
29# Command to compute system configuration.
30sysconf_cmd () {
31 cat -- $CMP_FILE_LIST
32 stat -c '%s %Y %n' -- $META_FILE_LIST | awk -F/ '{print $1 " " $NF;}'
33}
34
35[ -f /etc/default/udev-cache ] && . /etc/default/udev-cache
36[ -f /etc/udev/udev.conf ] && . /etc/udev/udev.conf 18[ -f /etc/udev/udev.conf ] && . /etc/udev/udev.conf
37[ -f /etc/default/rcS ] && . /etc/default/rcS 19[ -f /etc/default/rcS ] && . /etc/default/rcS
38 20
@@ -66,37 +48,6 @@ case "$1" in
66 # /var/volatile/tmp directory to be available. 48 # /var/volatile/tmp directory to be available.
67 mkdir -m 1777 -p /var/volatile/tmp 49 mkdir -m 1777 -p /var/volatile/tmp
68 50
69 # Cache handling.
70 if [ "$DEVCACHE" != "" ]; then
71 if [ -e $DEVCACHE ]; then
72 sysconf_cmd > "$SYSCONF_TMP"
73 if cmp $SYSCONF_CACHED $SYSCONF_TMP >/dev/null; then
74 tar xmf $DEVCACHE -C / -m
75 not_first_boot=1
76 [ "$VERBOSE" != "no" ] && echo "udev: using cache file $DEVCACHE"
77 [ -e $SYSCONF_TMP ] && rm -f "$SYSCONF_TMP"
78 [ -e "$DEVCACHE_REGEN" ] && rm -f "$DEVCACHE_REGEN"
79 else
80 # Output detailed reason why the cached /dev is not used
81 cat <<EOF
82udev: Not using udev cache because of changes detected in the following files:
83udev: $CMP_FILE_LIST
84udev: $META_FILE_LIST
85udev: The udev cache will be regenerated. To identify the detected changes,
86udev: compare the cached sysconf at $SYSCONF_CACHED
87udev: against the current sysconf at $SYSCONF_TMP
88EOF
89 touch "$DEVCACHE_REGEN"
90 fi
91 else
92 if [ "$ROOTFS_READ_ONLY" != "yes" ]; then
93 # If rootfs is not read-only, it's possible that a new udev cache would be generated;
94 # otherwise, we do not bother to read files.
95 touch "$DEVCACHE_REGEN"
96 fi
97 fi
98 fi
99
100 # make_extra_nodes 51 # make_extra_nodes
101 kill_udevd > "/dev/null" 2>&1 52 kill_udevd > "/dev/null" 2>&1
102 53