summaryrefslogtreecommitdiffstats
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
parentd81ea2849d44b2a76cc852b98603939d22ee2b0d (diff)
downloaddrakx-6edf51a2dbf8a11b521a1d36b3a593da594a6bcf.tar
drakx-6edf51a2dbf8a11b521a1d36b3a593da594a6bcf.tar.gz
drakx-6edf51a2dbf8a11b521a1d36b3a593da594a6bcf.tar.bz2
drakx-6edf51a2dbf8a11b521a1d36b3a593da594a6bcf.tar.xz
drakx-6edf51a2dbf8a11b521a1d36b3a593da594a6bcf.zip
handle third party modules from various devices
(at least floppy is still working :)
-rw-r--r--perl-install/install_steps.pm24
-rw-r--r--perl-install/install_steps_interactive.pm9
2 files changed, 20 insertions, 13 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);
}
#------------------------------------------------------------------------------
diff --git a/perl-install/install_steps_interactive.pm b/perl-install/install_steps_interactive.pm
index a23c6e060..49a8b026e 100644
--- a/perl-install/install_steps_interactive.pm
+++ b/perl-install/install_steps_interactive.pm
@@ -765,10 +765,11 @@ sub afterInstallPackages($) {
$o->SUPER::afterInstallPackages;
}
-sub updateModulesFromFloppy {
- my ($o) = @_;
- $o->ask_okcancel('', N("Please insert the Update Modules floppy in drive %s", $o->{updatemodules}), 1) or return;
- $o->SUPER::updateModulesFromFloppy;
+sub updatemodules {
+ my ($o, $dev, $rel_dir) = @_;
+
+ $o->ask_okcancel('', N("Please ensure the Update Modules media is in drive %s", $dev), 1) or return;
+ $o->SUPER::updatemodules($dev, $rel_dir);
}
#------------------------------------------------------------------------------