Openembedded Devel Discussions
 help / color / mirror / Atom feed
* [PATCH] udev: also use /proc/devices to invalidate devcache
@ 2011-02-11 19:35 Denys Dmytriyenko
  2011-02-11 20:21 ` Koen Kooi
  0 siblings, 1 reply; 2+ messages in thread
From: Denys Dmytriyenko @ 2011-02-11 19:35 UTC (permalink / raw)
  To: openembedded-devel; +Cc: Denys Dmytriyenko

From: Denys Dmytriyenko <denys@ti.com>

* Besides checking for kernel version, bootargs or cmdline changes between
reboots, also consider changes in /proc/devices to invalidate device cache.

Signed-off-by: Denys Dmytriyenko <denys@ti.com>
---
 recipes/udev/udev-141/cache |    2 ++
 recipes/udev/udev-141/init  |    2 ++
 recipes/udev/udev-151/cache |    2 ++
 recipes/udev/udev-151/init  |    2 ++
 recipes/udev/udev-154/cache |    2 ++
 recipes/udev/udev-154/init  |    2 ++
 recipes/udev/udev-162/cache |    2 ++
 recipes/udev/udev-162/init  |    2 ++
 recipes/udev/udev-165/cache |    2 ++
 recipes/udev/udev-165/init  |    2 ++
 recipes/udev/udev_141.bb    |    3 ++-
 recipes/udev/udev_151.bb    |    3 ++-
 recipes/udev/udev_154.bb    |    3 ++-
 recipes/udev/udev_162.bb    |    3 ++-
 recipes/udev/udev_165.bb    |    3 ++-
 15 files changed, 30 insertions(+), 5 deletions(-)

diff --git a/recipes/udev/udev-141/cache b/recipes/udev/udev-141/cache
index c0d400b..6936170 100644
--- a/recipes/udev/udev-141/cache
+++ b/recipes/udev/udev-141/cache
@@ -11,11 +11,13 @@ if [ "$DEVCACHE" != "" ]; then
 	(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
 	echo
 else
 	rm -f /tmp/uname
 	rm -f /tmp/cmdline
+	rm -f /tmp/devices
 	rm -f /tmp/atags
 fi
 
diff --git a/recipes/udev/udev-141/init b/recipes/udev/udev-141/init
index 4dcb241..c0ecdfc 100644
--- a/recipes/udev/udev-141/init
+++ b/recipes/udev/udev-141/init
@@ -39,10 +39,12 @@ 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
 	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
 		(cd /; tar xf $DEVCACHE > /dev/null 2>&1)
 		not_first_boot=1
diff --git a/recipes/udev/udev-151/cache b/recipes/udev/udev-151/cache
index c0d400b..6936170 100644
--- a/recipes/udev/udev-151/cache
+++ b/recipes/udev/udev-151/cache
@@ -11,11 +11,13 @@ if [ "$DEVCACHE" != "" ]; then
 	(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
 	echo
 else
 	rm -f /tmp/uname
 	rm -f /tmp/cmdline
+	rm -f /tmp/devices
 	rm -f /tmp/atags
 fi
 
diff --git a/recipes/udev/udev-151/init b/recipes/udev/udev-151/init
index 4dcb241..c0ecdfc 100644
--- a/recipes/udev/udev-151/init
+++ b/recipes/udev/udev-151/init
@@ -39,10 +39,12 @@ 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
 	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
 		(cd /; tar xf $DEVCACHE > /dev/null 2>&1)
 		not_first_boot=1
diff --git a/recipes/udev/udev-154/cache b/recipes/udev/udev-154/cache
index c0d400b..6936170 100644
--- a/recipes/udev/udev-154/cache
+++ b/recipes/udev/udev-154/cache
@@ -11,11 +11,13 @@ if [ "$DEVCACHE" != "" ]; then
 	(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
 	echo
 else
 	rm -f /tmp/uname
 	rm -f /tmp/cmdline
+	rm -f /tmp/devices
 	rm -f /tmp/atags
 fi
 
diff --git a/recipes/udev/udev-154/init b/recipes/udev/udev-154/init
index 4dcb241..c0ecdfc 100644
--- a/recipes/udev/udev-154/init
+++ b/recipes/udev/udev-154/init
@@ -39,10 +39,12 @@ 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
 	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
 		(cd /; tar xf $DEVCACHE > /dev/null 2>&1)
 		not_first_boot=1
diff --git a/recipes/udev/udev-162/cache b/recipes/udev/udev-162/cache
index c0d400b..6936170 100644
--- a/recipes/udev/udev-162/cache
+++ b/recipes/udev/udev-162/cache
@@ -11,11 +11,13 @@ if [ "$DEVCACHE" != "" ]; then
 	(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
 	echo
 else
 	rm -f /tmp/uname
 	rm -f /tmp/cmdline
+	rm -f /tmp/devices
 	rm -f /tmp/atags
 fi
 
diff --git a/recipes/udev/udev-162/init b/recipes/udev/udev-162/init
index 4dcb241..c0ecdfc 100644
--- a/recipes/udev/udev-162/init
+++ b/recipes/udev/udev-162/init
@@ -39,10 +39,12 @@ 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
 	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
 		(cd /; tar xf $DEVCACHE > /dev/null 2>&1)
 		not_first_boot=1
diff --git a/recipes/udev/udev-165/cache b/recipes/udev/udev-165/cache
index c0d400b..6936170 100644
--- a/recipes/udev/udev-165/cache
+++ b/recipes/udev/udev-165/cache
@@ -11,11 +11,13 @@ if [ "$DEVCACHE" != "" ]; then
 	(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
 	echo
 else
 	rm -f /tmp/uname
 	rm -f /tmp/cmdline
+	rm -f /tmp/devices
 	rm -f /tmp/atags
 fi
 
diff --git a/recipes/udev/udev-165/init b/recipes/udev/udev-165/init
index 4dcb241..c0ecdfc 100644
--- a/recipes/udev/udev-165/init
+++ b/recipes/udev/udev-165/init
@@ -39,10 +39,12 @@ 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
 	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
 		(cd /; tar xf $DEVCACHE > /dev/null 2>&1)
 		not_first_boot=1
diff --git a/recipes/udev/udev_141.bb b/recipes/udev/udev_141.bb
index 80b7cc7..9a0a7be 100644
--- a/recipes/udev/udev_141.bb
+++ b/recipes/udev/udev_141.bb
@@ -7,7 +7,7 @@ DEFAULT_PREFERENCE = "-1"
 
 require udev.inc
 
-PR = "${INC_PR}.5"
+PR = "${INC_PR}.6"
 
 SRC_URI += "file://mount.blacklist \
 	    file://run.rules \
@@ -73,6 +73,7 @@ do_install () {
 
 	touch ${D}${sysconfdir}/udev/saved.uname
 	touch ${D}${sysconfdir}/udev/saved.cmdline
+	touch ${D}${sysconfdir}/udev/saved.devices
 	touch ${D}${sysconfdir}/udev/saved.atags
 
 	install -d ${D}${sysconfdir}/udev/scripts/
diff --git a/recipes/udev/udev_151.bb b/recipes/udev/udev_151.bb
index 32ab909..393fcc7 100644
--- a/recipes/udev/udev_151.bb
+++ b/recipes/udev/udev_151.bb
@@ -3,7 +3,7 @@ DESCRIPTION = "udev is a daemon which dynamically creates and removes device nod
 the hotplug package and requires a kernel not older than 2.6.12."
 LICENSE = "GPLv2+"
 
-PR = "r23"
+PR = "r24"
 
 # Untested
 DEFAULT_PREFERENCE = "-1"
@@ -135,6 +135,7 @@ do_install () {
 
 	touch ${D}${sysconfdir}/udev/saved.uname
 	touch ${D}${sysconfdir}/udev/saved.cmdline
+	touch ${D}${sysconfdir}/udev/saved.devices
 	touch ${D}${sysconfdir}/udev/saved.atags
 
 	install -d ${D}${sysconfdir}/udev/scripts/
diff --git a/recipes/udev/udev_154.bb b/recipes/udev/udev_154.bb
index 4a358d3..44d7b13 100644
--- a/recipes/udev/udev_154.bb
+++ b/recipes/udev/udev_154.bb
@@ -3,7 +3,7 @@ DESCRIPTION = "udev is a daemon which dynamically creates and removes device nod
 the hotplug package and requires a kernel not older than 2.6.12."
 LICENSE = "GPLv2+"
 
-PR = "r7"
+PR = "r8"
 
 # Untested
 DEFAULT_PREFERENCE = "-1"
@@ -128,6 +128,7 @@ do_install () {
 
 	touch ${D}${sysconfdir}/udev/saved.uname
 	touch ${D}${sysconfdir}/udev/saved.cmdline
+	touch ${D}${sysconfdir}/udev/saved.devices
 	touch ${D}${sysconfdir}/udev/saved.atags
 
 	install -d ${D}${sysconfdir}/udev/scripts/
diff --git a/recipes/udev/udev_162.bb b/recipes/udev/udev_162.bb
index e344065..8f23f08 100644
--- a/recipes/udev/udev_162.bb
+++ b/recipes/udev/udev_162.bb
@@ -3,7 +3,7 @@ DESCRIPTION = "udev is a daemon which dynamically creates and removes device nod
 the hotplug package and requires a kernel not older than 2.6.12."
 LICENSE = "GPLv2+"
 
-PR = "r10"
+PR = "r11"
 
 # Untested
 #DEFAULT_PREFERENCE = "-1"
@@ -140,6 +140,7 @@ do_install () {
 
 	touch ${D}${sysconfdir}/udev/saved.uname
 	touch ${D}${sysconfdir}/udev/saved.cmdline
+	touch ${D}${sysconfdir}/udev/saved.devices
 	touch ${D}${sysconfdir}/udev/saved.atags
 
 	install -d ${D}${sysconfdir}/udev/scripts/
diff --git a/recipes/udev/udev_165.bb b/recipes/udev/udev_165.bb
index 55eccb0..1f57a46 100644
--- a/recipes/udev/udev_165.bb
+++ b/recipes/udev/udev_165.bb
@@ -3,7 +3,7 @@ DESCRIPTION = "udev is a daemon which dynamically creates and removes device nod
 the hotplug package and requires a kernel not older than 2.6.12."
 LICENSE = "GPLv2+"
 
-PR = "r1"
+PR = "r2"
 
 # Untested
 DEFAULT_PREFERENCE = "-1"
@@ -137,6 +137,7 @@ do_install () {
 
 	touch ${D}${sysconfdir}/udev/saved.uname
 	touch ${D}${sysconfdir}/udev/saved.cmdline
+	touch ${D}${sysconfdir}/udev/saved.devices
 	touch ${D}${sysconfdir}/udev/saved.atags
 
 	install -d ${D}${sysconfdir}/udev/scripts/
-- 
1.7.0.4




^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [PATCH] udev: also use /proc/devices to invalidate devcache
  2011-02-11 19:35 [PATCH] udev: also use /proc/devices to invalidate devcache Denys Dmytriyenko
@ 2011-02-11 20:21 ` Koen Kooi
  0 siblings, 0 replies; 2+ messages in thread
From: Koen Kooi @ 2011-02-11 20:21 UTC (permalink / raw)
  To: openembedded-devel

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

On 11-02-11 20:35, Denys Dmytriyenko wrote:
> From: Denys Dmytriyenko <denys@ti.com>
> 
> * Besides checking for kernel version, bootargs or cmdline changes between
> reboots, also consider changes in /proc/devices to invalidate device cache.
> 
> Signed-off-by: Denys Dmytriyenko <denys@ti.com>

Acked-by: Koen Kooi <k-kooi@ti.com>

FWIW, to make everything work properly newer udevs might need a change
in the trigger script to explicitly use --action=add, but I need to run
some more tests.
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.5 (Darwin)

iD8DBQFNVZo+MkyGM64RGpERAj97AJ9G4UOkQ9suecrPe0GvI7en+sRq0wCfbIX+
FieAuvTwv3YKyCBJk9ckaU4=
=iC0+
-----END PGP SIGNATURE-----




^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2011-02-11 20:22 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2011-02-11 19:35 [PATCH] udev: also use /proc/devices to invalidate devcache Denys Dmytriyenko
2011-02-11 20:21 ` Koen Kooi

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox