diff options
author | Pascal Rigaux <pixel@mandriva.com> | 2004-12-21 11:28:57 +0000 |
---|---|---|
committer | Pascal Rigaux <pixel@mandriva.com> | 2004-12-21 11:28:57 +0000 |
commit | 68830f224661c15349199961a9ab1b05ef85d2e2 (patch) | |
tree | aab90c96372093a050ec73cd5ac3095a7597badb /perl-install/install_steps.pm | |
parent | a901b76faa10b814145b8fffd27d27cf5c6f7439 (diff) | |
download | drakx-68830f224661c15349199961a9ab1b05ef85d2e2.tar drakx-68830f224661c15349199961a9ab1b05ef85d2e2.tar.gz drakx-68830f224661c15349199961a9ab1b05ef85d2e2.tar.bz2 drakx-68830f224661c15349199961a9ab1b05ef85d2e2.tar.xz drakx-68830f224661c15349199961a9ab1b05ef85d2e2.zip |
much simpler code to handle post-install update modules
- it handles new modules
- it calls depmod
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"); } |