From: Richard Tollerton <rich.toller...@ni.com>

Presently, $DEVCACHE_CURRENT_SYSCONF doesn't change if rules are
modified, which may cause the cache to preserve an old configuration.
To fix, include `ls -l` output for all rules, which ought to be
reasonably fast to run on boot.

Natinst-Rally-ID: TA44427
Acked-by: Gratian Crisan <gratian.cri...@ni.com>
Natinst-ReviewBoard-ID: 58620
Signed-off-by: Richard Tollerton <rich.toller...@ni.com>
---
 meta/recipes-core/udev/udev/init | 7 ++++---
 1 file changed, 4 insertions(+), 3 deletions(-)

diff --git a/meta/recipes-core/udev/udev/init b/meta/recipes-core/udev/udev/init
index e4a196f..3a52e98 100644
--- a/meta/recipes-core/udev/udev/init
+++ b/meta/recipes-core/udev/udev/init
@@ -63,9 +63,10 @@ case "$1" in
     # A list of files which are used as a criteria to judge whether the udev 
cache could be reused.
     CMP_FILE_LIST="/proc/version /proc/cmdline /proc/devices /proc/atags"
     if [ "$DEVCACHE" != "" ]; then
+           RULELIST=`ls -l /lib/udev/rules.d/* /etc/udev/rules.d/* 2>/dev/null`
             if [ -e $DEVCACHE ]; then
                    readfiles $CMP_FILE_LIST
-                   NEWDATA="$READDATA"
+                   NEWDATA="$READDATA$RULELIST"
                    readfiles "$DEVCACHE_SYSCONF"
                    OLDDATA="$READDATA"
                    if [ "$OLDDATA" = "$NEWDATA" -a -f "$DEVCACHE" ]; then
@@ -77,7 +78,7 @@ case "$1" in
                            # Output detailed reason why the cached /dev is not 
used
                            if [ "$VERBOSE" != "no" ]; then
                                    echo "udev: udev cache not used"
-                                   echo "udev: we use $CMP_FILE_LIST as 
criteria to judge whether the cache /dev could be resued"
+                                   echo "udev: we use $CMP_FILE_LIST and ls -l 
[/lib][etc]/udev/rules.d/* as criteria to judge whether the cached /dev could 
be reused"
                                    echo "udev: olddata: $OLDDATA"
                                    echo "udev: newdata: $NEWDATA"
                            fi
@@ -88,7 +89,7 @@ case "$1" in
                            # If rootfs is not read-only, it's possible that a 
new udev cache would be generated;
                            # otherwise, we do not bother to read files.
                            readfiles $CMP_FILE_LIST
-                           echo "$READDATA" > "$DEVCACHE_CURRENT_SYSCONF"
+                           echo "$READDATA$RULELIST" > 
"$DEVCACHE_CURRENT_SYSCONF"
                    fi
             fi
     fi
-- 
2.0.4

-- 
_______________________________________________
Openembedded-core mailing list
Openembedded-core@lists.openembedded.org
http://lists.openembedded.org/mailman/listinfo/openembedded-core

Reply via email to