diff options
author | Tudor Florea <tudor.florea@enea.com> | 2015-10-09 22:59:03 +0200 |
---|---|---|
committer | Tudor Florea <tudor.florea@enea.com> | 2015-10-09 22:59:03 +0200 |
commit | 972dcfcdbfe75dcfeb777150c136576cf1a71e99 (patch) | |
tree | 97a61cd7e293d7ae9d56ef7ed0f81253365bb026 /meta/recipes-core/udev/udev/udev-cache | |
download | poky-972dcfcdbfe75dcfeb777150c136576cf1a71e99.tar.gz |
initial commit for Enea Linux 5.0 arm
Signed-off-by: Tudor Florea <tudor.florea@enea.com>
Diffstat (limited to 'meta/recipes-core/udev/udev/udev-cache')
-rw-r--r-- | meta/recipes-core/udev/udev/udev-cache | 38 |
1 files changed, 38 insertions, 0 deletions
diff --git a/meta/recipes-core/udev/udev/udev-cache b/meta/recipes-core/udev/udev/udev-cache new file mode 100644 index 0000000000..497d257397 --- /dev/null +++ b/meta/recipes-core/udev/udev/udev-cache | |||
@@ -0,0 +1,38 @@ | |||
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 | [ -f /etc/default/udev-cache ] && . /etc/default/udev-cache | ||
23 | |||
24 | if [ "$ROOTFS_READ_ONLY" = "yes" ]; then | ||
25 | [ "$VERBOSE" != "no" ] && echo "udev-cache: read-only rootfs, skip generating udev-cache" | ||
26 | exit 0 | ||
27 | fi | ||
28 | |||
29 | if [ "$DEVCACHE" != "" -a -e "$SYSCONF_TMP" ]; then | ||
30 | echo "Populating dev cache" | ||
31 | find /dev -xdev \( -type b -o -type c -o -type l \) | cut -c 2- \ | ||
32 | | xargs tar cf "${DEVCACHE_TMP}" -T- | ||
33 | gzip < "${DEVCACHE_TMP}" > "$DEVCACHE" | ||
34 | rm -f "${DEVCACHE_TMP}" | ||
35 | mv "$SYSCONF_TMP" "$SYSCONF_CACHED" | ||
36 | fi | ||
37 | |||
38 | exit 0 | ||