Linux Archive

Linux Archive (http://www.linux-archive.org/)
-   Fedora Infrastructure (http://www.linux-archive.org/fedora-infrastructure/)
-   -   fix text mode KeyError crash (#804483) (http://www.linux-archive.org/fedora-infrastructure/646969-fix-text-mode-keyerror-crash-804483-a.html)

Will Woods 03-20-2012 07:10 PM

fix text mode KeyError crash (#804483)
 
anaconda didn't know how to deal with LANG=C. So if we have LANG=C, just
treat it like we had no LANG set: reset to DEFAULT_LANG.

Just to be sure, use TTYReset=yes in anaconda.service, which will make
systemd reset the terminal to sane (and unicode-ready) settings.

Finally, emit the magic control sequence to set UTF-8 output, which fixes
the line-drawing characters in text-mode virtual terminals.
---
anaconda | 5 +++++
data/systemd/anaconda.service | 3 ++-
2 files changed, 7 insertions(+), 1 deletions(-)

diff --git a/anaconda b/anaconda
index 4fcc6b8..ae23d4f 100755
--- a/anaconda
+++ b/anaconda
@@ -643,6 +643,11 @@ if __name__ == "__main__":
iutil.execWithRedirect("localedef",
["-i", deflang, "-f", defcode, DEFAULT_LANG])

+ # to set UTF8 mode on the terminal, we need LANG to be set usefully
+ if os.environ.get("LANG", "C") == "C":
+ os.environ['LANG'] = DEFAULT_LANG
+ print "33%G" # UTF8 power go!
+
import gettext
_ = lambda x: gettext.ldgettext("anaconda", x)

diff --git a/data/systemd/anaconda.service b/data/systemd/anaconda.service
index 8e853aa..45061cc 100644
--- a/data/systemd/anaconda.service
+++ b/data/systemd/anaconda.service
@@ -4,9 +4,10 @@ Wants=instperf.service rsyslog.service udev-settle.service NetworkManager.servic
After=instperf.service rsyslog.service udev-settle.service NetworkManager.service

[Service]
-Environment=HOME=/root MALLOC_CHECK_=2 MALLOC_PERTURB_=204 PATH=/usr/bin:/bin:/sbin:/usr/sbin:/mnt/sysimage/bin:/mnt/sysimage/usr/bin:/mnt/sysimage/usr/sbin:/mnt/sysimage/sbin PYTHONPATH=/tmp/updates TERM=linux
+Environment=HOME=/root MALLOC_CHECK_=2 MALLOC_PERTURB_=204 PATH=/usr/bin:/bin:/sbin:/usr/sbin:/mnt/sysimage/bin:/mnt/sysimage/usr/bin:/mnt/sysimage/usr/sbin:/mnt/sysimage/sbin PYTHONPATH=/tmp/updates
Type=oneshot
WorkingDirectory=/root
ExecStart=/usr/sbin/anaconda
StandardInput=tty-force
+TTYReset=yes
TimeoutSec=0
--
1.7.7.6

_______________________________________________
Anaconda-devel-list mailing list
Anaconda-devel-list@redhat.com
https://www.redhat.com/mailman/listinfo/anaconda-devel-list


All times are GMT. The time now is 06:44 AM.

VBulletin, Copyright ©2000 - 2014, Jelsoft Enterprises Ltd.
Content Relevant URLs by vBSEO ©2007, Crawlability, Inc.