summaryrefslogtreecommitdiffstats
path: root/perl-install
diff options
context:
space:
mode:
authorPascal Rigaux <pixel@mandriva.com>2000-04-03 14:23:31 +0000
committerPascal Rigaux <pixel@mandriva.com>2000-04-03 14:23:31 +0000
commit4ad0308a646d6d6ff38d1f8410e3ae43e0b9cabb (patch)
tree0fbde1c8c2615138dbef59381c79615379342c20 /perl-install
parent08f4b5bf2f57dc0d75dcde2cec410a16e1f65f20 (diff)
downloaddrakx-4ad0308a646d6d6ff38d1f8410e3ae43e0b9cabb.tar
drakx-4ad0308a646d6d6ff38d1f8410e3ae43e0b9cabb.tar.gz
drakx-4ad0308a646d6d6ff38d1f8410e3ae43e0b9cabb.tar.bz2
drakx-4ad0308a646d6d6ff38d1f8410e3ae43e0b9cabb.tar.xz
drakx-4ad0308a646d6d6ff38d1f8410e3ae43e0b9cabb.zip
no_comment
Diffstat (limited to 'perl-install')
-rw-r--r--perl-install/Xconfigurator.pm8
-rw-r--r--perl-install/any.pm2
-rw-r--r--perl-install/detect_devices.pm10
-rw-r--r--perl-install/fs.pm10
-rw-r--r--perl-install/install2.pm33
-rw-r--r--perl-install/install_any.pm22
-rw-r--r--perl-install/install_steps.pm12
-rw-r--r--perl-install/install_steps_gtk.pm88
-rw-r--r--perl-install/install_steps_interactive.pm89
-rw-r--r--perl-install/keyboard.pm9
-rw-r--r--perl-install/lang.pm8
-rw-r--r--perl-install/modparm.pm2
-rw-r--r--perl-install/modules.pm8
-rw-r--r--perl-install/my_gtk.pm11
-rw-r--r--perl-install/share/keyboards.tar.bz2bin20724 -> 15936 bytes
15 files changed, 187 insertions, 125 deletions
diff --git a/perl-install/Xconfigurator.pm b/perl-install/Xconfigurator.pm
index bbebb1cba..215bf4b26 100644
--- a/perl-install/Xconfigurator.pm
+++ b/perl-install/Xconfigurator.pm
@@ -178,12 +178,12 @@ sub cardConfiguration(;$$$) {
add2hash($card, cardName2card($card->{type})) if $card->{type};
add2hash($card, { vendor => "Unknown", board => "Unknown" });
- $card->{prog} = "/usr/X11R6/bin/" . ($::xf4 ? 'XFree86' : "XF86_$card->{server}");
+ $card->{prog} = "/usr/X11R6/bin/" . ($::xf4 && $card->{driver} ? 'XFree86' : "XF86_$card->{server}");
-x "$prefix$card->{prog}" or $install && do {
$in->suspend;
&$install($card->{server});
- &$install('server') if $::xf4;
+ &$install('server') if $::xf4 && $card->{driver};
$in->resume;
};
-x "$prefix$card->{prog}" or die "server $card->{server} is not available (should be in $prefix$card->{prog})";
@@ -267,7 +267,7 @@ sub testConfig($) {
unlink "/tmp/.X9-lock";
#- restart_xfs;
- my $f = $tmpconfig . ($::xf4 && "-4");
+ my $f = $tmpconfig . ($::xf4 && $o->{card}{driver} && "-4");
local *F;
open F, "$prefix$o->{card}{prog} :9 -probeonly -pn -xf86config $f 2>&1 |";
foreach (<F>) {
@@ -332,7 +332,7 @@ sub testFinalConfig($;$$) {
open STDERR, ">$f_err";
chroot $prefix if $prefix;
exec $o->{card}{prog},
- ($o->{card}{prog} !~ /Xsun/ ? ("-xf86config", ($::testing ? $tmpconfig : $f) . ($::xf4 && "-4")) : ()),
+ ($o->{card}{prog} !~ /Xsun/ ? ("-xf86config", ($::testing ? $tmpconfig : $f) . ($::xf4 && $o->{card}{driver} && "-4")),
":9" or c::_exit(0);
}
diff --git a/perl-install/any.pm b/perl-install/any.pm
index 735753809..ae3d187f7 100644
--- a/perl-install/any.pm
+++ b/perl-install/any.pm
@@ -47,7 +47,7 @@ sub addUsers {
foreach my $u (@users) {
substInFile { s/^$u\n//; $_ .= "$u\n" if eof } "$msec/user.conf" if -d $msec;
}
- run_program::rooted($prefix, "/etc/security/msec/init-sh/grpuser.sh --refresh");
+ run_program::rooted($prefix, "/usr/share/msec/grpuser.sh --refresh");
}
sub setupBootloader {
diff --git a/perl-install/detect_devices.pm b/perl-install/detect_devices.pm
index 74e498d8d..ee4aa3319 100644
--- a/perl-install/detect_devices.pm
+++ b/perl-install/detect_devices.pm
@@ -34,8 +34,9 @@ sub get {
[ \&hasCompaqSmartArray, \&getCompaqSmartArray ];
}
sub hds() { grep { $_->{type} eq 'hd' && ($::isStandalone || !isRemovableDrive($_)) } get(); }
-sub zips() { grep { $_->{type} eq 'hd' && isZipDrive($_) } get(); }
-#-sub jazzs() { grep { $_->{type} eq 'hd' && isJazDrive($_) } get(); }
+sub zips() { grep { $_->{type} =~ /.d/ && isZipDrive($_) } get(); }
+sub ide_zips() { grep { $_->{type} =~ /.d/ && isZipDrive($_) } getIDE(); }
+#-sub jazzs() { grep { $_->{type} =~ /.d/ && isJazDrive($_) } get(); }
sub ls120s() { grep { $_->{type} =~ /.d/ && isLS120Drive($_) } get(); }
sub cdroms() {
my @l = grep { $_->{type} eq 'cdrom' } get();
@@ -51,7 +52,7 @@ sub cdroms() {
@l;
}
sub floppies() {
- my @ide = map { $_->{device} } grep { $_->{type} eq 'fd' } get() and modules::load("ide-floppy");
+ my @ide = map { $_->{device} } ls120s() and modules::load("ide-floppy");
(@ide, grep { tryOpen($_) } qw(fd0 fd1));
}
#- example ls120, model = "LS-120 SLIM 02 UHD Floppy"
@@ -197,12 +198,11 @@ sub syslog {
sub hasSMP { c::detectSMP() }
-#- warning: hasUltra66 does a pci probe
sub hasUltra66 {
cat_("/proc/cmdline") =~ /(ide2=(\S+)(\s+ide3=(\S+))?)/ and return $1;
require pci_probing::main;
- my @l = map { $_->[0] } grep { $_->[1] =~ /(HPT|Ultra66)/ } pci_probing::main::probe('STORAGE_OTHER', 'more') or return;
+ my @l = map { $_->[0] } pci_probing::main::matching_desc('(HPT|Ultra66)') or return;
my $ide = sprintf "ide2=0x%x,0x%x ide3=0x%x,0x%x",
@l == 2 ?
diff --git a/perl-install/fs.pm b/perl-install/fs.pm
index 88734a3e4..43b88e69d 100644
--- a/perl-install/fs.pm
+++ b/perl-install/fs.pm
@@ -312,15 +312,7 @@ sub write($$$$) {
$useSupermount ?
[ "/mnt/zip$i", "/mnt/zip$i", "supermount", "fs=vfat,dev=/dev/zip$i", 0, 0 ] :
[ "/dev/zip$i", "/mnt/zip$i", "auto", "user,noauto,nosuid,exec,nodev", 0, 0 ];
- } detect_devices::zips()),
- (map_index { #- for LS-120 drives, there are no partitions by default.
- my $i = $::i ? $::i + 1 : '';
- mkdir "$prefix/mnt/floppy-ls$i", 0755 or log::l("failed to mkdir $prefix/mnt/floppy-ls$i: $!");
- symlinkf $_->{device}, "$prefix/dev/floppy-ls$i" or log::l("failed to symlink $prefix/dev/floppy-ls$i: $!");
- $useSupermount ?
- [ "/mnt/floppy-ls$i", "/mnt/floppy-ls$i", "supermount", "fs=vfat,dev=/dev/floppy-ls$i", 0, 0 ] :
- [ "/dev/floppy-ls$i", "/mnt/floppy-ls$i", "auto", "user,noauto,nosuid,exec,nodev", 0, 0 ];
- } detect_devices::ls120s()));
+ } detect_devices::zips()));
write_fstab($fstab, $prefix, @to_add);
}
diff --git a/perl-install/install2.pm b/perl-install/install2.pm
index 4e5fb566f..f81b7ba8d 100644
--- a/perl-install/install2.pm
+++ b/perl-install/install2.pm
@@ -43,21 +43,20 @@ my (%installSteps, @orderedInstallSteps);
selectLanguage => [ __("Choose your language"), 1, 1, '' ],
selectInstallClass => [ __("Select installation class"), 1, 1, '' ],
setupSCSI => [ __("Setup SCSI"), 1, 0, '' ],
- selectPath => [ __("Choose install or upgrade"), 0, 0, '', "selectInstallClass" ],
- selectMouse => [ __("Configure mouse"), 1, 1, 'beginner', "selectPath" ],
- selectKeyboard => [ __("Choose your keyboard"), 1, 1, '', "selectPath" ],
+ selectMouse => [ __("Configure mouse"), 1, 1, 'beginner', "selectInstallClass" ],
+ selectKeyboard => [ __("Choose your keyboard"), 1, 1, '', "selectInstallClass" ],
miscellaneous => [ __("Miscellaneous"), 1, 1, 'beginner' ],
- partitionDisks => [ __("Setup filesystems"), 1, 0, '', "selectPath" ],
+ partitionDisks => [ __("Setup filesystems"), 1, 0, '', "selectInstallClass" ],
formatPartitions => [ __("Format partitions"), 1, -1, '', "partitionDisks" ],
- choosePackages => [ __("Choose packages to install"), 1, 1, 'beginner', "selectPath" ],
- doInstallStep => [ __("Install system"), 1, -1, '', ["formatPartitions", "selectPath"] ],
+ choosePackages => [ __("Choose packages to install"), 1, 1, 'beginner', "selectInstallClass" ],
+ doInstallStep => [ __("Install system"), 1, -1, '', ["formatPartitions", "selectInstallClass"] ],
configureNetwork => [ __("Configure networking"), 1, 1, 'beginner', "formatPartitions" ],
installCrypto => [ __("Cryptographic"), 1, 1, '!expert', "configureNetwork" ],
configureTimezone => [ __("Configure timezone"), 1, 1, '', "doInstallStep" ],
configureServices => [ __("Configure services"), 1, 1, '!expert', "doInstallStep" ],
configurePrinter => [ __("Configure printer"), 1, 0, '', "doInstallStep" ],
setRootPassword => [ __("Set root password"), 1, 1, '', "formatPartitions" ],
- addUser => [ __("Add a user"), 1, 1, '', "doInstallStep" ],
+ addUser => [ __("Add a user"), 1, 1, '' ],
arch() !~ /alpha/ ? (
createBootdisk => [ __("Create a bootdisk"), 1, 0, '', "doInstallStep" ],
) : (),
@@ -68,7 +67,6 @@ arch() !~ /alpha/ ? (
);
for (my $i = 0; $i < @installSteps; $i += 2) {
my %h; @h{@installStepsFields} = @{ $installSteps[$i + 1] };
- $h{previous}= $installSteps[$i - 2] if $i >= 2;
$h{next} = $installSteps[$i + 2];
$h{entered} = 0;
$h{onError} = $installSteps[$i + 2 * $h{onError}];
@@ -260,12 +258,6 @@ sub selectKeyboard {
}
#------------------------------------------------------------------------------
-sub selectPath {
- $o->selectPath;
- install_any::searchAndMount4Upgrade($o) if $o->{isUpgrade};
-}
-
-#------------------------------------------------------------------------------
sub selectInstallClass {
$o->selectInstallClass(@install_classes);
@@ -275,16 +267,24 @@ sub selectInstallClass {
$o->setPackages(\@install_classes);
$o->selectPackagesToUpgrade() if $o->{isUpgrade};
}
+ if ($o->{isUpgrade}) {
+ @{$o->{orderedSteps}} = map { /selectInstallClass/ ? ($_, "partitionDisks") : $_ }
+ grep { !/partitionDisks/ } @{$o->{orderedSteps}};
+ my $s; foreach (@{$o->{orderedSteps}}) {
+ $s->{next} = $_;
+ $s = $o->{steps}{$_};
+ }
+ }
}
#------------------------------------------------------------------------------
sub partitionDisks {
+ return install_any::searchAndMount4Upgrade($o) if $o->{isUpgrade};
return
$o->{fstab} = [
{ device => "loop7", type => 0x83, size => 2048 * cat_('/dos/lnx4win/size.txt'), mntpoint => "/", isFormatted => 1, isMounted => 1 },
{ device => "/initrd/dos/lnx4win/swapfile", type => 0x82, mntpoint => "swap", isFormatted => 1, isMounted => 1 },
] if $o->{lnx4win};
- return if $o->{isUpgrade};
($o->{hd_dev}) = cat_("/proc/mounts") =~ m|/tmp/(\S+)\s+/tmp/hdimage|;
@@ -491,6 +491,7 @@ sub main {
require install_steps_auto_install;
install_steps_auto_install::errorInStep();
};
+ $ENV{SHARE_PATH} ||= "/usr/share";
$::beginner = $::expert = $::g_auto_install = 0;
@@ -585,6 +586,8 @@ sub main {
if ($@) {
log::l("error using auto_install, continuing");
undef $::auto_install;
+ } else {
+ log::l("auto install config file loaded successfully");
}
}
unless ($::auto_install) {
diff --git a/perl-install/install_any.pm b/perl-install/install_any.pm
index 30fdec6bc..d7e22cce1 100644
--- a/perl-install/install_any.pm
+++ b/perl-install/install_any.pm
@@ -359,7 +359,7 @@ sub searchAndMount4Upgrade {
log::l("found root partition : $root->{device}");
- #- test if the partition has to be fschecked and remounted rw.
+ #- test if the partition has to be fsck'ed and remounted rw.
if ($root->{realMntpoint}) {
($o->{prefix}, $root->{mntpoint}) = ($root->{realMntpoint}, '/');
} else {
@@ -723,44 +723,44 @@ sub kdeicons_postinstall($) {
foreach (<F>) {
if (m|^/dev/(\S+)\s+/mnt/cdrom(\d*)\s+|) {
my %toreplace = ( device => $1, id => $2 );
- template2userfile($prefix, "/usr/share/cdrom.fsdev.kdelnk.in", "Desktop/Cd-Rom". ($2 && " $2") .".kdelnk",
+ template2userfile($prefix, "$ENV{SHARE_PATH}/cdrom.fsdev.kdelnk.in", "Desktop/Cd-Rom". ($2 && " $2") .".kdelnk",
1, %toreplace);
} elsif (m|^/dev/(\S+)\s+/mnt/zip(\d*)\s+|) {
my %toreplace = ( device => $1, id => $2 );
- template2userfile($prefix, "/usr/share/zip.fsdev.kdelnk.in", "Desktop/Zip". ($2 && " $2") .".kdelnk",
+ template2userfile($prefix, "$ENV{SHARE_PATH}/zip.fsdev.kdelnk.in", "Desktop/Zip". ($2 && " $2") .".kdelnk",
1, %toreplace);
} elsif (m|^/dev/(\S+)\s+/mnt/floppy-ls(\d*)\s+|) {
my %toreplace = ( device => $1, id => $2 );
- template2userfile($prefix, "/usr/share/floppy.fsdev.kdelnk.in", "Desktop/LS-120". ($2 && " $2") .".kdelnk",
+ template2userfile($prefix, "$ENV{SHARE_PATH}/floppy.fsdev.kdelnk.in", "Desktop/LS-120". ($2 && " $2") .".kdelnk",
1, %toreplace);
} elsif (m|^/dev/(\S+)\s+/mnt/floppy(\d*)\s+|) {
my %toreplace = ( device => $1, id => $2 );
- template2userfile($prefix, "/usr/share/floppy.fsdev.kdelnk.in", "Desktop/Floppy". ($2 && " $2") .".kdelnk",
+ template2userfile($prefix, "$ENV{SHARE_PATH}/floppy.fsdev.kdelnk.in", "Desktop/Floppy". ($2 && " $2") .".kdelnk",
1, %toreplace);
} elsif (m|^/mnt/cdrom(\d*)\s+/mnt/cdrom\d*\s+supermount|) {
my %toreplace = ( id => $1 );
- template2userfile($prefix, "/usr/share/cdrom.kdelnk.in", "Desktop/Cd-Rom". ($1 && " $1") .".kdelnk",
+ template2userfile($prefix, "$ENV{SHARE_PATH}/cdrom.kdelnk.in", "Desktop/Cd-Rom". ($1 && " $1") .".kdelnk",
1, %toreplace);
} elsif (m|^/mnt/zip(\d*)\s+/mnt/zip\d*\s+supermount|) {
my %toreplace = ( id => $1 );
- template2userfile($prefix, "/usr/share/zip.kdelnk.in", "Desktop/Zip". ($1 && " $1") .".kdelnk",
+ template2userfile($prefix, "$ENV{SHARE_PATH}/zip.kdelnk.in", "Desktop/Zip". ($1 && " $1") .".kdelnk",
1, %toreplace);
} elsif (m|^/mnt/floppy-ls(\d*)\s+/mnt/floppy-ls\d*\s+supermount|) {
my %toreplace = ( id => $1 );
- template2userfile($prefix, "/usr/share/floppy.kdelnk.in", "Desktop/LS-120". ($1 && " $1") .".kdelnk",
+ template2userfile($prefix, "$ENV{SHARE_PATH}/floppy.kdelnk.in", "Desktop/LS-120". ($1 && " $1") .".kdelnk",
1, %toreplace);
} elsif (m|^/mnt/floppy(\d*)\s+/mnt/floppy\d*\s+supermount|) {
my %toreplace = ( id => $1 );
- template2userfile($prefix, "/usr/share/floppy.kdelnk.in", "Desktop/Floppy". ($1 && " $1") .".kdelnk",
+ template2userfile($prefix, "$ENV{SHARE_PATH}/floppy.kdelnk.in", "Desktop/Floppy". ($1 && " $1") .".kdelnk",
1, %toreplace);
} elsif (m|^/dev/(\S+)\s+(/mnt/DOS_\S*)\s+|) {
my %toreplace = ( device => $1, id => $1, mntpoint => $2 );
- template2userfile($prefix, "/usr/share/Dos_.kdelnk.in", "Desktop/Dos_$1.kdelnk", 1, %toreplace);
+ template2userfile($prefix, "$ENV{SHARE_PATH}/Dos_.kdelnk.in", "Desktop/Dos_$1.kdelnk", 1, %toreplace);
symlink "hd_umount.xpm", "$prefix/usr/share/icons/hd_unmount.xpm";
symlink "hd_umount.xpm", "$prefix/usr/share/icons/large/hd_unmount.xpm";
} elsif (m|^/dev/(\S+)\s+(\S*)\s+vfat\s+|) {
my %toreplace = ( device => $1, id => $1, mntpoint => $2 );
- template2userfile($prefix, "/usr/share/Dos_.kdelnk.in", "Desktop/Dos_$1.kdelnk", 1, %toreplace);
+ template2userfile($prefix, "$ENV{SHARE_PATH}/Dos_.kdelnk.in", "Desktop/Dos_$1.kdelnk", 1, %toreplace);
symlink "hd_umount.xpm", "$prefix/usr/share/icons/hd_unmount.xpm";
symlink "hd_umount.xpm", "$prefix/usr/share/icons/large/hd_unmount.xpm";
}
diff --git a/perl-install/install_steps.pm b/perl-install/install_steps.pm
index df04546d5..34f18407e 100644
--- a/perl-install/install_steps.pm
+++ b/perl-install/install_steps.pm
@@ -114,8 +114,7 @@ sub selectInstallClass($@) {
}
#------------------------------------------------------------------------------
sub setupSCSI {
- modules::load("ide-mod", 'prereq', 'options="' . detect_devices::hasUltra66() . '"');
- modules::load_multi(qw(ide-probe ide-disk ide-cd));
+ modules::load_ide();
modules::load_thiskind('scsi');
}
#------------------------------------------------------------------------------
@@ -429,7 +428,7 @@ sub pppConfig {
print F "nameserver $o->{modem}{dns2}\n" if $o->{modem}{dns2};
close F;
- install_any::template2userfile($o->{prefix}, "/usr/share/kppprc.in", ".kde/share/config/kppprc", 1, %toreplace);
+ install_any::template2userfile($o->{prefix}, "$ENV{SHARE_PATH}/kppprc.in", ".kde/share/config/kppprc", 1, %toreplace);
miscellaneousNetwork($o);
}
@@ -762,10 +761,11 @@ sub miscellaneous {
$_ .= " mem=$ramsize";
}
if (my @l = detect_devices::getIDEBurners() and !/ide-scsi/) {
- $_ .= " " . join(" ", map { "$_=ide-scsi" } @l);
+ $_ .= " " . join(" ", (map { "$_=ide-scsi" } @l),
+ map { "$_->{device}=ide-floppy" } detect_devices::ide_zips());
}
- if (my $m = modules::get_options("ide-mod")) {
- $m =~ /options="(.*)"/ and $_ .= " $1" if !/ide.=/;
+ if (my $m = detect_devices::hasUltra66()) {
+ $_ .= " $m" if !/ide.=/;
}
#- keep some given parameters
diff --git a/perl-install/install_steps_gtk.pm b/perl-install/install_steps_gtk.pm
index bf5d30467..13d83a316 100644
--- a/perl-install/install_steps_gtk.pm
+++ b/perl-install/install_steps_gtk.pm
@@ -265,6 +265,30 @@ sub selectLanguage {
}
#------------------------------------------------------------------------------
+sub selectInstallClass1 {
+ my ($o, $verif, $l, $def, $l2, $def2) = @_;
+
+ my $w = my_gtk->new('');
+ my ($radio, $focused);
+ gtkadd($w->{window},
+ gtkpack($o->create_box_with_title(_("Which installation class do you want?")),
+ (my @radios = map { $radio = new Gtk::RadioButton($_, $radio ? $radio : ());
+ $radio->set_active($_ eq $def); $radio } @$l),
+ gtkadd(create_hbox(),
+ map { my $v = $_;
+ my $b = new Gtk::Button($_);
+ $focused = $b if $_ eq $def2;
+ gtksignal_connect($b, "clicked" => sub { $w->{retval} = $v; Gtk->main_quit });
+ } @$l2)
+ ));
+ $focused->grab_focus if $focused;
+ $w->main;
+
+ mapn { $verif->($_[1]) if $_[0]->active } \@radios, $l;
+ $w->{retval};
+}
+
+#------------------------------------------------------------------------------
sub selectMouse {
my ($o, $force) = @_;
my $old_dev = $o->{mouse}{device};
@@ -368,7 +392,7 @@ installation of each selected groups.") .
sub choosePackagesTree {
my ($o, $packages, $compss) = @_;
- my ($curr, $info_widget, $w_size, $go, $idle);
+ my ($curr, $info_widget, $w_size, $go, $idle, $flat, $auto_deps);
my (%wtree, %ptree);
my $w = my_gtk->new('');
@@ -385,20 +409,22 @@ sub choosePackagesTree {
gtkadd(gtkset_usize(new Gtk::Frame(_("Info")), 150, 0),
createScrolledWindow($info_widget = new Gtk::Text),
)),
- 0, gtkpack__(new Gtk::HBox(0,0), $w_size = new Gtk::Label('')),
+ 0, my $l = new Gtk::HBox(0,0),
0, gtkpack(new Gtk::HBox(0,10),
$go = gtksignal_connect(new Gtk::Button(_("Install")), "clicked" => sub { $w->{retval} = 1; Gtk->main_quit }),
)
));
+ gtkpack__($l, $w_size = new Gtk::Label(''));
+ $l->pack_end(my $toolbar = new Gtk::Toolbar('horizontal', 'icons'), 0, 1, 0);
+ $l->pack_end(gtksignal_connect(new Gtk::CheckButton(_("Automatic dependencies")), clicked => sub { invbool \$auto_deps }), 0, 1, 0);
+
$w->{window}->set_usize(map { $_ - 2 * $my_gtk::border - 4 } $::windowwidth, $::windowheight);
$go->grab_focus;
- $w->show;
+ $w->{rwindow}->show_all;
- $tree->freeze;
- my $dir = $::testing && $ENV{SHARE_PATH} || "/usr/share";
- my $pix_base = [ Gtk::Gdk::Pixmap->create_from_xpm($w->{window}->window, $w->{window}->style->bg('normal'), "$dir/rpm-base.xpm") ];
- my $pix_selected = [ Gtk::Gdk::Pixmap->create_from_xpm($w->{window}->window, $w->{window}->style->bg('normal'), "$dir/rpm-selected.xpm") ];
- my $pix_unselect = [ Gtk::Gdk::Pixmap->create_from_xpm($w->{window}->window, $w->{window}->style->bg('normal'), "$dir/rpm-unselected.xpm") ];
+ my $pix_base = [ gtkcreate_xpm($w->{window}, "$ENV{SHARE_PATH}/rpm-base.xpm") ];
+ my $pix_selected = [ gtkcreate_xpm($w->{window}, "$ENV{SHARE_PATH}/rpm-selected.xpm") ];
+ my $pix_unselect = [ gtkcreate_xpm($w->{window}, "$ENV{SHARE_PATH}/rpm-unselected.xpm") ];
my $parent; $parent = sub {
if (my $w = $wtree{$_[0]}) { return $w }
@@ -417,16 +443,38 @@ sub choosePackagesTree {
$tree->node_set_pixmap($node, 1, $pix->[0], $pix->[1]);
push @{$ptree{$leaf}}, $node;
};
-
- my ($root, $leaf);
- foreach (sort keys %{$packages->[0]}) {
- $add_node->($_, 'all');
- }
- foreach (sort @$compss) {
- ($root, $leaf) = m|(.*)/(.+)|o or ($root, $leaf) = ('', $_);
- $add_node->($leaf, $root);
+ my $add_nodes = sub {
+ %ptree = %wtree = ();
+
+ $tree->freeze;
+ while (1) { $tree->remove_node($tree->node_nth(0) || last) }
+
+ my ($root, $leaf);
+ if ($flat = $_[0]) {
+ $add_node->($_, undef) foreach sort keys %{$packages->[0]};
+ } else {
+ foreach (sort @$compss) {
+ ($root, $leaf) = m|(.*)/(.+)|o or ($root, $leaf) = ('', $_);
+ $add_node->($leaf, $root);
+ }
+ }
+ $tree->thaw;
+ };
+ $add_nodes->($flat);
+
+ my %toolbar = my @toolbar =
+ (
+ ftout => [ _("Expand Tree") , sub { $tree->expand_recursive(undef) } ],
+ ftin => [ _("Collapse Tree") , sub { $tree->collapse_recursive(undef) } ],
+ reload=> [ _("Toggle between flat and group sorted"), sub { $add_nodes->(!$flat) } ],
+ );
+ $toolbar->set_button_relief("none");
+ foreach (grep_index { $::i % 2 == 0 } @toolbar) {
+ gtksignal_connect($toolbar->append_item(undef, $toolbar{$_}[0], undef, gtkxpm($tree, "$ENV{SHARE_PATH}/$_.xpm")),
+ clicked => $toolbar{$_}[1]);
}
- $tree->thaw;
+ $toolbar->set_style("icons");
+
my $display_info = sub {
my $p = $packages->[0]{$curr} or return gtktext_insert($info_widget, '');
@@ -462,7 +510,7 @@ sub choosePackagesTree {
my $p = $packages->[0]{$curr} or return;
pkgs::togglePackageSelection($packages, $p, my $l = {});
if (my @l = grep { $l->{$_} } keys %$l) {
- @l > 1 and $o->ask_okcancel('', [ _("The following packages are going to be install/removed"), join(", ", sort @l) ], 1) || return;
+ @l > 1 && !$auto_deps and $o->ask_okcancel('', [ _("The following packages are going to be install/removed"), join(", ", sort @l) ], 1) || return;
pkgs::togglePackageSelection($packages, $p);
foreach (@l) {
my $p = $packages->[0]{$_};
@@ -598,7 +646,7 @@ _("There was an error ordering packages:"), $1, _("Go on anyway?") ], 1) and ret
#------------------------------------------------------------------------------
sub load_rc($) {
- if (my ($f) = grep { -r $_ } map { "$_/$_[0].rc" } ("share", "/usr/share", dirname(__FILE__))) {
+ if (my ($f) = grep { -r $_ } map { "$_/$_[0].rc" } ("share", $ENV{SHARE_PATH}, dirname(__FILE__))) {
Gtk::Rc->parse($f);
foreach (cat_($f)) {
if (/style\s+"background"/ .. /^\s*$/) {
@@ -782,7 +830,7 @@ sub create_logo_window() {
$w->{rwindow}->set_name("logo");
$w->show;
my $file = "logo-mandrake.xpm";
- -r $file or $file = "/usr/share/$file";
+ -r $file or $file = "$ENV{SHARE_PATH}/$file";
if (-r $file) {
my $ww = $w->{window};
my @logo = Gtk::Gdk::Pixmap->create_from_xpm($ww->window, $ww->style->bg('normal'), $file);
diff --git a/perl-install/install_steps_interactive.pm b/perl-install/install_steps_interactive.pm
index d0a7eb06b..2362b3582 100644
--- a/perl-install/install_steps_interactive.pm
+++ b/perl-install/install_steps_interactive.pm
@@ -84,16 +84,6 @@ sub selectKeyboard($) {
}
}
#------------------------------------------------------------------------------
-sub selectPath($) {
- my ($o) = @_;
- $o->{isUpgrade} =
- $o->ask_from_list_(_("Install/Upgrade"),
- _("Is this an install or an upgrade?"),
- [ __("Install"), __("Upgrade") ],
- $o->{isUpgrade} ? "Upgrade" : "Install") eq "Upgrade";
- install_steps::selectPath($o);
-}
-#------------------------------------------------------------------------------
sub selectRootPartition($@) {
my ($o, @parts) = @_;
$o->{upgradeRootPartition} =
@@ -103,31 +93,45 @@ sub selectRootPartition($@) {
#- TODO check choice, then mount partition in $o->{prefix} and autodetect.
#- install_steps::selectRootPartition($o);
}
+
+sub selectInstallClass1 {
+ my ($o, $verif, $l, $def, $l2, $def2) = @_;
+ $verif->($o->ask_from_list(_("Install Class"), _("Which installation class do you want?"), $l, $def));
+
+ $o->ask_from_list_(_("Install/Upgrade"), _("Is this an install or an upgrade?"), $l2, $def2);
+}
+
#------------------------------------------------------------------------------
sub selectInstallClass($@) {
my ($o, @classes) = @_;
- my @c = qw(beginner specific expert);
- my %c = (
- beginner => _("Recommended"),
- specific => _("Customized"),
- expert => _("Expert"),
- );
- my $installClass = ${{reverse %c}}{$o->ask_from_list(_("Install Class"),
- _("Which installation class do you want?"),
- [ map { $c{$_} } @c ], $c{$o->{installClass}} || $c{beginner})};
- $::expert = $installClass eq "expert";
- $::beginner = $installClass eq "beginner";
-
- if ($::beginner) {
- $o->{installClass} = "normal";
- } else {
+ my %c = my @c = (
+ _("Recommended") => "beginner",
+ _("Customized") => "specific",
+ _("Expert") => "expert",
+ );
+
+ my $verifInstallClass = sub {
+ $o->{installClass} = $c{$_[0]};
+ $::beginner = $o->{installClass} eq "beginner";
+ $::expert = $o->{installClass} eq "expert" &&
+ $o->ask_from_list_('',
+_("Are you sure you are an expert?
+Hey no kidding, you will be allowed powerfull but dangerous things here."),
+ [ _("Hurt me plenty"), _("Normal") ]) ne "Normal";
+ };
+
+ $o->{isUpgrade} = $o->selectInstallClass1($verifInstallClass,
+ first(list2kv(@c)), ${{reverse %c}}{$o->{installClass}},
+ [ __("Install"), __("Upgrade") ], $o->{isUpgrade} ? "Upgrade" : "Install") eq "Upgrade";
+
+ unless ($::beginner || $o->{isUpgrade}) {
my %c = (
normal => _("Normal"),
developer => _("Development"),
server => _("Server"),
);
$o->{installClass} = ${{reverse %c}}{$o->ask_from_list(_("Install Class"),
- _("What usage do you want?"),
+ _("Which usage do you want?"),
[ values %c ], $c{$o->{installClass}})};
}
install_steps::selectInstallClass($o);
@@ -156,7 +160,12 @@ sub selectMouse {
$o->SUPER::selectMouse;
}
#------------------------------------------------------------------------------
-sub setupSCSI { setup_thiskind($_[0], 'scsi', $_[1], $_[2]) }
+sub setupSCSI {
+ my ($o) = @_;
+ { my $w = $o->wait_message(_("IDE"), _("Configuring IDE"));
+ modules::load_ide() }
+ setup_thiskind($_[0], 'scsi', $_[1], $_[2]);
+}
sub ask_mntpoint_s {
my ($o, $fstab) = @_;
@@ -283,7 +292,7 @@ You can go on anyway, but be warned that you won't get all packages", $max_size
($o->{packages_}{ind}) =
pkgs::setSelectedFromCompssList($o->{compssListLevels}, $packages, 1, $size2install, $o->{installClass});
}
- $o->choosePackagesTree($packages, $compss) if $::expert;
+ $o->choosePackagesTree($packages, $compss) if $o->{compssUsersChoice}{Individual} || $::expert && $o->{isUpgrade};
}
sub chooseSizeToInstall {
@@ -297,8 +306,8 @@ sub chooseGroups {
$o->ask_many_from_list_ref('',
_("Package Group Selection"),
- [ @$compssUsersSorted, "Miscellaneous" ],
- [ map { \$o->{compssUsersChoice}{$_} } @$compssUsersSorted, "Miscellaneous" ]
+ [ @$compssUsersSorted, _("Miscellaneous"), _("Individual package selection") ],
+ [ map { \$o->{compssUsersChoice}{$_} } @$compssUsersSorted, "Miscellaneous", "Individual" ]
) or goto &chooseGroups unless $::beginner;
unless ($o->{compssUsersChoice}{Miscellaneous}) {
@@ -594,7 +603,11 @@ sub setRootPassword($) {
$::beginner ? () : "setRootPasswordNIS");
$o->ask_from_entries_refH([_("Set root password"), _("Ok"), $o->{security} > 2 ? () : _("No password")],
- _("Set root password"), [
+ [ _("Set root password"),
+ $::beginner ? "\n" .
+_("(a user ``mandrake'' with password ``mandrake'' has been automatically added.
+Do not use the user ``root'', except in special occasions.") : ()
+ ], [
_("Password") => { val => \$sup->{password}, hidden => 1 },
_("Password (again)") => { val => \$sup->{password2}, hidden => 1 },
$o->{installClass} eq "server" || $::expert ? (
@@ -628,14 +641,14 @@ _("Use NIS") => { val => \$o->{authentication}{NIS}, type => 'bool', text => _("
#------------------------------------------------------------------------------
sub addUser($) {
my ($o, $clicked) = @_;
- my $u = $o->{user} ||= $o->{security} < 1 ? { name => "mandrake", realname => "default" } : {};
+ my $u = $o->{user} ||= $o->{security} < 1 ? { name => "mandrake", passwd => "mandrake", realname => "default" } : {};
$u->{password2} ||= $u->{password} ||= "";
$u->{shell} ||= "/bin/bash";
$u->{icon} ||= translate('default');
my @fields = qw(realname name password password2);
my @shells = install_any::shells($o);
- if ($o->{security} < 2 && !$clicked || $o->ask_from_entries_refH(
+ if (($o->{security} >= 2 || $clicked) && $o->ask_from_entries_refH(
[ _("Add user"), _("Accept user"), $o->{security} >= 4 && !@{$o->{users}} ? () : _("Done") ],
_("Enter a user\n%s", $o->{users} ? _("(already added %s)", join(", ", map { $_->{realname} || $_->{name} } @{$o->{users}})) : ''),
[
@@ -667,7 +680,7 @@ sub addUser($) {
)) {
push @{$o->{users}}, $o->{user};
$o->{user} = {};
- goto &addUser unless $o->{security} < 2 && !$clicked; #- INFO_TO_DEL: bad security level may cause deadlocks...
+ goto &addUser;
}
install_steps::addUser($o);
}
@@ -950,6 +963,8 @@ sub setupXfree {
sub generateAutoInstFloppy($) {
my ($o) = @_;
+ return unless $::expert && $::corporate;
+
my ($floppy) = detect_devices::floppies();
$o->ask_yesorno('',
@@ -1089,12 +1104,6 @@ sub setup_thiskind {
my @l;
my $allow_probe = !$::expert || $o->ask_yesorno('', _("Try to find PCI devices?"), 1);
- {
- my $w = $o->wait_message(_("IDE"), _("Configuring IDE"));
- modules::load("ide-mod", 'prereq', $allow_probe && 'options="' . detect_devices::hasUltra66() . '"');
- modules::load_multi(qw(ide-probe ide-disk ide-cd));
- }
-
if ($allow_probe && $type =~ /scsi/i) {
#- hey, we're allowed to pci probe :) let's do a lot of probing!
require pci_probing::main;
diff --git a/perl-install/keyboard.pm b/perl-install/keyboard.pm
index 7cb5418d7..5e905aa2c 100644
--- a/perl-install/keyboard.pm
+++ b/perl-install/keyboard.pm
@@ -180,6 +180,7 @@ sub lang2keyboard($) {
sub load($) {
my ($keymap) = @_;
+ return if $::testing;
my ($magic, @keymaps) = unpack "I i" . c::MAX_NR_KEYMAPS() . "a*", $keymap;
$keymap = pop @keymaps;
@@ -209,9 +210,9 @@ sub load($) {
sub xmodmap_file {
my ($keyboard) = @_;
- my $f = "/usr/share/xmodmap/xmodmap.$keyboard";
+ my $f = "$ENV{SHARE_PATH}/xmodmap/xmodmap.$keyboard";
if (! -e $f) {
- run_program::run("extract_archive", "/usr/share/xmodmap.cz2", '/tmp', "xmodmap.$keyboard");
+ run_program::run("extract_archive", "$ENV{SHARE_PATH}/xmodmap.cz2", '/tmp', "xmodmap.$keyboard");
$f = "/tmp/xmodmap.$keyboard";
}
-e $f && $f;
@@ -222,11 +223,11 @@ sub setup($) {
my $o = $keyboards{$keyboard} or return;
log::l("loading keymap $o->[1]");
- if (-e (my $f = "/usr/share/keymaps/$o->[1].kmap")) {
+ if (-e (my $f = "$ENV{SHARE_PATH}/keymaps/$o->[1].kmap")) {
load(cat_($f));
} else {
local *F;
- open F, "extract_archive /usr/share/keymaps.cz2 '' $o->[1].kmap |";
+ open F, "extract_archive $ENV{SHARE_PATH}/keymaps.cz2 '' $o->[1].kmap |";
local $/ = undef;
eval { load(<F>) };
}
diff --git a/perl-install/lang.pm b/perl-install/lang.pm
index 298225425..e7199a2f0 100644
--- a/perl-install/lang.pm
+++ b/perl-install/lang.pm
@@ -208,12 +208,12 @@ sub set {
#- using a compressed cpio archive is nighmare to extract all files.
#- reset locale environment variable to avoid any warnings by perl,
#- so installation of new locale is done with empty locale ...
- unless (-e "/usr/share/locale/".$languages{$lang}[2]) {
+ unless (-e "$ENV{SHARE_PATH}/locale/".$languages{$lang}[2]) {
@ENV{qw(LANG LC_ALL LANGUAGE LINGUAS)} = ();
- eval { commands::rm("-r", "/usr/share/locale") };
+ eval { commands::rm("-r", "$ENV{SHARE_PATH}/locale") };
require 'run_program.pm';
- run_program::run("extract_archive", "/usr/share/locale.cz2", '/usr/share/locale', $languages{$lang}[2]);
+ run_program::run("extract_archive", "$ENV{SHARE_PATH}/locale.cz2", '$ENV{SHARE_PATH}/locale', $languages{$lang}[2]);
}
$ENV{LC_ALL} = $lang;
@@ -330,7 +330,7 @@ sub load_po($) {
#- }
#-
#- # text mode font
-#- log::l("loading font /usr/share/consolefonts/$fontFile");
+#- log::l("loading font $ENV{SHARE_PATH}/consolefonts/$fontFile");
#- #c::loadFont("/tmp/$fontFile") or log::l("error in loadFont: one of PIO_FONT PIO_UNIMAPCLR PIO_UNIMAP PIO_UNISCRNMAP failed: $!");
#- #print STDERR "\033(K";
#-
diff --git a/perl-install/modparm.pm b/perl-install/modparm.pm
index 067c2477e..46dcb23b7 100644
--- a/perl-install/modparm.pm
+++ b/perl-install/modparm.pm
@@ -15,7 +15,7 @@ use log;
#- Functions
#-######################################################################################
sub read_modparm_file {
- my $file = -e "modparm.lst" ? "modparm.lst" : "/usr/share/modparm.lst";
+ my $file = -e "modparm.lst" ? "modparm.lst" : "$ENV{SHARE_PATH}/modparm.lst";
my @line;
my %modparm_hash;
diff --git a/perl-install/modules.pm b/perl-install/modules.pm
index fc02afec3..b98230b1e 100644
--- a/perl-install/modules.pm
+++ b/perl-install/modules.pm
@@ -134,6 +134,7 @@ arch() =~ /^sparc/ ? (
"qlogicisp" => "Qlogic ISP",
"sym53c8xx" => "Symbios 53c8xx",
"scsi_mod" => "scsi_mod",
+ "sd_mod" => "sd_mod",
"ide-mod" => "ide-mod",
"ide-probe" => "ide-probe",
}],
@@ -485,7 +486,7 @@ sub write_conf {
my @l = sort grep { $conf{$_}{alias} && /scsi_hostadapter/ } keys %conf;
add_alias('block-major-11', 'scsi_hostadapter') if @l;
- push @l, "ide-floppy" if detect_devices::zips();
+ push @l, "ide-floppy" if detect_devices::ide_zips();
$conf{supermount}{"post-install"} = join " ; ", map { "modprobe $_" } @l if @l;
local *F;
@@ -566,3 +567,8 @@ sub get_pcmcia_devices($$) {
}
@devs;
}
+
+sub load_ide {
+ load("ide-mod", 'prereq', 'options="' . detect_devices::hasUltra66() . '"');
+ load_multi(qw(ide-probe ide-disk ide-cd));
+}
diff --git a/perl-install/my_gtk.pm b/perl-install/my_gtk.pm
index 40f82f4cd..491680271 100644
--- a/perl-install/my_gtk.pm
+++ b/perl-install/my_gtk.pm
@@ -10,7 +10,7 @@ use vars qw(@ISA %EXPORT_TAGS @EXPORT_OK $border @grabbed);
@ISA = qw(Exporter);
%EXPORT_TAGS = (
helpers => [ qw(create_okcancel createScrolledWindow create_menu create_notebook create_packtable create_hbox create_vbox create_adjustment create_box_with_title create_treeitem) ],
- wrappers => [ qw(gtksignal_connect gtkpack gtkpack_ gtkpack__ gtkappend gtkadd gtktext_insert gtkset_usize gtkset_justify gtkset_active gtkshow gtkdestroy gtkset_mousecursor gtkset_background gtkset_default_fontset) ],
+ wrappers => [ qw(gtksignal_connect gtkpack gtkpack_ gtkpack__ gtkappend gtkadd gtktext_insert gtkset_usize gtkset_justify gtkset_active gtkshow gtkdestroy gtkset_mousecursor gtkset_background gtkset_default_fontset gtkxpm gtkcreate_xpm) ],
ask => [ qw(ask_warn ask_okcancel ask_yesorno ask_from_entry ask_from_list ask_file) ],
);
$EXPORT_TAGS{all} = [ map { @$_ } values %EXPORT_TAGS ];
@@ -180,6 +180,9 @@ sub gtkset_default_fontset($) {
Gtk::Widget->set_default_style($style);
}
+sub gtkcreate_xpm { my $w = shift; Gtk::Gdk::Pixmap->create_from_xpm($w->window, $w->style->bg('normal'), @_) }
+sub xpm_d { my $w = shift; Gtk::Gdk::Pixmap->create_from_xpm_d($w->window, undef, @_) }
+sub gtkxpm { new Gtk::Pixmap(gtkcreate_xpm(@_)) }
#-###############################################################################
#- createXXX functions
@@ -450,7 +453,7 @@ sub _ask_from_entry($$@) {
gtksignal_connect($entry, 'activate' => $f),
($o->{hide_buttons} ? () : create_okcancel($o))),
);
- $entry->grab_focus();
+ $entry->grab_focus;
}
sub _ask_from_list {
@@ -536,7 +539,7 @@ sub _ask_warn($@) {
gtksignal_connect(my $w = new Gtk::Button(_("Ok")), "clicked" => sub { Gtk->main_quit }),
),
);
- $w->grab_focus();
+ $w->grab_focus;
}
sub _ask_okcancel($@) {
@@ -548,7 +551,7 @@ sub _ask_okcancel($@) {
create_okcancel($o, $ok, $cancel),
)
);
- $o->{ok}->grab_focus();
+ $o->{ok}->grab_focus;
}
diff --git a/perl-install/share/keyboards.tar.bz2 b/perl-install/share/keyboards.tar.bz2
index 78085e860..3ac57d229 100644
--- a/perl-install/share/keyboards.tar.bz2
+++ b/perl-install/share/keyboards.tar.bz2
Binary files differ