Index: make_boot_img =================================================================== RCS file: /cooker/gi/make_boot_img,v retrieving revision 1.103 diff -u -r1.103 make_boot_img --- make_boot_img 2002/03/15 14:59:55 1.103 +++ make_boot_img 2002/03/20 22:12:43 @@ -10,8 +10,8 @@ ($img, $type) = @ARGV; -$default_append = "ramdisk_size=32000 root=/dev/ram3"; -$default_vga = "vga=788"; +$default_append = "ramdisk_size=48000 root=/dev/ram3"; +$default_vga = "vga=785"; $instdir = "mdk-stage1"; $mnt = "/tmp/drakx_mnt"; Index: mdk-stage1/Makefile =================================================================== RCS file: /cooker/gi/mdk-stage1/Makefile,v retrieving revision 1.53 diff -u -r1.53 Makefile --- mdk-stage1/Makefile 2002/02/26 22:59:53 1.53 +++ mdk-stage1/Makefile 2002/03/20 22:12:43 @@ -36,7 +36,7 @@ #***************************************************************************** -VERSION = 8.2 +VERSION = 0.9.2 top_dir = . Index: mdk-stage1/cdrom.c =================================================================== RCS file: /cooker/gi/mdk-stage1/cdrom.c,v retrieving revision 1.18 diff -u -r1.18 cdrom.c --- mdk-stage1/cdrom.c 2001/08/22 12:43:27 1.18 +++ mdk-stage1/cdrom.c 2002/03/20 22:12:43 @@ -58,7 +58,7 @@ if (test_that_cd()) { enum return_type results; umount(IMAGE_LOCATION); - results = ask_yes_no("That CDROM disc does not seem to be a " DISTRIB_NAME " Installation CDROM.\nRetry with another disc?"); + results = ask_yes_no("That CDROM disc does not seem to be a " DISTRIB_NAME " Demo-CDROM.\nRetry with another disc?"); if (results == RETURN_OK) return try_with_device(dev_name, dev_model); return results; @@ -66,8 +66,7 @@ log_message("found a " DISTRIB_NAME " CDROM, good news!"); - if (IS_SPECIAL_STAGE2 || ramdisk_possible()) - load_ramdisk(); /* we don't care about return code, we'll do it live if we failed */ + load_ramdisk(IMAGE_LOCATION LIVE_LOCATION); /* we don't care about return code, we'll do it live if we failed */ if (IS_RESCUE) umount(IMAGE_LOCATION); Index: mdk-stage1/config-stage1.h =================================================================== RCS file: /cooker/gi/mdk-stage1/config-stage1.h,v retrieving revision 1.7 diff -u -r1.7 config-stage1.h --- mdk-stage1/config-stage1.h 2001/07/30 13:28:18 1.7 +++ mdk-stage1/config-stage1.h 2002/03/20 22:12:43 @@ -24,12 +24,12 @@ /* If we have more than that amount of memory (in Mbytes), we assume we can load the rescue as a ramdisk */ #define MEM_LIMIT_RESCUE 40 -#define DISTRIB_NAME "Mandrake Linux" +#define DISTRIB_NAME "Frozen Bubble" #define RAMDISK_COMPRESSION_RATIO 1.95 -#define LIVE_LOCATION "/Mandrake/mdkinst/" -#define RAMDISK_LOCATION "/Mandrake/base/" +#define LIVE_LOCATION "/fbimg.bz2" +#define RAMDISK_LOCATION "/" #define IMAGE_LOCATION "/tmp/image" #define STAGE2_LOCATION "/tmp/stage2" Index: mdk-stage1/disk.c =================================================================== RCS file: /cooker/gi/mdk-stage1/disk.c,v retrieving revision 1.24 diff -u -r1.24 disk.c --- mdk-stage1/disk.c 2001/09/24 22:39:09 1.24 +++ mdk-stage1/disk.c 2002/03/20 22:12:43 @@ -148,7 +148,7 @@ static enum return_type try_with_device(char *dev_name) { - char * questions_location[] = { "Directory or ISO image", NULL }; + char * questions_location[] = { "Location", NULL }; char * questions_location_auto[] = { "directory", NULL }; static char ** answers_location = NULL; char device_fullname[50]; @@ -197,7 +197,7 @@ return RETURN_ERROR; } - results = ask_from_list_comments_auto("Please choose the partition where is copied the " DISTRIB_NAME " Distribution.", + results = ask_from_list_comments_auto("Please choose the partition where is copied the " DISTRIB_NAME " Image File.", parts, parts_comments, &choice, "partition", parts); if (results != RETURN_OK) return results; @@ -212,7 +212,7 @@ return try_with_device(dev_name); } - if (ask_from_entries_auto("Please enter the directory (or ISO image file) containing the " DISTRIB_NAME " Distribution.", + if (ask_from_entries_auto("Please enter the full path of the " DISTRIB_NAME " Image File.", questions_location, &answers_location, 24, questions_location_auto, NULL) != RETURN_OK) { umount(disk_own_mount); return try_with_device(dev_name); @@ -223,9 +223,9 @@ strcat(location_full, answers_location[0]); if (access(location_full, R_OK)) { - stg1_error_message("Directory or ISO image file could not be found on partition.\n" - "Here's a short extract of the files in the root of the partition:\n" - "%s", disk_extract_list_directory(disk_own_mount)); + stg1_error_message("No such file on partition.\n" + "Here's a short extract of the files in the root of the partition:\n" + "%s", disk_extract_list_directory(disk_own_mount)); umount(disk_own_mount); return try_with_device(dev_name); } @@ -233,14 +233,18 @@ unlink(IMAGE_LOCATION); if (!stat(location_full, &statbuf) && !S_ISDIR(statbuf.st_mode)) { - log_message("%s exists and is not a directory, assuming this is an ISO image", location_full); - if (lomount(location_full, IMAGE_LOCATION)) { - stg1_error_message("Could not mount file %s as an ISO image of the " DISTRIB_NAME " Distribution.", answers_location[0]); + log_message("found file ok"); + if (load_ramdisk(location_full) != RETURN_OK) { + stg1_error_message("Could not load program into memory."); umount(disk_own_mount); return try_with_device(dev_name); } - } else - symlink(location_full, IMAGE_LOCATION); + method_name = strdup("disk"); + return RETURN_OK; + } else { + stg1_error_message("It's a directory!"); + return try_with_device(dev_name); + } if (IS_SPECIAL_STAGE2 || ramdisk_possible()) { /* RAMDISK install */ @@ -253,12 +257,6 @@ umount(disk_own_mount); return try_with_device(dev_name); } - if (load_ramdisk() != RETURN_OK) { - stg1_error_message("Could not load program into memory."); - loumount(); - umount(disk_own_mount); - return try_with_device(dev_name); - } } else { /* LIVE install */ char p; @@ -326,7 +324,7 @@ return disk_prepare(); } - results = ask_from_list_comments_auto("Please choose the DISK drive on which you copied the " DISTRIB_NAME " Distribution.", + results = ask_from_list_comments_auto("Please choose the DISK drive on which you copied the " DISTRIB_NAME " Image File", medias, medias_models, &choice, "disk", medias); if (results != RETURN_OK) Index: mdk-stage1/network.c =================================================================== RCS file: /cooker/gi/mdk-stage1/network.c,v retrieving revision 1.40 diff -u -r1.40 network.c --- mdk-stage1/network.c 2002/03/20 22:11:43 1.40 +++ mdk-stage1/network.c 2002/03/20 22:12:44 @@ -670,7 +670,7 @@ log_message("found the " DISTRIB_NAME " Installation, good news!"); if (IS_SPECIAL_STAGE2) { - if (load_ramdisk() != RETURN_OK) { + if (load_ramdisk(NULL) != RETURN_OK) { stg1_error_message("Could not load program into memory."); return nfs_prepare(); } Index: mdk-stage1/stage1.c =================================================================== RCS file: /cooker/gi/mdk-stage1/stage1.c,v retrieving revision 1.46 diff -u -r1.46 stage1.c --- mdk-stage1/stage1.c 2001/12/11 14:48:26 1.46 +++ mdk-stage1/stage1.c 2002/03/20 22:12:44 @@ -394,6 +394,9 @@ init_modules_insmoding(); init_frontend("Welcome to " DISTRIB_NAME " (" VERSION ") " __DATE__ " " __TIME__); + if (total_memory() < 66) + stg1_error_message("It seems that you have 64 Mbytes or less of RAM. It will probably fail."); + if (IS_EXPERT) expert_third_party_modules(); Index: mdk-stage1/tools.c =================================================================== RCS file: /cooker/gi/mdk-stage1/tools.c,v retrieving revision 1.29 diff -u -r1.29 tools.c --- mdk-stage1/tools.c 2001/08/24 19:11:07 1.29 +++ mdk-stage1/tools.c 2002/03/20 22:12:44 @@ -339,14 +339,10 @@ } -enum return_type load_ramdisk(void) +enum return_type load_ramdisk(char * img_name) { int st2_fd; struct stat statr; - char img_name[500]; - - strcpy(img_name, IMAGE_LOCATION); - strcat(img_name, get_ramdisk_realname()); log_message("trying to load %s as a ramdisk", img_name); Index: mdk-stage1/tools.h =================================================================== RCS file: /cooker/gi/mdk-stage1/tools.h,v retrieving revision 1.9 diff -u -r1.9 tools.h --- mdk-stage1/tools.h 2001/04/30 17:23:04 1.9 +++ mdk-stage1/tools.h 2002/03/20 22:12:44 @@ -32,7 +32,7 @@ int total_memory(void); int ramdisk_possible(void); char * get_ramdisk_realname(void); -enum return_type load_ramdisk(void); +enum return_type load_ramdisk(char * img_name); enum return_type load_ramdisk_fd(int ramdisk_fd, int size); void * memdup(void *src, size_t size); void add_to_env(char * name, char * value); Index: perl-install/Makefile =================================================================== RCS file: /cooker/gi/perl-install/Makefile,v retrieving revision 1.225 diff -u -r1.225 Makefile --- perl-install/Makefile 2002/03/11 11:38:23 1.225 +++ perl-install/Makefile 2002/03/20 22:12:44 @@ -68,8 +68,7 @@ chmod a+x $(DESTREP4PMS)/g_auto_install chmod a+x $(DESTREP4PMS)/live_install* -get_needed_files: $(DIRS) $(MOFILES) - $(MAKE) -C share +get_needed_files: $(DIRS) # export PERL_INSTALL_TEST=1 ; strace -f -e trace=file -o '| grep -v "(No such file or directory)" | sed -e "s/[^\"]*\"//" -e "s/\".*//" | grep "^/" | grep -v -e "^/tmp" -e "^/home" -e "^/proc" -e "^/var" -e "^/dev" -e "^/etc" -e "^/usr/lib/rpm" > /tmp/list ' $(PERL) -d install2 < /dev/null eval `perl -V:version`; \ @@ -80,6 +79,19 @@ find auto -follow -name "*.so" >> /tmp/list + rpm -ql icewm-light | grep /usr/X11R6 >> /tmp/list + rpm -ql libSDL_image1.2 libSDL1.2 libSDL_mixer1.2 | grep /usr/lib >> /tmp/list + rpm -ql perl-SDL | grep site_perl >> /tmp/list + rpm -ql frozen-bubble | grep -v /usr/lib/menu | grep -v /usr/share/doc >> /tmp/list + echo /sbin/isapnp >> /tmp/list + echo /sbin/pnpdump >> /tmp/list + echo /usr/sbin/sndconfig >> /tmp/list + echo /bin/vim-minimal >> /tmp/list + echo /usr/bin/aumix >> /tmp/list + echo /bin/bash >> /tmp/list + echo /usr/X11R6/bin/rxvt.bin >> /tmp/list + echo /usr/X11R6/lib/X11/rgb.txt >> /tmp/list + for i in $(LOCALFILES) `cat /tmp/list` ; do \ ldd $$i 2>/dev/null | grep "=>" | sed -e 's/.*=> //' -e 's/ .*//' | uniq | sort >> /tmp/list; \ done @@ -160,10 +172,20 @@ for i in ../all.modules/modules.cz*; do cp -f $$i $(DEST)/lib/; done - $(MAKE) -C share/po install NAME=libDrakX LOCALEDIR=$(DEST)/usr/share/locale_special +# $(MAKE) -C share/po install NAME=libDrakX LOCALEDIR=$(DEST)/usr/share/locale_special # echo -e '#!/bin/sh\n\nexec "/usr/bin/sh"' > $(DEST)/usr/bin/runinstall2 # chmod a+x $(DEST)/usr/bin/runinstall2 + + rm -f $(DEST)/usr/X11R6/lib/X11/fonts/{gb16st,k14,taipei16,baekmuk_gulim_12}.pcf.gz + cp -f /usr/X11R6/lib/X11/fonts/75dpi/helv* $(DEST)/usr/X11R6/lib/X11/fonts/ + cp -f /usr/X11R6/lib/X11/fonts/misc/7x14* $(DEST)/usr/X11R6/lib/X11/fonts/ + mkfontdir $(DEST)/usr/X11R6/lib/X11/fonts 2>/dev/null + + echo -e "prog frozen-bubble frozen-bubble frozen-bubble\nprog aumix aumix aumix\nprog rxvt rxvt rxvt.bin -sl 2000 -fn -*-fixed-medium-*-*-*-*-*-*-*-*-*-iso8859-15" > $(DEST)/usr/X11R6/lib/X11/icewm/toolbar + cat $(DEST)/usr/X11R6/lib/X11/icewm/toolbar > $(DEST)/usr/X11R6/lib/X11/icewm/menu + echo -e "Theme=bluePlastic/default.theme" > $(DEST)/usr/X11R6/lib/X11/icewm/preferences + ifeq (i386,$(ARCH)) cp -a /etc/pcmcia $(DEST)/etc Index: perl-install/install_steps_gtk.pm =================================================================== RCS file: /cooker/gi/perl-install/install_steps_gtk.pm,v retrieving revision 1.263 diff -u -r1.263 install_steps_gtk.pm --- perl-install/install_steps_gtk.pm 2002/03/15 10:32:48 1.263 +++ perl-install/install_steps_gtk.pm 2002/03/20 22:12:44 @@ -57,7 +57,7 @@ sleep 1; log::l("Server died"), return 0 if !$ok; if (c::Xtest($ENV{DISPLAY})) { - fork || exec("aewm-drakx") || exec("true"); +# fork || exec("aewm-drakx") || exec("true"); return 1; } } @@ -105,6 +105,31 @@ } } OK: + require commands; + commands::mknod("/dev/dsp", "c", 14, 3); + commands::mknod("/dev/mixer", "c", 14, 0); + eval { commands::mknod("/dev/ptyp0", "c", 2, 0); }; + eval { commands::mknod("/dev/ttyp0", "c", 3, 0); }; + eval { commands::mknod("/dev/ptmx", "c", 5, 2); }; + eval { commands::mknod("/dev/tty", "c", 5, 0); }; + + symlink "/usr/bin/bash", "/bin/bash"; + symlinkf("/usr/bin/bash", "/bin/sh"); + + if (!$::expert) { + if (!modules::load_thiskind("sound")) { + eval { + symlink "/usr/bin/pnpdump", "/sbin/pnpdump"; + run_program::run("sndconfig", "--quiet"); + run_program::run("isapnp", "/etc/isapnp.conf"); + my @l = cat_("/etc/modules.conf"); + my $module; /alias sound-slot-0 (\S+)/ and $module = $1 foreach @l; + my @options; /options\s+$module\s+(.*)/ and @options = split ' ', $1 foreach @l; + modules::load($module, 'sound', @options); + } + } + } + exec "icewm-light" or die; install_gtk::init_sizes(); install_gtk::default_theme($o); install_gtk::create_logo_window($o); Index: tools/make_mdkinst_stage2 =================================================================== RCS file: /cooker/gi/tools/make_mdkinst_stage2,v retrieving revision 1.21 diff -u -r1.21 make_mdkinst_stage2 --- tools/make_mdkinst_stage2 2002/02/21 14:54:28 1.21 +++ tools/make_mdkinst_stage2 2002/03/20 22:12:44 @@ -61,7 +61,7 @@ mkdir -p $MNTPOINT 2>/dev/null for i in $MNTPOINT $STAGE2; do $SUDO umount $i 2>/dev/null ; done dd if=/dev/zero of=$STAGE2 bs=1k count=$[ `du -s $STAGE2TMP | cut -f1` + 1024 + 200 ] -$MKE2FS -N 1000 $STAGE2 +$MKE2FS -N 2000 $STAGE2 $SUDO mount -t ext2 $STAGE2 $MNTPOINT -o loop rmdir $MNTPOINT/lost+found 233'>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
package install_steps_gtk; # $Id$

use diagnostics;
use strict;
use vars qw(@ISA);

@ISA = qw(install_steps_interactive interactive_gtk);

#-######################################################################################
#- misc imports
#-######################################################################################
use install_steps_interactive;
use interactive_gtk;
use common;
use my_gtk qw(:helpers :wrappers);
use Gtk;
use devices;
use modules;
use install_gtk;
use install_any;
use mouse;
use help;
use log;

#-######################################################################################
#- In/Out Steps Functions
#-######################################################################################
sub new($$) {
    my ($type, $o) = @_;

    my $old = $SIG{__DIE__};
    $SIG{__DIE__} = sub { $_[0] !~ /my_gtk\.pm/ and goto $old };

    $ENV{DISPLAY} ||= $o->{display} || ":0";
    unless ($::testing) {
	$my_gtk::force_focus = $ENV{DISPLAY} eq ":0";

	if ($ENV{DISPLAY} eq ":0" && !$::live) {
	    my $f = "/tmp/Xconf";
	    install_gtk::createXconf($f, @{$o->{mouse}}{"XMOUSETYPE", "device"}, $o->{wacom}[0]);
	    devices::make("/dev/kbd");

	    local (*T1, *T2);
	    open T1, ">/dev/tty5";
	    open T2, ">/dev/tty6";

	    my $launchX = sub {
		my $ok = 1;
		my $xpmac_opts = cat_("/proc/cmdline");
		unless (-d "/var/log" ) { mkdir("/var/log"); }
		local $SIG{CHLD} = sub { $ok = 0 if waitpid(-1, c::WNOHANG()) > 0 };
		unless (fork) {
		    exec $_[0], (arch() =~ /^sparc/ || arch() eq "ppc" ? () : ("-kb")), "-dpms","-s" ,"240",
		      ($_[0] =~ /Xpmac/ ? $xpmac_opts !~ /ofonly/ ? ("-mode", "17", "-depth", "32") : ("-mach64"):()),
		      ($_[0] =~ /Xsun/ || $_[0] =~ /Xpmac/ ? ("-fp", "/usr/X11R6/lib/X11/fonts:unscaled") :
		       ("-allowMouseOpenFail", "-xf86config", $f)) or exit 1;
		}
		foreach (1..60) {
		    sleep 1;
		    log::l("Server died"), return 0 if !$ok;
		    return 1 if c::Xtest($ENV{DISPLAY});
		}
		log::l("Timeout!!");
		0;
	    };
	    my @servers = qw(FBDev VGA16); #-)
	    if (arch() eq "alpha") {
		require Xconfigurator;
		my $card = Xconfigurator::cardConfigurationAuto();
		Xconfigurator::updateCardAccordingName($card, $card->{type}) if $card && $card->{type};
		@servers = $card->{server} || "TGA";
		#-@servers = qw(SVGA 3DLabs TGA) 
	    } elsif (arch() =~ /^sparc/) {
		local $_ = cat_("/proc/fb");
		if (/Mach64/) { @servers = qw(Mach64) }
		elsif (/Permedia2/) { @servers = qw(3DLabs) }
		else { @servers = qw(Xsun24) }
	    } elsif (arch() =~ /ia64/) {
		@servers= 'XFree86';
	    } elsif (arch() eq "ppc") {
	    	@servers = qw(Xpmac);
            }

	    foreach (@servers) {
		log::l("Trying with server $_");
		my $dir = "/usr/X11R6/bin";
		my $prog = /Xsun|Xpmac|XFree86/ ? $_ : "XF86_$_";
		unless (-x "$dir/$prog") {
		    unlink $_ foreach glob_("$dir/X*");
		    install_any::getAndSaveFile("Mandrake/mdkinst$dir/$prog", "$dir/$prog") or die "failed to get server $prog: $!";
		    chmod 0755, "$dir/$prog";
		}
		if (/FB/) {
		    !$o->{vga16} && $o->{allowFB} or next;

		    $o->{allowFB} = &$launchX($prog) #- keep in mind FB is used.
		      and goto OK;
		} else {
		    $o->{vga16} = 1 if /VGA16/;
		    &$launchX($prog) and goto OK;
		}
	    }
	    return undef;
	}
    }
  OK:
    install_gtk::init_sizes();
    install_gtk::default_theme($o);
    install_gtk::create_logo_window($o);

    $my_gtk::force_center = [ $::rootwidth - $::windowwidth, $::logoheight, $::windowwidth, $::windowheight ];

    (bless {}, ref $type || $type)->SUPER::new($o);
}

sub enteringStep {
    my ($o, $step) = @_;

    printf "Entering step `%s'\n", $o->{steps}{$step}{text};
    $o->SUPER::enteringStep($step);
    install_gtk::create_steps_window($o);
    install_gtk::create_help_window($o);
}
sub leavingStep {
    my ($o, $step) = @_;
    $o->SUPER::leavingStep($step);
}


sub charsetChanged {
    my ($o) = @_;
    Gtk->set_locale;
    install_gtk::install_theme($o);
    install_gtk::create_steps_window($o);
}

#-######################################################################################
#- Steps Functions
#-######################################################################################
sub selectLanguage {
    my ($o, $first_time) = @_;
    $o->SUPER::selectLanguage;
  
    $o->ask_warn('',
_("Your system is low on resource. You may have some problem installing
Mandrake Linux. If that occurs, you can try a text install instead. For this,
press `F1' when booting on CDROM, then enter `text'.")) if $first_time && availableRamMB() < 60; # 60MB

}

#------------------------------------------------------------------------------
sub selectInstallClass1 {
    my ($o, $verif, $l, $def, $l2, $def2) = @_;
    $::live || @$l == 1 and return $o->SUPER::selectInstallClass1($verif, $l, $def, $l2, $def2);

    my $w = my_gtk->new('');
    my $focused;
    gtkadd($w->{window},
	   gtkpack($w->create_box_with_title(_("Please, choose one of the following classes of installation:")),
		   (my @radios = gtkradio($def, @$l)),
		   gtkadd(create_hbox(),
			  map { my $v = $_; 
				my $b = new Gtk::Button(translate($_));
				$focused = $b if $_ eq $def2;
				gtksignal_connect($b, "clicked" => sub { $w->{retval} = $v; Gtk->main_quit });
			    } @$l2)
		  ));
    $focused->grab_focus if $focused;
    $w->main;

    mapn { $verif->($_[1]) if $_[0]->active } \@radios, $l;
    install_gtk::create_steps_window($o);

    $w->{retval};
}

#------------------------------------------------------------------------------
sub selectMouse {
    my ($o, $force) = @_;
    my %old = %{$o->{mouse}};
    $o->SUPER::selectMouse($force);
    my $mouse = $o->{mouse};
    $mouse->{type} eq 'none' ||
      $old{type}   eq $mouse->{type}   && 
      $old{name}   eq $mouse->{name}   &&
      $old{device} eq $mouse->{device} && !$force and return;

    local $my_gtk::grab = 1; #- unsure a crazy mouse don't go wild clicking everywhere

    while (1) {
	log::l("telling X server to use another mouse");
	eval { modules::load('serial') } if $mouse->{device} =~ /ttyS/;

	if (!$::testing) {
	    devices::make($mouse->{device});
	    symlinkf($mouse->{device}, "/dev/mouse");
	    c::setMouseLive($ENV{DISPLAY}, mouse::xmouse2xId($mouse->{XMOUSETYPE}), $mouse->{nbuttons} < 3);
	}
	install_gtk::test_mouse($mouse) and return;
	$o->SUPER::selectMouse(1);
	$mouse = $o->{mouse};
    } 
}

#------------------------------------------------------------------------------
sub chooseSizeToInstall {
    my ($o, $packages, $min_size, $def_size, $max_size_, $availableC, $individual) = @_;
    my $max_size = min($max_size_, $availableC);
    my $enough = $max_size == $max_size_;
    my $percentage = int 100 * $max_size / $max_size_;

    #- don't ask anything if the difference between min and max is too small
    log::l("chooseSizeToInstall: min_size=$min_size, def_size=$def_size, max_size=$max_size_, available=$availableC");
    return $max_size if $min_size && $max_size / $min_size < 1.05;

    log::l("choosing size to install between $min_size and $max_size");
    my $w = my_gtk->new('');
    my $adj = create_adjustment(int(100 * $def_size / $max_size_), $min_size * 100 / $max_size_, $percentage);
    my $spin = gtkset_usize(new Gtk::SpinButton($adj, 0, 0), 20, 0);
    my $val;

    require pkgs;
    gtkadd($w->{window},
	  gtkpack(new Gtk::VBox(0,20),
		  _("The total size for the groups you have selected is approximately %d MB.\n", pkgs::correctSize($max_size_ / sqr(1024))) .
		  ($enough ?
_("If you wish to install less than this size,
select the percentage of packages that you want to install.

A low percentage will install only the most important packages;
a percentage of 100%% will install all selected packages.") : 
_("You have space on your disk for only %d%% of these packages.

If you wish to install less than this,
select the percentage of packages that you want to install.
A low percentage will install only the most important packages;
a percentage of %d%% will install as many packages as possible.", $percentage, $percentage))
. ($individual ? "\n\n" . _("You will be able to choose them more specifically in the next step.") : ''),
		 create_packtable({},
				  [ _("Percentage of packages to install") . '  ', $spin, "%", my $mb = new Gtk::Label ],
				  [ undef, new Gtk::HScrollbar($adj) ],
			       ),
		 create_okcancel($w)
		)
	 );
    $spin->signal_connect(changed => my $changed = sub { 
	$val = $spin->get_value_as_int / 100 * $max_size_;
	$mb->set(sprintf("(%dMB)", pkgs::correctSize($val / sqr(1024)))); 
    }); &$changed();
    $spin->signal_connect(activate => sub { $w->{retval} = 1; Gtk->main_quit });
    $spin->grab_focus();
    $w->main and $val + 1; #- add a single byte (hack?) to make selection of 0 bytes ok.
}

sub reallyChooseGroups {
    my ($o, $size_to_display, $individual, $val) = @_;

    my $w = my_gtk->new('');
    my $tips = new Gtk::Tooltips;
    my $w_size = new Gtk::Label(&$size_to_display);

    my $entry = sub {
	my ($e) = @_;
	my $text = translate($o->{compssUsers}{$e}{label});
	my $help = translate($o->{compssUsers}{$e}{descr});

	my $file = do {
	    my $f = "$ENV{SHARE_PATH}/icons/" . ($o->{compssUsers}{$e}{icons} || 'default');
	    -e "$f.png" or $f .= "_section";
	    -e "$f.png" or $f = "$ENV{SHARE_PATH}/icons/default_section";
	    "$f.png";
	};
	my $check = Gtk::CheckButton->new($text);
	$check->set_active($val->{$e});
	$check->signal_connect(clicked => sub { 
	    $val->{$e} = $check->get_active;
	    $w_size->set(&$size_to_display);
	});
	gtkset_tip($tips, $check, $help);
	gtkpack_(new Gtk::HBox(0,0), 0, gtkpng($file), 1, $check);
	#$check;
    };
    my $entries_in_path = sub {
	my ($path) = @_;
	translate($path), map { $entry->($_) } grep { !/Utilities/ && $o->{compssUsers}{$_}{path} eq $path } @{$o->{compssUsersSorted}};
    };
    gtkadd($w->{window},
	   gtkpack($w->create_box_with_title(_("Package Group Selection")),
		   gtkpack_(new Gtk::VBox(0,0),
			   1, gtkpack_(new Gtk::HBox(0,0),
				   1, gtkpack(new Gtk::VBox(0,0), 
					   $entries_in_path->('Workstation'),
					   '',
					   $entry->('Development|Development'),
					   $entry->('Development|Documentation'),
					  ),
				   0, gtkpack(new Gtk::VBox(0,0), 
					   $entries_in_path->('Server'),
					   '',
					   $entries_in_path->('Graphical Environment'),
					  ),
				     ),
			   ),
		   '',
		   gtkadd(new Gtk::HBox(0,0),
			  $w_size,
			  if_($individual, do {
			      my $check = Gtk::CheckButton->new(_("Individual package selection"));
			      $check->set_active($$individual);
			      $check->signal_connect(clicked => sub { $$individual = $check->get_active });
			      $check;
			  }),
			  gtksignal_connect(new Gtk::Button(_("Ok")), clicked => sub { Gtk->main_quit }),
			 ),
		  ),
	  );
    $w->{rwindow}->set_default_size($::windowwidth * 0.8, $::windowheight * 0.8);
    $w->main;
    1;    
}


sub choosePackagesTree {
    my ($o, $packages) = @_;

    my $available = install_any::getAvailableSpace($o);
    my $availableCorrected = pkgs::invCorrectSize($available / sqr(1024)) * sqr(1024);

    my $common; $common = { get_status => sub {
				my $size = pkgs::selectedSize($packages);
				_("Total size: %d / %d MB", pkgs::correctSize($size / sqr(1024)), $available / sqr(1024));
			    },
			    node_state => sub {
				my $p = pkgs::packageByName($packages,$_[0]) or return;
				pkgs::packageMedium($p)->{selected} or return;
				pkgs::packageFlagBase($p) and return 'base';
				pkgs::packageFlagInstalled($p) and return 'installed';
				pkgs::packageFlagSelected($p) and return 'selected';
				return 'unselected';
			    },
			    build_tree => sub {
				my ($add_node, $flat) = @_;
				if ($flat) {
				    foreach (sort grep { my $pkg = pkgs::packageByName($packages, $_);
							 pkgs::packageMedium($pkg)->{selected} } keys %{$packages->{names}}) {
					$add_node->($_, undef);
				    }
				} else {
				    foreach my $root (@{$o->{compssUsersSorted}}) {
					my (%fl, @firstchoice, @others);
					#$fl{$_} = $o->{compssUsersChoice}{$_} foreach @{$o->{compssUsers}{$root}{flags}}; #- FEATURE:improve choce of packages...
					$fl{$_} = 1 foreach @{$o->{compssUsers}{$root}{flags}};
					foreach my $p (values %{$packages->{names}}) {
					    my ($rate, @flags) = pkgs::packageRateRFlags($p);
					    next if !($rate && grep { grep { !/^!/ && $fl{$_} } split('\|\|') } @flags);
					    $rate >= 3 ?
					      push(@firstchoice, pkgs::packageName($p)) :
						push(@others,      pkgs::packageName($p));
					}
					$add_node->($_, $root                   ) foreach sort @firstchoice;
					$add_node->($_, $root . '|' . _("Other")) foreach sort @others;
				    }
				}
			    },
			    get_info => sub {
				my $p = pkgs::packageByName($packages, $_[0]) or return '';
				pkgs::extractHeaders($o->{prefix}, [$p], pkgs::packageMedium($p));
				pkgs::packageHeader($p) or die;

				my $imp = translate($pkgs::compssListDesc{pkgs::packageFlagBase($p) ?
									  5 : pkgs::packageRate($p)});

				my $info = $@ ? _("Bad package") :
				  (_("Name: %s\n", pkgs::packageName($p)) .
				   _("Version: %s\n", pkgs::packageVersion($p) . '-' . pkgs::packageRelease($p)) .
				   _("Size: %d KB\n", pkgs::packageSize($p) / 1024) .
				   ($imp && _("Importance: %s\n", $imp)) . "\n" .
				   formatLines(c::headerGetEntry(pkgs::packageHeader($p), 'description')));
				pkgs::packageFreeHeader($p);
				return $info;
			    },
			    toggle_nodes => sub {
				my $set_state = shift @_;
				my @n = map { pkgs::packageByName($packages, $_) } @_;
				my %l;
				my $isSelection = !pkgs::packageFlagSelected($n[0]);
				foreach (@n) {
				    pkgs::togglePackageSelection($packages, $_, my $l = {});
				    @l{grep {$l->{$_}} keys %$l} = ();
				}
				if (my @l = keys %l) {
				    #- check for size before trying to select.
				    my $size = pkgs::selectedSize($packages);
				    foreach (@l) {
					my $p = $packages->{names}{$_};
					pkgs::packageFlagSelected($p) or $size += pkgs::packageSize($p);
				    }
				    if (pkgs::correctSize($size / sqr(1024)) > $available / sqr(1024)) {
					return $o->ask_warn('', _("You can't select this package as there is not enough space left to install it"));
				    }

				    @l > @n && $common->{state}{auto_deps} and
				      $o->ask_okcancel('', [ $isSelection ? 
							     _("The following packages are going to be installed") :