summaryrefslogtreecommitdiffstats
path: root/bootloader/make-kbd-info
diff options
context:
space:
mode:
authorMartin Whitaker <mageia@martin-whitaker.me.uk>2018-04-09 23:18:39 +0100
committerMartin Whitaker <mageia@martin-whitaker.me.uk>2018-04-15 22:06:36 +0100
commite8776cdc56be26520efb4007c319d2356a30055a (patch)
tree0699ce41bd770bff0e04a7769ee79412a2b91600 /bootloader/make-kbd-info
parent043333dda03be66fef493921b7e595557611e58a (diff)
downloaddrakiso-e8776cdc56be26520efb4007c319d2356a30055a.tar
drakiso-e8776cdc56be26520efb4007c319d2356a30055a.tar.gz
drakiso-e8776cdc56be26520efb4007c319d2356a30055a.tar.bz2
drakiso-e8776cdc56be26520efb4007c319d2356a30055a.tar.xz
drakiso-e8776cdc56be26520efb4007c319d2356a30055a.zip
GRUB2 at_keyboard is unreliable on real hardware, so don't use it.
Currently I don't see any way to reliably support different keyboard layouts in GRUB2, so remove all support for that. The keyboard menu is still useful for selecting the keyboard layout when using the minimal ISO example.
Diffstat (limited to 'bootloader/make-kbd-info')
-rwxr-xr-xbootloader/make-kbd-info42
1 files changed, 12 insertions, 30 deletions
diff --git a/bootloader/make-kbd-info b/bootloader/make-kbd-info
index d36fde8..95560b6 100755
--- a/bootloader/make-kbd-info
+++ b/bootloader/make-kbd-info
@@ -19,15 +19,9 @@
# SYNOPSIS
#
# This program gets the list of supported keyboards from libDrakX and
-# generates a grub2 keyboard mapping file for each keyboard in the list.
-# It then generates the keyboard names file and the language to keyboard
-# mapping file that are used when generating the bootloader menus for
-# the Mageia ISOs.
-#
-# The grub2 keyboard mapping files are generated using the grub2-kbdcomp
-# program. The X11 keyboard layout and variant names are obtained from
-# libDrakX. The files (*.gkb) are stored in the 'layouts' subdirectory
-# of the current working directory.
+# generates the keyboard names file and the language to keyboard mapping
+# file that are used when generating the bootloader menus for the Mageia
+# ISOs.
#
# The keyboard names file consists of a list of paired identifier and
# description strings. The identifier is the keyboard identifier used
@@ -44,44 +38,32 @@
#
# The list of supported languages is read from the language names file
# (lang-names.txt) that is used when generating the bootloader menus.
-# This file is expected to be found in the current working directory.
+# This file is expected to be found in the current working directory.
+#
+# NOTE: An older version of this program also generated GRUB2 keyboard
+# layout files for each supported language, but it was found that the
+# GRUB2 at_keyboard driver did not work on all hardware, so this feature
+# was dropped.
use lib qw(/usr/lib/libDrakX);
use strict;
use Cwd qw(getcwd);
-use Data::Dumper;
use MDK::Common;
use common;
use keyboard;
-use run_program;
# Make sure we get the canonical description for the keyboard.
$ENV{LANGUAGE} = 'C';
-# Make sure the 'layouts' subdirectory exists.
-my $kbd_dir = getcwd() . '/layouts';
-mkdir_p($kbd_dir);
-
-# Generate the grub2 keyboard mapping files and collect the keyboard
-# descriptions. For keyboards with multiple layouts, only use the first
-# layout. If we fail to generate a keyboard mapping, don't include that
-# keyboard in the lists.
+# Collect the keyboard descriptions. For keyboards with multiple layouts,
+# only use the first layout.
my %names;
my @keyboards = map { { KEYBOARD => $_ } } keyboard::KEYBOARDs();
foreach (@keyboards) {
my $id = $_->{KEYBOARD};
- my $xkb = keyboard::keyboard2full_xkb($_);
- my @model = split(',', $xkb->{XkbModel});
- my @layout = split(',', $xkb->{XkbLayout});
- my @variant = split(',', $xkb->{XkbVariant});
- my $kbd_file = $kbd_dir . '/' . $id . '.gkb';
- if (-e $kbd_file || run_program::run('grub2-kbdcomp', '-o', $kbd_file, '-model', $model[0], $layout[0], $variant[0])) {
- $names{$id} = translate(keyboard::keyboard2text($_));
- } else {
- rm_rf($kbd_file);
- }
+ $names{$id} = translate(keyboard::keyboard2text($_));
}
# Generate the keyboard names file.