[oe-commits] Tom Rini : udev: Make the dev cache work with /dev/shm
git version control
git at git.openembedded.org
Wed Jun 8 18:40:38 UTC 2011
Module: openembedded.git
Branch: master
Commit: ca688dd2de58dbec865ac7e70fab4d2c373ad822
URL: http://git.openembedded.org/?p=openembedded.git&a=commit;h=ca688dd2de58dbec865ac7e70fab4d2c373ad822
Author: Tom Rini <tom_rini at mentor.com>
Date: Wed Jun 8 11:31:13 2011 -0700
udev: Make the dev cache work with /dev/shm
At this point in the boot process we may not have a writable /tmp
directory. We will have a writable /dev/shm and the data we need
is small enough that we use this directory.
Signed-off-by: Tom Rini <tom_rini at mentor.com>
---
recipes/udev/udev.inc | 2 +-
recipes/udev/udev/cache | 16 ++++++++--------
recipes/udev/udev/init | 16 ++++++++--------
3 files changed, 17 insertions(+), 17 deletions(-)
diff --git a/recipes/udev/udev.inc b/recipes/udev/udev.inc
index 6b4279d..7fb9455 100644
--- a/recipes/udev/udev.inc
+++ b/recipes/udev/udev.inc
@@ -14,7 +14,7 @@ SRC_URI = "http://kernel.org/pub/linux/utils/kernel/hotplug/udev-${PV}.tar.gz \
file://init \
file://udev-compat-wrapper-patch"
-INC_PR = "r31"
+INC_PR = "r32"
inherit update-rc.d autotools pkgconfig
diff --git a/recipes/udev/udev/cache b/recipes/udev/udev/cache
index 6936170..62673ad 100644
--- a/recipes/udev/udev/cache
+++ b/recipes/udev/udev/cache
@@ -9,16 +9,16 @@ echo "Caching udev devnodes"
if [ "$DEVCACHE" != "" ]; then
echo -n "Populating dev cache"
(cd /; tar cf $DEVCACHE dev)
- mv /tmp/uname /etc/udev/saved.uname
- mv /tmp/cmdline /etc/udev/saved.cmdline
- mv /tmp/devices /etc/udev/saved.devices
- mv /tmp/atags /etc/udev/saved.atags
+ mv /dev/shm/uname /etc/udev/saved.uname
+ mv /dev/shm/cmdline /etc/udev/saved.cmdline
+ mv /dev/shm/devices /etc/udev/saved.devices
+ mv /dev/shm/atags /etc/udev/saved.atags
echo
else
- rm -f /tmp/uname
- rm -f /tmp/cmdline
- rm -f /tmp/devices
- rm -f /tmp/atags
+ rm -f /dev/shm/uname
+ rm -f /dev/shm/cmdline
+ rm -f /dev/shm/devices
+ rm -f /dev/shm/atags
fi
exit 0
diff --git a/recipes/udev/udev/init b/recipes/udev/udev/init
index c0ecdfc..eb9df8c 100644
--- a/recipes/udev/udev/init
+++ b/recipes/udev/udev/init
@@ -37,15 +37,15 @@ LANG=C awk "\$2 == \"/dev\" && \$3 == \"tmpfs\" { exit 1 }" /proc/mounts && {
if [ "$DEVCACHE" != "" ]; then
# Invalidate udev cache if the kernel or its bootargs/cmdline have changed
- [ -x /bin/uname ] && /bin/uname -mrspv > /tmp/uname || touch /tmp/uname
- [ -r /proc/cmdline ] && cat /proc/cmdline > /tmp/cmdline || touch /tmp/cmdline
- [ -r /proc/devices ] && cat /proc/devices > /tmp/devices || touch /tmp/devices
- [ -r /proc/atags ] && cat /proc/atags > /tmp/atags || touch /tmp/atags
+ [ -x /bin/uname ] && /bin/uname -mrspv > /dev/shm/uname || touch /dev/shm/uname
+ [ -r /proc/cmdline ] && cat /proc/cmdline > /dev/shm/cmdline || touch /dev/shm/cmdline
+ [ -r /proc/devices ] && cat /proc/devices > /dev/shm/devices || touch /dev/shm/devices
+ [ -r /proc/atags ] && cat /proc/atags > /dev/shm/atags || touch /dev/shm/atags
if [ -e $DEVCACHE ] && \
- cmp -s /tmp/uname /etc/udev/saved.uname && \
- cmp -s /tmp/cmdline /etc/udev/saved.cmdline && \
- cmp -s /tmp/devices /etc/udev/saved.devices && \
- cmp -s /tmp/atags /etc/udev/saved.atags; then
+ cmp -s /dev/shm/uname /etc/udev/saved.uname && \
+ cmp -s /dev/shm/cmdline /etc/udev/saved.cmdline && \
+ cmp -s /dev/shm/devices /etc/udev/saved.devices && \
+ cmp -s /dev/shm/atags /etc/udev/saved.atags; then
(cd /; tar xf $DEVCACHE > /dev/null 2>&1)
not_first_boot=1
fi
More information about the Openembedded-commits
mailing list