Skip to content

Commit

Permalink
- call unicode_start/stop and initviocons only on consoles (bnc#800790)
Browse files Browse the repository at this point in the history
- fixed check for missing initviocons
- fixed typos
  • Loading branch information
aschnell committed May 3, 2013
1 parent 3ded1e1 commit 25cd09d
Show file tree
Hide file tree
Showing 6 changed files with 55 additions and 24 deletions.
7 changes: 7 additions & 0 deletions package/yast2-installation.changes
@@ -1,3 +1,10 @@
-------------------------------------------------------------------
Fri May 03 12:18:43 CEST 2013 - aschnell@suse.de

- call unicode_start/stop and initviocons only on consoles
(bnc#800790)
- fixed check for missing initviocons

-------------------------------------------------------------------
Mon Apr 22 14:59:35 CEST 2013 - jsuchome@suse.cz

Expand Down
8 changes: 4 additions & 4 deletions startup/First-Stage/F06-terminal
Expand Up @@ -7,12 +7,12 @@ log "========================"
#---------------------------------------------
# ---- DISABLED: S390 console check ----
# . /usr/lib/YaST2/startup/arch/s390/console.sh
# BEG S390: check if initvicons needs to be called
# s390_check_need_initvicons
# BEG S390: check if initviocons needs to be called
# s390_check_need_initviocons
# END S390:

if ! skip_initvicons;then
eval `initviocons -e`
if ! skip_initviocons ; then
eval `/bin/initviocons -e`

#export TERM only, initviocons takes care about
#LINES and COLUMNS automatically (#184179)
Expand Down
8 changes: 4 additions & 4 deletions startup/Second-Stage/S05-config
Expand Up @@ -12,12 +12,12 @@ log "\tNo configuration files needs to be provided..."
#---------------------------------------------
# ---- DISABLED: S390 console check ----
# . /usr/lib/YaST2/startup/arch/s390/console.sh
# BEG S390: check if initvicons needs to be called
# s390_check_need_initvicons
# BEG S390: check if initviocons needs to be called
# s390_check_need_initviocons
# END S390:

if ! skip_initvicons;then
eval `initviocons -e`
if ! skip_initviocons ; then
eval `/bin/initviocons -e`

#export TERM only, initviocons takes care about
#LINES and COLUMNS automatically (#184179)
Expand Down
8 changes: 4 additions & 4 deletions startup/arch/s390/console.sh
@@ -1,14 +1,14 @@
#!/bin/sh

function s390_check_need_initvicons () {
function s390_check_need_initviocons () {
[ -n "$HOSTTYPE" ] || HOSTTYPE=$(arch)
if [ "$HOSTTYPE" = "s390" ];then
export NEED_INITVICONS="no"
export NEED_INITVIOCONS="no"
return
fi
if [ "$HOSTTYPE" = "s390x" ];then
export NEED_INITVICONS="no"
export NEED_INITVIOCONS="no"
return
fi
export NEED_INITVICONS="yes"
export NEED_INITVIOCONS="yes"
}
29 changes: 22 additions & 7 deletions startup/common/language.sh
Expand Up @@ -105,24 +105,39 @@ function start_unicode () {
#--------------------------------------------------
# start unicode mode if LANG is a UTF-8 locale
# ---
if [ -x /bin/unicode_start ];then
if echo $LANG | grep -q '\.UTF-8$'; then
if [ ! -x /bin/unicode_start ] ; then
return
fi

# unicode_starts/stop should only be called on consoles, see bnc #800790
TTY=`/usr/bin/tty`
if [ "$TTY" != "/dev/console" -a "$TTY" == "${TTY#/dev/tty[0-9]}" ] ; then
return
fi

if echo $LANG | grep -q '\.UTF-8$' ; then
log "\tStarting UTF-8 mode..."
unicode_start
fi
fi
}

#----[ stop_unicode ]-----#
function stop_unicode () {
#--------------------------------------------------
# stop unicode mode if LANG is a UTF-8 locale
# ---
if [ -x /bin/unicode_stop ];then
if echo $LANG | grep -q '\.UTF-8$'; then
if [ ! -x /bin/unicode_stop ] ; then
return
fi

# unicode_start/stop should only be called on consoles, see bnc #800790
TTY=`/usr/bin/tty`
if [ "$TTY" != "/dev/console" -a "$TTY" == "${TTY#/dev/tty[0-9]}" ] ; then
return
fi

if echo $LANG | grep -q '\.UTF-8$' ; then
log "\tStopping UTF-8 mode..."
unicode_stop
fi
fi
}

19 changes: 14 additions & 5 deletions startup/common/misc.sh 100755 → 100644
Expand Up @@ -208,12 +208,21 @@ function load_module () {
/sbin/modprobe $1
}

#----[ skip_initvicons ]----#
function skip_initvicons () {
#----[ skip_initviocons ]----#
function skip_initviocons () {
#------------------------------------------------------
# check if the call to initvicons must be skipped
# check if the call to initviocons must be skipped
# ---
# #173426#c17: it is missing on single-CD repos
test -x /bin/initviocons || return 1
# bnc #173426#c17: it is missing on single-CD repos
if [ ! -x /bin/initviocons ] ; then
return 0
fi

# initviocons should only be required on consoles, see bnc #800790
TTY=`/usr/bin/tty`
if [ "$TTY" != "/dev/console" -a "$TTY" == "${TTY#/dev/tty[0-9]}" ] ; then
return 0
fi

grep -qw TERM /proc/cmdline && return 0 || return 1
}

0 comments on commit 25cd09d

Please sign in to comment.