diff options
Diffstat (limited to 'perl-install/install2.pm')
| -rw-r--r-- | perl-install/install2.pm | 86 |
1 files changed, 44 insertions, 42 deletions
diff --git a/perl-install/install2.pm b/perl-install/install2.pm index f1984e285..507c56af0 100644 --- a/perl-install/install2.pm +++ b/perl-install/install2.pm @@ -15,16 +15,14 @@ use install_any; use lang; use keyboard; use mouse; -use fsedit; use devices; -use partition_table qw(:types); +use partition_table; use modules; use detect_devices; use run_program; use any; use log; use fs; -#-$::corporate=1; #-####################################################################################### @@ -95,7 +93,7 @@ sub selectLanguage { sub acceptLicense { my ($_clicked, $_ent_number, $auto) = @_; - installStepsCall($o, $auto, 'acceptLicense') if !$o->{useless_thing_accepted}; + installStepsCall($o, $auto, 'acceptLicense'); } #------------------------------------------------------------------------------ @@ -107,7 +105,7 @@ sub selectMouse { installStepsCall($o, $auto, 'selectMouse', !$first_time || $clicked); - addToBeDone { mouse::write($o, $o->{mouse}) if !$o->{isUpgrade} || $clicked } 'installPackages'; + addToBeDone { mouse::write($o->do_pkgs, $o->{mouse}) if !$o->{isUpgrade} || $clicked } 'installPackages'; } #------------------------------------------------------------------------------ @@ -162,10 +160,10 @@ sub formatPartitions { $o->{steps}{choosePackages}{done} = 0; installStepsCall($o, $auto, 'choosePartitionsToFormat', $o->{fstab}) if !$o->{isUpgrade}; - my $want_root_formated = fsedit::get_root($o->{fstab})->{toFormat}; + my $want_root_formated = fs::get::root($o->{fstab})->{toFormat}; if ($want_root_formated) { foreach ('/usr') { - my $part = fsedit::mntpoint2part($_, $o->{fstab}) or next; + my $part = fs::get::mntpoint2part($_, $o->{fstab}) or next; $part->{toFormat} or die N("You must also format %s", $_); } } @@ -187,6 +185,10 @@ sub formatPartitions { devices::make("$o->{prefix}/dev/null"); chmod 0666, "$o->{prefix}/dev/null"; + eval { fs::mount('none', "$o->{prefix}/proc", 'proc') }; + eval { fs::mount('none', "$o->{prefix}/proc/bus/usb", 'usbdevfs') }; + eval { fs::mount('none', "$o->{prefix}/sys", 'sysfs') }; + common::screenshot_dir__and_move(); any::rotate_logs($o->{prefix}); @@ -198,11 +200,11 @@ sub formatPartitions { #- when usb-storage is in scsi_hostadapter, #- hotplug + scsimon do not load sd_mod/sr_mod when needed #- (eg: when plugging a usb key) - modules::remove_probeall('scsi_hostadapter', 'usb-storage'); + $o->{modules_conf}->remove_probeall('scsi_hostadapter', 'usb-storage'); } require raid; - raid::prepare_prefixed($o->{all_hds}{raids}, $o->{prefix}); + raid::prepare_prefixed($o->{all_hds}{raids}); #- needed by lilo if (my @vgs = map { $_->{VG_name} } @{$o->{all_hds}{lvms}}) { @@ -218,7 +220,8 @@ sub choosePackages { #- always setPackages as it may have to copy hdlist files and synthesis files. installStepsCall($o, $auto, 'setPackages', $o->{isUpgrade} && $ent_number == 1); installStepsCall($o, $auto, 'choosePackages', $o->{packages}, $o->{compssUsers}, $ent_number == 1); - log::l("compssUsersChoice's: ", join(" ", grep { $o->{compssUsersChoice}{$_} } keys %{$o->{compssUsersChoice}})); + my @flags = map_each { if_($::b, $::a) } %{$o->{rpmsrate_flags_chosen}}; + log::l("rpmsrate_flags_chosen's: ", join(' ', sort @flags)); #- check pre-condition where base backage has to be selected. pkgs::packageByName($o->{packages}, 'basesystem')->flag_available or die "basesystem package not selected"; @@ -264,7 +267,7 @@ sub configureNetwork { #------------------------------------------------------------------------------ sub installUpdates { my ($_clicked, $_ent_number, $auto) = @_; - installStepsCall($o, $auto, 'installUpdates'); + installStepsCall($o, $auto, 'installUpdates') if $o->{meta_class} ne 'firewall'; } #------------------------------------------------------------------------------ sub configureServices { @@ -290,7 +293,7 @@ sub setupBootloader { my ($_clicked, $ent_number, $auto) = @_; return if $::uml_install; - modules::write_conf(); + $o->{modules_conf}->write; installStepsCall($o, $auto, 'setupBootloaderBefore') if $ent_number == 1; installStepsCall($o, $auto, 'setupBootloader', $ent_number); @@ -303,7 +306,7 @@ sub configureX { #- done here and also at the end of install2.pm, just in case... install_any::write_fstab($o); - modules::write_conf(); + $o->{modules_conf}->write; require pkgs; installStepsCall($o, $auto, 'configureX') if !$::testing && eval { pkgs::packageByName($o->{packages}, 'xorg-x11')->flag_installed } && !$o->{X}{disabled}; @@ -326,9 +329,8 @@ sub start_i810fb() { eval { modules::load('intel-agp') }; eval { any::ddcxinfos(); # keep the result otherwise ddcxinfos doesn't return good results afterwards - modules::load([ 'i810fb', - "xres=$xres", 'hsync1=32', 'hsync2=48', 'vsync1=50', 'vsync2=70', #- this sucking i810fb does not accept floating point numbers in hsync! - 'vram=2', 'bpp=16', 'accel=1', 'mtrr=1' ]); + my $opt = "xres=$xres hsync1=32 hsync2=48 vsync1=50 vsync2=70 vram=2 bpp=16 accel=1 mtrr=1"; #- this sucking i810fb does not accept floating point numbers in hsync! + modules::load_with_options([ 'i810fb' ], { i810fb => $opt }); }; } @@ -338,14 +340,15 @@ sub start_i810fb() { #-###################################################################################### sub main { $SIG{SEGV} = sub { - my $msg = "segmentation fault: seems like memory is missing as the install crashes"; print "$msg\n"; log::l($msg); + my $msg = "segmentation fault: seems like memory is missing as the install crashes"; log::l($msg); $o->ask_warn('', $msg); setVirtual(1); require install_steps_auto_install; - install_steps_auto_install_non_interactive::errorInStep(); + install_steps_auto_install_non_interactive::errorInStep($o, $msg); }; $ENV{PERL_BADLANG} = 1; $ENV{LD_ASSUME_KERNEL} = '2.4.1'; + delete $ENV{TERMINFO}; umask 022; $::isInstall = 1; @@ -387,7 +390,7 @@ sub main { vga => sub { $o->{vga} = $v }, step => sub { $o->{steps}{first} = $v }, meta_class => sub { $o->{meta_class} = $v }, - freeDriver => sub { $o->{freeDriver} = $v }, + freedriver => sub { $o->{freedriver} = $v }, readonly => sub { $o->{partitioning}{readonly} = $v ne "0" }, display => sub { $o->{display} = $v }, askdisplay => sub { print "Please enter the X11 display to perform the install on ? "; $o->{display} = chomp_(scalar(<STDIN>)) }, @@ -401,7 +404,6 @@ sub main { newt => sub { $o->{interactive} = "newt" }, text => sub { $o->{interactive} = "newt" }, stdio => sub { $o->{interactive} = "stdio" }, - corporate => sub { $::corporate = 1 }, kickstart => sub { $::auto_install = $v }, uml_install => sub { $::uml_install = 1 }, auto_install => sub { $::auto_install = $v }, @@ -420,7 +422,7 @@ sub main { } %cmdline; if ($::testing) { - $ENV{SHARE_PATH} ||= "/export/Mandrake/mdkinst/usr/share"; + $ENV{SHARE_PATH} ||= "/export/install/stage2/live/usr/share"; $ENV{SHARE_PATH} = "/usr/share" if !-e $ENV{SHARE_PATH}; } else { $ENV{SHARE_PATH} ||= "/usr/share"; @@ -457,8 +459,10 @@ sub main { eval { spawnShell() }; modules::load_dependencies(($::testing ? ".." : "") . "/modules/modules.dep"); - modules::mergein_conf_raw('/tmp/modules.conf'); - modules::read_already_loaded(); + require modules::any_conf; + require modules::modules_conf; + $o->{modules_conf} = modules::modules_conf::read(modules::any_conf::vnew(), '/tmp/modules.conf'); + modules::read_already_loaded($o->{modules_conf}); #- done before auto_install is called to allow the -IP feature on auto_install file name if (-e '/tmp/network') { @@ -493,8 +497,7 @@ sub main { log::l("error using auto_install, continuing"); undef $::auto_install; } else { - print "Error using auto_install\n", formatError($@), "\n"; - install_steps_auto_install_non_interactive::errorInStep(); + install_steps_auto_install_non_interactive::errorInStep($o, "Error using auto_install\n" . formatError($@)); } } else { log::l("auto install config file loaded successfully"); @@ -527,12 +530,12 @@ sub main { require "install_steps_$o->{interactive}.pm" if $o->{interactive}; #- needed before accessing floppy (in case of usb floppy) - modules::load_category('bus/usb'); + modules::load_category($o->{modules_conf}, 'bus/usb'); #- oem patch should be read before to still allow patch or defcfg. - eval { $o = $::o = install_any::loadO($o, "Mandrake/base/patch-oem.pl"); log::l("successfully read oem patch") }; + eval { $o = $::o = install_any::loadO($o, "install/patch-oem.pl"); log::l("successfully read oem patch") }; #- recovery mode should be read early to allow default parameter to be taken. - eval { $o = $::o = install_any::loadO($o, "Mandrake/base/recovery.cfg"); log::l("successfully read recovery") } if $::recovery; + eval { $o = $::o = install_any::loadO($o, "install/recovery.cfg"); log::l("successfully read recovery") } if $::recovery; $@ and $::recovery = 0; #- avoid keeping recovery if there was a problem reading the recovery.cfg file. #- patch should be read after defcfg in order to take precedance. eval { $o = $::o = install_any::loadO($o, $cfg); log::l("successfully read default configuration: $cfg") } if $cfg; @@ -541,7 +544,7 @@ sub main { eval { modules::load("af_packet") }; require harddrake::sound; - harddrake::sound::configure_sound_slots(); + harddrake::sound::configure_sound_slots($o->{modules_conf}); #- need to be after oo-izing $o if ($o->{brltty}) { @@ -570,11 +573,8 @@ sub main { #- needed very early for install_steps_gtk if (!$::testing) { - if ($o->{mouse}) { - mouse::load_modules($o->{mouse}); - } else { - eval { $o->{mouse} = mouse::detect() } if !$o->{nomouseprobe}; - } + eval { $o->{mouse} = mouse::detect($o->{modules_conf}) } if !$o->{mouse} && !$o->{nomouseprobe}; + mouse::load_modules($o->{mouse}); } $o->{locale}{lang} = lang::set($o->{locale}) if $o->{locale}{lang} ne 'en_US' && !$::move; #- mainly for defcfg @@ -583,17 +583,19 @@ sub main { $o->{allowFB} = listlength(cat_("/proc/fb")); - if (!$::move && !$::testing) { + if (!$::move && !$::testing && !$o->{meta_class}) { my $VERSION = cat__(install_any::getFile("VERSION")) or do { print "VERSION file missing\n"; sleep 5 }; - $::corporate = 1 if $VERSION =~ /corporate/i; - $o->{meta_class} = 'desktop' if $VERSION =~ /desktop|discovery/i; - $o->{meta_class} = 'download' if $VERSION =~ /download/i; - $o->{meta_class} = 'firewall' if $VERSION =~ /firewall/i; - $o->{meta_class} = 'server' if $VERSION =~ /server|prosuite/i; + my @classes = qw(powerpackplus powerpack desktop download server firewall); + if (my $meta_class = find { $VERSION =~ /$_/i } @classes) { + $o->{meta_class} = $meta_class; + } $o->{distro_type} = 'community' if $VERSION =~ /community/i; $o->{distro_type} = 'cooker' if $VERSION =~ /cooker/i; } $o->{meta_class} eq 'discovery' and $o->{meta_class} = 'desktop'; + $o->{meta_class} eq 'powerpackplus' and $o->{meta_class} = 'server'; + + log::l("meta_class $o->{meta_class}"); if ($::oem) { $o->{partitioning}{use_existing_root} = 1; $o->{compssListLevel} = 4; @@ -663,12 +665,12 @@ sub main { install_any::log_sizes($o); install_any::remove_advertising($o); install_any::write_fstab($o); - modules::write_conf(); + $o->{modules_conf}->write; detect_devices::install_addons($o->{prefix}); #- save recovery file if needed (ie disk style install). $o->{method} eq 'disk' and - output($o->{prefix}.any::hdInstallPath()."/Mandrake/base/recovery.cfg", install_any::g_auto_install(1)); + output($o->{prefix} . any::hdInstallPath() . '/install/recovery.cfg', install_any::g_auto_install(1)); #- mainly for auto_install's #- do not use run_program::xxx because it doesn't leave stdin/stdout unchanged |
