summaryrefslogtreecommitdiffstats
path: root/perl-install
diff options
context:
space:
mode:
authorPascal Rigaux <pixel@mandriva.com>1999-09-16 17:30:46 +0000
committerPascal Rigaux <pixel@mandriva.com>1999-09-16 17:30:46 +0000
commit81068b4c188a82c0ae486665617f385997e619cd (patch)
tree485035ca8ecab31f9012e5b38c59c25434a0b676 /perl-install
parent1609027e73313dc16a5109e3d3f56d6b1c9b20ad (diff)
downloaddrakx-81068b4c188a82c0ae486665617f385997e619cd.tar
drakx-81068b4c188a82c0ae486665617f385997e619cd.tar.gz
drakx-81068b4c188a82c0ae486665617f385997e619cd.tar.bz2
drakx-81068b4c188a82c0ae486665617f385997e619cd.tar.xz
drakx-81068b4c188a82c0ae486665617f385997e619cd.zip
no_comment
Diffstat (limited to 'perl-install')
-rw-r--r--perl-install/Makefile2
-rw-r--r--perl-install/Xconfig.pm14
-rw-r--r--perl-install/Xconfigurator.pm14
-rw-r--r--perl-install/Xconfigurator_consts.pm2
-rw-r--r--perl-install/commands.pm11
-rw-r--r--perl-install/fsedit.pm28
-rw-r--r--perl-install/install2.pm8
-rw-r--r--perl-install/install_any.pm17
-rw-r--r--perl-install/install_steps.pm7
-rw-r--r--perl-install/install_steps_interactive.pm7
-rw-r--r--perl-install/partition_table.pm8
-rw-r--r--perl-install/share/list1
12 files changed, 90 insertions, 29 deletions
diff --git a/perl-install/Makefile b/perl-install/Makefile
index dcb0ff56b..6c79a31df 100644
--- a/perl-install/Makefile
+++ b/perl-install/Makefile
@@ -9,7 +9,7 @@ BASE = $(ROOTDEST)/Mandrake/base
DESTREP4PMS = $(DEST)/usr/bin/perl-install
STAGE2TMP = /tmp/stage2_tmp
PERL = perl
-LOCALFILES = $(PERL) mouseconfig ddcxinfo
+LOCALFILES = $(PERL) mouseconfig ddcxinfos
DIRS = po pci_probing
EXCLUDE = $(LOCALFILES) boot.img keymaps consolefonts install
RPMS = $(wildcard $(ROOTDEST)/Mandrake/RPMS/*.rpm)
diff --git a/perl-install/Xconfig.pm b/perl-install/Xconfig.pm
index e22168377..acab3ca55 100644
--- a/perl-install/Xconfig.pm
+++ b/perl-install/Xconfig.pm
@@ -95,8 +95,20 @@ sub getinfoFromDDC {
my $o = shift || {};
my $O = $o->{monitor} ||= {};
return $o if $O->{hsyncrange} && $O->{vsyncrange} && $O->{modelines};
- my ($h, $v, @l) = `ddcxinfo`;
+ my ($m, @l) = `ddcxinfos`;
$? == 0 or return $o;
+
+ $o->{card}{memory} = to_int($m);
+ while (($_ = shift @l) ne "\n") {
+ my ($depth, $x, $y) = split;
+ $depth = int(log($depth) / log(2));
+ if ($depth >= 8 && $x >= 640) {
+ push @{$o->{card}{depth}{$depth}}, [ $x, $y ];
+ push @{$o->{card}{depth}{32}}, [ $x, $y ] if $depth == 24;
+ }
+ }
+ my ($h, $v, @m) = @l;
+
chop $h; chop $v;
$O->{hsyncrange} ||= $h;
$O->{vsyncrange} ||= $v;
diff --git a/perl-install/Xconfigurator.pm b/perl-install/Xconfigurator.pm
index acd1c17f0..33a06bed8 100644
--- a/perl-install/Xconfigurator.pm
+++ b/perl-install/Xconfigurator.pm
@@ -154,7 +154,8 @@ sub cardConfiguration(;$$) {
$card->{type} = undef unless $card->{server}; #- bad type as we can't find the server
add2hash($card, cardConfigurationAuto()) unless $card->{server} || $noauto;
- add2hash($card, { type => $in->ask_from_list('', _("Choose a graphic card"), [keys %cards]) }) unless $card->{type} || $card->{server};
+ $card->{type} = $in->ask_from_list('', _("Choose a graphic card"), ['Unlisted', keys %cards]) unless $card->{type} || $card->{server};
+ $card->{type} = undef, $card->{server} = $in->ask_from_list('', _("Choose a X server"), \@allservers) if $card->{type} eq "Unlisted";
add2hash($card, $cards{$card->{type}}) if $card->{type};
add2hash($card, { vendor => "Unknown", board => "Unknown" });
@@ -369,7 +370,8 @@ sub chooseResolutions($$) {
map { 0, $w2widget{$_} } ikeys(%w2widget),
),
),
- 0, $W->create_okcancel,
+ 0, gtkadd($W->create_okcancel,
+ gtksignal_connect(new Gtk::Button('Show all'), clicked => sub { $W->{retval} = 1; $chosen_w = 0; Gtk->main_quit })),
));
$depth_combo->disable_activate;
$depth_combo->set_use_arrows_always(1);
@@ -383,7 +385,6 @@ sub chooseResolutions($$) {
&$set_depth();
$W->main or return;
-
($chosen_depth, $chosen_w);
}
@@ -456,6 +457,11 @@ Try with another video card or monitor")), return;
$auto or ($depth, $res) = chooseResolutions($card, $depth) or return;
+ unless ($res) {
+ delete $card->{depth};
+ return resolutionsConfiguration($o, 'noauto');
+ }
+
#- needed in auto mode when all has been provided by the user
$card->{depth}{$depth} or die "you fixed an unusable depth";
@@ -509,7 +515,7 @@ sub write_XF86Config {
#- Write monitor section.
$O = $o->{monitor};
- $O->{modelines} ||= $o->{card}{type} eq "TG 96" ? $modelines_text_Trident_TG_96xx : $modelines_text;
+ $O->{modelines} .= $o->{card}{type} eq "TG 96" ? $modelines_text_Trident_TG_96xx : $modelines_text;
print F $monitorsection_text1;
print F qq( Identifier "$O->{type}"\n);
diff --git a/perl-install/Xconfigurator_consts.pm b/perl-install/Xconfigurator_consts.pm
index 3bc757382..17ecb02f8 100644
--- a/perl-install/Xconfigurator_consts.pm
+++ b/perl-install/Xconfigurator_consts.pm
@@ -2,7 +2,7 @@ use common qw(:common);
%depths = (
8 => __("256 colors"),
-#- 15 => __("32 thousand colors"),
+ 15 => __("32 thousand colors"),
16 => __("65 thousand colors"),
24 => __("16 million colors"),
32 => __("4 billion colors"),
diff --git a/perl-install/commands.pm b/perl-install/commands.pm
index 87862c19b..2ae11bf8e 100644
--- a/perl-install/commands.pm
+++ b/perl-install/commands.pm
@@ -41,7 +41,8 @@ sub lsmod { print "Module Size Used by\n"; cat("/proc/modules"
sub grep_ {
my ($h, $v) = getopts(\@_, qw(hv));
- my $r = shift and !$h or die "usage: grep <regexp> [files...]\n";
+ @_ == 0 || $h and die "usage: grep <regexp> [files...]\n";
+ my $r = shift;
@ARGV = @_; (/$r/ ? $v || print : $v && print) while <>
}
@@ -57,13 +58,17 @@ sub tr_ {
sub mount {
@_ or return cat("/proc/mounts");
my ($t) = getopts(\@_, qw(t));
- my $fs = $t ? shift : $_[0] =~ /:/ ? "nfs" : "ext2";
+ my $fs = $t && shift;
@_ == 2 or die "usage: mount [-t <fs>] <device> <dir>\n",
" (if /dev/ is left off the device name, a temporary node will be created)\n";
+ my ($dev, $where) = @_;
+ $fs ||= $where =~ /:/ ? "nfs" :
+ $dev =~ /fd/ ? "vfat" : "ext2";
+
require 'fs.pm';
- fs::mount(@_, $fs, 0, 1);
+ fs::mount($dev, $where, $fs, 0, 1);
}
sub umount {
diff --git a/perl-install/fsedit.pm b/perl-install/fsedit.pm
index 9ff3a0c01..390ce2d7d 100644
--- a/perl-install/fsedit.pm
+++ b/perl-install/fsedit.pm
@@ -287,6 +287,34 @@ sub move {
}
}
+sub rescuept($) {
+ my ($hd) = @_;
+ my ($ext, @hd);
+
+ my $dev = devices::make($hd->{device});
+ open F, "rescuept $dev|";
+ foreach (<F>) {
+ my ($st, $si, $id) = /start=\s*(\d+),\s*size=\s*(\d+),\s*Id=\s*(\d+)/ or next;
+ my $part = { start => $st, size => $si, type => hex($id) };
+ if (isExtended($part)) {
+ $ext = $part;
+ } else {
+ push @hd, $part;
+ }
+ }
+ close F or die "rescuept failed";
+
+ partition_table_raw::zero_MBR($hd);
+ foreach (@hd) {
+ my $b = partition_table::verifyInside($_, $ext);
+ if ($b) {
+ $_->{start}--;
+ $_->{size}++;
+ }
+ partition_table::add($hd, $_, ($b ? 'Extended' : 'Primary'), 1);
+ }
+}
+
#-######################################################################################
#- Wonderful perl :(
#-######################################################################################
diff --git a/perl-install/install2.pm b/perl-install/install2.pm
index 5d864a3f0..d668b4b4a 100644
--- a/perl-install/install2.pm
+++ b/perl-install/install2.pm
@@ -188,7 +188,7 @@ my @installSteps = (
addUser => [ __("Add a user"), 1, 1, "doInstallStep" ],
createBootdisk => [ __("Create bootdisk"), 1, 0, "doInstallStep" ],
setupBootloader => [ __("Install bootloader"), 1, 1, "doInstallStep" ],
- configureX => [ __("Configure X"), 1, 0, "doInstallStep" ],
+ configureX => [ __("Configure X"), 1, 0, "formatPartitions" ],
exitInstall => [ __("Exit install"), 0, 0, "alldone" ],
);
@@ -369,7 +369,7 @@ sub selectInstallClass {
$::beginner = $o->{installClass} eq "beginner";
$o->{partitions} ||= $suggestedPartitions{$o->{installClass}};
- install_any::setPackages($o, \@install_classes) if $o->{steps}{choosePackages}{entered} > 1;
+ $o->setPackages(\@install_classes) if $o->{steps}{choosePackages}{entered} >= 1;
}
#------------------------------------------------------------------------------
@@ -428,8 +428,10 @@ sub formatPartitions {
}
#------------------------------------------------------------------------------
+#-PADTODO
sub choosePackages {
- $o->choosePackages($o->{packages}, $o->{compss}, \@install_classes);
+ $o->setPackages($o, \@install_classes) if $_[1] == 1;
+ $o->choosePackages($o->{packages}, $o->{compss});
$o->{packages}{$_}{selected} = 1 foreach @{$o->{base}};
}
diff --git a/perl-install/install_any.pm b/perl-install/install_any.pm
index 2cab51528..07480df6c 100644
--- a/perl-install/install_any.pm
+++ b/perl-install/install_any.pm
@@ -38,7 +38,6 @@ sub getFile($) {
*install_any::getFile = \&ftp::getFile;
} else {
*install_any::getFile = sub($) {
- print ">>>>>> /tmp/rhimage/" . relGetFile($_[0]), "\n";
open getFile, "/tmp/rhimage/" . relGetFile($_[0]) or sleep(1000), return;
\*getFile;
};
@@ -115,24 +114,26 @@ sub getAvailableSpace {
sub setPackages($$) {
my ($o, $install_classes) = @_;
- unless ($o->{packages}) {
+ if ($o->{packages}) {
+ $_->{selected} = 0 foreach values %{$o->{packages}};
+ } else {
my $useHdlist = $o->{method} !~ /nfs|hd/;
eval { $o->{packages} = pkgs::psUsingHdlist() } if $useHdlist;
$o->{packages} = pkgs::psUsingDirectory() if !$useHdlist || $@;
pkgs::getDeps($o->{packages});
- $o->{compss} = pkgs::readCompss ($o->{packages});
+ $o->{compss} = pkgs::readCompss($o->{packages});
$o->{compssListLevels} = pkgs::readCompssList($o->{packages});
$o->{compssListLevels} ||= $install_classes;
push @{$o->{base}}, "kernel-smp" if detect_devices::hasSMP();
-
- do {
- my $p = $o->{packages}{$_} or log::l(), next;
- pkgs::select($o->{packages}, $p, 1);
- } foreach @{$o->{base}};
}
+ do {
+ my $p = $o->{packages}{$_} or log::l("missing base package $_"), next;
+ pkgs::select($o->{packages}, $p, 1);
+ } foreach @{$o->{base}};
+
pkgs::setShowFromCompss($o->{compss}, $o->{installClass}, $o->{lang});
pkgs::setSelectedFromCompssList($o->{compssListLevels}, $o->{packages}, getAvailableSpace($o) * 0.7, $o->{installClass}, $o->{lang});
}
diff --git a/perl-install/install_steps.pm b/perl-install/install_steps.pm
index 09756f199..1cb0cca1e 100644
--- a/perl-install/install_steps.pm
+++ b/perl-install/install_steps.pm
@@ -127,10 +127,13 @@ sub formatPartitions {
}
#------------------------------------------------------------------------------
-sub choosePackages($$$) {
- my ($o, $packages, $compss, $install_classes) = @_;
+sub setPackages {
+ my ($o, $install_classes) = @_;
install_any::setPackages($o, $install_classes);
}
+sub choosePackages($$$) {
+ my ($o, $packages, $compss) = @_;
+}
sub beforeInstallPackages {
my ($o) = @_;
diff --git a/perl-install/install_steps_interactive.pm b/perl-install/install_steps_interactive.pm
index 557215229..a742dc26d 100644
--- a/perl-install/install_steps_interactive.pm
+++ b/perl-install/install_steps_interactive.pm
@@ -118,7 +118,12 @@ sub formatPartitions {
}
}
#------------------------------------------------------------------------------
-#-choosePackage
+sub setPackages {
+ my ($o, $install_classes) = @_;
+ my $w = $o->wait_message('', _("Searching for available packages"));
+ $o->SUPER::setPackages($install_classes);
+}
+
#------------------------------------------------------------------------------
#-mouse
diff --git a/perl-install/partition_table.pm b/perl-install/partition_table.pm
index b16f9dd38..f6b8532dc 100644
--- a/perl-install/partition_table.pm
+++ b/perl-install/partition_table.pm
@@ -375,7 +375,6 @@ The only solution is to move your primary partitions to have the hole next to th
}
if ($e && $part->{start} < $e->{start}) {
-
my $l = first (@{$hd->{extended}});
#- the first is a special case, must recompute its real size
@@ -385,7 +384,6 @@ The only solution is to move your primary partitions to have the hole next to th
unshift @{$hd->{extended}}, { type => 5, raw => [ $part, $ext, {}, {} ], normal => $part, extended => $ext };
#- size will be autocalculated :)
} else {
-
my ($ext, $ext_size) = is_empty_array_ref($hd->{extended}) ?
($hd->{primary}, -1) : #- -1 size will be computed by adjust_main_extended
(top(@{$hd->{extended}}), $part->{size});
@@ -401,15 +399,15 @@ The only solution is to move your primary partitions to have the hole next to th
adjust_main_extended($hd);
}
-sub add($$;$) {
- my ($hd, $part, $primaryOrExtended) = @_;
+sub add($$;$$) {
+ my ($hd, $part, $primaryOrExtended, $forceNoAdjust) = @_;
$part->{notFormatted} = 1;
$part->{isFormatted} = 0;
$part->{rootDevice} = $hd->{device};
$hd->{isDirty} = $hd->{needKernelReread} = 1;
$part->{start} ||= 1; #- starting at sector 0 is not allowed
- adjustStartAndEnd($hd, $part);
+ adjustStartAndEnd($hd, $part) unless $forceNoAdjust;
my $e = $hd->{primary}{extended};
diff --git a/perl-install/share/list b/perl-install/share/list
index 4aa44e59f..dfd44e102 100644
--- a/perl-install/share/list
+++ b/perl-install/share/list
@@ -83,3 +83,4 @@
/usr/share/fonts/ISO8859-9/75dpi/tr_helvR08.pcf.gz
/usr/share/fonts/ISO8859-9/75dpi/tr_helvR10.pcf.gz
/usr/sbin/ext2resize
+/usr/sbin/rescuept