Workaround for DEVT-160 - Handle systemd locale instead of /etc/sysconfig/i18n 12/18412/2 accepted/tizen/ivi/20140324.222436 submit/tizen/20140324.220314
authorJimmy Huang <jimmy.huang@intel.com>
Fri, 21 Mar 2014 19:38:58 +0000 (12:38 -0700)
committerJimmy Huang <jimmy.huang@intel.com>
Fri, 21 Mar 2014 20:47:44 +0000 (13:47 -0700)
This is a workaround fix for DEVT-160, currently systemd gets locale from
/etc/locale.conf, but MIC does not populate this file.  This patch will
move the locale configurationfrom /etc/sysconfig/i18n to /etc/locale.conf.

It also sets the default locale from en_US.UTF-8 to en_US.utf8 to be
compatible with systemd.

Change-Id: I6e0d2537aaf54c8afade372b719fc6aa87723c38
Signed-off-by: Jimmy Huang <jimmy.huang@intel.com>
ivi.yaml
ks/ivi-efi-i586.yaml
ks/ivi-mbr-i586-JJ.yaml
ks/ivi-mbr-i586-emul.yaml
ks/ivi-mbr-i586.yaml
ks/ivi-min-efi-i586.yaml
ks/ivi-min-mbr-i586.yaml
scripts/locale.post [new file with mode: 0644]

index 0e69535..850eea8 100644 (file)
--- a/ivi.yaml
+++ b/ivi.yaml
@@ -4,7 +4,7 @@ Default:
     Mic2Options: -f raw --fstab=uuid --copy-kernel --compress-disk-image=bz2 --generate-bmap
     Architecture: ia32
     Part: ivi-mbr
-    Language: en_US.UTF-8
+    Language: en_US.utf8
     Keyboard: us
     Timezone: America/Los_Angeles
     RootPass: tizen
index d1c91ae..48f4345 100644 (file)
@@ -17,3 +17,4 @@ ExtraPackages:
     - setup-ivi-clone
 PostScripts:
     - setup-ivi
+    - locale
index 8b0ae46..ae379c2 100644 (file)
@@ -16,3 +16,4 @@ ExtraPackages:
     - setup-ivi-clone
 PostScripts:
     - setup-ivi
+    - locale
index a09e377..14f534c 100644 (file)
@@ -21,3 +21,4 @@ RemovePackages:
     - sdbd
 PostScripts:
     - setup-ivi
+    - locale
index fce9c37..b47e478 100644 (file)
@@ -16,3 +16,4 @@ ExtraPackages:
     - setup-ivi-clone
 PostScripts:
     - setup-ivi
+    - locale
index 86a5ec4..f7e0031 100644 (file)
@@ -18,3 +18,4 @@ ExtraPackages:
 PostScripts:
     - base-ivi-minimal
     - setup-ivi
+    - locale
index 8405b2c..7565d88 100644 (file)
@@ -17,3 +17,4 @@ ExtraPackages:
 PostScripts:
     - base-ivi-minimal
     - setup-ivi
+    - locale
diff --git a/scripts/locale.post b/scripts/locale.post
new file mode 100644 (file)
index 0000000..43a9d7c
--- /dev/null
@@ -0,0 +1,33 @@
+
+# Migrate /etc/sysconfig/i18n until MIC is fixed to handle locale.conf
+#
+if [ -e /etc/sysconfig/i18n -a ! -e /etc/locale.conf ]; then
+        unset LANG
+        unset LC_CTYPE
+        unset LC_NUMERIC
+        unset LC_TIME
+        unset LC_COLLATE
+        unset LC_MONETARY
+        unset LC_MESSAGES
+        unset LC_PAPER
+        unset LC_NAME
+        unset LC_ADDRESS
+        unset LC_TELEPHONE
+        unset LC_MEASUREMENT
+        unset LC_IDENTIFICATION
+        . /etc/sysconfig/i18n >/dev/null 2>&1 || :
+        [ -n "$LANG" ] && echo LANG=$LANG > /etc/locale.conf 2>&1 || :
+        [ -n "$LC_CTYPE" ] && echo LC_CTYPE=$LC_CTYPE >> /etc/locale.conf 2>&1 || :
+        [ -n "$LC_NUMERIC" ] && echo LC_NUMERIC=$LC_NUMERIC >> /etc/locale.conf 2>&1 || :
+        [ -n "$LC_TIME" ] && echo LC_TIME=$LC_TIME >> /etc/locale.conf 2>&1 || :
+        [ -n "$LC_COLLATE" ] && echo LC_COLLATE=$LC_COLLATE >> /etc/locale.conf 2>&1 || :
+        [ -n "$LC_MONETARY" ] && echo LC_MONETARY=$LC_MONETARY >> /etc/locale.conf 2>&1 || :
+        [ -n "$LC_MESSAGES" ] && echo LC_MESSAGES=$LC_MESSAGES >> /etc/locale.conf 2>&1 || :
+        [ -n "$LC_PAPER" ] && echo LC_PAPER=$LC_PAPER >> /etc/locale.conf 2>&1 || :
+        [ -n "$LC_NAME" ] && echo LC_NAME=$LC_NAME >> /etc/locale.conf 2>&1 || :
+        [ -n "$LC_ADDRESS" ] && echo LC_ADDRESS=$LC_ADDRESS >> /etc/locale.conf 2>&1 || :
+        [ -n "$LC_TELEPHONE" ] && echo LC_TELEPHONE=$LC_TELEPHONE >> /etc/locale.conf 2>&1 || :
+        [ -n "$LC_MEASUREMENT" ] && echo LC_MEASUREMENT=$LC_MEASUREMENT >> /etc/locale.conf 2>&1 || :
+        [ -n "$LC_IDENTIFICATION" ] && echo LC_IDENTIFICATION=$LC_IDENTIFICATION >> /etc/locale.conf 2>&1 || :
+fi
+rm -f /etc/sysconfig/i18n >/dev/null 2>&1 || :