diff options
-rw-r--r-- | lib/Iurt/DKMS.pm | 20 |
1 files changed, 10 insertions, 10 deletions
diff --git a/lib/Iurt/DKMS.pm b/lib/Iurt/DKMS.pm index 2c564ab..5006d9b 100644 --- a/lib/Iurt/DKMS.pm +++ b/lib/Iurt/DKMS.pm @@ -114,9 +114,9 @@ sub search_dkms { my ($module, $version, $modulesourcedir, $realmodule, $realversion, $file) = @$dkms; foreach my $k (@kernel) { my ($kernel, $modulesdir) = @$k; - plog("checking $module-kernel-$modulesdir-$realversion"); - next if $cache->{dkms}{"$module-kernel-$modulesdir-$realversion"} && !$run->{ignore_failure}; - if (!$modules{$module}{$version}{$modulesdir}) { + plog("checking $realmodule-kernel-$modulesdir-$realversion"); + next if $cache->{dkms}{"$realmodule-kernel-$modulesdir-$realversion"} && !$run->{ignore_failure}; + if (!$modules{$realmodule}{$realversion}{$modulesdir}) { my ($name, $v) = $kernel =~ /^([^-]+)-.*-(2\..*)/; my $source = "$name-$v"; if (!$kernel_source{$source}) { @@ -137,7 +137,7 @@ sub search_dkms { $nb++; push @{$run->{dkms_todo}}, [ $module, $version, $modulesourcedir, $realmodule, $realversion, $file, $kernel, $modulesdir, @{$kernel_source{$source}}, $media ]; } - $modules{$module}{$version}{$modulesdir}++; + $modules{$realmodule}{$realversion}{$modulesdir}++; } } } @@ -245,18 +245,18 @@ sub dkms_compile { # but if we just compile it for a new kernel, we need to rebuild it manually foreach my $cmd ('add', 'build') { - my $command = "TMP=/home/$luser/tmp/ sudo chroot $chroot_tmp /usr/sbin/dkms $cmd -m $name -v $realversion --rpm_safe_upgrade -k $modulesdir --kernelsourcedir=/usr/src/$sourcedir"; + my $command = "TMP=/home/$luser/tmp/ sudo chroot $chroot_tmp /usr/sbin/dkms $cmd -m $realname -v $realversion --rpm_safe_upgrade -k $modulesdir --kernelsourcedir=/usr/src/$sourcedir"; plog('DEBUG', "execute: $command"); system($command); } # now need to move dkms build if it wrongly assume a build for the running kernel - plog("search module in /var/lib/dkms/$name/$version/$kerver/"); - if (-d "$chroot_tmp/var/lib/dkms/$name/$version/$kerver/") { - system("sudo mv $chroot_tmp/var/lib/dkms/$name/$realversion/$kerver/ $chroot_tmp/var/lib/dkms/$name/$realversion/$modulesdir/"); + plog("search module in /var/lib/dkms/$realname/$realversion/$kerver/"); + if (-d "$chroot_tmp/var/lib/dkms/$realname/$realversion/$kerver/") { + system("sudo mv $chroot_tmp/var/lib/dkms/$realname/$realversion/$kerver/ $chroot_tmp/var/lib/dkms/$realname/$realversion/$modulesdir/"); } - $cache->{dkms}{"$name-kernel-$modulesdir-$realversion"} = 1; - if (system("sudo chroot $chroot_tmp /usr/sbin/dkms mkrpm -m $name -v $realversion --rpm_safe_upgrade -k $modulesdir")) { + $cache->{dkms}{"$realname-kernel-$modulesdir-$realversion"} = 1; + if (system("sudo chroot $chroot_tmp /usr/sbin/dkms mkrpm -m $realname -v $realversion --rpm_safe_upgrade -k $modulesdir")) { plog('FAIL', "build failed ($!)"); next; } |