summaryrefslogtreecommitdiffstats
path: root/perl-install/install_steps.pm
diff options
context:
space:
mode:
authorPascal Rigaux <pixel@mandriva.com>2005-04-07 16:34:33 +0000
committerPascal Rigaux <pixel@mandriva.com>2005-04-07 16:34:33 +0000
commit6edf51a2dbf8a11b521a1d36b3a593da594a6bcf (patch)
tree44169e7ef905361b05933f25155b863896e5088d /perl-install/install_steps.pm
parentd81ea2849d44b2a76cc852b98603939d22ee2b0d (diff)
downloaddrakx-backup-do-not-use-6edf51a2dbf8a11b521a1d36b3a593da594a6bcf.tar
drakx-backup-do-not-use-6edf51a2dbf8a11b521a1d36b3a593da594a6bcf.tar.gz
drakx-backup-do-not-use-6edf51a2dbf8a11b521a1d36b3a593da594a6bcf.tar.bz2
drakx-backup-do-not-use-6edf51a2dbf8a11b521a1d36b3a593da594a6bcf.tar.xz
drakx-backup-do-not-use-6edf51a2dbf8a11b521a1d36b3a593da594a6bcf.zip
handle third party modules from various devices
(at least floppy is still working :)
Diffstat (limited to 'perl-install/install_steps.pm')
-rw-r--r--perl-install/install_steps.pm24
1 files changed, 15 insertions, 9 deletions
diff --git a/perl-install/install_steps.pm b/perl-install/install_steps.pm
index 06ace7895..1493fad60 100644
--- a/perl-install/install_steps.pm
+++ b/perl-install/install_steps.pm
@@ -596,8 +596,7 @@ GridHeight=70
push @{$o->{waitpids}}, run_program::raw({ root => $o->{prefix}, detach => 1 }, "update-menus", "-n");
if ($o->{updatemodules}) {
- $o->{updatemodules} = detect_devices::floppy() or die N("No floppy drive available");
- $o->updateModulesFromFloppy;
+ $o->updatemodules($ENV{THIRDPARTY_DEVICE}, $ENV{THIRDPARTY_DIR});
}
}
@@ -613,21 +612,28 @@ sub install_urpmi {
}
}
-sub updateModulesFromFloppy {
- my ($o) = @_;
+sub updatemodules {
+ my ($_o, $dev, $rel_dir) = @_;
return if $::testing;
- fs::mount(devices::make($o->{updatemodules}), "/floppy", "ext2", 0);
+ $dev = devices::make($dev) or log::l("updatemodules: bad device $dev"), return;
+
+ my $mount_dir = '/updatemodules';
+ find {
+ eval { fs::mount($dev, $mount_dir, $_, 0); 1 };
+ } 'ext2', 'vfat' or log::l("updatemodules: can't mount $dev"), return;
+
+ my $dir = "$mount_dir$rel_dir";
foreach my $kernel_version (all("$::prefix/lib/modules")) {
log::l("examining updated modules for kernel $kernel_version");
- -d "/floppy/$kernel_version" or next;
+ -d "$dir/$kernel_version" or next;
log::l("found updatable modules");
- run_program::run("cd /floppy/$kernel_version ; find -type f | cpio -pdu $::prefix/lib/modules/$kernel_version");
+ run_program::run("cd $dir/$kernel_version ; find -type f | cpio -pdu $::prefix/lib/modules/$kernel_version");
run_program::rooted($::prefix, 'depmod', '-a', '-F', "/boot/System.map-$kernel_version", $kernel_version);
}
my $category;
- foreach (cat_('/floppy/to_load')) {
+ foreach (cat_("$dir/to_load")) {
chomp;
if (/^#/) {
($category) = $1 if /\[list_modules: (.*?)\]/;
@@ -641,7 +647,7 @@ sub updateModulesFromFloppy {
}
}
- fs::umount("/floppy");
+ fs::umount($mount_dir);
}
#------------------------------------------------------------------------------