[13/20] udev-cache: Avoid caching udev.cache or non-devfs filesystems

Submitted by Ben Shelton on Aug. 4, 2014, 6:41 p.m. | Patch ID: 77243


Message ID 3e278d7733edb0f2473ee7a874b0e971080843d8.1407177403.git.ben.shelton@ni.com
State New
Headers show

Commit Message

Ben Shelton Aug. 4, 2014, 6:41 p.m.
From: Richard Tollerton <rich.tollerton@ni.com>

If $DEVCACHE_CURRENT_SYSCONF gets stored in the cache tarball, and
extracted, then udev-cache will needlessly rebuild the cache on every
future boot. The direct fix to this is to explicitly exclude it.

Investigating this also uncovered that we're also archiving everything
under other filesystems, including /dev/cgroup, /dev/shm, etc. This
shouldn't be happening. The fix is to use `tar --one-file-system`, but
this is GNU-specific.

Natinst-Rally-ID: TA44427
Acked-by: Gratian Crisan <gratian.crisan@ni.com>
Natinst-ReviewBoard-ID: 58620
Signed-off-by: Richard Tollerton <rich.tollerton@ni.com>
 meta/recipes-core/udev/udev/udev-cache.default | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

Patch hide | download patch | download mbox

diff --git a/meta/recipes-core/udev/udev/udev-cache.default b/meta/recipes-core/udev/udev/udev-cache.default
index 554142a..c71826e 100644
--- a/meta/recipes-core/udev/udev/udev-cache.default
+++ b/meta/recipes-core/udev/udev/udev-cache.default
@@ -8,7 +8,8 @@  DEVCACHE_CURRENT_SYSCONF="/dev/shm/udev.cache"
 # - Avoid /dev/log because it's a pipe.
 # - Don't restore mtimes. Avoids errors on systems lacking an RTC.
-DEVCACHE_EXTRACT_OPTS="--exclude=log -m"
+# - (gnutar specific) Stay on the same fs.
+DEVCACHE_EXTRACT_OPTS="--exclude=log -m --exclude=udev.cache --one-file-system"
+DEVCACHE_CREATE_OPTS="--exclude=log --exclude=udev.cache --one-file-system"