summaryrefslogtreecommitdiffstats
path: root/perl-install/patch/patch-updatemodules.pl
blob: 382f8ff43d1bcb78b3075eb9d44a60f8bcd99887 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
use install_steps;
package install_steps;

log::l("updateModulesFromFloppy version needing the exact directories");

undef *updateModulesFromFloppy;
*updateModulesFromFloppy = sub {
    my ($o) = @_;
    return if $::testing;

    fs::mount(devices::make($o->{updatemodules}), "/floppy", "ext2", 0);
    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");
};