All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH v1] initscripts: do not save timestamp for readonly system
@ 2015-11-23  9:42 Ming Liu
  2015-11-23 21:18 ` Burton, Ross
  0 siblings, 1 reply; 3+ messages in thread
From: Ming Liu @ 2015-11-23  9:42 UTC (permalink / raw)
  To: openembedded-core; +Cc: Ming Liu

From: Ming Liu <peter.x.liu@external.atlascopco.com>

To avoid reporting errors for /etc/timestamp is not writeable in a
readonly system.

Reported-by: Niklas Soderlund <niklas.soderlund@external.atlascopco.com>
Signed-off-by: Ming Liu <peter.x.liu@external.atlascopco.com>
---
 meta/recipes-core/initscripts/initscripts-1.0/save-rtc.sh | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/meta/recipes-core/initscripts/initscripts-1.0/save-rtc.sh b/meta/recipes-core/initscripts/initscripts-1.0/save-rtc.sh
index b038fc5..6e5be79 100644
--- a/meta/recipes-core/initscripts/initscripts-1.0/save-rtc.sh
+++ b/meta/recipes-core/initscripts/initscripts-1.0/save-rtc.sh
@@ -9,5 +9,5 @@
 # Description:       
 ### END INIT INFO
 
-# Update the timestamp
-date -u +%4Y%2m%2d%2H%2M%2S > /etc/timestamp
+# Update the timestamp for writeable system
+[ -w /etc/timestamp ] && date -u +%4Y%2m%2d%2H%2M%2S > /etc/timestamp
-- 
1.9.1



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

* Re: [PATCH v1] initscripts: do not save timestamp for readonly system
  2015-11-23  9:42 [PATCH v1] initscripts: do not save timestamp for readonly system Ming Liu
@ 2015-11-23 21:18 ` Burton, Ross
  2015-11-23 21:43   ` Ming Liu
  0 siblings, 1 reply; 3+ messages in thread
From: Burton, Ross @ 2015-11-23 21:18 UTC (permalink / raw)
  To: Ming Liu; +Cc: Ming Liu, OE-core

[-- Attachment #1: Type: text/plain, Size: 364 bytes --]

On 23 November 2015 at 09:42, Ming Liu <liu.ming50@gmail.com> wrote:

> +[ -w /etc/timestamp ] && date -u +%4Y%2m%2d%2H%2M%2S > /etc/timestamp
>

This would fail if /etc/timestamp doesn't already exist.  I'm tempted to
say you should just 2>/dev/null so it tries and the error is hidden in case
/etc/timestamp is deleted on a writable file system.

Ross

[-- Attachment #2: Type: text/html, Size: 776 bytes --]

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

* Re: [PATCH v1] initscripts: do not save timestamp for readonly system
  2015-11-23 21:18 ` Burton, Ross
@ 2015-11-23 21:43   ` Ming Liu
  0 siblings, 0 replies; 3+ messages in thread
From: Ming Liu @ 2015-11-23 21:43 UTC (permalink / raw)
  To: Burton, Ross; +Cc: Ming Liu, OE-core

[-- Attachment #1: Type: text/plain, Size: 563 bytes --]



On 11/23/2015 10:18 PM, Burton, Ross wrote:
>
> On 23 November 2015 at 09:42, Ming Liu <liu.ming50@gmail.com 
> <mailto:liu.ming50@gmail.com>> wrote:
>
>     +[ -w /etc/timestamp ] && date -u +%4Y%2m%2d%2H%2M%2S > /etc/timestamp
>
>
> This would fail if /etc/timestamp doesn't already exist.  I'm tempted 
> to say you should just 2>/dev/null so it tries and the error is hidden 
> in case /etc/timestamp is deleted on a writable file system.
Yes, that is true! I did not consider that case, then I will send a V2 soon.

//Ming Liu
>
> Ross


[-- Attachment #2: Type: text/html, Size: 1958 bytes --]

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

end of thread, other threads:[~2015-11-23 21:43 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2015-11-23  9:42 [PATCH v1] initscripts: do not save timestamp for readonly system Ming Liu
2015-11-23 21:18 ` Burton, Ross
2015-11-23 21:43   ` Ming Liu

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.