summaryrefslogtreecommitdiffstats
path: root/perl-install/standalone/service_harddrake
Commit message (Collapse)AuthorAgeFilesLines
...
* use new set_removable_auto_configuratorThierry Vignaud2004-07-291-1/+1
|
* use do_pkgs_standalone->new instead of class_discardPascal Rigaux2004-07-211-2/+2
|
* - %modules::conf is no more a global, so many functions need passing ↵Pascal Rigaux2004-07-211-10/+10
| | | | | | | | | | | | | | | $modules_conf - $modules_conf is a class choosing modules.conf or modprobe.conf (esp. useful after install) (but not working yet!) - modules::load() doesn't use $modules_conf, use modules::load_and_configure() - modules::load() doesn't allow options, use either modules::load_raw() or modules::load_and_configure() - some functions used to want an array ref for modules options and some a string, now every functions use a string - many functions (like modules::get_alias()) are now methods on $modules_conf - some functions in mouse.pm needed a $in where a $do_pkgs is enough - some perl_checker compliance - small fixes
* modules::mergein_conf() doesn't need to be given /etc/modules.confPascal Rigaux2004-07-071-1/+1
| | | | | => prepare for reading either modprobe.conf or modules.conf based on the running kernel version
* high level explanationThierry Vignaud2004-07-061-0/+1
|
* fix logs of newly added hardwareThierry Vignaud2004-06-201-1/+1
|
* fix warningsThierry Vignaud2004-06-201-2/+2
|
* only log about nv <-> nvidia swtich only if we do have to perform itThierry Vignaud2004-06-201-4/+10
|
* fix mouse autoconfiguration done on every boot instead of on 2.4.x/2.6.xThierry Vignaud2004-06-201-1/+1
| | | | | switches
* simplify x11 autoconfThierry Vignaud2004-06-201-1/+1
|
* log error if a tool isn't executableThierry Vignaud2004-06-201-1/+5
|
* simplify globetrotter case: skip non interactive stuffThierry Vignaud2004-06-201-1/+1
|
* do not uselessy fork shellsThierry Vignaud2004-06-201-2/+2
|
* log error when we cannot run the config toolThierry Vignaud2004-06-201-1/+7
|
* faster auto mouse reconfiguration on major kernel switchThierry Vignaud2004-06-201-1/+5
|
* harddrake wasn't aware of newly added wireless network card since earlyThierry Vignaud2004-06-201-1/+1
| | | | | 2004/02
* only stop boot progressbar if there a non automatic tool to runThierry Vignaud2004-06-181-1/+1
|
* merge globetrotter support from MDK-10-branchThierry Vignaud2004-06-181-1/+4
|
* merge mouse autoreconfiguration when switching between 2.4.x and 2.6.x kernelsThierry Vignaud2004-06-181-0/+8
| | | | | from MDK-10-branch
* merge x11 autoconf support from MDK-10-branchThierry Vignaud2004-06-181-0/+4
|
* do not automatically switch from nv to nvidia (in order to handleThierry Vignaud2004-06-141-2/+2
| | | | | cases where nvidia module crashes the system)
* log removed/added hwThierry Vignaud2004-04-281-0/+3
|
* do automatic sound configuration (one can still switch between OSS andThierry Vignaud2004-04-231-0/+1
| | | | | ALSA through mcc)
* handle again timeoutsThierry Vignaud2004-04-231-1/+1
|
* do X11 configuration automagicallyThierry Vignaud2004-04-231-1/+2
|
* - when automatic flag is set for one hardware class, do not ask forThierry Vignaud2004-04-231-14/+20
| | | | | | | confirmation and just do what is needed - only show "probing in progress" message if we did run an interactive tool
* switch to new harddrake data structureThierry Vignaud2004-04-221-2/+3
|
* log nv<=>nvidia switchesThierry Vignaud2004-04-051-0/+2
|
* let execl() handle the arg array (this is safer)Thierry Vignaud2004-04-011-1/+1
|
* pass timeout parameter tooThierry Vignaud2004-04-011-1/+1
|
* enable to translate a few more messagesThierry Vignaud2004-04-011-1/+1
|
* translate "XYZ was added/removed" messagesThierry Vignaud2004-04-011-2/+2
|
* space "fix"Thierry Vignaud2004-03-291-1/+1
|
* typo fixThierry Vignaud2004-03-291-1/+1
|
* only alter xfree config if we found an nvidia cardThierry Vignaud2004-03-291-6/+7
|
* try several locationsThierry Vignaud2004-03-291-1/+1
|
* check for compressed nvidia modules tooThierry Vignaud2004-03-291-1/+1
|
* typo fixThierry Vignaud2004-03-291-1/+1
|
* switch between nv and nvidia driver if commercial driver isn't installedThierry Vignaud2004-03-241-0/+8
|
* remove /etc/asound.state *before* restarting sound serviceThierry Vignaud2004-03-171-1/+1
|
* add agpgart modules to modprobe.preload if neededThierry Vignaud2004-03-171-0/+3
|
* do not crash when detector failled (eg: when mouse detection failled becauseThierry Vignaud2004-03-011-1/+1
| | | | | | of unhandled exception on module exception b/c of unresolved symbolds b/c of gcc-3.4)
* when sound card is added/removed, delete current sound levels so that soundThierry Vignaud2004-02-251-0/+1
| | | | | service reset it to sg sane
* for removable devices, we've to remove/add them one by one, so whenThierry Vignaud2003-12-291-16/+16
| | | | | | | | several devices of the same class are removed/added, we ask if we should handle them several time. let ask confirmation once per class instead (olivier blin, #6649)
* do no ask several times the kernel to switch into verbose modeThierry Vignaud2003-12-291-1/+1
| | | | | (olivier blin)
* really display which devices were removedThierry Vignaud2003-12-291-1/+1
|
* remove net aliases if neededThierry Vignaud2003-11-141-0/+6
|
* workaround anthill bug #18 (do not overwrite sound aliases when no hardware ↵Thierry Vignaud2003-10-171-2/+5
| | | | change)
* stop bootsplash silent mode if something is detectedFlorent Villard2003-09-141-1/+2
|
* while bootstrapping, only write /etc/modules.conf only if we really altered itThierry Vignaud2003-08-261-1/+0
| | | | | (thus preventing depmod to be runned everytime)
ask_yesorno_ { my ($o, $common, $b_def) = @_; $common->{cancel} = ''; ask_from_listf_raw($o, $common, sub { translate($_[0]) }, [ N_("Yes"), N_("No") ], $b_def ? "Yes" : "No") eq "Yes"; } sub ask_okcancel_ { my ($o, $common, $b_def) = @_; if ($::isWizard) { $::no_separator = 1; $common->{focus_cancel} = !$b_def; ask_from_no_check($o, $common, []); } else { ask_from_listf_raw($o, $common, sub { translate($_[0]) }, [ $o->ok, $o->cancel ], $b_def ? $o->ok : "Cancel") eq $o->ok; } } sub ask_filename { my ($o, $common) = @_; $common->{want_a_dir} = 0; $o->ask_fileW($common); } sub ask_directory { my ($o, $common) = @_; $common->{want_a_dir} = 1; $o->ask_fileW($common); } #- predecated sub ask_file { my ($o, $title, $o_dir) = @_; $o->ask_fileW({ title => $title, want_a_dir => 0, directory => $o_dir }); } sub ask_fileW { my ($o, $common) = @_; $o->ask_from_entry($common->{title}, $common->{message} || N("Choose a file")); } sub ask_from_list { my ($o, $title, $message, $l, $o_def) = @_; ask_from_listf($o, $title, $message, undef, $l, $o_def); } sub ask_from_list_ { my ($o, $title, $message, $l, $o_def) = @_; ask_from_listf($o, $title, $message, sub { translate($_[0]) }, $l, $o_def); } sub ask_from_listf_ { my ($o, $title, $message, $f, $l, $o_def) = @_; ask_from_listf($o, $title, $message, sub { translate($f->(@_)) }, $l, $o_def); } sub ask_from_listf { my ($o, $title, $message, $f, $l, $o_def) = @_; ask_from_listf_raw($o, { title => $title, messages => $message }, $f, $l, $o_def); } sub ask_from_listf_raw { my ($_o, $_common, $_f, $l, $_o_def) = @_; @$l == 0 and die "ask_from_list: empty list\n" . backtrace(); @$l == 1 and return $l->[0]; goto &ask_from_listf_raw_no_check; } sub ask_from_listf_raw_no_check { my ($o, $common, $f, $l, $o_def) = @_; if (@$l <= ($::isWizard ? 1 : 2)) { my ($ok, $cancel) = map { $_ && may_apply($f, $_) } @$l; if (length "$ok$cancel" < 70) { my $ret = eval { put_in_hash($common, { ok => $ok, if_($cancel, cancel => $cancel, focus_cancel => $o_def eq $l->[1]) }); ask_from_no_check($o, $common, []) ? $l->[0] : $l->[1]; }; die if $@ && $@ !~ /^wizcancel/; return $@ ? undef : $ret; } } ask_from_no_check($o, $common, [ { val => \$o_def, type => 'list', list => $l, format => $f } ]) && $o_def; } sub ask_from_treelist { my ($o, $title, $message, $separator, $l, $o_def) = @_; ask_from_treelistf($o, $title, $message, $separator, undef, $l, $o_def); } sub ask_from_treelist_ { my ($o, $title, $message, $separator, $l, $o_def) = @_; my $transl = sub { join '|', map { translate($_) } split(quotemeta($separator), $_[0]) }; ask_from_treelistf($o, $title, $message, $separator, $transl, $l, $o_def); } sub ask_from_treelistf { my ($o, $title, $message, $separator, $f, $l, $o_def) = @_; ask_from($o, $title, $message, [ { val => \$o_def, separator => $separator, list => $l, format => $f, sort => 1 } ]) or return; $o_def; } sub ask_many_from_list { my ($o, $title, $message, @l) = @_; @l = grep { @{$_->{list}} } @l or return ''; foreach my $h (@l) { $h->{e}{$_} = { text => may_apply($h->{label}, $_), val => $h->{val} ? $h->{val}->($_) : do { my $i = $h->{value} ? $h->{value}->($_) : $h->{values} ? member($_, @{$h->{values}}) : 0; \$i; }, type => 'bool', help => may_apply($h->{help}, $_, ''), icon => may_apply($h->{icon2f}, $_, ''), } foreach @{$h->{list}}; if ($h->{sort}) { $h->{list} = [ sort { $h->{e}{$a}{text} cmp $h->{e}{$b}{text} } @{$h->{list}} ]; } } $o->ask_from($title, $message, [ map { my $h = $_; map { $h->{e}{$_} } @{$h->{list}} } @l ]) or return; @l = map { my $h = $_; [ grep { ${$h->{e}{$_}{val}} } @{$h->{list}} ]; } @l; wantarray() ? @l : $l[0]; } sub ask_from_entry { my ($o, $title, $message, %callback) = @_; first(ask_from_entries($o, $title, $message, [''], %callback)); } sub ask_from_entries { my ($o, $title, $message, $l, %callback) = @_; my @l = map { my $i = ''; { label => $_, val => \$i } } @$l; $o->ask_from_({ title => $title, messages => $message, callbacks => \%callback, focus_first => 1 }, \@l) or return; map { ${$_->{val}} } @l; } sub ask_from__add_modify_remove { my ($o, $title, $message, $l, %callback) = @_; die "ask_from__add_modify_remove only handles one item" if @$l != 1; $callback{$_} or internal_error("missing callback $_") foreach qw(Add Modify Remove); if ($o->can('ask_from__add_modify_removeW')) { $o->ask_from__add_modify_removeW($title, $message, $l, %callback); } else { my $e = $l->[0]; my $chosen_element; put_in_hash($e, { allow_empty_list => 1, val => \$chosen_element, type => 'list' }); while (1) { my $continue; my @l = (@$l, map { my $s = $_; { val => translate($_), clicked_may_quit => sub { my $r = $callback{$s}->($chosen_element); defined $r or return; $continue = 1; } } } N_("Add"), if_(@{$e->{list}} > 0, N_("Modify"), N_("Remove"))); $o->ask_from_({ title => $title, messages => $message, callbacks => \%callback }, \@l) or return; return 1 if !$continue; } } } #- can get a hash of callback: focus_out changed and complete #- moreove if you pass a hash with a field list -> combo #- if you pass a hash with a field hidden -> emulate stty -echo sub ask_from { my ($o, $title, $message, $l, %callback) = @_; ask_from_($o, { title => $title, messages => $message, callbacks => \%callback }, $l); } sub ask_from_normalize { my ($o, $common, $l) = @_; ref($l) eq 'ARRAY' or internal_error('ask_from_normalize'); foreach my $e (@$l) { if (my $li = $e->{list}) { ref($e->{val}) =~ /SCALAR|REF/ or internal_error($e->{val} ? "field {val} must be a reference (it is $e->{val})" : "field {val} is mandatory"); #-# if ($e->{sort} || @$li > 10 && !exists $e->{sort}) { my @l2 = map { may_apply($e->{format}, $_) } @$li; my @places = sort { $l2[$a] cmp $l2[$b] } 0 .. $#l2; $e->{list} = $li = [ map { $li->[$_] } @places ]; } $e->{type} = 'iconlist' if $e->{icon2f}; $e->{type} = 'treelist' if $e->{separator} && $e->{type} ne 'combo'; add2hash_($e, { not_edit => 1 }); $e->{type} ||= 'combo'; if (!$e->{not_edit}) { die q(when using "not_edit" you must use strings, not a data structure) if ref(${$e->{val}}) || any { ref $_ } @$li; } if ($e->{type} ne 'combo' || $e->{not_edit}) { ${$e->{val}} = $li->[0] if !member(may_apply($e->{format}, ${$e->{val}}), map { may_apply($e->{format}, $_) } @$li); } } elsif ($e->{type} eq 'range') { $e->{min} <= $e->{max} or die "bad range min $e->{min} > max $e->{max} (called from " . join(':', caller()) . ")"; ${$e->{val}} = max($e->{min}, min(${$e->{val}}, $e->{max})); } elsif ($e->{type} eq 'button' || $e->{clicked} || $e->{clicked_may_quit}) { $e->{type} = 'button'; $e->{clicked_may_quit} ||= $e->{clicked} ? sub { $e->{clicked}(); 0 } : sub {}; $e->{val} = \ (my $_v = $e->{val}) if !ref($e->{val}); } elsif ($e->{type} eq 'label' || !ref($e->{val})) { $e->{type} = 'label'; $e->{val} = \ (my $_v = $e->{val}) if !ref($e->{val}); } else { $e->{type} ||= 'entry'; } $e->{disabled} ||= sub { 0 }; } #- do not display empty lists and one element lists @$l = grep { if ($_->{list} && $_->{not_edit} && !$_->{allow_empty_list}) { if (!@{$_->{list}}) { eval { require 'log.pm'; #- "require log" causes some pb, perl thinking that "log" is the log() function log::l("ask_from_normalize: empty list for $_->{label}\n" . backtrace()); }; } @{$_->{list}} > 1; } else { 1; } } @$l; if (!$common->{title} && $::isStandalone) { ($common->{title} = $0) =~ s|.*/||; } $common->{interactive_help} ||= $o->{interactive_help}; $common->{interactive_help} ||= $common->{interactive_help_id} && $o->interactive_help_sub_get_id($common->{interactive_help_id}); $common->{advanced_label} ||= N("Advanced"); $common->{advanced_label_close} ||= N("Basic"); $common->{$_} = $common->{$_} ? [ deref($common->{$_}) ] : [] foreach qw(messages advanced_messages); add2hash_($common->{callbacks} ||= {}, { changed => sub {}, focus_out => sub {}, complete => sub { 0 }, canceled => sub { 0 }, advanced => sub {} }); } sub ask_from_ { my ($o, $common, $l) = @_; ask_from_normalize($o, $common, $l); @$l or return 1; $common->{cancel} = '' if !defined wantarray(); ask_from_real($o, $common, $l); } sub ask_from_no_check { my ($o, $common, $l) = @_; ask_from_normalize($o, $common, $l); $common->{cancel} = '' if !defined wantarray(); my ($l1, $l2) = partition { !$_->{advanced} } @$l; $o->ask_fromW($common, $l1, $l2); } sub ask_from_real { my ($o, $common, $l) = @_; my ($l1, $l2) = partition { !$_->{advanced} } @$l; my $v = $o->ask_fromW($common, $l1, $l2); foreach my $e (@$l1, @$l2) { if ($e->{type} eq 'range') { ${$e->{val}} = max($e->{min}, min(${$e->{val}}, $e->{max})); } } %$common = (); $v; } sub ask_browse_tree_info { my ($o, $title, $message, $common) = @_; $common->{interactive_help} ||= $common->{interactive_help_id} && $o->interactive_help_sub_get_id($common->{interactive_help_id}); add2hash_($common, { ok => $::isWizard ? ($::Wizard_finished ? N("Finish") : N("Next")) : N("Ok"), cancel => $::isWizard ? N("Previous") : N("Cancel") }); add2hash_($common, { title => $title, message => $message }); add2hash_($common, { grep_allowed_to_toggle => sub { @_ }, grep_unselected => sub { grep { $common->{node_state}($_) eq 'unselected' } @_ }, check_interactive_to_toggle => sub { 1 }, toggle_nodes => sub { my ($set_state, @nodes) = @_; my $new_state = !$common->{grep_unselected}($nodes[0]) ? 'selected' : 'unselected'; $set_state->($_, $new_state) foreach @nodes; }, }); $o->ask_browse_tree_info_refW($common); } sub ask_browse_tree_info_refW { #- default definition, do not use with too many items (memory consuming) my ($o, $common) = @_; my ($l, $v, $h) = ([], [], {}); $common->{build_tree}(sub { my ($node) = $common->{grep_allowed_to_toggle}(@_); if (my $state = $node && $common->{node_state}($node)) { push @$l, $node; $state eq 'selected' and push @$v, $node; $h->{$node} = $state eq 'selected'; } }, 'flat'); add2hash_($common, { list => $l, #- TODO interactivity of toggle is missing values => $v, help => sub { $common->{get_info}($_[0]) }, }); my ($new_v) = $o->ask_many_from_list($common->{title}, $common->{message}, $common) or return; $common->{toggle_nodes}(sub {}, grep { ! delete $h->{$_} } @$new_v); $common->{toggle_nodes}(sub {}, grep { $h->{$_} } keys %$h); 1; } sub wait_message { my ($o, $title, $message, $b_temp) = @_; my $w = $o->wait_messageW($title, [ N("Please wait"), deref($message) ]); push @tempory::objects, $w if $b_temp; my $b = before_leaving { $o->wait_message_endW($w) }; #- enable access through set MDK::Common::Func::add_f4before_leaving(sub { $o->wait_message_nextW([ deref($_[1]) ], $w) }, $b, 'set'); $b; } sub kill() {} sub helper_separator_tree_to_tree { my ($separator, $list, $formatted_list) = @_; my $sep = quotemeta $separator; my $tree = {}; each_index { my @l = split $sep; my $leaf = pop @l; my $node = $tree; foreach (@l) { $node = $node->{$_} ||= do { my $r = {}; push @{$node->{_order_}}, $_; $r; }; } push @{$node->{_leaves_}}, [ $leaf, $list->[$::i] ]; (); } @$formatted_list; $tree; } sub interactive_help_has_id { my ($_o, $id) = @_; exists $help::{$id}; } sub interactive_help_get_id { my ($_o, @l) = @_; @l = map { join("\n\n", map { s/\n/ /mg; $_ } split("\n\n", translate($help::{$_}->()))); } grep { exists $help::{$_} } @l; join("\n\n\n", @l); } sub interactive_help_sub_get_id { my ($o, $id) = @_; $o->interactive_help_has_id($id) && sub { $o->interactive_help_get_id($id) }; } sub interactive_help_sub_display_id { my ($o, $id) = @_; $o->interactive_help_has_id($id) && sub { $o->ask_warn(N("Help"), $o->interactive_help_get_id($id)) }; } 1;