From 1fe9cdbb6053f7b1dbbeca87d334f78824d2bd4d Mon Sep 17 00:00:00 2001 From: Stefan Seyfried Date: Sat, 11 Oct 2014 21:58:45 +0200 Subject: [PATCH] setting_helpers: write /etc/timezone for better compatibility Origin commit data ------------------ Commit: https://github.com/neutrino-images/ni-neutrino/commit/c9c3c01e92f8b8132ce6907ce7750c3e6fefa152 Author: Stefan Seyfried Date: 2014-10-11 (Sat, 11 Oct 2014) --- src/system/setting_helpers.cpp | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/system/setting_helpers.cpp b/src/system/setting_helpers.cpp index 48bba1bc8..99bb9f984 100644 --- a/src/system/setting_helpers.cpp +++ b/src/system/setting_helpers.cpp @@ -509,6 +509,12 @@ bool CTZChangeNotifier::changeNotify(const neutrino_locale_t, void * Data) perror("unlink failed"); if (symlink(cmd.c_str(), "/etc/localtime")) perror("symlink failed"); + /* for yocto tzdata compatibility */ + FILE *f = fopen("/etc/timezone", "w"); + if (f) { + fprintf(f, "%s\n", zone.c_str()); + fclose(f); + } #if 0 cmd = ":" + zone; setenv("TZ", cmd.c_str(), 1);