summaryrefslogtreecommitdiffstats
path: root/meta
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
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')
-rw-r--r--meta/recipes-core/udev/eudev/init49
-rw-r--r--meta/recipes-core/udev/eudev/udev-cache75
-rw-r--r--meta/recipes-core/udev/eudev/udev-cache.default5
-rw-r--r--meta/recipes-core/udev/eudev_3.2.2.bb20
4 files changed, 2 insertions, 147 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
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
12export 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
19DEVCACHE_TMP="/dev/shm/udev-cache-tmp.tar"
20SYSCONF_CACHED="/etc/udev/cache.data"
21SYSCONF_TMP="/dev/shm/udev.cache"
22DEVCACHE_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.
25CMP_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.
30META_FILE_LIST="lib/udev/rules.d/* etc/udev/rules.d/*"
31
32# Command to compute system configuration.
33sysconf_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
40if [ "$ROOTFS_READ_ONLY" = "yes" ]; then
41 [ "$VERBOSE" != "no" ] && echo "udev-cache: read-only rootfs, skip generating udev-cache"
42 exit 0
43fi
44
45[ "$DEVCACHE" != "" ] || exit 0
46[ "${VERBOSE}" == "no" ] || echo -n "udev-cache: checking for ${DEVCACHE_REGEN}... "
47if ! [ -e "$DEVCACHE_REGEN" ]; then
48 [ "${VERBOSE}" == "no" ] || echo "not found."
49 exit 0
50fi
51[ "${VERBOSE}" == "no" ] || echo "found."
52echo "Populating dev cache"
53
54err_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
75exit 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
4DEVCACHE="/etc/udev-cache.tar.gz"
5PROBE_PLATFORM_BUS="yes"
diff --git a/meta/recipes-core/udev/eudev_3.2.2.bb b/meta/recipes-core/udev/eudev_3.2.2.bb
index 78fef2c144..47d958bf6b 100644
--- a/meta/recipes-core/udev/eudev_3.2.2.bb
+++ b/meta/recipes-core/udev/eudev_3.2.2.bb
@@ -17,8 +17,6 @@ SRC_URI = "https://github.com/gentoo/${BPN}/archive/v${PV}.tar.gz;downloadfilena
17 file://local.rules \ 17 file://local.rules \
18 file://permissions.rules \ 18 file://permissions.rules \
19 file://run.rules \ 19 file://run.rules \
20 file://udev-cache \
21 file://udev-cache.default \
22 file://udev.rules \ 20 file://udev.rules \
23" 21"
24UPSTREAM_CHECK_URI = "https://github.com/gentoo/eudev/releases" 22UPSTREAM_CHECK_URI = "https://github.com/gentoo/eudev/releases"
@@ -40,14 +38,7 @@ PACKAGECONFIG[hwdb] = "--enable-hwdb,--disable-hwdb"
40do_install_append() { 38do_install_append() {
41 install -d ${D}${sysconfdir}/init.d 39 install -d ${D}${sysconfdir}/init.d
42 install -m 0755 ${WORKDIR}/init ${D}${sysconfdir}/init.d/udev 40 install -m 0755 ${WORKDIR}/init ${D}${sysconfdir}/init.d/udev
43 install -m 0755 ${WORKDIR}/udev-cache ${D}${sysconfdir}/init.d/udev-cache
44 sed -i s%@UDEVD@%${base_sbindir}/udevd% ${D}${sysconfdir}/init.d/udev 41 sed -i s%@UDEVD@%${base_sbindir}/udevd% ${D}${sysconfdir}/init.d/udev
45 sed -i s%@UDEVD@%${base_sbindir}/udevd% ${D}${sysconfdir}/init.d/udev-cache
46
47 install -d ${D}${sysconfdir}/default
48 install -m 0755 ${WORKDIR}/udev-cache.default ${D}${sysconfdir}/default/udev-cache
49
50 touch ${D}${sysconfdir}/udev/cache.data
51 42
52 install -d ${D}${sysconfdir}/udev/rules.d 43 install -d ${D}${sysconfdir}/udev/rules.d
53 install -m 0644 ${WORKDIR}/local.rules ${D}${sysconfdir}/udev/rules.d/local.rules 44 install -m 0644 ${WORKDIR}/local.rules ${D}${sysconfdir}/udev/rules.d/local.rules
@@ -59,14 +50,10 @@ do_install_append() {
59 rm -f ${D}${base_libdir}/udev/hid2hci 50 rm -f ${D}${base_libdir}/udev/hid2hci
60} 51}
61 52
62INITSCRIPT_PACKAGES = "eudev udev-cache" 53INITSCRIPT_NAME = "udev"
63INITSCRIPT_NAME_eudev = "udev" 54INITSCRIPT_PARAMS = "start 04 S ."
64INITSCRIPT_PARAMS_eudev = "start 04 S ."
65INITSCRIPT_NAME_udev-cache = "udev-cache"
66INITSCRIPT_PARAMS_udev-cache = "start 36 S ."
67 55
68PACKAGES =+ "libudev" 56PACKAGES =+ "libudev"
69PACKAGES =+ "udev-cache"
70PACKAGES =+ "eudev-hwdb" 57PACKAGES =+ "eudev-hwdb"
71 58
72 59
@@ -76,13 +63,10 @@ FILES_${PN}-dev = "${datadir}/pkgconfig/udev.pc \
76 ${includedir}/udev.h ${libdir}/libudev.la \ 63 ${includedir}/udev.h ${libdir}/libudev.la \
77 ${libdir}/libudev.a ${libdir}/pkgconfig/libudev.pc" 64 ${libdir}/libudev.a ${libdir}/pkgconfig/libudev.pc"
78FILES_libudev = "${base_libdir}/libudev.so.*" 65FILES_libudev = "${base_libdir}/libudev.so.*"
79FILES_udev-cache = "${sysconfdir}/init.d/udev-cache ${sysconfdir}/default/udev-cache"
80FILES_eudev-hwdb = "${sysconfdir}/udev/hwdb.d" 66FILES_eudev-hwdb = "${sysconfdir}/udev/hwdb.d"
81 67
82RDEPENDS_eudev-hwdb += "eudev" 68RDEPENDS_eudev-hwdb += "eudev"
83 69
84RRECOMMENDS_${PN} += "udev-cache"
85
86RPROVIDES_${PN} = "hotplug udev" 70RPROVIDES_${PN} = "hotplug udev"
87RPROVIDES_eudev-hwdb += "udev-hwdb" 71RPROVIDES_eudev-hwdb += "udev-hwdb"
88 72