WARNING - OLD ARCHIVES

This is an archived copy of the Xen.org mailing list, which we have preserved to ensure that existing links to archives are not broken. The live archive, which contains the latest emails, can be found at http://lists.xen.org/
   
 
 
Xen 
 
Home Products Support Community News
 
   
 

xen-devel

[Xen-devel] [PATCH] XEN: use C locale in bootup message

To: xen-devel <xen-devel@xxxxxxxxxxxxxxxxxxx>
Subject: [Xen-devel] [PATCH] XEN: use C locale in bootup message
From: Horms <horms@xxxxxxxxxxxx>
Date: Thu, 31 Aug 2006 13:27:13 +0900
Delivery-date: Thu, 31 Aug 2006 01:40:07 -0700
Envelope-to: www-data@xxxxxxxxxxxxxxxxxx
List-help: <mailto:xen-devel-request@lists.xensource.com?subject=help>
List-id: Xen developer discussion <xen-devel.lists.xensource.com>
List-post: <mailto:xen-devel@lists.xensource.com>
List-subscribe: <http://lists.xensource.com/cgi-bin/mailman/listinfo/xen-devel>, <mailto:xen-devel-request@lists.xensource.com?subject=subscribe>
List-unsubscribe: <http://lists.xensource.com/cgi-bin/mailman/listinfo/xen-devel>, <mailto:xen-devel-request@lists.xensource.com?subject=unsubscribe>
Sender: xen-devel-bounces@xxxxxxxxxxxxxxxxxxx
User-agent: mutt-ng/devel-r804 (Debian)
There is a fairly extensive comment inline that explains what is going on,
but in a nutshell:

* LC_ALL=C is needed for date output
* LANG=C   may be needed, at worst its harmless
* The scope of the settings needs to be global, not include/xen/compile.h
* export the variables for consistency sake

I have:
  date (GNU coreutils) 5.97
  GNU Make 3.81
  And my locale set to Japanese (I can send details if anyone cares)

And in that environment Japanese text was ending up in
include/xen/compile.h, and coming out as complete garbage
on xen console over serial.

Signed-Off-By: Simon Horman <horms@xxxxxxxxxxxx>

 xen/Makefile |   17 ++++++++++++++++-
 1 file changed, 16 insertions(+), 1 deletion(-)

--- x/xen/Makefile
+++ x/xen/Makefile
@@ -89,8 +89,23 @@ include/xen/acm_policy.h:
          echo "#define ACM_DEFAULT_SECURITY_POLICY 
$(ACM_DEFAULT_SECURITY_POLICY)"; \
          echo "#endif") >$@
 
+# These variables need to be set to ensure that date (and possibly others)
+# produce information for include/xen/compile.h, which is able
+# to be displayed on a dumb console - the contents is displayed on boot.
+# Setting them local to include/xen/compile.h, as in the following
+# commented out line, does not work as the scope does not extend to
+# $(shell blah)
+#
+# include/xen/compile.h: LANG=C
+#
+# export isn't really neccessary, as if the variables are present in
+# the environment then they will be exported anyway. And if not there
+# is no need to set them at all. But it seems safe enough to consistently
+# export them to all child processes of this makefile.
+export LANG=C
+export LC_ALL=C
+
 # compile.h contains dynamic build info. Rebuilt on every 'make' invocation.
-include/xen/compile.h: LANG=C
 include/xen/compile.h: include/xen/compile.h.in
        @sed -e 's/@@date@@/$(shell date)/g' \
            -e 's/@@time@@/$(shell date +%T)/g' \

_______________________________________________
Xen-devel mailing list
Xen-devel@xxxxxxxxxxxxxxxxxxx
http://lists.xensource.com/xen-devel

<Prev in Thread] Current Thread [Next in Thread>