summaryrefslogtreecommitdiffstats
path: root/perl-install
diff options
context:
space:
mode:
Diffstat (limited to 'perl-install')
-rw-r--r--perl-install/install_steps.pm2
-rw-r--r--perl-install/keyboard.pm13
-rwxr-xr-xperl-install/standalone/keyboarddrake2
3 files changed, 15 insertions, 2 deletions
diff --git a/perl-install/install_steps.pm b/perl-install/install_steps.pm
index 9972dfc2e..f2237a9cb 100644
--- a/perl-install/install_steps.pm
+++ b/perl-install/install_steps.pm
@@ -119,7 +119,7 @@ sub selectLanguage {
$o->{keyboard} = { KEYBOARD => $o->{keyboard} } if $o->{keyboard} && !ref($o->{keyboard});
if (!$o->{keyboard} || $o->{keyboard}{unsafe}) {
- $o->{keyboard} = keyboard::from_usb() || keyboard::lang2keyboard($o->{locale}{lang});
+ $o->{keyboard} = keyboard::default($o->{locale});
$o->{keyboard}{unsafe} = 1;
keyboard::setup($o->{keyboard});
}
diff --git a/perl-install/keyboard.pm b/perl-install/keyboard.pm
index 5332a62fa..ee95f8e8c 100644
--- a/perl-install/keyboard.pm
+++ b/perl-install/keyboard.pm
@@ -456,6 +456,14 @@ sub lang2keyboard {
{ KEYBOARD => $keyboards{$kb} ? $kb : 'us' }; #- handle incorrect keyboard mapping to us.
}
+sub default {
+ my ($o_locale) = @_;
+
+ my $keyboard = from_usb() || lang2keyboard(($o_locale || lang::read())->{lang});
+ add2hash($keyboard, from_DMI());
+ $keyboard;
+}
+
sub from_usb() {
return if $::noauto;
my ($usb_kbd) = detect_devices::usbKeyboards() or return;
@@ -464,6 +472,11 @@ sub from_usb() {
$keyboard !~ /SKIP/ && { KEYBOARD => $keyboard };
}
+sub from_DMI() {
+ my $XkbModel = detect_devices::probe_unique_name('XkbModel');
+ $XkbModel && { XkbModel => $XkbModel };
+}
+
sub load {
my ($keymap) = @_;
return if $::testing;
diff --git a/perl-install/standalone/keyboarddrake b/perl-install/standalone/keyboarddrake
index 5a42cef56..d4bde7e10 100755
--- a/perl-install/standalone/keyboarddrake
+++ b/perl-install/standalone/keyboarddrake
@@ -13,7 +13,7 @@ use c;
require_root_capability();
my $in;
-my $keyboard = keyboard::read();
+my $keyboard = keyboard::read() || keyboard::default();
if (my ($kb) = grep { !/^-/ } @ARGV) {
keyboard::KEYBOARD2text($kb) or die "bad keyboard $kb\n";
$keyboard->{KEYBOARD} = $kb;