~ubuntu-branches/ubuntu/wily/console-setup/wily

« back to all changes in this revision

Viewing changes to debian/console-setup.config

  • Committer: Package Import Robot
  • Author(s): Mathieu Trudel-Lapierre, Steve Langasek, Mathieu Trudel-Lapierre
  • Date: 2015-02-27 16:36:52 UTC
  • mfrom: (3.2.59 sid)
  • Revision ID: package-import@ubuntu.com-20150227163652-9sxmh6sbwqseysa0
Tags: 1.108ubuntu1
[ Steve Langasek ]
* Merge from Debian unstable, remaining changes: (LP: #1426721)
  - Don't gzip font or ACM files in /etc/console-setup/.  The space saving
    is negligible, and it's more efficient not to need to uncompress them
    at boot time.
  - Include pc105.tree for ubiquity.
  - Move boot tasks to a combination of two udev rules and a single
    Upstart job, ensuring that they're run at points when we are able to
    satisfy the constraints on the relevant ioctls.
  - Stop running debconf-updatepo on clean.
  - Set keymap and font in the initramfs if possible and sensible.
  - Add an apport hook.
  - Use keymapper to generate decision trees for a restricted subset of
    the pc105 model.
  - Depend on kbd (>= 1.15-1ubuntu3) for a valuable loadkeys improvement.
  - Include support for translated keyboard names.
  - Depend on debconf instead of pre-depending, because pre-depends have
    no effect on config scripts.
  - debian/vtrgb, debian/vtrgb.vga,
    debian/console-setup-linux.setvtrgb.upstart, debian/rules,
    debian/console-setup-linux.postinst: use Ubuntu's virtual terminal color
    scheme by default, with a VGA color scheme available as an alternative.
  - Make setupcon explicitly exit 0, so that postinsts don't fail in the
    event that loadkeys can't find a console.
  - Update for new layouts and variants for Montenegro and Serbia, and
    migrate configuration files from the old layouts.
  - Generate a locale locally for translating keyboard names in
    kbdnames-maker.
  - Don't copy keyboard-configuration questions to /target in OEM mode.
    oem-config will ask them later, and copying these confuses it.
  - Change the default font from Fixed to VGA for Lat15; while it's not
    entirely complete, it looks better and is largely good enough.
  - If the detect-keyboard debconf plugin is available
    (cdebconf-newt-detect-keys in the installer), then offer to use it to
    detect the keyboard layout.
  - Fix default keyboard selection for language/country combinations
    lacking a proper combined locale.
  - Drop the layout/variant priority to high on fresh installs.
  - Set default for Dutch to us(intl), not just us.
  - Set default layout for Vietnam to 'us'.
  - Set default variant for French to oss.
  - Set default layout for Simplified Chinese to 'cn'.
  - Don't use the default keyboard variant if the layout is overridden by
    preseeding.
  - If keyboard-configuration/layoutcode is preseeded but not marked as
    seen, then set the default layout but don't lower the layout question
    priority or preseed console-setup/ask_detect.
  - Use the default keyboard model if an existing configuration file sets
    XKBMODEL="".
  - Go back to always asking layout before variant.
  - Fix keyboard layout detection to set the layout properly.
  - Reset keyboard-configuration/toggle to the default if it's set to "No
    toggling" and you select a non-Latin layout.
  - Automatically save the font and keymap to /etc in
    /etc/init.d/console-setup if it isn't being run from init. Similarly,
    ensure that the font and keymap are saved to /etc during initial
    installation.
  - Replace usplash detection code with Plymouth detection code.
  - Load the new keyboard configuration immediately when running
    'dpkg-reconfigure keyboard-configuration' in an installed system.
  - Don't fail to configure keyboard-configuration if setxkbmap fails to
    talk to the X display.
  - Tolerate absence of setupcon in keyboard-configuration.postinst.
  - Drop the simplified keyboard-configuration/xkb-keymap question.
  - Fix command injection in ckbcomp.
  - debian/console-setup.console-font.upstart: Add Upstart job that sets up
    console font when plymouth-splash is starting.
  - Override description of the ch layout from "German (Switzerland)" to
    just "Switzerland".
  - Map ppc64el/* to XKBMODEL=pc105.
* Dropped changes, included in Debian:
  - "Do not configure keyboard; keep kernel keymap" model option,
    preseedable by keyboard-configuration/modelcode=SKIP: this is now
    supported upstream with either "unknown" or an empty string as the
    model.
  - Run kbd_mode on each tty in ACTIVE_CONSOLES rather than on the current
    tty, since the current tty might belong to X and changing X's tty out
    of raw mode is a very bad idea.
  - Include Terminus font in the compiled packages.  Do not depend, but
    conflict/provide/replace console-terminus.  New upstream version of
    the Terminus font (4.32).
  - Explicitly build-depend on liblocale-gettext-perl for kbdnames-maker,
    and likewise have keyboard-configuration depend on
    liblocale-gettext-perl.
  - Weaken test for whether /usr is mounted; testing for /usr/share is
    sufficient, and fixes operation in d-i.
  - Make keyboard-configuration replace old console-setup/console-setup-mini
    versions as well as conflicting with them.
  - Set default layout for Kurdish to tr(ku).
* Dropped changes, no longer needed:
  - Cope with systems installed with console-setup-udeb (<< 1.53) (which
    predates Ubuntu 12.04 and Debian wheezy).
  - Drop ancient handling of an empty codeset in the config file.
  - Drop vtrgb upgrade handling from natty
  - Drop upstart job transition from lucid
* setupcon: Map XKBMODEL=SKIP to '' for compatibility with existing
  configs.
* debian/rules: revert hard-coding of a list of "debconf-selectable"
  layouts for the udebs, since we don't use this debconf question in Ubuntu
  and all layouts are selectable.
* setupcon: revert ridiculous upstream twiddling of keymap cache filenames:
  - the variables are taken from a config file which, if changed,
    invalidates the cache.
  - there is only ever one keyboard map per system.
  - the system should not have to resolve filenames to find the keymap cache
    on boot.
* Move vtrgb handling to console-setup-linux package, since this is clearly
  Linux-specific.
* Add missing console-setup-linux.prerm to remove /etc/vtrgb alternatives
* Keyboard/kbdcompiler: fix bug in filtering of unsupported variants that
  breaks generation of the pc105.tree for d-i keyboard detection.
* debian/keyboard-configuration.postinst: udpkg is not part of an installed
  Debian system; don't fail to configure if it's absent and the script is
  called outside of an installer context.
* Don't make debian/copyright a symlink to COPYRIGHT, this is disallowed
  by the Ubuntu archive installer.

[ Mathieu Trudel-Lapierre ]
* debian/keyboard-configuration.config: fix typo in model check for SKIP;
  even when looking up the layout/variant, we need to check for the model
  as XKBMODEL, since $model doesn't exist.
* debian/preprocessor: revert the removal of keyboard names (for size) of
  console-setup-udeb: we do need those, since we don't use the simplified
  xkb-keymap template from Debian just yet: this way we can still show
  country/language names when selecting a keyboard, layout or variant.

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
649
707
 
650
708
if [ "$CODESET" ]; then
651
709
    default_codeset="$(decode_codeset "$CODESET")"
652
 
    if [ -z "$default_codeset" ]; then
653
 
        default_codeset=Uni1
654
 
        codeset_priority=high
655
 
    fi
656
710
fi
657
711
 
658
 
if [ "$FONTFACE" ]; then
 
712
if [ "$FONTFACE" = guess ]; then
 
713
    db_metaget console-setup/guess_font description
 
714
    default_fontface="$RET"
 
715
elif [ "$FONTFACE" ]; then
659
716
    default_fontface="$FONTFACE"
660
717
else
661
718
    db_metaget console-setup/use_system_font description
662
719
    default_fontface="$RET"
663
720
fi
664
721
 
665
 
if [ "$FONTSIZE" ]; then
666
 
    default_fontsize="$FONTSIZE"
667
 
else
668
 
    # if $FONTSIZE='' this will be replaced by '' in the postinst
669
 
    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}
670
728
fi
671
729
 
672
730
# Store the default values into debconf db.  Workaround #352697.
675
733
    db_set console-setup/charmap47 "$CHARMAP"
676
734
    db_set console-setup/codeset47 "$default_codeset"
677
735
    db_set console-setup/fontface47 "$default_fontface"
678
 
    db_set console-setup/fontsize-text47 "$default_fontsize"
679
 
    db_set console-setup/fontsize-fb47 "$default_fontsize"
680
 
    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"
681
740
 
682
741
    db_set console-setup/store_defaults_in_debconf_db false
683
742
fi
690
749
    starting_state=$STATE
691
750
    case "$STATE" in
692
751
        1)
693
 
            if
694
 
                [ -d /lib/debian-installer ] \
695
 
                    && db_get debian-installer/charmap \
696
 
                    && [ "$RET" ]
697
 
            then
698
 
                db_set console-setup/charmap47 "$CHARMAP"
699
 
                # skip the questions without making Debconf loop
700
 
                STATE=$(( $STATE + $STATE - $old_state ))
 
752
            # add commas
 
753
            choices=`echo "$charmaps" | sed -e 's/$/,/g' | LC_ALL=C 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))
701
760
            else
702
 
                # add commas
703
 
                choices=`echo "$charmaps" | sed -e 's/$/,/g' | LC_ALL=C sort `
704
 
                # remove newlines
705
 
                choices=`echo $choices | sed -e 's/,$//' `
706
 
                db_subst console-setup/charmap47 CHOICES "$choices"
707
 
                db_input $charmap_priority console-setup/charmap47 || true
708
 
                if db_go; then
709
 
                    STATE=$(($STATE + 1))
710
 
                else
711
 
                    STATE=$(($STATE - 1))
712
 
                fi
 
761
                STATE=$(($STATE - 1))
713
762
            fi
714
763
            ;;
715
764
        2)
731
780
            choices=`echo $choices | sed -e 's/,$//'`
732
781
            db_metaget console-setup/use_system_font description
733
782
            choices="$choices, $RET"
 
783
            db_metaget console-setup/guess_font description
 
784
            choices="$choices, $RET"
734
785
            db_subst console-setup/fontface47 CHOICES "$choices"
735
786
            db_input medium console-setup/fontface47 || true
736
787
            if db_go; then
744
795
            if [ "$fontface" = "$RET" ]; then
745
796
                fontface=''
746
797
            fi
 
798
            db_metaget console-setup/guess_font description
 
799
            if [ "$fontface" = "$RET" ]; then
 
800
                fontface=guess
 
801
            fi
747
802
            ;;
748
803
        4)
749
 
            fontsizes=`available_fontsizes`
750
 
            # add commas
751
 
            choices=`echo "$fontsizes" | sed -e 's/$/,/g' `
752
 
            # remove newlines
753
 
            choices=`echo $choices | sed -e 's/,$//'`
754
 
            if [ "$choices" ]; then
755
 
                if echo "$choices" | grep -q x; then
756
 
                    size_template=console-setup/fontsize-fb47
757
 
                else
758
 
                    size_template=console-setup/fontsize-text47
759
 
                fi
760
 
                db_subst $size_template CHOICES "$choices"
761
 
                db_input medium $size_template || true
762
 
                if db_go; then
763
 
                    STATE=$(($STATE + 1))
764
 
                else
765
 
                    STATE=$(($STATE - 1))
766
 
                fi
767
 
                db_get $size_template
768
 
                fontsize=$RET
769
 
                db_set console-setup/fontsize "$fontsize"
770
 
            else
771
 
                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
772
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"
773
834
            fi
774
835
            ;;
775
836
        *)