Send connman mailing list submissions to
        [email protected]

To subscribe or unsubscribe via the World Wide Web, visit
        https://lists.01.org/mailman/listinfo/connman
or, via email, send a message with subject or body 'help' to
        [email protected]

You can reach the person managing the list at
        [email protected]

When replying, please edit your Subject line so it is more specific
than "Re: Contents of connman digest..."


Today's Topics:

   1. Connman problem with changing timezone on read-only rootfs
      (Viliam Lejcik)


----------------------------------------------------------------------

Message: 1
Date: Tue, 6 Sep 2016 17:24:40 +0000
From: Viliam Lejcik <[email protected]>
To: "[email protected]" <[email protected]>
Subject: Connman problem with changing timezone on read-only rootfs
Message-ID:
        <d13610e838836d488558653194c1806901e20...@kihagwinex02.int.kistler.com>
        
Content-Type: text/plain; charset="us-ascii"

Hi all,

Recently we started testing our yocto-based linux OS on a read-only root file 
system and we've run into a problem with changing a timezone. It happens 
because the /etc/localtime file is in the read-only partition and connman 
cannot overwrite it. We've solved the problem by changing the /etc/localtime 
file to a symlink pointing somewhere to a writeable partition (e.g. /var). In 
this case connman still tries to delete the /etc/localtime link on a timezone 
change request (see write_file()), but it doesn't care if it was successful, so 
the link file stays unchanged and the following open() call will overwrite the 
target file. If a developer temporarily remouted the filesystem to read-write 
mode and changed a timezone, the link is replaced with a regular file. 
Moreover, connman sets inotify_add_watch() for the /etc dir and if the 
localtime file is a link, it doesn't catch changes in the target file content.

I am enclosing a patch with a more general solution for this problem. It covers 
situations where /etc/localtime file is:
- regular file, it is overwritten everytime (the same as before)
- link file pointing somewhere into /usr/share/zoneinfo/..., what is usually an 
initial state after clean OS installation, the link file is removed and 
replaced with a regular file (the same as before)
- link file pointing somewhere else (e.g. /var/...), the link file is preserved 
and the target file is overwritten, moreover connman watches for changes in the 
directory where the link file points to (new behavior)

The patch doesn't handle the situation when /etc/localhost link file is 
modified by another process or user and is relinked to point into another 
directory, as I'm not sure if this is necessary.

What do you think about my solution? For us this is sufficient, and I think it 
may be helpful for others too. Thank you for review.

Best Regards,
Viliam

-------------- next part --------------
A non-text attachment was scrubbed...
Name: timezone-change-fix-for-ro-rootfs.patch
Type: application/octet-stream
Size: 2066 bytes
Desc: timezone-change-fix-for-ro-rootfs.patch
URL: 
<http://lists.01.org/pipermail/connman/attachments/20160906/e76d7c24/attachment-0001.obj>

------------------------------

Subject: Digest Footer

_______________________________________________
connman mailing list
[email protected]
https://lists.01.org/mailman/listinfo/connman


------------------------------

End of connman Digest, Vol 11, Issue 6
**************************************

Reply via email to