summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorPascal Rigaux <pixel@mandriva.com>2000-09-15 20:42:47 +0000
committerPascal Rigaux <pixel@mandriva.com>2000-09-15 20:42:47 +0000
commit851338fe8bf4c8d057984431b542b333cbad4b8e (patch)
tree7029da4dde591025d410100a9b1b126967ba2f76
parent91608779ad460d1481bec34e39db4661b4950441 (diff)
downloaddrakx-851338fe8bf4c8d057984431b542b333cbad4b8e.tar
drakx-851338fe8bf4c8d057984431b542b333cbad4b8e.tar.gz
drakx-851338fe8bf4c8d057984431b542b333cbad4b8e.tar.bz2
drakx-851338fe8bf4c8d057984431b542b333cbad4b8e.tar.xz
drakx-851338fe8bf4c8d057984431b542b333cbad4b8e.zip
no_comment
-rw-r--r--perl-install/ChangeLog41
-rw-r--r--perl-install/Xconfig.pm5
-rw-r--r--perl-install/Xconfigurator.pm14
-rw-r--r--perl-install/bootloader.pm7
-rw-r--r--perl-install/common.pm7
-rw-r--r--perl-install/fs.pm2
-rw-r--r--perl-install/install2.pm8
-rw-r--r--perl-install/install_any.pm11
-rw-r--r--perl-install/install_interactive.pm12
-rw-r--r--perl-install/install_steps.pm2
-rw-r--r--perl-install/install_steps_gtk.pm2
-rw-r--r--perl-install/install_steps_interactive.pm17
12 files changed, 93 insertions, 35 deletions
diff --git a/perl-install/ChangeLog b/perl-install/ChangeLog
index 53f26243f..f85d0bac3 100644
--- a/perl-install/ChangeLog
+++ b/perl-install/ChangeLog
@@ -1,3 +1,44 @@
+2000-09-15 Pixel <pixel@mandrakesoft.com>
+
+ * Xconfigurator.pm: the reference is now nbuttons to
+ know wether to put Emulate3Buttons or ZAxisMapping.
+ * Xconfigurator.pm (cardConfiguration): install Glide_V3-DRI on
+ Banshee too.
+
+ * Xconfig.pm: guess nbuttons based on Emulate3Buttons and
+ ZAxisMapping.
+
+ * common.pm (availableRamMB): replace availableRam, now use the
+ size of /proc/kcore (what else to find the real ramsize?)
+
+ * common.pm (cat__): created
+
+ * install2.pm (main): add field meta_class in $o. Can be
+ 'desktop', in case option desktop is given, or if /desktop/i is
+ found in /VERSION
+
+ * install_steps.pm (miscellaneous): for lnx4win, always have
+ 'mem=' (so that the initrd is visible by both windows
+
+ * install2.pm (main): add option "desktop"
+
+ * install_any.pm (generate_ks_cfg): fix for new(?) $o->{intf} format
+
+ * install_interactive.pm (partitionWizardSolutions):
+ use only TrueFS for existing_part
+ (partitionWizard): have only "loopback" for lnx4win
+
+ * pci_probing/pcitable: associate Voodoo5 with Voodoo5
+
+ * share/Cards+: add Voodoo5
+
+ * bootloader.pm (suggest): add entry linux-nonfb (called linux-up
+ for smp)
+
+2000-09-14 DrakX <install@linux-mandrake.com>
+
+ * snapshot uploaded
+
2000-09-12 François Pons <fpons@mandrakesoft.com>
* detect_devices.pm, mouse.pm: moved probing serial port before to
diff --git a/perl-install/Xconfig.pm b/perl-install/Xconfig.pm
index 438862971..585ed7247 100644
--- a/perl-install/Xconfig.pm
+++ b/perl-install/Xconfig.pm
@@ -30,7 +30,6 @@ sub getinfo {
add2hash($o->{mouse}, mouse::detect()) unless $o->{mouse}{XMOUSETYPE};
$o->{mouse}{device} ||= "mouse" if -e "/dev/mouse";
- $o->{mouse}{nbuttons} ||= mouse::X2nbuttons($o->{mouse}{XMOUSETYPE});
$o;
}
@@ -49,9 +48,11 @@ sub getinfoFromXF86Config {
} elsif (/^Section "Pointer"/ .. /^EndSection/) {
$o->{mouse}{XMOUSETYPE} ||= $1 if /^\s*Protocol\s+"(.*?)"/;
$o->{mouse}{device} ||= $1 if m|^\s*Device\s+"/dev/(.*?)"|;
- $o->{mouse}{XEMU3} ||= 1 if m/^\s*Emulate3Buttons\s+/;
$o->{mouse}{cleardtrrts} ||= 1 if m/^\s*ClearDTR\s+/;
$o->{mouse}{cleardtrrts} ||= 1 if m/^\s*ClearRTS\s+/;
+ $o->{mouse}{nbuttons} = 2 if m/^\s*Emulate3Buttons\s+/;
+ $o->{mouse}{nbuttons} ||= 5 if m/^\s*ZAxisMapping\s.*5/;
+ $o->{mouse}{nbuttons} = 7 if m/^\s*ZAxisMapping\s.*7/;
} elsif (my $i = /^Section "Device"/ .. /^EndSection/) {
%c = () if $i == 1;
diff --git a/perl-install/Xconfigurator.pm b/perl-install/Xconfigurator.pm
index 7aaff1426..7421f53f6 100644
--- a/perl-install/Xconfigurator.pm
+++ b/perl-install/Xconfigurator.pm
@@ -263,7 +263,7 @@ NOTE THIS IS EXPERIMENTAL SUPPORT AND MAY FREEZE YOUR COMPUTER.", $xf3_ver)) . "
my @l = ();
if ($card->{DRI_glx}) {
push @l, 'Glide_V5' if $card->{identifier} =~ /Voodoo 5/;
- push @l, 'Glide_V3-DRI' if $card->{identifier} =~ /Voodoo 3/;
+ push @l, 'Glide_V3-DRI' if $card->{identifier} =~ /Voodoo (3|Banshee)/;
push @l, 'Device3Dfx', 'XFree86-glide-module' if $card->{identifier} =~ /Voodoo/;
}
if ($card->{Utah_glx}) {
@@ -778,12 +778,12 @@ sub write_XF86Config {
print G qq( Option "ZAxisMapping" "4 5"\n) if $O->{nbuttons} > 3;
print G qq( Option "ZAxisMapping" "6 7"\n) if $O->{nbuttons} > 5;
- print F "#" unless $O->{XEMU3};
- print G "#" unless $O->{XEMU3};
+ print F "#" unless $O->{nbuttons} < 3;
+ print G "#" unless $O->{nbuttons} < 3;
print F qq( Emulate3Buttons\n);
print G qq( Option "Emulate3Buttons"\n);
- print F "#" unless $O->{XEMU3};
- print G "#" unless $O->{XEMU3};
+ print F "#" unless $O->{nbuttons} < 3;
+ print G "#" unless $O->{nbuttons} < 3;
print F qq( Emulate3Timeout 50\n\n);
print G qq( Option "Emulate3Timeout" "50"\n\n);
print F "# ChordMiddle is an option for some 3-button Logitech mice\n\n";
@@ -1083,8 +1083,8 @@ sub main {
($prefix, $o, $in, $allowFB, $isLaptop, $install) = @_;
$o ||= {};
- XF86check_link('');
- XF86check_link('-4');
+ XF86check_link('');
+ XF86check_link('-4');
{
my $w = $in->wait_message('', _("Preparing X-Window configuration"), 1);
diff --git a/perl-install/bootloader.pm b/perl-install/bootloader.pm
index ffde61d6a..0c4659015 100644
--- a/perl-install/bootloader.pm
+++ b/perl-install/bootloader.pm
@@ -249,17 +249,16 @@ wait %d seconds for default boot.
log::l("SMP machine, but no SMP kernel found") unless $isSecure;
$isSMP = 0;
}
- add_kernel($prefix, $lilo, $kernelVersion, $isSecure ? 'secure' : 'smp',
+ add_kernel($prefix, $lilo, $kernelVersion, $isSecure ? 'secure' : $isSMP ? 'smp' : '',
{
label => 'linux',
root => "/dev/$root",
$vga_fb ? ( vga => $vga_fb) : (), #- using framebuffer
- }) if $isSecure || $isSMP;
+ });
add_kernel($prefix, $lilo, $kernelVersion, '',
{
- label => $isSecure || $isSMP ? 'linux-up' : 'linux',
+ label => $isSecure || $isSMP ? 'linux-up' : 'linux-nonfb',
root => "/dev/$root",
- $vga_fb ? ( vga => $vga_fb) : (), #- using framebuffer
});
add_kernel($prefix, $lilo, $kernelVersion, '',
{
diff --git a/perl-install/common.pm b/perl-install/common.pm
index 39d3dd161..ca86f0459 100644
--- a/perl-install/common.pm
+++ b/perl-install/common.pm
@@ -8,8 +8,8 @@ use vars qw(@ISA %EXPORT_TAGS @EXPORT_OK $printable_chars $sizeof_int $bitof_int
%EXPORT_TAGS = (
common => [ qw(__ even odd arch better_arch compat_arch min max sqr sum and_ or_ sign product bool invbool listlength bool2text bool2yesno text2bool to_int to_float ikeys member divide is_empty_array_ref is_empty_hash_ref add2hash add2hash_ set_new set_add round round_up round_down first second top uniq translate untranslate warp_text formatAlaTeX formatLines deref next_val_in_array) ],
functional => [ qw(fold_left compose mapgrep map_index grep_index find_index map_each grep_each list2kv map_tab_hash mapn mapn_ difference2 before_leaving catch_cdie cdie combine) ],
- file => [ qw(dirname basename touch all glob_ cat_ output symlinkf chop_ mode typeFromMagic expand_symlinks) ],
- system => [ qw(sync makedev unmakedev psizeof strcpy gettimeofday syscall_ salt getVarsFromSh setVarsInSh setVarsInCsh substInFile availableRam availableMemory removeXiBSuffix template2file template2userfile update_userkderc list_skels formatTime formatTimeRaw unix2dos setVirtual) ],
+ file => [ qw(dirname basename touch all glob_ cat_ cat__ output symlinkf chop_ mode typeFromMagic expand_symlinks) ],
+ system => [ qw(sync makedev unmakedev psizeof strcpy gettimeofday syscall_ salt getVarsFromSh setVarsInSh setVarsInCsh substInFile availableMemory availableRamMB removeXiBSuffix template2file template2userfile update_userkderc list_skels formatTime formatTimeRaw unix2dos setVirtual) ],
constant => [ qw($printable_chars $sizeof_int $bitof_int $SECTORSIZE %compat_arch) ],
);
@EXPORT_OK = map { @$_ } values %EXPORT_TAGS;
@@ -88,6 +88,7 @@ sub bool2yesno { $_[0] ? "yes" : "no" }
sub text2bool { my $t = lc($_[0]); $t eq "true" || $t eq "yes" ? 1 : 0 }
sub strcpy { substr($_[0], $_[2] || 0, length $_[1]) = $_[1] }
sub cat_ { local *F; open F, $_[0] or $_[1] ? die "cat of file $_[0] failed: $!\n" : return; my @l = <F>; wantarray ? @l : join '', @l }
+sub cat__ { my ($f) = @_; my @l = <$f>; wantarray ? @l : join '', @l }
sub output { my $f = shift; local *F; open F, ">$f" or die "output in file $f failed: $!\n"; print F foreach @_; }
sub deref { ref $_[0] eq "ARRAY" ? @{$_[0]} : ref $_[0] eq "HASH" ? %{$_[0]} : $_[0] }
sub linkf { unlink $_[1]; link $_[0], $_[1] }
@@ -562,8 +563,8 @@ sub typeFromMagic($@) {
undef;
}
-sub availableRam() { sum map { /(\d+)/ } grep { /^(MemTotal):/ } cat_("/proc/meminfo"); }
sub availableMemory() { sum map { /(\d+)/ } grep { /^(MemTotal|SwapTotal):/ } cat_("/proc/meminfo"); }
+sub availableRamMB() { divide((stat("/proc/kcore"))[7], 1024 * 1024) + 1 }
sub setVirtual($) {
my $vt = '';
diff --git a/perl-install/fs.pm b/perl-install/fs.pm
index f268fc7d6..c29faae8a 100644
--- a/perl-install/fs.pm
+++ b/perl-install/fs.pm
@@ -312,6 +312,8 @@ sub df {
mkdir $dir;
eval { mount($part->{device}, $dir, type2fs($part->{type}), 'readonly') };
if ($@) {
+ $part->{notFormatted} = 1;
+ $part->{isFormatted} = 0;
unlink $dir;
return;
}
diff --git a/perl-install/install2.pm b/perl-install/install2.pm
index 76a7c52c3..9d9e30dfa 100644
--- a/perl-install/install2.pm
+++ b/perl-install/install2.pm
@@ -501,7 +501,8 @@ sub main {
expert => sub { $::expert = 1; $::beginner = 0 },
beginner => sub { $::beginner = $v },
class => sub { $o->{installClass} = $v },
- fclass => sub { $o->{installClass} = $v; push @auto, "selectInstallClass" },
+ fclass => sub { $o->{installClass} = $v; push @auto, 'selectInstallClass' },
+ desktop => sub { $o->{meta_class} = 'desktop' },
lnx4win => sub { $o->{lnx4win} = 1 },
readonly => sub { $o->{partitioning}{readonly} = $v ne "0" },
display => sub { $o->{display} = $v },
@@ -632,6 +633,11 @@ sub main {
$o->{interactive} = "newt";
require install_steps_newt;
}
+ $o->{meta_class} = 'desktop' if cat__(install_any::getFile("VERSION")) =~ /desktop/i;
+ if ($o->{meta_class} eq 'desktop') {
+ $o->{installClass} = 'normal';
+ push @auto, 'selectInstallClass';
+ }
if ($oem) {
push @auto, 'selectInstallClass', 'selectMouse', 'configureTimezone', 'exitInstall';
}
diff --git a/perl-install/install_any.pm b/perl-install/install_any.pm
index 53fdf2798..749bb40ab 100644
--- a/perl-install/install_any.pm
+++ b/perl-install/install_any.pm
@@ -129,6 +129,7 @@ sub getFile {
ftp::getFile($rel);
} elsif ($::o->{method} eq "http") {
require http;
+ log::l("http getFile $f");
http::getFile($rel);
} else {
#- try to open the file, but examine if it is present in the repository, this allow
@@ -308,7 +309,7 @@ sub setPackages($) {
my @l = ();
push @l, "kapm", "kcmlaptop", "DrakProfile", "DrakSync" if $o->{pcmcia};
push @l, "Glide_V5" if detect_devices::matching_desc('Voodoo 5');
- push @l, "Glide_V3-DRI" if detect_devices::matching_desc('Voodoo 3');
+ push @l, "Glide_V3-DRI" if detect_devices::matching_desc('Voodoo (3|Banshee)');
push @l, "Device3Dfx", "XFree86-glide-module" if detect_devices::matching_desc('Voodoo');
require timezone;
require lang;
@@ -580,12 +581,12 @@ sub generate_ks_cfg {
cat_("/proc/mounts") =~ m|(\S+):(\S+)\s+/tmp/rhimage nfs| or die;
$ks .= "nfs --server $1 --dir $2\n";
}
- my %intf = %{$o->{intf}[0]};
- if ($intf{BOOTPROTO} =~ /^(dhcp|bootp)$/) {
- $ks .= "network --bootproto $intf{BOOTPROTO}\n";
+ my ($intf) = values %{$o->{intf}};
+ if ($intf->{BOOTPROTO} =~ /^(dhcp|bootp)$/) {
+ $ks .= "network --bootproto $intf->{BOOTPROTO}\n";
} else {
require network;
- my %l = (ip => $intf{IPADDR}, netmask => $intf{NETMASK}, gateway => $o->{netc}{GATEWAY});
+ my %l = (ip => $intf->{IPADDR}, netmask => $intf->{NETMASK}, gateway => $o->{netc}{GATEWAY});
$ks .= "network " . join(" ", map_each { $::b && "--$::a $::b" } %l);
$ks .= " --nameserver $_" foreach network::dnsServers($o->{netc});
$ks .= "\n";
diff --git a/perl-install/install_interactive.pm b/perl-install/install_interactive.pm
index 4fcaca28f..7f635f18f 100644
--- a/perl-install/install_interactive.pm
+++ b/perl-install/install_interactive.pm
@@ -71,10 +71,9 @@ sub partitionWizardSolutions {
"no harddrive on which partitions can be added") if !$readonly;
}
- if (@$fstab) {
- my $truefs = grep { isTrueFS($_) } @$fstab;
+ if (my @truefs = grep { isTrueFS($_) } @$fstab) {
#- value twice the ext2 partitions
- $solutions{existing_part} = [ 6 + $truefs + @$fstab, _("Use existing partition"), sub { $o->ask_mntpoint_s($fstab) } ]
+ $solutions{existing_part} = [ 6 + @truefs + @$fstab, _("Use existing partition"), sub { $o->ask_mntpoint_s($fstab) } ]
} else {
push @wizlog, _("There is no existing partition to use");
}
@@ -83,7 +82,7 @@ sub partitionWizardSolutions {
fs::df($_) foreach @fats;
if (my @ok_forloopback = sort { $b->{free} <=> $a->{free} } grep { $_->{free} > $min_linux + $min_freewin } @fats) {
$solutions{loopback} =
- [ -10 - @fats, _("Use the FAT partition for loopback"),
+ [ -10 - @fats, _("Use the Windows partition for loopback"),
sub {
my ($s_root, $s_swap);
my $part = $o->ask_from_listf('', _("Which partition do you want to use to put Linux4Win?"), \&partition_table_raw::description, \@ok_forloopback) or return;
@@ -179,16 +178,21 @@ sub partitionWizard {
my ($o, $nodiskdrake) = @_;
my %solutions = partitionWizardSolutions($o, $o->{hds}, $o->{fstab}, $o->{partitioning}{readonly});
+ %solutions = (loopback => $solutions{loopback}) if $o->{lnx4win};
delete $solutions{diskdrake} if $nodiskdrake;
my @solutions = sort { $b->[0] <=> $a->[0] } values %solutions;
my $level = $::beginner ? 0 : $::expert ? -9999 : -10;
my @sol = grep { $_->[0] >= $level } @solutions;
+
+ log::l("solutions found: " . join('', map {$_->[1]} @sol) . " (all solutions found: " . join('', map {$_->[1]} @solutions) . ")");
+
@solutions = @sol if @sol > 1;
my $ok; while (!$ok) {
my $sol = $o->ask_from_listf('', _("The DrakX Partitioning wizard found the following solutions:"), sub { $_->[1] }, \@solutions) or redo;
+ log::l("partitionWizard calling solution $sol->[1]");
eval { $ok = $sol->[2]->() };
die if $@ =~ /setstep/;
$ok &&= !$@;
diff --git a/perl-install/install_steps.pm b/perl-install/install_steps.pm
index c2e52150e..61c3efcec 100644
--- a/perl-install/install_steps.pm
+++ b/perl-install/install_steps.pm
@@ -805,6 +805,8 @@ sub miscellaneous {
my ($o) = @_;
local $_ = $o->{bootloader}{perImageAppend};
+
+ $o->{miscellaneous}{memsize} ||= availableRamMB() . 'M' if $o->{lnx4win};
if (my $ramsize = $o->{miscellaneous}{memsize} and !/mem=/) {
$_ .= " mem=$ramsize";
}
diff --git a/perl-install/install_steps_gtk.pm b/perl-install/install_steps_gtk.pm
index 19ed1d5bb..06777fd12 100644
--- a/perl-install/install_steps_gtk.pm
+++ b/perl-install/install_steps_gtk.pm
@@ -135,7 +135,7 @@ sub selectLanguage {
$o->ask_warn('',
_("Your system is low on resource. You may have some problem installing
Linux-Mandrake. If that occurs, you can try a text install instead. For this,
-press `F1' when booting on CDROM, then enter `text'.")) if $first_time && availableRam < 60 * 1024; # 60MB
+press `F1' when booting on CDROM, then enter `text'.")) if $first_time && availableRamMB() < 60; # 60MB
}
diff --git a/perl-install/install_steps_interactive.pm b/perl-install/install_steps_interactive.pm
index 11825436e..ab32dc452 100644
--- a/perl-install/install_steps_interactive.pm
+++ b/perl-install/install_steps_interactive.pm
@@ -154,7 +154,6 @@ sub selectMouse {
$o->{mouse} = $o->ask_from_listf_('', _("Please, choose the type of your mouse."),
sub { $_[0]{FULLNAME} }, [ mouse::list ], $o->{mouse}) if $force;
- $o->{mouse}{XEMU3} = 'yes' if $o->{mouse}{nbuttons} < 3;
if ($force && $o->{mouse}{device} eq "ttyS") {
$o->set_help('selectSerialPort');
@@ -248,7 +247,7 @@ Continue at your own risk!"));
\&partition_table_raw::description,
[ install_any::find_root_parts($o->{hds}, $o->{prefix}) ]) or die "setstep exitInstall\n";
install_any::use_root_part($o->{fstab}, $p, $o->{prefix});
- } elsif ($::expert) {
+ } elsif ($::expert && ref($o) =~ /gtk/) {
install_interactive::partition_with_diskdrake($o, $o->{hds});
} else {
install_interactive::partitionWizard($o);
@@ -276,21 +275,23 @@ sub choosePartitionsToFormat($$) {
return if $::beginner && 0 == grep { ! $_->{toFormat} } @l;
- $_->{toFormat} ||= $_->{toFormatUnsure} foreach @l;
- log::l("preparing to format $_->{mntpoint}") foreach grep { $_->{toFormat} } @l;
+ my %toFormat = map { $_ => $_->{toFormat} || $_->{toFormatUnsure} } @l;
my %label;
- $label{$_} = sprintf("%s (%s)",
+ $label{$_} = sprintf("%s %s",
isSwap($_) ? type2name($_->{type}) : $_->{mntpoint},
- isLoopback($_) ? loopback::file($_) : $_->{device}) foreach @l;
+ isLoopback($_) ?
+ $::expert && loopback::file($_) :
+ "(" . partition_table_raw::description($_) . ")") foreach @l;
$o->ask_many_from_list_ref('', _("Choose the partitions you want to format"),
[ map { $label{$_} } @l ],
- [ map { \$_->{toFormat} } @l ]) or die "cancel";
+ [ map { \$toFormat{$_} } @l ]) or die "cancel";
@l = grep { $_->{toFormat} && !isLoopback($_) && !isReiserfs($_) } @l;
$o->ask_many_from_list_ref('', _("Check bad blocks?"),
[ map { $label{$_} } @l ],
[ map { \$_->{toFormatCheck} } @l ]) or goto &choosePartitionsToFormat if $::expert;
+ $_->{toFormat} = $toFormat{$_} foreach @l;
}
@@ -807,7 +808,7 @@ sub miscellaneous {
_("Miscellaneous questions"), [
_("Use hard drive optimisations?") => { val => \$u->{HDPARM}, type => 'bool', text => _("(may cause data corruption)") },
_("Choose security level") => { val => \$s, list => [ map { $l{$_} } ikeys %l ] },
-_("Precise RAM size if needed (found %d MB)", availableRam / 1024 + 1) => \$u->{memsize}, #- add three for correction.
+_("Precise RAM size if needed (found %d MB)", availableRamMB()) => \$u->{memsize},
arch() !~ /^sparc/ ? (
_("Removable media automounting") => { val => \$o->{useSupermount}, type => 'bool', text => 'supermount' }, ) : (),
$::expert ? (