summaryrefslogtreecommitdiffstats
path: root/perl-install/ChangeLog
diff options
context:
space:
mode:
authorPascal Rigaux <pixel@mandriva.com>2000-02-21 19:22:12 +0000
committerPascal Rigaux <pixel@mandriva.com>2000-02-21 19:22:12 +0000
commit8abe7a7e8c29a95d8229577b5ff0afaa74589fcc (patch)
tree36deb9889d4642b0078b687dfa4ad1a234ffc644 /perl-install/ChangeLog
parent1a6ceb9a7e98d4f7b3aa7e398519ca6a89d852e4 (diff)
downloaddrakx-backup-do-not-use-8abe7a7e8c29a95d8229577b5ff0afaa74589fcc.tar
drakx-backup-do-not-use-8abe7a7e8c29a95d8229577b5ff0afaa74589fcc.tar.gz
drakx-backup-do-not-use-8abe7a7e8c29a95d8229577b5ff0afaa74589fcc.tar.bz2
drakx-backup-do-not-use-8abe7a7e8c29a95d8229577b5ff0afaa74589fcc.tar.xz
drakx-backup-do-not-use-8abe7a7e8c29a95d8229577b5ff0afaa74589fcc.zip
no_comment
Diffstat (limited to 'perl-install/ChangeLog')
-rw-r--r--perl-install/ChangeLog9
1 files changed, 9 insertions, 0 deletions
diff --git a/perl-install/ChangeLog b/perl-install/ChangeLog
index bceb518af..824c6ea5a 100644
--- a/perl-install/ChangeLog
+++ b/perl-install/ChangeLog
@@ -1,5 +1,14 @@
2000-02-21 Pixel <pixel@mandrakesoft.com>
+ * install_steps_gtk.pm (create_big_help): display the help in full
+ screen
+
+ * my_gtk.pm (_create_window): add big help on F1
+
+ * common.pm (add2hash): now returns the first parameter
+
+ * mouse.pm (detect): really defaults to serial mouse
+
* interactive.pm: add ask_many_from_list_with_help and
ask_many_from_list_with_help_ref
'#n189'>189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 387 388 389 390 391 392 393 394 395 396 397 398 399 400 401 402 403 404 405 406 407 408 409 410 411 412 413 414 415 416 417 418 419 420 421 422 423 424 425 426 427 428 429 430 431 432 433 434 435 436 437 438 439 440 441 442 443 444 445 446 447 448 449 450 451 452 453 454 455 456 457 458 459 460 461 462 463 464 465 466 467 468 469 470 471 472 473 474 475 476 477 478 479 480 481 482 483 484 485 486 487 488 489 490 491 492 493 494 495 496 497 498 499 500 501 502 503 504 505 506 507 508 509 510 511 512 513 514 515 516 517 518 519 520 521 522 523 524 525 526 527 528 529 530 531 532 533 534 535 536 537 538 539 540 541 542 543 544 545 546 547 548 549 550 551 552 553 554 555 556 557 558 559 560 561 562 563 564 565 566 567 568 569 570 571 572 573 574 575 576 577 578 579 580 581 582 583 584 585 586 587 588 589 590 591 592 593 594 595 596 597 598 599 600 601 602 603 604 605 606 607 608 609 610 611 612 613 614 615 616 617 618 619 620 621 622 623 624 625 626 627 628 629 630 631 632 633 634 635 636 637 638 639 640 641 642 643 644 645 646 647 648 649 650 651 652 653 654 655 656 657 658 659 660 661 662 663 664 665 666 667 668 669 670 671 672 673 674 675 676 677 678 679 680 681 682 683 684 685 686 687 688 689 690 691 692 693 694 695 696 697 698 699 700 701 702 703 704 705 706 707 708 709 710 711 712 713 714 715 716 717 718 719 720 721 722 723 724 725 726 727 728 729 730 731 732 733 734 735 736 737 738 739 740 741 742 743 744 745 746 747 748 749 750 751 752 753 754 755 756 757 758 759 760 761 762 763 764 765 766 767 768 769 770 771 772 773 774 775 776 777 778 779 780 781 782 783 784 785 786 787 788 789 790 791 792 793 794 795 796 797 798 799 800 801 802 803
package any; # $Id$

use diagnostics;
use strict;

#-######################################################################################
#- misc imports
#-######################################################################################
use common qw(:common :system :file :functional);
use commands;
use detect_devices;
use partition_table qw(:types);
use fsedit;
use fs;
use run_program;
use modules;
use log;

sub drakx_version { 
    sprintf "DrakX v%s built %s", $::testing ? ('TEST', scalar gmtime()) : (split('/', cat_("$ENV{SHARE_PATH}/VERSION")))[2,3];
}

sub facesdir {
    my ($prefix) = @_;
    "$prefix/usr/share/faces/";
}
sub face2xpm {
    my ($face, $prefix) = @_;
    facesdir($prefix) . $face . ".xpm";
}
sub face2png {
    my ($face, $prefix) = @_;
    facesdir($prefix) . $face . ".png";
}
sub facesnames {
    my ($prefix) = @_;
    my $dir = facesdir($prefix);
    my @l = grep { /^[A-Z]/ } all($dir);
    grep { -e "$dir/$_.png" } map { /(.*)\.xpm/ } (@l ? @l : all($dir));
}

sub addKdmIcon {
    my ($prefix, $user, $icon) = @_;
    my $dest = "$prefix/usr/share/faces/$user.png";
    eval { commands::cp("-f", facesdir($prefix) . $icon . ".png", $dest) } if $icon;
}

sub allocUsers {
    my ($prefix, $users) = @_;
    my @m = my @l = facesnames($prefix);
    foreach (grep { !$_->{icon} || $_->{icon} eq "automagic" } @$users) {
	$_->{auto_icon} = splice(@m, rand(@m), 1); #- known biased (see cookbook for better)
	log::l("auto_icon is $_->{auto_icon}");
	@m = @l unless @m;
    }
}

sub addUsers {
    my ($prefix, $users) = @_;
    my $msec = "$prefix/etc/security/msec";

    allocUsers($prefix, $users);
    foreach my $u (@$users) {
	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});
    }
    run_program::rooted($prefix, "/usr/share/msec/grpuser.sh --refresh >/dev/null");
}

sub crypt {
    my ($password, $md5) = @_;
    crypt($password, $md5 ? '$1$' . salt(8) : salt(2));
}
sub enableShadow {
    my ($prefix) = @_;
    run_program::rooted($prefix, "pwconv")  or log::l("pwconv failed");
    run_program::rooted($prefix, "grpconv") or log::l("grpconv failed");
}
sub enableMD5Shadow {
    my ($prefix, $shadow, $md5) = @_;
    substInFile {
	if (/^password.*pam_pwdb.so/) {
	    s/\s*shadow//; s/\s*md5//;
	    s/$/ shadow/ if $shadow;
	    s/$/ md5/ if $md5;
	}
    } grep { -r $_ } map { "$prefix/etc/pam.d/$_" } qw(login rlogin passwd);
}

sub setupBootloader {
    my ($in, $b, $hds, $fstab, $security, $prefix, $more) = @_;

    $more++ if $b->{bootUnsafe};
	$more = 2 if arch() =~ /ppc/; #- no auto for PPC yet
	
    if (!$::expert && $more < 1) {
	#- automatic
    } elsif (!$::expert) {
	my @l = (__("First sector of drive (MBR)"), __("First sector of boot partition"));

	$in->set_help('setupBootloaderBeginner') unless $::isStandalone;
	if (arch() =~ /sparc/) {
	    $b->{use_partition} = $in->ask_from_list_(_("SILO Installation"),
						      _("Where do you want to install the bootloader?"),
						      \@l, $l[$b->{use_partition}]) or return;
	} elsif (arch() =~ /ppc/) {
		if (defined $partition_table_mac::bootstrap_part) {
			$b->{boot} = $partition_table_mac::bootstrap_part;
			log::l("set bootstrap to $b->{boot}"); 
		} else {
			die "no bootstrap partition - yaboot.conf creation failed";
		}
	} else {
	    my $boot = $hds->[0]{device};
	    my $onmbr = "/dev/$boot" eq $b->{boot};
	    $b->{boot} = "/dev/" . ($in->ask_from_list_(_("LILO/grub Installation"),
							_("Where do you want to install the bootloader?"),
							\@l, $l[!$onmbr]) eq $l[0] 
				    ? $boot : fsedit::get_root($fstab, 'boot')->{device});
	}
    } else {
	$in->set_help(arch() =~ /sparc/ ? "setupSILOGeneral" :  arch() =~ /ppc/ ? 'setupYabootGeneral' :"setupBootloaderGeneral") unless $::isStandalone; #- TO MERGE ?

	my @silo_install_lang = (_("First sector of drive (MBR)"), _("First sector of boot partition"));
	my $silo_install_lang = $silo_install_lang[$b->{use_partition}];

	my %bootloaders = (if_(exists $b->{methods}{silo},
			       __("SILO")                     => sub { $b->{methods}{silo} = 1 }),
			   if_(exists $b->{methods}{lilo},
			       __("LILO with text menu")      => sub { $b->{methods}{lilo} = "lilo-menu" },
			       __("LILO with graphical menu") => sub { $b->{methods}{lilo} = "lilo-graphic" }),
			   if_(exists $b->{methods}{grub},
			       #- put lilo if grub is chosen, so that /etc/lilo.conf is generated
			       __("Grub")                     => sub { $b->{methods}{grub} = 1;
								       exists $b->{methods}{lilo}
									 and $b->{methods}{lilo} = "lilo-menu" }),
			   if_(exists $b->{methods}{loadlin},
			       __("Boot from DOS/Windows (loadlin)") => sub { $b->{methods}{loadlin} = 1 }),
			   if_(exists $b->{methods}{yaboot},
			       __("Yaboot") => sub { $b->{methods}{yaboot} = 1 }),
			  );
	my $bootloader = arch() =~ /sparc/ ? __("SILO") : arch() =~ /ppc/ ? __("Yaboot") : __("LILO with graphical menu");
	my $profiles = bootloader::has_profiles($b);
	my $memsize = bootloader::get_append($b, 'mem');

	$b->{vga} ||= 'Normal';
	if (arch !~ /ppc/) {
	$in->ask_from_entries_refH('', _("Bootloader main options"), [
{ label => _("Bootloader to use"), val => \$bootloader, list => [ keys(%bootloaders) ], format => \&translate },
    arch() =~ /sparc/ ? (
{ label => _("Bootloader installation"), val => \$silo_install_lang, list => \@silo_install_lang },
) : (
{ label => _("Boot device"), val => \$b->{boot}, list => [ map { "/dev/$_" } (map { $_->{device} } (@$hds, grep { !isFat($_) } @$fstab)), detect_devices::floppies() ], not_edit => !$::expert },
{ label => _("LBA (doesn't work on old BIOSes)"), val => \$b->{lba32}, type => "bool", text => "lba", advanced => 1 },
{ label => _("Compact"), val => \$b->{compact}, type => "bool", text => _("compact"), advanced => 1 },
{ label => _("Video mode"), val => \$b->{vga}, list => [ keys %bootloader::vga_modes ], not_edit => !$::expert, advanced => 1 },
),
{ label => _("Delay before booting default image"), val => \$b->{timeout} },
    if_($security >= 4,
{ label => _("Password"), val => \$b->{password}, hidden => 1 },
{ label => _("Password (again)"), val => \$b->{password2}, hidden => 1 },
{ label => _("Restrict command line options"), val => \$b->{restricted}, type => "bool", text => _("restrict") },
    ),
{ label => _("Clean /tmp at each boot"), val => \$b->{CLEAN_TMP}, type => 'bool', advanced => 1 },
{ label => _("Precise RAM size if needed (found %d MB)", availableRamMB()), val => \$memsize, advanced => 1 },
    if_(detect_devices::isLaptop,
{ label => _("Enable multi profiles"), val => \$profiles, type => 'bool', advanced => 1 },
    ),
],
				 complete => sub {
				     !$memsize || $memsize =~ /K$/ || $memsize =~ s/^(\d+)M?$/$1M/i or $in->ask_warn('', _("Give the ram size in MB")), return 1;
#-				     $security > 4 && length($b->{password}) < 6 and $in->ask_warn('', _("At this level of security, a password (and a good one) in lilo is requested")), return 1;
				     $b->{restricted} && !$b->{password} and $in->ask_warn('', _("Option ``Restrict command line options'' is of no use without a password")), return 1;
				     $b->{password} eq $b->{password2} or !$b->{restricted} or $in->ask_warn('', [ _("The passwords do not match"), _("Please try again") ]), return 1;
				     0;
				 }
				) or return 0;
	} else {
	$b->{boot} = $partition_table_mac::bootstrap_part;	
	$in->ask_from_entries_refH('', _("Bootloader main options"), [
	{ label => _("Bootloader to use"), val => \$bootloader, list => [ keys(%bootloaders) ], format => \&translate },	
	{ label => _("Init Message"), val => \$b->{initmsg} },
	{ label => _("Boot device"), val => \$b->{boot}, list => [ map { "/dev/$_" } (map { $_->{device} } (grep { isAppleBootstrap($_) } @$fstab))], not_edit => !$::expert },
	{ label => _("Open Firmware Delay"), val => \$b->{delay} },
	{ label => _("Kernel Boot Timeout"), val => \$b->{timeout} },
	{ label => _("Enable CD Boot?"), val => \$b->{enablecdboot}, type => "bool" },
	{ label => _("Enable OF Boot?"), val => \$b->{enableofboot}, type => "bool" },
	{ label => _("Default OS?"), val=> \$b->{defaultos}, list => [ 'linux', 'macos', 'macosx', 'darwin' ] },
	]) or return 0;				
	}
	
	$b->{methods}{$_} = 0 foreach keys %{$b->{methods}};
	$bootloaders{$bootloader} and $bootloaders{$bootloader}->();
	#- at least one method
	grep_each { $::b } %{$b->{methods}} or return;

	$b->{use_partition} = $silo_install_lang eq _("First sector of drive (MBR)") ? 0 : 1;
	$b->{vga} = $bootloader::vga_modes{$b->{vga}} || $b->{vga};

	bootloader::set_profiles($b, $profiles);
	bootloader::add_append($b, "mem", $memsize);
    }

    while ($::expert || $more > 1) {
	$in->set_help(arch() =~ /sparc/ ? 'setupSILOAddEntry' : arch() =~ /ppc/ ? 'setupYabootAddEntry' : 'setupBootloaderAddEntry') unless $::isStandalone;
	my ($c, $e);
	eval { $in->ask_from_entries_refH_powered( 
		{
		 messages => 
_("Here are the different entries.
You can add some more or change the existing ones."),
		 ok => '',
},
		[ { val => \$e, format => sub {
		    my ($e) = @_;
		    ref $e ? 
		      "$e->{label} ($e->{kernel_or_dev})" . ($b->{default} eq $e->{label} && "  *") : 
		      translate($e);
		}, list => [ @{$b->{entries}} ] },
		  (map { my $s = $_; { val => translate($_), clicked => sub { $c = $s; die } } } (__("Modify"), __("Add"), __("Done"))),
		]
	) };
	!$c || $c eq "Done" and last;

	if ($c eq "Add") {