From e9d5cd96b2054cad8cca21bc1e7c10e4f4e135ed Mon Sep 17 00:00:00 2001 From: Pascal Rigaux Date: Sun, 7 Nov 1999 11:52:51 +0000 Subject: no_comment --- perl-install/devices.pm | 5 +++- perl-install/install2.pm | 7 ++---- perl-install/install_any.pm | 1 - perl-install/install_steps.pm | 42 +++++++++++++++++++------------ perl-install/install_steps_interactive.pm | 21 ++++++---------- perl-install/modules.pm | 26 +++++++------------ perl-install/mouse.pm | 8 ++++-- perl-install/share/compssList | 2 +- 8 files changed, 56 insertions(+), 56 deletions(-) (limited to 'perl-install') diff --git a/perl-install/devices.pm b/perl-install/devices.pm index 116293983..6e1b7ccf4 100644 --- a/perl-install/devices.pm +++ b/perl-install/devices.pm @@ -77,9 +77,11 @@ sub make($) { } elsif (/(.*)(\d+)$/) { ($type, $major, $minor) = @{ ${{"fd" => [ c::S_IFBLK(), 2, 0 ], + "md" => [ c::S_IFBLK(), 9, 0 ], "lp" => [ c::S_IFCHR(), 6, 0 ], "scd" => [ c::S_IFBLK(), 11, 0 ], - "nst" => [ c::S_IFCHR(), 9, 128 ], + "nst" => [ c::S_IFCHR(), 9, 128], + "ttyS" => [ c::S_IFCHR(), 4, 64 ], "hidbp-mse-" => [ c::S_IFCHR(), 10, 32 ], }}{$1}}; $minor += $2; @@ -96,6 +98,7 @@ sub make($) { "mcd" => [ c::S_IFBLK(), 23, 0 ], "mcdx" => [ c::S_IFBLK(), 20, 0 ], "mem" => [ c::S_IFCHR(), 1, 1 ], + "psaux" => [ c::S_IFCHR(), 10, 1 ], "random" => [ c::S_IFCHR(), 1, 8 ], "optcd" => [ c::S_IFBLK(), 17, 0 ], "sbpcd" => [ c::S_IFBLK(), 25, 0 ], diff --git a/perl-install/install2.pm b/perl-install/install2.pm index 406fe81d6..bcb98cb47 100644 --- a/perl-install/install2.pm +++ b/perl-install/install2.pm @@ -1,3 +1,4 @@ + package install2; use diagnostics; @@ -87,12 +88,11 @@ my @install_classes = (__("beginner"), __("developer"), __("server"), __("expert #-##################################################################################### #- partition layout my %suggestedPartitions = ( - beginner => my $b = [ + normal => my $b = [ { mntpoint => "/", size => 700 << 11, type => 0x83 }, { mntpoint => "swap", size => 128 << 11, type => 0x82 }, { mntpoint => "/home", size => 300 << 11, type => 0x83 }, ], - normal => $b, developer => [ { mntpoint => "/boot", size => 16 << 11, type => 0x83 }, { mntpoint => "swap", size => 128 << 11, type => 0x82 }, @@ -108,9 +108,6 @@ my %suggestedPartitions = ( { mntpoint => "/var", size => 600 << 11, type => 0x83 }, { mntpoint => "/home", size => 500 << 11, type => 0x83 }, ], - expert => [ - { mntpoint => "/", size => 200 << 11, type => 0x83 }, - ], ); #-####################################################################################### diff --git a/perl-install/install_any.pm b/perl-install/install_any.pm index 654e703b3..fa963c4d4 100644 --- a/perl-install/install_any.pm +++ b/perl-install/install_any.pm @@ -133,7 +133,6 @@ sub setPackages($) { $_->{selected} = 0 foreach values %{$o->{packages}}; } - #- this will be done if necessary in the selectPackagesToUpgrade, #- move the selection here ? this will remove the little window. unless ($o->{isUpgrade}) { diff --git a/perl-install/install_steps.pm b/perl-install/install_steps.pm index 4ae18d73d..bbe35e2f7 100644 --- a/perl-install/install_steps.pm +++ b/perl-install/install_steps.pm @@ -99,7 +99,15 @@ sub selectKeyboard { #------------------------------------------------------------------------------ sub selectPath {} #------------------------------------------------------------------------------ -sub selectInstallClass($@) {} +sub selectInstallClass($@) { + my ($o) = @_; + $o->{installClass} ||= "normal"; + $o->{security} || ${{ + normal => 2, + developer => 3, + server => 4, + }}{$o->{installClass}}; +} #------------------------------------------------------------------------------ sub setupSCSI { modules::load_thiskind('scsi') } #------------------------------------------------------------------------------ @@ -197,6 +205,7 @@ sub installPackages($$) { } push @toInstall, grep { $_->{base} && $_->{selected} && !$_->{installed} && !$firstInstalled{$_->{name}} } values %$packages; push @toInstall, grep { !$_->{base} && $_->{selected} && !$_->{installed} && !$firstInstalled{$_->{name}} } values %$packages; + print int @toInstall, "<<<<<<\n"; pkgs::install($o->{prefix}, \@toInstall); } @@ -316,22 +325,23 @@ sub addUser($) { my (%uids, %gids); foreach (glob_("$p/home")) { my ($u, $g) = (stat($_))[4,5]; $uids{$u} = 1; $gids{$g} = 1; } - my @l = @{$o->{users} || []}; my %done; - foreach (@l) { - next if !$_->{name} || getpwnam($_->{name}) || $done{$_->{name}}; - - my $u = $_->{uid} || ($_->{oldu} = (stat("$p$_->{home}"))[4]); - my $g = $_->{gid} || ($_->{oldg} = (stat("$p$_->{home}"))[5]); - if (!$u || getpwuid($u)) { for ($u = 500; getpwuid($u) || $uids{$u}; $u++) {} } - if (!$g || getgrgid($g)) { for ($g = 500; getgrgid($g) || $gids{$g}; $g++) {} } - - $_->{home} ||= "/home/$_->{name}"; - $_->{uid} = $u; - $_->{gid} = $g; - $_{pw} ||= $_->{password} && install_any::crypt($_->{password}); - $done{$_->{name}} = 1; - } + my @l = grep { + if (!$_->{name} || getpwnam($_->{name}) || $done{$_->{name}}) { + 0; + } else { + my $u = $_->{uid} || ($_->{oldu} = (stat("$p$_->{home}"))[4]); + my $g = $_->{gid} || ($_->{oldg} = (stat("$p$_->{home}"))[5]); + if (!$u || getpwuid($u)) { for ($u = 500; getpwuid($u) || $uids{$u}; $u++) {} } + if (!$g || getgrgid($g)) { for ($g = 500; getgrgid($g) || $gids{$g}; $g++) {} } + + $_->{home} ||= "/home/$_->{name}"; + $_->{uid} = $u; + $_->{gid} = $g; + $_{pw} ||= $_->{password} && install_any::crypt($_->{password}); + $done{$_->{name}} = 1; + } + } @{$o->{users} || []}; my @passwd = cat_("$p/etc/passwd");; local *F; diff --git a/perl-install/install_steps_interactive.pm b/perl-install/install_steps_interactive.pm index 609187640..533926784 100644 --- a/perl-install/install_steps_interactive.pm +++ b/perl-install/install_steps_interactive.pm @@ -97,20 +97,20 @@ sub selectRootPartition($@) { #------------------------------------------------------------------------------ sub selectInstallClass($@) { my ($o, @classes) = @_; - my @c = qw(normal specific expert); + my @c = qw(beginner specific expert); my %c = ( - normal => _("Recommended"), + beginner => _("Recommended"), specific => _("Personalized"), expert => _("Expert"), ); my $installClass = ${{reverse %c}}{$o->ask_from_list(_("Install Class"), _("What installation class do you want?"), - [ map { $c{$_} } @c ], $c{$o->{installClass}} || $c{normal})}; + [ map { $c{$_} } @c ], $c{$o->{installClass}} || $c{beginner})}; $::expert = $installClass eq "expert"; - $::beginner = $installClass eq "normal"; + $::beginner = $installClass eq "beginner"; if ($::beginner) { - $o->{installClass} = $installClass; + $o->{installClass} = "normal"; } else { my %c = ( normal => _("Normal"), @@ -646,10 +646,10 @@ sub addUser($) { }, complete => sub { $u->{password} eq $u->{password2} or $o->ask_warn('', [ _("The passwords do not match"), _("Please try again") ]), return (1,3); - #(length $u->{password} < 6) and $o->ask_warn('', _("This password is too simple")), return (1,2); + $o->{security} > 3 && length($u->{password}) < 6 and $o->ask_warn('', _("This password is too simple")), return (1,2); $u->{name} or $o->ask_warn('', _("Please give a user name")), return (1,0); $u->{name} =~ /^[a-z0-9_-]+$/ or $o->ask_warn('', _("The user name must contain only lower cased letters, numbers, `-' and `_'")), return (1,0); - member($u->{name}, map { $_->{name} } @{$u->{users}}) and $o->ask_warn('', _("This user name is already added")), return (1,0); + member($u->{name}, map { $_->{name} } @{$o->{users}}) and $o->ask_warn('', _("This user name is already added")), return (1,0); return 0; }, )) { @@ -822,12 +822,7 @@ sub miscellaneous { ); my $u = $o->{miscellaneous} ||= {}; exists $u->{LAPTOP} or $u->{LAPTOP} = 1; - my $s = $o->{security} || ${{ - beginner => 2, - developer => 3, - server => 4, - expert => 3 - }}{$o->{installClass}}; + my $s = $o->{security}; $s = $l{$s} || $s; !$::beginner || $clicked and $o->ask_from_entries_ref('', diff --git a/perl-install/modules.pm b/perl-install/modules.pm index 828b92af7..3c3d00ff6 100644 --- a/perl-install/modules.pm +++ b/perl-install/modules.pm @@ -157,6 +157,7 @@ sub text2driver($) { die "$text is not a valid module description"; } +sub add_alias($$) { $conf{$_[0]}{alias} = $_[1]; } sub load { my ($name, $type, @options) = @_; @@ -174,17 +175,19 @@ sub load { } push @{$loaded{$type}}, $name; - $conf{'scsi_hostadapter' . ($scsi++ || '')}{alias} = $name - if $type && $type eq 'scsi'; - + if ($type) { + $conf{$type}{alias} = $name if $type eq 'usbmouse'; + $conf{'scsi_hostadapter' . ($scsi++ || '')}{alias} = $name if $type eq 'scsi'; + } $conf{$name}{options} = join " ", @options if @options; } sub unload($) { + my ($m) = @_; if ($::testing) { - log::l("rmmod $_[0]"); - } else { - run_program::run("rmmod", $_[0]); + log::l("rmmod $m"); + } else { + run_program::run("rmmod", $m) && delete $conf{$m}{loaded}; } } @@ -331,14 +334,3 @@ sub get_pcmcia_devices($$) { } @devs; } - -#-#- This assumes only one of each driver type is loaded -#-sub removeDeviceDriver { -#- my ($type) = @_; -#- -#- my @m = grep { $loaded{$_}{type} eq $type } keys %loaded; -#- @m or return 0; -#- @m > 1 and log::l("removeDeviceDriver assume only one of each driver type is loaded, which is not the case (" . join(' ', @m) . ")"); -#- removeModule($m[0]); -#- 1; -#-} diff --git a/perl-install/mouse.pm b/perl-install/mouse.pm index ecedfff9a..44bde68ac 100644 --- a/perl-install/mouse.pm +++ b/perl-install/mouse.pm @@ -45,6 +45,8 @@ my @mouses = ( [ 2, "atibm", "Busmouse", "BusMouse", __("ATI Bus Mouse") ], [ 2, "inportbm", "Busmouse", "BusMouse", __("Microsoft Bus Mouse") ], [ 3, "logibm", "Busmouse", "BusMouse", __("Logitech Bus Mouse") ], + [ 2, "usbmouse", "ps/2", "PS/2", __("USB Mouse") ], + [ 5, "usbmouse", "ps/2", "PS/2", __("USB Mouse (3 buttons or more)") ], ); map_index { my %l; @l{@mouses_fields} = @$_; @@ -92,8 +94,10 @@ sub detect() { eval { run_program::run("rmmod", "serial") }; if (my ($c) = pci_probing::main::probe("SERIAL_USB")) { - eval { modules::load($c->[1]) }; - return name2mouse("Generic Mouse (PS/2)") if !$@ && detect_devices::tryOpen("usbmouse"); + eval { modules::load($c->[1], 'usbmouse') }; + sleep(1); + return name2mouse("USB Mouse") if !$@ && detect_devices::tryOpen("usbmouse"); + modules::unload($c->[1]); } die "mouseconfig failed"; } diff --git a/perl-install/share/compssList b/perl-install/share/compssList index d98864a28..0db74f227 100644 --- a/perl-install/share/compssList +++ b/perl-install/share/compssList @@ -224,7 +224,7 @@ howto-sgml 25 0 22 ibtk 15 0 13 ical 30 0 27 iceconf 60 0 54 -icewm 80 0 80 +icewm 40 0 80 icewm-themes 60 0 54 ImageMagick 42 0 60 ImageMagick-devel 1 0 60 -- cgit v1.2.1