diff options
author | Oliver Stäbler <oliver.staebler@bytesatwork.ch> | 2017-08-02 11:37:10 +0200 |
---|---|---|
committer | Richard Purdie <richard.purdie@linuxfoundation.org> | 2017-08-13 09:27:37 +0100 |
commit | 44f550f392e231b7fbd1e29da3f59d6c9dd7f472 (patch) | |
tree | 5cd55ec74c35b3f1f75ef866143a2ed7a55b39cb /meta/recipes-core/udev/eudev | |
parent | c3e2ad0695a3ca348dd6867d5429d1cdb1dad885 (diff) | |
download | poky-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')
-rw-r--r-- | meta/recipes-core/udev/eudev/init | 49 | ||||
-rw-r--r-- | meta/recipes-core/udev/eudev/udev-cache | 75 | ||||
-rw-r--r-- | meta/recipes-core/udev/eudev/udev-cache.default | 5 |
3 files changed, 0 insertions, 129 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 |
17 | SYSCONF_CACHED="/etc/udev/cache.data" | ||
18 | SYSCONF_TMP="/dev/shm/udev.cache" | ||
19 | DEVCACHE_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. | ||
22 | CMP_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. | ||
27 | META_FILE_LIST="lib/udev/rules.d/* etc/udev/rules.d/*" | ||
28 | |||
29 | # Command to compute system configuration. | ||
30 | sysconf_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 | ||
82 | udev: Not using udev cache because of changes detected in the following files: | ||
83 | udev: $CMP_FILE_LIST | ||
84 | udev: $META_FILE_LIST | ||
85 | udev: The udev cache will be regenerated. To identify the detected changes, | ||
86 | udev: compare the cached sysconf at $SYSCONF_CACHED | ||
87 | udev: against the current sysconf at $SYSCONF_TMP | ||
88 | EOF | ||
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 | ||
diff --git a/meta/recipes-core/udev/eudev/udev-cache b/meta/recipes-core/udev/eudev/udev-cache deleted file mode 100644 index dcfff1cb45..0000000000 --- a/meta/recipes-core/udev/eudev/udev-cache +++ /dev/null | |||
@@ -1,75 +0,0 @@ | |||
1 | #!/bin/sh -e | ||
2 | |||
3 | ### BEGIN INIT INFO | ||
4 | # Provides: udev-cache | ||
5 | # Required-Start: mountall | ||
6 | # Required-Stop: | ||
7 | # Default-Start: S | ||
8 | # Default-Stop: | ||
9 | # Short-Description: cache /dev to speedup the udev next boot | ||
10 | ### END INIT INFO | ||
11 | |||
12 | export TZ=/etc/localtime | ||
13 | |||
14 | [ -r /proc/mounts ] || exit 1 | ||
15 | [ -x @UDEVD@ ] || exit 1 | ||
16 | [ -d /sys/class ] || exit 1 | ||
17 | |||
18 | [ -f /etc/default/rcS ] && . /etc/default/rcS | ||
19 | DEVCACHE_TMP="/dev/shm/udev-cache-tmp.tar" | ||
20 | SYSCONF_CACHED="/etc/udev/cache.data" | ||
21 | SYSCONF_TMP="/dev/shm/udev.cache" | ||
22 | DEVCACHE_REGEN="/dev/shm/udev-regen" # create to request cache regen | ||
23 | |||
24 | # A list of files which are used as a criteria to judge whether the udev cache could be reused. | ||
25 | CMP_FILE_LIST="/proc/version /proc/cmdline /proc/devices" | ||
26 | [ -f /proc/atags ] && CMP_FILE_LIST="$CMP_FILE_LIST /proc/atags" | ||
27 | |||
28 | # List of files whose metadata (size/mtime/name) will be included in cached | ||
29 | # system state. | ||
30 | META_FILE_LIST="lib/udev/rules.d/* etc/udev/rules.d/*" | ||
31 | |||
32 | # Command to compute system configuration. | ||
33 | sysconf_cmd () { | ||
34 | cat -- $CMP_FILE_LIST | ||
35 | stat -c '%s %Y %n' -- $META_FILE_LIST | awk -F/ '{print $1 " " $NF;}' | ||
36 | } | ||
37 | |||
38 | [ -f /etc/default/udev-cache ] && . /etc/default/udev-cache | ||
39 | |||
40 | if [ "$ROOTFS_READ_ONLY" = "yes" ]; then | ||
41 | [ "$VERBOSE" != "no" ] && echo "udev-cache: read-only rootfs, skip generating udev-cache" | ||
42 | exit 0 | ||
43 | fi | ||
44 | |||
45 | [ "$DEVCACHE" != "" ] || exit 0 | ||
46 | [ "${VERBOSE}" == "no" ] || echo -n "udev-cache: checking for ${DEVCACHE_REGEN}... " | ||
47 | if ! [ -e "$DEVCACHE_REGEN" ]; then | ||
48 | [ "${VERBOSE}" == "no" ] || echo "not found." | ||
49 | exit 0 | ||
50 | fi | ||
51 | [ "${VERBOSE}" == "no" ] || echo "found." | ||
52 | echo "Populating dev cache" | ||
53 | |||
54 | err_cleanup () { | ||
55 | echo "udev-cache: update failed!" | ||
56 | udevadm control --start-exec-queue | ||
57 | rm -f -- "$SYSCONF_TMP" "$DEVCACHE_TMP" "$DEVCACHE" "$SYSCONF_CACHED" | ||
58 | } | ||
59 | |||
60 | ( | ||
61 | set -e | ||
62 | trap 'err_cleanup' EXIT | ||
63 | udevadm control --stop-exec-queue | ||
64 | sysconf_cmd > "$SYSCONF_TMP" | ||
65 | find /dev -xdev \( -type b -o -type c -o -type l \) | cut -c 2- \ | ||
66 | | xargs tar cf "${DEVCACHE_TMP}" | ||
67 | gzip < "${DEVCACHE_TMP}" > "$DEVCACHE" | ||
68 | rm -f "${DEVCACHE_TMP}" | ||
69 | mv "$SYSCONF_TMP" "$SYSCONF_CACHED" | ||
70 | udevadm control --start-exec-queue | ||
71 | rm -f "$DEVCACHE_REGEN" | ||
72 | trap - EXIT | ||
73 | ) & | ||
74 | |||
75 | exit 0 | ||
diff --git a/meta/recipes-core/udev/eudev/udev-cache.default b/meta/recipes-core/udev/eudev/udev-cache.default deleted file mode 100644 index a3b732698d..0000000000 --- a/meta/recipes-core/udev/eudev/udev-cache.default +++ /dev/null | |||
@@ -1,5 +0,0 @@ | |||
1 | # Default for /etc/init.d/udev | ||
2 | |||
3 | # Comment this out to disable device cache | ||
4 | DEVCACHE="/etc/udev-cache.tar.gz" | ||
5 | PROBE_PLATFORM_BUS="yes" | ||