diff options
author | Pascal Rigaux <pixel@mandriva.com> | 2000-01-02 21:45:04 +0000 |
---|---|---|
committer | Pascal Rigaux <pixel@mandriva.com> | 2000-01-02 21:45:04 +0000 |
commit | b707231329f40f0537da5a7a8a6033cf8bb8fbf5 (patch) | |
tree | 259609acdea36e2678111f5ecea195d202c58bdb /perl-install | |
parent | dba903b20c5e9d89e6dbda4e37d8c87f3b6a4562 (diff) | |
download | drakx-backup-do-not-use-b707231329f40f0537da5a7a8a6033cf8bb8fbf5.tar drakx-backup-do-not-use-b707231329f40f0537da5a7a8a6033cf8bb8fbf5.tar.gz drakx-backup-do-not-use-b707231329f40f0537da5a7a8a6033cf8bb8fbf5.tar.bz2 drakx-backup-do-not-use-b707231329f40f0537da5a7a8a6033cf8bb8fbf5.tar.xz drakx-backup-do-not-use-b707231329f40f0537da5a7a8a6033cf8bb8fbf5.zip |
no_comment
Diffstat (limited to 'perl-install')
-rw-r--r-- | perl-install/Xconfigurator.pm | 2 | ||||
-rw-r--r-- | perl-install/detect_devices.pm | 3 | ||||
-rw-r--r-- | perl-install/fs.pm | 2 | ||||
-rw-r--r-- | perl-install/fsedit.pm | 7 | ||||
-rw-r--r-- | perl-install/install2.pm | 4 | ||||
-rw-r--r-- | perl-install/install_steps.pm | 26 | ||||
-rw-r--r-- | perl-install/install_steps_interactive.pm | 22 | ||||
-rw-r--r-- | perl-install/modules.pm | 37 | ||||
-rw-r--r-- | perl-install/mouse.pm | 2 | ||||
-rw-r--r-- | perl-install/share/compssUsers | 1 |
10 files changed, 72 insertions, 34 deletions
diff --git a/perl-install/Xconfigurator.pm b/perl-install/Xconfigurator.pm index 2b3814faf..644b94a3b 100644 --- a/perl-install/Xconfigurator.pm +++ b/perl-install/Xconfigurator.pm @@ -293,7 +293,7 @@ sub testFinalConfig($;$$) { $mesg = $mesg . "\n" . _("Warning: testing is dangerous on this graphic card"); $def = 0; } - $in->ask_yesorno(_("Test configuration"), $mesg, $def) or return 1; + $auto && $def or $in->ask_yesorno(_("Test configuration"), $mesg, $def) or return 1; unlink "$prefix/tmp/.X9-lock"; diff --git a/perl-install/detect_devices.pm b/perl-install/detect_devices.pm index cea04aebc..f5deb81d6 100644 --- a/perl-install/detect_devices.pm +++ b/perl-install/detect_devices.pm @@ -104,6 +104,9 @@ sub getIDE() { @idi; } +#- do not work if ide-scsi is built in the kernel (aka not in module) +sub getIDEBurners() { uniq map { m!ATAPI.* CD(-R|/RW){1,2} ! ? /(\w+)/ : () } syslog() } + sub getCompaqSmartArray() { my @idi; my $f; diff --git a/perl-install/fs.pm b/perl-install/fs.pm index 88ffb1171..20cbf3798 100644 --- a/perl-install/fs.pm +++ b/perl-install/fs.pm @@ -212,7 +212,7 @@ sub write($$$$) { [ 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: $!"); + 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: $!"); chown 0, 12, "$prefix/dev/$_->{device}"; $useSupermount ? diff --git a/perl-install/fsedit.pm b/perl-install/fsedit.pm index eef623e9e..6060a1cc7 100644 --- a/perl-install/fsedit.pm +++ b/perl-install/fsedit.pm @@ -98,12 +98,13 @@ sub hasRAID { $b; } -sub get_root($) { - my ($fstab) = @_; +sub get_root($;$) { + my ($fstab, $boot) = @_; + if ($boot) { $_->{mntpoint} eq "/boot" and return $_ foreach @$fstab; } $_->{mntpoint} eq "/" and return $_ foreach @$fstab; undef; } -sub get_root_ { get_root([ get_fstab(@{$_[0]}) ]) } +sub get_root_ { get_root([ get_fstab(@{$_[0]}) ], $_[1]) } sub is_one_big_fat { my ($hds) = @_; diff --git a/perl-install/install2.pm b/perl-install/install2.pm index 12007e28d..333ec7abf 100644 --- a/perl-install/install2.pm +++ b/perl-install/install2.pm @@ -28,7 +28,7 @@ use detect_devices; use run_program; use install_steps; -use install_steps_interactive; +#use install_steps_interactive; #-###################################################################################### #- Steps table @@ -91,7 +91,7 @@ my %suggestedPartitions = ( { mntpoint => "/boot", size => 10 << 11, type => 0x83, maxsize => 30 << 11 }, { mntpoint => "/", size => 300 << 11, type => 0x83, ratio => 5, maxsize => 2500 << 11 }, { mntpoint => "swap", size => 64 << 11, type => 0x82, ratio => 1, maxsize => 250 << 11 }, - { mntpoint => "/home", size => 300 << 11, type => 0x83, ratio => 5 }, + { mntpoint => "/home", size => 300 << 11, type => 0x83, ratio => 2 }, ], developer => [ { mntpoint => "/boot", size => 10 << 11, type => 0x83, maxsize => 30 << 11 }, diff --git a/perl-install/install_steps.pm b/perl-install/install_steps.pm index 141cb42c9..9198279c3 100644 --- a/perl-install/install_steps.pm +++ b/perl-install/install_steps.pm @@ -184,6 +184,11 @@ sub choosePackages($$$$) { sub beforeInstallPackages { my ($o) = @_; + $o->{bootloader}{perImageAppend} .= " " . join(" ", grep { /^ide/ } split ' ', cat_("/proc/cmdline")); + if (my @l = detect_devices::getIDEBurners()) { + $o->{bootloader}{perImageAppend} .= " " . join(" ", map { "$_=ide-scsi" } @l); + } + network::add2hosts("$o->{prefix}/etc/hosts", "localhost.localdomain", "127.0.0.1"); require pkgs; pkgs::init_db($o->{prefix}, $o->{isUpgrade}); @@ -454,13 +459,14 @@ sub addUser($) { if (!$_->{name} || getpwnam($_->{name}) || $done{$_->{name}}) { 0; } else { + $_->{home} ||= "/home/$_->{name}"; + my $u = $_->{uid} || ($_->{oldu} = (stat("$p$_->{home}"))[4]); my $g = $_->{gid} || ($_->{oldg} = (stat("$p$_->{home}"))[5]); #- search for available uid above 501 else initscripts may fail to change language for KDE. if (!$u || getpwuid($u)) { for ($u = 501; getpwuid($u) || $uids{$u}; $u++) {} } if (!$g || getgrgid($g)) { for ($g = 501; getgrgid($g) || $gids{$g}; $g++) {} } - $_->{home} ||= "/home/$_->{name}"; $_->{uid} = $u; $uids{$u} = 1; $_->{gid} = $g; $gids{$g} = 1; $_->{pw} ||= $_->{password} && install_any::crypt($_->{password}); @@ -507,7 +513,7 @@ sub createBootdisk($) { return if $::testing; require lilo; - lilo::mkbootdisk($o->{prefix}, install_any::kernelVersion(), $dev); + lilo::mkbootdisk($o->{prefix}, install_any::kernelVersion(), $dev, $o->{bootloader}{perImageAppend}); $o->{mkbootdisk} = $dev; } @@ -544,10 +550,6 @@ sub readBootloaderConfigBeforeInstall { sub setupBootloaderBefore { my ($o) = @_; - $o->{bootloader}{perImageAppend} .= " " . join(" ", grep { /^ide/ } split ' ', cat_("/proc/cmdline")); - if (my $ramsize = $o->{miscellaneous}{memsize} && $o->{bootloader}{perImageAppend} !~ /mem=/) { - $o->{bootloader}{perImageAppend} .= " mem=$ramsize"; - } require lilo; lilo::suggest($o->{prefix}, $o->{bootloader}, $o->{hds}, $o->{fstab}, install_any::kernelVersion()); $o->{bootloader}{keytable} ||= keyboard::keyboard2kmap($o->{keyboard}); @@ -621,6 +623,18 @@ sub miscellaneous { cat_("/proc/cmdline") =~ /mem=(\S+)/; add2hash_($o->{miscellaneous} ||= {}, { numlock => !$o->{pcmcia}, $1 ? (memsize => $1) : () }); + + local $_ = $o->{bootloader}{perImageAppend}; + if (my $ramsize = $o->{miscellaneous}{memsize} and !/mem=/) { + $_ .= " mem=$ramsize"; + } + if (my @l = detect_devices::getIDEBurners() and !/ide-scsi/) { + $_ .= " " . join(" ", map { "$_=ide-scsi" } @l); + } + #- keep some given parameters + $_ .= " " . join(" ", grep { /^ide/ } split ' ', cat_("/proc/cmdline")) unless /ide.=/; + + $o->{bootloader}{perImageAppend} = $_; } #------------------------------------------------------------------------------ diff --git a/perl-install/install_steps_interactive.pm b/perl-install/install_steps_interactive.pm index 7787aee7b..c9009ec78 100644 --- a/perl-install/install_steps_interactive.pm +++ b/perl-install/install_steps_interactive.pm @@ -344,7 +344,7 @@ notation (for example, 1.2.3.4)."), [ _("IP address:"), _("Netmask:"), _("Automatic IP") ], [ \$intf->{IPADDR}, \$intf->{NETMASK}, { val => \$pump, type => "bool", text => _("(bootp/dhcp)") } ], complete => sub { - $intf->{BOOTPROTO} = $pump ? "bootp" : "static"; + $intf->{BOOTPROTO} = $pump ? "dhcp" : "static"; return 0 if $pump; for (my $i = 0; $i < @fields; $i++) { unless (network::is_ip($intf->{$fields[$i]})) { @@ -645,9 +645,10 @@ sub setupBootloader { $o->set_help('setupBootloaderBeginner'); my $boot = $o->{hds}[0]{device}; my $onmbr = "/dev/$boot" eq $b->{boot}; - $b->{boot} = "/dev/$boot" if $o->ask_from_list_(_("LILO Installation"), - _("Where do you want to install the bootloader?"), - \@l, $l[!$onmbr]) eq $l[0]; + $b->{boot} = "/dev/" . ($o->ask_from_list_(_("LILO Installation"), + _("Where do you want to install the bootloader?"), + \@l, $l[!$onmbr]) eq $l[0] + ? $boot : fsedit::get_root($o->{fstab}, 'boot')->{device}); } elsif ($more || !$::beginner) { $o->set_help("setupBootloaderGeneral"); @@ -948,14 +949,14 @@ sub load_thiskind { unless !$::beginner && modules::pcmcia_need_config($o->{pcmcia}) && !$o->ask_yesorno('', _("Try to find PCMCIA cards?"), 1); $w = $o->wait_message(_("PCMCIA"), _("Configuring PCMCIA cards...")) if modules::pcmcia_need_config($pcmcia); - modules::load_thiskind($type, sub { $w = wait_load_module($o, $type, @_) }, $pcmcia); if ($type =~ /scsi/i && cat_("/proc/cmdline") !~ /ide2=/) { log::l("HPT: looking for HPT"); + require pci_probing::main; my @l = grep { $_->[1] =~ /HPT/ } pci_probing::main::probe('STORAGE_OTHER', 'more'); if (@l == 2 && $o->ask_yesorno('', _("Linux does not yet fully support ultra dma 66 HPT. -As a work-around i can make a custom floppy giving access the hard drive on ide2 and ide3"))) { +As a work-around i can make a custom floppy giving access the hard drive on ide2 and ide3"), 1)) { log::l("HPT: found"); my $ide = sprintf "ide2=0x%x,0x%x ide3=0x%x,0x%x", map { my ($a, $b) = (split ' ', $_->[0])[3,4]; @@ -978,6 +979,7 @@ As a work-around i can make a custom floppy giving access the hard drive on ide2 _("Enter a floppy to create an HTP enabled boot (all data on floppy will be lost)")); if (my $fd = install_any::getFile("$image.img")) { + my $w = $o->wait_message('', _("Creating bootdisk")); local *OUT; open OUT, ">$dev" or log::l("failed to write $dev"), return; local $/ = \ (16 * 1024); @@ -990,10 +992,10 @@ _("Enter a floppy to create an HTP enabled boot fs::umount("/floppy"); log::l("HPT: all done"); - $o->ask_okcancel('', $nb_try ? + $o->ask_warn('', $nb_try ? _("It is necessary to restart installation booting on the floppy") : - _("It is necessary to restart installation with the new parameters")) and - install_steps::rebootNeeded($o); + _("It is necessary to restart installation with the new parameters")); + install_steps::rebootNeeded($o); } else { $o->ask_warn('', _("Failed to create an HTP boot floppy. @@ -1001,6 +1003,8 @@ You may have to restart installation and give ``%s'' at the prompt", $ide)); } } } + + modules::load_thiskind($type, sub { $w = wait_load_module($o, $type, @_) }, $pcmcia); } #------------------------------------------------------------------------------ diff --git a/perl-install/modules.pm b/perl-install/modules.pm index 8c2c82cd4..7bae980d5 100644 --- a/perl-install/modules.pm +++ b/perl-install/modules.pm @@ -300,7 +300,23 @@ sub text2driver($) { die "$text is not a valid module description"; } -sub add_alias($$) { $conf{$_[0]}{alias} = $_[1]; } +sub add_alias($$) { + my ($alias, $name); + $conf{$_}{alias} && $conf{$_}{alias} eq $name and return foreach keys %conf; + $alias .= $scsi++ || '' if $alias eq 'scsi_hostadapter'; + $conf{$alias}{alias} ||= $name; + 1; +} + +sub remove_alias($) { + my ($name) = @_; + foreach (keys %conf) { + $conf{$_}{alias} && $conf{$_}{alias} eq $name or next; + delete $conf{$_}{alias}; + return 1; + } + 0; +} sub load { my ($name, $type, @options) = @_; @@ -319,19 +335,20 @@ sub load { push @{$loaded{$type}}, $name; if ($type) { - $conf{usbmouse}{alias} = $name if $type =~ /serial_usb/i; - $conf{'scsi_hostadapter' . ($scsi++ || '')}{alias} = $name if $type eq 'scsi'; + add_alias('usbmouse', $name) if $type =~ /serial_usb/i; + add_alias('scsi_hostadapter', $name) if $type eq 'scsi'; } $conf{$name}{options} = join " ", @options if @options; } -sub unload($) { - my ($m) = @_; +sub unload($;$) { + my ($m, $remove_alias) = @_; if ($::testing) { log::l("rmmod $m"); } else { run_program::run("rmmod", $m) && delete $conf{$m}{loaded}; } + remove_alias($m) if $remove_alias; } sub load_raw($@) { @@ -377,12 +394,12 @@ sub read_conf($;$) { foreach (cat_($file)) { do { $c{$2}{$1} = $3; - $$scsi = max($$scsi, $1 || 0) if /^\s*alias\s+scsi_hostadapter (\d*)/x && $scsi; + $$scsi = max($$scsi, $1 || 0) if /^\s*alias\s+scsi_hostadapter (\d*)/x && $scsi; #- space added to make perl2fcalls happy! } if /^\s*(\S+)\s+(\S+)\s+(.*?)\s*$/; } #- cheating here: not handling aliases of aliases while (my ($k, $v) = each %c) { - $$scsi ||= $v->{scsi_hostadapter} if $scsi; +#- $$scsi ||= $v->{scsi_hostadapter} if $scsi; if (my $a = $v->{alias}) { local $c{$a}{alias}; add2hash($c{$a}, $v); @@ -396,9 +413,9 @@ sub write_conf { my $written = read_conf($file); my %net = detect_devices::net2module(); - while (my ($k, $v) = each %net) { - $conf{$k}{alias} ||= $v; - } + while (my ($k, $v) = each %net) { add_alias($k, $v) } + + add_alias('scsi_hostadapter', 'ide-scsi') if detect_devices::getIDEBurners(); local *F; open F, ">> $file" or die("cannot write module config file $file: $!\n"); diff --git a/perl-install/mouse.pm b/perl-install/mouse.pm index 4ab9c9a32..b7853eb68 100644 --- a/perl-install/mouse.pm +++ b/perl-install/mouse.pm @@ -123,7 +123,7 @@ sub detect() { eval { modules::load($c->[1], "serial_usb") }; sleep(1); do { $wacom or modules::unload("serial"); return name2mouse("USB Mouse"), $wacom } if !$@ && detect_devices::tryOpen("usbmouse"); - modules::unload($c->[1]); + modules::unload($c->[1], 'remove_alias'); } die "mouseconfig failed"; } diff --git a/perl-install/share/compssUsers b/perl-install/share/compssUsers index 5b8b28b2d..827e3c0eb 100644 --- a/perl-install/share/compssUsers +++ b/perl-install/share/compssUsers @@ -68,7 +68,6 @@ Documentation documentation:languages:en documentation:misc documentation:tools - documentation:tools Databases database |