summaryrefslogtreecommitdiffstats
path: root/perl-install/install_any.pm
Commit message (Collapse)AuthorAgeFilesLines
* re-sync after the big svn lossPascal Rigaux2007-04-251-2030/+0
|
* this is redundant with: grep { modules::probe_category("multimedia/$_") } ↵Pascal Rigaux2006-03-081-1/+0
| | | | modules::sub_categories('multimedia')
* - rename DOCS to CAT_MINIMAL_DOCSPascal Rigaux2006-03-081-1/+1
| | | | | | | - cuz otherwise DOCS is a "always" flag and modifying it afterwise is useless - CAT_DOCS would be not precise enough - simplify the "changed" callback
* typo fix (#13292)Thierry Vignaud2006-01-021-1/+1
|
* (default_packages) better let rpmsrate handle ALSA packages installationThierry Vignaud2005-11-211-1/+0
|
* (default_packages) typo fixThierry Vignaud2005-11-211-1/+1
|
* install aoss too when installing ALSAThierry Vignaud2005-11-211-1/+1
|
* (is_network_install) use it whenever possibleThierry Vignaud2005-11-041-3/+2
|
* (default_packages) install powernowd on x86_64 (since they've the cool&quiet ↵Thierry Vignaud2005-10-031-0/+1
| | | | technology) and athcool on athlon32
* (default_packages) "alsa" doesn't existsThierry Vignaud2005-10-031-1/+1
|
* automatically configure DSL connection on installation from DSLOlivier Blin2005-09-161-0/+6
|
* - there is no more adverstising iconPascal Rigaux2005-09-151-5/+2
| | | | | - cleaning
* add upgrade script for conectivaPascal Rigaux2005-09-141-1/+1
|
* migrate fstab when upgrading an alien distro (should be done always?)Pascal Rigaux2005-09-131-1/+2
|
* when taking screenshot during pkgs install, we can be chrootedPascal Rigaux2005-09-131-2/+4
|
* for now, disable FTP in media_browser since we don't handle it (#16088)Pascal Rigaux2005-09-131-1/+1
|
* for local_install we don't want use_root_part to do anythingPascal Rigaux2005-09-131-0/+2
|
* silently ignore existing X config file if upgrading an alien distroPascal Rigaux2005-09-131-0/+1
|
* set META_CLASS"xxx" flagPascal Rigaux2005-09-091-0/+1
|
* have a progress bar when removing packagesPascal Rigaux2005-09-091-1/+12
|
* Remove commented codeRafael Garcia-Suarez2005-09-091-1/+0
|
* When adding http suppl media, repropose the last url entered. VeryRafael Garcia-Suarez2005-09-091-2/+7
| | | | | useful in case of typo in the url
* pass around wait_message with progress bar capabilityPascal Rigaux2005-09-091-4/+2
|
* Remove a misleading commentRafael Garcia-Suarez2005-09-061-1/+1
|
* At some point, an empty hashref is autovivified in $packages->{medium}.Rafael Garcia-Suarez2005-09-051-1/+1
| | | | | | So, protect the loops that iterate over this hash, in application of the belt and suspenders doctrine.
* Proper detection of network interface at supplementary media setupRafael Garcia-Suarez2005-09-051-1/+1
|
* - new functionality: upgrade_by_removing_pkgs, enabled when upgrading redhat ↵Pascal Rigaux2005-09-021-7/+15
| | | | | | | | | | | and conectiva distributions - add file upgrade-map.conectiva.10 for precise choice of packages - save /etc/xxx-release into /root/drakx/xxx-release.upgrading when starting - release_file(): look for xxx-release.upgrading first - find_root_parts(): better logging about upgrade_by_removing_pkgs, and factorize code - when all packages are installed, remove xxx-release.upgrading and rename pkgs::removed_pkgs_to_upgrade_file()
* move code to create_minimal_files()Pascal Rigaux2005-09-021-0/+12
|
* rename pkgs::rpmDbOpenForInstall() to pkgs::open_rpm_db_rw()Pascal Rigaux2005-09-021-1/+1
|
* opening rpm db in selectPackage(), so remove some rpmDbOpen()Pascal Rigaux2005-09-021-1/+0
|
* new function select_by_package_names()Pascal Rigaux2005-09-021-5/+2
|
* hoist things in install_anyPascal Rigaux2005-09-021-1/+9
|
* fs::format::wait_message() is now ->wait_message_with_progress_bar (on ↵Pascal Rigaux2005-09-021-1/+1
| | | | interactive objects)
* initial deployment server supportOlivier Blin2005-08-311-0/+25
|
* more precise log_size during installPascal Rigaux2005-08-261-3/+3
|
* log more precisely the "naughty servers" unselectedPascal Rigaux2005-08-181-1/+1
|
* fix typoPascal Rigaux2005-08-161-4/+4
|
* - if we have a lot of memory, keep the clp in tmpfsPascal Rigaux2005-08-101-10/+36
| | | | | | - check the size available in $::prefix/tmp for the case it's on its own filesystem (bug #15377) - also check the size available in other cases
* create clp_on_tmpfs() for future usePascal Rigaux2005-08-101-1/+2
|
* cleanupPascal Rigaux2005-08-081-1/+1
|
* move is_xbox from common to detect_devicesOlivier Blin2005-08-051-1/+1
|
* workarround problem in supplementary mediaFlorent Villard2005-07-151-0/+5
|
* Don't write ignored media in urpmi.cfg (bug 15537)Rafael Garcia-Suarez2005-07-011-1/+1
|
* use fs::type::is_dmraid()Pascal Rigaux2005-07-011-1/+1
|
* don't spawn a new shell if it's already running (useful when using the ↵Pascal Rigaux2005-07-011-1/+4
| | | | no-reboot-restart-install blino trick)
* fix typo in previous commitPascal Rigaux2005-06-301-1/+1
|
* install dmraid if neededPascal Rigaux2005-06-301-0/+1
|
* try to cleanup fs.pmPascal Rigaux2005-06-281-12/+12
| | | | | | | | | | | | | | | | | | | | | | | | (to have simpler dependencies between modules, esp. have some modules only required by diskdrake): - move some functions from fs to fs::mount (most keep their name, except mount_part and mount_usbfs) - move formatMount_part and formatMount_all from fs to fs::format - move some functions from fs to fs::wild_device (part2wild_device_name -> fs::wild_device::from_part) (subpart_from_wild_device_name -> fs::wild_device::to_subpart) (analyze_wild_device_name -> fs::wild_device::analyse) - formatMount_part(), formatMount_all(), fs::mount::part() don't take a prefix anymore the current situation was quite muddy we now rely on fs::get::mntpoint_prefixed() which will maybe depend on a field in $part for now, we mount every part in chroot, it seems to be what's wanted - fs::format::part() now expect $all_hds instead of $raids - fs::type::carryRootLoopback is now fs::get::carry_root_loopback() - in fs::loopback, most functions don't want a prefix anymore
* upcase protocol namesThierry Vignaud2005-06-281-4/+4
|
* (ask_if_suppl_media) upcase protocol nameThierry Vignaud2005-06-281-1/+1
|
b">$name, $new_option) = @_; $conf{$name}{options} = $new_option; } sub add_alias { my ($alias, $module) = @_; $module =~ /ignore/ and return; /\Q$alias/ && $conf{$_}{alias} && $conf{$_}{alias} eq $module and return $_ foreach keys %conf; log::l("adding alias $alias to $module"); $conf{$alias}{alias} ||= $module; $conf{$module}{above} = 'snd-pcm-oss' if $module =~ /^snd-/; $alias; } sub add_probeall { my ($alias, $module) = @_; my $l = $conf{$alias}{probeall} ||= []; push @$l, $module; log::l("setting probeall scsi_hostadapter to @$l"); } sub remove_alias($) { my ($name) = @_; foreach (keys %conf) { $conf{$_}{alias} && $conf{$_}{alias} eq $name or next; delete $conf{$_}{alias}; return 1; } 0; } sub read_conf { my ($file) = @_; my %c; foreach (cat_($file)) { next if /^\s*#/; my ($type, $alias, $val) = split(/\s+/, chomp_($_), 3) or next; $val = [ split ' ', $val ] if $type eq 'probeall'; $c{$alias}{$type} = $val; } #- cheating here: not handling aliases of aliases while (my ($k, $v) = each %c) { if (my $a = $v->{alias}) { local $c{$a}{alias}; delete $v->{probeall}; add2hash($c{$a}, $v); } } #- convert old aliases to new probeall foreach my $name ('scsi_hostadapter', 'usb-interface') { my @old_aliases = map { $_->[0] } sort { $a->[1] <=> $b->[1] } map { if_(/^$name(\d*)/ && $c{$_}{alias}, [ $_, $1 || 0 ]) } keys %c; foreach my $alias (@old_aliases) { push @{$c{$name}{probeall} ||= []}, delete $c{$alias}{alias}; } } \%c; } sub mergein_conf { my ($file) = @_; my $modconfref = read_conf($file); while (my ($key, $value) = each %$modconfref) { $conf{$key}{alias} = $value->{alias} if !exists $conf{$key}{alias}; push @{$conf{$key}{probeall} ||= []}, deref($value->{probeall}); } } sub write_conf { my ($prefix) = @_; my $file = "$prefix/etc/modules.conf"; rename "$prefix/etc/conf.modules", $file; #- make the switch to new name if needed #- Substitute new aliases in modules.conf (if config has changed) substInFile { my ($type,$alias,$module) = split(/\s+/, chomp_($_), 3); if ($type eq 'post-install' && $alias eq 'supermount') { #- remove the post-install supermount stuff. $_ = ''; } elsif ($type eq 'alias' && $alias =~ /scsi_hostadapter|usb-interface/) { #- remove old aliases which are replaced by probeall $_ = ''; } elsif ( $conf{$alias}{$type} && $conf{$alias}{$type} ne $module) { my $v = join(' ', uniq(deref($conf{$alias}{$type}))); $_ = "$type $alias $v\n"; } } $file; my $written = read_conf($file); local *F; open F, ">> $file" or die("cannot write module config file $file: $!\n"); while (my ($mod, $h) = each %conf) { while (my ($type, $v) = each %$h) { my $v2 = join(' ', uniq(deref($v))); print F "$type $mod $v2\n" if $v2 && !$written->{$mod}{$type}; } } my @l = (); push @l, 'scsi_hostadapter' if !is_empty_array_ref($conf{scsi_hostadapter}{probeall}); push @l, 'bttv' if grep { $_->{driver} eq 'bttv' } detect_devices::probeall(); append_to_etc_modules($prefix, @l); } sub append_to_etc_modules { my ($prefix, @l) = @_; my $l = join '|', map { '^\s*'.$_.'\s*$' } @l; log::l("to put in modules ", join(", ", @l)); substInFile { $_ = '' if $l && /$l/; $_ .= join '', map { "$_\n" } @l if eof; } "$prefix/etc/modules"; } sub read_stage1_conf { mergein_conf($_[0]); } #-############################################################################### #- pcmcia various #-############################################################################### sub configure_pcmcia { my ($pcic) = @_; #- try to setup pcmcia if cardmgr is not running. my $running if 0; return if $running; $running = 1; if (c::kernel_version() =~ /^2\.2/) { my $msg = _("PCMCIA support no longer exist for 2.2 kernels. Please use a 2.4 kernel."); log::l($msg); return $msg; } log::l("i try to configure pcmcia services"); symlink "/tmp/stage2/$_", $_ foreach "/etc/pcmcia"; eval { load("pcmcia_core"); load($pcic); load("ds"); }; #- run cardmgr in foreground while it is configuring the card. run_program::run("cardmgr", "-f", "-m" ,"/modules"); sleep(3); #- make sure to be aware of loaded module by cardmgr. read_already_loaded(); } sub write_pcmcia { my ($prefix, $pcmcia) = @_; #- should be set after installing the package above otherwise the file will be renamed. setVarsInSh("$prefix/etc/sysconfig/pcmcia", { PCMCIA => bool2yesno($pcmcia), PCIC => $pcmcia, PCIC_OPTS => "", CORE_OPTS => "", }); } #-############################################################################### #- internal functions #-############################################################################### sub loaded_modules { map { /(\S+)/ } cat_("/proc/modules"); } sub read_already_loaded { when_load($_) foreach reverse loaded_modules(); } sub when_load { my ($name, @options) = @_; my $category = module2category($name); if ($category =~ m,disk/(scsi|hardware_raid|usb),) { add_probeall('scsi_hostadapter', $name); eval { load('sd_mod') }; } add_alias('sound-slot-0', $name) if $category =~ /sound/; load('snd-pcm-oss') if $name =~ /^snd-/; add_probeall('usb-interface', $name) if $name =~ /usb-[uo]hci/ || $name eq 'ehci-hcd'; $conf{$name}{options} = join " ", @options if @options; } sub cz_file { "/lib/modules" . (arch() eq 'sparc64' && "64") . ".cz-" . c::kernel_version(); } sub extract_modules { my ($dir, @modules) = @_; my $cz = cz_file(); if (!-e $cz) { unlink $_ foreach glob_("/lib/modules*.cz*"); require install_any; install_any::getAndSaveFile("Mandrake/mdkinst$cz", $cz) or die "failed to get modules $cz: $!"; } eval { require packdrake; my $packer = new packdrake($cz, quiet => 1); $packer->extract_archive($dir, map { "$_.o" } @modules); }; } sub load_raw { my @l = @_; extract_modules('/tmp', map { $_->[0] } @l); my @failed = grep { my $m = "/tmp/$_->[0].o"; if (-e $m && run_program::run(["/usr/bin/insmod_", "insmod"], '2>', '/dev/tty5', $m, @{$_->[1]})) { unlink $m; ''; } else { log::l("missing module $_->[0]") if !-e $m; -e $m; } } @l; die "insmod'ing module " . join(", ", map { $_->[0] } @failed) . " failed" if @failed; foreach (@l) { if ($_->[0] =~ /usb-[uo]hci/) { eval { require fs; fs::mount('/proc/bus/usb', '/proc/bus/usb', 'usbdevfs'); #- ensure keyboard is working, the kernel must do the job the BIOS was doing sleep 2; load("usbkbd", "keybdev") if detect_devices::usbKeyboards(); } } } } 1;