summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorPascal Rigaux <pixel@mandriva.com>1999-12-02 12:47:17 +0000
committerPascal Rigaux <pixel@mandriva.com>1999-12-02 12:47:17 +0000
commit8212f09c04859180c0e67588f0ab5912b3c08a86 (patch)
tree24f36eccb18068cdb01626fd83010f692e1b0531
parentfb1408984a4460dcb8c66a9ba4d2e51d2b97303f (diff)
downloaddrakx-8212f09c04859180c0e67588f0ab5912b3c08a86.tar
drakx-8212f09c04859180c0e67588f0ab5912b3c08a86.tar.gz
drakx-8212f09c04859180c0e67588f0ab5912b3c08a86.tar.bz2
drakx-8212f09c04859180c0e67588f0ab5912b3c08a86.tar.xz
drakx-8212f09c04859180c0e67588f0ab5912b3c08a86.zip
no_comment
-rw-r--r--docs/TODO2
-rwxr-xr-xmake_boot_img6
-rw-r--r--perl-install/Makefile2
-rw-r--r--perl-install/Makefile.drakxtools2
-rw-r--r--perl-install/help.pm10
-rw-r--r--perl-install/install_steps.pm2
-rw-r--r--perl-install/install_steps_gtk.pm8
-rw-r--r--perl-install/install_steps_interactive.pm2
-rw-r--r--perl-install/interactive.pm1
-rw-r--r--perl-install/keyboard.pm20
-rwxr-xr-xperl-install/standalone/keyboarddrake45
-rwxr-xr-xperl-install/standalone/mousedrake4
12 files changed, 70 insertions, 34 deletions
diff --git a/docs/TODO b/docs/TODO
index a7b031ff7..4ba65c77e 100644
--- a/docs/TODO
+++ b/docs/TODO
@@ -22,7 +22,7 @@ i18n
ability to add nfs/weird_fs entries in fstab
-standalone applications for configuration (netdrake)
+standalone applications for configuration (netdrake, authentificationconf, systemservices, soundcard)
is configureNetworkNet needed with dhcp/bootp?
diff --git a/make_boot_img b/make_boot_img
index 8ec17c7f1..87413b8e9 100755
--- a/make_boot_img
+++ b/make_boot_img
@@ -85,7 +85,11 @@ sub msg_boot_img {
my ($mnt, $img) = @_;
__ "$sudo umount $mnt 2>/dev/null";
- _ "bunzip2 -c $instdir/installinit/msgboot.img.bz2 > $img";
+ if ($type eq "hd") {
+ _ "bunzip2 -c $instdir/installinit/msgboot.img.bz2 > $img";
+ } else {
+ _ "bunzip2 -c $instdir/installinit/msgboot-graphicallogo.img.bz2 > $img";
+ }
_ "$sudo mount -t msdos -o umask=0 $img $mnt -o loop";
_ "cat vmlinuz > $mnt/vmlinuz";
initrd("${mnt}2", "$mnt/$type.rdz");
diff --git a/perl-install/Makefile b/perl-install/Makefile
index 5c75921e3..93734f614 100644
--- a/perl-install/Makefile
+++ b/perl-install/Makefile
@@ -33,7 +33,7 @@ tar-drakxtools: clean
$(MAKE) -C ../tools clean
cd .. ; rm -rf drakxtools ; cp -af perl-install drakxtools ; cp -af tools/ddcprobe drakxtools
cd ../drakxtools ; rm -rf install* ForMakefile.pm pkgs.pm ftp.pm t.pm standalone/CVS ; mv Makefile.drakxtools Makefile ; mv -f standalone/* .
- cd .. ; tar cfy drakxtools.tar.bz2 --exclude CVS $(patsubst %,drakxtools/%,Makefile MonitorsDB Newt c ddcprobe po pci_probing resize_fat diskdrake diskdrake.rc XFdrake mousedrake lspcidrake printerdrake *.pm)
+ cd .. ; tar cfy drakxtools.tar.bz2 --exclude CVS $(patsubst %,drakxtools/%,Makefile MonitorsDB Newt c ddcprobe po pci_probing resize_fat diskdrake diskdrake.rc XFdrake mousedrake lspcidrake printerdrake keyboarddrake *.pm)
cd .. ; rm -rf drakxtools
$(DIRS):
diff --git a/perl-install/Makefile.drakxtools b/perl-install/Makefile.drakxtools
index 5aa8f99c1..f53577618 100644
--- a/perl-install/Makefile.drakxtools
+++ b/perl-install/Makefile.drakxtools
@@ -16,7 +16,7 @@ $(DIRS):
install:
install -d $(BINDEST) $(ETCDEST) $(SBINDEST) $(LIBDEST) $(X11DEST) $(DIRS:%=$(LIBDEST)/%)
- install diskdrake XFdrake mousedrake lspcidrake printerdrake $(SBINDEST)
+ install diskdrake XFdrake mousedrake lspcidrake printerdrake keyboarddrake $(SBINDEST)
install -s ddcprobe/ddcxinfos $(SBINDEST)
for i in *.pm ; do perl -pe '$$_ = "\n" if /\s*use\s+(diagnostics|vars|strict)/' $$i > $(LIBDEST)/$$i ; done
diff --git a/perl-install/help.pm b/perl-install/help.pm
index b37b41ff3..9de77c2ee 100644
--- a/perl-install/help.pm
+++ b/perl-install/help.pm
@@ -4,16 +4,6 @@ use common qw(:common);
%steps = (
selectLanguage =>
-# __("
-# Quelques sites de recherche :
-# Quelques sites de recherche :
-# Quelques sites de recherche :
-# Quelques sites de recherche :
-# Quelques sites de recherche :
-# Quelques sites de recherche :
-# Quelques sites de recherche :
-#
-#"),
__("Choose preferred language for install and system usage."),
selectKeyboard =>
diff --git a/perl-install/install_steps.pm b/perl-install/install_steps.pm
index 669683cb6..4de59ed3a 100644
--- a/perl-install/install_steps.pm
+++ b/perl-install/install_steps.pm
@@ -503,7 +503,7 @@ sub setupBootloaderBefore {
$o->{bootloader}{perImageAppend} = "mem=$o->{miscellaneous}{memsize}" if $o->{miscellaneous}{memsize};
require lilo;
lilo::suggest($o->{prefix}, $o->{bootloader}, $o->{hds}, $o->{fstab}, install_any::kernelVersion());
- $o->{bootloader}{keytable} ||= keyboard::kmap($o->{keyboard});
+ $o->{bootloader}{keytable} ||= keyboard::keyboard2kmap($o->{keyboard});
}
sub setupBootloader($) {
diff --git a/perl-install/install_steps_gtk.pm b/perl-install/install_steps_gtk.pm
index 53f95c72c..51ea451b6 100644
--- a/perl-install/install_steps_gtk.pm
+++ b/perl-install/install_steps_gtk.pm
@@ -640,10 +640,10 @@ sub create_help_window {
gtkadd($w->{window},
gtkpack_(new Gtk::HBox(0,-2),
#- 0, $b,
- 1, createScrolledWindow($w_help = new Gtk::XmHTML)));
-#- 1, createScrolledWindow($w_help = new Gtk::Text)));
- $w_help->source($o->{step} ? translate($o->{steps}{$o->{step}}{help}) : '');
-#- gtktext_insert($w_help, $o->{step} ? formatAlaTeX(translate($o->{steps}{$o->{step}}{help})) : '');
+#- 1, createScrolledWindow($w_help = new Gtk::XmHTML)));
+ 1, createScrolledWindow($w_help = new Gtk::Text)));
+#- $w_help->source($o->{step} ? translate($o->{steps}{$o->{step}}{help}) : '');
+ gtktext_insert($w_help, $o->{step} ? formatAlaTeX(translate($o->{steps}{$o->{step}}{help})) : '');
$w->show;
$o->{help_window} = $w;
diff --git a/perl-install/install_steps_interactive.pm b/perl-install/install_steps_interactive.pm
index 02d9349a1..b0ebd1216 100644
--- a/perl-install/install_steps_interactive.pm
+++ b/perl-install/install_steps_interactive.pm
@@ -64,7 +64,7 @@ sub selectLanguage($) {
sub selectKeyboard($) {
my ($o) = @_;
$o->{keyboard} =
- keyboard::text2keyboard($o->ask_from_list_("Keyboard",
+ keyboard::text2keyboard($o->ask_from_list_(_("Keyboard"),
_("What is your keyboard layout?"),
[ keyboard::list() ],
keyboard::keyboard2text($o->{keyboard})));
diff --git a/perl-install/interactive.pm b/perl-install/interactive.pm
index dd92bd004..6686f2999 100644
--- a/perl-install/interactive.pm
+++ b/perl-install/interactive.pm
@@ -39,6 +39,7 @@ sub new($) {
}
sub vnew {
+ require c;
if (c::Xtest($ENV{DISPLAY} ||= ":0")) {
require interactive_gtk;
interactive_gtk->new;
diff --git a/perl-install/keyboard.pm b/perl-install/keyboard.pm
index 93e025811..c6d514553 100644
--- a/perl-install/keyboard.pm
+++ b/perl-install/keyboard.pm
@@ -46,7 +46,7 @@ my %keyboards = (
"gr" => [ __("Greek"), "gr-8859_7", "gr" ],
"hu" => [ __("Hungarian"), "hu-latin2", "hu" ],
"il" => [ __("Israeli"), "il-8859_8", "il" ],
- "il" => [ __("Israeli (Phonetic)"),"hebrew", "il_phonetic" ],
+ "il_phonetic" => [ __("Israeli (Phonetic)"),"hebrew", "il_phonetic" ],
"is" => [ __("Icelandic"), "is-latin1", "is" ],
"it" => [ __("Italian"), "it-latin1", "it" ],
"la" => [ __("Latin American"), "la-latin1", "la" ],
@@ -59,7 +59,7 @@ my %keyboards = (
"pt" => [ __("Portuguese"), "pt-latin1", "pt" ],
"qc" => [ __("Canadian (Quebec)"), "qc-latin1","ca_enhanced" ],
"ru" => [ __("Russian"), "ru4", "ru" ],
- "ru" => [ __("Russian (Yawerty)"),"ru-yawerty","ru_yawerty" ],
+ "ru_yawerty" => [ __("Russian (Yawerty)"),"ru-yawerty","ru_yawerty" ],
"se" => [ __("Swedish"), "se-latin1", "se_SE" ],
"si" => [ __("Slovenian"), "slovene", "si" ],
"sk" => [ __("Slovakian"), "sk-qwertz", "czsk" ],
@@ -79,7 +79,8 @@ my %keyboards = (
sub list { map { $_->[0] } values %keyboards }
sub xmodmaps { keys %keyboards }
sub keyboard2text { $keyboards{$_[0]} && $keyboards{$_[0]}[0] }
-sub keyboard2xkb { $keyboards{$_[0]} && $keyboards{$_[0]}[2] }
+sub keyboard2kmap { $keyboards{$_[0]} && $keyboards{$_[0]}[1] }
+sub keyboard2xkb { $keyboards{$_[0]} && $keyboards{$_[0]}[2] }
sub text2keyboard {
my ($t) = @_;
while (my ($k, $v) = each %keyboards) {
@@ -88,10 +89,6 @@ sub text2keyboard {
die "unknown keyboard $t";
}
-sub kmap($) {
- my ($keyboard) = @_;
- ($keyboards{$keyboard} || [])->[1];
-}
sub lang2keyboard($) {
local ($_) = @_;
@@ -140,11 +137,10 @@ sub setup($) {
}
}
-sub write($$) {
- my ($prefix, $keyboard) = @_;
-
- setVarsInSh("$prefix/etc/sysconfig/keyboard", { KEYTABLE => kmap($keyboard), BACKSPACE => "Delete" });
+sub write($$;$) {
+ my ($prefix, $keyboard, $isNotDelete) = @_;
+ setVarsInSh("$prefix/etc/sysconfig/keyboard", { KEYTABLE => keyboard2kmap($keyboard), $isNotDelete ? () : (BACKSPACE => "Delete") });
run_program::rooted($prefix, "dumpkeys > /etc/sysconfig/console/default.kmap") or die "dumpkeys failed";
}
@@ -152,7 +148,7 @@ sub read($) {
my ($prefix) = @_;
my %keyf = getVarsFromSh("$prefix/etc/sysconfig/keyboard");
- map { kmap($_) eq $keyf{KEYTABLE} ? $_ : (); } keys %keyboards;
+ map { keyboard2kmap($_) eq $keyf{KEYTABLE} ? $_ : (); } keys %keyboards;
}
#-######################################################################################
diff --git a/perl-install/standalone/keyboarddrake b/perl-install/standalone/keyboarddrake
new file mode 100755
index 000000000..9bb77e6bb
--- /dev/null
+++ b/perl-install/standalone/keyboarddrake
@@ -0,0 +1,45 @@
+#!/usr/bin/perl
+
+use lib qw(/usr/lib/libDrakX);
+
+
+use interactive;
+use keyboard;
+use Xconfigurator_consts;
+use common qw(:system);
+
+local $_ = join '', @ARGV;
+
+/-h/ and die "usage: keyboarddrake [--expert]\n";
+
+$::expert = /--expert/;
+$::isStandalone = 1;
+
+my $in = vnew interactive;
+
+my $keyboard = keyboard::text2keyboard(
+ $in->ask_from_list_(_("Keyboard"),
+ _("What is your keyboard layout?"),
+ [ keyboard::list() ],
+ keyboard::keyboard2text(keyboard::read(''))));
+
+my $isNotDelete = $::expert && !$in->ask_yesorno("BackSpace", "Do you want the BackSpace to return Delete in console?", 1);
+
+my $kmap = keyboard::keyboard2kmap($keyboard);
+`loadkeys $kmap`;
+
+my $xkb = keyboard::keyboard2xkb($keyboard);
+`setxkbmap $xkb`;
+
+my $f = "/etc/X11/XF86Config";
+substInFile {
+ if (/^Section "Keyboard"/ .. /^EndSection/) {
+ s|^(\s*XkbLayout\s+).*|$1"$xkb"|
+ and $_ .= join '', map { " $_\n" } @{$xkb_options{$xkb} || []};
+ s,^(\s*(XkbVariant|XkbOptions)\s+).*,,; # remove existing one
+ }
+} $f if -e $f && !$::testing;
+
+keyboard::write('', $keyboard, $isNotDelete);
+
+exec 'true' if ref($in) =~ /gtk/; #- workaround for perl-GTK
diff --git a/perl-install/standalone/mousedrake b/perl-install/standalone/mousedrake
index 852c5e612..daacb90e9 100755
--- a/perl-install/standalone/mousedrake
+++ b/perl-install/standalone/mousedrake
@@ -43,8 +43,8 @@ modules::write_conf("/etc/conf.modules") if $mouse->{device} eq "usbmouse" && !$
my $f = "/etc/X11/XF86Config";
substInFile {
if (/^Section "Pointer"/ .. /^EndSection/) {
- s|^(\s*Protocol\s+).*|$1 "$mouse->{XMOUSETYPE}"|;
- s|^(\s*Device\s+).*|$1 "/dev/mouse"|;
+ s|^(\s*Protocol\s+).*|$1"$mouse->{XMOUSETYPE}"|;
+ s|^(\s*Device\s+).*|$1"/dev/mouse"|;
}
} $f if -e $f && !$::testing;