diff options
author | Pascal Rigaux <pixel@mandriva.com> | 1999-11-05 16:45:20 +0000 |
---|---|---|
committer | Pascal Rigaux <pixel@mandriva.com> | 1999-11-05 16:45:20 +0000 |
commit | 9ff7de045d43481f087f30db037992341c09680a (patch) | |
tree | f4f18b1b772b9d0635af08f41ae90261925c7ac4 /perl-install | |
parent | 350a90a90a0bafcc964e4b3556238660b134fc4c (diff) | |
download | drakx-9ff7de045d43481f087f30db037992341c09680a.tar drakx-9ff7de045d43481f087f30db037992341c09680a.tar.gz drakx-9ff7de045d43481f087f30db037992341c09680a.tar.bz2 drakx-9ff7de045d43481f087f30db037992341c09680a.tar.xz drakx-9ff7de045d43481f087f30db037992341c09680a.zip |
no_comment
Diffstat (limited to 'perl-install')
-rw-r--r-- | perl-install/Makefile | 1 | ||||
-rw-r--r-- | perl-install/install2.pm | 10 | ||||
-rw-r--r-- | perl-install/install_any.pm | 8 | ||||
-rw-r--r-- | perl-install/install_steps.pm | 2 | ||||
-rw-r--r-- | perl-install/install_steps_interactive.pm | 18 | ||||
-rw-r--r-- | perl-install/interactive_gtk.pm | 7 | ||||
-rw-r--r-- | perl-install/interactive_newt.pm | 51 | ||||
-rw-r--r-- | perl-install/partition_table_raw.pm | 3 | ||||
-rw-r--r-- | perl-install/share/themes.rc | 6 |
9 files changed, 60 insertions, 46 deletions
diff --git a/perl-install/Makefile b/perl-install/Makefile index c5bd1bfae..9de2f57b6 100644 --- a/perl-install/Makefile +++ b/perl-install/Makefile @@ -124,6 +124,7 @@ get_needed_files: $(DIRS) fi; \ fi; \ done + mv -f $(DEST)/lib/libimlib-xpm.so $(DEST)/usr/lib mv -f $(DEST)/bin/* $(DEST)/sbin/* $(DEST)/usr/bin cd $(DEST)/usr/bin ; mv insmod insmod_ diff --git a/perl-install/install2.pm b/perl-install/install2.pm index 364e1ef78..4d6d5102e 100644 --- a/perl-install/install2.pm +++ b/perl-install/install2.pm @@ -123,8 +123,8 @@ $o = $::o = { autoSCSI => 0, mkbootdisk => 1, #- no mkbootdisk if 0 or undef, find a floppy with 1, or fd1 #- packages => [ qw() ], - partitioning => { clearall => 0, eraseBadPartitions => 0, auto_allocate => 0, autoformat => 0, readonly => 0 }, -#- security => 3, + partitioning => { clearall => 0, eraseBadPartitions => 0, auto_allocate => 0, autoformat => 0 }, #- , readonly => 0 +#- security => 2, #- partitions => [ #- { mntpoint => "/boot", size => 16 << 11, type => 0x83 }, #- { mntpoint => "/", size => 256 << 11, type => 0x83 }, @@ -178,7 +178,7 @@ $o = $::o = { #- user => { name => 'foo', password => 'bar', home => '/home/foo', shell => '/bin/bash', realname => 'really, it is foo' }, #- keyboard => 'de', -#- display => "192.168.1.19:2", +#- display => "192.168.1.15:0", steps => \%installSteps, orderedSteps => \@orderedInstallSteps, @@ -269,8 +269,6 @@ sub setupSCSI { sub partitionDisks { return $o->{fstab} = [ - #{ device => "loop7", mntpoint => "/", type => 0x83, size => ((cat_('/dos/lnx4win/size.txt'))[0]*2048), isFormatted => 1, isMounted => 1, noMakeDevice => 1 }, - #{ device => "/initrd/dos/lnx4win/swapfile", mntpoint => "swap", type => 0x82, isFormatted => 1, isMounted => 1, noMakeDevice => 1 }, { device => "loop7", type => 0x83, mntpoint => "/", isFormatted => 1, isMounted => 1 }, { device => "/initrd/dos/lnx4win/swapfile", type => 0x82, mntpoint => "swap", isFormatted => 1, isMounted => 1 }, ] if $o->{lnx4win}; @@ -558,7 +556,7 @@ sub main { last if $o->{step} eq 'exitInstall'; } - substInFile { s|/sbin/mingetty tty1.*|/bin/bash --login| } "$o->{prefix}/etc/inittab" if $o->{security} < 2; + substInFile { s|/sbin/mingetty tty1.*|/bin/bash --login| } "$o->{prefix}/etc/inittab" if $o->{security} < 1; fs::write($o->{prefix}, $o->{fstab}); modules::write_conf("$o->{prefix}/etc/conf.modules", 'append'); diff --git a/perl-install/install_any.pm b/perl-install/install_any.pm index 06c135288..654e703b3 100644 --- a/perl-install/install_any.pm +++ b/perl-install/install_any.pm @@ -17,6 +17,7 @@ use common qw(:common :system :functional :file); use commands; use run_program; use partition_table qw(:types); +use partition_table_raw; use devices; use fsedit; use network; @@ -164,8 +165,11 @@ sub getHds { my ($o) = @_; my ($ok, $ok2) = 1; + my @drives = detect_devices::hds(); + add2hash_($o->{partitioning}, { readonly => 1 }) if partition_table_raw::typeOfMBR($drives[0]{device}) eq 'system_commander'; + getHds: - $o->{hds} = catch_cdie { fsedit::hds([ detect_devices::hds() ], $o->{partitioning}) } + $o->{hds} = catch_cdie { fsedit::hds(\@drives, $o->{partitioning}) } sub { $o->ask_warn(_("Error"), _("I can't read your partition table, it's too corrupted for me :( @@ -415,6 +419,6 @@ sub pkg_install { } sub fsck_option() { - my $y = $::o->{security} < 4 && $::beginner && "-y "; + my $y = $::o->{security} < 3 && $::beginner && "-y "; substInFile { s/^(\s*fsckoptions=)(-y )?/$1$y/ } "$::o->{prefix}/etc/rc.d/rc.sysinit"; } diff --git a/perl-install/install_steps.pm b/perl-install/install_steps.pm index 60718fc88..225a0d3c1 100644 --- a/perl-install/install_steps.pm +++ b/perl-install/install_steps.pm @@ -323,7 +323,7 @@ sub addUser($) { foreach (@l) { if (! -d "$p$_->{home}") { - my $mode = $o->{security} < 3 ? 0755 : 0750; + my $mode = $o->{security} < 2 ? 0755 : 0750; eval { commands::cp("-f", "$p/etc/skel", "$p$_->{home}") }; if ($@) { log::l("copying of skel failed: $@"); mkdir("$p$_->{home}", $mode); diff --git a/perl-install/install_steps_interactive.pm b/perl-install/install_steps_interactive.pm index e46c99c19..d027f4d98 100644 --- a/perl-install/install_steps_interactive.pm +++ b/perl-install/install_steps_interactive.pm @@ -17,6 +17,7 @@ use pci_probing::main; use install_any; use detect_devices; use timezone; +use run_program; use fsedit; use network; use mouse; @@ -541,9 +542,9 @@ sub setRootPassword($) { my $sup = $o->{superuser} ||= {}; $sup->{password2} ||= $sup->{password} ||= ""; - return if $o->{security} < 2 && !$clicked; + return if $o->{security} < 1 && !$clicked; - $o->{security} < 2 or + $o->{security} < 1 or $o->ask_from_entries_ref([_("Set root password"), _("Ok"), _("No password")], _("Set root password"), [_("Password:"), _("Password (again):"), $o->{installClass} eq "server" || $::expert ? (_("Use shadow file"), _("Use MD5 passwords")) : (), $::beginner ? () : _("Use NIS") ], @@ -555,7 +556,7 @@ sub setRootPassword($) { ], complete => sub { $sup->{password} eq $sup->{password2} or $o->ask_warn('', [ _("The passwords do not match"), _("Please try again") ]), return (1,1); - length $sup->{password} < ($o->{security} > 4 ? 10 : 6) + length $sup->{password} < ($o->{security} > 3 ? 10 : 6) and $o->ask_warn('', _("This password is too simple")), return (1,0); return 0 } @@ -577,7 +578,7 @@ sub setRootPassword($) { #------------------------------------------------------------------------------ sub addUser($) { my ($o, $clicked) = @_; - my $u = $o->{user} ||= $o->{security} < 2 ? { name => "mandrake", realname => "default" } : {}; + my $u = $o->{user} ||= $o->{security} < 1 ? { name => "mandrake", realname => "default" } : {}; $u->{password2} ||= $u->{password} ||= ""; my @fields = qw(realname name password password2); my @shells = install_any::shells($o); @@ -585,7 +586,7 @@ sub addUser($) { if ($o->{security} < 2 && !$clicked || $o->ask_from_entries_ref( [ _("Add user"), _("Accept user"), _("Done") ], _("Enter a user\n%s", $o->{users} ? _("(already added %s)", join(", ", map { $_->{realname} } @{$o->{users}})) : ''), - [ _("Real name"), _("User name"), $o->{security} < 3 ? () : (_("Password"), _("Password (again)")), $::beginner ? () : _("Shell") ], + [ _("Real name"), _("User name"), $o->{security} < 2 ? () : (_("Password"), _("Password (again)")), $::beginner ? () : _("Shell") ], [ \$u->{realname}, \$u->{name}, {val => \$u->{password}, hidden => 1}, {val => \$u->{password2}, hidden => 1}, {val => \$u->{shell}, list => \@shells, not_edit => !$::expert}, @@ -605,7 +606,7 @@ sub addUser($) { )) { push @{$o->{users}}, $o->{user}; $o->{user} = {}; - goto &addUser unless $o->{security} < 2 && !$clicked; + goto &addUser unless $o->{security} < 1 && !$clicked; } install_steps::addUser($o); } @@ -673,7 +674,7 @@ _("Linear (needed for some SCSI drives)") => { val => \$b->{linear}, type => "bo _("Compact") => { val => \$b->{compact}, type => "bool", text => _("compact") }, _("Delay before booting default image") => \$b->{timeout}, _("Video mode") => { val => \$b->{vga}, list => [ keys %lilo::vga_modes ], not_edit => $::beginner }, -$o->{security} < 3 ? () : ( +$o->{security} < 2 ? () : ( _("Password") => { val => \$b->{password}, hidden => 1 }, _("Restrict command line options") => { val => \$b->{restricted}, type => "bool", text => _("restrict") }, ) @@ -763,7 +764,8 @@ _("Default") => { val => \$default, type => 'bool' }, sub miscellaneous { my ($o, $clicked) = @_; my %l = ( - 1 => _("Windows(TM)"), + 0 => _("Windows(TM)"), + 1 => _("Poor"), 2 => _("Low"), 3 => _("Medium"), 4 => _("High"), diff --git a/perl-install/interactive_gtk.pm b/perl-install/interactive_gtk.pm index 7074e6664..3063a2d19 100644 --- a/perl-install/interactive_gtk.pm +++ b/perl-install/interactive_gtk.pm @@ -48,14 +48,13 @@ sub ask_from_listW { sub ask_many_from_list_refW($$$$$) { my ($o, $title, $messages, $list, $val) = @_; - my $n = 0; my $w = my_gtk->new('', %$o); my $box = gtkpack(new Gtk::VBox(0,0), map { - my $nn = $n++; + my $i = $::i; my $o = Gtk::CheckButton->new($_); - $o->set_active(${$val->[$nn]}); - $o->signal_connect(clicked => sub { invbool \${$val->[$nn]} }); + $o->set_active(${$val->[$i]}); + $o->signal_connect(clicked => sub { invbool \${$val->[$i]} }); $o; } @$list); gtkadd($w->{window}, diff --git a/perl-install/interactive_newt.pm b/perl-install/interactive_newt.pm index 254e27eb1..a6ae69d25 100644 --- a/perl-install/interactive_newt.pm +++ b/perl-install/interactive_newt.pm @@ -10,6 +10,9 @@ use interactive; use common qw(:common :functional); use Term::Newt; +my $width = 80; +my $height = 25; + my $n = Term::Newt->new; $n->init; $n->cls; @@ -28,36 +31,36 @@ sub ask_from_listW { $l->[$n->win_ternary($title, @$l, $mesg) - 1]; } else { my $i; map_index { $i = $::i if $def eq $_ } @$l; - print STDERR "($i)\n"; my ($r, $e) = $n->newtWinMenu($title, $mesg, 40, 5, 5, 8, $l, $i, @okcancel); return if $r > 1; $l->[$e]; } } -#sub ask_many_from_list_refW($$$$$) { -# my ($o, $title, $messages, $list, $val) = @_; -# my $n = 0; -# my $w = my_gtk->new('', %$o); -# my $box = gtkpack(new Gtk::VBox(0,0), -# map { -# my $nn = $n++; -# my $o = Gtk::CheckButton->new($_); -# $o->set_active(${$val->[$nn]}); -# $o->signal_connect(clicked => sub { invbool \${$val->[$nn]} }); -# $o; -# } @$list); -# gtkadd($w->{window}, -# gtkpack_(create_box_with_title($w, @$messages), -# 1, @$list > 11 ? gtkset_usize(createScrolledWindow($box), 0, 250) : $box, -# 0, $w->create_okcancel, -# ) -# ); -# $w->{ok}->grab_focus; -# $w->main && $val; -#} -# -# +sub ask_many_from_list_refW($$$$$) { + my ($o, $title, $messages, $list, $val) = @_; + my $w = my_gtk->new('', %$o); + my @box = map_index { + $n->newtCheckbox(1, $::i + 1, $_, ${$val->[$::i]} ? '*' : ' ', " *", ${$val->[$::i]}); + } @$list; + + my $l = max(22, 2 + max map { length } @$list); + my $h = max(10, 2 + @$list + @$messages); + + $n->open_window(($width - $l) / 2, ($height - $h) / 2, $l, $h, $title); + my $form = $n->form(\ (my $ref = 0),'', 0); + + $n->form_add_components($form, @box, + $n->button(1, @$list + 3, _("Ok")), + $n->button(10, @$list + 3, _("Cancel"))); + + $n->run_form($form); + $n->form_destroy($form); + + $$_ = $$_ eq "*" foreach @$val; +} + + #sub ask_from_entries_refW { # my ($o, $title, $messages, $l, $val, %hcallback) = @_; # my ($title_, @okcancel) = ref $title ? @$title : $title; diff --git a/perl-install/partition_table_raw.pm b/perl-install/partition_table_raw.pm index 87e0ffdf5..1e1d1a09f 100644 --- a/perl-install/partition_table_raw.pm +++ b/perl-install/partition_table_raw.pm @@ -18,7 +18,8 @@ my @MBR_signatures = ( [ 'empty', 0, "\0\0\0\0" ], [ 'lilo', 0x6, "LILO" ], [ 'osbs', 0x2, "OSBS" ], #- http://www.prz.tu-berlin.de/~wolf/os-bs.html - [ 'pqmagic', 0xef, "PQV" ], + [ 'pqmagic', 0xef, "PQV" ], + [ 'BootStar', 0x130, "BootStar:" ], [ 'DocsBoot', 0x148, 'DocsBoot' ], [ 'system_commander', 0x1ad, "SYSCMNDRSYS" ], [ 'dos', 0xa0, "\x25\x03\x4E\x02\xCD\x13" ], diff --git a/perl-install/share/themes.rc b/perl-install/share/themes.rc index 5b05c2294..1cfb40937 100644 --- a/perl-install/share/themes.rc +++ b/perl-install/share/themes.rc @@ -3,6 +3,11 @@ style "marble3d" bg[NORMAL] = { 0.80, 0.80, 0.8 } bg[PRELIGHT] = { 0.9, 0.9, 0.9 } } +style "DarkMarble" +{ + bg[NORMAL] = { 0.4, 0.45, 0.4 } + bg[PRELIGHT] = { 0.5, 0.55, 0.5 } +} style "savane" { bg[NORMAL] = { 1.0, 0.67, 0 } @@ -19,6 +24,7 @@ style "blue" bg[PRELIGHT] = { 0, 0, 1.0 } } widget "*marble3d*" style "marble3d" +widget "*DarkMarble*" style "DarkMarble" widget "*savane*" style "savane" widget "*blackwhite*" style "blackwhite" widget "*blue*" style "blue" |