diff options
Diffstat (limited to 'perl-install/install_steps.pm')
-rw-r--r-- | perl-install/install_steps.pm | 39 |
1 files changed, 6 insertions, 33 deletions
diff --git a/perl-install/install_steps.pm b/perl-install/install_steps.pm index 3f44f9963..338c3f420 100644 --- a/perl-install/install_steps.pm +++ b/perl-install/install_steps.pm @@ -624,39 +624,12 @@ sub updateModulesFromFloppy { return if $::testing; fs::mount($o->{updatemodules}, "/floppy", "ext2", 0); - foreach (glob_("$o->{prefix}/lib/modules/*")) { - my ($kernelVersion) = m,lib/modules/(\S*),; - log::l("examining updated modules for kernel $kernelVersion"); - if (-d "/floppy/$kernelVersion") { - my @src_files = glob_("/floppy/$kernelVersion/*"); - my @dest_files = map { chomp_($_) } run_program::rooted_get_stdout($o->{prefix}, 'find', '/lib/modules'); - foreach my $s (@src_files) { - log::l("found updatable module $s"); - my ($sfile, $sext) = $s =~ m!([^/\.]*\.k?o)(\.gz|\.bz2)?$!; - my $qsfile = quotemeta $sfile; - my $qsext = quotemeta $sext; - foreach my $target (@dest_files) { - $target =~ /$qsfile/ or next; - $target = "$o->{prefix}/$target"; - eval { cp_af($s, $target) }; - if ($@) { - log::l("updating module $target by $s failed: $@"); - } else { - log::l("updating module $target by $s"); - } - if ($target !~ /$qsfile$qsext$/) { - #- extension differ, first rename target file correctly, - #- then uncompress source file, then compress it as expected. - my ($basetarget, $text) = $target =~ /(.*?)(\.gz|\.bz2)$/; - rename $target, "$basetarget$sext"; - $sext eq '.gz' and run_program::run("gzip", "-d", "$basetarget$sext"); - $sext eq '.bz2' and run_program::run("bzip2", "-d", "$basetarget$sext"); - $text eq '.gz' and run_program::run("gzip", $basetarget); - $text eq '.bz2' and run_program::run("bzip2", $basetarget); - } - } - } - } + foreach my $kernel_version (all("$::prefix/lib/modules")) { + log::l("examining updated modules for kernel $kernel_version"); + -d "/floppy/$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::rooted($::prefix, 'depmod', '-a', '-F', "/boot/System.map-$kernel_version", $kernel_version); } fs::umount("/floppy"); } |