~eugenenuke/ubuntu/wily/console-setup/fix-for-1565542

« back to all changes in this revision

Viewing changes to debian/console-setup.config

  • Committer: Bazaar Package Importer
  • Author(s): Anton Zinoviev, Anton Zinoviev, Samuel Thibault
  • Date: 2011-03-21 07:08:43 UTC
  • mto: This revision was merged to the branch mainline in revision 125.
  • Revision ID: james.westby@ubuntu.com-20110321070843-dyzebcgrrm3dnvfx
Tags: 1.71
[ Anton Zinoviev ]
* FAQ: correct some typos and apply two patches by Jonathan Nieder.
  Thanks also to Vincent Lefevre.  Closes: #565391 (with apologies for
  the delay).
* New manual pages keyboard(5) and console-setup(5).  Updated ckbcomp(1)
  and setupcon(1). Remove README.fonts.  Common documentation directory
  for keyboard-configuration, console-setup-linux,
  console-setup-freebsd, console-setup and console-setup-mini.  New
  README.Debian.  Thanks to Jorgen Grahn, closes: #617580.
* Remove most of the comments in the default configuration files.  It is
  difficult to update these comments when the functionality of
  console-setup changes and the new manual pages make these comments
  less necessary.
* Remove the VERBOSE_OUTPUT option from the default configuration file
  (but it is still supported).
* Install *.bug-control files for reportbug.
* Ask the keyboard option question even when Debconf doesn't support the
  layout.  Thanks to Petr Baudis and Julien Cristau, closes: #581758.
* ckbcomp_mini: process properly empty layout and/or variant options.
  Thanks to Baptiste Carvello who reported the problem and traced its
  source.  Closes: #617499.
* ckbcomp: ignore actions[...] = ... specifications in key definitions.
  Thanks to Klaus Ethgen, closes: #607532.
* setupcon: accept all methods to state font size in the configuration
  file (8x14, 14x8, 14).
* Debconf: More human-friendly options for the font size question.  By
  default use 8x14 format for all sizes.
* setupcon: Improved test whether we are on the console.  Thanks to
  Michael Schutte and Julien Cristau for the suggestions.
* console-setup(-mini).postinst: add again commands to configure the
  console.
* ckbcomp: improved implementation for Alt+PrintScreen=SysRq and
  Ctrl+Pause=Break on AT keyboards.
* ckbcomp: more correct use of approximate().  This probably affects
  only some exotic key combination such as Ctrl+Alt+Shift+AltGr+F1.
* ckbcomp: lets try to remove some unnecessary and potentialy harmful on
  non-standard layouts mappings for Linux (Ctrl+'=^G, Ctrl+3=^[,
  Ctrl+4=^\, Ctrl+5=^], Ctrl+7=^_, Ctrl+8=^?).
* Do not source /etc/default/keyboard in /etc/default/console-setup
  (on new installs or upgrades from pre 1.47 versions).
* setupcon: do not cache automatically the keymap.  Instead add --save
  option the init script.
* Do not remove /etc/console-setup in postrm.
* setupcon, config, postinst: recognise 'guess' value in the
  configuration file.
* postinst: do not fail if setupcon fails.
* Include Terminus font in the compiled packages.  Do not depend, but
  conflict and provide console-terminus.  New upstream version of the
  Terminus font (4.32).
* Keyboard/ckb: update with keyboard data of version 2.1 of xkb files.
  (This change is not relevant for Debian.)
* New install targets in the Makefiles and debian/rules to better
  support non-Debian installs.
* Support for FreeBSD.  Packages for Debian GNU/kFreeBSD:
  - bdf2psf: new option --raw to generate raw fonts.  Try to use CP437
    code positions if possible.  When generating raw fonts with same
    codeset, use identical font map.
  - ckbcomp and setupcon: support for FreeBSD keymaps.
  - ckbcomp: new option -backspace [ del | bs ] to determine the
    behaviour of the keys BackSpace and Delete.
  - setupcon, postinst: A corresponding variable BACKSPACE in
    /etc/default/keyboard.
  - Termcap and Terminfo entries for FreeBSD.
  - setupcon: When UTF-8 is requested on FreeBSD, act as if the encoding
    is ISO-8859-1.
  - Debconf: Don't ask the question about font size on kFreeBSD (no need
    for this -- all available sizes will be loaded).
  - New configuration variable VIDEOMODE.  Currently it is most useful
    on FreeBSD because the default Linux framebuffer driver (VesaFB)
    doesn't permit changes of the videomode.
  - Support for 8-bit encodings in console-setup-mini and in the udebs
  - Udebs for kFreeBSD.

[ Samuel Thibault ]
* Fonts/bdf2psf: Fix typo.

Show diffs side-by-side

added added

removed removed

Lines of Context:
53
53
 
54
54
default_codeset=''
55
55
default_fontface=''
56
 
default_fontsize=''
57
56
CHARMAP=''
58
57
CODESET=''
59
58
FONTFACE=''
64
63
 
65
64
# fontsets='Arabic-Fixed15
66
65
# Arabic-Fixed16
67
 
# Arabic-vga14
 
66
# Arabic-VGA14
68
67
# ... 
69
68
# Vietnamese-Fixed18
70
69
# '
79
78
 
80
79
## CODESETS ##
81
80
 
82
 
codesets='Arabic*. Arabic
 
81
codesets='guess*Guess optimal character set
 
82
Arabic*. Arabic
83
83
Armenian*# Armenian
84
84
CyrKoi*# Cyrillic - KOI8-R and KOI8-U
85
85
CyrAsia*# Cyrillic - non-Slavic languages
102
102
db_capb backup
103
103
 
104
104
available_fontfaces () {
 
105
    local prefix
 
106
    case "$CODESET" in
 
107
        guess) prefix='[^-]*-' ;;
 
108
        *) prefix="$CODESET"- ;;
 
109
    esac
105
110
    echo "$fontsets" | sort | \
106
 
        grep "^$CODESET-" | \
107
 
        sed -e "s/^$CODESET-//" \
 
111
        grep "^$prefix" | \
 
112
        sed -e "s/^$prefix//" \
108
113
            -e 's/[0-9][0-9]*x[0-9][0-9]*$//' \
109
114
            -e 's/[0-9]*$//' | \
 
115
        sort -n | \
110
116
        uniq
111
117
}
112
118
 
113
119
available_fontsizes () {
114
 
    echo "$fontsets" | sort | \
115
 
        grep "^$CODESET-$fontface[0-9]" | \
116
 
        sed -e "s/^$CODESET-$fontface//" | \
117
 
        sort -n | \
118
 
        uniq
 
120
    local prefix
 
121
    case "$CODESET" in
 
122
        guess) prefix='[^-]*-' ;;
 
123
        *) prefix="$CODESET"- ;;
 
124
    esac
 
125
    case "$fontface" in
 
126
        guess) prefix="$prefix[^0-9]*" ;;
 
127
        *) prefix="$prefix$fontface" ;; # this includes fontface=''
 
128
    esac
 
129
    echo "$fontsets" \
 
130
        | grep "^$prefix[0-9]" \
 
131
        | sed -e "s/^$prefix//" \
 
132
        | sort -n | uniq \
 
133
        | while read x; do
 
134
              decode_fontsize "$x"
 
135
          done \
 
136
}
 
137
 
 
138
db_metaget console-setup/framebuffer_only description
 
139
framebuffer_only="$RET"
 
140
decode_fontsize () {
 
141
    local a b fbonly
 
142
    case "$1" in
 
143
        8x*)
 
144
            echo 8x${1#*x}
 
145
            ;;
 
146
        *x8)
 
147
            echo 8x${1%x*}
 
148
            ;;
 
149
        *x*)
 
150
            a=${1#*x}
 
151
            b=${1%x*}
 
152
            if [ "$a" -lt "$b" ]; then
 
153
                echo ${a}x${b} "($framebuffer_only)"
 
154
            else
 
155
                echo ${b}x${a} "($framebuffer_only)"
 
156
            fi
 
157
            ;;
 
158
        *)
 
159
            echo 8x$1
 
160
            ;;
 
161
    esac
 
162
}
 
163
 
 
164
encode_fontsize () {
 
165
    echo $1 | sed -e 's/[\, ;].*//'
119
166
}
120
167
 
121
168
decode_codeset () {
130
177
        sed 's/[*].*//'
131
178
}
132
179
 
 
180
kernel=unknown
 
181
if which uname >/dev/null; then
 
182
    case "`uname`" in
 
183
        *Linux*) kernel=linux ;;
 
184
        *FreeBSD*) kernel=freebsd ;;
 
185
    esac
 
186
fi
 
187
 
133
188
if type locale 2>/dev/null >/dev/null; then
134
189
    eval `locale`
135
190
fi
142
197
    locale=C
143
198
fi
144
199
 
145
 
if [ -d /lib/debian-installer ]; then
146
 
    CHARMAP=UTF-8
147
 
elif [ "$locale" = C ]; then
148
 
    CHARMAP=UTF-8
 
200
if [ "$locale" = C ]; then
 
201
    CHARMAP=ISO-8859-15
149
202
    charmap_priority=high
150
203
elif type locale 2>/dev/null >/dev/null; then
151
204
    CHARMAP=`locale charmap`
565
618
        codeset_priority=low
566
619
        ;;
567
620
    *)
568
 
        CODESET=Uni2
569
 
        codeset_priority=high
 
621
        CODESET=guess
 
622
        if [ "$CHARMAP" = UTF-8 ]; then
 
623
            codeset_priority=high
 
624
        else
 
625
            # for 8-bit encodings we can guess good codeset
 
626
            codeset_priority=low
 
627
        fi
570
628
        ;;
571
629
esac
572
630
if [ "$CODESET" = unsupported ]; then
573
 
    CODESET=Uni2
 
631
    CODESET=guess
574
632
fi
575
633
 
576
634
case "$CODESET" in
651
709
    default_codeset="$(decode_codeset "$CODESET")"
652
710
fi
653
711
 
654
 
if [ "$FONTFACE" ]; then
 
712
if [ "$FONTFACE" = guess ]; then
 
713
    db_metaget console-setup/guess_font description
 
714
    default_fontface="$RET"
 
715
elif [ "$FONTFACE" ]; then
655
716
    default_fontface="$FONTFACE"
656
717
else
657
718
    db_metaget console-setup/use_system_font description
658
719
    default_fontface="$RET"
659
720
fi
660
721
 
661
 
if [ "$FONTSIZE" ]; then
662
 
    default_fontsize="$FONTSIZE"
663
 
else
664
 
    # if $FONTSIZE='' this will be replaced by '' in the postinst
665
 
    default_fontsize=16 
 
722
if [ "$FONTSIZE" = guess -a "$FONTFACE" != guess ]; then
 
723
    # this combination is currently unsupported
 
724
    FONTSIZE=16
 
725
fi
 
726
if [ "$FONTFACE" ]; then
 
727
    FONTSIZE=${FONTSIZE:-16}
666
728
fi
667
729
 
668
730
# Store the default values into debconf db.  Workaround #352697.
671
733
    db_set console-setup/charmap47 "$CHARMAP"
672
734
    db_set console-setup/codeset47 "$default_codeset"
673
735
    db_set console-setup/fontface47 "$default_fontface"
674
 
    db_set console-setup/fontsize-text47 "$default_fontsize"
675
 
    db_set console-setup/fontsize-fb47 "$default_fontsize"
676
 
    db_set console-setup/fontsize "$default_fontsize"
 
736
    fontsizetext="`decode_fontsize $FONTSIZE`"
 
737
    db_set console-setup/fontsize-text47 "$fontsizetext"
 
738
    db_set console-setup/fontsize-fb47 "$fontsizetext"
 
739
    db_set console-setup/fontsize "$fontsizetext"
677
740
 
678
741
    db_set console-setup/store_defaults_in_debconf_db false
679
742
fi
686
749
    starting_state=$STATE
687
750
    case "$STATE" in
688
751
        1)
689
 
            if
690
 
                [ -d /lib/debian-installer ] \
691
 
                    && db_get debian-installer/charmap \
692
 
                    && [ "$RET" ]
693
 
            then
694
 
                db_set console-setup/charmap47 "$CHARMAP"
695
 
                # skip the questions without making Debconf loop
696
 
                STATE=$(( $STATE + $STATE - $old_state ))
 
752
            # add commas
 
753
            choices=`echo "$charmaps" | sed -e 's/$/,/g' | sort `
 
754
            # remove newlines
 
755
            choices=`echo $choices | sed -e 's/,$//' `
 
756
            db_subst console-setup/charmap47 CHOICES "$choices"
 
757
            db_input $charmap_priority console-setup/charmap47 || true
 
758
            if db_go; then
 
759
                STATE=$(($STATE + 1))
697
760
            else
698
 
                # add commas
699
 
                choices=`echo "$charmaps" | sed -e 's/$/,/g' | sort `
700
 
                # remove newlines
701
 
                choices=`echo $choices | sed -e 's/,$//' `
702
 
                db_subst console-setup/charmap47 CHOICES "$choices"
703
 
                db_input $charmap_priority console-setup/charmap47 || true
704
 
                if db_go; then
705
 
                    STATE=$(($STATE + 1))
706
 
                else
707
 
                    STATE=$(($STATE - 1))
708
 
                fi
 
761
                STATE=$(($STATE - 1))
709
762
            fi
710
763
            ;;
711
764
        2)
727
780
            choices=`echo $choices | sed -e 's/,$//'`
728
781
            db_metaget console-setup/use_system_font description
729
782
            choices="$choices, $RET"
 
783
            db_metaget console-setup/guess_font description
 
784
            choices="$choices, $RET"
730
785
            db_subst console-setup/fontface47 CHOICES "$choices"
731
786
            db_input medium console-setup/fontface47 || true
732
787
            if db_go; then
740
795
            if [ "$fontface" = "$RET" ]; then
741
796
                fontface=''
742
797
            fi
 
798
            db_metaget console-setup/guess_font description
 
799
            if [ "$fontface" = "$RET" ]; then
 
800
                fontface=guess
 
801
            fi
743
802
            ;;
744
803
        4)
745
 
            fontsizes=`available_fontsizes`
746
 
            # add commas
747
 
            choices=`echo "$fontsizes" | sed -e 's/$/,/g' `
748
 
            # remove newlines
749
 
            choices=`echo $choices | sed -e 's/,$//'`
750
 
            if [ "$choices" ]; then
751
 
                if echo "$choices" | grep -q x; then
752
 
                    size_template=console-setup/fontsize-fb47
753
 
                else
754
 
                    size_template=console-setup/fontsize-text47
755
 
                fi
756
 
                db_subst $size_template CHOICES "$choices"
757
 
                db_input medium $size_template || true
758
 
                if db_go; then
759
 
                    STATE=$(($STATE + 1))
760
 
                else
761
 
                    STATE=$(($STATE - 1))
762
 
                fi
763
 
                db_get $size_template
764
 
                fontsize=$RET
765
 
                db_set console-setup/fontsize "$fontsize"
766
 
            else
767
 
                db_set console-setup/fontsize ''
 
804
            if [ "$kernel" = freebsd ]; then
 
805
                db_set console-setup/fontsize "$FONTSIZE"
 
806
                # skip the question without making Debconf loop
768
807
                STATE=$(( $STATE + $STATE - $old_state ))
 
808
            else
 
809
                fontsizes=`available_fontsizes`
 
810
                # add commas
 
811
                choices=`echo "$fontsizes" | sed -e 's/$/,/g' `
 
812
                # remove newlines and the last comma
 
813
                choices=`echo $choices | sed -e 's/,$//'`
 
814
                if [ -n "$choices" -a "$FONTSIZE" != guess ]; then
 
815
                    if echo "$choices" | grep -q x; then
 
816
                        size_template=console-setup/fontsize-fb47
 
817
                    else
 
818
                        size_template=console-setup/fontsize-text47
 
819
                    fi
 
820
                    db_subst $size_template CHOICES "$choices"
 
821
                    db_input medium $size_template || true
 
822
                    if db_go; then
 
823
                        STATE=$(($STATE + 1))
 
824
                    else
 
825
                        STATE=$(($STATE - 1))
 
826
                    fi
 
827
                    db_get $size_template
 
828
                    FONTSIZE=`encode_fontsize "$RET"`
 
829
                else
 
830
                    FONTSIZE=${choices:+guess}
 
831
                    STATE=$(( $STATE + $STATE - $old_state ))
 
832
                fi
 
833
                db_set console-setup/fontsize "$FONTSIZE"
769
834
            fi
770
835
            ;;
771
836
        *)