blob: aaf1ddd1ac1201a4864e211d28d946096a6d4107 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
|
#!/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
export TZ=/etc/localtime
[ -r /proc/mounts ] || exit 1
[ -x @UDEVD@ ] || exit 1
[ -d /sys/class ] || exit 1
[ -f /etc/default/rcS ] && . /etc/default/rcS
DEVCACHE_TMP="/dev/shm/udev-cache-tmp.tar"
[ -f /etc/default/udev-cache ] && . /etc/default/udev-cache
if [ "$ROOTFS_READ_ONLY" = "yes" ]; then
[ "$VERBOSE" != "no" ] && echo "udev-cache: read-only rootfs, skip generating udev-cache"
exit 0
fi
if [ "$DEVCACHE" != "" -a -e /dev/shm/udev.cache ]; then
echo "Populating dev cache"
find /dev -xdev \( -type b -o -type c -o -type l \) | cut -c 2- \
| xargs tar cf "${DEVCACHE_TMP}" -T-
gzip < "${DEVCACHE_TMP}" > "$DEVCACHE"
rm -f "${DEVCACHE_TMP}"
mv /dev/shm/udev.cache /etc/udev/cache.data
fi
exit 0
|