diff options
-rw-r--r-- | perl-install/ChangeLog | 13 | ||||
-rw-r--r-- | perl-install/any.pm | 2 | ||||
-rw-r--r-- | perl-install/fs.pm | 12 | ||||
-rw-r--r-- | perl-install/install2.pm | 11 | ||||
-rw-r--r-- | perl-install/install_any.pm | 5 | ||||
-rw-r--r-- | perl-install/install_steps.pm | 5 | ||||
-rw-r--r-- | perl-install/install_steps_interactive.pm | 16 | ||||
-rw-r--r-- | perl-install/modules.pm | 2 | ||||
-rw-r--r-- | perl-install/mouse.pm | 4 | ||||
-rw-r--r-- | perl-install/my_gtk.pm | 20 | ||||
-rw-r--r-- | perl-install/partition_table.pm | 15 | ||||
-rw-r--r-- | perl-install/pkgs.pm | 4 | ||||
-rw-r--r-- | perl-install/share/list | 1 | ||||
-rw-r--r-- | perl-install/share/themes-mdk.rc | 2 |
14 files changed, 79 insertions, 33 deletions
diff --git a/perl-install/ChangeLog b/perl-install/ChangeLog index 56d23eefd..ea01dc681 100644 --- a/perl-install/ChangeLog +++ b/perl-install/ChangeLog @@ -1,3 +1,16 @@ +2000-04-14 Pixel <pixel@mandrakesoft.com> + + * install_steps_interactive.pm (choosePartitionsToFormat): don't + ask about checking bad blocks for reiserfs, cuz not handled + + * fs.pm (mount): reiserfs handling + * fs.pm (format_reiserfs): added + * fs.pm (write_fstab): add option "notail" for reiserfs if + the partition holds the kernel (/boot or /) + + * partition_table.pm (isTrueFS): added, replaces most occurences + of isExt2 + 2000-04-12 François Pons <fpons@mandrakesoft.com> * install2.pm: force installation step if package have been diff --git a/perl-install/any.pm b/perl-install/any.pm index 0eb1000c4..d66282fc7 100644 --- a/perl-install/any.pm +++ b/perl-install/any.pm @@ -44,7 +44,7 @@ sub addUsers { allocUsers($prefix, @users); foreach my $u (@users) { - substInFile { s/^$u\n//; $_ .= "$u\n" if eof } "$msec/user.conf" if -d $msec; + substInFile { s/^$u->{name}\n//; $_ .= "$u->{name}\n" if eof } "$msec/user.conf" if -d $msec; addKdmIcon($prefix, $u->{name}, delete $u->{auto_icon} || $u->{icon}, 'force'); } run_program::rooted($prefix, "/usr/share/msec/grpuser.sh --refresh"); diff --git a/perl-install/fs.pm b/perl-install/fs.pm index d4a564b0c..0f89057e7 100644 --- a/perl-install/fs.pm +++ b/perl-install/fs.pm @@ -88,7 +88,7 @@ sub format_ext2($@) { sub format_reiserfs($@) { my ($dev, @options) = @_; - run_program::run("mkreiserfs", @options, devices::make($dev)) or die _("%s formatting of %s failed", "reiserfs", $dev); + run_program::run("mkreiserfs", "-f", @options, devices::make($dev)) or die _("%s formatting of %s failed", "reiserfs", $dev); } sub format_dos($@) { @@ -186,9 +186,14 @@ sub mount($$$;$) { my $mount_opt = ""; if ($fs eq 'vfat') { - $mount_opt = "check=relaxed"; + $mount_opt = 'check=relaxed'; eval { modules::load('vfat') }; #- try using vfat eval { modules::load('msdos') } if $@; #- otherwise msdos... + } elsif ($fs eq 'reiserfs') { + #- could be better if we knew if there is a /boot or not + #- without knowing it, / is forced to be mounted with notail + $mount_opt = 'notail' if $where =~ m|/(boot)?$|; + eval { modules::load('reiserfs') }; } log::l("calling mount($dev, $where, $fs, $flag, $mount_opt)"); @@ -340,9 +345,10 @@ sub write_fstab($;$$) { my ($dir, $options, $freq, $passno) = qw(/dev/ defaults 0 0); $options = $_->{options} || $options; - isExt2($_) and ($freq, $passno) = (1, ($_->{mntpoint} eq '/') ? 1 : 2); + isTrueFS($_) and ($freq, $passno) = (1, ($_->{mntpoint} eq '/') ? 1 : 2); isNfs($_) and $dir = '', $options = $_->{options} || 'ro,nosuid,rsize=8192,wsize=8192'; isFat($_) and $options = $_->{options} || "user,exec,umask=0"; + isReiserfs($_) && $_ == fsedit::get_root($fstab, 'boot') and add_options($options, "notail"); my $dev = isLoopback($_) ? ($_->{mntpoint} eq '/' ? "/initrd/loopfs$_->{loopback_file}" : loopback::file($_)) : diff --git a/perl-install/install2.pm b/perl-install/install2.pm index 87b4a3a01..5de9f6cc6 100644 --- a/perl-install/install2.pm +++ b/perl-install/install2.pm @@ -128,6 +128,7 @@ arch() =~ /^sparc/ ? ( ], ), ); +$suggestedPartitions{corporate} = $suggestedPartitions{server}; #-####################################################################################### #-$O @@ -271,7 +272,7 @@ sub selectInstallClass { @{$o->{orderedSteps}} = map { /setupSCSI/ ? ($_, "partitionDisks") : $_ } grep { !/partitionDisks/ } @{$o->{orderedSteps}}; my $s; foreach (@{$o->{orderedSteps}}) { - $s->{next} = $_; + $s->{next} = $_ if $s; $s = $o->{steps}{$_}; } } @@ -337,7 +338,7 @@ sub formatPartitions { #- Do not update inode access times on this #- file system (e.g, for faster access on the #- news spool to speed up news servers). - $o->{pcmcia} and $_->{options} = "noatime" foreach grep { isExt2($_) } @{$o->{fstab}}; + $o->{pcmcia} and $_->{options} = "noatime" foreach grep { isTrueFS($_) } @{$o->{fstab}}; } #------------------------------------------------------------------------------ @@ -513,6 +514,8 @@ sub main { } } $cmdline{$opt} = 1 if $opt; + $::beginner = 1; + map_each { my ($n, $v) = @_; my $f = ${{ @@ -520,8 +523,8 @@ sub main { pcmcia => sub { $o->{pcmcia} = $v }, vga => sub { $o->{vga16} = $v }, step => sub { $o->{steps}{first} = $v }, - expert => sub { $::expert = 1 }, - beginner => sub { $::beginner = 1 }, + expert => sub { $::expert = 1; $::beginner = 0 }, + beginner => sub { $::beginner = $v }, class => sub { $o->{installClass} = $v }, lnx4win => sub { $o->{lnx4win} = 1 }, readonly => sub { $o->{partitioning}{readonly} = $v ne "0" }, diff --git a/perl-install/install_any.pm b/perl-install/install_any.pm index 9fca69858..f7387056f 100644 --- a/perl-install/install_any.pm +++ b/perl-install/install_any.pm @@ -247,6 +247,7 @@ sub setPackages($) { push @{$o->{default_packages}}, "kernel-pcmcia-cs" if $o->{pcmcia}; push @{$o->{default_packages}}, "apmd" if $o->{pcmcia}; push @{$o->{default_packages}}, "raidtools" if $o->{raid} && !is_empty_array_ref($o->{raid}{raid}); + push @{$o->{default_packages}}, "reiserfs-utils" if grep { isReiserfs($_) } @{$o->{fstab}}; push @{$o->{default_packages}}, "cdrecord" if detect_devices::getIDEBurners(); push @{$o->{default_packages}}, "alsa" if modules::get_alias("sound") =~ /^snd-card-/; @@ -351,7 +352,7 @@ sub searchAndMount4Upgrade { getHds($o); #- get all ext2 partition that may be root partition. - my %Parts = my %parts = map { $_->{device} => $_ } grep { isExt2($_) } @{$o->{fstab}}; + my %Parts = my %parts = map { $_->{device} => $_ } grep { isTrueFS($_) } @{$o->{fstab}}; while (keys(%parts) > 0) { $root = $::beginner ? first(%parts) : $o->selectRootPartition(keys %parts); $root = delete $parts{$root}; @@ -389,7 +390,7 @@ sub searchAndMount4Upgrade { map { $_->{mntpoint} = 'swap_upgrade' } grep { isSwap($_) } @{$o->{fstab}}; #- use all available swap. #- TODO fsck, create check_mount_all ? - fs::mount_all([ grep { isExt2($_) || isSwap($_) } @{$o->{fstab}} ], $o->{prefix}); + fs::mount_all([ grep { isTrueFS($_) || isSwap($_) } @{$o->{fstab}} ], $o->{prefix}); } } diff --git a/perl-install/install_steps.pm b/perl-install/install_steps.pm index 5cf74d227..cb81ad4ff 100644 --- a/perl-install/install_steps.pm +++ b/perl-install/install_steps.pm @@ -105,10 +105,11 @@ sub selectPath {} #------------------------------------------------------------------------------ sub selectInstallClass($@) { my ($o) = @_; - $o->{installClass} ||= "normal"; + $o->{installClass} ||= $::corporate ? "corporate" : "normal"; $o->{security} ||= ${{ normal => 2, developer => 3, + corporate => 3, server => 4, }}{$o->{installClass}}; } @@ -786,7 +787,7 @@ sub miscellaneous { $o->{security} ||= $s{SECURITY} if exists $s{SECURITY}; $ENV{SECURE_LEVEL} = $o->{security}; - add2hash_ $o, { useSupermount => $o->{security} < 4 }; + add2hash_ $o, { useSupermount => $o->{security} < 4 && $o->{installClass} !~ /corporate|server/ }; cat_("/proc/cmdline") =~ /mem=(\S+)/; add2hash_($o->{miscellaneous} ||= {}, { numlock => !$o->{pcmcia}, $1 ? (memsize => $1) : () }); diff --git a/perl-install/install_steps_interactive.pm b/perl-install/install_steps_interactive.pm index d62253590..ba7d28b58 100644 --- a/perl-install/install_steps_interactive.pm +++ b/perl-install/install_steps_interactive.pm @@ -120,11 +120,11 @@ Hey no kidding, you will be allowed powerfull but dangerous things here."), }; $o->{isUpgrade} = $o->selectInstallClass1($verifInstallClass, - first(list2kv(@c)), ${{reverse %c}}{$o->{installClass}}, + first(list2kv(@c)), ${{reverse %c}}{$::beginner ? "beginner" : $::expert ? "expert" : "specific"}, [ __("Install"), __("Upgrade") ], $o->{isUpgrade} ? "Upgrade" : "Install") eq "Upgrade"; if ($::corporate || $::beginner || $o->{isUpgrade}) { - $o->{installClass} = "normal"; + delete $o->{installClass}; } else { my %c = ( normal => _("Normal"), @@ -142,7 +142,7 @@ Hey no kidding, you will be allowed powerfull but dangerous things here."), sub selectMouse { my ($o, $force) = @_; - if ($o->{mouse}{unsafe} || !$::beginner || $force) { + if ($o->{mouse}{unsafe} || $::expert || $force) { my $name = $o->ask_from_list_('', _("What is the type of your mouse?"), [ mouse::names() ], $o->{mouse}{FULLNAME}); $o->{mouse} = mouse::name2mouse($name); } @@ -170,7 +170,7 @@ sub setupSCSI { sub ask_mntpoint_s { my ($o, $fstab) = @_; - my @fstab = grep { isExt2($_) } @$fstab; + my @fstab = grep { isTrueFS($_) } @$fstab; @fstab = grep { isSwap($_) } @$fstab if @fstab == 0; # @fstab = @$fstab if @fstab == 0; die _("no available partitions") if @fstab == 0; @@ -230,7 +230,7 @@ sub choosePartitionsToFormat($$) { $o->ask_many_from_list_ref('', _("Choose the partitions you want to format"), [ map { $label{$_} } @l ], [ map { \$_->{toFormat} } @l ]) or die "cancel"; - @l = grep { $_->{toFormat} && !isLoopback($_) } @l; + @l = grep { $_->{toFormat} && !isLoopback($_) && !isReiserfs($_) } @l; $o->ask_many_from_list_ref('', _("Check bad blocks?"), [ map { $label{$_} } @l ], [ map { \$_->{toFormatCheck} } @l ]) or goto &choosePartitionsToFormat if $::expert; @@ -319,7 +319,7 @@ sub chooseGroups { _("Package Group Selection"), [ @$compssUsersSorted, _("Miscellaneous"), _("Individual package selection") ], [ map { \$o->{compssUsersChoice}{$_} } @$compssUsersSorted, "Miscellaneous", "Individual" ] - ) or goto &chooseGroups unless $::beginner; + ) or goto &chooseGroups unless $::beginner || $::corporate; unless ($o->{compssUsersChoice}{Miscellaneous}) { my %l; @@ -619,13 +619,13 @@ sub setRootPassword { return if $o->{security} < 1 && !$clicked; $o->set_help("setRootPassword", - $o->{installClass} eq "server" || $::expert ? "setRootPasswordMd5" : (), + $o->{installClass} =~ "server" || $::expert ? "setRootPasswordMd5" : (), $::beginner ? () : "setRootPasswordNIS"); $o->ask_from_entries_refH([_("Set root password"), _("Ok"), $o->{security} > 2 ? () : _("No password")], [ _("Set root password"), $::beginner ? "\n" . -_("(an user ``mandrake'' with password ``mandrake'' has been automatically added)") : () +_("(a user ``mandrake'' with password ``mandrake'' has been automatically added)") : () ], [ _("Password") => { val => \$sup->{password}, hidden => 1 }, _("Password (again)") => { val => \$sup->{password2}, hidden => 1 }, diff --git a/perl-install/modules.pm b/perl-install/modules.pm index b98230b1e..8ec397a4d 100644 --- a/perl-install/modules.pm +++ b/perl-install/modules.pm @@ -123,7 +123,7 @@ arch() =~ /^sparc/ ? ( "atp870u" => "atp870u (Acard/Artop)", "dc395x_trm" => "dc395x_trm", "psi240i" => "psi240i", - "qlogicfc" => "qlogicfc", +# "qlogicfc" => "qlogicfc", #- removed for instance. "sim710" => "sim710", "sym53c416" => "sym53c416", "tmscsim" => "tmscsim", diff --git a/perl-install/mouse.pm b/perl-install/mouse.pm index 1239ae99f..9443329ae 100644 --- a/perl-install/mouse.pm +++ b/perl-install/mouse.pm @@ -134,7 +134,7 @@ sub detect() { return name2mouse("Apple ADB Mouse"); } - detect_devices::hasMousePS2 and return name2mouse("Generic Mouse (PS/2)"); + detect_devices::hasMousePS2 and return { unsafe => 1, %{name2mouse("Generic Mouse (PS/2)")} }; eval { commands::modprobe("serial") }; my ($r, $wacom) = mouseconfig(); return ($r, $wacom) if $r; @@ -159,5 +159,5 @@ sub detect() { } #- defaults to generic ttyS0 - add2hash({ device => "ttyS0", unsafe => 1 }, name2mouse("Generic Mouse (serial)")); + { device => "ttyS0", unsafe => 1, %{name2mouse("Generic Mouse (serial)")} }; } diff --git a/perl-install/my_gtk.pm b/perl-install/my_gtk.pm index c1f35749e..02037f5b5 100644 --- a/perl-install/my_gtk.pm +++ b/perl-install/my_gtk.pm @@ -18,6 +18,7 @@ $EXPORT_TAGS{all} = [ map { @$_ } values %EXPORT_TAGS ]; use Gtk; use c; +use log; use common qw(:common :functional); my $forgetTime = 1000; #- in milli-seconds @@ -324,12 +325,27 @@ sub _create_window($$) { $w->signal_connect(delete_event => sub { undef $o->{retval}; Gtk->main_quit }); $w->set_uposition(@{$my_gtk::force_position || $o->{force_position}}) if $my_gtk::force_position || $o->{force_position}; - $w->signal_connect('focus' => sub { Gtk->idle_add(sub { $w->ensure_focus($_[0]); 0 }, $_[1]) }) if $w->can('ensure_focus'); + $w->signal_connect(focus => sub { Gtk->idle_add(sub { $w->ensure_focus($_[0]); 0 }, $_[1]) }) if $w->can('ensure_focus'); - $w->signal_connect("key_press_event" => sub { + $w->set_events("pointer_motion_mask"); + my $signal; + $signal = $w->signal_connect(motion_notify_event => sub { + delete $o->{mouse}{unsafe}; + log::l("unsetting unsafe mouse"); + $w->signal_disconnect($signal); + }) if $o->{mouse}{unsafe}; + + $w->signal_connect(key_press_event => sub { my $d = ${{ 65470 => 'help', 65481 => 'next', 65480 => 'previous' }}{$_[1]->{keyval}} or return; + + #- previous field is created here :( + my $s; foreach (reverse @{$::o->{orderedSteps}}) { + $s->{previous} = $_ if $s; + $s = $::o->{steps}{$_}; + } + if ($d eq "help") { require install_steps_gtk; install_steps_gtk::create_big_help(); diff --git a/perl-install/partition_table.pm b/perl-install/partition_table.pm index 09790a2ec..167c3d435 100644 --- a/perl-install/partition_table.pm +++ b/perl-install/partition_table.pm @@ -2,12 +2,12 @@ package partition_table; use diagnostics; use strict; -use vars qw(@ISA %EXPORT_TAGS @EXPORT_OK @important_types @fields2save); +use vars qw(@ISA %EXPORT_TAGS @EXPORT_OK @important_types @important_types2 @fields2save); use Data::Dumper; @ISA = qw(Exporter); %EXPORT_TAGS = ( - types => [ qw(type2name type2fs name2type fs2type isExtended isExt2 isReiserfs isSwap isDos isWin isFat isPrimary isNfs isSupermount isRAID isHFS isNT isMountableRW isApplePartMap isLoopback) ], + types => [ qw(type2name type2fs name2type fs2type isExtended isExt2 isReiserfs isTrueFS isSwap isDos isWin isFat isPrimary isNfs isSupermount isRAID isHFS isNT isMountableRW isApplePartMap isLoopback) ], ); @EXPORT_OK = map { @$_ } values %EXPORT_TAGS; @@ -21,7 +21,8 @@ use partition_table_mac; use log; -@important_types = ('Linux native', 'ReiserFS', 'Linux swap', 'DOS FAT16', 'Win98 FAT32', 'Linux RAID'); +@important_types = ('Linux native', 'Linux swap', 'Win98 FAT32'); +@important_types2 = ('ReiserFS', 'Linux RAID'); @fields2save = qw(primary extended totalsectors); @@ -189,7 +190,10 @@ my %fs2type = reverse %type2fs; 1; -sub important_types { $_[0] and return sort values %types; @important_types } +sub important_types { + $::expert and return sort values %types; + @important_types, $::beginner ? () : @important_types2; +} sub type2name($) { $types{$_[0]} || $_[0] } sub type2fs($) { $type2fs{$_[0]} } @@ -212,9 +216,10 @@ sub isNfs($) { $_[0]{type} eq 'nfs' } #- small hack sub isNT($) { $_[0]{type} == 0x7 } sub isSupermount($) { $_[0]{type} eq 'supermount' } sub isHFS($) { $type2fs{$_[0]{type}} eq 'hfs' } -sub isMountableRW { isExt2($_[0]) || isFat($_[0]) } sub isApplePartMap { defined $_[0]{isMap} } sub isLoopback { defined $_[0]{loopback_file} } +sub isTrueFS { isExt2($_[0]) || isReiserfs($_[0]) } +sub isMountableRW { isTrueFS($_[0]) || isFat($_[0]) } sub isPrimary($$) { my ($part, $hd) = @_; diff --git a/perl-install/pkgs.pm b/perl-install/pkgs.pm index 4acc279f8..4aa8edb4d 100644 --- a/perl-install/pkgs.pm +++ b/perl-install/pkgs.pm @@ -487,8 +487,8 @@ sub readCompss { /^\s*$/ || /^#/ and next; s/#.*//; - if (/^(\S+)/) { - $p = $1 if /^(\S+)/; + if (/^(\S.*)/) { + $p = $1; } else { /(\S+)/; $packages->[0]{$1} or log::l("unknown package $1 in compss"), next; diff --git a/perl-install/share/list b/perl-install/share/list index 41fc0e2d5..fd495cac8 100644 --- a/perl-install/share/list +++ b/perl-install/share/list @@ -13,6 +13,7 @@ /sbin/mkraid /sbin/rmmod /sbin/mke2fs +/sbin/mkreiserfs /sbin/raidstart /usr/X11R6/lib/X11/Cards /usr/bin/bzip2 diff --git a/perl-install/share/themes-mdk.rc b/perl-install/share/themes-mdk.rc index 020b6389c..ca1033977 100644 --- a/perl-install/share/themes-mdk.rc +++ b/perl-install/share/themes-mdk.rc @@ -148,7 +148,7 @@ style "any" fg[INSENSITIVE] = { 1.0, 1.0, 1.0 } text[INSENSITIVE]={ 1.0, 1.0, 1.0 } fg[ACTIVE] = { 1.0, 1.0, 1.0 } - fg[PRELIGHT] = { 1.0, 1.0, 1.0 } + fg[PRELIGHT] = { 0.8, 0.8, 1.0 } bg[SELECTED] = { 1.0, 1.0, 1.0 } fg[SELECTED] = { 0.2, 0.2, 0.4 } |