Patchwork [12/20] udev-cache: fix timestamp errors on systems lacking an RTC

login
register
mail settings
Submitter Ben Shelton
Date Aug. 4, 2014, 6:41 p.m.
Message ID <17dc769adb9aef8b1cdb1f298874d482f0337ad3.1407177403.git.ben.shelton@ni.com>
Download mbox | patch
Permalink /patch/77217/
State New
Headers show

Comments

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

If the system lacks an RTC, the time will typically start from the
epoch, and may get set to the "correct" time later (if at all).
In this circumstance, the timestamps in the cache tarball will always be
in the future. gnutar complains bitterly about this.

To work around this, use `tar -m` to strip mtimes during extract.

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 | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

Patch

diff --git a/meta/recipes-core/udev/udev/udev-cache.default b/meta/recipes-core/udev/udev/udev-cache.default
index 30d7faa..554142a 100644
--- a/meta/recipes-core/udev/udev/udev-cache.default
+++ b/meta/recipes-core/udev/udev/udev-cache.default
@@ -7,7 +7,8 @@  DEVCACHE_SYSCONF="/etc/udev/cache.data"
 DEVCACHE_CURRENT_SYSCONF="/dev/shm/udev.cache"
 
 # - Avoid /dev/log because it's a pipe.
-DEVCACHE_EXTRACT_OPTS="--exclude=log"
+# - Don't restore mtimes. Avoids errors on systems lacking an RTC.
+DEVCACHE_EXTRACT_OPTS="--exclude=log -m"
 DEVCACHE_CREATE_OPTS="--exclude=log"
 
 PROBE_PLATFORM_BUS="yes"