summaryrefslogtreecommitdiffstats
path: root/perl-install
diff options
context:
space:
mode:
authorPascal Rigaux <pixel@mandriva.com>1999-12-01 08:53:47 +0000
committerPascal Rigaux <pixel@mandriva.com>1999-12-01 08:53:47 +0000
commit27968886bf2586682cb1a6f45eb8b485dc6a4257 (patch)
tree8ee761eb8c2fe9067af23fa2d38348284d84ea9f /perl-install
parent11c086f6eb07e76fec02c5627072d52b4d6cd7d8 (diff)
downloaddrakx-27968886bf2586682cb1a6f45eb8b485dc6a4257.tar
drakx-27968886bf2586682cb1a6f45eb8b485dc6a4257.tar.gz
drakx-27968886bf2586682cb1a6f45eb8b485dc6a4257.tar.bz2
drakx-27968886bf2586682cb1a6f45eb8b485dc6a4257.tar.xz
drakx-27968886bf2586682cb1a6f45eb8b485dc6a4257.zip
no_comment
Diffstat (limited to 'perl-install')
-rw-r--r--perl-install/common.pm6
-rw-r--r--perl-install/fs.pm9
-rw-r--r--perl-install/install2.pm51
-rw-r--r--perl-install/install_any.pm48
-rw-r--r--perl-install/install_steps.pm21
-rw-r--r--perl-install/install_steps_gtk.pm11
-rw-r--r--perl-install/install_steps_interactive.pm24
-rw-r--r--perl-install/interactive.pm4
-rw-r--r--perl-install/lang.pm51
-rw-r--r--perl-install/modparm.pm18
-rw-r--r--perl-install/modules.pm2
-rw-r--r--perl-install/mouse.pm2
-rw-r--r--perl-install/partition_table.pm3
13 files changed, 133 insertions, 117 deletions
diff --git a/perl-install/common.pm b/perl-install/common.pm
index 927b863f7..11f5f9b97 100644
--- a/perl-install/common.pm
+++ b/perl-install/common.pm
@@ -54,8 +54,8 @@ sub uniq { my %l; @l{@_} = (); keys %l }
sub to_int { $_[0] =~ /(\d*)/; $1 }
sub to_float { $_[0] =~ /(\d*(\.\d*)?)/; $1 }
sub ikeys { my %l = @_; sort { $a <=> $b } keys %l }
-sub add2hash { my ($a, $b) = @_; while (my ($k, $v) = each %{$b || {}}) { $a->{$k} ||= $v } }
-sub add2hash_ { my ($a, $b) = @_; while (my ($k, $v) = each %{$b || {}}) { exists $a->{$k} or $a->{$k} = $v } }
+sub add2hash($$) { my ($a, $b) = @_; while (my ($k, $v) = each %{$b || {}}) { $a->{$k} ||= $v } }
+sub add2hash_($$) { my ($a, $b) = @_; while (my ($k, $v) = each %{$b || {}}) { exists $a->{$k} or $a->{$k} = $v } }
sub member { my $e = shift; foreach (@_) { $e eq $_ and return 1 } 0 }
sub dirname { @_ == 1 or die "usage: dirname <name>\n"; local $_ = shift; s|[^/]*/*\s*$||; s|(.)/*$|$1|; $_ || '.' }
sub basename { @_ == 1 or die "usage: basename <name>\n"; local $_ = shift; s|/*\s*$||; s|.*/||; $_ }
@@ -446,7 +446,7 @@ sub removeXiBSuffix($) {
sub formatTime($) {
my ($s, $m, $h) = gmtime($_[0]);
- sprintf "%02d:%02d:%02d", $h, $m, 10 * int (($s + 5) / 10);
+ sprintf "%02d:%02d:%02d", $h, $m, $s;
}
diff --git a/perl-install/fs.pm b/perl-install/fs.pm
index 5e0bee90d..6ccc8d909 100644
--- a/perl-install/fs.pm
+++ b/perl-install/fs.pm
@@ -195,20 +195,23 @@ sub write($$$) {
open F, "> $prefix/etc/mtab" or die "error resetting $prefix/etc/mtab";
my @to_add = (
- [ split ' ', '/dev/fd0 /mnt/floppy auto sync,user,noauto,nosuid,nodev,unhide 0 0' ],
+#- [ split ' ', '/dev/fd0 /mnt/floppy auto sync,user,noauto,nosuid,nodev,unhide 0 0' ],
+ [ split ' ', '/mnt/floppy /mnt/floppy supermount fs=vfat,dev=/dev/fd0 0 0' ],
[ split ' ', 'none /proc proc defaults 0 0' ],
[ split ' ', 'none /dev/pts devpts mode=0620 0 0' ],
(map_index {
my $i = $::i ? $::i + 1 : '';
mkdir "$prefix/mnt/cdrom$i", 0755 or log::l("failed to mkdir $prefix/mnt/cdrom$i: $!");
symlinkf $_->{device}, "$prefix/dev/cdrom$i" or log::l("failed to symlink $prefix/dev/cdrom$i: $!");
- [ "/dev/cdrom$i", "/mnt/cdrom$i", "auto", "user,noauto,nosuid,exec,nodev,ro", 0, 0 ];
+#- [ "/dev/cdrom$i", "/mnt/cdrom$i", "auto", "user,noauto,nosuid,exec,nodev,ro", 0, 0 ];
+ [ "/mnt/cdrom$i", "/mnt/cdrom$i", "supermount", "fs=iso9660,dev=/dev/cdrom$i", 0, 0 ];
} detect_devices::cdroms()),
(map_index { #- for zip drives, the right partition is the 4th.
my $i = $::i ? $::i + 1 : '';
mkdir "$prefix/mnt/zip$i", 0755 or log::l("failed to mkdir $prefix/mnt/zip$i: $!");
symlinkf "$_->{device}4", "$prefix/dev/zip$i" or log::l("failed to symlink $prefix/dev/zip$i: $!");
- [ "/dev/zip$i", "/mnt/zip$i", "auto", "user,noauto,nosuid,exec,nodev", 0, 0 ];
+#- [ "/dev/zip$i", "/mnt/zip$i", "auto", "user,noauto,nosuid,exec,nodev", 0, 0 ];
+ [ "/mnt/zip$i", "/mnt/zip$i", "supermount", "fs=vfat,dev=/dev/zip$i", 0, 0 ];
} detect_devices::zips()));
write_fstab($fstab, $prefix, @to_add);
}
diff --git a/perl-install/install2.pm b/perl-install/install2.pm
index 83c30f8bc..d714d08e7 100644
--- a/perl-install/install2.pm
+++ b/perl-install/install2.pm
@@ -18,19 +18,14 @@ use commands;
use network;
use lang;
use keyboard;
-use lilo;
use mouse;
use fs;
use raid;
-use timezone;
use fsedit;
use devices;
use partition_table qw(:types);
-use pkgs;
-use printer;
use modules;
use detect_devices;
-use modparm;
use run_program;
use install_steps;
@@ -38,8 +33,12 @@ use install_steps;
#-######################################################################################
#- Steps table
#-######################################################################################
-my @installStepsFields = qw(text redoable onError hidden needs entered reachable toBeDone help next done);
-my @installSteps = (
+
+my (%installSteps, @orderedInstallSteps);
+{
+ my @installStepsFields = qw(text redoable onError hidden needs);
+ #entered reachable toBeDone help next done;
+ my @installSteps = (
selectLanguage => [ __("Choose your language"), 1, 1, '' ],
selectInstallClass => [ __("Select installation class"), 1, 1, '' ],
setupSCSI => [ __("Setup SCSI"), 1, 0, '' ],
@@ -63,23 +62,19 @@ my @installSteps = (
configureX => [ __("Configure X"), 1, 0, '', ["formatPartitions", "setupBootloader"] ],
exitInstall => [ __("Exit install"), 0, 0, 'beginner' ],
);
-
-my (%installSteps, %upgradeSteps, @orderedInstallSteps, @orderedUpgradeSteps);
-
-for (my $i = 0; $i < @installSteps; $i += 2) {
- my %h; @h{@installStepsFields} = @{ $installSteps[$i + 1] };
- $h{help} = $help::steps{$installSteps[$i]} || __("Help");
- $h{previous}= $installSteps[$i - 2] if $i >= 2;
- $h{next} = $installSteps[$i + 2];
- $h{entered} = 0;
- $h{onError} = $installSteps[$i + 2 * $h{onError}];
- $h{reachable} = !$h{needs};
- $installSteps{ $installSteps[$i] } = \%h;
- push @orderedInstallSteps, $installSteps[$i];
+ for (my $i = 0; $i < @installSteps; $i += 2) {
+ my %h; @h{@installStepsFields} = @{ $installSteps[$i + 1] };
+ $h{help} = $help::steps{$installSteps[$i]} || __("Help");
+ $h{previous}= $installSteps[$i - 2] if $i >= 2;
+ $h{next} = $installSteps[$i + 2];
+ $h{entered} = 0;
+ $h{onError} = $installSteps[$i + 2 * $h{onError}];
+ $h{reachable} = !$h{needs};
+ $installSteps{ $installSteps[$i] } = \%h;
+ push @orderedInstallSteps, $installSteps[$i];
+ }
+ $installSteps{first} = $installSteps[0];
}
-
-$installSteps{first} = $installSteps[0];
-
#-#####################################################################################
#-INTERN CONSTANT
#-#####################################################################################
@@ -92,7 +87,7 @@ my @install_classes = (__("beginner"), __("developer"), __("server"), __("expert
#-#####################################################################################
#- partition layout
my %suggestedPartitions = (
- normal => my $b = [
+ normal => [
{ mntpoint => "/boot", size => 10 << 11, type => 0x83, maxsize => 30 << 11 },
{ mntpoint => "/", size => 300 << 11, type => 0x83, ratio => 5, maxsize => 1500 << 11 },
{ mntpoint => "swap", size => 64 << 11, type => 0x82, ratio => 1, maxsize => 250 << 11 },
@@ -187,8 +182,6 @@ $o = $::o = {
steps => \%installSteps,
orderedSteps => \@orderedInstallSteps,
- crypto => { mirror => "leia" },
-
base => [ qw(basesystem sed initscripts console-tools mkbootdisk utempter ldconfig chkconfig ntsysv setup filesystem SysVinit bdflush crontabs dev e2fsprogs etcskel fileutils findutils getty_ps grep gzip hdparm info initscripts isapnptools kernel less ldconfig lilo logrotate losetup man mkinitrd mingetty modutils mount net-tools passwd procmail procps psmisc mandrake-release rootfiles rpm sash ash setserial shadow-utils sh-utils stat sysklogd tar termcap textutils time tmpwatch util-linux vim-minimal vixie-cron which perl-base msec) ],
#-GOLD base => [ qw(basesystem sed initscripts console-tools mkbootdisk anacron utempter ldconfig chkconfig ntsysv mktemp setup filesystem SysVinit bdflush crontabs dev e2fsprogs etcskel fileutils findutils getty_ps grep groff gzip hdparm info initscripts isapnptools kbdconfig kernel less ldconfig lilo logrotate losetup man mkinitrd mingetty modutils mount net-tools passwd procmail procps psmisc mandrake-release rootfiles rpm sash ash setconsole setserial shadow-utils sh-utils slocate stat sysklogd tar termcap textutils time tmpwatch util-linux vim-minimal vixie-cron which cpio perl) ],
@@ -334,6 +327,7 @@ sub formatPartitions {
#------------------------------------------------------------------------------
sub choosePackages {
+ require pkgs;
$o->setPackages if $_[1] == 1;
$o->selectPackagesToUpgrade($o) if $o->{isUpgrade} && $_[1] == 1;
unless ($o->{isUpgrade}) {
@@ -388,6 +382,7 @@ sub configureTimezone {
my ($clicked) = @_;
my $f = "$o->{prefix}/etc/sysconfig/clock";
+ require timezone;
if ($o->{isUpgrade} && -r $f && -s $f > 0) {
return if $_[1] == 1 && !$clicked;
#- can't be done in install cuz' timeconfig %post creates funny things
@@ -523,13 +518,14 @@ sub main {
#- make sure we don't pick up any gunk from the outside world
$ENV{PATH} = "/usr/bin:/bin:/sbin:/usr/sbin:/usr/X11R6/bin:$o->{prefix}/sbin:$o->{prefix}/bin:$o->{prefix}/usr/sbin:$o->{prefix}/usr/bin:$o->{prefix}/usr/X11R6/bin" unless $::g_auto_install;
+ $o->{interactive} ||= 'gtk';
if ($o->{interactive} eq "gtk" && availableMemory < 24 * 1024) {
log::l("switching to newt install cuz not enough memory");
$o->{interactive} = "newt";
}
if ($::auto_install) {
- require 'install_steps_auto_install.pm';
+ require install_steps_auto_install;
eval { $o = $::o = install_any::loadO($o, "floppy") };
if ($@) {
log::l("error using auto_install, continuing");
@@ -570,7 +566,6 @@ sub main {
modules::load_deps("/modules/modules.dep");
modules::read_stage1_conf("/tmp/conf.modules");
modules::read_already_loaded();
- modparm::read_modparm_file(-e "modparm.lst" ? "modparm.lst" : "/usr/share/modparm.lst");
#-the main cycle
my $clicked = 0;
diff --git a/perl-install/install_any.pm b/perl-install/install_any.pm
index 185fa4780..00d869cff 100644
--- a/perl-install/install_any.pm
+++ b/perl-install/install_any.pm
@@ -22,9 +22,7 @@ use devices;
use fsedit;
use network;
use modules;
-use lilo;
use detect_devices;
-use pkgs;
use fs;
use log;
@@ -43,10 +41,10 @@ sub relGetFile($) {
sub getFile($) {
local $^W = 0;
if ($::o->{method} && $::o->{method} eq "ftp") {
- require 'ftp.pm';
+ require ftp;
*install_any::getFile = \&ftp::getFile;
} elsif ($::o->{method} && $::o->{method} eq "http") {
- require 'http.pm';
+ require http;
*install_any::getFile = \&http::getFile;
} else {
*install_any::getFile = sub($) {
@@ -113,6 +111,7 @@ sub getAvailableSpace {
sub setPackages($) {
my ($o) = @_;
+ require pkgs;
if (is_empty_hash_ref($o->{packages})) {
my $useHdlist = $o->{method} !~ /nfs|hd/ || $o->{isUpgrade};
eval { $o->{packages} = pkgs::psUsingHdlist() } if $useHdlist;
@@ -120,7 +119,8 @@ sub setPackages($) {
push @{$o->{default_packages}}, "nfs-utils-clients" if $o->{method} eq "nfs";
push @{$o->{default_packages}}, "numlock" if $o->{miscellaneous}{numlock};
- push @{$o->{default_packages}}, "kernel-smp" if detect_devices::hasSMP();
+ push @{$o->{default_packages}}, "kernel-secure" if $o->{security} > 3;
+ push @{$o->{default_packages}}, "kernel-smp" if $o->{security} <= 3 && detect_devices::hasSMP(); #- no need for kernel-smp if we have kernel-secure which is smp
push @{$o->{default_packages}}, "kernel-pcmcia-cs" if $o->{pcmcia};
push @{$o->{default_packages}}, "raidtools" if !is_empty_hash_ref($o->{raid});
@@ -152,6 +152,7 @@ sub setPackages($) {
sub selectPackagesToUpgrade($) {
my ($o) = @_;
+ require pkgs;
pkgs::selectPackagesToUpgrade($o->{packages}, $o->{prefix}, $o->{base});
}
@@ -355,33 +356,37 @@ sub setupFB {
my ($o, $vga) = @_;
#- install needed packages for frame buffer.
+ require pkgs;
pkgs::select($o->{packages}, $o->{packages}{'kernel-fb'});
pkgs::select($o->{packages}, $o->{packages}{'XFree86-FBDev'});
$o->installPackages($o->{packages});
$vga ||= 785; #- assume at least 640x480x16.
+ require lilo;
#- update lilo entries with a new fb label. a bit hack unless
#- a frame buffer kernel is used, in such case we use it instead
#- with the right mode, nothing more to do.
- if ($o->{bootloader}{entries}{'/boot/vmlinuz-smp'}) {
- $o->{bootloader}{entries}{'/boot/vmlinuz-smp'}{vga} = $vga;
- lilo::install($o->{prefix}, $o->{bootloader});
- } else {
- my $root = $o->{bootloader}{entries}{'/boot/vmlinuz'}{root};
- if (lilo::add_kernel($o->{prefix}, $o->{bootloader}, kernelVersion(), 'fb',
- {
- label => 'linux-fb',
- root => $root,
- vga => $vga,
- })) {
- $o->{bootloader}{default} = 'linux-fb';
+ foreach (qw(secure smp)) {
+ if ($o->{bootloader}{entries}{"/boot/vmlinuz-$_"}) {
+ $o->{bootloader}{entries}{"/boot/vmlinuz-$_"}{vga} = $vga;
lilo::install($o->{prefix}, $o->{bootloader});
- } else {
- log::l("unable to install kernel with frame buffer support, disabling");
- return 0;
+ return 1;
}
}
+ my $root = $o->{bootloader}{entries}{'/boot/vmlinuz'}{root};
+ if (lilo::add_kernel($o->{prefix}, $o->{bootloader}, kernelVersion(), 'fb',
+ {
+ label => 'linux-fb',
+ root => $root,
+ vga => $vga,
+ })) {
+ $o->{bootloader}{default} = 'linux-fb';
+ lilo::install($o->{prefix}, $o->{bootloader});
+ } else {
+ log::l("unable to install kernel with frame buffer support, disabling");
+ return 0;
+ }
1;
}
@@ -396,7 +401,7 @@ sub g_auto_install(;$) {
my @fields = qw(mntpoint type size);
$o->{partitions} = [ map { my %l; @l{@fields} = @$_{@fields}; \%l } grep { $_->{mntpoint} } @{$::o->{fstab}} ];
- exists $::o->{$_} and $o->{$_} = $::o->{$_} foreach qw(lang autoSCSI authentication printer mouse netc timezone superuser intf keyboard mkbootdisk base users installClass partitioning isUpgrade manualFstab nomouseprobe crypto); #- TODO modules bootloader
+ exists $::o->{$_} and $o->{$_} = $::o->{$_} foreach qw(lang autoSCSI authentication printer mouse netc timezone superuser intf keyboard mkbootdisk base users installClass partitioning isUpgrade manualFstab nomouseprobe crypto modem); #- TODO modules bootloader
if (my $card = $::o->{X}{card}) {
$o->{X}{card}{$_} = $card->{$_} foreach qw(default_depth);
@@ -446,6 +451,7 @@ sub loadO {
sub pkg_install {
my ($o, $name) = @_;
+ require pkgs;
pkgs::select($o->{packages}, $o->{packages}{$name} || die "$name rpm not found");
install_steps::installPackages ($o, $o->{packages});
}
diff --git a/perl-install/install_steps.pm b/perl-install/install_steps.pm
index 0dcff61fd..50ebd11b4 100644
--- a/perl-install/install_steps.pm
+++ b/perl-install/install_steps.pm
@@ -10,19 +10,11 @@ use common qw(:file :system :common :functional);
use install_any qw(:all);
use partition_table qw(:types);
use detect_devices;
-use timezone;
-use Xconfig;
-use Xconfigurator;
use modules;
-use class_discard;
use run_program;
-use crypto;
-use lilo;
use lang;
use raid;
use keyboard;
-use printer;
-use pkgs;
use log;
use fsedit;
use commands;
@@ -193,6 +185,7 @@ sub beforeInstallPackages {
my ($o) = @_;
network::add2hosts("$o->{prefix}/etc/hosts", "localhost.localdomain", "127.0.0.1");
+ require pkgs;
pkgs::init_db($o->{prefix}, $o->{isUpgrade});
}
@@ -327,6 +320,8 @@ sub installCrypto {
open F, "$dir/$_[0]" or return;
*F;
};
+ require crypto;
+ require pkgs;
while (crypto::get($u->{mirror}, $dir,
grep { !$done{$_} && ($done{$_} = $u->{packages}{$_}) } %{$u->{packages}})) {
$packages = pkgs::psUsingDirectory($dir);
@@ -359,6 +354,7 @@ sub pcmciaConfig($) {
#------------------------------------------------------------------------------
sub timeConfig {
my ($o, $f) = @_;
+ require timezone;
timezone::write($o->{prefix}, $o->{timezone}, $f);
}
@@ -368,7 +364,8 @@ sub servicesConfig {}
sub printerConfig {
my($o) = @_;
if ($o->{printer}{complete}) {
-
+ require printer;
+ require pkgs;
pkgs::select($o->{packages}, $o->{packages}{'rhs-printfilters'});
$o->installPackages($o->{packages});
@@ -465,6 +462,7 @@ sub createBootdisk($) {
return if $::testing;
+ require lilo;
lilo::mkbootdisk($o->{prefix}, install_any::kernelVersion(), $dev);
$o->{mkbootdisk} = $dev;
}
@@ -473,6 +471,7 @@ sub createBootdisk($) {
sub readBootloaderConfigBeforeInstall {
my ($o) = @_;
my ($image, $v);
+ require lilo;
add2hash($o->{bootloader} ||= {}, lilo::read($o->{prefix}, "/etc/lilo.conf"));
#- since kernel or kernel-smp may not be upgraded, it should be checked
@@ -502,6 +501,7 @@ sub readBootloaderConfigBeforeInstall {
sub setupBootloaderBefore {
my ($o) = @_;
$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});
}
@@ -518,6 +518,7 @@ sub setupXfreeBefore {
$o->{X}{keyboard}{xkb_keymap} ||= keyboard::keyboard2xkb($o->{keyboard});
$o->{X}{mouse} = $o->{mouse};
+ require Xconfig;
Xconfig::getinfoFromDDC($o->{X});
#- keep this here if the package has to be updated.
@@ -527,6 +528,8 @@ sub setupXfree {
my ($o) = @_;
$o->setupXfreeBefore;
+ require Xconfigurator;
+ require class_discard;
{ local $::testing = 0; #- unset testing
local $::auto = 1;
local $::skiptest = 1;
diff --git a/perl-install/install_steps_gtk.pm b/perl-install/install_steps_gtk.pm
index 3c3f288c1..8414c897a 100644
--- a/perl-install/install_steps_gtk.pm
+++ b/perl-install/install_steps_gtk.pm
@@ -19,16 +19,12 @@ use fsedit;
use keyboard;
use network;
use modules;
-use printer;
use install_steps;
use run_program;
use install_steps_interactive;
-use Xconfigurator;
-use Xconfig;
use interactive_gtk;
use install_any;
use diskdrake;
-use pkgs;
use log;
use help;
use lang;
@@ -269,6 +265,7 @@ sub choosePackages {
my ($o, $packages, $compss, $compssUsers, $first_time) = @_;
if ($::beginner) {
+ require pkgs;
pkgs::setSelectedFromCompssList($o->{compssListLevels}, $o->{packages}, install_any::getAvailableSpace($o) * 0.7, $o->{installClass}, $o->{lang}, $o->{isUpgrade});
} else {
install_steps_interactive::choosePackages(@_);
@@ -499,7 +496,7 @@ sub installPackages {
my $w = my_gtk->new(_("Installing"), grab => 1);
$w->{window}->set_usize($windowwidth * 0.8, $windowheight * 0.5);
my $text = new Gtk::Label;
- my ($msg, $msg_time_remaining, $msg_time_total) = map { new Gtk::Label } '', (_("Estimating")) x 2;
+ my ($msg, $msg_time_remaining, $msg_time_total) = map { new Gtk::Label($_) } '', (_("Estimating")) x 2;
my ($progress, $progress_total) = map { new Gtk::ProgressBar } (1..2);
gtkadd($w->{window}, gtkadd(new Gtk::EventBox,
gtkpack(new Gtk::VBox(0,10),
@@ -540,8 +537,8 @@ sub installPackages {
$progress_total->update($ratio);
if ($dtime != $last_dtime && $current_total_size > 2 * 1024 * 1024) {
- $msg_time_total->set(formatTime($total_time));
- $msg_time_remaining->set(formatTime(max($total_time - $dtime, 0)));
+ $msg_time_total->set(formatTime(10 * round($total_time / 10)));
+ $msg_time_remaining->set(formatTime(10 * round(max($total_time - $dtime, 0) / 10)));
$last_dtime = $dtime;
}
$w->flush;
diff --git a/perl-install/install_steps_interactive.pm b/perl-install/install_steps_interactive.pm
index e26530631..8d4cab630 100644
--- a/perl-install/install_steps_interactive.pm
+++ b/perl-install/install_steps_interactive.pm
@@ -13,28 +13,20 @@ use vars qw(@ISA $global_wait);
use common qw(:common :file :functional :system);
use partition_table qw(:types);
use install_steps;
-use pci_probing::main;
-use Xconfig;
-use Xconfigurator;
use install_any;
use detect_devices;
-use timezone;
use run_program;
use commands;
use fsedit;
use network;
-use crypto;
use raid;
use mouse;
use modules;
use lang;
-use pkgs;
use keyboard;
use fs;
-use modparm;
use log;
-use printerdrake;
-use lilo;
+
#-######################################################################################
#- In/Out Steps Functions
#-######################################################################################
@@ -237,6 +229,7 @@ sub selectPackagesToUpgrade {
sub choosePackages {
my ($o, $packages, $compss, $compssUsers) = @_;
+ require pkgs;
$o->ask_many_from_list_ref('',
_("Package Group Selection"),
[ keys %$compssUsers ],
@@ -262,7 +255,7 @@ sub installPackages {
$total = $_[2];
} elsif ($m =~ /^Starting installing package/) {
my $name = $_[0];
- $w->set(_("Installing package %s\n%d%%", $name, 100 * $current / $total));
+ $w->set(_("Installing package %s\n%d%%", $name, $total && 100 * $current / $total));
$current += c::headerGetEntry($o->{packages}{$name}{header}, 'size');
} else { unshift @_, $m; goto $old }
};
@@ -419,8 +412,9 @@ sub installCrypto {
"Do you want to download cryptographic packages?
(! !)
") || return;
-
- $u->{mirror} = crypto::text2mirror($o->ask_from_list('', _("Choose a mirror from which to get the packages"), [ crypto::mirrorstext ], crypto::mirror2text($u->{mirror})));
+
+ require crypto;
+ $u->{mirror} = crypto::text2mirror($o->ask_from_list('', _("Choose a mirror from which to get the packages"), [ crypto::mirrorstext() ], crypto::mirror2text($u->{mirror})));
my @packages = do {
my $w = $o->wait_message('', _("Contacting the mirror to get the list of available packages"));
@@ -437,6 +431,7 @@ sub installCrypto {
sub timeConfig {
my ($o, $f, $clicked) = @_;
+ require timezone;
$o->{timezone}{timezone} ||= timezone::bestTimezone(lang::lang2text($o->{lang}));
$o->{timezone}{timezone} = $o->ask_from_list('', _("Which is your timezone?"), [ timezone::getTimeZones($::g_auto_install ? '' : $o->{prefix}) ], $o->{timezone}{timezone});
$o->{timezone}{GMT} = $o->ask_yesorno('', _("Is your hardware clock set to GMT?"), $o->{timezone}{GMT}) if $::expert || $clicked;
@@ -454,6 +449,7 @@ sub printerConfig($) {
$o->{printer}{want});
return if !$o->{printer}{want};
+ require printerdrake;
printerdrake::main($o->{prefix}, $o->{printer}, $o, sub { install_any::pkg_install($o, $_[0]) });
}
@@ -761,6 +757,8 @@ sub setupXfree {
my ($o) = @_;
$o->setupXfreeBefore;
+ require Xconfig;
+ require Xconfigurator;
#- by default do not use existing configuration, so new card will be detected.
if ($o->{isUpgrade} && -r "$o->{prefix}/etc/X11/XF86Config") {
unless ($::beginner || !$o->ask_yesorno('', _("Use existing configuration for X11?"), 0)) {
@@ -833,6 +831,7 @@ sub load_module {
[ modules::text_of_type($type) ]) or return;
my $m = modules::text2driver($l);
+ require modparm;
my @names = modparm::get_options_name($m);
if ((@names != 0) && $o->ask_from_list_('',
@@ -903,6 +902,7 @@ sub setup_thiskind {
push @l, \@r;
} else {
eval { commands::modprobe("isapnp") };
+ require pci_probing::main;
$o->ask_warn('', [ pci_probing::main::list(), scalar cat_("/proc/isapnp") ]);
}
}
diff --git a/perl-install/interactive.pm b/perl-install/interactive.pm
index a71f27197..dd92bd004 100644
--- a/perl-install/interactive.pm
+++ b/perl-install/interactive.pm
@@ -40,12 +40,12 @@ sub new($) {
sub vnew {
if (c::Xtest($ENV{DISPLAY} ||= ":0")) {
- require 'interactive_gtk.pm';
+ require interactive_gtk;
interactive_gtk->new;
} else {
undef *log::l;
*log::l = sub {}; # otherwise, it will bother us :(
- require 'interactive_newt.pm';
+ require interactive_newt;
interactive_newt->new;
}
}
diff --git a/perl-install/lang.pm b/perl-install/lang.pm
index 9838fc2aa..cb5d4346f 100644
--- a/perl-install/lang.pm
+++ b/perl-install/lang.pm
@@ -6,7 +6,7 @@ use strict;
#-######################################################################################
#- misc imports
#-######################################################################################
-use common qw(:file);
+use common qw(:common :file :system);
use commands;
use log;
@@ -67,6 +67,23 @@ my %languages = (
'zh_CN' => [ 'Chinese (GuoBiao)', 'gb2312', 'zh_CN', 'zh_CN.gb2312:zh' ],
);
+my %xim = (
+ 'zh_TW.Big5' => {
+ ENC => 'big5',
+ XIM => 'xcin',
+ XMODIFIERS => '"@im=xcin"',
+ },
+ 'zh_CN' => {
+ ENC => 'gb',
+ XIM => 'xcin-zh_CN.GB2312',
+ XMODIFIERS => '"@im=xcin-zh_CN.GB2312"',
+ },
+ 'ko' => {
+ XIM => 'ami',
+ XMODIFIERS => '"@im=ami"',
+ },
+);
+
sub std2 { "-mdk-helvetica-medium-r-normal-*-*-$_[1]-*-*-*-*-$_[0]" }
sub std_ { std2($_[0], 100), std2($_[0], 100) }
sub std { std2($_[0], 100), std2($_[0], 80) }
@@ -74,9 +91,9 @@ sub std { std2($_[0], 100), std2($_[0], 80) }
my %charsets = (
"armscii-8" => [ "arm8", "armscii8", std_("armscii-8") ],
#- chinese needs special console driver for text mode
- "Big5" => [ "?????", "????",
+ "Big5" => [ undef, undef,
"-*-*-*-*-*-*-*-*-*-*-*-*-big5-0" ],
- "gb2312" => [ "?????", "????",
+ "gb2312" => [ undef, undef,
"-isas-song ti-medium-r-normal--16-*-*-*-*-*-gb2312.1980-0" ],
"iso-8859-1" => [ "lat0-sun16", "iso15", std("iso8859-1") ],
"iso-8859-2" => [ "lat2-sun16", "iso02", std("iso8859-2") ],
@@ -91,18 +108,18 @@ my %charsets = (
#- (and gtk support isn't done yet)
"iso-8859-8" => [ "iso08.f16", "iso08", std_("iso8859-8") ],
"iso-8859-9" => [ "lat5-16", "iso09", std("iso8859-9") ],
- "iso-8859-13" => [ "??????", "?????", std_("iso8859-13") ],
- "iso-8859-14" => [ "??????", "?????", std_("iso8859-14") ],
+ "iso-8859-13" => [ "??????", undef, std_("iso8859-13") ],
+ "iso-8859-14" => [ "??????", undef, std_("iso8859-14") ],
"iso-8859-15" => [ "lat0-sun16", "iso15", std("iso8859-15") ],
#- japanese needs special console driver for text mode [kon2]
- "jisx0208" => [ "????", "????",
+ "jisx0208" => [ undef, undef,
"-*-*-*-*-*-*-*-*-*-*-*-*-jisx*.*-0" ],
"koi8-r" => [ "Cyr_a8x16", "koi2alt", std("koi8-r") ],
"koi8-u" => [ "ruscii_8x16", "koi2alt", std("koi8-u") ],
#- korean needs special console driver for text mode
- "ksc5601" => [ "?????", "?????",
+ "ksc5601" => [ undef, undef,
"-*-*-*-*-*-*-*-*-*-*-*-*-ksc5601.1987-*" ],
- "tis620" => [ "????", "????", std2("tis620.2533-1",120) ],
+ "tis620" => [ undef, undef, std2("tis620.2533-1",120) ],
"tcvn" => [ "tcvn8x16", "tcvn", std2("tcvn-5712", 130), std2("tcvn-5712", 100) ],
"viscii" => [ "viscii10-8x16", "viscii",
"-*-*-*-*-*-*-*-*-*-*-*-*-viscii1.1-1" ],
@@ -144,20 +161,14 @@ sub write {
my $lang = $ENV{LC_ALL};
$lang or return;
- local *F;
- open F, "> $prefix/etc/sysconfig/i18n" or die "failed to reset $prefix/etc/sysconfig/i18n for writing";
- my $f = sub { $_[1] and print F "$_[0]=$_[1]\n"; };
- &$f("LC_ALL", $lang);
+ my $h = { LC_ALL => $lang };
if (my $l = $languages{$lang}) {
- &$f("LANG", $l->[2]);
- &$f("LANGUAGE", $l->[3]);
- &$f("LINGUAS", $l->[3]);
+ add2hash $h, { LANG => $l->[2], LANGUAGE => $l->[2], LINGUAS => $l->[3] };
- $l->[1] or return;
- if (my $c = $charsets{$l->[1]}) {
- &$f("SYSFONT", $c->[0]);
- &$f("SYSFONTACM", $c->[1]);
+ my $c = $charsets{$l->[1] || ''};
+ if ($c && $c->[0] && $c->[1]) {
+ add2hash $h, { SYSFONT => $c->[0], SYSFONTACM => $c->[1] };
my $p = "$prefix/usr/lib/kbd";
commands::cp("-f",
@@ -165,7 +176,9 @@ sub write {
glob_("$p/consoletrans/$c->[1]*"),
"$prefix/etc/sysconfig/console");
}
+ add2hash $h, $xim{$lang};
}
+ setVarsInSh("$prefix/etc/sysconfig/i18n", $h);
}
sub load_po($) {
diff --git a/perl-install/modparm.pm b/perl-install/modparm.pm
index 652f4aa24..067c2477e 100644
--- a/perl-install/modparm.pm
+++ b/perl-install/modparm.pm
@@ -10,18 +10,15 @@ use common qw(:common :functional);
use log;
-#-#####################################################################################
-#- Globals
-#-#####################################################################################
-my %modparm_hash;
#-######################################################################################
#- Functions
#-######################################################################################
-sub read_modparm_file($) {
- my ($file) = @_;
+sub read_modparm_file {
+ my $file = -e "modparm.lst" ? "modparm.lst" : "/usr/share/modparm.lst";
my @line;
+ my %modparm_hash;
local *F;
open F, $file or log::l("missing $file: $!"), return;
foreach (<F>) {
@@ -34,24 +31,25 @@ sub read_modparm_file($) {
desc => $line [4],
};
}
+ \%modparm_hash;
}
sub get_options_result($@) {
my ($module, @value) = @_;
+ my $modparm_hash = modparm::read_modparm_file;
mapn {
my ($a, $b) = @_;
$a ? "$b=$a" : ()
- } \@value, [ keys %{$modparm_hash{$module}} ];
+ } \@value, [ keys %{$modparm_hash->{$module}} ];
}
sub get_options_name($) {
my ($module) = @_;
my @names;
+ my $modparm_hash = modparm::read_modparm_file;
- %modparm_hash or return;
-
- while (my ($k, $v) = each %{$modparm_hash{$module} || {}}) {
+ while (my ($k, $v) = each %{$modparm_hash->{$module} || {}}) {
my $opttype = $v->{type};
my $default = $v->{default};
push @names, "$k ($v->{type})" . (defined($v->{default}) && "[$v->{default}]");
diff --git a/perl-install/modules.pm b/perl-install/modules.pm
index 783b25e01..b671de21e 100644
--- a/perl-install/modules.pm
+++ b/perl-install/modules.pm
@@ -3,7 +3,6 @@ package modules;
use vars qw(%loaded %drivers);
use common qw(:common :file);
-use pci_probing::main;
use detect_devices;
use run_program;
use log;
@@ -399,6 +398,7 @@ sub read_stage1_conf {
sub load_thiskind($;&$) {
my ($type, $f, $pcic) = @_;
+ require pci_probing::main;
my @pcidevs = pci_probing::main::probe($type);
log::l("pci probe found " . scalar @pcidevs . " $type devices");
diff --git a/perl-install/mouse.pm b/perl-install/mouse.pm
index f535ffcc2..056f3749f 100644
--- a/perl-install/mouse.pm
+++ b/perl-install/mouse.pm
@@ -8,7 +8,6 @@ use strict;
#-######################################################################################
use common qw(:common :system :functional :file);
use modules;
-use pci_probing::main;
use detect_devices;
use run_program;
use devices;
@@ -117,6 +116,7 @@ sub detect() {
#- @l{qw(FULLNAME nbuttons MOUSETYPE XMOUSETYPE device)} = split("\n", `mouseconfig --nointeractive 2>/dev/null`) and return \%l;
#- modules::unload("serial");
+ require pci_probing::main;
if (my ($c) = pci_probing::main::probe("serial_usb")) {
eval { modules::load($c->[1], "serial_usb") };
sleep(1);
diff --git a/perl-install/partition_table.pm b/perl-install/partition_table.pm
index 92cb9eb2a..6443c6e35 100644
--- a/perl-install/partition_table.pm
+++ b/perl-install/partition_table.pm
@@ -6,7 +6,7 @@ use vars qw(@ISA %EXPORT_TAGS @EXPORT_OK @important_types @fields2save);
@ISA = qw(Exporter);
%EXPORT_TAGS = (
- types => [ qw(type2name type2fs name2type fs2type isExtended isExt2 isSwap isDos isWin isFat isPrimary isNfs isRAID) ],
+ types => [ qw(type2name type2fs name2type fs2type isExtended isExt2 isSwap isDos isWin isFat isPrimary isNfs isSupermount isRAID) ],
);
@EXPORT_OK = map { @$_ } values %EXPORT_TAGS;
@@ -174,6 +174,7 @@ sub isDos($) { $ {{ 1=>1, 4=>1, 6=>1 }}{$_[0]{type}} }
sub isWin($) { $ {{ 0xb=>1, 0xc=>1, 0xe=>1 }}{$_[0]{type}} }
sub isFat($) { isDos($_[0]) || isWin($_[0]) }
sub isNfs($) { $_[0]{type} eq 'nfs' } #- small hack
+sub isSupermount($) { $_[0]{type} eq 'supermount' }
sub isPrimary($$) {
my ($part, $hd) = @_;