package harddrake::autoconf; use common; sub xconf { my ($modules_conf, $o) = @_; log::l('automatic XFree configuration'); require Xconfig::default; require do_pkgs; my $do_pkgs = do_pkgs_standalone->new; $o->{raw_X} = Xconfig::default::configure($do_pkgs); require Xconfig::main; Xconfig::main::configure_everything_auto_install($o->{raw_X}, $do_pkgs, {}, { allowFB => listlength(cat_("/proc/fb")) }); #- always disable compositing desktop effects when configuring a new video card require Xconfig::glx; Xconfig::glx::write({}); modules::load_category($modules_conf, 'various/agpgart'); } sub network_conf { my ($obj) = @_; require network::network; network::network::easy_dhcp($obj->{net}, $obj->{modules_conf}); } sub mouse_conf { my ($modules_conf) = @_; require do_pkgs; require mouse; mouse::write_conf(do_pkgs_standalone->new, $modules_conf, my $mouse = mouse::detect($modules_conf), 1); mouse::load_modules($mouse); } sub pcmcia { my ($pcic) = @_; require modules; modules::set_preload_modules("pcmcia", if_($pcic, $pcic)); } sub bluetooth { my ($enable) = @_; #- FIXME: make sure these packages are installed when needed # if ($enable) { # require do_pkgs; # my $do_pkgs = do_pkgs_standalone->new; # $do_pkgs->ensure_is_installed("bluez-utils", "/usr/bin/rfcomm"); # } require services; services::set_status("bluetooth", $enable); my $kbluetoothd_cfg = '/etc/kde/kbluetoothrc'; update_gnomekderc($kbluetoothd_cfg, 'General', 'AutoStart' => bool2text($enable)) if -f $kbluetoothd_cfg; } sub laptop { my ($on_laptop) = @_; #- FIXME: make sure these packages are installed when needed # require do_pkgs; # my $do_pkgs = do_pkgs_standalone->new; # if ($on_laptop) { # $do_pkgs->ensure_is_installed("cpufreq", "/etc/rc.d/init.d/cpufreq"); # $do_pkgs->ensure_is_installed("apmd", "/usr/bin/apm"); # $do_pkgs->ensure_is_installed("hotkeys", "/usr/bin/hotkeys"); # $do_pkgs->ensure_is_installed("laptop-mode-tools", "/usr/sbin/laptop_mode"); # } else { # $do_pkgs->ensure_is_installed("numlock", "/etc/rc.d/init.d/numlock"); # } require services; services::set_status("apmd", -e "/proc/apm"); services::set_status("cpufreq", $on_laptop); services::set_status("apmd", $on_laptop); services::set_status("laptop-mode", $on_laptop); services::set_status("numlock", !$on_laptop); } sub cpufreq() { require cpufreq; modules::set_preload_modules("cpufreq", cpufreq::get_modules()); } sub floppy() { require detect_devices; modules::set_preload_modules("floppy", if_(detect_devices::floppy(), "floppy")); } sub fix_aliases { my ($modules_conf) = @_; require modalias; my %new_aliases; #- first pass: find module targets whose modalias is not valid anymore foreach my $module ($modules_conf->modules) { if (my $aliased_to = $modules_conf->get_alias($module)) { my @valid_modaliases = modalias::get_modules($module, 'skip_config') or next; my ($found, $others) = partition { $_ eq $aliased_to } @valid_modaliases; $new_aliases{$aliased_to} = @{$others || []} == 1 && $others->[0] if is_empty_array_ref($found); } } #- second pass: adapt module targets that are not valid anymore foreach my $module ($modules_conf->modules) { if (my $aliased_to = $modules_conf->get_alias($module)) { if (my $new = exists $new_aliases{$aliased_to} && $new_aliases{$aliased_to}) { $modules_conf->set_alias($module, $new); } else { $modules_conf->remove_alias($module); } } } $modules_conf->write; } 1; _64-branch'>topic/x86_64-branch Mageia Installer and base platform for many utilitiesThierry Vignaud [tv]
summaryrefslogtreecommitdiffstats
path: root/perl-install/steps.pm
blob: 6ec51ebe1b89789b47ca18f45395d92d24e499b8 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
package steps;

use strict;
use vars qw(%installSteps @orderedInstallSteps);
use common;

#-######################################################################################
#- Steps table
#-######################################################################################
{
    my @installStepsFields = qw(text redoable onError hidden needs); 
    #entered reachable toBeDone next done;
    my @installSteps = (
  selectLanguage     => [ N_("Language"), 1, 1, '', '' ],
  acceptLicense      => [ N_("License"), 1, -1, '', '' ],
  selectMouse        => [ N_("Configure mouse"), 1, 1, '1', '' ],
  setupSCSI          => [ N_("Hard drive detection"), 1, 0, '1', '' ],
  selectInstallClass => [ N_("Select installation class"), 1, 1, '1', '' ],
  selectKeyboard     => [ N_("Choose your keyboard"), 1, 1, '1' ],
  miscellaneous      => [ N_("Security"), 1, 1, '', '' ],
  doPartitionDisks   => [ N_("Partitioning"), 1, 0, '', "selectInstallClass" ],
  formatPartitions   => [ N_("Format partitions"), 1, -1, '1', "doPartitionDisks" ],
  choosePackages     => [ N_("Choose packages to install"), 1, -2, '1', "formatPartitions" ],
  installPackages    => [ N_("Install system"), 1, -1, '', ["formatPartitions", "selectInstallClass"] ],
  setRootPassword    => [ N_("Administrator password"), 1, 1, '', "installPackages" ],
  addUser            => [ N_("Add a user"), 1, 1, '', "installPackages" ],
  configureNetwork   => [ N_("Configure networking"), 1, 1, '1', "formatPartitions" ],
  setupBootloader    => [ N_("Install bootloader"), 1, 0, '', "installPackages" ],
  configureX         => [ N_("Configure X"), 1, 1, '1', ["formatPartitions", "setupBootloader"] ],
  summary            => [ N_("Summary"), 1, 0, '', "installPackages" ],
  configureServices  => [ N_("Configure services"), 1, 1, '1', "installPackages" ],
  installUpdates     => [ N_("Install updates"), 1, 1, '',  ["installPackages", "configureNetwork", "summary"] ],
  exitInstall        => [ N_("Exit install"), 0, 0, '', '' ],
);
    for (my $i = 0; $i < @installSteps; $i += 2) {
	my %h; @h{@installStepsFields} = @{ $installSteps[$i + 1] };
	$h{entered} = 0;
	$h{onError} = $installSteps[$i + 2 * $h{onError}];
	$h{reachable} = !$h{needs};
	$installSteps{$installSteps[$i]} = \%h;
	push @orderedInstallSteps, $installSteps[$i];
    }
    $installSteps{first} = $installSteps[0];
}


1;